From 09b7714598aaae9991e685c12776f59909c1e8ae Mon Sep 17 00:00:00 2001 From: bierett Date: Mon, 9 Dec 2024 10:06:42 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20preview=20for=20PR=20377=20?= =?UTF-8?q?=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pr-previews/pr-377/assets/1BI1b7D_asS4.js | 2 + .../{DnYPVZQRsXfx.js => 2C0geDG_OBHU.js} | 2 +- .../{DbBkdn6FNbgs.js => B60Dx_GOYdnk.js} | 2 +- .../pr-previews/pr-377/assets/B6P_btgblpGb.js | 1 - .../{C520TGz1zAm6.js => BFY0X3gkqjoN.js} | 2 +- .../{BSXAw6dYwqdy.js => BFqpayjr3qWr.js} | 2 +- .../pr-previews/pr-377/assets/BKR6R-cAnIXt.js | 1 + .../{CJwLdrVebURZ.js => BLfEaHvmX9OI.js} | 2 +- .../{BHV5vl3sU07-.js => BMNhf717kFFK.js} | 2 +- .../{jRJMM4_GqJDc.js => BWf1FusGPLsb.js} | 2 +- .../{B_KTQkWPSzAO.js => BXfBNJYYR7xb.js} | 2 +- .../{CLzYDcnWEay-.js => BYONkh1IVI5I.js} | 2 +- .../{BCfEYGqoP6pv.js => BgefHtPAQ8E-.js} | 2 +- .../pr-previews/pr-377/assets/BkcX60-fpzHn.js | 1 - .../{DjAArQ67Dgmx.js => BlACKGYldMfy.js} | 2 +- .../{CCXTS-icusD6.js => BpQSjk0kyblh.js} | 2 +- .../pr-previews/pr-377/assets/BxannLiVc7Kn.js | 1 - .../{CLvK5IJfz41Q.js => C1CVOge1__u2.js} | 2 +- .../{35mnA9_wxNJd.js => C9VJq5Ka7299.js} | 2 +- .../pr-previews/pr-377/assets/CFax2WnWeOWk.js | 1 - .../pr-previews/pr-377/assets/CG5nmvkyugDn.js | 1 + .../pr-previews/pr-377/assets/CI5dqHk8x18v.js | 1 + .../pr-previews/pr-377/assets/CKwKePgRpvKf.js | 1 - .../pr-previews/pr-377/assets/CL68Tre-iuri.js | 1 - .../{Ca8Zt9kwahLC.js => CMfwYEDRd35m.js} | 2 +- .../{oqYRsmCvbYjm.js => CY0UlXoH4bZI.js} | 2 +- .../{Djes_egHqOHx.js => CYroAbEI2PyD.js} | 2 +- .../pr-previews/pr-377/assets/CZ0KYiWqoLMD.js | 19 ---- .../{VXuNJBviGPoL.js => CbxgmwRI74qQ.js} | 6 +- .../pr-previews/pr-377/assets/Cy4dgg1WoJEA.js | 1 - .../pr-previews/pr-377/assets/DIOfOjAL_o1F.js | 1 + .../pr-previews/pr-377/assets/DOBi0XXIQOue.js | 1 - .../{nEjnOjKmH1UU.js => DSjrbd_eKbZM.js} | 8 +- .../{BTgBaMxcW6XT.js => DgGf7HG5MNJv.js} | 2 +- .../pr-previews/pr-377/assets/DjS5-7IPlotu.js | 1 + .../{Ch2CPfq1SbGd.js => Dko_2nwYwIor.js} | 2 +- .../pr-previews/pr-377/assets/Dlj8U5klui5y.js | 1 + .../pr-previews/pr-377/assets/Do0wXWKIsHnp.js | 1 + .../pr-previews/pr-377/assets/DyxVjgSvwe-K.js | 20 ---- .../pr-previews/pr-377/assets/Fvn-TvW_dbjq.js | 2 - .../pr-previews/pr-377/assets/WUfcarXw4YPE.js | 19 ++++ .../{CR6SzAtaFOeK.js => __kfMbro-lod.js} | 6 +- .../{D8JwQmCkwKBk.js => ajAX9OmvUsbZ.js} | 2 +- .../{BUqsBljB9Wju.js => cFp2KtAGHfQy.js} | 2 +- .../pr-previews/pr-377/assets/j0mck_Meu7Xh.js | 92 +++++++++++++++++++ .../{Znh2j7vplK2r.js => jI8ea5EYTjZP.js} | 2 +- .../pr-previews/pr-377/assets/pazOBFR22sbz.js | 1 + .../{zAWMMVSLb5Gc.js => uQ1goSLJpXIo.js} | 2 +- .../{CwYOJLhODXKJ.js => vepZWq5kkQUw.js} | 2 +- .../samples/experimental-sidebar/index.html | 14 +-- .../pr-377/samples/map-sample/index.html | 48 +++++----- .../pr-377/samples/ogc-api-sample/index.html | 36 ++++---- .../pr-377/samples/showcase/index.html | 46 +++++----- .../samples/test-basemap-switcher/index.html | 22 ++--- .../test-highlight-and-zoom/index.html | 16 ++-- .../pr-377/samples/test-menu-fix/index.html | 16 ++-- .../samples/test-printing-api/index.html | 16 ++-- .../samples/test-result-list/index.html | 26 +++--- .../pr-377/samples/test-toc/index.html | 34 +++---- 59 files changed, 292 insertions(+), 220 deletions(-) create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/1BI1b7D_asS4.js rename openlayers-base-packages/pr-previews/pr-377/assets/{DnYPVZQRsXfx.js => 2C0geDG_OBHU.js} (98%) rename openlayers-base-packages/pr-previews/pr-377/assets/{DbBkdn6FNbgs.js => B60Dx_GOYdnk.js} (99%) delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/B6P_btgblpGb.js rename openlayers-base-packages/pr-previews/pr-377/assets/{C520TGz1zAm6.js => BFY0X3gkqjoN.js} (60%) rename openlayers-base-packages/pr-previews/pr-377/assets/{BSXAw6dYwqdy.js => BFqpayjr3qWr.js} (95%) create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/BKR6R-cAnIXt.js rename openlayers-base-packages/pr-previews/pr-377/assets/{CJwLdrVebURZ.js => BLfEaHvmX9OI.js} (97%) rename openlayers-base-packages/pr-previews/pr-377/assets/{BHV5vl3sU07-.js => BMNhf717kFFK.js} (84%) rename openlayers-base-packages/pr-previews/pr-377/assets/{jRJMM4_GqJDc.js => BWf1FusGPLsb.js} (97%) rename openlayers-base-packages/pr-previews/pr-377/assets/{B_KTQkWPSzAO.js => BXfBNJYYR7xb.js} (86%) rename openlayers-base-packages/pr-previews/pr-377/assets/{CLzYDcnWEay-.js => BYONkh1IVI5I.js} (99%) rename openlayers-base-packages/pr-previews/pr-377/assets/{BCfEYGqoP6pv.js => BgefHtPAQ8E-.js} (80%) delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/BkcX60-fpzHn.js rename openlayers-base-packages/pr-previews/pr-377/assets/{DjAArQ67Dgmx.js => BlACKGYldMfy.js} (79%) rename openlayers-base-packages/pr-previews/pr-377/assets/{CCXTS-icusD6.js => BpQSjk0kyblh.js} (67%) delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/BxannLiVc7Kn.js rename openlayers-base-packages/pr-previews/pr-377/assets/{CLvK5IJfz41Q.js => C1CVOge1__u2.js} (98%) rename openlayers-base-packages/pr-previews/pr-377/assets/{35mnA9_wxNJd.js => C9VJq5Ka7299.js} (84%) delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/CFax2WnWeOWk.js create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/CG5nmvkyugDn.js create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/CI5dqHk8x18v.js delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/CKwKePgRpvKf.js delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/CL68Tre-iuri.js rename openlayers-base-packages/pr-previews/pr-377/assets/{Ca8Zt9kwahLC.js => CMfwYEDRd35m.js} (70%) rename openlayers-base-packages/pr-previews/pr-377/assets/{oqYRsmCvbYjm.js => CY0UlXoH4bZI.js} (87%) rename openlayers-base-packages/pr-previews/pr-377/assets/{Djes_egHqOHx.js => CYroAbEI2PyD.js} (92%) delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/CZ0KYiWqoLMD.js rename openlayers-base-packages/pr-previews/pr-377/assets/{VXuNJBviGPoL.js => CbxgmwRI74qQ.js} (96%) delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/Cy4dgg1WoJEA.js create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/DIOfOjAL_o1F.js delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/DOBi0XXIQOue.js rename openlayers-base-packages/pr-previews/pr-377/assets/{nEjnOjKmH1UU.js => DSjrbd_eKbZM.js} (91%) rename openlayers-base-packages/pr-previews/pr-377/assets/{BTgBaMxcW6XT.js => DgGf7HG5MNJv.js} (88%) create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/DjS5-7IPlotu.js rename openlayers-base-packages/pr-previews/pr-377/assets/{Ch2CPfq1SbGd.js => Dko_2nwYwIor.js} (58%) create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/Dlj8U5klui5y.js create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/Do0wXWKIsHnp.js delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/DyxVjgSvwe-K.js delete mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/Fvn-TvW_dbjq.js create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/WUfcarXw4YPE.js rename openlayers-base-packages/pr-previews/pr-377/assets/{CR6SzAtaFOeK.js => __kfMbro-lod.js} (99%) rename openlayers-base-packages/pr-previews/pr-377/assets/{D8JwQmCkwKBk.js => ajAX9OmvUsbZ.js} (90%) rename openlayers-base-packages/pr-previews/pr-377/assets/{BUqsBljB9Wju.js => cFp2KtAGHfQy.js} (96%) create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/j0mck_Meu7Xh.js rename openlayers-base-packages/pr-previews/pr-377/assets/{Znh2j7vplK2r.js => jI8ea5EYTjZP.js} (82%) create mode 100644 openlayers-base-packages/pr-previews/pr-377/assets/pazOBFR22sbz.js rename openlayers-base-packages/pr-previews/pr-377/assets/{zAWMMVSLb5Gc.js => uQ1goSLJpXIo.js} (96%) rename openlayers-base-packages/pr-previews/pr-377/assets/{CwYOJLhODXKJ.js => vepZWq5kkQUw.js} (60%) diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/1BI1b7D_asS4.js b/openlayers-base-packages/pr-previews/pr-377/assets/1BI1b7D_asS4.js new file mode 100644 index 0000000..e5344d2 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/1BI1b7D_asS4.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__kfMbro-lod.js","./CmsKOCeNyeyo.js","./DSjrbd_eKbZM.js","./B60Dx_GOYdnk.js","./j0mck_Meu7Xh.js","./BpQSjk0kyblh.js","./vepZWq5kkQUw.js","./C9VJq5Ka7299.js","./2C0geDG_OBHU.js"])))=>i.map(i=>d[i]); +var Qt=Object.defineProperty;var Ye=r=>{throw TypeError(r)};var es=(r,e,t)=>e in r?Qt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var y=(r,e,t)=>es(r,typeof e!="symbol"?e+"":e,t),Ae=(r,e,t)=>e.has(r)||Ye("Cannot "+t);var _=(r,e,t)=>(Ae(r,e,"read from private field"),t?t.call(r):e.get(r)),x=(r,e,t)=>e.has(r)?Ye("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),b=(r,e,t,s)=>(Ae(r,e,"write to private field"),s?s.call(r,t):e.set(r,t),t),te=(r,e,t)=>(Ae(r,e,"access private method"),t);import{aE as ts,b7 as ss,b8 as ns,b9 as is,aP as rs,aX as os,ba as as,bb as ls,J as cs,bc as ds,bd as us,be as hs,bf as gs,bg as St,bh as fs,bi as ms,a as ee,b as Fe,aL as ve,bj as Je,bk as K,a9 as Xe,G as T,bl as Ne,a_ as Z,an as Ze,bm as pe,p as P,bn as A,bo as Qe,bp as F,bq as Se,br as ps,bs as ys,z as _s,bt as De,bu as vs,bv as Ss,bw as xt,ao as wt,bx as xs,by as ws,bz as et,bA as bs,bB as tt,bC as Ms,bD as st,j as R,r as Be,a$ as $e,bE as bt,bF as Es,b0 as Cs,f as Ue,u as z,aZ as B,i as $,b4 as Ps,b3 as Le,bG as Fs,am as xe,bH as Ls,bI as Is,c as we,ax as ie,F as Re,C as Ts,bJ as nt,bK as As,bL as it,k as rt}from"./j0mck_Meu7Xh.js";import{h as We,u as Mt,o as Et,l as Ct,j as u,g as G,s as Ns,t as Os,r as p,v as se,w as ot,x as js,y as ks,z as Ds,c as fe,d as Pt,B as L,C as at,b as Ft,D as Rs,G as Gs,i as Lt,H as It,V as Vs,q as Hs,I as Bs}from"./B60Dx_GOYdnk.js";import{G as Tt,i as $s}from"./CYroAbEI2PyD.js";import{a as Us}from"./BWf1FusGPLsb.js";import{D as At,S as Ws,I as zs,c as Ks,a as qs}from"./C1CVOge1__u2.js";import{u as H}from"./BpQSjk0kyblh.js";import{u as U,c as k,s as Nt}from"./DSjrbd_eKbZM.js";import{T as Q,L as Ys}from"./BKR6R-cAnIXt.js";import{c as Ot}from"./BlACKGYldMfy.js";import{L as Ge}from"./ajAX9OmvUsbZ.js";import{u as jt,F as be}from"./vepZWq5kkQUw.js";import{F as Me}from"./Dko_2nwYwIor.js";import{H as Ve}from"./BFY0X3gkqjoN.js";import{F as Js}from"./2C0geDG_OBHU.js";import{_ as Xs}from"./CmsKOCeNyeyo.js";import{s as Zs}from"./CbxgmwRI74qQ.js";const ze=We(function(e,t){const{htmlSize:s,...n}=e,i=Mt("Input",n),a=Et(n),o=jt(a),l=Ct("chakra-input",e.className);return u.jsx(G.input,{size:s,...o,__css:i.field,ref:t,className:l})});ze.displayName="Input";ze.id="Input";const kt=We(function(e,t){const{children:s,placeholder:n,className:i,...a}=e;return u.jsxs(G.select,{...a,ref:t,className:Ct("chakra-select",i),children:[n&&u.jsx("option",{value:"",children:n}),s]})});kt.displayName="SelectField";const Ke=We((r,e)=>{const t=Mt("Select",r),{rootProps:s,placeholder:n,icon:i,color:a,height:o,h:l,minH:d,minHeight:c,iconColor:g,iconSize:h,...f}=Et(r),[m,v]=Zs(f,Ns),S=jt(v),I={width:"100%",height:"fit-content",position:"relative",color:a},N={paddingEnd:"2rem",...t.field,_focus:{zIndex:"unset",...t.field?._focus}};return u.jsxs(G.div,{className:"chakra-select__wrapper",__css:I,...m,...s,children:[u.jsx(kt,{ref:e,height:l??o,minH:d??c,placeholder:n,...S,__css:N,children:r.children}),u.jsx(Dt,{"data-disabled":Os(S.disabled),...(g||a)&&{color:g||a},__css:t.icon,...h&&{fontSize:h},children:i})]})});Ke.displayName="Select";const Qs=r=>u.jsx("svg",{viewBox:"0 0 24 24",...r,children:u.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),en=G("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Dt=r=>{const{children:e=u.jsx(Qs,{}),...t}=r,s=p.cloneElement(e,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return u.jsx(en,{...t,className:"chakra-select__icon-wrapper",children:p.isValidElement(e)?s:null})};Dt.displayName="SelectIcon";function tn(r,e){const t=r??"bottom";return{"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[t]?.[e]??t}function sn(r,e){const t=n=>({...e,...n,position:tn(n?.position??e?.position,r)}),s=n=>{const i=t(n),a=js(i);return se.notify(a,i)};return s.update=(n,i)=>{se.update(n,t(i))},s.promise=(n,i)=>{const a=s({...i.loading,status:"loading",duration:null});n.then(o=>s.update(a,{status:"success",duration:5e3,...ot(i.success,o)})).catch(o=>s.update(a,{status:"error",duration:5e3,...ot(i.error,o)}))},s.closeAll=se.closeAll,s.close=se.close,s.isActive=se.isActive,s}function nn(r){const{theme:e}=ks(),t=Ds();return p.useMemo(()=>sn(e.direction,{...t,...r}),[r,e.direction,t])}const M={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class Ie extends ts{constructor(e){super(),this.on,this.once,this.un,this.options=e,this.id=e.id,this.insertFirst=e.insertFirst!==void 0?e.insertFirst:!0,this.stopEvent=e.stopEvent!==void 0?e.stopEvent:!0,this.element=document.createElement("div"),this.element.className=e.className!==void 0?e.className:"ol-overlay-container "+ss,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=e.autoPan===!0?{}:e.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(M.ELEMENT,this.handleElementChanged),this.addChangeListener(M.MAP,this.handleMapChanged),this.addChangeListener(M.OFFSET,this.handleOffsetChanged),this.addChangeListener(M.POSITION,this.handlePositionChanged),this.addChangeListener(M.POSITIONING,this.handlePositioningChanged),e.element!==void 0&&this.setElement(e.element),this.setOffset(e.offset!==void 0?e.offset:[0,0]),this.setPositioning(e.positioning||"top-left"),e.position!==void 0&&this.setPosition(e.position)}getElement(){return this.get(M.ELEMENT)}getId(){return this.id}getMap(){return this.get(M.MAP)||null}getOffset(){return this.get(M.OFFSET)}getPosition(){return this.get(M.POSITION)}getPositioning(){return this.get(M.POSITIONING)}handleElementChanged(){ns(this.element);const e=this.getElement();e&&this.element.appendChild(e)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),is(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const e=this.getMap();if(e){this.mapPostrenderListenerKey=rs(e,os.POSTRENDER,this.render,this),this.updatePixelPosition();const t=this.stopEvent?e.getOverlayContainerStopEvent():e.getOverlayContainer();this.insertFirst?t.insertBefore(this.element,t.childNodes[0]||null):t.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(e){this.set(M.ELEMENT,e)}setMap(e){this.set(M.MAP,e)}setOffset(e){this.set(M.OFFSET,e)}setPosition(e){this.set(M.POSITION,e)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(e){const t=this.getMap();if(!t||!t.getTargetElement()||!this.get(M.POSITION))return;const s=this.getRect(t.getTargetElement(),t.getSize()),n=this.getElement(),i=this.getRect(n,[as(n),ls(n)]);e=e||{};const a=e.margin===void 0?20:e.margin;if(!cs(s,i)){const o=i[0]-s[0],l=s[2]-i[2],d=i[1]-s[1],c=s[3]-i[3],g=[0,0];if(o<0?g[0]=o-a:l<0&&(g[0]=Math.abs(l)+a),d<0?g[1]=d-a:c<0&&(g[1]=Math.abs(c)+a),g[0]!==0||g[1]!==0){const h=t.getView().getCenterInternal(),f=t.getPixelFromCoordinateInternal(h);if(!f)return;const m=[f[0]+g[0],f[1]+g[1]],v=e.animation||{};t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(m),duration:v.duration,easing:v.easing})}}}getRect(e,t){const s=e.getBoundingClientRect(),n=s.left+window.pageXOffset,i=s.top+window.pageYOffset;return[n,i,n+t[0],i+t[1]]}setPositioning(e){this.set(M.POSITIONING,e)}setVisible(e){this.rendered.visible!==e&&(this.element.style.display=e?"":"none",this.rendered.visible=e)}updatePixelPosition(){const e=this.getMap(),t=this.getPosition();if(!e||!e.isRendered()||!t){this.setVisible(!1);return}const s=e.getPixelFromCoordinate(t),n=e.getSize();this.updateRenderedPosition(s,n)}updateRenderedPosition(e,t){const s=this.element.style,n=this.getOffset(),i=this.getPositioning();this.setVisible(!0);const a=Math.round(e[0]+n[0])+"px",o=Math.round(e[1]+n[1])+"px";let l="0%",d="0%";i=="bottom-right"||i=="center-right"||i=="top-right"?l="-100%":(i=="bottom-center"||i=="center-center"||i=="top-center")&&(l="-50%"),i=="bottom-left"||i=="bottom-center"||i=="bottom-right"?d="-100%":(i=="center-left"||i=="center-center"||i=="center-right")&&(d="-50%");const c=`translate(${l}, ${d}) translate(${a}, ${o})`;this.rendered.transform_!=c&&(this.rendered.transform_=c,s.transform=c)}getOptions(){return this.options}}const Zi=ds,lt=0,re=1,ct=[0,0,0,0],q=[],Oe={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class je extends wt{constructor(e,t,s){super(e),this.features=t,this.mapBrowserEvent=s}}class rn extends us{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:hs,this.defaultDeleteCondition_=function(s){return gs(s)&&St(s)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:fs,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new ms,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new ee({source:new Fe({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:an(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new ve(this.source_.getFeatures()),this.source_.addEventListener(Je.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Je.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(K.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(K.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}addFeature_(e){const t=e.getGeometry();if(t){const n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}const s=this.getMap();s&&s.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(s.getCoordinateFromPixel(this.lastPixel_)),e.addEventListener(Xe.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ve;const s=this.featuresBeingModified_.getArray();for(let n=0,i=t.length;n=0;--n){const i=s[n];for(let a=this.dragSegments_.length-1;a>=0;--a)this.dragSegments_[a][0]===i&&this.dragSegments_.splice(a,1);t.remove(i)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){const s=t.getCoordinates(),n={feature:e,geometry:t,segment:[s,s]};this.rBush_.insert(t.getExtent(),n)}writeMultiPointGeometry_(e,t){const s=t.getCoordinates();for(let n=0,i=s.length;ni));const t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],s=[],n=[];for(let i=0,a=this.dragSegments_.length;i=0;--i)this.insertVertex_(s[i],n);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const s=this.dragSegments_[t][0],n=s.geometry;if(n.getType()==="Circle"){const i=n,a=i.getCenter(),o=s.featureSegments[0],l=s.featureSegments[1];o.segment[0]=a,o.segment[1]=a,l.segment[0]=a,l.segment[1]=a,this.rBush_.update(Ne(a),o);let d=i;this.rBush_.update(d.getExtent(),l)}else this.rBush_.update(T(s.segment),s)}return this.featuresBeingModified_&&(this.dispatchEvent(new je(Oe.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.coordinate)}handlePointerAtPixel_(e){const t=this.getMap(),s=t.getPixelFromCoordinate(e);t.getView().getProjection();const n=function(o,l){return dt(e,o)-dt(e,l)};let i,a;if(this.hitDetection_){const o=typeof this.hitDetection_=="object"?l=>l===this.hitDetection_:void 0;t.forEachFeatureAtPixel(s,(l,d,c)=>{c&&c.getType()==="Point"&&(c=new Ze(Se(c.getCoordinates())));const g=c||l.getGeometry();if(g&&g.getType()==="Point"&&l instanceof Z&&this.features_.getArray().includes(l)){a=g;const h=l.getGeometry().getFlatCoordinates().slice(0,2);i=[{feature:l,geometry:a,segment:[h,h]}]}return!0},{layerFilter:o})}if(!i){const o=ps(Ne(e,ct)),l=t.getView().getResolution()*this.pixelTolerance_,d=ys(_s(o,l,ct));i=this.rBush_.getInExtent(d)}if(i&&i.length>0){const o=i.sort(n)[0],l=o.segment;let d=ut(e,o);const c=t.getPixelFromCoordinate(d);let g=Qe(s,c);if(a||g<=this.pixelTolerance_){const h={};if(h[P(l)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-e[0],this.delta_[1]=d[1]-e[1]),o.geometry.getType()==="Circle"&&o.index===re)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[o.feature],[o.geometry],this.snappedToVertex_);else{const f=t.getPixelFromCoordinate(l[0]),m=t.getPixelFromCoordinate(l[1]),v=De(c,f),S=De(c,m);g=Math.sqrt(Math.min(v,S)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(d=v>S?l[1]:l[0]),this.createOrUpdateVertexFeature_(d,[o.feature],[o.geometry],this.snappedToVertex_);const I={};I[P(o.geometry)]=!0;for(let N=1,w=i.length;Ns.getType()==="Circle"||s.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(T([e])).some(({segment:s})=>A(s[0],e)||A(s[1],e))}removePoint(e){if(e&&(e=F(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=pe.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_.map(([n])=>n));const s=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new je(Oe.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,s}return!1}removeVertex_(){const e=this.dragSegments_,t={};let s=!1,n,i,a,o,l,d,c,g,h,f,m;for(l=e.length-1;l>=0;--l)a=e[l],f=a[0],m=P(f.feature),f.depth&&(m+="-"+f.depth.join("-")),m in t||(t[m]={}),a[1]===0?(t[m].right=f,t[m].index=f.index):a[1]==1&&(t[m].left=f,t[m].index=f.index+1);for(m in t){switch(h=t[m].right,c=t[m].left,d=t[m].index,g=d-1,c!==void 0?f=c:f=h,g<0&&(g=0),o=f.geometry,i=o.getCoordinates(),n=i,s=!1,o.getType()){case"MultiLineString":i[f.depth[0]].length>2&&(i[f.depth[0]].splice(d,1),s=!0);break;case"LineString":i.length>2&&(i.splice(d,1),s=!0);break;case"MultiPolygon":n=n[f.depth[1]];case"Polygon":n=n[f.depth[0]],n.length>4&&(d==n.length-1&&(d=0),n.splice(d,1),s=!0,d===0&&(n.pop(),n.push(n[0]),g=n.length-1));break}if(s){this.setGeometryCoordinates_(o,i);const v=[];if(c!==void 0&&(this.rBush_.remove(c),v.push(c.segment[0])),h!==void 0&&(this.rBush_.remove(h),v.push(h.segment[1])),c!==void 0&&h!==void 0){const S={depth:f.depth,feature:f.feature,geometry:f.geometry,index:g,segment:v};this.rBush_.insert(T(S.segment),S)}this.updateSegmentIndices_(o,d,f.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return s}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(s=>s.getType()==="Circle"||s.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(T([e])).some(({segment:s})=>!(A(s[0],e)||A(s[1],e)))}insertPoint(e){const t=e?F(e,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((n,i)=>n||this.insertVertex_(i,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,s,n){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(s===void 0||i.depth===void 0||vs(i.depth,s))&&i.index>t&&(i.index+=n)})}}function on(r,e){return r.index-e.index}function dt(r,e,t){const s=e.geometry;if(s.getType()==="Circle"){let i=s;if(e.index===re){const a=De(i.getCenter(),F(r)),o=Math.sqrt(a)-i.getRadius();return o*o}}const n=F(r);return q[0]=F(e.segment[0]),q[1]=F(e.segment[1]),xs(n,q)}function ut(r,e,t){const s=e.geometry;if(s.getType()==="Circle"&&e.index===re)return Se(s.getClosestPoint(F(r)));const n=F(r);return q[0]=F(e.segment[0]),q[1]=F(e.segment[1]),Se(Ss(n,q))}function an(){const r=xt();return function(e,t){return r.Point}}const ln={SELECT:"select"};class cn extends wt{constructor(e,t,s,n){super(e),this.selected=t,this.deselected=s,this.mapBrowserEvent=n}}const ye={};class Rt extends ws{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=e.condition?e.condition:St,this.addCondition_=e.addCondition?e.addCondition:et,this.removeCondition_=e.removeCondition?e.removeCondition:et,this.toggleCondition_=e.toggleCondition?e.toggleCondition:bs,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:tt,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style!==void 0?e.style:dn(),this.features_=e.features||new ve;let t;if(e.layers)if(typeof e.layers=="function")t=e.layers;else{const s=e.layers;t=function(n){return s.includes(n)}}else t=tt;this.layerFilter_=t,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[P(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[P(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(K.ADD,this.boundAddFeature_),this.features_.addEventListener(K.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(K.ADD,this.boundAddFeature_),this.features_.removeEventListener(K.REMOVE,this.boundRemoveFeature_))}addFeature_(e){const t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){const s=this.getMap().getAllLayers().find(function(n){if(n instanceof ee&&n.getSource()&&n.getSource().hasFeature(t))return n});s&&this.addFeatureLayerAssociation_(t,s)}}removeFeature_(e){this.style_&&this.restorePreviousStyle_(e.element)}getStyle(){return this.style_}applySelectedStyle_(e){const t=P(e);t in ye||(ye[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(e){const t=this.getMap().getInteractions().getArray();for(let n=t.length-1;n>=0;--n){const i=t[n];if(i!==this&&i instanceof Rt&&i.getStyle()&&i.getFeatures().getArray().lastIndexOf(e)!==-1){e.setStyle(i.getStyle());return}}const s=P(e);e.setStyle(ye[s]),delete ye[s]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[P(e)]}handleEvent(e){if(!this.condition_(e))return!0;const t=this.addCondition_(e),s=this.removeCondition_(e),n=this.toggleCondition_(e),i=!t&&!s&&!n,a=e.map,o=this.getFeatures(),l=[],d=[];if(i){Ms(this.featureLayerAssociation_),a.forEachFeatureAtPixel(e.pixel,(c,g)=>{if(!(!(c instanceof Z)||!this.filter_(c,g)))return this.addFeatureLayerAssociation_(c,g),d.push(c),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let c=o.getLength()-1;c>=0;--c){const g=o.item(c),h=d.indexOf(g);h>-1?d.splice(h,1):(o.remove(g),l.push(g))}d.length!==0&&o.extend(d)}else{a.forEachFeatureAtPixel(e.pixel,(c,g)=>{if(!(!(c instanceof Z)||!this.filter_(c,g)))return(t||n)&&!o.getArray().includes(c)?(this.addFeatureLayerAssociation_(c,g),d.push(c)):(s||n)&&o.getArray().includes(c)&&(l.push(c),this.removeFeatureLayerAssociation_(c)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let c=l.length-1;c>=0;--c)o.remove(l[c]);o.extend(d)}return(d.length>0||l.length>0)&&this.dispatchEvent(new cn(ln.SELECT,d,l,e)),!0}}function dn(){const r=xt();return st(r.Polygon,r.LineString),st(r.GeometryCollection,r.LineString),function(e){return e.getGeometry()?r[e.getGeometry().getType()]:null}}async function un(r,e,t,s){const i=s.getCode().replace("EPSG:","http://www.opengis.net/def/crs/EPSG/0/"),a=await r.fetch(e,{method:"POST",body:JSON.stringify({type:"Feature",properties:{},geometry:t}),headers:{"Content-Type":"application/geo+json; charset=utf-8","Content-Crs":`<${i}>`}});if(!a||!a.ok||a.status!==201)throw new Error("Request failed: "+a.status);const o=a.headers.get("location");if(!o)throw new Error("Request failed: no Location response header");const l=o.substring(o.lastIndexOf("/")+1);return Promise.resolve(l)}async function hn(r,e,t,s,n){const a=n.getCode().replace("EPSG:","http://www.opengis.net/def/crs/EPSG/0/"),o=new URL(`${e.toString()}/${t}`),l=await r.fetch(o,{method:"PATCH",body:JSON.stringify({type:"Feature",properties:{},geometry:s}),headers:{"Content-Type":"application/geo+json; charset=utf-8","Content-Crs":`<${a}>`}});if(!l||!l.ok||l.status!==204)throw new Error("Request failed: "+l.status);return Promise.resolve(t)}function Gt(r,e){const t=document.createElement("div");t.className="editing-tooltip editing-tooltip-hidden",t.role="tooltip";const s=document.createElement("span");s.textContent=e,t.appendChild(s);const n=new Ie({element:t,offset:[15,0],positioning:"center-left"}),i=r.on("pointermove",a=>{a.dragging||n.setPosition(a.coordinate)});return r.addOverlay(n),{destroy(){R(i),r.removeOverlay(n)},setVisible(a){t.classList.toggle("editing-tooltip-hidden",!a)},setText(a){s.textContent=a}}}function Vt(r){let e=ht(r.polygon);Array.isArray(e)&&(e=e[0]);let t=ht(r.vertex);Array.isArray(t)&&(t=t[0]);const s=[];return e&&s.push(e),t&&(t.setGeometry(gn),s.push(t)),s}const gn=r=>{if(r){const e=r.getGeometry();if(e&&e.getType()==="Polygon"){const t=e.getCoordinates()[0];if(t)return new Us(t)}}},ht=r=>{const e=new Z,s=new ee({style:r}).getStyleFunction();if(!s)throw new Error("can't retrieve style function");const n=s(e,1);if(!n)throw new Error("can't retrieve styles from feature style function");return Array.isArray(n)&&n.length?n.length>1?n:n[0]:n},fn=fe("editing:EditingCreateWorkflowImpl");var D;class mn{constructor(e){x(this,D);y(this,"_httpService");y(this,"_intl");y(this,"_map");y(this,"_polygonStyle");y(this,"_vertexStyle");y(this,"_state");y(this,"_editLayerURL");y(this,"_featureId");y(this,"_editingSource");y(this,"_editingLayer");y(this,"_drawInteraction");y(this,"_olMap");y(this,"_tooltip");y(this,"_enterHandler");y(this,"_escapeHandler");y(this,"_error");y(this,"_interactionListener");y(this,"_mapListener");this._httpService=e.httpService,this._intl=e.intl,this._polygonStyle=e.polygonStyle,this._vertexStyle=e.vertexStyle,this._map=e.map,this._olMap=e.map.olMap,this._state=Be("active:initialized"),this._editLayerURL=e.ogcApiFeatureLayerUrl,this._editingSource=new Fe,this._editingLayer=new ee({source:this._editingSource,zIndex:$e,properties:{name:"editing-layer"}}),this._drawInteraction=new At({source:this._editingSource,type:"Polygon",style:Vt({polygon:this._polygonStyle,vertex:this._vertexStyle})}),this._tooltip=Gt(this._olMap,this._intl.formatMessage({id:"create.tooltip.begin"})),this._enterHandler=t=>{if((t.code==="Enter"||t.code==="NumpadEnter")&&t.target===this._olMap.getTargetElement()){const s=this._drawInteraction.getOverlay().getSource()?.getFeatures()??[];s[0]&&s[0].getGeometry().getCoordinates()[0].length>4&&this.triggerSave()}},this._escapeHandler=t=>{t.code==="Escape"&&t.target===this._olMap.getTargetElement()&&this.reset()},this._interactionListener=[],this._mapListener=[],this._start()}getDrawInteraction(){return this._drawInteraction}getState(){return this._state.value}_setState(e){this._state.value=e}_save(e){this._setState("active:saving");const t=this._editLayerURL,s=e.getGeometry();if(!s){this._destroy(),this._error=new Error("no geometry available"),_(this,D)?.reject(this._error);return}const n=this._olMap.getView().getProjection(),a=new Tt({dataProjection:n}).writeGeometryObject(s,{rightHanded:!0,decimals:10});this._olMap.removeInteraction(this._drawInteraction),this._tooltip.destroy(),un(this._httpService,t,a,n).then(o=>{this._featureId=o,this._destroy(),_(this,D)?.resolve({featureId:this._featureId})}).catch(o=>{fn.error(o),this._destroy(),this._error=new Error("Failed to save feature",{cause:o}),_(this,D)?.reject(this._error)})}_start(){this._olMap.addLayer(this._editingLayer),this._olMap.addInteraction(this._drawInteraction);const e=bt(()=>{const n=this._map.container;if(n)return n.addEventListener("keydown",this._enterHandler,!1),n.addEventListener("keydown",this._escapeHandler,!1),()=>{n.removeEventListener("keydown",this._enterHandler),n.removeEventListener("keydown",this._escapeHandler)}});this._tooltip.setVisible(!0);const t=this._drawInteraction.on("drawstart",()=>{this._setState("active:drawing"),this._tooltip.setText(this._intl.formatMessage({id:"create.tooltip.continue"}))}),s=this._drawInteraction.on("drawend",n=>{const i=n.feature;if(!i){this._destroy(),this._error=new Error("no feature available"),_(this,D)?.reject(this._error);return}this._save(i)});this._interactionListener.push(t,s),this._mapListener.push(e)}reset(){this._drawInteraction.abortDrawing(),this._tooltip.setText(this._intl.formatMessage({id:"create.tooltip.begin"})),this._setState("active:initialized")}stop(){this._destroy(),_(this,D)?.resolve(void 0)}_destroy(){this._olMap.removeLayer(this._editingLayer),this._olMap.removeInteraction(this._drawInteraction),this._tooltip.destroy(),this._interactionListener.forEach(e=>{R(e)}),this._mapListener.forEach(e=>{e.destroy()}),this._setState("destroyed")}triggerSave(){this._drawInteraction.finishDrawing()}whenComplete(){return this._state.value==="destroyed"?this._error?Promise.reject(this._error):this._featureId?Promise.resolve({featureId:this._featureId}):Promise.resolve(void 0):(_(this,D)??b(this,D,Pt())).promise}}D=new WeakMap;var O;class pn{constructor(e){x(this,O);y(this,"_httpService");y(this,"_intl");y(this,"_map");y(this,"_polygonStyle");y(this,"_vertexStyle");y(this,"_state");y(this,"_editLayerURL");y(this,"_featureId");y(this,"_initialFeature");y(this,"_editFeature");y(this,"_editingSource");y(this,"_editingLayer");y(this,"_modifyInteraction");y(this,"_olMap");y(this,"_tooltip");y(this,"_enterHandler");y(this,"_escapeHandler");y(this,"_error");y(this,"_interactionListener");y(this,"_mapListener");this._httpService=e.httpService,this._intl=e.intl,this._polygonStyle=e.polygonStyle,this._vertexStyle=e.vertexStyle,this._map=e.map,this._olMap=e.map.olMap,this._state=Be("active:initialized"),this._editLayerURL=e.ogcApiFeatureLayerUrl,this._initialFeature=e.feature.clone(),this._initialFeature.setId(e.feature.getId()),this._editFeature=e.feature.clone(),this._editFeature.setId(e.feature.getId()),this._editFeature.setStyle(Vt({polygon:this._polygonStyle,vertex:this._vertexStyle})),this._editingSource=new Fe({features:new ve([this._editFeature])}),this._editingLayer=new ee({source:this._editingSource,zIndex:$e,properties:{name:"editing-layer"}}),this._modifyInteraction=new rn({source:this._editingSource}),this._tooltip=Gt(this._olMap,this._intl.formatMessage({id:"create.tooltip.deselect"})),this._enterHandler=t=>{if((t.code==="Enter"||t.code==="NumpadEnter")&&t.target===this._olMap.getTargetElement()){const s=this._editingSource.getFeatures()[0];if(!s)throw Error("no updated feature found");this._save(s)}},this._escapeHandler=t=>{t.code==="Escape"&&t.target===this._olMap.getTargetElement()&&this.reset()},this._interactionListener=[],this._mapListener=[],this._start()}getModifyInteraction(){return this._modifyInteraction}getState(){return this._state.value}_setState(e){this._state.value=e}_save(e){this._setState("active:saving");const t=this._editLayerURL;if(this._featureId=e.getId()?.toString(),!this._featureId){this._destroy(),this._error=new Error("no feature id available"),_(this,O)?.reject(this._error);return}const s=e?.getGeometry();if(!s){this._destroy(),this._error=new Error("no geometry available"),_(this,O)?.reject(this._error);return}const n=this._olMap.getView().getProjection(),a=new Tt({dataProjection:n}).writeGeometryObject(s,{rightHanded:!0,decimals:10});this._olMap.removeInteraction(this._modifyInteraction),this._tooltip.destroy(),hn(this._httpService,t,this._featureId,a,n).then(o=>{this._destroy(),_(this,O)?.resolve({featureId:o})}).catch(o=>{this._destroy(),this._error=new Error("Failed to save feature",{cause:o}),_(this,O)?.reject(this._error)})}_start(){this._olMap.addLayer(this._editingLayer),this._olMap.addInteraction(this._modifyInteraction);const e=this._editingSource.getFeatures()[0];if(e&&!e.getId()?.toString()){this._destroy(),this._error=new Error("no feature id available"),_(this,O)?.reject(this._error);return}const t=bt(()=>{const i=this._map.container;if(i)return i.addEventListener("keydown",this._enterHandler,!1),i.addEventListener("keydown",this._escapeHandler,!1),()=>{i.removeEventListener("keydown",this._enterHandler),i.removeEventListener("keydown",this._escapeHandler)}});this._tooltip.setVisible(!0);const s=this._map.olMap.on("click",i=>{const a=i.coordinate,o=i.originalEvent.altKey,l=this._editingSource.getFeaturesAtCoordinate(a);o||l.length===0&&this.triggerSave()}),n=this._modifyInteraction.on("modifystart",()=>{this._setState("active:drawing")});this._interactionListener.push(s,n),this._mapListener.push(t)}reset(){const e=this._initialFeature.getGeometry()?.clone(),t=this._editingSource.getFeatures()[0];if(!t)throw Error("no updated feature found");t.setGeometry(e),this._setState("active:initialized")}stop(){this._destroy(),_(this,O)?.resolve(void 0)}_destroy(){this._editingSource.clear(),this._olMap.removeLayer(this._editingLayer),this._olMap.removeInteraction(this._modifyInteraction),this._tooltip.destroy(),this._interactionListener.forEach(e=>{R(e)}),this._mapListener.forEach(e=>{e.destroy()}),this._setState("destroyed")}triggerSave(){const e=this._editingSource.getFeatures()[0];if(!e)throw Error("no updated feature found");this._save(e)}whenComplete(){return this._state.value==="destroyed"?this._error?Promise.reject(this._error):this._featureId?Promise.resolve({featureId:this._featureId}):Promise.resolve(void 0):(_(this,O)??b(this,O,Pt())).promise}}O=new WeakMap;class Qi{_serviceOptions;_workflows;constructor(e){this._serviceOptions=e,this._workflows=new Map}createFeature(e,t){if(!t||!e||!e.id)throw new Error("Map, mapId or url is undefined.");const s=e.id;let n=this._workflows.get(s);if(n)throw new Error("EditingWorkflow could not be started. EditingWorkflow already in progress for this map.");return n=new mn({map:e,ogcApiFeatureLayerUrl:t,polygonStyle:this._serviceOptions.properties.polygonStyle,vertexStyle:this._serviceOptions.properties.vertexStyle,httpService:this._serviceOptions.references.httpService,intl:this._serviceOptions.intl}),this._workflows.set(s,n),this._connectToWorkflowDestroyEvent(n,s),n}updateFeature(e,t,s){if(!t||!e||!e.id)throw new Error("Map, mapId or url is undefined.");const n=e.id;let i=this._workflows.get(n);if(i)throw new Error("EditingWorkflow could not be started. EditingWorkflow already in progress for this map.");return i=new pn({map:e,ogcApiFeatureLayerUrl:t,feature:s,polygonStyle:this._serviceOptions.properties.polygonStyle,vertexStyle:this._serviceOptions.properties.vertexStyle,httpService:this._serviceOptions.references.httpService,intl:this._serviceOptions.intl}),this._workflows.set(n,i),this._connectToWorkflowDestroyEvent(i,n),i}stop(e){const t=this._workflows.get(e);t&&t.stop()}reset(e){const t=this._workflows.get(e);if(t)t.reset();else throw new Error("No workflow found for mapId: "+e)}_connectToWorkflowDestroyEvent(e,t){const s=Es(()=>[e.getState()],([n])=>{n==="destroyed"&&(this._workflows.get(t)===e&&this._workflows.delete(t),s.destroy())})}}var W,V,oe,ae,le,He;class yn{constructor(e,t,s){x(this,le);y(this,"label");x(this,W,Be({kind:"available"}));x(this,V);x(this,oe);x(this,ae);this.label=t,b(this,V,e),b(this,ae,s),te(this,le,He).call(this),b(this,oe,_(this,V).on("change:visible",()=>{te(this,le,He).call(this)}))}destroy(){R(_(this,oe))}get status(){return _(this,W).value}async select(e,t){if(e.type!=="extent")throw new Error(`Unsupported selection kind: ${e.type}`);if(_(this,W).value.kind!=="available"||_(this,V).getSource()===null)return[];const s=[];_(this,V).getSource().forEachFeatureIntersectingExtent(e.extent,a=>{if(!a.getGeometry())return;const o={...a.getProperties()};delete o.geometries;const l={id:a.getId()?.toString()||Cs(),geometry:a.getGeometry(),properties:o};s.push(l)});const n=s.filter(a=>a!=null);return n.length>t.maxResults?n.slice(0,t.maxResults):n}}W=new WeakMap,V=new WeakMap,oe=new WeakMap,ae=new WeakMap,le=new WeakSet,He=function(){const t=_(this,V).getVisible()?{kind:"available"}:{kind:"unavailable",reason:_(this,ae)};t.kind!==_(this,W).value.kind&&(_(this,W).value=t)};var ce;class er{constructor({intl:e}){x(this,ce);b(this,ce,e)}createSelectionSource(e){return new yn(e.vectorLayer,e.label,_(this,ce).formatMessage({id:"layerNotVisibleReason"}))}}ce=new WeakMap;const _n="@open-pioneer/notifier",vn=Ue.bind(void 0,_n),Sn=Ot({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),Ht=Ot({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),xn=!1;function tr(r){const{position:e="top-right"}=r,t=nn(),s=vn("notifier.NotificationService"),[n,i]=p.useState(!xn),a=H(l=>{const d=l.level==="error"?u.jsx(Ht,{h:"100%",w:"100%"}):void 0;t({position:e,title:l.title,description:l.message||null,status:l.level,isClosable:!0,duration:l.displayDuration??null,icon:d})}),o=H(()=>{t.closeAll()});return p.useEffect(()=>{const l=s.registerHandler({showNotification:a,closeAll:o});return()=>l.destroy()},[n,s,a,o]),u.jsx(u.Fragment,{})}const wn="@open-pioneer/coordinate-viewer",bn=z.bind(void 0,wn),Mn=4,En="decimal",sr=r=>{const{precision:e,displayProjectionCode:t,format:s}=r,{containerProps:n}=B("coordinate-viewer",r),{map:i}=$(r),a=i?.olMap,o=U(()=>i?.projection.getCode()??"",[i]);let{coordinates:l}=Pn(a);l=l&&t?Ln(l,o,t):l;const d=Cn(l,e,s),c=t||o,g=d?d+" "+c:"";return u.jsx(L,{...n,children:u.jsx(Q,{className:"coordinate-viewer-text",children:g})})};function Cn(r,e,t){const s=bn();return r?Fn(r,e,s,t):""}function Pn(r){const[e,t]=p.useState();return p.useEffect(()=>{if(!r)return;const s=r.on("pointermove",n=>{t(n.coordinate)});return()=>R(s)},[r]),{coordinates:e}}function Fn(r,e,t,s){if(r[0]==null||r[1]==null)return"";const n=e??Mn,i=s??En,[a,o]=r;let l;if(i==="degree"&&isFinite(a)&&isFinite(o)){const[d,c,g]=gt(a,t,n),[h,f,m]=gt(o,t,n),v=`${Math.abs(d)}°${c}'${g}"${0<=d?"(E)":"(W)"}`,S=`${Math.abs(h)}°${f}'${m}"${0<=h?"(N)":"(S)"}`;l=v+" "+S}else{const d=t.formatNumber(a,{maximumFractionDigits:n,minimumFractionDigits:n}),c=t.formatNumber(o,{maximumFractionDigits:n,minimumFractionDigits:n});l=d+" "+c}return l}function gt(r,e,t){const s=Math.floor(r),n=r-s,i=Math.floor(60*n),o=60*(60*n-i),l=e.formatNumber(o,{maximumFractionDigits:t,minimumFractionDigits:t});return[s,i,l]}function Ln(r,e,t){return Ps(r,e,t)}const nr=r=>{const{displayMode:e="line"}=r,{containerProps:t}=B("scale-bar",r),{map:s}=$(r),n=p.useRef(null);return p.useEffect(()=>{if(n.current&&s){const i=s.olMap,a=new Ws({units:"metric",target:n.current,bar:e==="bar"});return i.addControl(a),()=>{i.removeControl(a)}}},[e,s]),u.jsx(L,{...t,ref:n})},In="@open-pioneer/scale-viewer",Tn=z.bind(void 0,In),ir=r=>{const{containerProps:e}=B("scale-viewer",r),{map:t}=$(r),s=Tn(),n=U(()=>t?.scale??1,[t]),i=n?s.formatNumber(n):void 0;return u.jsx(L,{...e,children:i&&u.jsxs(Q,{children:["1:",i]})})},An="@open-pioneer/legend",Bt=z.bind(void 0,An),rr=r=>{const{showBaseLayers:e=!1}=r,{containerProps:t}=B("legend",r),{map:s}=$(r);return u.jsx(L,{...t,children:s?u.jsx(Nn,{map:s,showBaseLayers:e}):null})};function Nn(r){const{map:e,showBaseLayers:t}=r,n=jn(e).map(i=>u.jsx($t,{layer:i,showBaseLayers:t},i.id));return u.jsx(Ys,{as:"ul",className:"legend-layer-list",listStyleType:"none",spacing:2,children:n})}function $t(r){const{layer:e,showBaseLayers:t}=r,s=U(()=>e.visible,[e]),n=kn(e);if(!s||!t&&$s(e)&&Ut(e))return;const i=[];return n?.length&&n.forEach(a=>{i.push(u.jsx($t,{layer:a,showBaseLayers:t},a.id))}),u.jsxs(u.Fragment,{children:[u.jsx(On,{layer:e,showBaseLayers:t}),i]})}function On(r){const e=Bt(),{layer:t,showBaseLayers:s}=r,n=Ut(t),i=Dn(t),a=U(()=>t.legend,[t]);let o;return i?.Component?o=u.jsx(i.Component,{layer:t}):i?.imageUrl?o=u.jsx(ft,{layer:t,imageUrl:i.imageUrl}):a&&(o=u.jsx(ft,{layer:t,imageUrl:a})),o?u.jsxs(L,{as:"li",className:Le("legend-item",`layer-${Rn(t.id)}`),children:[s&&n?u.jsx(Q,{as:"b",children:e.formatMessage({id:"basemapLabel"})}):null,o]}):void 0}function ft(r){const e=Bt(),{layer:t,imageUrl:s}=r;return u.jsxs(L,{children:[u.jsx(Q,{children:t.title}),u.jsx(zs,{maxW:"none",maxH:"none",src:s,alt:e.formatMessage({id:"altLabel"},{layerName:t.title}),className:"legend-item__image",fallbackStrategy:"onError",fallback:u.jsx(L,{children:u.jsxs(Q,{children:[u.jsx(Ht,{me:2}),e.formatMessage({id:"fallbackLabel"})]})})})]})}function jn(r){return U(()=>{const e=r.layers.getAllLayers({sortByDisplayOrder:!0})??[];return e.reverse(),e},[r])}function kn(r){return U(()=>{const e=r.sublayers?.getSublayers({sortByDisplayOrder:!0});if(e)return e.reverse(),e},[r])}function Dn(r){return U(()=>r.attributes.legend,[r])}function Ut(r){return!("parentLayer"in r)&&r.isBaseLayer}function Rn(r){return r.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}const Gn="@open-pioneer/measurement",Vn=z.bind(void 0,Gn);class Hn{olMap;messages;activeFeatureStyle;layer;source;draw=void 0;activeMeasurement;predefinedMeasurements=new Map;finishedMeasurements=new Set;helpTooltip;resources=[];measurementChangedHandler;constructor(e,t){this.olMap=e,this.messages=t;const s=this.source=new Fe;this.layer=new ee({source:s,zIndex:$e,properties:{name:"measurement-layer"}}),e.addLayer(this.layer);const n=e.on("pointermove",this.handlePointerMove.bind(this));this.resources.push({destroy(){R(n)}});const i=()=>{this.helpTooltip.element.classList.add("hidden")};e.getViewport().addEventListener("mouseout",i),this.resources.push({destroy(){e.getViewport().removeEventListener("mouseout",i)}}),this.helpTooltip=$n(this.olMap)}destroy(){this.stopMeasurement();for(const e of this.resources)e.destroy();this.resources=[],this.activeMeasurement=at(this.activeMeasurement);for(const e of this.finishedMeasurements)e.destroy();this.finishedMeasurements.clear(),this.helpTooltip.destroy(),this.olMap.removeLayer(this.layer),this.layer.dispose(),this.source.dispose(),this.measurementChangedHandler=void 0,this.predefinedMeasurements.clear()}getVectorLayer(){return this.layer}setFinishedFeatureStyle(e){this.layer.setStyle(e)}setMeasurementSourceChangedHandler(e){this.measurementChangedHandler=e}setPredefinedMeasurements(e){this.updatePredefinedMeasurements(e)}setActiveFeatureStyle(e){const t=Fs(e);this.activeFeatureStyle=(s,...n)=>{const i=s?.getGeometry()?.getType();if(i==="Polygon"||i==="LineString"||i==="Point")return t(s,...n)},this.draw?.getOverlay().setStyle(this.activeFeatureStyle)}clearMeasurements(){const e=this.source.getFeatures();this.source.clear(),e.forEach(t=>{this.raiseMeasurementsChangeEvent("remove-measurement",t)}),this.predefinedMeasurements.clear();for(const t of this.finishedMeasurements)t.destroy();this.finishedMeasurements.clear()}startMeasurement(e){if(this.draw)throw new Error("Internal error: another measurement interaction is still active.");const t=e==="area"?"Polygon":"LineString",s=this.draw=new At({source:this.source,type:t,style:this.activeFeatureStyle});this.olMap.addInteraction(s);let n,i;s.on("drawstart",a=>{const o=a.feature;o&&(n=this.activeMeasurement=new mt("active",o,this),i=o.getGeometry()?.on("change",()=>{n?.updateTooltipContent(),n?.updateTooltipPosition()}))}),s.on("drawend",()=>{if(n&&n===this.activeMeasurement){const a=n;a.updateState("finished"),this.finishedMeasurements.add(a),this.raiseMeasurementsChangeEvent("add-measurement",a.feature),this.activeMeasurement=n=void 0}n=void 0,i&&R(i)}),s.on("drawabort",()=>{n&&(n.destroy(),n===this.activeMeasurement&&(this.activeMeasurement=void 0),n=void 0),i&&R(i)})}stopMeasurement(){this.draw&&(this.olMap.removeInteraction(this.draw),this.draw.abortDrawing(),this.draw.dispose(),this.draw=void 0),this.activeMeasurement=at(this.activeMeasurement)}handlePointerMove(e){if(e.dragging)return;const t=this.helpTooltip,s=Wn(this.messages,this.activeMeasurement);t.setText(s),t.overlay.setPosition(e.coordinate),t.element.classList.remove("hidden")}updatePredefinedMeasurements(e){const t=e.filter(n=>!this.predefinedMeasurements.has(n)),s=[];for(const n of this.predefinedMeasurements.keys())e.includes(n)||s.push(n);t.forEach(n=>{const i=new Z(n);this.source.addFeature(i);const a=new mt("finished",i,this);this.finishedMeasurements.add(a),this.predefinedMeasurements.set(n,a),this.raiseMeasurementsChangeEvent("add-measurement",i)}),s.forEach(n=>{const i=this.predefinedMeasurements.get(n);i&&(this.source.removeFeature(i.feature),this.finishedMeasurements.delete(i),i.destroy(),this.raiseMeasurementsChangeEvent("remove-measurement",i.feature)),this.predefinedMeasurements.delete(n)})}raiseMeasurementsChangeEvent(e,t){const s=t.getGeometry();this.measurementChangedHandler&&s&&this.measurementChangedHandler({kind:e,geometry:(s instanceof xe,s)})}}class mt{controller;feature;_state;tooltip;constructor(e,t,s){this.controller=s,this._state=e,this.feature=t,this.tooltip=Un(this.olMap),this.updateTooltipContent(),this.updateTooltipPosition(),this.tooltip.setActive(e==="active")}destroy(){this.tooltip.destroy()}get state(){return this._state}updateState(e){this._state!==e&&(this._state=e,this.tooltip.setActive(e==="active"))}updateTooltipContent(){const e=this.feature.getGeometry();if(!e)return;const t=this.olMap.getView().getProjection();let s;e instanceof xe?s=zn(e,t,this.messages):e instanceof Ge&&(s=Kn(e,t,this.messages)),s&&this.tooltip.setHtml(s)}updateTooltipPosition(){const e=this.feature.getGeometry();if(!e)return;let t;if(e instanceof xe)t=e.getInteriorPoint().getCoordinates()||null;else if(e instanceof Ge)t=e.getLastCoordinate()||null;else return;this.tooltip.overlay.setPosition(t)}get olMap(){return this.controller.olMap}get messages(){return this.controller.messages}}const pt=[0,-15],Bn=[0,-7];function $n(r){const e=document.createElement("div");e.className="measurement-tooltip printing-hide hidden",e.role="tooltip";const t=document.createElement("span");e.appendChild(t);const s=new Ie({element:e,offset:[15,0],positioning:"center-left"});return r.addOverlay(s),{overlay:s,element:e,destroy(){r.removeOverlay(s)},setText(n){t.textContent=n},setHtml(n){t.innerHTML=n}}}function Un(r){const e=document.createElement("div");e.role="tooltip",e.className="measurement-tooltip measurement-active-tooltip printing-hide";const t=document.createElement("span");e.appendChild(t);const s=new Ie({element:e,offset:pt,positioning:"bottom-center",stopEvent:!1,insertFirst:!1});return r.addOverlay(s),{overlay:s,element:e,destroy(){r.removeOverlay(s)},setActive(n){n?(e.className="measurement-tooltip measurement-active-tooltip printing-hide",s.setOffset(pt)):(e.className="measurement-tooltip measurement-finished-tooltip",s.setOffset(Bn))},setText(n){t.textContent=n},setHtml(n){t.innerHTML=n}}}function Wn(r,e){if(e){const t=e.feature.getGeometry();if(t instanceof xe||t instanceof Ge)return r.getContinueMessage()}return r.getHelpMessage()}function zn(r,e,t){const s=Ls(r,{projection:e});let n;return s>=1e6?n=`${t.formatNumber(s/1e6)} km2`:n=`${t.formatNumber(s)} m2`,n}function Kn(r,e,t){const s=Is(r,{projection:e});let n;return s>=1e3?n=`${t.formatNumber(s/1e3)} km`:n=`${t.formatNumber(s)} m`,n}const or=r=>{const e=Vn(),{containerProps:t}=B("measurement",r),[s,n]=p.useState("distance"),i=c=>e.formatMessage({id:c}),a=$(r),o=qn(a.map,r,e);p.useEffect(()=>{if(o)return o.startMeasurement(s),()=>{o.stopMeasurement()}},[o,s]);function l(c){if(c==="distance"||c==="area")n(c);else throw new Error(`Unexpected measurement type: '${c}'.`)}function d(){o?.clearMeasurements()}return u.jsxs(L,{...t,children:[u.jsx(Q,{mb:3,children:e.formatMessage({id:"measurementInfoText"})}),u.jsx(be,{mb:4,alignItems:"center",children:u.jsxs(Ve,{mb:2,children:[u.jsx(Me,{mb:1,children:i("measurementLabel")}),u.jsxs(Ke,{value:s,onChange:c=>l(c.target.value),className:"measurement-select",children:[u.jsx("option",{value:"distance",children:i("distance")}),u.jsx("option",{value:"area",children:i("area")})]})]})}),u.jsx(Ft,{padding:2,className:"measurement-delete-button",onClick:d,width:"100%",children:i("deleteMeasurementLabel")})]})};function qn(r,e,t){const{activeFeatureStyle:s,finishedFeatureStyle:n,onMeasurementsChange:i,predefinedMeasurements:a}=e,[o,l]=p.useState(void 0);return p.useEffect(()=>{if(!r)return;const d=new Hn(r.olMap,{getContinueMessage(){return t.formatMessage({id:"tooltips.continue"})},getHelpMessage(){return t.formatMessage({id:"tooltips.help"})},formatNumber(c){return t.formatNumber(c,{maximumFractionDigits:2})}});return l(d),()=>{d.destroy(),l(void 0)}},[r,t]),p.useEffect(()=>{o?.setActiveFeatureStyle(s??Yn())},[o,s]),p.useEffect(()=>{o?.setFinishedFeatureStyle(n??Jn())},[o,n]),p.useEffect(()=>{o?.setMeasurementSourceChangedHandler(i)},[o,i]),p.useEffect(()=>{o?.setPredefinedMeasurements(a??[])},[o,a]),o}function Yn(){return[new we({stroke:new ie({color:"#fff",lineDash:[10,10],width:5})}),new we({fill:new Re({color:"rgba(0,0,0,0.15)"}),stroke:new ie({color:"rgba(0, 0, 0, 0.7)",lineDash:[10,10],width:3}),image:new Ts({radius:5,stroke:new ie({color:"rgba(0, 0, 0, 0.7)",width:2}),fill:new Re({color:"rgba(255, 255, 255, 0.2)"})})})]}function Jn(){return[new we({stroke:new ie({color:"#fff",width:5})}),new we({stroke:new ie({color:"#0b96fc",width:3}),fill:new Re({color:"rgba(11,150,252,0.15)"})})]}const Xn="@open-pioneer/search",Te=z.bind(void 0,Xn);function Zn(r){const e=r.selectProps.inputValue.length>0,t={...r,className:Le(r.className,{"search-invisible":!e})};return u.jsx(k.Menu,{...t,children:r.children})}function Qn(r){const e=r.data.label,t={...r.innerProps,"aria-label":e,role:"group"};return u.jsx(k.Group,{...r,innerProps:t})}function ei(r){const t=Te().formatMessage({id:"noOptionsText"});return u.jsx(k.NoOptionsMessage,{...r,children:u.jsx(G.span,{className:"search-no-match",children:t})})}function ti(r){const t=Te().formatMessage({id:"loadingText"});return u.jsx(k.LoadingMessage,{...r,children:u.jsx(G.span,{className:"search-loading-text",children:t})})}function si({children:r,...e}){const t={...e,className:Le(e.className,"search-value-container")};return u.jsxs(k.ValueContainer,{...t,children:[!!r&&u.jsx(Sn,{style:{position:"absolute",left:8}}),r]})}function ni(r){const e={...r,isHidden:!1};return u.jsx(k.Input,{...e})}function ii(r){return null}function ri(r){return u.jsxs(k.IndicatorsContainer,{...r,children:[r.children,!r.selectProps.isLoading&&r.selectProps.inputValue&&u.jsx(oi,{selectProps:r.selectProps,clearValue:r.clearValue})]})}function oi(r){const t=Te().formatMessage({id:"ariaLabel.clearButton"}),s=n=>{n.preventDefault(),n.stopPropagation(),r.clearValue()};return u.jsx(Rs,{role:"button",size:"md",mr:1,"aria-label":t,onClick:s,onTouchEnd:s,onMouseDown:n=>n.preventDefault()})}function ai(r){return null}function li(r){const e=r.selectProps.inputValue,t=r.data.label,s={...r,className:Le(r.className,"search-option")};return u.jsx(k.Option,{...s,children:u.jsx(G.div,{className:"search-option-label",children:e.trim().length>0?ci(t,e):t})})}function ci(r,e){const t=r.toLowerCase().indexOf(e.toLowerCase());return t>=0?u.jsxs(u.Fragment,{children:[r.substring(0,t),u.jsx(G.span,{className:"search-highlighted-match",children:r.substring(t,t+e.length)},"highlighted"),r.substring(t+e.length)]}):r}const yt=fe("search:SearchController"),_t=200,vt=5;var de,Y,J,X,j,Ce,Wt;class di{constructor(e,t){x(this,Ce);x(this,de);x(this,Y,[]);x(this,J,vt);x(this,X,_t);x(this,j);b(this,de,e),b(this,Y,t)}destroy(){_(this,j)?.abort(),b(this,j,void 0)}async search(e){if(_(this,j)?.abort(),b(this,j,void 0),!e)return[];const t=b(this,j,new AbortController);try{return await ui(t.signal,_(this,X)),t.signal.aborted&&(yt.debug(`search canceled with ${e}`),Gs()),(await Promise.all(_(this,Y).map(n=>te(this,Ce,Wt).call(this,n,e,t.signal)))).filter(n=>n!=null)}finally{_(this,j)===t&&b(this,j,void 0)}}get searchTypingDelay(){return _(this,X)}set searchTypingDelay(e){b(this,X,e??_t)}get maxResultsPerSource(){return _(this,J)}set maxResultsPerSource(e){b(this,J,e??vt)}get sources(){return _(this,Y)}}de=new WeakMap,Y=new WeakMap,J=new WeakMap,X=new WeakMap,j=new WeakMap,Ce=new WeakSet,Wt=async function(e,t,s){const n=e.label,i=_(this,de).olMap.getView().getProjection();try{const a=_(this,J);let o=await e.search(t,{maxResults:a,signal:s,mapProjection:i});return o.length>a&&(o=o.slice(0,a)),{label:n,source:e,results:o}}catch(a){Lt(a)||yt.error(`search for source ${n} failed`,a);return}};async function ui(r,e){r.aborted||await new Promise(t=>{const s=()=>{r.removeEventListener("abort",s),clearTimeout(n),t()};r.addEventListener("abort",s);const n=setTimeout(s,e)})}const Ee=fe("search:Search"),ar=r=>{const{sources:e,searchTypingDelay:t,maxResultsPerGroup:s,onSelect:n,onClear:i}=r,{containerProps:a}=B("search",r),{map:o}=$(r),l=Te(),d=mi(e,t,s,o),{input:c,search:g,selectedOption:h,onInputChanged:f,onResultConfirmed:m}=pi(d),v=fi(),S=hi(l),I=gi(),N=H((C,me)=>{me.action==="input-change"&&f(C)}),w=H((C,me)=>{switch(me.action){case"select-option":C&&(m(C),n?.({source:C.source,result:C.result}));break;case"clear":f(""),E.current?.blur(),E.current?.focus(),i?.();break;default:Ee.debug(`Unhandled action type '${me.action}'.`);break}}),E=p.useRef(null);return u.jsx(L,{...a,children:u.jsx(Nt,{className:"search-component",classNamePrefix:"react-select",ref:E,inputValue:c,onInputChange:N,"aria-label":l.formatMessage({id:"ariaLabel.search"}),ariaLiveMessages:S,tagColorScheme:"trails",selectedOptionStyle:"color",selectedOptionColorScheme:"trails",chakraStyles:v,isClearable:!0,placeholder:r.placeholder??l.formatMessage({id:"searchPlaceholder"}),closeMenuOnSelect:!0,isLoading:g.kind==="loading",options:g.kind==="ready"?g.results:void 0,filterOption:()=>!0,tabSelectsValue:!1,components:I,onChange:w,value:h,menuPosition:"fixed"})})};function hi(r){return p.useMemo(()=>({onFocus:()=>"",onChange:()=>"",guidance:()=>`${r.formatMessage({id:"ariaLabel.instructions"})}`,onFilter:()=>""}),[r])}function gi(){return p.useMemo(()=>({Menu:Zn,Input:ni,SingleValue:ii,Option:li,NoOptionsMessage:ei,LoadingMessage:ti,ValueContainer:si,IndicatorsContainer:ri,ClearIndicator:ai,Group:Qn}),[])}function fi(){const[r,e]=It("colors",["trails.100","trails.50"],["#d5e5ec","#eaf2f5"]);return p.useMemo(()=>({groupHeading:s=>({...s,backgroundColor:r,padding:"8px 12px",fontSize:"inherit",fontWeight:"inherit"}),option:s=>({...s,backgroundColor:"inherit",_focus:{backgroundColor:e}}),dropdownIndicator:s=>({...s,display:"none"})}),[r,e])}function mi(r,e,t,s){const[n,i]=p.useState(void 0);return p.useEffect(()=>{if(!s)return;const a=new di(s,r);return i(a),()=>{a.destroy(),i(void 0)}},[s,r]),p.useEffect(()=>{n&&(n.searchTypingDelay=e)},[n,e]),p.useEffect(()=>{n&&(n.maxResultsPerSource=t)},[n,t]),n}function pi(r){const[e,t]=p.useReducer((o,l)=>{switch(l.kind){case"input":return{...o,query:l.query,selectedOption:null};case"select-option":return{...o,selectedOption:l.option,query:l.option.label};case"load-results":return{...o,search:{kind:"loading"}};case"accept-results":return{...o,search:{kind:"ready",results:l.results}}}},void 0,()=>({query:"",selectedOption:null,search:{kind:"ready",results:[]}})),s=p.useRef(),n=H(o=>{if(!r){s.current=void 0,t({kind:"accept-results",results:[]});return}Ee.isDebug()&&Ee.debug(`Starting new search for query ${JSON.stringify(o)}.`),t({kind:"load-results"});const l=s.current=yi(r,o).then(d=>{s.current===l&&t({kind:"accept-results",results:d})})}),i=p.useCallback(o=>{t({kind:"select-option",option:o})},[]),a=p.useCallback(o=>{t({kind:"input",query:o}),n(o)},[n]);return{input:e.query,search:e.search,selectedOption:e.selectedOption,onResultConfirmed:i,onInputChanged:a}}async function yi(r,e){let t;try{t=await r.search(e)}catch(s){Lt(s)||Ee.error("Search failed",s),t=[]}return _i(t)}function _i(r){return r.map((t,s)=>({label:t.label,options:t.results.map(n=>({value:`${s}-${n.id}`,label:n.label,source:t.source,result:n}))}))}const zt="@open-pioneer/selection",vi=Ue.bind(void 0,zt),qe=z.bind(void 0,zt),ne="selection-active",_e="selection-inactive";class Si{tooltip;interactionResources=[];olMap;isActive=!0;tooltipMessage;tooltipDisabledMessage;constructor(e,t,s,n){const i=this.initViewport(e);this.interactionResources.push(this.createDragBox(e,n,i,this.interactionResources)),this.interactionResources.push(this.createDrag(e,i,this.interactionResources)),this.tooltip=this.createHelpTooltip(e,t),this.olMap=e,this.tooltipMessage=t,this.tooltipDisabledMessage=s}initViewport(e){const t=e.getViewport();return t.classList.add(ne),t.oncontextmenu=s=>(s.preventDefault(),!1),t}destroy(){this.tooltip.destroy(),this.interactionResources.forEach(e=>{e.destroy()})}setActive(e){if(this.isActive===e)return;const t=this.olMap.getViewport();e?(this.interactionResources.forEach(s=>this.olMap.addInteraction(s.interaction)),this.tooltip.setText(this.tooltipMessage),t.classList.remove(_e),t.classList.add(ne),this.isActive=!0):(this.interactionResources.forEach(s=>this.olMap.removeInteraction(s.interaction)),this.tooltip.setText(this.tooltipDisabledMessage),t.classList.remove(ne),t.classList.add(_e),this.isActive=!1)}createDragBox(e,t,s,n){const i=new nt({className:"selection-drag-box",condition:As});return e.addInteraction(i),i.on("boxend",function(){t(i.getGeometry())}),{interaction:i,destroy(){e.removeInteraction(i),n.splice(n.indexOf(this)),i.dispose(),s.classList.remove(ne),s.classList.remove(_e),s.oncontextmenu=null}}}createDrag(e,t,s){const n=function(o){return o.originalEvent.button==2},i=new it({condition:n});return e.addInteraction(i),{interaction:i,destroy(){e.removeInteraction(i),s.splice(s.indexOf(this)),i.dispose(),t.classList.remove(ne),t.classList.remove(_e),t.oncontextmenu=null}}}createHelpTooltip(e,t){const s=document.createElement("div");s.className="selection-tooltip printing-hide",s.role="tooltip";const n=document.createElement("span");n.textContent=t,s.appendChild(n);const i=new Ie({element:s,offset:[15,0],positioning:"center-left"}),a=e.on("pointermove",o=>{i.setPosition(o.coordinate)});return e.addOverlay(i),{overlay:i,element:s,destroy(){e.removeOverlay(i),i.dispose(),R(a)},setText(o){n.textContent=o}}}getDragboxInteraction(){return this.interactionResources.find(e=>e.interaction instanceof nt)}getDragPanInteraction(){return this.interactionResources.find(e=>e.interaction instanceof it)}}const ke=fe("selection:SelectionController"),xi=1e4;var ue,he,ge,Pe,Kt;class wi{constructor(e){x(this,Pe);x(this,ue);x(this,he);x(this,ge);const{mapModel:t,onError:s,maxResults:n=xi}=e;b(this,ue,t),b(this,he,n),b(this,ge,s)}destroy(){}async select(e,t){if(t)return await te(this,Pe,Kt).call(this,e,t)}}ue=new WeakMap,he=new WeakMap,ge=new WeakMap,Pe=new WeakSet,Kt=async function(e,t){const s=_(this,ue).olMap.getView().getProjection();try{ke.debug(`Starting selection on source '${e.label}'`);const n=_(this,he);let i=await e.select({type:"extent",extent:t},{maxResults:n,mapProjection:s,signal:new AbortController().signal});return i.length>n&&(i=i.slice(0,n)),ke.debug(`Found ${i.length} results on source '${e.label}'`),{source:e,results:i}}catch(n){ke.error(`selection from source ${e.label} failed`,n),_(this,ge).call(this);return}};const bi={classNamePrefix:"react-select",menuPosition:"fixed",isSearchable:!1,isClearable:!1},lr=r=>{const e=qe(),{sources:t,onSelectionComplete:s,onSelectionSourceChanged:n}=r,{containerProps:i}=B("selection",r),a=e.formatMessage({id:"sourceNotAvailable"}),[o,l]=Ci(t,n),d=Jt(o,a),c=$(r),{onExtentSelected:g}=Pi(c.map,t,o,s),h=Li(),[f,m]=p.useState(!1);Fi(c.map,e,g,d.kind==="available",!!o);const v=p.useMemo(()=>t.map(w=>({label:w.label,value:w})),[t]),S=p.useMemo(()=>v.find(E=>E.value===o)||null,[v,o]),I=H(w=>{l(w?.value)}),N=H(w=>{!f&&w.key==="Enter"&&m(!0)});return u.jsx(Vs,{...i,spacing:2,children:u.jsxs(be,{children:[u.jsx(Me,{children:e.formatMessage({id:"selectSource"})}),u.jsx(Nt,{className:"selection-source react-select",...bi,options:v,placeholder:e.formatMessage({id:"selectionPlaceholder"}),value:S,onChange:I,components:{Option:Mi,SingleValue:Ei},isOptionDisabled:()=>!1,getOptionLabel:w=>{const E=w.label,C=Yt(w.value,a);return C.kind=="available"?E:E+" "+C.reason},ariaLiveMessages:{guidance:()=>"",onChange:w=>w.action=="select-option"||w.action=="initial-input-focus"?w.label+" "+e.formatMessage({id:"selected"}):"",onFilter:()=>"",onFocus:()=>""},chakraStyles:h,onKeyDown:N,menuIsOpen:f,onMenuOpen:()=>m(!0),onMenuClose:()=>m(!1)})]})})};function Mi(r){const{value:e}=r.data,{isAvailable:t,content:s}=qt(e,!1);return u.jsx(k.Option,{...r,isDisabled:!t,className:"selection-source-option",children:s})}function Ei(r){const{value:e}=r.data,{isAvailable:t,content:s}=qt(e,!0),n=t?"selection-source-value":"selection-source-value selection-source-value--disabled";return u.jsx(k.SingleValue,{...r,isDisabled:!t,className:n,children:s})}function Ci(r,e){const[t,s]=p.useState(()=>r[0]);p.useEffect(()=>{t&&!r.includes(t)&&s(void 0)},[r,t]);const n=p.useRef(void 0);return p.useEffect(()=>{t!==n.current&&(n.current=t,e?.({source:t}))},[t,e]),[t,s]}function qt(r,e){const t=qe(),s=r?.label,n=t.formatMessage({id:"sourceNotAvailable"}),i=Jt(r,n);return{isAvailable:i.kind==="available",content:u.jsxs(rt,{direction:"row",alignItems:"center",grow:1,children:[!e&&u.jsx(rt,{grow:1,children:s}),i.kind==="unavailable"&&u.jsx(L,{ml:2,children:u.jsx(Hs,{label:i.reason,placement:"right",openDelay:500,children:u.jsx(G.span,{children:u.jsx(Bs,{as:Js,color:"red",className:"warning-icon","aria-label":i.reason})})})}),e&&s]})}}function Pi(r,e,t,s){const n=vi("notifier.NotificationService"),i=qe(),[a,o]=p.useState(void 0);p.useEffect(()=>{if(!r)return;const d=new wi({mapModel:r,onError(){n.notify({level:"error",message:i.formatMessage({id:"selectionFailed"})})}});return o(d),()=>{d.destroy()}},[r,n,e,i]);const l=H(async d=>{if(!a||!t)return;const c=await a.select(t,d.getExtent());c&&s?.(c)});return{controller:a,onExtentSelected:l}}function Yt(r,e){const t=r.status??"available",s=typeof t=="string"?{kind:t}:t;return s.kind==="available"?s:{kind:"unavailable",reason:s.reason??e}}function Jt(r,e){return U(()=>r?Yt(r,e):{kind:"unavailable",reason:e},[r,e])}function Fi(r,e,t,s,n){p.useEffect(()=>{if(!r)return;const i=n?e.formatMessage({id:"disabledTooltip"}):e.formatMessage({id:"noSourceTooltip"}),a=new Si(r.olMap,e.formatMessage({id:"tooltip"}),i,t);return a.setActive(s),()=>{a?.destroy()}},[r,e,t,s,n])}function Li(){const[r,e]=It("colors",["background_body","border"],["#ffffff","#ffffff"]);return p.useMemo(()=>({control:s=>({...s,cursor:"pointer"}),indicatorSeparator:s=>({...s,borderColor:e}),dropdownIndicator:s=>({...s,backgroundColor:r})}),[r,e])}const Xt="@open-pioneer/printing",Zt=Ue.bind(void 0,Xt),Ii=z.bind(void 0,Xt),Ti="map";class Ai{olMap;i18n;printingService;viewPadding;printMap=void 0;overlay=void 0;constructor(e,t,s){this.olMap=e,this.printingService=t,this.i18n=s}destroy(){this.reset()}setViewPadding(e){this.viewPadding=e}async handleMapExport(e){if(this.olMap)try{this.begin(),this.printMap=await this.printingService.printMap(this.olMap,{blockUserInteraction:!1,viewPadding:this.viewPadding});const t=this.printMap.getCanvas();if(t)e.fileFormat=="png"?await this.exportMapInPNG(t,e):await this.exportMapInPDF(t,e);else throw new Error("Canvas export failed")}finally{this.reset()}}begin(){const e=this.olMap.getTargetElement();e&&(this.overlay=Ks(e,this.i18n.overlayText))}reset(){this.overlay?.destroy(),this.overlay=void 0}getTitleAndFileName(e){const t=e.title||"",s=e.title||Ti;return{title:t,fileName:s}}async exportMapInPNG(e,t){const s=document.createElement("canvas");s.width=e.width,s.height=e.height+50,s.style.backgroundColor="#fff";const n=s.getContext("2d");if(!n)throw new Error("2d canvas rendering context not available");const{title:i,fileName:a}=this.getTitleAndFileName(t);n.fillStyle="#fff",n.fillRect(0,0,s.width,s.height),n.font="20px bold sans-serif",n.textAlign="center",n.fillStyle="#000";const o=s.width/2;n.fillText(i,o,20),n.drawImage(e,0,50);const l=document.createElement("a");l.setAttribute("download",a+".png");const d=qs(s);if(!d)throw new Error("Failed to get image data URL");l.href=d,l.click()}async exportMapInPDF(e,t){const{jsPDF:s}=await Xs(async()=>{const{jsPDF:I}=await import("./__kfMbro-lod.js");return{jsPDF:I}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),n=new s({orientation:"landscape",unit:"mm",format:"a4"}),i=n.internal.pageSize.getWidth(),a=n.internal.pageSize.getHeight(),o=15,l=20,d=a-l;n.setFontSize(20);const{title:c,fileName:g}=this.getTitleAndFileName(t);n.text(c,i/2,o,{align:"center"});const h=e.width/e.height;let f=d,m=f*h;m>=i&&(m=i,f=m/h);const v=(i-m)/2,S=l+(d-f)/2;n.addImage(e,"",v,S,m,f),n.save(g+".pdf")}}const Ni=fe("printing"),cr=r=>{const e=Ii(),{viewPadding:t="auto"}=r,{containerProps:s}=B("printing",r),[n,i]=p.useState("pdf"),[a,o]=p.useState(""),[l,d]=p.useState(!1),c=Zt("notifier.NotificationService"),{map:g}=$(r),h=Oi(g,e,t);function f(v){(v==="png"||v==="pdf")&&i(v)}function m(){l||!h||(d(!0),h.handleMapExport({title:a,fileFormat:n}).catch(v=>{const S=e.formatMessage({id:"printingFailed"});c.notify({level:"error",message:S}),Ni.error("Failed to print the map",v)}).finally(()=>{d(!1)}))}return u.jsx(L,{...s,children:u.jsxs(L,{as:"form",m:2,alignItems:"center",onSubmit:v=>{v.preventDefault(),m()},children:[u.jsxs(be,{as:Ve,mb:2,children:[u.jsx(Me,{minWidth:"82",mb:1,children:e.formatMessage({id:"title"})}),u.jsx(ze,{placeholder:e.formatMessage({id:"input.placeholder"}),value:a,onChange:v=>{o(v.target.value)},autoFocus:!0})]}),u.jsxs(be,{as:Ve,mb:2,children:[u.jsx(Me,{minWidth:"82",mb:1,children:e.formatMessage({id:"fileFormat"})}),u.jsxs(Ke,{value:n,onChange:v=>f(v.target.value),className:"printing-select",children:[u.jsx("option",{value:"png",children:"PNG"}),u.jsx("option",{value:"pdf",children:"PDF"})]})]}),u.jsx(Ft,{isLoading:l,loadingText:e.formatMessage({id:"printingMap"}),disabled:l,mt:2,p:2,className:"printing-export-button",type:"submit",width:"100%",children:e.formatMessage({id:"export"})})]})})};function Oi(r,e,t){const s=Zt("printing.PrintingService"),[n,i]=p.useState(void 0);return p.useEffect(()=>{if(!r)return;const a=new Ai(r.olMap,s,{overlayText:e.formatMessage({id:"printingMap"})});return i(a),()=>{a.destroy(),i(void 0)}},[r,e,s]),p.useEffect(()=>{n?.setViewPadding(t)},[n,t]),n}export{sr as C,Qi as E,ze as I,rr as L,or as M,tr as N,Ie as O,cr as P,Rt as S,er as V,Zi as W,nr as a,ir as b,ar as c,lr as d,Ke as e}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/DnYPVZQRsXfx.js b/openlayers-base-packages/pr-previews/pr-377/assets/2C0geDG_OBHU.js similarity index 98% rename from openlayers-base-packages/pr-previews/pr-377/assets/DnYPVZQRsXfx.js rename to openlayers-base-packages/pr-previews/pr-377/assets/2C0geDG_OBHU.js index cc3a128..974f245 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/DnYPVZQRsXfx.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/2C0geDG_OBHU.js @@ -1 +1 @@ -import{a5 as a}from"./DbBkdn6FNbgs.js";var h={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},f=a.createContext&&a.createContext(h),y=["attr","size","title"];function m(t,e){if(t==null)return{};var r=b(t,e),n,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function b(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;ea.createElement(e.tag,u({key:r},e.attr),p(e.child)))}function o(t){return e=>a.createElement(k,s({attr:u({},t.attr)},e),p(t.child))}function k(t){var e=r=>{var{attr:n,size:i,title:l}=t,v=m(t,y),d=i||r.size||"1em",c;return r.className&&(c=r.className),t.className&&(c=(c?c+" ":"")+t.className),a.createElement("svg",s({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,v,{className:c,style:u(u({color:t.color||r.color},r.style),t.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),l&&a.createElement("title",null,l),t.children)};return f!==void 0?a.createElement(f.Consumer,null,r=>e(r)):e(h)}function P(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"12",y2:"13"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(t)}function L(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"},child:[]},{tag:"polyline",attr:{points:"7.5 4.21 12 6.81 16.5 4.21"},child:[]},{tag:"polyline",attr:{points:"7.5 19.79 7.5 14.6 3 12"},child:[]},{tag:"polyline",attr:{points:"21 12 16.5 14.6 16.5 19.79"},child:[]},{tag:"polyline",attr:{points:"3.27 6.96 12 12.01 20.73 6.96"},child:[]},{tag:"line",attr:{x1:"12",y1:"22.08",x2:"12",y2:"12"},child:[]}]})(t)}function C(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 14 4 9 9 4"},child:[]},{tag:"path",attr:{d:"M20 20v-7a4 4 0 0 0-4-4H4"},child:[]}]})(t)}function W(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 14 20 9 15 4"},child:[]},{tag:"path",attr:{d:"M4 20v-7a4 4 0 0 1 4-4h12"},child:[]}]})(t)}function E(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"},child:[]},{tag:"polyline",attr:{points:"9 22 9 12 15 12 15 22"},child:[]}]})(t)}function B(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(t)}function F(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"1"},child:[]},{tag:"circle",attr:{cx:"12",cy:"5",r:"1"},child:[]},{tag:"circle",attr:{cx:"12",cy:"19",r:"1"},child:[]}]})(t)}function z(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(t)}export{P as F,o as G,E as a,B as b,z as c,C as d,W as e,F as f,L as g}; +import{a7 as a}from"./B60Dx_GOYdnk.js";var h={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},f=a.createContext&&a.createContext(h),y=["attr","size","title"];function m(t,e){if(t==null)return{};var r=b(t,e),n,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function b(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;ea.createElement(e.tag,u({key:r},e.attr),p(e.child)))}function o(t){return e=>a.createElement(k,s({attr:u({},t.attr)},e),p(t.child))}function k(t){var e=r=>{var{attr:n,size:i,title:l}=t,v=m(t,y),d=i||r.size||"1em",c;return r.className&&(c=r.className),t.className&&(c=(c?c+" ":"")+t.className),a.createElement("svg",s({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,v,{className:c,style:u(u({color:t.color||r.color},r.style),t.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),l&&a.createElement("title",null,l),t.children)};return f!==void 0?a.createElement(f.Consumer,null,r=>e(r)):e(h)}function P(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"12",y2:"13"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(t)}function L(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"},child:[]},{tag:"polyline",attr:{points:"7.5 4.21 12 6.81 16.5 4.21"},child:[]},{tag:"polyline",attr:{points:"7.5 19.79 7.5 14.6 3 12"},child:[]},{tag:"polyline",attr:{points:"21 12 16.5 14.6 16.5 19.79"},child:[]},{tag:"polyline",attr:{points:"3.27 6.96 12 12.01 20.73 6.96"},child:[]},{tag:"line",attr:{x1:"12",y1:"22.08",x2:"12",y2:"12"},child:[]}]})(t)}function C(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 14 4 9 9 4"},child:[]},{tag:"path",attr:{d:"M20 20v-7a4 4 0 0 0-4-4H4"},child:[]}]})(t)}function W(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 14 20 9 15 4"},child:[]},{tag:"path",attr:{d:"M4 20v-7a4 4 0 0 1 4-4h12"},child:[]}]})(t)}function E(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"},child:[]},{tag:"polyline",attr:{points:"9 22 9 12 15 12 15 22"},child:[]}]})(t)}function B(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(t)}function F(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"1"},child:[]},{tag:"circle",attr:{cx:"12",cy:"5",r:"1"},child:[]},{tag:"circle",attr:{cx:"12",cy:"19",r:"1"},child:[]}]})(t)}function z(t){return o({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(t)}export{P as F,o as G,E as a,B as b,z as c,C as d,W as e,F as f,L as g}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/DbBkdn6FNbgs.js b/openlayers-base-packages/pr-previews/pr-377/assets/B60Dx_GOYdnk.js similarity index 99% rename from openlayers-base-packages/pr-previews/pr-377/assets/DbBkdn6FNbgs.js rename to openlayers-base-packages/pr-previews/pr-377/assets/B60Dx_GOYdnk.js index e41b529..8debaaf 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/DbBkdn6FNbgs.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/B60Dx_GOYdnk.js @@ -379,4 +379,4 @@ Error generating stack: `+i.message+` min-height: 100%; height: 100%; font-feature-settings: 'kern'; -}`,Kj={light:"chakra-ui-light",dark:"chakra-ui-dark"},Qj=({container:e,colorMode:t,children:r,theme:n})=>{const o=eV(e),i=w.useMemo(()=>Jj(n),[n]),s=w.useRef(null),a={portalProps:{containerRef:s}},l=Zj(s,t);return A.jsx("div",{className:"chakra-host",ref:s,children:A.jsx(wN,{value:o,children:A.jsx(FN,{theme:i,children:A.jsx(eS,{children:A.jsxs(l,{children:[A.jsx(zN,{}),A.jsx(Ic,{styles:Yj}),A.jsx(VN,{}),A.jsx(fF,{value:a?.defaultOptions,children:A.jsx(Gj,{value:s,children:r})}),A.jsx(hF,{...a})]})})})})})};function Zj(e,t){const r=t??"light";return w.useEffect(()=>{const o=e.current;if(!o)return;const i=Kj[r];return o.classList.add(i),o.dataset.theme=r,()=>{o.classList.remove(i),o.dataset.theme=void 0}},[e,r]),r==="light"?Z1:Q1}function Jj(e=_u){return fg({styles:{global:{".chakra-host":_u.styles.global.body}}},e)}function eV(e){const t=w.useRef();return t.current||(t.current=j1({key:"css",container:e})),t.current}const tV={},rV={trails:{50:"#eaf2f5",100:"#d5e5ec",200:"#abcbd9",300:"#81b1c5",400:"#5797b2",500:"#2d7d9f",600:"#24647f",700:"#1b4b5f",800:"#123240",900:"#091920"}},nV={colors:{background_body:"white",background_primary:"trails.500",background_light:"trails.50",placeholder:"gray.500",font_primary:"black",font_inverse:"white",font_link:"trails.600",border:"gray.300","chakra-body-text":"font_primary","chakra-body-bg":"background_body","chakra-border-color":"border","chakra-placeholder-color":"placeholder"}},oV=fg({fonts:tV,colors:rV,semanticTokens:nV},_u),eo=(e,t)=>{const r=t.semanticTokens.colors[e];if(r&&r.includes(".")){const n=r.split("."),o=n[0],i=n[1];return t.colors[o][i]}return r},iV=fg(bF({colorScheme:"trails"}),{styles:{global({theme:e}){return{".chakra-host":{"--trails-theme-shadow-color":`${eo("background_primary",e)}99`}}}},shadows:{outline:"0 0 0 3px var(--trails-theme-shadow-color)"},components:{Button:{defaultProps:{}},Checkbox:{defaultProps:{}},Divider:{baseStyle:{borderColor:"background_primary"}},Input:{defaultProps:{},variants:{outline({theme:e}){return{field:{borderColor:"border",_focusVisible:{borderColor:"background_primary",boxShadow:`0 0 0 1px ${eo("background_primary",e)}`}},addon:{borderColor:"border",bg:"background_primary"}}},filled:{field:{_focusVisible:{borderColor:"background_primary"}},addon:{bg:"background_primary"}},flushed({theme:e}){return{field:{_focusVisible:{borderColor:"background_primary",boxShadow:`0px 1px 0px 0px ${eo("background_primary",e)}`}}}}}},Link:{baseStyle:{color:"font_link"}},Radio:{defaultProps:{}},Select:{defaultProps:{},variants:{outline({theme:e}){return{field:{borderColor:"border",_focusVisible:{borderColor:"background_primary",boxShadow:`0 0 0 1px ${eo("background_primary",e)}`}}}},filled:{field:{_focusVisible:{borderColor:"background_primary"}},addon:{bg:"background_primary"}},flushed({theme:e}){return{field:{_focusVisible:{borderColor:"background_primary",boxShadow:`0px 1px 0px 0px ${eo("background_primary",e)}`}}}}}},Slider:{defaultProps:{},baseStyle:{thumb:{borderColor:"background_primary",_hover:{bg:"background_primary"}}}},Switch:{defaultProps:{}},Textarea:{defaultProps:{},variants:{outline({theme:e}){return{borderColor:"border",_focusVisible:{borderColor:"background_primary",boxShadow:`0 0 0 1px ${eo("background_primary",e)}`}}},filled:{_focusVisible:{borderColor:"background_primary"}},flushed({theme:e}){return{_focusVisible:{borderColor:"background_primary",boxShadow:`0px 1px 0px 0px ${eo("background_primary",e)}`}}}}},Tooltip:{baseStyle:{borderRadius:"md"}}}},oV),sV=w.createContext(null);var tE,Sb=cg;tE=Sb.createRoot,Sb.hydrateRoot;class Ca{containerNode;theme;root;packageContext;static createForApp(t){const{serviceLayer:r,packages:n}=t,o=aV(r,n);return new Ca({...t,packageContext:o})}static createForErrorScreen(t){const r=()=>{throw new F(j.INVALID_STATE,"Hook cannot be used within the error screen.")},n={getIntl:r,getProperties:r,getService:r,getServices:r};return new Ca({...t,packageContext:n})}constructor(t){this.containerNode=t.container,this.theme=t.theme,this.root=tE(t.rootNode),this.packageContext=t.packageContext}render(t){this.root.render(A.jsx(w.StrictMode,{children:A.jsx(Qj,{container:this.containerNode,colorMode:"light",theme:this.theme??iV,children:A.jsx(sV.Provider,{value:this.packageContext,children:t})})}))}destroy(){this.root.unmount()}}function aV(e,t){const r=o=>{const i=t.get(o);if(!i)throw new F(j.INTERNAL,`Package '${o}' was not found in application.`);return i};return{getService:(o,i,s)=>{const a={interfaceName:i,...s},l=e.getService(o,a);if(l.type==="found")return l.value.getInstanceOrThrow();const u=lc(a);switch(l.type){case"unimplemented":throw new F(j.INTERFACE_NOT_FOUND,`The UI of package '${o}' requested the unimplemented interface ${u}.`);case"undeclared":throw new F(j.UNDECLARED_DEPENDENCY,`Package '${o}' did not declare an UI dependency on interface ${u}. Add the dependency to the package configuration or remove the usage.`);case"ambiguous":{const c=Db(l.choices);throw new F(j.AMBIGUOUS_DEPENDENCY,`The UI of package '${o}' requires the ambiguous interface ${u}. Possible choices are: ${c}.`)}case"unknown-package":throw new F(j.MISSING_PACKAGE,xb(o,i))}},getServices:(o,i)=>{const s=e.getServices(o,i);if(s.type==="found")return s.value.map(a=>a.getInstanceOrThrow());switch(s.type){case"undeclared":throw new F(j.UNDECLARED_DEPENDENCY,`Package '${o}' did not declare an UI dependency on all services implementing interface '${i}'. Add the dependency ("all": true) to the package configuration or remove the usage.`);case"unknown-package":throw new F(j.MISSING_PACKAGE,xb(o,i))}},getProperties:o=>r(o).properties,getIntl:o=>r(o).intl}}function xb(e,t){return`Package '${e}' was not found in the application's metadata while it attempted to reference the interface '${t}'. Check that the dependency is declared correctly in the packages that use '${e}'.`}const lV={title:"Anwendungsstart fehlgeschlagen",alertTitle:"Fehler",alertDescription:"Leider ist beim Start der Anwendung ein Fehler aufgetreten.","details.title":"Fehlerdetails","details.inspect":"Konsole öffnen, um weitere Details zu sehen.","details.errorMessage":"Fehler: {message}"},uV={title:"Application start failed",alertTitle:"Error",alertDescription:"Unfortunately an error occurred during application start.","details.title":"Error details","details.inspect":"Inspect the console to see more details.","details.errorMessage":"Error: {message}"},Pf={en:uV,de:lV},cV=!1;function dV(e){const t=e.intl;return A.jsx(Ok,{width:"100%",height:"100%",minWidth:"350px",minHeight:"150px",children:A.jsxs(Kk,{padding:4,width:"100%",height:"100%",children:[A.jsx(Zk,{size:"md",children:t.formatMessage({id:"title"})}),A.jsxs(gm,{status:"error",maxWidth:550,borderRadius:"4px",mt:2,children:[A.jsx(ym,{}),A.jsx(vm,{children:t.formatMessage({id:"alertTitle"})}),A.jsx(bm,{children:t.formatMessage({id:"alertDescription"})})]}),cV]})})}const Gr=Ma("runtime:CustomElement");function zV(e){var r,n,o,i,rE,sp;class t extends HTMLElement{constructor(){super();Gt(this,i);Gt(this,r);Gt(this,n);Gt(this,o);Lt(this,r,this.attachShadow({mode:"open"}))}static get observedAttributes(){return[]}connectedCallback(){Gr.debug("Launching application"),Me(this,n)&&Me(this,n).destroy(),Lt(this,n,sl(this,i,sp).call(this)),Me(this,n).start()}disconnectedCallback(){Gr.debug("Shutting down application"),Me(this,o)&&clearTimeout(Me(this,o)),Me(this,n)?.destroy(),Lt(this,n,void 0),Gr.debug("Application destroyed")}when(){return Me(this,n)?Me(this,n).whenAPI():Promise.reject(new F(j.NOT_MOUNTED,"Cannot use the application's API because the HTML element has not yet been mounted into the DOM."))}}return r=new WeakMap,n=new WeakMap,o=new WeakMap,i=new WeakSet,rE=function(c){Me(this,o)&&clearTimeout(Me(this,o)),Lt(this,o,setTimeout(()=>{Me(this,n)&&(Gr.debug("Restarting application with new options",c),Me(this,n).destroy(),Lt(this,n,sl(this,i,sp).call(this,c)),Me(this,n).start())},1))},sp=function(c){return new fV({hostElement:this,shadowRoot:Me(this,r),elementOptions:e,overrides:c,restart:sl(this,i,rE).bind(this)})},t}class fV{options;apiPromise;api;state="not-started";container;config;serviceLayer;lifecycleEvents;reactIntegration;stylesWatch;constructor(t){this.options=t}start(){if(this.state!=="not-started")throw new F(j.INTERNAL,`Cannot start element in state '${this.state}'`);this.state="starting",this.startImpl().catch(t=>{this.state!=="destroyed"&&(gV(t),this.reset(),this.state="error",this.showErrorScreen(t))})}destroy(){if(this.state!=="destroyed"){if(this.state==="started")try{this.triggerApplicationLifecycleEvent("before-stop")}catch{}this.state="destroyed",this.reset()}}reset(){this.apiPromise?.reject(Nb()),this.reactIntegration=yd(this.reactIntegration),this.options.shadowRoot.replaceChildren(),this.container=void 0,this.lifecycleEvents=void 0,this.serviceLayer=yd(this.serviceLayer),this.stylesWatch=yd(this.stylesWatch)}whenAPI(){return this.api?Promise.resolve(this.api):(this.apiPromise??=LC()).promise}async startImpl(){const{shadowRoot:t,hostElement:r,elementOptions:n,overrides:o}=this.options,i=this.config=await pV(r,n,o);this.checkAbort(),Gr.debug("Application config is",i);const s=await gP(n.appMetadata,i.locale);this.checkAbort();const a=this.container=wb(s.locale),l=this.initStyles();t.replaceChildren(a,...l);const{serviceLayer:u,packages:c}=this.initServiceLayer({container:a,properties:i.properties,i18n:s});this.lifecycleEvents=kb(u,vp),await this.initAPI(u),this.checkAbort(),this.reactIntegration=Ca.createForApp({rootNode:a,container:t,theme:n.theme,serviceLayer:u,packages:c});const d=this.options.elementOptions.component??yV;this.reactIntegration.render(w.createElement(d)),this.state="started",this.triggerApplicationLifecycleEvent("after-start"),Gr.debug("Application started")}initStyles(){const t=":host { all: initial; display: block; }",r=document.createElement("style");Eb(r,{value:t});const n=this.options.elementOptions.appMetadata?.styles,o=document.createElement("style");return Eb(o,n),[r,o]}initServiceLayer(t){const{hostElement:r,shadowRoot:n,elementOptions:o,restart:i}=this.options,{container:s,properties:a,i18n:l}=t,u=o.appMetadata?.packages??{},c=_P({host:r,shadowRoot:n,container:s,locale:l.locale,supportedLocales:l.supportedMessageLocales,changeLocale(g){const y=l.supportedMessageLocales;if(g!=null&&!l.supportsLocale(g))throw new F(j.UNSUPPORTED_LOCALE,`Unsupported locale '${g}' (supported locales: ${y.join(", ")}).`);i({locale:g})}}),{serviceLayer:d,packages:f}=hV({packageMetadata:u,builtinPackage:c,properties:a,i18n:l});return this.serviceLayer=d,Gr.isDebug()&&Gr.debug("Launching service layer with packages",Object.fromEntries(f)),d.start(),{serviceLayer:d,packages:f}}async initAPI(t){const r=kb(t,yp);try{const n=this.api=await r.getApi();Gr.debug("Application API initialized to",n),this.apiPromise?.resolve(n)}catch(n){throw new F(j.INTERNAL,"Failed to gather the application's API methods.",{cause:n})}}triggerApplicationLifecycleEvent(t){this.lifecycleEvents?.emitLifecycleEvent(t)}checkAbort(){this.state==="destroyed"&&TC()}showErrorScreen(t){const{shadowRoot:r,elementOptions:n}=this.options,o=s1(),i=new i1(Object.keys(Pf)),{locale:s,messageLocale:a}=i.pickSupportedLocale(void 0,o),l=this.container=wb(s);l.classList.add("pioneer-root-error-screen");const u=Pf[a]??Pf.en,c=gp(s,u);this.reactIntegration=Ca.createForErrorScreen({rootNode:l,container:r,theme:n.theme}),this.reactIntegration.render(w.createElement(dV,{intl:c,error:t})),r.replaceChildren(l)}}function wb(e){const t=document.createElement("div");return t.classList.add("pioneer-root"),t.style.minHeight="100%",t.style.height="100%",e&&(t.lang=e),t}function hV(e){const{packageMetadata:t,properties:r,builtinPackage:n,i18n:o}=e;let i;try{i=BC(t??{},o,r)}catch(l){throw new F(j.INVALID_METADATA,"Failed to parse package metadata.",{cause:l})}{const l=i.findIndex(u=>u.name===n.name);l>=0&&i.splice(l,1),i.push(n)}const s=[{interfaceName:yp},{interfaceName:vp},{interfaceName:PP,all:!0}],a=new RP(i,s);return{packages:new Map(i.map(l=>[l.name,l])),serviceLayer:a}}function kb(e,t){const r=e.getService("@open-pioneer/runtime",{interfaceName:t},{ignoreDeclarationCheck:!0});if(r.type!=="found")throw new F(j.INTERNAL,`Failed to find instance of '${t}' (result type '${r.type}'). This is a builtin service that must be present exactly once.`);return r.value.getInstanceOrThrow()}async function pV(e,t,r){let n;try{const i=t.config??{},s=await t.resolveConfig?.({hostElement:e,getAttribute(a){return e.getAttribute(a)??void 0}})??{};n=[i,s]}catch(i){throw new F(j.CONFIG_RESOLUTION_FAILED,"Failed to resolve application properties.",{cause:i})}const o=mV(n);return r?.locale&&(o.locale=r.locale),o}function mV(e){const t=Object.assign({locale:void 0,properties:{}},...e),r=t.properties={};for(const n of e)for(const[o,i]of Object.entries(n.properties??{})){const s=r[o]??={};Object.assign(s,i)}return t}function Eb(e,t){let r=t?.value??"";r=r.replace(/\/\*# sourceMappingURL=.*$/,"");const n=document.createTextNode(r);e.replaceChildren(n)}function gV(e){if(e instanceof F){const t=EC(e).reverse();if(t.length===1){console.error(e);return}let r=1;for(const n of t)console.error(`#${r}`,n),++r}else console.error("Unexpected error",e)}function yV(){return null}function FV(e){return{value:e}}export{Ru as $,gm as A,Ok as B,Lx as C,xd as D,F as E,BV as F,_x as G,Px as H,Ua as I,Ao as J,i2 as K,zj as L,Ze as M,ku as N,Zi as O,fm as P,PV as Q,EV as R,Yk as S,Vi as T,IV as U,Kk as V,gt as W,ZP as X,CV as Y,IN as Z,_V as _,FV as a,cg as a0,RN as a1,hm as a2,AV as a3,kV as a4,kC as a5,Sp as a6,xu as a7,wu as a8,u0 as a9,c1 as aa,zP as ab,jP as ac,wV as ad,xV as ae,XP as af,fg as ag,iV as ah,Zk as ai,ap as aj,sV as ak,j as al,B as am,SV as an,al as ao,gF as b,Ma as c,LC as d,Nb as e,zV as f,ke as g,xr as h,CC as i,A as j,ym as k,DV as l,Sr as m,TV as n,zi as o,i0 as p,Rr as q,w as r,J3 as s,Ds as t,H3 as u,F3 as v,NV as w,yd as x,TC as y,MV as z}; +}`,Kj={light:"chakra-ui-light",dark:"chakra-ui-dark"},Qj=({container:e,colorMode:t,children:r,theme:n})=>{const o=eV(e),i=w.useMemo(()=>Jj(n),[n]),s=w.useRef(null),a={portalProps:{containerRef:s}},l=Zj(s,t);return A.jsx("div",{className:"chakra-host",ref:s,children:A.jsx(wN,{value:o,children:A.jsx(FN,{theme:i,children:A.jsx(eS,{children:A.jsxs(l,{children:[A.jsx(zN,{}),A.jsx(Ic,{styles:Yj}),A.jsx(VN,{}),A.jsx(fF,{value:a?.defaultOptions,children:A.jsx(Gj,{value:s,children:r})}),A.jsx(hF,{...a})]})})})})})};function Zj(e,t){const r=t??"light";return w.useEffect(()=>{const o=e.current;if(!o)return;const i=Kj[r];return o.classList.add(i),o.dataset.theme=r,()=>{o.classList.remove(i),o.dataset.theme=void 0}},[e,r]),r==="light"?Z1:Q1}function Jj(e=_u){return fg({styles:{global:{".chakra-host":_u.styles.global.body}}},e)}function eV(e){const t=w.useRef();return t.current||(t.current=j1({key:"css",container:e})),t.current}const tV={},rV={trails:{50:"#eaf2f5",100:"#d5e5ec",200:"#abcbd9",300:"#81b1c5",400:"#5797b2",500:"#2d7d9f",600:"#24647f",700:"#1b4b5f",800:"#123240",900:"#091920"}},nV={colors:{background_body:"white",background_primary:"trails.500",background_light:"trails.50",placeholder:"gray.500",font_primary:"black",font_inverse:"white",font_link:"trails.600",border:"gray.300","chakra-body-text":"font_primary","chakra-body-bg":"background_body","chakra-border-color":"border","chakra-placeholder-color":"placeholder"}},oV=fg({fonts:tV,colors:rV,semanticTokens:nV},_u),eo=(e,t)=>{const r=t.semanticTokens.colors[e];if(r&&r.includes(".")){const n=r.split("."),o=n[0],i=n[1];return t.colors[o][i]}return r},iV=fg(bF({colorScheme:"trails"}),{styles:{global({theme:e}){return{".chakra-host":{"--trails-theme-shadow-color":`${eo("background_primary",e)}99`}}}},shadows:{outline:"0 0 0 3px var(--trails-theme-shadow-color)"},components:{Button:{defaultProps:{}},Checkbox:{defaultProps:{}},Divider:{baseStyle:{borderColor:"background_primary"}},Input:{defaultProps:{},variants:{outline({theme:e}){return{field:{borderColor:"border",_focusVisible:{borderColor:"background_primary",boxShadow:`0 0 0 1px ${eo("background_primary",e)}`}},addon:{borderColor:"border",bg:"background_primary"}}},filled:{field:{_focusVisible:{borderColor:"background_primary"}},addon:{bg:"background_primary"}},flushed({theme:e}){return{field:{_focusVisible:{borderColor:"background_primary",boxShadow:`0px 1px 0px 0px ${eo("background_primary",e)}`}}}}}},Link:{baseStyle:{color:"font_link"}},Radio:{defaultProps:{}},Select:{defaultProps:{},variants:{outline({theme:e}){return{field:{borderColor:"border",_focusVisible:{borderColor:"background_primary",boxShadow:`0 0 0 1px ${eo("background_primary",e)}`}}}},filled:{field:{_focusVisible:{borderColor:"background_primary"}},addon:{bg:"background_primary"}},flushed({theme:e}){return{field:{_focusVisible:{borderColor:"background_primary",boxShadow:`0px 1px 0px 0px ${eo("background_primary",e)}`}}}}}},Slider:{defaultProps:{},baseStyle:{thumb:{borderColor:"background_primary",_hover:{bg:"background_primary"}}}},Switch:{defaultProps:{}},Textarea:{defaultProps:{},variants:{outline({theme:e}){return{borderColor:"border",_focusVisible:{borderColor:"background_primary",boxShadow:`0 0 0 1px ${eo("background_primary",e)}`}}},filled:{_focusVisible:{borderColor:"background_primary"}},flushed({theme:e}){return{_focusVisible:{borderColor:"background_primary",boxShadow:`0px 1px 0px 0px ${eo("background_primary",e)}`}}}}},Tooltip:{baseStyle:{borderRadius:"md"}}}},oV),sV=w.createContext(null);var tE,Sb=cg;tE=Sb.createRoot,Sb.hydrateRoot;class Ca{containerNode;theme;root;packageContext;static createForApp(t){const{serviceLayer:r,packages:n}=t,o=aV(r,n);return new Ca({...t,packageContext:o})}static createForErrorScreen(t){const r=()=>{throw new F(j.INVALID_STATE,"Hook cannot be used within the error screen.")},n={getIntl:r,getProperties:r,getService:r,getServices:r};return new Ca({...t,packageContext:n})}constructor(t){this.containerNode=t.container,this.theme=t.theme,this.root=tE(t.rootNode),this.packageContext=t.packageContext}render(t){this.root.render(A.jsx(w.StrictMode,{children:A.jsx(Qj,{container:this.containerNode,colorMode:"light",theme:this.theme??iV,children:A.jsx(sV.Provider,{value:this.packageContext,children:t})})}))}destroy(){this.root.unmount()}}function aV(e,t){const r=o=>{const i=t.get(o);if(!i)throw new F(j.INTERNAL,`Package '${o}' was not found in application.`);return i};return{getService:(o,i,s)=>{const a={interfaceName:i,...s},l=e.getService(o,a);if(l.type==="found")return l.value.getInstanceOrThrow();const u=lc(a);switch(l.type){case"unimplemented":throw new F(j.INTERFACE_NOT_FOUND,`The UI of package '${o}' requested the unimplemented interface ${u}.`);case"undeclared":throw new F(j.UNDECLARED_DEPENDENCY,`Package '${o}' did not declare an UI dependency on interface ${u}. Add the dependency to the package configuration or remove the usage.`);case"ambiguous":{const c=Db(l.choices);throw new F(j.AMBIGUOUS_DEPENDENCY,`The UI of package '${o}' requires the ambiguous interface ${u}. Possible choices are: ${c}.`)}case"unknown-package":throw new F(j.MISSING_PACKAGE,xb(o,i))}},getServices:(o,i)=>{const s=e.getServices(o,i);if(s.type==="found")return s.value.map(a=>a.getInstanceOrThrow());switch(s.type){case"undeclared":throw new F(j.UNDECLARED_DEPENDENCY,`Package '${o}' did not declare an UI dependency on all services implementing interface '${i}'. Add the dependency ("all": true) to the package configuration or remove the usage.`);case"unknown-package":throw new F(j.MISSING_PACKAGE,xb(o,i))}},getProperties:o=>r(o).properties,getIntl:o=>r(o).intl}}function xb(e,t){return`Package '${e}' was not found in the application's metadata while it attempted to reference the interface '${t}'. Check that the dependency is declared correctly in the packages that use '${e}'.`}const lV={title:"Anwendungsstart fehlgeschlagen",alertTitle:"Fehler",alertDescription:"Leider ist beim Start der Anwendung ein Fehler aufgetreten.","details.title":"Fehlerdetails","details.inspect":"Konsole öffnen, um weitere Details zu sehen.","details.errorMessage":"Fehler: {message}"},uV={title:"Application start failed",alertTitle:"Error",alertDescription:"Unfortunately an error occurred during application start.","details.title":"Error details","details.inspect":"Inspect the console to see more details.","details.errorMessage":"Error: {message}"},Pf={en:uV,de:lV},cV=!1;function dV(e){const t=e.intl;return A.jsx(Ok,{width:"100%",height:"100%",minWidth:"350px",minHeight:"150px",children:A.jsxs(Kk,{padding:4,width:"100%",height:"100%",children:[A.jsx(Zk,{size:"md",children:t.formatMessage({id:"title"})}),A.jsxs(gm,{status:"error",maxWidth:550,borderRadius:"4px",mt:2,children:[A.jsx(ym,{}),A.jsx(vm,{children:t.formatMessage({id:"alertTitle"})}),A.jsx(bm,{children:t.formatMessage({id:"alertDescription"})})]}),cV]})})}const Gr=Ma("runtime:CustomElement");function zV(e){var r,n,o,i,rE,sp;class t extends HTMLElement{constructor(){super();Gt(this,i);Gt(this,r);Gt(this,n);Gt(this,o);Lt(this,r,this.attachShadow({mode:"open"}))}static get observedAttributes(){return[]}connectedCallback(){Gr.debug("Launching application"),Me(this,n)&&Me(this,n).destroy(),Lt(this,n,sl(this,i,sp).call(this)),Me(this,n).start()}disconnectedCallback(){Gr.debug("Shutting down application"),Me(this,o)&&clearTimeout(Me(this,o)),Me(this,n)?.destroy(),Lt(this,n,void 0),Gr.debug("Application destroyed")}when(){return Me(this,n)?Me(this,n).whenAPI():Promise.reject(new F(j.NOT_MOUNTED,"Cannot use the application's API because the HTML element has not yet been mounted into the DOM."))}}return r=new WeakMap,n=new WeakMap,o=new WeakMap,i=new WeakSet,rE=function(c){Me(this,o)&&clearTimeout(Me(this,o)),Lt(this,o,setTimeout(()=>{Me(this,n)&&(Gr.debug("Restarting application with new options",c),Me(this,n).destroy(),Lt(this,n,sl(this,i,sp).call(this,c)),Me(this,n).start())},1))},sp=function(c){return new fV({hostElement:this,shadowRoot:Me(this,r),elementOptions:e,overrides:c,restart:sl(this,i,rE).bind(this)})},t}class fV{options;apiPromise;api;state="not-started";container;config;serviceLayer;lifecycleEvents;reactIntegration;stylesWatch;constructor(t){this.options=t}start(){if(this.state!=="not-started")throw new F(j.INTERNAL,`Cannot start element in state '${this.state}'`);this.state="starting",this.startImpl().catch(t=>{this.state!=="destroyed"&&(gV(t),this.reset(),this.state="error",this.showErrorScreen(t))})}destroy(){if(this.state!=="destroyed"){if(this.state==="started")try{this.triggerApplicationLifecycleEvent("before-stop")}catch{}this.state="destroyed",this.reset()}}reset(){this.apiPromise?.reject(Nb()),this.reactIntegration=yd(this.reactIntegration),this.options.shadowRoot.replaceChildren(),this.container=void 0,this.lifecycleEvents=void 0,this.serviceLayer=yd(this.serviceLayer),this.stylesWatch=yd(this.stylesWatch)}whenAPI(){return this.api?Promise.resolve(this.api):(this.apiPromise??=LC()).promise}async startImpl(){const{shadowRoot:t,hostElement:r,elementOptions:n,overrides:o}=this.options,i=this.config=await pV(r,n,o);this.checkAbort(),Gr.debug("Application config is",i);const s=await gP(n.appMetadata,i.locale);this.checkAbort();const a=this.container=wb(s.locale),l=this.initStyles();t.replaceChildren(a,...l);const{serviceLayer:u,packages:c}=this.initServiceLayer({container:a,properties:i.properties,i18n:s});this.lifecycleEvents=kb(u,vp),await this.initAPI(u),this.checkAbort(),this.reactIntegration=Ca.createForApp({rootNode:a,container:t,theme:n.theme,serviceLayer:u,packages:c});const d=this.options.elementOptions.component??yV;this.reactIntegration.render(w.createElement(d)),this.state="started",this.triggerApplicationLifecycleEvent("after-start"),Gr.debug("Application started")}initStyles(){const t=":host { all: initial; display: block; }",r=document.createElement("style");Eb(r,{value:t});const n=this.options.elementOptions.appMetadata?.styles,o=document.createElement("style");return Eb(o,n),[r,o]}initServiceLayer(t){const{hostElement:r,shadowRoot:n,elementOptions:o,restart:i}=this.options,{container:s,properties:a,i18n:l}=t,u=o.appMetadata?.packages??{},c=_P({host:r,shadowRoot:n,container:s,locale:l.locale,supportedLocales:l.supportedMessageLocales,changeLocale(g){const y=l.supportedMessageLocales;if(g!=null&&!l.supportsLocale(g))throw new F(j.UNSUPPORTED_LOCALE,`Unsupported locale '${g}' (supported locales: ${y.join(", ")}).`);i({locale:g})}}),{serviceLayer:d,packages:f}=hV({packageMetadata:u,builtinPackage:c,properties:a,i18n:l});return this.serviceLayer=d,Gr.isDebug()&&Gr.debug("Launching service layer with packages",Object.fromEntries(f)),d.start(),{serviceLayer:d,packages:f}}async initAPI(t){const r=kb(t,yp);try{const n=this.api=await r.getApi();Gr.debug("Application API initialized to",n),this.apiPromise?.resolve(n)}catch(n){throw new F(j.INTERNAL,"Failed to gather the application's API methods.",{cause:n})}}triggerApplicationLifecycleEvent(t){this.lifecycleEvents?.emitLifecycleEvent(t)}checkAbort(){this.state==="destroyed"&&TC()}showErrorScreen(t){const{shadowRoot:r,elementOptions:n}=this.options,o=s1(),i=new i1(Object.keys(Pf)),{locale:s,messageLocale:a}=i.pickSupportedLocale(void 0,o),l=this.container=wb(s);l.classList.add("pioneer-root-error-screen");const u=Pf[a]??Pf.en,c=gp(s,u);this.reactIntegration=Ca.createForErrorScreen({rootNode:l,container:r,theme:n.theme}),this.reactIntegration.render(w.createElement(dV,{intl:c,error:t})),r.replaceChildren(l)}}function wb(e){const t=document.createElement("div");return t.classList.add("pioneer-root"),t.style.minHeight="100%",t.style.height="100%",e&&(t.lang=e),t}function hV(e){const{packageMetadata:t,properties:r,builtinPackage:n,i18n:o}=e;let i;try{i=BC(t??{},o,r)}catch(l){throw new F(j.INVALID_METADATA,"Failed to parse package metadata.",{cause:l})}{const l=i.findIndex(u=>u.name===n.name);l>=0&&i.splice(l,1),i.push(n)}const s=[{interfaceName:yp},{interfaceName:vp},{interfaceName:PP,all:!0}],a=new RP(i,s);return{packages:new Map(i.map(l=>[l.name,l])),serviceLayer:a}}function kb(e,t){const r=e.getService("@open-pioneer/runtime",{interfaceName:t},{ignoreDeclarationCheck:!0});if(r.type!=="found")throw new F(j.INTERNAL,`Failed to find instance of '${t}' (result type '${r.type}'). This is a builtin service that must be present exactly once.`);return r.value.getInstanceOrThrow()}async function pV(e,t,r){let n;try{const i=t.config??{},s=await t.resolveConfig?.({hostElement:e,getAttribute(a){return e.getAttribute(a)??void 0}})??{};n=[i,s]}catch(i){throw new F(j.CONFIG_RESOLUTION_FAILED,"Failed to resolve application properties.",{cause:i})}const o=mV(n);return r?.locale&&(o.locale=r.locale),o}function mV(e){const t=Object.assign({locale:void 0,properties:{}},...e),r=t.properties={};for(const n of e)for(const[o,i]of Object.entries(n.properties??{})){const s=r[o]??={};Object.assign(s,i)}return t}function Eb(e,t){let r=t?.value??"";r=r.replace(/\/\*# sourceMappingURL=.*$/,"");const n=document.createTextNode(r);e.replaceChildren(n)}function gV(e){if(e instanceof F){const t=EC(e).reverse();if(t.length===1){console.error(e);return}let r=1;for(const n of t)console.error(`#${r}`,n),++r}else console.error("Unexpected error",e)}function yV(){return null}function FV(e){return{value:e}}export{IN as $,gm as A,Ok as B,yd as C,Lx as D,F as E,BV as F,TC as G,MV as H,Ua as I,xd as J,_x as K,Px as L,i2 as M,zj as N,Ze as O,ku as P,Zi as Q,fm as R,Yk as S,PV as T,EV as U,Kk as V,Vi as W,IV as X,gt as Y,ZP as Z,CV as _,FV as a,_V as a0,Ru as a1,cg as a2,RN as a3,hm as a4,AV as a5,kV as a6,kC as a7,Sp as a8,xu as a9,wu as aa,u0 as ab,zP as ac,jP as ad,wV as ae,xV as af,fg as ag,iV as ah,Zk as ai,ap as aj,sV as ak,j as al,B as am,SV as an,al as ao,gF as b,Ma as c,LC as d,Nb as e,zV as f,ke as g,xr as h,CC as i,A as j,Ao as k,Sr as l,XP as m,c1 as n,zi as o,ym as p,DV as q,w as r,TV as s,i0 as t,H3 as u,Ds as v,Rr as w,J3 as x,F3 as y,NV as z}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/B6P_btgblpGb.js b/openlayers-base-packages/pr-previews/pr-377/assets/B6P_btgblpGb.js deleted file mode 100644 index 67e7265..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/B6P_btgblpGb.js +++ /dev/null @@ -1 +0,0 @@ -import{J as ye,j as f,g as x,a6 as ve,a7 as $,r as s,a8 as X,a9 as Ce,p as o,O as d,N as re,Z as Q,h as ge,u as xe,o as we,R as Ee,aa as Se,m as Ie}from"./DbBkdn6FNbgs.js";import{c as Pe}from"./CwYOJLhODXKJ.js";const[et,Le]=ye({name:"CheckboxGroupContext",strict:!1});function De(e){return f.jsx(x.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:f.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function Ae(e){return f.jsx(x.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:f.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function Fe(e){const{isIndeterminate:r,isChecked:n,...a}=e,h=r?Ae:De;return n||r?f.jsx(x.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:f.jsx(h,{...a})}):null}var Me=()=>typeof document<"u",ie=!1,B=null,y=!1,J=!1,Z=new Set;function Y(e,r){Z.forEach(n=>n(e,r))}var Be=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Re(e){return!(e.metaKey||!Be&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function ce(e){y=!0,Re(e)&&(B="keyboard",Y("keyboard",e))}function g(e){if(B="pointer",e.type==="mousedown"||e.type==="pointerdown"){y=!0;const r=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=r.matches(":focus-visible")}catch{}if(n)return;Y("pointer",e)}}function je(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function _e(e){je(e)&&(y=!0,B="virtual")}function Ke(e){e.target===window||e.target===document||e.target instanceof Element&&e.target.hasAttribute("tabindex")||(!y&&!J&&(B="virtual",Y("virtual",e)),y=!1,J=!1)}function Ne(){y=!1,J=!0}function le(){return B!=="pointer"}function Te(){if(!Me()||ie)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){y=!0,e.apply(this,n)},document.addEventListener("keydown",ce,!0),document.addEventListener("keyup",ce,!0),document.addEventListener("click",_e,!0),window.addEventListener("focus",Ke,!0),window.addEventListener("blur",Ne,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",g,!0),document.addEventListener("pointermove",g,!0),document.addEventListener("pointerup",g,!0)):(document.addEventListener("mousedown",g,!0),document.addEventListener("mousemove",g,!0),document.addEventListener("mouseup",g,!0)),ie=!0}function He(e){Te(),e(le());const r=()=>e(le());return Z.add(r),()=>{Z.delete(r)}}const Ue={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Ve(e={}){const r=Pe(e),{isDisabled:n,isReadOnly:a,isRequired:h,isInvalid:i,id:b,onBlur:U,onFocus:V,"aria-describedby":w}=r,{defaultChecked:E,isChecked:S,isFocusable:O,onChange:W,isIndeterminate:u,name:I,value:R,tabIndex:j=void 0,"aria-label":P,"aria-labelledby":L,"aria-invalid":p,...q}=e,D=ve(q,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),_=$(W),K=$(U),A=$(V),[v,G]=s.useState(!1),[k,N]=s.useState(!1),[F,ee]=s.useState(!1),[M,C]=s.useState(!1);s.useEffect(()=>He(G),[]);const m=s.useRef(null),[te,ue]=s.useState(!0),[de,T]=s.useState(!!E),z=S!==void 0,c=z?S:de,ne=s.useCallback(t=>{if(a||n){t.preventDefault();return}z||T(c?t.currentTarget.checked:u?!0:t.currentTarget.checked),_?.(t)},[a,n,c,z,u,_]);X(()=>{m.current&&(m.current.indeterminate=!!u)},[u]),Ce(()=>{n&&N(!1)},[n,N]),X(()=>{const t=m.current;if(!t?.form)return;const l=()=>{T(!!E)};return t.form.addEventListener("reset",l),()=>t.form?.removeEventListener("reset",l)},[]);const oe=n&&!O,ae=s.useCallback(t=>{t.key===" "&&C(!0)},[C]),se=s.useCallback(t=>{t.key===" "&&C(!1)},[C]);X(()=>{if(!m.current)return;m.current.checked!==c&&T(m.current.checked)},[m.current]);const fe=s.useCallback((t={},l=null)=>{const H=be=>{k&&be.preventDefault(),C(!0)};return{...t,ref:l,"data-active":o(M),"data-hover":o(F),"data-checked":o(c),"data-focus":o(k),"data-focus-visible":o(k&&v),"data-indeterminate":o(u),"data-disabled":o(n),"data-invalid":o(i),"data-readonly":o(a),"aria-hidden":!0,onMouseDown:d(t.onMouseDown,H),onMouseUp:d(t.onMouseUp,()=>C(!1)),onMouseEnter:d(t.onMouseEnter,()=>ee(!0)),onMouseLeave:d(t.onMouseLeave,()=>ee(!1))}},[M,c,n,k,v,F,u,i,a]),me=s.useCallback((t={},l=null)=>({...t,ref:l,"data-active":o(M),"data-hover":o(F),"data-checked":o(c),"data-focus":o(k),"data-focus-visible":o(k&&v),"data-indeterminate":o(u),"data-disabled":o(n),"data-invalid":o(i),"data-readonly":o(a)}),[M,c,n,k,v,F,u,i,a]),he=s.useCallback((t={},l=null)=>({...D,...t,ref:re(l,H=>{H&&ue(H.tagName==="LABEL")}),onClick:d(t.onClick,()=>{te||(m.current?.click(),requestAnimationFrame(()=>{m.current?.focus({preventScroll:!0})}))}),"data-disabled":o(n),"data-checked":o(c),"data-invalid":o(i)}),[D,n,c,i,te]),pe=s.useCallback((t={},l=null)=>({...t,ref:re(m,l),type:"checkbox",name:I,value:R,id:b,tabIndex:j,onChange:d(t.onChange,ne),onBlur:d(t.onBlur,K,()=>N(!1)),onFocus:d(t.onFocus,A,()=>N(!0)),onKeyDown:d(t.onKeyDown,ae),onKeyUp:d(t.onKeyUp,se),required:h,checked:c,disabled:oe,readOnly:a,"aria-label":P,"aria-labelledby":L,"aria-invalid":p?!!p:i,"aria-describedby":w,"aria-disabled":n,style:Ue}),[I,R,b,ne,K,A,ae,se,h,c,oe,a,P,L,p,i,w,n,j]),ke=s.useCallback((t={},l=null)=>({...t,ref:l,onMouseDown:d(t.onMouseDown,Oe),"data-disabled":o(n),"data-checked":o(c),"data-invalid":o(i)}),[c,n,i]);return{state:{isInvalid:i,isFocused:k,isChecked:c,isActive:M,isHovered:F,isIndeterminate:u,isDisabled:n,isReadOnly:a,isRequired:h},getRootProps:he,getCheckboxProps:fe,getIndicatorProps:me,getInputProps:pe,getLabelProps:ke,htmlProps:D}}function Oe(e){e.preventDefault(),e.stopPropagation()}function We(e){const[r,n]=s.useState(e),[a,h]=s.useState(!1);return e!==r&&(h(!0),n(e)),a}const qe={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},Ge={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},ze=Q({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),$e=Q({from:{opacity:0},to:{opacity:1}}),Xe=Q({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Je=ge(function(r,n){const a=Le(),h={...a,...r},i=xe("Checkbox",h),b=we(r),{spacing:U="0.5rem",className:V,children:w,iconColor:E,iconSize:S,icon:O=f.jsx(Fe,{}),isChecked:W,isDisabled:u=a?.isDisabled,onChange:I,inputProps:R,...j}=b;let P=W;a?.value&&b.value&&(P=a.value.includes(b.value));let L=I;a?.onChange&&b.value&&(L=Ee(a.onChange,I));const{state:p,getInputProps:q,getCheckboxProps:D,getLabelProps:_,getRootProps:K}=Ve({...j,isDisabled:u,isChecked:P,onChange:L}),A=We(p.isChecked),v=s.useMemo(()=>({animation:A?p.isIndeterminate?`${$e} 20ms linear, ${Xe} 200ms linear`:`${ze} 200ms linear`:void 0,...i.icon,...Se({fontSize:S,color:E})}),[E,S,A,p.isIndeterminate,i.icon]),G=s.cloneElement(O,{__css:v,isIndeterminate:p.isIndeterminate,isChecked:p.isChecked});return f.jsxs(x.label,{__css:{...Ge,...i.container},className:Ie("chakra-checkbox",V),...K(),children:[f.jsx("input",{className:"chakra-checkbox__input",...q(R,n)}),f.jsx(x.span,{__css:{...qe,...i.control},className:"chakra-checkbox__control",...D(),children:G}),w&&f.jsx(x.span,{className:"chakra-checkbox__label",..._(),__css:{marginStart:U,...i.label},children:w})]})});Je.displayName="Checkbox";export{Je as C,He as t,Ue as v}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/C520TGz1zAm6.js b/openlayers-base-packages/pr-previews/pr-377/assets/BFY0X3gkqjoN.js similarity index 60% rename from openlayers-base-packages/pr-previews/pr-377/assets/C520TGz1zAm6.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BFY0X3gkqjoN.js index 59e265c..76a702f 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/C520TGz1zAm6.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BFY0X3gkqjoN.js @@ -1 +1 @@ -import{h as r,j as s,S as o}from"./DbBkdn6FNbgs.js";const e=r((a,t)=>s.jsx(o,{align:"center",...a,direction:"row",ref:t}));e.displayName="HStack";export{e as H}; +import{h as r,j as s,S as o}from"./B60Dx_GOYdnk.js";const e=r((a,t)=>s.jsx(o,{align:"center",...a,direction:"row",ref:t}));e.displayName="HStack";export{e as H}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/BSXAw6dYwqdy.js b/openlayers-base-packages/pr-previews/pr-377/assets/BFqpayjr3qWr.js similarity index 95% rename from openlayers-base-packages/pr-previews/pr-377/assets/BSXAw6dYwqdy.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BFqpayjr3qWr.js index f1d1222..5d97d4a 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/BSXAw6dYwqdy.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BFqpayjr3qWr.js @@ -1 +1 @@ -import{a as E,r as n,j as e,B as N,S as g,b as s,F,V as U,l as A,g as D,f as H}from"./DbBkdn6FNbgs.js";import{t as B}from"./CFax2WnWeOWk.js";import{S as V,T as q,O as W,M as $,H as X,k as y,g as Y,h as Z,l as J,m as j}from"./DyxVjgSvwe-K.js";import{_ as S}from"./CmsKOCeNyeyo.js";import{a as z,b as u,R as K}from"./VXuNJBviGPoL.js";import{a as Q,C as ee,b as oe,M as p}from"./Ca8Zt9kwahLC.js";import{T as L,U as re,a as c}from"./CL68Tre-iuri.js";import{M as te}from"./35mnA9_wxNJd.js";import{F as C}from"./CwYOJLhODXKJ.js";import{F as I}from"./Ch2CPfq1SbGd.js";import{C as ie}from"./B6P_btgblpGb.js";import"./DjAArQ67Dgmx.js";import"./CCXTS-icusD6.js";const G="main";class le{mapId=G;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new V({title:"OSM",isBaseLayer:!0,olLayer:new q({source:new W})})]}}}const ne={"result-list-app":{name:"result-list-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:le,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:$,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:X,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}}},ae=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',se=["en","de"];function pe(o){switch(o){case"en":return S(()=>import("./CWewJjE-xeCE.js"),[],import.meta.url).then(i=>i.default);case"de":return S(()=>import("./BbSw8Fldfnox.js"),[],import.meta.url).then(i=>i.default)}throw new Error(`Unsupported locale: '${o}'`)}const ce=E(ae),de=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:pe,locales:se,packages:ne,styles:ce},Symbol.toStringTag,{value:"Module"})),M=400;function ue(){const[o,i]=n.useState(0),[r,x]=n.useState(),[T,m]=n.useState(!1),[d,R]=n.useState(!1),[h,_]=n.useState("multi"),[v,f]=n.useState("checkbox"),w=!!r&&T,a=l=>{x(l),m(!0),i(o+1)},k=n.useMemo(()=>{if(!r||!d)return r;const l=r.columns.filter((b,P)=>P%2==1);return{...r,columns:l}},[d,r]);return e.jsx(y,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(Y,{title:e.jsx(N,{textAlign:"center",py:1,children:e.jsx(Z,{size:"md",children:"OpenLayers Base Packages - Result List"})}),children:e.jsxs(y,{flex:"1",direction:"column",position:"relative",children:[e.jsxs(J,{mapId:G,viewPadding:{bottom:w?M:0},children:[e.jsx(j,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsx(N,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:e.jsxs(g,{children:[e.jsx(L,{align:"center",children:"Test Controls:"}),e.jsxs(te,{placement:"right-end",children:[e.jsx(Q,{as:s,rightIcon:e.jsx(ee,{}),children:"Fill result list"}),e.jsx(F,{children:e.jsxs(oe,{children:[e.jsx(p,{onClick:()=>a(he),children:"Persons"}),e.jsx(p,{onClick:()=>a(Ne),children:"Custom render"}),e.jsx(p,{onClick:()=>a(be),children:"Generated"}),e.jsx(p,{onClick:()=>a(Le),children:"Long Strings"}),e.jsx(p,{onClick:()=>a(Oe),children:"Many Columns"})]})})]}),e.jsxs(s,{onClick:()=>R(!d),children:[d?"Show":"Hide"," even columns"]}),e.jsx(s,{isDisabled:r===void 0,onClick:()=>m(!0),children:"Show result list"}),e.jsx(s,{onClick:()=>m(!1),children:"Hide result list"}),e.jsx(s,{isDisabled:r===void 0,onClick:()=>x(void 0),children:"Close result list"}),e.jsxs(C,{children:[e.jsx(I,{children:"Selection mode"}),e.jsx(z,{value:h,onChange:l=>{const b=l;_(b),f(b==="single"?"radio":"checkbox")},children:e.jsxs(g,{direction:"row",children:[e.jsx(u,{value:"single",children:"Single"}),e.jsx(u,{value:"multi",children:"Multi"})]})})]}),e.jsxs(C,{children:[e.jsx(I,{children:"Selection style"}),e.jsx(z,{value:v,onChange:l=>{f(l)},children:e.jsxs(g,{direction:"row",children:[e.jsx(u,{value:"radio",isDisabled:h==="multi",children:"Radio"}),e.jsx(u,{value:"checkbox",children:"Checkbox"})]})})]})]})})}),e.jsx(j,{position:"top-right",horizontalGap:10,verticalGap:10,children:e.jsxs(U,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",maxHeight:"300px",overflow:"auto",children:[e.jsx(L,{as:"b",children:"Description"}),e.jsx(L,{children:"This application can be used to test the result list component. Internally, this application keeps track of the current result list input and displays it when the component shall be shown."}),e.jsxs(re,{children:[e.jsx(c,{children:"If the result list has been filled, it can be hidden and shown again while preserving the state (selection, sort, scroll, ...)."}),e.jsx(c,{children:"The result list is embedded with a fixed height (with internal scrolling) above the map (using view padding). Showing or hiding the component will animate the view."}),e.jsx(c,{children:"Toggling columns will preserve the state of the result list."}),e.jsx(c,{children:"Filling the result list again resets the state (even when using equal data)."}),e.jsx(c,{children:"Fully closing the result list drops all state."})]})]})})]}),k&&e.jsx(N,{position:"absolute",visibility:w?"visible":"hidden",bottom:"0",backgroundColor:"white",width:"100%",height:`${M}px`,borderTop:"2px solid",borderColor:"trails.500",zIndex:1,children:e.jsx(K,{mapId:G,input:k,selectionMode:h,selectionStyle:v},String(o))})]})})})}let me=1;function t(o,i,r){return{id:String(me++),properties:{name:o,age:i,city:r}}}const he={data:[t("Test User A",21,"Cologne"),t("Test User B",33,"Berlin"),t("Test User C",44,"New York"),t("Test User D",55,"London"),t("Test User E",8,"Rome"),t("Test User F",14,"Vienna"),t("Test User G",17,"Paris"),t("Test User H",27,"Brussels"),t("Test User I",19,"Warsaw")],columns:[{displayName:"id",getPropertyValue(o){return o.id}},{propertyName:"name"},{propertyName:"age"},{propertyName:"city"}]},be={data:Array.from(Array(100).keys()).map(o=>({id:o,properties:{boolean:o%2==0,empty:o%2==0?null:void 0,number:o,float:o/7,string:`Item ${o}`,date:new Date}})),columns:[{propertyName:"boolean"},{propertyName:"number"},{propertyName:"float"},{propertyName:"string"},{propertyName:"date"},{propertyName:"empty"}],formatOptions:{numberOptions:{maximumFractionDigits:2},dateOptions:{timeStyle:"full",dateStyle:"full",timeZone:"UTC"}}},Ne={data:[{id:1,properties:{bool:!0}},{id:2,properties:{bool:!1}},{id:3,properties:{bool:void 0}}],columns:[{displayName:"id (with tooltip)",getPropertyValue(o){return o.id},renderCell({feature:o}){return e.jsx(ge,{id:o.id})}},{displayName:"boolean as checkbox (read only)",propertyName:"bool",renderCell({value:o}){return e.jsx(ie,{isIndeterminate:o===void 0,isChecked:!!o})}}]};function ge(o){return e.jsx(A,{label:`tooltip for feature ${o.id}`,placement:"top",children:e.jsx(D.span,{children:o.id})})}const Le={data:[{id:1,properties:{short:"Short 1",long:"LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG "}},{id:2,properties:{short:"Short 2",long:"LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG"}}],columns:[{propertyName:"short"},{propertyName:"long",width:300}]},Oe={columns:[{propertyName:"a"},{propertyName:"b"},{propertyName:"c"},{propertyName:"d"},{propertyName:"e"},{propertyName:"f"},{propertyName:"g"},{propertyName:"h"},{propertyName:"i"}],data:[{id:0,properties:{a:1,b:1,c:1,d:1,e:1,f:1,g:1,h:1,i:1}}]},Ge=new URLSearchParams(window.location.search),O=Ge.get("lang"),xe=H({component:ue,theme:B,appMetadata:de,config:{locale:O==="de"||O==="en"?O:void 0}});customElements.define("result-list-app",xe); +import{a as E,r as n,j as e,B as N,S as g,b as s,F,V as U,q as A,g as D,f as H}from"./B60Dx_GOYdnk.js";import{t as B}from"./DjS5-7IPlotu.js";import{S as V,T as q,O as W,M as $,H as X,k as y,g as Y,h as Z,l as J,m as j}from"./j0mck_Meu7Xh.js";import{_ as S}from"./CmsKOCeNyeyo.js";import{a as z,b as u,R as K}from"./CbxgmwRI74qQ.js";import{a as Q,C as ee,b as oe,M as p}from"./CMfwYEDRd35m.js";import{T as L,U as re,a as c}from"./BKR6R-cAnIXt.js";import{M as te}from"./C9VJq5Ka7299.js";import{F as C}from"./vepZWq5kkQUw.js";import{F as I}from"./Dko_2nwYwIor.js";import{C as ie}from"./CG5nmvkyugDn.js";import"./BlACKGYldMfy.js";import"./BpQSjk0kyblh.js";const G="main";class le{mapId=G;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new V({title:"OSM",isBaseLayer:!0,olLayer:new q({source:new W})})]}}}const ne={"result-list-app":{name:"result-list-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:le,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:$,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:X,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}}},ae=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',se=["en","de"];function pe(o){switch(o){case"en":return S(()=>import("./CWewJjE-xeCE.js"),[],import.meta.url).then(i=>i.default);case"de":return S(()=>import("./BbSw8Fldfnox.js"),[],import.meta.url).then(i=>i.default)}throw new Error(`Unsupported locale: '${o}'`)}const ce=E(ae),de=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:pe,locales:se,packages:ne,styles:ce},Symbol.toStringTag,{value:"Module"})),M=400;function ue(){const[o,i]=n.useState(0),[r,x]=n.useState(),[T,m]=n.useState(!1),[d,R]=n.useState(!1),[h,_]=n.useState("multi"),[v,f]=n.useState("checkbox"),w=!!r&&T,a=l=>{x(l),m(!0),i(o+1)},k=n.useMemo(()=>{if(!r||!d)return r;const l=r.columns.filter((b,P)=>P%2==1);return{...r,columns:l}},[d,r]);return e.jsx(y,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(Y,{title:e.jsx(N,{textAlign:"center",py:1,children:e.jsx(Z,{size:"md",children:"OpenLayers Base Packages - Result List"})}),children:e.jsxs(y,{flex:"1",direction:"column",position:"relative",children:[e.jsxs(J,{mapId:G,viewPadding:{bottom:w?M:0},children:[e.jsx(j,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsx(N,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:e.jsxs(g,{children:[e.jsx(L,{align:"center",children:"Test Controls:"}),e.jsxs(te,{placement:"right-end",children:[e.jsx(Q,{as:s,rightIcon:e.jsx(ee,{}),children:"Fill result list"}),e.jsx(F,{children:e.jsxs(oe,{children:[e.jsx(p,{onClick:()=>a(he),children:"Persons"}),e.jsx(p,{onClick:()=>a(Ne),children:"Custom render"}),e.jsx(p,{onClick:()=>a(be),children:"Generated"}),e.jsx(p,{onClick:()=>a(Le),children:"Long Strings"}),e.jsx(p,{onClick:()=>a(Oe),children:"Many Columns"})]})})]}),e.jsxs(s,{onClick:()=>R(!d),children:[d?"Show":"Hide"," even columns"]}),e.jsx(s,{isDisabled:r===void 0,onClick:()=>m(!0),children:"Show result list"}),e.jsx(s,{onClick:()=>m(!1),children:"Hide result list"}),e.jsx(s,{isDisabled:r===void 0,onClick:()=>x(void 0),children:"Close result list"}),e.jsxs(C,{children:[e.jsx(I,{children:"Selection mode"}),e.jsx(z,{value:h,onChange:l=>{const b=l;_(b),f(b==="single"?"radio":"checkbox")},children:e.jsxs(g,{direction:"row",children:[e.jsx(u,{value:"single",children:"Single"}),e.jsx(u,{value:"multi",children:"Multi"})]})})]}),e.jsxs(C,{children:[e.jsx(I,{children:"Selection style"}),e.jsx(z,{value:v,onChange:l=>{f(l)},children:e.jsxs(g,{direction:"row",children:[e.jsx(u,{value:"radio",isDisabled:h==="multi",children:"Radio"}),e.jsx(u,{value:"checkbox",children:"Checkbox"})]})})]})]})})}),e.jsx(j,{position:"top-right",horizontalGap:10,verticalGap:10,children:e.jsxs(U,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",maxHeight:"300px",overflow:"auto",children:[e.jsx(L,{as:"b",children:"Description"}),e.jsx(L,{children:"This application can be used to test the result list component. Internally, this application keeps track of the current result list input and displays it when the component shall be shown."}),e.jsxs(re,{children:[e.jsx(c,{children:"If the result list has been filled, it can be hidden and shown again while preserving the state (selection, sort, scroll, ...)."}),e.jsx(c,{children:"The result list is embedded with a fixed height (with internal scrolling) above the map (using view padding). Showing or hiding the component will animate the view."}),e.jsx(c,{children:"Toggling columns will preserve the state of the result list."}),e.jsx(c,{children:"Filling the result list again resets the state (even when using equal data)."}),e.jsx(c,{children:"Fully closing the result list drops all state."})]})]})})]}),k&&e.jsx(N,{position:"absolute",visibility:w?"visible":"hidden",bottom:"0",backgroundColor:"white",width:"100%",height:`${M}px`,borderTop:"2px solid",borderColor:"trails.500",zIndex:1,children:e.jsx(K,{mapId:G,input:k,selectionMode:h,selectionStyle:v},String(o))})]})})})}let me=1;function t(o,i,r){return{id:String(me++),properties:{name:o,age:i,city:r}}}const he={data:[t("Test User A",21,"Cologne"),t("Test User B",33,"Berlin"),t("Test User C",44,"New York"),t("Test User D",55,"London"),t("Test User E",8,"Rome"),t("Test User F",14,"Vienna"),t("Test User G",17,"Paris"),t("Test User H",27,"Brussels"),t("Test User I",19,"Warsaw")],columns:[{displayName:"id",getPropertyValue(o){return o.id}},{propertyName:"name"},{propertyName:"age"},{propertyName:"city"}]},be={data:Array.from(Array(100).keys()).map(o=>({id:o,properties:{boolean:o%2==0,empty:o%2==0?null:void 0,number:o,float:o/7,string:`Item ${o}`,date:new Date}})),columns:[{propertyName:"boolean"},{propertyName:"number"},{propertyName:"float"},{propertyName:"string"},{propertyName:"date"},{propertyName:"empty"}],formatOptions:{numberOptions:{maximumFractionDigits:2},dateOptions:{timeStyle:"full",dateStyle:"full",timeZone:"UTC"}}},Ne={data:[{id:1,properties:{bool:!0}},{id:2,properties:{bool:!1}},{id:3,properties:{bool:void 0}}],columns:[{displayName:"id (with tooltip)",getPropertyValue(o){return o.id},renderCell({feature:o}){return e.jsx(ge,{id:o.id})}},{displayName:"boolean as checkbox (read only)",propertyName:"bool",renderCell({value:o}){return e.jsx(ie,{isIndeterminate:o===void 0,isChecked:!!o})}}]};function ge(o){return e.jsx(A,{label:`tooltip for feature ${o.id}`,placement:"top",children:e.jsx(D.span,{children:o.id})})}const Le={data:[{id:1,properties:{short:"Short 1",long:"LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG LONG "}},{id:2,properties:{short:"Short 2",long:"LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG"}}],columns:[{propertyName:"short"},{propertyName:"long",width:300}]},Oe={columns:[{propertyName:"a"},{propertyName:"b"},{propertyName:"c"},{propertyName:"d"},{propertyName:"e"},{propertyName:"f"},{propertyName:"g"},{propertyName:"h"},{propertyName:"i"}],data:[{id:0,properties:{a:1,b:1,c:1,d:1,e:1,f:1,g:1,h:1,i:1}}]},Ge=new URLSearchParams(window.location.search),O=Ge.get("lang"),xe=H({component:ue,theme:B,appMetadata:de,config:{locale:O==="de"||O==="en"?O:void 0}});customElements.define("result-list-app",xe); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/BKR6R-cAnIXt.js b/openlayers-base-packages/pr-previews/pr-377/assets/BKR6R-cAnIXt.js new file mode 100644 index 0000000..eb7df4c --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BKR6R-cAnIXt.js @@ -0,0 +1 @@ +import{k as f,h as a,u as S,o as x,m as T,j as n,g as d,I as h,W as p,n as j,l as N}from"./B60Dx_GOYdnk.js";const[I,L]=f({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),m=a(function(s,e){const t=S("List",s),{children:o,styleType:y="none",stylePosition:u,spacing:r,...c}=x(s),l=T(o),g=r?{["& > *:not(style) ~ *:not(style)"]:{mt:r}}:{};return n.jsx(I,{value:t,children:n.jsx(d.ul,{ref:e,listStyleType:y,listStylePosition:u,role:"list",__css:{...t.container,...g},...c,children:l})})});m.displayName="List";const _=a((i,s)=>{const{as:e,...t}=i;return n.jsx(m,{ref:s,as:"ol",styleType:"decimal",marginStart:"1em",...t})});_.displayName="OrderedList";const C=a(function(s,e){const{as:t,...o}=s;return n.jsx(m,{ref:e,as:"ul",styleType:"initial",marginStart:"1em",...o})});C.displayName="UnorderedList";const P=a(function(s,e){const t=L();return n.jsx(d.li,{ref:e,...s,__css:t.item})});P.displayName="ListItem";const U=a(function(s,e){const t=L();return n.jsx(h,{ref:e,role:"presentation",...s,__css:t.icon})});U.displayName="ListIcon";const k=a(function(s,e){const t=p("Text",s),{className:o,align:y,decoration:u,casing:r,...c}=x(s),l=j({textAlign:s.align,textDecoration:s.decoration,textTransform:s.casing});return n.jsx(d.p,{ref:e,className:N("chakra-text",s.className),...l,...c,__css:t})});k.displayName="Text";export{m as L,k as T,C as U,P as a}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CJwLdrVebURZ.js b/openlayers-base-packages/pr-previews/pr-377/assets/BLfEaHvmX9OI.js similarity index 97% rename from openlayers-base-packages/pr-previews/pr-377/assets/CJwLdrVebURZ.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BLfEaHvmX9OI.js index 874c7a3..096b248 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CJwLdrVebURZ.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BLfEaHvmX9OI.js @@ -1 +1 @@ -import{bQ as l}from"./DyxVjgSvwe-K.js";import{G as t}from"./DnYPVZQRsXfx.js";const o=l;function c(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M156,40a12,12,0,0,1-12,12H112a12,12,0,0,1,0-24h32A12,12,0,0,1,156,40ZM144,204H112a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24ZM204,52V72a12,12,0,0,0,24,0V48a20,20,0,0,0-20-20H184a12,12,0,0,0,0,24Zm12,48a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V112A12,12,0,0,0,216,100ZM40,156a12,12,0,0,0,12-12V112a12,12,0,0,0-24,0v32A12,12,0,0,0,40,156Zm32,48H52V184a12,12,0,0,0-24,0v24a20,20,0,0,0,20,20H72a12,12,0,0,0,0-24ZM72,28H48A20,20,0,0,0,28,48V72a12,12,0,0,0,24,0V52H72a12,12,0,0,0,0-24ZM240,204H228V192a12,12,0,0,0-24,0v12H192a12,12,0,0,0,0,24h12v12a12,12,0,0,0,24,0V228h12a12,12,0,0,0,0-24Z"},child:[]}]})(a)}function h(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z"},child:[]}]})(a)}function n(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,42H72A14,14,0,0,0,58,56V74H40A14,14,0,0,0,26,88V200a14,14,0,0,0,14,14H184a14,14,0,0,0,14-14V182h18a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM70,56a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2v67.57L204.53,110.1a14,14,0,0,0-19.8,0l-21.42,21.41L117.9,86.1a14,14,0,0,0-19.8,0L70,114.2ZM186,200a2,2,0,0,1-2,2H40a2,2,0,0,1-2-2V88a2,2,0,0,1,2-2H58v82a14,14,0,0,0,14,14H186Zm30-30H72a2,2,0,0,1-2-2V131.17l36.58-36.58a2,2,0,0,1,2.83,0l49.66,49.66a6,6,0,0,0,8.49,0l25.65-25.66a2,2,0,0,1,2.83,0l22,22V168A2,2,0,0,1,216,170ZM162,84a10,10,0,1,1,10,10A10,10,0,0,1,162,84Z"},child:[]}]})(a)}function H(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128ZM40,70H216a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12ZM216,186H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z"},child:[]}]})(a)}function Z(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M214.67,74H198V40a6,6,0,0,0-6-6H64a6,6,0,0,0-6,6V74H41.33C28.47,74,18,83.87,18,96v80a6,6,0,0,0,6,6H58v34a6,6,0,0,0,6,6H192a6,6,0,0,0,6-6V182h34a6,6,0,0,0,6-6V96C238,83.87,227.53,74,214.67,74ZM70,46H186V74H70ZM186,210H70V158H186Zm40-40H198V152a6,6,0,0,0-6-6H64a6,6,0,0,0-6,6v18H30V96c0-5.51,5.08-10,11.33-10H214.67C220.92,86,226,90.49,226,96Zm-28-54a10,10,0,1,1-10-10A10,10,0,0,1,198,116Z"},child:[]}]})(a)}function e(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M233.91,74.79,181.22,22.1a14,14,0,0,0-19.8,0L22.09,161.41a14,14,0,0,0,0,19.8L74.78,233.9a14,14,0,0,0,19.8,0L233.91,94.59A14,14,0,0,0,233.91,74.79ZM225.42,86.1,86.1,225.41h0a2,2,0,0,1-2.83,0L30.58,172.73a2,2,0,0,1,0-2.83L64,136.48l27.76,27.76a6,6,0,1,0,8.48-8.48L72.48,128,96,104.48l27.76,27.76a6,6,0,0,0,8.48-8.48L104.48,96,128,72.49l27.76,27.75a6,6,0,0,0,8.48-8.48L136.49,64,169.9,30.59a2,2,0,0,1,2.83,0l52.69,52.68A2,2,0,0,1,225.42,86.1Z"},child:[]}]})(a)}function g(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"},child:[]}]})(a)}function L(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M88,24V16a8,8,0,0,1,16,0v8a8,8,0,0,1-16,0ZM16,104h8a8,8,0,0,0,0-16H16a8,8,0,0,0,0,16ZM124.42,39.16a8,8,0,0,0,10.74-3.58l8-16a8,8,0,0,0-14.31-7.16l-8,16A8,8,0,0,0,124.42,39.16Zm-96,81.69-16,8a8,8,0,0,0,7.16,14.31l16-8a8,8,0,1,0-7.16-14.31ZM219.31,184a16,16,0,0,1,0,22.63l-12.68,12.68a16,16,0,0,1-22.63,0L132.7,168,115,214.09c0,.1-.08.21-.13.32a15.83,15.83,0,0,1-14.6,9.59l-.79,0a15.83,15.83,0,0,1-14.41-11L32.8,52.92A16,16,0,0,1,52.92,32.8L213,85.07a16,16,0,0,1,1.41,29.8l-.32.13L168,132.69ZM208,195.31,156.69,144h0a16,16,0,0,1,4.93-26l.32-.14,45.95-17.64L48,48l52.2,159.86,17.65-46c0-.11.08-.22.13-.33a16,16,0,0,1,11.69-9.34,16.72,16.72,0,0,1,3-.28,16,16,0,0,1,11.3,4.69L195.31,208Z"},child:[]}]})(a)}function M(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228.92,49.69a8,8,0,0,0-6.86-1.45L160.93,63.52,99.58,32.84a8,8,0,0,0-5.52-.6l-64,16A8,8,0,0,0,24,56V200a8,8,0,0,0,9.94,7.76l61.13-15.28,61.35,30.68A8.15,8.15,0,0,0,160,224a8,8,0,0,0,1.94-.24l64-16A8,8,0,0,0,232,200V56A8,8,0,0,0,228.92,49.69ZM104,52.94l48,24V203.06l-48-24ZM40,62.25l48-12v127.5l-48,12Zm176,131.5-48,12V78.25l48-12Z"},child:[]}]})(a)}function d(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M53.92,34.62A8,8,0,1,0,42.08,45.38l48.2,53L36.68,152A15.89,15.89,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31l50.4-50.39,47.69,52.46a8,8,0,1,0,11.84-10.76Zm63,93.12L68,176.69,51.31,160l49.75-49.74ZM48,179.31,76.69,208H48Zm48,25.38L79.32,188l48.41-48.41,15.89,17.48ZM227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L118.33,70.36a8,8,0,0,0,11.32,11.31L136,75.31,152.69,92,145,99.69A8,8,0,1,0,156.31,111l7.69-7.69L180.69,120l-9,9A8,8,0,0,0,183,140.34L227.32,96A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"},child:[]}]})(a)}function u(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM51.31,160,136,75.31,152.69,92,68,176.68ZM48,179.31,76.69,208H48Zm48,25.38L79.31,188,164,103.31,180.69,120Zm96-96L147.31,64l24-24L216,84.68Z"},child:[]}]})(a)}export{L as P,o as W,h as a,H as b,n as c,Z as d,d as e,u as f,e as g,c as h,M as i,g as j}; +import{bQ as l}from"./j0mck_Meu7Xh.js";import{G as t}from"./2C0geDG_OBHU.js";const o=l;function c(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M156,40a12,12,0,0,1-12,12H112a12,12,0,0,1,0-24h32A12,12,0,0,1,156,40ZM144,204H112a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24ZM204,52V72a12,12,0,0,0,24,0V48a20,20,0,0,0-20-20H184a12,12,0,0,0,0,24Zm12,48a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V112A12,12,0,0,0,216,100ZM40,156a12,12,0,0,0,12-12V112a12,12,0,0,0-24,0v32A12,12,0,0,0,40,156Zm32,48H52V184a12,12,0,0,0-24,0v24a20,20,0,0,0,20,20H72a12,12,0,0,0,0-24ZM72,28H48A20,20,0,0,0,28,48V72a12,12,0,0,0,24,0V52H72a12,12,0,0,0,0-24ZM240,204H228V192a12,12,0,0,0-24,0v12H192a12,12,0,0,0,0,24h12v12a12,12,0,0,0,24,0V228h12a12,12,0,0,0,0-24Z"},child:[]}]})(a)}function h(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z"},child:[]}]})(a)}function n(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,42H72A14,14,0,0,0,58,56V74H40A14,14,0,0,0,26,88V200a14,14,0,0,0,14,14H184a14,14,0,0,0,14-14V182h18a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM70,56a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2v67.57L204.53,110.1a14,14,0,0,0-19.8,0l-21.42,21.41L117.9,86.1a14,14,0,0,0-19.8,0L70,114.2ZM186,200a2,2,0,0,1-2,2H40a2,2,0,0,1-2-2V88a2,2,0,0,1,2-2H58v82a14,14,0,0,0,14,14H186Zm30-30H72a2,2,0,0,1-2-2V131.17l36.58-36.58a2,2,0,0,1,2.83,0l49.66,49.66a6,6,0,0,0,8.49,0l25.65-25.66a2,2,0,0,1,2.83,0l22,22V168A2,2,0,0,1,216,170ZM162,84a10,10,0,1,1,10,10A10,10,0,0,1,162,84Z"},child:[]}]})(a)}function H(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128ZM40,70H216a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12ZM216,186H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z"},child:[]}]})(a)}function Z(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M214.67,74H198V40a6,6,0,0,0-6-6H64a6,6,0,0,0-6,6V74H41.33C28.47,74,18,83.87,18,96v80a6,6,0,0,0,6,6H58v34a6,6,0,0,0,6,6H192a6,6,0,0,0,6-6V182h34a6,6,0,0,0,6-6V96C238,83.87,227.53,74,214.67,74ZM70,46H186V74H70ZM186,210H70V158H186Zm40-40H198V152a6,6,0,0,0-6-6H64a6,6,0,0,0-6,6v18H30V96c0-5.51,5.08-10,11.33-10H214.67C220.92,86,226,90.49,226,96Zm-28-54a10,10,0,1,1-10-10A10,10,0,0,1,198,116Z"},child:[]}]})(a)}function e(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M233.91,74.79,181.22,22.1a14,14,0,0,0-19.8,0L22.09,161.41a14,14,0,0,0,0,19.8L74.78,233.9a14,14,0,0,0,19.8,0L233.91,94.59A14,14,0,0,0,233.91,74.79ZM225.42,86.1,86.1,225.41h0a2,2,0,0,1-2.83,0L30.58,172.73a2,2,0,0,1,0-2.83L64,136.48l27.76,27.76a6,6,0,1,0,8.48-8.48L72.48,128,96,104.48l27.76,27.76a6,6,0,0,0,8.48-8.48L104.48,96,128,72.49l27.76,27.75a6,6,0,0,0,8.48-8.48L136.49,64,169.9,30.59a2,2,0,0,1,2.83,0l52.69,52.68A2,2,0,0,1,225.42,86.1Z"},child:[]}]})(a)}function g(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"},child:[]}]})(a)}function L(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M88,24V16a8,8,0,0,1,16,0v8a8,8,0,0,1-16,0ZM16,104h8a8,8,0,0,0,0-16H16a8,8,0,0,0,0,16ZM124.42,39.16a8,8,0,0,0,10.74-3.58l8-16a8,8,0,0,0-14.31-7.16l-8,16A8,8,0,0,0,124.42,39.16Zm-96,81.69-16,8a8,8,0,0,0,7.16,14.31l16-8a8,8,0,1,0-7.16-14.31ZM219.31,184a16,16,0,0,1,0,22.63l-12.68,12.68a16,16,0,0,1-22.63,0L132.7,168,115,214.09c0,.1-.08.21-.13.32a15.83,15.83,0,0,1-14.6,9.59l-.79,0a15.83,15.83,0,0,1-14.41-11L32.8,52.92A16,16,0,0,1,52.92,32.8L213,85.07a16,16,0,0,1,1.41,29.8l-.32.13L168,132.69ZM208,195.31,156.69,144h0a16,16,0,0,1,4.93-26l.32-.14,45.95-17.64L48,48l52.2,159.86,17.65-46c0-.11.08-.22.13-.33a16,16,0,0,1,11.69-9.34,16.72,16.72,0,0,1,3-.28,16,16,0,0,1,11.3,4.69L195.31,208Z"},child:[]}]})(a)}function M(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228.92,49.69a8,8,0,0,0-6.86-1.45L160.93,63.52,99.58,32.84a8,8,0,0,0-5.52-.6l-64,16A8,8,0,0,0,24,56V200a8,8,0,0,0,9.94,7.76l61.13-15.28,61.35,30.68A8.15,8.15,0,0,0,160,224a8,8,0,0,0,1.94-.24l64-16A8,8,0,0,0,232,200V56A8,8,0,0,0,228.92,49.69ZM104,52.94l48,24V203.06l-48-24ZM40,62.25l48-12v127.5l-48,12Zm176,131.5-48,12V78.25l48-12Z"},child:[]}]})(a)}function d(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M53.92,34.62A8,8,0,1,0,42.08,45.38l48.2,53L36.68,152A15.89,15.89,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31l50.4-50.39,47.69,52.46a8,8,0,1,0,11.84-10.76Zm63,93.12L68,176.69,51.31,160l49.75-49.74ZM48,179.31,76.69,208H48Zm48,25.38L79.32,188l48.41-48.41,15.89,17.48ZM227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L118.33,70.36a8,8,0,0,0,11.32,11.31L136,75.31,152.69,92,145,99.69A8,8,0,1,0,156.31,111l7.69-7.69L180.69,120l-9,9A8,8,0,0,0,183,140.34L227.32,96A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"},child:[]}]})(a)}function u(a){return t({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM51.31,160,136,75.31,152.69,92,68,176.68ZM48,179.31,76.69,208H48Zm48,25.38L79.31,188,164,103.31,180.69,120Zm96-96L147.31,64l24-24L216,84.68Z"},child:[]}]})(a)}export{L as P,o as W,h as a,H as b,n as c,Z as d,d as e,u as f,e as g,c as h,M as i,g as j}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/BHV5vl3sU07-.js b/openlayers-base-packages/pr-previews/pr-377/assets/BMNhf717kFFK.js similarity index 84% rename from openlayers-base-packages/pr-previews/pr-377/assets/BHV5vl3sU07-.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BMNhf717kFFK.js index 37a7f10..d683411 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/BHV5vl3sU07-.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BMNhf717kFFK.js @@ -1 +1 @@ -import{j as t,B as d,c as q,a as U,r as p,b as I,i as K,d as $,e as A,F as Z,f as Y}from"./DbBkdn6FNbgs.js";import{V as J,S as j,T as X,O as Q,a as C,b as N,c as ee,C as te,F as oe,r as T,d as D,e as re,w as ie,H as ne,M as ae,u as se,f as le,g as v,h as x,i as L,j as M,k as y,D as ce,l as pe,m as de}from"./DyxVjgSvwe-K.js";import{W as V,P as ue,a as me,b as ge,c as he,d as fe,e as be,f as ve,g as xe,h as we}from"./CJwLdrVebURZ.js";import{W as R,E as Se,V as ye,S as ke,O as Me,C as je,a as Ce,b as Le,L as ze,M as _e,c as Pe,d as Ie,P as Ae,N as Te}from"./Fvn-TvW_dbjq.js";import{G as O,u as De,T as h,P as Re,a as Ee,b as Fe,c as qe,d as Ne,e as Ve}from"./Djes_egHqOHx.js";import{T as z}from"./CL68Tre-iuri.js";import{N as Oe,P as He}from"./CLvK5IJfz41Q.js";import{V as Ge,S as We,I as Be,Z as Ue,a as Ke}from"./BUqsBljB9Wju.js";import{_ as E}from"./CmsKOCeNyeyo.js";import{u as b,D as $e}from"./nEjnOjKmH1UU.js";import{H}from"./C520TGz1zAm6.js";import{G}from"./DnYPVZQRsXfx.js";import{R as Ze}from"./VXuNJBviGPoL.js";import{C as Ye}from"./CKwKePgRpvKf.js";import"./jRJMM4_GqJDc.js";import"./D8JwQmCkwKBk.js";import"./CCXTS-icusD6.js";import"./DjAArQ67Dgmx.js";import"./CwYOJLhODXKJ.js";import"./Ch2CPfq1SbGd.js";import"./B_KTQkWPSzAO.js";import"./Ca8Zt9kwahLC.js";import"./35mnA9_wxNJd.js";import"./B6P_btgblpGb.js";const Je={height:"25px",width:"25px",borderColor:"#4cb3ff",borderWidth:"3px",borderRadius:"50%",display:"inline-block "};function Xe(r){return t.jsxs(d,{children:[t.jsx(z,{children:r.layer.title}),t.jsx(d,{style:Je})]})}const _="main";class Qe{mapId=_;vectorSourceFactory;constructor(e){this.vectorSourceFactory=e.references.vectorSourceFactory}async getMapConfig(){return{advanced:{view:new J({center:[404747,5757920],zoom:13,constrainResolution:!0,projection:"EPSG:25832"})},layers:[...et(),rt(),tt(this.vectorSourceFactory),ot(),it()]}}}function et(){return[new R({isBaseLayer:!0,title:"Topplus grau",url:"https://www.wmts.nrw.de/topplus_open/1.0.0/WMTSCapabilities.xml",name:"topplus_grau",matrixSet:"EPSG_25832_14",visible:!1,sourceOptions:{attributions:`Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie ${new Date().getFullYear()}, Datenquellen`}}),new R({isBaseLayer:!0,title:"Topplus farbig",url:"https://www.wmts.nrw.de/topplus_open/1.0.0/WMTSCapabilities.xml",name:"topplus_col",matrixSet:"EPSG_25832_14",visible:!0,sourceOptions:{attributions:`Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie ${new Date().getFullYear()}, Datenquellen`}}),new j({title:"OpenStreetMaps",visible:!1,isBaseLayer:!0,olLayer:new X({source:new Q})})]}function tt(r){const e="https://ogc-api-test.nrw.de/inspire-us-krankenhaus/v1",o="governmentalservice",i=r.createVectorSource({strategy:"next",baseUrl:e,collectionId:o,limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/25832",attributions:`Land NRW (${new Date().getFullYear()}), Datenlizenz Deutschland - Namensnennung - Version 2.0, Datenquelle`}),n=new C({source:i});return new j({id:"krankenhaus",title:"Krankenhäuser",visible:!1,olLayer:n,attributes:{collectionURL:e+"/collections/"+o}})}function ot(){return new V({title:"Schulstandorte",description:"Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.",visible:!0,url:"https://www.wms.nrw.de/wms/wms_nw_inspire-schulen",sublayers:[{name:"US.education",title:"INSPIRE - WMS Schulstandorte NRW",attributes:{legend:{}}}],sourceOptions:{ratio:1}})}function rt(){return new V({title:"Straßennetz Landesbetrieb Straßenbau NRW",url:"https://www.wms.nrw.de/wms/strassen_nrw_wms",visible:!0,sublayers:[{name:"1",title:"Verwaltungen",attributes:{legend:{imageUrl:"https://www.wms.nrw.de/legends/wms/strassen_nrw_wms/1.png"}}},{name:"4",title:"Abschnitte und Äste"},{name:"6",title:"Unfälle"}]})}function it(){const r={Component:Xe},e=new N({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new O,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'}),o=new C({source:e,style:new ee({image:new te({fill:new oe({color:"blue"}),radius:4})})});return new j({id:"ogc_kitas",title:"Kindertagesstätten",visible:!0,olLayer:o,attributes:{legend:r,resultListMetadata:[{id:"id",displayName:"ID",width:100,getPropertyValue(i){return i.id}},{propertyName:"pointOfContact.address.postCode",displayName:"PLZ",width:120},{propertyName:"name",displayName:"Name"},{propertyName:"inspireId",displayName:"inspireID"},{displayName:"Gefördert",width:160,getPropertyValue(i){switch(i.properties?.gefoerdert){case"ja":return!0;case"nein":return!1;default:return i.properties?.gefoerdert}}}]}})}class nt{label;filteredTypes;httpService;constructor(e,o,i){this.label=e,this.filteredTypes=o,this.httpService=i}async search(e,{mapProjection:o,signal:i}){const n=await this.request(e,100,i),a=new O({dataProjection:"EPSG:4326",featureProjection:o});return n.features.filter(s=>this.filteredTypes.includes(s.properties.type)).map((s,l)=>{const c=a.readGeometry(s.geometry);return{id:s.properties.osm_id||l,label:this.createLabel(s),geometry:c,properties:s.properties}})}async request(e,o,i){const n=new URL("https://photon.komoot.io/api?");n.searchParams.set("q",e),n.searchParams.set("lang","de"),n.searchParams.set("lat","51.961563"),n.searchParams.set("lon","7.628202"),n.searchParams.set("limit",o.toString());const a=await this.httpService.fetch(n,{signal:i});if(!a.ok)throw new Error("Request failed: "+a.status);return await a.json()}createLabel(e){return`${e.properties.name} (${e.properties.osm_value?e.properties.osm_value+", ":""}${e.properties.postcode?e.properties.postcode+", ":""}${e.properties.city?e.properties.city+", ":""}${e.properties.country?e.properties.country+")":")"}`}}const at=q("ol-app:AppModel");function k(r){return r==="selection"||r==="measurement"||r.startsWith("editing-")}class st{_mapRegistry;_vectorSelectionSourceFactory;_httpService;_resources=[];_featureHighlight=void 0;_mainContent=T(["toc"]);_searchSources=D();_selectionSources=D();_sourceMetadata=re();_resultListState=T({key:0,open:!1,input:void 0});constructor({references:e}){this._mapRegistry=e.mapRegistry,this._vectorSelectionSourceFactory=e.vectorSelectionSourceFactory,this._httpService=e.httpService,this.initSearchSources(),this.initSelectionSources().catch(o=>{at.error("Failed to initialize selection sources",o)})}destroy(){this.clearHighlight(),this._resources.forEach(e=>e.destroy())}get mainContent(){return this._mainContent.value}get searchSources(){return this._searchSources}get selectionSources(){return this._selectionSources}get sourceMetadata(){return this._sourceMetadata}get resultListState(){return this._resultListState.value}toggleMainContent(e){const o=this._mainContent.value;if(o.includes(e)){this._mainContent.value=o.filter(n=>n!==e);return}let i;k(e)?(i=[e],this.clearHighlight()):(i=o.filter(n=>!k(n)),i.push(e)),this._mainContent.value=i}hideContent(e){this._mainContent.value=this._mainContent.value.filter(o=>o!==e)}clearInteractions(){this._mainContent.value=this._mainContent.value.filter(e=>!k(e))}setResultListInput(e){const o=this._resultListState.value;this._resultListState.value={open:!0,key:o.key+1,input:e}}setResultListVisibility(e){this._resultListState.value={...this._resultListState.value,open:e}}highlightAndZoom(e,o){const i=e.olMap.getViewport();this.clearHighlight(),this._featureHighlight=e.highlightAndZoom(o,{viewPadding:i&&i.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}zoom(e,o){const i=e.olMap.getViewport();e.zoom(o,{viewPadding:i&&i.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}clearHighlight(){this._featureHighlight&&(this._featureHighlight.destroy(),this._featureHighlight=void 0)}initSearchSources(){const e=new nt("Photon Geocoder",["city","street"],this._httpService);this._searchSources.push(e)}async initSelectionSources(){const e=["ogc_kitas","ogc_kataster"],i=(await this._mapRegistry.expectMapModel(_)).layers.getOperationalLayers({sortByDisplayOrder:!0});for(const n of i){if(!e.includes(n.id)||!lt(n.olLayer))continue;const a=this._vectorSelectionSourceFactory.createSelectionSource({vectorLayer:n.olLayer,label:n.title}),s=ie(()=>[a.status],([l])=>{l!=="available"&&(l==="unavailable"||l?.kind==="unavailable")&&this.clearHighlight()});this._resources.push(s,a),this._selectionSources.unshift(a),this._sourceMetadata.set(a,n.attributes.resultListMetadata)}}}function lt(r){return r instanceof C&&r.getSource()instanceof N}const ct={"ol-map":{name:"ol-map",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Qe,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},AppModel:{name:"AppModel",clazz:st,provides:[{name:"ol-app.AppModel",qualifier:void 0}],references:{vectorSelectionSourceFactory:{name:"selection.VectorSelectionSourceFactory",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1},mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1},{name:"ol-app.AppModel",qualifier:void 0,all:!1},{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"editing.EditingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:ne,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:Oe,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:ae,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/coordinate-viewer":{name:"@open-pioneer/coordinate-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:Ge,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:We,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/scale-bar":{name:"@open-pioneer/scale-bar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-viewer":{name:"@open-pioneer/scale-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:He,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/editing":{name:"@open-pioneer/editing",services:{EditingServiceImpl:{name:"EditingServiceImpl",clazz:Se,provides:[{name:"editing.EditingService",qualifier:void 0}],references:{mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{polygonStyle:{value:{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"red","stroke-width":1.25,"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1},vertexStyle:{value:{"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1}}},"@open-pioneer/legend":{name:"@open-pioneer/legend",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/measurement":{name:"@open-pioneer/measurement",services:{},ui:{references:[]},properties:{}},"@open-pioneer/search":{name:"@open-pioneer/search",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/selection":{name:"@open-pioneer/selection",services:{VectorSelectionSourceFactory:{name:"VectorSelectionSourceFactory",clazz:ye,provides:[{name:"selection.VectorSelectionSourceFactory",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}}},pt='.search-box{position:absolute;width:500px;max-width:100%;z-index:1}:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}.editing-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.editing-tooltip-hidden{visibility:hidden}.measurement-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.measurement-active-tooltip{background:#000000e6;border-radius:4px;border-color:#000000e6;opacity:.9;color:#fff}.measurement-finished-tooltip{background-color:#4cb3ffe6;color:#000;border:1px solid white}.measurement-active-tooltip:before,.measurement-finished-tooltip:before{border-top:6px solid rgba(0,0,0,.9);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.measurement-finished-tooltip:before{border-top-color:#4cb3ff}.search-component .chakra-divider{display:none}.search-component .search-highlighted-match{font-weight:700}.search-component .search-value-container{cursor:text;padding-left:30px!important}.search-component .search-invisible{display:none}.selection-drag-box{background-color:#ffffff4d!important;border:3px solid var(--chakra-colors-background_primary)!important}.selection-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.selection .react-select{cursor:default}.map-container .selection-active{cursor:crosshair}.map-container .selection-inactive{cursor:no-drop}.selection-source-value.selection-source-value--disabled{opacity:.4}.selection-source-value.selection-source-value--disabled span{margin:0 6px 0 0}.scale-bar .ol-scale-bar{margin-bottom:8px;margin-right:8px}.scale-bar .ol-scale-bar,.scale-bar .ol-scale-line{position:relative;bottom:0;left:0;background:none}.scale-bar .ol-scale-bar .ol-scale-bar-inner,.scale-bar .ol-scale-bar .ol-scale-line-inner,.scale-bar .ol-scale-line .ol-scale-bar-inner,.scale-bar .ol-scale-line .ol-scale-line-inner{color:var(--chakra-white);border-color:var(--chakra-white)}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',dt=["en","de"];function ut(r){switch(r){case"en":return E(()=>import("./C1WkJ-kI19ro.js"),[],import.meta.url).then(e=>e.default);case"de":return E(()=>import("./BDbbl70241yO.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${r}'`)}const mt=U(pt),gt=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:ut,locales:dt,packages:ct,styles:mt},Symbol.toStringTag,{value:"Module"})),W="ol-map",g=le.bind(void 0,W),u=se.bind(void 0,W),ht=q("ol-app:Editing");function F(r){const e=ft(r.kind),o=p.useId(),i=u();return t.jsx(d,{role:"dialog","aria-labelledby":o,children:t.jsx(v,{title:t.jsx(x,{id:o,size:"md",mb:2,children:i.formatMessage({id:"editing.title"})}),children:t.jsxs(d,{overflowY:"auto",maxHeight:300,children:[t.jsx(z,{textAlign:"center",children:i.formatMessage({id:"editing.active"})}),t.jsxs(H,{mt:4,align:"center",justify:"center",children:[t.jsx(I,{onClick:()=>{e?.reset()},children:i.formatMessage({id:"editing.resetGeometry"})}),t.jsx(I,{onClick:()=>{e?.destroy()},children:i.formatMessage({id:"editing.abort"})})]})]})})})}function ft(r){const e=g("notifier.NotificationService"),o=g("editing.EditingService"),i=u(),n=g("ol-app.AppModel"),{map:a}=L(),[s,l]=p.useState();return p.useEffect(()=>{if(!a)return;const c=new bt(e,o,a,i,n,r);return l(c),()=>{c.destroy(),l(void 0)}},[n,o,i,a,e,r]),s}class bt{notificationService;editingService;map;intl;appModel;kind;job;constructor(e,o,i,n,a,s){this.notificationService=e,this.editingService=o,this.map=i,this.intl=n,this.appModel=a,this.kind=s;let l;switch(s){case"create":l=this.createJob();break;case"update":l=this.updateJob();break}this.job=l,this.job.run().catch(c=>{K(c)||(ht.error("Edit operation failed",c),this.notificationService.notify({level:"error",message:this.intl.formatMessage({id:"editing.error"})}))}).finally(()=>{this.destroy()})}destroy(){this.job?.destroy(),this.job=void 0,this.appModel.hideContent(`editing-${this.kind}`)}reset(){this.job?.reset()}createJob(){let e;return{destroy(){e?.stop(),e=void 0},reset(){e?.reset()},run:async()=>{const o=this.findLayer(),i=new URL(o.attributes.collectionURL+"/items");e=this.editingService.createFeature(this.map,i);const n=await e.whenComplete();if(e=void 0,!n)return;this.notificationService.notify({level:"info",message:this.intl.formatMessage({id:"editing.create.featureCreated"},{featureId:n.featureId})}),(o?.olLayer).getSource()?.refresh()}}}updateJob(){const e=this.map,o=new AbortController,i=o.signal;let n,a,s;function l(){a&&e.olMap.removeInteraction(a),a&&a.dispose(),n&&n.destroy(),o.abort(),a=void 0,n=void 0}return{destroy(){l(),s?.stop(),s=void 0},reset(){s?.reset()},run:async()=>{const c=this.findLayer(),m=c.olLayer,w=new URL(c.attributes.collectionURL+"/items");a=new ke({layers:[m]}),e.olMap.addInteraction(a),n=vt(this.intl,e.olMap),n.element.classList.remove("editing-tooltip-hidden");let f;for(;;){const{selected:P,deselected:B}=await xt(a,i);if(P.length===1&&B.length===0){l(),f=P[0];break}}if(!f)throw Error("Feature is undefined");s=this.editingService.updateFeature(e,w,f);const S=await s.whenComplete();S&&(this.notificationService.notify({level:"info",message:this.intl.formatMessage({id:"editing.update.featureModified"},{featureId:S.featureId})}),m.getSource()?.refresh())}}}findLayer(){const e=this.map.layers.getLayerById("krankenhaus");if(!e)throw new Error("Layer not found");return e}}function vt(r,e){const o=document.createElement("div");o.className="editing-tooltip editing-tooltip-hidden",o.textContent=r.formatMessage({id:"editing.update.tooltip.select"});const i=new Me({element:o,offset:[15,0],positioning:"center-left"}),n=e.on("pointermove",a=>{a.dragging||i.setPosition(a.coordinate)});return e.addOverlay(i),{overlay:i,element:o,destroy(){M(n),e.removeOverlay(i)}}}function xt(r,e){let o;const{promise:i,resolve:n,reject:a}=$();if(e.aborted)return a(A()),i;const s=()=>{o&&M(o),o=void 0,a(A())};return e.addEventListener("abort",s),o=r.on("select",l=>{e.removeEventListener("abort",s),o&&M(o),o=void 0,n(l)}),i}function wt(){const r=u();return t.jsxs(y,{role:"region","aria-label":r.formatMessage({id:"ariaLabel.footer"}),gap:3,alignItems:"center",justifyContent:"center",children:[t.jsx(je,{precision:2,displayProjectionCode:"EPSG:4326"}),t.jsx(Ce,{}),t.jsx(Le,{})]})}function St(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"legendTitle"})}),children:t.jsx(d,{overflowY:"auto",maxHeight:300,children:t.jsx(ze,{showBaseLayers:!0})})})})}function yt(r){return G({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M6.5 9.5l1.546 -1.311"},child:[]},{tag:"path",attr:{d:"M14 5.5l3 1.5"},child:[]},{tag:"path",attr:{d:"M18.5 10l-1.185 3.318m-1.062 2.972l-.253 .71"},child:[]},{tag:"path",attr:{d:"M13.5 17.5l-7 -5"},child:[]},{tag:"path",attr:{d:"M3 3l18 18"},child:[]}]})(r)}function kt(r){return G({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M6.5 9.5l3.5 -3"},child:[]},{tag:"path",attr:{d:"M14 5.5l3 1.5"},child:[]},{tag:"path",attr:{d:"M18.5 10l-2.5 7"},child:[]},{tag:"path",attr:{d:"M13.5 17.5l-7 -5"},child:[]}]})(r)}function Mt(){const r=u(),e=g("ol-app.AppModel"),o=b(()=>e.resultListState,[e]),i=o.open,{isTocActive:n,isLegendActive:a,isPrintingActive:s}=b(()=>({isTocActive:e.mainContent.includes("toc"),isLegendActive:e.mainContent.includes("legend"),isPrintingActive:e.mainContent.includes("printing")}),[e]);return t.jsxs(y,{role:"toolbar","aria-label":r.formatMessage({id:"ariaLabel.toolbar"}),direction:"column",gap:1,padding:1,children:[t.jsx(jt,{}),o.input&&t.jsx(h,{label:r.formatMessage({id:"resultListTitle"}),icon:t.jsx(me,{}),isActive:o.open,onClick:()=>e.setResultListVisibility(!i)}),t.jsx(h,{label:r.formatMessage({id:"tocTitle"}),icon:t.jsx(ge,{}),isActive:n,onClick:()=>e.toggleMainContent("toc")}),t.jsx(h,{label:r.formatMessage({id:"legendTitle"}),icon:t.jsx(he,{}),isActive:a,onClick:()=>e.toggleMainContent("legend")}),t.jsx(h,{label:r.formatMessage({id:"printingTitle"}),icon:t.jsx(fe,{}),isActive:s,onClick:()=>e.toggleMainContent("printing")}),t.jsx(Be,{}),t.jsx(Ue,{}),t.jsx(Ke,{})]})}function jt(){const r=u(),e=g("ol-app.AppModel"),[o,i]=p.useState(!1),{isSelectionActive:n,isMeasurementActive:a,isEditingCreateActive:s,isEditingUpdateActive:l}=b(()=>({isSelectionActive:e.mainContent.includes("selection"),isMeasurementActive:e.mainContent.includes("measurement"),isEditingCreateActive:e.mainContent.includes("editing-create"),isEditingUpdateActive:e.mainContent.includes("editing-update")}),[e]),c=f=>()=>{f(),i(!1)},m={placement:"top"},w=t.jsxs(t.Fragment,{children:[t.jsx(h,{label:s?r.formatMessage({id:"editing.stopTitle"}):r.formatMessage({id:"editing.create.startTitle"}),icon:s?t.jsx(yt,{}):t.jsx(kt,{}),isActive:s,onClick:c(()=>e.toggleMainContent("editing-create")),tooltipProps:m}),t.jsx(h,{label:l?r.formatMessage({id:"editing.stopTitle"}):r.formatMessage({id:"editing.update.startTitle"}),icon:l?t.jsx(be,{}):t.jsx(ve,{}),isActive:l,onClick:c(()=>e.toggleMainContent("editing-update")),tooltipProps:m}),t.jsx(h,{label:r.formatMessage({id:"measurementTitle"}),icon:t.jsx(xe,{}),isActive:a,onClick:c(()=>e.toggleMainContent("measurement")),tooltipProps:m}),t.jsx(h,{label:r.formatMessage({id:"selectionTitle"}),icon:t.jsx(we,{}),isActive:n,onClick:c(()=>e.toggleMainContent("selection")),tooltipProps:m})]});return t.jsxs(Re,{placement:"left",isLazy:!0,onOpen:()=>i(!0),onClose:()=>i(!1),isOpen:o,children:[t.jsx(Ee,{children:t.jsx(Ct,{})}),t.jsx(Z,{children:t.jsxs(Fe,{width:"auto",children:[t.jsx(qe,{}),t.jsx(Ne,{children:t.jsx(H,{spacing:2,children:w})})]})})]})}const Ct=p.forwardRef(function(e,o){const i=u(),n=De(),{onClick:a,...s}=n.getTriggerProps();return t.jsx(h,{ref:o,label:i.formatMessage({id:"mapInteractions.title"}),icon:t.jsx(ue,{}),onClick:a,buttonProps:s})});function Lt(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"measurementTitle"})}),children:t.jsx(_e,{})})})}function zt(){const r=g("ol-app.AppModel"),e=b(()=>r.resultListState,[r]),[o,i]=p.useState([]),[n,a]=p.useState([]),s=p.useCallback(l=>{i(l.features),a(l.getFeatureIds())},[]);return p.useEffect(()=>{console.log("Anzahl Features: "+o.length),console.log("SelectedIds: "+n.toString())},[o,n]),e.input&&t.jsx(d,{className:"result-list-container",position:"absolute",visibility:e.open?"visible":"hidden",bottom:"0",backgroundColor:"white",width:"100%",height:"400px",zIndex:1,borderTop:"2px solid",borderBottom:"2px solid",borderColor:"trails.100",children:t.jsx(Ze,{input:e.input,onSelectionChange:s},e.key)})}function _t(){const{map:r}=L(),e=g("ol-app.AppModel"),o=b(()=>e.searchSources.getItems(),[e]);function i(a){if(console.debug("The user selected the following item: ",a.result),!r)return;const s=a.result.geometry;s&&e.highlightAndZoom(r,[s])}function n(){console.debug("The user cleared the search"),e.clearHighlight()}return t.jsx(d,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",mt:5,className:"search-box",children:t.jsx(Pe,{sources:o,maxResultsPerGroup:10,onSelect:i,onClear:n})})}function Pt(){const r=u(),e=g("notifier.NotificationService"),o=p.useId(),{map:i}=L(),n=g("ol-app.AppModel"),a=b(()=>n.selectionSources.getItems(),[n]),s={numberOptions:{maximumFractionDigits:3},dateOptions:{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}};function l(m){const{source:w,results:f}=m;if(!i){console.debug("Map not ready");return}const S=n.sourceMetadata.get(w);if(!S){console.warn("Can not show results because no metadata could be found");return}n.setResultListInput({columns:S,data:f,formatOptions:s}),e.notify({level:"info",message:r.formatMessage({id:"foundResults"},{resultsCount:f.length}),displayDuration:4e3})}function c(m){n.clearHighlight()}return t.jsx(d,{role:"dialog","aria-labelledby":o,children:t.jsx(v,{title:t.jsx(x,{id:o,size:"md",mb:2,children:r.formatMessage({id:"selectionTitle"})}),children:t.jsx(Ie,{sources:a,onSelectionComplete:l,onSelectionSourceChanged:c})})})}function It(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:t.jsx(z,{children:e.formatMessage({id:"tocTitle"})})}),children:t.jsx(d,{overflowY:"auto",maxHeight:300,children:t.jsx(Ve,{showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})})})}function At(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"printingTitle"})}),children:t.jsx(Ae,{})})})}function Tt(){const r=u(),e=g("ol-app.AppModel"),{resultListState:o,mainContent:i}=b(()=>({resultListState:e.resultListState,mainContent:e.mainContent}),[e]),n=o.input&&o.open;return t.jsx(ce,{mapId:_,children:t.jsxs(y,{height:"100%",direction:"column",overflow:"hidden",children:[t.jsx(Te,{position:"top-right"}),t.jsxs(v,{title:t.jsx(d,{role:"region","aria-label":r.formatMessage({id:"ariaLabel.header"}),textAlign:"center",py:1,children:t.jsx(x,{size:"md",children:"Sample Application"})}),children:[t.jsx(y,{flex:"1",direction:"column",position:"relative",children:t.jsxs(pe,{role:"main","aria-label":r.formatMessage({id:"ariaLabel.map"}),viewPadding:n?{bottom:400}:void 0,children:[t.jsx(Ye,{centerContent:!0,children:t.jsx(_t,{})}),t.jsx(Dt,{mainContent:i}),t.jsx(de,{position:"bottom-right",horizontalGap:10,verticalGap:45,children:t.jsx(Mt,{})}),t.jsx(zt,{})]})}),t.jsx(wt,{})]})]})})}function Dt(r){const{mainContent:e}=r,o=p.useMemo(()=>{const i=n=>{switch(n){case"toc":return t.jsx(It,{},n);case"legend":return t.jsx(St,{},n);case"printing":return t.jsx(At,{},n);case"selection":return t.jsx(Pt,{},n);case"measurement":return t.jsx(Lt,{},n);case"editing-create":return t.jsx(F,{kind:"create"},n);case"editing-update":return t.jsx(F,{kind:"update"},n)}};return e.map(n=>i(n))},[e]);return t.jsx(Rt,{children:o})}function Rt(r){const e=r.children,o=[];for(const i of e)i&&(o.length&&o.push(t.jsx($e,{mt:4,mb:4},o.length)),o.push(i));if(o.length!==0)return t.jsx(d,{position:"absolute",top:"100px",left:4,maxHeight:"calc(100% - 140px)",width:350,maxWidth:350,zIndex:1,backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",overflow:"auto",children:o})}const Et=new URLSearchParams(window.location.search),Ft=Et.get("lang")||void 0,qt=Y({component:Tt,appMetadata:gt,config:{locale:Ft,properties:{"@open-pioneer/local-storage":{storageId:"ol-app-state"}}}});customElements.define("ol-map-app",qt); +import{j as t,B as d,c as q,a as U,r as p,b as I,i as K,d as $,e as A,F as Z,f as Y}from"./B60Dx_GOYdnk.js";import{V as J,S as j,T as X,O as Q,a as C,b as N,c as ee,C as te,F as oe,r as T,d as D,e as re,w as ie,H as ne,M as ae,u as se,f as le,g as v,h as x,i as L,j as M,k as y,D as ce,l as pe,m as de}from"./j0mck_Meu7Xh.js";import{W as V,P as ue,a as me,b as ge,c as he,d as fe,e as be,f as ve,g as xe,h as we}from"./BLfEaHvmX9OI.js";import{W as R,E as Se,V as ye,S as ke,O as Me,C as je,a as Ce,b as Le,L as ze,M as _e,c as Pe,d as Ie,P as Ae,N as Te}from"./1BI1b7D_asS4.js";import{G as O,u as De,T as h,P as Re,a as Ee,b as Fe,c as qe,d as Ne,e as Ve}from"./CYroAbEI2PyD.js";import{T as z}from"./BKR6R-cAnIXt.js";import{N as Oe,P as He}from"./C1CVOge1__u2.js";import{V as Ge,S as We,I as Be,Z as Ue,a as Ke}from"./cFp2KtAGHfQy.js";import{_ as E}from"./CmsKOCeNyeyo.js";import{u as b,D as $e}from"./DSjrbd_eKbZM.js";import{H}from"./BFY0X3gkqjoN.js";import{G}from"./2C0geDG_OBHU.js";import{R as Ze}from"./CbxgmwRI74qQ.js";import{C as Ye}from"./DIOfOjAL_o1F.js";import"./BWf1FusGPLsb.js";import"./ajAX9OmvUsbZ.js";import"./BpQSjk0kyblh.js";import"./BlACKGYldMfy.js";import"./vepZWq5kkQUw.js";import"./Dko_2nwYwIor.js";import"./BXfBNJYYR7xb.js";import"./CMfwYEDRd35m.js";import"./C9VJq5Ka7299.js";import"./CG5nmvkyugDn.js";const Je={height:"25px",width:"25px",borderColor:"#4cb3ff",borderWidth:"3px",borderRadius:"50%",display:"inline-block "};function Xe(r){return t.jsxs(d,{children:[t.jsx(z,{children:r.layer.title}),t.jsx(d,{style:Je})]})}const _="main";class Qe{mapId=_;vectorSourceFactory;constructor(e){this.vectorSourceFactory=e.references.vectorSourceFactory}async getMapConfig(){return{advanced:{view:new J({center:[404747,5757920],zoom:13,constrainResolution:!0,projection:"EPSG:25832"})},layers:[...et(),rt(),tt(this.vectorSourceFactory),ot(),it()]}}}function et(){return[new R({isBaseLayer:!0,title:"Topplus grau",url:"https://www.wmts.nrw.de/topplus_open/1.0.0/WMTSCapabilities.xml",name:"topplus_grau",matrixSet:"EPSG_25832_14",visible:!1,sourceOptions:{attributions:`Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie ${new Date().getFullYear()}, Datenquellen`}}),new R({isBaseLayer:!0,title:"Topplus farbig",url:"https://www.wmts.nrw.de/topplus_open/1.0.0/WMTSCapabilities.xml",name:"topplus_col",matrixSet:"EPSG_25832_14",visible:!0,sourceOptions:{attributions:`Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie ${new Date().getFullYear()}, Datenquellen`}}),new j({title:"OpenStreetMaps",visible:!1,isBaseLayer:!0,olLayer:new X({source:new Q})})]}function tt(r){const e="https://ogc-api-test.nrw.de/inspire-us-krankenhaus/v1",o="governmentalservice",i=r.createVectorSource({strategy:"next",baseUrl:e,collectionId:o,limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/25832",attributions:`Land NRW (${new Date().getFullYear()}), Datenlizenz Deutschland - Namensnennung - Version 2.0, Datenquelle`}),n=new C({source:i});return new j({id:"krankenhaus",title:"Krankenhäuser",visible:!1,olLayer:n,attributes:{collectionURL:e+"/collections/"+o}})}function ot(){return new V({title:"Schulstandorte",description:"Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.",visible:!0,url:"https://www.wms.nrw.de/wms/wms_nw_inspire-schulen",sublayers:[{name:"US.education",title:"INSPIRE - WMS Schulstandorte NRW",attributes:{legend:{}}}],sourceOptions:{ratio:1}})}function rt(){return new V({title:"Straßennetz Landesbetrieb Straßenbau NRW",url:"https://www.wms.nrw.de/wms/strassen_nrw_wms",visible:!0,sublayers:[{name:"1",title:"Verwaltungen",attributes:{legend:{imageUrl:"https://www.wms.nrw.de/legends/wms/strassen_nrw_wms/1.png"}}},{name:"4",title:"Abschnitte und Äste"},{name:"6",title:"Unfälle"}]})}function it(){const r={Component:Xe},e=new N({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new O,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'}),o=new C({source:e,style:new ee({image:new te({fill:new oe({color:"blue"}),radius:4})})});return new j({id:"ogc_kitas",title:"Kindertagesstätten",visible:!0,olLayer:o,attributes:{legend:r,resultListMetadata:[{id:"id",displayName:"ID",width:100,getPropertyValue(i){return i.id}},{propertyName:"pointOfContact.address.postCode",displayName:"PLZ",width:120},{propertyName:"name",displayName:"Name"},{propertyName:"inspireId",displayName:"inspireID"},{displayName:"Gefördert",width:160,getPropertyValue(i){switch(i.properties?.gefoerdert){case"ja":return!0;case"nein":return!1;default:return i.properties?.gefoerdert}}}]}})}class nt{label;filteredTypes;httpService;constructor(e,o,i){this.label=e,this.filteredTypes=o,this.httpService=i}async search(e,{mapProjection:o,signal:i}){const n=await this.request(e,100,i),a=new O({dataProjection:"EPSG:4326",featureProjection:o});return n.features.filter(s=>this.filteredTypes.includes(s.properties.type)).map((s,l)=>{const c=a.readGeometry(s.geometry);return{id:s.properties.osm_id||l,label:this.createLabel(s),geometry:c,properties:s.properties}})}async request(e,o,i){const n=new URL("https://photon.komoot.io/api?");n.searchParams.set("q",e),n.searchParams.set("lang","de"),n.searchParams.set("lat","51.961563"),n.searchParams.set("lon","7.628202"),n.searchParams.set("limit",o.toString());const a=await this.httpService.fetch(n,{signal:i});if(!a.ok)throw new Error("Request failed: "+a.status);return await a.json()}createLabel(e){return`${e.properties.name} (${e.properties.osm_value?e.properties.osm_value+", ":""}${e.properties.postcode?e.properties.postcode+", ":""}${e.properties.city?e.properties.city+", ":""}${e.properties.country?e.properties.country+")":")"}`}}const at=q("ol-app:AppModel");function k(r){return r==="selection"||r==="measurement"||r.startsWith("editing-")}class st{_mapRegistry;_vectorSelectionSourceFactory;_httpService;_resources=[];_featureHighlight=void 0;_mainContent=T(["toc"]);_searchSources=D();_selectionSources=D();_sourceMetadata=re();_resultListState=T({key:0,open:!1,input:void 0});constructor({references:e}){this._mapRegistry=e.mapRegistry,this._vectorSelectionSourceFactory=e.vectorSelectionSourceFactory,this._httpService=e.httpService,this.initSearchSources(),this.initSelectionSources().catch(o=>{at.error("Failed to initialize selection sources",o)})}destroy(){this.clearHighlight(),this._resources.forEach(e=>e.destroy())}get mainContent(){return this._mainContent.value}get searchSources(){return this._searchSources}get selectionSources(){return this._selectionSources}get sourceMetadata(){return this._sourceMetadata}get resultListState(){return this._resultListState.value}toggleMainContent(e){const o=this._mainContent.value;if(o.includes(e)){this._mainContent.value=o.filter(n=>n!==e);return}let i;k(e)?(i=[e],this.clearHighlight()):(i=o.filter(n=>!k(n)),i.push(e)),this._mainContent.value=i}hideContent(e){this._mainContent.value=this._mainContent.value.filter(o=>o!==e)}clearInteractions(){this._mainContent.value=this._mainContent.value.filter(e=>!k(e))}setResultListInput(e){const o=this._resultListState.value;this._resultListState.value={open:!0,key:o.key+1,input:e}}setResultListVisibility(e){this._resultListState.value={...this._resultListState.value,open:e}}highlightAndZoom(e,o){const i=e.olMap.getViewport();this.clearHighlight(),this._featureHighlight=e.highlightAndZoom(o,{viewPadding:i&&i.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}zoom(e,o){const i=e.olMap.getViewport();e.zoom(o,{viewPadding:i&&i.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}clearHighlight(){this._featureHighlight&&(this._featureHighlight.destroy(),this._featureHighlight=void 0)}initSearchSources(){const e=new nt("Photon Geocoder",["city","street"],this._httpService);this._searchSources.push(e)}async initSelectionSources(){const e=["ogc_kitas","ogc_kataster"],i=(await this._mapRegistry.expectMapModel(_)).layers.getOperationalLayers({sortByDisplayOrder:!0});for(const n of i){if(!e.includes(n.id)||!lt(n.olLayer))continue;const a=this._vectorSelectionSourceFactory.createSelectionSource({vectorLayer:n.olLayer,label:n.title}),s=ie(()=>[a.status],([l])=>{l!=="available"&&(l==="unavailable"||l?.kind==="unavailable")&&this.clearHighlight()});this._resources.push(s,a),this._selectionSources.unshift(a),this._sourceMetadata.set(a,n.attributes.resultListMetadata)}}}function lt(r){return r instanceof C&&r.getSource()instanceof N}const ct={"ol-map":{name:"ol-map",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Qe,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},AppModel:{name:"AppModel",clazz:st,provides:[{name:"ol-app.AppModel",qualifier:void 0}],references:{vectorSelectionSourceFactory:{name:"selection.VectorSelectionSourceFactory",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1},mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1},{name:"ol-app.AppModel",qualifier:void 0,all:!1},{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"editing.EditingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:ne,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:Oe,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:ae,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:Ge,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:We,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/coordinate-viewer":{name:"@open-pioneer/coordinate-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-bar":{name:"@open-pioneer/scale-bar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-viewer":{name:"@open-pioneer/scale-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/editing":{name:"@open-pioneer/editing",services:{EditingServiceImpl:{name:"EditingServiceImpl",clazz:Se,provides:[{name:"editing.EditingService",qualifier:void 0}],references:{mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{polygonStyle:{value:{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"red","stroke-width":1.25,"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1},vertexStyle:{value:{"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1}}},"@open-pioneer/legend":{name:"@open-pioneer/legend",services:{},ui:{references:[]},properties:{}},"@open-pioneer/measurement":{name:"@open-pioneer/measurement",services:{},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:He,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/selection":{name:"@open-pioneer/selection",services:{VectorSelectionSourceFactory:{name:"VectorSelectionSourceFactory",clazz:ye,provides:[{name:"selection.VectorSelectionSourceFactory",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/search":{name:"@open-pioneer/search",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}}},pt='.search-box{position:absolute;width:500px;max-width:100%;z-index:1}:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.editing-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.editing-tooltip-hidden{visibility:hidden}.measurement-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.measurement-active-tooltip{background:#000000e6;border-radius:4px;border-color:#000000e6;opacity:.9;color:#fff}.measurement-finished-tooltip{background-color:#4cb3ffe6;color:#000;border:1px solid white}.measurement-active-tooltip:before,.measurement-finished-tooltip:before{border-top:6px solid rgba(0,0,0,.9);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.measurement-finished-tooltip:before{border-top-color:#4cb3ff}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}.selection-drag-box{background-color:#ffffff4d!important;border:3px solid var(--chakra-colors-background_primary)!important}.selection-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.selection .react-select{cursor:default}.map-container .selection-active{cursor:crosshair}.map-container .selection-inactive{cursor:no-drop}.selection-source-value.selection-source-value--disabled{opacity:.4}.selection-source-value.selection-source-value--disabled span{margin:0 6px 0 0}.search-component .chakra-divider{display:none}.search-component .search-highlighted-match{font-weight:700}.search-component .search-value-container{cursor:text;padding-left:30px!important}.search-component .search-invisible{display:none}.scale-bar .ol-scale-bar{margin-bottom:8px;margin-right:8px}.scale-bar .ol-scale-bar,.scale-bar .ol-scale-line{position:relative;bottom:0;left:0;background:none}.scale-bar .ol-scale-bar .ol-scale-bar-inner,.scale-bar .ol-scale-bar .ol-scale-line-inner,.scale-bar .ol-scale-line .ol-scale-bar-inner,.scale-bar .ol-scale-line .ol-scale-line-inner{color:var(--chakra-white);border-color:var(--chakra-white)}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',dt=["en","de"];function ut(r){switch(r){case"en":return E(()=>import("./C1WkJ-kI19ro.js"),[],import.meta.url).then(e=>e.default);case"de":return E(()=>import("./BDbbl70241yO.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${r}'`)}const mt=U(pt),gt=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:ut,locales:dt,packages:ct,styles:mt},Symbol.toStringTag,{value:"Module"})),W="ol-map",g=le.bind(void 0,W),u=se.bind(void 0,W),ht=q("ol-app:Editing");function F(r){const e=ft(r.kind),o=p.useId(),i=u();return t.jsx(d,{role:"dialog","aria-labelledby":o,children:t.jsx(v,{title:t.jsx(x,{id:o,size:"md",mb:2,children:i.formatMessage({id:"editing.title"})}),children:t.jsxs(d,{overflowY:"auto",maxHeight:300,children:[t.jsx(z,{textAlign:"center",children:i.formatMessage({id:"editing.active"})}),t.jsxs(H,{mt:4,align:"center",justify:"center",children:[t.jsx(I,{onClick:()=>{e?.reset()},children:i.formatMessage({id:"editing.resetGeometry"})}),t.jsx(I,{onClick:()=>{e?.destroy()},children:i.formatMessage({id:"editing.abort"})})]})]})})})}function ft(r){const e=g("notifier.NotificationService"),o=g("editing.EditingService"),i=u(),n=g("ol-app.AppModel"),{map:a}=L(),[s,l]=p.useState();return p.useEffect(()=>{if(!a)return;const c=new bt(e,o,a,i,n,r);return l(c),()=>{c.destroy(),l(void 0)}},[n,o,i,a,e,r]),s}class bt{notificationService;editingService;map;intl;appModel;kind;job;constructor(e,o,i,n,a,s){this.notificationService=e,this.editingService=o,this.map=i,this.intl=n,this.appModel=a,this.kind=s;let l;switch(s){case"create":l=this.createJob();break;case"update":l=this.updateJob();break}this.job=l,this.job.run().catch(c=>{K(c)||(ht.error("Edit operation failed",c),this.notificationService.notify({level:"error",message:this.intl.formatMessage({id:"editing.error"})}))}).finally(()=>{this.destroy()})}destroy(){this.job?.destroy(),this.job=void 0,this.appModel.hideContent(`editing-${this.kind}`)}reset(){this.job?.reset()}createJob(){let e;return{destroy(){e?.stop(),e=void 0},reset(){e?.reset()},run:async()=>{const o=this.findLayer(),i=new URL(o.attributes.collectionURL+"/items");e=this.editingService.createFeature(this.map,i);const n=await e.whenComplete();if(e=void 0,!n)return;this.notificationService.notify({level:"info",message:this.intl.formatMessage({id:"editing.create.featureCreated"},{featureId:n.featureId})}),(o?.olLayer).getSource()?.refresh()}}}updateJob(){const e=this.map,o=new AbortController,i=o.signal;let n,a,s;function l(){a&&e.olMap.removeInteraction(a),a&&a.dispose(),n&&n.destroy(),o.abort(),a=void 0,n=void 0}return{destroy(){l(),s?.stop(),s=void 0},reset(){s?.reset()},run:async()=>{const c=this.findLayer(),m=c.olLayer,w=new URL(c.attributes.collectionURL+"/items");a=new ke({layers:[m]}),e.olMap.addInteraction(a),n=vt(this.intl,e.olMap),n.element.classList.remove("editing-tooltip-hidden");let f;for(;;){const{selected:P,deselected:B}=await xt(a,i);if(P.length===1&&B.length===0){l(),f=P[0];break}}if(!f)throw Error("Feature is undefined");s=this.editingService.updateFeature(e,w,f);const S=await s.whenComplete();S&&(this.notificationService.notify({level:"info",message:this.intl.formatMessage({id:"editing.update.featureModified"},{featureId:S.featureId})}),m.getSource()?.refresh())}}}findLayer(){const e=this.map.layers.getLayerById("krankenhaus");if(!e)throw new Error("Layer not found");return e}}function vt(r,e){const o=document.createElement("div");o.className="editing-tooltip editing-tooltip-hidden",o.textContent=r.formatMessage({id:"editing.update.tooltip.select"});const i=new Me({element:o,offset:[15,0],positioning:"center-left"}),n=e.on("pointermove",a=>{a.dragging||i.setPosition(a.coordinate)});return e.addOverlay(i),{overlay:i,element:o,destroy(){M(n),e.removeOverlay(i)}}}function xt(r,e){let o;const{promise:i,resolve:n,reject:a}=$();if(e.aborted)return a(A()),i;const s=()=>{o&&M(o),o=void 0,a(A())};return e.addEventListener("abort",s),o=r.on("select",l=>{e.removeEventListener("abort",s),o&&M(o),o=void 0,n(l)}),i}function wt(){const r=u();return t.jsxs(y,{role:"region","aria-label":r.formatMessage({id:"ariaLabel.footer"}),gap:3,alignItems:"center",justifyContent:"center",children:[t.jsx(je,{precision:2,displayProjectionCode:"EPSG:4326"}),t.jsx(Ce,{}),t.jsx(Le,{})]})}function St(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"legendTitle"})}),children:t.jsx(d,{overflowY:"auto",maxHeight:300,children:t.jsx(ze,{showBaseLayers:!0})})})})}function yt(r){return G({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M6.5 9.5l1.546 -1.311"},child:[]},{tag:"path",attr:{d:"M14 5.5l3 1.5"},child:[]},{tag:"path",attr:{d:"M18.5 10l-1.185 3.318m-1.062 2.972l-.253 .71"},child:[]},{tag:"path",attr:{d:"M13.5 17.5l-7 -5"},child:[]},{tag:"path",attr:{d:"M3 3l18 18"},child:[]}]})(r)}function kt(r){return G({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M6.5 9.5l3.5 -3"},child:[]},{tag:"path",attr:{d:"M14 5.5l3 1.5"},child:[]},{tag:"path",attr:{d:"M18.5 10l-2.5 7"},child:[]},{tag:"path",attr:{d:"M13.5 17.5l-7 -5"},child:[]}]})(r)}function Mt(){const r=u(),e=g("ol-app.AppModel"),o=b(()=>e.resultListState,[e]),i=o.open,{isTocActive:n,isLegendActive:a,isPrintingActive:s}=b(()=>({isTocActive:e.mainContent.includes("toc"),isLegendActive:e.mainContent.includes("legend"),isPrintingActive:e.mainContent.includes("printing")}),[e]);return t.jsxs(y,{role:"toolbar","aria-label":r.formatMessage({id:"ariaLabel.toolbar"}),direction:"column",gap:1,padding:1,children:[t.jsx(jt,{}),o.input&&t.jsx(h,{label:r.formatMessage({id:"resultListTitle"}),icon:t.jsx(me,{}),isActive:o.open,onClick:()=>e.setResultListVisibility(!i)}),t.jsx(h,{label:r.formatMessage({id:"tocTitle"}),icon:t.jsx(ge,{}),isActive:n,onClick:()=>e.toggleMainContent("toc")}),t.jsx(h,{label:r.formatMessage({id:"legendTitle"}),icon:t.jsx(he,{}),isActive:a,onClick:()=>e.toggleMainContent("legend")}),t.jsx(h,{label:r.formatMessage({id:"printingTitle"}),icon:t.jsx(fe,{}),isActive:s,onClick:()=>e.toggleMainContent("printing")}),t.jsx(Be,{}),t.jsx(Ue,{}),t.jsx(Ke,{})]})}function jt(){const r=u(),e=g("ol-app.AppModel"),[o,i]=p.useState(!1),{isSelectionActive:n,isMeasurementActive:a,isEditingCreateActive:s,isEditingUpdateActive:l}=b(()=>({isSelectionActive:e.mainContent.includes("selection"),isMeasurementActive:e.mainContent.includes("measurement"),isEditingCreateActive:e.mainContent.includes("editing-create"),isEditingUpdateActive:e.mainContent.includes("editing-update")}),[e]),c=f=>()=>{f(),i(!1)},m={placement:"top"},w=t.jsxs(t.Fragment,{children:[t.jsx(h,{label:s?r.formatMessage({id:"editing.stopTitle"}):r.formatMessage({id:"editing.create.startTitle"}),icon:s?t.jsx(yt,{}):t.jsx(kt,{}),isActive:s,onClick:c(()=>e.toggleMainContent("editing-create")),tooltipProps:m}),t.jsx(h,{label:l?r.formatMessage({id:"editing.stopTitle"}):r.formatMessage({id:"editing.update.startTitle"}),icon:l?t.jsx(be,{}):t.jsx(ve,{}),isActive:l,onClick:c(()=>e.toggleMainContent("editing-update")),tooltipProps:m}),t.jsx(h,{label:r.formatMessage({id:"measurementTitle"}),icon:t.jsx(xe,{}),isActive:a,onClick:c(()=>e.toggleMainContent("measurement")),tooltipProps:m}),t.jsx(h,{label:r.formatMessage({id:"selectionTitle"}),icon:t.jsx(we,{}),isActive:n,onClick:c(()=>e.toggleMainContent("selection")),tooltipProps:m})]});return t.jsxs(Re,{placement:"left",isLazy:!0,onOpen:()=>i(!0),onClose:()=>i(!1),isOpen:o,children:[t.jsx(Ee,{children:t.jsx(Ct,{})}),t.jsx(Z,{children:t.jsxs(Fe,{width:"auto",children:[t.jsx(qe,{}),t.jsx(Ne,{children:t.jsx(H,{spacing:2,children:w})})]})})]})}const Ct=p.forwardRef(function(e,o){const i=u(),n=De(),{onClick:a,...s}=n.getTriggerProps();return t.jsx(h,{ref:o,label:i.formatMessage({id:"mapInteractions.title"}),icon:t.jsx(ue,{}),onClick:a,buttonProps:s})});function Lt(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"measurementTitle"})}),children:t.jsx(_e,{})})})}function zt(){const r=g("ol-app.AppModel"),e=b(()=>r.resultListState,[r]),[o,i]=p.useState([]),[n,a]=p.useState([]),s=p.useCallback(l=>{i(l.features),a(l.getFeatureIds())},[]);return p.useEffect(()=>{console.log("Anzahl Features: "+o.length),console.log("SelectedIds: "+n.toString())},[o,n]),e.input&&t.jsx(d,{className:"result-list-container",position:"absolute",visibility:e.open?"visible":"hidden",bottom:"0",backgroundColor:"white",width:"100%",height:"400px",zIndex:1,borderTop:"2px solid",borderBottom:"2px solid",borderColor:"trails.100",children:t.jsx(Ze,{input:e.input,onSelectionChange:s},e.key)})}function _t(){const{map:r}=L(),e=g("ol-app.AppModel"),o=b(()=>e.searchSources.getItems(),[e]);function i(a){if(console.debug("The user selected the following item: ",a.result),!r)return;const s=a.result.geometry;s&&e.highlightAndZoom(r,[s])}function n(){console.debug("The user cleared the search"),e.clearHighlight()}return t.jsx(d,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",mt:5,className:"search-box",children:t.jsx(Pe,{sources:o,maxResultsPerGroup:10,onSelect:i,onClear:n})})}function Pt(){const r=u(),e=g("notifier.NotificationService"),o=p.useId(),{map:i}=L(),n=g("ol-app.AppModel"),a=b(()=>n.selectionSources.getItems(),[n]),s={numberOptions:{maximumFractionDigits:3},dateOptions:{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}};function l(m){const{source:w,results:f}=m;if(!i){console.debug("Map not ready");return}const S=n.sourceMetadata.get(w);if(!S){console.warn("Can not show results because no metadata could be found");return}n.setResultListInput({columns:S,data:f,formatOptions:s}),e.notify({level:"info",message:r.formatMessage({id:"foundResults"},{resultsCount:f.length}),displayDuration:4e3})}function c(m){n.clearHighlight()}return t.jsx(d,{role:"dialog","aria-labelledby":o,children:t.jsx(v,{title:t.jsx(x,{id:o,size:"md",mb:2,children:r.formatMessage({id:"selectionTitle"})}),children:t.jsx(Ie,{sources:a,onSelectionComplete:l,onSelectionSourceChanged:c})})})}function It(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:t.jsx(z,{children:e.formatMessage({id:"tocTitle"})})}),children:t.jsx(d,{overflowY:"auto",maxHeight:300,children:t.jsx(Ve,{showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})})})}function At(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"printingTitle"})}),children:t.jsx(Ae,{})})})}function Tt(){const r=u(),e=g("ol-app.AppModel"),{resultListState:o,mainContent:i}=b(()=>({resultListState:e.resultListState,mainContent:e.mainContent}),[e]),n=o.input&&o.open;return t.jsx(ce,{mapId:_,children:t.jsxs(y,{height:"100%",direction:"column",overflow:"hidden",children:[t.jsx(Te,{position:"top-right"}),t.jsxs(v,{title:t.jsx(d,{role:"region","aria-label":r.formatMessage({id:"ariaLabel.header"}),textAlign:"center",py:1,children:t.jsx(x,{size:"md",children:"Sample Application"})}),children:[t.jsx(y,{flex:"1",direction:"column",position:"relative",children:t.jsxs(pe,{role:"main","aria-label":r.formatMessage({id:"ariaLabel.map"}),viewPadding:n?{bottom:400}:void 0,children:[t.jsx(Ye,{centerContent:!0,children:t.jsx(_t,{})}),t.jsx(Dt,{mainContent:i}),t.jsx(de,{position:"bottom-right",horizontalGap:10,verticalGap:45,children:t.jsx(Mt,{})}),t.jsx(zt,{})]})}),t.jsx(wt,{})]})]})})}function Dt(r){const{mainContent:e}=r,o=p.useMemo(()=>{const i=n=>{switch(n){case"toc":return t.jsx(It,{},n);case"legend":return t.jsx(St,{},n);case"printing":return t.jsx(At,{},n);case"selection":return t.jsx(Pt,{},n);case"measurement":return t.jsx(Lt,{},n);case"editing-create":return t.jsx(F,{kind:"create"},n);case"editing-update":return t.jsx(F,{kind:"update"},n)}};return e.map(n=>i(n))},[e]);return t.jsx(Rt,{children:o})}function Rt(r){const e=r.children,o=[];for(const i of e)i&&(o.length&&o.push(t.jsx($e,{mt:4,mb:4},o.length)),o.push(i));if(o.length!==0)return t.jsx(d,{position:"absolute",top:"100px",left:4,maxHeight:"calc(100% - 140px)",width:350,maxWidth:350,zIndex:1,backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",overflow:"auto",children:o})}const Et=new URLSearchParams(window.location.search),Ft=Et.get("lang")||void 0,qt=Y({component:Tt,appMetadata:gt,config:{locale:Ft,properties:{"@open-pioneer/local-storage":{storageId:"ol-app-state"}}}});customElements.define("ol-map-app",qt); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/jRJMM4_GqJDc.js b/openlayers-base-packages/pr-previews/pr-377/assets/BWf1FusGPLsb.js similarity index 97% rename from openlayers-base-packages/pr-previews/pr-377/assets/jRJMM4_GqJDc.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BWf1FusGPLsb.js index 0ca6df9..ff3c128 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/jRJMM4_GqJDc.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BWf1FusGPLsb.js @@ -1 +1 @@ -import{cc as F,b8 as M,aP as x,a9 as w,cd as c,ce as Y,cf as L,b2 as X,b_ as y,bC as g,cg as I,ch as S,ci as T,cj as O,ck as b,cl as j,cm as D,bY as K,c9 as $,cn as k,an as P,co as U,cp as Z,cq as z,cr as B,cs as H,ct as N,bU as v,cu as J,cv as Q,cw as V,bT as W,cx as q,am as E,cy as tt,bZ as et}from"./DyxVjgSvwe-K.js";import{L as G}from"./D8JwQmCkwKBk.js";class C extends F{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(M),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,s=t.length;et.clone())}class m extends y{constructor(t,e,s){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&s)this.setFlatCoordinates(e,t),this.ends_=s;else{const i=t,n=[],o=[];for(let a=0,l=i.length;at.clone())}class m extends y{constructor(t,e,s){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&s)this.setFlatCoordinates(e,t),this.ends_=s;else{const i=t,n=[],o=[];for(let a=0,l=i.length;a{const{icon:r,children:l,isRound:n,"aria-label":o,...i}=t,e=r||l,c=a.isValidElement(e)?a.cloneElement(e,{"aria-hidden":!0,focusable:!1}):null;return u.jsx(f,{px:"0",py:"0",borderRadius:n?"full":void 0,ref:s,"aria-label":o,...i,children:c})});h.displayName="IconButton";const m=p("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});m.displayName="Spacer";export{h as I,m as S}; +import{h as d,r as a,j as u,b as f,g as p}from"./B60Dx_GOYdnk.js";const h=d((t,s)=>{const{icon:r,children:l,isRound:n,"aria-label":o,...i}=t,e=r||l,c=a.isValidElement(e)?a.cloneElement(e,{"aria-hidden":!0,focusable:!1}):null;return u.jsx(f,{px:"0",py:"0",borderRadius:n?"full":void 0,ref:s,"aria-label":o,...i,children:c})});h.displayName="IconButton";const m=p("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});m.displayName="Spacer";export{h as I,m as S}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CLzYDcnWEay-.js b/openlayers-base-packages/pr-previews/pr-377/assets/BYONkh1IVI5I.js similarity index 99% rename from openlayers-base-packages/pr-previews/pr-377/assets/CLzYDcnWEay-.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BYONkh1IVI5I.js index 9ea2f21..c518821 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CLzYDcnWEay-.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BYONkh1IVI5I.js @@ -1,4 +1,4 @@ -import{ao as Ke,aj as Ao}from"./DbBkdn6FNbgs.js";import{a as mi}from"./nEjnOjKmH1UU.js";import"./DyxVjgSvwe-K.js";import"./CCXTS-icusD6.js";import"./CwYOJLhODXKJ.js";import"./35mnA9_wxNJd.js";import"./DnYPVZQRsXfx.js";var vt=function(a){return a&&a.Math===Math&&a},D=vt(typeof globalThis=="object"&&globalThis)||vt(typeof window=="object"&&window)||vt(typeof self=="object"&&self)||vt(typeof Ke=="object"&&Ke)||vt(typeof Ke=="object"&&Ke)||function(){return this}()||Function("return this")(),Et={},k=function(a){try{return!!a()}catch{return!0}},bl=k,le=!bl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),xl=k,pr=!xl(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")}),Tl=pr,Ft=Function.prototype.call,Y=Tl?Ft.bind(Ft):function(){return Ft.apply(Ft,arguments)},Po={},Ro={}.propertyIsEnumerable,No=Object.getOwnPropertyDescriptor,Ol=No&&!Ro.call({1:2},1);Po.f=Ol?function(e){var t=No(this,e);return!!t&&t.enumerable}:Ro;var bi=function(a,e){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:e}},Io=pr,Mo=Function.prototype,Ua=Mo.call,Sl=Io&&Mo.bind.bind(Ua,Ua),L=Io?Sl:function(a){return function(){return Ua.apply(a,arguments)}},_o=L,El=_o({}.toString),$l=_o("".slice),Be=function(a){return $l(El(a),8,-1)},wl=L,Cl=k,Al=Be,Wr=Object,Pl=wl("".split),Vo=Cl(function(){return!Wr("z").propertyIsEnumerable(0)})?function(a){return Al(a)==="String"?Pl(a,""):Wr(a)}:Wr,je=function(a){return a==null},Rl=je,Nl=TypeError,he=function(a){if(Rl(a))throw new Nl("Can't call method on "+a);return a},Il=Vo,Ml=he,$t=function(a){return Il(Ml(a))},qr=typeof document=="object"&&document.all,B=typeof qr>"u"&&qr!==void 0?function(a){return typeof a=="function"||a===qr}:function(a){return typeof a=="function"},_l=B,ve=function(a){return typeof a=="object"?a!==null:_l(a)},Qr=D,Vl=B,Dl=function(a){return Vl(a)?a:void 0},Fe=function(a,e){return arguments.length<2?Dl(Qr[a]):Qr[a]&&Qr[a][e]},kl=L,yr=kl({}.isPrototypeOf),mr=typeof navigator<"u"&&String(navigator.userAgent)||"",Do=D,Kr=mr,fn=Do.process,cn=Do.Deno,gn=fn&&fn.versions||cn&&cn.version,dn=gn&&gn.v8,ue,hr;dn&&(ue=dn.split("."),hr=ue[0]>0&&ue[0]<4?1:+(ue[0]+ue[1]));!hr&&Kr&&(ue=Kr.match(/Edge\/(\d+)/),(!ue||ue[1]>=74)&&(ue=Kr.match(/Chrome\/(\d+)/),ue&&(hr=+ue[1])));var xi=hr,pn=xi,Ll=k,Bl=D,jl=Bl.String,ko=!!Object.getOwnPropertySymbols&&!Ll(function(){var a=Symbol("symbol detection");return!jl(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&pn&&pn<41}),Fl=ko,Lo=Fl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ul=Fe,Gl=B,zl=yr,Hl=Lo,Yl=Object,Bo=Hl?function(a){return typeof a=="symbol"}:function(a){var e=Ul("Symbol");return Gl(e)&&zl(e.prototype,Yl(a))},Xl=String,br=function(a){try{return Xl(a)}catch{return"Object"}},Wl=B,ql=br,Ql=TypeError,Te=function(a){if(Wl(a))return a;throw new Ql(ql(a)+" is not a function")},Kl=Te,Zl=je,ot=function(a,e){var t=a[e];return Zl(t)?void 0:Kl(t)},Zr=Y,Jr=B,ea=ve,Jl=TypeError,eh=function(a,e){var t,r;if(e==="string"&&Jr(t=a.toString)&&!ea(r=Zr(t,a))||Jr(t=a.valueOf)&&!ea(r=Zr(t,a))||e!=="string"&&Jr(t=a.toString)&&!ea(r=Zr(t,a)))return r;throw new Jl("Can't convert object to primitive value")},jo={exports:{}},yn=D,th=Object.defineProperty,Ti=function(a,e){try{th(yn,a,{value:e,configurable:!0,writable:!0})}catch{yn[a]=e}return e},rh=D,ah=Ti,mn="__core-js_shared__",bn=jo.exports=rh[mn]||ah(mn,{});(bn.versions||(bn.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Oi=jo.exports,xn=Oi,Si=function(a,e){return xn[a]||(xn[a]=e||{})},ih=he,nh=Object,xr=function(a){return nh(ih(a))},sh=L,oh=xr,uh=sh({}.hasOwnProperty),fe=Object.hasOwn||function(e,t){return uh(oh(e),t)},lh=L,hh=0,vh=Math.random(),fh=lh(1 .toString),Fo=function(a){return"Symbol("+(a===void 0?"":a)+")_"+fh(++hh+vh,36)},ch=D,gh=Si,Tn=fe,dh=Fo,ph=ko,yh=Lo,Ze=ch.Symbol,ta=gh("wks"),mh=yh?Ze.for||Ze:Ze&&Ze.withoutSetter||dh,z=function(a){return Tn(ta,a)||(ta[a]=ph&&Tn(Ze,a)?Ze[a]:mh("Symbol."+a)),ta[a]},bh=Y,On=ve,Sn=Bo,xh=ot,Th=eh,Oh=z,Sh=TypeError,Eh=Oh("toPrimitive"),$h=function(a,e){if(!On(a)||Sn(a))return a;var t=xh(a,Eh),r;if(t){if(e===void 0&&(e="default"),r=bh(t,a,e),!On(r)||Sn(r))return r;throw new Sh("Can't convert object to primitive value")}return e===void 0&&(e="number"),Th(a,e)},wh=$h,Ch=Bo,Uo=function(a){var e=wh(a,"string");return Ch(e)?e:e+""},Ah=D,En=ve,Ga=Ah.document,Ph=En(Ga)&&En(Ga.createElement),Tr=function(a){return Ph?Ga.createElement(a):{}},Rh=le,Nh=k,Ih=Tr,Go=!Rh&&!Nh(function(){return Object.defineProperty(Ih("div"),"a",{get:function(){return 7}}).a!==7}),Mh=le,_h=Y,Vh=Po,Dh=bi,kh=$t,Lh=Uo,Bh=fe,jh=Go,$n=Object.getOwnPropertyDescriptor;Et.f=Mh?$n:function(e,t){if(e=kh(e),t=Lh(t),jh)try{return $n(e,t)}catch{}if(Bh(e,t))return Dh(!_h(Vh.f,e,t),e[t])};var Oe={},Fh=le,Uh=k,zo=Fh&&Uh(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Gh=ve,zh=String,Hh=TypeError,J=function(a){if(Gh(a))return a;throw new Hh(zh(a)+" is not an object")},Yh=le,Xh=Go,Wh=zo,Ut=J,wn=Uo,qh=TypeError,ra=Object.defineProperty,Qh=Object.getOwnPropertyDescriptor,aa="enumerable",ia="configurable",na="writable";Oe.f=Yh?Wh?function(e,t,r){if(Ut(e),t=wn(t),Ut(r),typeof e=="function"&&t==="prototype"&&"value"in r&&na in r&&!r[na]){var i=Qh(e,t);i&&i[na]&&(e[t]=r.value,r={configurable:ia in r?r[ia]:i[ia],enumerable:aa in r?r[aa]:i[aa],writable:!1})}return ra(e,t,r)}:ra:function(e,t,r){if(Ut(e),t=wn(t),Ut(r),Xh)try{return ra(e,t,r)}catch{}if("get"in r||"set"in r)throw new qh("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Kh=le,Zh=Oe,Jh=bi,wt=Kh?function(a,e,t){return Zh.f(a,e,Jh(1,t))}:function(a,e,t){return a[e]=t,a},Ho={exports:{}},za=le,ev=fe,Yo=Function.prototype,tv=za&&Object.getOwnPropertyDescriptor,Ei=ev(Yo,"name"),rv=Ei&&(function(){}).name==="something",av=Ei&&(!za||za&&tv(Yo,"name").configurable),Or={EXISTS:Ei,PROPER:rv,CONFIGURABLE:av},iv=L,nv=B,Ha=Oi,sv=iv(Function.toString);nv(Ha.inspectSource)||(Ha.inspectSource=function(a){return sv(a)});var $i=Ha.inspectSource,ov=D,uv=B,Cn=ov.WeakMap,lv=uv(Cn)&&/native code/.test(String(Cn)),hv=Si,vv=Fo,An=hv("keys"),wi=function(a){return An[a]||(An[a]=vv(a))},Ci={},fv=lv,Xo=D,cv=ve,gv=wt,sa=fe,oa=Oi,dv=wi,pv=Ci,Pn="Object already initialized",Ya=Xo.TypeError,yv=Xo.WeakMap,vr,Tt,fr,mv=function(a){return fr(a)?Tt(a):vr(a,{})},bv=function(a){return function(e){var t;if(!cv(e)||(t=Tt(e)).type!==a)throw new Ya("Incompatible receiver, "+a+" required");return t}};if(fv||oa.state){var de=oa.state||(oa.state=new yv);de.get=de.get,de.has=de.has,de.set=de.set,vr=function(a,e){if(de.has(a))throw new Ya(Pn);return e.facade=a,de.set(a,e),e},Tt=function(a){return de.get(a)||{}},fr=function(a){return de.has(a)}}else{var Ye=dv("state");pv[Ye]=!0,vr=function(a,e){if(sa(a,Ye))throw new Ya(Pn);return e.facade=a,gv(a,Ye,e),e},Tt=function(a){return sa(a,Ye)?a[Ye]:{}},fr=function(a){return sa(a,Ye)}}var Sr={set:vr,get:Tt,has:fr,enforce:mv,getterFor:bv},Ai=L,xv=k,Tv=B,Gt=fe,Xa=le,Ov=Or.CONFIGURABLE,Sv=$i,Wo=Sr,Ev=Wo.enforce,$v=Wo.get,Rn=String,ir=Object.defineProperty,wv=Ai("".slice),Cv=Ai("".replace),Av=Ai([].join),Pv=Xa&&!xv(function(){return ir(function(){},"length",{value:8}).length!==8}),Rv=String(String).split("String"),Nv=Ho.exports=function(a,e,t){wv(Rn(e),0,7)==="Symbol("&&(e="["+Cv(Rn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Gt(a,"name")||Ov&&a.name!==e)&&(Xa?ir(a,"name",{value:e,configurable:!0}):a.name=e),Pv&&t&&Gt(t,"arity")&&a.length!==t.arity&&ir(a,"length",{value:t.arity});try{t&&Gt(t,"constructor")&&t.constructor?Xa&&ir(a,"prototype",{writable:!1}):a.prototype&&(a.prototype=void 0)}catch{}var r=Ev(a);return Gt(r,"source")||(r.source=Av(Rv,typeof e=="string"?e:"")),a};Function.prototype.toString=Nv(function(){return Tv(this)&&$v(this).source||Sv(this)},"toString");var qo=Ho.exports,Iv=B,Mv=Oe,_v=qo,Vv=Ti,Ue=function(a,e,t,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(Iv(t)&&_v(t,n,r),r.global)i?a[e]=t:Vv(e,t);else{try{r.unsafe?a[e]&&(i=!0):delete a[e]}catch{}i?a[e]=t:Mv.f(a,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return a},Qo={},Dv=Math.ceil,kv=Math.floor,Lv=Math.trunc||function(e){var t=+e;return(t>0?kv:Dv)(t)},Bv=Lv,Er=function(a){var e=+a;return e!==e||e===0?0:Bv(e)},jv=Er,Fv=Math.max,Uv=Math.min,Gv=function(a,e){var t=jv(a);return t<0?Fv(t+e,0):Uv(t,e)},zv=Er,Hv=Math.min,ut=function(a){var e=zv(a);return e>0?Hv(e,9007199254740991):0},Yv=ut,Pi=function(a){return Yv(a.length)},Xv=$t,Wv=Gv,qv=Pi,Nn=function(a){return function(e,t,r){var i=Xv(e),n=qv(i);if(n===0)return!a&&-1;var o=Wv(r,n),s;if(a&&t!==t){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((a||o in i)&&i[o]===t)return a||o||0;return!a&&-1}},Ko={includes:Nn(!0),indexOf:Nn(!1)},Qv=L,ua=fe,Kv=$t,Zv=Ko.indexOf,Jv=Ci,In=Qv([].push),Zo=function(a,e){var t=Kv(a),r=0,i=[],n;for(n in t)!ua(Jv,n)&&ua(t,n)&&In(i,n);for(;e.length>r;)ua(t,n=e[r++])&&(~Zv(i,n)||In(i,n));return i},Ri=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ef=Zo,tf=Ri,rf=tf.concat("length","prototype");Qo.f=Object.getOwnPropertyNames||function(e){return ef(e,rf)};var Jo={};Jo.f=Object.getOwnPropertySymbols;var af=Fe,nf=L,sf=Qo,of=Jo,uf=J,lf=nf([].concat),hf=af("Reflect","ownKeys")||function(e){var t=sf.f(uf(e)),r=of.f;return r?lf(t,r(e)):t},Mn=fe,vf=hf,ff=Et,cf=Oe,gf=function(a,e,t){for(var r=vf(e),i=cf.f,n=ff.f,o=0;of;f++)if(v=y(a[f]),v&&ls(vs,v))return v;return new or(!1)}l=yd(a,h)}for(d=n?a.next:l.next;!(g=fd(d,l)).done;){try{v=y(g.value)}catch(x){hs(l,"throw",x)}if(typeof v=="object"&&v&&ls(vs,v))return v}return new or(!1)},xd=z,Iu=xd("iterator"),Mu=!1;try{var Td=0,fs={next:function(){return{done:!!Td++}},return:function(){Mu=!0}};fs[Iu]=function(){return this},Array.from(fs,function(){throw 2})}catch{}var Od=function(a,e){try{if(!e&&!Mu)return!1}catch{return!1}var t=!1;try{var r={};r[Iu]=function(){return{next:function(){return{done:t=!0}}}},a(r)}catch{}return t},Sd=Cr,Ed=Od,$d=Pt.CONSTRUCTOR,_u=$d||!Ed(function(a){Sd.all(a).then(void 0,function(){})}),wd=ee,Cd=Y,Ad=Te,Pd=lt,Rd=Vi,Nd=Nu,Id=_u;wd({target:"Promise",stat:!0,forced:Id},{all:function(e){var t=this,r=Pd.f(t),i=r.resolve,n=r.reject,o=Rd(function(){var s=Ad(t.resolve),u=[],l=0,h=1;Nd(e,function(f){var c=l++,v=!1;h++,Cd(s,t,f).then(function(d){v||(v=!0,u[c]=d,--h||i(u))},n)}),--h||i(u)});return o.error&&n(o.value),r.promise}});var Md=ee,_d=Pt.CONSTRUCTOR,ti=Cr,Vd=Fe,Dd=B,kd=Ue,cs=ti&&ti.prototype;Md({target:"Promise",proto:!0,forced:_d,real:!0},{catch:function(a){return this.then(void 0,a)}});if(Dd(ti)){var gs=Vd("Promise").prototype.catch;cs.catch!==gs&&kd(cs,"catch",gs,{unsafe:!0})}var Ld=ee,Bd=Y,jd=Te,Fd=lt,Ud=Vi,Gd=Nu,zd=_u;Ld({target:"Promise",stat:!0,forced:zd},{race:function(e){var t=this,r=Fd.f(t),i=r.reject,n=Ud(function(){var o=jd(t.resolve);Gd(e,function(s){Bd(o,t,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var Hd=ee,Yd=lt,Xd=Pt.CONSTRUCTOR;Hd({target:"Promise",stat:!0,forced:Xd},{reject:function(e){var t=Yd.f(this),r=t.reject;return r(e),t.promise}});var Wd=J,qd=ve,Qd=lt,Kd=function(a,e){if(Wd(a),qd(e)&&e.constructor===a)return e;var t=Qd.f(a),r=t.resolve;return r(e),t.promise},Zd=ee,Jd=Fe,ep=Pt.CONSTRUCTOR,tp=Kd;Jd("Promise");Zd({target:"Promise",stat:!0,forced:ep},{resolve:function(e){return tp(this,e)}});function ds(a,e,t,r,i,n,o){try{var s=a[n](o),u=s.value}catch(l){return void t(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function xe(a){return function(){var e=this,t=arguments;return new Promise(function(r,i){var n=a.apply(e,t);function o(u){ds(n,r,i,o,s,"next",u)}function s(u){ds(n,r,i,o,s,"throw",u)}o(void 0)})}}var rp=Ni,ap=String,pe=function(a){if(rp(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ap(a)},ip=J,Vu=function(){var a=ip(this),e="";return a.hasIndices&&(e+="d"),a.global&&(e+="g"),a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a.dotAll&&(e+="s"),a.unicode&&(e+="u"),a.unicodeSets&&(e+="v"),a.sticky&&(e+="y"),e},ji=k,np=D,Fi=np.RegExp,Ui=ji(function(){var a=Fi("a","y");return a.lastIndex=2,a.exec("abcd")!==null}),sp=Ui||ji(function(){return!Fi("a","y").sticky}),op=Ui||ji(function(){var a=Fi("^r","gy");return a.lastIndex=2,a.exec("str")!==null}),Du={BROKEN_CARET:op,MISSED_STICKY:sp,UNSUPPORTED_Y:Ui},ku={},up=Zo,lp=Ri,hp=Object.keys||function(e){return up(e,lp)},vp=le,fp=zo,cp=Oe,gp=J,dp=$t,pp=hp;ku.f=vp&&!fp?Object.defineProperties:function(e,t){gp(e);for(var r=dp(t),i=pp(t),n=i.length,o=0,s;n>o;)cp.f(e,s=i[o++],r[s]);return e};var yp=J,mp=ku,ps=Ri,bp=Ci,xp=hu,Tp=Tr,Op=wi,ys=">",ms="<",ri="prototype",ai="script",Lu=Op("IE_PROTO"),xa=function(){},Bu=function(a){return ms+ai+ys+a+ms+"/"+ai+ys},bs=function(a){a.write(Bu("")),a.close();var e=a.parentWindow.Object;return a=null,e},Sp=function(){var a=Tp("iframe"),e="java"+ai+":",t;return a.style.display="none",xp.appendChild(a),a.src=String(e),t=a.contentWindow.document,t.open(),t.write(Bu("document.F=Object")),t.close(),t.F},Kt,ur=function(){try{Kt=new ActiveXObject("htmlfile")}catch{}ur=typeof document<"u"?document.domain&&Kt?bs(Kt):Sp():bs(Kt);for(var a=ps.length;a--;)delete ur[ri][ps[a]];return ur()};bp[Lu]=!0;var Gi=Object.create||function(e,t){var r;return e!==null?(xa[ri]=yp(e),r=new xa,xa[ri]=null,r[Lu]=e):r=ur(),t===void 0?r:mp.f(r,t)},Ep=k,$p=D,wp=$p.RegExp,Cp=Ep(function(){var a=wp(".","s");return!(a.dotAll&&a.test(` +import{ao as Ke,aj as Ao}from"./B60Dx_GOYdnk.js";import{a as mi}from"./DSjrbd_eKbZM.js";import"./j0mck_Meu7Xh.js";import"./BpQSjk0kyblh.js";import"./vepZWq5kkQUw.js";import"./C9VJq5Ka7299.js";import"./2C0geDG_OBHU.js";var vt=function(a){return a&&a.Math===Math&&a},D=vt(typeof globalThis=="object"&&globalThis)||vt(typeof window=="object"&&window)||vt(typeof self=="object"&&self)||vt(typeof Ke=="object"&&Ke)||vt(typeof Ke=="object"&&Ke)||function(){return this}()||Function("return this")(),Et={},k=function(a){try{return!!a()}catch{return!0}},bl=k,le=!bl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),xl=k,pr=!xl(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")}),Tl=pr,Ft=Function.prototype.call,Y=Tl?Ft.bind(Ft):function(){return Ft.apply(Ft,arguments)},Po={},Ro={}.propertyIsEnumerable,No=Object.getOwnPropertyDescriptor,Ol=No&&!Ro.call({1:2},1);Po.f=Ol?function(e){var t=No(this,e);return!!t&&t.enumerable}:Ro;var bi=function(a,e){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:e}},Io=pr,Mo=Function.prototype,Ua=Mo.call,Sl=Io&&Mo.bind.bind(Ua,Ua),L=Io?Sl:function(a){return function(){return Ua.apply(a,arguments)}},_o=L,El=_o({}.toString),$l=_o("".slice),Be=function(a){return $l(El(a),8,-1)},wl=L,Cl=k,Al=Be,Wr=Object,Pl=wl("".split),Vo=Cl(function(){return!Wr("z").propertyIsEnumerable(0)})?function(a){return Al(a)==="String"?Pl(a,""):Wr(a)}:Wr,je=function(a){return a==null},Rl=je,Nl=TypeError,he=function(a){if(Rl(a))throw new Nl("Can't call method on "+a);return a},Il=Vo,Ml=he,$t=function(a){return Il(Ml(a))},qr=typeof document=="object"&&document.all,B=typeof qr>"u"&&qr!==void 0?function(a){return typeof a=="function"||a===qr}:function(a){return typeof a=="function"},_l=B,ve=function(a){return typeof a=="object"?a!==null:_l(a)},Qr=D,Vl=B,Dl=function(a){return Vl(a)?a:void 0},Fe=function(a,e){return arguments.length<2?Dl(Qr[a]):Qr[a]&&Qr[a][e]},kl=L,yr=kl({}.isPrototypeOf),mr=typeof navigator<"u"&&String(navigator.userAgent)||"",Do=D,Kr=mr,fn=Do.process,cn=Do.Deno,gn=fn&&fn.versions||cn&&cn.version,dn=gn&&gn.v8,ue,hr;dn&&(ue=dn.split("."),hr=ue[0]>0&&ue[0]<4?1:+(ue[0]+ue[1]));!hr&&Kr&&(ue=Kr.match(/Edge\/(\d+)/),(!ue||ue[1]>=74)&&(ue=Kr.match(/Chrome\/(\d+)/),ue&&(hr=+ue[1])));var xi=hr,pn=xi,Ll=k,Bl=D,jl=Bl.String,ko=!!Object.getOwnPropertySymbols&&!Ll(function(){var a=Symbol("symbol detection");return!jl(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&pn&&pn<41}),Fl=ko,Lo=Fl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ul=Fe,Gl=B,zl=yr,Hl=Lo,Yl=Object,Bo=Hl?function(a){return typeof a=="symbol"}:function(a){var e=Ul("Symbol");return Gl(e)&&zl(e.prototype,Yl(a))},Xl=String,br=function(a){try{return Xl(a)}catch{return"Object"}},Wl=B,ql=br,Ql=TypeError,Te=function(a){if(Wl(a))return a;throw new Ql(ql(a)+" is not a function")},Kl=Te,Zl=je,ot=function(a,e){var t=a[e];return Zl(t)?void 0:Kl(t)},Zr=Y,Jr=B,ea=ve,Jl=TypeError,eh=function(a,e){var t,r;if(e==="string"&&Jr(t=a.toString)&&!ea(r=Zr(t,a))||Jr(t=a.valueOf)&&!ea(r=Zr(t,a))||e!=="string"&&Jr(t=a.toString)&&!ea(r=Zr(t,a)))return r;throw new Jl("Can't convert object to primitive value")},jo={exports:{}},yn=D,th=Object.defineProperty,Ti=function(a,e){try{th(yn,a,{value:e,configurable:!0,writable:!0})}catch{yn[a]=e}return e},rh=D,ah=Ti,mn="__core-js_shared__",bn=jo.exports=rh[mn]||ah(mn,{});(bn.versions||(bn.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Oi=jo.exports,xn=Oi,Si=function(a,e){return xn[a]||(xn[a]=e||{})},ih=he,nh=Object,xr=function(a){return nh(ih(a))},sh=L,oh=xr,uh=sh({}.hasOwnProperty),fe=Object.hasOwn||function(e,t){return uh(oh(e),t)},lh=L,hh=0,vh=Math.random(),fh=lh(1 .toString),Fo=function(a){return"Symbol("+(a===void 0?"":a)+")_"+fh(++hh+vh,36)},ch=D,gh=Si,Tn=fe,dh=Fo,ph=ko,yh=Lo,Ze=ch.Symbol,ta=gh("wks"),mh=yh?Ze.for||Ze:Ze&&Ze.withoutSetter||dh,z=function(a){return Tn(ta,a)||(ta[a]=ph&&Tn(Ze,a)?Ze[a]:mh("Symbol."+a)),ta[a]},bh=Y,On=ve,Sn=Bo,xh=ot,Th=eh,Oh=z,Sh=TypeError,Eh=Oh("toPrimitive"),$h=function(a,e){if(!On(a)||Sn(a))return a;var t=xh(a,Eh),r;if(t){if(e===void 0&&(e="default"),r=bh(t,a,e),!On(r)||Sn(r))return r;throw new Sh("Can't convert object to primitive value")}return e===void 0&&(e="number"),Th(a,e)},wh=$h,Ch=Bo,Uo=function(a){var e=wh(a,"string");return Ch(e)?e:e+""},Ah=D,En=ve,Ga=Ah.document,Ph=En(Ga)&&En(Ga.createElement),Tr=function(a){return Ph?Ga.createElement(a):{}},Rh=le,Nh=k,Ih=Tr,Go=!Rh&&!Nh(function(){return Object.defineProperty(Ih("div"),"a",{get:function(){return 7}}).a!==7}),Mh=le,_h=Y,Vh=Po,Dh=bi,kh=$t,Lh=Uo,Bh=fe,jh=Go,$n=Object.getOwnPropertyDescriptor;Et.f=Mh?$n:function(e,t){if(e=kh(e),t=Lh(t),jh)try{return $n(e,t)}catch{}if(Bh(e,t))return Dh(!_h(Vh.f,e,t),e[t])};var Oe={},Fh=le,Uh=k,zo=Fh&&Uh(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Gh=ve,zh=String,Hh=TypeError,J=function(a){if(Gh(a))return a;throw new Hh(zh(a)+" is not an object")},Yh=le,Xh=Go,Wh=zo,Ut=J,wn=Uo,qh=TypeError,ra=Object.defineProperty,Qh=Object.getOwnPropertyDescriptor,aa="enumerable",ia="configurable",na="writable";Oe.f=Yh?Wh?function(e,t,r){if(Ut(e),t=wn(t),Ut(r),typeof e=="function"&&t==="prototype"&&"value"in r&&na in r&&!r[na]){var i=Qh(e,t);i&&i[na]&&(e[t]=r.value,r={configurable:ia in r?r[ia]:i[ia],enumerable:aa in r?r[aa]:i[aa],writable:!1})}return ra(e,t,r)}:ra:function(e,t,r){if(Ut(e),t=wn(t),Ut(r),Xh)try{return ra(e,t,r)}catch{}if("get"in r||"set"in r)throw new qh("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Kh=le,Zh=Oe,Jh=bi,wt=Kh?function(a,e,t){return Zh.f(a,e,Jh(1,t))}:function(a,e,t){return a[e]=t,a},Ho={exports:{}},za=le,ev=fe,Yo=Function.prototype,tv=za&&Object.getOwnPropertyDescriptor,Ei=ev(Yo,"name"),rv=Ei&&(function(){}).name==="something",av=Ei&&(!za||za&&tv(Yo,"name").configurable),Or={EXISTS:Ei,PROPER:rv,CONFIGURABLE:av},iv=L,nv=B,Ha=Oi,sv=iv(Function.toString);nv(Ha.inspectSource)||(Ha.inspectSource=function(a){return sv(a)});var $i=Ha.inspectSource,ov=D,uv=B,Cn=ov.WeakMap,lv=uv(Cn)&&/native code/.test(String(Cn)),hv=Si,vv=Fo,An=hv("keys"),wi=function(a){return An[a]||(An[a]=vv(a))},Ci={},fv=lv,Xo=D,cv=ve,gv=wt,sa=fe,oa=Oi,dv=wi,pv=Ci,Pn="Object already initialized",Ya=Xo.TypeError,yv=Xo.WeakMap,vr,Tt,fr,mv=function(a){return fr(a)?Tt(a):vr(a,{})},bv=function(a){return function(e){var t;if(!cv(e)||(t=Tt(e)).type!==a)throw new Ya("Incompatible receiver, "+a+" required");return t}};if(fv||oa.state){var de=oa.state||(oa.state=new yv);de.get=de.get,de.has=de.has,de.set=de.set,vr=function(a,e){if(de.has(a))throw new Ya(Pn);return e.facade=a,de.set(a,e),e},Tt=function(a){return de.get(a)||{}},fr=function(a){return de.has(a)}}else{var Ye=dv("state");pv[Ye]=!0,vr=function(a,e){if(sa(a,Ye))throw new Ya(Pn);return e.facade=a,gv(a,Ye,e),e},Tt=function(a){return sa(a,Ye)?a[Ye]:{}},fr=function(a){return sa(a,Ye)}}var Sr={set:vr,get:Tt,has:fr,enforce:mv,getterFor:bv},Ai=L,xv=k,Tv=B,Gt=fe,Xa=le,Ov=Or.CONFIGURABLE,Sv=$i,Wo=Sr,Ev=Wo.enforce,$v=Wo.get,Rn=String,ir=Object.defineProperty,wv=Ai("".slice),Cv=Ai("".replace),Av=Ai([].join),Pv=Xa&&!xv(function(){return ir(function(){},"length",{value:8}).length!==8}),Rv=String(String).split("String"),Nv=Ho.exports=function(a,e,t){wv(Rn(e),0,7)==="Symbol("&&(e="["+Cv(Rn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Gt(a,"name")||Ov&&a.name!==e)&&(Xa?ir(a,"name",{value:e,configurable:!0}):a.name=e),Pv&&t&&Gt(t,"arity")&&a.length!==t.arity&&ir(a,"length",{value:t.arity});try{t&&Gt(t,"constructor")&&t.constructor?Xa&&ir(a,"prototype",{writable:!1}):a.prototype&&(a.prototype=void 0)}catch{}var r=Ev(a);return Gt(r,"source")||(r.source=Av(Rv,typeof e=="string"?e:"")),a};Function.prototype.toString=Nv(function(){return Tv(this)&&$v(this).source||Sv(this)},"toString");var qo=Ho.exports,Iv=B,Mv=Oe,_v=qo,Vv=Ti,Ue=function(a,e,t,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(Iv(t)&&_v(t,n,r),r.global)i?a[e]=t:Vv(e,t);else{try{r.unsafe?a[e]&&(i=!0):delete a[e]}catch{}i?a[e]=t:Mv.f(a,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return a},Qo={},Dv=Math.ceil,kv=Math.floor,Lv=Math.trunc||function(e){var t=+e;return(t>0?kv:Dv)(t)},Bv=Lv,Er=function(a){var e=+a;return e!==e||e===0?0:Bv(e)},jv=Er,Fv=Math.max,Uv=Math.min,Gv=function(a,e){var t=jv(a);return t<0?Fv(t+e,0):Uv(t,e)},zv=Er,Hv=Math.min,ut=function(a){var e=zv(a);return e>0?Hv(e,9007199254740991):0},Yv=ut,Pi=function(a){return Yv(a.length)},Xv=$t,Wv=Gv,qv=Pi,Nn=function(a){return function(e,t,r){var i=Xv(e),n=qv(i);if(n===0)return!a&&-1;var o=Wv(r,n),s;if(a&&t!==t){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((a||o in i)&&i[o]===t)return a||o||0;return!a&&-1}},Ko={includes:Nn(!0),indexOf:Nn(!1)},Qv=L,ua=fe,Kv=$t,Zv=Ko.indexOf,Jv=Ci,In=Qv([].push),Zo=function(a,e){var t=Kv(a),r=0,i=[],n;for(n in t)!ua(Jv,n)&&ua(t,n)&&In(i,n);for(;e.length>r;)ua(t,n=e[r++])&&(~Zv(i,n)||In(i,n));return i},Ri=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ef=Zo,tf=Ri,rf=tf.concat("length","prototype");Qo.f=Object.getOwnPropertyNames||function(e){return ef(e,rf)};var Jo={};Jo.f=Object.getOwnPropertySymbols;var af=Fe,nf=L,sf=Qo,of=Jo,uf=J,lf=nf([].concat),hf=af("Reflect","ownKeys")||function(e){var t=sf.f(uf(e)),r=of.f;return r?lf(t,r(e)):t},Mn=fe,vf=hf,ff=Et,cf=Oe,gf=function(a,e,t){for(var r=vf(e),i=cf.f,n=ff.f,o=0;of;f++)if(v=y(a[f]),v&&ls(vs,v))return v;return new or(!1)}l=yd(a,h)}for(d=n?a.next:l.next;!(g=fd(d,l)).done;){try{v=y(g.value)}catch(x){hs(l,"throw",x)}if(typeof v=="object"&&v&&ls(vs,v))return v}return new or(!1)},xd=z,Iu=xd("iterator"),Mu=!1;try{var Td=0,fs={next:function(){return{done:!!Td++}},return:function(){Mu=!0}};fs[Iu]=function(){return this},Array.from(fs,function(){throw 2})}catch{}var Od=function(a,e){try{if(!e&&!Mu)return!1}catch{return!1}var t=!1;try{var r={};r[Iu]=function(){return{next:function(){return{done:t=!0}}}},a(r)}catch{}return t},Sd=Cr,Ed=Od,$d=Pt.CONSTRUCTOR,_u=$d||!Ed(function(a){Sd.all(a).then(void 0,function(){})}),wd=ee,Cd=Y,Ad=Te,Pd=lt,Rd=Vi,Nd=Nu,Id=_u;wd({target:"Promise",stat:!0,forced:Id},{all:function(e){var t=this,r=Pd.f(t),i=r.resolve,n=r.reject,o=Rd(function(){var s=Ad(t.resolve),u=[],l=0,h=1;Nd(e,function(f){var c=l++,v=!1;h++,Cd(s,t,f).then(function(d){v||(v=!0,u[c]=d,--h||i(u))},n)}),--h||i(u)});return o.error&&n(o.value),r.promise}});var Md=ee,_d=Pt.CONSTRUCTOR,ti=Cr,Vd=Fe,Dd=B,kd=Ue,cs=ti&&ti.prototype;Md({target:"Promise",proto:!0,forced:_d,real:!0},{catch:function(a){return this.then(void 0,a)}});if(Dd(ti)){var gs=Vd("Promise").prototype.catch;cs.catch!==gs&&kd(cs,"catch",gs,{unsafe:!0})}var Ld=ee,Bd=Y,jd=Te,Fd=lt,Ud=Vi,Gd=Nu,zd=_u;Ld({target:"Promise",stat:!0,forced:zd},{race:function(e){var t=this,r=Fd.f(t),i=r.reject,n=Ud(function(){var o=jd(t.resolve);Gd(e,function(s){Bd(o,t,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var Hd=ee,Yd=lt,Xd=Pt.CONSTRUCTOR;Hd({target:"Promise",stat:!0,forced:Xd},{reject:function(e){var t=Yd.f(this),r=t.reject;return r(e),t.promise}});var Wd=J,qd=ve,Qd=lt,Kd=function(a,e){if(Wd(a),qd(e)&&e.constructor===a)return e;var t=Qd.f(a),r=t.resolve;return r(e),t.promise},Zd=ee,Jd=Fe,ep=Pt.CONSTRUCTOR,tp=Kd;Jd("Promise");Zd({target:"Promise",stat:!0,forced:ep},{resolve:function(e){return tp(this,e)}});function ds(a,e,t,r,i,n,o){try{var s=a[n](o),u=s.value}catch(l){return void t(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function xe(a){return function(){var e=this,t=arguments;return new Promise(function(r,i){var n=a.apply(e,t);function o(u){ds(n,r,i,o,s,"next",u)}function s(u){ds(n,r,i,o,s,"throw",u)}o(void 0)})}}var rp=Ni,ap=String,pe=function(a){if(rp(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ap(a)},ip=J,Vu=function(){var a=ip(this),e="";return a.hasIndices&&(e+="d"),a.global&&(e+="g"),a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a.dotAll&&(e+="s"),a.unicode&&(e+="u"),a.unicodeSets&&(e+="v"),a.sticky&&(e+="y"),e},ji=k,np=D,Fi=np.RegExp,Ui=ji(function(){var a=Fi("a","y");return a.lastIndex=2,a.exec("abcd")!==null}),sp=Ui||ji(function(){return!Fi("a","y").sticky}),op=Ui||ji(function(){var a=Fi("^r","gy");return a.lastIndex=2,a.exec("str")!==null}),Du={BROKEN_CARET:op,MISSED_STICKY:sp,UNSUPPORTED_Y:Ui},ku={},up=Zo,lp=Ri,hp=Object.keys||function(e){return up(e,lp)},vp=le,fp=zo,cp=Oe,gp=J,dp=$t,pp=hp;ku.f=vp&&!fp?Object.defineProperties:function(e,t){gp(e);for(var r=dp(t),i=pp(t),n=i.length,o=0,s;n>o;)cp.f(e,s=i[o++],r[s]);return e};var yp=J,mp=ku,ps=Ri,bp=Ci,xp=hu,Tp=Tr,Op=wi,ys=">",ms="<",ri="prototype",ai="script",Lu=Op("IE_PROTO"),xa=function(){},Bu=function(a){return ms+ai+ys+a+ms+"/"+ai+ys},bs=function(a){a.write(Bu("")),a.close();var e=a.parentWindow.Object;return a=null,e},Sp=function(){var a=Tp("iframe"),e="java"+ai+":",t;return a.style.display="none",xp.appendChild(a),a.src=String(e),t=a.contentWindow.document,t.open(),t.write(Bu("document.F=Object")),t.close(),t.F},Kt,ur=function(){try{Kt=new ActiveXObject("htmlfile")}catch{}ur=typeof document<"u"?document.domain&&Kt?bs(Kt):Sp():bs(Kt);for(var a=ps.length;a--;)delete ur[ri][ps[a]];return ur()};bp[Lu]=!0;var Gi=Object.create||function(e,t){var r;return e!==null?(xa[ri]=yp(e),r=new xa,xa[ri]=null,r[Lu]=e):r=ur(),t===void 0?r:mp.f(r,t)},Ep=k,$p=D,wp=$p.RegExp,Cp=Ep(function(){var a=wp(".","s");return!(a.dotAll&&a.test(` `)&&a.flags==="s")}),Ap=k,Pp=D,Rp=Pp.RegExp,Np=Ap(function(){var a=Rp("(?b)","g");return a.exec("b").groups.a!=="b"||"b".replace(a,"$c")!=="bc"}),et=Y,Pr=L,Ip=pe,Mp=Vu,_p=Du,Vp=Si,Dp=Gi,kp=Sr.get,Lp=Cp,Bp=Np,jp=Vp("native-string-replace",String.prototype.replace),dr=RegExp.prototype.exec,ii=dr,Fp=Pr("".charAt),Up=Pr("".indexOf),Gp=Pr("".replace),Ta=Pr("".slice),ni=function(){var a=/a/,e=/b*/g;return et(dr,a,"a"),et(dr,e,"a"),a.lastIndex!==0||e.lastIndex!==0}(),ju=_p.BROKEN_CARET,si=/()??/.exec("")[1]!==void 0,zp=ni||si||ju||Lp||Bp;zp&&(ii=function(e){var t=this,r=kp(t),i=Ip(e),n=r.raw,o,s,u,l,h,f,c;if(n)return n.lastIndex=t.lastIndex,o=et(ii,n,i),t.lastIndex=n.lastIndex,o;var v=r.groups,d=ju&&t.sticky,g=et(Mp,t),p=t.source,y=0,x=i;if(d&&(g=Gp(g,"y",""),Up(g,"g")===-1&&(g+="g"),x=Ta(i,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&Fp(i,t.lastIndex-1)!==` `)&&(p="(?: "+p+")",x=" "+x,y++),s=new RegExp("^(?:"+p+")",g)),si&&(s=new RegExp("^"+p+"$(?!\\s)",g)),ni&&(u=t.lastIndex),l=et(dr,d?s:t,x),d?l?(l.input=Ta(l.input,y),l[0]=Ta(l[0],y),l.index=t.lastIndex,t.lastIndex+=l[0].length):t.lastIndex=0:ni&&l&&(t.lastIndex=t.global?l.index+l[0].length:u),si&&l&&l.length>1&&et(jp,l[0],s,function(){for(h=1;h=n?a?"":void 0:(o=Es(r,i),o<55296||o>56319||i+1===n||(s=Es(r,i+1))<56320||s>57343?a?Zp(r,i):o:a?Jp(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},ey={codeAt:$s(!1),charAt:$s(!0)},ty=ey.charAt,Xi=function(a,e,t){return e+(t?ty(a,e).length:1)},ws=Y,ry=J,ay=B,iy=Be,ny=zi,sy=TypeError,Wi=function(a,e){var t=a.exec;if(ay(t)){var r=ws(t,a,e);return r!==null&&ry(r),r}if(iy(a)==="RegExp")return ws(ny,a,e);throw new sy("RegExp#exec called on incompatible receiver")},oy=Y,uy=Hi,ly=J,hy=je,vy=ut,Sa=pe,fy=he,cy=ot,gy=Xi,Cs=Wi;uy("match",function(a,e,t){return[function(i){var n=fy(this),o=hy(i)?void 0:cy(i,a);return o?oy(o,i,n):new RegExp(i)[a](Sa(n))},function(r){var i=ly(this),n=Sa(r),o=t(e,i,n);if(o.done)return o.value;if(!i.global)return Cs(i,n);var s=i.unicode;i.lastIndex=0;for(var u=[],l=0,h;(h=Cs(i,n))!==null;){var f=Sa(h[0]);u[l]=f,f===""&&(i.lastIndex=gy(n,vy(i.lastIndex),s)),l++}return l===0?null:u}]});var qi=L,dy=xr,py=Math.floor,Ea=qi("".charAt),yy=qi("".replace),$a=qi("".slice),my=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,by=/\$([$&'`]|\d{1,2})/g,xy=function(a,e,t,r,i,n){var o=t+a.length,s=r.length,u=by;return i!==void 0&&(i=dy(i),u=my),yy(n,u,function(l,h){var f;switch(Ea(h,0)){case"$":return"$";case"&":return a;case"`":return $a(e,0,t);case"'":return $a(e,o);case"<":f=i[$a(h,1,-1)];break;default:var c=+h;if(c===0)return l;if(c>s){var v=py(c/10);return v===0?l:v<=s?r[v-1]===void 0?Ea(h,1):r[v-1]+Ea(h,1):l}f=r[c-1]}return f===void 0?"":f})},Ty=lu,As=Y,Rr=L,Oy=Hi,Sy=k,Ey=J,$y=B,wy=je,Cy=Er,Ay=ut,We=pe,Py=he,Ry=Xi,Ny=ot,Iy=xy,My=Wi,_y=z,oi=_y("replace"),Vy=Math.max,Dy=Math.min,ky=Rr([].concat),wa=Rr([].push),Ps=Rr("".indexOf),Rs=Rr("".slice),Ly=function(a){return a===void 0?a:String(a)},By=function(){return"a".replace(/./,"$0")==="$0"}(),Ns=function(){return/./[oi]?/./[oi]("a","$0")==="":!1}(),jy=!Sy(function(){var a=/./;return a.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(a,"$")!=="7"});Oy("replace",function(a,e,t){var r=Ns?"$":"$0";return[function(n,o){var s=Py(this),u=wy(n)?void 0:Ny(n,oi);return u?As(u,n,s,o):As(e,We(s),n,o)},function(i,n){var o=Ey(this),s=We(i);if(typeof n=="string"&&Ps(n,r)===-1&&Ps(n,"$<")===-1){var u=t(e,o,s,n);if(u.done)return u.value}var l=$y(n);l||(n=We(n));var h=o.global,f;h&&(f=o.unicode,o.lastIndex=0);for(var c=[],v;v=My(o,s),!(v===null||(wa(c,v),!h));){var d=We(v[0]);d===""&&(o.lastIndex=Ry(s,Ay(o.lastIndex),f))}for(var g="",p=0,y=0;y=p&&(g+=Rs(s,p,b)+$,p=b+x.length)}return g+Rs(s,p)}]},!jy||!By||Ns);var Fy=ve,Uy=Be,Gy=z,zy=Gy("match"),Hy=function(a){var e;return Fy(a)&&((e=a[zy])!==void 0?!!e:Uy(a)==="RegExp")},Yy=Hy,Xy=TypeError,Qi=function(a){if(Yy(a))throw new Xy("The method doesn't accept regular expressions");return a},Wy=z,qy=Wy("match"),Ki=function(a){var e=/./;try{"/./"[a](e)}catch{try{return e[qy]=!1,"/./"[a](e)}catch{}}return!1},Qy=ee,Ky=wr,Zy=Et.f,Jy=ut,Is=pe,em=Qi,tm=he,rm=Ki,am=Ky("".slice),im=Math.min,Uu=rm("startsWith"),nm=!Uu&&!!function(){var a=Zy(String.prototype,"startsWith");return a&&!a.writable}();Qy({target:"String",proto:!0,forced:!nm&&!Uu},{startsWith:function(e){var t=Is(tm(this));em(e);var r=Jy(im(arguments.length>1?arguments[1]:void 0,t.length)),i=Is(e);return am(t,r,r+i.length)===i}});var sm=z,om=Gi,um=Oe.f,ui=sm("unscopables"),li=Array.prototype;li[ui]===void 0&&um(li,ui,{configurable:!0,value:om(null)});var lm=function(a){li[ui][a]=!0},hm=k,vm=!hm(function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype}),fm=fe,cm=B,gm=xr,dm=wi,pm=vm,Ms=dm("IE_PROTO"),hi=Object,ym=hi.prototype,Gu=pm?hi.getPrototypeOf:function(a){var e=gm(a);if(fm(e,Ms))return e[Ms];var t=e.constructor;return cm(t)&&e instanceof t?t.prototype:e instanceof hi?ym:null},mm=k,bm=B,xm=ve,_s=Gu,Tm=Ue,Om=z,vi=Om("iterator"),zu=!1,ke,Ca,Aa;[].keys&&(Aa=[].keys(),"next"in Aa?(Ca=_s(_s(Aa)),Ca!==Object.prototype&&(ke=Ca)):zu=!0);var Sm=!xm(ke)||mm(function(){var a={};return ke[vi].call(a)!==a});Sm&&(ke={});bm(ke[vi])||Tm(ke,vi,function(){return this});var Hu={IteratorPrototype:ke,BUGGY_SAFARI_ITERATORS:zu},Em=Hu.IteratorPrototype,$m=Gi,wm=bi,Cm=$r,Am=Rt,Pm=function(){return this},Rm=function(a,e,t,r){var i=e+" Iterator";return a.prototype=$m(Em,{next:wm(+!r,t)}),Cm(a,i,!1),Am[i]=Pm,a},Nm=ee,Im=Y,Yu=Or,Mm=B,_m=Rm,Vs=Gu,Ds=tu,Vm=$r,Dm=wt,Pa=Ue,km=z,Lm=Rt,Xu=Hu,Bm=Yu.PROPER,jm=Yu.CONFIGURABLE,ks=Xu.IteratorPrototype,Zt=Xu.BUGGY_SAFARI_ITERATORS,ct=km("iterator"),Ls="keys",gt="values",Bs="entries",Fm=function(){return this},Um=function(a,e,t,r,i,n,o){_m(t,e,r);var s=function(y){if(y===i&&c)return c;if(!Zt&&y&&y in h)return h[y];switch(y){case Ls:return function(){return new t(this,y)};case gt:return function(){return new t(this,y)};case Bs:return function(){return new t(this,y)}}return function(){return new t(this)}},u=e+" Iterator",l=!1,h=a.prototype,f=h[ct]||h["@@iterator"]||i&&h[i],c=!Zt&&f||s(i),v=e==="Array"&&h.entries||f,d,g,p;if(v&&(d=Vs(v.call(new a)),d!==Object.prototype&&d.next&&(Vs(d)!==ks&&(Ds?Ds(d,ks):Mm(d[ct])||Pa(d,ct,Fm)),Vm(d,u,!0))),Bm&&i===gt&&f&&f.name!==gt&&(jm?Dm(h,"name",gt):(l=!0,c=function(){return Im(f,this)})),i)if(g={values:s(gt),keys:n?c:s(Ls),entries:s(Bs)},o)for(p in g)(Zt||l||!(p in h))&&Pa(h,p,g[p]);else Nm({target:e,proto:!0,forced:Zt||l},g);return h[ct]!==c&&Pa(h,ct,c,{name:i}),Lm[e]=c,g},Gm=function(a,e){return{value:a,done:e}},zm=$t,Zi=lm,js=Rt,Wu=Sr,Hm=Oe.f,Ym=Um,Jt=Gm,Xm=le,qu="Array Iterator",Wm=Wu.set,qm=Wu.getterFor(qu),Qm=Ym(Array,"Array",function(a,e){Wm(this,{type:qu,target:zm(a),index:0,kind:e})},function(){var a=qm(this),e=a.target,t=a.index++;if(!e||t>=e.length)return a.target=void 0,Jt(void 0,!0);switch(a.kind){case"keys":return Jt(t,!1);case"values":return Jt(e[t],!1)}return Jt([t,e[t]],!1)},"values"),Fs=js.Arguments=js.Array;Zi("keys");Zi("values");Zi("entries");if(Xm&&Fs.name!=="values")try{Hm(Fs,"name",{value:"values"})}catch{}var Km={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Zm=Tr,Ra=Zm("span").classList,Us=Ra&&Ra.constructor&&Ra.constructor.prototype,Jm=Us===Object.prototype?void 0:Us,Gs=D,Qu=Km,e0=Jm,pt=Qm,zs=wt,t0=$r,r0=z,Na=r0("iterator"),Ia=pt.values,Ku=function(a,e){if(a){if(a[Na]!==Ia)try{zs(a,Na,Ia)}catch{a[Na]=Ia}if(t0(a,e,!0),Qu[e]){for(var t in pt)if(a[t]!==pt[t])try{zs(a,t,pt[t])}catch{a[t]=pt[t]}}}};for(var Ma in Qu)Ku(Gs[Ma]&&Gs[Ma].prototype,Ma);Ku(e0,"DOMTokenList");var a0=Te,i0=xr,n0=Vo,s0=Pi,Hs=TypeError,Ys="Reduce of empty array with no initial value",Xs=function(a){return function(e,t,r,i){var n=i0(e),o=n0(n),s=s0(n);if(a0(t),s===0&&r<2)throw new Hs(Ys);var u=a?s-1:0,l=a?-1:1;if(r<2)for(;;){if(u in o){i=o[u],u+=l;break}if(u+=l,a?u<0:s<=u)throw new Hs(Ys)}for(;a?u>=0:s>u;u+=l)u in o&&(i=t(i,o[u],u,n));return i}},o0={left:Xs(!1),right:Xs(!0)},u0=k,Zu=function(a,e){var t=[][a];return!!t&&u0(function(){t.call(null,e||function(){return 1},1)})},l0=ee,h0=o0.left,v0=Zu,Ws=xi,f0=At,c0=!f0&&Ws>79&&Ws<83,g0=c0||!v0("reduce");l0({target:"Array",proto:!0,forced:g0},{reduce:function(e){var t=arguments.length;return h0(this,e,t,t>1?arguments[1]:void 0)}});var d0=ee,p0=wr,y0=Et.f,m0=ut,qs=pe,b0=Qi,x0=he,T0=Ki,O0=p0("".slice),S0=Math.min,Ju=T0("endsWith"),E0=!Ju&&!!function(){var a=y0(String.prototype,"endsWith");return a&&!a.writable}();d0({target:"String",proto:!0,forced:!E0&&!Ju},{endsWith:function(e){var t=qs(x0(this));b0(e);var r=arguments.length>1?arguments[1]:void 0,i=t.length,n=r===void 0?i:S0(m0(r),i),o=qs(e);return O0(t,n-o.length,n)===o}});var _a=Y,el=L,$0=Hi,w0=J,C0=je,A0=he,P0=ou,R0=Xi,N0=ut,Qs=pe,I0=ot,Ks=Wi,M0=Du,_0=k,qe=M0.UNSUPPORTED_Y,V0=4294967295,D0=Math.min,Va=el([].push),Da=el("".slice),k0=!_0(function(){var a=/(?:)/,e=a.exec;a.exec=function(){return e.apply(this,arguments)};var t="ab".split(a);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),Zs="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;$0("split",function(a,e,t){var r="0".split(void 0,0).length?function(i,n){return i===void 0&&n===0?[]:_a(e,this,i,n)}:e;return[function(n,o){var s=A0(this),u=C0(n)?void 0:I0(n,a);return u?_a(u,n,s,o):_a(r,Qs(s),n,o)},function(i,n){var o=w0(this),s=Qs(i);if(!Zs){var u=t(r,o,s,n,r!==e);if(u.done)return u.value}var l=P0(o,RegExp),h=o.unicode,f=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(qe?"g":"y"),c=new l(qe?"^(?:"+o.source+")":o,f),v=n===void 0?V0:n>>>0;if(v===0)return[];if(s.length===0)return Ks(c,s)===null?[s]:[];for(var d=0,g=0,p=[];g"u"?Ke:window,er=["moz","webkit"],rt="AnimationFrame",st=be["request"+rt],St=be["cancel"+rt]||be["cancelRequest"+rt];for(var dt=0;!st&&dt3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var u=this.r.toString(16),l=this.g.toString(16),h=this.b.toString(16);return u.length==1&&(u="0"+u),l.length==1&&(l="0"+l),h.length==1&&(h="0"+h),"#"+u+l+h},this.getHelpXML=function(){for(var u=new Array,l=0;l "+g.toRGB()+" -> "+g.toHex());d.appendChild(p),d.appendChild(y),v.appendChild(d)}catch{}return v}};const ci=Ao(eb);var tb=ee,rb=wr,ab=Ko.indexOf,ib=Zu,gi=rb([].indexOf),rl=!!gi&&1/gi([1],1,-0)<0,nb=rl||!ib("indexOf");tb({target:"Array",proto:!0,forced:nb},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return rl?gi(this,e,t)||0:ab(this,e,t)}});var sb=ee,ob=L,ub=Qi,lb=he,ao=pe,hb=Ki,vb=ob("".indexOf);sb({target:"String",proto:!0,forced:!hb("includes")},{includes:function(e){return!!~vb(ao(lb(this)),ao(ub(e)),arguments.length>1?arguments[1]:void 0)}});var fb=Be,cb=Array.isArray||function(e){return fb(e)==="Array"},gb=ee,db=L,pb=cb,yb=db([].reverse),io=[1,2];gb({target:"Array",proto:!0,forced:String(io)===String(io.reverse())},{reverse:function(){return pb(this)&&(this.length=this.length),yb(this)}});/*! ***************************************************************************** diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/BCfEYGqoP6pv.js b/openlayers-base-packages/pr-previews/pr-377/assets/BgefHtPAQ8E-.js similarity index 80% rename from openlayers-base-packages/pr-previews/pr-377/assets/BCfEYGqoP6pv.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BgefHtPAQ8E-.js index b266c34..f708cd2 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/BCfEYGqoP6pv.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BgefHtPAQ8E-.js @@ -1 +1 @@ -import{a as k,c as y,r as p,j as e,B as c,S as z,b as m,V as g,f as S}from"./DbBkdn6FNbgs.js";import{t as j}from"./CFax2WnWeOWk.js";import{S as I,T as C,O as M,M as P,H as L,f as R,i as _,k as b,g as E,h as A,l as T,m as s}from"./DyxVjgSvwe-K.js";import{P as H,N as q,I as N}from"./CLvK5IJfz41Q.js";import{_ as v}from"./CmsKOCeNyeyo.js";import{T as i,U,a as h}from"./CL68Tre-iuri.js";import"./jRJMM4_GqJDc.js";import"./D8JwQmCkwKBk.js";const d="main";class O{mapId=d;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new I({title:"OSM",isBaseLayer:!0,olLayer:new C({source:new M})})]}}}const F={"printing-api-app":{name:"printing-api-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:O,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:P,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:L,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:H,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:q,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}}},G=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}',D=["en","de"];function B(o){switch(o){case"en":return v(()=>import("./-jAncdI_g-d4.js"),[],import.meta.url).then(r=>r.default);case"de":return v(()=>import("./1YhbJ59n8_2l.js"),[],import.meta.url).then(r=>r.default)}throw new Error(`Unsupported locale: '${o}'`)}const V=k(G),W=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:B,locales:D,packages:F,styles:V},Symbol.toStringTag,{value:"Module"})),K="printing-api-app",$=R.bind(void 0,K),J=y("printing");function Q(){const{map:o}=_(d),r=$("printing.PrintingService"),[t,n]=p.useState(void 0),f=async()=>{u("canvas")},x=async()=>{u("png")},u=async w=>{o&&await r.printMap(o.olMap).then(a=>{const l=a.getCanvas();w==="canvas"?(l.style.width="100%",l.style.height="100%",n(l)):n(a.getPNGDataURL(.6))},a=>{J.error(a)})};return e.jsx(b,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(E,{title:e.jsx(c,{textAlign:"center",py:1,children:e.jsx(A,{size:"md",children:"OpenLayers Base Packages - Printing API"})}),children:e.jsx(b,{flex:"1",direction:"column",position:"relative",children:e.jsxs(T,{mapId:d,children:[e.jsx(s,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsx(c,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:e.jsxs(z,{pt:5,children:[e.jsx(i,{align:"center",children:"Test Controls:"}),e.jsx(m,{onClick:()=>f(),children:"Canvas"}),e.jsx(m,{onClick:()=>x(),children:"Image data URL"})]})})}),e.jsx(s,{position:"top-right",horizontalGap:10,verticalGap:10,children:e.jsxs(g,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",maxHeight:"300px",overflow:"auto",children:[e.jsx(i,{as:"b",children:"Description"}),e.jsx(i,{children:"This application can be used to test the printing service. The service provides the screenshot of the given map view in a form of HTMLCanvasElement or a data url."}),e.jsxs(U,{children:[e.jsxs(h,{children:["Clicking on the ","'Canvas'"," button shows the HTMLCanvasElement of the map view embedded in another HTMLElement."]}),e.jsxs(h,{children:["Clicking on the ","'Image data URL'"," button shows the data url of the map view image used as source for HTMLImageElement."]})]})]})}),e.jsx(s,{position:"top-right",horizontalGap:450,verticalGap:10,children:t&&e.jsx(g,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",className:"result-display",maxWidth:"600",maxHeight:"500",children:e.jsx(X,{input:t})})})]})})})})}function X(o){const r=typeof o.input=="string"?o.input:void 0,t=r&&e.jsxs(e.Fragment,{children:[e.jsx(i,{as:"b",children:"Image from data URL"}),e.jsx(N,{src:r})]}),n=typeof o.input!="string"?e.jsx(Y,{canvas:o.input}):void 0;return t||n}function Y(o){const r=p.useRef(null);return p.useEffect(()=>{if(!r.current)return;const t=r.current;return t.appendChild(o.canvas),()=>{t.removeChild(o.canvas)}},[o.canvas]),e.jsxs(e.Fragment,{children:[e.jsx(i,{as:"b",children:"Image from canvas"}),e.jsx(c,{ref:r})]})}const Z=new URLSearchParams(window.location.search),ee=Z.get("lang"),oe=S({component:Q,config:{locale:ee??void 0},theme:j,appMetadata:W});customElements.define("printing-api-app",oe); +import{a as k,c as y,r as p,j as e,B as c,S as z,b as m,V as g,f as S}from"./B60Dx_GOYdnk.js";import{t as j}from"./DjS5-7IPlotu.js";import{S as I,T as C,O as M,M as P,H as L,f as R,i as _,k as b,g as E,h as A,l as T,m as s}from"./j0mck_Meu7Xh.js";import{P as H,N as q,I as N}from"./C1CVOge1__u2.js";import{_ as v}from"./CmsKOCeNyeyo.js";import{T as i,U,a as h}from"./BKR6R-cAnIXt.js";import"./BWf1FusGPLsb.js";import"./ajAX9OmvUsbZ.js";const d="main";class O{mapId=d;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new I({title:"OSM",isBaseLayer:!0,olLayer:new C({source:new M})})]}}}const F={"printing-api-app":{name:"printing-api-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:O,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:P,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:H,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:L,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:q,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},G=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}',D=["en","de"];function B(o){switch(o){case"en":return v(()=>import("./-jAncdI_g-d4.js"),[],import.meta.url).then(r=>r.default);case"de":return v(()=>import("./1YhbJ59n8_2l.js"),[],import.meta.url).then(r=>r.default)}throw new Error(`Unsupported locale: '${o}'`)}const V=k(G),W=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:B,locales:D,packages:F,styles:V},Symbol.toStringTag,{value:"Module"})),K="printing-api-app",$=R.bind(void 0,K),J=y("printing");function Q(){const{map:o}=_(d),r=$("printing.PrintingService"),[t,n]=p.useState(void 0),f=async()=>{u("canvas")},x=async()=>{u("png")},u=async w=>{o&&await r.printMap(o.olMap).then(a=>{const l=a.getCanvas();w==="canvas"?(l.style.width="100%",l.style.height="100%",n(l)):n(a.getPNGDataURL(.6))},a=>{J.error(a)})};return e.jsx(b,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(E,{title:e.jsx(c,{textAlign:"center",py:1,children:e.jsx(A,{size:"md",children:"OpenLayers Base Packages - Printing API"})}),children:e.jsx(b,{flex:"1",direction:"column",position:"relative",children:e.jsxs(T,{mapId:d,children:[e.jsx(s,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsx(c,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:e.jsxs(z,{pt:5,children:[e.jsx(i,{align:"center",children:"Test Controls:"}),e.jsx(m,{onClick:()=>f(),children:"Canvas"}),e.jsx(m,{onClick:()=>x(),children:"Image data URL"})]})})}),e.jsx(s,{position:"top-right",horizontalGap:10,verticalGap:10,children:e.jsxs(g,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",maxHeight:"300px",overflow:"auto",children:[e.jsx(i,{as:"b",children:"Description"}),e.jsx(i,{children:"This application can be used to test the printing service. The service provides the screenshot of the given map view in a form of HTMLCanvasElement or a data url."}),e.jsxs(U,{children:[e.jsxs(h,{children:["Clicking on the ","'Canvas'"," button shows the HTMLCanvasElement of the map view embedded in another HTMLElement."]}),e.jsxs(h,{children:["Clicking on the ","'Image data URL'"," button shows the data url of the map view image used as source for HTMLImageElement."]})]})]})}),e.jsx(s,{position:"top-right",horizontalGap:450,verticalGap:10,children:t&&e.jsx(g,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",className:"result-display",maxWidth:"600",maxHeight:"500",children:e.jsx(X,{input:t})})})]})})})})}function X(o){const r=typeof o.input=="string"?o.input:void 0,t=r&&e.jsxs(e.Fragment,{children:[e.jsx(i,{as:"b",children:"Image from data URL"}),e.jsx(N,{src:r})]}),n=typeof o.input!="string"?e.jsx(Y,{canvas:o.input}):void 0;return t||n}function Y(o){const r=p.useRef(null);return p.useEffect(()=>{if(!r.current)return;const t=r.current;return t.appendChild(o.canvas),()=>{t.removeChild(o.canvas)}},[o.canvas]),e.jsxs(e.Fragment,{children:[e.jsx(i,{as:"b",children:"Image from canvas"}),e.jsx(c,{ref:r})]})}const Z=new URLSearchParams(window.location.search),ee=Z.get("lang"),oe=S({component:Q,config:{locale:ee??void 0},theme:j,appMetadata:W});customElements.define("printing-api-app",oe); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/BkcX60-fpzHn.js b/openlayers-base-packages/pr-previews/pr-377/assets/BkcX60-fpzHn.js deleted file mode 100644 index fb1b878..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/BkcX60-fpzHn.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse(`{"showcase-app":{"header.title":"Component Showcase","ariaLabels.map":"Karte. Mit den Pfeiltasten kannst du die Karte bewegen. Mit der Plus Taste hineinzoomen und mit der Minus Taste herauszoomen.","demos.geolocation.title":"Geolocation","demos.geolocation.description":"Diese Demo zeigt, wie das Geolocation-Tool verwendet werden kann, um die aktuelle Position des Geräts zu erhalten.","demos.printing.title":"Druck","demos.printing.description":"Diese Demo zeigt, wie die Printing-Komponente verwendet werden kann, um einen Screenshot der Karte zu exportieren.","demos.spatialBookmarks.title":"Räumliche Lesezeichen","demos.spatialBookmarks.description":"Diese Demo zeigt, wie die SpatialBookmarks-Komponente verwendet werden kann, um räumliche Lesezeichen zu speichern und anzuwenden.","demos.overviewMap.title":"Übersichtskarte","demos.overviewMap.description":"Diese Demo zeigt, wie die OverviewMap verwendet werden kann.","demos.mapNavigation.title":"Kartennavigations-Werkzeuge","demos.mapNavigation.description":"Diese Demo zeigt, wie die Tools zur Kartennavigation verwendet werden können: ZoomIn, ZoomOut, InitialExtent","demos.searchAndHighlight.title":"Suche und Feature-Highlight","demos.searchAndHighlight.description":"Diese Demo zeigt, wie die Search-Komponente verwendet werden kann und wie mittels Highlighting Features in der Karte hervorgehoben werden können.","demos.coordinateViewer.title":"Koordinaten-Anzeige","demos.coordinateViewer.description":"Diese Demo zeigt, wie die CoordinateViewer-Komponente verwendet werden kann, um sich Koordinaten an der Position des Mauszeigers anzeigen zu lassen.","demos.scaleViewer.title":"Maßstabs-Anzeige","demos.scaleViewer.description":"Diese Demo zeigt, wie die ScaleViewer-Komponente verwendet werden kann, um den aktuellen Maßstab anzuzeigen.","demos.scaleSetter.title":"Maßstab setzen","demos.scaleSetter.description":"Diese Demo zeigt, wie die ScaleSetter-Komponente verwendet werden kann, um den Maßstab der Karte anzupassen.","demos.scaleBar.title":"Maßstabsleiste","demos.scaleBar.description":"Diese Demo zeigt, wie die ScaleBar-Komponente verwendet werden kann, um eine Maßstabsleiste anzuzeigen.","demos.measurement.title":"Messen","demos.measurement.description":"Diese Demo zeigt, wie die Measurement-Komponente verwendet werden kann, um Strecken- und Flächenmessungen in der karte zu durchzuführen.","demos.tocLegend.title":"Karteninhalt, Grundkarte und Legende","demos.tocLegend.description":"Diese Demo zeigt, wie die Toc-, BasemapSwitcher und Legend-Komponenten verwendet werden können, um die Karteninhalte zu kontrollieren und eine Legende anzuzeigen.","demos.tocLegend.tocTitle":"Karteninhalt","demos.tocLegend.legendTitle":"Legende","demos.selectionResultList.title":"Selektion und Ergebnisliste","demos.selectionResultList.description":"Diese Demo zeigt, wie die Selection-Komponente verwendet werden kann, um Features in der Karte zu selektieren und wie die ResultList-Komponente verwendet werden kann, die Attribute von Features in einer Liste anzuzeigen.","demos.editing.title":"Editing","demos.editing.description":"Diese Demo zeigt, wie mit Hilfe der API des Paketes editing Editier-Funktionen angeboten werden können.","demos.editing.startCreateButton":"Feature erstellen","demos.editing.startUpdateButton":"Feature bearbeiten","demos.editing.stopButton":"Editierung stoppen","demos.editing.create.startTitle":"Editierung - Neues Feature erstellen","demos.editing.create.featureCreated":"Objekt erstellt mit ID: {featureId}","demos.editing.update.startTitle":"Editierung - Feature bearbeiten","demos.editing.update.featureModified":"Objekt aktualisiert mit ID: {featureId}","demos.editing.update.tooltip.select":"Geometrie auswählen, um mit der Bearbeitung zu starten","demos.editing.update.savingStared":"Feature wird gespeichert...","demos.editing.activeInfo":"Status: Editierung aktiv","demos.editing.inactiveInfo":"Status: Editierung inaktiv","demoSelection.label":"Demo:","demoSelection.notFound":"Demo ''{demoId}'' wurde nicht gefunden.","localeSwitcher.label":"Sprache:","localeSwitcher.locale.de":"Deutsch","localeSwitcher.locale.en":"Englisch"},"@open-pioneer/editing":{"title":"Editierung von Objekten","create.tooltip.begin":"Klicken, um mit Erstellung der Geometrie zu beginnen","create.tooltip.continue":"Doppelt klicken, um Geometrie abzuschließen und Feature zu speichern","create.tooltip.deselect":"Außerhalb der Geometrie in die Karte klicken, um Änderungen zu speichern"},"@open-pioneer/geolocation":{"locateNotSupported":"Die Geolokalisierung wird nicht unterstützt.","locateMeStart":"Geolokalisierung starten","locateMeEnd":"Geolokalisierung stoppen","error":"Fehler","permissionDenied":"Die Geolokalisierung wurde abgebrochen.","positionUnavailable":"Die Position kann nicht ermittelt werden.","timeout":"Die Geolokalisierung dauert zu lange und wurde daher abgebrochen.","unknownError":"Bei der Geolokalisierung ist es zu einem unerwarteten Fehler gekommen."},"@open-pioneer/legend":{"altLabel":"Legendengrafik für Layer {layerName}","fallbackLabel":"Legende nicht verfügbar","basemapLabel":"Hintergrundkarte"},"@open-pioneer/map-navigation":{"initial-extent.title":"Zoom auf initiale Ausdehnung","zoom-in.title":"Karte vergrößern","zoom-out.title":"Karte verkleinern","view-backward.title":"Eine Kartenansicht zurück","view-forward.title":"Eine Kartenansicht vor"},"@open-pioneer/measurement":{"measurementLabel":"Modus","distance":"Strecke","area":"Fläche","deleteMeasurementLabel":"Messungen löschen","measurementInfoText":"Klicken Sie in die Karte, um eine Messung zu beginnen.","tooltips.help":"Klicken, um mit der Messung zu beginnen.","tooltips.continue":"Doppelt klicken, um die Messung zu beenden."},"@open-pioneer/printing":{"title":"Titel","fileFormat":"Datei Format","export":"Karte exportieren","input.placeholder":"Titel eingeben","printingMap":"Karte wird gedruckt ...","printingFailed":"Die Karte konnte nicht gedruckt werden."},"@open-pioneer/result-list":{"selectAllTooltip":"Alle auswählen","deSelectAllTooltip":"Alle abwählen","noDataMessage":"Keine Daten verfügbar","displayBoolean.true":"ja","displayBoolean.false":"nein","ariaLabel.selectSingle":"Drücken Sie die Leertaste zum ab- oder anwählen."},"@open-pioneer/scale-setter":{"button.ariaLabel":"Aktueller Maßstab: {scale}.","button.ariaDescription":"Drücken Sie Enter um den Maßstab zu ändern."},"@open-pioneer/search":{"noOptionsText":"Keine Suchtreffer gefunden","loadingText":"Frage Daten ab...","searchPlaceholder":"Suche...","ariaLabel.search":"Suchleiste","ariaLabel.instructions":"Benutze die Pfeiltasten Hoch und Runter um durch die Suchergebnisse zu scrollen, drücke Enter um das Suchergebnis zu selektieren, drücke Escape um zurückzukehren","ariaLabel.searchFocus":"fokussiert","ariaLabel.searchSelect":"selektiert","ariaLabel.searchClear":"gelöscht","ariaLabel.clearButton":"Suche leeren"},"@open-pioneer/selection":{"selectMethod":"Methode auswählen","EXTENT":"Rechteck","POLYGON":"Polygon","FREEPOLYGON":"Freies Zeichnen","CIRCLE":"Kreis","selectSource":"Quelle auswählen","tooltip":"Klicken Sie in die Karte, halten Sie die Maustaste gedrückt und ziehen Sie ein Rechteck auf","disabledTooltip":"Die aktuelle Selektionsquelle ist nicht verfügbar.","noSourceTooltip":"Es ist keine Selektionsquelle ausgewählt. Zum Starten bitte Selektionsquelle auswählen.","sourceNotAvailable":"Quelle nicht verfügbar","selectionFailed":"Die räumliche Auswahl ist fehlgeschlagen","selectionPlaceholder":"Keine Quelle ausgewählt","layerNotVisibleReason":"Zugehöriger Layer ist nicht sichtbar.","selected":"selektiert"},"@open-pioneer/spatial-bookmarks":{"bookmark.button.create":"Neues Lesezeichen hinzufügen","bookmark.button.deleteAll":"Alle Lesezeichen löschen","bookmark.button.deleteOne":"Lesezeichen löschen","bookmark.button.save":"Speichern","bookmark.button.cancel":"Abbrechen","bookmark.button.cancelDelete":"Nein","bookmark.button.confirmDelete":"Ja","bookmark.input.label":"Name","bookmark.input.placeholder":"Name des Lesezeichens","bookmark.alert.create":"Nach der Eingabe eines Namens können Sie das neue Lesezeichen speichern. Dabei wird der aktuelle Kartenausschnitt als Grundlage für die Position verwendet.","bookmark.alert.delete":"Möchten Sie wirklich alle räumlichen Lesezeichen löschen?","bookmark.alert.noSaved":"Sie haben keine gespeicherten Lesezeichen","bookmark.list.label":"Räumliche Lesezeichen"},"@open-pioneer/toc":{"basemapsLabel":"Hintergrundkarten","descriptionLabel":"Layer Beschreibung","operationalLayerLabel":"Layer","childgroupLabel":"Layergruppe {title}","missingLayers":"Es sind keine Layer vorhanden.","group.expand":"Gruppe ausklappen","group.collapse":"Gruppe einklappen","error":"Beim Erstellen des Karteninhalts ist ein Fehler aufgetreten.","layerNotAvailable":"Layer nicht verfügbar","toolsLabel":"Kartenwerkzeuge","tools.hideAllLayers":"Alle Karteninhalte ausblenden","tools.collapseAllGroups":"Alle Gruppen einklappen"},"@open-pioneer/basemap-switcher":{"emptyBasemapLabel":"Ohne Hintergrundkarte","layerNotAvailable":"Layer nicht verfügbar","selected":"selektiert"}}`);export{e as default}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/DjAArQ67Dgmx.js b/openlayers-base-packages/pr-previews/pr-377/assets/BlACKGYldMfy.js similarity index 79% rename from openlayers-base-packages/pr-previews/pr-377/assets/DjAArQ67Dgmx.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BlACKGYldMfy.js index a39edfd..d91f6a6 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/DjAArQ67Dgmx.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BlACKGYldMfy.js @@ -1 +1 @@ -import{r as l,h as d,j as o,I as h}from"./DbBkdn6FNbgs.js";function x(r){const{viewBox:e="0 0 24 24",d:s,displayName:n,defaultProps:c={}}=r,t=l.Children.toArray(r.path),a=d((i,p)=>o.jsx(h,{ref:p,viewBox:e,...c,...i,children:t.length?t:o.jsx("path",{fill:"currentColor",d:s})}));return a.displayName=n,a}export{x as c}; +import{r as l,h as d,j as o,I as h}from"./B60Dx_GOYdnk.js";function x(r){const{viewBox:e="0 0 24 24",d:s,displayName:n,defaultProps:c={}}=r,t=l.Children.toArray(r.path),a=d((i,p)=>o.jsx(h,{ref:p,viewBox:e,...c,...i,children:t.length?t:o.jsx("path",{fill:"currentColor",d:s})}));return a.displayName=n,a}export{x as c}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CCXTS-icusD6.js b/openlayers-base-packages/pr-previews/pr-377/assets/BpQSjk0kyblh.js similarity index 67% rename from openlayers-base-packages/pr-previews/pr-377/assets/CCXTS-icusD6.js rename to openlayers-base-packages/pr-previews/pr-377/assets/BpQSjk0kyblh.js index b0a168c..184c85a 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CCXTS-icusD6.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/BpQSjk0kyblh.js @@ -1 +1 @@ -import{r as e}from"./DbBkdn6FNbgs.js";function c(t){const r=e.useRef(null);return e.useLayoutEffect(()=>{r.current=t}),e.useCallback((...n)=>{const u=r.current;return u(...n)},[])}export{c as u}; +import{r as e}from"./B60Dx_GOYdnk.js";function c(t){const r=e.useRef(null);return e.useLayoutEffect(()=>{r.current=t}),e.useCallback((...n)=>{const u=r.current;return u(...n)},[])}export{c as u}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/BxannLiVc7Kn.js b/openlayers-base-packages/pr-previews/pr-377/assets/BxannLiVc7Kn.js deleted file mode 100644 index ab9845c..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/BxannLiVc7Kn.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse(`{"showcase-app":{"header.title":"Component Showcase","ariaLabels.map":"Map. Use the arrow keys to move the map. Zoom in with the plus button and zoom out with the minus button.","demos.geolocation.title":"Geolocation","demos.geolocation.description":"This demo shows how to use the Geolocation tool to get the current position of the device.","demos.printing.title":"Printing","demos.printing.description":"This demo shows how to use the Printing component to export a screenshot of the map.","demos.spatialBookmarks.title":"Spatial Bookmarks","demos.spatialBookmarks.description":"This demo shows how to use the SpatialBookmarks component to save und load spatial bookmarks.","demos.overviewMap.title":"Overview map","demos.overviewMap.description":"This demo shows how to use the OverviewMap.","demos.mapNavigation.title":"Map navigation tools","demos.mapNavigation.description":"This demo shows how to use the map navigation tools: ZoomIn, ZoomOut, InitialExtent","demos.searchAndHighlight.title":"Search and Feature-Highlight","demos.searchAndHighlight.description":"This demo shows how to use the Search component and how features can be highlighted in the map.","demos.coordinateViewer.title":"Coordinate viewer","demos.coordinateViewer.description":"This demo shows how to use the CoordinateViewer component to show the coordinates at the users current mouse position.","demos.scaleViewer.title":"Scale viewer","demos.scaleViewer.description":"This demo shows how to use the ScaleViewer component.","demos.scaleSetter.title":"Scale setter","demos.scaleSetter.description":"This demo shows how to use the ScaleSetter component to change the scale of the map.","demos.scaleBar.title":"Scale bar","demos.scaleBar.description":"This demo shows how to use the ScaleBar component.","demos.measurement.title":"Measurement","demos.measurement.description":"This demo shows how to use the Measurement component for measuring distances and areas. Measurement component for measuring distances and areas.","demos.tocLegend.title":"Toc, BasemapSwitcher and Legend","demos.tocLegend.description":"This demo shows how to use the Toc, BasemapSwitcher and Legend components to control the map content and to show the legend for the contents.","demos.tocLegend.tocTitle":"TOC","demos.tocLegend.legendTitle":"Legend","demos.selectionResultList.title":"Selection and Result List","demos.selectionResultList.description":"This demo shows how to use the Selection component to select feature in the map and how to use the ResultList component to display feature attributes in a table.","demos.editing.title":"Editing","demos.editing.description":"This demo shows how the API of the editing package can be used to provide editing functionality.","demos.editing.startCreateButton":"create feature","demos.editing.startUpdateButton":"update feature","demos.editing.stopButton":"stop editing","demos.editing.create.startTitle":"Editing - Create new feature","demos.editing.create.featureCreated":"Created feature with ID: {featureId}","demos.editing.update.startTitle":"Editing - Modify feature","demos.editing.update.featureModified":"Modified feature with ID: {featureId}","demos.editing.update.tooltip.select":"Select geometry to start editing","demos.editing.update.savingStared":"Feature is being saved...","demos.editing.activeInfo":"Status: editing active","demos.editing.inactiveInfo":"Status: editing inactive","demoSelection.label":"Demo:","demoSelection.notFound":"Demo ''{demoId}'' was not found.","localeSwitcher.label":"Language:","localeSwitcher.locale.de":"German","localeSwitcher.locale.en":"English"},"@open-pioneer/editing":{"title":"Editing","create.tooltip.begin":"Click to start creating the geometry","create.tooltip.continue":"Double click to finish the geometry and save the feature","create.tooltip.deselect":"Click outside the geometry in the map to save changes"},"@open-pioneer/geolocation":{"locateNotSupported":"Geolocation is not supported.","locateMeStart":"Start geolocation","locateMeEnd":"Stop geolocation","error":"Error","permissionDenied":"Geolocation was canceled.","positionUnavailable":"Geolocation position cannot be determined.","timeout":"Geolocation was canceled due to timeout.","unknownError":"An unexpected error occurred during geolocation."},"@open-pioneer/legend":{"altLabel":"legend image for layer {layerName}","fallbackLabel":"legend not available","basemapLabel":"Basemap"},"@open-pioneer/map-navigation":{"initial-extent.title":"Zoom to initial extent","zoom-in.title":"Zoom in map","zoom-out.title":"Zoom out map","view-backward.title":"One map view back","view-forward.title":"One map view ahead"},"@open-pioneer/measurement":{"measurementLabel":"Mode","distance":"Distance","area":"Area","deleteMeasurementLabel":"Delete measurements","measurementInfoText":"Click in the map to start a measurement.","tooltips.help":"Click to start measuring.","tooltips.continue":"Double click to end the measurement."},"@open-pioneer/printing":{"title":"Title","fileFormat":"File format","export":"Export map","input.placeholder":"Enter title","printingMap":"Map is printing ...","printingFailed":"Failed to print the map."},"@open-pioneer/result-list":{"selectAllTooltip":"Select all","deSelectAllTooltip":"Deselect all","noDataMessage":"No data available","displayBoolean.true":"yes","displayBoolean.false":"no","ariaLabel.selectSingle":"Press space to select or deselect."},"@open-pioneer/scale-setter":{"button.ariaLabel":"Current scale: {scale}.","button.ariaDescription":"Press Enter to change the scale."},"@open-pioneer/search":{"noOptionsText":"No results found","loadingText":"Loading...","searchPlaceholder":"Search...","ariaLabel.search":"Search bar","ariaLabel.instructions":"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.","ariaLabel.searchFocus":"focused","ariaLabel.searchSelect":"selected","ariaLabel.searchClear":"cleared","ariaLabel.clearButton":"Empty the search"},"@open-pioneer/selection":{"selectMethod":"Select method","EXTENT":"Rechteck","POLYGON":"Polygon","FREEPOLYGON":"Freies Zeichnen","CIRCLE":"Kreis","selectSource":"Select source","tooltip":"Click on the map, hold down the mouse button and draw a rectangle","disabledTooltip":"The current selection source is not available","noSourceTooltip":"No selection source selected. Please choose a selection source to start.","sourceNotAvailable":"Source not available","selectionFailed":"Spatial selection failed","selectionPlaceholder":"No source selected","layerNotVisibleReason":"Matching layer is not visible.","selected":"selected"},"@open-pioneer/spatial-bookmarks":{"bookmark.button.create":"Add new bookmark","bookmark.button.deleteAll":"Delete all bookmarks","bookmark.button.deleteOne":"Delete bookmark","bookmark.button.save":"Save","bookmark.button.cancel":"Cancel","bookmark.button.cancelDelete":"No","bookmark.button.confirmDelete":"Yes","bookmark.input.label":"Name","bookmark.input.placeholder":"Enter bookmark name","bookmark.alert.create":"After entering a name you can save the new bookmark. The current map extent is used as the basis for the position.","bookmark.alert.delete":"Do you really want to delete all spatial bookmarks?","bookmark.alert.noSaved":"No bookmarks saved","bookmark.list.label":"Spatial bookmarks"},"@open-pioneer/toc":{"basemapsLabel":"Basemaps","descriptionLabel":"Layer description","operationalLayerLabel":"Operational layers","childgroupLabel":"Layer group {title}","missingLayers":"There are no layers to display.","group.expand":"Expand group {title}","group.collapse":"Collapse group {title}","error":"Error while creating map content.","layerNotAvailable":"Layer not available","toolsLabel":"Map tools","tools.hideAllLayers":"Hide all layers","tools.collapseAllGroups":"Collapse all groups"},"@open-pioneer/basemap-switcher":{"emptyBasemapLabel":"Without basemap","layerNotAvailable":"Layer not available","selected":"selected"}}`);export{e as default}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CLvK5IJfz41Q.js b/openlayers-base-packages/pr-previews/pr-377/assets/C1CVOge1__u2.js similarity index 98% rename from openlayers-base-packages/pr-previews/pr-377/assets/CLvK5IJfz41Q.js rename to openlayers-base-packages/pr-previews/pr-377/assets/C1CVOge1__u2.js index 4094e1b..43e92af 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CLvK5IJfz41Q.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/C1CVOge1__u2.js @@ -1,4 +1,4 @@ -var J=a=>{throw TypeError(a)};var V=(a,e,t)=>e.has(a)||J("Cannot "+t);var w=(a,e,t)=>(V(a,e,"read from private field"),t?t.call(a):e.get(a)),E=(a,e,t)=>e.has(a)?J("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),v=(a,e,t,i)=>(V(a,e,"write to private field"),i?i.call(a,t):e.set(a,t),t),x=(a,e,t)=>(V(a,e,"access private method"),t);import{r as R,a8 as ue,h as se,j as K,a6 as fe,g as Q,c as ge,d as _e}from"./DbBkdn6FNbgs.js";import{_ as me}from"./CmsKOCeNyeyo.js";import{b_ as pe,b$ as ye,B as Ce,c0 as we,c1 as ke,c2 as Te,bc as xe,c3 as Pe,bA as ve,bn as Z,bs as Se,a as Le,b as De,c4 as Ee,bg as ee,bz as be,c5 as Me,a9 as Ie,bl as k,c6 as Fe,G as Re,bm as ne,a_ as b,an as B,c7 as te,bv as Ne,ao as Oe,am as re,by as Ge,c8 as Ue,c9 as oe,ca as Ae,aK as je,aM as We,cb as ie,aq as Ve}from"./DyxVjgSvwe-K.js";import{a as Be,b as ae,M as he,G as qe}from"./jRJMM4_GqJDc.js";import{L as j}from"./D8JwQmCkwKBk.js";function He(a){const{loading:e,src:t,srcSet:i,onLoad:s,onError:r,crossOrigin:n,sizes:o,ignoreFallback:h}=a,[l,c]=R.useState("pending");R.useEffect(()=>{c(t?"loading":"pending")},[t]);const d=R.useRef(),u=R.useCallback(()=>{if(!t)return;f();const g=new Image;g.src=t,n&&(g.crossOrigin=n),i&&(g.srcset=i),o&&(g.sizes=o),e&&(g.loading=e),g.onload=_=>{f(),c("loaded"),s?.(_)},g.onerror=_=>{f(),c("failed"),r?.(_)},d.current=g},[t,n,i,o,s,r,e]),f=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return ue(()=>{if(!h)return l==="loading"&&u(),()=>{f()}},[l,u,h]),h?"loaded":l}const $e=(a,e)=>a!=="loaded"&&e==="beforeLoadOrError"||a==="failed"&&e==="onError",Y=se(function(e,t){const{htmlWidth:i,htmlHeight:s,alt:r,...n}=e;return K.jsx("img",{width:i,height:s,ref:t,alt:r,...n})});Y.displayName="NativeImage";const Xe=se(function(e,t){const{fallbackSrc:i,fallback:s,src:r,srcSet:n,align:o,fit:h,loading:l,ignoreFallback:c,crossOrigin:d,fallbackStrategy:u="beforeLoadOrError",referrerPolicy:f,...g}=e,_=i!==void 0||s!==void 0,m=l!=null||c||!_,P=He({...e,crossOrigin:d,ignoreFallback:m}),T=$e(P,u),p={ref:t,objectFit:h,objectPosition:o,...m?g:fe(g,["onError","onLoad"])};return T?s||K.jsx(Q.img,{as:Y,className:"chakra-image__placeholder",src:i,...p}):K.jsx(Q.img,{as:Y,src:r,srcSet:n,crossOrigin:d,loading:l,referrerPolicy:f,className:"chakra-image",...p})});Xe.displayName="Image";class W extends pe{constructor(e,t,i){super(),i!==void 0&&t===void 0?this.setFlatCoordinates(i,e):(t=t||0,this.setCenterAndRadius(e,t,i))}clone(){const e=new W(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,s){const r=this.flatCoordinates,n=e-r[0],o=t-r[1],h=n*n+o*o;if(h=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:we(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],s=e.slice();s[t]=s[0]+i;for(let r=1;r{throw TypeError(a)};var V=(a,e,t)=>e.has(a)||J("Cannot "+t);var w=(a,e,t)=>(V(a,e,"read from private field"),t?t.call(a):e.get(a)),E=(a,e,t)=>e.has(a)?J("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),v=(a,e,t,i)=>(V(a,e,"write to private field"),i?i.call(a,t):e.set(a,t),t),x=(a,e,t)=>(V(a,e,"access private method"),t);import{r as R,aa as ue,h as se,j as K,a8 as fe,g as Q,c as ge,d as _e}from"./B60Dx_GOYdnk.js";import{_ as me}from"./CmsKOCeNyeyo.js";import{b_ as pe,b$ as ye,B as Ce,c0 as we,c1 as ke,c2 as Te,bd as xe,c3 as Pe,bB as ve,bp as Z,bt as Se,a as Le,b as De,c4 as Ee,bh as ee,bA as be,c5 as Me,a9 as Ie,bm as k,c6 as Fe,G as Re,bo as ne,a_ as b,an as B,c7 as te,bw as Ne,ao as Oe,am as re,bz as Ge,c8 as Ue,c9 as oe,ca as Ae,aK as je,aM as We,cb as ie,aq as Ve}from"./j0mck_Meu7Xh.js";import{a as Be,b as ae,M as he,G as qe}from"./BWf1FusGPLsb.js";import{L as j}from"./ajAX9OmvUsbZ.js";function He(a){const{loading:e,src:t,srcSet:i,onLoad:s,onError:r,crossOrigin:n,sizes:o,ignoreFallback:h}=a,[l,c]=R.useState("pending");R.useEffect(()=>{c(t?"loading":"pending")},[t]);const d=R.useRef(),u=R.useCallback(()=>{if(!t)return;f();const g=new Image;g.src=t,n&&(g.crossOrigin=n),i&&(g.srcset=i),o&&(g.sizes=o),e&&(g.loading=e),g.onload=_=>{f(),c("loaded"),s?.(_)},g.onerror=_=>{f(),c("failed"),r?.(_)},d.current=g},[t,n,i,o,s,r,e]),f=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return ue(()=>{if(!h)return l==="loading"&&u(),()=>{f()}},[l,u,h]),h?"loaded":l}const $e=(a,e)=>a!=="loaded"&&e==="beforeLoadOrError"||a==="failed"&&e==="onError",Y=se(function(e,t){const{htmlWidth:i,htmlHeight:s,alt:r,...n}=e;return K.jsx("img",{width:i,height:s,ref:t,alt:r,...n})});Y.displayName="NativeImage";const Xe=se(function(e,t){const{fallbackSrc:i,fallback:s,src:r,srcSet:n,align:o,fit:h,loading:l,ignoreFallback:c,crossOrigin:d,fallbackStrategy:u="beforeLoadOrError",referrerPolicy:f,...g}=e,_=i!==void 0||s!==void 0,m=l!=null||c||!_,P=He({...e,crossOrigin:d,ignoreFallback:m}),T=$e(P,u),p={ref:t,objectFit:h,objectPosition:o,...m?g:fe(g,["onError","onLoad"])};return T?s||K.jsx(Q.img,{as:Y,className:"chakra-image__placeholder",src:i,...p}):K.jsx(Q.img,{as:Y,src:r,srcSet:n,crossOrigin:d,loading:l,referrerPolicy:f,className:"chakra-image",...p})});Xe.displayName="Image";class W extends pe{constructor(e,t,i){super(),i!==void 0&&t===void 0?this.setFlatCoordinates(i,e):(t=t||0,this.setCenterAndRadius(e,t,i))}clone(){const e=new W(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,s){const r=this.flatCoordinates,n=e-r[0],o=t-r[1],h=n*n+o*o;if(h=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:we(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],s=e.slice();s[t]=s[0]+i;for(let r=1;r component has likely been used twice in your application.`),{destroy(){}};v(this,C,e);const t=w(this,D);if(v(this,D,void 0),t)for(const[s,...r]of t)e[s](...r);let i=!1;return{destroy:()=>{i||(i=!0,w(this,C)===e&&v(this,C,void 0))}}}}C=new WeakMap,D=new WeakMap,F=new WeakMap,y=new WeakSet,I=function(e,t){typeof t=="string"&&(t={message:t}),this.notify({...t,level:e})},z=function(e,...t){if(w(this,C))w(this,C)[e](...t);else{const i=w(this,D)??v(this,D,[]);if(i.length>=1024){q.error(`Internal notification buffer overflow: this event will be dropped to prevent a memory leak. Make sure that the UI is configured to display notifications (use ).`,{method:e,args:t});return}i.push([e,...t])}},Ke=function(){w(this,C)||q.warn(`No notification handler has been registered: notifications will not be visible. Make sure that your app contains the component.`)};const N={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class O extends Oe{constructor(e,t){super(e),this.feature=t}}function Ye(a,e){const t=[];for(let i=0;i=t?a[e-t]:a[e]}function U(a,e,t){let i,s;en){const h=L(a,i),l=L(a,s);return G(h,l)}let o=0;if(iu.startIndex?_u.startIndex&&(_-=f.length)),h=_,o=d)}const l=e.targets[o];let c=l.ring;if(e.targetIndex===o&&c){const d=L(l.coordinates,h),u=t.getPixelFromCoordinate(d);ne(u,e.startPx)>i&&(c=!1)}if(c){const d=l.coordinates,u=d.length,f=l.startIndex,g=h;if(f=t?i-=t:i<0&&(i+=t);let r=i+1;r>=t&&(r-=t);const n=a[i],o=n[0],h=n[1],l=a[r],c=l[0]-o,d=l[1]-h;return[o+c*s,h+d*s]}class Je extends xe{constructor(e){const t=e;t.stopDown||(t.stopDown=Pe),super(t),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=Ze(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:ve,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let i=e.geometryFunction;if(!i){const s=this.mode_;if(s==="Circle")i=(r,n,o)=>{const h=n||new W([NaN,NaN]),l=Z(r[0]),c=Se(l,Z(r[r.length-1]));return h.setCenterAndRadius(l,Math.sqrt(c),this.geometryLayout_),h};else{let r;s==="Point"?r=B:s==="LineString"?r=j:s==="Polygon"&&(r=re),i=(n,o,h)=>(o?s==="Polygon"?n[0].length?o.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):o.setCoordinates([],this.geometryLayout_):o.setCoordinates(n,this.geometryLayout_):o=new r(n,this.geometryLayout_),o)}}this.geometryFunction_=i,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new Le({source:new De({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:Qe(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Ee,this.freehandCondition_,e.freehand?this.freehandCondition_=ee:this.freehandCondition_=e.freehandCondition?e.freehandCondition:be,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Me.ACTIVE,this.updateState_)}setTrace(e){let t;e?e===!0?t=ee:t=e:t=Ge,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===Ie.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let t=e.type===k.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===k.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===k.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===k.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===k.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===k.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===k.DBLCLICK&&(i=!1),super.handleEvent(e)&&i}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new Fe(k.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const t=this.getMap(),i=t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),s=t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),r=Re([i,s]),n=this.traceSource_.getFeaturesInExtent(r);if(n.length===0)return;const o=Ye(e.coordinate,n);o.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:o,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const i=e.startIndex<=e.endIndex,s=e.startIndex<=t;i===s?i&&t>e.endIndex||!i&&te.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let i=0;if(e0&&this.removeLastPoints_(i)}addTracedCoordinates_(e,t,i){if(t===i)return;const s=[];if(t=n;--o)s.push(S(e.coordinates,o))}s.length&&this.appendCoordinates(s)}updateTrace_(e){const t=this.traceState_;if(!t.active||t.targetIndex===-1&&ne(t.startPx,e.pixel)this.squaredClickTolerance_:n<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let i=!1;if(this.sketchFeature_){let s=!1,r=[this.finishCoordinate_];const n=this.mode_;if(n==="Point")i=!0;else if(n==="Circle")i=this.sketchCoords_.length===2;else if(n==="LineString")s=!t&&this.sketchCoords_.length>this.minPoints_;else if(n==="Polygon"){const o=this.sketchCoords_;s=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]],t?r=[o[0][0]]:r=[o[0][0],o[0][o[0].length-2]]}if(s){const o=this.getMap();for(let h=0,l=r.length;h=this.maxPoints_&&(this.freehand_?r.pop():s=!0),r.push(e.slice()),this.geometryFunction_(r,t,i)):n==="Polygon"&&(r=this.sketchCoords_[0],r.length>=this.maxPoints_&&(this.freehand_?r.pop():s=!0),r.push(e.slice()),s&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,t,i)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),s?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),s=this.mode_;for(let r=0;r=2){this.finishCoordinate_=n[n.length-2].slice();const o=this.finishCoordinate_.slice();n[n.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(n,t,i),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(s==="Polygon"){n=this.sketchCoords_[0],n.splice(-2,1);const o=this.sketchLine_.getGeometry();if(n.length>=2){const h=n[n.length-2].slice();n[n.length-1]=h,this.createOrUpdateSketchPoint_(h)}o.setCoordinates(n),this.geometryFunction_(this.sketchCoords_,t,i)}if(n.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_;const i=e.getGeometry(),s=this.getMap().getView().getProjection();return this.mode_==="LineString"?(t.pop(),this.geometryFunction_(t,i,s)):this.mode_==="Polygon"&&(t[0].pop(),this.geometryFunction_(t,i,s),t=i.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new Be([t])):this.type_==="MultiLineString"?e.setGeometry(new ae([t])):this.type_==="MultiPolygon"&&e.setGeometry(new he([t])),this.dispatchEvent(new O(N.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new O(N.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(e[0]);let s;if(t==="LineString"||t==="Circle")s=this.sketchCoords_;else if(t==="Polygon")s=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&s.shift(),s.pop();for(let n=0;n=h){u=_,f=m,g=P;break}else if(f>=o)break;_=u,m=f,P=g,++d}const T=this.scaleBar_?this.createScaleBar(f,u,c):u.toFixed(g<0?-g:0)+" "+c;this.renderedHTML_!=T&&(this.innerElement_.innerHTML=T,this.renderedHTML_=T),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,t,i){const s=this.getScaleForResolution(),r=s<1?Math.round(1/s).toLocaleString()+" : 1":"1 : "+Math.round(s).toLocaleString(),n=this.scaleBarSteps_,o=e/n,h=[this.createMarker("absolute")];for(let c=0;c
`+this.createMarker("relative")+(c%2===0||n===2?this.createStepText(c,e,!1,t,i):"")+"")}return h.push(this.createStepText(n,e,!0,t,i)),(this.scaleBarText_?`
`+r+"
":"")+h.join("")}createMarker(e){return`
`}createStepText(e,t,i,s,r){const o=(e===0?0:Math.round(s/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+r),h=e===0?-3:t/this.scaleBarSteps_*-1,l=e===0?0:t/this.scaleBarSteps_*2;return`
`+o+"
"}getScaleForResolution(){const e=ie(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),t=this.dpi_||M,i=1e3/25.4;return e*i*t}render(e){const t=e.frameState;t?this.viewState_=t.viewState:this.viewState_=null,this.updateElement_()}}const it=.8,de="printing-hide";function st(a,e){return a.toDataURL("image/png",e??it)}function nt(a,e){const t=document.createElement("div");t.classList.add("printing-overlay",de),a.appendChild(t);const i=document.createElement("div");return i.classList.add("printing-overlay-status"),i.textContent=e,t.appendChild(i),{destroy(){t.remove()}}}class gt{defaultOverlayText;constructor(e){this.defaultOverlayText=e.intl.formatMessage({id:"printingMap"})}async printMap(e,t){return await new rt(e,{blockUserInteraction:!0,overlayText:this.defaultOverlayText,viewPadding:"auto",...t}).printMap()}}class rt{olMap;blockUserInteraction=!1;overlayText;viewPadding;running=!1;drawInformation=[];scaleLine=void 0;overlay=void 0;constructor(e,t){this.olMap=e,this.blockUserInteraction=t.blockUserInteraction,this.overlayText=t.overlayText,this.viewPadding=t.viewPadding}async printMap(){if(this.running)throw new Error("Printing already running.");try{await this.beginExport();let e=await this.printToCanvas(this.olMap.getViewport());if(!e)throw new Error("Canvas export failed");return this.viewPadding==="auto"&&(e=this.removePadding(e,this.getViewPadding())),new ot(e)}finally{this.reset()}}async beginExport(){this.running=!0;const e=this.olMap.getInteractions().getArray().filter(t=>t.getActive()&&t instanceof Je);if(this.drawInformation=[],e?.forEach(t=>{const i=t,s=i.getOverlay().getStyle();i.getOverlay().setStyle(null),this.drawInformation?.push({draw:i,style:s})}),this.blockUserInteraction){const t=this.olMap?.getTargetElement();t&&(this.overlay=nt(t,this.overlayText))}await this.addScaleLine()}async addScaleLine(){const t=(this.scaleLine=new tt({className:"printing-scale-bar ol-scale-bar",bar:!0,text:!0,minWidth:125})).element;if(!t)throw new Error("Scale line does not have an element");let i=50,s=8;if(this.viewPadding==="auto"){const{bottom:h,left:l}=this.getViewPadding();i=Math.max(h+8,i),s+=l}t.style.setProperty("--printing-scale-bar-bottom",`${i}px`),t.style.setProperty("--printing-scale-bar-left",`${s}px`);const r=_e(),n=setTimeout(()=>{r.reject(new Error("Scale line did not render"))},3e3),o=this.scaleLine.render;this.scaleLine.render=(...h)=>{o.apply(this.scaleLine,h),r.resolve()},this.olMap?.addControl(this.scaleLine);try{await r.promise,await new Promise(h=>{requestAnimationFrame(h)})}finally{clearTimeout(n)}}async printToCanvas(e){const t={useCORS:!0,ignoreElements:function(r){if(r.classList&&typeof r.classList=="object"){const n=r.classList;return n.contains("map-anchors")||n.contains(de)}return!1}},i=(await me(async()=>{const{default:r}=await import("./BfxBtG_Oxhhm.js");return{default:r}},[],import.meta.url)).default;return await i(e,t)}reset(){this.scaleLine&&(this.olMap?.removeControl(this.scaleLine),this.scaleLine=void 0),this.overlay&&(this.overlay.destroy(),this.overlay=void 0),this.running=!1,this.drawInformation?.length&&this.drawInformation.forEach(e=>{e.draw.getOverlay().setStyle(e.style)})}removePadding(e,t){const i=window.devicePixelRatio||1,s={top:t.top*i,right:t.right*i,bottom:t.bottom*i,left:t.left*i};if(s.left===0&&s.right===0&&s.top===0&&s.bottom===0)return e;const{width:r,height:n}=e,o=document.createElement("canvas");o.width=r-s.left-s.right,o.height=n-s.top-s.bottom;const h=o.getContext("2d");if(!h)throw new Error("Failed to get a canvas context");return h.drawImage(e,s.left,s.top,o.width,o.height,0,0,o.width,o.height),o}getViewPadding(){const t=this.olMap.getView().padding??[0,0,0,0];return{top:t[0]??0,right:t[1]??0,bottom:t[2]??0,left:t[3]??0}}}class ot{canvas;constructor(e){this.canvas=e}getCanvas(){return this.canvas}getPNGDataURL(e){return st(this.canvas,e)}}export{Je as D,Xe as I,ft as N,gt as P,tt as S,st as a,nt as c}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/35mnA9_wxNJd.js b/openlayers-base-packages/pr-previews/pr-377/assets/C9VJq5Ka7299.js similarity index 84% rename from openlayers-base-packages/pr-previews/pr-377/assets/35mnA9_wxNJd.js rename to openlayers-base-packages/pr-previews/pr-377/assets/C9VJq5Ka7299.js index 4c677ed..425d2b2 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/35mnA9_wxNJd.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/C9VJq5Ka7299.js @@ -1 +1 @@ -import{ab as J,ac as fe,ad as me,ae as be,r as u,D as se,a9 as j,a8 as pe,a7 as he,J as X,N as U,p as oe,K as Ee,L as xe,O as q,u as Ce,o as Ie,P as ye,j as V,q as Me,m as Z,g as De}from"./DbBkdn6FNbgs.js";function ge(e){return re(e)?.defaultView??window}function re(e){return J(e)?e.ownerDocument:document}function ve(e){return re(e).activeElement}const ue=e=>e.hasAttribute("tabindex"),Oe=e=>ue(e)&&e.tabIndex===-1;function ce(e){if(!J(e)||fe(e)||me(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const s={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in s?s[t]():be(e)?!0:ue(e)}function ke(e){return e?J(e)&&ce(e)&&!Oe(e):!1}const we=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],Pe=we.join(),Ne=e=>e.offsetWidth>0&&e.offsetHeight>0;function Se(e){const t=Array.from(e.querySelectorAll(Pe));return t.unshift(e),t.filter(n=>ce(n)&&Ne(n))}function Te(e){const{wasSelected:t,enabled:n,isSelected:s,mode:r="unmount"}=e;return!!(!n||s||r==="keepMounted"&&t)}function Fe(e){const{isOpen:t,ref:n}=e,[s,r]=u.useState(t),[o,c]=u.useState(!1);return u.useEffect(()=>{o||(r(t),c(!0))},[t,o,s]),se(()=>n.current,"animationend",()=>{r(t)}),{present:!(t?!1:!s),onComplete(){const d=ge(n.current),f=new d.CustomEvent("animationend",{bubbles:!0});n.current?.dispatchEvent(f)}}}function Le(e){const t=e.current;if(!t)return!1;const n=ve(t);return!n||t.contains(n)?!1:!!ke(n)}function Re(e,t){const{shouldFocus:n,visible:s,focusRef:r}=t,o=n&&!s;j(()=>{if(!o||Le(e))return;const c=r?.current||e.current;let i;if(c)return i=requestAnimationFrame(()=>{c.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(i)}},[o,e,r])}const Ae={preventScroll:!0,shouldFocus:!1};function mt(e,t=Ae){const{focusRef:n,preventScroll:s,shouldFocus:r,visible:o}=t,c=_e(e)?e.current:e,i=r&&o,d=u.useRef(i),f=u.useRef(o);pe(()=>{!f.current&&o&&(d.current=i),f.current=o},[o,i]);const l=u.useCallback(()=>{if(!(!o||!c||!d.current)&&(d.current=!1,!c.contains(document.activeElement)))if(n?.current)requestAnimationFrame(()=>{n.current?.focus({preventScroll:s})});else{const m=Se(c);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:s})})}},[o,s,c,n]);j(()=>{l()},[l]),se(c,"transitionend",l)}function _e(e){return"current"in e}function Ue(e,t){const n=u.useId();return u.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Ke(e,...t){const n=Ue(e);return u.useMemo(()=>t.map(s=>`${s}-${n}`),[n,t])}function Ve(e){const{ref:t,handler:n,enabled:s=!0}=e,r=he(n),c=u.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;u.useEffect(()=>{if(!s)return;const i=m=>{$(m,t)&&(c.isPointerDown=!0)},d=m=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&$(m,t)&&(c.isPointerDown=!1,r(m))},f=m=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&$(m,t)&&(c.isPointerDown=!1,r(m))},l=ae(t.current);return l.addEventListener("mousedown",i,!0),l.addEventListener("mouseup",d,!0),l.addEventListener("touchstart",i,!0),l.addEventListener("touchend",f,!0),()=>{l.removeEventListener("mousedown",i,!0),l.removeEventListener("mouseup",d,!0),l.removeEventListener("touchstart",i,!0),l.removeEventListener("touchend",f,!0)}},[n,t,r,c,s])}function $(e,t){const n=e.target;return n&&!ae(n).contains(n)?!1:!t.current?.contains(e.composedPath?.()[0]??n)}function ae(e){return e?.ownerDocument??document}function Q(e){return e.sort((t,n)=>{const s=t.compareDocumentPosition(n);if(s&Node.DOCUMENT_POSITION_FOLLOWING||s&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(s&Node.DOCUMENT_POSITION_PRECEDING||s&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(s&Node.DOCUMENT_POSITION_DISCONNECTED||s&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}const je=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function ee(e,t,n){let s=e+1;return n&&s>=t&&(s=0),s}function te(e,t,n){let s=e-1;return n&&s<0&&(s=t),s}const z=typeof window<"u"?u.useLayoutEffect:u.useEffect,ne=e=>e;var Be=Object.defineProperty,He=(e,t,n)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>(He(e,typeof t!="symbol"?t+"":t,n),n);class $e{constructor(){E(this,"descendants",new Map),E(this,"register",t=>{if(t!=null)return je(t)?this.registerNode(t):n=>{this.registerNode(n,t)}}),E(this,"unregister",t=>{this.descendants.delete(t);const n=Q(Array.from(this.descendants.keys()));this.assignIndex(n)}),E(this,"destroy",()=>{this.descendants.clear()}),E(this,"assignIndex",t=>{this.descendants.forEach(n=>{const s=t.indexOf(n.node);n.index=s,n.node.dataset.index=n.index.toString()})}),E(this,"count",()=>this.descendants.size),E(this,"enabledCount",()=>this.enabledValues().length),E(this,"values",()=>Array.from(this.descendants.values()).sort((n,s)=>n.index-s.index)),E(this,"enabledValues",()=>this.values().filter(t=>!t.disabled)),E(this,"item",t=>{if(this.count()!==0)return this.values()[t]}),E(this,"enabledItem",t=>{if(this.enabledCount()!==0)return this.enabledValues()[t]}),E(this,"first",()=>this.item(0)),E(this,"firstEnabled",()=>this.enabledItem(0)),E(this,"last",()=>this.item(this.descendants.size-1)),E(this,"lastEnabled",()=>{const t=this.enabledValues().length-1;return this.enabledItem(t)}),E(this,"indexOf",t=>t?this.descendants.get(t)?.index??-1:-1),E(this,"enabledIndexOf",t=>t==null?-1:this.enabledValues().findIndex(n=>n.node.isSameNode(t))),E(this,"next",(t,n=!0)=>{const s=ee(t,this.count(),n);return this.item(s)}),E(this,"nextEnabled",(t,n=!0)=>{const s=this.item(t);if(!s)return;const r=this.enabledIndexOf(s.node),o=ee(r,this.enabledCount(),n);return this.enabledItem(o)}),E(this,"prev",(t,n=!0)=>{const s=te(t,this.count()-1,n);return this.item(s)}),E(this,"prevEnabled",(t,n=!0)=>{const s=this.item(t);if(!s)return;const r=this.enabledIndexOf(s.node),o=te(r,this.enabledCount()-1,n);return this.enabledItem(o)}),E(this,"registerNode",(t,n)=>{if(!t||this.descendants.has(t))return;const s=Array.from(this.descendants.keys()).concat(t),r=Q(s);n?.disabled&&(n.disabled=!!n.disabled);const o={node:t,index:-1,...n};this.descendants.set(t,o),this.assignIndex(r)})}}function ze(){const[e,t]=X({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});return[e,t,()=>{const r=u.useRef(new $e);return z(()=>()=>r.current.destroy()),r.current},r=>{const o=t(),[c,i]=u.useState(-1),d=u.useRef(null);z(()=>()=>{d.current&&o.unregister(d.current)},[]),z(()=>{if(!d.current)return;const l=Number(d.current.dataset.index);c!=l&&!Number.isNaN(l)&&i(l)});const f=ne(r?o.register(r):o.register);return{descendants:o,index:c,enabledIndex:o.enabledIndexOf(d.current),register:U(f,d)}}]}function We(e,t,n,s){if(t==null)return s;if(!s)return e.find(c=>n(c).toLowerCase().startsWith(t.toLowerCase()));const r=e.filter(o=>n(o).toLowerCase().startsWith(t.toLowerCase()));if(r.length>0){let o;return r.includes(s)?(o=r.indexOf(s)+1,o===r.length&&(o=0),r[o]):(o=e.indexOf(r[0]),e[o])}return s}function qe(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function Ge(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[s,r]=u.useState([]),o=u.useRef(),c=()=>{o.current&&(clearTimeout(o.current),o.current=null)},i=()=>{c(),o.current=setTimeout(()=>{r([]),o.current=null},t)};u.useEffect(()=>c,[]);function d(f){return l=>{if(l.key==="Backspace"){const m=[...s];m.pop(),r(m);return}if(qe(l)){const m=s.concat(l.key);n(l)&&(l.preventDefault(),l.stopPropagation()),r(m),f(m.join("")),i()}}}return d}function Je(){const e=u.useRef(new Map),t=e.current,n=u.useCallback((r,o,c,i)=>{e.current.set(c,{type:o,el:r,options:i}),r.addEventListener(o,c,i)},[]),s=u.useCallback((r,o,c,i)=>{r.removeEventListener(o,c,i),e.current.delete(c)},[]);return u.useEffect(()=>()=>{t.forEach((r,o)=>{s(r.el,r.type,o,r.options)})},[s,t]),{add:n,remove:s}}function W(e){const t=e.composedPath?.()?.[0]??e.target,{tagName:n,isContentEditable:s}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&s!==!0}function Xe(e={}){const{ref:t,isDisabled:n,isFocusable:s,clickOnEnter:r=!0,clickOnSpace:o=!0,onMouseDown:c,onMouseUp:i,onClick:d,onKeyDown:f,onKeyUp:l,tabIndex:m,onMouseOver:O,onMouseLeave:x,...T}=e,[M,I]=u.useState(!0),[v,b]=u.useState(!1),p=Je(),N=a=>{a&&a.tagName!=="BUTTON"&&I(!1)},D=M?m:m||0,S=n&&!s,C=u.useCallback(a=>{if(n){a.stopPropagation(),a.preventDefault();return}a.currentTarget.focus(),d?.(a)},[n,d]),h=u.useCallback(a=>{v&&W(a)&&(a.preventDefault(),a.stopPropagation(),b(!1),p.remove(document,"keyup",h,!1))},[v,p]),g=u.useCallback(a=>{if(f?.(a),n||a.defaultPrevented||a.metaKey||!W(a.nativeEvent)||M)return;const A=r&&a.key==="Enter";o&&a.key===" "&&(a.preventDefault(),b(!0)),A&&(a.preventDefault(),a.currentTarget.click()),p.add(document,"keyup",h,!1)},[n,M,f,r,o,p,h]),L=u.useCallback(a=>{if(l?.(a),n||a.defaultPrevented||a.metaKey||!W(a.nativeEvent)||M)return;o&&a.key===" "&&(a.preventDefault(),b(!1),a.currentTarget.click())},[o,M,n,l]),F=u.useCallback(a=>{a.button===0&&(b(!1),p.remove(document,"mouseup",F,!1))},[p]),R=u.useCallback(a=>{if(a.button!==0)return;if(n){a.stopPropagation(),a.preventDefault();return}M||b(!0),a.currentTarget.focus({preventScroll:!0}),p.add(document,"mouseup",F,!1),c?.(a)},[n,M,c,p,F]),k=u.useCallback(a=>{a.button===0&&(M||b(!1),i?.(a))},[i,M]),y=u.useCallback(a=>{if(n){a.preventDefault();return}O?.(a)},[n,O]),H=u.useCallback(a=>{v&&(a.preventDefault(),b(!1)),x?.(a)},[v,x]),K=U(t,N);return M?{...T,ref:K,type:"button","aria-disabled":S?void 0:n,disabled:S,onClick:C,onMouseDown:c,onMouseUp:i,onKeyUp:l,onKeyDown:f,onMouseOver:O,onMouseLeave:x}:{...T,ref:K,role:"button","data-active":oe(v),"aria-disabled":n?"true":void 0,tabIndex:S?void 0:D,onClick:C,onMouseDown:R,onMouseUp:k,onKeyUp:L,onKeyDown:g,onMouseOver:y,onMouseLeave:H}}const[Ye,Ze,Qe,et]=ze(),[tt,B]=X({strict:!1,name:"MenuContext"});function ie(e){return e?.ownerDocument??document}function nt(e){return ie(e).activeElement===e}function st(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:s=!0,initialFocusRef:r,autoSelect:o=!0,isLazy:c,isOpen:i,defaultIsOpen:d,onClose:f,onOpen:l,placement:m="bottom-start",lazyBehavior:O="unmount",direction:x,computePositionOnMount:T=!1,...M}=e,I=u.useRef(null),v=u.useRef(null),b=u.useRef(!0),p=Qe(),N=u.useCallback(()=>{requestAnimationFrame(()=>{I.current?.focus({preventScroll:!1})})},[]),D=u.useCallback(()=>{const w=setTimeout(()=>{if(r)r.current?.focus();else if(!p.count())I.current?.focus({preventScroll:!1});else{const P=p.firstEnabled();P&&y(P.index)}});_.current.add(w)},[p,r]),S=u.useCallback(()=>{const w=setTimeout(()=>{if(!p.count())I.current?.focus({preventScroll:!1});else{const P=p.lastEnabled();P&&y(P.index)}});_.current.add(w)},[p]),C=u.useCallback(()=>{l?.(),o?D():N()},[o,D,N,l]),{isOpen:h,onOpen:g,onClose:L,onToggle:F}=Ee({isOpen:i,defaultIsOpen:d,onClose:f,onOpen:C});Ve({enabled:h&&s,ref:I,handler:w=>{const P=w.composedPath?.()?.[0]??w.target;v.current?.contains(P)||L()}});const R=xe({...M,enabled:h||T,placement:m,direction:x}),[k,y]=u.useState(-1);Re(I,{focusRef:v,visible:h,shouldFocus:!0});const H=Fe({isOpen:h,ref:I}),[K,a]=Ke(t,"menu-button","menu-list"),A=u.useCallback(()=>{g(),N()},[g,N]),_=u.useRef(new Set([]));u.useEffect(()=>{const w=_.current;return()=>{w.forEach(P=>clearTimeout(P)),w.clear()}},[]),j(()=>{h||(y(-1),I.current?.scrollTo(0,0))},[h]),j(()=>{h&&k===-1&&N()},[k,h]),u.useEffect(()=>{if(!h)return;p.item(k)?.node?.focus({preventScroll:!b.current})},[p,k,h]);const Y=u.useCallback(()=>{g(),D()},[D,g]),le=u.useCallback(()=>{b.current=!0,g(),S()},[g,S]),de=u.useCallback(()=>{const w=ie(I.current),P=I.current?.contains(w.activeElement);if(!(h&&!P))return;p.item(k)?.node?.focus({preventScroll:!b.current})},[h,k,p]);return{openAndFocusMenu:A,openAndFocusFirstItem:Y,openAndFocusLastItem:le,onTransitionEnd:de,unstable__animationState:H,descendants:p,popper:R,buttonId:K,menuId:a,forceUpdate:R.forceUpdate,orientation:"vertical",isOpen:h,onToggle:F,onOpen:g,onClose:L,menuRef:I,buttonRef:v,focusedIndex:k,closeOnSelect:n,closeOnBlur:s,autoSelect:o,setFocusedIndex:y,isLazy:c,lazyBehavior:O,initialFocusRef:r,scrollIntoViewRef:b}}function bt(e={},t=null){const n=B(),{onToggle:s,popper:r,openAndFocusFirstItem:o,openAndFocusLastItem:c,scrollIntoViewRef:i}=n,d=u.useCallback(f=>{const l=f.key,O={Enter:o,ArrowDown:o,ArrowUp:c}[l];O&&(i.current=!0,f.preventDefault(),f.stopPropagation(),O(f))},[o,c,i]);return{...e,ref:U(n.buttonRef,t,r.referenceRef),id:n.buttonId,"data-active":oe(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:q(e.onClick,s),onKeyDown:q(e.onKeyDown,d)}}function G(e){return ot(e)&&!!e?.getAttribute("role")?.startsWith("menuitem")}function pt(e={},t=null){const n=B();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within
");const{focusedIndex:s,setFocusedIndex:r,menuRef:o,isOpen:c,onClose:i,menuId:d,isLazy:f,lazyBehavior:l,scrollIntoViewRef:m,unstable__animationState:O}=n,x=Ze(),T=Ge({preventDefault:b=>b.key!==" "&&G(b.target)}),M=u.useCallback(b=>{if(!b.currentTarget.contains(b.target))return;const p=b.key,D={Tab:C=>C.preventDefault(),Escape:C=>{C.stopPropagation(),i()},ArrowDown:()=>{m.current=!0;const C=x.nextEnabled(s)??x.firstEnabled();C&&r(C.index)},ArrowUp:()=>{m.current=!0;const C=x.prevEnabled(s)??x.firstEnabled();C&&r(C.index)}}[p];if(D){b.preventDefault(),D(b);return}const S=T(C=>{const h=We(x.values(),C,g=>g?.node?.textContent??"",x.item(s));if(h){const g=x.indexOf(h.node);r(g)}});G(b.target)&&S(b)},[x,s,T,i,r,m]),I=u.useRef(!1);c&&(I.current=!0);const v=Te({wasSelected:I.current,enabled:f,mode:l,isSelected:O.present});return{...e,ref:U(o,t),children:v?e.children:null,tabIndex:-1,role:"menu",id:d,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:q(e.onKeyDown,M)}}function ht(e={}){const{popper:t,isOpen:n}=B();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function Et(e={},t=null){const{onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onClick:o,onFocus:c,isDisabled:i,isFocusable:d,closeOnSelect:f,type:l,...m}=e,O=B(),{setFocusedIndex:x,focusedIndex:T,closeOnSelect:M,onClose:I,menuId:v,scrollIntoViewRef:b}=O,p=u.useRef(null),N=`${v}-menuitem-${u.useId()}`,{index:D,register:S}=et({disabled:i&&!d}),C=u.useCallback(y=>{n?.(y),!i&&(b.current=!1,x(D))},[x,D,i,n,b]),h=u.useCallback(y=>{s?.(y),p.current&&!nt(p.current)&&C(y)},[C,s]),g=u.useCallback(y=>{r?.(y),!i&&x(-1)},[x,i,r]),L=u.useCallback(y=>{o?.(y),G(y.currentTarget)&&(f??M)&&I()},[I,o,M,f]),F=u.useCallback(y=>{c?.(y),x(D)},[x,c,D]),R=D===T,k=Xe({onClick:L,onFocus:F,onMouseEnter:C,onMouseMove:h,onMouseLeave:g,ref:U(S,p,t),isDisabled:i,isFocusable:d});return{...m,...k,type:l??k.type,id:N,role:"menuitem",tabIndex:R?0:-1}}function ot(e){if(!rt(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function rt(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}const[ut,ct]=X({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),at=e=>{const{children:t}=e,n=Ce("Menu",e),s=Ie(e),{direction:r}=ye(),{descendants:o,...c}=st({...s,direction:r}),i=u.useMemo(()=>c,[c]),{isOpen:d,onClose:f,forceUpdate:l}=i;return V.jsx(Ye,{value:o,children:V.jsx(tt,{value:i,children:V.jsx(ut,{value:n,children:Me(t,{isOpen:d,onClose:f,forceUpdate:l})})})})};at.displayName="Menu";const it=e=>{const{className:t,children:n,...s}=e,r=ct(),o=u.Children.only(n),c=u.isValidElement(o)?u.cloneElement(o,{focusable:"false","aria-hidden":!0,className:Z("chakra-menu__icon",o.props.className)}):null,i=Z("chakra-menu__icon-wrapper",t);return V.jsx(De.span,{className:i,...s,__css:r.icon,children:c})};it.displayName="MenuIcon";export{at as M,Re as a,mt as b,Ve as c,it as d,ct as e,bt as f,Et as g,B as h,ce as i,pt as j,ht as k,Te as l,Fe as u}; +import{ac as J,ad as fe,ae as me,af as be,r as u,J as se,ab as j,aa as pe,a9 as he,k as Q,P as U,t as oe,M as Ee,N as xe,Q as q,u as Ce,o as Ie,R as ye,j as V,w as Me,l as Y,g as ge}from"./B60Dx_GOYdnk.js";function De(e){return re(e)?.defaultView??window}function re(e){return J(e)?e.ownerDocument:document}function ve(e){return re(e).activeElement}const ue=e=>e.hasAttribute("tabindex"),Oe=e=>ue(e)&&e.tabIndex===-1;function ce(e){if(!J(e)||fe(e)||me(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const s={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in s?s[t]():be(e)?!0:ue(e)}function ke(e){return e?J(e)&&ce(e)&&!Oe(e):!1}const we=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],Pe=we.join(),Ne=e=>e.offsetWidth>0&&e.offsetHeight>0;function Se(e){const t=Array.from(e.querySelectorAll(Pe));return t.unshift(e),t.filter(n=>ce(n)&&Ne(n))}function Te(e){const{wasSelected:t,enabled:n,isSelected:s,mode:r="unmount"}=e;return!!(!n||s||r==="keepMounted"&&t)}function Fe(e){const{isOpen:t,ref:n}=e,[s,r]=u.useState(t),[o,c]=u.useState(!1);return u.useEffect(()=>{o||(r(t),c(!0))},[t,o,s]),se(()=>n.current,"animationend",()=>{r(t)}),{present:!(t?!1:!s),onComplete(){const d=De(n.current),f=new d.CustomEvent("animationend",{bubbles:!0});n.current?.dispatchEvent(f)}}}function Le(e){const t=e.current;if(!t)return!1;const n=ve(t);return!n||t.contains(n)?!1:!!ke(n)}function Re(e,t){const{shouldFocus:n,visible:s,focusRef:r}=t,o=n&&!s;j(()=>{if(!o||Le(e))return;const c=r?.current||e.current;let i;if(c)return i=requestAnimationFrame(()=>{c.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(i)}},[o,e,r])}const Ae={preventScroll:!0,shouldFocus:!1};function mt(e,t=Ae){const{focusRef:n,preventScroll:s,shouldFocus:r,visible:o}=t,c=_e(e)?e.current:e,i=r&&o,d=u.useRef(i),f=u.useRef(o);pe(()=>{!f.current&&o&&(d.current=i),f.current=o},[o,i]);const l=u.useCallback(()=>{if(!(!o||!c||!d.current)&&(d.current=!1,!c.contains(document.activeElement)))if(n?.current)requestAnimationFrame(()=>{n.current?.focus({preventScroll:s})});else{const m=Se(c);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:s})})}},[o,s,c,n]);j(()=>{l()},[l]),se(c,"transitionend",l)}function _e(e){return"current"in e}function Ue(e,t){const n=u.useId();return u.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Ke(e,...t){const n=Ue(e);return u.useMemo(()=>t.map(s=>`${s}-${n}`),[n,t])}function Ve(e){const{ref:t,handler:n,enabled:s=!0}=e,r=he(n),c=u.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;u.useEffect(()=>{if(!s)return;const i=m=>{$(m,t)&&(c.isPointerDown=!0)},d=m=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&$(m,t)&&(c.isPointerDown=!1,r(m))},f=m=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&$(m,t)&&(c.isPointerDown=!1,r(m))},l=ae(t.current);return l.addEventListener("mousedown",i,!0),l.addEventListener("mouseup",d,!0),l.addEventListener("touchstart",i,!0),l.addEventListener("touchend",f,!0),()=>{l.removeEventListener("mousedown",i,!0),l.removeEventListener("mouseup",d,!0),l.removeEventListener("touchstart",i,!0),l.removeEventListener("touchend",f,!0)}},[n,t,r,c,s])}function $(e,t){const n=e.target;return n&&!ae(n).contains(n)?!1:!t.current?.contains(e.composedPath?.()[0]??n)}function ae(e){return e?.ownerDocument??document}function Z(e){return e.sort((t,n)=>{const s=t.compareDocumentPosition(n);if(s&Node.DOCUMENT_POSITION_FOLLOWING||s&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(s&Node.DOCUMENT_POSITION_PRECEDING||s&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(s&Node.DOCUMENT_POSITION_DISCONNECTED||s&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}const je=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function ee(e,t,n){let s=e+1;return n&&s>=t&&(s=0),s}function te(e,t,n){let s=e-1;return n&&s<0&&(s=t),s}const z=typeof window<"u"?u.useLayoutEffect:u.useEffect,ne=e=>e;var Be=Object.defineProperty,He=(e,t,n)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>(He(e,typeof t!="symbol"?t+"":t,n),n);class $e{constructor(){E(this,"descendants",new Map),E(this,"register",t=>{if(t!=null)return je(t)?this.registerNode(t):n=>{this.registerNode(n,t)}}),E(this,"unregister",t=>{this.descendants.delete(t);const n=Z(Array.from(this.descendants.keys()));this.assignIndex(n)}),E(this,"destroy",()=>{this.descendants.clear()}),E(this,"assignIndex",t=>{this.descendants.forEach(n=>{const s=t.indexOf(n.node);n.index=s,n.node.dataset.index=n.index.toString()})}),E(this,"count",()=>this.descendants.size),E(this,"enabledCount",()=>this.enabledValues().length),E(this,"values",()=>Array.from(this.descendants.values()).sort((n,s)=>n.index-s.index)),E(this,"enabledValues",()=>this.values().filter(t=>!t.disabled)),E(this,"item",t=>{if(this.count()!==0)return this.values()[t]}),E(this,"enabledItem",t=>{if(this.enabledCount()!==0)return this.enabledValues()[t]}),E(this,"first",()=>this.item(0)),E(this,"firstEnabled",()=>this.enabledItem(0)),E(this,"last",()=>this.item(this.descendants.size-1)),E(this,"lastEnabled",()=>{const t=this.enabledValues().length-1;return this.enabledItem(t)}),E(this,"indexOf",t=>t?this.descendants.get(t)?.index??-1:-1),E(this,"enabledIndexOf",t=>t==null?-1:this.enabledValues().findIndex(n=>n.node.isSameNode(t))),E(this,"next",(t,n=!0)=>{const s=ee(t,this.count(),n);return this.item(s)}),E(this,"nextEnabled",(t,n=!0)=>{const s=this.item(t);if(!s)return;const r=this.enabledIndexOf(s.node),o=ee(r,this.enabledCount(),n);return this.enabledItem(o)}),E(this,"prev",(t,n=!0)=>{const s=te(t,this.count()-1,n);return this.item(s)}),E(this,"prevEnabled",(t,n=!0)=>{const s=this.item(t);if(!s)return;const r=this.enabledIndexOf(s.node),o=te(r,this.enabledCount()-1,n);return this.enabledItem(o)}),E(this,"registerNode",(t,n)=>{if(!t||this.descendants.has(t))return;const s=Array.from(this.descendants.keys()).concat(t),r=Z(s);n?.disabled&&(n.disabled=!!n.disabled);const o={node:t,index:-1,...n};this.descendants.set(t,o),this.assignIndex(r)})}}function ze(){const[e,t]=Q({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});return[e,t,()=>{const r=u.useRef(new $e);return z(()=>()=>r.current.destroy()),r.current},r=>{const o=t(),[c,i]=u.useState(-1),d=u.useRef(null);z(()=>()=>{d.current&&o.unregister(d.current)},[]),z(()=>{if(!d.current)return;const l=Number(d.current.dataset.index);c!=l&&!Number.isNaN(l)&&i(l)});const f=ne(r?o.register(r):o.register);return{descendants:o,index:c,enabledIndex:o.enabledIndexOf(d.current),register:U(f,d)}}]}function We(e,t,n,s){if(t==null)return s;if(!s)return e.find(c=>n(c).toLowerCase().startsWith(t.toLowerCase()));const r=e.filter(o=>n(o).toLowerCase().startsWith(t.toLowerCase()));if(r.length>0){let o;return r.includes(s)?(o=r.indexOf(s)+1,o===r.length&&(o=0),r[o]):(o=e.indexOf(r[0]),e[o])}return s}function qe(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function Ge(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[s,r]=u.useState([]),o=u.useRef(),c=()=>{o.current&&(clearTimeout(o.current),o.current=null)},i=()=>{c(),o.current=setTimeout(()=>{r([]),o.current=null},t)};u.useEffect(()=>c,[]);function d(f){return l=>{if(l.key==="Backspace"){const m=[...s];m.pop(),r(m);return}if(qe(l)){const m=s.concat(l.key);n(l)&&(l.preventDefault(),l.stopPropagation()),r(m),f(m.join("")),i()}}}return d}function Je(){const e=u.useRef(new Map),t=e.current,n=u.useCallback((r,o,c,i)=>{e.current.set(c,{type:o,el:r,options:i}),r.addEventListener(o,c,i)},[]),s=u.useCallback((r,o,c,i)=>{r.removeEventListener(o,c,i),e.current.delete(c)},[]);return u.useEffect(()=>()=>{t.forEach((r,o)=>{s(r.el,r.type,o,r.options)})},[s,t]),{add:n,remove:s}}function W(e){const t=e.composedPath?.()?.[0]??e.target,{tagName:n,isContentEditable:s}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&s!==!0}function Qe(e={}){const{ref:t,isDisabled:n,isFocusable:s,clickOnEnter:r=!0,clickOnSpace:o=!0,onMouseDown:c,onMouseUp:i,onClick:d,onKeyDown:f,onKeyUp:l,tabIndex:m,onMouseOver:O,onMouseLeave:x,...T}=e,[M,I]=u.useState(!0),[v,b]=u.useState(!1),p=Je(),N=a=>{a&&a.tagName!=="BUTTON"&&I(!1)},g=M?m:m||0,S=n&&!s,C=u.useCallback(a=>{if(n){a.stopPropagation(),a.preventDefault();return}a.currentTarget.focus(),d?.(a)},[n,d]),h=u.useCallback(a=>{v&&W(a)&&(a.preventDefault(),a.stopPropagation(),b(!1),p.remove(document,"keyup",h,!1))},[v,p]),D=u.useCallback(a=>{if(f?.(a),n||a.defaultPrevented||a.metaKey||!W(a.nativeEvent)||M)return;const A=r&&a.key==="Enter";o&&a.key===" "&&(a.preventDefault(),b(!0)),A&&(a.preventDefault(),a.currentTarget.click()),p.add(document,"keyup",h,!1)},[n,M,f,r,o,p,h]),L=u.useCallback(a=>{if(l?.(a),n||a.defaultPrevented||a.metaKey||!W(a.nativeEvent)||M)return;o&&a.key===" "&&(a.preventDefault(),b(!1),a.currentTarget.click())},[o,M,n,l]),F=u.useCallback(a=>{a.button===0&&(b(!1),p.remove(document,"mouseup",F,!1))},[p]),R=u.useCallback(a=>{if(a.button!==0)return;if(n){a.stopPropagation(),a.preventDefault();return}M||b(!0),a.currentTarget.focus({preventScroll:!0}),p.add(document,"mouseup",F,!1),c?.(a)},[n,M,c,p,F]),k=u.useCallback(a=>{a.button===0&&(M||b(!1),i?.(a))},[i,M]),y=u.useCallback(a=>{if(n){a.preventDefault();return}O?.(a)},[n,O]),H=u.useCallback(a=>{v&&(a.preventDefault(),b(!1)),x?.(a)},[v,x]),K=U(t,N);return M?{...T,ref:K,type:"button","aria-disabled":S?void 0:n,disabled:S,onClick:C,onMouseDown:c,onMouseUp:i,onKeyUp:l,onKeyDown:f,onMouseOver:O,onMouseLeave:x}:{...T,ref:K,role:"button","data-active":oe(v),"aria-disabled":n?"true":void 0,tabIndex:S?void 0:g,onClick:C,onMouseDown:R,onMouseUp:k,onKeyUp:L,onKeyDown:D,onMouseOver:y,onMouseLeave:H}}const[Xe,Ye,Ze,et]=ze(),[tt,B]=Q({strict:!1,name:"MenuContext"});function ie(e){return e?.ownerDocument??document}function nt(e){return ie(e).activeElement===e}function st(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:s=!0,initialFocusRef:r,autoSelect:o=!0,isLazy:c,isOpen:i,defaultIsOpen:d,onClose:f,onOpen:l,placement:m="bottom-start",lazyBehavior:O="unmount",direction:x,computePositionOnMount:T=!1,...M}=e,I=u.useRef(null),v=u.useRef(null),b=u.useRef(!0),p=Ze(),N=u.useCallback(()=>{requestAnimationFrame(()=>{I.current?.focus({preventScroll:!1})})},[]),g=u.useCallback(()=>{const w=setTimeout(()=>{if(r)r.current?.focus();else if(!p.count())I.current?.focus({preventScroll:!1});else{const P=p.firstEnabled();P&&y(P.index)}});_.current.add(w)},[p,r]),S=u.useCallback(()=>{const w=setTimeout(()=>{if(!p.count())I.current?.focus({preventScroll:!1});else{const P=p.lastEnabled();P&&y(P.index)}});_.current.add(w)},[p]),C=u.useCallback(()=>{l?.(),o?g():N()},[o,g,N,l]),{isOpen:h,onOpen:D,onClose:L,onToggle:F}=Ee({isOpen:i,defaultIsOpen:d,onClose:f,onOpen:C});Ve({enabled:h&&s,ref:I,handler:w=>{const P=w.composedPath?.()?.[0]??w.target;v.current?.contains(P)||L()}});const R=xe({...M,enabled:h||T,placement:m,direction:x}),[k,y]=u.useState(-1);Re(I,{focusRef:v,visible:h,shouldFocus:!0});const H=Fe({isOpen:h,ref:I}),[K,a]=Ke(t,"menu-button","menu-list"),A=u.useCallback(()=>{D(),N()},[D,N]),_=u.useRef(new Set([]));u.useEffect(()=>{const w=_.current;return()=>{w.forEach(P=>clearTimeout(P)),w.clear()}},[]),j(()=>{h||(y(-1),I.current?.scrollTo(0,0))},[h]),j(()=>{h&&k===-1&&N()},[k,h]),u.useEffect(()=>{if(!h)return;p.item(k)?.node?.focus({preventScroll:!b.current})},[p,k,h]);const X=u.useCallback(()=>{D(),g()},[g,D]),le=u.useCallback(()=>{b.current=!0,D(),S()},[D,S]),de=u.useCallback(()=>{const w=ie(I.current),P=I.current?.contains(w.activeElement);if(!(h&&!P))return;p.item(k)?.node?.focus({preventScroll:!b.current})},[h,k,p]);return{openAndFocusMenu:A,openAndFocusFirstItem:X,openAndFocusLastItem:le,onTransitionEnd:de,unstable__animationState:H,descendants:p,popper:R,buttonId:K,menuId:a,forceUpdate:R.forceUpdate,orientation:"vertical",isOpen:h,onToggle:F,onOpen:D,onClose:L,menuRef:I,buttonRef:v,focusedIndex:k,closeOnSelect:n,closeOnBlur:s,autoSelect:o,setFocusedIndex:y,isLazy:c,lazyBehavior:O,initialFocusRef:r,scrollIntoViewRef:b}}function bt(e={},t=null){const n=B(),{onToggle:s,popper:r,openAndFocusFirstItem:o,openAndFocusLastItem:c,scrollIntoViewRef:i}=n,d=u.useCallback(f=>{const l=f.key,O={Enter:o,ArrowDown:o,ArrowUp:c}[l];O&&(i.current=!0,f.preventDefault(),f.stopPropagation(),O(f))},[o,c,i]);return{...e,ref:U(n.buttonRef,t,r.referenceRef),id:n.buttonId,"data-active":oe(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:q(e.onClick,s),onKeyDown:q(e.onKeyDown,d)}}function G(e){return ot(e)&&!!e?.getAttribute("role")?.startsWith("menuitem")}function pt(e={},t=null){const n=B();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:s,setFocusedIndex:r,menuRef:o,isOpen:c,onClose:i,menuId:d,isLazy:f,lazyBehavior:l,scrollIntoViewRef:m,unstable__animationState:O}=n,x=Ye(),T=Ge({preventDefault:b=>b.key!==" "&&G(b.target)}),M=u.useCallback(b=>{if(!b.currentTarget.contains(b.target))return;const p=b.key,g={Tab:C=>C.preventDefault(),Escape:C=>{C.stopPropagation(),i()},ArrowDown:()=>{m.current=!0;const C=x.nextEnabled(s)??x.firstEnabled();C&&r(C.index)},ArrowUp:()=>{m.current=!0;const C=x.prevEnabled(s)??x.firstEnabled();C&&r(C.index)}}[p];if(g){b.preventDefault(),g(b);return}const S=T(C=>{const h=We(x.values(),C,D=>D?.node?.textContent??"",x.item(s));if(h){const D=x.indexOf(h.node);r(D)}});G(b.target)&&S(b)},[x,s,T,i,r,m]),I=u.useRef(!1);c&&(I.current=!0);const v=Te({wasSelected:I.current,enabled:f,mode:l,isSelected:O.present});return{...e,ref:U(o,t),children:v?e.children:null,tabIndex:-1,role:"menu",id:d,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:q(e.onKeyDown,M)}}function ht(e={}){const{popper:t,isOpen:n}=B();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function Et(e={},t=null){const{onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onClick:o,onFocus:c,isDisabled:i,isFocusable:d,closeOnSelect:f,type:l,...m}=e,O=B(),{setFocusedIndex:x,focusedIndex:T,closeOnSelect:M,onClose:I,menuId:v,scrollIntoViewRef:b}=O,p=u.useRef(null),N=`${v}-menuitem-${u.useId()}`,{index:g,register:S}=et({disabled:i&&!d}),C=u.useCallback(y=>{n?.(y),!i&&(b.current=!1,x(g))},[x,g,i,n,b]),h=u.useCallback(y=>{s?.(y),p.current&&!nt(p.current)&&C(y)},[C,s]),D=u.useCallback(y=>{r?.(y),!i&&x(-1)},[x,i,r]),L=u.useCallback(y=>{o?.(y),G(y.currentTarget)&&(f??M)&&I()},[I,o,M,f]),F=u.useCallback(y=>{c?.(y),x(g)},[x,c,g]),R=g===T,k=Qe({onClick:L,onFocus:F,onMouseEnter:C,onMouseMove:h,onMouseLeave:D,ref:U(S,p,t),isDisabled:i,isFocusable:d});return{...m,...k,type:l??k.type,id:N,role:"menuitem",tabIndex:R?0:-1}}function ot(e){if(!rt(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function rt(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}const[ut,ct]=Q({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),at=e=>{const{children:t}=e,n=Ce("Menu",e),s=Ie(e),{direction:r}=ye(),{descendants:o,...c}=st({...s,direction:r}),i=u.useMemo(()=>c,[c]),{isOpen:d,onClose:f,forceUpdate:l}=i;return V.jsx(Xe,{value:o,children:V.jsx(tt,{value:i,children:V.jsx(ut,{value:n,children:Me(t,{isOpen:d,onClose:f,forceUpdate:l})})})})};at.displayName="Menu";const it=e=>{const{className:t,children:n,...s}=e,r=ct(),o=u.Children.only(n),c=u.isValidElement(o)?u.cloneElement(o,{focusable:"false","aria-hidden":!0,className:Y("chakra-menu__icon",o.props.className)}):null,i=Y("chakra-menu__icon-wrapper",t);return V.jsx(ge.span,{className:i,...s,__css:r.icon,children:c})};it.displayName="MenuIcon";export{at as M,Re as a,mt as b,Ve as c,it as d,ct as e,bt as f,Et as g,B as h,ce as i,pt as j,ht as k,Te as l,Fe as u}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CFax2WnWeOWk.js b/openlayers-base-packages/pr-previews/pr-377/assets/CFax2WnWeOWk.js deleted file mode 100644 index 5066168..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CFax2WnWeOWk.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as e,ah as t}from"./DbBkdn6FNbgs.js";const m=e({},t);export{m as t}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CG5nmvkyugDn.js b/openlayers-base-packages/pr-previews/pr-377/assets/CG5nmvkyugDn.js new file mode 100644 index 0000000..c3e08a2 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/CG5nmvkyugDn.js @@ -0,0 +1 @@ +import{k as ye,j as f,g as x,a8 as ve,a9 as z,r as s,aa as X,ab as Ce,t as o,Q as d,P as re,$ as Y,h as ge,u as xe,o as we,U as Ee,n as Se,l as Ie}from"./B60Dx_GOYdnk.js";import{c as Pe}from"./vepZWq5kkQUw.js";const[et,Le]=ye({name:"CheckboxGroupContext",strict:!1});function De(e){return f.jsx(x.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:f.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function Ae(e){return f.jsx(x.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:f.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function Fe(e){const{isIndeterminate:r,isChecked:n,...a}=e,h=r?Ae:De;return n||r?f.jsx(x.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:f.jsx(h,{...a})}):null}var Me=()=>typeof document<"u",ie=!1,B=null,y=!1,Q=!1,J=new Set;function Z(e,r){J.forEach(n=>n(e,r))}var Be=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function je(e){return!(e.metaKey||!Be&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function ce(e){y=!0,je(e)&&(B="keyboard",Z("keyboard",e))}function g(e){if(B="pointer",e.type==="mousedown"||e.type==="pointerdown"){y=!0;const r=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=r.matches(":focus-visible")}catch{}if(n)return;Z("pointer",e)}}function Re(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function _e(e){Re(e)&&(y=!0,B="virtual")}function Ke(e){e.target===window||e.target===document||e.target instanceof Element&&e.target.hasAttribute("tabindex")||(!y&&!Q&&(B="virtual",Z("virtual",e)),y=!1,Q=!1)}function Ne(){y=!1,Q=!0}function le(){return B!=="pointer"}function Te(){if(!Me()||ie)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){y=!0,e.apply(this,n)},document.addEventListener("keydown",ce,!0),document.addEventListener("keyup",ce,!0),document.addEventListener("click",_e,!0),window.addEventListener("focus",Ke,!0),window.addEventListener("blur",Ne,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",g,!0),document.addEventListener("pointermove",g,!0),document.addEventListener("pointerup",g,!0)):(document.addEventListener("mousedown",g,!0),document.addEventListener("mousemove",g,!0),document.addEventListener("mouseup",g,!0)),ie=!0}function Ue(e){Te(),e(le());const r=()=>e(le());return J.add(r),()=>{J.delete(r)}}const He={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Ve(e={}){const r=Pe(e),{isDisabled:n,isReadOnly:a,isRequired:h,isInvalid:i,id:b,onBlur:H,onFocus:V,"aria-describedby":w}=r,{defaultChecked:E,isChecked:S,isFocusable:W,onChange:q,isIndeterminate:u,name:I,value:j,tabIndex:R=void 0,"aria-label":P,"aria-labelledby":L,"aria-invalid":p,...G}=e,D=ve(G,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),_=z(q),K=z(H),A=z(V),[v,O]=s.useState(!1),[k,N]=s.useState(!1),[F,ee]=s.useState(!1),[M,C]=s.useState(!1);s.useEffect(()=>Ue(O),[]);const m=s.useRef(null),[te,ue]=s.useState(!0),[de,T]=s.useState(!!E),$=S!==void 0,c=$?S:de,ne=s.useCallback(t=>{if(a||n){t.preventDefault();return}$||T(c?t.currentTarget.checked:u?!0:t.currentTarget.checked),_?.(t)},[a,n,c,$,u,_]);X(()=>{m.current&&(m.current.indeterminate=!!u)},[u]),Ce(()=>{n&&N(!1)},[n,N]),X(()=>{const t=m.current;if(!t?.form)return;const l=()=>{T(!!E)};return t.form.addEventListener("reset",l),()=>t.form?.removeEventListener("reset",l)},[]);const oe=n&&!W,ae=s.useCallback(t=>{t.key===" "&&C(!0)},[C]),se=s.useCallback(t=>{t.key===" "&&C(!1)},[C]);X(()=>{if(!m.current)return;m.current.checked!==c&&T(m.current.checked)},[m.current]);const fe=s.useCallback((t={},l=null)=>{const U=be=>{k&&be.preventDefault(),C(!0)};return{...t,ref:l,"data-active":o(M),"data-hover":o(F),"data-checked":o(c),"data-focus":o(k),"data-focus-visible":o(k&&v),"data-indeterminate":o(u),"data-disabled":o(n),"data-invalid":o(i),"data-readonly":o(a),"aria-hidden":!0,onMouseDown:d(t.onMouseDown,U),onMouseUp:d(t.onMouseUp,()=>C(!1)),onMouseEnter:d(t.onMouseEnter,()=>ee(!0)),onMouseLeave:d(t.onMouseLeave,()=>ee(!1))}},[M,c,n,k,v,F,u,i,a]),me=s.useCallback((t={},l=null)=>({...t,ref:l,"data-active":o(M),"data-hover":o(F),"data-checked":o(c),"data-focus":o(k),"data-focus-visible":o(k&&v),"data-indeterminate":o(u),"data-disabled":o(n),"data-invalid":o(i),"data-readonly":o(a)}),[M,c,n,k,v,F,u,i,a]),he=s.useCallback((t={},l=null)=>({...D,...t,ref:re(l,U=>{U&&ue(U.tagName==="LABEL")}),onClick:d(t.onClick,()=>{te||(m.current?.click(),requestAnimationFrame(()=>{m.current?.focus({preventScroll:!0})}))}),"data-disabled":o(n),"data-checked":o(c),"data-invalid":o(i)}),[D,n,c,i,te]),pe=s.useCallback((t={},l=null)=>({...t,ref:re(m,l),type:"checkbox",name:I,value:j,id:b,tabIndex:R,onChange:d(t.onChange,ne),onBlur:d(t.onBlur,K,()=>N(!1)),onFocus:d(t.onFocus,A,()=>N(!0)),onKeyDown:d(t.onKeyDown,ae),onKeyUp:d(t.onKeyUp,se),required:h,checked:c,disabled:oe,readOnly:a,"aria-label":P,"aria-labelledby":L,"aria-invalid":p?!!p:i,"aria-describedby":w,"aria-disabled":n,style:He}),[I,j,b,ne,K,A,ae,se,h,c,oe,a,P,L,p,i,w,n,R]),ke=s.useCallback((t={},l=null)=>({...t,ref:l,onMouseDown:d(t.onMouseDown,We),"data-disabled":o(n),"data-checked":o(c),"data-invalid":o(i)}),[c,n,i]);return{state:{isInvalid:i,isFocused:k,isChecked:c,isActive:M,isHovered:F,isIndeterminate:u,isDisabled:n,isReadOnly:a,isRequired:h},getRootProps:he,getCheckboxProps:fe,getIndicatorProps:me,getInputProps:pe,getLabelProps:ke,htmlProps:D}}function We(e){e.preventDefault(),e.stopPropagation()}function qe(e){const[r,n]=s.useState(e),[a,h]=s.useState(!1);return e!==r&&(h(!0),n(e)),a}const Ge={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},Oe={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},$e=Y({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),ze=Y({from:{opacity:0},to:{opacity:1}}),Xe=Y({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Qe=ge(function(r,n){const a=Le(),h={...a,...r},i=xe("Checkbox",h),b=we(r),{spacing:H="0.5rem",className:V,children:w,iconColor:E,iconSize:S,icon:W=f.jsx(Fe,{}),isChecked:q,isDisabled:u=a?.isDisabled,onChange:I,inputProps:j,...R}=b;let P=q;a?.value&&b.value&&(P=a.value.includes(b.value));let L=I;a?.onChange&&b.value&&(L=Ee(a.onChange,I));const{state:p,getInputProps:G,getCheckboxProps:D,getLabelProps:_,getRootProps:K}=Ve({...R,isDisabled:u,isChecked:P,onChange:L}),A=qe(p.isChecked),v=s.useMemo(()=>({animation:A?p.isIndeterminate?`${ze} 20ms linear, ${Xe} 200ms linear`:`${$e} 200ms linear`:void 0,...i.icon,...Se({fontSize:S,color:E})}),[E,S,A,p.isIndeterminate,i.icon]),O=s.cloneElement(W,{__css:v,isIndeterminate:p.isIndeterminate,isChecked:p.isChecked});return f.jsxs(x.label,{__css:{...Oe,...i.container},className:Ie("chakra-checkbox",V),...K(),children:[f.jsx("input",{className:"chakra-checkbox__input",...G(j,n)}),f.jsx(x.span,{__css:{...Ge,...i.control},className:"chakra-checkbox__control",...D(),children:O}),w&&f.jsx(x.span,{className:"chakra-checkbox__label",..._(),__css:{marginStart:H,...i.label},children:w})]})});Qe.displayName="Checkbox";export{Qe as C,Ue as t,He as v}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CI5dqHk8x18v.js b/openlayers-base-packages/pr-previews/pr-377/assets/CI5dqHk8x18v.js new file mode 100644 index 0000000..0943cb9 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/CI5dqHk8x18v.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"showcase-app":{"header.title":"Component Showcase","ariaLabels.map":"Karte. Mit den Pfeiltasten kannst du die Karte bewegen. Mit der Plus Taste hineinzoomen und mit der Minus Taste herauszoomen.","demos.geolocation.title":"Geolocation","demos.geolocation.description":"Diese Demo zeigt, wie das Geolocation-Tool verwendet werden kann, um die aktuelle Position des Geräts zu erhalten.","demos.printing.title":"Druck","demos.printing.description":"Diese Demo zeigt, wie die Printing-Komponente verwendet werden kann, um einen Screenshot der Karte zu exportieren.","demos.spatialBookmarks.title":"Räumliche Lesezeichen","demos.spatialBookmarks.description":"Diese Demo zeigt, wie die SpatialBookmarks-Komponente verwendet werden kann, um räumliche Lesezeichen zu speichern und anzuwenden.","demos.overviewMap.title":"Übersichtskarte","demos.overviewMap.description":"Diese Demo zeigt, wie die OverviewMap verwendet werden kann.","demos.mapNavigation.title":"Kartennavigations-Werkzeuge","demos.mapNavigation.description":"Diese Demo zeigt, wie die Tools zur Kartennavigation verwendet werden können: ZoomIn, ZoomOut, InitialExtent","demos.searchAndHighlight.title":"Suche und Feature-Highlight","demos.searchAndHighlight.description":"Diese Demo zeigt, wie die Search-Komponente verwendet werden kann und wie mittels Highlighting Features in der Karte hervorgehoben werden können.","demos.coordinateViewer.title":"Koordinaten-Anzeige","demos.coordinateViewer.description":"Diese Demo zeigt, wie die CoordinateViewer-Komponente verwendet werden kann, um sich Koordinaten an der Position des Mauszeigers anzeigen zu lassen.","demos.coordinateInput.title":"Koordinaten-Eingabe","demos.coordinateInput.description":"Diese Demo zeigt, wie die CoordinateInput-Komponente verwendet werden kann, um Usern die Eingabe von Koordinaten zu ermöglichen. Es findet eine Validierung statt, ob die Eingabe eine gültige Koordinate in der ausgewählten Projektion darstellt.","demos.coordinateInput.cleared":"Eingabefeld geleert","demos.coordinateInput.entered":"Koordinate eingegeben: {coordinates} in {projection}","demos.coordinateInput.placeholder":"Hier Koordinate eingeben","demos.coordinateInput.setInput":"Wert in Eingabefeld schreiben","demos.coordinateSearch.title":"Koordinaten-Suche","demos.coordinateSearch.description":"Diese Demo zeigt, wie die CoordinateSearch-Komponente verwendet werden kann, um sich Koordinaten an der Position des Mauszeigers anzeigen zu lassen und nach Koordinaten zu suchen. Dafür kann zwischen verschiedenen Projektionen gewechselt werden.","demos.coordinateSearch.cleared":"Eingabefeld geleert","demos.coordinateSearch.entered":"Koordinate eingegeben: {coordinates} in {projection}","demos.scaleViewer.title":"Maßstabs-Anzeige","demos.scaleViewer.description":"Diese Demo zeigt, wie die ScaleViewer-Komponente verwendet werden kann, um den aktuellen Maßstab anzuzeigen.","demos.scaleSetter.title":"Maßstab setzen","demos.scaleSetter.description":"Diese Demo zeigt, wie die ScaleSetter-Komponente verwendet werden kann, um den Maßstab der Karte anzupassen.","demos.scaleBar.title":"Maßstabsleiste","demos.scaleBar.description":"Diese Demo zeigt, wie die ScaleBar-Komponente verwendet werden kann, um eine Maßstabsleiste anzuzeigen.","demos.measurement.title":"Messen","demos.measurement.description":"Diese Demo zeigt, wie die Measurement-Komponente verwendet werden kann, um Strecken- und Flächenmessungen in der karte zu durchzuführen.","demos.tocLegend.title":"Karteninhalt, Grundkarte und Legende","demos.tocLegend.description":"Diese Demo zeigt, wie die Toc-, BasemapSwitcher und Legend-Komponenten verwendet werden können, um die Karteninhalte zu kontrollieren und eine Legende anzuzeigen.","demos.tocLegend.tocTitle":"Karteninhalt","demos.tocLegend.legendTitle":"Legende","demos.selectionResultList.title":"Selektion und Ergebnisliste","demos.selectionResultList.description":"Diese Demo zeigt, wie die Selection-Komponente verwendet werden kann, um Features in der Karte zu selektieren und wie die ResultList-Komponente verwendet werden kann, die Attribute von Features in einer Liste anzuzeigen.","demos.editing.title":"Editing","demos.editing.description":"Diese Demo zeigt, wie mit Hilfe der API des Paketes editing Editier-Funktionen angeboten werden können.","demos.editing.startCreateButton":"Feature erstellen","demos.editing.startUpdateButton":"Feature bearbeiten","demos.editing.stopButton":"Editierung stoppen","demos.editing.create.startTitle":"Editierung - Neues Feature erstellen","demos.editing.create.featureCreated":"Objekt erstellt mit ID: {featureId}","demos.editing.update.startTitle":"Editierung - Feature bearbeiten","demos.editing.update.featureModified":"Objekt aktualisiert mit ID: {featureId}","demos.editing.update.tooltip.select":"Geometrie auswählen, um mit der Bearbeitung zu starten","demos.editing.update.savingStared":"Feature wird gespeichert...","demos.editing.activeInfo":"Status: Editierung aktiv","demos.editing.inactiveInfo":"Status: Editierung inaktiv","demoSelection.label":"Demo:","demoSelection.notFound":"Demo ''{demoId}'' wurde nicht gefunden.","localeSwitcher.label":"Sprache:","localeSwitcher.locale.de":"Deutsch","localeSwitcher.locale.en":"Englisch"},"@open-pioneer/coordinate-search":{"coordinateInput.ariaLabel":"Koordinateneingabe","coordinateInput.copyPlaceholder":"Kopieren","coordinateInput.clearPlaceholder":"Löschen","tooltip.basic":"Ungültige Eingabe","tooltip.space":"Ungültige Eingabe: Bitte trennen Sie die Koordinaten mit genau einem Leerzeichen.","tooltip.spaceOne":"Ungültige Eingabe: Bitte verwenden Sie nur genau ein Leerzeichen zum Trennen der Koordinaten.","tooltip.2coords":"Ungültige Eingabe: Es müssen zwei Zahlen eingegeben werden.","tooltip.invalidNumbers":"Ungültige Eingabe: Es müssen zwei gültige Zahlen eingegeben werden.","tooltip.extent":"Die eingegebenen Koordinaten passen nicht zum Koordinatensystem. Bitte Koordinatensystem oder Koordinaten ändern.","tooltip.projection":"Es gibt einen Fehler mit der Projektion. Bitte eine andere Projektion auswählen.","selected":"selektiert"},"@open-pioneer/editing":{"title":"Editierung von Objekten","create.tooltip.begin":"Klicken, um mit Erstellung der Geometrie zu beginnen","create.tooltip.continue":"Doppelt klicken, um Geometrie abzuschließen und Feature zu speichern","create.tooltip.deselect":"Außerhalb der Geometrie in die Karte klicken, um Änderungen zu speichern"},"@open-pioneer/geolocation":{"locateNotSupported":"Die Geolokalisierung wird nicht unterstützt.","locateMeStart":"Geolokalisierung starten","locateMeEnd":"Geolokalisierung stoppen","error":"Fehler","permissionDenied":"Die Geolokalisierung wurde abgebrochen.","positionUnavailable":"Die Position kann nicht ermittelt werden.","timeout":"Die Geolokalisierung dauert zu lange und wurde daher abgebrochen.","unknownError":"Bei der Geolokalisierung ist es zu einem unerwarteten Fehler gekommen."},"@open-pioneer/legend":{"altLabel":"Legendengrafik für Layer {layerName}","fallbackLabel":"Legende nicht verfügbar","basemapLabel":"Hintergrundkarte"},"@open-pioneer/map-navigation":{"initial-extent.title":"Zoom auf initiale Ausdehnung","zoom-in.title":"Karte vergrößern","zoom-out.title":"Karte verkleinern","view-backward.title":"Eine Kartenansicht zurück","view-forward.title":"Eine Kartenansicht vor"},"@open-pioneer/measurement":{"measurementLabel":"Modus","distance":"Strecke","area":"Fläche","deleteMeasurementLabel":"Messungen löschen","measurementInfoText":"Klicken Sie in die Karte, um eine Messung zu beginnen.","tooltips.help":"Klicken, um mit der Messung zu beginnen.","tooltips.continue":"Doppelt klicken, um die Messung zu beenden."},"@open-pioneer/printing":{"title":"Titel","fileFormat":"Datei Format","export":"Karte exportieren","input.placeholder":"Titel eingeben","printingMap":"Karte wird gedruckt ...","printingFailed":"Die Karte konnte nicht gedruckt werden."},"@open-pioneer/result-list":{"selectAllTooltip":"Alle auswählen","deSelectAllTooltip":"Alle abwählen","noDataMessage":"Keine Daten verfügbar","displayBoolean.true":"ja","displayBoolean.false":"nein","ariaLabel.selectSingle":"Drücken Sie die Leertaste zum ab- oder anwählen."},"@open-pioneer/scale-setter":{"button.ariaLabel":"Aktueller Maßstab: {scale}.","button.ariaDescription":"Drücken Sie Enter um den Maßstab zu ändern."},"@open-pioneer/search":{"noOptionsText":"Keine Suchtreffer gefunden","loadingText":"Frage Daten ab...","searchPlaceholder":"Suche...","ariaLabel.search":"Suchleiste","ariaLabel.instructions":"Benutze die Pfeiltasten Hoch und Runter um durch die Suchergebnisse zu scrollen, drücke Enter um das Suchergebnis zu selektieren, drücke Escape um zurückzukehren","ariaLabel.searchFocus":"fokussiert","ariaLabel.searchSelect":"selektiert","ariaLabel.searchClear":"gelöscht","ariaLabel.clearButton":"Suche leeren"},"@open-pioneer/selection":{"selectMethod":"Methode auswählen","EXTENT":"Rechteck","POLYGON":"Polygon","FREEPOLYGON":"Freies Zeichnen","CIRCLE":"Kreis","selectSource":"Quelle auswählen","tooltip":"Klicken Sie in die Karte, halten Sie die Maustaste gedrückt und ziehen Sie ein Rechteck auf","disabledTooltip":"Die aktuelle Selektionsquelle ist nicht verfügbar.","noSourceTooltip":"Es ist keine Selektionsquelle ausgewählt. Zum Starten bitte Selektionsquelle auswählen.","sourceNotAvailable":"Quelle nicht verfügbar","selectionFailed":"Die räumliche Auswahl ist fehlgeschlagen","selectionPlaceholder":"Keine Quelle ausgewählt","layerNotVisibleReason":"Zugehöriger Layer ist nicht sichtbar.","selected":"selektiert"},"@open-pioneer/spatial-bookmarks":{"bookmark.button.create":"Neues Lesezeichen hinzufügen","bookmark.button.deleteAll":"Alle Lesezeichen löschen","bookmark.button.deleteOne":"Lesezeichen löschen","bookmark.button.save":"Speichern","bookmark.button.cancel":"Abbrechen","bookmark.button.cancelDelete":"Nein","bookmark.button.confirmDelete":"Ja","bookmark.input.label":"Name","bookmark.input.placeholder":"Name des Lesezeichens","bookmark.alert.create":"Nach der Eingabe eines Namens können Sie das neue Lesezeichen speichern. Dabei wird der aktuelle Kartenausschnitt als Grundlage für die Position verwendet.","bookmark.alert.delete":"Möchten Sie wirklich alle räumlichen Lesezeichen löschen?","bookmark.alert.noSaved":"Sie haben keine gespeicherten Lesezeichen","bookmark.list.label":"Räumliche Lesezeichen"},"@open-pioneer/toc":{"basemapsLabel":"Hintergrundkarten","descriptionLabel":"Layer Beschreibung","operationalLayerLabel":"Layer","childgroupLabel":"Layergruppe {title}","missingLayers":"Es sind keine Layer vorhanden.","group.expand":"Gruppe ausklappen","group.collapse":"Gruppe einklappen","error":"Beim Erstellen des Karteninhalts ist ein Fehler aufgetreten.","layerNotAvailable":"Layer nicht verfügbar","toolsLabel":"Kartenwerkzeuge","tools.hideAllLayers":"Alle Karteninhalte ausblenden","tools.collapseAllGroups":"Alle Gruppen einklappen"},"@open-pioneer/basemap-switcher":{"emptyBasemapLabel":"Ohne Hintergrundkarte","layerNotAvailable":"Layer nicht verfügbar","selected":"selektiert"}}`);export{e as default}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CKwKePgRpvKf.js b/openlayers-base-packages/pr-previews/pr-377/assets/CKwKePgRpvKf.js deleted file mode 100644 index 2f9ce15..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CKwKePgRpvKf.js +++ /dev/null @@ -1 +0,0 @@ -import{h as r,o as i,T as c,j as m,g as l,m as f}from"./DbBkdn6FNbgs.js";const x=r(function(e,n){const{className:s,centerContent:a,...t}=i(e),o=c("Container",e);return m.jsx(l.div,{ref:n,className:f("chakra-container",s),...t,__css:{...o,...a&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});x.displayName="Container";export{x as C}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CL68Tre-iuri.js b/openlayers-base-packages/pr-previews/pr-377/assets/CL68Tre-iuri.js deleted file mode 100644 index bd5b282..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CL68Tre-iuri.js +++ /dev/null @@ -1 +0,0 @@ -import{J as f,h as a,u as S,o as x,af as T,j as n,g as d,I as h,T as p,aa as j,m as N}from"./DbBkdn6FNbgs.js";const[I,L]=f({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),m=a(function(s,e){const t=S("List",s),{children:o,styleType:y="none",stylePosition:u,spacing:r,...c}=x(s),l=T(o),g=r?{["& > *:not(style) ~ *:not(style)"]:{mt:r}}:{};return n.jsx(I,{value:t,children:n.jsx(d.ul,{ref:e,listStyleType:y,listStylePosition:u,role:"list",__css:{...t.container,...g},...c,children:l})})});m.displayName="List";const _=a((i,s)=>{const{as:e,...t}=i;return n.jsx(m,{ref:s,as:"ol",styleType:"decimal",marginStart:"1em",...t})});_.displayName="OrderedList";const C=a(function(s,e){const{as:t,...o}=s;return n.jsx(m,{ref:e,as:"ul",styleType:"initial",marginStart:"1em",...o})});C.displayName="UnorderedList";const P=a(function(s,e){const t=L();return n.jsx(d.li,{ref:e,...s,__css:t.item})});P.displayName="ListItem";const U=a(function(s,e){const t=L();return n.jsx(h,{ref:e,role:"presentation",...s,__css:t.icon})});U.displayName="ListIcon";const v=a(function(s,e){const t=p("Text",s),{className:o,align:y,decoration:u,casing:r,...c}=x(s),l=j({textAlign:s.align,textDecoration:s.decoration,textTransform:s.casing});return n.jsx(d.p,{ref:e,className:N("chakra-text",s.className),...l,...c,__css:t})});v.displayName="Text";export{m as L,v as T,C as U,P as a}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/Ca8Zt9kwahLC.js b/openlayers-base-packages/pr-previews/pr-377/assets/CMfwYEDRd35m.js similarity index 70% rename from openlayers-base-packages/pr-previews/pr-377/assets/Ca8Zt9kwahLC.js rename to openlayers-base-packages/pr-previews/pr-377/assets/CMfwYEDRd35m.js index 0bcd9b1..c2ed1ef 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/Ca8Zt9kwahLC.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/CMfwYEDRd35m.js @@ -1 +1 @@ -import{h as r,j as s,g as l,m as h,r as M,H as f,R as j}from"./DbBkdn6FNbgs.js";import{e as d,f as b,g as I,d as N,h as v,j as g,k as S}from"./35mnA9_wxNJd.js";import{c as C}from"./DjAArQ67Dgmx.js";const E=r((e,t)=>{const n=d();return s.jsx(l.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),P=r((e,t)=>{const{children:n,as:a,...o}=e,c=b(o,t),i=a||E;return s.jsx(i,{...c,className:h("chakra-menu__menu-button",e.className),children:s.jsx(l.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});P.displayName="MenuButton";const _=r((e,t)=>{const n=d();return s.jsx(l.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});_.displayName="MenuCommand";const k=r((e,t)=>{const{type:n,...a}=e,o=d(),c=a.as||n?n??void 0:"button",i=M.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return s.jsx(l.button,{ref:t,type:c,...a,__css:i})}),z=r((e,t)=>{const{icon:n,iconSpacing:a="0.75rem",command:o,commandSpacing:c="0.75rem",children:i,...p}=e,m=I(p,t),x=n||o?s.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return s.jsxs(k,{...m,className:h("chakra-menu__menuitem",m.className),children:[n&&s.jsx(N,{fontSize:"0.8em",marginEnd:a,children:n}),x,o&&s.jsx(_,{marginStart:c,children:o})]})});z.displayName="MenuItem";const A={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},L=l(f.div),w=r(function(t,n){const{rootProps:a,motionProps:o,...c}=t,{isOpen:i,onTransitionEnd:p,unstable__animationState:m}=v(),u=g(c,n),x=S(a),y=d();return s.jsx(l.div,{...x,__css:{zIndex:t.zIndex??y.list?.zIndex},children:s.jsx(L,{variants:A,initial:!1,animate:i?"enter":"exit",__css:{outline:0,...y.list},...o,...u,className:h("chakra-menu__menu-list",u.className),onUpdate:p,onAnimationComplete:j(m.onComplete,u.onAnimationComplete)})})});w.displayName="MenuList";const T=C({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});export{T as C,z as M,P as a,w as b}; +import{h as r,j as s,g as l,l as h,r as M,L as f,U as j}from"./B60Dx_GOYdnk.js";import{e as d,f as b,g as I,d as N,h as v,j as g,k as S}from"./C9VJq5Ka7299.js";import{c as C}from"./BlACKGYldMfy.js";const E=r((e,t)=>{const n=d();return s.jsx(l.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),P=r((e,t)=>{const{children:n,as:a,...o}=e,c=b(o,t),i=a||E;return s.jsx(i,{...c,className:h("chakra-menu__menu-button",e.className),children:s.jsx(l.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});P.displayName="MenuButton";const _=r((e,t)=>{const n=d();return s.jsx(l.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});_.displayName="MenuCommand";const k=r((e,t)=>{const{type:n,...a}=e,o=d(),c=a.as||n?n??void 0:"button",i=M.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return s.jsx(l.button,{ref:t,type:c,...a,__css:i})}),L=r((e,t)=>{const{icon:n,iconSpacing:a="0.75rem",command:o,commandSpacing:c="0.75rem",children:i,...p}=e,m=I(p,t),x=n||o?s.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return s.jsxs(k,{...m,className:h("chakra-menu__menuitem",m.className),children:[n&&s.jsx(N,{fontSize:"0.8em",marginEnd:a,children:n}),x,o&&s.jsx(_,{marginStart:c,children:o})]})});L.displayName="MenuItem";const z={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},A=l(f.div),w=r(function(t,n){const{rootProps:a,motionProps:o,...c}=t,{isOpen:i,onTransitionEnd:p,unstable__animationState:m}=v(),u=g(c,n),x=S(a),y=d();return s.jsx(l.div,{...x,__css:{zIndex:t.zIndex??y.list?.zIndex},children:s.jsx(A,{variants:z,initial:!1,animate:i?"enter":"exit",__css:{outline:0,...y.list},...o,...u,className:h("chakra-menu__menu-list",u.className),onUpdate:p,onAnimationComplete:j(m.onComplete,u.onAnimationComplete)})})});w.displayName="MenuList";const W=C({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});export{W as C,L as M,P as a,w as b}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/oqYRsmCvbYjm.js b/openlayers-base-packages/pr-previews/pr-377/assets/CY0UlXoH4bZI.js similarity index 87% rename from openlayers-base-packages/pr-previews/pr-377/assets/oqYRsmCvbYjm.js rename to openlayers-base-packages/pr-previews/pr-377/assets/CY0UlXoH4bZI.js index bec8b48..f4a8bad 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/oqYRsmCvbYjm.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/CY0UlXoH4bZI.js @@ -1 +1 @@ -import{a as c,j as e,V as a,b as l,f as p}from"./DbBkdn6FNbgs.js";import{a as m,C as u,b as h,M as s}from"./Ca8Zt9kwahLC.js";import{C as d}from"./CKwKePgRpvKf.js";import{H as x}from"./C520TGz1zAm6.js";import{T as r,U as f,a as t}from"./CL68Tre-iuri.js";import{M as j}from"./35mnA9_wxNJd.js";import"./DjAArQ67Dgmx.js";const k={"menu-fix-app":{name:"menu-fix-app",services:{},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}}},g="",b=[];function M(n){throw new Error(`Unsupported locale: '${n}'`)}const C=c(g),v=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:M,locales:b,packages:k,styles:C},Symbol.toStringTag,{value:"Module"}));function S(){return e.jsx(e.Fragment,{children:e.jsxs(d,{p:5,children:[e.jsxs(x,{children:[o({title:"Closes on select",closeOnSelect:!0}),o({title:"Does not close on select",closeOnSelect:!1})]}),e.jsxs(a,{mt:5,align:"start",spacing:2,children:[e.jsx(r,{as:"b",children:"Description"}),e.jsxs(r,{children:["This application is used to test Chakra-UI menus inside a Shadow DOM. Patches against Chakra","'","s ",e.jsx("code",{children:"Menu"})," component and"," ",e.jsx("code",{children:"useOutsideClick()"})," hooks ensure that the component behaves as expected:"]}),e.jsxs(f,{children:[e.jsx(t,{children:"Both menu buttons should behave normally when clicking them multiple times (first click on button opens menu; second click hides it again)."}),e.jsx(t,{children:"Both menus close when the user clicks outside."}),e.jsx(t,{children:"The first menu should close by itself if some menu item is clicked."}),e.jsxs(t,{children:["The second menu should ",e.jsx("em",{children:"not"})," close itself if an item is clicked."]})]})]})]})})}function o(n){const i=()=>{};return e.jsxs(j,{closeOnSelect:n.closeOnSelect??!0,onClose:i,children:[e.jsx(m,{as:l,rightIcon:e.jsx(u,{}),children:n.title}),e.jsxs(h,{children:[e.jsx(s,{children:"Download"}),e.jsx(s,{children:"Create a Copy"}),e.jsx(s,{children:"Mark as Draft"}),e.jsx(s,{children:"Delete"}),e.jsx(s,{children:"Attend a Workshop"})]})]})}const O=p({component:S,appMetadata:v});customElements.define("menu-fix-app",O); +import{a as c,j as e,V as a,b as l,f as p}from"./B60Dx_GOYdnk.js";import{a as m,C as u,b as h,M as s}from"./CMfwYEDRd35m.js";import{C as d}from"./DIOfOjAL_o1F.js";import{H as x}from"./BFY0X3gkqjoN.js";import{T as r,U as f,a as t}from"./BKR6R-cAnIXt.js";import{M as j}from"./C9VJq5Ka7299.js";import"./BlACKGYldMfy.js";const k={"menu-fix-app":{name:"menu-fix-app",services:{},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}}},g="",b=[];function M(n){throw new Error(`Unsupported locale: '${n}'`)}const C=c(g),v=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:M,locales:b,packages:k,styles:C},Symbol.toStringTag,{value:"Module"}));function S(){return e.jsx(e.Fragment,{children:e.jsxs(d,{p:5,children:[e.jsxs(x,{children:[o({title:"Closes on select",closeOnSelect:!0}),o({title:"Does not close on select",closeOnSelect:!1})]}),e.jsxs(a,{mt:5,align:"start",spacing:2,children:[e.jsx(r,{as:"b",children:"Description"}),e.jsxs(r,{children:["This application is used to test Chakra-UI menus inside a Shadow DOM. Patches against Chakra","'","s ",e.jsx("code",{children:"Menu"})," component and"," ",e.jsx("code",{children:"useOutsideClick()"})," hooks ensure that the component behaves as expected:"]}),e.jsxs(f,{children:[e.jsx(t,{children:"Both menu buttons should behave normally when clicking them multiple times (first click on button opens menu; second click hides it again)."}),e.jsx(t,{children:"Both menus close when the user clicks outside."}),e.jsx(t,{children:"The first menu should close by itself if some menu item is clicked."}),e.jsxs(t,{children:["The second menu should ",e.jsx("em",{children:"not"})," close itself if an item is clicked."]})]})]})]})})}function o(n){const i=()=>{};return e.jsxs(j,{closeOnSelect:n.closeOnSelect??!0,onClose:i,children:[e.jsx(m,{as:l,rightIcon:e.jsx(u,{}),children:n.title}),e.jsxs(h,{children:[e.jsx(s,{children:"Download"}),e.jsx(s,{children:"Create a Copy"}),e.jsx(s,{children:"Mark as Draft"}),e.jsx(s,{children:"Delete"}),e.jsx(s,{children:"Attend a Workshop"})]})]})}const O=p({component:S,appMetadata:v});customElements.define("menu-fix-app",O); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/Djes_egHqOHx.js b/openlayers-base-packages/pr-previews/pr-377/assets/CYroAbEI2PyD.js similarity index 92% rename from openlayers-base-packages/pr-previews/pr-377/assets/Djes_egHqOHx.js rename to openlayers-base-packages/pr-previews/pr-377/assets/CYroAbEI2PyD.js index fe3d123..4456615 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/Djes_egHqOHx.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/CYroAbEI2PyD.js @@ -1 +1 @@ -import{a_ as Me,af as M,bR as P,ay as ht,bS as bt,ak as Fe,an as Pt,am as xt,bT as vt,bU as jt,bV as wt,bW as Ct,ac as St,bX as I,bY as Le,bZ as Ot,aZ as Ne,b3 as Ge,u as Mt,k as ne,i as Ft,g as Pe,h as xe}from"./DyxVjgSvwe-K.js";import{G as Lt,a as Nt,b as Gt,M as Et}from"./jRJMM4_GqJDc.js";import{L as Tt}from"./D8JwQmCkwKBk.js";import{D as kt,r as i,j as s,G as At,H as Ee,m as R,J as Te,K as It,L as Rt,M as re,N as D,O as C,u as _t,o as Bt,P as Dt,q as Ht,g as A,h as J,C as Jt,Q as Ut,R as Vt,l as ke,b as ie,B as H,F as Ae}from"./DbBkdn6FNbgs.js";import{u as q,B as zt}from"./nEjnOjKmH1UU.js";import{u as Wt}from"./CCXTS-icusD6.js";import{F as $t,f as Ie}from"./DnYPVZQRsXfx.js";import{I as Kt,S as Re}from"./B_KTQkWPSzAO.js";import{c as Yt}from"./DjAArQ67Dgmx.js";import{C as qt,a as Zt,b as Qt,M as ve}from"./Ca8Zt9kwahLC.js";import{T as se,L as Xt}from"./CL68Tre-iuri.js";import{C as er}from"./B6P_btgblpGb.js";import{u as tr,a as rr,b as or,c as nr,l as sr,i as je,M as ar}from"./35mnA9_wxNJd.js";const ir=t=>{const{condition:e,message:r}=t};function lr(t){return"current"in t}const _e=()=>typeof window<"u";function cr(){return navigator.userAgentData?.platform??navigator.platform}const ur=t=>_e()&&t.test(navigator.vendor),dr=t=>_e()&&t.test(cr()),pr=()=>dr(/mac|iphone|ipad|ipod/i),mr=()=>pr()&&ur(/apple/i);function fr(t){const{ref:e,elements:r,enabled:o}=t,n=()=>e.current?.ownerDocument??document;kt(n,"pointerdown",a=>{if(!mr()||!o)return;const l=a.composedPath?.()?.[0]??a.target,p=(r??[e]).some(c=>{const f=lr(c)?c.current:c;return f?.contains(l)||f===l});n().activeElement!==l&&p&&(a.preventDefault(),l.focus())})}const k={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},ho={enter:{duration:.2,ease:k.easeOut},exit:{duration:.1,ease:k.easeIn}},we={enter:(t,e)=>({...t,delay:typeof e=="number"?e:e?.enter}),exit:(t,e)=>({...t,delay:typeof e=="number"?e:e?.exit})},gr=t=>t!=null&&parseInt(t.toString(),10)>0,Ce={exit:{height:{duration:.2,ease:k.ease},opacity:{duration:.3,ease:k.ease}},enter:{height:{duration:.3,ease:k.ease},opacity:{duration:.4,ease:k.ease}}},yr={exit:({animateOpacity:t,startingHeight:e,transition:r,transitionEnd:o,delay:n})=>({...t&&{opacity:gr(e)?1:0},height:e,transitionEnd:o?.exit,transition:r?.exit??we.exit(Ce.exit,n)}),enter:({animateOpacity:t,endingHeight:e,transition:r,transitionEnd:o,delay:n})=>({...t&&{opacity:1},height:e,transitionEnd:o?.enter,transition:r?.enter??we.enter(Ce.enter,n)})},Be=i.forwardRef((t,e)=>{const{in:r,unmountOnExit:o,animateOpacity:n=!0,startingHeight:a=0,endingHeight:l="auto",style:m,className:p,transition:c,transitionEnd:f,animatePresenceProps:y,...x}=t,[v,S]=i.useState(!1);i.useEffect(()=>{const G=setTimeout(()=>{S(!0)});return()=>clearTimeout(G)},[]),ir({condition:Number(a)>0&&!!o,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const w=parseFloat(a.toString())>0,u={startingHeight:a,endingHeight:l,animateOpacity:n,transition:v?c:{enter:{duration:0}},transitionEnd:{enter:f?.enter,exit:o?f?.exit:{...f?.exit,display:w?"block":"none"}}},g=o?r:!0,O=r||o?"enter":"exit";return s.jsx(At,{...y,initial:!1,custom:u,children:g&&s.jsx(Ee.div,{ref:e,...x,className:R("chakra-collapse",p),style:{overflow:"hidden",display:"block",...m},custom:u,variants:yr,initial:o?"exit":!1,animate:O,exit:"exit"})})});Be.displayName="Collapse";const[hr,N]=Te({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[br,U]=Te({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),T={click:"click",hover:"hover"};function Pr(t={}){const{closeOnBlur:e=!0,closeOnEsc:r=!0,initialFocusRef:o,id:n,returnFocusOnClose:a=!0,autoFocus:l=!0,arrowSize:m,arrowShadowColor:p,trigger:c=T.click,openDelay:f=200,closeDelay:y=200,isLazy:x,lazyBehavior:v="unmount",computePositionOnMount:S,...w}=t,{isOpen:u,onClose:g,onOpen:O,onToggle:G}=It(t),[tt,Q]=i.useState(a);i.useEffect(()=>Q(a),[a]);const X=i.useRef(null),_=i.useRef(null),F=i.useRef(null),B=i.useRef(!1),de=i.useRef(!1);u&&(de.current=!0);const[pe,rt]=i.useState(!1),[me,ot]=i.useState(!1),nt=i.useId(),st=n??nt,[fe,V,z,W]=["popover-trigger","popover-content","popover-header","popover-body"].map(d=>`${d}-${st}`),{referenceRef:$,getArrowProps:at,getPopperProps:ge,getArrowInnerProps:it,forceUpdate:lt}=Rt({...w,enabled:u||!!S}),ye=tr({isOpen:u,ref:F});fr({enabled:u,ref:_}),rr(F,{focusRef:_,visible:u,shouldFocus:tt&&c===T.click}),or(F,{focusRef:o,visible:u,shouldFocus:l&&c===T.click}),nr({enabled:u&&e,ref:F,handler(d){const b=d.composedPath?.()[0]??[d.target];K(_.current,b)||(b&&Q(!je(b)),g())}});const he=sr({wasSelected:de.current,enabled:x,mode:v,isSelected:ye.present}),ct=i.useCallback((d={},b=null)=>{const h={...d,style:{...d.style,transformOrigin:re.transformOrigin.varRef,[re.arrowSize.var]:m?`${m}px`:void 0,[re.arrowShadowColor.var]:p},ref:D(F,b),children:he?d.children:null,id:V,tabIndex:-1,role:"dialog",onKeyDown:C(d.onKeyDown,j=>{j.nativeEvent.isComposing||r&&j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),g())}),onBlur:C(d.onBlur,j=>{const E=Se(j),te=K(F.current,E),gt=K(_.current,E),yt=!te&&!gt;E&&Q(!je(E)),u&&e&&yt&&g()}),"aria-labelledby":pe?z:void 0,"aria-describedby":me?W:void 0};return c===T.hover&&(h.role="tooltip",h.onMouseEnter=C(d.onMouseEnter,()=>{B.current=!0}),h.onMouseLeave=C(d.onMouseLeave,j=>{j.nativeEvent.relatedTarget!==null&&(B.current=!1,setTimeout(()=>g(),y))})),h},[he,V,pe,z,me,W,c,r,g,u,e,y,p,m]),ut=i.useCallback((d={},b=null)=>ge({...d,style:{visibility:u?"visible":"hidden",...d.style}},b),[u,ge]),dt=i.useCallback((d,b=null)=>({...d,ref:D(b,X,$)}),[X,$]),L=i.useRef(),ee=i.useRef(),be=i.useCallback(d=>{X.current==null&&$(d)},[$]),pt=i.useCallback((d={},b=null)=>{const h={...d,ref:D(_,b,be),id:fe,"aria-haspopup":"dialog","aria-expanded":u,"aria-controls":V};return c===T.click&&(h.onClick=C(d.onClick,G)),c===T.hover&&(h.onFocus=C(d.onFocus,()=>{L.current===void 0&&O()}),h.onBlur=C(d.onBlur,j=>{const E=Se(j),te=!K(F.current,E);u&&e&&te&&g()}),h.onKeyDown=C(d.onKeyDown,j=>{j.key==="Escape"&&g()}),h.onMouseEnter=C(d.onMouseEnter,()=>{B.current=!0,L.current=window.setTimeout(()=>O(),f)}),h.onMouseLeave=C(d.onMouseLeave,()=>{B.current=!1,L.current&&(clearTimeout(L.current),L.current=void 0),ee.current=window.setTimeout(()=>{B.current===!1&&g()},y)})),h},[fe,u,V,c,be,G,O,e,g,f,y]);i.useEffect(()=>()=>{L.current&&clearTimeout(L.current),ee.current&&clearTimeout(ee.current)},[]);const mt=i.useCallback((d={},b=null)=>({...d,id:z,ref:D(b,h=>{rt(!!h)})}),[z]),ft=i.useCallback((d={},b=null)=>({...d,id:W,ref:D(b,h=>{ot(!!h)})}),[W]);return{forceUpdate:lt,isOpen:u,onAnimationComplete:ye.onComplete,onClose:g,getAnchorProps:dt,getArrowProps:at,getArrowInnerProps:it,getPopoverPositionerProps:ut,getPopoverProps:ct,getTriggerProps:pt,getHeaderProps:mt,getBodyProps:ft}}function K(t,e){return t===e||t?.contains(e)}function Se(t){const e=t.currentTarget.ownerDocument.activeElement;return t.relatedTarget??e}function De(t){const e=_t("Popover",t),{children:r,...o}=Bt(t),n=Dt(),a=Pr({...o,direction:n.direction});return s.jsx(hr,{value:a,children:s.jsx(br,{value:e,children:Ht(r,{isOpen:a.isOpen,onClose:a.onClose,forceUpdate:a.forceUpdate})})})}De.displayName="Popover";const oe=(t,e)=>e?`${t}.${e}, ${e}`:void 0;function He(t){const{bg:e,bgColor:r,backgroundColor:o,shadow:n,boxShadow:a,shadowColor:l,...m}=t,{getArrowProps:p,getArrowInnerProps:c}=N(),f=U(),y=e??r??o,x=n??a;return s.jsx(A.div,{...p(),className:"chakra-popover__arrow-positioner",children:s.jsx(A.div,{className:R("chakra-popover__arrow",t.className),...c(m),__css:{"--popper-arrow-shadow-color":oe("colors",l),"--popper-arrow-bg":oe("colors",y),"--popper-arrow-shadow":oe("shadows",x),...f.arrow}})})}He.displayName="PopoverArrow";const Je=J(function(e,r){const{getBodyProps:o}=N(),n=U();return s.jsx(A.div,{...o(e,r),className:R("chakra-popover__body",e.className),__css:n.body})});Je.displayName="PopoverBody";const Ue=J(function(e,r){const{onClose:o}=N(),n=U();return s.jsx(Jt,{size:"sm",onClick:o,className:R("chakra-popover__close-btn",e.className),__css:n.closeButton,ref:r,...e})});Ue.displayName="PopoverCloseButton";function xr(t){if(t)return{enter:{...t.enter,visibility:"visible"},exit:{...t.exit,transitionEnd:{visibility:"hidden"}}}}const vr={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},jr=A(Ee.section),Ve=J(function(e,r){const{variants:o=vr,...n}=e,{isOpen:a}=N();return s.jsx(jr,{ref:r,variants:xr(o),initial:!1,animate:a?"enter":"exit",...n})});Ve.displayName="PopoverTransition";const ze=J(function(e,r){const{rootProps:o,motionProps:n,...a}=e,{getPopoverProps:l,getPopoverPositionerProps:m,onAnimationComplete:p}=N(),c=U(),f=Ut({position:"relative",display:"flex",flexDirection:"column",...c.content});return s.jsx(A.div,{...m(o),__css:c.popper,className:"chakra-popover__popper",children:s.jsx(Ve,{...n,...l(a,r),onAnimationComplete:Vt(p,a.onAnimationComplete),className:R("chakra-popover__content",e.className),__css:f})})});ze.displayName="PopoverContent";const We=J(function(e,r){const{getHeaderProps:o}=N(),n=U();return s.jsx(A.header,{...o(e,r),className:R("chakra-popover__header",e.className),__css:n.header})});We.displayName="PopoverHeader";function $e(t){const e=i.Children.only(t.children),{getTriggerProps:r}=N();return s.jsx(s.Fragment,{children:i.cloneElement(e,r(e.props,e.ref))})}$e.displayName="PopoverTrigger";function wr(t){return"parentLayer"in t}function bo(t){return"olLayer"in t}class Cr{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Me,this.supportedMediaTypes=null}getReadOptions(e,r){if(r){let o=r.dataProjection?M(r.dataProjection):this.readProjection(e);r.extent&&o&&o.getUnits()==="tile-pixels"&&(o=M(o),o.setWorldExtent(r.extent)),r={dataProjection:o,featureProjection:r.featureProjection}}return this.adaptOptions(r)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return P()}readFeature(e,r){return P()}readFeatures(e,r){return P()}readGeometry(e,r){return P()}readProjection(e){return P()}writeFeature(e,r){return P()}writeFeatures(e,r){return P()}writeGeometry(e,r){return P()}}function le(t,e,r){const o=r?M(r.featureProjection):null,n=r?M(r.dataProjection):null;let a=t;if(o&&n&&!ht(o,n)){e&&(a=t.clone());const l=e?o:n,m=e?n:o;l.getUnits()==="tile-pixels"?a.transform(l,m):a.applyTransform(bt(l,m))}if(e&&r&&r.decimals!==void 0){const l=Math.pow(10,r.decimals),m=function(p){for(let c=0,f=p.length;cKe({...t,geometry:a})).flat();const o=r.type==="MultiPolygon"?"Polygon":r.type;if(o==="GeometryCollection"||o==="Circle")throw new Error("Unsupported geometry type: "+o);const n=r.layout.length;return le(new Fe(o,o==="Polygon"?Or(r.flatCoordinates,r.ends,n):r.flatCoordinates,r.ends?.flat(),n,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function ce(t,e){if(!t)return null;if(Array.isArray(t)){const o=t.map(n=>ce(n,e));return new Lt(o)}const r=Sr[t.type];return le(new r(t.flatCoordinates,t.layout,t.ends),!1,e)}class Mr extends Cr{constructor(){super()}getType(){return"json"}readFeature(e,r){return this.readFeatureFromObject(Y(e),this.getReadOptions(e,r))}readFeatures(e,r){return this.readFeaturesFromObject(Y(e),this.getReadOptions(e,r))}readFeatureFromObject(e,r){return P()}readFeaturesFromObject(e,r){return P()}readGeometry(e,r){return this.readGeometryFromObject(Y(e),this.getReadOptions(e,r))}readGeometryFromObject(e,r){return P()}readProjection(e){return this.readProjectionFromObject(Y(e))}readProjectionFromObject(e){return P()}writeFeature(e,r){return JSON.stringify(this.writeFeatureObject(e,r))}writeFeatureObject(e,r){return P()}writeFeatures(e,r){return JSON.stringify(this.writeFeaturesObject(e,r))}writeFeaturesObject(e,r){return P()}writeGeometry(e,r){return JSON.stringify(this.writeGeometryObject(e,r))}writeGeometryObject(e,r){return P()}}function Y(t){if(typeof t=="string"){const e=JSON.parse(t);return e||null}return t!==null?t:null}class Po extends Mr{constructor(e){e=e||{},super(),this.dataProjection=M(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=M(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,r){let o=null;e.type==="Feature"?o=e:o={type:"Feature",geometry:e,properties:null};const n=ue(o.geometry);if(this.featureClass===Fe)return Ke({geometry:n,id:o.id,properties:o.properties},r);const a=new Me;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&o.geometry_name&&a.setGeometryName(o.geometry_name),a.setGeometry(ce(n,r)),"id"in o&&a.setId(o.id),o.properties&&a.setProperties(o.properties,!0),a}readFeaturesFromObject(e,r){const o=e;let n=null;if(o.type==="FeatureCollection"){const a=e;n=[];const l=a.features;for(let m=0,p=l.length;m{u(!1),a?.(O)};return s.jsx(ke,{label:o,placement:"auto",openDelay:500,...c,isOpen:w,onOpen:()=>u(!0),onClose:()=>u(!1),children:s.jsx(Vr,{className:v,ref:r,"aria-label":o,leftIcon:n,iconSpacing:0,padding:0,isDisabled:m,isLoading:l,isActive:p,"aria-pressed":S,...x,...f,onClick:g})})}),Vr=i.forwardRef(function(e,r){const{"aria-labelledby":o,"aria-describedby":n,...a}=e;return s.jsx(ie,{ref:r,...a})}),zr="@open-pioneer/toc",Z=Mt.bind(void 0,zr),Ye=i.createContext(void 0),Wr=Ye.Provider;function $r(){const t=i.useContext(Ye);if(!t)throw new Error("useTocWidgetOptions must be used within a TocWidgetOptionsProvider");return t}const qe=i.createContext(void 0),Ze=i.forwardRef((t,e)=>{const{map:r,"aria-label":o}=t,n=i.useRef();n.current||(n.current=new Map);const a=i.useMemo(()=>({registerExpandedState(c,f){n.current.set(c,f)},unregisterExpandedState(c){n.current.delete(c)}}),[]),l=Xr(n.current),m=Z(),p=qr(r);return i.useImperativeHandle(e,()=>({listItemsExpandedModel:l})),p.length?s.jsx(qe.Provider,{value:a,children:Qe(p,{"aria-label":o})}):s.jsx(se,{className:"toc-missing-layers","aria-label":o,children:m.formatMessage({id:"missingLayers"})})});Ze.displayName="LayerList";function Qe(t,e){const r=t.map(n=>s.jsx(Kr,{layer:n},n.id));return s.jsx(H,{children:s.jsx(Xt,{as:"ul",className:"toc-layer-list",listStyleType:"none",role:"group",...e,children:r})})}function Kr(t){const{layer:e}=t,r=Z(),o=$r(),n=i.useId(),{title:a,description:l,isVisible:m}=q(()=>({title:e.title,description:e.description,isVisible:e.visible}),[e]),p=Zr(e),c=et(e)!=="error",f=r.formatMessage({id:"layerNotAvailable"}),[y,x]=i.useState(!0),v=i.useContext(qe),S=o?o.collapsibleGroups:!1,w=Wt(g=>{x(g)});i.useEffect(()=>{if(v)return v.registerExpandedState(e.id,{layerId:e.id,isExpanded:y,setExpanded:w}),()=>v.unregisterExpandedState(e.id)},[e,v,w,y]);let u;return p?.length&&(u=Qe(p,{ml:4,"aria-label":r.formatMessage({id:"childgroupLabel"},{title:a})})),s.jsxs(H,{as:"li",className:Ge("toc-layer-item",`layer-${Qr(e.id)}`),children:[s.jsxs(ne,{className:"toc-layer-item-content",width:"100%",flexDirection:"row",align:"center",justifyContent:"space-between",gap:2,minHeight:10,children:[s.jsx(er,{"aria-label":a+(c?"":" "+f),isChecked:m,isDisabled:!c,onChange:g=>Xe(e,g.target.checked,o.autoShowParents),children:a}),!c&&s.jsx(ke,{className:"toc-layer-item-content-tooltip",label:f,placement:"right",openDelay:500,children:s.jsx("span",{children:s.jsx($t,{className:"toc-layer-item-content-icon",color:"red","aria-label":f})})}),u&&S&&s.jsx(Kt,{variant:"ghost",borderRadius:"full",padding:0,className:"toc-layer-item-collapse-button",onClick:()=>x(!y),icon:y?s.jsx(Ur,{}):s.jsx(qt,{}),"aria-label":y?r.formatMessage({id:"group.collapse"},{title:a}):r.formatMessage({id:"group.expand"},{title:a}),"aria-expanded":y,"aria-controls":n}),s.jsx(Re,{}),l&&s.jsx(Yr,{layer:e,title:a,description:l,intl:r})]}),u&&s.jsx(Be,{in:y,id:n,className:"toc-collapsible-item",children:u})]})}function Xe(t,e,r){t.setVisible(e),e&&r&&t.parent&&Xe(t.parent,!0,!0)}function Yr(t){const{layer:e,title:r,description:o,intl:n}=t,a=n.formatMessage({id:"descriptionLabel"}),l=et(e)!=="error";return s.jsxs(De,{placement:"bottom-start",children:[s.jsx($e,{children:s.jsx(ie,{isDisabled:!l,className:"toc-layer-item-details-button","aria-label":a,borderRadius:"full",iconSpacing:0,padding:0,variant:"ghost",leftIcon:s.jsx(Ie,{})})}),s.jsx(Ae,{children:s.jsxs(ze,{className:"toc-layer-item-details",overflowY:"auto",maxHeight:"400",children:[s.jsx(He,{}),s.jsx(Ue,{mt:1}),s.jsx(We,{children:r}),s.jsx(Je,{children:o})]})})]})}function qr(t){return q(()=>{const e=t.layers.getOperationalLayers({sortByDisplayOrder:!0})??[];return e.reverse(),e},[t])}function Zr(t){return q(()=>{const e=t.children?.getItems({sortByDisplayOrder:!0});return e?.reverse(),e},[t])}function et(t){return q(()=>(wr(t)?t.parentLayer:t).loadState,[t])}function Qr(t){return t.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}function Xr(t){return i.useMemo(()=>({isExpanded(r){if(t.has(r))return t.get(r)?.isExpanded},setExpanded(r,o){t.get(r)?.setExpanded(o)},getAllExpandedStates(){return Array.from(t.values())}}),[t])}const eo=t=>{const e=Z(),{map:r,listItemsExpandedModel:o,showHideAllLayers:n=!0,showCollapseAllGroups:a=!0}=t;return!(!n&&!a)&&s.jsx(H,{className:"toc-tools",children:s.jsxs(ar,{placement:"bottom-start",children:[s.jsx(Zt,{as:ie,className:"toc-tools-button","aria-label":e.formatMessage({id:"toolsLabel"}),borderRadius:"full",iconSpacing:0,padding:3,variant:"ghost",leftIcon:s.jsx(Ie,{})}),s.jsx(Ae,{children:s.jsxs(Qt,{className:"tools-menu",children:[n&&s.jsx(ve,{"aria-label":e.formatMessage({id:"tools.hideAllLayers"}),onClick:()=>{to(r)},children:e.formatMessage({id:"tools.hideAllLayers"})}),a&&s.jsx(ve,{"aria-label":e.formatMessage({id:"tools.collapseAllGroups"}),onClick:()=>{ro(o)},children:e.formatMessage({id:"tools.collapseAllGroups"})})]})})]})})};function to(t){const e=r=>{r.setVisible(!1);const o=r.children?.getItems();if(o)for(const n of o)e(n)};t?.layers.getOperationalLayers().forEach(r=>{e(r)})}function ro(t){t&&t.getAllExpandedStates().forEach(e=>e.setExpanded(!1))}const Oe=2,vo=t=>{const e=Z(),{showTools:r=!1,toolsConfig:o,showBasemapSwitcher:n=!0,basemapSwitcherProps:a,collapsibleGroups:l=!1,autoShowParents:m=!0}=t,{containerProps:p}=Ne("toc",t),c=i.useId(),f=i.useMemo(()=>({autoShowParents:m,collapsibleGroups:l}),[m,l]),y=Ft(t),[x,v]=i.useState(),S=i.useCallback(g=>{g&&v(g.listItemsExpandedModel)},[]),w=o?o.showCollapseAllGroups&&f.collapsibleGroups:f.collapsibleGroups;let u;switch(y.kind){case"loading":u=null;break;case"rejected":u=s.jsx(se,{className:"toc-error",children:e.formatMessage({id:"error"})});break;case"resolved":{const g=y.map,O=n&&s.jsx(H,{className:"toc-basemap-switcher",children:s.jsx(Pe,{title:s.jsx(xe,{id:c,size:"sm",mb:Oe,children:e.formatMessage({id:"basemapsLabel"})}),children:s.jsx(zt,{map:g,"aria-labelledby":c,...a})})}),G=s.jsx(H,{className:"toc-operational-layers",children:s.jsx(Pe,{title:s.jsx(xe,{size:"sm",mb:2,children:s.jsxs(ne,{children:[s.jsx(se,{my:3,children:e.formatMessage({id:"operationalLayerLabel"})}),s.jsx(Re,{}),r&&s.jsx(eo,{map:g,listItemsExpandedModel:x,showHideAllLayers:o?.showHideAllLayers,showCollapseAllGroups:w})]})}),children:s.jsx(Ze,{map:g,"aria-label":e.formatMessage({id:"operationalLayerLabel"}),ref:S})})});u=s.jsxs(s.Fragment,{children:[O,G]});break}}return s.jsx(ne,{...p,direction:"column",gap:Oe,children:s.jsx(Wr,{value:f,children:u})})};export{Ur as C,Cr as F,Po as G,De as P,xo as T,$e as a,ze as b,He as c,Je as d,vo as e,bo as i,le as t,N as u}; +import{a_ as Me,af as M,bR as P,ay as ht,bS as bt,ak as Fe,an as Pt,am as xt,bT as vt,bU as jt,bV as wt,bW as Ct,ac as St,bX as I,bY as Le,bZ as Ot,aZ as Ne,b3 as Ge,u as Mt,k as ne,i as Ft,g as Pe,h as xe}from"./j0mck_Meu7Xh.js";import{G as Lt,a as Nt,b as Gt,M as Et}from"./BWf1FusGPLsb.js";import{L as Tt}from"./ajAX9OmvUsbZ.js";import{J as kt,r as i,j as s,K as At,L as Ee,l as R,k as Te,M as It,N as Rt,O as re,P as D,Q as C,u as _t,o as Bt,R as Dt,w as Ht,g as A,h as U,D as Ut,T as Jt,U as Vt,q as ke,b as ie,B as H,F as Ae}from"./B60Dx_GOYdnk.js";import{u as q,B as zt}from"./DSjrbd_eKbZM.js";import{u as Wt}from"./BpQSjk0kyblh.js";import{F as $t,f as Ie}from"./2C0geDG_OBHU.js";import{I as Kt,S as Re}from"./BXfBNJYYR7xb.js";import{c as Yt}from"./BlACKGYldMfy.js";import{C as qt,a as Zt,b as Qt,M as ve}from"./CMfwYEDRd35m.js";import{T as se,L as Xt}from"./BKR6R-cAnIXt.js";import{C as er}from"./CG5nmvkyugDn.js";import{u as tr,a as rr,b as or,c as nr,l as sr,i as je,M as ar}from"./C9VJq5Ka7299.js";const ir=t=>{const{condition:e,message:r}=t};function lr(t){return"current"in t}const _e=()=>typeof window<"u";function cr(){return navigator.userAgentData?.platform??navigator.platform}const ur=t=>_e()&&t.test(navigator.vendor),dr=t=>_e()&&t.test(cr()),pr=()=>dr(/mac|iphone|ipad|ipod/i),mr=()=>pr()&&ur(/apple/i);function fr(t){const{ref:e,elements:r,enabled:o}=t,n=()=>e.current?.ownerDocument??document;kt(n,"pointerdown",a=>{if(!mr()||!o)return;const l=a.composedPath?.()?.[0]??a.target,p=(r??[e]).some(c=>{const f=lr(c)?c.current:c;return f?.contains(l)||f===l});n().activeElement!==l&&p&&(a.preventDefault(),l.focus())})}const k={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},ho={enter:{duration:.2,ease:k.easeOut},exit:{duration:.1,ease:k.easeIn}},we={enter:(t,e)=>({...t,delay:typeof e=="number"?e:e?.enter}),exit:(t,e)=>({...t,delay:typeof e=="number"?e:e?.exit})},gr=t=>t!=null&&parseInt(t.toString(),10)>0,Ce={exit:{height:{duration:.2,ease:k.ease},opacity:{duration:.3,ease:k.ease}},enter:{height:{duration:.3,ease:k.ease},opacity:{duration:.4,ease:k.ease}}},yr={exit:({animateOpacity:t,startingHeight:e,transition:r,transitionEnd:o,delay:n})=>({...t&&{opacity:gr(e)?1:0},height:e,transitionEnd:o?.exit,transition:r?.exit??we.exit(Ce.exit,n)}),enter:({animateOpacity:t,endingHeight:e,transition:r,transitionEnd:o,delay:n})=>({...t&&{opacity:1},height:e,transitionEnd:o?.enter,transition:r?.enter??we.enter(Ce.enter,n)})},Be=i.forwardRef((t,e)=>{const{in:r,unmountOnExit:o,animateOpacity:n=!0,startingHeight:a=0,endingHeight:l="auto",style:m,className:p,transition:c,transitionEnd:f,animatePresenceProps:y,...x}=t,[v,S]=i.useState(!1);i.useEffect(()=>{const G=setTimeout(()=>{S(!0)});return()=>clearTimeout(G)},[]),ir({condition:Number(a)>0&&!!o,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const w=parseFloat(a.toString())>0,u={startingHeight:a,endingHeight:l,animateOpacity:n,transition:v?c:{enter:{duration:0}},transitionEnd:{enter:f?.enter,exit:o?f?.exit:{...f?.exit,display:w?"block":"none"}}},g=o?r:!0,O=r||o?"enter":"exit";return s.jsx(At,{...y,initial:!1,custom:u,children:g&&s.jsx(Ee.div,{ref:e,...x,className:R("chakra-collapse",p),style:{overflow:"hidden",display:"block",...m},custom:u,variants:yr,initial:o?"exit":!1,animate:O,exit:"exit"})})});Be.displayName="Collapse";const[hr,N]=Te({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[br,J]=Te({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),T={click:"click",hover:"hover"};function Pr(t={}){const{closeOnBlur:e=!0,closeOnEsc:r=!0,initialFocusRef:o,id:n,returnFocusOnClose:a=!0,autoFocus:l=!0,arrowSize:m,arrowShadowColor:p,trigger:c=T.click,openDelay:f=200,closeDelay:y=200,isLazy:x,lazyBehavior:v="unmount",computePositionOnMount:S,...w}=t,{isOpen:u,onClose:g,onOpen:O,onToggle:G}=It(t),[tt,Q]=i.useState(a);i.useEffect(()=>Q(a),[a]);const X=i.useRef(null),_=i.useRef(null),F=i.useRef(null),B=i.useRef(!1),de=i.useRef(!1);u&&(de.current=!0);const[pe,rt]=i.useState(!1),[me,ot]=i.useState(!1),nt=i.useId(),st=n??nt,[fe,V,z,W]=["popover-trigger","popover-content","popover-header","popover-body"].map(d=>`${d}-${st}`),{referenceRef:$,getArrowProps:at,getPopperProps:ge,getArrowInnerProps:it,forceUpdate:lt}=Rt({...w,enabled:u||!!S}),ye=tr({isOpen:u,ref:F});fr({enabled:u,ref:_}),rr(F,{focusRef:_,visible:u,shouldFocus:tt&&c===T.click}),or(F,{focusRef:o,visible:u,shouldFocus:l&&c===T.click}),nr({enabled:u&&e,ref:F,handler(d){const b=d.composedPath?.()[0]??[d.target];K(_.current,b)||(b&&Q(!je(b)),g())}});const he=sr({wasSelected:de.current,enabled:x,mode:v,isSelected:ye.present}),ct=i.useCallback((d={},b=null)=>{const h={...d,style:{...d.style,transformOrigin:re.transformOrigin.varRef,[re.arrowSize.var]:m?`${m}px`:void 0,[re.arrowShadowColor.var]:p},ref:D(F,b),children:he?d.children:null,id:V,tabIndex:-1,role:"dialog",onKeyDown:C(d.onKeyDown,j=>{j.nativeEvent.isComposing||r&&j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),g())}),onBlur:C(d.onBlur,j=>{const E=Se(j),te=K(F.current,E),gt=K(_.current,E),yt=!te&&!gt;E&&Q(!je(E)),u&&e&&yt&&g()}),"aria-labelledby":pe?z:void 0,"aria-describedby":me?W:void 0};return c===T.hover&&(h.role="tooltip",h.onMouseEnter=C(d.onMouseEnter,()=>{B.current=!0}),h.onMouseLeave=C(d.onMouseLeave,j=>{j.nativeEvent.relatedTarget!==null&&(B.current=!1,setTimeout(()=>g(),y))})),h},[he,V,pe,z,me,W,c,r,g,u,e,y,p,m]),ut=i.useCallback((d={},b=null)=>ge({...d,style:{visibility:u?"visible":"hidden",...d.style}},b),[u,ge]),dt=i.useCallback((d,b=null)=>({...d,ref:D(b,X,$)}),[X,$]),L=i.useRef(),ee=i.useRef(),be=i.useCallback(d=>{X.current==null&&$(d)},[$]),pt=i.useCallback((d={},b=null)=>{const h={...d,ref:D(_,b,be),id:fe,"aria-haspopup":"dialog","aria-expanded":u,"aria-controls":V};return c===T.click&&(h.onClick=C(d.onClick,G)),c===T.hover&&(h.onFocus=C(d.onFocus,()=>{L.current===void 0&&O()}),h.onBlur=C(d.onBlur,j=>{const E=Se(j),te=!K(F.current,E);u&&e&&te&&g()}),h.onKeyDown=C(d.onKeyDown,j=>{j.key==="Escape"&&g()}),h.onMouseEnter=C(d.onMouseEnter,()=>{B.current=!0,L.current=window.setTimeout(()=>O(),f)}),h.onMouseLeave=C(d.onMouseLeave,()=>{B.current=!1,L.current&&(clearTimeout(L.current),L.current=void 0),ee.current=window.setTimeout(()=>{B.current===!1&&g()},y)})),h},[fe,u,V,c,be,G,O,e,g,f,y]);i.useEffect(()=>()=>{L.current&&clearTimeout(L.current),ee.current&&clearTimeout(ee.current)},[]);const mt=i.useCallback((d={},b=null)=>({...d,id:z,ref:D(b,h=>{rt(!!h)})}),[z]),ft=i.useCallback((d={},b=null)=>({...d,id:W,ref:D(b,h=>{ot(!!h)})}),[W]);return{forceUpdate:lt,isOpen:u,onAnimationComplete:ye.onComplete,onClose:g,getAnchorProps:dt,getArrowProps:at,getArrowInnerProps:it,getPopoverPositionerProps:ut,getPopoverProps:ct,getTriggerProps:pt,getHeaderProps:mt,getBodyProps:ft}}function K(t,e){return t===e||t?.contains(e)}function Se(t){const e=t.currentTarget.ownerDocument.activeElement;return t.relatedTarget??e}function De(t){const e=_t("Popover",t),{children:r,...o}=Bt(t),n=Dt(),a=Pr({...o,direction:n.direction});return s.jsx(hr,{value:a,children:s.jsx(br,{value:e,children:Ht(r,{isOpen:a.isOpen,onClose:a.onClose,forceUpdate:a.forceUpdate})})})}De.displayName="Popover";const oe=(t,e)=>e?`${t}.${e}, ${e}`:void 0;function He(t){const{bg:e,bgColor:r,backgroundColor:o,shadow:n,boxShadow:a,shadowColor:l,...m}=t,{getArrowProps:p,getArrowInnerProps:c}=N(),f=J(),y=e??r??o,x=n??a;return s.jsx(A.div,{...p(),className:"chakra-popover__arrow-positioner",children:s.jsx(A.div,{className:R("chakra-popover__arrow",t.className),...c(m),__css:{"--popper-arrow-shadow-color":oe("colors",l),"--popper-arrow-bg":oe("colors",y),"--popper-arrow-shadow":oe("shadows",x),...f.arrow}})})}He.displayName="PopoverArrow";const Ue=U(function(e,r){const{getBodyProps:o}=N(),n=J();return s.jsx(A.div,{...o(e,r),className:R("chakra-popover__body",e.className),__css:n.body})});Ue.displayName="PopoverBody";const Je=U(function(e,r){const{onClose:o}=N(),n=J();return s.jsx(Ut,{size:"sm",onClick:o,className:R("chakra-popover__close-btn",e.className),__css:n.closeButton,ref:r,...e})});Je.displayName="PopoverCloseButton";function xr(t){if(t)return{enter:{...t.enter,visibility:"visible"},exit:{...t.exit,transitionEnd:{visibility:"hidden"}}}}const vr={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},jr=A(Ee.section),Ve=U(function(e,r){const{variants:o=vr,...n}=e,{isOpen:a}=N();return s.jsx(jr,{ref:r,variants:xr(o),initial:!1,animate:a?"enter":"exit",...n})});Ve.displayName="PopoverTransition";const ze=U(function(e,r){const{rootProps:o,motionProps:n,...a}=e,{getPopoverProps:l,getPopoverPositionerProps:m,onAnimationComplete:p}=N(),c=J(),f=Jt({position:"relative",display:"flex",flexDirection:"column",...c.content});return s.jsx(A.div,{...m(o),__css:c.popper,className:"chakra-popover__popper",children:s.jsx(Ve,{...n,...l(a,r),onAnimationComplete:Vt(p,a.onAnimationComplete),className:R("chakra-popover__content",e.className),__css:f})})});ze.displayName="PopoverContent";const We=U(function(e,r){const{getHeaderProps:o}=N(),n=J();return s.jsx(A.header,{...o(e,r),className:R("chakra-popover__header",e.className),__css:n.header})});We.displayName="PopoverHeader";function $e(t){const e=i.Children.only(t.children),{getTriggerProps:r}=N();return s.jsx(s.Fragment,{children:i.cloneElement(e,r(e.props,e.ref))})}$e.displayName="PopoverTrigger";function wr(t){return"parentLayer"in t}function bo(t){return"olLayer"in t}class Cr{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Me,this.supportedMediaTypes=null}getReadOptions(e,r){if(r){let o=r.dataProjection?M(r.dataProjection):this.readProjection(e);r.extent&&o&&o.getUnits()==="tile-pixels"&&(o=M(o),o.setWorldExtent(r.extent)),r={dataProjection:o,featureProjection:r.featureProjection}}return this.adaptOptions(r)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return P()}readFeature(e,r){return P()}readFeatures(e,r){return P()}readGeometry(e,r){return P()}readProjection(e){return P()}writeFeature(e,r){return P()}writeFeatures(e,r){return P()}writeGeometry(e,r){return P()}}function le(t,e,r){const o=r?M(r.featureProjection):null,n=r?M(r.dataProjection):null;let a=t;if(o&&n&&!ht(o,n)){e&&(a=t.clone());const l=e?o:n,m=e?n:o;l.getUnits()==="tile-pixels"?a.transform(l,m):a.applyTransform(bt(l,m))}if(e&&r&&r.decimals!==void 0){const l=Math.pow(10,r.decimals),m=function(p){for(let c=0,f=p.length;cKe({...t,geometry:a})).flat();const o=r.type==="MultiPolygon"?"Polygon":r.type;if(o==="GeometryCollection"||o==="Circle")throw new Error("Unsupported geometry type: "+o);const n=r.layout.length;return le(new Fe(o,o==="Polygon"?Or(r.flatCoordinates,r.ends,n):r.flatCoordinates,r.ends?.flat(),n,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function ce(t,e){if(!t)return null;if(Array.isArray(t)){const o=t.map(n=>ce(n,e));return new Lt(o)}const r=Sr[t.type];return le(new r(t.flatCoordinates,t.layout,t.ends),!1,e)}class Mr extends Cr{constructor(){super()}getType(){return"json"}readFeature(e,r){return this.readFeatureFromObject(Y(e),this.getReadOptions(e,r))}readFeatures(e,r){return this.readFeaturesFromObject(Y(e),this.getReadOptions(e,r))}readFeatureFromObject(e,r){return P()}readFeaturesFromObject(e,r){return P()}readGeometry(e,r){return this.readGeometryFromObject(Y(e),this.getReadOptions(e,r))}readGeometryFromObject(e,r){return P()}readProjection(e){return this.readProjectionFromObject(Y(e))}readProjectionFromObject(e){return P()}writeFeature(e,r){return JSON.stringify(this.writeFeatureObject(e,r))}writeFeatureObject(e,r){return P()}writeFeatures(e,r){return JSON.stringify(this.writeFeaturesObject(e,r))}writeFeaturesObject(e,r){return P()}writeGeometry(e,r){return JSON.stringify(this.writeGeometryObject(e,r))}writeGeometryObject(e,r){return P()}}function Y(t){if(typeof t=="string"){const e=JSON.parse(t);return e||null}return t!==null?t:null}class Po extends Mr{constructor(e){e=e||{},super(),this.dataProjection=M(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=M(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,r){let o=null;e.type==="Feature"?o=e:o={type:"Feature",geometry:e,properties:null};const n=ue(o.geometry);if(this.featureClass===Fe)return Ke({geometry:n,id:o.id,properties:o.properties},r);const a=new Me;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&o.geometry_name&&a.setGeometryName(o.geometry_name),a.setGeometry(ce(n,r)),"id"in o&&a.setId(o.id),o.properties&&a.setProperties(o.properties,!0),a}readFeaturesFromObject(e,r){const o=e;let n=null;if(o.type==="FeatureCollection"){const a=e;n=[];const l=a.features;for(let m=0,p=l.length;m{u(!1),a?.(O)};return s.jsx(ke,{label:o,placement:"auto",openDelay:500,...c,isOpen:w,onOpen:()=>u(!0),onClose:()=>u(!1),children:s.jsx(Vr,{className:v,ref:r,"aria-label":o,leftIcon:n,iconSpacing:0,padding:0,isDisabled:m,isLoading:l,isActive:p,"aria-pressed":S,...x,...f,onClick:g})})}),Vr=i.forwardRef(function(e,r){const{"aria-labelledby":o,"aria-describedby":n,...a}=e;return s.jsx(ie,{ref:r,...a})}),zr="@open-pioneer/toc",Z=Mt.bind(void 0,zr),Ye=i.createContext(void 0),Wr=Ye.Provider;function $r(){const t=i.useContext(Ye);if(!t)throw new Error("useTocWidgetOptions must be used within a TocWidgetOptionsProvider");return t}const qe=i.createContext(void 0),Ze=i.forwardRef((t,e)=>{const{map:r,"aria-label":o}=t,n=i.useRef();n.current||(n.current=new Map);const a=i.useMemo(()=>({registerExpandedState(c,f){n.current.set(c,f)},unregisterExpandedState(c){n.current.delete(c)}}),[]),l=Xr(n.current),m=Z(),p=qr(r);return i.useImperativeHandle(e,()=>({listItemsExpandedModel:l})),p.length?s.jsx(qe.Provider,{value:a,children:Qe(p,{"aria-label":o})}):s.jsx(se,{className:"toc-missing-layers","aria-label":o,children:m.formatMessage({id:"missingLayers"})})});Ze.displayName="LayerList";function Qe(t,e){const r=t.map(n=>s.jsx(Kr,{layer:n},n.id));return s.jsx(H,{children:s.jsx(Xt,{as:"ul",className:"toc-layer-list",listStyleType:"none",role:"group",...e,children:r})})}function Kr(t){const{layer:e}=t,r=Z(),o=$r(),n=i.useId(),{title:a,description:l,isVisible:m}=q(()=>({title:e.title,description:e.description,isVisible:e.visible}),[e]),p=Zr(e),c=et(e)!=="error",f=r.formatMessage({id:"layerNotAvailable"}),[y,x]=i.useState(!0),v=i.useContext(qe),S=o?o.collapsibleGroups:!1,w=Wt(g=>{x(g)});i.useEffect(()=>{if(v)return v.registerExpandedState(e.id,{layerId:e.id,isExpanded:y,setExpanded:w}),()=>v.unregisterExpandedState(e.id)},[e,v,w,y]);let u;return p?.length&&(u=Qe(p,{ml:4,"aria-label":r.formatMessage({id:"childgroupLabel"},{title:a})})),s.jsxs(H,{as:"li",className:Ge("toc-layer-item",`layer-${Qr(e.id)}`),children:[s.jsxs(ne,{className:"toc-layer-item-content",width:"100%",flexDirection:"row",align:"center",justifyContent:"space-between",gap:2,minHeight:10,children:[s.jsx(er,{"aria-label":a+(c?"":" "+f),isChecked:m,isDisabled:!c,onChange:g=>Xe(e,g.target.checked,o.autoShowParents),children:a}),!c&&s.jsx(ke,{className:"toc-layer-item-content-tooltip",label:f,placement:"right",openDelay:500,children:s.jsx("span",{children:s.jsx($t,{className:"toc-layer-item-content-icon",color:"red","aria-label":f})})}),u&&S&&s.jsx(Kt,{variant:"ghost",borderRadius:"full",padding:0,className:"toc-layer-item-collapse-button",onClick:()=>x(!y),icon:y?s.jsx(Jr,{}):s.jsx(qt,{}),"aria-label":y?r.formatMessage({id:"group.collapse"},{title:a}):r.formatMessage({id:"group.expand"},{title:a}),"aria-expanded":y,"aria-controls":n}),s.jsx(Re,{}),l&&s.jsx(Yr,{layer:e,title:a,description:l,intl:r})]}),u&&s.jsx(Be,{in:y,id:n,className:"toc-collapsible-item",children:u})]})}function Xe(t,e,r){t.setVisible(e),e&&r&&t.parent&&Xe(t.parent,!0,!0)}function Yr(t){const{layer:e,title:r,description:o,intl:n}=t,a=n.formatMessage({id:"descriptionLabel"}),l=et(e)!=="error";return s.jsxs(De,{placement:"bottom-start",children:[s.jsx($e,{children:s.jsx(ie,{isDisabled:!l,className:"toc-layer-item-details-button","aria-label":a,borderRadius:"full",iconSpacing:0,padding:0,variant:"ghost",leftIcon:s.jsx(Ie,{})})}),s.jsx(Ae,{children:s.jsxs(ze,{className:"toc-layer-item-details",overflowY:"auto",maxHeight:"400",children:[s.jsx(He,{}),s.jsx(Je,{mt:1}),s.jsx(We,{children:r}),s.jsx(Ue,{children:o})]})})]})}function qr(t){return q(()=>{const e=t.layers.getOperationalLayers({sortByDisplayOrder:!0})??[];return e.reverse(),e},[t])}function Zr(t){return q(()=>{const e=t.children?.getItems({sortByDisplayOrder:!0});return e?.reverse(),e},[t])}function et(t){return q(()=>(wr(t)?t.parentLayer:t).loadState,[t])}function Qr(t){return t.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}function Xr(t){return i.useMemo(()=>({isExpanded(r){if(t.has(r))return t.get(r)?.isExpanded},setExpanded(r,o){t.get(r)?.setExpanded(o)},getAllExpandedStates(){return Array.from(t.values())}}),[t])}const eo=t=>{const e=Z(),{map:r,listItemsExpandedModel:o,showHideAllLayers:n=!0,showCollapseAllGroups:a=!0}=t;return!(!n&&!a)&&s.jsx(H,{className:"toc-tools",children:s.jsxs(ar,{placement:"bottom-start",children:[s.jsx(Zt,{as:ie,className:"toc-tools-button","aria-label":e.formatMessage({id:"toolsLabel"}),borderRadius:"full",iconSpacing:0,padding:3,variant:"ghost",leftIcon:s.jsx(Ie,{})}),s.jsx(Ae,{children:s.jsxs(Qt,{className:"tools-menu",children:[n&&s.jsx(ve,{"aria-label":e.formatMessage({id:"tools.hideAllLayers"}),onClick:()=>{to(r)},children:e.formatMessage({id:"tools.hideAllLayers"})}),a&&s.jsx(ve,{"aria-label":e.formatMessage({id:"tools.collapseAllGroups"}),onClick:()=>{ro(o)},children:e.formatMessage({id:"tools.collapseAllGroups"})})]})})]})})};function to(t){const e=r=>{r.setVisible(!1);const o=r.children?.getItems();if(o)for(const n of o)e(n)};t?.layers.getOperationalLayers().forEach(r=>{e(r)})}function ro(t){t&&t.getAllExpandedStates().forEach(e=>e.setExpanded(!1))}const Oe=2,vo=t=>{const e=Z(),{showTools:r=!1,toolsConfig:o,showBasemapSwitcher:n=!0,basemapSwitcherProps:a,collapsibleGroups:l=!1,autoShowParents:m=!0}=t,{containerProps:p}=Ne("toc",t),c=i.useId(),f=i.useMemo(()=>({autoShowParents:m,collapsibleGroups:l}),[m,l]),y=Ft(t),[x,v]=i.useState(),S=i.useCallback(g=>{g&&v(g.listItemsExpandedModel)},[]),w=o?o.showCollapseAllGroups&&f.collapsibleGroups:f.collapsibleGroups;let u;switch(y.kind){case"loading":u=null;break;case"rejected":u=s.jsx(se,{className:"toc-error",children:e.formatMessage({id:"error"})});break;case"resolved":{const g=y.map,O=n&&s.jsx(H,{className:"toc-basemap-switcher",children:s.jsx(Pe,{title:s.jsx(xe,{id:c,size:"sm",mb:Oe,children:e.formatMessage({id:"basemapsLabel"})}),children:s.jsx(zt,{map:g,"aria-labelledby":c,...a})})}),G=s.jsx(H,{className:"toc-operational-layers",children:s.jsx(Pe,{title:s.jsx(xe,{size:"sm",mb:2,children:s.jsxs(ne,{children:[s.jsx(se,{my:3,children:e.formatMessage({id:"operationalLayerLabel"})}),s.jsx(Re,{}),r&&s.jsx(eo,{map:g,listItemsExpandedModel:x,showHideAllLayers:o?.showHideAllLayers,showCollapseAllGroups:w})]})}),children:s.jsx(Ze,{map:g,"aria-label":e.formatMessage({id:"operationalLayerLabel"}),ref:S})})});u=s.jsxs(s.Fragment,{children:[O,G]});break}}return s.jsx(ne,{...p,direction:"column",gap:Oe,children:s.jsx(Wr,{value:f,children:u})})};export{Jr as C,Cr as F,Po as G,De as P,xo as T,$e as a,ze as b,He as c,Ue as d,vo as e,bo as i,le as t,N as u}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CZ0KYiWqoLMD.js b/openlayers-base-packages/pr-previews/pr-377/assets/CZ0KYiWqoLMD.js deleted file mode 100644 index 5ecbfb2..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CZ0KYiWqoLMD.js +++ /dev/null @@ -1,19 +0,0 @@ -import{a as Ki,j as Y,B as yn,V as Ji,f as Yi}from"./DbBkdn6FNbgs.js";import{t as Qi}from"./CFax2WnWeOWk.js";import{n as ti,o as eo,p as ye,q as to,s as V,t as ro,v as no,x as je,y as ri,z as lt,A as io,B as Re,E as oo,G as ao,I as so,J as lo,K as uo,L as ni,N as ii,P as er,Q as co,R as po,U as gn,W as fo,X as ho,Y as tr,Z as mo,_ as xn,$ as bn,a0 as yo,a1 as go,a2 as xo,a3 as bo,a4 as vo,a5 as Tt,a6 as wo,a7 as oi,a8 as jr,a9 as Tr,aa as ai,ab as To,ac as ko,ad as zo,ae as So,af as Xe,ag as Fo,ah as Eo,ai as Co,aj as Io,ak as kr,al as _o,am as Po,an as Ro,a as zr,ao as Mo,ap as Mt,aq as Ao,ar as si,as as Do,at as jo,au as Lo,av as $o,aw as Oo,ax as st,F as Ge,ay as qo,b as rr,az as Go,aA as Vo,c as Ee,aB as vn,C as li,aC as No,aD as wn,S as it,T as Uo,O as Bo,H as Zo,M as Ho,u as Xo,k as nr,g as Tn,h as kn,l as Wo,m as ir}from"./DyxVjgSvwe-K.js";import{F as Ko,t as Jo,G as zn,e as Yo}from"./Djes_egHqOHx.js";import{L as Qo}from"./D8JwQmCkwKBk.js";import{M as ea,a as ta,b as ra}from"./jRJMM4_GqJDc.js";import{V as na,S as ia,I as oa,Z as aa,a as sa}from"./BUqsBljB9Wju.js";import{_ as Sn}from"./CmsKOCeNyeyo.js";import{T as or}from"./CL68Tre-iuri.js";import"./nEjnOjKmH1UU.js";import"./CCXTS-icusD6.js";import"./CwYOJLhODXKJ.js";import"./35mnA9_wxNJd.js";import"./DnYPVZQRsXfx.js";import"./B_KTQkWPSzAO.js";import"./DjAArQ67Dgmx.js";import"./Ca8Zt9kwahLC.js";import"./B6P_btgblpGb.js";const Fn=[];class la extends ti{constructor(e,t,n,i,o){super(e,t,{transition:0}),this.context_=null,this.executorGroups=[],this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=i.bind(void 0,this),this.removeSourceTiles_=o,this.wrappedTileCoord=n}getContext(){return this.context_||(this.context_=eo(1,1,Fn)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){const t=ye(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&(to(this.context_),Fn.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let ui=class extends ti{constructor(e,t,n,i,o,a){super(e,t,a),this.extent=null,this.format_=i,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=o,this.url_=n,this.key=n}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==V.IDLE&&(this.setState(V.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(V.ERROR)}setFeatures(e){this.features_=e,this.setState(V.LOADED)}setLoader(e){this.loader_=e}};const ua={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},En={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class ca extends ro{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=no(),this.tileClipContexts_=null}drawTile(e,t,n,i,o,a,s,l){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,n,i,o,a,s,l)}getTile(e,t,n,i){const o=this.getOrCreateTile(e,t,n,i);if(!o)return null;const s=i.viewState.resolution,l=i.viewHints;return(!(l[je.ANIMATING]||l[je.INTERACTING])||!o.wantedResolution)&&(o.wantedResolution=s),o}prepareFrame(e){const t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,n){const i=this.getLayer(),o=i.getRevision(),a=i.getRenderOrder()||null,s=e.wantedResolution,l=e.getReplayState(i);if(!l.dirty&&l.renderedResolution===s&&l.renderedRevision==o&&l.renderedRenderOrder==a)return;const u=i.getSource(),c=!!i.getDeclutter(),p=u.getTileGrid(),f=u.getTileGridForProjection(n).getTileCoordExtent(e.wrappedTileCoord),m=u.getSourceTiles(t,n,e),x=ye(i);delete e.hitDetectionImageData[x],e.executorGroups[x]=[],l.dirty=!1;for(let h=0,R=m.length;h{const I=L?t.declutter[L].all().map(A=>A.value):null;for(let A=0,j=k.length;A{const i=this.getLayer(),o=ye(i),a=i.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,c=a.getTileGridForProjection(s),p=so(this.renderedPixelToCoordinateTransform_,e.slice()),d=c.getTileCoordForCoordAndResolution(p,u);let f;for(let C=0,S=this.renderedTiles.length;C0){t([]);return}const m=c.getTileCoordExtent(f.wrappedTileCoord),x=ni(m),h=[(p[0]-x[0])/u,(x[1]-p[1])/u],R=f.getSourceTiles().reduce(function(C,S){return C.concat(S.getFeatures())},[]);let E=f.hitDetectionImageData[o];if(!E){const C=ii(c.getTileSize(c.getZForResolution(u,a.zDirection))),S=this.renderedRotation_,F=[this.getRenderTransform(c.getTileCoordCenter(f.wrappedTileCoord),u,0,er,C[0]*er,C[1]*er,0)];E=co(C,F,R,i.getStyleFunction(),c.getTileCoordExtent(f.wrappedTileCoord),f.getReplayState(i).renderedResolution,S),f.hitDetectionImageData[o]=E}t(po(h,R,E))})}getFeaturesInExtent(e){const t=[],n=this.getTileCache();if(n.getCount()===0)return t;const o=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),a=o.getZForResolution(this.renderedResolution),s={};return n.forEach(l=>{if(l.tileCoord[0]!==a||l.getState()!==V.LOADED)return;const u=l.getSourceTiles();for(let c=0,p=u.length;c=0;--f)p[f].execute(this.context,[this.context.canvas.width,this.context.canvas.height],this.getTileRenderTransform(c,e),e.viewState.rotation,a,gn,d?e.declutter[d]:void 0)}n.globalAlpha=i}renderDeferredInternal(e){const n=this.renderedTiles.reduce((s,l,u)=>(l.executorGroups[ye(this.getLayer())].forEach(c=>s.push({executorGroup:c,index:u})),s),[]),i=n.map(({executorGroup:s})=>s.getDeferredZIndexContexts()),o={};for(let s=0,l=n.length;s{i.forEach((l,u)=>{l[s]&&(l[s].forEach(c=>{const{executorGroup:p,index:d}=n[u],f=p.getRenderedContext(),m=f.globalAlpha;f.globalAlpha=this.renderedOpacity_;const x=this.tileClipContexts_[d];x&&x.draw(f),c.draw(f),x&&f.restore(),f.globalAlpha=m,c.clear()}),l[s].length=0)})})}getTileRenderTransform(e,t){const n=t.pixelRatio,i=t.viewState,o=i.center,a=i.resolution,s=i.rotation,l=t.size,u=Math.round(l[0]*n),c=Math.round(l[1]*n),d=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),f=e.tileCoord,m=d.getTileCoordExtent(e.wrappedTileCoord),x=d.getTileCoordExtent(f,this.tempExtent)[0]-m[0];return ho(tr(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(o,a,s,n,u,c,x))}postRender(e,t){const n=t.viewHints,i=!(n[je.ANIMATING]||n[je.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;const o=this.getLayer(),a=o.getRenderMode(),s=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;const l=o.getDeclutter(),u=l?En[a].filter(S=>!gn.includes(S)):En[a],c=t.viewState,p=c.rotation,d=o.getSource(),m=d.getTileGridForProjection(c.projection).getZForResolution(c.resolution,d.zDirection),x=this.renderedTiles,h=[],R=[],E=[];let C=!0;for(let S=x.length-1;S>=0;--S){const F=x[S];C=C&&!F.getReplayState(o).dirty;const L=F.executorGroups[ye(o)].filter(q=>q.hasExecutors(u));if(L.length===0)continue;const k=this.getTileRenderTransform(F,t),I=F.tileCoord[0];let A=!1;const j=L[0].getClipCoords(k);let G=e,v;if(j){v=new mo,G=v.getContext();for(let q=0,T=h.length;q{const f=this.tileUrlFunction(d,e,t);this.sourceTiles_[f]||(this.sourceTiles_[f]=new this.tileClass(d,f?V.IDLE:V.EMPTY,f,this.format_,this.tileLoadFunction));const m=this.sourceTiles_[f];n.sourceTiles.push(m),this.tileKeysBySourceTileUrl_[f]||(this.tileKeysBySourceTileUrl_[f]=[]),this.tileKeysBySourceTileUrl_[f].push(n.getKey());const x=m.getState();if(x{this.handleTileChange(R);const E=m.getState();if(E===V.LOADED||E===V.ERROR){const C=m.getKey();C in n.errorTileKeys?m.getState()===V.LOADED&&delete n.errorTileKeys[C]:n.loadingSourceTiles--,E===V.ERROR?n.errorTileKeys[C]=!0:m.removeEventListener(Tr.CHANGE,h),n.loadingSourceTiles===0&&n.setState(ko(n.errorTileKeys)?V.LOADED:V.ERROR)}};m.addEventListener(Tr.CHANGE,h),n.loadingSourceTiles++}x===V.IDLE&&(m.extent=u.getTileCoordExtent(d),m.projection=t,m.resolution=u.getResolution(d[0]),m.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(d=>d.getState()===V.ERROR)?V.ERROR:V.LOADED)}return n.sourceTiles}removeSourceTiles(e){const t=e.sourceTiles;for(let n=0,i=t.length;n{c=c&&!this.tileUrlFunction(h,i,o)})}const p=new la(a,c?V.EMPTY:V.IDLE,s,this.getSourceTiles.bind(this,i,o),this.removeSourceTiles.bind(this));return p.key=this.getKey(),p}getTileGridForProjection(e){const t=e.getCode();let n=this.tileGrids_[t];if(!n){const i=this.tileGrid,o=i.getResolutions().slice(),a=o.map(function(u,c){return i.getOrigin(c)}),s=o.map(function(u,c){return i.getTileSize(c)}),l=zo+1;for(let u=o.length;u=200&&t.status<300){let n;try{n=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(n)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){const t=Xe("EPSG:4326"),n=this.getProjection();let i;if(e.bounds!==void 0){const u=Fo(t,n);i=Eo(e.bounds,u)}const o=oi(n),a=e.minzoom||0,s=e.maxzoom||22,l=jr({extent:o,maxZoom:s,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=Co(e.tiles,l),e.attribution&&!this.getAttributions()){const u=i!==void 0?i:o;this.setAttributions(function(c){return Re(u,c.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}const Sr=65536*65536,Cn=1/Sr,fa=12,In=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),ar=0,kt=1,ot=2,zt=5;class ha{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,n=this.length){for(;this.pos>3,a=this.pos;this.type=i&7,e(o,t,this),this.pos===a&&this.skip(i)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Sr;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Sr;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let n,i;return i=t[this.pos++],n=i&127,i<128||(i=t[this.pos++],n|=(i&127)<<7,i<128)||(i=t[this.pos++],n|=(i&127)<<14,i<128)||(i=t[this.pos++],n|=(i&127)<<21,i<128)?n:(i=t[this.pos],n|=(i&15)<<28,ma(n,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=fa&&In?In.decode(this.buf.subarray(t,e)):Ca(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const n=this.readPackedEnd();for(;this.pos127;);else if(t===ot)this.pos=this.readVarint()+this.pos;else if(t===zt)this.pos+=4;else if(t===kt)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t268435455||e<0){ya(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;const t=this.pos;this.pos=Ia(this.buf,e,this.pos);const n=this.pos-t;n>=128&&_n(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let n=0;n=128&&_n(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeMessage(e,t,n){this.writeTag(e,ot),this.writeRawMessage(t,n)}writePackedVarint(e,t){t.length&&this.writeMessage(e,ba,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,va,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,ka,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,wa,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Ta,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,za,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Sa,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Fa,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Ea,t)}writeBytesField(e,t){this.writeTag(e,ot),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,zt),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,zt),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,kt),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,kt),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,ar),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,ar),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,ot),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,zt),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,kt),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function ma(r,e,t){const n=t.buf;let i,o;if(o=n[t.pos++],i=(o&112)>>4,o<128||(o=n[t.pos++],i|=(o&127)<<3,o<128)||(o=n[t.pos++],i|=(o&127)<<10,o<128)||(o=n[t.pos++],i|=(o&127)<<17,o<128)||(o=n[t.pos++],i|=(o&127)<<24,o<128)||(o=n[t.pos++],i|=(o&1)<<31,o<128))return Le(r,i,e);throw new Error("Expected varint not more than 10 bytes")}function Le(r,e,t){return t?e*4294967296+(r>>>0):(e>>>0)*4294967296+(r>>>0)}function ya(r,e){let t,n;if(r>=0?(t=r%4294967296|0,n=r/4294967296|0):(t=~(-r%4294967296),n=~(-r/4294967296),t^4294967295?t=t+1|0:(t=0,n=n+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),ga(t,n,e),xa(n,e)}function ga(r,e,t){t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos]=r&127}function xa(r,e){const t=(r&7)<<4;e.buf[e.pos++]|=t|((r>>>=3)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127)))))}function _n(r,e,t){const n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(n);for(let i=t.pos-1;i>=r;i--)t.buf[i+n]=t.buf[i]}function ba(r,e){for(let t=0;t239?4:o>223?3:o>191?2:1;if(i+s>t)break;let l,u,c;s===1?o<128&&(a=o):s===2?(l=r[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=r[i+1],u=r[i+2],(l&192)===128&&(u&192)===128&&(a=(o&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=r[i+1],u=r[i+2],c=r[i+3],(l&192)===128&&(u&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function Ia(r,e,t){for(let n=0,i,o;n55295&&i<57344)if(o)if(i<56320){r[t++]=239,r[t++]=191,r[t++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(r[t++]=239,r[t++]=191,r[t++]=189):o=i;continue}else o&&(r[t++]=239,r[t++]=191,r[t++]=189,o=null);i<128?r[t++]=i:(i<2048?r[t++]=i>>6|192:(i<65536?r[t++]=i>>12|224:(r[t++]=i>>18|240,r[t++]=i>>12&63|128),r[t++]=i>>6&63|128),r[t++]=i&63|128)}return t}class $r extends Ko{constructor(e){super(),e=e||{},this.dataProjection=new Io({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:kr,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.idProperty_=e.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,n,i){e.pos=t.geometry;const o=e.readVarint()+e.pos;let a=1,s=0,l=0,u=0,c=0,p=0;for(;e.pos>3}if(s--,a===1||a===2)l+=e.readSVarint(),u+=e.readSVarint(),a===1&&c>p&&(i.push(c),p=c),n.push(l,u),c+=2;else if(a===7)c>p&&(n.push(n[p],n[p+1]),c+=2);else throw new Error("Invalid command found in the PBF")}c>p&&(i.push(c),p=c)}createFeature_(e,t,n){const i=t.type;if(i===0)return null;let o;const a=t.properties;let s;this.idProperty_?(s=a[this.idProperty_],delete a[this.idProperty_]):s=t.id,a[this.layerName_]=t.layer.name;const l=[],u=[];this.readRawGeometry_(e,t,l,u);const c=Aa(i,u.length);if(this.featureClass===kr)o=new this.featureClass(c,l,u,2,a,s),o.transform(n.dataProjection);else{let p;if(c=="Polygon"){const m=_o(l,u);p=m.length>1?new ea(l,"XY",m):new Po(l,"XY",u)}else p=c==="Point"?new Ro(l,"XY"):c==="LineString"?new Qo(l,"XY"):c==="MultiPoint"?new ta(l,"XY"):c==="MultiLineString"?new ra(l,"XY",u):null;const d=this.featureClass;o=new d,this.geometryName_&&o.setGeometryName(this.geometryName_);const f=Jo(p,!1,n);o.setGeometry(f),s!==void 0&&o.setId(s),o.setProperties(a,!0)}return o}getType(){return"arraybuffer"}readFeatures(e,t){const n=this.layers_;t=this.adaptOptions(t);const i=Xe(t.dataProjection);i.setWorldExtent(t.extent),t.dataProjection=i;const o=new ha(e),a=o.readFields(_a,{}),s=[];for(const l in a){if(n&&!n.includes(l))continue;const u=a[l],c=u?[0,0,u.extent,u.extent]:null;i.setExtent(c);for(let p=0,d=u.length;p>3,n=r===1?t.readString():r===2?t.readFloat():r===3?t.readDouble():r===4?t.readVarint64():r===5?t.readVarint():r===6?t.readSVarint():r===7?t.readBoolean():null;e.values.push(n)}}function Ra(r,e,t){if(r==1)e.id=t.readVarint();else if(r==2){const n=t.readVarint()+t.pos;for(;t.pos255?255:r}function Rn(r){return r<0?0:r>1?1:r}function sr(r){return r[r.length-1]==="%"?ct(parseFloat(r)/100*255):ct(parseInt(r))}function St(r){return r[r.length-1]==="%"?Rn(parseFloat(r)/100):Rn(parseFloat(r))}function lr(r,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?r+(e-r)*t*6:t*2<1?e:t*3<2?r+(e-r)*(2/3-t)*6:r}function ja(r){var e=r.replace(/ /g,"").toLowerCase();if(e in Pn)return Pn[e].slice();if(e[0]==="#"){if(e.length===4){var t=parseInt(e.substr(1),16);return t>=0&&t<=4095?[(t&3840)>>4|(t&3840)>>8,t&240|(t&240)>>4,t&15|(t&15)<<4,1]:null}else if(e.length===7){var t=parseInt(e.substr(1),16);return t>=0&&t<=16777215?[(t&16711680)>>16,(t&65280)>>8,t&255,1]:null}return null}var n=e.indexOf("("),i=e.indexOf(")");if(n!==-1&&i+1===e.length){var o=e.substr(0,n),a=e.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(a.length!==4)return null;s=St(a.pop());case"rgb":return a.length!==3?null:[sr(a[0]),sr(a[1]),sr(a[2]),s];case"hsla":if(a.length!==4)return null;s=St(a.pop());case"hsl":if(a.length!==3)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=St(a[1]),c=St(a[2]),p=c<=.5?c*(u+1):c+u-c*u,d=c*2-p;return[ct(lr(d,p,l+1/3)*255),ct(lr(d,p,l)*255),ct(lr(d,p,l-1/3)*255),s];default:return null}}return null}try{di=Da.parseCSSColor=ja}catch{}class ae{constructor(e,t,n,i=1){this.r=e,this.g=t,this.b=n,this.a=i}static parse(e){if(!e)return;if(e instanceof ae)return e;if(typeof e!="string")return;const t=di(e);if(t)return new ae(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}toString(){const[e,t,n,i]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(n)},${i})`}toArray(){const{r:e,g:t,b:n,a:i}=this;return i===0?[0,0,0,0]:[e*255/i,t*255/i,n*255/i,i]}toArray01(){const{r:e,g:t,b:n,a:i}=this;return i===0?[0,0,0,0]:[e/i,t/i,n/i,i]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:n,a:i}=this;return[e,t,n,i]}}ae.black=new ae(0,0,0,1);ae.white=new ae(1,1,1,1);ae.transparent=new ae(0,0,0,0);ae.red=new ae(1,0,0,1);ae.blue=new ae(0,0,1,1);var ue=ae;function ft(r){return typeof r=="object"?["literal",r]:r}function La(r,e){let t=r.stops;if(!t)return $a(r,e);const n=t&&typeof t[0][0]=="object",i=n||r.property!==void 0,o=n||!i;return t=t.map(a=>!i&&e.tokens&&typeof a[1]=="string"?[a[0],Va(a[1])]:[a[0],ft(a[1])]),n?Oa(r,e,t):o?Ga(r,e,t):Fr(r,e,t)}function $a(r,e){const t=["get",r.property];if(r.default===void 0)return e.type==="string"?["string",t]:t;if(e.type==="enum")return["match",t,Object.keys(e.values),t,r.default];{const n=[e.type==="color"?"to-color":e.type,t,ft(r.default)];return e.type==="array"&&n.splice(1,0,e.value,e.length||null),n}}function Or(r){switch(r.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Oa(r,e,t){const n={},i={},o=[];for(let s=0;s3&&e===r[r.length-2]||(n&&r.length===2||r.push(e),r.push(t))}function Gr(r,e){return r.type?r.type:e.expression.interpolated?"exponential":"interval"}function Va(r){const e=["concat"],t=/{([^{}]+)}/g;let n=0;for(let i=t.exec(r);i!==null;i=t.exec(r)){const o=r.slice(n,t.lastIndex-i[0].length);n=t.lastIndex,o.length>0&&e.push(o),e.push(["get",i[1]])}if(e.length===1)return r;if(n`:r.itemType.kind==="value"?"array":`array<${e}>`}else return r.kind}const Za=[Nt,y,M,_,ze,Bt,Be,me(P),yt];function ht(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!ht(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(const t of Za)if(!ht(t,e))return null}}return`Expected ${B(r)} but found ${B(e)} instead.`}function Nr(r,e){return e.some(t=>t.kind===r.kind)}function mt(r,e){return e.some(t=>t==="null"?r===null:t==="array"?Array.isArray(r):t==="object"?r&&!Array.isArray(r)&&typeof r=="object":t===typeof r)}class Ur{constructor(e,t,n){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Er{constructor(e,t,n,i,o){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=n,this.fontStack=i,this.textColor=o}}class ve{constructor(e){this.sections=e}static fromString(e){return new ve([new Er(e,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof ve?e:ve.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const n={};t.fontStack&&(n["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(n["font-scale"]=t.scale),t.textColor&&(n["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(n)}return e}}class Ie{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Ie({name:e,available:!1}):null}serialize(){return["image",this.name]}}function fi(r,e,t,n){return typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255?typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[r,e,t,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[r,e,t,n]:[r,e,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function At(r){if(r===null)return!0;if(typeof r=="string")return!0;if(typeof r=="boolean")return!0;if(typeof r=="number")return!0;if(r instanceof ue)return!0;if(r instanceof Ur)return!0;if(r instanceof ve)return!0;if(r instanceof Ie)return!0;if(Array.isArray(r)){for(const e of r)if(!At(e))return!1;return!0}else if(typeof r=="object"){for(const e in r)if(!At(r[e]))return!1;return!0}else return!1}function Q(r){if(r===null)return Nt;if(typeof r=="string")return M;if(typeof r=="boolean")return _;if(typeof r=="number")return y;if(r instanceof ue)return ze;if(r instanceof Ur)return Ut;if(r instanceof ve)return Bt;if(r instanceof Ie)return yt;if(Array.isArray(r)){const e=r.length;let t;for(const n of r){const i=Q(n);if(!t)t=i;else{if(t===i)continue;t=P;break}}return me(t||P,e)}else return Be}function pt(r){const e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof ue||r instanceof ve||r instanceof Ie?r.toString():JSON.stringify(r)}class Br{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!At(e[1]))return t.error("invalid value");const n=e[1];let i=Q(n);const o=t.expectedType;return i.kind==="array"&&i.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(i=o),new Br(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof ue?["rgba"].concat(this.value.toArray()):this.value instanceof ve?this.value.serialize():this.value}}var Dt=Br;class Ha{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}var te=Ha;const ur={string:M,number:y,boolean:_,object:Be};class Zr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let n=1,i;const o=e[0];if(o==="array"){let s;if(e.length>2){const u=e[1];if(typeof u!="string"||!(u in ur)||u==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);s=ur[u],n++}else s=P;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);l=e[2],n++}i=me(s,l)}else i=ur[o];const a=[];for(;ne.outputDefined())}serialize(){const e=this.type,t=[e.kind];if(e.kind==="array"){const n=e.itemType;if(n.kind==="string"||n.kind==="number"||n.kind==="boolean"){t.push(n.kind);const i=e.N;(typeof i=="number"||this.args.length>1)&&t.push(i)}}return t.concat(this.args.map(n=>n.serialize()))}}var ke=Zr;class Zt{constructor(e){this.type=Bt,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&typeof n=="object")return t.error("First argument must be an image or text section.");const i=[];let o=!1;for(let a=1;a<=e.length-1;++a){const s=e[a];if(o&&typeof s=="object"&&!Array.isArray(s)){o=!1;let l=null;if(s["font-scale"]&&(l=t.parse(s["font-scale"],1,y),!l))return null;let u=null;if(s["text-font"]&&(u=t.parse(s["text-font"],1,me(M)),!u))return null;let c=null;if(s["text-color"]&&(c=t.parse(s["text-color"],1,ze),!c))return null;const p=i[i.length-1];p.scale=l,p.font=u,p.textColor=c}else{const l=t.parse(e[a],1,P);if(!l)return null;const u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,i.push({content:l,scale:null,font:null,textColor:null})}}return new Zt(i)}evaluate(e){const t=n=>{const i=n.content.evaluate(e);return Q(i)===yt?new Er("",i,null,null,null):new Er(pt(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null)};return new ve(this.sections.map(t))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const n={};t.scale&&(n["font-scale"]=t.scale.serialize()),t.font&&(n["text-font"]=t.font.serialize()),t.textColor&&(n["text-color"]=t.textColor.serialize()),e.push(n)}return e}}class Ht{constructor(e){this.type=yt,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const n=t.parse(e[1],1,M);return n?new Ht(n):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),n=Ie.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Xa={"to-boolean":_,"to-color":ze,"to-number":y,"to-string":M};class Hr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[0];if((n==="to-boolean"||n==="to-string")&&e.length!==2)return t.error("Expected one argument.");const i=Xa[n],o=[];for(let a=1;a4?n=`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:n=fi(t[0],t[1],t[2],t[3]),!n))return new ue(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new te(n||`Could not parse color from value '${typeof t=="string"?t:String(JSON.stringify(t))}'`)}else if(this.type.kind==="number"){let t=null;for(const n of this.args){if(t=n.evaluate(e),t===null)return 0;const i=Number(t);if(!isNaN(i))return i}throw new te(`Could not convert ${JSON.stringify(t)} to number.`)}else return this.type.kind==="formatted"?ve.fromString(pt(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Ie.fromString(pt(this.args[0].evaluate(e))):pt(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Zt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ht(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(t=>{e.push(t.serialize())}),e}}var Ve=Hr;const Wa=["Unknown","Point","LineString","Polygon"];class Ka{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Wa[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:n,y:i}=this.featureTileCoord,o=n*t-e[0],a=i*t-e[1],s=this.featureDistanceData.bearing[0],l=this.featureDistanceData.bearing[1];return s*o+l*a}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=ue.parse(e)),t}}var hi=Ka;class Ne{constructor(e,t,n,i){this.name=e,this.type=t,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,t){const n=e[0],i=Ne.definitions[n];if(!i)return t.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter(([u])=>!Array.isArray(u)||u.length===e.length-1);let l=null;for(const[u,c]of s){l=new bi(t.registry,t.path,null,t.scope);const p=[];let d=!1;for(let f=1;fJa(d)).join(" | "),p=[];for(let d=1;d=e[2]||r[1]<=e[1]||r[3]>=e[3])}function es(r,e){const t=Ya(r[0]),n=Qa(r[1]),i=Math.pow(2,e.z);return[Math.round(t*i*Ce),Math.round(n*i*Ce)]}function ts(r,e,t){const n=r[0]-e[0],i=r[1]-e[1],o=r[0]-t[0],a=r[1]-t[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}function rs(r,e,t){return e[1]>r[1]!=t[1]>r[1]&&r[0]<(t[0]-e[0])*(r[1]-e[1])/(t[1]-e[1])+e[0]}function Wr(r,e){let t=!1;for(let n=0,i=e.length;n0&&p<0||c<0&&p>0}function os(r,e,t,n){const i=[e[0]-r[0],e[1]-r[1]],o=[n[0]-t[0],n[1]-t[1]];return is(o,i)===0?!1:!!(An(r,e,t,n)&&An(t,n,r,e))}function as(r,e,t){for(const n of t)for(let i=0;it[2]){const i=n*.5;let o=r[0]-t[0]>i?-n:t[0]-r[0]>i?n:0;o===0&&(o=r[0]-t[2]>i?-n:t[2]-r[0]>i?n:0),r[0]+=o}Xr(e,r)}function ls(r){r[0]=r[1]=1/0,r[2]=r[3]=-1/0}function Dn(r,e,t,n){const i=Math.pow(2,n.z)*Ce,o=[n.x*Ce,n.y*Ce],a=[];if(!r)return a;for(const s of r)for(const l of s){const u=[l.x+o[0],l.y+o[1]];gi(u,e,t,i),a.push(u)}return a}function jn(r,e,t,n){const i=Math.pow(2,n.z)*Ce,o=[n.x*Ce,n.y*Ce],a=[];if(!r)return a;for(const s of r){const l=[];for(const u of s){const c=[u.x+o[0],u.y+o[1]];Xr(e,c),l.push(c)}a.push(l)}if(e[2]-e[0]<=i/2){ls(e);for(const s of a)for(const l of s)gi(l,e,t,i)}return a}function us(r,e){const t=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=r.canonicalID();if(!i)return!1;if(e.type==="Polygon"){const o=Kr(e.coordinates,n,i),a=Dn(r.geometry(),t,n,i);if(!jt(t,n))return!1;for(const s of a)if(!Wr(s,o))return!1}if(e.type==="MultiPolygon"){const o=yi(e.coordinates,n,i),a=Dn(r.geometry(),t,n,i);if(!jt(t,n))return!1;for(const s of a)if(!ns(s,o))return!1}return!0}function cs(r,e){const t=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=r.canonicalID();if(!i)return!1;if(e.type==="Polygon"){const o=Kr(e.coordinates,n,i),a=jn(r.geometry(),t,n,i);if(!jt(t,n))return!1;for(const s of a)if(!mi(s,o))return!1}if(e.type==="MultiPolygon"){const o=yi(e.coordinates,n,i),a=jn(r.geometry(),t,n,i);if(!jt(t,n))return!1;for(const s of a)if(!ss(s,o))return!1}return!0}class dt{constructor(e,t){this.type=_,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(At(e[1])){const n=e[1];if(n.type==="FeatureCollection")for(let i=0;i{e&&!Wt(t)&&(e=!1)}),e}function Yr(r){if(r instanceof Ke&&r.name==="feature-state")return!1;let e=!0;return r.eachChild(t=>{e&&!Yr(t)&&(e=!1)}),e}function Qr(r,e){if(r instanceof Ke&&e.indexOf(r.name)>=0)return!1;let t=!0;return r.eachChild(n=>{t&&!Qr(n,e)&&(t=!1)}),t}class en{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");const n=e[1];return t.scope.has(n)?new en(n,t.scope.get(n)):t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var xi=en;class tn{constructor(e,t=[],n,i=new Ua,o=[]){this.registry=e,this.path=t,this.key=t.map(a=>`[${a}]`).join(""),this.scope=i,this.errors=o,this.expectedType=n}parse(e,t,n,i,o={}){return t?this.concat(t,n,i)._parse(e,o):this._parse(e,o)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,o,a){return a==="assert"?new ke(o,[i]):a==="coerce"?new Ve(o,[i]):i}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=e[0];if(typeof i!="string")return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[i];if(o){let a=o.parse(e,this);if(!a)return null;if(this.expectedType){const s=this.expectedType,l=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&l.kind==="value")a=n(a,s,t.typeAnnotation||"assert");else if((s.kind==="color"||s.kind==="formatted"||s.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))a=n(a,s,t.typeAnnotation||"coerce");else if(this.checkSubtype(s,l))return null}if(!(a instanceof Dt)&&a.type.kind!=="resolvedImage"&&Cr(a)){const s=new hi;try{a=new Dt(a.type,a.evaluate(s))}catch(l){return this.error(l.message),null}}return a}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,n){const i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new tn(this.registry,i,t||null,o,this.errors)}error(e,...t){const n=`${this.key}${t.map(i=>`[${i}]`).join("")}`;this.errors.push(new be(n,e))}checkSubtype(e,t){const n=ht(e,t);return n&&this.error(n),n}}var bi=tn;function Cr(r){if(r instanceof xi)return Cr(r.boundExpression);if(r instanceof Ke&&r.name==="error")return!1;if(r instanceof Xt)return!1;if(r instanceof Jr)return!1;const e=r instanceof Ve||r instanceof ke;let t=!0;return r.eachChild(n=>{e?t=t&&Cr(n):t=t&&n instanceof Dt}),t?Wt(r)&&Qr(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]):!1}function vi(r,e){const t=r.length-1;let n=0,i=t,o=0,a,s;for(;n<=i;)if(o=Math.floor((n+i)/2),a=r[o],s=r[o+1],a<=e){if(o===t||ee)i=o-1;else throw new te("Input is not a number.");return 0}class rn{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[i,o]of n)this.labels.push(i),this.outputs.push(o)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");const n=t.parse(e[1],1,y);if(!n)return null;const i=[];let o=null;t.expectedType&&t.expectedType.kind!=="value"&&(o=t.expectedType);for(let a=1;a=s)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);const p=t.parse(l,c,o);if(!p)return null;o=o||p.type,i.push([s,p])}return new rn(o,n,i)}evaluate(e){const t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return n[0].evaluate(e);const o=t.length;if(i>=t[o-1])return n[o-1].evaluate(e);const a=vi(t,i);return n[a].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let t=0;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var wi=rn,ps=Je;function Je(r,e,t,n){this.cx=3*r,this.bx=3*(t-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=n,this.p2x=t,this.p2y=n}Je.prototype.sampleCurveX=function(r){return((this.ax*r+this.bx)*r+this.cx)*r};Je.prototype.sampleCurveY=function(r){return((this.ay*r+this.by)*r+this.cy)*r};Je.prototype.sampleCurveDerivativeX=function(r){return(3*this.ax*r+2*this.bx)*r+this.cx};Je.prototype.solveCurveX=function(r,e){typeof e>"u"&&(e=1e-6);var t,n,i,o,a;for(i=r,a=0;a<8;a++){if(o=this.sampleCurveX(i)-r,Math.abs(o)n)return n;for(;to?t=i:n=i,i=(n-t)*.5+t}return i};Je.prototype.solve=function(r,e){return this.sampleCurveY(this.solveCurveX(r,e))};var ds=pi(ps);function le(r,e,t){return r*(1-t)+e*t}function fs(r,e,t){return new ue(le(r.r,e.r,t),le(r.g,e.g,t),le(r.b,e.b,t),le(r.a,e.a,t))}function hs(r,e,t){return r.map((n,i)=>le(n,e[i],t))}var ms=Object.freeze({__proto__:null,number:le,color:fs,array:hs});const Ti=.95047,ki=1,zi=1.08883,Si=4/29,Ze=6/29,Fi=3*Ze*Ze,ys=Ze*Ze*Ze,gs=Math.PI/180,xs=180/Math.PI;function cr(r){return r>ys?Math.pow(r,1/3):r/Fi+Si}function pr(r){return r>Ze?r*r*r:Fi*(r-Si)}function dr(r){return 255*(r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055)}function fr(r){return r/=255,r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function Ei(r){const e=fr(r.r),t=fr(r.g),n=fr(r.b),i=cr((.4124564*e+.3575761*t+.1804375*n)/Ti),o=cr((.2126729*e+.7151522*t+.072175*n)/ki),a=cr((.0193339*e+.119192*t+.9503041*n)/zi);return{l:116*o-16,a:500*(i-o),b:200*(o-a),alpha:r.a}}function Ci(r){let e=(r.l+16)/116,t=isNaN(r.a)?e:e+r.a/500,n=isNaN(r.b)?e:e-r.b/200;return e=ki*pr(e),t=Ti*pr(t),n=zi*pr(n),new ue(dr(3.2404542*t-1.5371385*e-.4985314*n),dr(-.969266*t+1.8760108*e+.041556*n),dr(.0556434*t-.2040259*e+1.0572252*n),r.alpha)}function bs(r,e,t){return{l:le(r.l,e.l,t),a:le(r.a,e.a,t),b:le(r.b,e.b,t),alpha:le(r.alpha,e.alpha,t)}}function vs(r){const{l:e,a:t,b:n}=Ei(r),i=Math.atan2(n,t)*xs;return{h:i<0?i+360:i,c:Math.sqrt(t*t+n*n),l:e,alpha:r.a}}function ws(r){const e=r.h*gs,t=r.c,n=r.l;return Ci({l:n,a:Math.cos(e)*t,b:Math.sin(e)*t,alpha:r.alpha})}function Ts(r,e,t){const n=e-r;return r+t*(n>180||n<-180?n-360*Math.round(n/360):n)}function ks(r,e,t){return{h:Ts(r.h,e.h,t),c:le(r.c,e.c,t),l:le(r.l,e.l,t),alpha:le(r.alpha,e.alpha,t)}}const Ft={forward:Ei,reverse:Ci,interpolate:bs},Et={forward:vs,reverse:ws,interpolate:ks};class Lt{constructor(e,t,n,i,o){this.type=e,this.operator=t,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(const[a,s]of o)this.labels.push(a),this.outputs.push(s)}static interpolationFactor(e,t,n,i){let o=0;if(e.name==="exponential")o=hr(t,e.base,n,i);else if(e.name==="linear")o=hr(t,1,n,i);else if(e.name==="cubic-bezier"){const a=e.controlPoints;o=new ds(a[0],a[1],a[2],a[3]).solve(hr(t,1,n,i))}return o}static parse(e,t){let[n,i,o,...a]=e;if(!Array.isArray(i)||i.length===0)return t.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){const u=i[1];if(typeof u!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:u}}else if(i[0]==="cubic-bezier"){const u=i.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:u}}else return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,y),!o)return null;const s=[];let l=null;n==="interpolate-hcl"||n==="interpolate-lab"?l=ze:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let u=0;u=c)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);const m=t.parse(p,f,l);if(!m)return null;l=l||m.type,s.push([c,m])}return l.kind!=="number"&&l.kind!=="color"&&!(l.kind==="array"&&l.itemType.kind==="number"&&typeof l.N=="number")?t.error(`Type ${B(l)} is not interpolatable.`):new Lt(l,n,i,o,s)}evaluate(e){const t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return n[0].evaluate(e);const o=t.length;if(i>=t[o-1])return n[o-1].evaluate(e);const a=vi(t,i),s=t[a],l=t[a+1],u=Lt.interpolationFactor(this.interpolation,i,s,l),c=n[a].evaluate(e),p=n[a+1].evaluate(e);return this.operator==="interpolate"?ms[this.type.kind.toLowerCase()](c,p,u):this.operator==="interpolate-hcl"?Et.reverse(Et.interpolate(Et.forward(c),Et.forward(p),u)):Ft.reverse(Ft.interpolate(Ft.forward(c),Ft.forward(p),u))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;this.interpolation.name==="linear"?e=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?e=["linear"]:e=["exponential",this.interpolation.base]:e=["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let n=0;nht(i,s.type))?new $t(P,o):new $t(n,o)}evaluate(e){let t=null,n=0,i;for(const o of this.args){if(n++,t=o.evaluate(e),t&&t instanceof Ie&&!t.available&&(i||(i=t),t=null,n===this.args.length))return i;if(t!==null)break}return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(t=>{e.push(t.serialize())}),e}}var Ii=$t;class nn{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let o=1;o=n.length)throw new te(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new te(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var zs=on;class an{constructor(e,t){this.type=_,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,P),i=t.parse(e[2],2,P);return!n||!i?null:Nr(n.type,[_,M,y,Nt,P])?new an(n,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${B(n.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(n==null)return!1;if(!mt(t,["boolean","string","number","null"]))throw new te(`Expected first argument to be of type boolean, string, number or null, but found ${B(Q(t))} instead.`);if(!mt(n,["string","array"]))throw new te(`Expected second argument to be of type array or string, but found ${B(Q(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ss=an;class Ot{constructor(e,t,n){this.type=y,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,P),i=t.parse(e[2],2,P);if(!n||!i)return null;if(!Nr(n.type,[_,M,y,Nt,P]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${B(n.type)} instead`);if(e.length===4){const o=t.parse(e[3],3,y);return o?new Ot(n,i,o):null}else return new Ot(n,i)}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!mt(t,["boolean","string","number","null"]))throw new te(`Expected first argument to be of type boolean, string, number or null, but found ${B(Q(t))} instead.`);if(!mt(n,["string","array"]))throw new te(`Expected second argument to be of type array or string, but found ${B(Q(n))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(e);return n.indexOf(t,i)}return n.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Fs=Ot;class sn{constructor(e,t,n,i,o,a){this.inputType=e,this.type=t,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return t.error("Expected an even number of arguments.");let n,i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);const o={},a=[];for(let u=2;uNumber.MAX_SAFE_INTEGER)return d.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof m=="number"&&Math.floor(m)!==m)return d.error("Numeric branch labels must be integer values.");if(!n)n=Q(m);else if(d.checkSubtype(n,Q(m)))return null;if(typeof o[String(m)]<"u")return d.error("Branch labels must be unique.");o[String(m)]=a.length}const f=t.parse(p,u,i);if(!f)return null;i=i||f.type,a.push(f)}const s=t.parse(e[1],1,P);if(!s)return null;const l=t.parse(e[e.length-1],e.length-1,i);return!l||s.type.kind!=="value"&&t.concat(1).checkSubtype(n,s.type)?null:new sn(n,i,s,o,a,l)}evaluate(e){const t=this.input.evaluate(e);return(Q(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),n=[],i={};for(const a of t){const s=i[this.cases[a]];s===void 0?(i[this.cases[a]]=n.length,n.push([this.cases[a],[a]])):n[s][1].push(a)}const o=a=>this.inputType.kind==="number"?Number(a):a;for(const[a,s]of n)s.length===1?e.push(o(s[0])):e.push(s.map(o)),e.push(this.outputs[a].serialize());return e.push(this.otherwise.serialize()),e}}var Es=sn;class ln{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let n;t.expectedType&&t.expectedType.kind!=="value"&&(n=t.expectedType);const i=[];for(let a=1;at.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(t=>{e.push(t.serialize())}),e}}var Cs=ln;class qt{constructor(e,t,n,i){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,P),i=t.parse(e[2],2,y);if(!n||!i)return null;if(!Nr(n.type,[me(P),M,P]))return t.error(`Expected first argument to be of type array or string, but found ${B(n.type)} instead`);if(e.length===4){const o=t.parse(e[3],3,y);return o?new qt(n.type,n,i,o):null}else return new qt(n.type,n,i)}evaluate(e){const t=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!mt(t,["string","array"]))throw new te(`Expected first argument to be of type array or string, but found ${B(Q(t))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(e);return t.slice(n,i)}return t.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Is=qt;function Ln(r,e){return r==="=="||r==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function _s(r,e,t){return e===t}function Ps(r,e,t){return e!==t}function Rs(r,e,t){return et}function As(r,e,t){return e<=t}function Ds(r,e,t){return e>=t}function Pi(r,e,t,n){return n.compare(e,t)===0}function js(r,e,t,n){return!Pi(r,e,t,n)}function Ls(r,e,t,n){return n.compare(e,t)<0}function $s(r,e,t,n){return n.compare(e,t)>0}function Os(r,e,t,n){return n.compare(e,t)<=0}function qs(r,e,t,n){return n.compare(e,t)>=0}function Ye(r,e,t){const n=r!=="=="&&r!=="!=";return class Ri{constructor(o,a,s){this.type=_,this.lhs=o,this.rhs=a,this.collator=s,this.hasUntypedArgument=o.type.kind==="value"||a.type.kind==="value"}static parse(o,a){if(o.length!==3&&o.length!==4)return a.error("Expected two or three arguments.");const s=o[0];let l=a.parse(o[1],1,P);if(!l)return null;if(!Ln(s,l.type))return a.concat(1).error(`"${s}" comparisons are not supported for type '${B(l.type)}'.`);let u=a.parse(o[2],2,P);if(!u)return null;if(!Ln(s,u.type))return a.concat(2).error(`"${s}" comparisons are not supported for type '${B(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error(`Cannot compare types '${B(l.type)}' and '${B(u.type)}'.`);n&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new ke(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new ke(l.type,[u])));let c=null;if(o.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error("Cannot use collator to compare non-string types.");if(c=a.parse(o[3],3,Ut),!c)return null}return new Ri(l,u,c)}evaluate(o){const a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const l=Q(a),u=Q(s);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new te(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const l=Q(a),u=Q(s);if(l.kind!=="string"||u.kind!=="string")return e(o,a,s)}return this.collator?t(o,a,s,this.collator.evaluate(o)):e(o,a,s)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}serialize(){const o=[r];return this.eachChild(a=>{o.push(a.serialize())}),o}}}const Gs=Ye("==",_s,Pi),Vs=Ye("!=",Ps,js),Ns=Ye("<",Rs,Ls),Us=Ye(">",Ms,$s),Bs=Ye("<=",As,Os),Zs=Ye(">=",Ds,qs);class un{constructor(e,t,n,i,o,a){this.type=M,this.number=e,this.locale=t,this.currency=n,this.unit=i,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const n=t.parse(e[1],1,y);if(!n)return null;const i=e[2];if(typeof i!="object"||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let o=null;if(i.locale&&(o=t.parse(i.locale,1,M),!o))return null;let a=null;if(i.currency&&(a=t.parse(i.currency,1,M),!a))return null;let s=null;if(i.unit&&(s=t.parse(i.unit,1,M),!s))return null;let l=null;if(i["min-fraction-digits"]&&(l=t.parse(i["min-fraction-digits"],1,y),!l))return null;let u=null;return i["max-fraction-digits"]&&(u=t.parse(i["max-fraction-digits"],1,y),!u)?null:new un(n,o,a,s,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency&&"currency"||this.unit&&"unit"||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class cn{constructor(e){this.type=y,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=t.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${B(n.type)} instead.`):new cn(n):null}evaluate(e){const t=this.input.evaluate(e);if(typeof t=="string")return t.length;if(Array.isArray(t))return t.length;throw new te(`Expected value to be of type string or array, but found ${B(Q(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(t=>{e.push(t.serialize())}),e}}var Hs=cn;const Mi={"==":Gs,"!=":Vs,">":Us,"<":Ns,">=":Zs,"<=":Bs,array:ke,at:zs,boolean:ke,case:Cs,coalesce:Ii,collator:Xt,format:Zt,image:Ht,in:Ss,"index-of":Fs,interpolate:Me,"interpolate-hcl":Me,"interpolate-lab":Me,length:Hs,let:_i,literal:Dt,match:Es,number:ke,"number-format":un,object:ke,slice:Is,step:wi,string:ke,"to-boolean":Ve,"to-color":Ve,"to-number":Ve,"to-string":Ve,var:xi,within:Jr};function $n(r,[e,t,n,i]){e=e.evaluate(r),t=t.evaluate(r),n=n.evaluate(r);const o=i?i.evaluate(r):1,a=fi(e,t,n,o);if(a)throw new te(a);return new ue(e/255*o,t/255*o,n/255*o,o)}function On(r,e){return r in e}function mr(r,e){const t=e[r];return typeof t>"u"?null:t}function Xs(r,e,t,n){for(;t<=n;){const i=t+n>>1;if(e[i]===r)return!0;e[i]>r?n=i-1:t=i+1}return!1}function _e(r){return{type:r}}Ke.register(Mi,{error:[Ba,[M],(r,[e])=>{throw new te(e.evaluate(r))}],typeof:[M,[P],(r,[e])=>B(Q(e.evaluate(r)))],"to-rgba":[me(y,4),[ze],(r,[e])=>e.evaluate(r).toArray()],rgb:[ze,[y,y,y],$n],rgba:[ze,[y,y,y,y],$n],has:{type:_,overloads:[[[M],(r,[e])=>On(e.evaluate(r),r.properties())],[[M,Be],(r,[e,t])=>On(e.evaluate(r),t.evaluate(r))]]},get:{type:P,overloads:[[[M],(r,[e])=>mr(e.evaluate(r),r.properties())],[[M,Be],(r,[e,t])=>mr(e.evaluate(r),t.evaluate(r))]]},"feature-state":[P,[M],(r,[e])=>mr(e.evaluate(r),r.featureState||{})],properties:[Be,[],r=>r.properties()],"geometry-type":[M,[],r=>r.geometryType()],id:[P,[],r=>r.id()],zoom:[y,[],r=>r.globals.zoom],pitch:[y,[],r=>r.globals.pitch||0],"distance-from-center":[y,[],r=>r.distanceFromCenter()],"heatmap-density":[y,[],r=>r.globals.heatmapDensity||0],"line-progress":[y,[],r=>r.globals.lineProgress||0],"sky-radial-progress":[y,[],r=>r.globals.skyRadialProgress||0],accumulated:[P,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[y,_e(y),(r,e)=>{let t=0;for(const n of e)t+=n.evaluate(r);return t}],"*":[y,_e(y),(r,e)=>{let t=1;for(const n of e)t*=n.evaluate(r);return t}],"-":{type:y,overloads:[[[y,y],(r,[e,t])=>e.evaluate(r)-t.evaluate(r)],[[y],(r,[e])=>-e.evaluate(r)]]},"/":[y,[y,y],(r,[e,t])=>e.evaluate(r)/t.evaluate(r)],"%":[y,[y,y],(r,[e,t])=>e.evaluate(r)%t.evaluate(r)],ln2:[y,[],()=>Math.LN2],pi:[y,[],()=>Math.PI],e:[y,[],()=>Math.E],"^":[y,[y,y],(r,[e,t])=>Math.pow(e.evaluate(r),t.evaluate(r))],sqrt:[y,[y],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[y,[y],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[y,[y],(r,[e])=>Math.log(e.evaluate(r))],log2:[y,[y],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[y,[y],(r,[e])=>Math.sin(e.evaluate(r))],cos:[y,[y],(r,[e])=>Math.cos(e.evaluate(r))],tan:[y,[y],(r,[e])=>Math.tan(e.evaluate(r))],asin:[y,[y],(r,[e])=>Math.asin(e.evaluate(r))],acos:[y,[y],(r,[e])=>Math.acos(e.evaluate(r))],atan:[y,[y],(r,[e])=>Math.atan(e.evaluate(r))],min:[y,_e(y),(r,e)=>Math.min(...e.map(t=>t.evaluate(r)))],max:[y,_e(y),(r,e)=>Math.max(...e.map(t=>t.evaluate(r)))],abs:[y,[y],(r,[e])=>Math.abs(e.evaluate(r))],round:[y,[y],(r,[e])=>{const t=e.evaluate(r);return t<0?-Math.round(-t):Math.round(t)}],floor:[y,[y],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[y,[y],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[_,[M,P],(r,[e,t])=>r.properties()[e.value]===t.value],"filter-id-==":[_,[P],(r,[e])=>r.id()===e.value],"filter-type-==":[_,[M],(r,[e])=>r.geometryType()===e.value],"filter-<":[_,[M,P],(r,[e,t])=>{const n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n{const t=r.id(),n=e.value;return typeof t==typeof n&&t":[_,[M,P],(r,[e,t])=>{const n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n>i}],"filter-id->":[_,[P],(r,[e])=>{const t=r.id(),n=e.value;return typeof t==typeof n&&t>n}],"filter-<=":[_,[M,P],(r,[e,t])=>{const n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[_,[P],(r,[e])=>{const t=r.id(),n=e.value;return typeof t==typeof n&&t<=n}],"filter->=":[_,[M,P],(r,[e,t])=>{const n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[_,[P],(r,[e])=>{const t=r.id(),n=e.value;return typeof t==typeof n&&t>=n}],"filter-has":[_,[P],(r,[e])=>e.value in r.properties()],"filter-has-id":[_,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[_,[me(M)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[_,[me(P)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[_,[M,me(P)],(r,[e,t])=>t.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[_,[M,me(P)],(r,[e,t])=>Xs(r.properties()[e.value],t.value,0,t.value.length-1)],all:{type:_,overloads:[[[_,_],(r,[e,t])=>e.evaluate(r)&&t.evaluate(r)],[_e(_),(r,e)=>{for(const t of e)if(!t.evaluate(r))return!1;return!0}]]},any:{type:_,overloads:[[[_,_],(r,[e,t])=>e.evaluate(r)||t.evaluate(r)],[_e(_),(r,e)=>{for(const t of e)if(t.evaluate(r))return!0;return!1}]]},"!":[_,[_],(r,[e])=>!e.evaluate(r)],"is-supported-script":[_,[M],(r,[e])=>{const t=r.globals&&r.globals.isSupportedScript;return t?t(e.evaluate(r)):!0}],upcase:[M,[M],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[M,[M],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[M,_e(P),(r,e)=>e.map(t=>pt(t.evaluate(r))).join("")],"resolved-locale":[M,[Ut],(r,[e])=>e.evaluate(r).resolvedLocale()]});var Ai=Mi;function Ir(r){return{result:"success",value:r}}function Oe(r){return{result:"error",value:r}}function Ws(r){return r["property-type"]==="data-driven"}function Ks(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function Js(r){return!!r.expression&&r.expression.interpolated}function Di(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}class Ys{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new hi,this._defaultValue=t?rl(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,n,i,o,a,s,l){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=i||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=l||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,i,o,a,s,l){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=l||null;try{const u=this.expression.evaluate(this._evaluator);if(u==null||typeof u=="number"&&u!==u)return this._defaultValue;if(this._enumValues&&!(u in this._enumValues))throw new te(`Expected value to be one of ${Object.keys(this._enumValues).map(c=>JSON.stringify(c)).join(", ")}, but found ${JSON.stringify(u)} instead.`);return u}catch(u){return this._warningHistory[u.message]||(this._warningHistory[u.message]=!0,typeof console<"u"&&console.warn(u.message)),this._defaultValue}}}function Qs(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Ai}function _r(r,e){const t=new bi(Ai,[],e?tl(e):void 0),n=t.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Ir(new Ys(n,e)):Oe(t.errors)}class qn{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Yr(t.expression)}evaluateWithoutErrorHandling(e,t,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,i,o,a)}evaluate(e,t,n,i,o,a){return this._styleExpression.evaluate(e,t,n,i,o,a)}}class Gn{constructor(e,t,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Yr(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,i,o,a)}evaluate(e,t,n,i,o,a){return this._styleExpression.evaluate(e,t,n,i,o,a)}interpolationFactor(e,t,n){return this.interpolationType?Me.interpolationFactor(this.interpolationType,e,t,n):0}}function el(r,e){if(r=_r(r,e),r.result==="error")return r;const t=r.value.expression,n=Wt(t);if(!n&&!Ws(e))return Oe([new be("","data expressions not supported")]);const i=Qr(t,["zoom","pitch","distance-from-center"]);if(!i&&!Ks(e))return Oe([new be("","zoom expressions not supported")]);const o=Pt(t);if(!o&&!i)return Oe([new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof be)return Oe([o]);if(o instanceof Me&&!Js(e))return Oe([new be("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Ir(n?new qn("constant",r.value):new qn("source",r.value));const a=o instanceof Me?o.interpolation:void 0;return Ir(n?new Gn("camera",r.value,o.labels,a):new Gn("composite",r.value,o.labels,a))}function Pt(r){let e=null;if(r instanceof _i)e=Pt(r.result);else if(r instanceof Ii){for(const t of r.args)if(e=Pt(t),e)break}else(r instanceof wi||r instanceof Me)&&r.input instanceof Ke&&r.input.name==="zoom"&&(e=r);return e instanceof be||r.eachChild(t=>{const n=Pt(t);n instanceof be?e=n:!e&&n?e=new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new be("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function tl(r){const e={color:ze,string:M,number:y,enum:M,boolean:_,formatted:Bt,resolvedImage:yt};return r.type==="array"?me(e[r.value]||P,r.length):e[r.type]}function rl(r){return r.type==="color"&&(Di(r.default)||Array.isArray(r.default))?new ue(0,0,0,0):r.type==="color"?ue.parse(r.default)||null:r.default===void 0?null:r.default}function nl(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function Pr(r){if(Array.isArray(r))return r.map(Pr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const e={};for(const t in r)e[t]=Pr(r[t]);return e}return nl(r)}var ji={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{},globe:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["source"]}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["fill-extrusion-edge-radius"]}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function Li(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const e of r.slice(1))if(!Li(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function il(r,e="fill"){if(r==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Li(r)||(r=Gt(r));const t=r;let n=!0;try{n=ol(t)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. -This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md -and paste the contents of this message in the report. -Thank you! -Filter Expression: -${JSON.stringify(t,null,2)} - `)}const i=ji[`filter_${e}`],o=_r(n,i);let a=null;if(o.result==="error")throw new Error(o.value.map(c=>`${c.key}: ${c.message}`).join(", "));a=(c,p,d)=>o.value.evaluate(c,p,{},d);let s=null,l=null;if(n!==t){const c=_r(t,i);if(c.result==="error")throw new Error(c.value.map(p=>`${p.key}: ${p.message}`).join(", "));s=(p,d,f,m,x)=>c.value.evaluate(p,d,{},f,void 0,void 0,m,x),l=!Wt(c.value.expression)}a=a;const u=qi(n);return{filter:a,dynamicFilter:s||void 0,needGeometry:u,needFeature:!!l}}function ol(r){if(!He(r))return r;let e=Pr(r);return Oi(e),e=$i(e),e}function $i(r){if(!Array.isArray(r))return r;const e=ll(r);return e===!0?e:e.map(t=>$i(t))}function Oi(r){let e=!1;const t=[];if(r[0]==="case"){for(let n=1;n",">=","<","<=","to-boolean"]);function ll(r){if(sl.has(r[0]))for(let e=1;ee?1:0}function qi(r){if(!Array.isArray(r))return!1;if(r[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?yr(r[1],r[2],e):e==="any"?cl(r.slice(1)):e==="all"?["all"].concat(r.slice(1).map(Gt)):e==="none"?["all"].concat(r.slice(1).map(Gt).map(Ct)):e==="in"?Vn(r[1],r.slice(2)):e==="!in"?Ct(Vn(r[1],r.slice(2))):e==="has"?Nn(r[1]):e==="!has"?Ct(Nn(r[1])):e==="within"?r:!0}function yr(r,e,t){switch(r){case"$type":return[`filter-type-${t}`,e];case"$id":return[`filter-id-${t}`,e];default:return[`filter-${t}`,r,e]}}function cl(r){return["any"].concat(r.map(Gt))}function Vn(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",r,["literal",e.sort(ul)]]:["filter-in-small",r,["literal",e]]}}function Nn(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Ct(r){return["!",r]}var pl=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dl(r,e){const t={};for(const n in r)n!=="ref"&&(t[n]=r[n]);return pl.forEach(n=>{n in e&&(t[n]=e[n])}),t}function fl(r){r=r.slice();const e=Object.create(null);for(let t=0;t1?d[d.length-2].toLowerCase():"";if(f==m||f==m.replace("-","")||x+"-"+f==m){i=s?i:Un[m],d.pop(),x&&m.startsWith(x)&&d.pop();break}}!s&&typeof f=="number"&&(i=f,s=!0);var h=d.join(at).replace("Klokantech Noto Sans","Noto Sans");h.indexOf(at)!==-1&&(h='"'+h+'"'),a.push(h)}n=Zn[r]=[o,i,a]}return n[0]+at+n[1]+at+e+"px"+(t?"/"+t:"")+at+n[2]},Rr=pi(hl);const Gi="https://api.mapbox.com";function pn(r){const e="mapbox://";return r.indexOf(e)!==0?"":r.slice(e.length)}function ml(r,e,t){const n=pn(r);if(!n)return decodeURI(new URL(r,t).href);const i="sprites/";if(n.indexOf(i)!==0)throw new Error(`unexpected sprites url: ${r}`);const o=n.slice(i.length);return`${Gi}/styles/v1/${o}/sprite?access_token=${e}`}function Vi(r,e){const t=pn(r);if(!t)return decodeURI(new URL(r,location.href).href);const n="styles/";if(t.indexOf(n)!==0)throw new Error(`unexpected style url: ${r}`);const i=t.slice(n.length);return`${Gi}/styles/v1/${i}?&access_token=${e}`}function Rt(r,e,t,n){const i=new URL(r,n),o=pn(r);if(!o)return e&&(i.searchParams.has(t)||i.searchParams.set(t,e)),decodeURI(i.href);if(o==="mapbox.satellite"){const a=window.devicePixelRatio>=1.5?"@2x":"";return`https://api.mapbox.com/v4/${o}/{z}/{x}/{y}${a}.webp?access_token=${e}`}return`https://{a-d}.tiles.mapbox.com/v4/${o}/{z}/{x}/{y}.vector.pbf?access_token=${e}`}const Hn={},Xn={};let yl=0;function dn(r){return r.id||(r.id=yl++),r.id}function gl(r,e){return dn(r)+"."+ye(e)}function xl(r){let e=Hn[r.id];return e||(e={},Hn[dn(r)]=e),e}function bl(r){let e=Xn[r.id];return e||(e={},Xn[dn(r)]=e),e}function gr(r){return r*Math.PI/180}const Kt=function(){const r=[];for(let e=78271.51696402048;r.length<=24;e/=2)r.push(e);return r}();function Jt(r,e){if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<"u")return new OffscreenCanvas(r,e);const t=document.createElement("canvas");return t.width=r,t.height=e,t}function Ni(r,e){let t=0;const n=e.length;for(;ti).then(a=>(a instanceof Request||(a=new Request(a)),a.headers.get("Accept")||a.headers.set("Accept","application/json"),n&&(n.request=a),fetch(a).then(function(s){return delete $e[e],s.ok?s.json():Promise.reject(new Error("Error fetching source "+e))}).catch(function(s){return delete $e[e],Promise.reject(new Error("Error fetching source "+e))})));return $e[e]=[i,o],o}function Ui(r,e){if(typeof r=="string")if(r.trim().startsWith("{"))try{const t=JSON.parse(r);return Promise.resolve(t)}catch(t){return Promise.reject(t)}else return r=Vi(r,e.accessToken),We("Style",r,e);else return Promise.resolve(r)}const Wn={};function wl(r,e,t={}){const n=[e,JSON.stringify(r)].toString();let i=Wn[n];if(!i||t.transformRequest){let o;t.transformRequest&&(o=(s,l)=>{const u=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(s instanceof ui)s.setLoader((c,p,d)=>{Mt(()=>u).then(f=>{fetch(f).then(m=>m.arrayBuffer()).then(m=>{const h=s.getFormat().readFeatures(m,{extent:c,featureProjection:d});s.setFeatures(h)}).catch(m=>s.setState(V.ERROR))})});else{const c=s.getImage();Mt(()=>u).then(p=>{p instanceof Request?fetch(p).then(d=>d.blob()).then(d=>{const f=URL.createObjectURL(d);c.addEventListener("load",()=>URL.revokeObjectURL(f)),c.addEventListener("error",()=>URL.revokeObjectURL(f)),c.src=f}).catch(d=>s.setState(V.ERROR)):c.src=p})}});const a=r.url;if(a&&!r.tiles){const s=Rt(a,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(a.startsWith("mapbox://"))i=Promise.resolve({tileJson:Object.assign({},r,{url:void 0,tiles:Vo(s)}),tileLoadFunction:o});else{const l={};i=We("Source",s,t,l).then(function(u){return u.tiles=u.tiles.map(function(c){return u.scheme==="tms"&&(c=c.replace("{y}","{-y}")),Rt(c,t.accessToken,t.accessTokenParam||"access_token",l.request.url)}),Promise.resolve({tileJson:u,tileLoadFunction:o})})}}else r=Object.assign({},r,{tiles:r.tiles.map(function(s){return r.scheme==="tms"&&(s=s.replace("{y}","{-y}")),Rt(s,t.accessToken,t.accessTokenParam||"access_token",e||location.href)})}),i=Promise.resolve({tileJson:Object.assign({},r),tileLoadFunction:o});Wn[n]=i}return i}function Kn(r,e,t,n){const i=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],o=Jt(i[0],i[1]),a=o.getContext("2d");a.drawImage(r,e.x,e.y,e.width,e.height,t*e.pixelRatio,t*e.pixelRatio,e.width,e.height);const s=a.getImageData(0,0,i[0],i[1]);a.globalCompositeOperation="destination-over",a.fillStyle=`rgba(${n.r*255},${n.g*255},${n.b*255},${n.a})`;const l=s.data;for(let u=0,c=s.width;u0&&a.arc(u,p,t*e.pixelRatio,0,2*Math.PI)}return a.fill(),o}function Tl(r,e,t){const n=Math.max(0,Math.min(1,(t-r)/(e-r)));return n*n*(3-2*n)}function Jn(r,e,t){const n=Jt(e.width,e.height),i=n.getContext("2d");i.drawImage(r,e.x,e.y,e.width,e.height,0,0,e.width,e.height);const o=i.getImageData(0,0,e.width,e.height),a=o.data;for(let s=0,l=o.width;s0?(a[p+0]=Math.round(255*t.r*x),a[p+1]=Math.round(255*t.g*x),a[p+2]=Math.round(255*t.b*x),a[p+3]=Math.round(255*x)):a[p+3]=0}return i.putImageData(o,0,0),n}const kl=Array(256).join(" ");function Mr(r,e){if(e>=.05){let t="";const n=r.split(` -`),i=kl.slice(0,Math.round(e/.1));for(let o=0,a=n.length;o0&&(t+=` -`),t+=n[o].split("").join(i);return t}return r}let xr;function Bi(){return xr||(xr=Jt(1,1).getContext("2d")),xr}function Pe(r,e){return Bi().measureText(r).width+(r.length-1)*e}const Yn={};function Ar(r,e,t,n){if(r.indexOf(` -`)!==-1){const a=r.split(` -`),s=[];for(let l=0,u=a.length;l1){const s=Bi();s.font=e;const u=s.measureText("M").width*t;let c="";const p=[];for(let d=0,f=a.length;d1;++d){const m=p[d];if(Pe(m,n)0?Pe(p[d-1],n):1/0,h=du*.7&&Pe(x,n)`${n.key}: ${n.message}`).join(", "));return t.value},Dr={},Vt={zoom:0};let _t,vr;function z(r,e,t,n,i,o,a){const s=r.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[s]||(o[s]={});const l=o[s];if(!l[t]){let u=(r[e]||Dr)[t];const c=ji[`${e}_${r.type}`][t];u===void 0&&(u=c.default);let p=Qs(u);if(!p&&Di(u)&&(u=La(u,c),p=!0),p){const d=_l(u,c);l[t]=d.evaluate.bind(d)}else c.type=="color"&&(u=ue.parse(u)),l[t]=function(){return u}}return Vt.zoom=n,l[t](Vt,i,a)}function Qn(r,e,t,n,i){return z(r,"layout",`${n}-allow-overlap`,e,t,i)?z(r,"layout",`${n}-ignore-placement`,e,t,i)?"none":"obstacle":"declutter"}function Pl(r,e,t,n,i){return i||console.warn("No filterCache provided to evaluateFilter()"),r in i||(i[r]=il(e).filter),Vt.zoom=n,i[r](Vt,t)}function Fe(r,e){if(r){if(r.a===0||e===0)return;const t=r.a;return e=e===void 0?1:e,t===0?"transparent":"rgba("+Math.round(r.r*255/t)+","+Math.round(r.g*255/t)+","+Math.round(r.b*255/t)+","+t*e+")"}return r}const Rl=/\{[^{}}]*\}/g;function wr(r,e){return r.replace(Rl,function(t){return e[t.slice(1,-1)]||""})}const Ml={};function Al(r,e,t,n=Kt,i=void 0,o=void 0,a=void 0,s=void 0){if(typeof e=="string"&&(e=JSON.parse(e)),e.version!=8)throw new Error("glStyle version 8 required.");Ml[gl(e,r)]=Array.from(arguments);let l,u,c;if(o){if(typeof Image<"u"){const k=new Image;let I;Mt(()=>o).then(A=>{A instanceof Request?fetch(A).then(j=>j.blob()).then(j=>{I=URL.createObjectURL(j),k.src=I}).catch(()=>{}):(k.crossOrigin="anonymous",k.src=A,I&&URL.revokeObjectURL(I))}),k.onload=function(){l=k,u=[k.width,k.height],r.changed(),k.onload=null}}else if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){const k=self;k.postMessage({action:"loadImage",src:o}),k.addEventListener("message",function(A){A.data.action==="imageLoaded"&&A.data.src===o&&(l=A.data.image,u=[l.width,l.height])})}}const p=fl(e.layers),d={},f=[],m={},x={},h=xl(e),R=bl(e);let E;for(let k=0,I=p.length;k=b.maxzoom)continue;const hn=b.filter;if(!hn||Pl(fn,hn,T,v,R)){let ce,we,vt,xe,Te,w;const De=xt.index;if(q==3&&(b.type=="fill"||b.type=="fill-extrusion"))if(we=z(b,"paint",b.type+"-opacity",v,T,h,g),b.type+"-pattern"in Ae){const Z=z(b,"paint",b.type+"-pattern",v,T,h,g);if(Z){const H=typeof Z=="string"?wr(Z,j):Z.toString();if(l&&i&&i[H]){++U,w=F[U],(!w||!w.getFill()||w.getStroke()||w.getText())&&(w=new Ee({fill:new Ge}),F[U]=w),vt=w.getFill(),w.setZIndex(De);const N=H+"."+we;let X=x[N];if(!X){const D=i[H],$=Jt(D.width,D.height),K=$.getContext("2d");K.globalAlpha=we,K.drawImage(l,D.x,D.y,D.width,D.height,0,0,D.width,D.height),X=K.createPattern($,"repeat"),x[N]=X}vt.setColor(X)}}}else ce=Fe(z(b,"paint",b.type+"-color",v,T,h,g),we),b.type+"-outline-color"in Ae&&(Te=Fe(z(b,"paint",b.type+"-outline-color",v,T,h,g),we)),Te||(Te=ce),(ce||Te)&&(++U,w=F[U],(!w||ce&&!w.getFill()||!ce&&w.getFill()||Te&&!w.getStroke()||!Te&&w.getStroke()||w.getText())&&(w=new Ee({fill:ce?new Ge:void 0,stroke:Te?new st:void 0}),F[U]=w),ce&&(vt=w.getFill(),vt.setColor(ce)),Te&&(xe=w.getStroke(),xe.setColor(Te),xe.setWidth(.5)),w.setZIndex(De));if(q!=1&&b.type=="line"){"line-pattern"in Ae?ce=void 0:ce=Fe(z(b,"paint","line-color",v,T,h,g),z(b,"paint","line-opacity",v,T,h,g));const Z=z(b,"paint","line-width",v,T,h,g);ce&&Z>0&&(++U,w=F[U],(!w||!w.getStroke()||w.getFill()||w.getText())&&(w=new Ee({stroke:new st}),F[U]=w),xe=w.getStroke(),xe.setLineCap(z(b,"layout","line-cap",v,T,h,g)),xe.setLineJoin(z(b,"layout","line-join",v,T,h,g)),xe.setMiterLimit(z(b,"layout","line-miter-limit",v,T,h,g)),xe.setColor(ce),xe.setWidth(Z),xe.setLineDash(Ae["line-dasharray"]?z(b,"paint","line-dasharray",v,T,h,g).map(function(H){return H*Z}):null),w.setZIndex(De))}let wt=!1,O=null,mn=0,Qe,ne,Yt;if((q==1||q==2)&&"icon-image"in bt){const Z=z(b,"layout","icon-image",v,T,h,g);if(Z){Qe=typeof Z=="string"?wr(Z,j):Z.toString();let H;const N=s?s(r,Qe):void 0;if(l&&i&&i[Qe]||N){const X=z(b,"layout","icon-rotation-alignment",v,T,h,g);if(q==2){const D=k.getGeometry();if(D.getFlatMidpoint||D.getFlatMidpoints){const $=D.getExtent();if(Math.sqrt(Math.max(Math.pow(($[2]-$[0])/I,2),Math.pow(($[3]-$[1])/I,2)))>150){const J=D.getType()==="MultiLineString"?D.getFlatMidpoints():D.getFlatMidpoint();if(vr||(_t=[NaN,NaN],vr=new kr("Point",_t,[],2,{},void 0)),H=vr,_t[0]=J[0],_t[1]=J[1],z(b,"layout","symbol-placement",v,T,h,g)==="line"&&X==="map"){const se=D.getStride(),ie=D.getFlatCoordinates();for(let oe=0,W=ie.length-se;oe=nt&&J[0]<=Xi&&J[1]>=Hi&&J[1]<=Wi){mn=Math.atan2(fe-re,he-de);break}}}}}}if(q!==2||H){const D=z(b,"layout","icon-size",v,T,h,g),$=Ae["icon-color"]!==void 0?z(b,"paint","icon-color",v,T,h,g):null;if(!$||$.a!==0){const K=z(b,"paint","icon-halo-color",v,T,h,g),J=z(b,"paint","icon-halo-width",v,T,h,g);let pe=`${Qe}.${D}.${J}.${K}`;if($!==null&&(pe+=`.${$}`),ne=m[pe],!ne){const se=Qn(b,v,T,"icon",h);let ie;"icon-offset"in bt&&(ie=z(b,"layout","icon-offset",v,T,h,g).slice(0),ie[0]*=D,ie[1]*=-D);let oe=$?[$.r*255,$.g*255,$.b*255,$.a]:void 0;if(N){const W={color:oe,rotateWithView:X==="map",displacement:ie,declutterMode:se,scale:D};typeof N=="string"?W.src=N:(W.img=N,W.imgSize=[N.width,N.height]),ne=new vn(W)}else{const W=i[Qe];let de,fe,he;J?W.sdf?(de=Kn(Jn(l,W,$||[0,0,0,1]),{x:0,y:0,width:W.width,height:W.height,pixelRatio:W.pixelRatio},J,K),oe=void 0):de=Kn(l,W,J,K):(W.sdf?(c||(c=Jn(l,{x:0,y:0,width:u[0],height:u[1]},{r:1,g:1,b:1,a:1})),de=c):de=l,fe=[W.width,W.height],he=[W.x,W.y]),ne=new vn({color:oe,img:de,imgSize:u,size:fe,offset:he,rotateWithView:X==="map",scale:D/W.pixelRatio,displacement:ie,declutterMode:se})}m[pe]=ne}}ne&&(++U,w=F[U],(!w||!w.getImage()||w.getFill()||w.getStroke())&&(w=new Ee,F[U]=w),w.setGeometry(H),ne.setRotation(mn+gr(z(b,"layout","icon-rotate",v,T,h,g))),ne.setOpacity(z(b,"paint","icon-opacity",v,T,h,g)),ne.setAnchor(Il[z(b,"layout","icon-anchor",v,T,h,g)]),w.setImage(ne),O=w.getText(),w.setText(void 0),w.setZIndex(De),wt=!0,Yt=!1)}else Yt=!0}}}if(q==1&&b.type==="circle"){++U,w=F[U],(!w||!w.getImage()||w.getFill()||w.getStroke())&&(w=new Ee,F[U]=w);const Z="circle-radius"in Ae?z(b,"paint","circle-radius",v,T,h,g):5,H=Fe(z(b,"paint","circle-stroke-color",v,T,h,g),z(b,"paint","circle-stroke-opacity",v,T,h,g)),N=z(b,"paint","circle-translate",v,T,h,g),X=Fe(z(b,"paint","circle-color",v,T,h,g),z(b,"paint","circle-opacity",v,T,h,g)),D=z(b,"paint","circle-stroke-width",v,T,h,g),$=Z+"."+H+"."+X+"."+D+"."+N[0]+"."+N[1];ne=m[$],ne||(ne=new li({radius:Z,displacement:[N[0],-N[1]],stroke:H&&D>0?new st({width:D,color:H}):void 0,fill:X?new Ge({color:X}):void 0,declutterMode:"none"}),m[$]=ne),w.setImage(ne),O=w.getText(),w.setText(void 0),w.setGeometry(void 0),w.setZIndex(De),wt=!0}let ee,et,tt,Se,rt,Qt;if("text-field"in bt){Se=Math.round(z(b,"layout","text-size",v,T,h,g));const Z=z(b,"layout","text-font",v,T,h,g);tt=z(b,"layout","text-line-height",v,T,h,g),et=Rr(a?a(Z,e.metadata?e.metadata["ol:webfonts"]:void 0):Z,Se,tt),et.includes("sans-serif")||(et+=",sans-serif"),rt=z(b,"layout","text-letter-spacing",v,T,h,g),Qt=z(b,"layout","text-max-width",v,T,h,g);const H=z(b,"layout","text-field",v,T,h,g);typeof H=="object"&&H.sections?H.sections.length===1?ee=H.toString():ee=H.sections.reduce((N,X,D)=>{const $=X.fontStack?X.fontStack.split(","):Z,K=Rr(a?a($):$,Se*(X.scale||1),tt);let J=X.text;if(J===` -`)return N.push(` -`,""),N;if(q==2){N.push(Mr(J,rt),K);return}J=Ar(J,K,Qt,rt).split(` -`);for(let pe=0,se=J.length;pe0&&N.push(` -`,""),N.push(J[pe],K);return N},[]):ee=wr(H,j).trim(),we=z(b,"paint","text-opacity",v,T,h,g)}if(ee&&we&&!Yt){wt||(++U,w=F[U],(!w||!w.getText()||w.getFill()||w.getStroke())&&(w=new Ee,F[U]=w),w.setImage(void 0),w.setGeometry(void 0));const Z=Qn(b,v,T,"text",h);w.getText()||w.setText(O),O=w.getText(),(!O||"getDeclutterMode"in O&&O.getDeclutterMode()!==Z)&&(O=new No({padding:[2,2,2,2],declutterMode:Z}),w.setText(O));const H=z(b,"layout","text-transform",v,T,h,g);H=="uppercase"?ee=Array.isArray(ee)?ee.map((re,nt)=>nt%2?re:re.toUpperCase()):ee.toUpperCase():H=="lowercase"&&(ee=Array.isArray(ee)?ee.map((re,nt)=>nt%2?re:re.toLowerCase()):ee.toLowerCase());const N=Array.isArray(ee)?ee:q==2?Mr(ee,rt):Ar(ee,et,Qt,rt);O.setText(N),O.setFont(et),O.setRotation(gr(z(b,"layout","text-rotate",v,T,h,g)));const X=z(b,"layout","text-anchor",v,T,h,g),D=wt||q==1?"point":z(b,"layout","symbol-placement",v,T,h,g);let $;if(D==="line-center"?(O.setPlacement("line"),$="center"):O.setPlacement(D),D==="line"&&typeof O.setRepeat=="function"){const re=z(b,"layout","symbol-spacing",v,T,h,g);O.setRepeat(re*2)}O.setOverflow(D==="point");let K=z(b,"paint","text-halo-width",v,T,h,g);const J=z(b,"layout","text-offset",v,T,h,g),pe=z(b,"paint","text-translate",v,T,h,g);let se=0,ie=0;if(D=="point"){$="center",X.indexOf("left")!==-1?($="left",ie=K):X.indexOf("right")!==-1&&($="right",ie=-K);const re=z(b,"layout","text-rotation-alignment",v,T,h,g);O.setRotateWithView(re=="map")}else O.setMaxAngle(gr(z(b,"layout","text-max-angle",v,T,h,g))*ee.length/N.length),O.setRotateWithView(!1);O.setTextAlign($);let oe="middle";X.indexOf("bottom")==0?(oe="bottom",se=-K-.5*(tt-1)*Se):X.indexOf("top")==0&&(oe="top",se=K+.5*(tt-1)*Se),O.setTextBaseline(oe);const W=z(b,"layout","text-justify",v,T,h,g);O.setJustify(W==="auto"?void 0:W),O.setOffsetX(J[0]*Se+ie+pe[0]),O.setOffsetY(J[1]*Se+se+pe[1]),S.setColor(Fe(z(b,"paint","text-color",v,T,h,g),we)),O.setFill(S);const de=Fe(z(b,"paint","text-halo-color",v,T,h,g),we);if(de&&K>0){C.setColor(de),K*=2;const re=.5*Se;C.setWidth(K<=re?K:re),O.setStroke(C)}else O.setStroke(void 0);const fe=z(b,"layout","text-padding",v,T,h,g),he=O.getPadding();fe!==he[0]&&(he[0]=fe,he[1]=fe,he[2]=fe,he[3]=fe),w.setZIndex(De)}}}if(U>-1)return F.length=U+1,F};return r.setStyle(L),r.set("mapbox-source",E),r.set("mapbox-layers",f),r.set("mapbox-featurestate",r.get("mapbox-featurestate")||{}),L}function Dl(r,e=512){return r.getExtent()?jr({extent:r.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Kt}function jl(r,e){return e.accessToken||(e=Object.assign({},e),new URL(r).searchParams.forEach((n,i)=>{e.accessToken=n,e.accessTokenParam=i})),e}function Ll(r,e,t="",n={},i=void 0){let o,a,s,l,u=!0;return typeof t!="string"&&!Array.isArray(t)?(s=t,l=s.source||s.layers,n=s):l=t,typeof n=="string"?(o=n,s={}):(o=n.styleUrl,s=n),s.updateSource===!1&&(u=!1),i||(i=s.resolutions),!o&&typeof e=="string"&&!e.trim().startsWith("{")&&(o=e),o&&(o=o.startsWith("data:")?location.href:Vi(o,s.accessToken),s=jl(o,s)),new Promise(function(c,p){Ui(e,s).then(function(d){if(d.version!=8)return p(new Error("glStyle version 8 required."));if(!(r instanceof zr||r instanceof ut))return p(new Error("Can only apply to VectorLayer or VectorTileLayer"));const f=r instanceof ut?"vector":"geojson";if(l?Array.isArray(l)?a=d.layers.find(function(S){return S.id===l[0]}).source:a=l:(a=Object.keys(d.sources).find(function(S){return d.sources[S].type===f}),l=a),!a)return p(new Error(`No ${f} source found in the glStyle.`));function m(){if(!u)return Promise.resolve();if(r instanceof ut)return Nl(d.sources[a],o,s).then(function(k){const I=r.getSource();I?k!==I&&(I.setTileUrlFunction(k.getTileUrlFunction()),typeof I.setUrls=="function"&&typeof k.getUrls=="function"&&I.setUrls(k.getUrls()),I.format_||(I.format_=k.format_),I.getAttributions()||I.setAttributions(k.getAttributions()),I.getTileLoadFunction()===ci&&I.setTileLoadFunction(k.getTileLoadFunction()),qo(I.getProjection(),k.getProjection())&&(I.tileGrid=k.getTileGrid())):r.setSource(k);const A=r.getSource().getTileGrid();!isFinite(r.getMaxResolution())&&!isFinite(r.getMinZoom())&&A.getMinZoom()>0&&r.setMaxResolution(vl(Math.max(0,A.getMinZoom()-1e-12),A.getResolutions()))});const S=d.sources[a];let F=r.getSource();(!F||F.get("mapbox-source")!==S)&&(F=Bl(S,o,s));const L=r.getSource();return L?F!==L&&(L.getAttributions()||L.setAttributions(F.getAttributions()),L.format_||(L.format_=F.getFormat()),L.url_=F.getUrl()):r.setSource(F),Promise.resolve()}let x,h,R,E;function C(){if(!E&&(!d.sprite||h)){if(s.projection&&!i){const F=Xe(s.projection).getUnits();F!=="m"&&(i=Kt.map(L=>L/Ao[F]))}E=Al(r,d,l,i,h,R,(S,F=s.webfonts)=>El(S,F),s.getImage),r.getStyle()?m().then(c).catch(p):p(new Error(`Nothing to show for source [${a}]`))}else E?(r.setStyle(E),m().then(c).catch(p)):p(new Error("Something went wrong trying to apply style."))}if(d.sprite){const S=new URL(ml(d.sprite,s.accessToken,o||location.href));x=window.devicePixelRatio>=1.5?.5:1;const F=x==.5?"@2x":"";let L=S.origin+S.pathname+F+".json"+S.search;new Promise(function(k,I){We("Sprite",L,s).then(k).catch(function(A){L=S.origin+S.pathname+".json"+S.search,We("Sprite",L,s).then(k).catch(I)})}).then(function(k){if(k===void 0&&p(new Error("No sprites found.")),h=k,R=S.origin+S.pathname+F+".png"+S.search,s.transformRequest){const I=s.transformRequest(R,"SpriteImage")||R;(I instanceof Request||I instanceof Promise)&&(R=I)}C()}).catch(function(k){p(new Error(`Sprites cannot be loaded: ${L}: ${k.message}`))})}else C()}).catch(p)})}const ei={};function $l(r,e,t){e.layers.some(function(n){if(n.type==="background"){if(r instanceof si)return r.setBackground(function(i){return Zi(n,i,t,{})}),!0;if(r instanceof Do||r instanceof jo)return r.getLayers().insertAt(0,Vl(n,t,{})),!0}})}function Ol(r,e,t={}){return Ui(e,t).then(function(n){$l(r,n,t)})}function ql(r,e){const t=r.bounds;if(t){const n=wn([t[0],t[1]],e),i=wn([t[2],t[3]],e);return[n[0],n[1],i[0],i[1]]}return Xe(e).getExtent()}function Gl(r,e,t){const n=new da({tileJSON:e,tileSize:r.tileSize||e.tileSize||512}),i=n.getTileJSON(),o=n.getTileGrid(),a=Xe(t.projection||"EPSG:3857"),s=ql(i,a),l=a.getExtent(),u=i.minzoom||0,c=i.maxzoom||22,p={attributions:n.getAttributions(),projection:a,tileGrid:new ai({origin:l?ni(l):o.getOrigin(0),extent:s||o.getExtent(),minZoom:u,resolutions:Dl(a,e.tileSize).slice(0,c+1),tileSize:o.getTileSize(0)})};return Array.isArray(i.tiles)?p.urls=i.tiles:p.url=i.tiles,p}function Zi(r,e,t,n){const i={id:r.id,type:r.type},o=r.layout||{},a=r.paint||{};i.paint=a;const s=Ni(e,t.resolutions||Kt);let l;const u=z(i,"paint","background-color",s,ei,n);return a["background-opacity"]!==void 0&&(l=z(i,"paint","background-opacity",s,ei,n)),o.visibility=="none"?void 0:Fe(u,l)}function Vl(r,e,t){const n=document.createElement("div");return n.className="ol-mapbox-style-background",n.style.position="absolute",n.style.width="100%",n.style.height="100%",new si({source:new Lo({}),render(i){const o=Zi(r,i.viewState.resolution,e,t);return n.style.backgroundColor=o,n}})}function Nl(r,e,t){return new Promise(function(n,i){wl(r,e,t).then(function({tileJson:o,tileLoadFunction:a}){const s=Gl(r,o,t);s.tileLoadFunction=a,s.format=new $r,n(new Lr(s))}).catch(i)})}function Ul(r){return`{bbox-${(r?r.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function Bl(r,e,t){const n=t.projection?new zn({dataProjection:t.projection}):new zn,i=r.data,o={};if(typeof i=="string"){const s=Rt(i,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(s)){const u=(p,d,f)=>{const m=Ul(f);return s.replace(m,`${p.join(",")}`)},c=new rr({attributions:r.attribution,format:n,loader:(p,d,f,m,x)=>{const h=typeof u=="function"?u(p,d,f):u;We("GeoJSON",h,t).then(R=>{const E=c.getFormat().readFeatures(R,{featureProjection:f});c.addFeatures(E),m(E)}).catch(R=>{c.removeLoadedExtent(p),x()})},strategy:Go});return c.set("mapbox-source",r),c}const l=new rr({attributions:r.attribution,format:n,url:s,loader:(u,c,p,d,f)=>{We("GeoJSON",s,t).then(m=>{const x=l.getFormat().readFeatures(m,{featureProjection:p});l.addFeatures(x),d(x)}).catch(m=>{l.removeLoadedExtent(u),f()})}});return l}o.features=n.readFeatures(i,{featureProjection:"EPSG:3857"});const a=new rr(Object.assign({attributions:r.attribution,format:n},o));return a.set("mapbox-source",r),a}class Zl extends Mo{constructor(e){super(Tr.ERROR),this.error=e}}class Hl extends ut{constructor(e){const t="declutter"in e?e.declutter:!0,n=new Lr({state:"loading",format:new $r});super({source:n,background:e.background===!1?null:e.background,declutter:t,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties}),e.accessToken&&(this.accessToken=e.accessToken);const i=e.styleUrl,o=[Ll(this,i,e.layers||e.source,{accessToken:this.accessToken})];this.getBackground()===void 0&&o.push(Ol(this,e.styleUrl,{accessToken:this.accessToken})),Promise.all(o).then(()=>{n.setState("ready")}).catch(a=>{this.dispatchEvent(new Zl(a)),this.getSource().setState("error")})}}const qe="main";class Xl{mapId=qe;vectorSourceFactory;constructor({references:e}){this.vectorSourceFactory=e.vectorSourceFactory}async getMapConfig(){return{projection:"EPSG:3857",initialView:{kind:"position",center:{x:848890,y:6793350},zoom:13},layers:[new it({title:"OSM",visible:!0,isBaseLayer:!0,olLayer:new Uo({source:new Bo})}),new it({id:"inspire-us-kindergarten",title:"Kindertageseinrichtungen in NRW",visible:!0,olLayer:new zr({style:new Ee({image:new li({fill:new Ge({color:"blue"}),radius:5})}),source:this.vectorSourceFactory.createVectorSource({baseUrl:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1",collectionId:"governmentalservice",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:"Datenlizenz Deutschland - Namensnennung - Version 2.0"})})}),new it({id:"ogc_katasterbezirk",title:"Liegenschaftskatasterbezirke in NRW (viele Daten)",visible:!1,olLayer:new zr({source:this.vectorSourceFactory.createVectorSource({baseUrl:"https://ogc-api.nrw.de/lika/v1",collectionId:"katasterbezirk",limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:"Datenlizenz Deutschland - Namensnennung - Version 2.0"})})}),new it({title:"Abschnitte / Äste mit Unfällen (Mapbox Style)",visible:!1,olLayer:new Hl({styleUrl:"https://demo.ldproxy.net/strassen/styles/default?f=mbs"})}),new it({title:"Pendleratlas",visible:!0,olLayer:new ut({source:new Lr({url:"https://pendleratlas.statistikportal.de/_vector_tiles/2022/vg250/{z}/{x}/{y}.pbf",format:new $r,projection:"EPSG:3857",attributions:`© Statistische Ämter der Länder ${new Date().getFullYear()} | GeoBasis-DE/BKG ${new Date().getFullYear()}`}),style:new Ee({fill:new Ge({color:"rgba(173, 209, 158, 0.6)"}),stroke:new st({color:"#2d7d9f",width:3})})})})]}}}class Wl{beforeRequest({target:e,options:t}){e.protocol==="https:"&&e.hostname==="ogc-api.nrw.de"&&t.headers.set("Authorization","Bearer 12345")}}const Kl={"ogc-api-app":{name:"ogc-api-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Xl,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},SampleTokenInterceptor:{name:"SampleTokenInterceptor",clazz:Wl,provides:[{name:"http.Interceptor",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:Zo,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:Ho,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:na,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:ia,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},Jl=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',Yl=["en","de"];function Ql(r){switch(r){case"en":return Sn(()=>import("./CQRU2o-rqIdt.js"),[],import.meta.url).then(e=>e.default);case"de":return Sn(()=>import("./ysjsThxdLmKR.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${r}'`)}const eu=Ki(Jl),tu=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:Ql,locales:Yl,packages:Kl,styles:eu},Symbol.toStringTag,{value:"Module"})),ru="ogc-api-app",nu=Xo.bind(void 0,ru);function iu(){const r=nu();return Y.jsx(nr,{height:"100%",direction:"column",overflow:"hidden",children:Y.jsx(Tn,{title:Y.jsx(yn,{textAlign:"center",py:1,children:Y.jsx(kn,{size:"md",children:"Open Pioneer - OGC API Features and OGC API Tiles Sample"})}),children:Y.jsx(nr,{flex:"1",direction:"column",position:"relative",children:Y.jsxs(Wo,{mapId:qe,children:[Y.jsx(ir,{position:"top-left",horizontalGap:20,verticalGap:20,children:Y.jsx(yn,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:Y.jsx(Tn,{title:Y.jsx(kn,{size:"md",children:r.formatMessage({id:"tocTitle"})}),children:Y.jsx(Yo,{mapId:qe,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})})}),Y.jsx(ir,{position:"top-right",horizontalGap:10,verticalGap:10,children:Y.jsxs(Ji,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[Y.jsx(or,{as:"b",children:"Description"}),Y.jsx(or,{children:"This application can be used to test OGC API Features and OGC API Tiles."}),Y.jsx(or,{children:"Vector Tiles cannot be reprojected and require the map to use the same projection. Currently all known MVT vector tile sets are using WebMercator, making them unusable in the Default Sample App which uses ETRS89/UTM zone 32N. This Sample App uses WebMercator."})]})}),Y.jsx(ir,{position:"bottom-right",horizontalGap:10,verticalGap:30,children:Y.jsxs(nr,{direction:"column",gap:1,padding:1,children:[Y.jsx(oa,{mapId:qe}),Y.jsx(aa,{mapId:qe}),Y.jsx(sa,{mapId:qe})]})})]})})})})}const ou=Yi({component:iu,theme:Qi,appMetadata:tu,async resolveConfig(r){const e=r.getAttribute("forced-locale");if(e)return{locale:e}}});customElements.define("ogc-api-app",ou);const au=document.getElementsByTagName("body")[0];su();function su(){const r=window.location.search,t=new URLSearchParams(r).get("lang"),n=document.createElement("ogc-api-app");n.classList.add("full-height"),n.setAttribute("id","test"),t&&n.setAttribute("forced-locale",t),au.appendChild(n)} diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/VXuNJBviGPoL.js b/openlayers-base-packages/pr-previews/pr-377/assets/CbxgmwRI74qQ.js similarity index 96% rename from openlayers-base-packages/pr-previews/pr-377/assets/VXuNJBviGPoL.js rename to openlayers-base-packages/pr-previews/pr-377/assets/CbxgmwRI74qQ.js index a92fcfd..52e0e06 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/VXuNJBviGPoL.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/CbxgmwRI74qQ.js @@ -1,4 +1,4 @@ -import{r as v,N as it,W as Me,J as Ve,h as T,j as w,g as I,m as De,p as D,O as G,a4 as oe,u as ze,o as Ee,R as rt,n as st,c as lt,z as ut,a5 as at,l as gt,B as dt}from"./DbBkdn6FNbgs.js";import{u as ct,b3 as He,aZ as ft,i as pt}from"./DyxVjgSvwe-K.js";import{c as Ge}from"./DjAArQ67Dgmx.js";import{u as mt}from"./CCXTS-icusD6.js";import{t as St,v as Ct,C as ht}from"./B6P_btgblpGb.js";import{a as Rt}from"./CwYOJLhODXKJ.js";function wt(e,o){const t={},n={};for(const[i,r]of Object.entries(e))o.includes(i)?t[i]=r:n[i]=r;return[t,n]}function vt(e){return e&&Me(e)&&Me(e.target)}function _t(e={}){const{onChange:o,value:t,defaultValue:n,name:i,isDisabled:r,isFocusable:s,isNative:l,...u}=e,[a,d]=v.useState(n||""),p=typeof t<"u",c=p?t:a,g=v.useRef(null),f=v.useCallback(()=>{const _=g.current;if(!_)return;let x="input:not(:disabled):checked";const z=_.querySelector(x);if(z){z.focus();return}x="input:not(:disabled)",_.querySelector(x)?.focus()},[]),S=`radio-${v.useId()}`,C=i||S,F=v.useCallback(_=>{const x=vt(_)?_.target.value:_;p||d(x),o?.(String(x))},[o,p]),P=v.useCallback((_={},x=null)=>({..._,ref:it(x,g),role:"radiogroup"}),[]),y=v.useCallback((_={},x=null)=>({..._,ref:x,name:C,[l?"checked":"isChecked"]:c!=null?_.value===c:void 0,onChange(V){F(V)},"data-radiogroup":!0}),[l,C,F,c]);return{getRootProps:P,getRadioProps:y,name:C,ref:g,focus:f,setValue:d,value:c,onChange:F,isDisabled:r,isFocusable:s,htmlProps:u}}const[Ft,Ae]=Ve({name:"RadioGroupContext",strict:!1}),xt=T((e,o)=>{const{colorScheme:t,size:n,variant:i,children:r,className:s,isDisabled:l,isFocusable:u,...a}=e,{value:d,onChange:p,getRootProps:c,name:g,htmlProps:f}=_t(a),m=v.useMemo(()=>({name:g,size:n,onChange:p,colorScheme:t,value:d,variant:i,isDisabled:l,isFocusable:u}),[g,n,p,t,d,i,l,u]);return w.jsx(Ft,{value:m,children:w.jsx(I.div,{...c(f,o),className:De("chakra-radio-group",s),children:r})})});xt.displayName="RadioGroup";function Pt(e={}){const{defaultChecked:o,isChecked:t,isFocusable:n,isDisabled:i,isReadOnly:r,isRequired:s,onChange:l,isInvalid:u,name:a,value:d,id:p,"data-radiogroup":c,"aria-describedby":g,...f}=e,m=`radio-${v.useId()}`,S=Rt(),F=!!Ae()||!!c;let y=!!S&&!F?S.id:m;y=p??y;const _=i??S?.isDisabled,x=r??S?.isReadOnly,z=s??S?.isRequired,V=u??S?.isInvalid,[B,U]=v.useState(!1),[A,Z]=v.useState(!1),[b,Re]=v.useState(!1),[te,q]=v.useState(!1),[et,tt]=v.useState(!!o),ne=typeof t<"u",j=ne?t:et;v.useEffect(()=>St(U),[]);const we=v.useCallback(M=>{if(x||_){M.preventDefault();return}ne||tt(M.currentTarget.checked),l?.(M)},[ne,_,x,l]),ve=v.useCallback(M=>{M.key===" "&&q(!0)},[q]),_e=v.useCallback(M=>{M.key===" "&&q(!1)},[q]),nt=v.useCallback((M={},N=null)=>({...M,ref:N,"data-active":D(te),"data-hover":D(b),"data-disabled":D(_),"data-invalid":D(V),"data-checked":D(j),"data-focus":D(A),"data-focus-visible":D(A&&B),"data-readonly":D(x),"aria-hidden":!0,onMouseDown:G(M.onMouseDown,()=>q(!0)),onMouseUp:G(M.onMouseUp,()=>q(!1)),onMouseEnter:G(M.onMouseEnter,()=>Re(!0)),onMouseLeave:G(M.onMouseLeave,()=>Re(!1))}),[te,b,_,V,j,A,x,B]),{onFocus:Fe,onBlur:xe}=S??{},ot=v.useCallback((M={},N=null)=>{const Pe=_&&!n;return{...M,id:y,ref:N,type:"radio",name:a,value:d,onChange:G(M.onChange,we),onBlur:G(xe,M.onBlur,()=>Z(!1)),onFocus:G(Fe,M.onFocus,()=>Z(!0)),onKeyDown:G(M.onKeyDown,ve),onKeyUp:G(M.onKeyUp,_e),checked:j,disabled:Pe,readOnly:x,required:z,"aria-invalid":oe(V),"aria-disabled":oe(Pe),"aria-required":oe(z),"data-readonly":D(x),"aria-describedby":g,style:Ct}},[_,n,y,a,d,we,xe,Fe,ve,_e,j,x,z,V,g]);return{state:{isInvalid:V,isFocused:A,isChecked:j,isActive:te,isHovered:b,isDisabled:_,isReadOnly:x,isRequired:z},getRadioProps:nt,getInputProps:ot,getLabelProps:(M={},N=null)=>({...M,ref:N,onMouseDown:G(M.onMouseDown,Mt),"data-disabled":D(_),"data-checked":D(j),"data-invalid":D(V)}),getRootProps:(M,N=null)=>({htmlFor:y,...M,ref:N,"data-disabled":D(_),"data-checked":D(j),"data-invalid":D(V)}),htmlProps:f}}function Mt(e){e.preventDefault(),e.stopPropagation()}const Le=T((e,o)=>{const t=Ae(),{onChange:n,value:i}=e,r=ze("Radio",{...t,...e}),s=Ee(e),{spacing:l="0.5rem",children:u,isDisabled:a=t?.isDisabled,isFocusable:d=t?.isFocusable,inputProps:p,...c}=s;let g=e.isChecked;t?.value!=null&&i!=null&&(g=t.value===i);let f=n;t?.onChange&&i!=null&&(f=rt(t.onChange,n));const m=e?.name??t?.name,{getInputProps:S,getRadioProps:C,getLabelProps:F,getRootProps:P,htmlProps:y}=Pt({...c,isChecked:g,isFocusable:d,isDisabled:a,onChange:f,name:m}),[_,x]=wt(y,st),z=C(x),V=S(p,o),B=F(),U=Object.assign({},_,P()),A={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...r.container},Z={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...r.control},b={userSelect:"none",marginStart:l,...r.label};return w.jsxs(I.label,{className:"chakra-radio",...U,__css:A,children:[w.jsx("input",{className:"chakra-radio__input",...V}),w.jsx(I.span,{className:"chakra-radio__control",...z,__css:Z}),u&&w.jsx(I.span,{className:"chakra-radio__label",...B,__css:b,children:u})]})});Le.displayName="Radio";const[yt,X]=Ve({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),ke=T((e,o)=>{const t=ze("Table",e),{className:n,layout:i,...r}=Ee(e);return w.jsx(yt,{value:t,children:w.jsx(I.table,{ref:o,__css:{tableLayout:i,...t.table},className:De("chakra-table",n),...r})})});ke.displayName="Table";const $t=T((e,o)=>{const t=X();return w.jsx(I.tbody,{...e,ref:o,__css:t.tbody})}),It=T(({isNumeric:e,...o},t)=>{const n=X();return w.jsx(I.td,{...o,ref:t,__css:n.td,"data-is-numeric":e})}),Vt=T(({isNumeric:e,...o},t)=>{const n=X();return w.jsx(I.th,{...o,ref:t,__css:n.th,"data-is-numeric":e})}),Dt=T((e,o)=>{const t=X();return w.jsx(I.thead,{...e,ref:o,__css:t.thead})}),Oe=T((e,o)=>{const t=X();return w.jsx(I.tr,{...e,ref:o,__css:t.tr})});function zt(e){var o=v.useRef();return v.useEffect(function(){o.current=e}),o.current}const Et=Ge({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"}),Ht=Ge({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"}),Gt="@open-pioneer/result-list",Te=ct.bind(void 0,Gt);/** +import{r as v,P as it,Y as Me,k as Ve,h as T,j as w,g as I,l as De,t as D,Q as G,a6 as oe,u as ze,o as Ee,U as rt,s as st,c as lt,H as ut,a7 as at,q as gt,B as dt}from"./B60Dx_GOYdnk.js";import{u as ct,b3 as He,aZ as ft,i as pt}from"./j0mck_Meu7Xh.js";import{c as Ge}from"./BlACKGYldMfy.js";import{u as mt}from"./BpQSjk0kyblh.js";import{t as St,v as Ct,C as ht}from"./CG5nmvkyugDn.js";import{a as Rt}from"./vepZWq5kkQUw.js";function wt(e,o){const t={},n={};for(const[i,r]of Object.entries(e))o.includes(i)?t[i]=r:n[i]=r;return[t,n]}function vt(e){return e&&Me(e)&&Me(e.target)}function _t(e={}){const{onChange:o,value:t,defaultValue:n,name:i,isDisabled:r,isFocusable:s,isNative:l,...u}=e,[a,d]=v.useState(n||""),p=typeof t<"u",c=p?t:a,g=v.useRef(null),f=v.useCallback(()=>{const _=g.current;if(!_)return;let x="input:not(:disabled):checked";const z=_.querySelector(x);if(z){z.focus();return}x="input:not(:disabled)",_.querySelector(x)?.focus()},[]),S=`radio-${v.useId()}`,C=i||S,F=v.useCallback(_=>{const x=vt(_)?_.target.value:_;p||d(x),o?.(String(x))},[o,p]),P=v.useCallback((_={},x=null)=>({..._,ref:it(x,g),role:"radiogroup"}),[]),y=v.useCallback((_={},x=null)=>({..._,ref:x,name:C,[l?"checked":"isChecked"]:c!=null?_.value===c:void 0,onChange(V){F(V)},"data-radiogroup":!0}),[l,C,F,c]);return{getRootProps:P,getRadioProps:y,name:C,ref:g,focus:f,setValue:d,value:c,onChange:F,isDisabled:r,isFocusable:s,htmlProps:u}}const[Ft,Ae]=Ve({name:"RadioGroupContext",strict:!1}),xt=T((e,o)=>{const{colorScheme:t,size:n,variant:i,children:r,className:s,isDisabled:l,isFocusable:u,...a}=e,{value:d,onChange:p,getRootProps:c,name:g,htmlProps:f}=_t(a),m=v.useMemo(()=>({name:g,size:n,onChange:p,colorScheme:t,value:d,variant:i,isDisabled:l,isFocusable:u}),[g,n,p,t,d,i,l,u]);return w.jsx(Ft,{value:m,children:w.jsx(I.div,{...c(f,o),className:De("chakra-radio-group",s),children:r})})});xt.displayName="RadioGroup";function Pt(e={}){const{defaultChecked:o,isChecked:t,isFocusable:n,isDisabled:i,isReadOnly:r,isRequired:s,onChange:l,isInvalid:u,name:a,value:d,id:p,"data-radiogroup":c,"aria-describedby":g,...f}=e,m=`radio-${v.useId()}`,S=Rt(),F=!!Ae()||!!c;let y=!!S&&!F?S.id:m;y=p??y;const _=i??S?.isDisabled,x=r??S?.isReadOnly,z=s??S?.isRequired,V=u??S?.isInvalid,[B,U]=v.useState(!1),[A,Y]=v.useState(!1),[b,Re]=v.useState(!1),[te,q]=v.useState(!1),[et,tt]=v.useState(!!o),ne=typeof t<"u",j=ne?t:et;v.useEffect(()=>St(U),[]);const we=v.useCallback(M=>{if(x||_){M.preventDefault();return}ne||tt(M.currentTarget.checked),l?.(M)},[ne,_,x,l]),ve=v.useCallback(M=>{M.key===" "&&q(!0)},[q]),_e=v.useCallback(M=>{M.key===" "&&q(!1)},[q]),nt=v.useCallback((M={},N=null)=>({...M,ref:N,"data-active":D(te),"data-hover":D(b),"data-disabled":D(_),"data-invalid":D(V),"data-checked":D(j),"data-focus":D(A),"data-focus-visible":D(A&&B),"data-readonly":D(x),"aria-hidden":!0,onMouseDown:G(M.onMouseDown,()=>q(!0)),onMouseUp:G(M.onMouseUp,()=>q(!1)),onMouseEnter:G(M.onMouseEnter,()=>Re(!0)),onMouseLeave:G(M.onMouseLeave,()=>Re(!1))}),[te,b,_,V,j,A,x,B]),{onFocus:Fe,onBlur:xe}=S??{},ot=v.useCallback((M={},N=null)=>{const Pe=_&&!n;return{...M,id:y,ref:N,type:"radio",name:a,value:d,onChange:G(M.onChange,we),onBlur:G(xe,M.onBlur,()=>Y(!1)),onFocus:G(Fe,M.onFocus,()=>Y(!0)),onKeyDown:G(M.onKeyDown,ve),onKeyUp:G(M.onKeyUp,_e),checked:j,disabled:Pe,readOnly:x,required:z,"aria-invalid":oe(V),"aria-disabled":oe(Pe),"aria-required":oe(z),"data-readonly":D(x),"aria-describedby":g,style:Ct}},[_,n,y,a,d,we,xe,Fe,ve,_e,j,x,z,V,g]);return{state:{isInvalid:V,isFocused:A,isChecked:j,isActive:te,isHovered:b,isDisabled:_,isReadOnly:x,isRequired:z},getRadioProps:nt,getInputProps:ot,getLabelProps:(M={},N=null)=>({...M,ref:N,onMouseDown:G(M.onMouseDown,Mt),"data-disabled":D(_),"data-checked":D(j),"data-invalid":D(V)}),getRootProps:(M,N=null)=>({htmlFor:y,...M,ref:N,"data-disabled":D(_),"data-checked":D(j),"data-invalid":D(V)}),htmlProps:f}}function Mt(e){e.preventDefault(),e.stopPropagation()}const Le=T((e,o)=>{const t=Ae(),{onChange:n,value:i}=e,r=ze("Radio",{...t,...e}),s=Ee(e),{spacing:l="0.5rem",children:u,isDisabled:a=t?.isDisabled,isFocusable:d=t?.isFocusable,inputProps:p,...c}=s;let g=e.isChecked;t?.value!=null&&i!=null&&(g=t.value===i);let f=n;t?.onChange&&i!=null&&(f=rt(t.onChange,n));const m=e?.name??t?.name,{getInputProps:S,getRadioProps:C,getLabelProps:F,getRootProps:P,htmlProps:y}=Pt({...c,isChecked:g,isFocusable:d,isDisabled:a,onChange:f,name:m}),[_,x]=wt(y,st),z=C(x),V=S(p,o),B=F(),U=Object.assign({},_,P()),A={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...r.container},Y={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...r.control},b={userSelect:"none",marginStart:l,...r.label};return w.jsxs(I.label,{className:"chakra-radio",...U,__css:A,children:[w.jsx("input",{className:"chakra-radio__input",...V}),w.jsx(I.span,{className:"chakra-radio__control",...z,__css:Y}),u&&w.jsx(I.span,{className:"chakra-radio__label",...B,__css:b,children:u})]})});Le.displayName="Radio";const[yt,X]=Ve({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "
" `}),ke=T((e,o)=>{const t=ze("Table",e),{className:n,layout:i,...r}=Ee(e);return w.jsx(yt,{value:t,children:w.jsx(I.table,{ref:o,__css:{tableLayout:i,...t.table},className:De("chakra-table",n),...r})})});ke.displayName="Table";const $t=T((e,o)=>{const t=X();return w.jsx(I.tbody,{...e,ref:o,__css:t.tbody})}),It=T(({isNumeric:e,...o},t)=>{const n=X();return w.jsx(I.td,{...o,ref:t,__css:n.td,"data-is-numeric":e})}),Vt=T(({isNumeric:e,...o},t)=>{const n=X();return w.jsx(I.th,{...o,ref:t,__css:n.th,"data-is-numeric":e})}),Dt=T((e,o)=>{const t=X();return w.jsx(I.thead,{...e,ref:o,__css:t.thead})}),Oe=T((e,o)=>{const t=X();return w.jsx(I.tr,{...e,ref:o,__css:t.tr})});function zt(e){var o=v.useRef();return v.useEffect(function(){o.current=e}),o.current}const Et=Ge({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"}),Ht=Ge({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"}),Gt="@open-pioneer/result-list",Te=ct.bind(void 0,Gt);/** * table-core * * Copyright (c) TanStack @@ -10,7 +10,7 @@ import{r as v,N as it,W as Me,J as Ve,h as T,j as w,g as I,m as De,p as D,O as G */function At(){return{accessor:(e,o)=>typeof e=="function"?{...o,accessorFn:e}:{...o,accessorKey:e},display:e=>e,group:e=>e}}function k(e,o){return typeof e=="function"?e(o):e}function E(e,o){return t=>{o.setState(n=>({...n,[e]:k(t,n[e])}))}}function ee(e){return e instanceof Function}function Lt(e){return Array.isArray(e)&&e.every(o=>typeof o=="number")}function kt(e,o){const t=[],n=i=>{i.forEach(r=>{t.push(r);const s=o(r);s!=null&&s.length&&n(s)})};return n(e),t}function h(e,o,t){let n=[],i;return r=>{let s;t.key&&t.debug&&(s=Date.now());const l=e(r);if(!(l.length!==n.length||l.some((d,p)=>n[p]!==d)))return i;n=l;let a;if(t.key&&t.debug&&(a=Date.now()),i=o(...l),t==null||t.onChange==null||t.onChange(i),t.key&&t.debug&&t!=null&&t.debug()){const d=Math.round((Date.now()-s)*100)/100,p=Math.round((Date.now()-a)*100)/100,c=p/16,g=(f,m)=>{for(f=String(f);f.length{var i;return(i=e?.debugAll)!=null?i:e[o]},key:!1,onChange:n}}function Ot(e,o,t,n){const i=()=>{var s;return(s=r.getValue())!=null?s:e.options.renderFallbackValue},r={id:`${o.id}_${t.id}`,row:o,column:t,getValue:()=>o.getValue(n),renderValue:i,getContext:h(()=>[e,t,o,r],(s,l,u,a)=>({table:s,column:l,row:u,cell:a,getValue:a.getValue,renderValue:a.renderValue}),R(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(r,t,o,e)},{}),r}function Tt(e,o,t,n){var i,r;const l={...e._getDefaultColumnDef(),...o},u=l.accessorKey;let a=(i=(r=l.id)!=null?r:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?i:typeof l.header=="string"?l.header:void 0,d;if(l.accessorFn?d=l.accessorFn:u&&(u.includes(".")?d=c=>{let g=c;for(const m of u.split(".")){var f;g=(f=g)==null?void 0:f[m]}return g}:d=c=>c[l.accessorKey]),!a)throw new Error;let p={id:`${String(a)}`,accessorFn:d,parent:n,depth:t,columnDef:l,columns:[],getFlatColumns:h(()=>[!0],()=>{var c;return[p,...(c=p.columns)==null?void 0:c.flatMap(g=>g.getFlatColumns())]},R(e.options,"debugColumns")),getLeafColumns:h(()=>[e._getOrderColumnsFn()],c=>{var g;if((g=p.columns)!=null&&g.length){let f=p.columns.flatMap(m=>m.getLeafColumns());return c(f)}return[p]},R(e.options,"debugColumns"))};for(const c of e._features)c.createColumn==null||c.createColumn(p,e);return p}const $="debugHeaders";function ye(e,o,t){var n;let r={id:(n=t.id)!=null?n:o.id,column:o,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],l=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(l),s.push(u)};return l(r),s},getContext:()=>({table:e,header:r,column:o})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(r,e)}),r}const jt={createTable:e=>{e.getHeaderGroups=h(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,i)=>{var r,s;const l=(r=n?.map(p=>t.find(c=>c.id===p)).filter(Boolean))!=null?r:[],u=(s=i?.map(p=>t.find(c=>c.id===p)).filter(Boolean))!=null?s:[],a=t.filter(p=>!(n!=null&&n.includes(p.id))&&!(i!=null&&i.includes(p.id)));return Y(o,[...l,...a,...u],e)},R(e.options,$)),e.getCenterHeaderGroups=h(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,i)=>(t=t.filter(r=>!(n!=null&&n.includes(r.id))&&!(i!=null&&i.includes(r.id))),Y(o,t,e,"center")),R(e.options,$)),e.getLeftHeaderGroups=h(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(o,t,n)=>{var i;const r=(i=n?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?i:[];return Y(o,r,e,"left")},R(e.options,$)),e.getRightHeaderGroups=h(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(o,t,n)=>{var i;const r=(i=n?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?i:[];return Y(o,r,e,"right")},R(e.options,$)),e.getFooterGroups=h(()=>[e.getHeaderGroups()],o=>[...o].reverse(),R(e.options,$)),e.getLeftFooterGroups=h(()=>[e.getLeftHeaderGroups()],o=>[...o].reverse(),R(e.options,$)),e.getCenterFooterGroups=h(()=>[e.getCenterHeaderGroups()],o=>[...o].reverse(),R(e.options,$)),e.getRightFooterGroups=h(()=>[e.getRightHeaderGroups()],o=>[...o].reverse(),R(e.options,$)),e.getFlatHeaders=h(()=>[e.getHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,$)),e.getLeftFlatHeaders=h(()=>[e.getLeftHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,$)),e.getCenterFlatHeaders=h(()=>[e.getCenterHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,$)),e.getRightFlatHeaders=h(()=>[e.getRightHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,$)),e.getCenterLeafHeaders=h(()=>[e.getCenterFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,$)),e.getLeftLeafHeaders=h(()=>[e.getLeftFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,$)),e.getRightLeafHeaders=h(()=>[e.getRightFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,$)),e.getLeafHeaders=h(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(o,t,n)=>{var i,r,s,l,u,a;return[...(i=(r=o[0])==null?void 0:r.headers)!=null?i:[],...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(u=(a=n[0])==null?void 0:a.headers)!=null?u:[]].map(d=>d.getLeafHeaders()).flat()},R(e.options,$))}};function Y(e,o,t,n){var i,r;let s=0;const l=function(c,g){g===void 0&&(g=1),s=Math.max(s,g),c.filter(f=>f.getIsVisible()).forEach(f=>{var m;(m=f.columns)!=null&&m.length&&l(f.columns,g+1)},0)};l(e);let u=[];const a=(c,g)=>{const f={depth:g,id:[n,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];c.forEach(S=>{const C=[...m].reverse()[0],F=S.column.depth===f.depth;let P,y=!1;if(F&&S.column.parent?P=S.column.parent:(P=S.column,y=!0),C&&C?.column===P)C.subHeaders.push(S);else{const _=ye(t,P,{id:[n,g,P.id,S?.id].filter(Boolean).join("_"),isPlaceholder:y,placeholderId:y?`${m.filter(x=>x.column===P).length}`:void 0,depth:g,index:m.length});_.subHeaders.push(S),m.push(_)}f.headers.push(S),S.headerGroup=f}),u.push(f),g>0&&a(m,g-1)},d=o.map((c,g)=>ye(t,c,{depth:s,index:g}));a(d,s-1),u.reverse();const p=c=>c.filter(f=>f.column.getIsVisible()).map(f=>{let m=0,S=0,C=[0];f.subHeaders&&f.subHeaders.length?(C=[],p(f.subHeaders).forEach(P=>{let{colSpan:y,rowSpan:_}=P;m+=y,C.push(_)})):m=1;const F=Math.min(...C);return S=S+F,f.colSpan=m,f.rowSpan=S,{colSpan:m,rowSpan:S}});return p((i=(r=u[0])==null?void 0:r.headers)!=null?i:[]),u}const Nt=(e,o,t,n,i,r,s)=>{let l={id:o,index:n,original:t,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(l._valuesCache.hasOwnProperty(u))return l._valuesCache[u];const a=e.getColumn(u);if(a!=null&&a.accessorFn)return l._valuesCache[u]=a.accessorFn(l.original,n),l._valuesCache[u]},getUniqueValues:u=>{if(l._uniqueValuesCache.hasOwnProperty(u))return l._uniqueValuesCache[u];const a=e.getColumn(u);if(a!=null&&a.accessorFn)return a.columnDef.getUniqueValues?(l._uniqueValuesCache[u]=a.columnDef.getUniqueValues(l.original,n),l._uniqueValuesCache[u]):(l._uniqueValuesCache[u]=[l.getValue(u)],l._uniqueValuesCache[u])},renderValue:u=>{var a;return(a=l.getValue(u))!=null?a:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>kt(l.subRows,u=>u.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let u=[],a=l;for(;;){const d=a.getParentRow();if(!d)break;u.push(d),a=d}return u.reverse()},getAllCells:h(()=>[e.getAllLeafColumns()],u=>u.map(a=>Ot(e,l,a,a.id)),R(e.options,"debugRows")),_getAllCellsByColumnId:h(()=>[l.getAllCells()],u=>u.reduce((a,d)=>(a[d.column.id]=d,a),{}),R(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():o.getPreFilteredRowModel(),e._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},je=(e,o,t)=>{var n,i;const r=t==null||(n=t.toString())==null?void 0:n.toLowerCase();return!!(!((i=e.getValue(o))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(r))};je.autoRemove=e=>H(e);const Ne=(e,o,t)=>{var n;return!!(!((n=e.getValue(o))==null||(n=n.toString())==null)&&n.includes(t))};Ne.autoRemove=e=>H(e);const Be=(e,o,t)=>{var n;return((n=e.getValue(o))==null||(n=n.toString())==null?void 0:n.toLowerCase())===t?.toLowerCase()};Be.autoRemove=e=>H(e);const qe=(e,o,t)=>{var n;return(n=e.getValue(o))==null?void 0:n.includes(t)};qe.autoRemove=e=>H(e)||!(e!=null&&e.length);const Ue=(e,o,t)=>!t.some(n=>{var i;return!((i=e.getValue(o))!=null&&i.includes(n))});Ue.autoRemove=e=>H(e)||!(e!=null&&e.length);const be=(e,o,t)=>t.some(n=>{var i;return(i=e.getValue(o))==null?void 0:i.includes(n)});be.autoRemove=e=>H(e)||!(e!=null&&e.length);const Ke=(e,o,t)=>e.getValue(o)===t;Ke.autoRemove=e=>H(e);const We=(e,o,t)=>e.getValue(o)==t;We.autoRemove=e=>H(e);const Se=(e,o,t)=>{let[n,i]=t;const r=e.getValue(o);return r>=n&&r<=i};Se.resolveFilterValue=e=>{let[o,t]=e,n=typeof o!="number"?parseFloat(o):o,i=typeof t!="number"?parseFloat(t):t,r=o===null||Number.isNaN(n)?-1/0:n,s=t===null||Number.isNaN(i)?1/0:i;if(r>s){const l=r;r=s,s=l}return[r,s]};Se.autoRemove=e=>H(e)||H(e[0])&&H(e[1]);const L={includesString:je,includesStringSensitive:Ne,equalsString:Be,arrIncludes:qe,arrIncludesAll:Ue,arrIncludesSome:be,equals:Ke,weakEquals:We,inNumberRange:Se};function H(e){return e==null||e===""}const qt={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:E("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,o)=>{e.getAutoFilterFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t?.getValue(e.id);return typeof n=="string"?L.includesString:typeof n=="number"?L.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?L.equals:Array.isArray(n)?L.arrIncludes:L.weakEquals},e.getFilterFn=()=>{var t,n;return ee(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(n=o.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?t:L[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,n,i;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((n=o.options.enableColumnFilters)!=null?n:!0)&&((i=o.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=o.getState().columnFilters)==null||(t=t.find(n=>n.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,n;return(t=(n=o.getState().columnFilters)==null?void 0:n.findIndex(i=>i.id===e.id))!=null?t:-1},e.setFilterValue=t=>{o.setColumnFilters(n=>{const i=e.getFilterFn(),r=n?.find(d=>d.id===e.id),s=k(t,r?r.value:void 0);if($e(i,s,e)){var l;return(l=n?.filter(d=>d.id!==e.id))!=null?l:[]}const u={id:e.id,value:s};if(r){var a;return(a=n?.map(d=>d.id===e.id?u:d))!=null?a:[]}return n!=null&&n.length?[...n,u]:[u]})}},createRow:(e,o)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=o=>{const t=e.getAllLeafColumns(),n=i=>{var r;return(r=k(o,i))==null?void 0:r.filter(s=>{const l=t.find(u=>u.id===s.id);if(l){const u=l.getFilterFn();if($e(u,s.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=o=>{var t,n;e.setColumnFilters(o?[]:(t=(n=e.initialState)==null?void 0:n.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function $e(e,o,t){return(e&&e.autoRemove?e.autoRemove(o,t):!1)||typeof o>"u"||typeof o=="string"&&!o}const Ut=(e,o,t)=>t.reduce((n,i)=>{const r=i.getValue(e);return n+(typeof r=="number"?r:0)},0),bt=(e,o,t)=>{let n;return t.forEach(i=>{const r=i.getValue(e);r!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}),n},Kt=(e,o,t)=>{let n;return t.forEach(i=>{const r=i.getValue(e);r!=null&&(n=r)&&(n=r)}),n},Wt=(e,o,t)=>{let n,i;return t.forEach(r=>{const s=r.getValue(e);s!=null&&(n===void 0?s>=s&&(n=i=s):(n>s&&(n=s),i{let t=0,n=0;if(o.forEach(i=>{let r=i.getValue(e);r!=null&&(r=+r)>=r&&(++t,n+=r)}),t)return n/t},Zt=(e,o)=>{if(!o.length)return;const t=o.map(r=>r.getValue(e));if(!Lt(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),i=t.sort((r,s)=>r-s);return t.length%2!==0?i[n]:(i[n-1]+i[n])/2},Yt=(e,o)=>Array.from(new Set(o.map(t=>t.getValue(e))).values()),Jt=(e,o)=>new Set(o.map(t=>t.getValue(e))).size,Qt=(e,o)=>o.length,ie={sum:Ut,min:bt,max:Kt,extent:Wt,mean:Xt,median:Zt,unique:Yt,uniqueCount:Jt,count:Qt},en={getDefaultColumnDef:()=>({aggregatedCell:e=>{var o,t;return(o=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:E("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,o)=>{e.toggleGrouping=()=>{o.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=o.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t?.getValue(e.id);if(typeof n=="number")return ie.sum;if(Object.prototype.toString.call(n)==="[object Date]")return ie.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return ee(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(n=o.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?t:ie[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=o=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(o),e.resetGrouping=o=>{var t,n;e.setGrouping(o?[]:(t=(n=e.initialState)==null?void 0:n.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,o)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const n=o.getColumn(t);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[t]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,o,t,n)=>{e.getIsGrouped=()=>o.getIsGrouped()&&o.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&o.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=t.subRows)!=null&&i.length)}}};function tn(e,o,t){if(!(o!=null&&o.length)||!t)return e;const n=e.filter(r=>!o.includes(r.id));return t==="remove"?n:[...o.map(r=>e.find(s=>s.id===r)).filter(Boolean),...n]}const nn={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:E("columnOrder",e)}),createColumn:(e,o)=>{e.getIndex=h(t=>[W(o,t)],t=>t.findIndex(n=>n.id===e.id),R(o.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=W(o,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const i=W(o,t);return((n=i[i.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=o=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(o),e.resetColumnOrder=o=>{var t;e.setColumnOrder(o?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=h(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(o,t,n)=>i=>{let r=[];if(!(o!=null&&o.length))r=i;else{const s=[...o],l=[...i];for(;l.length&&s.length;){const u=s.shift(),a=l.findIndex(d=>d.id===u);a>-1&&r.push(l.splice(a,1)[0])}r=[...r,...l]}return tn(r,t,n)},R(e.options,"debugTable"))}},re=()=>({left:[],right:[]}),on={getInitialState:e=>({columnPinning:re(),...e}),getDefaultOptions:e=>({onColumnPinningChange:E("columnPinning",e)}),createColumn:(e,o)=>{e.pin=t=>{const n=e.getLeafColumns().map(i=>i.id).filter(Boolean);o.setColumnPinning(i=>{var r,s;if(t==="right"){var l,u;return{left:((l=i?.left)!=null?l:[]).filter(p=>!(n!=null&&n.includes(p))),right:[...((u=i?.right)!=null?u:[]).filter(p=>!(n!=null&&n.includes(p))),...n]}}if(t==="left"){var a,d;return{left:[...((a=i?.left)!=null?a:[]).filter(p=>!(n!=null&&n.includes(p))),...n],right:((d=i?.right)!=null?d:[]).filter(p=>!(n!=null&&n.includes(p)))}}return{left:((r=i?.left)!=null?r:[]).filter(p=>!(n!=null&&n.includes(p))),right:((s=i?.right)!=null?s:[]).filter(p=>!(n!=null&&n.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var i,r,s;return((i=n.columnDef.enablePinning)!=null?i:!0)&&((r=(s=o.options.enableColumnPinning)!=null?s:o.options.enablePinning)!=null?r:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:n,right:i}=o.getState().columnPinning,r=t.some(l=>n?.includes(l)),s=t.some(l=>i?.includes(l));return r?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,n;const i=e.getIsPinned();return i?(t=(n=o.getState().columnPinning)==null||(n=n[i])==null?void 0:n.indexOf(e.id))!=null?t:-1:0}},createRow:(e,o)=>{e.getCenterVisibleCells=h(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(t,n,i)=>{const r=[...n??[],...i??[]];return t.filter(s=>!r.includes(s.column.id))},R(o.options,"debugRows")),e.getLeftVisibleCells=h(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),R(o.options,"debugRows")),e.getRightVisibleCells=h(()=>[e._getAllVisibleCells(),o.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.column.id===r)).filter(Boolean).map(r=>({...r,position:"right"})),R(o.options,"debugRows"))},createTable:e=>{e.setColumnPinning=o=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(o),e.resetColumnPinning=o=>{var t,n;return e.setColumnPinning(o?re():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:re())},e.getIsSomeColumnsPinned=o=>{var t;const n=e.getState().columnPinning;if(!o){var i,r;return!!((i=n.left)!=null&&i.length||(r=n.right)!=null&&r.length)}return!!((t=n[o])!=null&&t.length)},e.getLeftLeafColumns=h(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(o,t)=>(t??[]).map(n=>o.find(i=>i.id===n)).filter(Boolean),R(e.options,"debugColumns")),e.getRightLeafColumns=h(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(o,t)=>(t??[]).map(n=>o.find(i=>i.id===n)).filter(Boolean),R(e.options,"debugColumns")),e.getCenterLeafColumns=h(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n)=>{const i=[...t??[],...n??[]];return o.filter(r=>!i.includes(r.id))},R(e.options,"debugColumns"))}},J={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},se=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),rn={getDefaultColumnDef:()=>J,getInitialState:e=>({columnSizing:{},columnSizingInfo:se(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:E("columnSizing",e),onColumnSizingInfoChange:E("columnSizingInfo",e)}),createColumn:(e,o)=>{e.getSize=()=>{var t,n,i;const r=o.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:J.minSize,(n=r??e.columnDef.size)!=null?n:J.size),(i=e.columnDef.maxSize)!=null?i:J.maxSize)},e.getStart=h(t=>[t,W(o,t),o.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((i,r)=>i+r.getSize(),0),R(o.options,"debugColumns")),e.getAfter=h(t=>[t,W(o,t),o.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((i,r)=>i+r.getSize(),0),R(o.options,"debugColumns")),e.resetSize=()=>{o.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var t,n;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((n=o.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,o)=>{e.getSize=()=>{let t=0;const n=i=>{if(i.subHeaders.length)i.subHeaders.forEach(n);else{var r;t+=(r=i.column.getSize())!=null?r:0}};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const n=o.getColumn(e.column.id),i=n?.getCanResize();return r=>{if(!n||!i||(r.persist==null||r.persist(),le(r)&&r.touches&&r.touches.length>1))return;const s=e.getSize(),l=e?e.getLeafHeaders().map(C=>[C.column.id,C.column.getSize()]):[[n.id,n.getSize()]],u=le(r)?Math.round(r.touches[0].clientX):r.clientX,a={},d=(C,F)=>{typeof F=="number"&&(o.setColumnSizingInfo(P=>{var y,_;const x=o.options.columnResizeDirection==="rtl"?-1:1,z=(F-((y=P?.startOffset)!=null?y:0))*x,V=Math.max(z/((_=P?.startSize)!=null?_:0),-.999999);return P.columnSizingStart.forEach(B=>{let[U,A]=B;a[U]=Math.round(Math.max(A+A*V,0)*100)/100}),{...P,deltaOffset:z,deltaPercentage:V}}),(o.options.columnResizeMode==="onChange"||C==="end")&&o.setColumnSizing(P=>({...P,...a})))},p=C=>d("move",C),c=C=>{d("end",C),o.setColumnSizingInfo(F=>({...F,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=t||typeof document<"u"?document:null,f={moveHandler:C=>p(C.clientX),upHandler:C=>{g?.removeEventListener("mousemove",f.moveHandler),g?.removeEventListener("mouseup",f.upHandler),c(C.clientX)}},m={moveHandler:C=>(C.cancelable&&(C.preventDefault(),C.stopPropagation()),p(C.touches[0].clientX),!1),upHandler:C=>{var F;g?.removeEventListener("touchmove",m.moveHandler),g?.removeEventListener("touchend",m.upHandler),C.cancelable&&(C.preventDefault(),C.stopPropagation()),c((F=C.touches[0])==null?void 0:F.clientX)}},S=sn()?{passive:!1}:!1;le(r)?(g?.addEventListener("touchmove",m.moveHandler,S),g?.addEventListener("touchend",m.upHandler,S)):(g?.addEventListener("mousemove",f.moveHandler,S),g?.addEventListener("mouseup",f.upHandler,S)),o.setColumnSizingInfo(C=>({...C,startOffset:u,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=o=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(o),e.setColumnSizingInfo=o=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(o),e.resetColumnSizing=o=>{var t;e.setColumnSizing(o?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=o=>{var t;e.setColumnSizingInfo(o?se():(t=e.initialState.columnSizingInfo)!=null?t:se())},e.getTotalSize=()=>{var o,t;return(o=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getLeftTotalSize=()=>{var o,t;return(o=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getCenterTotalSize=()=>{var o,t;return(o=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getRightTotalSize=()=>{var o,t;return(o=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0}}};let Q=null;function sn(){if(typeof Q=="boolean")return Q;let e=!1;try{const o={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,o),window.removeEventListener("test",t)}catch{e=!1}return Q=e,Q}function le(e){return e.type==="touchstart"}const ln={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:E("columnVisibility",e)}),createColumn:(e,o)=>{e.toggleVisibility=t=>{e.getCanHide()&&o.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const i=e.columns;return(t=i.length?i.some(r=>r.getIsVisible()):(n=o.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=o.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,o)=>{e._getAllVisibleCells=h(()=>[e.getAllCells(),o.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),R(o.options,"debugRows")),e.getVisibleCells=h(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,i)=>[...t,...n,...i],R(o.options,"debugRows"))},createTable:e=>{const o=(t,n)=>h(()=>[n(),n().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),R(e.options,"debugColumns"));e.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=(n=t)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,r)=>({...i,[r.id]:t||!(r.getCanHide!=null&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible((n=t.target)==null?void 0:n.checked)}}};function W(e,o){return o?o==="center"?e.getCenterVisibleLeafColumns():o==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const un={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},an={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:E("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[o.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,o)=>{e.getCanGlobalFilter=()=>{var t,n,i,r;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=o.options.enableGlobalFilter)!=null?n:!0)&&((i=o.options.enableFilters)!=null?i:!0)&&((r=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>L.includesString,e.getGlobalFilterFn=()=>{var o,t;const{globalFilterFn:n}=e.options;return ee(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(o=(t=e.options.filterFns)==null?void 0:t[n])!=null?o:L[n]},e.setGlobalFilter=o=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(o)},e.resetGlobalFilter=o=>{e.setGlobalFilter(o?void 0:e.initialState.globalFilter)}}},gn={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:E("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let o=!1,t=!1;e._autoResetExpanded=()=>{var n,i;if(!o){e._queue(()=>{o=!0});return}if((n=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var i,r;e.setExpanded(n?{}:(i=(r=e.initialState)==null?void 0:r.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const s=r.split(".");n=Math.max(n,s.length)}),n},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,o)=>{e.toggleExpanded=t=>{o.setExpanded(n=>{var i;const r=n===!0?!0:!!(n!=null&&n[e.id]);let s={};if(n===!0?Object.keys(o.getRowModel().rowsById).forEach(l=>{s[l]=!0}):s=n,t=(i=t)!=null?i:!r,!r&&t)return{...s,[e.id]:!0};if(r&&!t){const{[e.id]:l,...u}=s;return u}return n})},e.getIsExpanded=()=>{var t;const n=o.getState().expanded;return!!((t=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(e))!=null?t:n===!0||n?.[e.id])},e.getCanExpand=()=>{var t,n,i;return(t=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(e))!=null?t:((n=o.options.enableExpanding)!=null?n:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let t=!0,n=e;for(;t&&n.parentId;)n=o.getRow(n.parentId,!0),t=n.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},de=0,ce=10,ue=()=>({pageIndex:de,pageSize:ce}),dn={getInitialState:e=>({...e,pagination:{...ue(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:E("pagination",e)}),createTable:e=>{let o=!1,t=!1;e._autoResetPageIndex=()=>{var n,i;if(!o){e._queue(()=>{o=!0});return}if((n=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const i=r=>k(n,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=n=>{var i;e.setPagination(n?ue():(i=e.initialState.pagination)!=null?i:ue())},e.setPageIndex=n=>{e.setPagination(i=>{let r=k(n,i.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,s)),{...i,pageIndex:r}})},e.resetPageIndex=n=>{var i,r;e.setPageIndex(n?de:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageIndex)!=null?i:de)},e.resetPageSize=n=>{var i,r;e.setPageSize(n?ce:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageSize)!=null?i:ce)},e.setPageSize=n=>{e.setPagination(i=>{const r=Math.max(1,k(n,i.pageSize)),s=i.pageSize*i.pageIndex,l=Math.floor(s/r);return{...i,pageIndex:l,pageSize:r}})},e.setPageCount=n=>e.setPagination(i=>{var r;let s=k(n,(r=e.options.pageCount)!=null?r:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=h(()=>[e.getPageCount()],n=>{let i=[];return n&&n>0&&(i=[...new Array(n)].fill(null).map((r,s)=>s)),i},R(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:ne.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},ae=()=>({top:[],bottom:[]}),cn={getInitialState:e=>({rowPinning:ae(),...e}),getDefaultOptions:e=>({onRowPinningChange:E("rowPinning",e)}),createRow:(e,o)=>{e.pin=(t,n,i)=>{const r=n?e.getLeafRows().map(u=>{let{id:a}=u;return a}):[],s=i?e.getParentRows().map(u=>{let{id:a}=u;return a}):[],l=new Set([...s,e.id,...r]);o.setRowPinning(u=>{var a,d;if(t==="bottom"){var p,c;return{top:((p=u?.top)!=null?p:[]).filter(m=>!(l!=null&&l.has(m))),bottom:[...((c=u?.bottom)!=null?c:[]).filter(m=>!(l!=null&&l.has(m))),...Array.from(l)]}}if(t==="top"){var g,f;return{top:[...((g=u?.top)!=null?g:[]).filter(m=>!(l!=null&&l.has(m))),...Array.from(l)],bottom:((f=u?.bottom)!=null?f:[]).filter(m=>!(l!=null&&l.has(m)))}}return{top:((a=u?.top)!=null?a:[]).filter(m=>!(l!=null&&l.has(m))),bottom:((d=u?.bottom)!=null?d:[]).filter(m=>!(l!=null&&l.has(m)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:n,enablePinning:i}=o.options;return typeof n=="function"?n(e):(t=n??i)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:n,bottom:i}=o.getState().rowPinning,r=t.some(l=>n?.includes(l)),s=t.some(l=>i?.includes(l));return r?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,n;const i=e.getIsPinned();if(!i)return-1;const r=(t=i==="top"?o.getTopRows():o.getBottomRows())==null?void 0:t.map(s=>{let{id:l}=s;return l});return(n=r?.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=o=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(o),e.resetRowPinning=o=>{var t,n;return e.setRowPinning(o?ae():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:ae())},e.getIsSomeRowsPinned=o=>{var t;const n=e.getState().rowPinning;if(!o){var i,r;return!!((i=n.top)!=null&&i.length||(r=n.bottom)!=null&&r.length)}return!!((t=n[o])!=null&&t.length)},e._getPinnedRows=(o,t,n)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(t??[]).map(s=>{const l=e.getRow(s,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(s=>o.find(l=>l.id===s))).filter(Boolean).map(s=>({...s,position:n}))},e.getTopRows=h(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(o,t)=>e._getPinnedRows(o,t,"top"),R(e.options,"debugRows")),e.getBottomRows=h(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(o,t)=>e._getPinnedRows(o,t,"bottom"),R(e.options,"debugRows")),e.getCenterRows=h(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(o,t,n)=>{const i=new Set([...t??[],...n??[]]);return o.filter(r=>!i.has(r.id))},R(e.options,"debugRows"))}},fn={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:E("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=o=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(o),e.resetRowSelection=o=>{var t;return e.setRowSelection(o?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=o=>{e.setRowSelection(t=>{o=typeof o<"u"?o:!e.getIsAllRowsSelected();const n={...t},i=e.getPreGroupedRowModel().flatRows;return o?i.forEach(r=>{r.getCanSelect()&&(n[r.id]=!0)}):i.forEach(r=>{delete n[r.id]}),n})},e.toggleAllPageRowsSelected=o=>e.setRowSelection(t=>{const n=typeof o<"u"?o:!e.getIsAllPageRowsSelected(),i={...t};return e.getRowModel().rows.forEach(r=>{fe(i,r.id,n,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=h(()=>[e.getState().rowSelection,e.getCoreRowModel()],(o,t)=>Object.keys(o).length?ge(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getFilteredSelectedRowModel=h(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(o,t)=>Object.keys(o).length?ge(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getGroupedSelectedRowModel=h(()=>[e.getState().rowSelection,e.getSortedRowModel()],(o,t)=>Object.keys(o).length?ge(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const o=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let n=!!(o.length&&Object.keys(t).length);return n&&o.some(i=>i.getCanSelect()&&!t[i.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const o=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:t}=e.getState();let n=!!o.length;return n&&o.some(i=>!t[i.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var o;const t=Object.keys((o=e.getState().rowSelection)!=null?o:{}).length;return t>0&&t{const o=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:o.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>o=>{e.toggleAllRowsSelected(o.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>o=>{e.toggleAllPageRowsSelected(o.target.checked)}},createRow:(e,o)=>{e.toggleSelected=(t,n)=>{const i=e.getIsSelected();o.setRowSelection(r=>{var s;if(t=typeof t<"u"?t:!i,e.getCanSelect()&&i===t)return r;const l={...r};return fe(l,e.id,t,(s=n?.selectChildren)!=null?s:!0,o),l})},e.getIsSelected=()=>{const{rowSelection:t}=o.getState();return Ce(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=o.getState();return pe(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=o.getState();return pe(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(e):(t=o.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(e):(t=o.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(e):(t=o.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected((i=n.target)==null?void 0:i.checked)}}}},fe=(e,o,t,n,i)=>{var r;const s=i.getRow(o,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),s.getCanSelect()&&(e[o]=!0)):delete e[o],n&&(r=s.subRows)!=null&&r.length&&s.getCanSelectSubRows()&&s.subRows.forEach(l=>fe(e,l.id,t,n,i))};function ge(e,o){const t=e.getState().rowSelection,n=[],i={},r=function(s,l){return s.map(u=>{var a;const d=Ce(u,t);if(d&&(n.push(u),i[u.id]=u),(a=u.subRows)!=null&&a.length&&(u={...u,subRows:r(u.subRows)}),d)return u}).filter(Boolean)};return{rows:r(o.rows),flatRows:n,rowsById:i}}function Ce(e,o){var t;return(t=o[e.id])!=null?t:!1}function pe(e,o,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let i=!0,r=!1;return e.subRows.forEach(s=>{if(!(r&&!i)&&(s.getCanSelect()&&(Ce(s,o)?r=!0:i=!1),s.subRows&&s.subRows.length)){const l=pe(s,o);l==="all"?r=!0:(l==="some"&&(r=!0),i=!1)}}),i?"all":r?"some":!1}const me=/([0-9]+)/gm,pn=(e,o,t)=>Xe(O(e.getValue(t)).toLowerCase(),O(o.getValue(t)).toLowerCase()),mn=(e,o,t)=>Xe(O(e.getValue(t)),O(o.getValue(t))),Sn=(e,o,t)=>he(O(e.getValue(t)).toLowerCase(),O(o.getValue(t)).toLowerCase()),Cn=(e,o,t)=>he(O(e.getValue(t)),O(o.getValue(t))),hn=(e,o,t)=>{const n=e.getValue(t),i=o.getValue(t);return n>i?1:nhe(e.getValue(t),o.getValue(t));function he(e,o){return e===o?0:e>o?1:-1}function O(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Xe(e,o){const t=e.split(me).filter(Boolean),n=o.split(me).filter(Boolean);for(;t.length&&n.length;){const i=t.shift(),r=n.shift(),s=parseInt(i,10),l=parseInt(r,10),u=[s,l].sort();if(isNaN(u[0])){if(i>r)return 1;if(r>i)return-1;continue}if(isNaN(u[1]))return isNaN(s)?-1:1;if(s>l)return 1;if(l>s)return-1}return t.length-n.length}const K={alphanumeric:pn,alphanumericCaseSensitive:mn,text:Sn,textCaseSensitive:Cn,datetime:hn,basic:Rn},wn={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:E("sorting",e),isMultiSortEvent:o=>o.shiftKey}),createColumn:(e,o)=>{e.getAutoSortingFn=()=>{const t=o.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const i of t){const r=i?.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return K.datetime;if(typeof r=="string"&&(n=!0,r.split(me).length>1))return K.alphanumeric}return n?K.text:K.basic},e.getAutoSortDir=()=>{const t=o.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,n;if(!e)throw new Error;return ee(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(n=o.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?t:K[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const i=e.getNextSortingOrder(),r=typeof t<"u"&&t!==null;o.setSorting(s=>{const l=s?.find(g=>g.id===e.id),u=s?.findIndex(g=>g.id===e.id);let a=[],d,p=r?t:i==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&n?l?d="toggle":d="add":s!=null&&s.length&&u!==s.length-1?d="replace":l?d="toggle":d="replace",d==="toggle"&&(r||i||(d="remove")),d==="add"){var c;a=[...s,{id:e.id,desc:p}],a.splice(0,a.length-((c=o.options.maxMultiSortColCount)!=null?c:Number.MAX_SAFE_INTEGER))}else d==="toggle"?a=s.map(g=>g.id===e.id?{...g,desc:p}:g):d==="remove"?a=s.filter(g=>g.id!==e.id):a=[{id:e.id,desc:p}];return a})},e.getFirstSortDir=()=>{var t,n;return((t=(n=e.columnDef.sortDescFirst)!=null?n:o.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var n,i;const r=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==r&&((n=o.options.enableSortingRemoval)==null||n)&&(!(t&&(i=o.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":r},e.getCanSort=()=>{var t,n;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((n=o.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,n;return(t=(n=e.columnDef.enableMultiSort)!=null?n:o.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const n=(t=o.getState().sorting)==null?void 0:t.find(i=>i.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,n;return(t=(n=o.getState().sorting)==null?void 0:n.findIndex(i=>i.id===e.id))!=null?t:-1},e.clearSorting=()=>{o.setSorting(t=>t!=null&&t.length?t.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return n=>{t&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=o=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(o),e.resetSorting=o=>{var t,n;e.setSorting(o?[]:(t=(n=e.initialState)==null?void 0:n.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},vn=[jt,ln,nn,on,Bt,qt,un,an,wn,en,gn,dn,cn,fn,rn];function _n(e){var o,t;const n=[...vn,...(o=e._features)!=null?o:[]];let i={_features:n};const r=i._features.reduce((c,g)=>Object.assign(c,g.getDefaultOptions==null?void 0:g.getDefaultOptions(i)),{}),s=c=>i.options.mergeOptions?i.options.mergeOptions(r,c):{...r,...c};let u={...{},...(t=e.initialState)!=null?t:{}};i._features.forEach(c=>{var g;u=(g=c.getInitialState==null?void 0:c.getInitialState(u))!=null?g:u});const a=[];let d=!1;const p={_features:n,options:{...r,...e},initialState:u,_queue:c=>{a.push(c),d||(d=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{i.setState(i.initialState)},setOptions:c=>{const g=k(c,i.options);i.options=s(g)},getState:()=>i.options.state,setState:c=>{i.options.onStateChange==null||i.options.onStateChange(c)},_getRowId:(c,g,f)=>{var m;return(m=i.options.getRowId==null?void 0:i.options.getRowId(c,g,f))!=null?m:`${f?[f.id,g].join("."):g}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(c,g)=>{let f=(g?i.getPrePaginationRowModel():i.getRowModel()).rowsById[c];if(!f&&(f=i.getCoreRowModel().rowsById[c],!f))throw new Error;return f},_getDefaultColumnDef:h(()=>[i.options.defaultColumn],c=>{var g;return c=(g=c)!=null?g:{},{header:f=>{const m=f.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:f=>{var m,S;return(m=(S=f.renderValue())==null||S.toString==null?void 0:S.toString())!=null?m:null},...i._features.reduce((f,m)=>Object.assign(f,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...c}},R(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:h(()=>[i._getColumnDefs()],c=>{const g=function(f,m,S){return S===void 0&&(S=0),f.map(C=>{const F=Tt(i,C,S,m),P=C;return F.columns=P.columns?g(P.columns,F,S+1):[],F})};return g(c)},R(e,"debugColumns")),getAllFlatColumns:h(()=>[i.getAllColumns()],c=>c.flatMap(g=>g.getFlatColumns()),R(e,"debugColumns")),_getAllFlatColumnsById:h(()=>[i.getAllFlatColumns()],c=>c.reduce((g,f)=>(g[f.id]=f,g),{}),R(e,"debugColumns")),getAllLeafColumns:h(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(c,g)=>{let f=c.flatMap(m=>m.getLeafColumns());return g(f)},R(e,"debugColumns")),getColumn:c=>i._getAllFlatColumnsById()[c]};Object.assign(i,p);for(let c=0;ch(()=>[e.options.data],o=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(i,r,s){r===void 0&&(r=0);const l=[];for(let a=0;ae._autoResetPageIndex()))}function xn(){return e=>h(()=>[e.getState().sorting,e.getPreSortedRowModel()],(o,t)=>{if(!t.rows.length||!(o!=null&&o.length))return t;const n=e.getState().sorting,i=[],r=n.filter(u=>{var a;return(a=e.getColumn(u.id))==null?void 0:a.getCanSort()}),s={};r.forEach(u=>{const a=e.getColumn(u.id);a&&(s[u.id]={sortUndefined:a.columnDef.sortUndefined,invertSorting:a.columnDef.invertSorting,sortingFn:a.getSortingFn()})});const l=u=>{const a=u.map(d=>({...d}));return a.sort((d,p)=>{for(let g=0;g{var p;i.push(d),(p=d.subRows)!=null&&p.length&&(d.subRows=l(d.subRows))}),a};return{rows:l(t.rows),flatRows:i,rowsById:t.rowsById}},R(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** + color: hsl(${Math.max(0,Math.min(120-120*c,120))}deg 100% 31%);`,t?.key)}return i}}function R(e,o,t,n){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[o]},key:!1,onChange:n}}function Ot(e,o,t,n){const i=()=>{var s;return(s=r.getValue())!=null?s:e.options.renderFallbackValue},r={id:`${o.id}_${t.id}`,row:o,column:t,getValue:()=>o.getValue(n),renderValue:i,getContext:h(()=>[e,t,o,r],(s,l,u,a)=>({table:s,column:l,row:u,cell:a,getValue:a.getValue,renderValue:a.renderValue}),R(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(r,t,o,e)},{}),r}function Tt(e,o,t,n){var i,r;const l={...e._getDefaultColumnDef(),...o},u=l.accessorKey;let a=(i=(r=l.id)!=null?r:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?i:typeof l.header=="string"?l.header:void 0,d;if(l.accessorFn?d=l.accessorFn:u&&(u.includes(".")?d=c=>{let g=c;for(const m of u.split(".")){var f;g=(f=g)==null?void 0:f[m]}return g}:d=c=>c[l.accessorKey]),!a)throw new Error;let p={id:`${String(a)}`,accessorFn:d,parent:n,depth:t,columnDef:l,columns:[],getFlatColumns:h(()=>[!0],()=>{var c;return[p,...(c=p.columns)==null?void 0:c.flatMap(g=>g.getFlatColumns())]},R(e.options,"debugColumns")),getLeafColumns:h(()=>[e._getOrderColumnsFn()],c=>{var g;if((g=p.columns)!=null&&g.length){let f=p.columns.flatMap(m=>m.getLeafColumns());return c(f)}return[p]},R(e.options,"debugColumns"))};for(const c of e._features)c.createColumn==null||c.createColumn(p,e);return p}const $="debugHeaders";function ye(e,o,t){var n;let r={id:(n=t.id)!=null?n:o.id,column:o,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],l=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(l),s.push(u)};return l(r),s},getContext:()=>({table:e,header:r,column:o})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(r,e)}),r}const jt={createTable:e=>{e.getHeaderGroups=h(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,i)=>{var r,s;const l=(r=n?.map(p=>t.find(c=>c.id===p)).filter(Boolean))!=null?r:[],u=(s=i?.map(p=>t.find(c=>c.id===p)).filter(Boolean))!=null?s:[],a=t.filter(p=>!(n!=null&&n.includes(p.id))&&!(i!=null&&i.includes(p.id)));return Z(o,[...l,...a,...u],e)},R(e.options,$)),e.getCenterHeaderGroups=h(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,i)=>(t=t.filter(r=>!(n!=null&&n.includes(r.id))&&!(i!=null&&i.includes(r.id))),Z(o,t,e,"center")),R(e.options,$)),e.getLeftHeaderGroups=h(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(o,t,n)=>{var i;const r=(i=n?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?i:[];return Z(o,r,e,"left")},R(e.options,$)),e.getRightHeaderGroups=h(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(o,t,n)=>{var i;const r=(i=n?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?i:[];return Z(o,r,e,"right")},R(e.options,$)),e.getFooterGroups=h(()=>[e.getHeaderGroups()],o=>[...o].reverse(),R(e.options,$)),e.getLeftFooterGroups=h(()=>[e.getLeftHeaderGroups()],o=>[...o].reverse(),R(e.options,$)),e.getCenterFooterGroups=h(()=>[e.getCenterHeaderGroups()],o=>[...o].reverse(),R(e.options,$)),e.getRightFooterGroups=h(()=>[e.getRightHeaderGroups()],o=>[...o].reverse(),R(e.options,$)),e.getFlatHeaders=h(()=>[e.getHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,$)),e.getLeftFlatHeaders=h(()=>[e.getLeftHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,$)),e.getCenterFlatHeaders=h(()=>[e.getCenterHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,$)),e.getRightFlatHeaders=h(()=>[e.getRightHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,$)),e.getCenterLeafHeaders=h(()=>[e.getCenterFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,$)),e.getLeftLeafHeaders=h(()=>[e.getLeftFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,$)),e.getRightLeafHeaders=h(()=>[e.getRightFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,$)),e.getLeafHeaders=h(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(o,t,n)=>{var i,r,s,l,u,a;return[...(i=(r=o[0])==null?void 0:r.headers)!=null?i:[],...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(u=(a=n[0])==null?void 0:a.headers)!=null?u:[]].map(d=>d.getLeafHeaders()).flat()},R(e.options,$))}};function Z(e,o,t,n){var i,r;let s=0;const l=function(c,g){g===void 0&&(g=1),s=Math.max(s,g),c.filter(f=>f.getIsVisible()).forEach(f=>{var m;(m=f.columns)!=null&&m.length&&l(f.columns,g+1)},0)};l(e);let u=[];const a=(c,g)=>{const f={depth:g,id:[n,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];c.forEach(S=>{const C=[...m].reverse()[0],F=S.column.depth===f.depth;let P,y=!1;if(F&&S.column.parent?P=S.column.parent:(P=S.column,y=!0),C&&C?.column===P)C.subHeaders.push(S);else{const _=ye(t,P,{id:[n,g,P.id,S?.id].filter(Boolean).join("_"),isPlaceholder:y,placeholderId:y?`${m.filter(x=>x.column===P).length}`:void 0,depth:g,index:m.length});_.subHeaders.push(S),m.push(_)}f.headers.push(S),S.headerGroup=f}),u.push(f),g>0&&a(m,g-1)},d=o.map((c,g)=>ye(t,c,{depth:s,index:g}));a(d,s-1),u.reverse();const p=c=>c.filter(f=>f.column.getIsVisible()).map(f=>{let m=0,S=0,C=[0];f.subHeaders&&f.subHeaders.length?(C=[],p(f.subHeaders).forEach(P=>{let{colSpan:y,rowSpan:_}=P;m+=y,C.push(_)})):m=1;const F=Math.min(...C);return S=S+F,f.colSpan=m,f.rowSpan=S,{colSpan:m,rowSpan:S}});return p((i=(r=u[0])==null?void 0:r.headers)!=null?i:[]),u}const Nt=(e,o,t,n,i,r,s)=>{let l={id:o,index:n,original:t,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(l._valuesCache.hasOwnProperty(u))return l._valuesCache[u];const a=e.getColumn(u);if(a!=null&&a.accessorFn)return l._valuesCache[u]=a.accessorFn(l.original,n),l._valuesCache[u]},getUniqueValues:u=>{if(l._uniqueValuesCache.hasOwnProperty(u))return l._uniqueValuesCache[u];const a=e.getColumn(u);if(a!=null&&a.accessorFn)return a.columnDef.getUniqueValues?(l._uniqueValuesCache[u]=a.columnDef.getUniqueValues(l.original,n),l._uniqueValuesCache[u]):(l._uniqueValuesCache[u]=[l.getValue(u)],l._uniqueValuesCache[u])},renderValue:u=>{var a;return(a=l.getValue(u))!=null?a:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>kt(l.subRows,u=>u.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let u=[],a=l;for(;;){const d=a.getParentRow();if(!d)break;u.push(d),a=d}return u.reverse()},getAllCells:h(()=>[e.getAllLeafColumns()],u=>u.map(a=>Ot(e,l,a,a.id)),R(e.options,"debugRows")),_getAllCellsByColumnId:h(()=>[l.getAllCells()],u=>u.reduce((a,d)=>(a[d.column.id]=d,a),{}),R(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():o.getPreFilteredRowModel(),e._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},je=(e,o,t)=>{var n,i;const r=t==null||(n=t.toString())==null?void 0:n.toLowerCase();return!!(!((i=e.getValue(o))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(r))};je.autoRemove=e=>H(e);const Ne=(e,o,t)=>{var n;return!!(!((n=e.getValue(o))==null||(n=n.toString())==null)&&n.includes(t))};Ne.autoRemove=e=>H(e);const Be=(e,o,t)=>{var n;return((n=e.getValue(o))==null||(n=n.toString())==null?void 0:n.toLowerCase())===t?.toLowerCase()};Be.autoRemove=e=>H(e);const qe=(e,o,t)=>{var n;return(n=e.getValue(o))==null?void 0:n.includes(t)};qe.autoRemove=e=>H(e)||!(e!=null&&e.length);const Ue=(e,o,t)=>!t.some(n=>{var i;return!((i=e.getValue(o))!=null&&i.includes(n))});Ue.autoRemove=e=>H(e)||!(e!=null&&e.length);const be=(e,o,t)=>t.some(n=>{var i;return(i=e.getValue(o))==null?void 0:i.includes(n)});be.autoRemove=e=>H(e)||!(e!=null&&e.length);const Ke=(e,o,t)=>e.getValue(o)===t;Ke.autoRemove=e=>H(e);const We=(e,o,t)=>e.getValue(o)==t;We.autoRemove=e=>H(e);const Se=(e,o,t)=>{let[n,i]=t;const r=e.getValue(o);return r>=n&&r<=i};Se.resolveFilterValue=e=>{let[o,t]=e,n=typeof o!="number"?parseFloat(o):o,i=typeof t!="number"?parseFloat(t):t,r=o===null||Number.isNaN(n)?-1/0:n,s=t===null||Number.isNaN(i)?1/0:i;if(r>s){const l=r;r=s,s=l}return[r,s]};Se.autoRemove=e=>H(e)||H(e[0])&&H(e[1]);const L={includesString:je,includesStringSensitive:Ne,equalsString:Be,arrIncludes:qe,arrIncludesAll:Ue,arrIncludesSome:be,equals:Ke,weakEquals:We,inNumberRange:Se};function H(e){return e==null||e===""}const qt={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:E("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,o)=>{e.getAutoFilterFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t?.getValue(e.id);return typeof n=="string"?L.includesString:typeof n=="number"?L.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?L.equals:Array.isArray(n)?L.arrIncludes:L.weakEquals},e.getFilterFn=()=>{var t,n;return ee(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(n=o.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?t:L[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,n,i;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((n=o.options.enableColumnFilters)!=null?n:!0)&&((i=o.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=o.getState().columnFilters)==null||(t=t.find(n=>n.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,n;return(t=(n=o.getState().columnFilters)==null?void 0:n.findIndex(i=>i.id===e.id))!=null?t:-1},e.setFilterValue=t=>{o.setColumnFilters(n=>{const i=e.getFilterFn(),r=n?.find(d=>d.id===e.id),s=k(t,r?r.value:void 0);if($e(i,s,e)){var l;return(l=n?.filter(d=>d.id!==e.id))!=null?l:[]}const u={id:e.id,value:s};if(r){var a;return(a=n?.map(d=>d.id===e.id?u:d))!=null?a:[]}return n!=null&&n.length?[...n,u]:[u]})}},createRow:(e,o)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=o=>{const t=e.getAllLeafColumns(),n=i=>{var r;return(r=k(o,i))==null?void 0:r.filter(s=>{const l=t.find(u=>u.id===s.id);if(l){const u=l.getFilterFn();if($e(u,s.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=o=>{var t,n;e.setColumnFilters(o?[]:(t=(n=e.initialState)==null?void 0:n.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function $e(e,o,t){return(e&&e.autoRemove?e.autoRemove(o,t):!1)||typeof o>"u"||typeof o=="string"&&!o}const Ut=(e,o,t)=>t.reduce((n,i)=>{const r=i.getValue(e);return n+(typeof r=="number"?r:0)},0),bt=(e,o,t)=>{let n;return t.forEach(i=>{const r=i.getValue(e);r!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}),n},Kt=(e,o,t)=>{let n;return t.forEach(i=>{const r=i.getValue(e);r!=null&&(n=r)&&(n=r)}),n},Wt=(e,o,t)=>{let n,i;return t.forEach(r=>{const s=r.getValue(e);s!=null&&(n===void 0?s>=s&&(n=i=s):(n>s&&(n=s),i{let t=0,n=0;if(o.forEach(i=>{let r=i.getValue(e);r!=null&&(r=+r)>=r&&(++t,n+=r)}),t)return n/t},Yt=(e,o)=>{if(!o.length)return;const t=o.map(r=>r.getValue(e));if(!Lt(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),i=t.sort((r,s)=>r-s);return t.length%2!==0?i[n]:(i[n-1]+i[n])/2},Zt=(e,o)=>Array.from(new Set(o.map(t=>t.getValue(e))).values()),Qt=(e,o)=>new Set(o.map(t=>t.getValue(e))).size,Jt=(e,o)=>o.length,ie={sum:Ut,min:bt,max:Kt,extent:Wt,mean:Xt,median:Yt,unique:Zt,uniqueCount:Qt,count:Jt},en={getDefaultColumnDef:()=>({aggregatedCell:e=>{var o,t;return(o=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:E("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,o)=>{e.toggleGrouping=()=>{o.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=o.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t?.getValue(e.id);if(typeof n=="number")return ie.sum;if(Object.prototype.toString.call(n)==="[object Date]")return ie.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return ee(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(n=o.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?t:ie[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=o=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(o),e.resetGrouping=o=>{var t,n;e.setGrouping(o?[]:(t=(n=e.initialState)==null?void 0:n.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,o)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const n=o.getColumn(t);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[t]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,o,t,n)=>{e.getIsGrouped=()=>o.getIsGrouped()&&o.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&o.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=t.subRows)!=null&&i.length)}}};function tn(e,o,t){if(!(o!=null&&o.length)||!t)return e;const n=e.filter(r=>!o.includes(r.id));return t==="remove"?n:[...o.map(r=>e.find(s=>s.id===r)).filter(Boolean),...n]}const nn={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:E("columnOrder",e)}),createColumn:(e,o)=>{e.getIndex=h(t=>[W(o,t)],t=>t.findIndex(n=>n.id===e.id),R(o.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=W(o,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const i=W(o,t);return((n=i[i.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=o=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(o),e.resetColumnOrder=o=>{var t;e.setColumnOrder(o?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=h(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(o,t,n)=>i=>{let r=[];if(!(o!=null&&o.length))r=i;else{const s=[...o],l=[...i];for(;l.length&&s.length;){const u=s.shift(),a=l.findIndex(d=>d.id===u);a>-1&&r.push(l.splice(a,1)[0])}r=[...r,...l]}return tn(r,t,n)},R(e.options,"debugTable"))}},re=()=>({left:[],right:[]}),on={getInitialState:e=>({columnPinning:re(),...e}),getDefaultOptions:e=>({onColumnPinningChange:E("columnPinning",e)}),createColumn:(e,o)=>{e.pin=t=>{const n=e.getLeafColumns().map(i=>i.id).filter(Boolean);o.setColumnPinning(i=>{var r,s;if(t==="right"){var l,u;return{left:((l=i?.left)!=null?l:[]).filter(p=>!(n!=null&&n.includes(p))),right:[...((u=i?.right)!=null?u:[]).filter(p=>!(n!=null&&n.includes(p))),...n]}}if(t==="left"){var a,d;return{left:[...((a=i?.left)!=null?a:[]).filter(p=>!(n!=null&&n.includes(p))),...n],right:((d=i?.right)!=null?d:[]).filter(p=>!(n!=null&&n.includes(p)))}}return{left:((r=i?.left)!=null?r:[]).filter(p=>!(n!=null&&n.includes(p))),right:((s=i?.right)!=null?s:[]).filter(p=>!(n!=null&&n.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var i,r,s;return((i=n.columnDef.enablePinning)!=null?i:!0)&&((r=(s=o.options.enableColumnPinning)!=null?s:o.options.enablePinning)!=null?r:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:n,right:i}=o.getState().columnPinning,r=t.some(l=>n?.includes(l)),s=t.some(l=>i?.includes(l));return r?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,n;const i=e.getIsPinned();return i?(t=(n=o.getState().columnPinning)==null||(n=n[i])==null?void 0:n.indexOf(e.id))!=null?t:-1:0}},createRow:(e,o)=>{e.getCenterVisibleCells=h(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(t,n,i)=>{const r=[...n??[],...i??[]];return t.filter(s=>!r.includes(s.column.id))},R(o.options,"debugRows")),e.getLeftVisibleCells=h(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),R(o.options,"debugRows")),e.getRightVisibleCells=h(()=>[e._getAllVisibleCells(),o.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.column.id===r)).filter(Boolean).map(r=>({...r,position:"right"})),R(o.options,"debugRows"))},createTable:e=>{e.setColumnPinning=o=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(o),e.resetColumnPinning=o=>{var t,n;return e.setColumnPinning(o?re():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:re())},e.getIsSomeColumnsPinned=o=>{var t;const n=e.getState().columnPinning;if(!o){var i,r;return!!((i=n.left)!=null&&i.length||(r=n.right)!=null&&r.length)}return!!((t=n[o])!=null&&t.length)},e.getLeftLeafColumns=h(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(o,t)=>(t??[]).map(n=>o.find(i=>i.id===n)).filter(Boolean),R(e.options,"debugColumns")),e.getRightLeafColumns=h(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(o,t)=>(t??[]).map(n=>o.find(i=>i.id===n)).filter(Boolean),R(e.options,"debugColumns")),e.getCenterLeafColumns=h(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n)=>{const i=[...t??[],...n??[]];return o.filter(r=>!i.includes(r.id))},R(e.options,"debugColumns"))}},Q={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},se=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),rn={getDefaultColumnDef:()=>Q,getInitialState:e=>({columnSizing:{},columnSizingInfo:se(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:E("columnSizing",e),onColumnSizingInfoChange:E("columnSizingInfo",e)}),createColumn:(e,o)=>{e.getSize=()=>{var t,n,i;const r=o.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Q.minSize,(n=r??e.columnDef.size)!=null?n:Q.size),(i=e.columnDef.maxSize)!=null?i:Q.maxSize)},e.getStart=h(t=>[t,W(o,t),o.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((i,r)=>i+r.getSize(),0),R(o.options,"debugColumns")),e.getAfter=h(t=>[t,W(o,t),o.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((i,r)=>i+r.getSize(),0),R(o.options,"debugColumns")),e.resetSize=()=>{o.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var t,n;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((n=o.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,o)=>{e.getSize=()=>{let t=0;const n=i=>{if(i.subHeaders.length)i.subHeaders.forEach(n);else{var r;t+=(r=i.column.getSize())!=null?r:0}};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const n=o.getColumn(e.column.id),i=n?.getCanResize();return r=>{if(!n||!i||(r.persist==null||r.persist(),le(r)&&r.touches&&r.touches.length>1))return;const s=e.getSize(),l=e?e.getLeafHeaders().map(C=>[C.column.id,C.column.getSize()]):[[n.id,n.getSize()]],u=le(r)?Math.round(r.touches[0].clientX):r.clientX,a={},d=(C,F)=>{typeof F=="number"&&(o.setColumnSizingInfo(P=>{var y,_;const x=o.options.columnResizeDirection==="rtl"?-1:1,z=(F-((y=P?.startOffset)!=null?y:0))*x,V=Math.max(z/((_=P?.startSize)!=null?_:0),-.999999);return P.columnSizingStart.forEach(B=>{let[U,A]=B;a[U]=Math.round(Math.max(A+A*V,0)*100)/100}),{...P,deltaOffset:z,deltaPercentage:V}}),(o.options.columnResizeMode==="onChange"||C==="end")&&o.setColumnSizing(P=>({...P,...a})))},p=C=>d("move",C),c=C=>{d("end",C),o.setColumnSizingInfo(F=>({...F,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=t||typeof document<"u"?document:null,f={moveHandler:C=>p(C.clientX),upHandler:C=>{g?.removeEventListener("mousemove",f.moveHandler),g?.removeEventListener("mouseup",f.upHandler),c(C.clientX)}},m={moveHandler:C=>(C.cancelable&&(C.preventDefault(),C.stopPropagation()),p(C.touches[0].clientX),!1),upHandler:C=>{var F;g?.removeEventListener("touchmove",m.moveHandler),g?.removeEventListener("touchend",m.upHandler),C.cancelable&&(C.preventDefault(),C.stopPropagation()),c((F=C.touches[0])==null?void 0:F.clientX)}},S=sn()?{passive:!1}:!1;le(r)?(g?.addEventListener("touchmove",m.moveHandler,S),g?.addEventListener("touchend",m.upHandler,S)):(g?.addEventListener("mousemove",f.moveHandler,S),g?.addEventListener("mouseup",f.upHandler,S)),o.setColumnSizingInfo(C=>({...C,startOffset:u,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=o=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(o),e.setColumnSizingInfo=o=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(o),e.resetColumnSizing=o=>{var t;e.setColumnSizing(o?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=o=>{var t;e.setColumnSizingInfo(o?se():(t=e.initialState.columnSizingInfo)!=null?t:se())},e.getTotalSize=()=>{var o,t;return(o=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getLeftTotalSize=()=>{var o,t;return(o=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getCenterTotalSize=()=>{var o,t;return(o=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getRightTotalSize=()=>{var o,t;return(o=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0}}};let J=null;function sn(){if(typeof J=="boolean")return J;let e=!1;try{const o={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,o),window.removeEventListener("test",t)}catch{e=!1}return J=e,J}function le(e){return e.type==="touchstart"}const ln={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:E("columnVisibility",e)}),createColumn:(e,o)=>{e.toggleVisibility=t=>{e.getCanHide()&&o.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const i=e.columns;return(t=i.length?i.some(r=>r.getIsVisible()):(n=o.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=o.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,o)=>{e._getAllVisibleCells=h(()=>[e.getAllCells(),o.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),R(o.options,"debugRows")),e.getVisibleCells=h(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,i)=>[...t,...n,...i],R(o.options,"debugRows"))},createTable:e=>{const o=(t,n)=>h(()=>[n(),n().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),R(e.options,"debugColumns"));e.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=(n=t)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,r)=>({...i,[r.id]:t||!(r.getCanHide!=null&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible((n=t.target)==null?void 0:n.checked)}}};function W(e,o){return o?o==="center"?e.getCenterVisibleLeafColumns():o==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const un={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},an={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:E("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[o.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,o)=>{e.getCanGlobalFilter=()=>{var t,n,i,r;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=o.options.enableGlobalFilter)!=null?n:!0)&&((i=o.options.enableFilters)!=null?i:!0)&&((r=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>L.includesString,e.getGlobalFilterFn=()=>{var o,t;const{globalFilterFn:n}=e.options;return ee(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(o=(t=e.options.filterFns)==null?void 0:t[n])!=null?o:L[n]},e.setGlobalFilter=o=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(o)},e.resetGlobalFilter=o=>{e.setGlobalFilter(o?void 0:e.initialState.globalFilter)}}},gn={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:E("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let o=!1,t=!1;e._autoResetExpanded=()=>{var n,i;if(!o){e._queue(()=>{o=!0});return}if((n=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var i,r;e.setExpanded(n?{}:(i=(r=e.initialState)==null?void 0:r.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const s=r.split(".");n=Math.max(n,s.length)}),n},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,o)=>{e.toggleExpanded=t=>{o.setExpanded(n=>{var i;const r=n===!0?!0:!!(n!=null&&n[e.id]);let s={};if(n===!0?Object.keys(o.getRowModel().rowsById).forEach(l=>{s[l]=!0}):s=n,t=(i=t)!=null?i:!r,!r&&t)return{...s,[e.id]:!0};if(r&&!t){const{[e.id]:l,...u}=s;return u}return n})},e.getIsExpanded=()=>{var t;const n=o.getState().expanded;return!!((t=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(e))!=null?t:n===!0||n?.[e.id])},e.getCanExpand=()=>{var t,n,i;return(t=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(e))!=null?t:((n=o.options.enableExpanding)!=null?n:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let t=!0,n=e;for(;t&&n.parentId;)n=o.getRow(n.parentId,!0),t=n.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},de=0,ce=10,ue=()=>({pageIndex:de,pageSize:ce}),dn={getInitialState:e=>({...e,pagination:{...ue(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:E("pagination",e)}),createTable:e=>{let o=!1,t=!1;e._autoResetPageIndex=()=>{var n,i;if(!o){e._queue(()=>{o=!0});return}if((n=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const i=r=>k(n,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=n=>{var i;e.setPagination(n?ue():(i=e.initialState.pagination)!=null?i:ue())},e.setPageIndex=n=>{e.setPagination(i=>{let r=k(n,i.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,s)),{...i,pageIndex:r}})},e.resetPageIndex=n=>{var i,r;e.setPageIndex(n?de:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageIndex)!=null?i:de)},e.resetPageSize=n=>{var i,r;e.setPageSize(n?ce:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageSize)!=null?i:ce)},e.setPageSize=n=>{e.setPagination(i=>{const r=Math.max(1,k(n,i.pageSize)),s=i.pageSize*i.pageIndex,l=Math.floor(s/r);return{...i,pageIndex:l,pageSize:r}})},e.setPageCount=n=>e.setPagination(i=>{var r;let s=k(n,(r=e.options.pageCount)!=null?r:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=h(()=>[e.getPageCount()],n=>{let i=[];return n&&n>0&&(i=[...new Array(n)].fill(null).map((r,s)=>s)),i},R(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:ne.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},ae=()=>({top:[],bottom:[]}),cn={getInitialState:e=>({rowPinning:ae(),...e}),getDefaultOptions:e=>({onRowPinningChange:E("rowPinning",e)}),createRow:(e,o)=>{e.pin=(t,n,i)=>{const r=n?e.getLeafRows().map(u=>{let{id:a}=u;return a}):[],s=i?e.getParentRows().map(u=>{let{id:a}=u;return a}):[],l=new Set([...s,e.id,...r]);o.setRowPinning(u=>{var a,d;if(t==="bottom"){var p,c;return{top:((p=u?.top)!=null?p:[]).filter(m=>!(l!=null&&l.has(m))),bottom:[...((c=u?.bottom)!=null?c:[]).filter(m=>!(l!=null&&l.has(m))),...Array.from(l)]}}if(t==="top"){var g,f;return{top:[...((g=u?.top)!=null?g:[]).filter(m=>!(l!=null&&l.has(m))),...Array.from(l)],bottom:((f=u?.bottom)!=null?f:[]).filter(m=>!(l!=null&&l.has(m)))}}return{top:((a=u?.top)!=null?a:[]).filter(m=>!(l!=null&&l.has(m))),bottom:((d=u?.bottom)!=null?d:[]).filter(m=>!(l!=null&&l.has(m)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:n,enablePinning:i}=o.options;return typeof n=="function"?n(e):(t=n??i)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:n,bottom:i}=o.getState().rowPinning,r=t.some(l=>n?.includes(l)),s=t.some(l=>i?.includes(l));return r?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,n;const i=e.getIsPinned();if(!i)return-1;const r=(t=i==="top"?o.getTopRows():o.getBottomRows())==null?void 0:t.map(s=>{let{id:l}=s;return l});return(n=r?.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=o=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(o),e.resetRowPinning=o=>{var t,n;return e.setRowPinning(o?ae():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:ae())},e.getIsSomeRowsPinned=o=>{var t;const n=e.getState().rowPinning;if(!o){var i,r;return!!((i=n.top)!=null&&i.length||(r=n.bottom)!=null&&r.length)}return!!((t=n[o])!=null&&t.length)},e._getPinnedRows=(o,t,n)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(t??[]).map(s=>{const l=e.getRow(s,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(s=>o.find(l=>l.id===s))).filter(Boolean).map(s=>({...s,position:n}))},e.getTopRows=h(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(o,t)=>e._getPinnedRows(o,t,"top"),R(e.options,"debugRows")),e.getBottomRows=h(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(o,t)=>e._getPinnedRows(o,t,"bottom"),R(e.options,"debugRows")),e.getCenterRows=h(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(o,t,n)=>{const i=new Set([...t??[],...n??[]]);return o.filter(r=>!i.has(r.id))},R(e.options,"debugRows"))}},fn={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:E("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=o=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(o),e.resetRowSelection=o=>{var t;return e.setRowSelection(o?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=o=>{e.setRowSelection(t=>{o=typeof o<"u"?o:!e.getIsAllRowsSelected();const n={...t},i=e.getPreGroupedRowModel().flatRows;return o?i.forEach(r=>{r.getCanSelect()&&(n[r.id]=!0)}):i.forEach(r=>{delete n[r.id]}),n})},e.toggleAllPageRowsSelected=o=>e.setRowSelection(t=>{const n=typeof o<"u"?o:!e.getIsAllPageRowsSelected(),i={...t};return e.getRowModel().rows.forEach(r=>{fe(i,r.id,n,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=h(()=>[e.getState().rowSelection,e.getCoreRowModel()],(o,t)=>Object.keys(o).length?ge(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getFilteredSelectedRowModel=h(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(o,t)=>Object.keys(o).length?ge(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getGroupedSelectedRowModel=h(()=>[e.getState().rowSelection,e.getSortedRowModel()],(o,t)=>Object.keys(o).length?ge(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const o=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let n=!!(o.length&&Object.keys(t).length);return n&&o.some(i=>i.getCanSelect()&&!t[i.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const o=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:t}=e.getState();let n=!!o.length;return n&&o.some(i=>!t[i.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var o;const t=Object.keys((o=e.getState().rowSelection)!=null?o:{}).length;return t>0&&t{const o=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:o.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>o=>{e.toggleAllRowsSelected(o.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>o=>{e.toggleAllPageRowsSelected(o.target.checked)}},createRow:(e,o)=>{e.toggleSelected=(t,n)=>{const i=e.getIsSelected();o.setRowSelection(r=>{var s;if(t=typeof t<"u"?t:!i,e.getCanSelect()&&i===t)return r;const l={...r};return fe(l,e.id,t,(s=n?.selectChildren)!=null?s:!0,o),l})},e.getIsSelected=()=>{const{rowSelection:t}=o.getState();return Ce(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=o.getState();return pe(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=o.getState();return pe(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(e):(t=o.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(e):(t=o.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(e):(t=o.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected((i=n.target)==null?void 0:i.checked)}}}},fe=(e,o,t,n,i)=>{var r;const s=i.getRow(o,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),s.getCanSelect()&&(e[o]=!0)):delete e[o],n&&(r=s.subRows)!=null&&r.length&&s.getCanSelectSubRows()&&s.subRows.forEach(l=>fe(e,l.id,t,n,i))};function ge(e,o){const t=e.getState().rowSelection,n=[],i={},r=function(s,l){return s.map(u=>{var a;const d=Ce(u,t);if(d&&(n.push(u),i[u.id]=u),(a=u.subRows)!=null&&a.length&&(u={...u,subRows:r(u.subRows)}),d)return u}).filter(Boolean)};return{rows:r(o.rows),flatRows:n,rowsById:i}}function Ce(e,o){var t;return(t=o[e.id])!=null?t:!1}function pe(e,o,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let i=!0,r=!1;return e.subRows.forEach(s=>{if(!(r&&!i)&&(s.getCanSelect()&&(Ce(s,o)?r=!0:i=!1),s.subRows&&s.subRows.length)){const l=pe(s,o);l==="all"?r=!0:(l==="some"&&(r=!0),i=!1)}}),i?"all":r?"some":!1}const me=/([0-9]+)/gm,pn=(e,o,t)=>Xe(O(e.getValue(t)).toLowerCase(),O(o.getValue(t)).toLowerCase()),mn=(e,o,t)=>Xe(O(e.getValue(t)),O(o.getValue(t))),Sn=(e,o,t)=>he(O(e.getValue(t)).toLowerCase(),O(o.getValue(t)).toLowerCase()),Cn=(e,o,t)=>he(O(e.getValue(t)),O(o.getValue(t))),hn=(e,o,t)=>{const n=e.getValue(t),i=o.getValue(t);return n>i?1:nhe(e.getValue(t),o.getValue(t));function he(e,o){return e===o?0:e>o?1:-1}function O(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Xe(e,o){const t=e.split(me).filter(Boolean),n=o.split(me).filter(Boolean);for(;t.length&&n.length;){const i=t.shift(),r=n.shift(),s=parseInt(i,10),l=parseInt(r,10),u=[s,l].sort();if(isNaN(u[0])){if(i>r)return 1;if(r>i)return-1;continue}if(isNaN(u[1]))return isNaN(s)?-1:1;if(s>l)return 1;if(l>s)return-1}return t.length-n.length}const K={alphanumeric:pn,alphanumericCaseSensitive:mn,text:Sn,textCaseSensitive:Cn,datetime:hn,basic:Rn},wn={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:E("sorting",e),isMultiSortEvent:o=>o.shiftKey}),createColumn:(e,o)=>{e.getAutoSortingFn=()=>{const t=o.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const i of t){const r=i?.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return K.datetime;if(typeof r=="string"&&(n=!0,r.split(me).length>1))return K.alphanumeric}return n?K.text:K.basic},e.getAutoSortDir=()=>{const t=o.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,n;if(!e)throw new Error;return ee(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(n=o.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?t:K[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const i=e.getNextSortingOrder(),r=typeof t<"u"&&t!==null;o.setSorting(s=>{const l=s?.find(g=>g.id===e.id),u=s?.findIndex(g=>g.id===e.id);let a=[],d,p=r?t:i==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&n?l?d="toggle":d="add":s!=null&&s.length&&u!==s.length-1?d="replace":l?d="toggle":d="replace",d==="toggle"&&(r||i||(d="remove")),d==="add"){var c;a=[...s,{id:e.id,desc:p}],a.splice(0,a.length-((c=o.options.maxMultiSortColCount)!=null?c:Number.MAX_SAFE_INTEGER))}else d==="toggle"?a=s.map(g=>g.id===e.id?{...g,desc:p}:g):d==="remove"?a=s.filter(g=>g.id!==e.id):a=[{id:e.id,desc:p}];return a})},e.getFirstSortDir=()=>{var t,n;return((t=(n=e.columnDef.sortDescFirst)!=null?n:o.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var n,i;const r=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==r&&((n=o.options.enableSortingRemoval)==null||n)&&(!(t&&(i=o.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":r},e.getCanSort=()=>{var t,n;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((n=o.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,n;return(t=(n=e.columnDef.enableMultiSort)!=null?n:o.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const n=(t=o.getState().sorting)==null?void 0:t.find(i=>i.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,n;return(t=(n=o.getState().sorting)==null?void 0:n.findIndex(i=>i.id===e.id))!=null?t:-1},e.clearSorting=()=>{o.setSorting(t=>t!=null&&t.length?t.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return n=>{t&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=o=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(o),e.resetSorting=o=>{var t,n;e.setSorting(o?[]:(t=(n=e.initialState)==null?void 0:n.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},vn=[jt,ln,nn,on,Bt,qt,un,an,wn,en,gn,dn,cn,fn,rn];function _n(e){var o,t;const n=[...vn,...(o=e._features)!=null?o:[]];let i={_features:n};const r=i._features.reduce((c,g)=>Object.assign(c,g.getDefaultOptions==null?void 0:g.getDefaultOptions(i)),{}),s=c=>i.options.mergeOptions?i.options.mergeOptions(r,c):{...r,...c};let u={...{},...(t=e.initialState)!=null?t:{}};i._features.forEach(c=>{var g;u=(g=c.getInitialState==null?void 0:c.getInitialState(u))!=null?g:u});const a=[];let d=!1;const p={_features:n,options:{...r,...e},initialState:u,_queue:c=>{a.push(c),d||(d=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{i.setState(i.initialState)},setOptions:c=>{const g=k(c,i.options);i.options=s(g)},getState:()=>i.options.state,setState:c=>{i.options.onStateChange==null||i.options.onStateChange(c)},_getRowId:(c,g,f)=>{var m;return(m=i.options.getRowId==null?void 0:i.options.getRowId(c,g,f))!=null?m:`${f?[f.id,g].join("."):g}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(c,g)=>{let f=(g?i.getPrePaginationRowModel():i.getRowModel()).rowsById[c];if(!f&&(f=i.getCoreRowModel().rowsById[c],!f))throw new Error;return f},_getDefaultColumnDef:h(()=>[i.options.defaultColumn],c=>{var g;return c=(g=c)!=null?g:{},{header:f=>{const m=f.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:f=>{var m,S;return(m=(S=f.renderValue())==null||S.toString==null?void 0:S.toString())!=null?m:null},...i._features.reduce((f,m)=>Object.assign(f,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...c}},R(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:h(()=>[i._getColumnDefs()],c=>{const g=function(f,m,S){return S===void 0&&(S=0),f.map(C=>{const F=Tt(i,C,S,m),P=C;return F.columns=P.columns?g(P.columns,F,S+1):[],F})};return g(c)},R(e,"debugColumns")),getAllFlatColumns:h(()=>[i.getAllColumns()],c=>c.flatMap(g=>g.getFlatColumns()),R(e,"debugColumns")),_getAllFlatColumnsById:h(()=>[i.getAllFlatColumns()],c=>c.reduce((g,f)=>(g[f.id]=f,g),{}),R(e,"debugColumns")),getAllLeafColumns:h(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(c,g)=>{let f=c.flatMap(m=>m.getLeafColumns());return g(f)},R(e,"debugColumns")),getColumn:c=>i._getAllFlatColumnsById()[c]};Object.assign(i,p);for(let c=0;ch(()=>[e.options.data],o=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(i,r,s){r===void 0&&(r=0);const l=[];for(let a=0;ae._autoResetPageIndex()))}function xn(){return e=>h(()=>[e.getState().sorting,e.getPreSortedRowModel()],(o,t)=>{if(!t.rows.length||!(o!=null&&o.length))return t;const n=e.getState().sorting,i=[],r=n.filter(u=>{var a;return(a=e.getColumn(u.id))==null?void 0:a.getCanSort()}),s={};r.forEach(u=>{const a=e.getColumn(u.id);a&&(s[u.id]={sortUndefined:a.columnDef.sortUndefined,invertSorting:a.columnDef.invertSorting,sortingFn:a.getSortingFn()})});const l=u=>{const a=u.map(d=>({...d}));return a.sort((d,p)=>{for(let g=0;g{var p;i.push(d),(p=d.subRows)!=null&&p.length&&(d.subRows=l(d.subRows))}),a};return{rows:l(t.rows),flatRows:i,rowsById:t.rowsById}},R(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** * react-table * * Copyright (c) TanStack @@ -19,4 +19,4 @@ import{r as v,N as it,W as Me,J as Ve,h as T,j as w,g as I,m as De,p as D,O as G * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ze(e,o){return e?Pn(e)?v.createElement(e,o):e:null}function Pn(e){return Mn(e)||typeof e=="function"||yn(e)}function Mn(e){return typeof e=="function"&&(()=>{const o=Object.getPrototypeOf(e);return o.prototype&&o.prototype.isReactComponent})()}function yn(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function $n(e){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=v.useState(()=>({current:_n(o)})),[n,i]=v.useState(()=>t.current.initialState);return t.current.setOptions(r=>({...r,...e,state:{...n,...e.state},onStateChange:s=>{i(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}function In(e){const{onDoubleClick:o,onMouseDown:t,onTouchStart:n,isResizing:i}=e;return w.jsx(I.span,{className:He("result-list-resizer",i&&"result-list-resizer--is-resizing"),onDoubleClick:o,onMouseDown:t,onTouchStart:n,onClick:r=>r.stopPropagation()})}function Vn(e){const{isSorted:o}=e;return w.jsx(I.span,{ml:"4",className:"result-list-sort-indicator",children:o?o==="desc"?w.jsx(Et,{}):w.jsx(Ht,{}):null})}function Dn(e){const{data:o,columns:t,onSelectionChange:n,selectionMode:i}=e,[r,s]=v.useState([]),l=zt(e.selectionMode),[u,a]=v.useState({}),d=v.useMemo(()=>r.filter(g=>t.some(f=>f.id===g.id)),[r,t]),p=mt(g=>{const f=zn(u,g);if(f!==u&&(a(f),n)){const m=c.getCoreRowModel().rowsById,S=[];for(const C of Object.keys(f)){if(!f[C])continue;const F=m[C];F&&S.push(F.original)}n({features:S,getFeatureIds:()=>S.map(C=>C.id)})}}),c=$n({columns:t,data:o,getRowId(g){return String(g.id)},columnResizeMode:"onChange",getCoreRowModel:Fn(),enableRowSelection:!0,enableMultiRowSelection:i==="multi",onRowSelectionChange:p,onSortingChange:s,getSortedRowModel:xn(),state:{sorting:d,rowSelection:u}});return v.useEffect(()=>{l&&i!==l&&c.resetRowSelection()},[c,l,i]),{table:c,sorting:r,rowSelection:u}}function zn(e,o){return typeof o=="function"?o(e):o}const En=lt("result-list:DataTable");function Hn(e){const o=Te(),{memoizeRows:t}=e,{table:n}=Dn(e),i=!!n.getState().columnSizingInfo.isResizingColumn,r=kn(n),[s,l]=v.useState(!1);return v.useEffect(()=>{l(i)},[i]),n.getRowModel().rows.length?w.jsxs(ke,{className:He("result-list-table",{"result-list-table--is-resizing":i}),style:r,width:"99.9%",onClickCapture:u=>{s&&(En.debug("Blocking click event because resizing is active"),u.stopPropagation(),u.preventDefault())},children:[w.jsx(Dt,{children:n.getHeaderGroups().map(u=>w.jsx(Gn,{headerGroup:u},u.id))}),w.jsx($t,{className:"result-list-table-body",children:t||i?w.jsx(Ln,{table:n}):w.jsx(Ye,{table:n})})]}):w.jsx(I.div,{className:"result-list-no-data-message",children:o.formatMessage({id:"noDataMessage"})})}function Gn(e){const{headerGroup:o}=e,t=ut("colors","trails.100");return w.jsx(Oe,{className:"result-list-headers",children:o.headers.map((n,i)=>w.jsx(An,{header:n,index:i,borderColor:t},n.id))},o.id)}function An(e){const{header:o,index:t,borderColor:n}=e,i=`calc(var(--header-${o.id}-size) * 1px)`;return w.jsxs(Vt,{className:"result-list-header",tabIndex:0,"aria-sort":On(o.column.getIsSorted()),onClick:()=>o.column.getCanSort()&&o.column.toggleSorting(),cursor:o.column.getCanSort()?"pointer":"unset",style:{width:t===0?"50px":i},onKeyDown:r=>{r.key==="Enter"&&o.column.getCanSort()&&o.column.toggleSorting(void 0)},border:"none",boxShadow:`inset 0 -2px 0 0 ${n}`,_focusVisible:{textDecorationLine:"underline"},_focus:{outline:"none"},children:[Ze(o.column.columnDef.header,o.getContext()),o.column.getCanSort()&&w.jsx(Vn,{isSorted:o.column.getIsSorted()}),w.jsx(In,{onDoubleClick:()=>o.column.resetSize(),onMouseDown:o.getResizeHandler(),onTouchStart:o.getResizeHandler(),isResizing:o.column.getIsResizing()})]})}function Ye({table:e}){return e.getRowModel().rows.map(o=>w.jsx(Oe,{className:"result-list-table-row",children:o.getVisibleCells().map(t=>{const n=`calc(var(--header-${t.column.id}-size) * 1px)`;return w.jsx(It,{style:{width:n},className:"result-list-table-row",children:Ze(t.column.columnDef.cell,t.getContext())},t.id)})},o.id))}function Ln({table:e}){return at.useMemo(()=>w.jsx(Ye,{table:e}),[e,e.getSortedRowModel().rows,e.getSelectedRowModel().rows])}function kn(e){const o=e.getState().columnSizingInfo,t=e.getState().columnSizing,n=e.getFlatHeaders();return v.useMemo(()=>{const i={};for(let r=0;rw.jsx(n,{...t}),[n,t]);return o?w.jsx(gt,{label:o,placement:"right",closeOnClick:!1,children:w.jsx(I.span,{children:i})}):i}function Tn(e){const o=v.useId(),{isIndeterminate:t,...n}=e;return w.jsx(Le,{name:o,...n})}const Je=70,Qe=At();function jn(e){const{columns:o,intl:t,tableWidth:n,formatOptions:i,selectionMode:r,selectionStyle:s}=e,l=n===void 0?void 0:Un(o,n),u=qn(t,r,s),a=o.map((d,p)=>{const c=d.width||l,g=d.id||d.propertyName&&Kn(d.propertyName)||String(p);return Nn({id:"result-list-col_"+g,column:d,intl:t,columnWidth:c,formatOptions:i})});return[u,...a]}function Nn(e){const{id:o,column:t,columnWidth:n,formatOptions:i,intl:r}=e,{propertyName:s,getPropertyValue:l}=t;if(!(l!=null||s!=null))throw new Error("Display columns are not yet implemented. You must either specify 'propertyName' or 'getPropertyValue'.");return Qe.accessor(a=>l?.(a)??a.properties?.[s],{id:o,cell:a=>{const d=a.getValue();return t.renderCell?t.renderCell({feature:a.row.original,value:d}):Bn(d,r,i)},header:t.displayName??t.propertyName,size:n})}function Bn(e,o,t){if(e==null)return"";const n=typeof e,i=r=>Number.isNaN(r)?"":o.formatNumber(r,t?.numberOptions);switch(n){case"number":return i(e);case"bigint":return i(e);case"boolean":return o.formatMessage({id:`displayBoolean.${e}`});case"string":return e;case"object":return e instanceof Date?o.formatDate(e,t?.dateOptions):e.toString();default:return String(e)}}function qn(e,o,t){return Qe.display({id:"selection-buttons",size:Je,enableSorting:!1,header:({table:n})=>{if(o==="multi")return w.jsx(I.div,{display:"inline-block",onClick:i=>{i.stopPropagation()},className:"result-list-select-all-container",children:w.jsx(Ie,{className:"result-list-select-all-checkbox",isChecked:n.getIsAllRowsSelected(),isIndeterminate:n.getIsSomeRowsSelected(),onChange:n.getToggleAllRowsSelectedHandler(),toolTipLabel:bn(n,e)})})},cell:({row:n})=>{const i=t==="radio"?"result-list-select-row-radio":"result-list-select-row-checkbox";return w.jsx(I.div,{display:"inline-block",onClick:r=>{r.stopPropagation()},className:"result-list-select-row-container",children:w.jsx(Ie,{mode:t,className:i,isChecked:n.getIsSelected(),isDisabled:!n.getCanSelect(),isIndeterminate:n.getIsSomeSelected(),onChange:n.getToggleSelectedHandler(),"aria-label":e.formatMessage({id:"ariaLabel.selectSingle"})})})}})}function Un(e,o,t=Je){const n=e.reduce((s,l)=>(l.width??0)+s,0),i=e.reduce((s,l)=>l.width===void 0?s+1:s,0);return(o-t-n)/i}function bn(e,o){return e.getIsAllRowsSelected()?o.formatMessage({id:"deSelectAllTooltip"}):o.formatMessage({id:"selectAllTooltip"})}function Kn(e){return e.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}const io=e=>{const{containerProps:o}=ft("result-list",e),t=Te(),{input:{data:n,columns:i,formatOptions:r},memoizeRows:s=!1,onSelectionChange:l,enableZoom:u=!0,zoomOptions:a,enableHighlight:d=!0,selectionMode:p="multi",selectionStyle:c=p==="single"?"radio":"checkbox",highlightOptions:g}=e,{map:f}=pt(e);if(i.length===0)throw Error("No columns were defined. The result list cannot be displayed.");if(p==="multi"&&c==="radio")throw new Error("Cannot mix multi selection with selectionStyle 'radio'.");const m=v.useRef(null),S=Wn(m),C=v.useMemo(()=>jn({columns:i,intl:t,tableWidth:S,formatOptions:r,selectionMode:p,selectionStyle:c}),[i,t,S,r,p,c]);return v.useEffect(()=>{if(f&&(u&&f.zoom(n,a),d)){const F=f.highlight(n,g);return()=>F.destroy()}},[f,n,a,u,d,g]),w.jsx(dt,{...o,height:"100%",overflowY:"auto",ref:m,children:w.jsx(Hn,{columns:C,data:n,memoizeRows:s,selectionMode:p,onSelectionChange:l})})};function Wn(e){const[o,t]=v.useState();return v.useEffect(()=>{if(!e?.current)return;const n=new ResizeObserver(i=>{const r=i[0]?.contentBoxSize[0]?.inlineSize;r!=null&&t(r)});return n.observe(e.current),()=>n.disconnect()},[e]),o}export{io as R,xt as a,Le as b,wt as s}; + */function Ye(e,o){return e?Pn(e)?v.createElement(e,o):e:null}function Pn(e){return Mn(e)||typeof e=="function"||yn(e)}function Mn(e){return typeof e=="function"&&(()=>{const o=Object.getPrototypeOf(e);return o.prototype&&o.prototype.isReactComponent})()}function yn(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function $n(e){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=v.useState(()=>({current:_n(o)})),[n,i]=v.useState(()=>t.current.initialState);return t.current.setOptions(r=>({...r,...e,state:{...n,...e.state},onStateChange:s=>{i(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}function In(e){const{onDoubleClick:o,onMouseDown:t,onTouchStart:n,isResizing:i}=e;return w.jsx(I.span,{className:He("result-list-resizer",i&&"result-list-resizer--is-resizing"),onDoubleClick:o,onMouseDown:t,onTouchStart:n,onClick:r=>r.stopPropagation()})}function Vn(e){const{isSorted:o}=e;return w.jsx(I.span,{ml:"4",className:"result-list-sort-indicator",children:o?o==="desc"?w.jsx(Et,{}):w.jsx(Ht,{}):null})}function Dn(e){const{data:o,columns:t,onSelectionChange:n,selectionMode:i}=e,[r,s]=v.useState([]),l=zt(e.selectionMode),[u,a]=v.useState({}),d=v.useMemo(()=>r.filter(g=>t.some(f=>f.id===g.id)),[r,t]),p=mt(g=>{const f=zn(u,g);if(f!==u&&(a(f),n)){const m=c.getCoreRowModel().rowsById,S=[];for(const C of Object.keys(f)){if(!f[C])continue;const F=m[C];F&&S.push(F.original)}n({features:S,getFeatureIds:()=>S.map(C=>C.id)})}}),c=$n({columns:t,data:o,getRowId(g){return String(g.id)},columnResizeMode:"onChange",getCoreRowModel:Fn(),enableRowSelection:!0,enableMultiRowSelection:i==="multi",onRowSelectionChange:p,onSortingChange:s,getSortedRowModel:xn(),state:{sorting:d,rowSelection:u}});return v.useEffect(()=>{l&&i!==l&&c.resetRowSelection()},[c,l,i]),{table:c,sorting:r,rowSelection:u}}function zn(e,o){return typeof o=="function"?o(e):o}const En=lt("result-list:DataTable");function Hn(e){const o=Te(),{memoizeRows:t}=e,{table:n}=Dn(e),i=!!n.getState().columnSizingInfo.isResizingColumn,r=kn(n),[s,l]=v.useState(!1);return v.useEffect(()=>{l(i)},[i]),n.getRowModel().rows.length?w.jsxs(ke,{className:He("result-list-table",{"result-list-table--is-resizing":i}),style:r,width:"99.9%",onClickCapture:u=>{s&&(En.debug("Blocking click event because resizing is active"),u.stopPropagation(),u.preventDefault())},children:[w.jsx(Dt,{children:n.getHeaderGroups().map(u=>w.jsx(Gn,{headerGroup:u},u.id))}),w.jsx($t,{className:"result-list-table-body",children:t||i?w.jsx(Ln,{table:n}):w.jsx(Ze,{table:n})})]}):w.jsx(I.div,{className:"result-list-no-data-message",children:o.formatMessage({id:"noDataMessage"})})}function Gn(e){const{headerGroup:o}=e,t=ut("colors","trails.100");return w.jsx(Oe,{className:"result-list-headers",children:o.headers.map((n,i)=>w.jsx(An,{header:n,index:i,borderColor:t},n.id))},o.id)}function An(e){const{header:o,index:t,borderColor:n}=e,i=`calc(var(--header-${o.id}-size) * 1px)`;return w.jsxs(Vt,{className:"result-list-header",tabIndex:0,"aria-sort":On(o.column.getIsSorted()),onClick:()=>o.column.getCanSort()&&o.column.toggleSorting(),cursor:o.column.getCanSort()?"pointer":"unset",style:{width:t===0?"50px":i},onKeyDown:r=>{r.key==="Enter"&&o.column.getCanSort()&&o.column.toggleSorting(void 0)},border:"none",boxShadow:`inset 0 -2px 0 0 ${n}`,_focusVisible:{textDecorationLine:"underline"},_focus:{outline:"none"},children:[Ye(o.column.columnDef.header,o.getContext()),o.column.getCanSort()&&w.jsx(Vn,{isSorted:o.column.getIsSorted()}),w.jsx(In,{onDoubleClick:()=>o.column.resetSize(),onMouseDown:o.getResizeHandler(),onTouchStart:o.getResizeHandler(),isResizing:o.column.getIsResizing()})]})}function Ze({table:e}){return e.getRowModel().rows.map(o=>w.jsx(Oe,{className:"result-list-table-row",children:o.getVisibleCells().map(t=>{const n=`calc(var(--header-${t.column.id}-size) * 1px)`;return w.jsx(It,{style:{width:n},className:"result-list-table-row",children:Ye(t.column.columnDef.cell,t.getContext())},t.id)})},o.id))}function Ln({table:e}){return at.useMemo(()=>w.jsx(Ze,{table:e}),[e,e.getSortedRowModel().rows,e.getSelectedRowModel().rows])}function kn(e){const o=e.getState().columnSizingInfo,t=e.getState().columnSizing,n=e.getFlatHeaders();return v.useMemo(()=>{const i={};for(let r=0;rw.jsx(n,{...t}),[n,t]);return o?w.jsx(gt,{label:o,placement:"right",closeOnClick:!1,children:w.jsx(I.span,{children:i})}):i}function Tn(e){const o=v.useId(),{isIndeterminate:t,...n}=e;return w.jsx(Le,{name:o,...n})}const Qe=70,Je=At();function jn(e){const{columns:o,intl:t,tableWidth:n,formatOptions:i,selectionMode:r,selectionStyle:s}=e,l=n===void 0?void 0:Un(o,n),u=qn(t,r,s),a=o.map((d,p)=>{const c=d.width||l,g=d.id||d.propertyName&&Kn(d.propertyName)||String(p);return Nn({id:"result-list-col_"+g,column:d,intl:t,columnWidth:c,formatOptions:i})});return[u,...a]}function Nn(e){const{id:o,column:t,columnWidth:n,formatOptions:i,intl:r}=e,{propertyName:s,getPropertyValue:l}=t;if(!(l!=null||s!=null))throw new Error("Display columns are not yet implemented. You must either specify 'propertyName' or 'getPropertyValue'.");return Je.accessor(a=>l?.(a)??a.properties?.[s],{id:o,cell:a=>{const d=a.getValue();return t.renderCell?t.renderCell({feature:a.row.original,value:d}):Bn(d,r,i)},header:t.displayName??t.propertyName,size:n})}function Bn(e,o,t){if(e==null)return"";const n=typeof e,i=r=>Number.isNaN(r)?"":o.formatNumber(r,t?.numberOptions);switch(n){case"number":return i(e);case"bigint":return i(e);case"boolean":return o.formatMessage({id:`displayBoolean.${e}`});case"string":return e;case"object":return e instanceof Date?o.formatDate(e,t?.dateOptions):e.toString();default:return String(e)}}function qn(e,o,t){return Je.display({id:"selection-buttons",size:Qe,enableSorting:!1,header:({table:n})=>{if(o==="multi")return w.jsx(I.div,{display:"inline-block",onClick:i=>{i.stopPropagation()},className:"result-list-select-all-container",children:w.jsx(Ie,{className:"result-list-select-all-checkbox",isChecked:n.getIsAllRowsSelected(),isIndeterminate:n.getIsSomeRowsSelected(),onChange:n.getToggleAllRowsSelectedHandler(),toolTipLabel:bn(n,e)})})},cell:({row:n})=>{const i=t==="radio"?"result-list-select-row-radio":"result-list-select-row-checkbox";return w.jsx(I.div,{display:"inline-block",onClick:r=>{r.stopPropagation()},className:"result-list-select-row-container",children:w.jsx(Ie,{mode:t,className:i,isChecked:n.getIsSelected(),isDisabled:!n.getCanSelect(),isIndeterminate:n.getIsSomeSelected(),onChange:n.getToggleSelectedHandler(),"aria-label":e.formatMessage({id:"ariaLabel.selectSingle"})})})}})}function Un(e,o,t=Qe){const n=e.reduce((s,l)=>(l.width??0)+s,0),i=e.reduce((s,l)=>l.width===void 0?s+1:s,0);return(o-t-n)/i}function bn(e,o){return e.getIsAllRowsSelected()?o.formatMessage({id:"deSelectAllTooltip"}):o.formatMessage({id:"selectAllTooltip"})}function Kn(e){return e.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}const io=e=>{const{containerProps:o}=ft("result-list",e),t=Te(),{input:{data:n,columns:i,formatOptions:r},memoizeRows:s=!1,onSelectionChange:l,enableZoom:u=!0,zoomOptions:a,enableHighlight:d=!0,selectionMode:p="multi",selectionStyle:c=p==="single"?"radio":"checkbox",highlightOptions:g}=e,{map:f}=pt(e);if(i.length===0)throw Error("No columns were defined. The result list cannot be displayed.");if(p==="multi"&&c==="radio")throw new Error("Cannot mix multi selection with selectionStyle 'radio'.");const m=v.useRef(null),S=Wn(m),C=v.useMemo(()=>jn({columns:i,intl:t,tableWidth:S,formatOptions:r,selectionMode:p,selectionStyle:c}),[i,t,S,r,p,c]);return v.useEffect(()=>{if(f&&(u&&f.zoom(n,a),d)){const F=f.highlight(n,g);return()=>F.destroy()}},[f,n,a,u,d,g]),w.jsx(dt,{...o,height:"100%",overflowY:"auto",ref:m,children:w.jsx(Hn,{columns:C,data:n,memoizeRows:s,selectionMode:p,onSelectionChange:l})})};function Wn(e){const[o,t]=v.useState();return v.useEffect(()=>{if(!e?.current)return;const n=new ResizeObserver(i=>{const r=i[0]?.contentBoxSize[0]?.inlineSize;r!=null&&t(r)});return n.observe(e.current),()=>n.disconnect()},[e]),o}export{io as R,xt as a,Le as b,wt as s}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/Cy4dgg1WoJEA.js b/openlayers-base-packages/pr-previews/pr-377/assets/Cy4dgg1WoJEA.js deleted file mode 100644 index 0614c17..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/Cy4dgg1WoJEA.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,a as P,K as k,r as p,b as C,l as y,B as u,C as B,f as R}from"./DbBkdn6FNbgs.js";import{t as T}from"./CFax2WnWeOWk.js";import{S as O,T as N,O as F,M as H,H as q,u as Z,k as m,i as $,g as D,h as V,l as W,m as G}from"./DyxVjgSvwe-K.js";import{_ as K}from"./CmsKOCeNyeyo.js";import{c as A}from"./DjAArQ67Dgmx.js";import{I as z,S as j}from"./B_KTQkWPSzAO.js";import{g as U}from"./DnYPVZQRsXfx.js";const J=A({displayName:"ArrowRightIcon",path:e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),e.jsx("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})}),Q=A({displayName:"ArrowLeftIcon",path:e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),e.jsx("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})}),h="main";class X{mapId=h;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new O({title:"OSM",isBaseLayer:!0,olLayer:new N({source:new F})})]}}}const Y={"sidebar-app":{name:"sidebar-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:X,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:H,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/experimental-layout-sidebar":{name:"@open-pioneer/experimental-layout-sidebar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:q,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}}},ee='.layout-sidebar{z-index:99}:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.layout-sidebar{height:100%;position:absolute;top:0}.layout-sidebar[data-theme=light]{background-color:var(--chakra-colors-whiteAlpha-700)}.layout-sidebar[data-theme=dark]{background-color:var(--chakra-colors-blackAlpha-700)}.layout-sidebar .layout-sidebar-main{transition:width .3s ease-out 0s;border-right:1px solid var(--chakra-colors-chakra-border-color)}.layout-sidebar .layout-sidebar-content{overflow:auto;transition:width .3s ease-out 0s}.layout-sidebar .layout-sidebar-content .content-section .content-header{font-size:1.5em;background-color:var(--chakra-colors-blackAlpha-500);padding:.5rem 1rem}.layout-sidebar .layout-sidebar-content .content-section .content-body{padding:1rem}',oe=["en"];function re(i){switch(i){case"en":return K(()=>import("./BIbDu0DJPL_e.js"),[],import.meta.url).then(s=>s.default)}throw new Error(`Unsupported locale: '${i}'`)}const te=P(ee),ae=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:re,locales:oe,packages:Y,styles:te},Symbol.toStringTag,{value:"Module"})),ie="@open-pioneer/experimental-layout-sidebar",le=Z.bind(void 0,ie),S=60,I=180,M=300;function ne({defaultExpanded:i,expandedChanged:s,sidebarWidthChanged:n,items:c}){const l=le(),[a,{toggle:t}]=se(c),{isOpen:r,onToggle:b}=k({defaultIsOpen:i,onOpen(){s?.(!0)},onClose(){s?.(!1)}}),{isOpen:d,onToggle:x}=k(),g=a.size>0;p.useEffect(()=>{g&&!d&&x(),!g&&d&&x()},[g]),p.useEffect(()=>{if(n){let o=S;r&&(o=I),d&&(o+=M),n(o)}},[r,d]);const E=c?.map((o,_)=>{const f="white",w=a.has(o.id)?"outline":"ghost";return e.jsx("div",{children:r?e.jsx(C,{leftIcon:o.icon,variant:w,colorScheme:f,onClick:()=>t(o),children:o.label},o.id):e.jsx(y,{hasArrow:!0,label:o.label,placement:"right",children:e.jsx(z,{"aria-label":o.label,variant:w,colorScheme:f,icon:o.icon,onClick:()=>t(o)})},o.id)},_)}),L=c?.filter(o=>a.has(o.id)).map(o=>e.jsxs("div",{className:"content-section",children:[e.jsxs(m,{className:"content-header",alignItems:"center",children:[e.jsx(u,{children:o.label}),e.jsx(j,{}),e.jsx(B,{onClick:()=>t(o)})]}),e.jsx("div",{className:"content-body",children:o.content})]},o.id)),v=l.formatMessage({id:r?"toggle.collapse":"toggle.expand"});return e.jsxs(m,{className:"layout-sidebar",children:[e.jsxs(u,{className:"layout-sidebar-main",display:"flex",flexDirection:"column",width:r?`${I}px`:`${S}px`,padding:"10px",gap:"10px",children:[E,e.jsx(j,{}),e.jsx(y,{label:v,hasArrow:!0,placement:"right",children:e.jsx(z,{"aria-label":v,variant:"ghost",icon:r?e.jsx(Q,{}):e.jsx(J,{}),onClick:b})})]}),e.jsx(u,{className:"layout-sidebar-content",width:d?`${M}px`:"0px",children:L})]})}function se(i){const[s,n]=p.useReducer((l,a)=>{switch(a.type){case"toggle":{const t=new Set(l);return t.has(a.id)?t.delete(a.id):t.add(a.id),t}case"retain":{const t=new Set(a.ids),r=new Set(l);for(const b of r)t.has(b)||r.delete(b);return r}}},void 0,()=>new Set),c=p.useCallback(l=>{n({type:"toggle",id:l.id})},[n]);return p.useEffect(()=>{n({type:"retain",ids:i?.map(l=>l.id)??[]})},[i,n]),[s,{toggle:c}]}const ce=[796987,5827477,796987,5827477];function pe(){const[i,s]=p.useState(),[n,c]=p.useState(!0),l=$(h),a=()=>{const r=l.map?.olMap;r&&r?.getView().fit(ce,{maxZoom:13})},t=[{id:"sandbox",icon:e.jsx(U,{}),label:"Sandbox",content:e.jsx(C,{onClick:a,children:"Center Berlin"})}];return e.jsx(m,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(D,{title:e.jsx(u,{textAlign:"center",py:1,px:1,children:e.jsx(V,{size:"md",children:"Sidebar sample"})}),children:e.jsxs(m,{flex:"1",direction:"column",position:"relative",children:[e.jsx(ne,{defaultExpanded:n,expandedChanged:r=>c(r),sidebarWidthChanged:r=>s({left:r}),items:t}),e.jsx(W,{mapId:h,viewPadding:i,viewPaddingChangeBehavior:"preserve-extent",children:e.jsx(G,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsx(u,{backgroundColor:"whiteAlpha.800",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:"This is a sample for a sidebar component."})})})]})})})}const de=R({component:pe,theme:T,appMetadata:ae});customElements.define("sidebar-app",de); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/DIOfOjAL_o1F.js b/openlayers-base-packages/pr-previews/pr-377/assets/DIOfOjAL_o1F.js new file mode 100644 index 0000000..69a8193 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/DIOfOjAL_o1F.js @@ -0,0 +1 @@ +import{h as r,o as i,W as c,j as l,g as m,l as f}from"./B60Dx_GOYdnk.js";const x=r(function(e,n){const{className:s,centerContent:a,...t}=i(e),o=c("Container",e);return l.jsx(m.div,{ref:n,className:f("chakra-container",s),...t,__css:{...o,...a&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});x.displayName="Container";export{x as C}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/DOBi0XXIQOue.js b/openlayers-base-packages/pr-previews/pr-377/assets/DOBi0XXIQOue.js deleted file mode 100644 index 4250c63..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/DOBi0XXIQOue.js +++ /dev/null @@ -1 +0,0 @@ -var Ft=Object.defineProperty;var Xe=o=>{throw TypeError(o)};var Bt=(o,e,t)=>e in o?Ft(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var b=(o,e,t)=>Bt(o,typeof e!="symbol"?e+"":e,t),Ne=(o,e,t)=>e.has(o)||Xe("Cannot "+t);var a=(o,e,t)=>(Ne(o,e,"read from private field"),t?t.call(o):e.get(o)),u=(o,e,t)=>e.has(o)?Xe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),h=(o,e,t,i)=>(Ne(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),x=(o,e,t)=>(Ne(o,e,"access private method"),t);import{g as ft,h as Gt,j as r,B as R,r as f,c as be,b as Y,F as Ht,V as Be,A as Oe,k as Ve,l as Ut,E as A,a as Wt,f as qt}from"./DbBkdn6FNbgs.js";import{aE as $t,aF as Kt,ag as Yt,af as Je,aG as Zt,aH as Xt,ao as Jt,aI as Qt,aJ as eo,aK as to,a9 as oo,as as io,aL as Qe,aM as ro,aN as so,aO as et,aP as ao,aQ as no,aR as ze,V as lo,aS as tt,A as co,L as po,aT as uo,J as ho,aU as mo,aV as go,aW as fo,aX as vo,aY as ot,S as Ue,T as vt,O as bt,a as We,b as wt,aZ as Ae,i as je,f as qe,u as Te,r as re,a_ as it,a$ as bo,an as wo,j as Ge,c as yt,C as yo,F as xt,ax as kt,d as xo,w as $e,b0 as ko,b1 as So,b2 as _o,k as F,b3 as Mo,g as ke,h as He,b4 as Io,b5 as Eo,H as Co,M as Lo,D as Ao,l as jo,m as rt}from"./DyxVjgSvwe-K.js";import{W as To,i as Po,j as St}from"./CJwLdrVebURZ.js";import{O as _t,W as Ro,c as Do,I as No,C as Oo,b as Vo,a as zo,M as Fo,P as Bo,L as Go,d as Ho,S as Uo,E as Wo,V as qo,e as Mt,N as $o}from"./Fvn-TvW_dbjq.js";import{G as It,T as Ko,C as Yo,e as Zo}from"./Djes_egHqOHx.js";import{T as Pe,L as Xo}from"./CL68Tre-iuri.js";import{u as B}from"./nEjnOjKmH1UU.js";import{G as Jo}from"./DnYPVZQRsXfx.js";import{Z as Qo,a as ei,H as ti,b as oi,I as ii,V as ri,S as si}from"./BUqsBljB9Wju.js";import{M as ai,a as ni,b as li}from"./Ca8Zt9kwahLC.js";import{M as ci}from"./35mnA9_wxNJd.js";import{S as di}from"./B_KTQkWPSzAO.js";import{R as pi}from"./VXuNJBviGPoL.js";import{N as ui,P as hi}from"./CLvK5IJfz41Q.js";import{_ as st}from"./CmsKOCeNyeyo.js";import{F as mi}from"./CwYOJLhODXKJ.js";import{H as gi}from"./C520TGz1zAm6.js";import{F as fi}from"./Ch2CPfq1SbGd.js";import"./jRJMM4_GqJDc.js";import"./D8JwQmCkwKBk.js";import"./CCXTS-icusD6.js";import"./DjAArQ67Dgmx.js";import"./B6P_btgblpGb.js";const Et=ft("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Et.displayName="Center";const vi={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Gt(function(e,t){const{axis:i="both",...s}=e;return r.jsx(ft.div,{ref:t,__css:vi[i],...s,position:"absolute"})});const g={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},bi={ERROR:"error"};class wi extends Jt{constructor(e){super(bi.ERROR),this.code=e.code,this.message=e.message}}let yi=class extends $t{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.position_=null,this.transform_=Kt,this.watchId_=void 0,this.addChangeListener(g.PROJECTION,this.handleProjectionChanged_),this.addChangeListener(g.TRACKING,this.handleTrackingChanged_),e.projection!==void 0&&this.setProjection(e.projection),e.trackingOptions!==void 0&&this.setTrackingOptions(e.trackingOptions),this.setTracking(e.tracking!==void 0?e.tracking:!1)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const e=this.getProjection();e&&(this.transform_=Yt(Je("EPSG:4326"),e),this.position_&&this.set(g.POSITION,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const e=this.getTracking();e&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(e){const t=e.coords;this.set(g.ACCURACY,t.accuracy),this.set(g.ALTITUDE,t.altitude===null?void 0:t.altitude),this.set(g.ALTITUDE_ACCURACY,t.altitudeAccuracy===null?void 0:t.altitudeAccuracy),this.set(g.HEADING,t.heading===null?void 0:Zt(t.heading)),this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];const i=this.transform_(this.position_);this.set(g.POSITION,i.slice()),this.set(g.SPEED,t.speed===null?void 0:t.speed);const s=Xt(this.position_,t.accuracy);s.applyTransform(this.transform_),this.set(g.ACCURACY_GEOMETRY,s),this.changed()}positionError_(e){this.dispatchEvent(new wi(e))}getAccuracy(){return this.get(g.ACCURACY)}getAccuracyGeometry(){return this.get(g.ACCURACY_GEOMETRY)||null}getAltitude(){return this.get(g.ALTITUDE)}getAltitudeAccuracy(){return this.get(g.ALTITUDE_ACCURACY)}getHeading(){return this.get(g.HEADING)}getPosition(){return this.get(g.POSITION)}getProjection(){return this.get(g.PROJECTION)}getSpeed(){return this.get(g.SPEED)}getTracking(){return this.get(g.TRACKING)}getTrackingOptions(){return this.get(g.TRACKING_OPTIONS)}setProjection(e){this.set(g.PROJECTION,Je(e))}setTracking(e){this.set(g.TRACKING,e)}setTrackingOptions(e){this.set(g.TRACKING_OPTIONS,e)}};const xi=1.2;function ki(o,e=xi){Si(o);const t=Qt(o),i=eo(o),s=t*e,n=i*e;return[o[0]-(s-t)/2,o[1]-(n-i)/2,o[2]+(s-t)/2,o[3]+(n-i)/2]}function Si(o){if(o.length!==4)throw new Error(`Invalid extent (expected length 4, but got length ${o.length}).`)}const Fe=.75,xe=.1;let _i=class extends to{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=e.rotateWithView!==void 0?e.rotateWithView:!1,this.viewExtent_=void 0;const t=e.className!==void 0?e.className:"ol-overviewmap",i=e.tipLabel!==void 0?e.tipLabel:"Overview map",s=e.collapseLabel!==void 0?e.collapseLabel:"‹";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s):this.collapseLabel_=s;const n=e.label!==void 0?e.label:"›";typeof n=="string"?(this.label_=document.createElement("span"),this.label_.textContent=n):this.label_=n;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,c=document.createElement("button");c.setAttribute("type","button"),c.title=i,c.appendChild(l),c.addEventListener(oo.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=e.view;const d=new io({view:e.view,controls:new Qe,interactions:new Qe});this.ovmap_=d,e.layers&&e.layers.forEach(function(M){d.addLayer(M)});const p=document.createElement("div");p.className="ol-overviewmap-box",p.style.boxSizing="border-box",this.boxOverlay_=new _t({position:[0,0],positioning:"center-center",element:p}),this.ovmap_.addOverlay(this.boxOverlay_);const y=t+" "+ro+" "+so+(this.collapsed_&&this.collapsible_?" "+et:"")+(this.collapsible_?"":" ol-uncollapsible"),m=this.element;m.className=y,m.appendChild(this.ovmapDiv_),m.appendChild(c);const v=this,_=this.boxOverlay_,T=this.boxOverlay_.getElement(),De=function(M){return{clientX:M.clientX,clientY:M.clientY}},we=function(M){const I=De(M),Ze=d.getEventCoordinate(I);_.setPosition(Ze)},ye=function(M){const I=d.getEventCoordinateInternal(M);v.getMap().getView().setCenterInternal(I),window.removeEventListener("pointermove",we),window.removeEventListener("pointerup",ye)};this.ovmapDiv_.addEventListener("pointerdown",function(){event.target===T&&window.addEventListener("pointermove",we),window.addEventListener("pointerup",ye)})}setMap(e){const t=this.getMap();if(e!==t){if(t){const i=t.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(ao(e,no.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const i=e.getView();i&&this.bindView_(i),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===ze.VIEW){const t=e.oldValue;t&&this.unbindView_(t);const i=this.getMap().getView();this.bindView_(i)}else!this.ovmap_.isRendered()&&(e.key===ze.TARGET||e.key===ze.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){const t=new lo({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(tt.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(tt.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),n=e.getView().calculateExtentInternal(i);if(this.viewExtent_&&co(n,this.viewExtent_))return;this.viewExtent_=n;const l=t.getSize(),d=t.getView().calculateExtentInternal(l),p=t.getPixelFromCoordinateInternal(po(n)),y=t.getPixelFromCoordinateInternal(uo(n)),m=Math.abs(p[0]-y[0]),v=Math.abs(p[1]-y[1]),_=l[0],T=l[1];m<_*xe||v_*Fe||v>T*Fe?this.resetExtent_():ho(d,n)||this.recenter_()}resetExtent_(){const e=this.getMap(),t=this.ovmap_,i=e.getSize(),n=e.getView().calculateExtentInternal(i),l=t.getView(),c=Math.log(Fe/xe)/Math.LN2,d=1/(Math.pow(2,c/2)*xe);mo(n,d),l.fitInternal(go(n))}recenter_(){const e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),s=e.getView(),n=t.getView(),l=this.rotateWithView_?0:-s.getRotation(),c=this.boxOverlay_,d=this.boxOverlay_.getElement(),p=s.getCenter(),y=s.getResolution(),m=n.getResolution(),v=i[0]*y/m,_=i[1]*y/m;if(c.setPosition(p),d){d.style.width=v+"px",d.style.height=_+"px";const T="rotate("+l+"rad)";d.style.transform=T}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=fo(this.ovmap_,vo.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()}))}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(et),this.collapsed_?ot(this.collapseLabel_,this.label_):ot(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}};const Mi={height:"25px",width:"25px",borderColor:"#4cb3ff",borderWidth:"3px",borderRadius:"50%",display:"inline-block "};function Ii(o){return r.jsxs(R,{children:[r.jsx(Pe,{children:o.layer.title}),r.jsx(R,{style:Mi})]})}const Re="main";class Ei{mapId=Re;vectorSourceFactory;constructor(e){this.vectorSourceFactory=e.references.vectorSourceFactory}async getMapConfig(){return{initialView:{kind:"position",center:{x:823091,y:6724521},zoom:8},layers:[new Ue({title:"OSM",id:"osm",isBaseLayer:!0,olLayer:new vt({source:new bt})}),new Ro({isBaseLayer:!0,title:"Orthofotos NRW",url:"https://www.wmts.nrw.de/geobasis/wmts_nw_dop/1.0.0/WMTSCapabilities.xml",name:"nw_dop",matrixSet:"EPSG_3857_16",sourceOptions:{attributions:'Die Geobasisdaten des amtlichen Vermessungswesens werden als öffentliche Aufgabe gem. VermKatG NRW und gebührenfrei nach Open Data-Prinzipien über online-Verfahren bereitgestellt. Nutzungsbedingungen: siehe '}}),Ai(),Li(),Ci(this.vectorSourceFactory)]}}}function Ci(o){const e="https://ogc-api-test.nrw.de/inspire-us-krankenhaus/v1",t="governmentalservice",i=o.createVectorSource({baseUrl:e,collectionId:t,limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:`Land NRW (${new Date().getFullYear()}), Datenlizenz Deutschland - Namensnennung - Version 2.0, Datenquelle`}),s=new We({source:i});return new Ue({id:"krankenhaus",title:"Krankenhäuser-Demo-Dienst",visible:!1,olLayer:s,attributes:{collectionURL:e+"/collections/"+t}})}function Li(){const o=new wt({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new It,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'}),e=new We({source:o}),t={Component:Ii};return new Ue({id:"ogc_kitas",title:"Kindertagesstätten",visible:!0,olLayer:e,attributes:{legend:t}})}function Ai(){return new To({title:"Verwaltungsgebiete",id:"verwaltungsgebiete",visible:!1,url:"https://www.wms.nrw.de/geobasis/wms_nw_dvg",sublayers:[{name:"nw_dvg_krs",title:"Kreise und kreisfreie Städte"}]})}const ji="200px",Ti="300px",Pi=o=>{const{olLayer:e,height:t=ji,width:i=Ti}=o,{containerProps:s}=Ae("overview-map",o),n=f.useRef(null),{map:l}=je(o);return f.useEffect(()=>{if(n.current&&l&&e){const c=l.olMap,d=new _i({className:"ol-overviewmap",layers:[e],collapsible:!1,collapsed:!1,target:n.current});return c.addControl(d),()=>{c.removeControl(d)}}},[l,e]),r.jsx(R,{height:t,width:i,ref:n,...s})};function Ri({intl:o}){return{id:"overviewMap",title:o.formatMessage({id:"demos.overviewMap.title"}),createModel(){const e=new vt({source:new bt});return{description:o.formatMessage({id:"demos.overviewMap.description"}),mainWidget:r.jsx(Pi,{olLayer:e}),destroy(){e.dispose()}}}}}class Di{label;filteredTypes;httpService;constructor(e,t,i){this.label=e,this.filteredTypes=t,this.httpService=i}async search(e,{mapProjection:t,signal:i}){const s=await this.request(e,100,i),n=new It({dataProjection:"EPSG:4326",featureProjection:t});return s.features.filter(l=>this.filteredTypes.includes(l.properties.type)).map((l,c)=>{const d=n.readGeometry(l.geometry);return{id:l.properties.osm_id||c,label:this.createLabel(l),geometry:d,properties:l.properties}})}async request(e,t,i){const s=new URL("https://photon.komoot.io/api?");s.searchParams.set("q",e),s.searchParams.set("lang","de"),s.searchParams.set("lat","51.961563"),s.searchParams.set("lon","7.628202"),s.searchParams.set("limit",t.toString());const n=await this.httpService.fetch(s,{signal:i});if(!n.ok)throw new Error("Request failed: "+n.status);return await n.json()}createLabel(e){return`${e.properties.name} (${e.properties.osm_value?e.properties.osm_value+", ":""}${e.properties.postcode?e.properties.postcode+", ":""}${e.properties.city?e.properties.city+", ":""}${e.properties.country?e.properties.country+")":")"}`}}function Ni({intl:o,httpService:e,mapModel:t}){return{id:"searchAndHighlight",title:o.formatMessage({id:"demos.searchAndHighlight.title"}),createModel(){return new Oi(o,t,e)}}}var de,pe,Z,Se,X,mt;let Oi=(mt=class{constructor(e,t,i){u(this,de);u(this,pe);u(this,Z);b(this,"description");b(this,"mainWidget");u(this,Se,e=>{const t=e.result.geometry;t&&(a(this,X).call(this),h(this,Z,Vi(a(this,pe),[t])))});u(this,X,()=>{a(this,Z)?.destroy(),h(this,Z,void 0)});h(this,de,new Di("Photon Geocoder",["city","street"],i)),h(this,pe,t),this.description=e.formatMessage({id:"demos.searchAndHighlight.description"}),this.mainWidget=r.jsx(Do,{sources:[a(this,de)],onSelect:a(this,Se),onClear:a(this,X)})}destroy(){a(this,X).call(this)}},de=new WeakMap,pe=new WeakMap,Z=new WeakMap,Se=new WeakMap,X=new WeakMap,mt);function Vi(o,e){const t=o.olMap.getViewport();return o.highlightAndZoom(e,{viewPadding:t&&t.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}const Ct="@open-pioneer/geolocation",zi=qe.bind(void 0,Ct),Lt=Te.bind(void 0,Ct);function Fi(o){return Jo({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"},child:[]}]})(o)}const at=be("geolocation:GeolocationController"),nt=17;var G,H;class Bi{constructor(e,t,i){b(this,"supported",!!navigator.geolocation);b(this,"map");b(this,"positionHighlightLayer");b(this,"geolocation");b(this,"onError");b(this,"maxZoom",nt);b(this,"accuracyFeature");b(this,"positionFeature");b(this,"changeHandlers",[]);b(this,"setMapToPosition",!0);b(this,"trackingOptions",{});b(this,"isInitialZoom",!0);u(this,G,re(!1));u(this,H,re(!1));this.map=e,this.onError=t,this.isInitialZoom=!0,this.accuracyFeature=new it,this.accuracyFeature.setStyle(ct()),this.positionFeature=new it,this.positionFeature.setStyle(lt()),this.positionHighlightLayer=new We({source:new wt({features:[this.accuracyFeature,this.positionFeature]})}),this.positionHighlightLayer.setZIndex(bo);const s=i||Gi();this.geolocation=new yi({tracking:!1,trackingOptions:s,projection:e.olView?.getProjection()}),this.trackingOptions=s,this.geolocation.on("error",n=>this.handleGeolocationError(n))}destroy(){this.stopGeolocation(),this.geolocation?.setTracking(!1),this.geolocation.dispose(),this.accuracyFeature=void 0,this.positionFeature=void 0,this.positionHighlightLayer.dispose()}startGeolocation(){if(a(this,H).value)return;new Promise(t=>{a(this,H).value=!0,a(this,G).value=!0,this.geolocation?.setProjection(this.map.olView?.getProjection()),this.geolocation?.setTracking(!0);const i=this.geolocation.on("change:accuracyGeometry",()=>{const c=this.geolocation.getAccuracyGeometry()||void 0;if(this.accuracyFeature?.setGeometry(c),this.accuracyFeature?.getGeometry()!==void 0&&t(),this.isInitialZoom){const d=this?.accuracyFeature?.getGeometry()?.getExtent();if(d){const p=ki(d);if(!p)return;this.map.olView.fit(p,{maxZoom:this.maxZoom}),this.isInitialZoom=!1}}}),s=this.geolocation.on("change:position",()=>{const c=this.geolocation.getPosition();c&&(c[0]||c[1])!==void 0&&(this.positionFeature?.setGeometry(new wo(c)),this.setMapToPosition&&this.map.olView.setCenter(c),this.positionFeature?.getGeometry()!==void 0&&t())}),n=this.map.olView.on("change:resolution",()=>{this.setMapToPosition=this.isInitialZoom}),l=this.map.olMap.on("pointermove",c=>{c.dragging&&(this.setMapToPosition=!1)});this.changeHandlers.push(i,s,n,l),this.map.olMap.addLayer(this.positionHighlightLayer)}).then(()=>{a(this,G).value=!1}).catch(t=>{at.error("Failed to determine location",t)})}stopGeolocation(){this.geolocation?.setTracking(!1),a(this,H).value=!1,a(this,G).value=!1,this.trackingOptions={},this.setMapToPosition=!0,this.isInitialZoom=!0,this.changeHandlers.forEach(e=>{Ge(e)}),this.changeHandlers=[],this.accuracyFeature?.setGeometry(void 0),this.positionFeature?.setGeometry(void 0),this.map.olMap.removeLayer(this.positionHighlightLayer)}get active(){return a(this,H).value}get loading(){return a(this,G).value}setPositionFeatureStyle(e){this.positionFeature?.setStyle(e??lt())}setAccuracyFeatureStyle(e){this.accuracyFeature?.setStyle(e??ct())}setMaxZoom(e){this.maxZoom=e??nt}getMaxZoom(){return this.maxZoom}getPositionFeature(){return this.positionFeature}getAccuracyFeature(){return this.accuracyFeature}getTrackingOptions(){return this.trackingOptions}getGeolocation(){return this.geolocation}handleGeolocationError(e){at.error("Error from geolocation API:",e.message),this.stopGeolocation();const t=(()=>{switch(e.code){case 1:return"permission-denied";case 2:return"position-unavailable";case 3:return"timeout";default:return"unknown"}})();this.onError(t)}}G=new WeakMap,H=new WeakMap;const lt=()=>new yt({image:new yo({radius:6,fill:new xt({color:"#3399CC"}),stroke:new kt({color:"#fff",width:2})})}),ct=()=>new yt({stroke:new kt({color:"#3399CC",width:3}),fill:new xt({color:"rgba(0, 0, 255, 0.05)"})}),Gi=()=>({enableHighAccuracy:!0,timeout:6e4,maximumAge:6e5}),Hi=f.forwardRef(function(e,t){const{maxZoom:i,positionFeatureStyle:s,accuracyFeatureStyle:n,trackingOptions:l}=e,{map:c}=je(e),d=Wi(c,i,l,s,n);return d&&r.jsx(Ui,{...e,controller:d,ref:t})}),Ui=f.forwardRef(function(e,t){const{controller:i}=e,{containerProps:s}=Ae("geolocation",e),{isLoading:n,isActive:l}=B(()=>({isLoading:i.loading,isActive:i.active}),[i]),c=Lt(),d=i.supported?l?c.formatMessage({id:"locateMeEnd"}):c.formatMessage({id:"locateMeStart"}):c.formatMessage({id:"locateNotSupported"}),p=()=>{i.active?i.stopGeolocation():i.startGeolocation()};return r.jsx(Ko,{ref:t,label:d,icon:r.jsx(Fi,{}),onClick:()=>p(),isActive:l,isLoading:n,isDisabled:!i.supported,...s})});function Wi(o,e,t,i,s){const n=Lt(),l=zi("notifier.NotificationService"),[c,d]=f.useState();return f.useEffect(()=>{if(!o)return;const p=m=>{const v=n.formatMessage({id:"error"}),_=(()=>{switch(m){case"permission-denied":return n.formatMessage({id:"permissionDenied"});case"position-unavailable":return n.formatMessage({id:"positionUnavailable"});case"timeout":return n.formatMessage({id:"timeout"});case"unknown":return n.formatMessage({id:"unknownError"})}})();l.notify({level:"error",title:v,message:_})},y=new Bi(o,p,t);return d(y),()=>{y.destroy(),d(void 0)}},[o,t,n,l]),f.useEffect(()=>{c?.setPositionFeatureStyle(i)},[c,i]),f.useEffect(()=>{c?.setAccuracyFeatureStyle(s)},[c,s]),f.useEffect(()=>{c?.setMaxZoom(e)},[c,e]),c}const qi="@open-pioneer/scale-setter",$i=Te.bind(void 0,qi),Ki=[17471320,8735660,4367830,2183915,1091957,545978,272989,136494,68247,34123,17061,8530,4265,2132],Yi=o=>{const{scales:e=Ki}=o,{containerProps:t}=Ae("scale-setter",o),{map:i}=je(o),s=$i(),n=B(()=>i?.scale??1,[i]),l=e.map(d=>r.jsx(ai,{value:d,onClick:()=>i?.setScale(d),onFocus:p=>{p.target?.scrollIntoView?.({block:"nearest"})},className:"scale-setter-option",children:dt(s,d)},d)),c=dt(s,n);return r.jsx(R,{...t,children:r.jsxs(ci,{isLazy:!0,children:[r.jsx(ni,{as:Y,rightIcon:r.jsx(Yo,{}),className:"scale-setter-menubutton","aria-label":s.formatMessage({id:"button.ariaLabel"},{scale:c}),"aria-description":s.formatMessage({id:"button.ariaDescription"}),children:c}),r.jsx(Ht,{children:r.jsx(li,{className:"scale-setter-menuoptions",maxHeight:"20em",overflowY:"auto",children:l})})]})})};function dt(o,e){return"1 : "+o.formatNumber(e)}const At="@open-pioneer/spatial-bookmarks",Zi=qe.bind(void 0,At),Xi=Te.bind(void 0,At),D=be("spatial-bookmark:SpatialBookmarkViewModel");class Ji{map;packageNamespace;writableBookmarks=xo([]);watchBookmarksHandle;get bookmarks(){return this.writableBookmarks.getItems()}constructor(e,t){this.map=e,this.packageNamespace=t.getNamespace("spatial-bookmarks"),this.loadState(),this.watchBookmarksHandle=$e(()=>[this.writableBookmarks.getItems()],([i])=>this.saveState(i),{immediate:!1})}destroy(){this.watchBookmarksHandle.destroy()}createBookmark(e){const t=this.map.olView.calculateExtent(),i=this.map.projection.getCode(),s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]},n={id:ko(),title:e,extent:s,projection:i};D.debug("Created a new bookmark",n),this.writableBookmarks.push(n)}activateBookmark(e){D.debug("Activating bookmark",e);const t=this.getBookmarkExtent(e);D.debug("Attempting to apply extent",t),this.applyExtent(t)}deleteBookmark(e){D.debug("Deleting bookmark",e);const t=this.writableBookmarks.findIndex(i=>i.id===e);t>-1&&this.writableBookmarks.splice(t,1)}deleteAllBookmarks(){D.debug("Deleting all bookmarks"),this.writableBookmarks.splice(0)}loadState(){D.debug("Restoring bookmarks from local storage");const e=this.packageNamespace.get("bookmarks")??[];try{Qi(e),this.writableBookmarks.push(...e)}catch(t){D.error("Bookmarks data in local storage is invalid, resetting to default value.",t),this.writableBookmarks.splice(0),this.saveState([])}}saveState(e){D.debug("Saving bookmarks to local storage"),this.packageNamespace.set("bookmarks",e)}getBookmarkExtent(e){const t=this.map.olView,i=e.extent,s=[i.minX,i.minY,i.maxX,i.maxY],n=t.getProjection(),l=e.projection;return So(s,l,n)}applyExtent(e){const t=this.map.olView,i=_o(e),s=t.getResolutionForExtent(e);t.setCenter(i),t.setResolution(s)}}function Qi(o){if(!Array.isArray(o))throw new Error("Expected bookmarks from local storage to be an array.");for(const e of o)er(e)}function er(o){if(!o||typeof o!="object")throw new Error("Expected bookmark from local storage to be an object.");const e=o;if(typeof e.id!="string")throw new Error("Bookmark does not have a valid id.");if(typeof e.title!="string")throw new Error("Bookmark does not have a valid title.");if(tr(e.extent),typeof e.projection!="string")throw new Error("Bookmark does not have a valid projection value.")}function tr(o){if(!o||typeof o!="object")throw new Error("Expected bookmark extent from local storage to be an object.");const e=o;if(typeof e.minX!="number"||typeof e.minY!="number"||typeof e.maxX!="number"||typeof e.maxY!="number")throw new Error("Expected bookmark extent from local storage to have valid coordinates.")}const or=o=>{const{map:e}=je(o),t=Zi("local-storage.LocalStorageService"),i=cr(e,t);return i&&r.jsx(ir,{...o,viewModel:i})};function ir(o){const{viewModel:e}=o,t=Xi(),i=f.useRef([]),[s,n]=f.useState(!1),l=B(()=>e.bookmarks,[e]),[c,d]=f.useState(""),p=c.trim().length>0,{containerProps:y}=Ae("spatial-bookmarks",o),[m,v]=f.useState("list"),_=()=>{e.deleteAllBookmarks(),v("list")},T=()=>{p&&(e.createBookmark(c),v("list"),d(""),n(!0))};f.useEffect(()=>{if(s){const I=i.current;I&&I[l.length-1]?.scrollIntoView?.(),n(!1)}},[l,s]);const De=()=>r.jsxs(Be,{children:[r.jsxs(Oe,{rounded:"md",status:"warning",children:[r.jsx(Ve,{}),t.formatMessage({id:"bookmark.alert.delete"})]}),r.jsx(nr,{intl:t,onClear:_,onCancel:()=>v("list")})]}),we=()=>r.jsxs(Be,{children:[r.jsxs(Oe,{rounded:"md",status:"info",children:[r.jsx(Ve,{}),t.formatMessage({id:"bookmark.alert.create"})]}),r.jsx(No,{"aria-label":t.formatMessage({id:"bookmark.input.label"}),placeholder:t.formatMessage({id:"bookmark.input.placeholder"}),value:c,onChange:I=>{d(I.target.value)},onKeyDown:I=>{I.key==="Enter"&&T()},isRequired:!0,isInvalid:!p,autoFocus:!0}),r.jsx(lr,{intl:t,isInvalid:!p,onCancel:()=>{d(""),v("list")},onSave:T})]}),ye=()=>r.jsxs(r.Fragment,{children:[l.length?rr(l,e,t,i):r.jsxs(Oe,{rounded:"md",status:"info",children:[r.jsx(Ve,{}),t.formatMessage({id:"bookmark.alert.noSaved"})]}),r.jsx(ar,{intl:t,bookmarks:l,showCreate:()=>v("create"),showDelete:()=>v("delete")})]}),M=r.jsxs(r.Fragment,{children:[m==="list"&&ye(),m==="create"&&we(),m==="delete"&&De()]});return r.jsx(F,{flexDirection:"column",...y,children:M})}function rr(o,e,t,i){const s=t.formatMessage({id:"bookmark.button.deleteOne"}),n=o.map((l,c)=>r.jsx(sr,{index:c,listItemNodes:i,bookmark:l,onActivate:()=>e.activateBookmark(l),onDelete:()=>e.deleteBookmark(l.id),deleteBtnLabel:s},l.id));return r.jsx(Xo,{as:"ul",className:"spatial-bookmark-list",role:"listbox","aria-label":t.formatMessage({id:"bookmark.list.label"}),flexShrink:1,flexGrow:1,p:1,spacing:1,overflowY:"auto",listStyleType:"none",children:n})}const pt={ArrowDown:1,ArrowUp:-1};function sr(o){const{index:e,listItemNodes:t,bookmark:i,onDelete:s,onActivate:n,deleteBtnLabel:l}=o,c=i.title,d=p=>{const y=p.key;if(y==="Enter"){p.target===p.currentTarget&&n();return}if(pt[y]!=null){const m=t.current?.length;if(!m)return;let v=(e+pt[y])%m;v<0&&(v=m-1),t.current[v]?.focus()}};return r.jsx(R,{as:"li",p:1,ref:p=>{if(!p){t.current.splice(e,1);return}t.current[e]=p},className:Mo("spatial-bookmarks-item"),tabIndex:0,rounded:"md",role:"option",cursor:"pointer",outline:0,_hover:{background:"trails.50"},_focusVisible:{boxShadow:"outline"},onKeyDown:d,onClick:n,children:r.jsxs(F,{width:"100%",flexDirection:"row",align:"center",gap:1,children:[r.jsx(Et,{children:r.jsx(Po,{})}),r.jsx(Pe,{ps:2,noOfLines:1,children:c}),r.jsx(di,{}),r.jsx(Ut,{hasArrow:!0,label:l,placement:"right",children:r.jsx(Y,{className:"spatial-bookmarks-item-delete","aria-label":l,borderRadius:"full",iconSpacing:0,padding:0,colorScheme:"red",variant:"ghost",leftIcon:r.jsx(St,{}),onClick:p=>{s(),p.stopPropagation()}})},e)]})})}function ar(o){const{intl:e,bookmarks:t,showCreate:i,showDelete:s}=o;return r.jsxs(Ke,{children:[r.jsx(se,{isDisabled:t.length===0,colorScheme:"red",width:void 0,iconSpacing:0,leftIcon:r.jsx(St,{}),onClick:s,"aria-label":e.formatMessage({id:"bookmark.button.deleteAll"}),variant:"outline"}),r.jsx(se,{onClick:i,width:"100%",children:e.formatMessage({id:"bookmark.button.create"})})]})}function nr(o){const{intl:e,onCancel:t,onClear:i}=o;return r.jsxs(Ke,{children:[r.jsx(se,{variant:"outline",onClick:t,children:e.formatMessage({id:"bookmark.button.cancelDelete"})}),r.jsx(se,{onClick:i,children:e.formatMessage({id:"bookmark.button.confirmDelete"})})]})}function lr(o){const{intl:e,onCancel:t,onSave:i,isInvalid:s}=o;return r.jsxs(Ke,{children:[r.jsx(se,{variant:"outline",onClick:()=>t(),children:e.formatMessage({id:"bookmark.button.cancel"})}),r.jsx(se,{isDisabled:s,onClick:()=>i(),children:e.formatMessage({id:"bookmark.button.save"})})]})}function Ke(o){return r.jsx(F,{width:"100%",flexDirection:"row",mt:2,gap:1,flexGrow:0,flexShrink:0,children:o.children})}function se(o){return r.jsx(Y,{width:"100%",...o})}function cr(o,e){const[t,i]=f.useState();return f.useEffect(()=>{let s;return o?s=new Ji(o,e):s=void 0,i(s),()=>s?.destroy()},[o,e]),t}function dr({intl:o}){return{id:"coordinateViewer",title:o.formatMessage({id:"demos.coordinateViewer.title"}),createModel(){return{description:o.formatMessage({id:"demos.coordinateViewer.description"}),mainWidget:r.jsx(Oo,{})}}}}function pr({intl:o}){return{id:"scaleViewer",title:o.formatMessage({id:"demos.scaleViewer.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleViewer.description"}),mainWidget:r.jsx(Vo,{})}}}}function ur({intl:o}){return{id:"scaleSetter",title:o.formatMessage({id:"demos.scaleSetter.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleSetter.description"}),mainWidget:r.jsx(Yi,{})}}}}function hr({intl:o}){return{id:"scaleBar",title:o.formatMessage({id:"demos.scaleBar.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleBar.description"}),tools:r.jsx(zo,{})}}}}function mr({intl:o}){return{id:"measurement",title:o.formatMessage({id:"demos.measurement.title"}),createModel(){return{description:o.formatMessage({id:"demos.measurement.description"}),mainWidget:r.jsx(Fo,{})}}}}function gr({intl:o}){return{id:"mapNavigation",title:o.formatMessage({id:"demos.mapNavigation.title"}),createModel(){return{description:o.formatMessage({id:"demos.mapNavigation.description"}),tools:r.jsxs(r.Fragment,{children:[r.jsx(Qo,{}),r.jsx(ei,{}),r.jsx(ti,{}),r.jsx(oi,{}),r.jsx(ii,{})]})}}}}function fr({intl:o}){return{id:"geolocation",title:o.formatMessage({id:"demos.geolocation.title"}),createModel(){return{description:o.formatMessage({id:"demos.geolocation.description"}),tools:r.jsx(Hi,{})}}}}function vr({intl:o}){return{id:"spatialBookmarks",title:o.formatMessage({id:"demos.spatialBookmarks.title"}),createModel(){return{description:o.formatMessage({id:"demos.spatialBookmarks.description"}),mainWidget:r.jsx(or,{})}}}}function br({intl:o}){return{id:"printing",title:o.formatMessage({id:"demos.printing.title"}),createModel(){return{description:o.formatMessage({id:"demos.printing.description"}),mainWidget:r.jsx(Bo,{})}}}}const jt="showcase-app",Tt=qe.bind(void 0,jt),le=Te.bind(void 0,jt);function wr({intl:o,mapModel:e}){return{id:"tocLegend",title:o.formatMessage({id:"demos.tocLegend.title"}),createModel(){function t(s=!0){e.layers.getLayerById("verwaltungsgebiete").setVisible(s),e.layers.getLayerById("krankenhaus").setVisible(s),e.layers.getLayerById("ogc_kitas").setVisible(s)}function i(){t(!1),e?.layers.activateBaseLayer("osm")}return{description:o.formatMessage({id:"demos.tocLegend.description"}),mainWidget:r.jsx(yr,{}),destroy:i}}}}function yr(){const o=f.useId(),e=f.useId(),t=le();return r.jsxs(r.Fragment,{children:[r.jsx(R,{role:"dialog","aria-labelledby":o,children:r.jsx(ke,{title:r.jsx(He,{id:o,size:"md",mb:2,children:r.jsx(Pe,{children:t.formatMessage({id:"demos.tocLegend.tocTitle"})})}),children:r.jsx(Zo,{showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})}),r.jsx(R,{pt:2,role:"dialog","aria-labelledby":e,children:r.jsx(ke,{title:r.jsx(He,{id:e,size:"md",mb:2,children:t.formatMessage({id:"demos.tocLegend.legendTitle"})}),children:r.jsx(Go,{showBaseLayers:!0})})})]})}function xr(o){return{id:"selectionResultList",title:o.intl.formatMessage({id:"demos.selectionResultList.title"}),createModel(){return new kr(o)}}}var ue,J,Q,_e,Me,gt;let kr=(gt=class{constructor(e){u(this,ue);u(this,J);u(this,Q,re({key:0,input:void 0,open:!1}));b(this,"description");b(this,"mainWidget");u(this,_e,e=>{const{results:t}=e,n={columns:[{id:"id",displayName:"ID",width:100,getPropertyValue(c){return c.id}},{propertyName:"pointOfContact.address.postCode",displayName:"PLZ",width:120},{propertyName:"name",displayName:"Name"},{propertyName:"inspireId",displayName:"inspireID"},{displayName:"Gefördert",width:160,getPropertyValue(c){switch(c.properties?.gefoerdert){case"ja":return!0;case"nein":return!1;default:return c.properties?.gefoerdert}}}],data:t,formatOptions:{numberOptions:{maximumFractionDigits:3},dateOptions:{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}}},l=a(this,Q).value.key;a(this,Q).value={open:!0,key:l+1,input:n}});u(this,Me,e=>{console.log("Selected features: ",e.features)});const{mapModel:t,vectorSelectionSourceFactory:i,intl:s}=e;h(this,ue,t),h(this,J,Sr(t,i)),this.description=s.formatMessage({id:"demos.selectionResultList.description"}),this.mainWidget=r.jsx(Ho,{sources:[a(this,J)],onSelectionComplete:a(this,_e)}),t.layers.getLayerById("ogc_kitas").setVisible(!0)}destroy(){a(this,J).destroy(),a(this,ue).layers.getLayerById("ogc_kitas").setVisible(!1)}get listContainer(){const e=a(this,Q).value;if(!(!e.open||!e.input))return r.jsx(pi,{input:e.input,onSelectionChange:a(this,Me)},e.key)}},ue=new WeakMap,J=new WeakMap,Q=new WeakMap,_e=new WeakMap,Me=new WeakMap,gt);function Sr(o,e){const t=o.layers.getLayerById("ogc_kitas");return e.createSelectionSource({vectorLayer:t.olLayer,label:t.title})}const _r="krankenhaus";function Mr(o){return{id:"editing",title:o.intl.formatMessage({id:"demos.editing.title"}),createModel(){return new Ir(o)}}}var he,ee;class Ir{constructor(e){b(this,"description");b(this,"mainWidget");u(this,he);u(this,ee);const{mapModel:t,intl:i,editingService:s,notificationService:n}=e;h(this,he,t),this.description=i.formatMessage({id:"demos.editing.description"}),h(this,ee,new Er(t,s,n,i)),this.mainWidget=r.jsx(Cr,{editingController:a(this,ee)}),this._setEditLayerVisible(!0)}destroy(){this._setEditLayerVisible(!1),a(this,ee).stopEditing()}_setEditLayerVisible(e=!0){a(this,he).layers.getLayerById(_r).setVisible(e)}}he=new WeakMap,ee=new WeakMap;var k,S,U,W,N,P,q,O;class Er{constructor(e,t,i,s){u(this,k);u(this,S);u(this,U);u(this,W);u(this,N);u(this,P);u(this,q);u(this,O);h(this,k,re(!1)),h(this,S,e),h(this,U,t),h(this,W,i),h(this,N,s)}editingActive(){return a(this,k).value}startCreateWorkflow(){if(!a(this,k).value)try{a(this,k).value=!0;const e=a(this,S).layers.getLayerById("krankenhaus"),t=new URL(e.attributes.collectionURL+"/items"),i=a(this,U).createFeature(a(this,S),t);this._watchState(i),i.whenComplete().then(s=>{if(!s)return;a(this,W).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.create.featureCreated"},{featureId:s.featureId})}),(e?.olLayer).getSource()?.refresh()}).catch(s=>{console.error(s)}).finally(()=>{a(this,k).value=!1})}catch(e){a(this,k).value=!1,console.error(e)}}startUpdateWorkflow(){if(!a(this,k).value)try{a(this,k).value=!0,h(this,O,this._createEditingSelectTooltip());const e=a(this,S).layers.getLayerById("krankenhaus"),t=e?.olLayer;h(this,P,new Uo({layers:[t]})),a(this,S).olMap.addInteraction(a(this,P)),a(this,O).element.classList.remove("editing-tooltip-hidden"),h(this,q,a(this,P).on("select",i=>{const s=i.selected,n=i.deselected;if(s.length!==1||n.length!==0)return;this._stopUpdateSelection();const l=s[0];if(!l)throw Error("feature is undefined");const c=new URL(e.attributes.collectionURL+"/items"),d=a(this,U).updateFeature(a(this,S),c,l);this._watchState(d),d.whenComplete().then(p=>{p&&(a(this,W).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.update.featureModified"},{featureId:p.featureId})}),t.getSource()?.refresh())}).catch(p=>{console.error(p)}).finally(()=>{a(this,k).value=!1})}))}catch(e){a(this,k).value=!1,console.error(e)}}_watchState(e){const t=$e(()=>[e.getState()],i=>{i[0]==="active:saving"&&a(this,W).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.update.savingStared"})}),i[0]==="destroyed"&&(t.destroy(),console.log("destroyed"))})}_createEditingSelectTooltip(){const e=document.createElement("div");e.className="editing-tooltip editing-tooltip-hidden",e.textContent=a(this,N).formatMessage({id:"demos.editing.update.tooltip.select"});const t=new _t({element:e,offset:[15,0],positioning:"center-left"}),i=a(this,S).olMap,s=i.on("pointermove",n=>{n.dragging||t.setPosition(n.coordinate)});return i.addOverlay(t),{overlay:t,element:e,destroy(){Ge(s),i.removeOverlay(t)}}}_stopUpdateSelection(){a(this,P)&&a(this,S).olMap.removeInteraction(a(this,P)),a(this,q)&&Ge(a(this,q)),a(this,O)&&a(this,O).destroy(),h(this,P,void 0),h(this,q,void 0),h(this,O,void 0)}stopEditing(){a(this,U).stop(Re),this._stopUpdateSelection(),a(this,k).value=!1}}k=new WeakMap,S=new WeakMap,U=new WeakMap,W=new WeakMap,N=new WeakMap,P=new WeakMap,q=new WeakMap,O=new WeakMap;function Cr({editingController:o}){const e=le(),t=B(()=>o.editingActive(),[o]),i=t?e.formatMessage({id:"demos.editing.activeInfo"}):e.formatMessage({id:"demos.editing.inactiveInfo"});return r.jsxs(r.Fragment,{children:[r.jsxs(F,{px:1,py:1,children:[r.jsx(Y,{mr:2,isDisabled:t,onClick:()=>{o.startCreateWorkflow()},children:e.formatMessage({id:"demos.editing.startCreateButton"})}),r.jsx(Y,{mr:2,isDisabled:t,onClick:()=>{o.startUpdateWorkflow()},children:e.formatMessage({id:"demos.editing.startUpdateButton"})}),r.jsx(Y,{isDisabled:!t,onClick:()=>{o.stopEditing()},children:e.formatMessage({id:"demos.editing.stopButton"})})]}),r.jsx(F,{px:1,py:1,children:i})]})}function Lr(o){return[wr(o),dr(o),pr(o),ur(o),hr(o),mr(o),Mr(o),gr(o),fr(o),vr(o),Ri(o),br(o),xr(o),Ni(o)]}const Ar=be("app::AppModel");var Ie,me,ge,V,E,Ee,Ce,ne,Pt,Rt;class jr{constructor(e,t,i,s){u(this,ne);u(this,Ie);u(this,me);u(this,ge);u(this,V);u(this,E);u(this,Ee,Io(()=>Array.from(a(this,V).values())));u(this,Ce,[]);if(h(this,Ie,e),h(this,me,t),h(this,ge,i),h(this,V,new Map(s.map(l=>[l.id,l]))),a(this,V).size===0)throw new Error("No demos defined.");const n=s[0];h(this,E,re([n,n.createModel()])),x(this,ne,Pt).call(this),a(this,Ce).push(x(this,ne,Rt).call(this))}destroy(){a(this,E).value[1].destroy?.()}get currentDemo(){return a(this,E).value[0]}get currentDemoModel(){return a(this,E).value[1]}get allDemoInfos(){return a(this,Ee).value}selectDemo(e){const t=a(this,V).get(e);if(!t)throw new Error(`Demo '${e}' does not exist.`);Eo(()=>{const[,i]=a(this,E).value;i.destroy?.(),a(this,E).value=[t,t.createModel()]})}}Ie=new WeakMap,me=new WeakMap,ge=new WeakMap,V=new WeakMap,E=new WeakMap,Ee=new WeakMap,Ce=new WeakMap,ne=new WeakSet,Pt=function(){const t=new URL(window.location.href).searchParams.get("demo");if(t){if(!a(this,V).has(t)){a(this,me).notify({title:a(this,ge).formatMessage({id:"demoSelection.notFound"},{demoId:t})});return}try{this.selectDemo(t)}catch(i){Ar.error("Failed to select demo from URL",i)}}},Rt=function(){return $e(()=>[a(this,E).value[0].id],([e])=>{const t=new URL(window.location.href);t.searchParams.set("demo",e),window.history.replaceState(null,"",t.toString())},{immediate:!0})};var te,fe,ve,Le,Dt;class Tr{constructor(e){u(this,Le);u(this,te,re({kind:"loading"}));u(this,fe,[]);u(this,ve,!1);const{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,notificationService:c}=e.references,d=e.intl;x(this,Le,Dt).call(this,{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,intl:d,notificationService:c}).catch(p=>{a(this,te).value={kind:"error",message:p.message||"Unknown error"}})}destroy(){h(this,ve,!0);for(const e of a(this,fe))e.destroy()}get appState(){return a(this,te).value}}te=new WeakMap,fe=new WeakMap,ve=new WeakMap,Le=new WeakSet,Dt=async function(e){const{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,intl:c,notificationService:d}=e,p=await t.getMapModel(Re);if(!p)throw new Error("No mapModel found.");const y=Lr({intl:c,httpService:i,mapModel:p,vectorSelectionSourceFactory:n,editingService:l,notificationService:d}),m={kind:"ready",appModel:new jr(p,s,c,y),destroy(){this.appModel.destroy()}};if(a(this,ve)){m.destroy();return}a(this,te).value=m,a(this,fe).push(m)};const $=be("local-storage"),Pr=0,j={CORRUPTED_DATA:"local-storage:corrupted-data",INVALID_PATH:"local-storage:invalid-path",INVALID_VALUE:"local-storage:invalid-value",NOT_SUPPORTED:"local-storage:not-supported",INTERNAL:"local-storage:internal-error"};var oe,C,z,ie,L,w,Nt,Ot,ce,K,Vt;class Rr{constructor(e){u(this,w);u(this,oe);u(this,C,{});u(this,z);u(this,ie);u(this,L);h(this,oe,Vr(e.properties)),h(this,z,zr()),a(this,z)&&(x(this,w,Ot).call(this),h(this,ie,x(this,w,Vt).call(this)))}destroy(){a(this,L)&&(clearTimeout(a(this,L)),h(this,L,void 0)),a(this,z)&&x(this,w,ce).call(this)}get isSupported(){return!!a(this,ie)}get(e){return x(this,w,K).call(this).get(e)}set(e,t){return x(this,w,K).call(this).set(e,t)}remove(e){return x(this,w,K).call(this).remove(e)}removeAll(){return x(this,w,K).call(this).removeAll()}getNamespace(e){return x(this,w,K).call(this).getNamespace(e)}}oe=new WeakMap,C=new WeakMap,z=new WeakMap,ie=new WeakMap,L=new WeakMap,w=new WeakSet,Nt=function(){a(this,L)&&clearTimeout(a(this,L)),h(this,L,setTimeout(()=>{h(this,L,void 0),x(this,w,ce).call(this)},Pr))},Ot=function(){try{const e=a(this,z);if(!e)throw new A(j.INTERNAL,"Local storage is not available.");const t=e.getItem(a(this,oe));if(t==null){h(this,C,{}),x(this,w,ce).call(this);return}try{const i=JSON.parse(t);if(!ae(i))throw new A(j.CORRUPTED_DATA,"Persisted value should be an object.");h(this,C,i)}catch(i){$.warn("Invalid persisted data, reverting to default.",i),h(this,C,{}),x(this,w,ce).call(this)}}catch(e){$.error("Failed to load from local storage",e)}},ce=function(){try{const e=a(this,z);if(!e)throw new A(j.INTERNAL,"Local storage is not available.");const t=JSON.stringify(a(this,C));e.setItem(a(this,oe),t)}catch(e){$.error("Failed to save to local storage",e)}},K=function(){const e=a(this,ie);if(!e)throw new A(j.NOT_SUPPORTED,"Local storage is not supported by this browser.");return e},Vt=function(){const e={getByPath:t=>ht(Dr(a(this,C),t)),setByPath:(t,i)=>{if(!Or(i))throw new A(j.INVALID_VALUE,"The value is not supported by local storage.");if(i=ht(i),t.length===0){if(!ae(i))throw new A(j.INVALID_VALUE,"The root value must be a plain object.");h(this,C,i)}else Nr(a(this,C),t,i);x(this,w,Nt).call(this)}};return new Ye([],e)};class Ye{path;access;constructor(e,t){this.path=e,this.access=t}get(e){return this.access.getByPath([...this.path,e])}set(e,t){this.access.setByPath([...this.path,e],t)}remove(e){this.access.setByPath([...this.path,e],void 0)}removeAll(){this.access.setByPath(this.path,{})}getNamespace(e){const t=this.get(e);if(t===void 0)this.set(e,{});else if(!ae(t))throw new A(j.INVALID_PATH,`Cannot use '${e}' as a namespace because it is not associated with an object.`);return new Ye(this.path.concat([e]),this.access)}}const ut="trails-state";function Dr(o,e){let t=o;for(const i of e){if(!ae(t))throw new A(j.INVALID_PATH,`Cannot get nested property '${i}' because the parent is no object.`);t=t[i]}return t}function Nr(o,e,t){if(!e.length)throw new A(j.INTERNAL,"Path must not be empty.");let i=o;for(let n=0,l=e.length-1;n"u"){$.warn("Local storage is not supported by this browser.");return}try{const o=globalThis.localStorage;if(!o){$.warn("Local storage is not supported by this browser.");return}return o}catch(o){$.warn("Local storage is not supported by this browser.",o);return}}function ht(o){return o!=null&&(o=JSON.parse(JSON.stringify(o))),o}const Fr={"showcase-app":{name:"showcase-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Ei,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},AppInitModel:{name:"AppInitModel",clazz:Tr,provides:[{name:"app.AppInitModel",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1},mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},notifier:{name:"notifier.NotificationService",qualifier:void 0,all:!1},vectorSelectionSourceFactory:{name:"selection.VectorSelectionSourceFactory",qualifier:void 0,all:!1},editingService:{name:"editing.EditingService",qualifier:void 0,all:!1},notificationService:{name:"notifier.NotificationService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"app.AppInitModel",qualifier:void 0,all:!1},{name:"runtime.ApplicationContext",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:Co,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:ui,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:Lo,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/coordinate-viewer":{name:"@open-pioneer/coordinate-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:ri,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:si,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/scale-bar":{name:"@open-pioneer/scale-bar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-viewer":{name:"@open-pioneer/scale-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/overview-map":{name:"@open-pioneer/overview-map",services:{},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:hi,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/editing":{name:"@open-pioneer/editing",services:{EditingServiceImpl:{name:"EditingServiceImpl",clazz:Wo,provides:[{name:"editing.EditingService",qualifier:void 0}],references:{mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{polygonStyle:{value:{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"red","stroke-width":1.25,"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1},vertexStyle:{value:{"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1}}},"@open-pioneer/legend":{name:"@open-pioneer/legend",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/measurement":{name:"@open-pioneer/measurement",services:{},ui:{references:[]},properties:{}},"@open-pioneer/search":{name:"@open-pioneer/search",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/selection":{name:"@open-pioneer/selection",services:{VectorSelectionSourceFactory:{name:"VectorSelectionSourceFactory",clazz:qo,provides:[{name:"selection.VectorSelectionSourceFactory",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/scale-setter":{name:"@open-pioneer/scale-setter",services:{},ui:{references:[]},properties:{}},"@open-pioneer/geolocation":{name:"@open-pioneer/geolocation",services:{},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/spatial-bookmarks":{name:"@open-pioneer/spatial-bookmarks",services:{},ui:{references:[{name:"local-storage.LocalStorageService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/local-storage":{name:"@open-pioneer/local-storage",services:{LocalStorageServiceImpl:{name:"LocalStorageServiceImpl",clazz:Rr,provides:[{name:"local-storage.LocalStorageService",qualifier:"local-storage.LocalStorageService"}],references:{}}},ui:{references:[]},properties:{storageId:{value:null,required:!1}}}},Br=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}.editing-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.editing-tooltip-hidden{visibility:hidden}.measurement-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.measurement-active-tooltip{background:#000000e6;border-radius:4px;border-color:#000000e6;opacity:.9;color:#fff}.measurement-finished-tooltip{background-color:#4cb3ffe6;color:#000;border:1px solid white}.measurement-active-tooltip:before,.measurement-finished-tooltip:before{border-top:6px solid rgba(0,0,0,.9);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.measurement-finished-tooltip:before{border-top-color:#4cb3ff}.search-component .chakra-divider{display:none}.search-component .search-highlighted-match{font-weight:700}.search-component .search-value-container{cursor:text;padding-left:30px!important}.search-component .search-invisible{display:none}.selection-drag-box{background-color:#ffffff4d!important;border:3px solid var(--chakra-colors-background_primary)!important}.selection-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.selection .react-select{cursor:default}.map-container .selection-active{cursor:crosshair}.map-container .selection-inactive{cursor:no-drop}.selection-source-value.selection-source-value--disabled{opacity:.4}.selection-source-value.selection-source-value--disabled span{margin:0 6px 0 0}.map-anchor.main-map-anchor{overflow-x:hidden;overflow-y:auto}.map-container:focus-visible{outline:none}.map-container:focus-visible:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:3px solid var(--chakra-colors-trails-500)}@media screen and (max-width: 48em){.map-anchor.main-map-anchor{max-height:45%}}.scale-bar .ol-scale-bar{margin-bottom:8px;margin-right:8px}.scale-bar .ol-scale-bar,.scale-bar .ol-scale-line{position:relative;bottom:0;left:0;background:none}.scale-bar .ol-scale-bar .ol-scale-bar-inner,.scale-bar .ol-scale-bar .ol-scale-line-inner,.scale-bar .ol-scale-line .ol-scale-bar-inner,.scale-bar .ol-scale-line .ol-scale-line-inner{color:var(--chakra-white);border-color:var(--chakra-white)}.overview-map .ol-overviewmap{position:relative;height:100%;width:100%}.overview-map .ol-overviewmap:not(.ol-collapsed){border:1px solid black}.overview-map .ol-overviewmap .ol-overviewmap-map{border:none;width:100%;height:100%}.overview-map .ol-overviewmap .ol-overviewmap-box{border:2px solid red}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',Gr=["en","de"];function Hr(o){switch(o){case"en":return st(()=>import("./BxannLiVc7Kn.js"),[],import.meta.url).then(e=>e.default);case"de":return st(()=>import("./BkcX60-fpzHn.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${o}'`)}const Ur=Wt(Br),Wr=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:Hr,locales:Gr,packages:Fr,styles:Ur},Symbol.toStringTag,{value:"Module"}));function zt({label:o,children:e}){return r.jsxs(mi,{as:gi,maxWidth:{base:"none",md:"20em"},width:{base:"100%",sm:"47%",md:void 0},children:[r.jsx(fi,{flexBasis:{base:"8em",sm:"auto"},m:0,children:o}),e]})}const qr=be("app::DemoSelection");function $r({appModel:o}){const e=le(),{allDemos:t,currentDemo:i}=B(()=>({allDemos:o.allDemoInfos,currentDemo:o.currentDemo}),[o]),s=f.useMemo(()=>t.map(n=>r.jsx("option",{value:n.id,children:n.title},n.id)),[t]);return r.jsx(zt,{label:e.formatMessage({id:"demoSelection.label"}),children:r.jsx(Mt,{value:i.id,onChange:n=>{const l=n.target.value;try{o.selectDemo(l)}catch(c){qr.error("Failed to select demo",c)}},children:s})})}function Kr(){const o=le(),e=Tt("runtime.ApplicationContext"),t=Yr(e.getLocale()),i=s=>{switch(s){case"en":e.setLocale("en-GB");break;case"de":e.setLocale("de-DE");break}};return r.jsx(zt,{label:o.formatMessage({id:"localeSwitcher.label"}),children:r.jsxs(Mt,{value:t,onChange:s=>i(s.target.value),children:[r.jsx("option",{value:"de",children:o.formatMessage({id:"localeSwitcher.locale.de"})}),r.jsx("option",{value:"en",children:o.formatMessage({id:"localeSwitcher.locale.en"})})]})})}function Yr(o){const e=o.match(/^[a-z]+/i)?.[0];if(e==="en"||e=="de")return e;throw new Error("unexpected locale prefix: "+e)}function Zr({appModel:o}){const e=le();return r.jsxs(F,{as:"header",px:2,py:3,flexWrap:{base:"wrap",md:"nowrap"},alignItems:"baseline",gap:2,boxShadow:"1px 0px 3px rgba(0, 0, 0, 0.5)",bgColor:"white",zIndex:100,children:[r.jsx(He,{size:"md",flexShrink:0,flexGrow:1,textAlign:{base:"center",md:"left"},width:{base:"100%",md:"auto"},mb:{base:2,md:0},children:e.formatMessage({id:"header.title"})}),r.jsx($r,{appModel:o}),r.jsx(Kr,{})]})}function Xr(){const o=Tt("app.AppInitModel"),e=B(()=>o.appState,[o]);let t;switch(e.kind){case"loading":t="Loading...";break;case"error":t="Error: "+e.message;break;case"ready":t=r.jsx(Jr,{state:e})}return t}function Jr(o){const e=le(),t=o.state.appModel,{currentDemo:i,currentDemoModel:s}=B(()=>({currentDemo:t.currentDemo,currentDemoModel:t.currentDemoModel}),[t]),n=B(()=>s.listContainer,[s]),l=f.useMemo(()=>({left:0,right:0,bottom:n!=null?400:0,top:0}),[n]);return r.jsxs(r.Fragment,{children:[r.jsx($o,{position:"top-right"}),r.jsx(F,{height:"100%",direction:"column",children:r.jsx(ke,{title:r.jsx(Zr,{appModel:t}),children:r.jsx(F,{flex:"1",direction:"column",position:"relative",children:r.jsx(Ao,{mapId:Re,children:r.jsxs(jo,{viewPadding:l,role:"main","aria-label":e.formatMessage({id:"ariaLabels.map"}),children:[r.jsx(rt,{className:"main-map-anchor",position:"top-left",horizontalGap:10,verticalGap:10,children:r.jsx(R,{bgColor:"white",borderRadius:10,p:2,maxW:"500px",children:r.jsxs(ke,{title:i.title,sectionHeadingProps:{size:"lg"},children:[r.jsx(Pe,{py:4,dangerouslySetInnerHTML:{__html:s.description}}),s.mainWidget]})})}),r.jsx(rt,{position:"bottom-right",horizontalGap:6,children:r.jsx(Be,{p:1,children:s.tools})}),n&&r.jsx(R,{className:"list-container",position:"absolute",bottom:"0",backgroundColor:"white",width:"100%",height:"400px",zIndex:1,borderTop:"2px solid",borderColor:"trails.100",children:n})]})})})})})]})}const Qr=new URLSearchParams(window.location.search),es=Qr.get("lang")||void 0,ts=qt({component:Xr,appMetadata:Wr,config:{properties:{"@open-pioneer/local-storage":{storageId:"ol-showcase-state"}},locale:es}});customElements.define("showcase-app",ts); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/nEjnOjKmH1UU.js b/openlayers-base-packages/pr-previews/pr-377/assets/DSjrbd_eKbZM.js similarity index 91% rename from openlayers-base-packages/pr-previews/pr-377/assets/nEjnOjKmH1UU.js rename to openlayers-base-packages/pr-previews/pr-377/assets/DSjrbd_eKbZM.js index 8df81aa..a6c7ab7 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/nEjnOjKmH1UU.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/DSjrbd_eKbZM.js @@ -1,6 +1,6 @@ -import{h as gn,T as Mt,o as bn,j as P,g as De,m as Sn,U as yn,r as v,P as Re,W as Vt,X as On,Y as Cn,Z as xn,_ as I,$ as V,a0 as Pn,a1 as Lt,B as N,u as ne,a2 as In,a3 as rt,I as Ke,l as wn,z as Mn}from"./DbBkdn6FNbgs.js";import{b4 as Vn,w as Ln,u as Dn,aZ as Rn,i as En,k as kn}from"./DyxVjgSvwe-K.js";import{u as Fn}from"./CCXTS-icusD6.js";import{u as Tn}from"./CwYOJLhODXKJ.js";import{M as An,d as $n}from"./35mnA9_wxNJd.js";import{F as Nn}from"./DnYPVZQRsXfx.js";const Dt=gn(function(e,r){const{borderLeftWidth:i,borderBottomWidth:t,borderTopWidth:o,borderRightWidth:s,borderWidth:u,borderStyle:a,borderColor:l,...c}=Mt("Divider",e),{className:d,orientation:p="horizontal",__css:m,...g}=bn(e),f={vertical:{borderLeftWidth:i||s||u||"1px",height:"100%"},horizontal:{borderBottomWidth:t||o||u||"1px",width:"100%"}};return P.jsx(De.hr,{ref:r,"aria-orientation":p,...g,__css:{...c,border:"0",borderColor:l,borderStyle:a,...f[p],...m},className:Sn("chakra-divider",d)})});Dt.displayName="Divider";function _n(n,e){if(n==null)return{};var r={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.includes(i))continue;r[i]=n[i]}return r}function We(n,e){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},We(n,e)}function ie(n){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(n)}function jn(n,e){if(ie(n)!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var i=r.call(n,e||"default");if(ie(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Rt(n){var e=jn(n,"string");return ie(e)=="symbol"?e:e+""}function le(n,e,r){return(e=Rt(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function Hn(n,e={}){const{ssr:r=!0,fallback:i}=e,{getWindow:t}=yn(),o=Array.isArray(n)?n:[n];let s=Array.isArray(i)?i:[i];s=s.filter(l=>l!=null);const[u,a]=v.useState(()=>o.map((l,c)=>({media:l,matches:r?!!s[c]:t().matchMedia(l).matches})));return v.useEffect(()=>{const l=t();a(o.map(p=>({media:p,matches:l.matchMedia(p).matches})));const c=o.map(p=>l.matchMedia(p)),d=p=>{a(m=>m.slice().map(g=>g.media===p.media?{...g,matches:p.matches}:g))};return c.forEach(p=>{typeof p.addListener=="function"?p.addListener(d):p.addEventListener("change",d)}),()=>{c.forEach(p=>{typeof p.removeListener=="function"?p.removeListener(d):p.removeEventListener("change",d)})}},[t]),u.map(l=>l.matches)}function zn(n){const e=Vt(n)?n:{fallback:n??"base"},i=Re().__breakpoints.details.map(({minMaxQuery:u,breakpoint:a})=>({breakpoint:a,query:u.replace("@media screen and ","")})),t=i.map(u=>u.breakpoint===e.fallback),s=Hn(i.map(u=>u.query),{fallback:t,ssr:e.ssr}).findIndex(u=>u==!0);return i[s]?.breakpoint??e.fallback}function Bn(n,e,r=On){let i=Object.keys(n).indexOf(e);if(i!==-1)return n[e];let t=r.indexOf(e);for(;t>=0;){const o=r[t];if(n.hasOwnProperty(o)){i=t;break}t-=1}if(i!==-1){const o=r[i];return n[o]}}function Un(n,e){const r=Vt(e)?e:{fallback:e??"base"},i=zn(r),t=Re();if(!i)return;const o=Array.from(t.__breakpoints?.keys||[]),s=Array.isArray(n)?Object.fromEntries(Object.entries(Cn(n,o)).map(([u,a])=>[u,a])):n;return Bn(s,i,o)}function Wn(n,e){const r=v.useRef(n);r.current=n;const i=Gn(e);return v.useMemo(()=>Vn(()=>r.current()),[i])}function Yn(n){const e=v.useCallback(()=>n.peek(),[n]),r=v.useCallback(t=>{const o=Ln(()=>[n.value],t);return()=>o.destroy()},[n]),i=v.useSyncExternalStore(r,e);return v.useDebugValue(i),i}function qe(n,e){const r=Wn(n,e),i=Yn(r);return v.useDebugValue(i),i}function Gn(n){const e=v.useRef();return(e.current==null||!Xn(e.current,n))&&(e.current=n??[]),e.current}function Xn(n,e){return n===e?!0:n.length===(e?.length??0)&&n.every((r,i)=>r===e[i])}function it(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),r.push.apply(r,i)}return r}function C(n){for(var e=1;en.length)&&(e=n.length);for(var r=0,i=Array(e);r({x:n,y:n});function dr(n){const{x:e,y:r,width:i,height:t}=n;return{width:i,height:t,top:r,left:e,right:e+i,bottom:r+t,x:e,y:r}}function Ft(n){return At(n)?(n.nodeName||"").toLowerCase():"#document"}function te(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Tt(n){var e;return(e=(At(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function At(n){return n instanceof Node||n instanceof te(n).Node}function pr(n){return n instanceof Element||n instanceof te(n).Element}function Ze(n){return n instanceof HTMLElement||n instanceof te(n).HTMLElement}function at(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof te(n).ShadowRoot}function $t(n){const{overflow:e,overflowX:r,overflowY:i,display:t}=Je(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&!["inline","contents"].includes(t)}function fr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function vr(n){return["html","body","#document"].includes(Ft(n))}function Je(n){return te(n).getComputedStyle(n)}function mr(n){if(Ft(n)==="html")return n;const e=n.assignedSlot||n.parentNode||at(n)&&n.host||Tt(n);return at(e)?e.host:e}function Nt(n){const e=mr(n);return vr(e)?n.ownerDocument?n.ownerDocument.body:n.body:Ze(e)&&$t(e)?e:Nt(e)}function Ie(n,e,r){var i;e===void 0&&(e=[]),r===void 0&&(r=!0);const t=Nt(n),o=t===((i=n.ownerDocument)==null?void 0:i.body),s=te(t);return o?e.concat(s,s.visualViewport||[],$t(t)?t:[],s.frameElement&&r?Ie(s.frameElement):[]):e.concat(t,Ie(t,[],r))}function hr(n){const e=Je(n);let r=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const t=Ze(n),o=t?n.offsetWidth:r,s=t?n.offsetHeight:i,u=xe(r)!==o||xe(i)!==s;return u&&(r=o,i=s),{width:r,height:i,$:u}}function Qe(n){return pr(n)?n:n.contextElement}function st(n){const e=Qe(n);if(!Ze(e))return Pe(1);const r=e.getBoundingClientRect(),{width:i,height:t,$:o}=hr(e);let s=(o?xe(r.width):r.width)/i,u=(o?xe(r.height):r.height)/t;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const gr=Pe(0);function br(n){const e=te(n);return!fr()||!e.visualViewport?gr:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Sr(n,e,r){return!1}function lt(n,e,r,i){e===void 0&&(e=!1);const t=n.getBoundingClientRect(),o=Qe(n);let s=Pe(1);e&&(s=st(n));const u=Sr()?br(o):Pe(0);let a=(t.left+u.x)/s.x,l=(t.top+u.y)/s.y,c=t.width/s.x,d=t.height/s.y;if(o){const p=te(o),m=i;let g=p,f=g.frameElement;for(;f&&i&&m!==g;){const h=st(f),b=f.getBoundingClientRect(),S=Je(f),O=b.left+(f.clientLeft+parseFloat(S.paddingLeft))*h.x,y=b.top+(f.clientTop+parseFloat(S.paddingTop))*h.y;a*=h.x,l*=h.y,c*=h.x,d*=h.y,a+=O,l+=y,g=te(f),f=g.frameElement}}return dr({width:c,height:d,x:a,y:l})}function yr(n,e){let r=null,i;const t=Tt(n);function o(){var u;clearTimeout(i),(u=r)==null||u.disconnect(),r=null}function s(u,a){u===void 0&&(u=!1),a===void 0&&(a=1),o();const{left:l,top:c,width:d,height:p}=n.getBoundingClientRect();if(u||e(),!d||!p)return;const m=be(c),g=be(t.clientWidth-(l+d)),f=be(t.clientHeight-(c+p)),h=be(l),S={rootMargin:-m+"px "+-g+"px "+-f+"px "+-h+"px",threshold:cr(0,ur(1,a))||1};let O=!0;function y(M){const w=M[0].intersectionRatio;if(w!==a){if(!O)return s();w?s(!1,w):i=setTimeout(()=>{s(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(y,{...S,root:t.ownerDocument})}catch{r=new IntersectionObserver(y,S)}r.observe(n)}return s(!0),o}function Or(n,e,r,i){i===void 0&&(i={});const{ancestorScroll:t=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,l=Qe(n),c=t||o?[...l?Ie(l):[],...Ie(e)]:[];c.forEach(b=>{t&&b.addEventListener("scroll",r,{passive:!0}),o&&b.addEventListener("resize",r)});const d=l&&u?yr(l,r):null;let p=-1,m=null;s&&(m=new ResizeObserver(b=>{let[S]=b;S&&S.target===l&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var O;(O=m)==null||O.observe(e)})),r()}),l&&!a&&m.observe(l),m.observe(e));let g,f=a?lt(n):null;a&&h();function h(){const b=lt(n);f&&(b.x!==f.x||b.y!==f.y||b.width!==f.width||b.height!==f.height)&&r(),f=b,g=requestAnimationFrame(h)}return r(),()=>{var b;c.forEach(S=>{t&&S.removeEventListener("scroll",r),o&&S.removeEventListener("resize",r)}),d?.(),(b=m)==null||b.disconnect(),m=null,a&&cancelAnimationFrame(g)}}var Ge=v.useLayoutEffect,Cr=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],we=function(){};function xr(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function Pr(n,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),t=2;t-1}function wr(n){return ke(n)?window.innerHeight:n.clientHeight}function jt(n){return ke(n)?window.pageYOffset:n.scrollTop}function Ve(n,e){if(ke(n)){window.scrollTo(0,e);return}n.scrollTop=e}function Mr(n){var e=getComputedStyle(n),r=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var t=n;t=t.parentElement;)if(e=getComputedStyle(t),!(r&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return t;return document.documentElement}function Vr(n,e,r,i){return r*((n=n/i-1)*n*n+1)+e}function Se(n,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:we,t=jt(n),o=e-t,s=10,u=0;function a(){u+=s;var l=Vr(u,t,o,r);Ve(n,l),ur.bottom?Ve(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+t,n.scrollHeight)):i.top-t1?r-1:0),t=1;t=g)return{placement:"bottom",maxHeight:e};if(D>=g&&!s)return o&&Se(a,k,E),{placement:"bottom",maxHeight:e};if(!s&&D>=i||s&&L>=i){o&&Se(a,k,E);var _=s?L-y:D-y;return{placement:"bottom",maxHeight:_}}if(t==="auto"||s){var H=e,F=s?w:x;return F>=i&&(H=Math.min(F-y-u,e)),{placement:"top",maxHeight:H}}if(t==="bottom")return o&&Ve(a,k),{placement:"bottom",maxHeight:e};break;case"top":if(w>=g)return{placement:"top",maxHeight:e};if(x>=g&&!s)return o&&Se(a,T,E),{placement:"top",maxHeight:e};if(!s&&x>=i||s&&w>=i){var R=e;return(!s&&x>=i||s&&w>=i)&&(R=s?w-M:x-M),o&&Se(a,T,E),{placement:"top",maxHeight:R}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(t,'".'))}return l}function _r(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var zt=function(e){return e==="auto"?"bottom":e},jr=function(e,r){var i,t=e.placement,o=e.theme,s=o.borderRadius,u=o.spacing,a=o.colors;return C((i={label:"menu"},le(i,_r(t),"100%"),le(i,"position","absolute"),le(i,"width","100%"),le(i,"zIndex",1),i),r?{}:{backgroundColor:a.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},Bt=v.createContext(null),Hr=function(e){var r=e.children,i=e.minMenuHeight,t=e.maxMenuHeight,o=e.menuPlacement,s=e.menuPosition,u=e.menuShouldScrollIntoView,a=e.theme,l=v.useContext(Bt)||{},c=l.setPortalPlacement,d=v.useRef(null),p=v.useState(t),m=z(p,2),g=m[0],f=m[1],h=v.useState(null),b=z(h,2),S=b[0],O=b[1],y=a.spacing.controlHeight;return Ge(function(){var M=d.current;if(M){var w=s==="fixed",L=u&&!w,x=Nr({maxHeight:t,menuEl:M,minHeight:i,placement:o,shouldScroll:L,isFixedPosition:w,controlHeight:y});f(x.maxHeight),O(x.placement),c?.(x.placement)}},[t,o,s,u,i,c,y]),r({ref:d,placerProps:C(C({},e),{},{placement:S||zt(o),maxHeight:g})})},zr=function(e){var r=e.children,i=e.innerRef,t=e.innerProps;return I("div",V({},$(e,"menu",{menu:!0}),{ref:i},t),r)},Br=zr,Ur=function(e,r){var i=e.maxHeight,t=e.theme.spacing.baseUnit;return C({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},r?{}:{paddingBottom:t,paddingTop:t})},Wr=function(e){var r=e.children,i=e.innerProps,t=e.innerRef,o=e.isMulti;return I("div",V({},$(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:t},i),r)},Ut=function(e,r){var i=e.theme,t=i.spacing.baseUnit,o=i.colors;return C({textAlign:"center"},r?{}:{color:o.neutral40,padding:"".concat(t*2,"px ").concat(t*3,"px")})},Yr=Ut,Gr=Ut,Xr=function(e){var r=e.children,i=r===void 0?"No options":r,t=e.innerProps,o=J(e,Ar);return I("div",V({},$(C(C({},o),{},{children:i,innerProps:t}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),t),i)},Kr=function(e){var r=e.children,i=r===void 0?"Loading...":r,t=e.innerProps,o=J(e,$r);return I("div",V({},$(C(C({},o),{},{children:i,innerProps:t}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),t),i)},qr=function(e){var r=e.rect,i=e.offset,t=e.position;return{left:r.left,position:t,top:i,width:r.width,zIndex:1}},Zr=function(e){var r=e.appendTo,i=e.children,t=e.controlElement,o=e.innerProps,s=e.menuPlacement,u=e.menuPosition,a=v.useRef(null),l=v.useRef(null),c=v.useState(zt(s)),d=z(c,2),p=d[0],m=d[1],g=v.useMemo(function(){return{setPortalPlacement:m}},[]),f=v.useState(null),h=z(f,2),b=h[0],S=h[1],O=v.useCallback(function(){if(t){var L=Lr(t),x=u==="fixed"?0:window.pageYOffset,D=L[p]+x;(D!==b?.offset||L.left!==b?.rect.left||L.width!==b?.rect.width)&&S({offset:D,rect:L})}},[t,u,p,b?.offset,b?.rect.left,b?.rect.width]);Ge(function(){O()},[O]);var y=v.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),t&&a.current&&(l.current=Or(t,a.current,O,{elementResize:"ResizeObserver"in window}))},[t,O]);Ge(function(){y()},[y]);var M=v.useCallback(function(L){a.current=L,y()},[y]);if(!r&&u!=="fixed"||!b)return null;var w=I("div",V({ref:M},$(C(C({},e),{},{offset:b.offset,position:u,rect:b.rect}),"menuPortal",{"menu-portal":!0}),o),i);return I(Bt.Provider,{value:g},r?Pn.createPortal(w,r):w)},Jr=function(e){var r=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:r?"none":void 0,position:"relative"}},Qr=function(e){var r=e.children,i=e.innerProps,t=e.isDisabled,o=e.isRtl;return I("div",V({},$(e,"container",{"--is-disabled":t,"--is-rtl":o}),i),r)},ei=function(e,r){var i=e.theme.spacing,t=e.isMulti,o=e.hasValue,s=e.selectProps.controlShouldRenderValue;return C({alignItems:"center",display:t&&o&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},r?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},ti=function(e){var r=e.children,i=e.innerProps,t=e.isMulti,o=e.hasValue;return I("div",V({},$(e,"valueContainer",{"value-container":!0,"value-container--is-multi":t,"value-container--has-value":o}),i),r)},ni=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},ri=function(e){var r=e.children,i=e.innerProps;return I("div",V({},$(e,"indicatorsContainer",{indicators:!0}),i),r)},dt,ii=["size"],oi=["innerProps","isRtl","size"],ai={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Wt=function(e){var r=e.size,i=J(e,ii);return I("svg",V({height:r,width:r,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ai},i))},et=function(e){return I(Wt,V({size:20},e),I("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Yt=function(e){return I(Wt,V({size:20},e),I("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Gt=function(e,r){var i=e.isFocused,t=e.theme,o=t.spacing.baseUnit,s=t.colors;return C({label:"indicatorContainer",display:"flex",transition:"color 150ms"},r?{}:{color:i?s.neutral60:s.neutral20,padding:o*2,":hover":{color:i?s.neutral80:s.neutral40}})},si=Gt,li=function(e){var r=e.children,i=e.innerProps;return I("div",V({},$(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),r||I(Yt,null))},ui=Gt,ci=function(e){var r=e.children,i=e.innerProps;return I("div",V({},$(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),r||I(et,null))},di=function(e,r){var i=e.isDisabled,t=e.theme,o=t.spacing.baseUnit,s=t.colors;return C({label:"indicatorSeparator",alignSelf:"stretch",width:1},r?{}:{backgroundColor:i?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},pi=function(e){var r=e.innerProps;return I("span",V({},r,$(e,"indicatorSeparator",{"indicator-separator":!0})))},fi=xn(dt||(dt=lr([` +import{h as gn,W as Mt,o as bn,j as P,g as De,l as Sn,X as yn,r as v,R as Re,Y as Vt,Z as On,_ as Cn,$ as xn,a0 as I,a1 as V,a2 as Pn,a3 as Lt,B as N,u as ne,a4 as In,a5 as rt,I as qe,q as wn,H as Mn}from"./B60Dx_GOYdnk.js";import{b5 as Vn,w as Ln,u as Dn,aZ as Rn,i as En,k as kn}from"./j0mck_Meu7Xh.js";import{u as Fn}from"./BpQSjk0kyblh.js";import{u as Tn}from"./vepZWq5kkQUw.js";import{M as An,d as $n}from"./C9VJq5Ka7299.js";import{F as Nn}from"./2C0geDG_OBHU.js";const Dt=gn(function(e,r){const{borderLeftWidth:i,borderBottomWidth:t,borderTopWidth:o,borderRightWidth:s,borderWidth:u,borderStyle:a,borderColor:l,...c}=Mt("Divider",e),{className:d,orientation:p="horizontal",__css:m,...g}=bn(e),f={vertical:{borderLeftWidth:i||s||u||"1px",height:"100%"},horizontal:{borderBottomWidth:t||o||u||"1px",width:"100%"}};return P.jsx(De.hr,{ref:r,"aria-orientation":p,...g,__css:{...c,border:"0",borderColor:l,borderStyle:a,...f[p],...m},className:Sn("chakra-divider",d)})});Dt.displayName="Divider";function _n(n,e){if(n==null)return{};var r={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.includes(i))continue;r[i]=n[i]}return r}function We(n,e){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},We(n,e)}function ie(n){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(n)}function jn(n,e){if(ie(n)!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var i=r.call(n,e||"default");if(ie(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Rt(n){var e=jn(n,"string");return ie(e)=="symbol"?e:e+""}function le(n,e,r){return(e=Rt(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function Hn(n,e={}){const{ssr:r=!0,fallback:i}=e,{getWindow:t}=yn(),o=Array.isArray(n)?n:[n];let s=Array.isArray(i)?i:[i];s=s.filter(l=>l!=null);const[u,a]=v.useState(()=>o.map((l,c)=>({media:l,matches:r?!!s[c]:t().matchMedia(l).matches})));return v.useEffect(()=>{const l=t();a(o.map(p=>({media:p,matches:l.matchMedia(p).matches})));const c=o.map(p=>l.matchMedia(p)),d=p=>{a(m=>m.slice().map(g=>g.media===p.media?{...g,matches:p.matches}:g))};return c.forEach(p=>{typeof p.addListener=="function"?p.addListener(d):p.addEventListener("change",d)}),()=>{c.forEach(p=>{typeof p.removeListener=="function"?p.removeListener(d):p.removeEventListener("change",d)})}},[t]),u.map(l=>l.matches)}function zn(n){const e=Vt(n)?n:{fallback:n??"base"},i=Re().__breakpoints.details.map(({minMaxQuery:u,breakpoint:a})=>({breakpoint:a,query:u.replace("@media screen and ","")})),t=i.map(u=>u.breakpoint===e.fallback),s=Hn(i.map(u=>u.query),{fallback:t,ssr:e.ssr}).findIndex(u=>u==!0);return i[s]?.breakpoint??e.fallback}function Bn(n,e,r=On){let i=Object.keys(n).indexOf(e);if(i!==-1)return n[e];let t=r.indexOf(e);for(;t>=0;){const o=r[t];if(n.hasOwnProperty(o)){i=t;break}t-=1}if(i!==-1){const o=r[i];return n[o]}}function Un(n,e){const r=Vt(e)?e:{fallback:e??"base"},i=zn(r),t=Re();if(!i)return;const o=Array.from(t.__breakpoints?.keys||[]),s=Array.isArray(n)?Object.fromEntries(Object.entries(Cn(n,o)).map(([u,a])=>[u,a])):n;return Bn(s,i,o)}function Wn(n,e){const r=v.useRef(n);r.current=n;const i=Gn(e);return v.useMemo(()=>Vn(()=>r.current()),[i])}function Yn(n){const e=v.useCallback(()=>n.peek(),[n]),r=v.useCallback(t=>{const o=Ln(()=>[n.value],t);return()=>o.destroy()},[n]),i=v.useSyncExternalStore(r,e);return v.useDebugValue(i),i}function Ke(n,e){const r=Wn(n,e),i=Yn(r);return v.useDebugValue(i),i}function Gn(n){const e=v.useRef();return(e.current==null||!Xn(e.current,n))&&(e.current=n??[]),e.current}function Xn(n,e){return n===e?!0:n.length===(e?.length??0)&&n.every((r,i)=>r===e[i])}function it(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),r.push.apply(r,i)}return r}function C(n){for(var e=1;en.length)&&(e=n.length);for(var r=0,i=Array(e);r({x:n,y:n});function dr(n){const{x:e,y:r,width:i,height:t}=n;return{width:i,height:t,top:r,left:e,right:e+i,bottom:r+t,x:e,y:r}}function Ft(n){return At(n)?(n.nodeName||"").toLowerCase():"#document"}function te(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Tt(n){var e;return(e=(At(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function At(n){return n instanceof Node||n instanceof te(n).Node}function pr(n){return n instanceof Element||n instanceof te(n).Element}function Ze(n){return n instanceof HTMLElement||n instanceof te(n).HTMLElement}function at(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof te(n).ShadowRoot}function $t(n){const{overflow:e,overflowX:r,overflowY:i,display:t}=Je(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&!["inline","contents"].includes(t)}function fr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function vr(n){return["html","body","#document"].includes(Ft(n))}function Je(n){return te(n).getComputedStyle(n)}function mr(n){if(Ft(n)==="html")return n;const e=n.assignedSlot||n.parentNode||at(n)&&n.host||Tt(n);return at(e)?e.host:e}function Nt(n){const e=mr(n);return vr(e)?n.ownerDocument?n.ownerDocument.body:n.body:Ze(e)&&$t(e)?e:Nt(e)}function Ie(n,e,r){var i;e===void 0&&(e=[]),r===void 0&&(r=!0);const t=Nt(n),o=t===((i=n.ownerDocument)==null?void 0:i.body),s=te(t);return o?e.concat(s,s.visualViewport||[],$t(t)?t:[],s.frameElement&&r?Ie(s.frameElement):[]):e.concat(t,Ie(t,[],r))}function hr(n){const e=Je(n);let r=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const t=Ze(n),o=t?n.offsetWidth:r,s=t?n.offsetHeight:i,u=xe(r)!==o||xe(i)!==s;return u&&(r=o,i=s),{width:r,height:i,$:u}}function Qe(n){return pr(n)?n:n.contextElement}function st(n){const e=Qe(n);if(!Ze(e))return Pe(1);const r=e.getBoundingClientRect(),{width:i,height:t,$:o}=hr(e);let s=(o?xe(r.width):r.width)/i,u=(o?xe(r.height):r.height)/t;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const gr=Pe(0);function br(n){const e=te(n);return!fr()||!e.visualViewport?gr:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Sr(n,e,r){return!1}function lt(n,e,r,i){e===void 0&&(e=!1);const t=n.getBoundingClientRect(),o=Qe(n);let s=Pe(1);e&&(s=st(n));const u=Sr()?br(o):Pe(0);let a=(t.left+u.x)/s.x,l=(t.top+u.y)/s.y,c=t.width/s.x,d=t.height/s.y;if(o){const p=te(o),m=i;let g=p,f=g.frameElement;for(;f&&i&&m!==g;){const h=st(f),b=f.getBoundingClientRect(),S=Je(f),O=b.left+(f.clientLeft+parseFloat(S.paddingLeft))*h.x,y=b.top+(f.clientTop+parseFloat(S.paddingTop))*h.y;a*=h.x,l*=h.y,c*=h.x,d*=h.y,a+=O,l+=y,g=te(f),f=g.frameElement}}return dr({width:c,height:d,x:a,y:l})}function yr(n,e){let r=null,i;const t=Tt(n);function o(){var u;clearTimeout(i),(u=r)==null||u.disconnect(),r=null}function s(u,a){u===void 0&&(u=!1),a===void 0&&(a=1),o();const{left:l,top:c,width:d,height:p}=n.getBoundingClientRect();if(u||e(),!d||!p)return;const m=be(c),g=be(t.clientWidth-(l+d)),f=be(t.clientHeight-(c+p)),h=be(l),S={rootMargin:-m+"px "+-g+"px "+-f+"px "+-h+"px",threshold:cr(0,ur(1,a))||1};let O=!0;function y(M){const w=M[0].intersectionRatio;if(w!==a){if(!O)return s();w?s(!1,w):i=setTimeout(()=>{s(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(y,{...S,root:t.ownerDocument})}catch{r=new IntersectionObserver(y,S)}r.observe(n)}return s(!0),o}function Or(n,e,r,i){i===void 0&&(i={});const{ancestorScroll:t=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,l=Qe(n),c=t||o?[...l?Ie(l):[],...Ie(e)]:[];c.forEach(b=>{t&&b.addEventListener("scroll",r,{passive:!0}),o&&b.addEventListener("resize",r)});const d=l&&u?yr(l,r):null;let p=-1,m=null;s&&(m=new ResizeObserver(b=>{let[S]=b;S&&S.target===l&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var O;(O=m)==null||O.observe(e)})),r()}),l&&!a&&m.observe(l),m.observe(e));let g,f=a?lt(n):null;a&&h();function h(){const b=lt(n);f&&(b.x!==f.x||b.y!==f.y||b.width!==f.width||b.height!==f.height)&&r(),f=b,g=requestAnimationFrame(h)}return r(),()=>{var b;c.forEach(S=>{t&&S.removeEventListener("scroll",r),o&&S.removeEventListener("resize",r)}),d?.(),(b=m)==null||b.disconnect(),m=null,a&&cancelAnimationFrame(g)}}var Ge=v.useLayoutEffect,Cr=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],we=function(){};function xr(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function Pr(n,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),t=2;t-1}function wr(n){return ke(n)?window.innerHeight:n.clientHeight}function jt(n){return ke(n)?window.pageYOffset:n.scrollTop}function Ve(n,e){if(ke(n)){window.scrollTo(0,e);return}n.scrollTop=e}function Mr(n){var e=getComputedStyle(n),r=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var t=n;t=t.parentElement;)if(e=getComputedStyle(t),!(r&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return t;return document.documentElement}function Vr(n,e,r,i){return r*((n=n/i-1)*n*n+1)+e}function Se(n,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:we,t=jt(n),o=e-t,s=10,u=0;function a(){u+=s;var l=Vr(u,t,o,r);Ve(n,l),ur.bottom?Ve(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+t,n.scrollHeight)):i.top-t1?r-1:0),t=1;t=g)return{placement:"bottom",maxHeight:e};if(D>=g&&!s)return o&&Se(a,k,E),{placement:"bottom",maxHeight:e};if(!s&&D>=i||s&&L>=i){o&&Se(a,k,E);var _=s?L-y:D-y;return{placement:"bottom",maxHeight:_}}if(t==="auto"||s){var H=e,F=s?w:x;return F>=i&&(H=Math.min(F-y-u,e)),{placement:"top",maxHeight:H}}if(t==="bottom")return o&&Ve(a,k),{placement:"bottom",maxHeight:e};break;case"top":if(w>=g)return{placement:"top",maxHeight:e};if(x>=g&&!s)return o&&Se(a,T,E),{placement:"top",maxHeight:e};if(!s&&x>=i||s&&w>=i){var R=e;return(!s&&x>=i||s&&w>=i)&&(R=s?w-M:x-M),o&&Se(a,T,E),{placement:"top",maxHeight:R}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(t,'".'))}return l}function _r(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var zt=function(e){return e==="auto"?"bottom":e},jr=function(e,r){var i,t=e.placement,o=e.theme,s=o.borderRadius,u=o.spacing,a=o.colors;return C((i={label:"menu"},le(i,_r(t),"100%"),le(i,"position","absolute"),le(i,"width","100%"),le(i,"zIndex",1),i),r?{}:{backgroundColor:a.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},Bt=v.createContext(null),Hr=function(e){var r=e.children,i=e.minMenuHeight,t=e.maxMenuHeight,o=e.menuPlacement,s=e.menuPosition,u=e.menuShouldScrollIntoView,a=e.theme,l=v.useContext(Bt)||{},c=l.setPortalPlacement,d=v.useRef(null),p=v.useState(t),m=z(p,2),g=m[0],f=m[1],h=v.useState(null),b=z(h,2),S=b[0],O=b[1],y=a.spacing.controlHeight;return Ge(function(){var M=d.current;if(M){var w=s==="fixed",L=u&&!w,x=Nr({maxHeight:t,menuEl:M,minHeight:i,placement:o,shouldScroll:L,isFixedPosition:w,controlHeight:y});f(x.maxHeight),O(x.placement),c?.(x.placement)}},[t,o,s,u,i,c,y]),r({ref:d,placerProps:C(C({},e),{},{placement:S||zt(o),maxHeight:g})})},zr=function(e){var r=e.children,i=e.innerRef,t=e.innerProps;return I("div",V({},$(e,"menu",{menu:!0}),{ref:i},t),r)},Br=zr,Ur=function(e,r){var i=e.maxHeight,t=e.theme.spacing.baseUnit;return C({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},r?{}:{paddingBottom:t,paddingTop:t})},Wr=function(e){var r=e.children,i=e.innerProps,t=e.innerRef,o=e.isMulti;return I("div",V({},$(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:t},i),r)},Ut=function(e,r){var i=e.theme,t=i.spacing.baseUnit,o=i.colors;return C({textAlign:"center"},r?{}:{color:o.neutral40,padding:"".concat(t*2,"px ").concat(t*3,"px")})},Yr=Ut,Gr=Ut,Xr=function(e){var r=e.children,i=r===void 0?"No options":r,t=e.innerProps,o=J(e,Ar);return I("div",V({},$(C(C({},o),{},{children:i,innerProps:t}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),t),i)},qr=function(e){var r=e.children,i=r===void 0?"Loading...":r,t=e.innerProps,o=J(e,$r);return I("div",V({},$(C(C({},o),{},{children:i,innerProps:t}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),t),i)},Kr=function(e){var r=e.rect,i=e.offset,t=e.position;return{left:r.left,position:t,top:i,width:r.width,zIndex:1}},Zr=function(e){var r=e.appendTo,i=e.children,t=e.controlElement,o=e.innerProps,s=e.menuPlacement,u=e.menuPosition,a=v.useRef(null),l=v.useRef(null),c=v.useState(zt(s)),d=z(c,2),p=d[0],m=d[1],g=v.useMemo(function(){return{setPortalPlacement:m}},[]),f=v.useState(null),h=z(f,2),b=h[0],S=h[1],O=v.useCallback(function(){if(t){var L=Lr(t),x=u==="fixed"?0:window.pageYOffset,D=L[p]+x;(D!==b?.offset||L.left!==b?.rect.left||L.width!==b?.rect.width)&&S({offset:D,rect:L})}},[t,u,p,b?.offset,b?.rect.left,b?.rect.width]);Ge(function(){O()},[O]);var y=v.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),t&&a.current&&(l.current=Or(t,a.current,O,{elementResize:"ResizeObserver"in window}))},[t,O]);Ge(function(){y()},[y]);var M=v.useCallback(function(L){a.current=L,y()},[y]);if(!r&&u!=="fixed"||!b)return null;var w=I("div",V({ref:M},$(C(C({},e),{},{offset:b.offset,position:u,rect:b.rect}),"menuPortal",{"menu-portal":!0}),o),i);return I(Bt.Provider,{value:g},r?Pn.createPortal(w,r):w)},Jr=function(e){var r=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:r?"none":void 0,position:"relative"}},Qr=function(e){var r=e.children,i=e.innerProps,t=e.isDisabled,o=e.isRtl;return I("div",V({},$(e,"container",{"--is-disabled":t,"--is-rtl":o}),i),r)},ei=function(e,r){var i=e.theme.spacing,t=e.isMulti,o=e.hasValue,s=e.selectProps.controlShouldRenderValue;return C({alignItems:"center",display:t&&o&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},r?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},ti=function(e){var r=e.children,i=e.innerProps,t=e.isMulti,o=e.hasValue;return I("div",V({},$(e,"valueContainer",{"value-container":!0,"value-container--is-multi":t,"value-container--has-value":o}),i),r)},ni=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},ri=function(e){var r=e.children,i=e.innerProps;return I("div",V({},$(e,"indicatorsContainer",{indicators:!0}),i),r)},dt,ii=["size"],oi=["innerProps","isRtl","size"],ai={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Wt=function(e){var r=e.size,i=J(e,ii);return I("svg",V({height:r,width:r,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ai},i))},et=function(e){return I(Wt,V({size:20},e),I("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Yt=function(e){return I(Wt,V({size:20},e),I("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Gt=function(e,r){var i=e.isFocused,t=e.theme,o=t.spacing.baseUnit,s=t.colors;return C({label:"indicatorContainer",display:"flex",transition:"color 150ms"},r?{}:{color:i?s.neutral60:s.neutral20,padding:o*2,":hover":{color:i?s.neutral80:s.neutral40}})},si=Gt,li=function(e){var r=e.children,i=e.innerProps;return I("div",V({},$(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),r||I(Yt,null))},ui=Gt,ci=function(e){var r=e.children,i=e.innerProps;return I("div",V({},$(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),r||I(et,null))},di=function(e,r){var i=e.isDisabled,t=e.theme,o=t.spacing.baseUnit,s=t.colors;return C({label:"indicatorSeparator",alignSelf:"stretch",width:1},r?{}:{backgroundColor:i?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},pi=function(e){var r=e.innerProps;return I("span",V({},r,$(e,"indicatorSeparator",{"indicator-separator":!0})))},fi=xn(dt||(dt=lr([` 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } -`]))),vi=function(e,r){var i=e.isFocused,t=e.size,o=e.theme,s=o.colors,u=o.spacing.baseUnit;return C({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:t,lineHeight:1,marginRight:t,textAlign:"center",verticalAlign:"middle"},r?{}:{color:i?s.neutral60:s.neutral20,padding:u*2})},Ne=function(e){var r=e.delay,i=e.offset;return I("span",{css:Lt({animation:"".concat(fi," 1s ease-in-out ").concat(r,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},mi=function(e){var r=e.innerProps,i=e.isRtl,t=e.size,o=t===void 0?4:t,s=J(e,oi);return I("div",V({},$(C(C({},s),{},{innerProps:r,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),r),I(Ne,{delay:0,offset:i}),I(Ne,{delay:160,offset:!0}),I(Ne,{delay:320,offset:!i}))},hi=function(e,r){var i=e.isDisabled,t=e.isFocused,o=e.theme,s=o.colors,u=o.borderRadius,a=o.spacing;return C({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},r?{}:{backgroundColor:i?s.neutral5:s.neutral0,borderColor:i?s.neutral10:t?s.primary:s.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:t?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:t?s.primary:s.neutral30}})},gi=function(e){var r=e.children,i=e.isDisabled,t=e.isFocused,o=e.innerRef,s=e.innerProps,u=e.menuIsOpen;return I("div",V({ref:o},$(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":t,"control--menu-is-open":u}),s,{"aria-disabled":i||void 0}),r)},bi=gi,Si=["data"],yi=function(e,r){var i=e.theme.spacing;return r?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},Oi=function(e){var r=e.children,i=e.cx,t=e.getStyles,o=e.getClassNames,s=e.Heading,u=e.headingProps,a=e.innerProps,l=e.label,c=e.theme,d=e.selectProps;return I("div",V({},$(e,"group",{group:!0}),a),I(s,V({},u,{selectProps:d,theme:c,getStyles:t,getClassNames:o,cx:i}),l),I("div",null,r))},Ci=function(e,r){var i=e.theme,t=i.colors,o=i.spacing;return C({label:"group",cursor:"default",display:"block"},r?{}:{color:t.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},xi=function(e){var r=_t(e);r.data;var i=J(r,Si);return I("div",V({},$(e,"groupHeading",{"group-heading":!0}),i))},Pi=Oi,Ii=["innerRef","isDisabled","isHidden","inputClassName"],wi=function(e,r){var i=e.isDisabled,t=e.value,o=e.theme,s=o.spacing,u=o.colors;return C(C({visibility:i?"hidden":"visible",transform:t?"translateZ(0)":""},Mi),r?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:u.neutral80})},Xt={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Mi={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":C({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Xt)},Vi=function(e){return C({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Xt)},Li=function(e){var r=e.cx,i=e.value,t=_t(e),o=t.innerRef,s=t.isDisabled,u=t.isHidden,a=t.inputClassName,l=J(t,Ii);return I("div",V({},$(e,"input",{"input-container":!0}),{"data-value":i||""}),I("input",V({className:r({input:!0},a),ref:o,style:Vi(u),disabled:s},l)))},Di=Li,Ri=function(e,r){var i=e.theme,t=i.spacing,o=i.borderRadius,s=i.colors;return C({label:"multiValue",display:"flex",minWidth:0},r?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:t.baseUnit/2})},Ei=function(e,r){var i=e.theme,t=i.borderRadius,o=i.colors,s=e.cropWithEllipsis;return C({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},r?{}:{borderRadius:t/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},ki=function(e,r){var i=e.theme,t=i.spacing,o=i.borderRadius,s=i.colors,u=e.isFocused;return C({alignItems:"center",display:"flex"},r?{}:{borderRadius:o/2,backgroundColor:u?s.dangerLight:void 0,paddingLeft:t.baseUnit,paddingRight:t.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},Kt=function(e){var r=e.children,i=e.innerProps;return I("div",i,r)},Fi=Kt,Ti=Kt;function Ai(n){var e=n.children,r=n.innerProps;return I("div",V({role:"button"},r),e||I(et,{size:14}))}var $i=function(e){var r=e.children,i=e.components,t=e.data,o=e.innerProps,s=e.isDisabled,u=e.removeProps,a=e.selectProps,l=i.Container,c=i.Label,d=i.Remove;return I(l,{data:t,innerProps:C(C({},$(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:a},I(c,{data:t,innerProps:C({},$(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},r),I(d,{data:t,innerProps:C(C({},$(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(r||"option")},u),selectProps:a}))},Ni=$i,_i=function(e,r){var i=e.isDisabled,t=e.isFocused,o=e.isSelected,s=e.theme,u=s.spacing,a=s.colors;return C({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},r?{}:{backgroundColor:o?a.primary:t?a.primary25:"transparent",color:i?a.neutral20:o?a.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?a.primary:a.primary50}})},ji=function(e){var r=e.children,i=e.isDisabled,t=e.isFocused,o=e.isSelected,s=e.innerRef,u=e.innerProps;return I("div",V({},$(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":t,"option--is-selected":o}),{ref:s,"aria-disabled":i},u),r)},Hi=ji,zi=function(e,r){var i=e.theme,t=i.spacing,o=i.colors;return C({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},r?{}:{color:o.neutral50,marginLeft:t.baseUnit/2,marginRight:t.baseUnit/2})},Bi=function(e){var r=e.children,i=e.innerProps;return I("div",V({},$(e,"placeholder",{placeholder:!0}),i),r)},Ui=Bi,Wi=function(e,r){var i=e.isDisabled,t=e.theme,o=t.spacing,s=t.colors;return C({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r?{}:{color:i?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Yi=function(e){var r=e.children,i=e.isDisabled,t=e.innerProps;return I("div",V({},$(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),t),r)},Gi=Yi,Xi={ClearIndicator:ci,Control:bi,DropdownIndicator:li,DownChevron:Yt,CrossIcon:et,Group:Pi,GroupHeading:xi,IndicatorsContainer:ri,IndicatorSeparator:pi,Input:Di,LoadingIndicator:mi,Menu:Br,MenuList:Wr,MenuPortal:Zr,LoadingMessage:Kr,NoOptionsMessage:Xr,MultiValue:Ni,MultiValueContainer:Fi,MultiValueLabel:Ti,MultiValueRemove:Ai,Option:Hi,Placeholder:Ui,SelectContainer:Qr,SingleValue:Gi,ValueContainer:ti},Ki=function(e){return C(C({},Xi),e.components)},pt=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function qi(n,e){return!!(n===e||pt(n)&&pt(e))}function Zi(n,e){if(n.length!==e.length)return!1;for(var r=0;r1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(t," is disabled. Select another option."):"option ".concat(t,", selected.");default:return""}},onFocus:function(e){var r=e.context,i=e.focused,t=e.options,o=e.label,s=o===void 0?"":o,u=e.selectValue,a=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,d=function(f,h){return f&&f.length?"".concat(f.indexOf(h)+1," of ").concat(f.length):""};if(r==="value"&&u)return"value ".concat(s," focused, ").concat(d(u,i),".");if(r==="menu"&&c){var p=a?" disabled":"",m="".concat(l?" selected":"").concat(p);return"".concat(s).concat(m,", ").concat(d(t,i),".")}return""},onFilter:function(e){var r=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(r?" for search term "+r:"",".")}},no=function(e){var r=e.ariaSelection,i=e.focusedOption,t=e.focusedValue,o=e.focusableOptions,s=e.isFocused,u=e.selectValue,a=e.selectProps,l=e.id,c=e.isAppleDevice,d=a.ariaLiveMessages,p=a.getOptionLabel,m=a.inputValue,g=a.isMulti,f=a.isOptionDisabled,h=a.isSearchable,b=a.menuIsOpen,S=a.options,O=a.screenReaderStatus,y=a.tabSelectsValue,M=a.isLoading,w=a["aria-label"],L=a["aria-live"],x=v.useMemo(function(){return C(C({},to),d||{})},[d]),D=v.useMemo(function(){var F="";if(r&&x.onChange){var R=r.option,W=r.options,j=r.removedValue,Z=r.removedValues,B=r.value,re=function(q){return Array.isArray(q)?null:q},A=j||R||re(B),U=A?p(A):"",K=W||Z||void 0,Y=K?K.map(p):[],G=C({isDisabled:A&&f(A,u),label:U,labels:Y},r);F=x.onChange(G)}return F},[r,x,f,u,p]),k=v.useMemo(function(){var F="",R=i||t,W=!!(i&&u&&u.includes(i));if(R&&x.onFocus){var j={focused:R,label:p(R),isDisabled:f(R,u),isSelected:W,options:o,context:R===i?"menu":"value",selectValue:u,isAppleDevice:c};F=x.onFocus(j)}return F},[i,t,p,f,x,o,u,c]),T=v.useMemo(function(){var F="";if(b&&S.length&&!M&&x.onFilter){var R=O({count:o.length});F=x.onFilter({inputValue:m,resultsMessage:R})}return F},[o,m,b,x,S,O,M]),E=r?.action==="initial-input-focus",_=v.useMemo(function(){var F="";if(x.guidance){var R=t?"value":b?"menu":"input";F=x.guidance({"aria-label":w,context:R,isDisabled:i&&f(i,u),isMulti:g,isSearchable:h,tabSelectsValue:y,isInitialFocus:E})}return F},[w,i,t,g,f,h,b,x,u,y,E]),H=I(v.Fragment,null,I("span",{id:"aria-selection"},D),I("span",{id:"aria-focused"},k),I("span",{id:"aria-results"},T),I("span",{id:"aria-guidance"},_));return I(v.Fragment,null,I(ft,{id:l},E&&H),I(ft,{"aria-live":L,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!E&&H))},ro=no,Xe=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],io=new RegExp("["+Xe.map(function(n){return n.letters}).join("")+"]","g"),qt={};for(var _e=0;_e-1}},lo=["innerRef"];function uo(n){var e=n.innerRef,r=J(n,lo),i=Tr(r,"onExited","in","enter","exit","appear");return I("input",V({ref:e},i,{css:Lt({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var co=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function po(n){var e=n.isEnabled,r=n.onBottomArrive,i=n.onBottomLeave,t=n.onTopArrive,o=n.onTopLeave,s=v.useRef(!1),u=v.useRef(!1),a=v.useRef(0),l=v.useRef(null),c=v.useCallback(function(h,b){if(l.current!==null){var S=l.current,O=S.scrollTop,y=S.scrollHeight,M=S.clientHeight,w=l.current,L=b>0,x=y-M-O,D=!1;x>b&&s.current&&(i&&i(h),s.current=!1),L&&u.current&&(o&&o(h),u.current=!1),L&&b>x?(r&&!s.current&&r(h),w.scrollTop=y,D=!0,s.current=!0):!L&&-b>O&&(t&&!u.current&&t(h),w.scrollTop=0,D=!0,u.current=!0),D&&co(h)}},[r,i,t,o]),d=v.useCallback(function(h){c(h,h.deltaY)},[c]),p=v.useCallback(function(h){a.current=h.changedTouches[0].clientY},[]),m=v.useCallback(function(h){var b=a.current-h.changedTouches[0].clientY;c(h,b)},[c]),g=v.useCallback(function(h){if(h){var b=Er?{passive:!1}:!1;h.addEventListener("wheel",d,b),h.addEventListener("touchstart",p,b),h.addEventListener("touchmove",m,b)}},[m,p,d]),f=v.useCallback(function(h){h&&(h.removeEventListener("wheel",d,!1),h.removeEventListener("touchstart",p,!1),h.removeEventListener("touchmove",m,!1))},[m,p,d]);return v.useEffect(function(){if(e){var h=l.current;return g(h),function(){f(h)}}},[e,g,f]),function(h){l.current=h}}var mt=["boxSizing","height","overflow","paddingRight","position"],ht={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function gt(n){n.preventDefault()}function bt(n){n.stopPropagation()}function St(){var n=this.scrollTop,e=this.scrollHeight,r=n+this.offsetHeight;n===0?this.scrollTop=1:r===e&&(this.scrollTop=n-1)}function yt(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ot=!!(typeof window<"u"&&window.document&&window.document.createElement),fe=0,se={capture:!1,passive:!1};function fo(n){var e=n.isEnabled,r=n.accountForScrollbars,i=r===void 0?!0:r,t=v.useRef({}),o=v.useRef(null),s=v.useCallback(function(a){if(Ot){var l=document.body,c=l&&l.style;if(i&&mt.forEach(function(g){var f=c&&c[g];t.current[g]=f}),i&&fe<1){var d=parseInt(t.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,m=window.innerWidth-p+d||0;Object.keys(ht).forEach(function(g){var f=ht[g];c&&(c[g]=f)}),c&&(c.paddingRight="".concat(m,"px"))}l&&yt()&&(l.addEventListener("touchmove",gt,se),a&&(a.addEventListener("touchstart",St,se),a.addEventListener("touchmove",bt,se))),fe+=1}},[i]),u=v.useCallback(function(a){if(Ot){var l=document.body,c=l&&l.style;fe=Math.max(fe-1,0),i&&fe<1&&mt.forEach(function(d){var p=t.current[d];c&&(c[d]=p)}),l&&yt()&&(l.removeEventListener("touchmove",gt,se),a&&(a.removeEventListener("touchstart",St,se),a.removeEventListener("touchmove",bt,se)))}},[i]);return v.useEffect(function(){if(e){var a=o.current;return s(a),function(){u(a)}}},[e,s,u]),function(a){o.current=a}}var vo=function(e){var r=e.target;return r.ownerDocument.activeElement&&r.ownerDocument.activeElement.blur()},mo={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ho(n){var e=n.children,r=n.lockEnabled,i=n.captureEnabled,t=i===void 0?!0:i,o=n.onBottomArrive,s=n.onBottomLeave,u=n.onTopArrive,a=n.onTopLeave,l=po({isEnabled:t,onBottomArrive:o,onBottomLeave:s,onTopArrive:u,onTopLeave:a}),c=fo({isEnabled:r}),d=function(m){l(m),c(m)};return I(v.Fragment,null,r&&I("div",{onClick:vo,css:mo}),e(d))}var go={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},bo=function(e){var r=e.name,i=e.onFocus;return I("input",{required:!0,name:r,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:go,value:"",onChange:function(){}})},So=bo;function tt(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function yo(){return tt(/^iPhone/i)}function Jt(){return tt(/^Mac/i)}function Oo(){return tt(/^iPad/i)||Jt()&&navigator.maxTouchPoints>1}function Co(){return yo()||Oo()}function xo(){return Jt()||Co()}var Po=function(e){return e.label},Qt=function(e){return e.label},en=function(e){return e.value},Io=function(e){return!!e.isDisabled},wo={clearIndicator:ui,container:Jr,control:hi,dropdownIndicator:si,group:yi,groupHeading:Ci,indicatorsContainer:ni,indicatorSeparator:di,input:wi,loadingIndicator:vi,loadingMessage:Gr,menu:jr,menuList:Ur,menuPortal:qr,multiValue:Ri,multiValueLabel:Ei,multiValueRemove:ki,noOptionsMessage:Yr,option:_i,placeholder:zi,singleValue:Wi,valueContainer:ei},Mo={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Vo=4,tn=4,Lo=38,Do=tn*2,Ro={baseUnit:tn,controlHeight:Lo,menuGutter:Do},ze={borderRadius:Vo,colors:Mo,spacing:Ro},Eo={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ct(),captureMenuScroll:!ct(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:so(),formatGroupLabel:Po,getOptionLabel:Qt,getOptionValue:en,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Io,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Dr(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var r=e.count;return"".concat(r," result").concat(r!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Ct(n,e,r,i){var t=on(n,e,r),o=an(n,e,r),s=rn(n,e),u=Le(n,e);return{type:"option",data:e,isDisabled:t,isSelected:o,label:s,value:u,index:i}}function Oe(n,e){return n.options.map(function(r,i){if("options"in r){var t=r.options.map(function(s,u){return Ct(n,s,e,u)}).filter(function(s){return Pt(n,s)});return t.length>0?{type:"group",data:r,options:t,index:i}:void 0}var o=Ct(n,r,e,i);return Pt(n,o)?o:void 0}).filter(kr)}function nn(n){return n.reduce(function(e,r){return r.type==="group"?e.push.apply(e,ue(r.options.map(function(i){return i.data}))):e.push(r.data),e},[])}function xt(n,e){return n.reduce(function(r,i){return i.type==="group"?r.push.apply(r,ue(i.options.map(function(t){return{data:t.data,id:"".concat(e,"-").concat(i.index,"-").concat(t.index)}}))):r.push({data:i.data,id:"".concat(e,"-").concat(i.index)}),r},[])}function ko(n,e){return nn(Oe(n,e))}function Pt(n,e){var r=n.inputValue,i=r===void 0?"":r,t=e.data,o=e.isSelected,s=e.label,u=e.value;return(!ln(n)||!o)&&sn(n,{label:s,value:u,data:t},i)}function Fo(n,e){var r=n.focusedValue,i=n.selectValue,t=i.indexOf(r);if(t>-1){var o=e.indexOf(r);if(o>-1)return r;if(t-1?r:e[0]}var Be=function(e,r){var i,t=(i=e.find(function(o){return o.data===r}))===null||i===void 0?void 0:i.id;return t||null},rn=function(e,r){return e.getOptionLabel(r)},Le=function(e,r){return e.getOptionValue(r)};function on(n,e,r){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,r):!1}function an(n,e,r){if(r.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,r);var i=Le(n,e);return r.some(function(t){return Le(n,t)===i})}function sn(n,e,r){return n.filterOption?n.filterOption(e,r):!0}var ln=function(e){var r=e.hideSelectedOptions,i=e.isMulti;return r===void 0?i:r},Ao=1,me=function(n){tr(r,n);var e=ir(r);function r(i){var t;if(Qn(this,r),t=e.call(this,i),t.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.isAppleDevice=xo(),t.controlRef=null,t.getControlRef=function(a){t.controlRef=a},t.focusedOptionRef=null,t.getFocusedOptionRef=function(a){t.focusedOptionRef=a},t.menuListRef=null,t.getMenuListRef=function(a){t.menuListRef=a},t.inputRef=null,t.getInputRef=function(a){t.inputRef=a},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(a,l){var c=t.props,d=c.onChange,p=c.name;l.name=p,t.ariaOnChange(a,l),d(a,l)},t.setValue=function(a,l,c){var d=t.props,p=d.closeMenuOnSelect,m=d.isMulti,g=d.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:g}),p&&(t.setState({inputIsHiddenAfterUpdate:!m}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(a,{action:l,option:c})},t.selectOption=function(a){var l=t.props,c=l.blurInputOnSelect,d=l.isMulti,p=l.name,m=t.state.selectValue,g=d&&t.isOptionSelected(a,m),f=t.isOptionDisabled(a,m);if(g){var h=t.getOptionValue(a);t.setValue(m.filter(function(b){return t.getOptionValue(b)!==h}),"deselect-option",a)}else if(!f)d?t.setValue([].concat(ue(m),[a]),"select-option",a):t.setValue(a,"select-option");else{t.ariaOnChange(a,{action:"select-option",option:a,name:p});return}c&&t.blurInput()},t.removeValue=function(a){var l=t.props.isMulti,c=t.state.selectValue,d=t.getOptionValue(a),p=c.filter(function(g){return t.getOptionValue(g)!==d}),m=ve(l,p,p[0]||null);t.onChange(m,{action:"remove-value",removedValue:a}),t.focusInput()},t.clearValue=function(){var a=t.state.selectValue;t.onChange(ve(t.props.isMulti,[],null),{action:"clear",removedValues:a})},t.popValue=function(){var a=t.props.isMulti,l=t.state.selectValue,c=l[l.length-1],d=l.slice(0,l.length-1),p=ve(a,d,d[0]||null);t.onChange(p,{action:"pop-value",removedValue:c})},t.getFocusedOptionId=function(a){return Be(t.state.focusableOptionsWithIds,a)},t.getFocusableOptionsWithIds=function(){return xt(Oe(t.props,t.state.selectValue),t.getElementId("option"))},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var a=arguments.length,l=new Array(a),c=0;cm||p>m}},t.onTouchEnd=function(a){t.userIsDragging||(t.controlRef&&!a.composedPath().includes(t.controlRef)&&t.menuListRef&&!a.composedPath().includes(t.menuListRef)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(a){t.userIsDragging||t.onControlMouseDown(a)},t.onClearIndicatorTouchEnd=function(a){t.userIsDragging||t.onClearIndicatorMouseDown(a)},t.onDropdownIndicatorTouchEnd=function(a){t.userIsDragging||t.onDropdownIndicatorMouseDown(a)},t.handleInputChange=function(a){var l=t.props.inputValue,c=a.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(c,{action:"input-change",prevInputValue:l}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(a){t.props.onFocus&&t.props.onFocus(a),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(a){var l=t.props.inputValue;if(t.menuListRef&&t.menuListRef.contains(document.activeElement)){t.inputRef.focus();return}t.props.onBlur&&t.props.onBlur(a),t.onInputChange("",{action:"input-blur",prevInputValue:l}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1})},t.onOptionHover=function(a){if(!(t.blockOptionHover||t.state.focusedOption===a)){var l=t.getFocusableOptions(),c=l.indexOf(a);t.setState({focusedOption:a,focusedOptionId:c>-1?t.getFocusedOptionId(a):null})}},t.shouldHideSelectedOptions=function(){return ln(t.props)},t.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),t.focus()},t.onKeyDown=function(a){var l=t.props,c=l.isMulti,d=l.backspaceRemovesValue,p=l.escapeClearsValue,m=l.inputValue,g=l.isClearable,f=l.isDisabled,h=l.menuIsOpen,b=l.onKeyDown,S=l.tabSelectsValue,O=l.openMenuOnFocus,y=t.state,M=y.focusedOption,w=y.focusedValue,L=y.selectValue;if(!f&&!(typeof b=="function"&&(b(a),a.defaultPrevented))){switch(t.blockOptionHover=!0,a.key){case"ArrowLeft":if(!c||m)return;t.focusValue("previous");break;case"ArrowRight":if(!c||m)return;t.focusValue("next");break;case"Delete":case"Backspace":if(m)return;if(w)t.removeValue(w);else{if(!d)return;c?t.popValue():g&&t.clearValue()}break;case"Tab":if(t.isComposing||a.shiftKey||!h||!S||!M||O&&t.isOptionSelected(M,L))return;t.selectOption(M);break;case"Enter":if(a.keyCode===229)break;if(h){if(!M||t.isComposing)return;t.selectOption(M);break}return;case"Escape":h?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:m}),t.onMenuClose()):g&&p&&t.clearValue();break;case" ":if(m)return;if(!h){t.openMenu("first");break}if(!M)return;t.selectOption(M);break;case"ArrowUp":h?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":h?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!h)return;t.focusOption("pageup");break;case"PageDown":if(!h)return;t.focusOption("pagedown");break;case"Home":if(!h)return;t.focusOption("first");break;case"End":if(!h)return;t.focusOption("last");break;default:return}a.preventDefault()}},t.state.instancePrefix="react-select-"+(t.props.instanceId||++Ao),t.state.selectValue=Me(i.value),i.menuIsOpen&&t.state.selectValue.length){var o=t.getFocusableOptionsWithIds(),s=t.buildFocusableOptions(),u=s.indexOf(t.state.selectValue[0]);t.state.focusableOptionsWithIds=o,t.state.focusedOption=s[u],t.state.focusedOptionId=Be(o,s[u])}return t}return er(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&ut(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(t){var o=this.props,s=o.isDisabled,u=o.menuIsOpen,a=this.state.isFocused;(a&&!s&&t.isDisabled||a&&u&&!t.menuIsOpen)&&this.focusInput(),a&&s&&!t.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!s&&t.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ut(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(t,o){this.props.onInputChange(t,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(t){var o=this,s=this.state,u=s.selectValue,a=s.isFocused,l=this.buildFocusableOptions(),c=t==="first"?0:l.length-1;if(!this.props.isMulti){var d=l.indexOf(u[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[c],focusedOptionId:this.getFocusedOptionId(l[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(t){var o=this.state,s=o.selectValue,u=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=s.indexOf(u);u||(a=-1);var l=s.length-1,c=-1;if(s.length){switch(t){case"previous":a===0?c=0:a===-1?c=l:c=a-1;break;case"next":a>-1&&a0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var a=0,l=u.indexOf(s);s||(l=-1),t==="up"?a=l>0?l-1:u.length-1:t==="down"?a=(l+1)%u.length:t==="pageup"?(a=l-o,a<0&&(a=0)):t==="pagedown"?(a=l+o,a>u.length-1&&(a=u.length-1)):t==="last"&&(a=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(ze):C(C({},ze),this.props.theme):ze}},{key:"getCommonProps",value:function(){var t=this.clearValue,o=this.cx,s=this.getStyles,u=this.getClassNames,a=this.getValue,l=this.selectOption,c=this.setValue,d=this.props,p=d.isMulti,m=d.isRtl,g=d.options,f=this.hasValue();return{clearValue:t,cx:o,getStyles:s,getClassNames:u,getValue:a,hasValue:f,isMulti:p,isRtl:m,options:g,selectOption:l,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var t=this.state.selectValue;return t.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var t=this.props,o=t.isClearable,s=t.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(t,o){return on(this.props,t,o)}},{key:"isOptionSelected",value:function(t,o){return an(this.props,t,o)}},{key:"filterOption",value:function(t,o){return sn(this.props,t,o)}},{key:"formatOptionLabel",value:function(t,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(t,{context:o,inputValue:s,selectValue:u})}else return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,o=t.isDisabled,s=t.isSearchable,u=t.inputId,a=t.inputValue,l=t.tabIndex,c=t.form,d=t.menuIsOpen,p=t.required,m=this.getComponents(),g=m.Input,f=this.state,h=f.inputIsHidden,b=f.ariaSelection,S=this.commonProps,O=u||this.getElementId("input"),y=C(C(C({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||void 0},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?v.createElement(g,V({},S,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:O,innerRef:this.getInputRef,isDisabled:o,isHidden:h,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:c,type:"text",value:a},y)):v.createElement(uo,V({id:O,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:we,onFocus:this.onInputFocus,disabled:o,tabIndex:l,inputMode:"none",form:c,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,o=this.getComponents(),s=o.MultiValue,u=o.MultiValueContainer,a=o.MultiValueLabel,l=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,p=this.commonProps,m=this.props,g=m.controlShouldRenderValue,f=m.isDisabled,h=m.isMulti,b=m.inputValue,S=m.placeholder,O=this.state,y=O.selectValue,M=O.focusedValue,w=O.isFocused;if(!this.hasValue()||!g)return b?null:v.createElement(d,V({},p,{key:"placeholder",isDisabled:f,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),S);if(h)return y.map(function(x,D){var k=x===M,T="".concat(t.getOptionLabel(x),"-").concat(t.getOptionValue(x));return v.createElement(s,V({},p,{components:{Container:u,Label:a,Remove:l},isFocused:k,isDisabled:f,key:T,index:D,removeProps:{onClick:function(){return t.removeValue(x)},onTouchEnd:function(){return t.removeValue(x)},onMouseDown:function(_){_.preventDefault()}},data:x}),t.formatOptionLabel(x,"value"))});if(b)return null;var L=y[0];return v.createElement(c,V({},p,{data:L,isDisabled:f}),this.formatOptionLabel(L,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents(),o=t.ClearIndicator,s=this.commonProps,u=this.props,a=u.isDisabled,l=u.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||a||!this.hasValue()||l)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return v.createElement(o,V({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents(),o=t.LoadingIndicator,s=this.commonProps,u=this.props,a=u.isDisabled,l=u.isLoading,c=this.state.isFocused;if(!o||!l)return null;var d={"aria-hidden":"true"};return v.createElement(o,V({},s,{innerProps:d,isDisabled:a,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),o=t.DropdownIndicator,s=t.IndicatorSeparator;if(!o||!s)return null;var u=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused;return v.createElement(s,V({},u,{isDisabled:a,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents(),o=t.DropdownIndicator;if(!o)return null;var s=this.commonProps,u=this.props.isDisabled,a=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return v.createElement(o,V({},s,{innerProps:l,isDisabled:u,isFocused:a}))}},{key:"renderMenu",value:function(){var t=this,o=this.getComponents(),s=o.Group,u=o.GroupHeading,a=o.Menu,l=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,p=o.NoOptionsMessage,m=o.Option,g=this.commonProps,f=this.state.focusedOption,h=this.props,b=h.captureMenuScroll,S=h.inputValue,O=h.isLoading,y=h.loadingMessage,M=h.minMenuHeight,w=h.maxMenuHeight,L=h.menuIsOpen,x=h.menuPlacement,D=h.menuPosition,k=h.menuPortalTarget,T=h.menuShouldBlockScroll,E=h.menuShouldScrollIntoView,_=h.noOptionsMessage,H=h.onMenuScrollToTop,F=h.onMenuScrollToBottom;if(!L)return null;var R=function(U,K){var Y=U.type,G=U.data,ee=U.isDisabled,q=U.isSelected,oe=U.label,Te=U.value,he=f===G,ce=ee?void 0:function(){return t.onOptionHover(G)},Ae=ee?void 0:function(){return t.selectOption(G)},ge="".concat(t.getElementId("option"),"-").concat(K),de={id:ge,onClick:Ae,onMouseMove:ce,onMouseOver:ce,tabIndex:-1,role:"option","aria-selected":t.isAppleDevice?void 0:q};return v.createElement(m,V({},g,{innerProps:de,data:G,isDisabled:ee,isSelected:q,key:ge,label:oe,type:Y,value:Te,isFocused:he,innerRef:he?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(U.data,"menu"))},W;if(this.hasOptions())W=this.getCategorizedOptions().map(function(A){if(A.type==="group"){var U=A.data,K=A.options,Y=A.index,G="".concat(t.getElementId("group"),"-").concat(Y),ee="".concat(G,"-heading");return v.createElement(s,V({},g,{key:G,data:U,options:K,Heading:u,headingProps:{id:ee,data:A.data},label:t.formatGroupLabel(A.data)}),A.options.map(function(q){return R(q,"".concat(Y,"-").concat(q.index))}))}else if(A.type==="option")return R(A,"".concat(A.index))});else if(O){var j=y({inputValue:S});if(j===null)return null;W=v.createElement(d,g,j)}else{var Z=_({inputValue:S});if(Z===null)return null;W=v.createElement(p,g,Z)}var B={minMenuHeight:M,maxMenuHeight:w,menuPlacement:x,menuPosition:D,menuShouldScrollIntoView:E},re=v.createElement(Hr,V({},g,B),function(A){var U=A.ref,K=A.placerProps,Y=K.placement,G=K.maxHeight;return v.createElement(a,V({},g,B,{innerRef:U,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:O,placement:Y}),v.createElement(ho,{captureEnabled:b,onTopArrive:H,onBottomArrive:F,lockEnabled:T},function(ee){return v.createElement(l,V({},g,{innerRef:function(oe){t.getMenuListRef(oe),ee(oe)},innerProps:{role:"listbox","aria-multiselectable":g.isMulti,id:t.getElementId("listbox")},isLoading:O,maxHeight:G,focusedOption:f}),W)}))});return k||D==="fixed"?v.createElement(c,V({},g,{appendTo:k,controlElement:this.controlRef,menuPlacement:x,menuPosition:D}),re):re}},{key:"renderFormField",value:function(){var t=this,o=this.props,s=o.delimiter,u=o.isDisabled,a=o.isMulti,l=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!u)return v.createElement(So,{name:l,onFocus:this.onValueInputFocus});if(!(!l||u))if(a)if(s){var p=d.map(function(f){return t.getOptionValue(f)}).join(s);return v.createElement("input",{name:l,type:"hidden",value:p})}else{var m=d.length>0?d.map(function(f,h){return v.createElement("input",{key:"i-".concat(h),name:l,type:"hidden",value:t.getOptionValue(f)})}):v.createElement("input",{name:l,type:"hidden",value:""});return v.createElement("div",null,m)}else{var g=d[0]?this.getOptionValue(d[0]):"";return v.createElement("input",{name:l,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,o=this.state,s=o.ariaSelection,u=o.focusedOption,a=o.focusedValue,l=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return v.createElement(ro,V({},t,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:u,focusedValue:a,isFocused:l,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var t=this.getComponents(),o=t.Control,s=t.IndicatorsContainer,u=t.SelectContainer,a=t.ValueContainer,l=this.props,c=l.className,d=l.id,p=l.isDisabled,m=l.menuIsOpen,g=this.state.isFocused,f=this.commonProps=this.getCommonProps();return v.createElement(u,V({},f,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:g}),this.renderLiveRegion(),v.createElement(o,V({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:g,menuIsOpen:m}),v.createElement(a,V({},f,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),v.createElement(s,V({},f,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(t,o){var s=o.prevProps,u=o.clearFocusValueOnUpdate,a=o.inputIsHiddenAfterUpdate,l=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,p=o.instancePrefix,m=t.options,g=t.value,f=t.menuIsOpen,h=t.inputValue,b=t.isMulti,S=Me(g),O={};if(s&&(g!==s.value||m!==s.options||f!==s.menuIsOpen||h!==s.inputValue)){var y=f?ko(t,S):[],M=f?xt(Oe(t,S),"".concat(p,"-option")):[],w=u?Fo(o,S):null,L=To(o,y),x=Be(M,L);O={selectValue:S,focusedOption:L,focusedOptionId:x,focusableOptionsWithIds:M,focusedValue:w,clearFocusValueOnUpdate:!1}}var D=a!=null&&t!==s?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},k=l,T=c&&d;return c&&!T&&(k={value:ve(b,S,S[0]||null),options:S,action:"initial-input-focus"},T=!d),l?.action==="initial-input-focus"&&(k=null),C(C(C({},O),D),{},{prevProps:t,ariaSelection:k,prevWasFocused:T})}}]),r}(v.Component);me.defaultProps=Eo;var $o=v.forwardRef(function(n,e){var r=Ee(n);return v.createElement(me,V({ref:e},r))}),No=$o,_o=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],It=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,t=String(e).toLowerCase(),o=String(i.getOptionValue(r)).toLowerCase(),s=String(i.getOptionLabel(r)).toLowerCase();return o===t||s===t},Ue={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,r,i,t){return!(!e||r.some(function(o){return It(e,o,t)})||i.some(function(o){return It(e,o,t)}))},getNewOptionData:function(e,r){return{label:r,value:e,__isNew__:!0}}};function un(n){var e=n.allowCreateWhileLoading,r=e===void 0?!1:e,i=n.createOptionPosition,t=i===void 0?"last":i,o=n.formatCreateLabel,s=o===void 0?Ue.formatCreateLabel:o,u=n.isValidNewOption,a=u===void 0?Ue.isValidNewOption:u,l=n.getNewOptionData,c=l===void 0?Ue.getNewOptionData:l,d=n.onCreateOption,p=n.options,m=p===void 0?[]:p,g=n.onChange,f=J(n,_o),h=f.getOptionValue,b=h===void 0?en:h,S=f.getOptionLabel,O=S===void 0?Qt:S,y=f.inputValue,M=f.isLoading,w=f.isMulti,L=f.value,x=f.name,D=v.useMemo(function(){return a(y,Me(L),m,{getOptionValue:b,getOptionLabel:O})?c(y,s(y)):void 0},[s,c,O,b,y,a,m,L]),k=v.useMemo(function(){return(r||!M)&&D?t==="first"?[D].concat(ue(m)):[].concat(ue(m),[D]):m},[r,t,M,D,m]),T=v.useCallback(function(E,_){if(_.action!=="select-option")return g(E,_);var H=Array.isArray(E)?E:[E];if(H[H.length-1]===D){if(d)d(y);else{var F=c(y,y),R={action:"create-option",name:x,option:F};g(ve(w,[].concat(ue(Me(L)),[F]),F),R)}return}g(E,_)},[c,y,w,x,D,d,g,L]);return C(C({},f),{},{options:k,onChange:T})}var jo=v.forwardRef(function(n,e){var r=Ee(n),i=un(r);return v.createElement(me,V({ref:e},i))}),Ho=jo,zo=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function cn(n){var e=n.defaultOptions,r=e===void 0?!1:e,i=n.cacheOptions,t=i===void 0?!1:i,o=n.loadOptions;n.options;var s=n.isLoading,u=s===void 0?!1:s,a=n.onInputChange,l=n.filterOption,c=l===void 0?null:l,d=J(n,zo),p=d.inputValue,m=v.useRef(void 0),g=v.useRef(!1),f=v.useState(Array.isArray(r)?r:void 0),h=z(f,2),b=h[0],S=h[1],O=v.useState(typeof p<"u"?p:""),y=z(O,2),M=y[0],w=y[1],L=v.useState(r===!0),x=z(L,2),D=x[0],k=x[1],T=v.useState(void 0),E=z(T,2),_=E[0],H=E[1],F=v.useState([]),R=z(F,2),W=R[0],j=R[1],Z=v.useState(!1),B=z(Z,2),re=B[0],A=B[1],U=v.useState({}),K=z(U,2),Y=K[0],G=K[1],ee=v.useState(void 0),q=z(ee,2),oe=q[0],Te=q[1],he=v.useState(void 0),ce=z(he,2),Ae=ce[0],ge=ce[1];t!==Ae&&(G({}),ge(t)),r!==oe&&(S(Array.isArray(r)?r:void 0),Te(r)),v.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]);var de=v.useCallback(function(pe,ae){if(!o)return ae();var X=o(pe,ae);X&&typeof X.then=="function"&&X.then(ae,function(){return ae()})},[o]);v.useEffect(function(){r===!0&&de(M,function(pe){g.current&&(S(pe||[]),k(!!m.current))})},[]);var vn=v.useCallback(function(pe,ae){var X=Ir(pe,ae,a);if(!X){m.current=void 0,w(""),H(""),j([]),k(!1),A(!1);return}if(t&&Y[X])w(X),H(X),j(Y[X]),k(!1),A(!1);else{var hn=m.current={};w(X),k(!0),A(!_),de(X,function($e){g&&hn===m.current&&(m.current=void 0,k(!1),H(X),j($e||[]),A(!1),G($e?C(C({},Y),{},le({},X,$e)):Y))})}},[t,de,_,Y,a]),mn=re?[]:M&&_?W:b||[];return C(C({},d),{},{options:mn,isLoading:D||u,onInputChange:vn,filterOption:c})}var Bo=v.forwardRef(function(n,e){var r=cn(n),i=Ee(r);return v.createElement(me,V({ref:e},i))}),Uo=Bo,Wo=v.forwardRef(function(n,e){var r=cn(n),i=Ee(r),t=un(i);return v.createElement(me,V({ref:e},t))}),Yo=Wo,dn=n=>{const{className:e,clearValue:r,cx:i,getStyles:t,getClassNames:o,getValue:s,hasValue:u,isMulti:a,isRtl:l,options:c,selectOption:d,selectProps:p,setValue:m,theme:g,...f}=n;return{...f}},Go=n=>typeof n=="string"&&["sm","md","lg"].includes(n),Xo=n=>Go(n)?n:n==="xs"?"sm":n==="xl"?"lg":"md",Q=n=>{const e=Re(),r=Xo(e.components.Input.defaultProps.size),i=n??r;return Un(typeof i=="string"?[i]:i,{fallback:"md"})||r},Ko=n=>{const{children:e,className:r,cx:i,innerProps:t,isDisabled:o,isRtl:s,hasValue:u,selectProps:{chakraStyles:a}}=n,l={position:"relative",direction:s?"rtl":void 0,...o?{cursor:"not-allowed"}:{}},c=a?.container?a.container(l,n):l;return P.jsx(N,{...t,className:i({"--is-disabled":o,"--is-rtl":s,"--has-value":u},r),sx:c,children:e})},qo=n=>{const{children:e,className:r,cx:i,isMulti:t,hasValue:o,innerProps:s,selectProps:{chakraStyles:u,size:a,variant:l,focusBorderColor:c,errorBorderColor:d,controlShouldRenderValue:p}}=n,m=Q(a),g=ne("Input",{size:m,variant:l,focusBorderColor:c,errorBorderColor:d}),f={display:t&&o&&p?"flex":"grid",alignItems:"center",flex:1,paddingY:"2px",paddingX:g.field.px,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},h=u?.valueContainer?u.valueContainer(f,n):f;return P.jsx(N,{...s,className:i({"value-container":!0,"value-container--is-multi":t,"value-container--has-value":o},r),sx:h,children:e})},Zo=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o}}=n,s={display:"flex",alignItems:"center",alignSelf:"stretch",flexShrink:0},u=o?.indicatorsContainer?o.indicatorsContainer(s,n):s;return P.jsx(N,{...t,className:i({indicators:!0},r),sx:u,children:e})},Jo=n=>{const{className:e,cx:r,children:i,innerRef:t,innerProps:o,isDisabled:s,isFocused:u,menuIsOpen:a,selectProps:{chakraStyles:l,size:c,variant:d,focusBorderColor:p,errorBorderColor:m,isInvalid:g,isReadOnly:f}}=n,h=Q(c),{field:{height:b,h:S,...O}}=ne("Input",{size:h,variant:d,focusBorderColor:p,errorBorderColor:m}),M={...O,position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",padding:0,overflow:"hidden",height:"auto",minH:b||S,...s?{pointerEvents:"none"}:{}},w=l?.control?l.control(M,n):M;return P.jsx(N,{ref:t,className:r({control:!0,"control--is-disabled":s,"control--is-focused":u,"control--menu-is-open":a},e),sx:w,...o,"data-focus":u?!0:void 0,"data-focus-visible":u?!0:void 0,"data-invalid":g?!0:void 0,"data-disabled":s?!0:void 0,"data-readonly":f?!0:void 0,children:i})},Qo=n=>{const{className:e,cx:r,selectProps:{chakraStyles:i}}=n,t={opacity:1,display:"none"},o=i?.indicatorSeparator?i.indicatorSeparator(t,n):t;return P.jsx(Dt,{className:r({"indicator-separator":!0},e),sx:o,orientation:"vertical"})},ea=n=>P.jsx(Ke,{role:"presentation",focusable:"false","aria-hidden":"true",...n,children:P.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),ta=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o,size:s,focusBorderColor:u,errorBorderColor:a,variant:l}}=n,c=Q(s),p={...ne("Select",{size:c,variant:l,focusBorderColor:u,errorBorderColor:a}).icon,display:"inline-flex",alignItems:"center",justifyContent:"center",position:"static",marginRight:2,marginLeft:1,pointerEvents:"none"},m=o?.dropdownIndicator?o.dropdownIndicator(p,n):p,g={height:"1em",width:"1em"},f=o?.downChevron?o.downChevron(g,n):g;return P.jsx(N,{...t,className:i({indicator:!0,"dropdown-indicator":!0},r),sx:m,children:e||P.jsx(ea,{sx:f})})},na=n=>P.jsx(Ke,{focusable:"false","aria-hidden":!0,...n,children:P.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})}),ra=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o,size:s}}=n,u=Q(s),l={...Mt("CloseButton",{size:u}),marginX:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,cursor:"pointer"},c=o?.clearIndicator?o.clearIndicator(l,n):l,d={width:"1em",height:"1em"},p=o?.crossIcon?o.crossIcon(d,n):d;return P.jsx(N,{role:"button",className:i({indicator:!0,"clear-indicator":!0},r),sx:c,"aria-label":"Clear selected options",...t,children:e||P.jsx(na,{sx:p})})},ia=n=>{const{className:e,cx:r,innerProps:i,selectProps:{chakraStyles:t,size:o},color:s,emptyColor:u,speed:a,thickness:l,spinnerSize:c}=n,d=Q(o),m={sm:"xs",md:"sm",lg:"md"}[d],g={marginRight:3},f=t?.loadingIndicator?t.loadingIndicator(g,n):g;return P.jsx(In,{className:r({indicator:!0,"loading-indicator":!0},e),sx:f,...i,size:c||m,color:s,emptyColor:u,speed:a,thickness:l})},oa=n=>{const{className:e,cx:r,value:i,selectProps:{chakraStyles:t,isReadOnly:o}}=n,{innerRef:s,isDisabled:u,isHidden:a,inputClassName:l,...c}=dn(n),d={gridArea:"1 / 2",minW:"2px",border:0,margin:0,outline:0,padding:0},p={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content",color:"inherit",marginX:"0.125rem",paddingY:"0.125rem",visibility:u?"hidden":"visible",transform:i?"translateZ(0)":"",_after:{content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre",padding:0,...d}},m=t?.inputContainer?t.inputContainer(p,n):p,g={background:0,opacity:a?0:1,width:"100%",...d},f=t?.input?t.input(g,n):g;return P.jsx(N,{className:r({"input-container":!0},e),"data-value":i||"",sx:m,children:P.jsx(De.input,{className:r({input:!0},l),ref:s,sx:f,disabled:u,readOnly:o?!0:void 0,...c})})},aa=n=>n?{bottom:"top",top:"bottom"}[n]:"top",sa=n=>{const{className:e,cx:r,children:i,innerProps:t,innerRef:o,placement:s,selectProps:{chakraStyles:u}}=n,a={position:"absolute",[aa(s)]:"100%",marginY:"8px",width:"100%",zIndex:1},l=u?.menu?u.menu(a,n):a;return P.jsx(An,{children:P.jsx(N,{...t,ref:o,className:r({menu:!0},e),sx:l,children:i})})},la=n=>{var e;const{className:r,cx:i,innerRef:t,children:o,maxHeight:s,isMulti:u,innerProps:a,selectProps:{chakraStyles:l,size:c,variant:d,focusBorderColor:p,errorBorderColor:m}}=n,g=ne("Menu"),f=Q(c),b=ne("Input",{size:f,variant:d,focusBorderColor:p,errorBorderColor:m}).field,S={...g.list,minW:"100%",maxHeight:`${s}px`,overflowY:"auto","--input-border-radius":b?.["--input-border-radius"],borderRadius:b?.borderRadius||((e=g.list)==null?void 0:e.borderRadius),position:"relative",WebkitOverflowScrolling:"touch"},O=l?.menuList?l.menuList(S,n):S;return P.jsx(N,{...a,className:i({"menu-list":!0,"menu-list--is-multi":u},r),sx:O,ref:t,children:o})},ua=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o,size:s}}=n,u=Q(s),l={color:"chakra-subtle-text",textAlign:"center",paddingY:{sm:"6px",md:"8px",lg:"10px"}[u],fontSize:u},c=o?.loadingMessage?o.loadingMessage(l,n):l;return P.jsx(N,{...t,className:i({"menu-notice":!0,"menu-notice--loading":!0},r),sx:c,children:e})},ca=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o,size:s}}=n,u=Q(s),l={color:"chakra-subtle-text",textAlign:"center",paddingY:{sm:"6px",md:"8px",lg:"10px"}[u],fontSize:u},c=o?.noOptionsMessage?o.noOptionsMessage(l,n):l;return P.jsx(N,{...t,className:i({"menu-notice":!0,"menu-notice--no-options":!0},r),sx:c,children:e})},da=n=>{const{children:e,className:r,cx:i,theme:t,getStyles:o,Heading:s,headingProps:u,label:a,selectProps:l,innerProps:c,getClassNames:d}=n,{chakraStyles:p}=l,m={},g=p?.group?p.group(m,n):m;return P.jsxs(N,{...c,className:i({group:!0},r),sx:g,children:[P.jsx(s,{...u,selectProps:l,cx:i,theme:t,getStyles:o,getClassNames:d,children:a}),P.jsx(N,{children:e})]})},pa=n=>{const{cx:e,className:r,selectProps:{chakraStyles:i,size:t}}=n,{data:o,...s}=dn(n),u=ne("Menu"),a=Q(t),l={sm:"xs",md:"sm",lg:"md"},c={sm:"0.4rem 0.8rem",md:"0.5rem 1rem",lg:"0.6rem 1.2rem"},d={...u.groupTitle,fontSize:l[a],padding:c[a],margin:0},p=i?.groupHeading?i.groupHeading(d,n):d;return P.jsx(N,{...s,className:e({"group-heading":!0},r),sx:p})},fa=n=>P.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...n,children:P.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),va=n=>{const{className:e,cx:r,innerRef:i,innerProps:t,children:o,isFocused:s,isDisabled:u,isSelected:a,selectProps:{chakraStyles:l,size:c,isMulti:d,hideSelectedOptions:p,selectedOptionStyle:m,selectedOptionColorScheme:g}}=n,f=ne("Menu").item,h=Q(c),b={sm:"0.6rem",md:"0.8rem",lg:"1rem"},S={sm:"0.3rem",md:"0.4rem",lg:"0.5rem"},O=rt(`${g}.500`,`${g}.300`),y=rt("white","black"),M=m==="check"&&(!d||p===!1),w=m==="color"&&a,L={...f,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",textAlign:"start",fontSize:h,paddingX:b[h],paddingY:S[h],...w?{bg:O,color:y,_active:{bg:O}}:{}},x=l?.option?l.option(L,n):L;return P.jsxs(N,{...t,className:r({option:!0,"option--is-disabled":u,"option--is-focused":s,"option--is-selected":a},e),sx:x,ref:i,"data-focus":s?!0:void 0,"aria-disabled":u?!0:void 0,"aria-selected":a,children:[M&&P.jsx($n,{fontSize:"0.8em",marginEnd:"0.75rem",opacity:a?1:0,children:P.jsx(fa,{})}),o]})},ma=n=>typeof n=="object"&&n!==null&&"colorScheme"in n&&typeof n.colorScheme=="string",ha=n=>typeof n=="object"&&n!==null&&"variant"in n&&typeof n.variant=="string",ga=n=>{const{children:e,className:r,components:i,cx:t,data:o,innerProps:s,isDisabled:u,isFocused:a,removeProps:l,selectProps:c,cropWithEllipsis:d}=n,{Container:p,Label:m,Remove:g}=i,{chakraStyles:f,tagColorScheme:h,tagVariant:b,size:S}=c,O=Q(S);let y="",M="";ma(o)&&(y=o.colorScheme),ha(o)&&(M=o.variant);const w=ne("Tag",{size:O,colorScheme:y||h,variant:M||b}),L={...w.container,display:"flex",alignItems:"center",minWidth:0,margin:"0.125rem"},x=f?.multiValue?f.multiValue(L,n):L,D={...w.label,overflow:"hidden",textOverflow:d||d===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},k=f?.multiValueLabel?f.multiValueLabel(D,n):D,T={...w.closeButton,display:"flex",alignItems:"center",justifyContent:"center"},E=f?.multiValueRemove?f.multiValueRemove(T,n):T;return P.jsxs(p,{data:o,innerProps:{className:t({"multi-value":!0,"multi-value--is-disabled":u},r),...s},sx:x,selectProps:c,children:[P.jsx(m,{data:o,innerProps:{className:t({"multi-value__label":!0},r)},sx:k,selectProps:c,children:e}),P.jsx(g,{data:o,innerProps:{className:t({"multi-value__remove":!0},r),"aria-label":`Remove ${e||"option"}`,...l},sx:E,selectProps:c,isFocused:a})]})},ba=n=>{const{children:e,innerProps:r,sx:i}=n;return P.jsx(De.span,{...r,sx:i,children:e})},Sa=n=>{const{children:e,innerProps:r,sx:i}=n;return P.jsx(De.span,{...r,sx:i,children:e})},ya=n=>P.jsx(Ke,{verticalAlign:"inherit",viewBox:"0 0 512 512",...n,children:P.jsx("path",{fill:"currentColor",d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})}),Oa=n=>{const{children:e,innerProps:r,isFocused:i,sx:t}=n;return P.jsx(N,{...r,role:"button",sx:t,"data-focus":i?!0:void 0,"data-focus-visible":i?!0:void 0,children:e||P.jsx(ya,{})})},Ca=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o}}=n,s={gridArea:"1 / 1 / 2 / 3",color:"chakra-placeholder-color",mx:"0.125rem",userSelect:"none"},u=o?.placeholder?o.placeholder(s,n):s;return P.jsx(N,{...t,className:i({placeholder:!0},r),sx:u,children:e})},xa=n=>{const{children:e,className:r,cx:i,isDisabled:t,innerProps:o,selectProps:{chakraStyles:s}}=n,u={gridArea:"1 / 1 / 2 / 3",mx:"0.125rem",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},a=s?.singleValue?s.singleValue(u,n):u;return P.jsx(N,{className:i({"single-value":!0,"single-value--is-disabled":t},r),sx:a,...o,children:e})},Pa={ClearIndicator:ra,Control:Jo,DropdownIndicator:ta,Group:da,GroupHeading:pa,IndicatorSeparator:Qo,IndicatorsContainer:Zo,Input:oa,LoadingIndicator:ia,LoadingMessage:ua,Menu:sa,MenuList:la,MultiValue:ga,MultiValueContainer:ba,MultiValueLabel:Sa,MultiValueRemove:Oa,NoOptionsMessage:ca,Option:va,Placeholder:Ca,SelectContainer:Ko,SingleValue:xa,ValueContainer:qo},nt=Pa,Ia=({components:n={},theme:e,size:r,isDisabled:i,isInvalid:t,isReadOnly:o,required:s,isRequired:u,inputId:a,selectedOptionStyle:l="color",selectedOptionColorScheme:c="blue",variant:d,tagColorScheme:p,tagVariant:m,focusBorderColor:g,errorBorderColor:f,chakraStyles:h={},onFocus:b,onBlur:S,menuIsOpen:O,...y})=>{var M,w,L,x,D,k,T;const E=Re(),{variant:_="outline"}=(L=(w=(M=E?.components)==null?void 0:M.Input)==null?void 0:w.defaultProps)!=null?L:{},{colorScheme:H="gray",variant:F="subtle"}=(k=(D=(x=E?.components)==null?void 0:x.Tag)==null?void 0:D.defaultProps)!=null?k:{},R=Tn({id:a,isDisabled:i,isInvalid:t,isRequired:u,isReadOnly:o,onFocus:b,onBlur:S}),W=O??(R.readOnly?!1:void 0);let j=l;["color","check"].includes(l)||(j="color");let B=c;return typeof B!="string"&&(B="blue"),{components:{...nt,...n},size:r,selectedOptionStyle:j,selectedOptionColorScheme:B,variant:d??_,tagColorScheme:p??H,tagVariant:m??F,chakraStyles:h,focusBorderColor:g,errorBorderColor:f,onFocus:R.onFocus,onBlur:R.onBlur,isDisabled:R.disabled,isInvalid:!!R["aria-invalid"],inputId:R.id,isReadOnly:R.readOnly,required:s??R.required,menuIsOpen:W,...y,"aria-invalid":(T=y["aria-invalid"])!=null?T:R["aria-invalid"]}},Fe=Ia,wa=v.forwardRef((n,e)=>{const r=Fe(n);return P.jsx(No,{ref:e,...r})}),Ma=wa;v.forwardRef((n,e)=>{const r=Fe(n);return P.jsx(Ho,{ref:e,...r})});v.forwardRef((n,e)=>{const r=Fe(n);return P.jsx(Uo,{ref:e,...r})});v.forwardRef((n,e)=>{const r=Fe(n);return P.jsx(Yo,{ref:e,...r})});const Va="@open-pioneer/basemap-switcher",pn=Dn.bind(void 0,Va),wt="___NO_BASEMAP___",_a=n=>{const e=pn(),{allowSelectingEmptyBasemap:r=!1,"aria-label":i,"aria-labelledby":t}=n,{containerProps:o}=Rn("basemap-switcher",n),s=e.formatMessage({id:"emptyBasemapLabel"}),{map:u}=En(n),a=La(u),l=qe(()=>u?.layers.getActiveBaseLayer(),[u]),c=S=>{u?.layers.activateBaseLayer(S===wt?void 0:S)},{options:d,selectedLayer:p}=v.useMemo(()=>{const S=a.map(y=>({value:y.id,layer:y}));if(r||l==null){const y={value:wt,layer:void 0};S.push(y)}const O=S.find(y=>y.layer===l);return{options:S,selectedLayer:O}},[r,a,l]),m=Ea(),[g,f]=v.useState(!1),h=v.useMemo(()=>({Option:Da,SingleValue:Ra}),[]),b=Fn(S=>{!g&&S.key==="Enter"&&f(!0)});return P.jsx(N,{...o,children:u?P.jsx(Ma,{"aria-label":i,"aria-labelledby":t,className:"basemap-switcher-select",classNamePrefix:"react-select",options:d,value:p,onChange:S=>S&&c(S.value),isClearable:!1,isSearchable:!1,menuPosition:"fixed",getOptionLabel:S=>S.layer!==void 0?S.layer.title+(S.layer.loadState==="error"?" "+e.formatMessage({id:"layerNotAvailable"}):""):s,isOptionDisabled:S=>S?.layer?.loadState==="error",components:h,ariaLiveMessages:{guidance:()=>"",onChange:S=>S.action=="select-option"||S.action=="initial-input-focus"?S.label+" "+e.formatMessage({id:"selected"}):"",onFilter:()=>"",onFocus:()=>""},chakraStyles:m,onKeyDown:b,menuIsOpen:g,onMenuOpen:()=>f(!0),onMenuClose:()=>f(!1)}):null})};function La(n){return qe(()=>n?.layers.getBaseLayers()??[],[n])}function Da(n){const{layer:e}=n.data,{isAvailable:r,content:i}=fn(e);return P.jsx(nt.Option,{...n,isDisabled:!r,className:"basemap-switcher-option",children:i})}function Ra(n){const{layer:e}=n.data,{isAvailable:r,content:i}=fn(e);return P.jsx(nt.SingleValue,{...n,isDisabled:!r,className:"basemap-switcher-value",children:i})}function fn(n){const e=pn(),r=e.formatMessage({id:"layerNotAvailable"}),{label:i,isAvailable:t}=qe(()=>n?{label:n.title,isAvailable:n.loadState!=="error"}:{label:e.formatMessage({id:"emptyBasemapLabel"}),isAvailable:!0},[n,e]);return{isAvailable:t,content:P.jsxs(kn,{direction:"row",alignItems:"center",children:[i,!t&&P.jsx(N,{ml:2,children:P.jsx(wn,{label:r,placement:"right",openDelay:500,children:P.jsx("span",{children:P.jsx(Nn,{color:"red","aria-label":r})})})})]})}}function Ea(){const[n,e]=Mn("colors",["background_body","border"],["#ffffff","#ffffff"]);return v.useMemo(()=>({control:i=>({...i,cursor:"pointer"}),indicatorSeparator:i=>({...i,borderColor:e}),dropdownIndicator:i=>({...i,backgroundColor:n})}),[n,e])}export{_a as B,Dt as D,ie as _,le as a,nt as c,Ma as s,qe as u}; +`]))),vi=function(e,r){var i=e.isFocused,t=e.size,o=e.theme,s=o.colors,u=o.spacing.baseUnit;return C({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:t,lineHeight:1,marginRight:t,textAlign:"center",verticalAlign:"middle"},r?{}:{color:i?s.neutral60:s.neutral20,padding:u*2})},Ne=function(e){var r=e.delay,i=e.offset;return I("span",{css:Lt({animation:"".concat(fi," 1s ease-in-out ").concat(r,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},mi=function(e){var r=e.innerProps,i=e.isRtl,t=e.size,o=t===void 0?4:t,s=J(e,oi);return I("div",V({},$(C(C({},s),{},{innerProps:r,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),r),I(Ne,{delay:0,offset:i}),I(Ne,{delay:160,offset:!0}),I(Ne,{delay:320,offset:!i}))},hi=function(e,r){var i=e.isDisabled,t=e.isFocused,o=e.theme,s=o.colors,u=o.borderRadius,a=o.spacing;return C({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},r?{}:{backgroundColor:i?s.neutral5:s.neutral0,borderColor:i?s.neutral10:t?s.primary:s.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:t?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:t?s.primary:s.neutral30}})},gi=function(e){var r=e.children,i=e.isDisabled,t=e.isFocused,o=e.innerRef,s=e.innerProps,u=e.menuIsOpen;return I("div",V({ref:o},$(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":t,"control--menu-is-open":u}),s,{"aria-disabled":i||void 0}),r)},bi=gi,Si=["data"],yi=function(e,r){var i=e.theme.spacing;return r?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},Oi=function(e){var r=e.children,i=e.cx,t=e.getStyles,o=e.getClassNames,s=e.Heading,u=e.headingProps,a=e.innerProps,l=e.label,c=e.theme,d=e.selectProps;return I("div",V({},$(e,"group",{group:!0}),a),I(s,V({},u,{selectProps:d,theme:c,getStyles:t,getClassNames:o,cx:i}),l),I("div",null,r))},Ci=function(e,r){var i=e.theme,t=i.colors,o=i.spacing;return C({label:"group",cursor:"default",display:"block"},r?{}:{color:t.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},xi=function(e){var r=_t(e);r.data;var i=J(r,Si);return I("div",V({},$(e,"groupHeading",{"group-heading":!0}),i))},Pi=Oi,Ii=["innerRef","isDisabled","isHidden","inputClassName"],wi=function(e,r){var i=e.isDisabled,t=e.value,o=e.theme,s=o.spacing,u=o.colors;return C(C({visibility:i?"hidden":"visible",transform:t?"translateZ(0)":""},Mi),r?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:u.neutral80})},Xt={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Mi={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":C({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Xt)},Vi=function(e){return C({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Xt)},Li=function(e){var r=e.cx,i=e.value,t=_t(e),o=t.innerRef,s=t.isDisabled,u=t.isHidden,a=t.inputClassName,l=J(t,Ii);return I("div",V({},$(e,"input",{"input-container":!0}),{"data-value":i||""}),I("input",V({className:r({input:!0},a),ref:o,style:Vi(u),disabled:s},l)))},Di=Li,Ri=function(e,r){var i=e.theme,t=i.spacing,o=i.borderRadius,s=i.colors;return C({label:"multiValue",display:"flex",minWidth:0},r?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:t.baseUnit/2})},Ei=function(e,r){var i=e.theme,t=i.borderRadius,o=i.colors,s=e.cropWithEllipsis;return C({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},r?{}:{borderRadius:t/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},ki=function(e,r){var i=e.theme,t=i.spacing,o=i.borderRadius,s=i.colors,u=e.isFocused;return C({alignItems:"center",display:"flex"},r?{}:{borderRadius:o/2,backgroundColor:u?s.dangerLight:void 0,paddingLeft:t.baseUnit,paddingRight:t.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},qt=function(e){var r=e.children,i=e.innerProps;return I("div",i,r)},Fi=qt,Ti=qt;function Ai(n){var e=n.children,r=n.innerProps;return I("div",V({role:"button"},r),e||I(et,{size:14}))}var $i=function(e){var r=e.children,i=e.components,t=e.data,o=e.innerProps,s=e.isDisabled,u=e.removeProps,a=e.selectProps,l=i.Container,c=i.Label,d=i.Remove;return I(l,{data:t,innerProps:C(C({},$(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:a},I(c,{data:t,innerProps:C({},$(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},r),I(d,{data:t,innerProps:C(C({},$(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(r||"option")},u),selectProps:a}))},Ni=$i,_i=function(e,r){var i=e.isDisabled,t=e.isFocused,o=e.isSelected,s=e.theme,u=s.spacing,a=s.colors;return C({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},r?{}:{backgroundColor:o?a.primary:t?a.primary25:"transparent",color:i?a.neutral20:o?a.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?a.primary:a.primary50}})},ji=function(e){var r=e.children,i=e.isDisabled,t=e.isFocused,o=e.isSelected,s=e.innerRef,u=e.innerProps;return I("div",V({},$(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":t,"option--is-selected":o}),{ref:s,"aria-disabled":i},u),r)},Hi=ji,zi=function(e,r){var i=e.theme,t=i.spacing,o=i.colors;return C({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},r?{}:{color:o.neutral50,marginLeft:t.baseUnit/2,marginRight:t.baseUnit/2})},Bi=function(e){var r=e.children,i=e.innerProps;return I("div",V({},$(e,"placeholder",{placeholder:!0}),i),r)},Ui=Bi,Wi=function(e,r){var i=e.isDisabled,t=e.theme,o=t.spacing,s=t.colors;return C({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r?{}:{color:i?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Yi=function(e){var r=e.children,i=e.isDisabled,t=e.innerProps;return I("div",V({},$(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),t),r)},Gi=Yi,Xi={ClearIndicator:ci,Control:bi,DropdownIndicator:li,DownChevron:Yt,CrossIcon:et,Group:Pi,GroupHeading:xi,IndicatorsContainer:ri,IndicatorSeparator:pi,Input:Di,LoadingIndicator:mi,Menu:Br,MenuList:Wr,MenuPortal:Zr,LoadingMessage:qr,NoOptionsMessage:Xr,MultiValue:Ni,MultiValueContainer:Fi,MultiValueLabel:Ti,MultiValueRemove:Ai,Option:Hi,Placeholder:Ui,SelectContainer:Qr,SingleValue:Gi,ValueContainer:ti},qi=function(e){return C(C({},Xi),e.components)},pt=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ki(n,e){return!!(n===e||pt(n)&&pt(e))}function Zi(n,e){if(n.length!==e.length)return!1;for(var r=0;r1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(t," is disabled. Select another option."):"option ".concat(t,", selected.");default:return""}},onFocus:function(e){var r=e.context,i=e.focused,t=e.options,o=e.label,s=o===void 0?"":o,u=e.selectValue,a=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,d=function(f,h){return f&&f.length?"".concat(f.indexOf(h)+1," of ").concat(f.length):""};if(r==="value"&&u)return"value ".concat(s," focused, ").concat(d(u,i),".");if(r==="menu"&&c){var p=a?" disabled":"",m="".concat(l?" selected":"").concat(p);return"".concat(s).concat(m,", ").concat(d(t,i),".")}return""},onFilter:function(e){var r=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(r?" for search term "+r:"",".")}},no=function(e){var r=e.ariaSelection,i=e.focusedOption,t=e.focusedValue,o=e.focusableOptions,s=e.isFocused,u=e.selectValue,a=e.selectProps,l=e.id,c=e.isAppleDevice,d=a.ariaLiveMessages,p=a.getOptionLabel,m=a.inputValue,g=a.isMulti,f=a.isOptionDisabled,h=a.isSearchable,b=a.menuIsOpen,S=a.options,O=a.screenReaderStatus,y=a.tabSelectsValue,M=a.isLoading,w=a["aria-label"],L=a["aria-live"],x=v.useMemo(function(){return C(C({},to),d||{})},[d]),D=v.useMemo(function(){var F="";if(r&&x.onChange){var R=r.option,W=r.options,j=r.removedValue,Z=r.removedValues,B=r.value,re=function(K){return Array.isArray(K)?null:K},A=j||R||re(B),U=A?p(A):"",q=W||Z||void 0,Y=q?q.map(p):[],G=C({isDisabled:A&&f(A,u),label:U,labels:Y},r);F=x.onChange(G)}return F},[r,x,f,u,p]),k=v.useMemo(function(){var F="",R=i||t,W=!!(i&&u&&u.includes(i));if(R&&x.onFocus){var j={focused:R,label:p(R),isDisabled:f(R,u),isSelected:W,options:o,context:R===i?"menu":"value",selectValue:u,isAppleDevice:c};F=x.onFocus(j)}return F},[i,t,p,f,x,o,u,c]),T=v.useMemo(function(){var F="";if(b&&S.length&&!M&&x.onFilter){var R=O({count:o.length});F=x.onFilter({inputValue:m,resultsMessage:R})}return F},[o,m,b,x,S,O,M]),E=r?.action==="initial-input-focus",_=v.useMemo(function(){var F="";if(x.guidance){var R=t?"value":b?"menu":"input";F=x.guidance({"aria-label":w,context:R,isDisabled:i&&f(i,u),isMulti:g,isSearchable:h,tabSelectsValue:y,isInitialFocus:E})}return F},[w,i,t,g,f,h,b,x,u,y,E]),H=I(v.Fragment,null,I("span",{id:"aria-selection"},D),I("span",{id:"aria-focused"},k),I("span",{id:"aria-results"},T),I("span",{id:"aria-guidance"},_));return I(v.Fragment,null,I(ft,{id:l},E&&H),I(ft,{"aria-live":L,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!E&&H))},ro=no,Xe=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],io=new RegExp("["+Xe.map(function(n){return n.letters}).join("")+"]","g"),Kt={};for(var _e=0;_e-1}},lo=["innerRef"];function uo(n){var e=n.innerRef,r=J(n,lo),i=Tr(r,"onExited","in","enter","exit","appear");return I("input",V({ref:e},i,{css:Lt({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var co=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function po(n){var e=n.isEnabled,r=n.onBottomArrive,i=n.onBottomLeave,t=n.onTopArrive,o=n.onTopLeave,s=v.useRef(!1),u=v.useRef(!1),a=v.useRef(0),l=v.useRef(null),c=v.useCallback(function(h,b){if(l.current!==null){var S=l.current,O=S.scrollTop,y=S.scrollHeight,M=S.clientHeight,w=l.current,L=b>0,x=y-M-O,D=!1;x>b&&s.current&&(i&&i(h),s.current=!1),L&&u.current&&(o&&o(h),u.current=!1),L&&b>x?(r&&!s.current&&r(h),w.scrollTop=y,D=!0,s.current=!0):!L&&-b>O&&(t&&!u.current&&t(h),w.scrollTop=0,D=!0,u.current=!0),D&&co(h)}},[r,i,t,o]),d=v.useCallback(function(h){c(h,h.deltaY)},[c]),p=v.useCallback(function(h){a.current=h.changedTouches[0].clientY},[]),m=v.useCallback(function(h){var b=a.current-h.changedTouches[0].clientY;c(h,b)},[c]),g=v.useCallback(function(h){if(h){var b=Er?{passive:!1}:!1;h.addEventListener("wheel",d,b),h.addEventListener("touchstart",p,b),h.addEventListener("touchmove",m,b)}},[m,p,d]),f=v.useCallback(function(h){h&&(h.removeEventListener("wheel",d,!1),h.removeEventListener("touchstart",p,!1),h.removeEventListener("touchmove",m,!1))},[m,p,d]);return v.useEffect(function(){if(e){var h=l.current;return g(h),function(){f(h)}}},[e,g,f]),function(h){l.current=h}}var mt=["boxSizing","height","overflow","paddingRight","position"],ht={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function gt(n){n.preventDefault()}function bt(n){n.stopPropagation()}function St(){var n=this.scrollTop,e=this.scrollHeight,r=n+this.offsetHeight;n===0?this.scrollTop=1:r===e&&(this.scrollTop=n-1)}function yt(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ot=!!(typeof window<"u"&&window.document&&window.document.createElement),fe=0,se={capture:!1,passive:!1};function fo(n){var e=n.isEnabled,r=n.accountForScrollbars,i=r===void 0?!0:r,t=v.useRef({}),o=v.useRef(null),s=v.useCallback(function(a){if(Ot){var l=document.body,c=l&&l.style;if(i&&mt.forEach(function(g){var f=c&&c[g];t.current[g]=f}),i&&fe<1){var d=parseInt(t.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,m=window.innerWidth-p+d||0;Object.keys(ht).forEach(function(g){var f=ht[g];c&&(c[g]=f)}),c&&(c.paddingRight="".concat(m,"px"))}l&&yt()&&(l.addEventListener("touchmove",gt,se),a&&(a.addEventListener("touchstart",St,se),a.addEventListener("touchmove",bt,se))),fe+=1}},[i]),u=v.useCallback(function(a){if(Ot){var l=document.body,c=l&&l.style;fe=Math.max(fe-1,0),i&&fe<1&&mt.forEach(function(d){var p=t.current[d];c&&(c[d]=p)}),l&&yt()&&(l.removeEventListener("touchmove",gt,se),a&&(a.removeEventListener("touchstart",St,se),a.removeEventListener("touchmove",bt,se)))}},[i]);return v.useEffect(function(){if(e){var a=o.current;return s(a),function(){u(a)}}},[e,s,u]),function(a){o.current=a}}var vo=function(e){var r=e.target;return r.ownerDocument.activeElement&&r.ownerDocument.activeElement.blur()},mo={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ho(n){var e=n.children,r=n.lockEnabled,i=n.captureEnabled,t=i===void 0?!0:i,o=n.onBottomArrive,s=n.onBottomLeave,u=n.onTopArrive,a=n.onTopLeave,l=po({isEnabled:t,onBottomArrive:o,onBottomLeave:s,onTopArrive:u,onTopLeave:a}),c=fo({isEnabled:r}),d=function(m){l(m),c(m)};return I(v.Fragment,null,r&&I("div",{onClick:vo,css:mo}),e(d))}var go={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},bo=function(e){var r=e.name,i=e.onFocus;return I("input",{required:!0,name:r,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:go,value:"",onChange:function(){}})},So=bo;function tt(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function yo(){return tt(/^iPhone/i)}function Jt(){return tt(/^Mac/i)}function Oo(){return tt(/^iPad/i)||Jt()&&navigator.maxTouchPoints>1}function Co(){return yo()||Oo()}function xo(){return Jt()||Co()}var Po=function(e){return e.label},Qt=function(e){return e.label},en=function(e){return e.value},Io=function(e){return!!e.isDisabled},wo={clearIndicator:ui,container:Jr,control:hi,dropdownIndicator:si,group:yi,groupHeading:Ci,indicatorsContainer:ni,indicatorSeparator:di,input:wi,loadingIndicator:vi,loadingMessage:Gr,menu:jr,menuList:Ur,menuPortal:Kr,multiValue:Ri,multiValueLabel:Ei,multiValueRemove:ki,noOptionsMessage:Yr,option:_i,placeholder:zi,singleValue:Wi,valueContainer:ei},Mo={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Vo=4,tn=4,Lo=38,Do=tn*2,Ro={baseUnit:tn,controlHeight:Lo,menuGutter:Do},ze={borderRadius:Vo,colors:Mo,spacing:Ro},Eo={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ct(),captureMenuScroll:!ct(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:so(),formatGroupLabel:Po,getOptionLabel:Qt,getOptionValue:en,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Io,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Dr(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var r=e.count;return"".concat(r," result").concat(r!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Ct(n,e,r,i){var t=on(n,e,r),o=an(n,e,r),s=rn(n,e),u=Le(n,e);return{type:"option",data:e,isDisabled:t,isSelected:o,label:s,value:u,index:i}}function Oe(n,e){return n.options.map(function(r,i){if("options"in r){var t=r.options.map(function(s,u){return Ct(n,s,e,u)}).filter(function(s){return Pt(n,s)});return t.length>0?{type:"group",data:r,options:t,index:i}:void 0}var o=Ct(n,r,e,i);return Pt(n,o)?o:void 0}).filter(kr)}function nn(n){return n.reduce(function(e,r){return r.type==="group"?e.push.apply(e,ue(r.options.map(function(i){return i.data}))):e.push(r.data),e},[])}function xt(n,e){return n.reduce(function(r,i){return i.type==="group"?r.push.apply(r,ue(i.options.map(function(t){return{data:t.data,id:"".concat(e,"-").concat(i.index,"-").concat(t.index)}}))):r.push({data:i.data,id:"".concat(e,"-").concat(i.index)}),r},[])}function ko(n,e){return nn(Oe(n,e))}function Pt(n,e){var r=n.inputValue,i=r===void 0?"":r,t=e.data,o=e.isSelected,s=e.label,u=e.value;return(!ln(n)||!o)&&sn(n,{label:s,value:u,data:t},i)}function Fo(n,e){var r=n.focusedValue,i=n.selectValue,t=i.indexOf(r);if(t>-1){var o=e.indexOf(r);if(o>-1)return r;if(t-1?r:e[0]}var Be=function(e,r){var i,t=(i=e.find(function(o){return o.data===r}))===null||i===void 0?void 0:i.id;return t||null},rn=function(e,r){return e.getOptionLabel(r)},Le=function(e,r){return e.getOptionValue(r)};function on(n,e,r){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,r):!1}function an(n,e,r){if(r.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,r);var i=Le(n,e);return r.some(function(t){return Le(n,t)===i})}function sn(n,e,r){return n.filterOption?n.filterOption(e,r):!0}var ln=function(e){var r=e.hideSelectedOptions,i=e.isMulti;return r===void 0?i:r},Ao=1,me=function(n){tr(r,n);var e=ir(r);function r(i){var t;if(Qn(this,r),t=e.call(this,i),t.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.isAppleDevice=xo(),t.controlRef=null,t.getControlRef=function(a){t.controlRef=a},t.focusedOptionRef=null,t.getFocusedOptionRef=function(a){t.focusedOptionRef=a},t.menuListRef=null,t.getMenuListRef=function(a){t.menuListRef=a},t.inputRef=null,t.getInputRef=function(a){t.inputRef=a},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(a,l){var c=t.props,d=c.onChange,p=c.name;l.name=p,t.ariaOnChange(a,l),d(a,l)},t.setValue=function(a,l,c){var d=t.props,p=d.closeMenuOnSelect,m=d.isMulti,g=d.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:g}),p&&(t.setState({inputIsHiddenAfterUpdate:!m}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(a,{action:l,option:c})},t.selectOption=function(a){var l=t.props,c=l.blurInputOnSelect,d=l.isMulti,p=l.name,m=t.state.selectValue,g=d&&t.isOptionSelected(a,m),f=t.isOptionDisabled(a,m);if(g){var h=t.getOptionValue(a);t.setValue(m.filter(function(b){return t.getOptionValue(b)!==h}),"deselect-option",a)}else if(!f)d?t.setValue([].concat(ue(m),[a]),"select-option",a):t.setValue(a,"select-option");else{t.ariaOnChange(a,{action:"select-option",option:a,name:p});return}c&&t.blurInput()},t.removeValue=function(a){var l=t.props.isMulti,c=t.state.selectValue,d=t.getOptionValue(a),p=c.filter(function(g){return t.getOptionValue(g)!==d}),m=ve(l,p,p[0]||null);t.onChange(m,{action:"remove-value",removedValue:a}),t.focusInput()},t.clearValue=function(){var a=t.state.selectValue;t.onChange(ve(t.props.isMulti,[],null),{action:"clear",removedValues:a})},t.popValue=function(){var a=t.props.isMulti,l=t.state.selectValue,c=l[l.length-1],d=l.slice(0,l.length-1),p=ve(a,d,d[0]||null);t.onChange(p,{action:"pop-value",removedValue:c})},t.getFocusedOptionId=function(a){return Be(t.state.focusableOptionsWithIds,a)},t.getFocusableOptionsWithIds=function(){return xt(Oe(t.props,t.state.selectValue),t.getElementId("option"))},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var a=arguments.length,l=new Array(a),c=0;cm||p>m}},t.onTouchEnd=function(a){t.userIsDragging||(t.controlRef&&!a.composedPath().includes(t.controlRef)&&t.menuListRef&&!a.composedPath().includes(t.menuListRef)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(a){t.userIsDragging||t.onControlMouseDown(a)},t.onClearIndicatorTouchEnd=function(a){t.userIsDragging||t.onClearIndicatorMouseDown(a)},t.onDropdownIndicatorTouchEnd=function(a){t.userIsDragging||t.onDropdownIndicatorMouseDown(a)},t.handleInputChange=function(a){var l=t.props.inputValue,c=a.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(c,{action:"input-change",prevInputValue:l}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(a){t.props.onFocus&&t.props.onFocus(a),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(a){var l=t.props.inputValue;if(t.menuListRef&&t.menuListRef.contains(document.activeElement)){t.inputRef.focus();return}t.props.onBlur&&t.props.onBlur(a),t.onInputChange("",{action:"input-blur",prevInputValue:l}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1})},t.onOptionHover=function(a){if(!(t.blockOptionHover||t.state.focusedOption===a)){var l=t.getFocusableOptions(),c=l.indexOf(a);t.setState({focusedOption:a,focusedOptionId:c>-1?t.getFocusedOptionId(a):null})}},t.shouldHideSelectedOptions=function(){return ln(t.props)},t.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),t.focus()},t.onKeyDown=function(a){var l=t.props,c=l.isMulti,d=l.backspaceRemovesValue,p=l.escapeClearsValue,m=l.inputValue,g=l.isClearable,f=l.isDisabled,h=l.menuIsOpen,b=l.onKeyDown,S=l.tabSelectsValue,O=l.openMenuOnFocus,y=t.state,M=y.focusedOption,w=y.focusedValue,L=y.selectValue;if(!f&&!(typeof b=="function"&&(b(a),a.defaultPrevented))){switch(t.blockOptionHover=!0,a.key){case"ArrowLeft":if(!c||m)return;t.focusValue("previous");break;case"ArrowRight":if(!c||m)return;t.focusValue("next");break;case"Delete":case"Backspace":if(m)return;if(w)t.removeValue(w);else{if(!d)return;c?t.popValue():g&&t.clearValue()}break;case"Tab":if(t.isComposing||a.shiftKey||!h||!S||!M||O&&t.isOptionSelected(M,L))return;t.selectOption(M);break;case"Enter":if(a.keyCode===229)break;if(h){if(!M||t.isComposing)return;t.selectOption(M);break}return;case"Escape":h?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:m}),t.onMenuClose()):g&&p&&t.clearValue();break;case" ":if(m)return;if(!h){t.openMenu("first");break}if(!M)return;t.selectOption(M);break;case"ArrowUp":h?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":h?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!h)return;t.focusOption("pageup");break;case"PageDown":if(!h)return;t.focusOption("pagedown");break;case"Home":if(!h)return;t.focusOption("first");break;case"End":if(!h)return;t.focusOption("last");break;default:return}a.preventDefault()}},t.state.instancePrefix="react-select-"+(t.props.instanceId||++Ao),t.state.selectValue=Me(i.value),i.menuIsOpen&&t.state.selectValue.length){var o=t.getFocusableOptionsWithIds(),s=t.buildFocusableOptions(),u=s.indexOf(t.state.selectValue[0]);t.state.focusableOptionsWithIds=o,t.state.focusedOption=s[u],t.state.focusedOptionId=Be(o,s[u])}return t}return er(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&ut(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(t){var o=this.props,s=o.isDisabled,u=o.menuIsOpen,a=this.state.isFocused;(a&&!s&&t.isDisabled||a&&u&&!t.menuIsOpen)&&this.focusInput(),a&&s&&!t.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!s&&t.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ut(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(t,o){this.props.onInputChange(t,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(t){var o=this,s=this.state,u=s.selectValue,a=s.isFocused,l=this.buildFocusableOptions(),c=t==="first"?0:l.length-1;if(!this.props.isMulti){var d=l.indexOf(u[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[c],focusedOptionId:this.getFocusedOptionId(l[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(t){var o=this.state,s=o.selectValue,u=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=s.indexOf(u);u||(a=-1);var l=s.length-1,c=-1;if(s.length){switch(t){case"previous":a===0?c=0:a===-1?c=l:c=a-1;break;case"next":a>-1&&a0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var a=0,l=u.indexOf(s);s||(l=-1),t==="up"?a=l>0?l-1:u.length-1:t==="down"?a=(l+1)%u.length:t==="pageup"?(a=l-o,a<0&&(a=0)):t==="pagedown"?(a=l+o,a>u.length-1&&(a=u.length-1)):t==="last"&&(a=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(ze):C(C({},ze),this.props.theme):ze}},{key:"getCommonProps",value:function(){var t=this.clearValue,o=this.cx,s=this.getStyles,u=this.getClassNames,a=this.getValue,l=this.selectOption,c=this.setValue,d=this.props,p=d.isMulti,m=d.isRtl,g=d.options,f=this.hasValue();return{clearValue:t,cx:o,getStyles:s,getClassNames:u,getValue:a,hasValue:f,isMulti:p,isRtl:m,options:g,selectOption:l,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var t=this.state.selectValue;return t.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var t=this.props,o=t.isClearable,s=t.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(t,o){return on(this.props,t,o)}},{key:"isOptionSelected",value:function(t,o){return an(this.props,t,o)}},{key:"filterOption",value:function(t,o){return sn(this.props,t,o)}},{key:"formatOptionLabel",value:function(t,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(t,{context:o,inputValue:s,selectValue:u})}else return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,o=t.isDisabled,s=t.isSearchable,u=t.inputId,a=t.inputValue,l=t.tabIndex,c=t.form,d=t.menuIsOpen,p=t.required,m=this.getComponents(),g=m.Input,f=this.state,h=f.inputIsHidden,b=f.ariaSelection,S=this.commonProps,O=u||this.getElementId("input"),y=C(C(C({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||void 0},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?v.createElement(g,V({},S,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:O,innerRef:this.getInputRef,isDisabled:o,isHidden:h,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:c,type:"text",value:a},y)):v.createElement(uo,V({id:O,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:we,onFocus:this.onInputFocus,disabled:o,tabIndex:l,inputMode:"none",form:c,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,o=this.getComponents(),s=o.MultiValue,u=o.MultiValueContainer,a=o.MultiValueLabel,l=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,p=this.commonProps,m=this.props,g=m.controlShouldRenderValue,f=m.isDisabled,h=m.isMulti,b=m.inputValue,S=m.placeholder,O=this.state,y=O.selectValue,M=O.focusedValue,w=O.isFocused;if(!this.hasValue()||!g)return b?null:v.createElement(d,V({},p,{key:"placeholder",isDisabled:f,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),S);if(h)return y.map(function(x,D){var k=x===M,T="".concat(t.getOptionLabel(x),"-").concat(t.getOptionValue(x));return v.createElement(s,V({},p,{components:{Container:u,Label:a,Remove:l},isFocused:k,isDisabled:f,key:T,index:D,removeProps:{onClick:function(){return t.removeValue(x)},onTouchEnd:function(){return t.removeValue(x)},onMouseDown:function(_){_.preventDefault()}},data:x}),t.formatOptionLabel(x,"value"))});if(b)return null;var L=y[0];return v.createElement(c,V({},p,{data:L,isDisabled:f}),this.formatOptionLabel(L,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents(),o=t.ClearIndicator,s=this.commonProps,u=this.props,a=u.isDisabled,l=u.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||a||!this.hasValue()||l)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return v.createElement(o,V({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents(),o=t.LoadingIndicator,s=this.commonProps,u=this.props,a=u.isDisabled,l=u.isLoading,c=this.state.isFocused;if(!o||!l)return null;var d={"aria-hidden":"true"};return v.createElement(o,V({},s,{innerProps:d,isDisabled:a,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),o=t.DropdownIndicator,s=t.IndicatorSeparator;if(!o||!s)return null;var u=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused;return v.createElement(s,V({},u,{isDisabled:a,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents(),o=t.DropdownIndicator;if(!o)return null;var s=this.commonProps,u=this.props.isDisabled,a=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return v.createElement(o,V({},s,{innerProps:l,isDisabled:u,isFocused:a}))}},{key:"renderMenu",value:function(){var t=this,o=this.getComponents(),s=o.Group,u=o.GroupHeading,a=o.Menu,l=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,p=o.NoOptionsMessage,m=o.Option,g=this.commonProps,f=this.state.focusedOption,h=this.props,b=h.captureMenuScroll,S=h.inputValue,O=h.isLoading,y=h.loadingMessage,M=h.minMenuHeight,w=h.maxMenuHeight,L=h.menuIsOpen,x=h.menuPlacement,D=h.menuPosition,k=h.menuPortalTarget,T=h.menuShouldBlockScroll,E=h.menuShouldScrollIntoView,_=h.noOptionsMessage,H=h.onMenuScrollToTop,F=h.onMenuScrollToBottom;if(!L)return null;var R=function(U,q){var Y=U.type,G=U.data,ee=U.isDisabled,K=U.isSelected,oe=U.label,Te=U.value,he=f===G,ce=ee?void 0:function(){return t.onOptionHover(G)},Ae=ee?void 0:function(){return t.selectOption(G)},ge="".concat(t.getElementId("option"),"-").concat(q),de={id:ge,onClick:Ae,onMouseMove:ce,onMouseOver:ce,tabIndex:-1,role:"option","aria-selected":t.isAppleDevice?void 0:K};return v.createElement(m,V({},g,{innerProps:de,data:G,isDisabled:ee,isSelected:K,key:ge,label:oe,type:Y,value:Te,isFocused:he,innerRef:he?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(U.data,"menu"))},W;if(this.hasOptions())W=this.getCategorizedOptions().map(function(A){if(A.type==="group"){var U=A.data,q=A.options,Y=A.index,G="".concat(t.getElementId("group"),"-").concat(Y),ee="".concat(G,"-heading");return v.createElement(s,V({},g,{key:G,data:U,options:q,Heading:u,headingProps:{id:ee,data:A.data},label:t.formatGroupLabel(A.data)}),A.options.map(function(K){return R(K,"".concat(Y,"-").concat(K.index))}))}else if(A.type==="option")return R(A,"".concat(A.index))});else if(O){var j=y({inputValue:S});if(j===null)return null;W=v.createElement(d,g,j)}else{var Z=_({inputValue:S});if(Z===null)return null;W=v.createElement(p,g,Z)}var B={minMenuHeight:M,maxMenuHeight:w,menuPlacement:x,menuPosition:D,menuShouldScrollIntoView:E},re=v.createElement(Hr,V({},g,B),function(A){var U=A.ref,q=A.placerProps,Y=q.placement,G=q.maxHeight;return v.createElement(a,V({},g,B,{innerRef:U,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:O,placement:Y}),v.createElement(ho,{captureEnabled:b,onTopArrive:H,onBottomArrive:F,lockEnabled:T},function(ee){return v.createElement(l,V({},g,{innerRef:function(oe){t.getMenuListRef(oe),ee(oe)},innerProps:{role:"listbox","aria-multiselectable":g.isMulti,id:t.getElementId("listbox")},isLoading:O,maxHeight:G,focusedOption:f}),W)}))});return k||D==="fixed"?v.createElement(c,V({},g,{appendTo:k,controlElement:this.controlRef,menuPlacement:x,menuPosition:D}),re):re}},{key:"renderFormField",value:function(){var t=this,o=this.props,s=o.delimiter,u=o.isDisabled,a=o.isMulti,l=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!u)return v.createElement(So,{name:l,onFocus:this.onValueInputFocus});if(!(!l||u))if(a)if(s){var p=d.map(function(f){return t.getOptionValue(f)}).join(s);return v.createElement("input",{name:l,type:"hidden",value:p})}else{var m=d.length>0?d.map(function(f,h){return v.createElement("input",{key:"i-".concat(h),name:l,type:"hidden",value:t.getOptionValue(f)})}):v.createElement("input",{name:l,type:"hidden",value:""});return v.createElement("div",null,m)}else{var g=d[0]?this.getOptionValue(d[0]):"";return v.createElement("input",{name:l,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,o=this.state,s=o.ariaSelection,u=o.focusedOption,a=o.focusedValue,l=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return v.createElement(ro,V({},t,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:u,focusedValue:a,isFocused:l,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var t=this.getComponents(),o=t.Control,s=t.IndicatorsContainer,u=t.SelectContainer,a=t.ValueContainer,l=this.props,c=l.className,d=l.id,p=l.isDisabled,m=l.menuIsOpen,g=this.state.isFocused,f=this.commonProps=this.getCommonProps();return v.createElement(u,V({},f,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:g}),this.renderLiveRegion(),v.createElement(o,V({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:g,menuIsOpen:m}),v.createElement(a,V({},f,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),v.createElement(s,V({},f,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(t,o){var s=o.prevProps,u=o.clearFocusValueOnUpdate,a=o.inputIsHiddenAfterUpdate,l=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,p=o.instancePrefix,m=t.options,g=t.value,f=t.menuIsOpen,h=t.inputValue,b=t.isMulti,S=Me(g),O={};if(s&&(g!==s.value||m!==s.options||f!==s.menuIsOpen||h!==s.inputValue)){var y=f?ko(t,S):[],M=f?xt(Oe(t,S),"".concat(p,"-option")):[],w=u?Fo(o,S):null,L=To(o,y),x=Be(M,L);O={selectValue:S,focusedOption:L,focusedOptionId:x,focusableOptionsWithIds:M,focusedValue:w,clearFocusValueOnUpdate:!1}}var D=a!=null&&t!==s?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},k=l,T=c&&d;return c&&!T&&(k={value:ve(b,S,S[0]||null),options:S,action:"initial-input-focus"},T=!d),l?.action==="initial-input-focus"&&(k=null),C(C(C({},O),D),{},{prevProps:t,ariaSelection:k,prevWasFocused:T})}}]),r}(v.Component);me.defaultProps=Eo;var $o=v.forwardRef(function(n,e){var r=Ee(n);return v.createElement(me,V({ref:e},r))}),No=$o,_o=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],It=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,t=String(e).toLowerCase(),o=String(i.getOptionValue(r)).toLowerCase(),s=String(i.getOptionLabel(r)).toLowerCase();return o===t||s===t},Ue={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,r,i,t){return!(!e||r.some(function(o){return It(e,o,t)})||i.some(function(o){return It(e,o,t)}))},getNewOptionData:function(e,r){return{label:r,value:e,__isNew__:!0}}};function un(n){var e=n.allowCreateWhileLoading,r=e===void 0?!1:e,i=n.createOptionPosition,t=i===void 0?"last":i,o=n.formatCreateLabel,s=o===void 0?Ue.formatCreateLabel:o,u=n.isValidNewOption,a=u===void 0?Ue.isValidNewOption:u,l=n.getNewOptionData,c=l===void 0?Ue.getNewOptionData:l,d=n.onCreateOption,p=n.options,m=p===void 0?[]:p,g=n.onChange,f=J(n,_o),h=f.getOptionValue,b=h===void 0?en:h,S=f.getOptionLabel,O=S===void 0?Qt:S,y=f.inputValue,M=f.isLoading,w=f.isMulti,L=f.value,x=f.name,D=v.useMemo(function(){return a(y,Me(L),m,{getOptionValue:b,getOptionLabel:O})?c(y,s(y)):void 0},[s,c,O,b,y,a,m,L]),k=v.useMemo(function(){return(r||!M)&&D?t==="first"?[D].concat(ue(m)):[].concat(ue(m),[D]):m},[r,t,M,D,m]),T=v.useCallback(function(E,_){if(_.action!=="select-option")return g(E,_);var H=Array.isArray(E)?E:[E];if(H[H.length-1]===D){if(d)d(y);else{var F=c(y,y),R={action:"create-option",name:x,option:F};g(ve(w,[].concat(ue(Me(L)),[F]),F),R)}return}g(E,_)},[c,y,w,x,D,d,g,L]);return C(C({},f),{},{options:k,onChange:T})}var jo=v.forwardRef(function(n,e){var r=Ee(n),i=un(r);return v.createElement(me,V({ref:e},i))}),Ho=jo,zo=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function cn(n){var e=n.defaultOptions,r=e===void 0?!1:e,i=n.cacheOptions,t=i===void 0?!1:i,o=n.loadOptions;n.options;var s=n.isLoading,u=s===void 0?!1:s,a=n.onInputChange,l=n.filterOption,c=l===void 0?null:l,d=J(n,zo),p=d.inputValue,m=v.useRef(void 0),g=v.useRef(!1),f=v.useState(Array.isArray(r)?r:void 0),h=z(f,2),b=h[0],S=h[1],O=v.useState(typeof p<"u"?p:""),y=z(O,2),M=y[0],w=y[1],L=v.useState(r===!0),x=z(L,2),D=x[0],k=x[1],T=v.useState(void 0),E=z(T,2),_=E[0],H=E[1],F=v.useState([]),R=z(F,2),W=R[0],j=R[1],Z=v.useState(!1),B=z(Z,2),re=B[0],A=B[1],U=v.useState({}),q=z(U,2),Y=q[0],G=q[1],ee=v.useState(void 0),K=z(ee,2),oe=K[0],Te=K[1],he=v.useState(void 0),ce=z(he,2),Ae=ce[0],ge=ce[1];t!==Ae&&(G({}),ge(t)),r!==oe&&(S(Array.isArray(r)?r:void 0),Te(r)),v.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]);var de=v.useCallback(function(pe,ae){if(!o)return ae();var X=o(pe,ae);X&&typeof X.then=="function"&&X.then(ae,function(){return ae()})},[o]);v.useEffect(function(){r===!0&&de(M,function(pe){g.current&&(S(pe||[]),k(!!m.current))})},[]);var vn=v.useCallback(function(pe,ae){var X=Ir(pe,ae,a);if(!X){m.current=void 0,w(""),H(""),j([]),k(!1),A(!1);return}if(t&&Y[X])w(X),H(X),j(Y[X]),k(!1),A(!1);else{var hn=m.current={};w(X),k(!0),A(!_),de(X,function($e){g&&hn===m.current&&(m.current=void 0,k(!1),H(X),j($e||[]),A(!1),G($e?C(C({},Y),{},le({},X,$e)):Y))})}},[t,de,_,Y,a]),mn=re?[]:M&&_?W:b||[];return C(C({},d),{},{options:mn,isLoading:D||u,onInputChange:vn,filterOption:c})}var Bo=v.forwardRef(function(n,e){var r=cn(n),i=Ee(r);return v.createElement(me,V({ref:e},i))}),Uo=Bo,Wo=v.forwardRef(function(n,e){var r=cn(n),i=Ee(r),t=un(i);return v.createElement(me,V({ref:e},t))}),Yo=Wo,dn=n=>{const{className:e,clearValue:r,cx:i,getStyles:t,getClassNames:o,getValue:s,hasValue:u,isMulti:a,isRtl:l,options:c,selectOption:d,selectProps:p,setValue:m,theme:g,...f}=n;return{...f}},Go=n=>typeof n=="string"&&["sm","md","lg"].includes(n),Xo=n=>Go(n)?n:n==="xs"?"sm":n==="xl"?"lg":"md",Q=n=>{const e=Re(),r=Xo(e.components.Input.defaultProps.size),i=n??r;return Un(typeof i=="string"?[i]:i,{fallback:"md"})||r},qo=n=>{const{children:e,className:r,cx:i,innerProps:t,isDisabled:o,isRtl:s,hasValue:u,selectProps:{chakraStyles:a}}=n,l={position:"relative",direction:s?"rtl":void 0,...o?{cursor:"not-allowed"}:{}},c=a?.container?a.container(l,n):l;return P.jsx(N,{...t,className:i({"--is-disabled":o,"--is-rtl":s,"--has-value":u},r),sx:c,children:e})},Ko=n=>{const{children:e,className:r,cx:i,isMulti:t,hasValue:o,innerProps:s,selectProps:{chakraStyles:u,size:a,variant:l,focusBorderColor:c,errorBorderColor:d,controlShouldRenderValue:p}}=n,m=Q(a),g=ne("Input",{size:m,variant:l,focusBorderColor:c,errorBorderColor:d}),f={display:t&&o&&p?"flex":"grid",alignItems:"center",flex:1,paddingY:"2px",paddingX:g.field.px,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},h=u?.valueContainer?u.valueContainer(f,n):f;return P.jsx(N,{...s,className:i({"value-container":!0,"value-container--is-multi":t,"value-container--has-value":o},r),sx:h,children:e})},Zo=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o}}=n,s={display:"flex",alignItems:"center",alignSelf:"stretch",flexShrink:0},u=o?.indicatorsContainer?o.indicatorsContainer(s,n):s;return P.jsx(N,{...t,className:i({indicators:!0},r),sx:u,children:e})},Jo=n=>{const{className:e,cx:r,children:i,innerRef:t,innerProps:o,isDisabled:s,isFocused:u,menuIsOpen:a,selectProps:{chakraStyles:l,size:c,variant:d,focusBorderColor:p,errorBorderColor:m,isInvalid:g,isReadOnly:f}}=n,h=Q(c),{field:{height:b,h:S,...O}}=ne("Input",{size:h,variant:d,focusBorderColor:p,errorBorderColor:m}),M={...O,position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",padding:0,overflow:"hidden",height:"auto",minH:b||S,...s?{pointerEvents:"none"}:{}},w=l?.control?l.control(M,n):M;return P.jsx(N,{ref:t,className:r({control:!0,"control--is-disabled":s,"control--is-focused":u,"control--menu-is-open":a},e),sx:w,...o,"data-focus":u?!0:void 0,"data-focus-visible":u?!0:void 0,"data-invalid":g?!0:void 0,"data-disabled":s?!0:void 0,"data-readonly":f?!0:void 0,children:i})},Qo=n=>{const{className:e,cx:r,selectProps:{chakraStyles:i}}=n,t={opacity:1,display:"none"},o=i?.indicatorSeparator?i.indicatorSeparator(t,n):t;return P.jsx(Dt,{className:r({"indicator-separator":!0},e),sx:o,orientation:"vertical"})},ea=n=>P.jsx(qe,{role:"presentation",focusable:"false","aria-hidden":"true",...n,children:P.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),ta=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o,size:s,focusBorderColor:u,errorBorderColor:a,variant:l}}=n,c=Q(s),p={...ne("Select",{size:c,variant:l,focusBorderColor:u,errorBorderColor:a}).icon,display:"inline-flex",alignItems:"center",justifyContent:"center",position:"static",marginRight:2,marginLeft:1,pointerEvents:"none"},m=o?.dropdownIndicator?o.dropdownIndicator(p,n):p,g={height:"1em",width:"1em"},f=o?.downChevron?o.downChevron(g,n):g;return P.jsx(N,{...t,className:i({indicator:!0,"dropdown-indicator":!0},r),sx:m,children:e||P.jsx(ea,{sx:f})})},na=n=>P.jsx(qe,{focusable:"false","aria-hidden":!0,...n,children:P.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})}),ra=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o,size:s}}=n,u=Q(s),l={...Mt("CloseButton",{size:u}),marginX:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,cursor:"pointer"},c=o?.clearIndicator?o.clearIndicator(l,n):l,d={width:"1em",height:"1em"},p=o?.crossIcon?o.crossIcon(d,n):d;return P.jsx(N,{role:"button",className:i({indicator:!0,"clear-indicator":!0},r),sx:c,"aria-label":"Clear selected options",...t,children:e||P.jsx(na,{sx:p})})},ia=n=>{const{className:e,cx:r,innerProps:i,selectProps:{chakraStyles:t,size:o},color:s,emptyColor:u,speed:a,thickness:l,spinnerSize:c}=n,d=Q(o),m={sm:"xs",md:"sm",lg:"md"}[d],g={marginRight:3},f=t?.loadingIndicator?t.loadingIndicator(g,n):g;return P.jsx(In,{className:r({indicator:!0,"loading-indicator":!0},e),sx:f,...i,size:c||m,color:s,emptyColor:u,speed:a,thickness:l})},oa=n=>{const{className:e,cx:r,value:i,selectProps:{chakraStyles:t,isReadOnly:o}}=n,{innerRef:s,isDisabled:u,isHidden:a,inputClassName:l,...c}=dn(n),d={gridArea:"1 / 2",minW:"2px",border:0,margin:0,outline:0,padding:0},p={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content",color:"inherit",marginX:"0.125rem",paddingY:"0.125rem",visibility:u?"hidden":"visible",transform:i?"translateZ(0)":"",_after:{content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre",padding:0,...d}},m=t?.inputContainer?t.inputContainer(p,n):p,g={background:0,opacity:a?0:1,width:"100%",...d},f=t?.input?t.input(g,n):g;return P.jsx(N,{className:r({"input-container":!0},e),"data-value":i||"",sx:m,children:P.jsx(De.input,{className:r({input:!0},l),ref:s,sx:f,disabled:u,readOnly:o?!0:void 0,...c})})},aa=n=>n?{bottom:"top",top:"bottom"}[n]:"top",sa=n=>{const{className:e,cx:r,children:i,innerProps:t,innerRef:o,placement:s,selectProps:{chakraStyles:u}}=n,a={position:"absolute",[aa(s)]:"100%",marginY:"8px",width:"100%",zIndex:1},l=u?.menu?u.menu(a,n):a;return P.jsx(An,{children:P.jsx(N,{...t,ref:o,className:r({menu:!0},e),sx:l,children:i})})},la=n=>{var e;const{className:r,cx:i,innerRef:t,children:o,maxHeight:s,isMulti:u,innerProps:a,selectProps:{chakraStyles:l,size:c,variant:d,focusBorderColor:p,errorBorderColor:m}}=n,g=ne("Menu"),f=Q(c),b=ne("Input",{size:f,variant:d,focusBorderColor:p,errorBorderColor:m}).field,S={...g.list,minW:"100%",maxHeight:`${s}px`,overflowY:"auto","--input-border-radius":b?.["--input-border-radius"],borderRadius:b?.borderRadius||((e=g.list)==null?void 0:e.borderRadius),position:"relative",WebkitOverflowScrolling:"touch"},O=l?.menuList?l.menuList(S,n):S;return P.jsx(N,{...a,className:i({"menu-list":!0,"menu-list--is-multi":u},r),sx:O,ref:t,children:o})},ua=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o,size:s}}=n,u=Q(s),l={color:"chakra-subtle-text",textAlign:"center",paddingY:{sm:"6px",md:"8px",lg:"10px"}[u],fontSize:u},c=o?.loadingMessage?o.loadingMessage(l,n):l;return P.jsx(N,{...t,className:i({"menu-notice":!0,"menu-notice--loading":!0},r),sx:c,children:e})},ca=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o,size:s}}=n,u=Q(s),l={color:"chakra-subtle-text",textAlign:"center",paddingY:{sm:"6px",md:"8px",lg:"10px"}[u],fontSize:u},c=o?.noOptionsMessage?o.noOptionsMessage(l,n):l;return P.jsx(N,{...t,className:i({"menu-notice":!0,"menu-notice--no-options":!0},r),sx:c,children:e})},da=n=>{const{children:e,className:r,cx:i,theme:t,getStyles:o,Heading:s,headingProps:u,label:a,selectProps:l,innerProps:c,getClassNames:d}=n,{chakraStyles:p}=l,m={},g=p?.group?p.group(m,n):m;return P.jsxs(N,{...c,className:i({group:!0},r),sx:g,children:[P.jsx(s,{...u,selectProps:l,cx:i,theme:t,getStyles:o,getClassNames:d,children:a}),P.jsx(N,{children:e})]})},pa=n=>{const{cx:e,className:r,selectProps:{chakraStyles:i,size:t}}=n,{data:o,...s}=dn(n),u=ne("Menu"),a=Q(t),l={sm:"xs",md:"sm",lg:"md"},c={sm:"0.4rem 0.8rem",md:"0.5rem 1rem",lg:"0.6rem 1.2rem"},d={...u.groupTitle,fontSize:l[a],padding:c[a],margin:0},p=i?.groupHeading?i.groupHeading(d,n):d;return P.jsx(N,{...s,className:e({"group-heading":!0},r),sx:p})},fa=n=>P.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...n,children:P.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),va=n=>{const{className:e,cx:r,innerRef:i,innerProps:t,children:o,isFocused:s,isDisabled:u,isSelected:a,selectProps:{chakraStyles:l,size:c,isMulti:d,hideSelectedOptions:p,selectedOptionStyle:m,selectedOptionColorScheme:g}}=n,f=ne("Menu").item,h=Q(c),b={sm:"0.6rem",md:"0.8rem",lg:"1rem"},S={sm:"0.3rem",md:"0.4rem",lg:"0.5rem"},O=rt(`${g}.500`,`${g}.300`),y=rt("white","black"),M=m==="check"&&(!d||p===!1),w=m==="color"&&a,L={...f,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",textAlign:"start",fontSize:h,paddingX:b[h],paddingY:S[h],...w?{bg:O,color:y,_active:{bg:O}}:{}},x=l?.option?l.option(L,n):L;return P.jsxs(N,{...t,className:r({option:!0,"option--is-disabled":u,"option--is-focused":s,"option--is-selected":a},e),sx:x,ref:i,"data-focus":s?!0:void 0,"aria-disabled":u?!0:void 0,"aria-selected":a,children:[M&&P.jsx($n,{fontSize:"0.8em",marginEnd:"0.75rem",opacity:a?1:0,children:P.jsx(fa,{})}),o]})},ma=n=>typeof n=="object"&&n!==null&&"colorScheme"in n&&typeof n.colorScheme=="string",ha=n=>typeof n=="object"&&n!==null&&"variant"in n&&typeof n.variant=="string",ga=n=>{const{children:e,className:r,components:i,cx:t,data:o,innerProps:s,isDisabled:u,isFocused:a,removeProps:l,selectProps:c,cropWithEllipsis:d}=n,{Container:p,Label:m,Remove:g}=i,{chakraStyles:f,tagColorScheme:h,tagVariant:b,size:S}=c,O=Q(S);let y="",M="";ma(o)&&(y=o.colorScheme),ha(o)&&(M=o.variant);const w=ne("Tag",{size:O,colorScheme:y||h,variant:M||b}),L={...w.container,display:"flex",alignItems:"center",minWidth:0,margin:"0.125rem"},x=f?.multiValue?f.multiValue(L,n):L,D={...w.label,overflow:"hidden",textOverflow:d||d===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},k=f?.multiValueLabel?f.multiValueLabel(D,n):D,T={...w.closeButton,display:"flex",alignItems:"center",justifyContent:"center"},E=f?.multiValueRemove?f.multiValueRemove(T,n):T;return P.jsxs(p,{data:o,innerProps:{className:t({"multi-value":!0,"multi-value--is-disabled":u},r),...s},sx:x,selectProps:c,children:[P.jsx(m,{data:o,innerProps:{className:t({"multi-value__label":!0},r)},sx:k,selectProps:c,children:e}),P.jsx(g,{data:o,innerProps:{className:t({"multi-value__remove":!0},r),"aria-label":`Remove ${e||"option"}`,...l},sx:E,selectProps:c,isFocused:a})]})},ba=n=>{const{children:e,innerProps:r,sx:i}=n;return P.jsx(De.span,{...r,sx:i,children:e})},Sa=n=>{const{children:e,innerProps:r,sx:i}=n;return P.jsx(De.span,{...r,sx:i,children:e})},ya=n=>P.jsx(qe,{verticalAlign:"inherit",viewBox:"0 0 512 512",...n,children:P.jsx("path",{fill:"currentColor",d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})}),Oa=n=>{const{children:e,innerProps:r,isFocused:i,sx:t}=n;return P.jsx(N,{...r,role:"button",sx:t,"data-focus":i?!0:void 0,"data-focus-visible":i?!0:void 0,children:e||P.jsx(ya,{})})},Ca=n=>{const{children:e,className:r,cx:i,innerProps:t,selectProps:{chakraStyles:o}}=n,s={gridArea:"1 / 1 / 2 / 3",color:"chakra-placeholder-color",mx:"0.125rem",userSelect:"none"},u=o?.placeholder?o.placeholder(s,n):s;return P.jsx(N,{...t,className:i({placeholder:!0},r),sx:u,children:e})},xa=n=>{const{children:e,className:r,cx:i,isDisabled:t,innerProps:o,selectProps:{chakraStyles:s}}=n,u={gridArea:"1 / 1 / 2 / 3",mx:"0.125rem",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},a=s?.singleValue?s.singleValue(u,n):u;return P.jsx(N,{className:i({"single-value":!0,"single-value--is-disabled":t},r),sx:a,...o,children:e})},Pa={ClearIndicator:ra,Control:Jo,DropdownIndicator:ta,Group:da,GroupHeading:pa,IndicatorSeparator:Qo,IndicatorsContainer:Zo,Input:oa,LoadingIndicator:ia,LoadingMessage:ua,Menu:sa,MenuList:la,MultiValue:ga,MultiValueContainer:ba,MultiValueLabel:Sa,MultiValueRemove:Oa,NoOptionsMessage:ca,Option:va,Placeholder:Ca,SelectContainer:qo,SingleValue:xa,ValueContainer:Ko},nt=Pa,Ia=({components:n={},theme:e,size:r,isDisabled:i,isInvalid:t,isReadOnly:o,required:s,isRequired:u,inputId:a,selectedOptionStyle:l="color",selectedOptionColorScheme:c="blue",variant:d,tagColorScheme:p,tagVariant:m,focusBorderColor:g,errorBorderColor:f,chakraStyles:h={},onFocus:b,onBlur:S,menuIsOpen:O,...y})=>{var M,w,L,x,D,k,T;const E=Re(),{variant:_="outline"}=(L=(w=(M=E?.components)==null?void 0:M.Input)==null?void 0:w.defaultProps)!=null?L:{},{colorScheme:H="gray",variant:F="subtle"}=(k=(D=(x=E?.components)==null?void 0:x.Tag)==null?void 0:D.defaultProps)!=null?k:{},R=Tn({id:a,isDisabled:i,isInvalid:t,isRequired:u,isReadOnly:o,onFocus:b,onBlur:S}),W=O??(R.readOnly?!1:void 0);let j=l;["color","check"].includes(l)||(j="color");let B=c;return typeof B!="string"&&(B="blue"),{components:{...nt,...n},size:r,selectedOptionStyle:j,selectedOptionColorScheme:B,variant:d??_,tagColorScheme:p??H,tagVariant:m??F,chakraStyles:h,focusBorderColor:g,errorBorderColor:f,onFocus:R.onFocus,onBlur:R.onBlur,isDisabled:R.disabled,isInvalid:!!R["aria-invalid"],inputId:R.id,isReadOnly:R.readOnly,required:s??R.required,menuIsOpen:W,...y,"aria-invalid":(T=y["aria-invalid"])!=null?T:R["aria-invalid"]}},Fe=Ia,wa=v.forwardRef((n,e)=>{const r=Fe(n);return P.jsx(No,{ref:e,...r})}),Ma=wa;v.forwardRef((n,e)=>{const r=Fe(n);return P.jsx(Ho,{ref:e,...r})});v.forwardRef((n,e)=>{const r=Fe(n);return P.jsx(Uo,{ref:e,...r})});v.forwardRef((n,e)=>{const r=Fe(n);return P.jsx(Yo,{ref:e,...r})});const Va="@open-pioneer/basemap-switcher",pn=Dn.bind(void 0,Va),wt="___NO_BASEMAP___",_a=n=>{const e=pn(),{allowSelectingEmptyBasemap:r=!1,"aria-label":i,"aria-labelledby":t}=n,{containerProps:o}=Rn("basemap-switcher",n),s=e.formatMessage({id:"emptyBasemapLabel"}),{map:u}=En(n),a=La(u),l=Ke(()=>u?.layers.getActiveBaseLayer(),[u]),c=S=>{u?.layers.activateBaseLayer(S===wt?void 0:S)},{options:d,selectedLayer:p}=v.useMemo(()=>{const S=a.map(y=>({value:y.id,layer:y}));if(r||l==null){const y={value:wt,layer:void 0};S.push(y)}const O=S.find(y=>y.layer===l);return{options:S,selectedLayer:O}},[r,a,l]),m=Ea(),[g,f]=v.useState(!1),h=v.useMemo(()=>({Option:Da,SingleValue:Ra}),[]),b=Fn(S=>{!g&&S.key==="Enter"&&f(!0)});return P.jsx(N,{...o,children:u?P.jsx(Ma,{"aria-label":i,"aria-labelledby":t,className:"basemap-switcher-select",classNamePrefix:"react-select",options:d,value:p,onChange:S=>S&&c(S.value),isClearable:!1,isSearchable:!1,menuPosition:"fixed",getOptionLabel:S=>S.layer!==void 0?S.layer.title+(S.layer.loadState==="error"?" "+e.formatMessage({id:"layerNotAvailable"}):""):s,isOptionDisabled:S=>S?.layer?.loadState==="error",components:h,ariaLiveMessages:{guidance:()=>"",onChange:S=>S.action=="select-option"||S.action=="initial-input-focus"?S.label+" "+e.formatMessage({id:"selected"}):"",onFilter:()=>"",onFocus:()=>""},chakraStyles:m,onKeyDown:b,menuIsOpen:g,onMenuOpen:()=>f(!0),onMenuClose:()=>f(!1)}):null})};function La(n){return Ke(()=>n?.layers.getBaseLayers()??[],[n])}function Da(n){const{layer:e}=n.data,{isAvailable:r,content:i}=fn(e);return P.jsx(nt.Option,{...n,isDisabled:!r,className:"basemap-switcher-option",children:i})}function Ra(n){const{layer:e}=n.data,{isAvailable:r,content:i}=fn(e);return P.jsx(nt.SingleValue,{...n,isDisabled:!r,className:"basemap-switcher-value",children:i})}function fn(n){const e=pn(),r=e.formatMessage({id:"layerNotAvailable"}),{label:i,isAvailable:t}=Ke(()=>n?{label:n.title,isAvailable:n.loadState!=="error"}:{label:e.formatMessage({id:"emptyBasemapLabel"}),isAvailable:!0},[n,e]);return{isAvailable:t,content:P.jsxs(kn,{direction:"row",alignItems:"center",children:[i,!t&&P.jsx(N,{ml:2,children:P.jsx(wn,{label:r,placement:"right",openDelay:500,children:P.jsx("span",{children:P.jsx(Nn,{color:"red","aria-label":r})})})})]})}}function Ea(){const[n,e]=Mn("colors",["background_body","border"],["#ffffff","#ffffff"]);return v.useMemo(()=>({control:i=>({...i,cursor:"pointer"}),indicatorSeparator:i=>({...i,borderColor:e}),dropdownIndicator:i=>({...i,backgroundColor:n})}),[n,e])}export{_a as B,Dt as D,ie as _,le as a,nt as c,Ma as s,Ke as u}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/BTgBaMxcW6XT.js b/openlayers-base-packages/pr-previews/pr-377/assets/DgGf7HG5MNJv.js similarity index 88% rename from openlayers-base-packages/pr-previews/pr-377/assets/BTgBaMxcW6XT.js rename to openlayers-base-packages/pr-previews/pr-377/assets/DgGf7HG5MNJv.js index 67e62f2..d2a771b 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/BTgBaMxcW6XT.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/DgGf7HG5MNJv.js @@ -1 +1 @@ -import{j as o,g as I,a as O,r as v,B as f,S as w,b as t,V as W,f as F}from"./DbBkdn6FNbgs.js";import{S as U,T as G,O as T,M as B,H as N,c as i,aB as k,ax as l,F as y,i as Q,an as h,am as m,k as A,g as E,h as V,l as K,m as z}from"./DyxVjgSvwe-K.js";import{L as j}from"./D8JwQmCkwKBk.js";import{T as u,U as q,a}from"./CL68Tre-iuri.js";import{C as Y}from"./B6P_btgblpGb.js";import{H as d}from"./C520TGz1zAm6.js";import"./CwYOJLhODXKJ.js";const M=r=>o.jsx(I.div,{className:"chakra-stack__divider",...r,__css:{...r.__css,borderWidth:0,alignSelf:"stretch",borderColor:"inherit",width:"auto",height:"auto"}});M.displayName="StackDivider";const b="main";class J{mapId=b;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new U({title:"OSM",isBaseLayer:!0,olLayer:new G({source:new T})})]}}}const X={"highlight-and-zoom-app":{name:"highlight-and-zoom-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:J,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:B,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:N,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},_=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',$=[];function oo(r){throw new Error(`Unsupported locale: '${r}'`)}const eo=O(_),ro=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:oo,locales:$,packages:X,styles:eo},Symbol.toStringTag,{value:"Module"})),C="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAM6SURBVGhD7Zn7TtRAFMZn2l2MRuWuBg2aGEX/MMLCC5iUx/UJ6CNw0WiiRBFBJaLAilyMbNvxO8tpgkDbM9MxarK/ZNPvdJfpt6dnznQW1aOHDM1Hb1x9PrvYSEx/YNQlijOtDpOG3v3+eK7V/YAnvBgfWozeKKPGYbCPT51LMzE/8UXW2634Pp9yppbxgaXZl4ExE0moG3xKRCM1nSzQy98m5x7xKWucjQ8vRO87DX2bQydwB9a2p+M7HFrhZHxkPto8auprHNair2O+bs3E1mMFfBSDTH/wZZrAWKMYc41DMVbGBxejZZTHLQ69gTHHB5eiVxyKsDKOCXWPpXeM1hMsRYiN02Q02n/fz0Gb1HQNDisRG88CZVUiYWYyenEoAubF1xBlkFZDHKaOo3KaHbOxPRPf5LDL8Hz0qdPUYxyWghVW5EmUcZgZZVkKlvp3p00TdI56NoelDC1EqyxLERlHCgZYFoLVMNmZju9yeAZaaMLUpBwWgmecIZaliIwblCzLQoJMHbIsJMzUD5aFSK5FiCengA4fyzjiYxn+ahwjVZpCq7zMshB0jcrP4FoJy1KkGa+8xVj9LrAspOqxl0CpHLAsRWQczxMbLEtBRygsBTyzS8pEoW1+ZlmKqJ4I9HIkQwae+DbTULUhdZiqAXzx68fvVOO1jxO0e2FZCRlNA/0Arwkb01gvKksyR2wck+8jyz9GFqp1lpWIS4WwKRcXpGVCiDNOoHb3WHoHY++wFGFlHPW6wtI72L4NsxRhZRy3cgqZ2efQGxhzi6UYqxrP8V3rNrWdY5XxHGToC8vaoM2KO8lJnDJO9D+bzepu5fCYm7RbcZNDK5wyTgSZecvSmTTUL1haUytj2JId4tniIodWUPuz7SQnqWWccJmo2iizOznnfLeJWn9M0D6TpRhtjNWPP+dRO+PEyHy0h8WpcpNAoEQ2USI3OHTGi3FCUjLdDbVjFzlN7VLJCTPzmmUhT1ux00Q+D2/G21PxQyoDDs+AubDyRLiflOCtVHLQIg/QIrv//8nBF3L6DbwM78aJwaUowe6n+/sITO/D9JXuG/8DNFmxeRZv9/4ZNsbGfiuXHj3+Ckr9AhPaF/aBpAV7AAAAAElFTkSuQmCC";function io(){const{map:r}=Q(b),n=v.useRef(new Map),[S,R]=v.useState(!1),H=[new h([852011.307424,6788511322702e-6]),new h([829800.379064,6809086916672e-6])],P=[new j([[851890.680238,6788133616293e-6],[851298.293269,6790235634571e-6],[853419.420804,6790407617885e-6]]),new j([[848107.047338,6790579601198e-6],[849081.619449,6793197569417e-6]])],L=[new m([[[851728.251553,6788384425292e-6],[851518.049725,6788651954891e-6],[852182.096409,6788881265976e-6],[851728.251553,6788384425292e-6]]]),new m([[[845183.331006,6794496998898e-6],[850132.628588,6794764528497e-6],[850629.469272,6791707047365e-6],[844399.851466,6791229315939e-6],[845183.331006,6794496998898e-6]]])],D=[new h([852011.307424,6788511322702e-6]),new m([[[845183.331006,6794496998898e-6],[850132.628588,6794764528497e-6],[850629.469272,6791707047365e-6],[844399.851466,6791229315939e-6],[845183.331006,6794496998898e-6]]])];function c(e,x,g){if(e&&!n.current.has(g))if(S){const s=e.highlightAndZoom(x,{highlightStyle:to});s&&n.current.set(g,s)}else{const s=e.highlightAndZoom(x,{});s&&n.current.set(g,s)}}function p(e){n.current.has(e)&&(n.current.get(e)?.destroy(),n.current.delete(e))}function Z(e){e&&(e.removeHighlights(),n.current=new Map)}return o.jsx(A,{height:"100%",direction:"column",overflow:"hidden",children:o.jsx(E,{title:o.jsx(f,{textAlign:"center",py:1,children:o.jsx(V,{size:"md",children:"OpenLayers Base Packages - Highlight and Zoom"})}),children:o.jsx(A,{flex:"1",direction:"column",position:"relative",children:o.jsxs(K,{mapId:b,children:[o.jsx(z,{position:"top-left",horizontalGap:10,verticalGap:10,children:o.jsxs(f,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:[o.jsx(u,{align:"center",children:"Test Controls:"}),o.jsx(w,{align:"center",divider:o.jsx(M,{borderColor:"gray.200"}),pt:5,children:o.jsx(Y,{onChange:e=>{R(e.target.checked)},children:"Own Style"})}),o.jsxs(w,{pt:5,children:[o.jsxs(d,{align:"center",children:[o.jsx(t,{width:105,onClick:()=>c(r,H,"point"),children:"Points"}),o.jsx(t,{onClick:()=>p("point"),children:"Remove"})]}),o.jsxs(d,{children:[o.jsx(t,{width:105,onClick:()=>c(r,P,"line"),children:"LineString"}),o.jsx(t,{onClick:()=>p("line"),children:"Remove"})]}),o.jsxs(d,{children:[o.jsx(t,{width:105,onClick:()=>c(r,L,"polygon"),children:"Polygons"}),o.jsx(t,{onClick:()=>p("polygon"),children:"Remove"})]}),o.jsxs(d,{children:[o.jsx(t,{width:105,onClick:()=>c(r,D,"mix"),children:"Mixed"}),o.jsx(t,{onClick:()=>p("mix"),children:"Remove"})]}),o.jsx(t,{onClick:()=>Z(r),children:"Reset All"})]})]})}),o.jsx(z,{position:"top-right",horizontalGap:10,verticalGap:10,children:o.jsxs(W,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[o.jsx(u,{as:"b",children:"Description"}),o.jsx(u,{children:"This application can be used to test adding highlight or marker, zoom to their extent, and removing highlight and marker. The highlight and zoom for point, line string and polygon geometries in two different styles can be tested."}),o.jsxs(q,{children:[o.jsxs(a,{children:["Clicking on ","'Points'"," adds markers for point geometries."]}),o.jsxs(a,{children:["Clicking on ","'LineString'"," adds highlight for linestring geometries."]}),o.jsxs(a,{children:["Clicking on ","'Polygon'"," adds highlight for polygon geometries."]}),o.jsxs(a,{children:["Clicking on ","'Mixed'"," adds highlight for geometries of different types."]}),o.jsxs(a,{children:["Clicking on ","'Remove'"," will remove the marker or highlight added by the button on the left."]}),o.jsxs(a,{children:["Clicking on ","'Reset All'"," removes all highlights and markers from the map."]}),o.jsxs(a,{children:["Clicking on ","'Own Style'"," activates highlighting with customstyle."]})]})]})})]})})})})}const to={Point:new i({image:new k({anchor:[.5,1],src:C})}),MultiPoint:new i({image:new k({anchor:[.5,1],src:C})}),LineString:[new i({stroke:new l({color:"#ff0000",width:5})}),new i({stroke:new l({color:"#ff0000",width:3})})],MultiLineString:[new i({stroke:new l({color:"#ff0000",width:5})}),new i({stroke:new l({color:"#ff0000",width:3})})],Polygon:[new i({stroke:new l({color:"#ff0000",width:5})}),new i({stroke:new l({color:"#ff0000",width:3}),fill:new y({color:"rgba(51, 171, 71,0.35)"})})],MultiPolygon:[new i({stroke:new l({color:"#ff0000",width:5})}),new i({stroke:new l({color:"#ff0000",width:3}),fill:new y({color:"rgba(51, 171, 71,0.35)"})})]},lo=F({component:io,appMetadata:ro});customElements.define("highlight-and-zoom-app",lo); +import{j as o,g as I,a as O,r as v,B as f,S as w,b as t,V as W,f as F}from"./B60Dx_GOYdnk.js";import{S as U,T as G,O as T,M as B,H as N,c as i,aB as k,ax as l,F as y,i as Q,an as h,am as m,k as A,g as E,h as V,l as K,m as z}from"./j0mck_Meu7Xh.js";import{L as j}from"./ajAX9OmvUsbZ.js";import{T as u,U as q,a}from"./BKR6R-cAnIXt.js";import{C as Y}from"./CG5nmvkyugDn.js";import{H as d}from"./BFY0X3gkqjoN.js";import"./vepZWq5kkQUw.js";const M=r=>o.jsx(I.div,{className:"chakra-stack__divider",...r,__css:{...r.__css,borderWidth:0,alignSelf:"stretch",borderColor:"inherit",width:"auto",height:"auto"}});M.displayName="StackDivider";const b="main";class J{mapId=b;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new U({title:"OSM",isBaseLayer:!0,olLayer:new G({source:new T})})]}}}const X={"highlight-and-zoom-app":{name:"highlight-and-zoom-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:J,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:B,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:N,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}}},_=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',$=[];function oo(r){throw new Error(`Unsupported locale: '${r}'`)}const eo=O(_),ro=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:oo,locales:$,packages:X,styles:eo},Symbol.toStringTag,{value:"Module"})),C="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAM6SURBVGhD7Zn7TtRAFMZn2l2MRuWuBg2aGEX/MMLCC5iUx/UJ6CNw0WiiRBFBJaLAilyMbNvxO8tpgkDbM9MxarK/ZNPvdJfpt6dnznQW1aOHDM1Hb1x9PrvYSEx/YNQlijOtDpOG3v3+eK7V/YAnvBgfWozeKKPGYbCPT51LMzE/8UXW2634Pp9yppbxgaXZl4ExE0moG3xKRCM1nSzQy98m5x7xKWucjQ8vRO87DX2bQydwB9a2p+M7HFrhZHxkPto8auprHNair2O+bs3E1mMFfBSDTH/wZZrAWKMYc41DMVbGBxejZZTHLQ69gTHHB5eiVxyKsDKOCXWPpXeM1hMsRYiN02Q02n/fz0Gb1HQNDisRG88CZVUiYWYyenEoAubF1xBlkFZDHKaOo3KaHbOxPRPf5LDL8Hz0qdPUYxyWghVW5EmUcZgZZVkKlvp3p00TdI56NoelDC1EqyxLERlHCgZYFoLVMNmZju9yeAZaaMLUpBwWgmecIZaliIwblCzLQoJMHbIsJMzUD5aFSK5FiCengA4fyzjiYxn+ahwjVZpCq7zMshB0jcrP4FoJy1KkGa+8xVj9LrAspOqxl0CpHLAsRWQczxMbLEtBRygsBTyzS8pEoW1+ZlmKqJ4I9HIkQwae+DbTULUhdZiqAXzx68fvVOO1jxO0e2FZCRlNA/0Arwkb01gvKksyR2wck+8jyz9GFqp1lpWIS4WwKRcXpGVCiDNOoHb3WHoHY++wFGFlHPW6wtI72L4NsxRhZRy3cgqZ2efQGxhzi6UYqxrP8V3rNrWdY5XxHGToC8vaoM2KO8lJnDJO9D+bzepu5fCYm7RbcZNDK5wyTgSZecvSmTTUL1haUytj2JId4tniIodWUPuz7SQnqWWccJmo2iizOznnfLeJWn9M0D6TpRhtjNWPP+dRO+PEyHy0h8WpcpNAoEQ2USI3OHTGi3FCUjLdDbVjFzlN7VLJCTPzmmUhT1ux00Q+D2/G21PxQyoDDs+AubDyRLiflOCtVHLQIg/QIrv//8nBF3L6DbwM78aJwaUowe6n+/sITO/D9JXuG/8DNFmxeRZv9/4ZNsbGfiuXHj3+Ckr9AhPaF/aBpAV7AAAAAElFTkSuQmCC";function io(){const{map:r}=Q(b),n=v.useRef(new Map),[S,R]=v.useState(!1),H=[new h([852011.307424,6788511322702e-6]),new h([829800.379064,6809086916672e-6])],P=[new j([[851890.680238,6788133616293e-6],[851298.293269,6790235634571e-6],[853419.420804,6790407617885e-6]]),new j([[848107.047338,6790579601198e-6],[849081.619449,6793197569417e-6]])],L=[new m([[[851728.251553,6788384425292e-6],[851518.049725,6788651954891e-6],[852182.096409,6788881265976e-6],[851728.251553,6788384425292e-6]]]),new m([[[845183.331006,6794496998898e-6],[850132.628588,6794764528497e-6],[850629.469272,6791707047365e-6],[844399.851466,6791229315939e-6],[845183.331006,6794496998898e-6]]])],D=[new h([852011.307424,6788511322702e-6]),new m([[[845183.331006,6794496998898e-6],[850132.628588,6794764528497e-6],[850629.469272,6791707047365e-6],[844399.851466,6791229315939e-6],[845183.331006,6794496998898e-6]]])];function c(e,x,g){if(e&&!n.current.has(g))if(S){const s=e.highlightAndZoom(x,{highlightStyle:to});s&&n.current.set(g,s)}else{const s=e.highlightAndZoom(x,{});s&&n.current.set(g,s)}}function p(e){n.current.has(e)&&(n.current.get(e)?.destroy(),n.current.delete(e))}function Z(e){e&&(e.removeHighlights(),n.current=new Map)}return o.jsx(A,{height:"100%",direction:"column",overflow:"hidden",children:o.jsx(E,{title:o.jsx(f,{textAlign:"center",py:1,children:o.jsx(V,{size:"md",children:"OpenLayers Base Packages - Highlight and Zoom"})}),children:o.jsx(A,{flex:"1",direction:"column",position:"relative",children:o.jsxs(K,{mapId:b,children:[o.jsx(z,{position:"top-left",horizontalGap:10,verticalGap:10,children:o.jsxs(f,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:[o.jsx(u,{align:"center",children:"Test Controls:"}),o.jsx(w,{align:"center",divider:o.jsx(M,{borderColor:"gray.200"}),pt:5,children:o.jsx(Y,{onChange:e=>{R(e.target.checked)},children:"Own Style"})}),o.jsxs(w,{pt:5,children:[o.jsxs(d,{align:"center",children:[o.jsx(t,{width:105,onClick:()=>c(r,H,"point"),children:"Points"}),o.jsx(t,{onClick:()=>p("point"),children:"Remove"})]}),o.jsxs(d,{children:[o.jsx(t,{width:105,onClick:()=>c(r,P,"line"),children:"LineString"}),o.jsx(t,{onClick:()=>p("line"),children:"Remove"})]}),o.jsxs(d,{children:[o.jsx(t,{width:105,onClick:()=>c(r,L,"polygon"),children:"Polygons"}),o.jsx(t,{onClick:()=>p("polygon"),children:"Remove"})]}),o.jsxs(d,{children:[o.jsx(t,{width:105,onClick:()=>c(r,D,"mix"),children:"Mixed"}),o.jsx(t,{onClick:()=>p("mix"),children:"Remove"})]}),o.jsx(t,{onClick:()=>Z(r),children:"Reset All"})]})]})}),o.jsx(z,{position:"top-right",horizontalGap:10,verticalGap:10,children:o.jsxs(W,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[o.jsx(u,{as:"b",children:"Description"}),o.jsx(u,{children:"This application can be used to test adding highlight or marker, zoom to their extent, and removing highlight and marker. The highlight and zoom for point, line string and polygon geometries in two different styles can be tested."}),o.jsxs(q,{children:[o.jsxs(a,{children:["Clicking on ","'Points'"," adds markers for point geometries."]}),o.jsxs(a,{children:["Clicking on ","'LineString'"," adds highlight for linestring geometries."]}),o.jsxs(a,{children:["Clicking on ","'Polygon'"," adds highlight for polygon geometries."]}),o.jsxs(a,{children:["Clicking on ","'Mixed'"," adds highlight for geometries of different types."]}),o.jsxs(a,{children:["Clicking on ","'Remove'"," will remove the marker or highlight added by the button on the left."]}),o.jsxs(a,{children:["Clicking on ","'Reset All'"," removes all highlights and markers from the map."]}),o.jsxs(a,{children:["Clicking on ","'Own Style'"," activates highlighting with customstyle."]})]})]})})]})})})})}const to={Point:new i({image:new k({anchor:[.5,1],src:C})}),MultiPoint:new i({image:new k({anchor:[.5,1],src:C})}),LineString:[new i({stroke:new l({color:"#ff0000",width:5})}),new i({stroke:new l({color:"#ff0000",width:3})})],MultiLineString:[new i({stroke:new l({color:"#ff0000",width:5})}),new i({stroke:new l({color:"#ff0000",width:3})})],Polygon:[new i({stroke:new l({color:"#ff0000",width:5})}),new i({stroke:new l({color:"#ff0000",width:3}),fill:new y({color:"rgba(51, 171, 71,0.35)"})})],MultiPolygon:[new i({stroke:new l({color:"#ff0000",width:5})}),new i({stroke:new l({color:"#ff0000",width:3}),fill:new y({color:"rgba(51, 171, 71,0.35)"})})]},lo=F({component:io,appMetadata:ro});customElements.define("highlight-and-zoom-app",lo); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/DjS5-7IPlotu.js b/openlayers-base-packages/pr-previews/pr-377/assets/DjS5-7IPlotu.js new file mode 100644 index 0000000..116098f --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/DjS5-7IPlotu.js @@ -0,0 +1 @@ +import{ag as e,ah as t}from"./B60Dx_GOYdnk.js";const m=e({},t);export{m as t}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/Ch2CPfq1SbGd.js b/openlayers-base-packages/pr-previews/pr-377/assets/Dko_2nwYwIor.js similarity index 58% rename from openlayers-base-packages/pr-previews/pr-377/assets/Ch2CPfq1SbGd.js rename to openlayers-base-packages/pr-previews/pr-377/assets/Dko_2nwYwIor.js index ad5a16a..f812b8c 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/Ch2CPfq1SbGd.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/Dko_2nwYwIor.js @@ -1 +1 @@ -import{h as c,T as R,o as _,j as a,g as l,m as d}from"./DbBkdn6FNbgs.js";import{a as m,b as h}from"./CwYOJLhODXKJ.js";const y=c(function(s,e){const r=R("FormLabel",s),o=_(s),{className:t,children:p,requiredIndicator:b=a.jsx(u,{}),optionalIndicator:q=null,...n}=o,i=m(),x=i?.getLabelProps(n,e)??{ref:e,...n};return a.jsxs(l.label,{...x,className:d("chakra-form__label",o.className),__css:{display:"block",textAlign:"start",...r},children:[p,i?.isRequired?b:q]})});y.displayName="FormLabel";const u=c(function(s,e){const r=m(),o=h();if(!r?.isRequired)return null;const t=d("chakra-form__required-indicator",s.className);return a.jsx(l.span,{...r?.getRequiredIndicatorProps(s,e),__css:o.requiredIndicator,className:t})});u.displayName="RequiredIndicator";export{y as F}; +import{h as l,W as R,o as _,j as a,g as c,l as d}from"./B60Dx_GOYdnk.js";import{a as m,b as h}from"./vepZWq5kkQUw.js";const y=l(function(s,e){const r=R("FormLabel",s),o=_(s),{className:t,children:p,requiredIndicator:b=a.jsx(u,{}),optionalIndicator:q=null,...n}=o,i=m(),x=i?.getLabelProps(n,e)??{ref:e,...n};return a.jsxs(c.label,{...x,className:d("chakra-form__label",o.className),__css:{display:"block",textAlign:"start",...r},children:[p,i?.isRequired?b:q]})});y.displayName="FormLabel";const u=l(function(s,e){const r=m(),o=h();if(!r?.isRequired)return null;const t=d("chakra-form__required-indicator",s.className);return a.jsx(c.span,{...r?.getRequiredIndicatorProps(s,e),__css:o.requiredIndicator,className:t})});u.displayName="RequiredIndicator";export{y as F}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/Dlj8U5klui5y.js b/openlayers-base-packages/pr-previews/pr-377/assets/Dlj8U5klui5y.js new file mode 100644 index 0000000..714b98e --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/Dlj8U5klui5y.js @@ -0,0 +1 @@ +import{j as e,a as P,M as k,r as p,b as C,q as y,B as u,D as B,f as R}from"./B60Dx_GOYdnk.js";import{t as T}from"./DjS5-7IPlotu.js";import{S as O,T as N,O as q,M as F,H,u as D,k as m,i as Z,g as $,h as V,l as W,m as G}from"./j0mck_Meu7Xh.js";import{_ as U}from"./CmsKOCeNyeyo.js";import{c as A}from"./BlACKGYldMfy.js";import{I as z,S as j}from"./BXfBNJYYR7xb.js";import{g as K}from"./2C0geDG_OBHU.js";const J=A({displayName:"ArrowRightIcon",path:e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),e.jsx("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})}),Q=A({displayName:"ArrowLeftIcon",path:e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),e.jsx("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})}),h="main";class X{mapId=h;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new O({title:"OSM",isBaseLayer:!0,olLayer:new N({source:new q})})]}}}const Y={"sidebar-app":{name:"sidebar-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:X,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:F,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:H,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/experimental-layout-sidebar":{name:"@open-pioneer/experimental-layout-sidebar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}}},ee='.layout-sidebar{z-index:99}:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.layout-sidebar{height:100%;position:absolute;top:0}.layout-sidebar[data-theme=light]{background-color:var(--chakra-colors-whiteAlpha-700)}.layout-sidebar[data-theme=dark]{background-color:var(--chakra-colors-blackAlpha-700)}.layout-sidebar .layout-sidebar-main{transition:width .3s ease-out 0s;border-right:1px solid var(--chakra-colors-chakra-border-color)}.layout-sidebar .layout-sidebar-content{overflow:auto;transition:width .3s ease-out 0s}.layout-sidebar .layout-sidebar-content .content-section .content-header{font-size:1.5em;background-color:var(--chakra-colors-blackAlpha-500);padding:.5rem 1rem}.layout-sidebar .layout-sidebar-content .content-section .content-body{padding:1rem}',oe=["en"];function re(i){switch(i){case"en":return U(()=>import("./BIbDu0DJPL_e.js"),[],import.meta.url).then(s=>s.default)}throw new Error(`Unsupported locale: '${i}'`)}const te=P(ee),ae=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:re,locales:oe,packages:Y,styles:te},Symbol.toStringTag,{value:"Module"})),ie="@open-pioneer/experimental-layout-sidebar",le=D.bind(void 0,ie),S=60,M=180,I=300;function ne({defaultExpanded:i,expandedChanged:s,sidebarWidthChanged:n,items:c}){const l=le(),[a,{toggle:t}]=se(c),{isOpen:r,onToggle:b}=k({defaultIsOpen:i,onOpen(){s?.(!0)},onClose(){s?.(!1)}}),{isOpen:d,onToggle:x}=k(),g=a.size>0;p.useEffect(()=>{g&&!d&&x(),!g&&d&&x()},[g]),p.useEffect(()=>{if(n){let o=S;r&&(o=M),d&&(o+=I),n(o)}},[r,d]);const E=c?.map((o,_)=>{const f="white",w=a.has(o.id)?"outline":"ghost";return e.jsx("div",{children:r?e.jsx(C,{leftIcon:o.icon,variant:w,colorScheme:f,onClick:()=>t(o),children:o.label},o.id):e.jsx(y,{hasArrow:!0,label:o.label,placement:"right",children:e.jsx(z,{"aria-label":o.label,variant:w,colorScheme:f,icon:o.icon,onClick:()=>t(o)})},o.id)},_)}),L=c?.filter(o=>a.has(o.id)).map(o=>e.jsxs("div",{className:"content-section",children:[e.jsxs(m,{className:"content-header",alignItems:"center",children:[e.jsx(u,{children:o.label}),e.jsx(j,{}),e.jsx(B,{onClick:()=>t(o)})]}),e.jsx("div",{className:"content-body",children:o.content})]},o.id)),v=l.formatMessage({id:r?"toggle.collapse":"toggle.expand"});return e.jsxs(m,{className:"layout-sidebar",children:[e.jsxs(u,{className:"layout-sidebar-main",display:"flex",flexDirection:"column",width:r?`${M}px`:`${S}px`,padding:"10px",gap:"10px",children:[E,e.jsx(j,{}),e.jsx(y,{label:v,hasArrow:!0,placement:"right",children:e.jsx(z,{"aria-label":v,variant:"ghost",icon:r?e.jsx(Q,{}):e.jsx(J,{}),onClick:b})})]}),e.jsx(u,{className:"layout-sidebar-content",width:d?`${I}px`:"0px",children:L})]})}function se(i){const[s,n]=p.useReducer((l,a)=>{switch(a.type){case"toggle":{const t=new Set(l);return t.has(a.id)?t.delete(a.id):t.add(a.id),t}case"retain":{const t=new Set(a.ids),r=new Set(l);for(const b of r)t.has(b)||r.delete(b);return r}}},void 0,()=>new Set),c=p.useCallback(l=>{n({type:"toggle",id:l.id})},[n]);return p.useEffect(()=>{n({type:"retain",ids:i?.map(l=>l.id)??[]})},[i,n]),[s,{toggle:c}]}const ce=[796987,5827477,796987,5827477];function pe(){const[i,s]=p.useState(),[n,c]=p.useState(!0),l=Z(h),a=()=>{const r=l.map?.olMap;r&&r?.getView().fit(ce,{maxZoom:13})},t=[{id:"sandbox",icon:e.jsx(K,{}),label:"Sandbox",content:e.jsx(C,{onClick:a,children:"Center Berlin"})}];return e.jsx(m,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx($,{title:e.jsx(u,{textAlign:"center",py:1,px:1,children:e.jsx(V,{size:"md",children:"Sidebar sample"})}),children:e.jsxs(m,{flex:"1",direction:"column",position:"relative",children:[e.jsx(ne,{defaultExpanded:n,expandedChanged:r=>c(r),sidebarWidthChanged:r=>s({left:r}),items:t}),e.jsx(W,{mapId:h,viewPadding:i,viewPaddingChangeBehavior:"preserve-extent",children:e.jsx(G,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsx(u,{backgroundColor:"whiteAlpha.800",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:"This is a sample for a sidebar component."})})})]})})})}const de=R({component:pe,theme:T,appMetadata:ae});customElements.define("sidebar-app",de); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/Do0wXWKIsHnp.js b/openlayers-base-packages/pr-previews/pr-377/assets/Do0wXWKIsHnp.js new file mode 100644 index 0000000..30162b4 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/Do0wXWKIsHnp.js @@ -0,0 +1 @@ +var So=Object.defineProperty;var xt=o=>{throw TypeError(o)};var ko=(o,e,t)=>e in o?So(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var w=(o,e,t)=>ko(o,typeof e!="symbol"?e+"":e,t),it=(o,e,t)=>e.has(o)||xt("Cannot "+t);var l=(o,e,t)=>(it(o,e,"read from private field"),t?t.call(o):e.get(o)),h=(o,e,t)=>e.has(o)?xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),g=(o,e,t,i)=>(it(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),y=(o,e,t)=>(it(o,e,"access private method"),t);import{g as De,h as q,j as r,k as Io,u as Eo,o as Mo,l as Oe,m as _o,n as Co,r as v,B as T,c as ye,b as ee,F as zt,V as lt,A as rt,p as nt,q as ut,E as N,a as jo,f as Lo}from"./B60Dx_GOYdnk.js";import{aE as Po,aF as Ao,ag as No,af as oe,aG as Ro,aH as To,ao as Do,aI as Oo,aJ as Vo,aK as Go,a9 as Fo,as as zo,aL as St,aM as Bo,aN as Ho,aO as kt,aP as Uo,aQ as Wo,aR as at,V as qo,aS as It,A as $o,L as Ko,aT as Yo,J as Zo,aU as Xo,aV as Jo,aW as Qo,aX as ei,aY as Et,S as pt,T as Bt,O as Ht,a as ht,b as Ut,aZ as xe,i as Se,f as Je,u as Ve,r as M,a_ as Mt,a$ as ti,an as oi,j as Be,c as Wt,C as ii,F as qt,ax as $t,d as ri,w as mt,b0 as ni,b1 as ai,b2 as si,k as j,b3 as li,b4 as Qe,b5 as Kt,g as He,h as ct,b6 as ci,H as di,M as ui,D as pi,l as hi,m as _t}from"./j0mck_Meu7Xh.js";import{W as mi,i as gi,j as Yt}from"./BLfEaHvmX9OI.js";import{O as Zt,W as fi,c as vi,I as Xt,C as bi,b as wi,a as yi,M as xi,P as Si,L as ki,d as Ii,S as Ei,E as Mi,V as _i,e as Jt,N as Ci}from"./1BI1b7D_asS4.js";import{G as Qt,T as ji,C as Li,e as Pi}from"./CYroAbEI2PyD.js";import{T as et,L as Ai}from"./BKR6R-cAnIXt.js";import{u as D,s as Ni}from"./DSjrbd_eKbZM.js";import{G as Ri}from"./2C0geDG_OBHU.js";import{Z as Ti,a as Di,H as Oi,b as Vi,I as Gi,V as Fi,S as zi}from"./cFp2KtAGHfQy.js";import{M as Bi,a as Hi,b as Ui}from"./CMfwYEDRd35m.js";import{M as Wi}from"./C9VJq5Ka7299.js";import{S as qi,I as $i}from"./BXfBNJYYR7xb.js";import{u as dt}from"./BpQSjk0kyblh.js";import{c as eo}from"./BlACKGYldMfy.js";import{R as Ki}from"./CbxgmwRI74qQ.js";import{N as Yi,P as Zi}from"./C1CVOge1__u2.js";import{_ as Ct}from"./CmsKOCeNyeyo.js";import{F as Xi}from"./vepZWq5kkQUw.js";import{H as Ji}from"./BFY0X3gkqjoN.js";import{F as Qi}from"./Dko_2nwYwIor.js";import"./BWf1FusGPLsb.js";import"./ajAX9OmvUsbZ.js";import"./CG5nmvkyugDn.js";const to=De("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});to.displayName="Center";const er={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};q(function(e,t){const{axis:i="both",...n}=e;return r.jsx(De.div,{ref:t,__css:er[i],...n,position:"absolute"})});const[tr,oo]=Io({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),gt=q(function(e,t){const i=Eo("Input",e),{children:n,className:a,...s}=Mo(e),c=Oe("chakra-input__group",a),d={},u=_o(n),f=i.field;u.forEach(m=>{i&&(f&&m.type.id==="InputLeftElement"&&(d.paddingStart=f.height??f.h),f&&m.type.id==="InputRightElement"&&(d.paddingEnd=f.height??f.h),m.type.id==="InputRightAddon"&&(d.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(d.borderStartRadius=0))});const p=u.map(m=>{const S=Co({size:m.props?.size||e.size,variant:m.props?.variant||e.variant});return m.type.id!=="Input"?v.cloneElement(m,S):v.cloneElement(m,Object.assign(S,d,m.props))});return r.jsx(De.div,{className:c,ref:t,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...i.group},"data-group":!0,...s,children:r.jsx(tr,{value:i,children:p})})});gt.displayName="InputGroup";const or={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},ir=De("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),ft=q(function(e,t){const{placement:i="left",...n}=e,a=or[i]??{},s=oo();return r.jsx(ir,{ref:t,...n,__css:{...s.addon,...a}})});ft.displayName="InputAddon";const io=q(function(e,t){return r.jsx(ft,{ref:t,placement:"left",...e,className:Oe("chakra-input__left-addon",e.className)})});io.displayName="InputLeftAddon";io.id="InputLeftAddon";const vt=q(function(e,t){return r.jsx(ft,{ref:t,placement:"right",...e,className:Oe("chakra-input__right-addon",e.className)})});vt.displayName="InputRightAddon";vt.id="InputRightAddon";const rr=De("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),tt=q(function(e,t){const{placement:i="left",...n}=e,a=oo(),s=a.field,d={[i==="left"?"insetStart":"insetEnd"]:"0",width:s?.height??s?.h,height:s?.height??s?.h,fontSize:s?.fontSize,...a.element};return r.jsx(rr,{ref:t,__css:d,...n})});tt.id="InputElement";tt.displayName="InputElement";const ro=q(function(e,t){const{className:i,...n}=e,a=Oe("chakra-input__left-element",i);return r.jsx(tt,{ref:t,placement:"left",className:a,...n})});ro.id="InputLeftElement";ro.displayName="InputLeftElement";const bt=q(function(e,t){const{className:i,...n}=e,a=Oe("chakra-input__right-element",i);return r.jsx(tt,{ref:t,placement:"right",className:a,...n})});bt.id="InputRightElement";bt.displayName="InputRightElement";const b={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},nr={ERROR:"error"};class ar extends Do{constructor(e){super(nr.ERROR),this.code=e.code,this.message=e.message}}let sr=class extends Po{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.position_=null,this.transform_=Ao,this.watchId_=void 0,this.addChangeListener(b.PROJECTION,this.handleProjectionChanged_),this.addChangeListener(b.TRACKING,this.handleTrackingChanged_),e.projection!==void 0&&this.setProjection(e.projection),e.trackingOptions!==void 0&&this.setTrackingOptions(e.trackingOptions),this.setTracking(e.tracking!==void 0?e.tracking:!1)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const e=this.getProjection();e&&(this.transform_=No(oe("EPSG:4326"),e),this.position_&&this.set(b.POSITION,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const e=this.getTracking();e&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(e){const t=e.coords;this.set(b.ACCURACY,t.accuracy),this.set(b.ALTITUDE,t.altitude===null?void 0:t.altitude),this.set(b.ALTITUDE_ACCURACY,t.altitudeAccuracy===null?void 0:t.altitudeAccuracy),this.set(b.HEADING,t.heading===null?void 0:Ro(t.heading)),this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];const i=this.transform_(this.position_);this.set(b.POSITION,i.slice()),this.set(b.SPEED,t.speed===null?void 0:t.speed);const n=To(this.position_,t.accuracy);n.applyTransform(this.transform_),this.set(b.ACCURACY_GEOMETRY,n),this.changed()}positionError_(e){this.dispatchEvent(new ar(e))}getAccuracy(){return this.get(b.ACCURACY)}getAccuracyGeometry(){return this.get(b.ACCURACY_GEOMETRY)||null}getAltitude(){return this.get(b.ALTITUDE)}getAltitudeAccuracy(){return this.get(b.ALTITUDE_ACCURACY)}getHeading(){return this.get(b.HEADING)}getPosition(){return this.get(b.POSITION)}getProjection(){return this.get(b.PROJECTION)}getSpeed(){return this.get(b.SPEED)}getTracking(){return this.get(b.TRACKING)}getTrackingOptions(){return this.get(b.TRACKING_OPTIONS)}setProjection(e){this.set(b.PROJECTION,oe(e))}setTracking(e){this.set(b.TRACKING,e)}setTrackingOptions(e){this.set(b.TRACKING_OPTIONS,e)}};const lr=1.2;function cr(o,e=lr){dr(o);const t=Oo(o),i=Vo(o),n=t*e,a=i*e;return[o[0]-(n-t)/2,o[1]-(a-i)/2,o[2]+(n-t)/2,o[3]+(a-i)/2]}function dr(o){if(o.length!==4)throw new Error(`Invalid extent (expected length 4, but got length ${o.length}).`)}const st=.75,Fe=.1;let ur=class extends Go{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=e.rotateWithView!==void 0?e.rotateWithView:!1,this.viewExtent_=void 0;const t=e.className!==void 0?e.className:"ol-overviewmap",i=e.tipLabel!==void 0?e.tipLabel:"Overview map",n=e.collapseLabel!==void 0?e.collapseLabel:"‹";typeof n=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;const a=e.label!==void 0?e.label:"›";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a):this.label_=a;const s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,c=document.createElement("button");c.setAttribute("type","button"),c.title=i,c.appendChild(s),c.addEventListener(Fo.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=e.view;const d=new zo({view:e.view,controls:new St,interactions:new St});this.ovmap_=d,e.layers&&e.layers.forEach(function(k){d.addLayer(k)});const u=document.createElement("div");u.className="ol-overviewmap-box",u.style.boxSizing="border-box",this.boxOverlay_=new Zt({position:[0,0],positioning:"center-center",element:u}),this.ovmap_.addOverlay(this.boxOverlay_);const f=t+" "+Bo+" "+Ho+(this.collapsed_&&this.collapsible_?" "+kt:"")+(this.collapsible_?"":" ol-uncollapsible"),p=this.element;p.className=f,p.appendChild(this.ovmapDiv_),p.appendChild(c);const m=this,S=this.boxOverlay_,_=this.boxOverlay_.getElement(),Ee=function(k){return{clientX:k.clientX,clientY:k.clientY}},O=function(k){const E=Ee(k),Me=d.getEventCoordinate(E);S.setPosition(Me)},ie=function(k){const E=d.getEventCoordinateInternal(k);m.getMap().getView().setCenterInternal(E),window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",ie)};this.ovmapDiv_.addEventListener("pointerdown",function(){event.target===_&&window.addEventListener("pointermove",O),window.addEventListener("pointerup",ie)})}setMap(e){const t=this.getMap();if(e!==t){if(t){const i=t.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(Uo(e,Wo.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const i=e.getView();i&&this.bindView_(i),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===at.VIEW){const t=e.oldValue;t&&this.unbindView_(t);const i=this.getMap().getView();this.bindView_(i)}else!this.ovmap_.isRendered()&&(e.key===at.TARGET||e.key===at.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){const t=new qo({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(It.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(It.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),a=e.getView().calculateExtentInternal(i);if(this.viewExtent_&&$o(a,this.viewExtent_))return;this.viewExtent_=a;const s=t.getSize(),d=t.getView().calculateExtentInternal(s),u=t.getPixelFromCoordinateInternal(Ko(a)),f=t.getPixelFromCoordinateInternal(Yo(a)),p=Math.abs(u[0]-f[0]),m=Math.abs(u[1]-f[1]),S=s[0],_=s[1];pS*st||m>_*st?this.resetExtent_():Zo(d,a)||this.recenter_()}resetExtent_(){const e=this.getMap(),t=this.ovmap_,i=e.getSize(),a=e.getView().calculateExtentInternal(i),s=t.getView(),c=Math.log(st/Fe)/Math.LN2,d=1/(Math.pow(2,c/2)*Fe);Xo(a,d),s.fitInternal(Jo(a))}recenter_(){const e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),n=e.getView(),a=t.getView(),s=this.rotateWithView_?0:-n.getRotation(),c=this.boxOverlay_,d=this.boxOverlay_.getElement(),u=n.getCenter(),f=n.getResolution(),p=a.getResolution(),m=i[0]*f/p,S=i[1]*f/p;if(c.setPosition(u),d){d.style.width=m+"px",d.style.height=S+"px";const _="rotate("+s+"rad)";d.style.transform=_}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=Qo(this.ovmap_,ei.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()}))}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(kt),this.collapsed_?Et(this.collapseLabel_,this.label_):Et(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}};const pr=eo({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"}),hr=eo({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),mr={height:"25px",width:"25px",borderColor:"#4cb3ff",borderWidth:"3px",borderRadius:"50%",display:"inline-block "};function gr(o){return r.jsxs(T,{children:[r.jsx(et,{children:o.layer.title}),r.jsx(T,{style:mr})]})}const ke="main";class fr{mapId=ke;vectorSourceFactory;constructor(e){this.vectorSourceFactory=e.references.vectorSourceFactory}async getMapConfig(){return{initialView:{kind:"position",center:{x:823091,y:6724521},zoom:8},layers:[new pt({title:"OSM",id:"osm",isBaseLayer:!0,olLayer:new Bt({source:new Ht})}),new fi({isBaseLayer:!0,title:"Orthofotos NRW",url:"https://www.wmts.nrw.de/geobasis/wmts_nw_dop/1.0.0/WMTSCapabilities.xml",name:"nw_dop",matrixSet:"EPSG_3857_16",sourceOptions:{attributions:'Die Geobasisdaten des amtlichen Vermessungswesens werden als öffentliche Aufgabe gem. VermKatG NRW und gebührenfrei nach Open Data-Prinzipien über online-Verfahren bereitgestellt. Nutzungsbedingungen: siehe '}}),wr(),br(),vr(this.vectorSourceFactory)]}}}function vr(o){const e="https://ogc-api-test.nrw.de/inspire-us-krankenhaus/v1",t="governmentalservice",i=o.createVectorSource({baseUrl:e,collectionId:t,limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:`Land NRW (${new Date().getFullYear()}), Datenlizenz Deutschland - Namensnennung - Version 2.0, Datenquelle`}),n=new ht({source:i});return new pt({id:"krankenhaus",title:"Krankenhäuser-Demo-Dienst",visible:!1,olLayer:n,attributes:{collectionURL:e+"/collections/"+t}})}function br(){const o=new Ut({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new Qt,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'}),e=new ht({source:o}),t={Component:gr};return new pt({id:"ogc_kitas",title:"Kindertagesstätten",visible:!0,olLayer:e,attributes:{legend:t}})}function wr(){return new mi({title:"Verwaltungsgebiete",id:"verwaltungsgebiete",visible:!1,url:"https://www.wms.nrw.de/geobasis/wms_nw_dvg",sublayers:[{name:"nw_dvg_krs",title:"Kreise und kreisfreie Städte"}]})}const yr="200px",xr="300px",Sr=o=>{const{olLayer:e,height:t=yr,width:i=xr}=o,{containerProps:n}=xe("overview-map",o),a=v.useRef(null),{map:s}=Se(o);return v.useEffect(()=>{if(a.current&&s&&e){const c=s.olMap,d=new ur({className:"ol-overviewmap",layers:[e],collapsible:!1,collapsed:!1,target:a.current});return c.addControl(d),()=>{c.removeControl(d)}}},[s,e]),r.jsx(T,{height:t,width:i,ref:a,...n})};function kr({intl:o}){return{id:"overviewMap",title:o.formatMessage({id:"demos.overviewMap.title"}),createModel(){const e=new Bt({source:new Ht});return{description:o.formatMessage({id:"demos.overviewMap.description"}),mainWidget:r.jsx(Sr,{olLayer:e}),destroy(){e.dispose()}}}}}class Ir{label;filteredTypes;httpService;constructor(e,t,i){this.label=e,this.filteredTypes=t,this.httpService=i}async search(e,{mapProjection:t,signal:i}){const n=await this.request(e,100,i),a=new Qt({dataProjection:"EPSG:4326",featureProjection:t});return n.features.filter(s=>this.filteredTypes.includes(s.properties.type)).map((s,c)=>{const d=a.readGeometry(s.geometry);return{id:s.properties.osm_id||c,label:this.createLabel(s),geometry:d,properties:s.properties}})}async request(e,t,i){const n=new URL("https://photon.komoot.io/api?");n.searchParams.set("q",e),n.searchParams.set("lang","de"),n.searchParams.set("lat","51.961563"),n.searchParams.set("lon","7.628202"),n.searchParams.set("limit",t.toString());const a=await this.httpService.fetch(n,{signal:i});if(!a.ok)throw new Error("Request failed: "+a.status);return await a.json()}createLabel(e){return`${e.properties.name} (${e.properties.osm_value?e.properties.osm_value+", ":""}${e.properties.postcode?e.properties.postcode+", ":""}${e.properties.city?e.properties.city+", ":""}${e.properties.country?e.properties.country+")":")"}`}}function Er({intl:o,httpService:e,mapModel:t}){return{id:"searchAndHighlight",title:o.formatMessage({id:"demos.searchAndHighlight.title"}),createModel(){return new Mr(o,t,e)}}}var Ce,je,ne,Ue,ae,Gt;let Mr=(Gt=class{constructor(e,t,i){h(this,Ce);h(this,je);h(this,ne);w(this,"description");w(this,"mainWidget");h(this,Ue,e=>{const t=e.result.geometry;t&&(l(this,ae).call(this),g(this,ne,_r(l(this,je),[t])))});h(this,ae,()=>{l(this,ne)?.destroy(),g(this,ne,void 0)});g(this,Ce,new Ir("Photon Geocoder",["city","street"],i)),g(this,je,t),this.description=e.formatMessage({id:"demos.searchAndHighlight.description"}),this.mainWidget=r.jsx(vi,{sources:[l(this,Ce)],onSelect:l(this,Ue),onClear:l(this,ae)})}destroy(){l(this,ae).call(this)}},Ce=new WeakMap,je=new WeakMap,ne=new WeakMap,Ue=new WeakMap,ae=new WeakMap,Gt);function _r(o,e){const t=o.olMap.getViewport();return o.highlightAndZoom(e,{viewPadding:t&&t.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}const no="@open-pioneer/geolocation",Cr=Je.bind(void 0,no),ao=Ve.bind(void 0,no);function jr(o){return Ri({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"},child:[]}]})(o)}const jt=ye("geolocation:GeolocationController"),Lt=17;var $,K;class Lr{constructor(e,t,i){w(this,"supported",!!navigator.geolocation);w(this,"map");w(this,"positionHighlightLayer");w(this,"geolocation");w(this,"onError");w(this,"maxZoom",Lt);w(this,"accuracyFeature");w(this,"positionFeature");w(this,"changeHandlers",[]);w(this,"setMapToPosition",!0);w(this,"trackingOptions",{});w(this,"isInitialZoom",!0);h(this,$,M(!1));h(this,K,M(!1));this.map=e,this.onError=t,this.isInitialZoom=!0,this.accuracyFeature=new Mt,this.accuracyFeature.setStyle(At()),this.positionFeature=new Mt,this.positionFeature.setStyle(Pt()),this.positionHighlightLayer=new ht({source:new Ut({features:[this.accuracyFeature,this.positionFeature]})}),this.positionHighlightLayer.setZIndex(ti);const n=i||Pr();this.geolocation=new sr({tracking:!1,trackingOptions:n,projection:e.olView?.getProjection()}),this.trackingOptions=n,this.geolocation.on("error",a=>this.handleGeolocationError(a))}destroy(){this.stopGeolocation(),this.geolocation?.setTracking(!1),this.geolocation.dispose(),this.accuracyFeature=void 0,this.positionFeature=void 0,this.positionHighlightLayer.dispose()}startGeolocation(){if(l(this,K).value)return;new Promise(t=>{l(this,K).value=!0,l(this,$).value=!0,this.geolocation?.setProjection(this.map.olView?.getProjection()),this.geolocation?.setTracking(!0);const i=this.geolocation.on("change:accuracyGeometry",()=>{const c=this.geolocation.getAccuracyGeometry()||void 0;if(this.accuracyFeature?.setGeometry(c),this.accuracyFeature?.getGeometry()!==void 0&&t(),this.isInitialZoom){const d=this?.accuracyFeature?.getGeometry()?.getExtent();if(d){const u=cr(d);if(!u)return;this.map.olView.fit(u,{maxZoom:this.maxZoom}),this.isInitialZoom=!1}}}),n=this.geolocation.on("change:position",()=>{const c=this.geolocation.getPosition();c&&(c[0]||c[1])!==void 0&&(this.positionFeature?.setGeometry(new oi(c)),this.setMapToPosition&&this.map.olView.setCenter(c),this.positionFeature?.getGeometry()!==void 0&&t())}),a=this.map.olView.on("change:resolution",()=>{this.setMapToPosition=this.isInitialZoom}),s=this.map.olMap.on("pointermove",c=>{c.dragging&&(this.setMapToPosition=!1)});this.changeHandlers.push(i,n,a,s),this.map.olMap.addLayer(this.positionHighlightLayer)}).then(()=>{l(this,$).value=!1}).catch(t=>{jt.error("Failed to determine location",t)})}stopGeolocation(){this.geolocation?.setTracking(!1),l(this,K).value=!1,l(this,$).value=!1,this.trackingOptions={},this.setMapToPosition=!0,this.isInitialZoom=!0,this.changeHandlers.forEach(e=>{Be(e)}),this.changeHandlers=[],this.accuracyFeature?.setGeometry(void 0),this.positionFeature?.setGeometry(void 0),this.map.olMap.removeLayer(this.positionHighlightLayer)}get active(){return l(this,K).value}get loading(){return l(this,$).value}setPositionFeatureStyle(e){this.positionFeature?.setStyle(e??Pt())}setAccuracyFeatureStyle(e){this.accuracyFeature?.setStyle(e??At())}setMaxZoom(e){this.maxZoom=e??Lt}getMaxZoom(){return this.maxZoom}getPositionFeature(){return this.positionFeature}getAccuracyFeature(){return this.accuracyFeature}getTrackingOptions(){return this.trackingOptions}getGeolocation(){return this.geolocation}handleGeolocationError(e){jt.error("Error from geolocation API:",e.message),this.stopGeolocation();const t=(()=>{switch(e.code){case 1:return"permission-denied";case 2:return"position-unavailable";case 3:return"timeout";default:return"unknown"}})();this.onError(t)}}$=new WeakMap,K=new WeakMap;const Pt=()=>new Wt({image:new ii({radius:6,fill:new qt({color:"#3399CC"}),stroke:new $t({color:"#fff",width:2})})}),At=()=>new Wt({stroke:new $t({color:"#3399CC",width:3}),fill:new qt({color:"rgba(0, 0, 255, 0.05)"})}),Pr=()=>({enableHighAccuracy:!0,timeout:6e4,maximumAge:6e5}),Ar=v.forwardRef(function(e,t){const{maxZoom:i,positionFeatureStyle:n,accuracyFeatureStyle:a,trackingOptions:s}=e,{map:c}=Se(e),d=Rr(c,i,s,n,a);return d&&r.jsx(Nr,{...e,controller:d,ref:t})}),Nr=v.forwardRef(function(e,t){const{controller:i}=e,{containerProps:n}=xe("geolocation",e),{isLoading:a,isActive:s}=D(()=>({isLoading:i.loading,isActive:i.active}),[i]),c=ao(),d=i.supported?s?c.formatMessage({id:"locateMeEnd"}):c.formatMessage({id:"locateMeStart"}):c.formatMessage({id:"locateNotSupported"}),u=()=>{i.active?i.stopGeolocation():i.startGeolocation()};return r.jsx(ji,{ref:t,label:d,icon:r.jsx(jr,{}),onClick:()=>u(),isActive:s,isLoading:a,isDisabled:!i.supported,...n})});function Rr(o,e,t,i,n){const a=ao(),s=Cr("notifier.NotificationService"),[c,d]=v.useState();return v.useEffect(()=>{if(!o)return;const u=p=>{const m=a.formatMessage({id:"error"}),S=(()=>{switch(p){case"permission-denied":return a.formatMessage({id:"permissionDenied"});case"position-unavailable":return a.formatMessage({id:"positionUnavailable"});case"timeout":return a.formatMessage({id:"timeout"});case"unknown":return a.formatMessage({id:"unknownError"})}})();s.notify({level:"error",title:m,message:S})},f=new Lr(o,u,t);return d(f),()=>{f.destroy(),d(void 0)}},[o,t,a,s]),v.useEffect(()=>{c?.setPositionFeatureStyle(i)},[c,i]),v.useEffect(()=>{c?.setAccuracyFeatureStyle(n)},[c,n]),v.useEffect(()=>{c?.setMaxZoom(e)},[c,e]),c}const Tr="@open-pioneer/scale-setter",Dr=Ve.bind(void 0,Tr),Or=[17471320,8735660,4367830,2183915,1091957,545978,272989,136494,68247,34123,17061,8530,4265,2132],Vr=o=>{const{scales:e=Or}=o,{containerProps:t}=xe("scale-setter",o),{map:i}=Se(o),n=Dr(),a=D(()=>i?.scale??1,[i]),s=e.map(d=>r.jsx(Bi,{value:d,onClick:()=>i?.setScale(d),onFocus:u=>{u.target?.scrollIntoView?.({block:"nearest"})},className:"scale-setter-option",children:Nt(n,d)},d)),c=Nt(n,a);return r.jsx(T,{...t,children:r.jsxs(Wi,{isLazy:!0,children:[r.jsx(Hi,{as:ee,rightIcon:r.jsx(Li,{}),className:"scale-setter-menubutton","aria-label":n.formatMessage({id:"button.ariaLabel"},{scale:c}),"aria-description":n.formatMessage({id:"button.ariaDescription"}),children:c}),r.jsx(zt,{children:r.jsx(Ui,{className:"scale-setter-menuoptions",maxHeight:"20em",overflowY:"auto",children:s})})]})})};function Nt(o,e){return"1 : "+o.formatNumber(e)}const so="@open-pioneer/spatial-bookmarks",Gr=Je.bind(void 0,so),Fr=Ve.bind(void 0,so),F=ye("spatial-bookmark:SpatialBookmarkViewModel");class zr{map;packageNamespace;writableBookmarks=ri([]);watchBookmarksHandle;get bookmarks(){return this.writableBookmarks.getItems()}constructor(e,t){this.map=e,this.packageNamespace=t.getNamespace("spatial-bookmarks"),this.loadState(),this.watchBookmarksHandle=mt(()=>[this.writableBookmarks.getItems()],([i])=>this.saveState(i),{immediate:!1})}destroy(){this.watchBookmarksHandle.destroy()}createBookmark(e){const t=this.map.olView.calculateExtent(),i=this.map.projection.getCode(),n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]},a={id:ni(),title:e,extent:n,projection:i};F.debug("Created a new bookmark",a),this.writableBookmarks.push(a)}activateBookmark(e){F.debug("Activating bookmark",e);const t=this.getBookmarkExtent(e);F.debug("Attempting to apply extent",t),this.applyExtent(t)}deleteBookmark(e){F.debug("Deleting bookmark",e);const t=this.writableBookmarks.findIndex(i=>i.id===e);t>-1&&this.writableBookmarks.splice(t,1)}deleteAllBookmarks(){F.debug("Deleting all bookmarks"),this.writableBookmarks.splice(0)}loadState(){F.debug("Restoring bookmarks from local storage");const e=this.packageNamespace.get("bookmarks")??[];try{Br(e),this.writableBookmarks.push(...e)}catch(t){F.error("Bookmarks data in local storage is invalid, resetting to default value.",t),this.writableBookmarks.splice(0),this.saveState([])}}saveState(e){F.debug("Saving bookmarks to local storage"),this.packageNamespace.set("bookmarks",e)}getBookmarkExtent(e){const t=this.map.olView,i=e.extent,n=[i.minX,i.minY,i.maxX,i.maxY],a=t.getProjection(),s=e.projection;return ai(n,s,a)}applyExtent(e){const t=this.map.olView,i=si(e),n=t.getResolutionForExtent(e);t.setCenter(i),t.setResolution(n)}}function Br(o){if(!Array.isArray(o))throw new Error("Expected bookmarks from local storage to be an array.");for(const e of o)Hr(e)}function Hr(o){if(!o||typeof o!="object")throw new Error("Expected bookmark from local storage to be an object.");const e=o;if(typeof e.id!="string")throw new Error("Bookmark does not have a valid id.");if(typeof e.title!="string")throw new Error("Bookmark does not have a valid title.");if(Ur(e.extent),typeof e.projection!="string")throw new Error("Bookmark does not have a valid projection value.")}function Ur(o){if(!o||typeof o!="object")throw new Error("Expected bookmark extent from local storage to be an object.");const e=o;if(typeof e.minX!="number"||typeof e.minY!="number"||typeof e.maxX!="number"||typeof e.maxY!="number")throw new Error("Expected bookmark extent from local storage to have valid coordinates.")}const Wr=o=>{const{map:e}=Se(o),t=Gr("local-storage.LocalStorageService"),i=Jr(e,t);return i&&r.jsx(qr,{...o,viewModel:i})};function qr(o){const{viewModel:e}=o,t=Fr(),i=v.useRef([]),[n,a]=v.useState(!1),s=D(()=>e.bookmarks,[e]),[c,d]=v.useState(""),u=c.trim().length>0,{containerProps:f}=xe("spatial-bookmarks",o),[p,m]=v.useState("list"),S=()=>{e.deleteAllBookmarks(),m("list")},_=()=>{u&&(e.createBookmark(c),m("list"),d(""),a(!0))};v.useEffect(()=>{if(n){const E=i.current;E&&E[s.length-1]?.scrollIntoView?.(),a(!1)}},[s,n]);const Ee=()=>r.jsxs(lt,{children:[r.jsxs(rt,{rounded:"md",status:"warning",children:[r.jsx(nt,{}),t.formatMessage({id:"bookmark.alert.delete"})]}),r.jsx(Zr,{intl:t,onClear:S,onCancel:()=>m("list")})]}),O=()=>r.jsxs(lt,{children:[r.jsxs(rt,{rounded:"md",status:"info",children:[r.jsx(nt,{}),t.formatMessage({id:"bookmark.alert.create"})]}),r.jsx(Xt,{"aria-label":t.formatMessage({id:"bookmark.input.label"}),placeholder:t.formatMessage({id:"bookmark.input.placeholder"}),value:c,onChange:E=>{d(E.target.value)},onKeyDown:E=>{E.key==="Enter"&&_()},isRequired:!0,isInvalid:!u,autoFocus:!0}),r.jsx(Xr,{intl:t,isInvalid:!u,onCancel:()=>{d(""),m("list")},onSave:_})]}),ie=()=>r.jsxs(r.Fragment,{children:[s.length?$r(s,e,t,i):r.jsxs(rt,{rounded:"md",status:"info",children:[r.jsx(nt,{}),t.formatMessage({id:"bookmark.alert.noSaved"})]}),r.jsx(Yr,{intl:t,bookmarks:s,showCreate:()=>m("create"),showDelete:()=>m("delete")})]}),k=r.jsxs(r.Fragment,{children:[p==="list"&&ie(),p==="create"&&O(),p==="delete"&&Ee()]});return r.jsx(j,{flexDirection:"column",...f,children:k})}function $r(o,e,t,i){const n=t.formatMessage({id:"bookmark.button.deleteOne"}),a=o.map((s,c)=>r.jsx(Kr,{index:c,listItemNodes:i,bookmark:s,onActivate:()=>e.activateBookmark(s),onDelete:()=>e.deleteBookmark(s.id),deleteBtnLabel:n},s.id));return r.jsx(Ai,{as:"ul",className:"spatial-bookmark-list",role:"listbox","aria-label":t.formatMessage({id:"bookmark.list.label"}),flexShrink:1,flexGrow:1,p:1,spacing:1,overflowY:"auto",listStyleType:"none",children:a})}const Rt={ArrowDown:1,ArrowUp:-1};function Kr(o){const{index:e,listItemNodes:t,bookmark:i,onDelete:n,onActivate:a,deleteBtnLabel:s}=o,c=i.title,d=u=>{const f=u.key;if(f==="Enter"){u.target===u.currentTarget&&a();return}if(Rt[f]!=null){const p=t.current?.length;if(!p)return;let m=(e+Rt[f])%p;m<0&&(m=p-1),t.current[m]?.focus()}};return r.jsx(T,{as:"li",p:1,ref:u=>{if(!u){t.current.splice(e,1);return}t.current[e]=u},className:li("spatial-bookmarks-item"),tabIndex:0,rounded:"md",role:"option",cursor:"pointer",outline:0,_hover:{background:"trails.50"},_focusVisible:{boxShadow:"outline"},onKeyDown:d,onClick:a,children:r.jsxs(j,{width:"100%",flexDirection:"row",align:"center",gap:1,children:[r.jsx(to,{children:r.jsx(gi,{})}),r.jsx(et,{ps:2,noOfLines:1,children:c}),r.jsx(qi,{}),r.jsx(ut,{hasArrow:!0,label:s,placement:"right",children:r.jsx(ee,{className:"spatial-bookmarks-item-delete","aria-label":s,borderRadius:"full",iconSpacing:0,padding:0,colorScheme:"red",variant:"ghost",leftIcon:r.jsx(Yt,{}),onClick:u=>{n(),u.stopPropagation()}})},e)]})})}function Yr(o){const{intl:e,bookmarks:t,showCreate:i,showDelete:n}=o;return r.jsxs(wt,{children:[r.jsx(ve,{isDisabled:t.length===0,colorScheme:"red",width:void 0,iconSpacing:0,leftIcon:r.jsx(Yt,{}),onClick:n,"aria-label":e.formatMessage({id:"bookmark.button.deleteAll"}),variant:"outline"}),r.jsx(ve,{onClick:i,width:"100%",children:e.formatMessage({id:"bookmark.button.create"})})]})}function Zr(o){const{intl:e,onCancel:t,onClear:i}=o;return r.jsxs(wt,{children:[r.jsx(ve,{variant:"outline",onClick:t,children:e.formatMessage({id:"bookmark.button.cancelDelete"})}),r.jsx(ve,{onClick:i,children:e.formatMessage({id:"bookmark.button.confirmDelete"})})]})}function Xr(o){const{intl:e,onCancel:t,onSave:i,isInvalid:n}=o;return r.jsxs(wt,{children:[r.jsx(ve,{variant:"outline",onClick:()=>t(),children:e.formatMessage({id:"bookmark.button.cancel"})}),r.jsx(ve,{isDisabled:n,onClick:()=>i(),children:e.formatMessage({id:"bookmark.button.save"})})]})}function wt(o){return r.jsx(j,{width:"100%",flexDirection:"row",mt:2,gap:1,flexGrow:0,flexShrink:0,children:o.children})}function ve(o){return r.jsx(ee,{width:"100%",...o})}function Jr(o,e){const[t,i]=v.useState();return v.useEffect(()=>{let n;return o?n=new zr(o,e):n=void 0,i(n),()=>n?.destroy()},[o,e]),t}const lo="@open-pioneer/coordinate-search",Qr=Je.bind(void 0,lo),Ge=Ve.bind(void 0,lo);function en(o){const{isInputValid:e,coordinateSearchInput:t,setCoordinateSearchInput:i,placeholder:n,placeholderString:a,onClear:s,onEnter:c}=o,d=Ge(),u=r.jsx(Xt,{type:"text",value:t,onChange:p=>{i(p.target.value)},isInvalid:!e,backgroundColor:e?"undefined":"red.100",placeholder:a,errorBorderColor:"red.500","aria-label":d.formatMessage({id:"coordinateInput.ariaLabel"}),borderRightRadius:0,onKeyDown:p=>{p.key=="Enter"&&c()}});let f=null;return t!==""?f=r.jsx(Tt,{className:"coordinate-input-clear-button",label:d.formatMessage({id:"coordinateInput.clearPlaceholder"}),onClick:()=>{i(""),s?.()},icon:r.jsx(hr,{})}):typeof n=="object"&&(f=r.jsx(Tt,{className:"coordinate-input-copy-button",label:d.formatMessage({id:"coordinateInput.copyPlaceholder"}),onClick:()=>{navigator.clipboard.writeText(a)},icon:r.jsx(pr,{})})),r.jsxs(gt,{className:"coordinate-input-field-group",children:[u,f]})}function Tt(o){const{className:e,label:t,onClick:i,icon:n}=o;return r.jsx(bt,{children:r.jsx(ut,{label:t,children:r.jsx($i,{className:e,size:"sm",onClick:i,padding:0,icon:n,"aria-label":t})})})}const tn=ye("coordinate-search");function on(o,e,t){if(o=="")return z("empty");if(!o.includes(" "))return z("tooltip.space");if(o.indexOf(" ")!=o.lastIndexOf(" "))return z("tooltip.spaceOne");const i=o.split(" ");if(i.length!=2||i[0]==""||i[1]=="")return z("tooltip.2coords");const n=e.parseNumber(i[0]),a=e.parseNumber(i[1]),s=[n,a];if(s.some(c=>Number.isNaN(c)))return z("tooltip.invalidNumbers");try{if(!Dt(t,s)||!Dt(oe("EPSG:4326"),Qe(s,t,"EPSG:4326")))return z("tooltip.extent")}catch(c){return tn.warn("Failed to check if coordinates are in projection extent",c),z("tooltip.projection")}return{kind:"success",projection:t,coordinates:s}}function z(o){return{kind:o}}function Dt(o,e){const t=o.getExtent();if(!t||t.length!==4)return!0;if(!e||e.length!==2)throw new Error(`Internal error: invalid coordinates ${e}.`);return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}function co(o,e,t){if(o[0]==null||o[1]==null)return"";const[i,n]=o,a=t.formatNumber(i,{maximumFractionDigits:e,minimumFractionDigits:e}),s=t.formatNumber(n,{maximumFractionDigits:e,minimumFractionDigits:e});return a+" "+s}const rn=v.memo(function(e){const{currentProjection:t,projections:i,portalElement:n,onProjectionChange:a}=e,s=Ge(),c=nn(s),[d,u]=v.useState(!1),f=dt(p=>{!d&&p.key==="Enter"&&u(!0)});return r.jsx(Ni,{value:t,defaultValue:t,options:i,menuPlacement:"auto",menuPortalTarget:n.current,"aria-label":s.formatMessage({id:"coordinateInput.ariaLabel"}),classNamePrefix:"coordinate-input-select",isSearchable:!1,chakraStyles:{menu:p=>({...p,width:"max-content",minWidth:"100%"}),control:(p,{selectProps:{menuIsOpen:m}})=>({...p,width:"max-content",minWidth:"100%",color:"white",borderLeftStyle:"none",borderLeftRadius:0,padding:0,backgroundColor:`${m?"rgb(27, 75, 95)":"var(--chakra-colors-background_primary)"}`,_focus:{boxShadow:"var(--chakra-shadows-outline)"}}),valueContainer:p=>({...p,paddingEnd:0,cursor:"pointer"}),dropdownIndicator:(p,{selectProps:{menuIsOpen:m}})=>({...p,paddingStart:0,backgroundColor:`${m?"rgb(27, 75, 95)":"var(--chakra-colors-background_primary)"}`}),option:p=>({...p,_focus:{background:"var(--chakra-colors-trails-300)"}}),indicatorSeparator:(p,{selectProps:{menuIsOpen:m}})=>({...p,backgroundColor:`${m?"rgb(27, 75, 95)":"var(--chakra-colors-background_primary)"}`,borderColor:`${m?"rgb(27, 75, 95)":"var(--chakra-colors-background_primary)"}`})},ariaLiveMessages:c,onChange:p=>{p?.value!==void 0&&a(p)},onKeyDown:f,menuIsOpen:d,onMenuOpen:()=>u(!0),onMenuClose:()=>u(!1)})});function nn(o){return v.useMemo(()=>({onFocus:()=>"",onChange:a=>a.action=="select-option"||a.action=="initial-input-focus"?a.label+" "+o.formatMessage({id:"selected"}):"",guidance:()=>"",onFilter:()=>""}),[o])}function an(o,e,t){const i=Ge();return v.useMemo(()=>{let n;if(typeof o=="string")n=o;else if(!e)n="";else{const a=Qe(o,e,t.value);n=co(a,t.precision,i)}return n},[o,e,t,i])}const sn=3,ln=[{label:"WGS 84",value:oe("EPSG:4326"),precision:3},{label:"Web Mercator",value:oe("EPSG:3857"),precision:2}],uo=o=>{const{onSelect:e,onClear:t,projections:i=ln,input:n,placeholder:a=""}=o,{containerProps:s}=xe("coordinate-input",o),{map:c}=Se(o),d=Ge(),u=D(()=>c?.projection,[c]),f=un(i),[p,m]=v.useState(f[0]),S=dt(ot=>{if(!e||ot.kind!=="success"||u==null)return;const xo=Qe(ot.coordinates,ot.projection,u);e({coords:xo,projection:u})}),[_,Ee,O]=cn(n,u,p,S),ie=an(a,u,p),k=O.kind==="success"||O.kind==="empty",E=dt(()=>{S(O)}),Me=v.useRef(null);return r.jsxs(T,{...s,children:[r.jsx(zt,{children:r.jsx("div",{ref:Me})}),r.jsx(j,{flexDirection:"row",flexDir:"row",children:r.jsx(ut,{label:k?void 0:d.formatMessage({id:O.kind}),hasArrow:!0,placement:"auto",isOpen:!k,className:"coordinate-input-tooltip",children:r.jsxs(gt,{className:"coordinate-input-group",children:[r.jsx(en,{coordinateSearchInput:_,setCoordinateSearchInput:Ee,placeholder:a,placeholderString:ie,onClear:t,isInputValid:k,onEnter:E}),r.jsx(vt,{padding:"0px",borderLeft:"0px",children:r.jsx(rn,{portalElement:Me,currentProjection:p,projections:f,onProjectionChange:m})})]})})})]})};function cn(o,e,t,i){const n=Ge(),a=Qr("runtime.NumberParserService"),[s]=v.useState(()=>new dn(n,t,a));v.useEffect(()=>{const f=o!==s.inputProp||t!==s.selectedProjection;if(s.setI18n(n,a),s.setInputProp(o),s.setSelectedProjection(t),s.setMapProjection(e),f){const p=s.validationResult;i(p)}},[s,n,a,o,t,e,i]);const{rawInput:c,validationResult:d}=D(()=>({rawInput:s.rawInput,validationResult:s.validationResult}),[s]),u=v.useCallback(f=>{s.setText(f)},[s]);return[c,u,d]}var se,V,le,Y,ce,Z,We,de,ze;class dn{constructor(e,t,i){h(this,de);h(this,se);h(this,V);h(this,le,M());h(this,Y,M());h(this,ce);h(this,Z,M(""));h(this,We,Kt(()=>on(l(this,Z).value,l(this,ce).value,l(this,V).value.value)));g(this,se,M(e)),g(this,V,M(t)),g(this,ce,M(i))}get inputProp(){return l(this,Y).value}get rawInput(){return l(this,Z).value}get validationResult(){return l(this,We).value}get selectedProjection(){return l(this,V).value}setI18n(e,t){l(this,se).value=e,l(this,ce).value=t}setText(e){l(this,Z).value=e}setSelectedProjection(e){e!==l(this,V).value&&(l(this,V).value=e,y(this,de,ze).call(this))}setInputProp(e){e!==l(this,Y).value&&(l(this,Y).value=e,y(this,de,ze).call(this))}setMapProjection(e){e!==l(this,le).value&&(l(this,le).value=e,y(this,de,ze).call(this))}}se=new WeakMap,V=new WeakMap,le=new WeakMap,Y=new WeakMap,ce=new WeakMap,Z=new WeakMap,We=new WeakMap,de=new WeakSet,ze=function(){const e=l(this,Y).value,t=l(this,le).value,i=l(this,V).value,n=l(this,se).value;if(t&&e){const a=Qe(e,t,i.value),s=co(a,i.precision,n);l(this,Z).value=s}};function un(o){return v.useMemo(()=>o.flatMap(t=>oe(t.value)!=null?{label:t.label,value:oe(t.value),precision:t.precision??sn}:[]),[o])}const pn=o=>{const{onSelect:e,onClear:t,projections:i}=o,{containerProps:n}=xe("coordinate-search",o),{map:a}=Se(o),s=a?.olMap,{coordinates:c}=hn(s);return r.jsx(uo,{...n,mapId:o.mapId,onSelect:d=>{a&&(s?.getView().setCenter(d.coords),e?.(d))},onClear:t,placeholder:c||"",projections:i})};function hn(o){const[e,t]=v.useState();return v.useEffect(()=>{if(!o)return;const i=o.on("pointermove",n=>{t(n.coordinate)});return()=>Be(i)},[o]),{coordinates:e}}function mn({intl:o}){return{id:"coordinateViewer",title:o.formatMessage({id:"demos.coordinateViewer.title"}),createModel(){return{description:o.formatMessage({id:"demos.coordinateViewer.description"}),mainWidget:r.jsx(bi,{})}}}}function gn({intl:o,notificationService:e}){return{id:"coordinateInput",title:o.formatMessage({id:"demos.coordinateInput.title"}),createModel(){return{description:o.formatMessage({id:"demos.coordinateInput.description"}),mainWidget:r.jsx(fn,{notificationService:e,intl:o})}}}}function fn(o){const{notificationService:e,intl:t}=o,[i,n]=v.useState();function a(c,d){e.notify({level:"info",message:t.formatMessage({id:"demos.coordinateInput.entered"},{coordinates:c.toString(),projection:d.getCode()}),displayDuration:4e3})}function s(){e.notify({level:"info",message:t.formatMessage({id:"demos.coordinateSearch.cleared"}),displayDuration:4e3}),n(void 0)}return r.jsxs(j,{direction:"column",gap:10,children:[r.jsx(uo,{mapId:ke,input:i,placeholder:t.formatMessage({id:"demos.coordinateInput.placeholder"}),onSelect:({coords:c,projection:d})=>a(c,d),onClear:s,projections:[{label:"EPSG:25832",value:"EPSG:25832"},{label:"WGS 84",value:"EPSG:4326"},{label:"Web Mercator",value:"EPSG:3857"},{label:"EPSG:25833",value:"EPSG:25833"},{label:"EPSG:31466",value:"EPSG:31466"},{label:"EPSG:31467",value:"EPSG:31467"},{label:"EPSG:3035",value:"EPSG:3035"}]}),r.jsx(ee,{onClick:()=>{n([761166,6692084])},children:t.formatMessage({id:"demos.coordinateInput.setInput"})})]})}function vn({intl:o,notificationService:e}){return{id:"coordinateSearch",title:o.formatMessage({id:"demos.coordinateSearch.title"}),createModel(){return{description:o.formatMessage({id:"demos.coordinateSearch.description"}),mainWidget:r.jsx(bn,{notificationService:e,intl:o})}}}}function bn(o){const{notificationService:e,intl:t}=o;function i(a,s){e.notify({level:"info",message:t.formatMessage({id:"demos.coordinateSearch.entered"},{coordinates:a.toString(),projection:s.getCode()}),displayDuration:4e3})}function n(){e.notify({level:"info",message:t.formatMessage({id:"demos.coordinateSearch.cleared"}),displayDuration:4e3})}return r.jsx(j,{direction:"column",gap:10,children:r.jsx(pn,{mapId:ke,onSelect:({coords:a,projection:s})=>i(a,s),onClear:n,projections:[{label:"EPSG:25832",value:"EPSG:25832"},{label:"WGS 84",value:"EPSG:4326"},{label:"Web Mercator",value:"EPSG:3857"},{label:"EPSG:25833",value:"EPSG:25833"},{label:"EPSG:31466",value:"EPSG:31466"},{label:"EPSG:31467",value:"EPSG:31467"},{label:"EPSG:3035",value:"EPSG:3035"}]})})}function wn({intl:o}){return{id:"scaleViewer",title:o.formatMessage({id:"demos.scaleViewer.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleViewer.description"}),mainWidget:r.jsx(wi,{})}}}}function yn({intl:o}){return{id:"scaleSetter",title:o.formatMessage({id:"demos.scaleSetter.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleSetter.description"}),mainWidget:r.jsx(Vr,{})}}}}function xn({intl:o}){return{id:"scaleBar",title:o.formatMessage({id:"demos.scaleBar.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleBar.description"}),tools:r.jsx(yi,{})}}}}function Sn({intl:o}){return{id:"measurement",title:o.formatMessage({id:"demos.measurement.title"}),createModel(){return{description:o.formatMessage({id:"demos.measurement.description"}),mainWidget:r.jsx(xi,{})}}}}function kn({intl:o}){return{id:"mapNavigation",title:o.formatMessage({id:"demos.mapNavigation.title"}),createModel(){return{description:o.formatMessage({id:"demos.mapNavigation.description"}),tools:r.jsxs(r.Fragment,{children:[r.jsx(Ti,{}),r.jsx(Di,{}),r.jsx(Oi,{}),r.jsx(Vi,{}),r.jsx(Gi,{})]})}}}}function In({intl:o}){return{id:"geolocation",title:o.formatMessage({id:"demos.geolocation.title"}),createModel(){return{description:o.formatMessage({id:"demos.geolocation.description"}),tools:r.jsx(Ar,{})}}}}function En({intl:o}){return{id:"spatialBookmarks",title:o.formatMessage({id:"demos.spatialBookmarks.title"}),createModel(){return{description:o.formatMessage({id:"demos.spatialBookmarks.description"}),mainWidget:r.jsx(Wr,{})}}}}function Mn({intl:o}){return{id:"printing",title:o.formatMessage({id:"demos.printing.title"}),createModel(){return{description:o.formatMessage({id:"demos.printing.description"}),mainWidget:r.jsx(Si,{})}}}}const po="showcase-app",ho=Je.bind(void 0,po),Ie=Ve.bind(void 0,po);function _n({intl:o,mapModel:e}){return{id:"tocLegend",title:o.formatMessage({id:"demos.tocLegend.title"}),createModel(){function t(n=!0){e.layers.getLayerById("verwaltungsgebiete").setVisible(n),e.layers.getLayerById("krankenhaus").setVisible(n),e.layers.getLayerById("ogc_kitas").setVisible(n)}function i(){t(!1),e?.layers.activateBaseLayer("osm")}return{description:o.formatMessage({id:"demos.tocLegend.description"}),mainWidget:r.jsx(Cn,{}),destroy:i}}}}function Cn(){const o=v.useId(),e=v.useId(),t=Ie();return r.jsxs(r.Fragment,{children:[r.jsx(T,{role:"dialog","aria-labelledby":o,children:r.jsx(He,{title:r.jsx(ct,{id:o,size:"md",mb:2,children:r.jsx(et,{children:t.formatMessage({id:"demos.tocLegend.tocTitle"})})}),children:r.jsx(Pi,{showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})}),r.jsx(T,{pt:2,role:"dialog","aria-labelledby":e,children:r.jsx(He,{title:r.jsx(ct,{id:e,size:"md",mb:2,children:t.formatMessage({id:"demos.tocLegend.legendTitle"})}),children:r.jsx(ki,{showBaseLayers:!0})})})]})}function jn(o){return{id:"selectionResultList",title:o.intl.formatMessage({id:"demos.selectionResultList.title"}),createModel(){return new Ln(o)}}}var Le,ue,pe,qe,$e,Ft;let Ln=(Ft=class{constructor(e){h(this,Le);h(this,ue);h(this,pe,M({key:0,input:void 0,open:!1}));w(this,"description");w(this,"mainWidget");h(this,qe,e=>{const{results:t}=e,a={columns:[{id:"id",displayName:"ID",width:100,getPropertyValue(c){return c.id}},{propertyName:"pointOfContact.address.postCode",displayName:"PLZ",width:120},{propertyName:"name",displayName:"Name"},{propertyName:"inspireId",displayName:"inspireID"},{displayName:"Gefördert",width:160,getPropertyValue(c){switch(c.properties?.gefoerdert){case"ja":return!0;case"nein":return!1;default:return c.properties?.gefoerdert}}}],data:t,formatOptions:{numberOptions:{maximumFractionDigits:3},dateOptions:{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}}},s=l(this,pe).value.key;l(this,pe).value={open:!0,key:s+1,input:a}});h(this,$e,e=>{console.log("Selected features: ",e.features)});const{mapModel:t,vectorSelectionSourceFactory:i,intl:n}=e;g(this,Le,t),g(this,ue,Pn(t,i)),this.description=n.formatMessage({id:"demos.selectionResultList.description"}),this.mainWidget=r.jsx(Ii,{sources:[l(this,ue)],onSelectionComplete:l(this,qe)}),t.layers.getLayerById("ogc_kitas").setVisible(!0)}destroy(){l(this,ue).destroy(),l(this,Le).layers.getLayerById("ogc_kitas").setVisible(!1)}get listContainer(){const e=l(this,pe).value;if(!(!e.open||!e.input))return r.jsx(Ki,{input:e.input,onSelectionChange:l(this,$e)},e.key)}},Le=new WeakMap,ue=new WeakMap,pe=new WeakMap,qe=new WeakMap,$e=new WeakMap,Ft);function Pn(o,e){const t=o.layers.getLayerById("ogc_kitas");return e.createSelectionSource({vectorLayer:t.olLayer,label:t.title})}const An="krankenhaus";function Nn(o){return{id:"editing",title:o.intl.formatMessage({id:"demos.editing.title"}),createModel(){return new Rn(o)}}}var Pe,he;class Rn{constructor(e){w(this,"description");w(this,"mainWidget");h(this,Pe);h(this,he);const{mapModel:t,intl:i,editingService:n,notificationService:a}=e;g(this,Pe,t),this.description=i.formatMessage({id:"demos.editing.description"}),g(this,he,new Tn(t,n,a,i)),this.mainWidget=r.jsx(Dn,{editingController:l(this,he)}),this._setEditLayerVisible(!0)}destroy(){this._setEditLayerVisible(!1),l(this,he).stopEditing()}_setEditLayerVisible(e=!0){l(this,Pe).layers.getLayerById(An).setVisible(e)}}Pe=new WeakMap,he=new WeakMap;var I,C,X,J,B,G,Q,H;class Tn{constructor(e,t,i,n){h(this,I);h(this,C);h(this,X);h(this,J);h(this,B);h(this,G);h(this,Q);h(this,H);g(this,I,M(!1)),g(this,C,e),g(this,X,t),g(this,J,i),g(this,B,n)}editingActive(){return l(this,I).value}startCreateWorkflow(){if(!l(this,I).value)try{l(this,I).value=!0;const e=l(this,C).layers.getLayerById("krankenhaus"),t=new URL(e.attributes.collectionURL+"/items"),i=l(this,X).createFeature(l(this,C),t);this._watchState(i),i.whenComplete().then(n=>{if(!n)return;l(this,J).notify({level:"info",message:l(this,B).formatMessage({id:"demos.editing.create.featureCreated"},{featureId:n.featureId})}),(e?.olLayer).getSource()?.refresh()}).catch(n=>{console.error(n)}).finally(()=>{l(this,I).value=!1})}catch(e){l(this,I).value=!1,console.error(e)}}startUpdateWorkflow(){if(!l(this,I).value)try{l(this,I).value=!0,g(this,H,this._createEditingSelectTooltip());const e=l(this,C).layers.getLayerById("krankenhaus"),t=e?.olLayer;g(this,G,new Ei({layers:[t]})),l(this,C).olMap.addInteraction(l(this,G)),l(this,H).element.classList.remove("editing-tooltip-hidden"),g(this,Q,l(this,G).on("select",i=>{const n=i.selected,a=i.deselected;if(n.length!==1||a.length!==0)return;this._stopUpdateSelection();const s=n[0];if(!s)throw Error("feature is undefined");const c=new URL(e.attributes.collectionURL+"/items"),d=l(this,X).updateFeature(l(this,C),c,s);this._watchState(d),d.whenComplete().then(u=>{u&&(l(this,J).notify({level:"info",message:l(this,B).formatMessage({id:"demos.editing.update.featureModified"},{featureId:u.featureId})}),t.getSource()?.refresh())}).catch(u=>{console.error(u)}).finally(()=>{l(this,I).value=!1})}))}catch(e){l(this,I).value=!1,console.error(e)}}_watchState(e){const t=mt(()=>[e.getState()],i=>{i[0]==="active:saving"&&l(this,J).notify({level:"info",message:l(this,B).formatMessage({id:"demos.editing.update.savingStared"})}),i[0]==="destroyed"&&(t.destroy(),console.log("destroyed"))})}_createEditingSelectTooltip(){const e=document.createElement("div");e.className="editing-tooltip editing-tooltip-hidden",e.textContent=l(this,B).formatMessage({id:"demos.editing.update.tooltip.select"});const t=new Zt({element:e,offset:[15,0],positioning:"center-left"}),i=l(this,C).olMap,n=i.on("pointermove",a=>{a.dragging||t.setPosition(a.coordinate)});return i.addOverlay(t),{overlay:t,element:e,destroy(){Be(n),i.removeOverlay(t)}}}_stopUpdateSelection(){l(this,G)&&l(this,C).olMap.removeInteraction(l(this,G)),l(this,Q)&&Be(l(this,Q)),l(this,H)&&l(this,H).destroy(),g(this,G,void 0),g(this,Q,void 0),g(this,H,void 0)}stopEditing(){l(this,X).stop(ke),this._stopUpdateSelection(),l(this,I).value=!1}}I=new WeakMap,C=new WeakMap,X=new WeakMap,J=new WeakMap,B=new WeakMap,G=new WeakMap,Q=new WeakMap,H=new WeakMap;function Dn({editingController:o}){const e=Ie(),t=D(()=>o.editingActive(),[o]),i=t?e.formatMessage({id:"demos.editing.activeInfo"}):e.formatMessage({id:"demos.editing.inactiveInfo"});return r.jsxs(r.Fragment,{children:[r.jsxs(j,{px:1,py:1,children:[r.jsx(ee,{mr:2,isDisabled:t,onClick:()=>{o.startCreateWorkflow()},children:e.formatMessage({id:"demos.editing.startCreateButton"})}),r.jsx(ee,{mr:2,isDisabled:t,onClick:()=>{o.startUpdateWorkflow()},children:e.formatMessage({id:"demos.editing.startUpdateButton"})}),r.jsx(ee,{isDisabled:!t,onClick:()=>{o.stopEditing()},children:e.formatMessage({id:"demos.editing.stopButton"})})]}),r.jsx(j,{px:1,py:1,children:i})]})}function On(o){return[_n(o),mn(o),gn(o),vn(o),wn(o),yn(o),xn(o),Sn(o),Nn(o),kn(o),In(o),En(o),kr(o),Mn(o),jn(o),Er(o)]}const Vn=ye("app::AppModel");var Ke,Ae,Ne,U,L,Ye,Ze,we,mo,go;class Gn{constructor(e,t,i,n){h(this,we);h(this,Ke);h(this,Ae);h(this,Ne);h(this,U);h(this,L);h(this,Ye,Kt(()=>Array.from(l(this,U).values())));h(this,Ze,[]);if(g(this,Ke,e),g(this,Ae,t),g(this,Ne,i),g(this,U,new Map(n.map(s=>[s.id,s]))),l(this,U).size===0)throw new Error("No demos defined.");const a=n[0];g(this,L,M([a,a.createModel()])),y(this,we,mo).call(this),l(this,Ze).push(y(this,we,go).call(this))}destroy(){l(this,L).value[1].destroy?.()}get currentDemo(){return l(this,L).value[0]}get currentDemoModel(){return l(this,L).value[1]}get allDemoInfos(){return l(this,Ye).value}selectDemo(e){const t=l(this,U).get(e);if(!t)throw new Error(`Demo '${e}' does not exist.`);ci(()=>{const[,i]=l(this,L).value;i.destroy?.(),l(this,L).value=[t,t.createModel()]})}}Ke=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,U=new WeakMap,L=new WeakMap,Ye=new WeakMap,Ze=new WeakMap,we=new WeakSet,mo=function(){const t=new URL(window.location.href).searchParams.get("demo");if(t){if(!l(this,U).has(t)){l(this,Ae).notify({title:l(this,Ne).formatMessage({id:"demoSelection.notFound"},{demoId:t})});return}try{this.selectDemo(t)}catch(i){Vn.error("Failed to select demo from URL",i)}}},go=function(){return mt(()=>[l(this,L).value[0].id],([e])=>{const t=new URL(window.location.href);t.searchParams.set("demo",e),window.history.replaceState(null,"",t.toString())},{immediate:!0})};var me,Re,Te,Xe,fo;class Fn{constructor(e){h(this,Xe);h(this,me,M({kind:"loading"}));h(this,Re,[]);h(this,Te,!1);const{mapRegistry:t,httpService:i,notifier:n,vectorSelectionSourceFactory:a,editingService:s,notificationService:c}=e.references,d=e.intl;y(this,Xe,fo).call(this,{mapRegistry:t,httpService:i,notifier:n,vectorSelectionSourceFactory:a,editingService:s,intl:d,notificationService:c}).catch(u=>{l(this,me).value={kind:"error",message:u.message||"Unknown error"}})}destroy(){g(this,Te,!0);for(const e of l(this,Re))e.destroy()}get appState(){return l(this,me).value}}me=new WeakMap,Re=new WeakMap,Te=new WeakMap,Xe=new WeakSet,fo=async function(e){const{mapRegistry:t,httpService:i,notifier:n,vectorSelectionSourceFactory:a,editingService:s,intl:c,notificationService:d}=e,u=await t.getMapModel(ke);if(!u)throw new Error("No mapModel found.");const f=On({intl:c,httpService:i,mapModel:u,vectorSelectionSourceFactory:a,editingService:s,notificationService:d}),p={kind:"ready",appModel:new Gn(u,n,c,f),destroy(){this.appModel.destroy()}};if(l(this,Te)){p.destroy();return}l(this,me).value=p,l(this,Re).push(p)};const te=ye("local-storage"),zn=0,R={CORRUPTED_DATA:"local-storage:corrupted-data",INVALID_PATH:"local-storage:invalid-path",INVALID_VALUE:"local-storage:invalid-value",NOT_SUPPORTED:"local-storage:not-supported",INTERNAL:"local-storage:internal-error"};var ge,P,W,fe,A,x,vo,bo,_e,re,wo;class Bn{constructor(e){h(this,x);h(this,ge);h(this,P,{});h(this,W);h(this,fe);h(this,A);g(this,ge,qn(e.properties)),g(this,W,$n()),l(this,W)&&(y(this,x,bo).call(this),g(this,fe,y(this,x,wo).call(this)))}destroy(){l(this,A)&&(clearTimeout(l(this,A)),g(this,A,void 0)),l(this,W)&&y(this,x,_e).call(this)}get isSupported(){return!!l(this,fe)}get(e){return y(this,x,re).call(this).get(e)}set(e,t){return y(this,x,re).call(this).set(e,t)}remove(e){return y(this,x,re).call(this).remove(e)}removeAll(){return y(this,x,re).call(this).removeAll()}getNamespace(e){return y(this,x,re).call(this).getNamespace(e)}}ge=new WeakMap,P=new WeakMap,W=new WeakMap,fe=new WeakMap,A=new WeakMap,x=new WeakSet,vo=function(){l(this,A)&&clearTimeout(l(this,A)),g(this,A,setTimeout(()=>{g(this,A,void 0),y(this,x,_e).call(this)},zn))},bo=function(){try{const e=l(this,W);if(!e)throw new N(R.INTERNAL,"Local storage is not available.");const t=e.getItem(l(this,ge));if(t==null){g(this,P,{}),y(this,x,_e).call(this);return}try{const i=JSON.parse(t);if(!be(i))throw new N(R.CORRUPTED_DATA,"Persisted value should be an object.");g(this,P,i)}catch(i){te.warn("Invalid persisted data, reverting to default.",i),g(this,P,{}),y(this,x,_e).call(this)}}catch(e){te.error("Failed to load from local storage",e)}},_e=function(){try{const e=l(this,W);if(!e)throw new N(R.INTERNAL,"Local storage is not available.");const t=JSON.stringify(l(this,P));e.setItem(l(this,ge),t)}catch(e){te.error("Failed to save to local storage",e)}},re=function(){const e=l(this,fe);if(!e)throw new N(R.NOT_SUPPORTED,"Local storage is not supported by this browser.");return e},wo=function(){const e={getByPath:t=>Vt(Hn(l(this,P),t)),setByPath:(t,i)=>{if(!Wn(i))throw new N(R.INVALID_VALUE,"The value is not supported by local storage.");if(i=Vt(i),t.length===0){if(!be(i))throw new N(R.INVALID_VALUE,"The root value must be a plain object.");g(this,P,i)}else Un(l(this,P),t,i);y(this,x,vo).call(this)}};return new yt([],e)};class yt{path;access;constructor(e,t){this.path=e,this.access=t}get(e){return this.access.getByPath([...this.path,e])}set(e,t){this.access.setByPath([...this.path,e],t)}remove(e){this.access.setByPath([...this.path,e],void 0)}removeAll(){this.access.setByPath(this.path,{})}getNamespace(e){const t=this.get(e);if(t===void 0)this.set(e,{});else if(!be(t))throw new N(R.INVALID_PATH,`Cannot use '${e}' as a namespace because it is not associated with an object.`);return new yt(this.path.concat([e]),this.access)}}const Ot="trails-state";function Hn(o,e){let t=o;for(const i of e){if(!be(t))throw new N(R.INVALID_PATH,`Cannot get nested property '${i}' because the parent is no object.`);t=t[i]}return t}function Un(o,e,t){if(!e.length)throw new N(R.INTERNAL,"Path must not be empty.");let i=o;for(let a=0,s=e.length-1;a"u"){te.warn("Local storage is not supported by this browser.");return}try{const o=globalThis.localStorage;if(!o){te.warn("Local storage is not supported by this browser.");return}return o}catch(o){te.warn("Local storage is not supported by this browser.",o);return}}function Vt(o){return o!=null&&(o=JSON.parse(JSON.stringify(o))),o}const Kn={"showcase-app":{name:"showcase-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:fr,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},AppInitModel:{name:"AppInitModel",clazz:Fn,provides:[{name:"app.AppInitModel",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1},mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},notifier:{name:"notifier.NotificationService",qualifier:void 0,all:!1},vectorSelectionSourceFactory:{name:"selection.VectorSelectionSourceFactory",qualifier:void 0,all:!1},editingService:{name:"editing.EditingService",qualifier:void 0,all:!1},notificationService:{name:"notifier.NotificationService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"app.AppInitModel",qualifier:void 0,all:!1},{name:"runtime.ApplicationContext",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:di,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:Yi,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:ui,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:Fi,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:zi,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/coordinate-viewer":{name:"@open-pioneer/coordinate-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-bar":{name:"@open-pioneer/scale-bar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-viewer":{name:"@open-pioneer/scale-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/overview-map":{name:"@open-pioneer/overview-map",services:{},ui:{references:[]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/editing":{name:"@open-pioneer/editing",services:{EditingServiceImpl:{name:"EditingServiceImpl",clazz:Mi,provides:[{name:"editing.EditingService",qualifier:void 0}],references:{mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{polygonStyle:{value:{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"red","stroke-width":1.25,"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1},vertexStyle:{value:{"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1}}},"@open-pioneer/legend":{name:"@open-pioneer/legend",services:{},ui:{references:[]},properties:{}},"@open-pioneer/measurement":{name:"@open-pioneer/measurement",services:{},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:Zi,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/selection":{name:"@open-pioneer/selection",services:{VectorSelectionSourceFactory:{name:"VectorSelectionSourceFactory",clazz:_i,provides:[{name:"selection.VectorSelectionSourceFactory",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/search":{name:"@open-pioneer/search",services:{},ui:{references:[]},properties:{}},"@open-pioneer/coordinate-search":{name:"@open-pioneer/coordinate-search",services:{},ui:{references:[{name:"runtime.NumberParserService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/geolocation":{name:"@open-pioneer/geolocation",services:{},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/scale-setter":{name:"@open-pioneer/scale-setter",services:{},ui:{references:[]},properties:{}},"@open-pioneer/spatial-bookmarks":{name:"@open-pioneer/spatial-bookmarks",services:{},ui:{references:[{name:"local-storage.LocalStorageService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/local-storage":{name:"@open-pioneer/local-storage",services:{LocalStorageServiceImpl:{name:"LocalStorageServiceImpl",clazz:Bn,provides:[{name:"local-storage.LocalStorageService",qualifier:"local-storage.LocalStorageService"}],references:{}}},ui:{references:[]},properties:{storageId:{value:null,required:!1}}}},Yn=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.editing-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.editing-tooltip-hidden{visibility:hidden}.measurement-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.measurement-active-tooltip{background:#000000e6;border-radius:4px;border-color:#000000e6;opacity:.9;color:#fff}.measurement-finished-tooltip{background-color:#4cb3ffe6;color:#000;border:1px solid white}.measurement-active-tooltip:before,.measurement-finished-tooltip:before{border-top:6px solid rgba(0,0,0,.9);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.measurement-finished-tooltip:before{border-top-color:#4cb3ff}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}.selection-drag-box{background-color:#ffffff4d!important;border:3px solid var(--chakra-colors-background_primary)!important}.selection-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.selection .react-select{cursor:default}.map-container .selection-active{cursor:crosshair}.map-container .selection-inactive{cursor:no-drop}.selection-source-value.selection-source-value--disabled{opacity:.4}.selection-source-value.selection-source-value--disabled span{margin:0 6px 0 0}.search-component .chakra-divider{display:none}.search-component .search-highlighted-match{font-weight:700}.search-component .search-value-container{cursor:text;padding-left:30px!important}.search-component .search-invisible{display:none}.map-anchor.main-map-anchor{overflow-x:hidden;overflow-y:auto}.map-container:focus-visible{outline:none}.map-container:focus-visible:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:3px solid var(--chakra-colors-trails-500)}@media screen and (max-width: 48em){.map-anchor.main-map-anchor{max-height:45%}}.scale-bar .ol-scale-bar{margin-bottom:8px;margin-right:8px}.scale-bar .ol-scale-bar,.scale-bar .ol-scale-line{position:relative;bottom:0;left:0;background:none}.scale-bar .ol-scale-bar .ol-scale-bar-inner,.scale-bar .ol-scale-bar .ol-scale-line-inner,.scale-bar .ol-scale-line .ol-scale-bar-inner,.scale-bar .ol-scale-line .ol-scale-line-inner{color:var(--chakra-white);border-color:var(--chakra-white)}.overview-map .ol-overviewmap{position:relative;height:100%;width:100%}.overview-map .ol-overviewmap:not(.ol-collapsed){border:1px solid black}.overview-map .ol-overviewmap .ol-overviewmap-map{border:none;width:100%;height:100%}.overview-map .ol-overviewmap .ol-overviewmap-box{border:2px solid red}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',Zn=["en","de"];function Xn(o){switch(o){case"en":return Ct(()=>import("./pazOBFR22sbz.js"),[],import.meta.url).then(e=>e.default);case"de":return Ct(()=>import("./CI5dqHk8x18v.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${o}'`)}const Jn=jo(Yn),Qn=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:Xn,locales:Zn,packages:Kn,styles:Jn},Symbol.toStringTag,{value:"Module"}));function yo({label:o,children:e}){return r.jsxs(Xi,{as:Ji,maxWidth:{base:"none",md:"20em"},width:{base:"100%",sm:"47%",md:void 0},children:[r.jsx(Qi,{flexBasis:{base:"8em",sm:"auto"},m:0,children:o}),e]})}const ea=ye("app::DemoSelection");function ta({appModel:o}){const e=Ie(),{allDemos:t,currentDemo:i}=D(()=>({allDemos:o.allDemoInfos,currentDemo:o.currentDemo}),[o]),n=v.useMemo(()=>t.map(a=>r.jsx("option",{value:a.id,children:a.title},a.id)),[t]);return r.jsx(yo,{label:e.formatMessage({id:"demoSelection.label"}),children:r.jsx(Jt,{value:i.id,onChange:a=>{const s=a.target.value;try{o.selectDemo(s)}catch(c){ea.error("Failed to select demo",c)}},children:n})})}function oa(){const o=Ie(),e=ho("runtime.ApplicationContext"),t=ia(e.getLocale()),i=n=>{switch(n){case"en":e.setLocale("en-GB");break;case"de":e.setLocale("de-DE");break}};return r.jsx(yo,{label:o.formatMessage({id:"localeSwitcher.label"}),children:r.jsxs(Jt,{value:t,onChange:n=>i(n.target.value),children:[r.jsx("option",{value:"de",children:o.formatMessage({id:"localeSwitcher.locale.de"})}),r.jsx("option",{value:"en",children:o.formatMessage({id:"localeSwitcher.locale.en"})})]})})}function ia(o){const e=o.match(/^[a-z]+/i)?.[0];if(e==="en"||e=="de")return e;throw new Error("unexpected locale prefix: "+e)}function ra({appModel:o}){const e=Ie();return r.jsxs(j,{as:"header",px:2,py:3,flexWrap:{base:"wrap",md:"nowrap"},alignItems:"baseline",gap:2,boxShadow:"1px 0px 3px rgba(0, 0, 0, 0.5)",bgColor:"white",zIndex:100,children:[r.jsx(ct,{size:"md",flexShrink:0,flexGrow:1,textAlign:{base:"center",md:"left"},width:{base:"100%",md:"auto"},mb:{base:2,md:0},children:e.formatMessage({id:"header.title"})}),r.jsx(ta,{appModel:o}),r.jsx(oa,{})]})}function na(){const o=ho("app.AppInitModel"),e=D(()=>o.appState,[o]);let t;switch(e.kind){case"loading":t="Loading...";break;case"error":t="Error: "+e.message;break;case"ready":t=r.jsx(aa,{state:e})}return t}function aa(o){const e=Ie(),t=o.state.appModel,{currentDemo:i,currentDemoModel:n}=D(()=>({currentDemo:t.currentDemo,currentDemoModel:t.currentDemoModel}),[t]),a=D(()=>n.listContainer,[n]),s=v.useMemo(()=>({left:0,right:0,bottom:a!=null?400:0,top:0}),[a]);return r.jsxs(r.Fragment,{children:[r.jsx(Ci,{position:"top-right"}),r.jsx(j,{height:"100%",direction:"column",children:r.jsx(He,{title:r.jsx(ra,{appModel:t}),children:r.jsx(j,{flex:"1",direction:"column",position:"relative",children:r.jsx(pi,{mapId:ke,children:r.jsxs(hi,{viewPadding:s,role:"main","aria-label":e.formatMessage({id:"ariaLabels.map"}),children:[r.jsx(_t,{className:"main-map-anchor",position:"top-left",horizontalGap:10,verticalGap:10,children:r.jsx(T,{bgColor:"white",borderRadius:10,p:2,maxW:"500px",children:r.jsxs(He,{title:i.title,sectionHeadingProps:{size:"lg"},children:[r.jsx(et,{py:4,dangerouslySetInnerHTML:{__html:n.description}}),n.mainWidget]})})}),r.jsx(_t,{position:"bottom-right",horizontalGap:6,children:r.jsx(lt,{p:1,children:n.tools})}),a&&r.jsx(T,{className:"list-container",position:"absolute",bottom:"0",backgroundColor:"white",width:"100%",height:"400px",zIndex:1,borderTop:"2px solid",borderColor:"trails.100",children:a})]})})})})})]})}const sa=new URLSearchParams(window.location.search),la=sa.get("lang")||void 0,ca=Lo({component:na,appMetadata:Qn,config:{properties:{"@open-pioneer/local-storage":{storageId:"ol-showcase-state"}},locale:la}});customElements.define("showcase-app",ca); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/DyxVjgSvwe-K.js b/openlayers-base-packages/pr-previews/pr-377/assets/DyxVjgSvwe-K.js deleted file mode 100644 index 5e3c7eb..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/DyxVjgSvwe-K.js +++ /dev/null @@ -1,20 +0,0 @@ -var A0=Object.defineProperty;var Vc=i=>{throw TypeError(i)};var L0=(i,t,e)=>t in i?A0(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Li=(i,t,e)=>L0(i,typeof t!="symbol"?t+"":t,e),Eh=(i,t,e)=>t.has(i)||Vc("Cannot "+e);var v=(i,t,e)=>(Eh(i,t,"read from private field"),e?e.call(i):t.get(i)),D=(i,t,e)=>t.has(i)?Vc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),U=(i,t,e,n)=>(Eh(i,t,"write to private field"),n?n.call(i,e):t.set(i,e),e),j=(i,t,e)=>(Eh(i,t,"access private method"),e);var Kc=(i,t,e,n)=>({set _(s){U(i,t,s,e)},get _(){return v(i,t,n)}});import{h as P0,j as Ie,g as Hh,c as Ii,x as Ld,i as Fr,r as gt,ai as O0,aj as D0,a0 as N0,B as F0,ak as Pd,E as k0,al as G0,am as Zc,d as z0,e as $c,an as W0,y as B0}from"./DbBkdn6FNbgs.js";const $a=Symbol("EventEmitterState");class Od{[$a]=new U0;on(t,e){return this[$a].on(t,{listener:e})}once(t,e){return this[$a].on(t,{listener:e,once:!0})}emit(t,...e){this[$a].emit(t,e[0])}}class U0{handlers=new Map;on(t,e){let n=this.handlers.get(t);return n||(n=new Set,this.handlers.set(t,n)),n.add(e),{destroy(){e.removed=!0,n?.delete(e),n=void 0}}}emit(t,e){const n=this.handlers.get(t);if(!n)return;const s=[...n];for(const r of s)r.removed||(r.once&&(r.removed=!0,n.delete(r)),r.listener(e))}}const j0=P0(function(t,e){const{direction:n,align:s,justify:r,wrap:a,basis:o,grow:h,shrink:l,...c}=t,u={display:"flex",flexDirection:n,alignItems:s,justifyContent:r,flexWrap:a,flexBasis:o,flexGrow:h,flexShrink:l};return Ie.jsx(Hh.div,{ref:e,__css:u,...c})});j0.displayName="Flex";var X0=Symbol.for("preact-signals");function Ho(){if(tn>1)tn--;else{for(var i,t=!1;Ir!==void 0;){var e=Ir;for(Ir=void 0,Jh++;e!==void 0;){var n=e.o;if(e.o=void 0,e.f&=-3,!(8&e.f)&&Nd(e))try{e.c()}catch(s){t||(i=s,t=!0)}e=n}}if(Jh=0,tn--,t)throw i}}function q0(i){if(tn>0)return i();tn++;try{return i()}finally{Ho()}}var ft=void 0;function Ta(i){var t=ft;ft=void 0;try{return i()}finally{ft=t}}var Ir=void 0,tn=0,Jh=0,Mo=0;function Dd(i){if(ft!==void 0){var t=i.n;if(t===void 0||t.t!==ft)return t={i:0,S:i,p:ft.s,n:void 0,t:ft,e:void 0,x:void 0,r:t},ft.s!==void 0&&(ft.s.n=t),ft.s=t,i.n=t,32&ft.f&&i.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=ft.s,t.n=void 0,ft.s.n=t,ft.s=t),t}}function ee(i){this.v=i,this.i=0,this.n=void 0,this.t=void 0}ee.prototype.brand=X0;ee.prototype.h=function(){return!0};ee.prototype.S=function(i){this.t!==i&&i.e===void 0&&(i.x=this.t,this.t!==void 0&&(this.t.e=i),this.t=i)};ee.prototype.U=function(i){if(this.t!==void 0){var t=i.e,e=i.x;t!==void 0&&(t.x=e,i.e=void 0),e!==void 0&&(e.e=t,i.x=void 0),i===this.t&&(this.t=e)}};ee.prototype.subscribe=function(i){var t=this;return Pl(function(){var e=t.value,n=ft;ft=void 0;try{i(e)}finally{ft=n}})};ee.prototype.valueOf=function(){return this.value};ee.prototype.toString=function(){return this.value+""};ee.prototype.toJSON=function(){return this.value};ee.prototype.peek=function(){var i=ft;ft=void 0;try{return this.value}finally{ft=i}};Object.defineProperty(ee.prototype,"value",{get:function(){var i=Dd(this);return i!==void 0&&(i.i=this.i),this.v},set:function(i){if(i!==this.v){if(Jh>100)throw new Error("Cycle detected");this.v=i,this.i++,Mo++,tn++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ho()}}}});function Tl(i){return new ee(i)}function Nd(i){for(var t=i.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Fd(i){for(var t=i.s;t!==void 0;t=t.n){var e=t.S.n;if(e!==void 0&&(t.r=e),t.S.n=t,t.i=-1,t.n===void 0){i.s=t;break}}}function kd(i){for(var t=i.s,e=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}i.s=e}function Qs(i){ee.call(this,void 0),this.x=i,this.s=void 0,this.g=Mo-1,this.f=4}(Qs.prototype=new ee).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Mo))return!0;if(this.g=Mo,this.f|=1,this.i>0&&!Nd(this))return this.f&=-2,!0;var i=ft;try{Fd(this),ft=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ft=i,kd(this),this.f&=-2,!0};Qs.prototype.S=function(i){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ee.prototype.S.call(this,i)};Qs.prototype.U=function(i){if(this.t!==void 0&&(ee.prototype.U.call(this,i),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Qs.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;i!==void 0;i=i.x)i.t.N()}};Object.defineProperty(Qs.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=Dd(this);if(this.h(),i!==void 0&&(i.i=this.i),16&this.f)throw this.v;return this.v}});function Al(i){return new Qs(i)}function Gd(i){var t=i.u;if(i.u=void 0,typeof t=="function"){tn++;var e=ft;ft=void 0;try{t()}catch(n){throw i.f&=-2,i.f|=8,Ll(i),n}finally{ft=e,Ho()}}}function Ll(i){for(var t=i.s;t!==void 0;t=t.n)t.S.U(t);i.x=void 0,i.s=void 0,Gd(i)}function Y0(i){if(ft!==this)throw new Error("Out-of-order effect");kd(this),ft=i,this.f&=-2,8&this.f&&Ll(this),Ho()}function Aa(i){this.x=i,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Aa.prototype.c=function(){var i=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{i()}};Aa.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Gd(this),Fd(this),tn++;var i=ft;return ft=this,Y0.bind(this,i)};Aa.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ir,Ir=this)};Aa.prototype.d=function(){this.f|=8,1&this.f||Ll(this)};function Pl(i){var t=new Aa(i);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function V0(i){let t;return{destroy:Pl(function(){this[K0]=i.bind(void 0),t=this[Z0].bind(this)}),start:t}}var K0="N",Z0="S",Hc="S",Jc="U";function $0(i,t){const e=Al(i),n=e[Hc],s=e[Jc];let r=0,a;return e[Hc]=function(h){n.call(this,h),r++===0&&(a=t())},e[Jc]=function(h){s.call(this,h),--r===0&&(a?.(),a=void 0)},e}function Kt(i,t){return new Q0(i,t?.equal)}function kr(i,t){return new J0(i,t?.equal)}function H0(i,t){const e=Tl(!1),n=()=>{e.value=!e.peek()},s=kr(()=>(e.value,Ta(()=>i())),t);return s.trigger=n,s}function br(i,t){return new e_(i,t)}function Ol(i){return q0(i)}function zd(i){return Ta(i)}var Jn=Symbol("signal"),Tr=Symbol("equals"),Dl=class{[Jn];constructor(i){this[Jn]=i}get value(){return this[Jn].value}set value(i){throw new Error("Cannot update a readonly reactive object.")}trigger(){throw new Error("Cannot trigger this reactive object.")}peek(){return this[Jn].peek()}toJSON(){return this.value}toString(){return`Reactive[value=${n_(this[Jn].value)}]`}},J0=class extends Dl{[Tr];constructor(i,t){const e=Al(t?i_(i,t):i);super(e),this[Tr]=t}},Q0=class extends Dl{[Tr];constructor(i,t){super(Tl(i)),this[Tr]=t}get value(){return super.value}set value(i){Ta(()=>this[Tr]?.(this.value,i))||(this[Jn].value=i)}},Ha=Symbol("invalidate_signal"),Ja=Symbol("is_watched"),t_=Symbol("has_scheduled_invalidate"),Sd,Rd,Cd,Id,ys,bd,e_=(bd=class extends(Id=Dl,Cd=Ha,Rd=Ja,Sd=t_,Id){constructor(t,e){const n=$0(()=>(this[Ha].value,this[Ja]||v(this,ys).call(this),Ta(()=>t())),()=>{this[Ja]=!0;const s=e(v(this,ys));return()=>{this[Ja]=!1,s(),v(this,ys).call(this)}});super(n);Li(this,Cd,Tl(!1));Li(this,Rd,!1);Li(this,Sd,!1);D(this,ys,()=>{this[Ha].value=!this[Ha].peek()})}},ys=new WeakMap,bd);function i_(i,t){let e=!0,n;return function(){const r=i();return Ta(()=>((e||!t(n,r))&&(n=r,e=!1),n))}}function n_(i){return typeof i=="string"?JSON.stringify(i):String(i)}function Wd(i,t){return i===t?!0:i.length===t.length&&i.every((e,n)=>e===t[n])}function Bd(i,t,e,n){const s=Al(t),r=n?.immediate??!1,a=n?.equal??s_;let o=!0,h,l;function c(){const f=l;l=void 0;try{f?.()}catch(g){throw d.destroy(),g}}const u=i(()=>{const f=s.value;zd(()=>{const g=h,_=o&&r||!o&&!a(g,f);(_||o)&&(h=f,o=!1),_&&(c(),l=e(f,g))})}),d={destroy(){try{c()}finally{u.destroy()}}};return d}function s_(i,t){return i===t}function r_(i){return{destroy:Pl(i)}}function GR(i,t,e){return Bd(r_,i,t,{equal:Wd,...e})}function Ud(i){Promise.reject(new Error("Error in effect or watch callback",{cause:i}))}var a_=class{queue=[];channel=new MessageChannel;constructor(){this.channel.port2.start()}enqueue(i){const t={fn:i,destroyed:!1};return this.queue.push(t),this.queue.length===1&&this.scheduleIteration(),{destroy(){t.destroyed||(t.destroyed=!0)}}}messageHandler=()=>this.runIteration();scheduleIteration(){const i=this.channel;i.port2.addEventListener("message",this.messageHandler),i.port1.postMessage("")}runIteration(){this.channel.port2.removeEventListener("message",this.messageHandler);const i=this.queue;this.queue=[];for(const t of i)if(!t.destroyed)try{t.fn()}catch(e){Ud(e)}}};function o_(i){const t=new h_(i);return{destroy:t.destroy.bind(t)}}var h_=class{callback;cleanup;watcher;scheduledExecution;isDestroyed=!1;initialExecution=!0;isExecuting=!1;constructor(i){this.callback=i,this.watcher=V0(this.scheduleExecution),this.execute(),this.initialExecution=!1}destroy(){if(!this.isDestroyed){this.isDestroyed=!0;try{this.triggerCleanup()}finally{this.watcher?.destroy(),this.watcher=void 0,this.scheduledExecution?.destroy(),this.scheduledExecution=void 0}}}execute(){const i=this.watcher;if(!i)return;this.isExecuting=!0;const t=i.start();try{if(this.initialExecution)try{this.triggerCallback()}catch(e){throw this.destroy(),e}else try{this.triggerCallback()}catch(e){Ud(e)}}finally{t(),this.isExecuting=!1}this.isDestroyed&&this.triggerCleanup()}triggerCallback(){if(!this.isDestroyed){this.triggerCleanup();const i=this.callback();typeof i=="function"&&(this.cleanup=i)}}triggerCleanup(){const i=this.cleanup;this.cleanup=void 0;try{i&&zd(i)}catch(t){throw this.destroy(),t}}scheduleExecution=()=>{if(!this.isDestroyed){if(this.isExecuting)throw new Error("Cycle detected");this.scheduledExecution||(this.scheduledExecution=u_(()=>{try{this.execute()}finally{this.scheduledExecution=void 0}}))}}};function l_(i,t,e){return Bd(o_,i,t,{equal:Wd,...e})}var c_=new a_;function u_(i){return c_.enqueue(i)}function jd(i){return new d_(i)}var Yt,ps,Gt,Gi,go,Xd,qd,Td,d_=(Td=class{constructor(i){D(this,Gt);D(this,Yt,new Map);D(this,ps,Kt(!1));if(i)for(const[t,e]of i)v(this,Yt).set(t,Kt(e))}get size(){return j(this,Gt,Gi).call(this),v(this,Yt).size}forEach(i){j(this,Gt,Gi).call(this);const t=v(this,Yt).entries();for(const[e,n]of t)i(n.value,e)}entries(){return j(this,Gt,Gi).call(this),j(this,Gt,Xd).call(this)}keys(){return j(this,Gt,Gi).call(this),v(this,Yt).keys()}values(){return j(this,Gt,Gi).call(this),j(this,Gt,qd).call(this)}[Symbol.iterator](){return this.entries()}clear(){const i=!!v(this,Yt).size;v(this,Yt).clear(),i&&j(this,Gt,go).call(this)}delete(i){const t=v(this,Yt).delete(i);return t&&j(this,Gt,go).call(this),t}get(i){return j(this,Gt,Gi).call(this),v(this,Yt).get(i)?.value}has(i){return j(this,Gt,Gi).call(this),v(this,Yt).has(i)}set(i,t){const e=v(this,Yt).get(i);return e?e.value=t:(v(this,Yt).set(i,Kt(t)),j(this,Gt,go).call(this)),this}},Yt=new WeakMap,ps=new WeakMap,Gt=new WeakSet,Gi=function(){v(this,ps).value},go=function(){v(this,ps).value=!v(this,ps).peek()},Xd=function*(){const i=v(this,Yt).entries();for(const[t,e]of i)yield[t,e.value]},qd=function*(){const i=v(this,Yt).values();for(const t of i)yield t.value},Td);function f_(i){return new g_(i)}var Pe,Ad,g_=(Ad=class{constructor(i){D(this,Pe);U(this,Pe,jd(i?__(i):void 0))}get size(){return v(this,Pe).size}clear(){v(this,Pe).clear()}has(i){return v(this,Pe).has(i)}add(i){return v(this,Pe).set(i,void 0),this}delete(i){return v(this,Pe).delete(i)}forEach(i){v(this,Pe).forEach((t,e)=>i(e,e))}entries(){return m_(this.values())}values(){return v(this,Pe).keys()}[Symbol.iterator](){return this.values()}},Pe=new WeakMap,Ad);function*__(i){for(const t of i)yield[t,void 0]}function*m_(i){for(const t of i)yield[t,t]}function dr(i){return new y_(i)}var Et,vs,rt,gn,_o,Yd,Vd,Le,_n,xs,y_=(xs=class{constructor(t){D(this,rt);D(this,Et);D(this,vs,Kt(!1));U(this,Et,t?Array.from(t).map(e=>Kt(e)):[])}get length(){return j(this,rt,Le).call(this),v(this,Et).length}push(...t){v(this,Et).push(...t.map(e=>Kt(e))),j(this,rt,_n).call(this)}pop(){if(v(this,Et).length===0)return;const t=v(this,Et).pop();return j(this,rt,_n).call(this),t.value}unshift(...t){v(this,Et).unshift(...t.map(e=>Kt(e))),j(this,rt,_n).call(this)}shift(){if(v(this,Et).length===0)return;const t=v(this,Et).shift();return j(this,rt,_n).call(this),t.value}splice(t,e,...n){const s=v(this,Et).splice(t,e??v(this,Et).length,...n.map(r=>Kt(r)));return(n!=null&&n.length!==0||s.length!==0)&&j(this,rt,_n).call(this),s.map(r=>r.value)}sort(t){v(this,Et).sort((e,n)=>t(e.value,n.value)),j(this,rt,_n).call(this)}getItems(){return j(this,rt,Le).call(this),v(this,Et).map(t=>t.value)}at(t){return j(this,rt,Le).call(this),v(this,Et).at(t)?.value}get(t){return j(this,rt,Le).call(this),v(this,Et)[t]?.value}set(t,e){if(t<0||t>=v(this,Et).length)throw new Error("index out of bounds");const n=v(this,Et)[t];n.value=e}slice(...t){j(this,rt,Le).call(this);const e=v(this,Et).slice(...t).map(n=>n.value);return dr(e)}concat(...t){const e=this.getItems().concat(...t.map(n=>n instanceof xs?n.getItems():n));return dr(e)}includes(t,e){return j(this,rt,gn).call(this,n=>n===t,e)!==-1}indexOf(t,e){return j(this,rt,gn).call(this,n=>n===t,e)}lastIndexOf(t){return j(this,rt,_o).call(this,e=>e===t)}find(t){const e=j(this,rt,gn).call(this,t);return this.get(e)}findLast(t){const e=j(this,rt,_o).call(this,t);return this.get(e)}findIndex(t){return j(this,rt,gn).call(this,t)}findLastIndex(t){return j(this,rt,_o).call(this,t)}some(t){return j(this,rt,gn).call(this,t)!==-1}every(t){return j(this,rt,gn).call(this,(e,n)=>!t(e,n))===-1}forEach(t){for(const[e,n]of this.entries())t(n,e)}filter(t){return dr(this.getItems().filter((e,n)=>t(e,n)))}map(t){return dr(this.getItems().map((e,n)=>t(e,n)))}flatMap(t){return dr(this.getItems().flatMap((e,n)=>t(e,n)))}reduce(t,...e){return j(this,rt,Le).call(this),v(this,Et).reduce((n,s,r)=>t(n,s.value,r),...e)}reduceRight(t,...e){return j(this,rt,Le).call(this),v(this,Et).reduceRight((n,s,r)=>t(n,s.value,r),...e)}keys(){return j(this,rt,Le).call(this),v(this,Et).keys()}values(){return j(this,rt,Le).call(this),j(this,rt,Yd).call(this)}entries(){return j(this,rt,Le).call(this),j(this,rt,Vd).call(this)}[Symbol.iterator](){return this.values()}},Et=new WeakMap,vs=new WeakMap,rt=new WeakSet,gn=function(t,e){for(let n=e??0,s=this.length;n0;){const n=this.get(e);if(t(n,e))return e}return-1},Yd=function*(){for(const t of v(this,Et))yield t.value},Vd=function*(){for(const[t,e]of v(this,Et).entries())yield[t,e.value]},Le=function(){v(this,vs).value},_n=function(){v(this,vs).value=!v(this,vs).peek()},xs);class Jo{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}class ri{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function p_(i,t,e){let n,s;e=e||vi;let r=0,a=i.length,o=!1;for(;r>1),s=+e(i[n],t),s<0?r=n+1:(a=n,o=!s);return o?r:~r}function vi(i,t){return i>t?1:i0?s-1:s}return n-1}if(e>0){for(let s=1;s0||a===0)})}function Gr(){return!0}function La(){return!1}function Gs(){}function Kd(i){let t,e,n;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==n||!on(s,e))&&(n=this,e=s,t=i.apply(this,arguments)),t}}function Zd(i){function t(){let e;try{e=i()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function Pa(i){for(const t in i)delete i[t]}function zs(i){let t;for(t in i)return!1;return!t}class Oa extends Jo{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),s=n[t]||(n[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",n=e?t:t.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=e?new ri(t):t;r.target||(r.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});n in a||(a[n]=0,o[n]=0),++a[n];let h;for(let l=0,c=s.length;l0:!1}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const s=n.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[s]=Gs,++this.pendingRemovals_[t]):(n.splice(s,1),n.length===0&&delete this.listeners_[t]))}}const $={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function at(i,t,e,n,s){if(s){const a=e;e=function(){i.removeEventListener(t,e),a.apply(n??this,arguments)}}else n&&n!==i&&(e=e.bind(n));const r={target:i,type:t,listener:e};return i.addEventListener(t,e),r}function wo(i,t,e,n){return at(i,t,e,n,!0)}function vt(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),Pa(i))}class Da extends Oa{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent($.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,s=new Array(n);for(let r=0;r1?(e=s,n=r):h>0&&(e+=a*h,n+=o*h)}return ds(i,t,e,n)}function ds(i,t,e,n){const s=e-i,r=n-t;return s*s+r*r}function w_(i){const t=i.length;for(let n=0;nr&&(r=h,s=o)}if(r===0)return null;const a=i[s];i[s]=i[n],i[n]=a;for(let o=n+1;o=0;n--){e[n]=i[n][t]/i[n][n];for(let s=n-1;s>=0;s--)i[s][t]-=i[s][n]*e[n]}return e}function tu(i){return i*180/Math.PI}function xi(i){return i*Math.PI/180}function fs(i,t){const e=i%t;return e*t<0?e+t:e}function ge(i,t,e){return i+e*(t-i)}function eh(i,t){const e=Math.pow(10,t);return Math.round(i*e)/e}function eu(i,t){return Math.round(eh(i,t))}function ss(i,t){return Math.floor(eh(i,t))}function Hi(i,t){return Math.ceil(eh(i,t))}class $d extends ai{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[mt.OPACITY]=t.opacity!==void 0?t.opacity:1,ht(typeof e[mt.OPACITY]=="number","Layer opacity must be a number"),e[mt.VISIBLE]=t.visible!==void 0?t.visible:!0,e[mt.Z_INDEX]=t.zIndex,e[mt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[mt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[mt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[mt.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},n=this.getZIndex();return e.opacity=Mt(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=n===void 0&&!e.managed?1/0:n,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return ot()}getLayerStatesArray(t){return ot()}getExtent(){return this.get(mt.EXTENT)}getMaxResolution(){return this.get(mt.MAX_RESOLUTION)}getMinResolution(){return this.get(mt.MIN_RESOLUTION)}getMinZoom(){return this.get(mt.MIN_ZOOM)}getMaxZoom(){return this.get(mt.MAX_ZOOM)}getOpacity(){return this.get(mt.OPACITY)}getSourceState(){return ot()}getVisible(){return this.get(mt.VISIBLE)}getZIndex(){return this.get(mt.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(mt.EXTENT,t)}setMaxResolution(t){this.set(mt.MAX_RESOLUTION,t)}setMinResolution(t){this.set(mt.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(mt.MAX_ZOOM,t)}setMinZoom(t){this.set(mt.MIN_ZOOM,t)}setOpacity(t){ht(typeof t=="number","Layer opacity must be a number"),this.set(mt.OPACITY,t)}setVisible(t){this.set(mt.VISIBLE,t)}setZIndex(t){this.set(mt.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const be={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},Ft={ANIMATING:0,INTERACTING:1},Ae={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},S_=42,Nl=256,zr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};let Fl=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||zr[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}};const Na=6378137,rs=Math.PI*Na,R_=[-rs,-rs,rs,rs],C_=[-180,-85,180,85],Qa=Na*Math.log(Math.tan(Math.PI/2));class jn extends Fl{constructor(t){super({code:t,units:"m",extent:R_,global:!0,worldExtent:C_,getPointResolution:function(e,n){return e/Math.cosh(n[1]/Na)}})}}const iu=[new jn("EPSG:3857"),new jn("EPSG:102100"),new jn("EPSG:102113"),new jn("EPSG:900913"),new jn("http://www.opengis.net/def/crs/EPSG/0/3857"),new jn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function I_(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;rQa?a=Qa:a<-Qa&&(a=-Qa),t[r+1]=a}return t}function b_(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;rs&&(h=h|Nt.RIGHT),or&&(h=h|Nt.ABOVE),h===Nt.UNKNOWN&&(h=Nt.INTERSECTING),h}function me(){return[1/0,1/0,-1/0,-1/0]}function Si(i,t,e,n,s){return s?(s[0]=i,s[1]=t,s[2]=e,s[3]=n,s):[i,t,e,n]}function Fa(i){return Si(1/0,1/0,-1/0,-1/0,i)}function ef(i,t){const e=i[0],n=i[1];return Si(e,n,e,n,t)}function Gl(i,t,e,n,s){const r=Fa(s);return sf(r,i,t,e,n)}function Us(i,t){return i[0]==t[0]&&i[2]==t[2]&&i[1]==t[1]&&i[3]==t[3]}function nf(i,t){return t[0]i[2]&&(i[2]=t[2]),t[1]i[3]&&(i[3]=t[3]),i}function Ar(i,t){t[0]i[2]&&(i[2]=t[0]),t[1]i[3]&&(i[3]=t[1])}function sf(i,t,e,n,s){for(;et[0]?n[0]=i[0]:n[0]=t[0],i[1]>t[1]?n[1]=i[1]:n[1]=t[1],i[2]=t[0]&&i[1]<=t[3]&&i[3]>=t[1]}function Fn(i){return i[2]=a&&_<=h),!n&&r&Nt.RIGHT&&!(s&Nt.RIGHT)&&(m=f-(d-h)*g,n=m>=o&&m<=l),!n&&r&Nt.BELOW&&!(s&Nt.BELOW)&&(_=d-(f-o)/g,n=_>=a&&_<=h),!n&&r&Nt.LEFT&&!(s&Nt.LEFT)&&(m=f-(d-a)*g,n=m>=o&&m<=l)}return n}function z_(i,t,e,n){if(Fn(i))return Fa(e);let s=[];s=[i[0],i[1],i[2],i[1],i[2],i[3],i[0],i[3]],t(s,s,2);const r=[],a=[];for(let o=0,h=s.length;o=e[2])){const s=it(e),a=Math.floor((n[0]-e[0])/s)*s;i[0]-=a,i[2]-=a}return i}function zl(i,t,e){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(i[0])||!isFinite(i[2]))return[[n[0],i[1],n[2],i[3]]];af(i,t);const s=it(n);if(it(i)>s&&!e)return[[n[0],i[1],n[2],i[3]]];if(i[0]n[2])return[[i[0],i[1],n[2],i[3]],[n[0],i[1],i[2]-s,i[3]]]}return[i]}function Wl(i,t){const e=(""+i).split("."),n=(""+t).split(".");for(let s=0;sa)return 1;if(a>r)return-1}return 0}function W_(i,t){return i[0]+=+t[0],i[1]+=+t[1],i}function B_(i,t){const e=i[0],n=i[1],s=t[0],r=t[1],a=s[0],o=s[1],h=r[0],l=r[1],c=h-a,u=l-o,d=c===0&&u===0?0:(c*(e-a)+u*(n-o))/(c*c+u*u||0);let f,g;return d<=0?(f=a,g=o):d>=1?(f=h,g=l):(f=a+d*c,g=o+d*u),[f,g]}function Ro(i,t){let e=!0;for(let n=i.length-1;n>=0;--n)if(i[n]!=t[n]){e=!1;break}return e}function Bl(i,t){const e=Math.cos(t),n=Math.sin(t),s=i[0]*e-i[1]*n,r=i[1]*e+i[0]*n;return i[0]=s,i[1]=r,i}function U_(i,t){return i[0]*=t,i[1]*=t,i}function of(i,t){const e=i[0]-t[0],n=i[1]-t[1];return e*e+n*n}function BR(i,t){return Math.sqrt(of(i,t))}function UR(i,t){return of(i,B_(i,t))}function hf(i,t){if(t.canWrapX()){const e=it(t.getExtent()),n=lf(i,t,e);n&&(i[0]-=n*e)}return i}function lf(i,t,e){const n=t.getExtent();let s=0;return t.canWrapX()&&(i[0]n[2])&&(e=e||it(n),s=Math.floor((i[0]-n[0])/e)),s}const rh=63710088e-1;function el(i,t,e){e=e||rh;const n=xi(i[1]),s=xi(t[1]),r=(s-n)/2,a=xi(t[0]-i[0])/2,o=Math.sin(r)*Math.sin(r)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))}function Mh(i,t){let e=0;for(let n=0,s=i.length;n=h?t[a+l]:o[l]}return e}}function K_(i,t,e,n){const s=yt(i),r=yt(t);Bs(s,r,ru(e)),Bs(r,s,ru(n))}function jR(i,t){return uf(),Xl(i,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function An(i,t){if(i===t)return!0;const e=i.getUnits()===t.getUnits();return(i.getCode()===t.getCode()||ah(i,t)===Ul)&&e}function ah(i,t){const e=i.getCode(),n=t.getCode();let s=Hd(e,n);return s||(s=df),s}function Br(i,t){const e=yt(i),n=yt(t);return ah(e,n)}function Xl(i,t,e){return Br(t,e)(i,void 0,i.length)}function Z_(i,t,e,n){const s=Br(t,e);return z_(i,s,void 0)}let $_=null;function H_(){return $_}function sl(i,t){return i}function gi(i,t){return il&&!Ro(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(il=!1,cf("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function ql(i,t){return i}function $e(i,t){return i}function au(i,t,e){return function(n){let s,r;if(i.canWrapX()){const a=i.getExtent(),o=it(a);n=n.slice(0),r=lf(n,i,o),r&&(n[0]=n[0]-r*o),n[0]=Mt(n[0],a[0],a[2]),n[1]=Mt(n[1],a[1],a[3]),s=e(n)}else s=e(n);return r&&t.canWrapX()&&(s[0]+=r*it(t.getExtent())),s}}function J_(){nl(iu),nl(su),V_(su,iu,I_,b_)}J_();function ou(i,t,e){return function(n,s,r,a,o){if(!n)return;if(!s&&!t)return n;const h=t?0:r[0]*s,l=t?0:r[1]*s,c=o?o[0]:0,u=o?o[1]:0;let d=i[0]+h/2+c,f=i[2]-h/2+c,g=i[1]+l/2+u,_=i[3]-l/2+u;d>f&&(d=(f+d)/2,f=d),g>_&&(g=(_+g)/2,_=g);let m=Mt(n[0],d,f),y=Mt(n[1],g,_);if(a&&e&&s){const p=30*s;m+=-p*Math.log(1+Math.max(0,d-n[0])/p)+p*Math.log(1+Math.max(0,n[0]-f)/p),y+=-p*Math.log(1+Math.max(0,g-n[1])/p)+p*Math.log(1+Math.max(0,n[1]-_)/p)}return[m,y]}}function Q_(i){return i}function Yl(i,t,e,n){const s=it(t)/e[0],r=Tt(t)/e[1];return n?Math.min(i,Math.max(s,r)):Math.min(i,Math.min(s,r))}function Vl(i,t,e){let n=Math.min(i,t);const s=50;return n*=Math.log(1+s*Math.max(0,i/t-1))/s+1,e&&(n=Math.max(n,e),n/=Math.log(1+s*Math.max(0,e/i-1))/s+1),Mt(n,e/2,t*2)}function tm(i,t,e,n){return t=t!==void 0?t:!0,function(s,r,a,o){if(s!==void 0){const h=i[0],l=i[i.length-1],c=e?Yl(h,e,a,n):h;if(o)return t?Vl(s,c,l):Mt(s,l,c);const u=Math.min(c,s),d=Math.floor(Qo(i,u,r));return i[d]>c&&dMath.round(e*cu[n])/cu[n]).join(", ")+")"}function en(i,t,e,n,s,r,a){r=r||[],a=a||2;let o=0;for(let h=t;h{if(!n)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return ot()}closestPointXY(t,e,n,s){return ot()}containsXY(t,e){const n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e}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 ot()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Fa(e),this.extentRevision_=this.getRevision()}return k_(this.extent_,t)}rotate(t,e){ot()}scale(t,e,n){ot()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return ot()}getType(){return ot()}applyTransform(t){ot()}intersectsExtent(t){return ot()}translate(t,e){ot()}transform(t,e){const n=yt(t),s=n.getUnits()=="tile-pixels"?function(r,a,o){const h=n.getExtent(),l=n.getWorldExtent(),c=Tt(l)/Tt(h);return ii(uu,l[0],l[3],c,-c,0,0,0),en(r,0,r.length,o,uu,a),Br(n,e)(r,a,o)}:Br(n,e);return this.applyTransform(s),this}}class $l extends um{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Gl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return ot()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)u=e;else if(d>0){for(let f=0;fs&&(s=l),r=o,a=h}return s}function xf(i,t,e,n,s){for(let r=0,a=e.length;r0;){const u=l.pop(),d=l.pop();let f=0;const g=i[d],_=i[d+1],m=i[u],y=i[u+1];for(let p=d+n;pf&&(c=p,f=M)}f>s&&(h[(c-t)/n]=1,d+n0&&_>f)&&(g<0&&m0&&m>g)){l=u,c=d;continue}r[a++]=l,r[a++]=c,o=l,h=c,l=u,c=d}return r[a++]=l,r[a++]=c,a}function Jl(i,t,e,n,s,r,a,o){for(let h=0,l=e.length;hr&&(l-o)*(r-h)-(s-o)*(c-h)>0&&a++:c<=r&&(l-o)*(r-h)-(s-o)*(c-h)<0&&a--,o=l,h=c}return a!==0}function Ql(i,t,e,n,s,r){if(e.length===0||!pn(i,t,e[0],n,s,r))return!1;for(let a=1,o=e.length;ay&&(l=(c+u)/2,Ql(i,t,e,n,l,g)&&(m=l,y=p)),c=u}return isNaN(m)&&(m=s[r]),a?(a.push(m,g,y),a):[m,g,y]}function vm(i,t,e,n,s){let r=[];for(let a=0,o=e.length;a=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:xm(i,t,e,n,function(a,o){return G_(s,a,o)}):!1}function QR(i,t,e,n,s){for(let r=0,a=e.length;r0}function Af(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,a=e.length;r1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);let s=0;for(;s0}getInteracting(){return this.hints_[Ft.INTERACTING]>0}cancelAnimations(){this.setHint(Ft.ANIMATING,-this.hints_[Ft.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e=0;--n){const s=this.animations_[n];let r=!0;for(let a=0,o=s.length;a0?l/h.duration:1;c>=1?(h.complete=!0,c=1):r=!1;const u=h.easing(c);if(h.sourceCenter){const d=h.sourceCenter[0],f=h.sourceCenter[1],g=h.targetCenter[0],_=h.targetCenter[1];this.nextCenter_=h.targetCenter;const m=d+u*(g-d),y=f+u*(_-f);this.targetCenter_=[m,y]}if(h.sourceResolution&&h.targetResolution){const d=u===1?h.targetResolution:h.sourceResolution+u*(h.targetResolution-h.sourceResolution);if(h.anchor){const f=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(g,h.anchor)}this.nextResolution_=h.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(h.sourceRotation!==void 0&&h.targetRotation!==void 0){const d=u===1?fs(h.targetRotation+Math.PI,2*Math.PI)-Math.PI:h.sourceRotation+u*(h.targetRotation-h.sourceRotation);if(h.anchor){const f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,h.anchor)}this.nextRotation_=h.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!h.complete)break}if(r){this.animations_[n]=null,this.setHint(Ft.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const a=s[0].callback;a&&eo(a,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const s=this.getCenterInternal();return s!==void 0&&(n=[s[0]-e[0],s[1]-e[1]],Bl(n,t-this.getRotation()),W_(n,e)),n}calculateCenterZoom(t,e){let n;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const a=e[0]-t*(e[0]-s[0])/r,o=e[1]-t*(e[1]-s[1])/r;n=[a,o]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],s=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&sl(t,this.getProjection())}getCenterInternal(){return this.get(Ae.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return ql(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();ht(e,"The view center is not defined");const n=this.getResolution();ht(n!==void 0,"The view resolution is not defined");const s=this.getRotation();return ht(s!==void 0,"The view rotation is not defined"),Wr(e,n,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Ae.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal($e(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=it(t)/e[0],s=Tt(t)/e[1];return Math.max(n,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(e/n)/Math.log(t);return function(r){return e/Math.pow(t,r*s)}}getRotation(){return this.get(Ae.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(n/s)/e;return function(a){return Math.log(n/a)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const a=this.getViewportSizeMinusPadding_();s=Sh(s,this.getViewportSize_(),[a[0]/2+r[3],a[1]/2+r[0]],e,n)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,n,s;if(this.resolutions_){const r=Qo(this.resolutions_,t,1);e=r,n=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=n/this.resolutions_[r+1]}else n=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(n/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const e=Mt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Mt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(ht(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){ht(!Fn(t),"Cannot fit empty extent provided as `geometry`");const s=$e(t,this.getProjection());n=_u(s)}else if(t.getType()==="Circle"){const s=$e(t.getExtent(),this.getProjection());n=_u(s),n.rotate(this.getRotation(),Te(s))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),a=t.getStride();let o=1/0,h=1/0,l=-1/0,c=-1/0;for(let u=0,d=r.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof Ce?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let s;e.layerStatesArray?s=e.layerStatesArray.find(a=>a.layer===this):s=this.getLayerState();const r=this.getExtent();return nc(s,e.viewState)&&(!r||Qt(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];const n=t instanceof Ce?t.getViewStateAndExtent():t;let s=e(n);return Array.isArray(s)||(s=[s]),s}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(mt.MAP,t)}getMapInternal(){return this.get(mt.MAP)}setMap(t){this.mapPrecomposeKey_&&(vt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(vt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=at(t,be.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=at(this,$.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,n=this.getLayerState(!1);ht(!e.some(s=>s.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(n)}setSource(t){this.set(mt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function nc(i,t){if(!i.visible)return!1;const e=t.resolution;if(e=i.maxResolution)return!1;const n=t.zoom;return n>i.minZoom&&n<=i.maxZoom}var Bt=[];for(var Rh=0;Rh<256;++Rh)Bt.push((Rh+256).toString(16).slice(1));function Im(i,t=0){return(Bt[i[t+0]]+Bt[i[t+1]]+Bt[i[t+2]]+Bt[i[t+3]]+"-"+Bt[i[t+4]]+Bt[i[t+5]]+"-"+Bt[i[t+6]]+Bt[i[t+7]]+"-"+Bt[i[t+8]]+Bt[i[t+9]]+"-"+Bt[i[t+10]]+Bt[i[t+11]]+Bt[i[t+12]]+Bt[i[t+13]]+Bt[i[t+14]]+Bt[i[t+15]]).toLowerCase()}var io,bm=new Uint8Array(16);function Tm(){if(!io&&(io=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!io))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return io(bm)}var Am=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const mu={randomUUID:Am};function Lm(i,t,e){if(mu.randomUUID&&!t&&!i)return mu.randomUUID();i=i||{};var n=i.random||(i.rng||Tm)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Im(n)}const Pm=Ii("map:AbstractLayerModel");var Es,Ui,na,Ms,ws,Ss,sa,Rs;class Lf extends Od{constructor(e){super();D(this,Es);D(this,Ui);D(this,na);D(this,Ms);D(this,ws);D(this,Ss,jd());D(this,sa);D(this,Rs,!1);U(this,na,e.id??Lm()),U(this,sa,kr(()=>Object.fromEntries(v(this,Ss).entries()))),U(this,Ms,Kt(e.title)),U(this,ws,Kt(e.description??"")),e.attributes&&this.updateAttributes(e.attributes)}get __destroyed(){return v(this,Rs)}get map(){const e=v(this,Es);if(!e)throw new Error(`Layer '${this.id}' has not been attached to a map yet.`);return e}get id(){return v(this,na)}get title(){return v(this,Ms).value}get description(){return v(this,ws).value}get attributes(){return v(this,sa).value}get parent(){return v(this,Ui)}get children(){return this.layers??this.sublayers??void 0}destroy(){if(!v(this,Rs)){U(this,Rs,!0),this.sublayers?.destroy(),this.layers?.destroy();try{this.emit("destroy")}catch(e){Pm.warn("Unexpected error from event listener during layer destruction:",e)}}}__attachToMap(e){if(v(this,Es))throw new Error(`Layer '${this.id}' has already been attached to the map '${this.map.id}'`);U(this,Es,e)}__attachToGroup(e){if(v(this,Ui))throw new Error(`Layer '${this.id}' has already been attached to the group layer '${v(this,Ui).id}'`);U(this,Ui,e)}__detachFromGroup(){U(this,Ui,void 0)}setTitle(e){v(this,Ms).value=e}setDescription(e){v(this,ws).value=e}updateAttributes(e){const n=Reflect.ownKeys(e);Ol(()=>{for(const s of n)v(this,Ss).set(s,e[s])})}deleteAttribute(e){v(this,Ss).delete(e)}}Es=new WeakMap,Ui=new WeakMap,na=new WeakMap,Ms=new WeakMap,ws=new WeakMap,Ss=new WeakMap,sa=new WeakMap,Rs=new WeakMap;const mo=Ii("map:AbstractLayer");var Ve,ra,aa,Cs,wn,Sn,Is;class qs extends Lf{constructor(e){super(e);D(this,Ve);D(this,ra);D(this,aa);D(this,Cs);D(this,wn);D(this,Sn);D(this,Is);U(this,Ve,e.olLayer),U(this,ra,e.isBaseLayer??!1),U(this,aa,e.healthCheck),U(this,Cs,H0(()=>v(this,Ve).getVisible())),U(this,Sn,v(this,Ve).on("change:visible",v(this,Cs).trigger)),U(this,wn,Kt(ol(al(v(this,Ve))))),this.__setVisible(e.visible??!0)}get visible(){return v(this,Cs).value}get olLayer(){return v(this,Ve)}get isBaseLayer(){return v(this,ra)}get loadState(){return v(this,wn).value}destroy(){this.__destroyed||(U(this,Is,Ld(v(this,Is))),v(this,Sn)&&ze(v(this,Sn)),U(this,Sn,void 0),this.olLayer.dispose(),super.destroy())}__attachToMap(e){super.__attachToMap(e);const{initial:n,resource:s}=Om(this,v(this,aa),r=>{v(this,wn).value=r});U(this,Is,s),v(this,wn).value=n}setVisible(e){if(this.isBaseLayer){mo.warn(`Cannot change visibility of base layer '${this.id}': use activateBaseLayer() on the map's LayerCollection instead.`);return}this.__setVisible(e)}__setVisible(e){v(this,Ve).getVisible()!==e&&v(this,Ve).setVisible(e)}}Ve=new WeakMap,ra=new WeakMap,aa=new WeakMap,Cs=new WeakMap,wn=new WeakMap,Sn=new WeakMap,Is=new WeakMap;function Om(i,t,e){const n=i.olLayer;if(!(n instanceof kn))return{initial:"loaded",resource:{destroy(){}}};let s=al(n);const r=ol(s);let a=r,o="loading";r!=="error"&&Dm(i,t).then(u=>{o=u,h()});const h=()=>{const u=ol(s),d=o==="error"?"error":u;a!==d&&(a=d,e(a))};let l;l=s?.on("change",()=>{h()});const c=n.on("change:source",()=>{l&&ze(l),l=void 0,s=al(n),l=s?.on("change",()=>{h()}),h()});return{initial:a,resource:{destroy(){l&&ze(l),ze(c)}}}}async function Dm(i,t){if(t==null)return"loaded";let e;if(typeof t=="function")e=t;else if(typeof t=="string")e=async()=>{const s=await i.map.__sharedDependencies.httpService.fetch(t);return s.ok?"loaded":(mo.warn(`Health check failed for layer '${i.id}' (http status ${s.status})`),"error")};else return mo.error(`Unexpected object for 'healthCheck' parameter of layer '${i.id}'`,t),"error";try{return await e(i)}catch(n){return mo.warn(`Health check failed for layer '${i.id}'`,n),"error"}}function al(i){if(i instanceof kn)return i?.getSource()??void 0}function ol(i){switch(i?.getState()){case void 0:return"loaded";case"undefined":return"not-loaded";case"loading":return"loading";case"ready":return"loaded";case"error":return"error"}}class Nm extends qs{get type(){return"simple"}get legend(){}get layers(){}get sublayers(){}}const sC=Nm;function sc(i,t){return Pf(i,t,[]).join("")}function Pf(i,t,e){if(i.nodeType==Node.CDATA_SECTION_NODE||i.nodeType==Node.TEXT_NODE)e.push(i.nodeValue);else{let n;for(n=i.firstChild;n;n=n.nextSibling)Pf(n,t,e)}return e}function Fm(i){return"documentElement"in i}function km(i){return new DOMParser().parseFromString(i,"application/xml")}function jr(i,t){return function(e,n){const s=i.call(this,e,n);s!==void 0&&n[n.length-1].push(s)}}function ct(i,t,e){return function(n,s){const r=i.call(this,n,s);if(r!==void 0){const a=s[s.length-1],o=n.localName;let h;o in a?h=a[o]:(h=[],a[o]=h),h.push(r)}}}function I(i,t,e){return function(n,s){const r=i.call(this,n,s);if(r!==void 0){const a=s[s.length-1],o=n.localName;a[o]=r}}}function V(i,t,e){e=e!==void 0?e:{};let n,s;for(n=0,s=i.length;n=0}const Wm=V(At,{Service:I(ly),Capability:I(hy)}),Of={Request:I(py),Exception:I(fy),Layer:I(gy)},Bm=V(At,{...Of,UserDefinedSymbolization:I(ay)}),Um=V(At,Of);class jm extends rc{constructor(){super(),this.version=void 0}readFromNode(t){this.version=t.getAttribute("version").trim();const e=J({version:this.version},Wm,t,[]);return e||null}}const Df={Name:I(W),Title:I(W),Abstract:I(W),KeywordList:I(Wf),OnlineResource:I(er),ContactInformation:I(cy),Fees:I(W),AccessConstraints:I(W)},Xm=V(At,Df),qm=V(At,{...Df,LayerLimit:I(Ge),MaxWidth:I(Ge),MaxHeight:I(Ge)}),Ym=V(At,{ContactPersonPrimary:I(uy),ContactPosition:I(W),ContactAddress:I(dy),ContactVoiceTelephone:I(W),ContactFacsimileTelephone:I(W),ContactElectronicMailAddress:I(W)}),Vm=V(At,{ContactPerson:I(W),ContactOrganization:I(W)}),Km=V(At,{AddressType:I(W),Address:I(W),City:I(W),StateOrProvince:I(W),PostCode:I(W),Country:I(W)}),Zm=V(At,{Format:jr(W)}),Nf={Name:I(W),Title:I(W),Abstract:I(W),KeywordList:I(Wf),BoundingBox:ct(Gf),Dimension:ct(_y),Attribution:I(ry),AuthorityURL:ct(Ey),Identifier:ct(W),MetadataURL:ct(My),DataURL:ct(Ri),FeatureListURL:ct(Ri),Style:ct(wy),Layer:ct(oh)},Ff=V(At,{...Nf,SRS:ct(W),Extent:I(my),ScaleHint:ct(yy),LatLonBoundingBox:I((i,t)=>Gf(i,t,!1)),Layer:ct(oh)}),kf=V(At,{...Nf,CRS:ct(W),EX_GeographicBoundingBox:I(oy),MinScaleDenominator:I(vn),MaxScaleDenominator:I(vn),Layer:ct(oh)}),$m=V(At,{Title:I(W),OnlineResource:I(er),LogoURL:I(zf)}),Hm=V(At,{westBoundLongitude:I(vn),eastBoundLongitude:I(vn),southBoundLatitude:I(vn),northBoundLatitude:I(vn)}),Jm=V(At,{GetCapabilities:I(Ch),GetMap:I(Ch),GetFeatureInfo:I(Ch)}),Qm=V(At,{Format:ct(W),DCPType:ct(vy)}),ty=V(At,{HTTP:I(xy)}),ey=V(At,{Get:I(Ri),Post:I(Ri)}),iy=V(At,{Name:I(W),Title:I(W),Abstract:I(W),LegendURL:ct(zf),StyleSheetURL:I(Ri),StyleURL:I(Ri)}),ny=V(At,{Format:I(W),OnlineResource:I(er)}),sy=V(At,{Keyword:jr(W)});function ry(i,t){return J({},$m,i,t)}function ay(i,t){return{SupportSLD:!!ke(i.getAttribute("UserDefinedSymbolization")),UserLayer:!!ke(i.getAttribute("UserLayer")),UserStyle:!!ke(i.getAttribute("UserStyle")),RemoteWFS:!!ke(i.getAttribute("RemoteWFS"))}}function Gf(i,t,e=!0){const n=[De(i.getAttribute("minx")),De(i.getAttribute("miny")),De(i.getAttribute("maxx")),De(i.getAttribute("maxy"))],s=[De(i.getAttribute("resx")),De(i.getAttribute("resy"))],r={extent:n,res:s};return e&&(ir(t)?r.crs=i.getAttribute("CRS"):r.srs=i.getAttribute("SRS")),r}function oy(i,t){const e=J({},Hm,i,t);if(!e)return;const n=e.westBoundLongitude,s=e.southBoundLatitude,r=e.eastBoundLongitude,a=e.northBoundLatitude;if(!(n===void 0||s===void 0||r===void 0||a===void 0))return[n,s,r,a]}function hy(i,t){return J({},ir(t)?Um:Bm,i,t)}function ly(i,t){return J({},ir(t)?qm:Xm,i,t)}function cy(i,t){return J({},Ym,i,t)}function uy(i,t){return J({},Vm,i,t)}function dy(i,t){return J({},Km,i,t)}function fy(i,t){return J([],Zm,i,t)}function gy(i,t){const e=J({},ir(t)?kf:Ff,i,t);return e.Layer===void 0?Object.assign(e,oh(i,t)):e}function oh(i,t){const e=ir(t),n=t[t.length-1],s=J({},e?kf:Ff,i,t);if(!s)return;let r=ke(i.getAttribute("queryable"));r===void 0&&(r=n.queryable),s.queryable=r!==void 0?r:!1;let a=bo(i.getAttribute("cascaded"));a===void 0&&(a=n.cascaded),s.cascaded=a;let o=ke(i.getAttribute("opaque"));o===void 0&&(o=n.opaque),s.opaque=o!==void 0?o:!1;let h=ke(i.getAttribute("noSubsets"));h===void 0&&(h=n.noSubsets),s.noSubsets=h!==void 0?h:!1;let l=De(i.getAttribute("fixedWidth"));l||(l=n.fixedWidth),s.fixedWidth=l;let c=De(i.getAttribute("fixedHeight"));c||(c=n.fixedHeight),s.fixedHeight=c;const u=["Style","AuthorityURL"];e?u.push("CRS"):u.push("SRS","Dimension"),u.forEach(function(f){if(f in n){const g=s[f]||[];s[f]=g.concat(n[f])}});const d=["BoundingBox","Attribution"];return e?d.push("Dimension","EX_GeographicBoundingBox","MinScaleDenominator","MaxScaleDenominator"):d.push("LatLonBoundingBox","ScaleHint","Extent"),d.forEach(function(f){if(!(f in s)){const g=n[f];s[f]=g}}),s}function _y(i,t){const e={name:i.getAttribute("name"),units:i.getAttribute("units"),unitSymbol:i.getAttribute("unitSymbol")};return ir(t)&&Object.assign(e,{default:i.getAttribute("default"),multipleValues:ke(i.getAttribute("multipleValues")),nearestValue:ke(i.getAttribute("nearestValue")),current:ke(i.getAttribute("current")),values:W(i)}),e}function my(i,t){return{name:i.getAttribute("name"),default:i.getAttribute("default"),nearestValue:ke(i.getAttribute("nearestValue"))}}function yy(i,t){return{min:De(i.getAttribute("min")),max:De(i.getAttribute("max"))}}function Ri(i,t){return J({},ny,i,t)}function py(i,t){return J({},Jm,i,t)}function vy(i,t){return J({},ty,i,t)}function xy(i,t){return J({},ey,i,t)}function Ch(i,t){return J({},Qm,i,t)}function zf(i,t){const e=Ri(i,t);if(e){const n=[bo(i.getAttribute("width")),bo(i.getAttribute("height"))];return e.size=n,e}}function Ey(i,t){const e=Ri(i,t);if(e)return e.name=i.getAttribute("name"),e}function My(i,t){const e=Ri(i,t);if(e)return e.type=i.getAttribute("type"),e}function wy(i,t){return J({},iy,i,t)}function Wf(i,t){return J([],sy,i,t)}class Sy extends kn{constructor(t){t=t||{},super(t)}}const X={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},Ry=5;class Cy extends Da{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=Ry}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return ot()}getData(t){return null}prepareFrame(t){return ot()}renderFrame(t,e){return ot()}forEachFeatureAtCoordinate(t,e,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===X.LOADED||e.getState()===X.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=X.LOADED&&e!=X.ERROR&&t.addEventListener($.CHANGE,this.boundHandleImageChange_),e==X.IDLE&&(t.load(),e=t.getState()),e==X.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class Bf extends ri{constructor(t,e,n,s){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=s}}const sn=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Iy=sn.includes("firefox"),by=sn.includes("safari")&&!sn.includes("chrom");by&&(sn.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(sn));const Ty=sn.includes("webkit")&&!sn.includes("edge"),Uf=sn.includes("macintosh"),jf=typeof devicePixelRatio<"u"?devicePixelRatio:1,Xf=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,ac=typeof Image<"u"&&Image.prototype.decode,Ay=typeof createImageBitmap=="function",qf=function(){let i=!1;try{const t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return i}();function bt(i,t,e,n){let s;return e&&e.length?s=e.shift():Xf?s=new OffscreenCanvas(i||300,t||300):s=document.createElement("canvas"),i&&(s.width=i),t&&(s.height=t),s.getContext("2d",n)}let Ih;function To(){return Ih||(Ih=bt(1,1)),Ih}function Ys(i){const t=i.canvas;t.width=1,t.height=1,i.clearRect(0,0,1,1)}function rC(i){let t=i.offsetWidth;const e=getComputedStyle(i);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function aC(i){let t=i.offsetHeight;const e=getComputedStyle(i);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function yu(i,t){const e=t.parentNode;e&&e.replaceChild(i,t)}function Ly(i){for(;i.lastChild;)i.lastChild.remove()}function Py(i,t){const e=i.childNodes;for(let n=0;;++n){const s=e[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){i.appendChild(r);continue}if(!r){i.removeChild(s),--n;continue}i.insertBefore(r,s)}}}class Yf{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(To(),{get:(t,e)=>{if(typeof To()[e]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,n)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,n),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,s=e.length;n.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[r*255,a*255,o*255]};Xr.xyz=function(i,t){var e=i[0]/255,n=i[1]/255,s=i[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=e*.41239079926595+n*.35758433938387+s*.18048078840183,a=e*.21263900587151+n*.71516867876775+s*.072192315360733,o=e*.019330818715591+n*.11919477979462+s*.95053215224966;return t=t||jt.whitepoint[2].E,[r*t[0],a*t[1],o*t[2]]};const oc={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(i,t,e){var n,s,r,a,o,h,l,c,u,d,f,g,_;if(r=i[0],a=i[1],o=i[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",e=e||2,u=jt.whitepoint[e][t][0],d=jt.whitepoint[e][t][1],f=jt.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),n=a/(13*r)+g||0,s=o/(13*r)+_||0,l=r>8?d*Math.pow((r+16)/116,3):d*r*m,h=l*9*n/(4*s)||0,c=l*(12-3*n-20*s)/(4*s)||0,[h,l,c]}};jt.luv=function(i,t,e){var n,s,r,a,o,h,l,c,u,d,f,g,_,m=.008856451679035631,y=903.2962962962961;t=t||"D65",e=e||2,u=jt.whitepoint[e][t][0],d=jt.whitepoint[e][t][1],f=jt.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),h=i[0],l=i[1],c=i[2],n=4*h/(h+15*l+3*c)||0,s=9*l/(h+15*l+3*c)||0;var p=l/d;return r=p<=m?y*p:116*Math.pow(p,1/3)-16,a=13*r*(n-g),o=13*r*(s-_),[r,a,o]};var Vf={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(i){var t=i[0],e=i[1],n=i[2],s,r,a;return a=n/360*2*Math.PI,s=e*Math.cos(a),r=e*Math.sin(a),[t,s,r]},xyz:function(i){return oc.xyz(Vf.luv(i))}};oc.lchuv=function(i){var t=i[0],e=i[1],n=i[2],s=Math.sqrt(e*e+n*n),r=Math.atan2(n,e),a=r*360/2/Math.PI;return a<0&&(a+=360),[t,s,a]};jt.lchuv=function(i){return oc.lchuv(jt.luv(i))};const pu={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var vu={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Oy(i){var t,e=[],n=1,s;if(typeof i=="number")return{space:"rgb",values:[i>>>16,(i&65280)>>>8,i&255],alpha:1};if(typeof i=="number")return{space:"rgb",values:[i>>>16,(i&65280)>>>8,i&255],alpha:1};if(i=String(i).toLowerCase(),pu[i])e=pu[i].slice(),s="rgb";else if(i==="transparent")n=0,s="rgb",e=[0,0,0];else if(i[0]==="#"){var r=i.slice(1),a=r.length,o=a<=4;n=1,o?(e=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],a===4&&(n=parseInt(r[3]+r[3],16)/255)):(e=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],a===8&&(n=parseInt(r[6]+r[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(i)){var h=t[1];s=h.replace(/a$/,"");var l=s==="cmyk"?4:s==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=e.shift()),e=e.map(function(c,u){if(c[c.length-1]==="%")return c=parseFloat(c)/100,u===3?c:s==="rgb"?c*255:s[0]==="h"||s[0]==="l"&&!u?c*100:s==="lab"?c*125:s==="lch"?u<2?c*150:c*360:s[0]==="o"&&!u?c:s==="oklab"?c*.4:s==="oklch"?u<2?c*.4:c*360:c;if(s[u]==="h"||u===2&&s[s.length-1]==="h"){if(vu[c]!==void 0)return vu[c];if(c.endsWith("deg"))return parseFloat(c);if(c.endsWith("turn"))return parseFloat(c)*360;if(c.endsWith("grad"))return parseFloat(c)*360/400;if(c.endsWith("rad"))return parseFloat(c)*180/Math.PI}return c==="none"?0:parseFloat(c)}),n=e.length>l?e.pop():1}else/[0-9](?:\s|\/|,)/.test(i)&&(e=i.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),s=i.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:e,alpha:n}}const bh={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(i){var t=i[0]/360,e=i[1]/100,n=i[2]/100,s,r,a,o,h,l=0;if(e===0)return h=n*255,[h,h,h];for(r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=[0,0,0];l<3;)a=t+1/3*-(l-1),a<0?a++:a>1&&a--,h=6*a<1?s+(r-s)*6*a:2*a<1?r:3*a<2?s+(r-s)*(2/3-a)*6:s,o[l++]=h*255;return o}};Xr.hsl=function(i){var t=i[0]/255,e=i[1]/255,n=i[2]/255,s=Math.min(t,e,n),r=Math.max(t,e,n),a=r-s,o,h,l;return r===s?o=0:t===r?o=(e-n)/a:e===r?o=2+(n-t)/a:n===r&&(o=4+(t-e)/a),o=Math.min(o*60,360),o<0&&(o+=360),l=(s+r)/2,r===s?h=0:l<=.5?h=a/(r+s):h=a/(2-r-s),[o,h*100,l*100]};function Dy(i){Array.isArray(i)&&i.raw&&(i=String.raw(...arguments)),i instanceof Number&&(i=+i);var t,e=Oy(i);if(!e.space)return[];const n=e.space[0]==="h"?bh.min:Xr.min,s=e.space[0]==="h"?bh.max:Xr.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],n[0]),s[0]),t[1]=Math.min(Math.max(e.values[1],n[1]),s[1]),t[2]=Math.min(Math.max(e.values[2],n[2]),s[2]),e.space[0]==="h"&&(t=bh.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}const hc=[NaN,NaN,NaN,0];function Ny(i){return typeof i=="string"?i:cc(i)}const Fy=1024,fr={};let Th=0;function ky(i){if(i.length===4)return i;const t=i.slice();return t[3]=1,t}function xu(i){const t=jt.lchuv(Xr.xyz(i));return t[3]=i[3],t}function Gy(i){const t=jt.rgb(Vf.xyz(i));return t[3]=i[3],t}function lc(i){if(i==="none")return hc;if(fr.hasOwnProperty(i))return fr[i];if(Th>=Fy){let e=0;for(const n in fr)e++&3||(delete fr[n],--Th)}const t=Dy(i);if(t.length!==4)throw new Error('failed to parse "'+i+'" as color');for(const e of t)if(isNaN(e))throw new Error('failed to parse "'+i+'" as color');return Kf(t),fr[i]=t,++Th,t}function qr(i){return Array.isArray(i)?i:lc(i)}function Kf(i){return i[0]=Mt(i[0]+.5|0,0,255),i[1]=Mt(i[1]+.5|0,0,255),i[2]=Mt(i[2]+.5|0,0,255),i[3]=Mt(i[3],0,1),i}function cc(i){let t=i[0];t!=(t|0)&&(t=t+.5|0);let e=i[1];e!=(e|0)&&(e=e+.5|0);let n=i[2];n!=(n|0)&&(n=n+.5|0);const s=i[3]===void 0?1:Math.round(i[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+s+")"}const Eu=[];let Qn=null;function zy(){Qn=bt(1,1,void 0,{willReadFrequently:!0})}class uc extends Cy{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=We(),this.pixelTransform=We(),this.inversePixelTransform=We(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,n){Qn||zy(),Qn.clearRect(0,0,1,1);let s;try{Qn.drawImage(t,e,n,1,1,0,0,1,1),s=Qn.getImageData(0,0,1,1).data}catch{return Qn=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const s=this.getLayer().getClassName();let r,a;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&on(qr(t.style.backgroundColor),qr(n)))){const o=t.firstElementChild;o instanceof HTMLCanvasElement&&(a=o.getContext("2d"))}if(a&&a.canvas.style.transform===e?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){r=document.createElement("div"),r.className=s;let o=r.style;o.position="absolute",o.width="100%",o.height="100%",a=bt();const h=a.canvas;r.appendChild(h),o=h.style,o.position="absolute",o.left="0",o.transformOrigin="top left",this.container=r,this.context=a}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const s=Nn(n),r=sh(n),a=nh(n),o=ih(n);kt(e.coordinateToPixelTransform,s),kt(e.coordinateToPixelTransform,r),kt(e.coordinateToPixelTransform,a),kt(e.coordinateToPixelTransform,o);const h=this.inversePixelTransform;kt(h,s),kt(h,r),kt(h,a),kt(h,o),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,a=t.pixelRatio,o=Math.round(it(n)/s*a),h=Math.round(Tt(n)/s*a);ii(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,r,-o/2,-h/2),yf(this.inversePixelTransform,this.pixelTransform);const l=hm(this.pixelTransform);if(this.useContainer(e,l,this.getBackground(t)),!this.containerReused){const c=this.context.canvas;c.width!=o||c.height!=h?(c.width=o,c.height=h):this.context.clearRect(0,0,o,h),l!==c.style.transform&&(c.style.transform=l)}}dispatchRenderEvent_(t,e,n){const s=this.getLayer();if(s.hasListener(t)){const r=new Bf(t,this.inversePixelTransform,n,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(be.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(be.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Yf),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(be.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(be.POSTRENDER,this.context,t))}getRenderTransform(t,e,n,s,r,a,o){const h=r/2,l=a/2,c=s/e,u=-c,d=-t[0]+o,f=-t[1];return ii(this.tempTransform,h,l,c,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class Wy extends uc{constructor(t){super(t),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(t){const e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,s=t.viewState,r=s.resolution,a=this.getLayer().getSource(),o=t.viewHints;let h=t.extent;if(e.extent!==void 0&&(h=_e(h,$e(e.extent,s.projection))),!o[Ft.ANIMATING]&&!o[Ft.INTERACTING]&&!Fn(h))if(a){const l=s.projection,c=a.getImage(h,r,n,l);c&&(this.loadImage(c)?this.image=c:c.getState()===X.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),s=kt(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!Ln(r,s))return null;const a=this.image.getExtent(),o=this.image.getImage(),h=it(a),l=Math.floor(o.width*((s[0]-a[0])/h));if(l<0||l>=o.width)return null;const c=Tt(a),u=Math.floor(o.height*((a[3]-s[1])/c));return u<0||u>=o.height?null:this.getImageData(o,l,u)}renderFrame(t,e){const n=this.image,s=n.getExtent(),r=n.getResolution(),[a,o]=Array.isArray(r)?r:[r,r],h=n.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],c=t.pixelRatio,u=t.viewState,d=u.center,f=u.resolution,g=c*a/(f*h),_=c*o/(f*h);this.prepareContainer(t,e);const m=this.context.canvas.width,y=this.context.canvas.height,p=this.getRenderContext(t);let x=!1,E=!0;if(l.extent){const b=$e(l.extent,u.projection);E=Qt(b,t.extent),x=E&&!Ze(b,t.extent),x&&this.clipUnrotated(p,t,b)}const M=n.getImage(),R=ii(this.tempTransform,m/2,y/2,g,_,0,h*(s[0]-d[0])/a,h*(d[1]-s[3])/o);this.renderedResolution=o*c/h;const S=M.width*R[0],w=M.height*R[3];if(this.getLayer().getSource().getInterpolate()||(p.imageSmoothingEnabled=!1),this.preRender(p,t),E&&S>=.5&&w>=.5){const b=R[4],B=R[5],N=l.opacity;N!==1&&(p.save(),p.globalAlpha=N),p.drawImage(M,0,0,+M.width,+M.height,b,B,S,w),N!==1&&p.restore()}return this.postRender(this.context,t),x&&p.restore(),p.imageSmoothingEnabled=!0,this.container}}class By extends Sy{constructor(t){super(t)}createRenderer(){return new Wy(this)}getData(t){return super.getData(t)}}class Zf extends Oa{constructor(t,e,n,s){super(),this.extent=t,this.pixelRatio_=n,this.resolution=e,this.state=typeof s=="function"?X.IDLE:s,this.image_=null,this.loader=typeof s=="function"?s:null}changed(){this.dispatchEvent($.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==X.IDLE&&this.loader){this.state=X.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;Zd(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=X.LOADED}).catch(n=>{this.state=X.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function Uy(i,t,e){const n=i;let s=!0,r=!1,a=!1;const o=[wo(n,$.LOAD,function(){a=!0,r||t()})];return n.src&&ac?(r=!0,n.decode().then(function(){s&&t()}).catch(function(h){s&&(a?t():e())})):o.push(wo(n,$.ERROR,e)),function(){s=!1,o.forEach(vt)}}function jy(i,t){return new Promise((e,n)=>{function s(){a(),e(i)}function r(){a(),n(new Error("Image load error"))}function a(){i.removeEventListener("load",s),i.removeEventListener("error",r)}i.addEventListener("load",s),i.addEventListener("error",r)})}function $f(i,t){return t&&(i.src=t),i.src&&ac?new Promise((e,n)=>i.decode().then(()=>e(i)).catch(s=>i.complete&&i.width?e(i):n(s))):jy(i)}function Hf(i,t){return t&&(i.src=t),i.src&&ac&&Ay?i.decode().then(()=>createImageBitmap(i)).catch(e=>{if(i.complete&&i.width)return i;throw e}):$f(i)}const dc=.5,Xy=10,Mu=.25;class fc{constructor(t,e,n,s,r,a){this.sourceProj_=t,this.targetProj_=e;let o={};const h=Br(this.targetProj_,this.sourceProj_);this.transformInv_=function(p){const x=p[0]+"/"+p[1];return o[x]||(o[x]=h(p)),o[x]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&it(s)>=it(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?it(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?it(this.targetProj_.getExtent()):null;const l=Nn(n),c=sh(n),u=nh(n),d=ih(n),f=this.transformInv_(l),g=this.transformInv_(c),_=this.transformInv_(u),m=this.transformInv_(d),y=Xy+(a?Math.max(0,Math.ceil(Math.log2(js(n)/(a*a*256*256)))):0);if(this.addQuad_(l,c,u,d,f,g,_,m,y),this.wrapsXInSource_){let p=1/0;this.triangles_.forEach(function(x,E,M){p=Math.min(p,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-p>this.sourceWorldWidth_/2){const E=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];E[0][0]-p>this.sourceWorldWidth_/2&&(E[0][0]-=this.sourceWorldWidth_),E[1][0]-p>this.sourceWorldWidth_/2&&(E[1][0]-=this.sourceWorldWidth_),E[2][0]-p>this.sourceWorldWidth_/2&&(E[2][0]-=this.sourceWorldWidth_);const M=Math.min(E[0][0],E[1][0],E[2][0]);Math.max(E[0][0],E[1][0],E[2][0])-M.5&&u<1;let g=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=So([t,e,n,s]);g=it(m)/this.targetWorldWidth_>Mu||g}!f&&this.sourceProj_.isGlobal()&&u&&(g=u>Mu||g)}if(!g&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!Qt(c,this.maxSourceExtent_))return;let _=0;if(!g&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(h[0])||!isFinite(h[1]))){if(l>0)g=!0;else if(_=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(h[0])||!isFinite(h[1])?1:0),_!=1&&_!=2&&_!=4&&_!=8)return}if(l>0){if(!g){const m=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(m);let p;f?p=(fs(r[0],d)+fs(o[0],d))/2-fs(y[0],d):p=(r[0]+o[0])/2-y[0];const x=(r[1]+o[1])/2-y[1];g=p*p+x*x>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const m=[(e[0]+n[0])/2,(e[1]+n[1])/2],y=this.transformInv_(m),p=[(s[0]+t[0])/2,(s[1]+t[1])/2],x=this.transformInv_(p);this.addQuad_(t,e,m,p,r,a,y,x,l-1),this.addQuad_(p,m,n,s,x,y,o,h,l-1)}else{const m=[(t[0]+e[0])/2,(t[1]+e[1])/2],y=this.transformInv_(m),p=[(n[0]+s[0])/2,(n[1]+s[1])/2],x=this.transformInv_(p);this.addQuad_(t,m,p,s,r,y,x,h,l-1),this.addQuad_(m,e,n,p,y,a,o,x,l-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}_&11||this.addTriangle_(t,n,s,r,o,h),_&14||this.addTriangle_(t,n,e,r,o,a),_&&(_&13||this.addTriangle_(e,s,t,a,h,r),_&7||this.addTriangle_(e,s,n,a,h,o))}calculateSourceExtent(){const t=me();return this.triangles_.forEach(function(e,n,s){const r=e.source;Ar(t,r[0]),Ar(t,r[1]),Ar(t,r[2])}),t}getTriangles(){return this.triangles_}}let Ah;const Ei=[];function wu(i,t,e,n,s){i.beginPath(),i.moveTo(0,0),i.lineTo(t,e),i.lineTo(n,s),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(t,n)+1,Math.max(e,s)),i.restore()}function Lh(i,t){return Math.abs(i[t*4]-210)>2||Math.abs(i[t*4+3]-.75*255)>2}function qy(){if(Ah===void 0){const i=bt(6,6,Ei);i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",wu(i,4,5,4,0),wu(i,4,5,0,5);const t=i.getImageData(0,0,3,3).data;Ah=Lh(t,0)||Lh(t,4)||Lh(t,8),Ys(i),Ei.push(i.canvas)}return Ah}function Ao(i,t,e,n){const s=Xl(e,t,i);let r=Co(t,n,e);const a=t.getMetersPerUnit();a!==void 0&&(r*=a);const o=i.getMetersPerUnit();o!==void 0&&(r/=o);const h=i.getExtent();if(!h||Ln(h,s)){const l=Co(i,r,s)/r;isFinite(l)&&l>0&&(r/=l)}return r}function Jf(i,t,e,n){const s=Te(e);let r=Ao(i,t,s,n);return(!isFinite(r)||r<=0)&&rf(e,function(a){return r=Ao(i,t,a,n),isFinite(r)&&r>0}),r}function gc(i,t,e,n,s,r,a,o,h,l,c,u,d,f){const g=bt(Math.round(e*i),Math.round(e*t),Ei);if(u||(g.imageSmoothingEnabled=!1),h.length===0)return g.canvas;g.scale(e,e);function _(M){return Math.round(M*e)/e}g.globalCompositeOperation="lighter";const m=me();h.forEach(function(M,R,S){nf(m,M.extent)});let y;const p=e/n,x=(u?1:1+Math.pow(2,-24))/p;if(!d||h.length!==1||l!==0){if(y=bt(Math.round(it(m)*p),Math.round(Tt(m)*p),Ei),u||(y.imageSmoothingEnabled=!1),s&&f){const M=(s[0]-m[0])*p,R=-(s[3]-m[3])*p,S=it(s)*p,w=Tt(s)*p;y.rect(M,R,S,w),y.clip()}h.forEach(function(M,R,S){if(M.image.width>0&&M.image.height>0){if(M.clipExtent){y.save();const T=(M.clipExtent[0]-m[0])*p,z=-(M.clipExtent[3]-m[3])*p,O=it(M.clipExtent)*p,q=Tt(M.clipExtent)*p;y.rect(u?T:Math.round(T),u?z:Math.round(z),u?O:Math.round(T+O)-Math.round(T),u?q:Math.round(z+q)-Math.round(z)),y.clip()}const w=(M.extent[0]-m[0])*p,b=-(M.extent[3]-m[3])*p,B=it(M.extent)*p,N=Tt(M.extent)*p;y.drawImage(M.image,l,l,M.image.width-2*l,M.image.height-2*l,u?w:Math.round(w),u?b:Math.round(b),u?B:Math.round(w+B)-Math.round(w),u?N:Math.round(b+N)-Math.round(b)),M.clipExtent&&y.restore()}})}const E=Nn(a);return o.getTriangles().forEach(function(M,R,S){const w=M.source,b=M.target;let B=w[0][0],N=w[0][1],T=w[1][0],z=w[1][1],O=w[2][0],q=w[2][1];const L=_((b[0][0]-E[0])/r),et=_(-(b[0][1]-E[1])/r),nt=_((b[1][0]-E[0])/r),xt=_(-(b[1][1]-E[1])/r),K=_((b[2][0]-E[0])/r),Q=_(-(b[2][1]-E[1])/r),pt=B,zt=N;B=0,N=0,T-=pt,z-=zt,O-=pt,q-=zt;const P=[[T,z,0,0,nt-L],[O,q,0,0,K-L],[0,0,T,z,xt-et],[0,0,O,q,Q-et]],ie=w_(P);if(!ie)return;if(g.save(),g.beginPath(),qy()||!u){g.moveTo(nt,xt);const Ot=4,je=L-nt,hi=et-xt;for(let ye=0;ye{const n=this.sourceImage_.getState();(n==X.LOADED||n==X.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){vt(this.sourceListenerKey_),this.sourceListenerKey_=null}}class _c extends ai{constructor(t){super(),this.projection=yt(t.projection),this.attributions_=Su(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(n,s){e.viewResolver=n,e.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Su(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Su(i){return i?typeof i=="function"?i:(Array.isArray(i)||(i=[i]),t=>i):null}const Ji=4,Ph={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class Vy extends ri{constructor(t,e){super(t),this.image=e}}class Ky extends _c{constructor(t){super({attributions:t.attributions,projection:t.projection,state:t.state,interpolate:t.interpolate!==void 0?t.interpolate:!0}),this.on,this.once,this.un,this.loader=t.loader||null,this.resolutions_=t.resolutions!==void 0?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=t.loader?t.loader.length===0:!1,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(t){this.resolutions_=t}findNearestResolution(t){const e=this.getResolutions();if(e){const n=Qo(e,t,0);t=e[n]}return t}getImage(t,e,n,s){const r=this.getProjection();if(!r||!s||An(r,s))return r&&(s=r),this.getImageInternal(t,e,n,s);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&An(this.reprojectedImage_.getProjection(),s)&&this.reprojectedImage_.getResolution()==e&&Us(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Yy(r,s,t,e,n,(a,o,h)=>this.getImageInternal(a,o,h,r),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,n,s){if(this.loader){const r=Qf(t,e,n,1),a=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===s&&(this.wantedExtent_&&Ze(this.wantedExtent_,r)||Ze(this.image.getExtent(),r))&&(this.wantedResolution_&&hl(this.wantedResolution_)===a||hl(this.image.getResolution())===a)))return this.image;this.wantedProjection_=s,this.wantedExtent_=r,this.wantedResolution_=a,this.image=new Zf(r,a,n,this.loader),this.image.addEventListener($.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let n;switch(e.getState()){case X.LOADING:this.loading=!0,n=Ph.IMAGELOADSTART;break;case X.LOADED:this.loading=!1,n=Ph.IMAGELOADEND;break;case X.ERROR:this.loading=!1,n=Ph.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new Vy(n,e))}}function Zy(i,t){i.getImage().src=t}function Qf(i,t,e,n){const s=t/e,r=Te(i),a=Hi(it(i)/s,Ji),o=Hi(Tt(i)/s,Ji),h=Hi((n-1)*a/2,Ji),l=a+2*h,c=Hi((n-1)*o/2,Ji),u=o+2*c;return Wr(r,s,0,[l,u])}function Lo(i,t,e,n){return n!==void 0?(n[0]=i,n[1]=t,n[2]=e,n):[i,t,e]}function $y(i,t,e){return i+"/"+t+"/"+e}function Hy(i){return Jy(i[0],i[1],i[2])}function Jy(i,t,e){return(t<e||e>t.getMaxZoom())return!1;const r=t.getFullTileRange(e);return r?r.containsXY(n,s):!0}function Po(i,t){const e=[];Object.keys(t).forEach(function(s){t[s]!==null&&t[s]!==void 0&&e.push(s+"="+encodeURIComponent(t[s]))});const n=e.join("&");return i=i.replace(/[?&]$/,""),i+=i.includes("?")?"&":"?",i+n}const tp=/\{z\}/g,ep=/\{x\}/g,ip=/\{y\}/g,np=/\{-y\}/g;function sp(i,t,e,n,s){return i.replace(tp,t.toString()).replace(ep,e.toString()).replace(ip,n.toString()).replace(np,function(){if(s===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(s-n).toString()})}function tg(i){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(i);if(e){const n=e[1].charCodeAt(0),s=e[2].charCodeAt(0);let r;for(r=n;r<=s;++r)t.push(i.replace(e[0],String.fromCharCode(r)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(i),e){const n=parseInt(e[2],10);for(let s=parseInt(e[1],10);s<=n;s++)t.push(i.replace(e[0],s.toString()));return t}return t.push(i),t}const eg="1.3.0",Ru=[101,101];function ig(i,t,e,n,s){s.WIDTH=e[0],s.HEIGHT=e[1];const r=n.getAxisOrientation(),a=Wl(s.VERSION,"1.3")>=0;s[a?"CRS":"SRS"]=n.getCode();const o=a&&r.startsWith("ne")?[t[1],t[0],t[3],t[2]]:t;return s.BBOX=o.join(","),Po(i,s)}function rp(i,t,e,n,s,r,a){r=Object.assign({REQUEST:"GetMap"},r);const o=t/e,h=[eu(it(i)/o,Ji),eu(Tt(i)/o,Ji)];if(e!=1)switch(a){case"geoserver":const c=90*e+.5|0;"FORMAT_OPTIONS"in r?r.FORMAT_OPTIONS+=";dpi:"+c:r.FORMAT_OPTIONS="dpi:"+c;break;case"mapserver":r.MAP_RESOLUTION=90*e;break;case"carmentaserver":case"qgis":r.DPI=90*e;break;default:throw new Error("Unknown `serverType` configured")}return ig(s,i,h,n,r)}function ng(i,t){return Object.assign({REQUEST:t,SERVICE:"WMS",VERSION:eg,FORMAT:"image/png",STYLES:"",TRANSPARENT:!0},i)}function ap(i){const t=i.hidpi===void 0?!0:i.hidpi,e=yt(i.projection||"EPSG:3857"),n=i.ratio||1.5,s=i.load||Hf,r=i.crossOrigin??null;return(a,o,h)=>{a=Qf(a,o,h,n),h!=1&&(!t||i.serverType===void 0)&&(h=1);const l=rp(a,o,h,e,i.url,ng(i.params,"GetMap"),i.serverType),c=new Image;return c.crossOrigin=r,s(c,l).then(u=>({image:u,extent:a,pixelRatio:h}))}}function op(i,t,e){if(i.url===void 0)return;const n=yt(i.projection||"EPSG:3857"),s=Wr(t,e,0,Ru),r={QUERY_LAYERS:i.params.LAYERS,INFO_FORMAT:"application/json"};Object.assign(r,ng(i.params,"GetFeatureInfo"),i.params);const a=ss((t[0]-s[0])/e,Ji),o=ss((s[3]-t[1])/e,Ji),h=Wl(r.VERSION,"1.3")>=0;return r[h?"I":"X"]=a,r[h?"J":"Y"]=o,ig(i.url,s,Ru,n,r)}function hp(i,t){if(i.url===void 0)return;const e={SERVICE:"WMS",VERSION:eg,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(t!==void 0){const n=yt(i.projection||"EPSG:3857").getMetersPerUnit()||1,s=28e-5;e.SCALE=t*n/s}if(Object.assign(e,i.params),i.params!==void 0&&e.LAYER===void 0){const n=e.LAYERS;if(!(!Array.isArray(n)||n.length!==1))return;e.LAYER=n}return Po(i.url,e)}class lp extends Ky{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:Zy,this.params_=Object.assign({},t.params),this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5,this.loaderProjection_=null}getFeatureInfoUrl(t,e,n,s){const r=yt(n),a=this.getProjection();a&&a!==r&&(e=Ao(a,r,t,e),t=Xl(t,r,a));const o={url:this.url_,params:{...this.params_,...s},projection:a||r};return op(o,t,e)}getLegendUrl(t,e){return hp({url:this.url_,params:{...this.params_,...e}},t)}getParams(){return this.params_}getImageInternal(t,e,n,s){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==s)&&(this.loaderProjection_=s,this.loader=ap({crossOrigin:this.crossOrigin_,params:this.params_,projection:s,serverType:this.serverType_,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(r,a)=>(this.image.setImage(r),this.imageLoadFunction_(this.image,a),Hf(r))})),super.getImageInternal(t,e,n,s))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}async function sg(i,t,e){const n=await t.fetch(i,{signal:e});if(!n.ok)throw new Error("Request failed: "+n.status);return await n.text()}var ji;class rg{constructor(t){D(this,ji);U(this,ji,t)}destroy(){for(const t of v(this,ji))t.destroy();U(this,ji,[])}getItems(t){return this.getSublayers(t)}getSublayers(t){return v(this,ji).slice()}__getRawSublayers(){return v(this,ji)}}ji=new WeakMap;const yo=Ii("map:WMSLayer");var bs,Rn,Ts,As,oa,ha,la,Ls,si,ag,og,hg,lg;class oC extends qs{constructor(e){const n=new By;super({...e,olLayer:n});D(this,si);D(this,bs);D(this,Rn);D(this,Ts);D(this,As);D(this,oa);D(this,ha,new AbortController);D(this,la);D(this,Ls);const s=new lp({...e.sourceOptions,url:e.url,params:{...e.sourceOptions?.params},imageLoadFunction:(r,a)=>j(this,si,lg).call(this,r,a).catch(o=>{yo.error(`Failed to load tile at '${a}'`,o)})});U(this,bs,e.url),U(this,As,s),U(this,Ts,n),U(this,Rn,new rg(cg(e.sublayers))),U(this,la,kr(()=>j(this,si,og).call(this),{equal(r,a){return r.length===a.length&&r.every((o,h)=>o===a[h])}})),U(this,Ls,l_(()=>[v(this,la).value],([r])=>{j(this,si,ag).call(this,r)},{immediate:!0}))}destroy(){v(this,ha).abort(),U(this,Ls,Ld(v(this,Ls))),super.destroy()}get type(){return"wms"}get legend(){}get url(){return v(this,bs)}get layers(){}get sublayers(){return v(this,Rn)}get capabilities(){return v(this,oa)}__attachToMap(e){super.__attachToMap(e);for(const s of v(this,Rn).getSublayers())s.__attach(e,this,this);const n=(s,r)=>{for(const a of s){const o=a.sublayers.getSublayers();o.length?n(o,r):a.name&&r.push(a)}};j(this,si,hg).call(this).then(s=>{Ol(()=>{const a=new jm().read(s);U(this,oa,a);const o=[];n(v(this,Rn).getSublayers(),o);for(const h of o){const l=up(a,h.name);h.__setLegend(l)}})}).catch(s=>{if(Fr(s)){yo.debug(`Layer ${this.id} has been destroyed before fetching capabilities`);return}yo.error(`Failed to fetch WMS capabilities for layer ${this.id}`,s)})}}bs=new WeakMap,Rn=new WeakMap,Ts=new WeakMap,As=new WeakMap,oa=new WeakMap,ha=new WeakMap,la=new WeakMap,Ls=new WeakMap,si=new WeakSet,ag=function(e){v(this,As).updateParams({LAYERS:e});const n=e.length===0?null:v(this,As);v(this,Ts).getSource()!==n&&v(this,Ts).setSource(n)},og=function(){const e=[],n=s=>{if(!s.visible)return;const r=s.sublayers.__getRawSublayers();if(r.length)for(const a of r)n(a);else s.name&&e.push(s.name)};for(const s of this.sublayers.__getRawSublayers())n(s);return e},hg=async function(){const e=this.map.__sharedDependencies.httpService,n=`${v(this,bs)}?LANGUAGE=ger&SERVICE=WMS&REQUEST=GetCapabilities`;return sg(n,e,v(this,ha).signal)},lg=async function(e,n){const s=this.map.__sharedDependencies.httpService,r=e.getImage(),a=await s.fetch(n);if(!a.ok)throw new Error(`Request failed with status ${a.status}.`);const o=await a.blob(),h=URL.createObjectURL(o),l=()=>{URL.revokeObjectURL(h),r.removeEventListener("load",l),r.removeEventListener("error",l)};r.addEventListener("load",l),r.addEventListener("error",l),r.src=h};var Cn,In,ca,ua,da,Ps;class cp extends Lf{constructor(e){super(e);D(this,Cn);D(this,In);D(this,ca);D(this,ua,Kt());D(this,da);D(this,Ps);U(this,ca,e.name),U(this,Ps,Kt(e.visible??!0)),U(this,da,new rg(cg(e.sublayers)))}get type(){return"wms-sublayer"}get name(){return v(this,ca)}get layers(){}get sublayers(){return v(this,da)}get parent(){const e=v(this,Cn);if(!e)throw new Error(`WMS sublayer ${this.id} has not been attached to its parent yet.`);return e}get parentLayer(){const e=v(this,In);if(!e)throw new Error(`WMS sublayer ${this.id} has not been attached to its parent yet.`);return e}get legend(){return v(this,ua).value}get visible(){return v(this,Ps).value}__attach(e,n,s){if(super.__attachToMap(e),v(this,Cn))throw new Error(`WMS sublayer '${this.id}' has already been attached to parent '${v(this,Cn).id}'`);if(U(this,Cn,s),v(this,In))throw new Error(`WMS sublayer '${this.id}' has already been attached to parent layer '${v(this,In).id}'`);U(this,In,n);for(const r of this.sublayers.__getRawSublayers())r.__attach(e,n,this)}__setLegend(e){v(this,ua).value=e}setVisible(e){v(this,Ps).value=e}}Cn=new WeakMap,In=new WeakMap,ca=new WeakMap,ua=new WeakMap,da=new WeakMap,Ps=new WeakMap;function cg(i=[]){const t=[];try{for(const e of i)t.push(new cp(e));return t}catch(e){for(;t.length;)t.pop()?.destroy();throw new Error("Failed to construct sublayers.",{cause:e})}}function up(i,t){const n=i?.Capability?.Layer;let s;const r=a=>{for(const o of a)if(o?.Name===t){const l=o.Style;if(!l||!l.length){yo.debug("No style in WMS layer capabilities - giving up.");return}s=l[0].LegendURL?.[0]?.OnlineResource}else o.Layer&&r(o.Layer)};return n&&r(n.Layer),s}const G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},de=[null,"http://www.opengis.net/ows/1.1"],dp=V(de,{ServiceIdentification:I(kp),ServiceProvider:I(zp),OperationsMetadata:I(Np)});class fp extends rc{constructor(){super()}readFromNode(t){const e=J({},dp,t,[]);return e||null}}const gp=V(de,{DeliveryPoint:I(W),City:I(W),AdministrativeArea:I(W),PostalCode:I(W),Country:I(W),ElectronicMailAddress:I(W)}),_p=V(de,{Value:ct(Wp)}),mp=V(de,{AllowedValues:I(bp)}),yp=V(de,{Phone:I(Fp),Address:I(Ip)}),pp=V(de,{HTTP:I(Op)}),vp=V(de,{Get:ct(Pp),Post:void 0}),xp=V(de,{DCP:I(Lp)}),Ep=V(de,{Operation:Dp}),Mp=V(de,{Voice:I(W),Facsimile:I(W)}),wp=V(de,{Constraint:ct(Tp)}),Sp=V(de,{IndividualName:I(W),PositionName:I(W),ContactInfo:I(Ap)}),Rp=V(de,{Abstract:I(W),AccessConstraints:I(W),Fees:I(W),Title:I(W),ServiceTypeVersion:I(W),ServiceType:I(W)}),Cp=V(de,{ProviderName:I(W),ProviderSite:I(er),ServiceContact:I(Gp)});function Ip(i,t){return J({},gp,i,t)}function bp(i,t){return J({},_p,i,t)}function Tp(i,t){const e=i.getAttribute("name");if(e)return J({name:e},mp,i,t)}function Ap(i,t){return J({},yp,i,t)}function Lp(i,t){return J({},pp,i,t)}function Pp(i,t){const e=er(i);if(e)return J({href:e},wp,i,t)}function Op(i,t){return J({},vp,i,t)}function Dp(i,t){const e=i.getAttribute("name"),n=J({},xp,i,t);if(!n)return;const s=t[t.length-1];s[e]=n}function Np(i,t){return J({},Ep,i,t)}function Fp(i,t){return J({},Mp,i,t)}function kp(i,t){return J({},Rp,i,t)}function Gp(i,t){return J({},Sp,i,t)}function zp(i,t){return J({},Cp,i,t)}function Wp(i,t){return W(i)}const oi=[null,"http://www.opengis.net/wmts/1.0"],nr=[null,"http://www.opengis.net/ows/1.1"],Bp=V(oi,{Contents:I(Jp)});class Up extends rc{constructor(){super(),this.owsParser_=new fp}readFromNode(t){let e=t.getAttribute("version");e&&(e=e.trim());let n=this.owsParser_.readFromNode(t);return n?(n.version=e,n=J(n,Bp,t,[]),n||null):null}}const jp=V(oi,{Layer:ct(Qp),TileMatrixSet:ct(t1)}),Xp=V(oi,{Style:ct(e1),Format:ct(W),TileMatrixSetLink:ct(i1),Dimension:ct(n1),ResourceURL:ct(s1)},V(nr,{Title:I(W),Abstract:I(W),WGS84BoundingBox:I(dg),BoundingBox:ct(r1),Identifier:I(W)})),qp=V(oi,{LegendURL:ct(a1)},V(nr,{Title:I(W),Identifier:I(W)})),Yp=V(oi,{TileMatrixSet:I(W),TileMatrixSetLimits:I(h1)}),Vp=V(oi,{TileMatrixLimits:jr(l1)}),Kp=V(oi,{TileMatrix:I(W),MinTileRow:I(Ge),MaxTileRow:I(Ge),MinTileCol:I(Ge),MaxTileCol:I(Ge)}),Zp=V(oi,{Default:I(W),Value:ct(W)},V(nr,{Identifier:I(W)})),ug=V(nr,{LowerCorner:jr(ll),UpperCorner:jr(ll)}),$p=V(oi,{WellKnownScaleSet:I(W),TileMatrix:ct(o1)},V(nr,{SupportedCRS:I(W),Identifier:I(W),BoundingBox:I(dg)})),Hp=V(oi,{TopLeftCorner:I(ll),ScaleDenominator:I(vn),TileWidth:I(Ge),TileHeight:I(Ge),MatrixWidth:I(Ge),MatrixHeight:I(Ge)},V(nr,{Identifier:I(W)}));function Jp(i,t){return J({},jp,i,t)}function Qp(i,t){return J({},Xp,i,t)}function t1(i,t){return J({},$p,i,t)}function e1(i,t){const e=J({},qp,i,t);if(!e)return;const n=i.getAttribute("isDefault")==="true";return e.isDefault=n,e}function i1(i,t){return J({},Yp,i,t)}function n1(i,t){return J({},Zp,i,t)}function s1(i,t){const e=i.getAttribute("format"),n=i.getAttribute("template"),s=i.getAttribute("resourceType"),r={};return e&&(r.format=e),n&&(r.template=n),s&&(r.resourceType=s),r}function dg(i,t){const e=J([],ug,i,t);if(e.length==2)return So(e)}function r1(i,t){const e=i.getAttribute("crs"),n=J([],ug,i,t);if(n.length==2)return{extent:So(n),crs:e}}function a1(i,t){const e={};return e.format=i.getAttribute("format"),e.href=er(i),e}function ll(i,t){const e=W(i).split(/\s+/);if(!e||e.length!=2)return;const n=+e[0],s=+e[1];if(!(isNaN(n)||isNaN(s)))return[n,s]}function o1(i,t){return J({},Hp,i,t)}function h1(i,t){return J([],Vp,i,t)}function l1(i,t){return J({},Kp,i,t)}const no={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class c1 extends kn{constructor(t){t=t||{};const e=Object.assign({},t),n=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(no.PRELOAD)}setPreload(t){this.set(no.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(no.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(no.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class mc extends Oa{constructor(t,e,n){super(),n=n||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent($.CHANGE)}release(){this.state===G.ERROR&&this.setState(G.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==G.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){ot()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;const s=e-n+1e3/60;return s>=this.transition_?1:gf(s/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}function Oo(i){return i instanceof Image||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageBitmap?i:null}function u1(i){return i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Float32Array||i instanceof DataView?i:null}const d1=new Error("disposed");let Xn=null;function f1(i){Xn||(Xn=bt(i.width,i.height,void 0,{willReadFrequently:!0}));const t=Xn.canvas,e=i.width;t.width!==e&&(t.width=e);const n=i.height;return t.height!==n&&(t.height=n),Xn.clearRect(0,0,e,n),Xn.drawImage(i,0,0),Xn.getImageData(0,0,e,n).data}const g1=[256,256];class cl extends mc{constructor(t){const e=G.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=Oo(this.data_);return t?[t.width,t.height]:g1}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==G.IDLE&&this.state!==G.ERROR)return;this.state=G.LOADING,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=G.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=G.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(d1),this.controller_=null),super.disposeInternal()}}class yc extends mc{constructor(t,e,n,s,r,a){super(t,e,a),this.crossOrigin_=s,this.src_=n,this.key=n,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=G.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=G.ERROR,this.unlistenImage_(),this.image_=_1(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=G.LOADED:this.state=G.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==G.ERROR&&(this.state=G.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==G.IDLE&&(this.state=G.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Uy(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function _1(){const i=bt(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}class m1{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();){const e=this.pop();e instanceof Jo&&e.dispose()}}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return ht(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const e=this.entries_[t];return ht(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.key_;return t}getValues(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){ht(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}class y1 extends cl{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:t.interpolate,transition:t.transition}),this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const e=t.sourceProj,n=e.getExtent(),s=t.sourceTileGrid.getExtent();this.clipExtent_=e.canWrapX()?s?_e(n,s):n:s;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),a=this.targetTileGrid_.getExtent();let o=this.sourceTileGrid_.getExtent();const h=a?_e(r,a):r;if(js(h)===0){this.state=G.EMPTY;return}n&&(o?o=_e(o,n):o=n);const l=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),c=t.targetProj,u=Jf(e,c,h,l);if(!isFinite(u)||u<=0){this.state=G.EMPTY;return}const d=t.errorThreshold!==void 0?t.errorThreshold:dc;if(this.triangulation_=new fc(e,c,h,o,u*d,l),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let f=this.triangulation_.calculateSourceExtent();if(o&&(e.canWrapX()?(f[1]=Mt(f[1],o[1],o[3]),f[3]=Mt(f[3],o[1],o[3])):f=_e(f,o)),!js(f))this.state=G.EMPTY;else{let g=0,_=0;e.canWrapX()&&(g=it(n),_=Math.floor((f[0]-n[0])/g)),zl(f.slice(),e,!0).forEach(y=>{const p=this.sourceTileGrid_.getTileRangeForExtentAndZ(y,this.sourceZ_),x=t.getTileFunction;for(let E=p.minX;E<=p.maxX;E++)for(let M=p.minY;M<=p.maxY;M++){const R=x(this.sourceZ_,E,M,this.pixelRatio_);if(R){const S=_*g;this.sourceTiles_.push({tile:R,offset:S})}}++_}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];let e=!1;if(this.sourceTiles_.forEach(g=>{const _=g.tile;if(!_||_.getState()!==G.LOADED)return;const m=_.getSize(),y=this.gutter_;let p;const x=u1(_.getData());x?p=x:(e=!0,p=f1(Oo(_.getData())));const E=[m[0]+2*y,m[1]+2*y],M=p instanceof Float32Array,R=E[0]*E[1],S=M?Float32Array:Uint8ClampedArray,w=new S(p.buffer),b=S.BYTES_PER_ELEMENT,B=b*w.length/R,N=w.byteLength/E[1],T=Math.floor(N/b/E[0]),z=R*T;let O=w;if(w.length!==z){O=new S(z);let et=0,nt=0;const xt=E[0]*T;for(let K=0;K=0;--g){const _=[];for(let M=0,R=t.length;M{const n=e.getState();if(n!==G.IDLE&&n!==G.LOADING)return;t++;const s=at(e,$.CHANGE,()=>{const r=e.getState();(r==G.LOADED||r==G.ERROR||r==G.EMPTY)&&(vt(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e}){e.getState()==G.IDLE&&e.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(vt),this.sourcesListenerKeys_=null}}class ul extends mc{constructor(t,e,n,s,r,a,o,h,l,c,u,d){super(r,G.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=o,this.gutter_=h,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=s,this.wrappedTileCoord_=a||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const f=s.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let _=this.sourceTileGrid_.getExtent();const m=g?_e(f,g):f;if(js(m)===0){this.state=G.EMPTY;return}const y=t.getExtent();y&&(_?_=_e(_,y):_=y);const p=s.getResolution(this.wrappedTileCoord_[0]),x=Jf(t,n,m,p);if(!isFinite(x)||x<=0){this.state=G.EMPTY;return}const E=c!==void 0?c:dc;if(this.triangulation_=new fc(t,n,m,_,x*E,p),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=e.getZForResolution(x);let M=this.triangulation_.calculateSourceExtent();if(_&&(t.canWrapX()?(M[1]=Mt(M[1],_[1],_[3]),M[3]=Mt(M[3],_[1],_[3])):M=_e(M,_)),!js(M))this.state=G.EMPTY;else{let R=0,S=0;t.canWrapX()&&(R=it(y),S=Math.floor((M[0]-y[0])/R)),zl(M.slice(),t,!0).forEach(b=>{const B=e.getTileRangeForExtentAndZ(b,this.sourceZ_);for(let N=B.minX;N<=B.maxX;N++)for(let T=B.minY;T<=B.maxY;T++){const z=l(this.sourceZ_,N,T,o);if(z){const O=S*R;this.sourceTiles_.push({tile:z,offset:O})}}++S}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{const n=e.tile;if(n&&n.getState()==G.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);s[0]+=e.offset,s[2]+=e.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:s,clipExtent:r,image:n.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=G.ERROR;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),s=typeof n=="number"?n:n[0],r=typeof n=="number"?n:n[1],a=this.targetTileGrid_.getResolution(e),o=this.sourceTileGrid_.getResolution(this.sourceZ_),h=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=gc(s,r,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,h,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=G.LOADED}this.changed()}load(){if(this.state==G.IDLE){this.state=G.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const n=e.getState();if(n==G.IDLE||n==G.LOADING){t++;const s=at(e,$.CHANGE,r=>{const a=e.getState();(a==G.LOADED||a==G.ERROR||a==G.EMPTY)&&(vt(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},n,s){e.getState()==G.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(vt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Ys(this.canvas_.getContext("2d")),Ei.push(this.canvas_),this.canvas_=null),super.release()}}class pc{constructor(t,e,n,s){this.minX=t,this.maxX=e,this.minY=n,this.maxY=s}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function qn(i,t,e,n,s){return s!==void 0?(s.minX=i,s.maxX=t,s.minY=e,s.maxY=n,s):new pc(i,t,e,n)}function Cu(i){return i[0]>0&&i[1]>0}function p1(i,t,e){return e===void 0&&(e=[0,0]),e[0]=i[0]*t+.5|0,e[1]=i[1]*t+.5|0,e}function le(i,t){return Array.isArray(i)?i:(t===void 0?t=[i,i]:(t[0]=i,t[1]=i),t)}function Oh(i,t,e,n){return`${i},${$y(t,e,n)}`}function Dh(i,t,e){if(!(e in i))return i[e]=new Set([t]),!0;const n=i[e],s=n.has(t);return s||n.add(t),!s}function v1(i,t,e){const n=i[e];return n?n.delete(t):!1}function Iu(i,t){const e=i.layerStatesArray[i.layerIndex];e.extent&&(t=_e(t,$e(e.extent,i.viewState.projection)));const n=e.layer.getRenderSource();if(!n.getWrapX()){const s=n.getTileGridForProjection(i.viewState.projection).getExtent();s&&(t=_e(t,s))}return t}class x1 extends uc{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=me(),this.tempTileRange_=new pc(0,0,0,0),this.tempTileCoord_=Lo(0,0,0);const n=e.cacheSize!==void 0?e.cacheSize:512;this.tileCache_=new m1(n),this.renderedProjection_=void 0,this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,n,s){const r=this.tileCache_,o=this.getLayer().getSource(),h=Oh(o.getKey(),t,e,n);let l;if(r.containsKey(h))l=r.get(h);else{if(l=o.getTile(t,e,n,s.pixelRatio,s.viewState.projection),!l)return null;r.set(h,l)}return l}getTile(t,e,n,s){const r=this.getOrCreateTile(t,e,n,s);return r||null}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),s=kt(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!Ln(r,s))return null;const a=e.viewState,o=n.getRenderSource(),h=o.getTileGridForProjection(a.projection),l=o.getTilePixelRatio(e.pixelRatio);for(let c=h.getZForResolution(a.resolution);c>=h.getMinZoom();--c){const u=h.getTileCoordForCoordAndZ(s,c),d=this.getTile(c,u[1],u[2],e);if(!d||d.getState()!==G.LOADED)continue;const f=h.getOrigin(c),g=le(h.getTileSize(c)),_=h.getResolution(c);let m;if(d instanceof yc||d instanceof ul)m=d.getImage();else if(d instanceof cl){if(m=Oo(d.getData()),!m)continue}else continue;const y=Math.floor(l*((s[0]-f[0])/_-u[1]*g[0])),p=Math.floor(l*((f[1]-s[1])/_-u[2]*g[1])),x=Math.round(l*o.getGutterForProjection(a.projection));return this.getImageData(m,y+x,p+x)}return null}prepareFrame(t){this.renderedProjection_?t.viewState.projection!==this.renderedProjection_&&(this.tileCache_.clear(),this.renderedProjection_=t.viewState.projection):this.renderedProjection_=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const n=e.getRevision();return this.renderedRevision_?this.renderedRevision_!==n&&(this.renderedRevision_=n,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedRevision_=n,!0}enqueueTiles(t,e,n,s,r){const a=t.viewState,o=this.getLayer(),h=o.getRenderSource(),l=h.getTileGridForProjection(a.projection),c=_t(h);c in t.wantedTiles||(t.wantedTiles[c]={});const u=t.wantedTiles[c],d=o.getMapInternal(),f=Math.max(n-r,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),h.zDirection));for(let g=n;g>=f;--g){const _=l.getTileRangeForExtentAndZ(e,g,this.tempTileRange_),m=l.getResolution(g);for(let y=_.minX;y<=_.maxX;++y)for(let p=_.minY;p<=_.maxY;++p){const x=this.getTile(g,y,p,t);if(!x||!Dh(s,x,g))continue;const M=x.getKey();if(u[M]=!0,x.getState()===G.IDLE&&!t.tileQueue.isKeyQueued(M)){const R=Lo(g,y,p,this.tempTileCoord_);t.tileQueue.enqueue([x,c,l.getTileCoordCenter(R),m])}}}}findStaleTile_(t,e){const n=this.tileCache_,s=t[0],r=t[1],a=t[2],o=this.getStaleKeys();for(let h=0;h0&&setTimeout(()=>{this.enqueueTiles(t,B,f-1,w,b-1)},0),!(f in w))return this.container;const N=_t(this),T=t.time;for(const K of w[f]){const Q=K.getState();if((K instanceof ul||K instanceof y1)&&Q===G.EMPTY)continue;const pt=K.tileCoord;if(Q===G.LOADED&&K.getAlpha(N,T)===1){K.endTransition(N);continue}if(this.renderComplete=!1,this.findStaleTile_(pt,w)){v1(w,K,f),t.animate=!0;continue}if(this.findAltTiles_(d,pt,f+1,w))continue;const ie=d.getMinZoom();for(let Wt=f-1;Wt>=ie&&!this.findAltTiles_(d,pt,Wt,w);--Wt);}const z=g/a*h/y,O=this.getRenderContext(t);ii(this.tempTransform,p/2,x/2,z,z,0,-p/2,-x/2),n.extent&&this.clipUnrotated(O,t,E),c.getInterpolate()||(O.imageSmoothingEnabled=!1),this.preRender(O,t);const q=Object.keys(w).map(Number);q.sort(vi);let L;const et=[],nt=[];for(let K=q.length-1;K>=0;--K){const Q=q[K],pt=c.getTilePixelSize(Q,h,r),P=d.getResolution(Q)/g,ie=pt[0]*P*z,Wt=pt[1]*P*z,Ot=d.getTileCoordForCoordAndZ(Nn(S),Q),je=d.getTileCoordExtent(Ot),hi=kt(this.tempTransform,[y*(je[0]-S[0])/g,y*(S[3]-je[3])/g]),ye=y*c.getGutterForProjection(r);for(const Ai of w[Q]){if(Ai.getState()!==G.LOADED)continue;const ar=Ai.tileCoord,Va=Ot[1]-ar[1],_h=Math.round(hi[0]-(Va-1)*ie),or=Ot[2]-ar[2],ln=Math.round(hi[1]-(or-1)*Wt),pe=Math.round(hi[0]-Va*ie),Xe=Math.round(hi[1]-or*Wt),zn=_h-pe,Wn=ln-Xe,hr=q.length===1;let cn=!1;L=[pe,Xe,pe+zn,Xe,pe+zn,Xe+Wn,pe,Xe+Wn];for(let Bn=0,Un=et.length;Bn{const pt=_t(c),zt=Q.wantedTiles[pt],P=zt?Object.keys(zt).length:0;this.updateCacheSize(P),this.tileCache_.expireCache()};return t.postRenderFunctions.push(xt),this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,n,s,r,a,o,h){let l;if(t instanceof cl){if(l=Oo(t.getData()),!l)throw new Error("Rendering array data is not yet supported")}else l=this.getTileImage(t);if(!l)return;const c=this.getRenderContext(e),u=_t(this),d=e.layerStatesArray[e.layerIndex],f=d.opacity*(h?t.getAlpha(u,e.time):1),g=f!==c.globalAlpha;g&&(c.save(),c.globalAlpha=f),c.drawImage(l,o,o,l.width-2*o,l.height-2*o,n,s,r,a),g&&c.restore(),f!==d.opacity?e.animate=!0:h&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,n){const s=_t(e);s in t||(t[s]={}),t[s][n.getKey()]=!0}}class fg extends c1{constructor(t){super(t)}createRenderer(){return new x1(this,{cacheSize:this.getCacheSize()})}}const Nh={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},Yn=[0,0,0],Pi=5;class vc{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,ht(x_(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s{const a=new pc(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(n){const o=this.getTileRangeForExtentAndZ(n,r);a.minX=Math.max(o.minX,a.minX),a.maxX=Math.min(o.maxX,a.maxX),a.minY=Math.max(o.minY,a.minY),a.maxY=Math.min(o.maxY,a.maxY)}return a}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,e,n){const s=this.getTileRangeForExtentAndZ(t,e);for(let r=s.minX,a=s.maxX;r<=a;++r)for(let o=s.minY,h=s.maxY;o<=h;++o)n([e,r,o])}forEachTileCoordParentTileRange(t,e,n,s){let r,a,o,h=null,l=t[0]-1;for(this.zoomFactor_===2?(a=t[1],o=t[2]):h=this.getTileCoordExtent(t,s);l>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),r=qn(a,a,o,o,n)):r=this.getTileRangeForExtentAndZ(h,l,n),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,n){if(t[0]this.maxZoom||e0?E=e.find(function(M){return x[c]==M[l]?!0:x[c].includes(":")?!1:i[c]+":"+x[c]===M[l]}):E=!0,E){s.push(x[c]);const M=x[u]*28e-5/y,R=x[f],S=x[g];p?r.push([x[d][1],x[d][0]]):r.push(x[d]),n.push(M),a.push(R==S?R:[R,S]),o.push([x.MatrixWidth,x.MatrixHeight])}}),new E1({extent:t,origins:r,resolutions:n,matrixIds:s,tileSizes:a,sizes:o})}function gg(i){let t=i.getDefaultTileGrid();return t||(t=C1(i),i.setDefaultTileGrid(t)),t}function w1(i,t,e){const n=t[0],s=i.getTileCoordCenter(t),r=xc(e);if(!Ln(r,s)){const a=it(r),o=Math.ceil((r[0]-s[0])/a);return s[0]+=a*o,i.getTileCoordForCoordAndZ(s,n)}return t}function S1(i,t,e,n){n=n!==void 0?n:"top-left";const s=_g(i,t,e);return new vc({extent:i,origin:N_(i,n),resolutions:s,tileSize:e})}function R1(i){const t=i||{},e=t.extent||yt("EPSG:3857").getExtent(),n={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:_g(e,t.maxZoom,t.tileSize,t.maxResolution)};return new vc(n)}function _g(i,t,e,n){t=t!==void 0?t:S_,e=le(e!==void 0?e:Nl);const s=Tt(i),r=it(i);n=n>0?n:Math.max(r/e[0],s/e[1]);const a=t+1,o=new Array(a);for(let h=0;hthis.getTileInternal(f,g,_,m,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=h,d}getTileInternal(t,e,n,s,r){const a=this.getKey();return this.createTile_(t,e,n,s,r,a)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const n=yt(t);if(n){const s=_t(n);s in this.tileGridForProjection||(this.tileGridForProjection[s]=e)}}}function L1(i,t){i.getImage().src=t}class P1 extends mg{constructor(t){const e=t.requestEncoding!==void 0?t.requestEncoding:"KVP",n=t.tileGrid;let s=t.urls;s===void 0&&t.url!==void 0&&(s=tg(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:s,wrapX:t.wrapX!==void 0?t.wrapX:!1,transition:t.transition,zDirection:t.zDirection}),this.version_=t.version!==void 0?t.version:"1.0.0",this.format_=t.format!==void 0?t.format:"image/jpeg",this.dimensions_=t.dimensions!==void 0?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),s&&s.length>0&&(this.tileUrlFunction=dl(s.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join(` -`);this.setTileUrlFunction(dl(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e=="KVP"?Po(t,n):t.replace(/\{(\w+?)\}/g,function(a,o){return o.toLowerCase()in n?n[o.toLowerCase()]:a});const s=this.tileGrid,r=this.dimensions_;return function(a,o,h){if(!a)return;const l={TileMatrix:s.getMatrixId(a[0]),TileCol:a[1],TileRow:a[2]};Object.assign(l,r);let c=t;return e=="KVP"?c=Po(c,l):c=c.replace(/\{(\w+?)\}/g,function(u,d){return l[d]}),c}}}function O1(i,t){const n=i.Contents.Layer?.find(function(T){return T.Identifier==t.layer});if(!n)return null;const s=i.Contents.TileMatrixSet;let r;n.TileMatrixSetLink.length>1?"projection"in t?r=n.TileMatrixSetLink.findIndex(function(T){const O=s.find(function(et){return et.Identifier==T.TileMatrixSet}).SupportedCRS,q=yt(O),L=yt(t.projection);return q&&L?An(q,L):O==t.projection}):r=n.TileMatrixSetLink.findIndex(function(T){return T.TileMatrixSet==t.matrixSet}):r=0,r<0&&(r=0);const a=n.TileMatrixSetLink[r].TileMatrixSet,o=n.TileMatrixSetLink[r].TileMatrixSetLimits;let h=n.Format[0];"format"in t&&(h=t.format),r=n.Style.findIndex(function(T){return"style"in t?T.Title==t.style:T.isDefault}),r<0&&(r=0);const l=n.Style[r].Identifier,c={};"Dimension"in n&&n.Dimension.forEach(function(T,z,O){const q=T.Identifier;let L=T.Default;L===void 0&&(L=T.Value[0]),c[q]=L});const d=i.Contents.TileMatrixSet.find(function(T){return T.Identifier==a});let f;const g=d.SupportedCRS;if(g&&(f=yt(g)),"projection"in t){const T=yt(t.projection);T&&(!f||An(T,f))&&(f=T)}let _=!1;const m=f.getAxisOrientation().startsWith("ne");let y=d.TileMatrix[0],p={MinTileCol:0,MinTileRow:0,MaxTileCol:y.MatrixWidth-1,MaxTileRow:y.MatrixHeight-1};if(o){p=o[o.length-1];const T=d.TileMatrix.find(z=>z.Identifier===p.TileMatrix||d.Identifier+":"+z.Identifier===p.TileMatrix);T&&(y=T)}const x=y.ScaleDenominator*28e-5/f.getMetersPerUnit(),E=m?[y.TopLeftCorner[1],y.TopLeftCorner[0]]:y.TopLeftCorner,M=y.TileWidth*x,R=y.TileHeight*x;let S=d.BoundingBox;S&&m&&(S=[S[1],S[0],S[3],S[2]]);let w=[E[0]+M*p.MinTileCol,E[1]-R*(1+p.MaxTileRow),E[0]+M*(1+p.MaxTileCol),E[1]-R*p.MinTileRow];if(S!==void 0&&!Ze(S,w)){const T=n.WGS84BoundingBox,z=yt("EPSG:4326").getExtent();if(w=S,T)_=T[0]===z[0]&&T[2]===z[2];else{const O=Z_(S,d.SupportedCRS,"EPSG:4326");_=O[0]-1e-10<=z[0]&&O[2]+1e-10>=z[2]}}const b=M1(d,w,o),B=[];let N=t.requestEncoding;if(N=N!==void 0?N:"","OperationsMetadata"in i&&"GetTile"in i.OperationsMetadata){const T=i.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let z=0,O=T.length;z0;)this.pop()}extend(t){for(let e=0,n=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new so(se.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let n=0,s=e.length;n=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new so(se.REMOVE,e,t)),e}setAt(t,e){const n=this.getLength();if(t>=n){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new so(se.REMOVE,s,t)),this.dispatchEvent(new so(se.ADD,e,t))}updateLength_(){this.set(bu.LENGTH,this.array_.length)}assertUnique_(t,e){for(let n=0,s=this.array_.length;nthis.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const n=this.cache_[e];!(t++&3)&&!n.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const s=Fh(t,e,n);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,n){const s=Fh(t,e,n);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,n,s,r){const a=Fh(t,e,n),o=a in this.cache_;this.cache_[a]=s,r&&(s.getImageState()===X.IDLE&&s.load(),s.getImageState()===X.LOADING?s.ready().then(()=>{this.patternCache_[a]=To().createPattern(s.getImage(1),"repeat")}):this.patternCache_[a]=To().createPattern(s.getImage(1),"repeat")),o||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Fh(i,t,e){const n=e?qr(e):"null";return t+":"+i+":"+n}const Je=new N1;let gr=null;class F1 extends Oa{constructor(t,e,n,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=s===void 0?X.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===X.LOADED){gr||(gr=bt(1,1,void 0,{willReadFrequently:!0})),gr.drawImage(this.image_,0,0);try{gr.getImageData(0,0,1,1),this.tainted_=!1}catch{gr=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent($.CHANGE)}handleImageError_(){this.imageState_=X.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=X.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=bt(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===X.IDLE){this.image_||this.initializeImage_(),this.imageState_=X.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&$f(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==X.LOADED)return;const e=this.image_,n=bt(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=n.canvas;n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=Ny(this.color_),n.fillRect(0,0,s.width/t,s.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===X.LOADED||this.imageState_===X.ERROR)t();else{const e=()=>{(this.imageState_===X.LOADED||this.imageState_===X.ERROR)&&(this.removeEventListener($.CHANGE,e),t())};this.addEventListener($.CHANGE,e)}})),this.ready_}}function wc(i,t,e,n,s,r){let a=t===void 0?void 0:Je.get(t,e,s);return a||(a=new F1(i,i&&"src"in i?i.src||void 0:t,e,n,s),Je.set(t,e,s,a,r)),r&&a&&!Je.getPattern(t,e,s)&&Je.set(t,e,s,a,r),a}class Ci{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new Ci({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const e=wc(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===X.IDLE&&e.load(),e.getImageState()===X.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function Tu(i,t,e,n,s,r,a){let o,h;const l=(e-t)/n;if(l===1)o=t;else if(l===2)o=t,h=s;else if(l!==0){let c=i[t],u=i[t+1],d=0;const f=[0];for(let m=t+n;m1?a:2,r=r||new Array(a);for(let c=0;c>1;sMath.max(s,No(i,r)),0);return e[t]=n,n}function U1(i,t){const e=[],n=[],s=[];let r=0,a=0,o=0,h=0;for(let l=0,c=t.length;l<=c;l+=2){const u=t[l];if(u===` -`||l===c){r=Math.max(r,a),s.push(a),a=0,o+=h,h=0;continue}const d=t[l+1]||i.font,f=No(d,u);e.push(f),a+=f;const g=B1(d);n.push(g),h=Math.max(h,g)}return{width:r,height:o,widths:e,heights:n,lineWidths:s}}function j1(i,t,e,n,s,r,a,o,h,l,c){i.save(),e!==1&&(i.globalAlpha===void 0?i.globalAlpha=u=>u.globalAlpha*=e:i.globalAlpha*=e),t&&i.transform.apply(i,t),n.contextInstructions?(i.translate(h,l),i.scale(c[0],c[1]),X1(n,i)):c[0]<0||c[1]<0?(i.translate(h,l),i.scale(c[0],c[1]),i.drawImage(n,s,r,a,o,0,0,a,o)):i.drawImage(n,s,r,a,o,h,l,a*c[0],o*c[1]),i.restore()}function X1(i,t){const e=i.contextInstructions;for(let n=0,s=e.length;nthis.imageState_=X.LOADED),this.render()}clone(){const t=this.getScale(),e=new ch({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const n=this.renderOptions_,s=bt(n.size*t,n.size*t);this.draw_(n,s,t),e=s.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(se;){if(n-e>600){const h=n-e+1,l=t-e+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),f=Math.max(e,Math.floor(t-l*u/h+d)),g=Math.min(n,Math.floor(t+(h-l)*u/h+d));Mg(i,t,f,g,s)}const r=i[t];let a=e,o=n;for(_r(i,e,t),s(i[n],r)>0&&_r(i,e,n);a0;)o--}s(i[e],r)===0?_r(i,e,o):(o++,_r(i,o,n)),o<=t&&(e=o+1),t<=o&&(n=o-1)}}function _r(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function Y1(i,t){return it?1:0}let wg=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!oo(t,e))return n;const s=this.toBBox,r=[];for(;e;){for(let a=0;a=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const n=t[e],s=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,s);const a=this._chooseSplitIndex(n,r,s),o=es(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,Vn(n,this.toBBox),Vn(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(n,o)}_splitRoot(t,e){this.data=es([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Vn(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let s,r=1/0,a=1/0;for(let o=e;o<=n-e;o++){const h=pr(t,0,o,this.toBBox),l=pr(t,o,n,this.toBBox),c=H1(h,l),u=Gh(h)+Gh(l);c=e;l--){const c=t.children[l];vr(o,t.leaf?r(c):c),h+=ao(o)}return h}_adjustParentBBoxes(t,e,n){for(let s=n;s>=0;s--)vr(e[s],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():Vn(t[e],this.toBBox)}};function V1(i,t,e){if(!e)return t.indexOf(i);for(let n=0;n=i.minX&&t.maxY>=i.minY}function es(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Nu(i,t,e,n,s){const r=[t,e];for(;r.length;){if(e=r.pop(),t=r.pop(),e-t<=n)continue;const a=t+Math.ceil((e-t)/n/2)*n;Mg(i,a,t,e,s),r.push(t,a,a,e)}}function Fu(i,t,e,n){return e!==void 0&&n!==void 0?[e/i,n/t]:e!==void 0?e/i:n!==void 0?n/t:1}class Zs extends hh{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,r=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:n,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const a=t.img!==void 0?t.img:null;let o=t.src;ht(!(o!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(o===void 0||o.length===0)&&a&&(o=a.src||_t(a)),ht(o!==void 0&&o.length>0,"A defined and non-empty `src` or `image` must be provided"),ht(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let h;if(t.src!==void 0?h=X.IDLE:a!==void 0&&("complete"in a?a.complete?h=a.src?X.LOADED:X.IDLE:h=X.LOADING:h=X.LOADED),this.color_=t.color!==void 0?qr(t.color):null,this.iconImage_=wc(a,o,this.crossOrigin_,h,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,this.initialOptions_,t.width!==void 0||t.height!==void 0){let l,c;if(t.size)[l,c]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)l=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const f=this.iconImage_.getSize();this.setScale(Fu(f[0],f[1],t.width,t.height))};this.listenImageChange(d);return}}l!==void 0&&this.setScale(Fu(l,c,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Zs({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=s[0]),this.anchorYUnits_=="fraction"&&(t[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==X.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==X.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener($.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener($.CHANGE,t)}ready(){return this.iconImage_.ready()}}let Gn=0;const Jt=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},ev={[C.Get]:Z(tt(1,1/0),ku),[C.Var]:Z(tt(1,1),iv),[C.Has]:Z(tt(1,1/0),ku),[C.Id]:Z(nv,Kn),[C.Concat]:Z(tt(2,1/0),lt(ae)),[C.GeometryType]:Z(sv,Kn),[C.LineMetric]:Z(Kn),[C.Resolution]:Z(Kn),[C.Zoom]:Z(Kn),[C.Time]:Z(Kn),[C.Any]:Z(tt(2,1/0),lt(Jt)),[C.All]:Z(tt(2,1/0),lt(Jt)),[C.Not]:Z(tt(1,1),lt(Jt)),[C.Equal]:Z(tt(2,2),lt(ho)),[C.NotEqual]:Z(tt(2,2),lt(ho)),[C.GreaterThan]:Z(tt(2,2),lt(st)),[C.GreaterThanOrEqualTo]:Z(tt(2,2),lt(st)),[C.LessThan]:Z(tt(2,2),lt(st)),[C.LessThanOrEqualTo]:Z(tt(2,2),lt(st)),[C.Multiply]:Z(tt(2,1/0),Gu),[C.Coalesce]:Z(tt(2,1/0),Gu),[C.Divide]:Z(tt(2,2),lt(st)),[C.Add]:Z(tt(2,1/0),lt(st)),[C.Subtract]:Z(tt(2,2),lt(st)),[C.Clamp]:Z(tt(3,3),lt(st)),[C.Mod]:Z(tt(2,2),lt(st)),[C.Pow]:Z(tt(2,2),lt(st)),[C.Abs]:Z(tt(1,1),lt(st)),[C.Floor]:Z(tt(1,1),lt(st)),[C.Ceil]:Z(tt(1,1),lt(st)),[C.Round]:Z(tt(1,1),lt(st)),[C.Sin]:Z(tt(1,1),lt(st)),[C.Cos]:Z(tt(1,1),lt(st)),[C.Atan]:Z(tt(1,2),lt(st)),[C.Sqrt]:Z(tt(1,1),lt(st)),[C.Match]:Z(tt(4,1/0),zu,av),[C.Between]:Z(tt(3,3),lt(st)),[C.Interpolate]:Z(tt(6,1/0),zu,ov),[C.Case]:Z(tt(3,1/0),rv,hv),[C.In]:Z(tt(2,2),lv),[C.Number]:Z(tt(1,1/0),lt(ho)),[C.String]:Z(tt(1,1/0),lt(ho)),[C.Array]:Z(tt(1,1/0),lt(st)),[C.Color]:Z(tt(1,4),lt(st)),[C.Band]:Z(tt(1,3),lt(st)),[C.Palette]:Z(tt(2,2),cv),[C.ToString]:Z(tt(1,1),lt(Jt|st|ae|Fe))};function ku(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;rt){const o=t===1/0?`${i} or more`:`${i} to ${t}`;throw new Error(`expected ${o} arguments for ${r}, got ${a}`)}}}function Gu(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;rn.featureId;case C.GeometryType:return n=>n.geometryType;case C.Concat:{const n=i.args.map(s=>Ue(s));return s=>"".concat(...n.map(r=>r(s).toString()))}case C.Resolution:return n=>n.resolution;case C.Any:case C.All:case C.Between:case C.In:case C.Not:return _v(i);case C.Equal:case C.NotEqual:case C.LessThan:case C.LessThanOrEqualTo:case C.GreaterThan:case C.GreaterThanOrEqualTo:return gv(i);case C.Multiply:case C.Divide:case C.Add:case C.Subtract:case C.Clamp:case C.Mod:case C.Pow:case C.Abs:case C.Floor:case C.Ceil:case C.Round:case C.Sin:case C.Cos:case C.Atan:case C.Sqrt:return mv(i);case C.Case:return yv(i);case C.Match:return pv(i);case C.Interpolate:return vv(i);case C.ToString:return xv(i);default:throw new Error(`Unsupported operator ${e}`)}}function dv(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r{for(let a=0;a{for(let a=0;a{const r=i.args;let a=s.properties[n];for(let o=1,h=r.length;os.variables[n];case C.Has:return s=>{const r=i.args;if(!(n in s.properties))return!1;let a=s.properties[n];for(let o=1,h=r.length;on(r)===s(r);case C.NotEqual:return r=>n(r)!==s(r);case C.LessThan:return r=>n(r)n(r)<=s(r);case C.GreaterThan:return r=>n(r)>s(r);case C.GreaterThanOrEqualTo:return r=>n(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${e}`)}}function _v(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r{for(let a=0;a{for(let a=0;a{const a=s[0](r),o=s[1](r),h=s[2](r);return a>=o&&a<=h};case C.In:return r=>{const a=s[0](r);for(let o=1;o!s[0](r);default:throw new Error(`Unsupported logical operator ${e}`)}}function mv(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r{let a=1;for(let o=0;os[0](r)/s[1](r);case C.Add:return r=>{let a=0;for(let o=0;os[0](r)-s[1](r);case C.Clamp:return r=>{const a=s[0](r),o=s[1](r);if(ah?h:a};case C.Mod:return r=>s[0](r)%s[1](r);case C.Pow:return r=>Math.pow(s[0](r),s[1](r));case C.Abs:return r=>Math.abs(s[0](r));case C.Floor:return r=>Math.floor(s[0](r));case C.Ceil:return r=>Math.ceil(s[0](r));case C.Round:return r=>Math.round(s[0](r));case C.Sin:return r=>Math.sin(s[0](r));case C.Cos:return r=>Math.cos(s[0](r));case C.Atan:return n===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case C.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${e}`)}}function yv(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s{for(let r=0;r{const r=n[0](s);for(let a=1;a{const r=n[0](s),a=n[1](s);let o,h;for(let l=2;l=a)return l===2?u:d?Ev(r,a,o,h,c,u):wr(r,a,o,h,c,u);o=c,h=u}return h}}function xv(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r{const a=s[0](r);return i.args[0].type===Fe?cc(a):a.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function wr(i,t,e,n,s,r){const a=s-e;if(a===0)return n;const o=t-e,h=i===1?o/a:(Math.pow(i,o)-1)/(Math.pow(i,a)-1);return n+h*(r-n)}function Ev(i,t,e,n,s,r){if(s-e===0)return n;const o=xu(n),h=xu(r);let l=h[2]-o[2];l>180?l-=360:l<-180&&(l+=360);const c=[wr(i,t,e,o[0],s,h[0]),wr(i,t,e,o[1],s,h[1]),o[2]+wr(i,t,e,0,s,l),wr(i,t,e,n[3],s,r[3])];return Kf(Gy(c))}function Mv(i){return!0}function wv(i){const t=Sg(),e=Sv(i,t),n=Cg();return function(s,r){if(n.properties=s.getPropertiesInternal(),n.resolution=r,t.featureId){const a=s.getId();a!==void 0?n.featureId=a:n.featureId=null}return t.geometryType&&(n.geometryType=Rg(s.getGeometry())),e(n)}}function Wu(i){const t=Sg(),e=i.length,n=new Array(e);for(let a=0;anull;n=Ic(i,t+"fill-color",e)}if(!n)return null;const s=new Ci;return function(r){const a=n(r);return a===hc?null:(s.setColor(a),s)}}function Hr(i,t,e){const n=oe(i,t+"stroke-width",e),s=Ic(i,t+"stroke-color",e);if(!n&&!s)return null;const r=mi(i,t+"stroke-line-cap",e),a=mi(i,t+"stroke-line-join",e),o=Ig(i,t+"stroke-line-dash",e),h=oe(i,t+"stroke-line-dash-offset",e),l=oe(i,t+"stroke-miter-limit",e),c=new Ht;return function(u){if(s){const d=s(u);if(d===hc)return null;c.setColor(d)}if(n&&c.setWidth(n(u)),r){const d=r(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");c.setLineCap(d)}if(a){const d=a(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");c.setLineJoin(d)}return o&&c.setLineDash(o(u)),h&&c.setLineDashOffset(h(u)),l&&c.setMiterLimit(l(u)),c}}function Rv(i,t){const e="text-",n=mi(i,e+"value",t);if(!n)return null;const s=$r(i,e,t),r=$r(i,e+"background-",t),a=Hr(i,e,t),o=Hr(i,e+"background-",t),h=mi(i,e+"font",t),l=oe(i,e+"max-angle",t),c=oe(i,e+"offset-x",t),u=oe(i,e+"offset-y",t),d=Jr(i,e+"overflow",t),f=mi(i,e+"placement",t),g=oe(i,e+"repeat",t),_=uh(i,e+"scale",t),m=Jr(i,e+"rotate-with-view",t),y=oe(i,e+"rotation",t),p=mi(i,e+"align",t),x=mi(i,e+"justify",t),E=mi(i,e+"baseline",t),M=Ig(i,e+"padding",t),R=dh(i,e+"declutter-mode"),S=new Rc({declutterMode:R});return function(w){if(S.setText(n(w)),s&&S.setFill(s(w)),r&&S.setBackgroundFill(r(w)),a&&S.setStroke(a(w)),o&&S.setBackgroundStroke(o(w)),h&&S.setFont(h(w)),l&&S.setMaxAngle(l(w)),c&&S.setOffsetX(c(w)),u&&S.setOffsetY(u(w)),d&&S.setOverflow(d(w)),f){const b=f(w);if(b!=="point"&&b!=="line")throw new Error("Expected point or line for text-placement");S.setPlacement(b)}if(g&&S.setRepeat(g(w)),_&&S.setScale(_(w)),m&&S.setRotateWithView(m(w)),y&&S.setRotation(y(w)),p){const b=p(w);if(b!=="left"&&b!=="center"&&b!=="right"&&b!=="end"&&b!=="start")throw new Error("Expected left, right, center, start, or end for text-align");S.setTextAlign(b)}if(x){const b=x(w);if(b!=="left"&&b!=="right"&&b!=="center")throw new Error("Expected left, right, or center for text-justify");S.setJustify(b)}if(E){const b=E(w);if(b!=="bottom"&&b!=="top"&&b!=="middle"&&b!=="alphabetic"&&b!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");S.setTextBaseline(b)}return M&&S.setPadding(M(w)),S}}function Cv(i,t){return"icon-src"in i?Iv(i,t):"shape-points"in i?bv(i,t):"circle-radius"in i?Tv(i,t):null}function Iv(i,t){const e="icon-",n=e+"src",s=bg(i[n],n),r=Fo(i,e+"anchor",t),a=uh(i,e+"scale",t),o=oe(i,e+"opacity",t),h=Fo(i,e+"displacement",t),l=oe(i,e+"rotation",t),c=Jr(i,e+"rotate-with-view",t),u=Uu(i,e+"anchor-origin"),d=ju(i,e+"anchor-x-units"),f=ju(i,e+"anchor-y-units"),g=Dv(i,e+"color"),_=Pv(i,e+"cross-origin"),m=Ov(i,e+"offset"),y=Uu(i,e+"offset-origin"),p=ko(i,e+"width"),x=ko(i,e+"height"),E=Lv(i,e+"size"),M=dh(i,e+"declutter-mode"),R=new Zs({src:s,anchorOrigin:u,anchorXUnits:d,anchorYUnits:f,color:g,crossOrigin:_,offset:m,offsetOrigin:y,height:x,width:p,size:E,declutterMode:M});return function(S){return o&&R.setOpacity(o(S)),h&&R.setDisplacement(h(S)),l&&R.setRotation(l(S)),c&&R.setRotateWithView(c(S)),a&&R.setScale(a(S)),r&&R.setAnchor(r(S)),R}}function bv(i,t){const e="shape-",n=e+"points",s=e+"radius",r=ml(i[n],n),a=ml(i[s],s),o=$r(i,e,t),h=Hr(i,e,t),l=uh(i,e+"scale",t),c=Fo(i,e+"displacement",t),u=oe(i,e+"rotation",t),d=Jr(i,e+"rotate-with-view",t),f=ko(i,e+"radius2"),g=ko(i,e+"angle"),_=dh(i,e+"declutter-mode"),m=new ch({points:r,radius:a,radius2:f,angle:g,declutterMode:_});return function(y){return o&&m.setFill(o(y)),h&&m.setStroke(h(y)),c&&m.setDisplacement(c(y)),u&&m.setRotation(u(y)),d&&m.setRotateWithView(d(y)),l&&m.setScale(l(y)),m}}function Tv(i,t){const e="circle-",n=$r(i,e,t),s=Hr(i,e,t),r=oe(i,e+"radius",t),a=uh(i,e+"scale",t),o=Fo(i,e+"displacement",t),h=oe(i,e+"rotation",t),l=Jr(i,e+"rotate-with-view",t),c=dh(i,e+"declutter-mode"),u=new ka({radius:5,declutterMode:c});return function(d){return r&&u.setRadius(r(d)),n&&u.setFill(n(d)),s&&u.setStroke(s(d)),o&&u.setDisplacement(o(d)),h&&u.setRotation(h(d)),l&&u.setRotateWithView(l(d)),a&&u.setScale(a(d)),u}}function oe(i,t,e){if(!(t in i))return;const n=bi(i[t],st,e);return function(s){return ml(n(s),t)}}function mi(i,t,e){if(!(t in i))return null;const n=bi(i[t],ae,e);return function(s){return bg(n(s),t)}}function Av(i,t,e){const n=mi(i,t+"pattern-src",e),s=Bu(i,t+"pattern-offset",e),r=Bu(i,t+"pattern-size",e),a=Ic(i,t+"color",e);return function(o){return{src:n(o),offset:s&&s(o),size:r&&r(o),color:a&&a(o)}}}function Jr(i,t,e){if(!(t in i))return null;const n=bi(i[t],Jt,e);return function(s){const r=n(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${t}`);return r}}function Ic(i,t,e){if(!(t in i))return null;const n=bi(i[t],Fe,e);return function(s){return Tg(n(s),t)}}function Ig(i,t,e){if(!(t in i))return null;const n=bi(i[t],Pn,e);return function(s){return Ga(n(s),t)}}function Fo(i,t,e){if(!(t in i))return null;const n=bi(i[t],Pn,e);return function(s){const r=Ga(n(s),t);if(r.length!==2)throw new Error(`Expected two numbers for ${t}`);return r}}function Bu(i,t,e){if(!(t in i))return null;const n=bi(i[t],Pn,e);return function(s){return Ag(n(s),t)}}function uh(i,t,e){if(!(t in i))return null;const n=bi(i[t],Pn|st,e);return function(s){return Nv(n(s),t)}}function ko(i,t){const e=i[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function Lv(i,t){const e=i[t];if(e!==void 0){if(typeof e=="number")return le(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function Pv(i,t){const e=i[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function Uu(i,t){const e=i[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function ju(i,t){const e=i[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function Ov(i,t){const e=i[t];if(e!==void 0)return Ga(e,t)}function dh(i,t){const e=i[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function Dv(i,t){const e=i[t];if(e!==void 0)return Tg(e,t)}function Ga(i,t){if(!Array.isArray(i))throw new Error(`Expected an array for ${t}`);const e=i.length;for(let n=0;n4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function Ag(i,t){const e=Ga(i,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function Nv(i,t){return typeof i=="number"?i:Ag(i,t)}const Xu={RENDER_ORDER:"renderOrder"};class Lg extends kn{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Xu.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new wg(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Xu.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?Eg:t;const e=Fv(t);this.styleFunction_=t===null?void 0:xg(e),this.changed()}}function Fv(i){if(i===void 0)return Eg;if(!i)return null;if(typeof i=="function"||i instanceof Ct)return i;if(!Array.isArray(i))return Wu([i]);if(i.length===0)return[];const t=i.length,e=i[0];if(e instanceof Ct){const s=new Array(t);for(let r=0;rh&&(this.instructions.push([Y.CUSTOM,h,c,t,n,as,r]),this.hitDetectionInstructions.push([Y.CUSTOM,h,c,t,s||n,as,r]));break;case"Point":l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),c=this.coordinates.length,this.instructions.push([Y.CUSTOM,h,c,t,n,void 0,r]),this.hitDetectionInstructions.push([Y.CUSTOM,h,c,t,s||n,void 0,r]);break}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[Y.BEGIN_GEOMETRY,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Y.BEGIN_GEOMETRY,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let s,r,a=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0}createFill(t){const e=t.fillStyle,n=[Y.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[Y.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,s=t.lineCap,r=t.lineDash,a=t.lineDashOffset,o=t.lineJoin,h=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=s||r!=t.currentLineDash&&!on(t.currentLineDash,r)||t.currentLineDashOffset!=a||t.currentLineJoin!=o||t.currentLineWidth!=h||t.currentMiterLimit!=l)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=a,t.currentLineJoin=o,t.currentLineWidth=h,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[Y.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Jd(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;kl(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class kv extends za{constructor(t,e,n,s){super(t,e,n,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,n){if(!this.image_||this.maxExtent&&!Ln(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=t.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(s,r);this.instructions.push([Y.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Y.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=[];for(let h=0,l=s.length;h=i){const g=(i-o+f)/f,_=ge(l,u,g),m=ge(c,d,g);h.push(_,m),r.push(h),h=[_,m],o==i&&(a+=s),o=0}else if(o0&&r.push(h),r}function Wv(i,t,e,n,s){let r=e,a=e,o=0,h=0,l=e,c,u,d,f,g,_,m,y,p,x;for(u=e;ui&&(h>o&&(o=h,r=l,a=u),h=0,l=u-s)),d=f,m=p,y=x),g=E,_=M}return h+=f,h>o?[l,u]:[r,a]}const Go={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class Bv extends za{constructor(t,e,n,s){super(t,e,n,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[re]={fillStyle:re},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,n){const s=this.textFillState_,r=this.textStrokeState_,a=this.textState_;if(this.text_===""||!a||!s&&!r)return;const o=this.coordinates;let h=o.length;const l=t.getType();let c=null,u=t.getStride();if(a.placement==="line"&&(l=="LineString"||l=="MultiLineString"||l=="Polygon"||l=="MultiPolygon")){if(!Qt(this.maxExtent,t.getExtent()))return;let d;if(c=t.getFlatCoordinates(),l=="LineString")d=[c.length];else if(l=="MultiLineString")d=t.getEnds();else if(l=="Polygon")d=t.getEnds().slice(0,1);else if(l=="MultiPolygon"){const m=t.getEndss();d=[];for(let y=0,p=m.length;y{const M=o[(p+E)*2]===c[E*u]&&o[(p+E)*2+1]===c[E*u+1];return M||--p,M})}this.saveTextStates_(),(a.backgroundFill||a.backgroundStroke)&&(this.setFillStrokeStyle(a.backgroundFill,a.backgroundStroke),a.backgroundFill&&this.updateFillStyle(this.state,this.createFill),a.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,n);let g=a.padding;if(g!=xn&&(a.scale[0]<0||a.scale[1]<0)){let p=a.padding[0],x=a.padding[1],E=a.padding[2],M=a.padding[3];a.scale[0]<0&&(x=-x,M=-M),a.scale[1]<0&&(p=-p,E=-E),g=[p,x,E,M]}const _=this.pixelRatio;this.instructions.push([Y.DRAW_IMAGE,h,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,g==xn?xn:g.map(function(p){return p*_}),!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const m=1/_,y=this.state.fillStyle;a.backgroundFill&&(this.state.fillStyle=re,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([Y.DRAW_IMAGE,h,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterMode_,this.declutterImageWithText_,g,!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?re:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),a.backgroundFill&&(this.state.fillStyle=y,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||Kr,justify:e.justify,textBaseline:e.textBaseline||Do,scale:e.scale});const a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();const h=this.pixelRatio,l=Go[s.textBaseline],c=this.textOffsetY_*h,u=this.text_,d=n?n.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([Y.DRAW_CHARS,t,e,l,s.overflow,o,s.maxAngle,h,c,r,d*h,u,a,1,this.declutterMode_]),this.hitDetectionInstructions.push([Y.DRAW_CHARS,t,e,l,s.overflow,o&&re,s.maxAngle,h,c,r,d*h,u,a,1/h,this.declutterMode_])}setTextStyle(t,e){let n,s,r;if(!t)this.text_="";else{const a=t.getFill();a?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=Qe(a.getColor()||re)):(s=null,this.textFillState_=s);const o=t.getStroke();if(!o)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const g=o.getLineDash(),_=o.getLineDashOffset(),m=o.getWidth(),y=o.getMiterLimit();r.lineCap=o.getLineCap()||Vs,r.lineDash=g?g.slice():Mi,r.lineDashOffset=_===void 0?wi:_,r.lineJoin=o.getLineJoin()||Ks,r.lineWidth=m===void 0?Zr:m,r.miterLimit=y===void 0?Yr:y,r.strokeStyle=Qe(o.getColor()||Vr)}n=this.textState_;const h=t.getFont()||pg;W1(h);const l=t.getScaleArray();n.overflow=t.getOverflow(),n.font=h,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Do,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||xn,n.scale=l===void 0?[1,1]:l;const c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),f=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:_t(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+_t(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const Uv={Circle:Yu,Default:za,Image:kv,LineString:Gv,Polygon:Yu,Text:Bv};class jv{constructor(t,e,n,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const s in n){const r=n[s].finish();t[e][s]=r}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[n];s===void 0&&(s={},this.buildersByZIndex_[n]=s);let r=s[e];if(r===void 0){const a=Uv[e];r=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=r}return r}}function Xv(i,t,e,n,s,r,a,o,h,l,c,u){let d=i[t],f=i[t+1],g=0,_=0,m=0,y=0;function p(){g=d,_=f,t+=n,d=i[t],f=i[t+1],y+=m,m=Math.sqrt((d-g)*(d-g)+(f-_)*(f-_))}do p();while(tL[2]}else N=E>b;const T=Math.PI,z=[],O=R+n===t;t=R,m=0,y=S,d=i[t],f=i[t+1];let q;if(O){p(),q=Math.atan2(f-_,d-g),N&&(q+=q>0?-T:T);const L=(b+E)/2,et=(B+M)/2;return z[0]=[L,et,(w-r)/2,q,s],z}s=s.replace(/\n/g," ");for(let L=0,et=s.length;L0?-T:T),q!==void 0){let P=nt-q;if(P+=P>T?-2*T:P<-T?2*T:0,Math.abs(P)>a)return null}q=nt;const xt=L;let K=0;for(;L0&&i.push(` -`,""),i.push(t,""),i}class Yv{constructor(t,e,n,s,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=We(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new Yf:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,n,s){const r=t+e+n+s;if(this.labels_[r])return this.labels_[r];const a=s?this.strokeStates[s]:null,o=n?this.fillStates[n]:null,h=this.textStates[e],l=this.pixelRatio,c=[h.scale[0]*l,h.scale[1]*l],u=h.justify?Go[h.justify]:Wh(Array.isArray(t)?t[0]:t,h.textAlign||Kr),d=s&&a.lineWidth?a.lineWidth:0,f=Array.isArray(t)?t:String(t).split(` -`).reduce(qv,[]),{width:g,height:_,widths:m,heights:y,lineWidths:p}=U1(h,f),x=g+d,E=[],M=(x+2)*c[0],R=(_+d)*c[1],S={width:M<0?Math.floor(M):Math.ceil(M),height:R<0?Math.floor(R):Math.ceil(R),contextInstructions:E};(c[0]!=1||c[1]!=1)&&E.push("scale",c),s&&(E.push("strokeStyle",a.strokeStyle),E.push("lineWidth",d),E.push("lineCap",a.lineCap),E.push("lineJoin",a.lineJoin),E.push("miterLimit",a.miterLimit),E.push("setLineDash",[a.lineDash]),E.push("lineDashOffset",a.lineDashOffset)),n&&E.push("fillStyle",o.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");const w=.5-u;let b=u*x+w*d;const B=[],N=[];let T=0,z=0,O=0,q=0,L;for(let et=0,nt=f.length;ett?t-l:r,E=a+c>e?e-c:a,M=g[3]+x*d[0]+g[1],R=g[0]+E*d[1]+g[2],S=y-g[3],w=p-g[0];(_||u!==0)&&(Di[0]=S,Ni[0]=S,Di[1]=w,di[1]=w,di[0]=S+M,fi[0]=di[0],fi[1]=w+R,Ni[1]=fi[1]);let b;return u!==0?(b=ii(We(),n,s,1,1,u,-n,-s),kt(b,Di),kt(b,di),kt(b,fi),kt(b,Ni),Si(Math.min(Di[0],di[0],fi[0],Ni[0]),Math.min(Di[1],di[1],fi[1],Ni[1]),Math.max(Di[0],di[0],fi[0],Ni[0]),Math.max(Di[1],di[1],fi[1],Ni[1]),Zn)):Si(Math.min(S,S+M),Math.min(w,w+R),Math.max(S,S+M),Math.max(w,w+R),Zn),f&&(y=Math.round(y),p=Math.round(p)),{drawImageX:y,drawImageY:p,drawImageW:x,drawImageH:E,originX:l,originY:c,declutterBox:{minX:Zn[0],minY:Zn[1],maxX:Zn[2],maxY:Zn[3],value:m},canvasTransform:b,scale:d}}replayImageOrLabel_(t,e,n,s,r,a,o){const h=!!(a||o),l=s.declutterBox,c=o?o[2]*s.scale[0]/2:0;return l.minX-c<=e[0]&&l.maxX+c>=0&&l.minY-c<=e[1]&&l.maxY+c>=0&&(h&&this.replayTextBackground_(t,Di,di,fi,Ni,a,o),j1(t,s.canvasTransform,r,n,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=kt(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(n[0]%s,n[1]%s),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,n,s){const r=this.textStates[e],a=this.createLabel(t,e,s,n),o=this.strokeStates[n],h=this.pixelRatio,l=Wh(Array.isArray(t)?t[0]:t,r.textAlign||Kr),c=Go[r.textBaseline||Do],u=o&&o.lineWidth?o.lineWidth:0,d=a.width/h-2*r.scale[0],f=l*d+2*(.5-l)*u,g=c*a.height/h+2*(.5-c)*u;return{label:a,anchorX:f,anchorY:g}}execute_(t,e,n,s,r,a,o,h){const l=this.zIndexContext_;let c;this.pixelCoordinates_&&on(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=en(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),am(this.renderedTransform_,n));let u=0;const d=s.length;let f=0,g,_,m,y,p,x,E,M,R,S,w,b,B,N=0,T=0,z=null,O=null;const q=this.coordinateCache_,L=this.viewRotation_,et=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,nt={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:L},xt=this.instructions!=s||this.overlaps?0:200;let K,Q,pt,zt;for(;uxt&&(this.fill_(t),N=0),T>xt&&(t.stroke(),T=0),!N&&!T&&(t.beginPath(),p=NaN,x=NaN),++u;break;case Y.CIRCLE:f=P[1];const Wt=c[f],Ot=c[f+1],je=c[f+2],hi=c[f+3],ye=je-Wt,Ai=hi-Ot,ar=Math.sqrt(ye*ye+Ai*Ai);t.moveTo(Wt+ar,Ot),t.arc(Wt,Ot,ar,0,2*Math.PI,!0),++u;break;case Y.CLOSE_PATH:t.closePath(),++u;break;case Y.CUSTOM:f=P[1],g=P[2];const Va=P[3],_h=P[4],or=P[5];nt.geometry=Va,nt.feature=K,u in q||(q[u]=[]);const ln=q[u];or?or(c,f,g,2,ln):(ln[0]=c[f],ln[1]=c[f+1],ln.length=2),l&&(l.zIndex=P[6]),_h(ln,nt),++u;break;case Y.DRAW_IMAGE:f=P[1],g=P[2],R=P[3],_=P[4],m=P[5];let pe=P[6];const Xe=P[7],zn=P[8],Wn=P[9],hr=P[10];let cn=P[11];const Bn=P[12];let Un=P[13];y=P[14]||"declutter";const Dt=P[15];if(!R&&P.length>=20){S=P[19],w=P[20],b=P[21],B=P[22];const ve=this.drawLabelWithPointPlacement_(S,w,b,B);R=ve.label,P[3]=R;const un=P[23];_=(ve.anchorX-un)*this.pixelRatio,P[4]=_;const xe=P[24];m=(ve.anchorY-xe)*this.pixelRatio,P[5]=m,pe=R.height,P[6]=pe,Un=R.width,P[13]=Un}let mh;P.length>25&&(mh=P[25]);let yh,Ka,Za;P.length>17?(yh=P[16],Ka=P[17],Za=P[18]):(yh=xn,Ka=!1,Za=!1),hr&&et?cn+=L:!hr&&!et&&(cn-=L);let C0=0;for(;f!Og.includes(i));class Kv{constructor(t,e,n,s,r,a,o){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=We(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,o)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let s=this.executorsByZIndex_[n];s===void 0&&(s={},this.executorsByZIndex_[n]=s);const r=t[n];for(const a in r){const o=r[a];s[a]=new Yv(this.resolution_,this.pixelRatio_,this.overlaps_,o,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let s=0,r=t.length;s0){if(!a||S==="none"||f!=="Image"&&f!=="Text"||a.includes(M)){const N=(d[b]-3)/4,T=s-N%o,z=s-(N/o|0),O=r(M,R,T*T+z*z);if(O)return O}c.clearRect(0,0,o,o);break}}const _=Object.keys(this.executorsByZIndex_).map(Number);_.sort(vi);let m,y,p,x,E;for(m=_.length-1;m>=0;--m){const M=_[m].toString();for(p=this.executorsByZIndex_[M],y=os.length-1;y>=0;--y)if(f=os[y],x=p[f],x!==void 0&&(E=x.executeHitDetection(c,h,n,g,u),E))return E}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],s=e[1],r=e[2],a=e[3],o=[n,s,n,a,r,a,r,s];return en(o,0,8,2,t,o),o}isEmpty(){return zs(this.executorsByZIndex_)}execute(t,e,n,s,r,a,o){const h=Object.keys(this.executorsByZIndex_).map(Number);h.sort(vi),a=a||os;const l=os.length;let c,u,d,f,g;for(o&&h.reverse(),c=0,u=h.length;cy.execute(M,e,n,s,r,o)),E&&x.restore(),p){p.offset();const M=h[c]*l+d;this.deferredZIndexContexts_[M]||(this.deferredZIndexContexts_[M]=[]),this.deferredZIndexContexts_[M].push(p)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(vi);for(let n=0,s=e.length;n{r.draw(this.renderedContext_),r.clear()}),t[e[n]].length=0}}const Bh={};function Zv(i){if(Bh[i]!==void 0)return Bh[i];const t=i*2+1,e=i*i,n=new Array(e+1);for(let r=0;r<=i;++r)for(let a=0;a<=i;++a){const o=r*r+a*a;if(o>e)break;let h=n[o];h||(h=[],n[o]=h),h.push(((i+r)*t+(i+a))*4+3),r>0&&h.push(((i-r)*t+(i+a))*4+3),a>0&&(h.push(((i+r)*t+(i-a))*4+3),r>0&&h.push(((i-r)*t+(i-a))*4+3))}const s=[];for(let r=0,a=n.length;ru*this.pixelRatio_),lineDashOffset:(a||wi)*this.pixelRatio_,lineJoin:o!==void 0?o:Ks,lineWidth:(h!==void 0?h:Zr)*this.pixelRatio_,miterLimit:l!==void 0?l:Yr,strokeStyle:Qe(n||Vr)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*n,this.imageAnchorY_=s[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const a=t.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const f=e.getColor();this.textFillState_={fillStyle:Qe(f||re)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const f=n.getColor(),g=n.getLineCap(),_=n.getLineDash(),m=n.getLineDashOffset(),y=n.getLineJoin(),p=n.getWidth(),x=n.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:Vs,lineDash:_||Mi,lineDashOffset:m||wi,lineJoin:y!==void 0?y:Ks,lineWidth:p!==void 0?p:Zr,miterLimit:x!==void 0?x:Yr,strokeStyle:Qe(f||Vr)}}const s=t.getFont(),r=t.getOffsetX(),a=t.getOffsetY(),o=t.getRotateWithView(),h=t.getRotation(),l=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:s!==void 0?s:pg,textAlign:u!==void 0?u:Kr,textBaseline:d!==void 0?d:Do},this.text_=c!==void 0?Array.isArray(c)?c.reduce((f,g,_)=>f+=_%2?" ":g,""):c:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=a!==void 0?this.pixelRatio_*a:0,this.textRotateWithView_=o!==void 0?o:!1,this.textRotation_=h!==void 0?h:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}}}const Ke=.5;function Hv(i,t,e,n,s,r,a,o,h){const l=h?ql(s):s,c=i[0]*Ke,u=i[1]*Ke,d=bt(c,u);d.imageSmoothingEnabled=!1;const f=d.canvas,g=new $v(d,Ke,s,null,a,o,h?ah(H_(),h):null),_=e.length,m=Math.floor((256*256*256-1)/_),y={};for(let x=1;x<=_;++x){const E=e[x-1],M=E.getStyleFunction()||n;if(!M)continue;let R=M(E,r);if(!R)continue;Array.isArray(R)||(R=[R]);const w=(x*m).toString(16).padStart(7,"#00000");for(let b=0,B=R.length;b0;return u&&Promise.all(h).then(()=>s(null)),ix(i,t,e,n,r,a,o),u}function ix(i,t,e,n,s,r,a){const o=e.getGeometryFunction()(t);if(!o)return;const h=o.simplifyTransformed(n,s);if(e.getRenderer())Fg(i,h,e,t,a);else{const c=Dg[h.getType()];c(i,h,e,t,a,r)}}function Fg(i,t,e,n,s){if(t.getType()=="GeometryCollection"){const a=t.getGeometries();for(let o=0,h=a.length;o{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,a=this.renderedRotation_,o=this.renderedProjection_,h=this.wrappedRenderedExtent_,l=this.getLayer(),c=[],u=n[0]*Ke,d=n[1]*Ke;c.push(this.getRenderTransform(s,r,a,Ke,u,d,0).slice());const f=l.getSource(),g=o.getExtent();if(f.getWrapX()&&o.canWrapX()&&!Ze(g,h)){let _=h[0];const m=it(g);let y=0,p;for(;_g[2];)++y,p=m*y,c.push(this.getRenderTransform(s,r,a,Ke,u,d,p).slice()),_-=m}this.hitDetectionImageData_=Hv(n,c,this.renderedFeatures_,l.getStyleFunction(),h,r,a,Zu(r,this.renderedPixelRatio_),null)}e(Jv(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,s,r){if(!this.replayGroup_)return;const a=e.viewState.resolution,o=e.viewState.rotation,h=this.getLayer(),l={},c=function(g,_,m){const y=_t(g),p=l[y];if(p){if(p!==!0&&mu=g.forEachFeatureAtCoordinate(t,a,o,n,c,f&&e.declutter[f]?e.declutter[f].all().map(_=>_.value):null)),u}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const s=t.viewHints[Ft.ANIMATING],r=t.viewHints[Ft.INTERACTING],a=e.getUpdateWhileAnimating(),o=e.getUpdateWhileInteracting();if(this.ready&&!a&&s||!o&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const h=t.extent,l=t.viewState,c=l.projection,u=l.resolution,d=t.pixelRatio,f=e.getRevision(),g=e.getRenderBuffer();let _=e.getRenderOrder();_===void 0&&(_=tx);const m=l.center.slice(),y=kl(h,g*u),p=y.slice(),x=[y.slice()],E=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!Ze(E,t.extent)){const O=it(E),q=Math.max(it(y)/2,O);y[0]=E[0]-q,y[2]=E[2]+q,hf(m,c);const L=af(x[0],c);L[0]E[0]&&L[2]>E[2]&&x.push([L[0]-O,L[1],L[2]-O,L[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==_&&this.renderedFrameDeclutter_===!!t.declutter&&Ze(this.wrappedRenderedExtent_,y))return on(this.renderedExtent_,p)||(this.hitDetectionImageData_=null,this.renderedExtent_=p),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const M=new jv(Ng(u,d),y,u,d);let R;for(let O=0,q=x.length;O{let L;const et=O.getStyleFunction()||e.getStyleFunction();if(et&&(L=et(O,u)),L){const nt=this.renderFeature(O,S,L,M,R,this.getLayer().getDeclutter(),q);w=w&&!nt}},B=ql(y),N=n.getFeaturesInExtent(B);_&&N.sort(_);for(let O=0,q=N.length;O{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":n.length=Hl(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),s=[n.length];break;case"MultiLineString":s=[],n.length=_m(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,s);break;case"Polygon":s=[],n.length=Jl(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,s);break}return s&&(this.simplifiedGeometry_=new Ne(this.type_,n,s,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Ne.prototype.getFlatCoordinates=Ne.prototype.getOrientedFlatCoordinates;const Me={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function fx(i,t){return[[-1/0,-1/0,1/0,1/0]]}function dC(i,t){return[i]}let gx=!1;function _x(i,t,e,n,s,r,a){const o=new XMLHttpRequest;o.open("GET",typeof i=="function"?i(e,n,s):i,!0),t.getType()=="arraybuffer"&&(o.responseType="arraybuffer"),o.withCredentials=gx,o.onload=function(h){if(!o.status||o.status>=200&&o.status<300){const l=t.getType();try{let c;l=="text"||l=="json"?c=o.responseText:l=="xml"?c=o.responseXML||o.responseText:l=="arraybuffer"&&(c=o.response),c?r(t.readFeatures(c,{extent:e,featureProjection:s}),t.readProjection(c)):a()}catch{a()}}else a()},o.onerror=a,o.send()}function Qu(i,t){return function(e,n,s,r,a){const o=this;_x(i,t,e,n,s,function(h,l){o.addFeatures(h),r!==void 0&&r(h)},a||Gs)}}class Fi extends ri{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class mx extends _c{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Gs,this.format_=t.format||null,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(ht(this.format_,"`format` must be set when `url` is set"),this.loader_=Qu(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:fx;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new Hu:null,this.loadedExtentsRtree_=new Hu,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,s;Array.isArray(t.features)?s=t.features:t.features&&(n=t.features,s=n.getArray()),!e&&n===void 0&&(n=new He(s)),s!==void 0&&this.addFeaturesInternal(s),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=_t(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const s=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Fi(Me.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof Ne||(this.featureChangeKeys_[t]=[at(e,$.CHANGE,this.handleFeatureChange_,this),at(e,Ws.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(e.getId()!==void 0){const s=String(e.getId());if(!(s in this.idIndex_))this.idIndex_[s]=e;else if(e instanceof Ne){const r=this.idIndex_[s];r instanceof Ne?Array.isArray(r)?r.push(e):this.idIndex_[s]=[r,e]:n=!1}else n=!1}return n&&(ht(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],s=[];for(let r=0,a=t.length;r{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener(se.REMOVE,n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(vt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const n=s=>{this.removeFeatureInternal(s)};this.featuresRtree_.forEach(n);for(const s in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Fi(Me.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(s){const r=s.getGeometry();if(r instanceof Ne||r.intersectsCoordinate(t))return e(s)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const s=n.getGeometry();if(s instanceof Ne||s.intersectsExtent(t)){const r=e(n);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),zs(this.nullGeometryFeatures_)||th(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=zl(t,e);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],s=t[1];let r=null;const a=[NaN,NaN];let o=1/0;const h=[-1/0,-1/0,1/0,1/0];return e=e||Gr,this.featuresRtree_.forEachInExtent(h,function(l){if(e(l)){const c=l.getGeometry(),u=o;if(o=c instanceof Ne?0:c.closestPointXY(n,s,a,o),o{--this.loadingExtentsCount_,this.dispatchEvent(new Fi(Me.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Fi(Me.FEATURESLOADERROR))}),s.insert(h,{extent:h.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let n;e.forEachInExtent(t,function(s){if(Us(s.extent,t))return n=s,!0}),n&&e.remove(n)}removeFeatures(t){let e=!1;for(let n=0,s=t.length;n0&&this.points_[n+2]>t;)n-=3;const s=this.points_[e+2]-this.points_[n+2];if(s<1e3/60)return!1;const r=this.points_[e]-this.points_[n],a=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(a,r),this.initialVelocity_=Math.sqrt(r*r+a*a)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}class px extends Jo{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){ot()}calculateMatrices2D(t){const e=t.viewState,n=t.coordinateToPixelTransform,s=t.pixelToCoordinateTransform;ii(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),yf(s,n)}forEachFeatureAtCoordinate(t,e,n,s,r,a,o,h){let l;const c=e.viewState;function u(E,M,R,S){return r.call(a,M,E?R:null,S)}const d=c.projection,f=hf(t.slice(),d),g=[[0,0]];if(d.canWrapX()&&s){const E=d.getExtent(),M=it(E);g.push([-M,0],[M,0])}const _=e.layerStatesArray,m=_.length,y=[],p=[];for(let E=0;E=0;--M){const R=_[M],S=R.layer;if(S.hasRenderer()&&nc(R,c)&&o.call(h,S)){const w=S.getRenderer(),b=S.getSource();if(w&&b){const B=b.getWrapX()?f:t,N=u.bind(null,R.managed);p[0]=B[0]+g[E][0],p[1]=B[1]+g[E][1],l=w.forEachFeatureAtCoordinate(p,e,n,N,y)}if(l)return l}}if(y.length===0)return;const x=1/y.length;return y.forEach((E,M)=>E.distanceSq+=M*x),y.sort((E,M)=>E.distanceSq-M.distanceSq),y.some(E=>l=E.callback(E.feature,E.layer,E.geometry)),l}hasFeatureAtCoordinate(t,e,n,s,r,a){return this.forEachFeatureAtCoordinate(t,e,n,s,Gr,this,r,a)!==void 0}getMap(){return this.map_}renderFrame(t){ot()}scheduleExpireIconCache(t){Je.canExpireCache()&&t.postRenderFunctions.push(vx)}}function vx(i,t){Je.expire()}class xx extends px{constructor(t){super(t),this.fontChangeListenerKey_=at(_i,Ws.PROPERTYCHANGE,t.redrawText,t),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=lh+" ol-layers";const n=t.getViewport();n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const n=this.getMap();if(n.hasListener(t)){const s=new Bf(t,void 0,e);n.dispatchEvent(s)}}disposeInternal(){vt(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(be.PRECOMPOSE,t);const e=t.layerStatesArray.sort((o,h)=>o.zIndex-h.zIndex);e.some(o=>o.layer instanceof Lg&&o.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const r=[];let a=null;for(let o=0,h=e.length;o=0;--n){const s=e[n],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}e.forEach(n=>n.layer.renderDeferred(t))}}}class Bi extends ri{constructor(t,e){super(t),this.layer=e}}const Uh={LAYERS:"layers"};class sr extends $d{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Uh.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new He(n.slice(),{unique:!0}):ht(typeof n.getArray=="function","Expected `layers` to be an array or a `Collection`"):n=new He(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(vt),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(at(t,se.ADD,this.handleLayersAdd_,this),at(t,se.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(vt);Pa(this.listenerKeys_);const e=t.getArray();for(let n=0,s=e.length;n{this.clickTimeoutId_=void 0;const n=new zi(wt.SINGLECLICK,this.map_,t);this.dispatchEvent(n)},250)}updateActivePointers_(t){const e=t,n=e.pointerId;if(e.type==wt.POINTERUP||e.type==wt.POINTERCANCEL){delete this.trackedTouches_[n];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==e.target){delete this.trackedTouches_[s];break}}else(e.type==wt.POINTERDOWN||e.type==wt.POINTERMOVE)&&(this.trackedTouches_[n]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new zi(wt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(vt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new zi(wt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(at(n,wt.POINTERMOVE,this.handlePointerMove_,this),at(n,wt.POINTERUP,this.handlePointerUp_,this),at(this.element_,wt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(at(this.element_.getRootNode(),wt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new zi(wt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new zi(wt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(vt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener($.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(vt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(vt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Wi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},qt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},zo=1/0;class Mx{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Pa(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const s=this.keyFunction_(n);return delete this.queuedElements_[s],n}enqueue(t){ht(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=zo?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,s=e.length,r=e[t],a=n[t],o=t;for(;t>1;){const h=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),c=lt;){const o=this.getParentIndex_(e);if(s[o]>a)n[e]=n[o],s[e]=s[o],e=o;else break}n[e]=r,s[e]=a}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let s=0;const r=e.length;let a,o,h;for(o=0;o0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===G.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,s.load())}}}function Sx(i,t,e,n,s){if(!i||!(e in i.wantedTiles)||!i.wantedTiles[e][t.getKey()])return zo;const r=i.viewState.center,a=n[0]-r[0],o=n[1]-r[1];return 65536*Math.log(s)+Math.sqrt(a*a+o*o)/s}class bc extends ai{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let e=0,n=this.listenerKeys.length;es.getAttributions(t)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>n.add(s)):n.add(this.attributions_)),!this.overrideCollapsible_){const s=!e.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(n)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=await Promise.all(this.collectSourceAttributions_(t).map(s=>Zd(()=>s))),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!on(e,this.renderedAttributions_)){Ly(this.ulElement_);for(let s=0,r=e.length;s0&&n%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:tr}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const n=e.viewState.rotation;if(n!=this.rotation_){const s="rotate("+n+"rad)";if(this.autoHide_){const r=this.element.classList.contains(ro);!r&&n===0?this.element.classList.add(ro):r&&n!==0&&this.element.classList.remove(ro)}this.label_.style.transform=s}this.rotation_=n}}class Cx extends bc{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",n=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",r=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",o=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",h=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",l=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=h,c.appendChild(typeof a=="string"?document.createTextNode(a):a),c.addEventListener($.CLICK,this.handleClick_.bind(this,n),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=l,u.appendChild(typeof o=="string"?document.createTextNode(o):o),u.addEventListener($.CLICK,this.handleClick_.bind(this,-n),!1);const d=e+" "+lh+" "+Sc,f=this.element;f.className=d,f.appendChild(c),f.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const n=this.getMap().getView();if(!n)return;const s=n.getZoom();if(s!==void 0){const r=n.getConstrainedZoom(s+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.duration_,easing:tr})):n.setZoom(r)}}}function Ix(i){i=i||{};const t=new He;return(i.zoom!==void 0?i.zoom:!0)&&t.push(new Cx(i.zoomOptions)),(i.rotate!==void 0?i.rotate:!0)&&t.push(new Rx(i.rotateOptions)),(i.attribution!==void 0?i.attribution:!0)&&t.push(new kg(i.attributionOptions)),t}const td={ACTIVE:"active"};class Wa extends ai{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(td.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(td.ACTIVE,t)}setMap(t){this.map_=t}}function bx(i,t,e){const n=i.getCenterInternal();if(n){const s=[n[0]+t[0],n[1]+t[1]];i.animateInternal({duration:e!==void 0?e:250,easing:rm,center:i.getConstrainedCenter(s)})}}function Tc(i,t,e,n){const s=i.getZoom();if(s===void 0)return;const r=i.getConstrainedZoom(s+t),a=i.getResolutionForZoom(r);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:a,anchor:e,duration:n!==void 0?n:250,easing:tr})}class Tx extends Wa{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==wt.DBLCLICK){const n=t.originalEvent,s=t.map,r=t.coordinate,a=n.shiftKey?-this.delta_:this.delta_,o=s.getView();Tc(o,a,r,this.duration_),n.preventDefault(),e=!0}return!e}}class Ba extends Wa{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==wt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==wt.POINTERUP){const n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==wt.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==wt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function Ac(i){const t=i.length;let e=0,n=0;for(let s=0;s0&&this.condition_(t)){const n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class kx extends Ba{constructor(t){t=t||{},super({stopDown:La}),this.condition_=t.condition?t.condition:Ax,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!jh(t))return;const e=t.map,n=e.getView();if(n.getConstraints().rotation===Kl)return;const s=e.getSize(),r=t.pixel,a=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const o=a-this.lastAngle_;n.adjustRotationInternal(-o)}this.lastAngle_=a}handleUpEvent(t){return jh(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return jh(t)&&zg(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Gx extends Jo{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,n="px",s=this.element_.style;s.left=Math.min(t[0],e[0])+n,s.top=Math.min(t[1],e[1])+n,s.width=Math.abs(e[0]-t[0])+n,s.height=Math.abs(e[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,s=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new Xs([s])}getGeometry(){return this.geometry_}}const $n={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class mr extends ri{constructor(t,e,n){super(t),this.coordinate=e,this.mapBrowserEvent=n}}class zx extends Ba{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new Gx(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??zg,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,n){const s=n[0]-e[0],r=n[1]-e[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new mr($n.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new mr(e?$n.BOXEND:$n.BOXCANCEL,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new mr($n.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new mr($n.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new mr($n.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class Ug extends zx{constructor(t){t=t||{};const e=t.condition?t.condition:Dx;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const n=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=n.rotatedExtentForGeometry(s),a=n.getResolutionForExtentInternal(r),o=n.getResolution()/a;s=s.clone(),s.scale(o*o)}n.fitInternal(s,{duration:this.duration_,easing:tr})}}const fn={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Wx extends Wa{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return Wg(e)&&Bg(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==$.KEYDOWN){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==fn.DOWN||s==fn.LEFT||s==fn.RIGHT||s==fn.UP)){const a=t.map.getView(),o=a.getResolution()*this.pixelDelta_;let h=0,l=0;s==fn.DOWN?l=-o:s==fn.LEFT?h=-o:s==fn.RIGHT?h=o:l=o;const c=[h,l];Bl(c,a.getRotation()),bx(a,c,this.duration_),n.preventDefault(),e=!0}}return!e}}class Bx extends Wa{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Ox(e)&&Bg(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==$.KEYDOWN||t.type==$.KEYPRESS){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==="+"||s==="-")){const r=t.map,a=s==="+"?this.delta_:-this.delta_,o=r.getView();Tc(o,a,void 0,this.duration_),n.preventDefault(),e=!0}}return!e}}class Ux extends Wa{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:Px;this.condition_=t.onFocusOnly?pl(Gg,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==$.WHEEL)return!0;const n=t.map,s=t.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let r;if(t.type==$.WHEEL&&(r=s.deltaY,Iy&&s.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(r/=jf),s.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=40)),r===0)return!1;this.lastDelta_=r;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const o=n.getView();if(this.mode_==="trackpad"&&!(o.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?n.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=a,!1;this.totalDelta_+=r;const h=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),h),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let n=-Mt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Tc(e,n,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class jx extends Ba{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=La),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const n=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-n.clientY,s.clientX-n.clientX);if(this.lastAngle_!==void 0){const h=r-this.lastAngle_;this.rotationDelta_+=h,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=h}this.lastAngle_=r;const a=t.map,o=a.getView();o.getConstraints().rotation!==Kl&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(Ac(this.targetPointers))),this.rotating_&&(a.render(),o.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class Xx extends Ba{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=La),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const n=this.targetPointers[0],s=this.targetPointers[1],r=n.clientX-s.clientX,a=n.clientY-s.clientY,o=Math.sqrt(r*r+a*a);this.lastDistance_!==void 0&&(e=this.lastDistance_/o),this.lastDistance_=o;const h=t.map,l=h.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=h.getCoordinateFromPixelInternal(h.getEventPixel(Ac(this.targetPointers))),h.render(),l.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const n=t.map.getView(),s=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function jg(i){i=i||{};const t=new He,e=new yx(-.005,.05,100);return(i.altShiftDragRotate!==void 0?i.altShiftDragRotate:!0)&&t.push(new kx),(i.doubleClickZoom!==void 0?i.doubleClickZoom:!0)&&t.push(new Tx({delta:i.zoomDelta,duration:i.zoomDuration})),(i.dragPan!==void 0?i.dragPan:!0)&&t.push(new Fx({onFocusOnly:i.onFocusOnly,kinetic:e})),(i.pinchRotate!==void 0?i.pinchRotate:!0)&&t.push(new jx),(i.pinchZoom!==void 0?i.pinchZoom:!0)&&t.push(new Xx({duration:i.zoomDuration})),(i.keyboard!==void 0?i.keyboard:!0)&&(t.push(new Wx),t.push(new Bx({delta:i.zoomDelta,duration:i.zoomDuration}))),(i.mouseWheelZoom!==void 0?i.mouseWheelZoom:!0)&&t.push(new Ux({onFocusOnly:i.onFocusOnly,duration:i.zoomDuration})),(i.shiftDragZoom!==void 0?i.shiftDragZoom:!0)&&t.push(new Ug({duration:i.zoomDuration})),t}function Xg(i){if(i instanceof kn){i.setMapInternal(null);return}i instanceof sr&&i.getLayers().forEach(Xg)}function qg(i,t){if(i instanceof kn){i.setMapInternal(t);return}if(i instanceof sr){const e=i.getLayers().getArray();for(let n=0,s=e.length;nthis.updateSize()),this.controls=e.controls||Ix(),this.interactions=e.interactions||jg({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new wx(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(qt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(qt.VIEW,this.handleViewChanged_),this.addChangeListener(qt.SIZE,this.handleSizeChanged_),this.addChangeListener(qt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const n=this;t.view&&!(t.view instanceof Ce)&&t.view.then(function(s){n.setView(new Ce(s))}),this.controls.addEventListener(se.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(se.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(se.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(se.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(se.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(se.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){qg(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,n){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(t);n=n!==void 0?n:{};const r=n.hitTolerance!==void 0?n.hitTolerance:0,a=n.layerFilter!==void 0?n.layerFilter:Gr,o=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,o,e,null,a,null)}getFeaturesAtPixel(t,e){const n=[];return this.forEachFeatureAtPixel(t,function(s){n.push(s)},e),n}getAllLayers(){const t=[];function e(n){n.forEach(function(s){s instanceof sr?e(s.getLayers()):t.push(s)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const s=e.layerFilter!==void 0?e.layerFilter:Gr,r=e.hitTolerance!==void 0?e.hitTolerance:0,a=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,a,s,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const n=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=n.width/s[0],a=n.height/s[1],o="changedTouches"in t?t.changedTouches[0]:t;return[(o.clientX-n.left)/r,(o.clientY-n.top)/a]}getTarget(){return this.get(qt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return sl(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?kt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(qt.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof He){e.setLayers(t);return}const n=e.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e=0;r--){const a=s[r];if(a.getMap()!==this||!a.getActive()||!this.getTargetElement())continue;if(!a.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let s=this.maxTilesLoading_,r=s;if(t){const a=t.viewHints;if(a[Ft.ANIMATING]||a[Ft.INTERACTING]){const o=Date.now()-t.time>8;s=o?0:8,r=o?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Bi("removelayer",e)),this.set(qt.LAYERGROUP,t)}setSize(t){this.set(qt.SIZE,t)}setTarget(t){this.set(qt.TARGET,t)}setView(t){if(!t||t instanceof Ce){this.set(qt.VIEW,t);return}this.set(qt.VIEW,new Ce);const e=this;t.then(function(n){e.setView(new Ce(n))})}updateSize(){const t=this.getTargetElement();let e;if(t){const s=getComputedStyle(t),r=t.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),a=t.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(a)&&(e=[Math.max(0,r),Math.max(0,a)],!Cu(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&cf("No map visible because the map container's width or height are 0."))}const n=this.getSize();e&&(!n||!on(e,n))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}};function Yx(i){let t=null;i.keyboardEventTarget!==void 0&&(t=typeof i.keyboardEventTarget=="string"?document.getElementById(i.keyboardEventTarget):i.keyboardEventTarget);const e={},n=i.layers&&typeof i.layers.getLayers=="function"?i.layers:new sr({layers:i.layers});e[qt.LAYERGROUP]=n,e[qt.TARGET]=i.target,e[qt.VIEW]=i.view instanceof Ce?i.view:new Ce;let s;i.controls!==void 0&&(Array.isArray(i.controls)?s=new He(i.controls.slice()):(ht(typeof i.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=i.controls));let r;i.interactions!==void 0&&(Array.isArray(i.interactions)?r=new He(i.interactions.slice()):(ht(typeof i.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=i.interactions));let a;return i.overlays!==void 0?Array.isArray(i.overlays)?a=new He(i.overlays.slice()):(ht(typeof i.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),a=i.overlays):a=new He,{controls:s,interactions:r,keyboardEventTarget:t,overlays:a,values:e}}const Mn=Ii("map:WMTSLayer");var Os,Ds,Ns,fa,ga,_a,ma,ya,Js,Yg,Vg;class yC extends qs{constructor(e){const n=new fg;super({...e,olLayer:n});D(this,Js);D(this,Os);D(this,Ds);D(this,Ns);D(this,fa);D(this,ga);D(this,_a);D(this,ma,Kt());D(this,ya,new AbortController);U(this,Os,e.url),U(this,Ds,e.name),U(this,fa,n),U(this,Ns,e.matrixSet),U(this,_a,e.sourceOptions)}get type(){return"wmts"}destroy(){v(this,ya).abort(),super.destroy()}get legend(){return v(this,ma).value}get sublayers(){}get layers(){}__attachToMap(e){super.__attachToMap(e),j(this,Js,Yg).call(this).then(n=>{const r=new Up().read(n),a=O1(r,{layer:v(this,Ds),matrixSet:v(this,Ns)});if(!a)throw new Error("Layer was not found in capabilities");const o=new P1({...a,...v(this,_a),tileLoadFunction:(c,u)=>{j(this,Js,Vg).call(this,c,u)}});U(this,ga,o),v(this,fa).setSource(v(this,ga));const h=o.getStyle(),l=Kx(r,this.name,h);v(this,ma).value=l}).catch(n=>{if(Fr(n)){Mn.error(`Layer ${this.name} has been destroyed before fetching the data`);return}Mn.error(`Failed fetching WMTS capabilities for Layer ${this.name}`,n)})}get url(){return v(this,Os)}get name(){return v(this,Ds)}get matrixSet(){return v(this,Ns)}}Os=new WeakMap,Ds=new WeakMap,Ns=new WeakMap,fa=new WeakMap,ga=new WeakMap,_a=new WeakMap,ma=new WeakMap,ya=new WeakMap,Js=new WeakSet,Yg=async function(){const e=this.map.__sharedDependencies.httpService;return sg(v(this,Os),e,v(this,ya).signal)},Vg=async function(e,n){const s=this.map.__sharedDependencies.httpService;try{if(!(e instanceof yc))throw new Error("Only 'ImageTile' is supported for now.");const r=e.getImage();if(!Vx(r))throw new Error("Only tags are supported as tiles for now.");const a=await s.fetch(n);if(!a.ok)throw new Error(`Tile request failed with status ${a.status}.`);const o=await a.blob(),h=URL.createObjectURL(o),l=()=>{URL.revokeObjectURL(h),r.removeEventListener("load",l),r.removeEventListener("error",l)};r.addEventListener("load",l),r.addEventListener("error",l),r.src=h}catch(r){e.setState(G.ERROR),Fr(r)||Mn.error("Failed to load tile",r)}};function Vx(i){return i.tagName==="IMG"}function Kx(i,t,e){const s=i?.Contents?.Layer;let r=s?.find(l=>l?.Identifier===t);if(!r&&(Mn.debug("Failed to find the active layer in WMTS layer capabilities."),r=s?.[0],!r)){Mn.debug("No layer in WMTS capabilities - giving up.");return}const a=r.Style;let o=a?.find(l=>l?.Identifier===e);if(!o&&(Mn.debug("Failed to find active style in WMTS layer."),o=a?.[0],!o)){Mn.debug("No style in WMTS layer capabilities - giving up.");return}return o.LegendURL?.[0]?.href}function Zx(i){const t=Object.keys(i.defs),e=t.length;let n,s;for(n=0;n=this.text.length)return;i=this.text[this.place++]}switch(this.state){case ta:return this.neutral(i);case Kg:return this.keyword(i);case Wo:return this.quoted(i);case $g:return this.afterquote(i);case Zg:return this.number(i);case Lc:return}};Ti.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=Wo;return}if(fh.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)};Ti.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=ta;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=ta,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Lc);return}};Ti.prototype.number=function(i){if(Hg.test(i)){this.word+=i;return}if(fh.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)};Ti.prototype.quoted=function(i){if(i==='"'){this.state=$g;return}this.word+=i};Ti.prototype.keyword=function(i){if(rE.test(i)){this.word+=i;return}if(i==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=ta;return}if(fh.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)};Ti.prototype.neutral=function(i){if(sE.test(i)){this.word=i,this.state=Kg;return}if(i==='"'){this.word="",this.state=Wo;return}if(Hg.test(i)){this.word=i,this.state=Zg;return}if(fh.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)};Ti.prototype.output=function(){for(;this.place0?90:-90),i.lat_ts=i.lat1):!i.lat_ts&&i.lat0&&i.projName==="Polar_Stereographic"&&(i.lat_ts=i.lat0,i.lat0=Ye(i.lat0>0?90:-90))}function Jg(i){var t=aE(i),e=t.shift(),n=t.shift();t.unshift(["name",n]),t.unshift(["type",e]);var s={};return hs(t,s),lE(s),s}function $t(i){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?$t[i]=xl(arguments[1]):$t[i]=Jg(arguments[1]):$t[i]=e}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(n){Array.isArray(n)?$t.apply(t,n):$t(n)});if(typeof i=="string"){if(i in $t)return $t[i]}else"EPSG"in i?$t["EPSG:"+i.EPSG]=i:"ESRI"in i?$t["ESRI:"+i.ESRI]=i:"IAU2000"in i?$t["IAU2000:"+i.IAU2000]=i:console.log(i);return}}$x($t);function cE(i){return typeof i=="string"}function uE(i){return i in $t}var dE=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function fE(i){return dE.some(function(t){return i.indexOf(t)>-1})}var gE=["3857","900913","3785","102113"];function _E(i){var t=rn(i,"authority");if(t){var e=rn(t,"epsg");return e&&gE.indexOf(e)>-1}}function mE(i){var t=rn(i,"extension");if(t)return rn(t,"proj4")}function yE(i){return i[0]==="+"}function pE(i){if(cE(i)){if(uE(i))return $t[i];if(fE(i)){var t=Jg(i);if(_E(t))return $t["EPSG:3857"];var e=mE(t);return e?xl(e):t}if(yE(i))return xl(i)}else return i}function rd(i,t){i=i||{};var e,n;if(!t)return i;for(n in t)e=t[n],e!==void 0&&(i[n]=e);return i}function ni(i,t,e){var n=i*t;return e/Math.sqrt(1-n*n)}function Ua(i){return i<0?-1:1}function k(i){return Math.abs(i)<=It?i:i-Ua(i)*Qr}function Be(i,t,e){var n=i*e,s=.5*i;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*(A-t))/n}function ea(i,t){for(var e=.5*i,n,s,r=A-2*Math.atan(t),a=0;a<=15;a++)if(n=i*Math.sin(r),s=A-2*Math.atan(t*Math.pow((1-n)/(1+n),e))-r,r+=s,Math.abs(s)<=1e-10)return r;return-9999}function vE(){var i=this.b/this.a;this.es=1-i*i,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=ni(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function xE(i){var t=i.x,e=i.y;if(e*ti>90&&e*ti<-90&&t*ti>180&&t*ti<-180)return null;var n,s;if(Math.abs(Math.abs(e)-A)<=F)return null;if(this.sphere)n=this.x0+this.a*this.k0*k(t-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(ut+.5*e));else{var r=Math.sin(e),a=Be(this.e,e,r);n=this.x0+this.a*this.k0*k(t-this.long0),s=this.y0-this.a*this.k0*Math.log(a)}return i.x=n,i.y=s,i}function EE(i){var t=i.x-this.x0,e=i.y-this.y0,n,s;if(this.sphere)s=A-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var r=Math.exp(-e/(this.a*this.k0));if(s=ea(this.e,r),s===-9999)return null}return n=k(this.long0+t/(this.a*this.k0)),i.x=n,i.y=s,i}var ME=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const wE={init:vE,forward:xE,inverse:EE,names:ME};function SE(){}function ad(i){return i}var RE=["longlat","identity"];const CE={init:SE,forward:ad,inverse:ad,names:RE};var IE=[wE,CE],po={},Bo=[];function Qg(i,t){var e=Bo.length;return i.names?(Bo[e]=i,i.names.forEach(function(n){po[n.toLowerCase()]=e}),this):(console.log(t),!0)}function bE(i){if(!i)return!1;var t=i.toLowerCase();if(typeof po[t]<"u"&&Bo[po[t]])return Bo[po[t]]}function TE(){IE.forEach(Qg)}const AE={start:TE,add:Qg,get:bE};var H={};H.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};H.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};H.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};H.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};H.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};H.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};H.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};H.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};H.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};H.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};H.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};H.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};H.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};H.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};H.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};H.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};H.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};H.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};H.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};H.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};H.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};H.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};H.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};H.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};H.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};H.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};H.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};H.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};H.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};H.hough={a:6378270,rf:297,ellipseName:"Hough"};H.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};H.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};H.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};H.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};H.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};H.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};H.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};H.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};H.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};H.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};H.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};H.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var LE=H.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};H.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function PE(i,t,e,n){var s=i*i,r=t*t,a=(s-r)/s,o=0;n?(i*=1-a*(Qx+a*(tE+a*eE)),s=i*i,a=0):o=Math.sqrt(a);var h=(s-r)/r;return{es:a,e:o,ep2:h}}function OE(i,t,e,n,s){if(!i){var r=rn(H,n);r||(r=LE),i=r.a,t=r.b,e=r.rf}return e&&!t&&(t=(1-1/e)*i),(e===0||Math.abs(i-t)3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=Dn,o.datum_params[3]*=Lr,o.datum_params[4]*=Lr,o.datum_params[5]*=Lr,o.datum_params[6]=o.datum_params[6]/1e6+1)),a&&(o.datum_type=_s,o.grids=a),o.a=e,o.b=n,o.es=s,o.ep2=r,o}var t0={};function NE(i,t){var e=new DataView(t),n=GE(e),s=zE(e,n),r=WE(e,s,n),a={header:s,subgrids:r};return t0[i]=a,a}function FE(i){if(i===void 0)return null;var t=i.split(",");return t.map(kE)}function kE(i){if(i.length===0)return null;var t=i[0]==="@";return t&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:i,mandatory:!t,grid:t0[i]||null,isNull:!1}}function ls(i){return i/3600*Math.PI/180}function GE(i){var t=i.getInt32(8,!1);return t===11?!1:(t=i.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function zE(i,t){return{nFields:i.getInt32(8,t),nSubgridFields:i.getInt32(24,t),nSubgrids:i.getInt32(40,t),shiftType:El(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,t),fromSemiMinorAxis:i.getFloat64(136,t),toSemiMajorAxis:i.getFloat64(152,t),toSemiMinorAxis:i.getFloat64(168,t)}}function El(i,t,e){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(t,e)))}function WE(i,t,e){for(var n=176,s=[],r=0;r5e-11?!1:i.datum_type===On?i.datum_params[0]===t.datum_params[0]&&i.datum_params[1]===t.datum_params[1]&&i.datum_params[2]===t.datum_params[2]:i.datum_type===Dn?i.datum_params[0]===t.datum_params[0]&&i.datum_params[1]===t.datum_params[1]&&i.datum_params[2]===t.datum_params[2]&&i.datum_params[3]===t.datum_params[3]&&i.datum_params[4]===t.datum_params[4]&&i.datum_params[5]===t.datum_params[5]&&i.datum_params[6]===t.datum_params[6]:!0}function e0(i,t,e){var n=i.x,s=i.y,r=i.z?i.z:0,a,o,h,l;if(s<-A&&s>-1.001*A)s=-A;else if(s>A&&s<1.001*A)s=A;else{if(s<-A)return{x:-1/0,y:-1/0,z:i.z};if(s>A)return{x:1/0,y:1/0,z:i.z}}return n>Math.PI&&(n-=2*Math.PI),o=Math.sin(s),l=Math.cos(s),h=o*o,a=e/Math.sqrt(1-t*h),{x:(a+r)*l*Math.cos(n),y:(a+r)*l*Math.sin(n),z:(a*(1-t)+r)*o}}function i0(i,t,e,n){var s=1e-12,r=s*s,a=30,o,h,l,c,u,d,f,g,_,m,y,p,x,E=i.x,M=i.y,R=i.z?i.z:0,S,w,b;if(o=Math.sqrt(E*E+M*M),h=Math.sqrt(E*E+M*M+R*R),o/er&&xn.y||f>n.x||mo&&Math.abs(h.y)>o);if(a<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=k(r.x+e.ll[0]),n.y=r.y+e.ll[1]}else isNaN(r.x)||(n.x=i.x+r.x,n.y=i.y+r.y);return n}function hd(i,t){var e={x:i.x/t.del[0],y:i.y/t.del[1]},n={x:Math.floor(e.x),y:Math.floor(e.y)},s={x:e.x-1*n.x,y:e.y-1*n.y},r={x:Number.NaN,y:Number.NaN},a;if(n.x<0||n.x>=t.lim[0]||n.y<0||n.y>=t.lim[1])return r;a=n.y*t.lim[0]+n.x;var o={x:t.cvs[a][0],y:t.cvs[a][1]};a++;var h={x:t.cvs[a][0],y:t.cvs[a][1]};a+=t.lim[0];var l={x:t.cvs[a][0],y:t.cvs[a][1]};a--;var c={x:t.cvs[a][0],y:t.cvs[a][1]},u=s.x*s.y,d=s.x*(1-s.y),f=(1-s.x)*(1-s.y),g=(1-s.x)*s.y;return r.x=f*o.x+d*h.x+g*c.x+u*l.x,r.y=f*o.y+d*h.y+g*c.y+u*l.y,r}function ld(i,t,e){var n=e.x,s=e.y,r=e.z||0,a,o,h,l={};for(h=0;h<3;h++)if(!(t&&h===2&&e.z===void 0))switch(h===0?(a=n,"ew".indexOf(i.axis[h])!==-1?o="x":o="y"):h===1?(a=s,"ns".indexOf(i.axis[h])!==-1?o="y":o="x"):(a=r,o="z"),i.axis[h]){case"e":l[o]=a;break;case"w":l[o]=-a;break;case"n":l[o]=a;break;case"s":l[o]=-a;break;case"u":e[o]!==void 0&&(l.z=a);break;case"d":e[o]!==void 0&&(l.z=-a);break;default:return null}return l}function n0(i){var t={x:i[0],y:i[1]};return i.length>2&&(t.z=i[2]),i.length>3&&(t.m=i[3]),t}function ZE(i){cd(i.x),cd(i.y)}function cd(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function $E(i,t){return(i.datum.datum_type===On||i.datum.datum_type===Dn||i.datum.datum_type===_s)&&t.datumCode!=="WGS84"||(t.datum.datum_type===On||t.datum.datum_type===Dn||t.datum.datum_type===_s)&&i.datumCode!=="WGS84"}function Uo(i,t,e,n){var s;Array.isArray(e)?e=n0(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var r=e.z!==void 0;if(ZE(e),i.datum&&t.datum&&$E(i,t)&&(s=new ei("WGS84"),e=Uo(i,s,e,n),i=s),n&&i.axis!=="enu"&&(e=ld(i,!1,e)),i.projName==="longlat")e={x:e.x*Ut,y:e.y*Ut,z:e.z||0};else if(i.to_meter&&(e={x:e.x*i.to_meter,y:e.y*i.to_meter,z:e.z||0}),e=i.inverse(e),!e)return;if(i.from_greenwich&&(e.x+=i.from_greenwich),e=VE(i.datum,t.datum,e),!!e)return t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*ti,y:e.y*ti,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),n&&t.axis!=="enu"?ld(t,!0,e):(e&&!r&&delete e.z,e)}var ud=ei("WGS84");function Xh(i,t,e,n){var s,r,a;return Array.isArray(e)?(s=Uo(i,t,e,n)||{x:NaN,y:NaN},e.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(e.slice(3)):[s.x,s.y,e[2]].concat(e.slice(3)):[s.x,s.y].concat(e.slice(2)):[s.x,s.y]):(r=Uo(i,t,e,n),a=Object.keys(e),a.length===2||a.forEach(function(o){if(typeof i.name<"u"&&i.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(o==="x"||o==="y"||o==="z")return}else if(o==="x"||o==="y")return;r[o]=e[o]}),r)}function dd(i){return i instanceof ei?i:i.oProj?i.oProj:ei(i)}function ue(i,t,e){i=dd(i);var n=!1,s;return typeof t>"u"?(t=i,i=ud,n=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=i,i=ud,n=!0),t=dd(t),e?Xh(i,t,e):(s={forward:function(r,a){return Xh(i,t,r,a)},inverse:function(r,a){return Xh(t,i,r,a)}},n&&(s.oProj=t),s)}var fd=6,s0="AJSAJS",r0="AFAFAF",cs=65,ne=73,we=79,Sr=86,Rr=90;const HE={forward:a0,inverse:JE,toPoint:o0};function a0(i,t){return t=t||5,eM(QE({lat:i[1],lon:i[0]}),t)}function JE(i){var t=Pc(l0(i.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function o0(i){var t=Pc(l0(i.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function qh(i){return i*(Math.PI/180)}function gd(i){return 180*(i/Math.PI)}function QE(i){var t=i.lat,e=i.lon,n=6378137,s=.00669438,r=.9996,a,o,h,l,c,u,d,f=qh(t),g=qh(e),_,m;m=Math.floor((e+180)/6)+1,e===180&&(m=60),t>=56&&t<64&&e>=3&&e<12&&(m=32),t>=72&&t<84&&(e>=0&&e<9?m=31:e>=9&&e<21?m=33:e>=21&&e<33?m=35:e>=33&&e<42&&(m=37)),a=(m-1)*6-180+3,_=qh(a),o=s/(1-s),h=n/Math.sqrt(1-s*Math.sin(f)*Math.sin(f)),l=Math.tan(f)*Math.tan(f),c=o*Math.cos(f)*Math.cos(f),u=Math.cos(f)*(g-_),d=n*((1-s/4-3*s*s/64-5*s*s*s/256)*f-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*f)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*f)-35*s*s*s/3072*Math.sin(6*f));var y=r*h*(u+(1-l+c)*u*u*u/6+(5-18*l+l*l+72*c-58*o)*u*u*u*u*u/120)+5e5,p=r*(d+h*Math.tan(f)*(u*u/2+(5-l+9*c+4*c*c)*u*u*u*u/24+(61-58*l+l*l+600*c-330*o)*u*u*u*u*u*u/720));return t<0&&(p+=1e7),{northing:Math.round(p),easting:Math.round(y),zoneNumber:m,zoneLetter:tM(t)}}function Pc(i){var t=i.northing,e=i.easting,n=i.zoneLetter,s=i.zoneNumber;if(s<0||s>60)return null;var r=.9996,a=6378137,o=.00669438,h,l=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),c,u,d,f,g,_,m,y,p,x=e-5e5,E=t;n<"N"&&(E-=1e7),m=(s-1)*6-180+3,h=o/(1-o),_=E/r,y=_/(a*(1-o/4-3*o*o/64-5*o*o*o/256)),p=y+(3*l/2-27*l*l*l/32)*Math.sin(2*y)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*y)+151*l*l*l/96*Math.sin(6*y),c=a/Math.sqrt(1-o*Math.sin(p)*Math.sin(p)),u=Math.tan(p)*Math.tan(p),d=h*Math.cos(p)*Math.cos(p),f=a*(1-o)/Math.pow(1-o*Math.sin(p)*Math.sin(p),1.5),g=x/(c*r);var M=p-c*Math.tan(p)/f*(g*g/2-(5+3*u+10*d-4*d*d-9*h)*g*g*g*g/24+(61+90*u+298*d+45*u*u-252*h-3*d*d)*g*g*g*g*g*g/720);M=gd(M);var R=(g-(1+2*u+d)*g*g*g/6+(5-2*d+28*u-3*d*d+8*h+24*u*u)*g*g*g*g*g/120)/Math.cos(p);R=m+gd(R);var S;if(i.accuracy){var w=Pc({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});S={top:w.lat,right:w.lon,bottom:M,left:R}}else S={lat:M,lon:R};return S}function tM(i){var t="Z";return 84>=i&&i>=72?t="X":72>i&&i>=64?t="W":64>i&&i>=56?t="V":56>i&&i>=48?t="U":48>i&&i>=40?t="T":40>i&&i>=32?t="S":32>i&&i>=24?t="R":24>i&&i>=16?t="Q":16>i&&i>=8?t="P":8>i&&i>=0?t="N":0>i&&i>=-8?t="M":-8>i&&i>=-16?t="L":-16>i&&i>=-24?t="K":-24>i&&i>=-32?t="J":-32>i&&i>=-40?t="H":-40>i&&i>=-48?t="G":-48>i&&i>=-56?t="F":-56>i&&i>=-64?t="E":-64>i&&i>=-72?t="D":-72>i&&i>=-80&&(t="C"),t}function eM(i,t){var e="00000"+i.easting,n="00000"+i.northing;return i.zoneNumber+i.zoneLetter+iM(i.easting,i.northing,i.zoneNumber)+e.substr(e.length-5,t)+n.substr(n.length-5,t)}function iM(i,t,e){var n=h0(e),s=Math.floor(i/1e5),r=Math.floor(t/1e5)%20;return nM(s,r,n)}function h0(i){var t=i%fd;return t===0&&(t=fd),t}function nM(i,t,e){var n=e-1,s=s0.charCodeAt(n),r=r0.charCodeAt(n),a=s+i-1,o=r+t,h=!1;a>Rr&&(a=a-Rr+cs-1,h=!0),(a===ne||sne||(a>ne||swe||(a>we||sRr&&(a=a-Rr+cs-1),o>Sr?(o=o-Sr+cs-1,h=!0):h=!1,(o===ne||rne||(o>ne||rwe||(o>we||rSr&&(o=o-Sr+cs-1);var l=String.fromCharCode(a)+String.fromCharCode(o);return l}function l0(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var t=i.length,e=null,n="",s,r=0;!/[A-Z]/.test(s=i.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+i;n+=s,r++}var a=parseInt(n,10);if(r===0||r+3>t)throw"MGRSPoint bad conversion from: "+i;var o=i.charAt(r++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+i;e=i.substring(r,r+=2);for(var h=h0(a),l=sM(e.charAt(0),h),c=rM(e.charAt(1),h);c0&&(_=1e5/Math.pow(10,d),m=i.substring(r,r+d),f=parseFloat(m)*_,y=i.substring(r+d),g=parseFloat(y)*_),p=f+l,x=g+c,{easting:p,northing:x,zoneLetter:o,zoneNumber:a,accuracy:_}}function sM(i,t){for(var e=s0.charCodeAt(t-1),n=1e5,s=!1;e!==i.charCodeAt(0);){if(e++,e===ne&&e++,e===we&&e++,e>Rr){if(s)throw"Bad character: "+i;e=cs,s=!0}n+=1e5}return n}function rM(i,t){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var e=r0.charCodeAt(t-1),n=0,s=!1;e!==i.charCodeAt(0);){if(e++,e===ne&&e++,e===we&&e++,e>Sr){if(s)throw"Bad character: "+i;e=cs,s=!0}n+=1e5}return n}function aM(i){var t;switch(i){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+i}function $s(i,t,e){if(!(this instanceof $s))return new $s(i,t,e);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof t>"u"){var n=i.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=i,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}$s.fromMGRS=function(i){return new $s(o0(i))};$s.prototype.toMGRS=function(i){return a0([this.x,this.y],i)};var oM=1,hM=.25,_d=.046875,md=.01953125,yd=.01068115234375,lM=.75,cM=.46875,uM=.013020833333333334,dM=.007120768229166667,fM=.3645833333333333,gM=.005696614583333333,_M=.3076171875;function Oc(i){var t=[];t[0]=oM-i*(hM+i*(_d+i*(md+i*yd))),t[1]=i*(lM-i*(_d+i*(md+i*yd)));var e=i*i;return t[2]=e*(cM-i*(uM+i*dM)),e*=i,t[3]=e*(fM-i*gM),t[4]=e*i*_M,t}function rr(i,t,e,n){return e*=t,t*=t,n[0]*i-e*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var mM=20;function Dc(i,t,e){for(var n=1/(1-t),s=i,r=mM;r;--r){var a=Math.sin(s),o=1-t*a*a;if(o=(rr(s,a,Math.cos(s),e)-i)*(o*Math.sqrt(o))*n,s-=o,Math.abs(o)F?Math.tan(e):0,_=Math.pow(g,2),m=Math.pow(_,2);s=1-this.es*Math.pow(o,2),c=c/Math.sqrt(s);var y=rr(e,o,h,this.en);r=this.a*(this.k0*c*(1+u/6*(1-_+d+u/20*(5-18*_+m+14*d-58*_*d+u/42*(61+179*m-m*_-479*_)))))+this.x0,a=this.a*(this.k0*(y-this.ml0+o*n*c/2*(1+u/12*(5-_+9*d+4*f+u/30*(61+m-58*_+270*d-330*_*d+u/56*(1385+543*m-m*_-3111*_))))))+this.y0}else{var l=h*Math.sin(n);if(Math.abs(Math.abs(l)-1)=1){if(l-1>F)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return i.x=r,i.y=a,i}function vM(i){var t,e,n,s,r=(i.x-this.x0)*(1/this.a),a=(i.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,e=Dc(t,this.es,this.en),Math.abs(e)F?Math.tan(e):0,g=this.ep2*Math.pow(d,2),_=Math.pow(g,2),m=Math.pow(f,2),y=Math.pow(m,2);t=1-this.es*Math.pow(u,2);var p=r*Math.sqrt(t)/this.k0,x=Math.pow(p,2);t=t*f,n=e-t*x/(1-this.es)*.5*(1-x/12*(5+3*m-9*g*m+g-4*_-x/30*(61+90*m-252*g*m+45*y+46*g-x/56*(1385+3633*m+4095*y+1574*y*m)))),s=k(this.long0+p*(1-x/6*(1+2*m+g-x/20*(5+28*m+24*y+8*g*m+6*g-x/42*(61+662*m+1320*y+720*y*m))))/d)}else n=A*Ua(a),s=0;else{var o=Math.exp(r/this.k0),h=.5*(o-1/o),l=this.lat0+a/this.k0,c=Math.cos(l);t=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(h,2))),n=Math.asin(t),a<0&&(n=-n),h===0&&c===0?s=0:s=k(Math.atan2(h,c)+this.long0)}return i.x=s,i.y=n,i}var xM=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const vo={init:yM,forward:pM,inverse:vM,names:xM};function c0(i){var t=Math.exp(i);return t=(t-1/t)/2,t}function he(i,t){i=Math.abs(i),t=Math.abs(t);var e=Math.max(i,t),n=Math.min(i,t)/(e||1);return e*Math.sqrt(1+Math.pow(n,2))}function EM(i){var t=1+i,e=t-1;return e===0?i:i*Math.log(t)/e}function MM(i){var t=Math.abs(i);return t=EM(t*(1+t/(he(1,t)+1))),i<0?-t:t}function Nc(i,t){for(var e=2*Math.cos(2*t),n=i.length-1,s=i[n],r=0,a;--n>=0;)a=-r+e*s+i[n],r=s,s=a;return t+a*Math.sin(2*t)}function wM(i,t){for(var e=2*Math.cos(t),n=i.length-1,s=i[n],r=0,a;--n>=0;)a=-r+e*s+i[n],r=s,s=a;return Math.sin(t)*a}function SM(i){var t=Math.exp(i);return t=(t+1/t)/2,t}function u0(i,t,e){for(var n=Math.sin(t),s=Math.cos(t),r=c0(e),a=SM(e),o=2*s*a,h=-2*n*r,l=i.length-1,c=i[l],u=0,d=0,f=0,g,_;--l>=0;)g=d,_=u,d=c,u=f,c=-g+o*d-h*u+i[l],f=-_+h*d+o*u;return o=n*a,h=s*r,[o*c-h*f,o*f+h*c]}function RM(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(vo.init.apply(this),this.forward=vo.forward,this.inverse=vo.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var i=this.es/(1+Math.sqrt(1-this.es)),t=i/(2-i),e=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),e=e*t,this.cgb[1]=e*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=e*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),e=e*t,this.cgb[2]=e*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=e*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),e=e*t,this.cgb[3]=e*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=e*(1237/630+t*(-12/5+t*(-24832/14175))),e=e*t,this.cgb[4]=e*(4174/315+t*(-144838/6237)),this.cbg[4]=e*(-734/315+t*(109598/31185)),e=e*t,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=e*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=e*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),e=e*t,this.utg[2]=e*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=e*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),e=e*t,this.utg[3]=e*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=e*(49561/161280+t*(-179/168+t*(6601661/7257600))),e=e*t,this.utg[4]=e*(-4583/161280+t*(108847/3991680)),this.gtu[4]=e*(34729/80640+t*(-3418889/1995840)),e=e*t,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var n=Nc(this.cbg,this.lat0);this.Zb=-this.Qn*(n+wM(this.gtu,2*n))}function CM(i){var t=k(i.x-this.long0),e=i.y;e=Nc(this.cbg,e);var n=Math.sin(e),s=Math.cos(e),r=Math.sin(t),a=Math.cos(t);e=Math.atan2(n,a*s),t=Math.atan2(r*s,he(n,s*a)),t=MM(Math.tan(t));var o=u0(this.gtu,2*e,2*t);e=e+o[0],t=t+o[1];var h,l;return Math.abs(t)<=2.623395162778?(h=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*e+this.Zb)+this.y0):(h=1/0,l=1/0),i.x=h,i.y=l,i}function IM(i){var t=(i.x-this.x0)*(1/this.a),e=(i.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var n,s;if(Math.abs(t)<=2.623395162778){var r=u0(this.utg,2*e,2*t);e=e+r[0],t=t+r[1],t=Math.atan(c0(t));var a=Math.sin(e),o=Math.cos(e),h=Math.sin(t),l=Math.cos(t);e=Math.atan2(a*l,he(h,l*o)),t=Math.atan2(h,l*o),n=k(t+this.long0),s=Nc(this.cgb,e)}else n=1/0,s=1/0;return i.x=n,i.y=s,i}var bM=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const xo={init:RM,forward:CM,inverse:IM,names:bM};function TM(i,t){if(i===void 0){if(i=Math.floor((k(t)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var AM="etmerc";function LM(){var i=TM(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*Ut,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,xo.init.apply(this),this.forward=xo.forward,this.inverse=xo.inverse}var PM=["Universal Transverse Mercator System","utm"];const OM={init:LM,names:PM,dependsOn:AM};function Fc(i,t){return Math.pow((1-i)/(1+i),t)}var DM=20;function NM(){var i=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ut)/(Math.pow(Math.tan(.5*this.lat0+ut),this.C)*Fc(this.e*i,this.ratexp))}function FM(i){var t=i.x,e=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+ut),this.C)*Fc(this.e*Math.sin(e),this.ratexp))-A,i.x=this.C*t,i}function kM(i){for(var t=1e-14,e=i.x/this.C,n=i.y,s=Math.pow(Math.tan(.5*n+ut)/this.K,1/this.C),r=DM;r>0&&(n=2*Math.atan(s*Fc(this.e*Math.sin(i.y),-.5*this.e))-A,!(Math.abs(n-i.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=F&&Math.abs(Math.cos(this.lat_ts))>F&&(this.k0=.5*this.cons*ni(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Be(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=ni(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-A,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function YM(i){var t=i.x,e=i.y,n=Math.sin(e),s=Math.cos(e),r,a,o,h,l,c,u=k(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=F&&Math.abs(e+this.lat0)<=F?(i.x=NaN,i.y=NaN,i):this.sphere?(r=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(u)),i.x=this.a*r*s*Math.sin(u)+this.x0,i.y=this.a*r*(this.coslat0*n-this.sinlat0*s*Math.cos(u))+this.y0,i):(a=2*Math.atan(this.ssfn_(e,n,this.e))-A,h=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=F?(l=Be(this.e,e*this.con,this.con*n),c=2*this.a*this.k0*l/this.cons,i.x=this.x0+c*Math.sin(t-this.long0),i.y=this.y0-this.con*c*Math.cos(t-this.long0),i):(Math.abs(this.sinlat0)0?t=k(this.long0+Math.atan2(i.x,-1*i.y)):t=k(this.long0+Math.atan2(i.x,i.y)):t=k(this.long0+Math.atan2(i.x*Math.sin(o),a*this.coslat0*Math.cos(o)-i.y*this.sinlat0*Math.sin(o))),i.x=t,i.y=e,i)}else if(Math.abs(this.coslat0)<=F){if(a<=F)return e=this.lat0,t=this.long0,i.x=t,i.y=e,i;i.x*=this.con,i.y*=this.con,n=a*this.cons/(2*this.a*this.k0),e=this.con*ea(this.e,n),t=this.con*k(this.con*this.long0+Math.atan2(i.x,-1*i.y))}else s=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=F?r=this.X0:(r=Math.asin(Math.cos(s)*this.sinX0+i.y*Math.sin(s)*this.cosX0/a),t=k(this.long0+Math.atan2(i.x*Math.sin(s),a*this.cosX0*Math.cos(s)-i.y*this.sinX0*Math.sin(s)))),e=-1*ea(this.e,Math.tan(.5*(A+r)));return i.x=t,i.y=e,i}var KM=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const ZM={init:qM,forward:YM,inverse:VM,names:KM,ssfn_:XM};function $M(){var i=this.lat0;this.lambda0=this.long0;var t=Math.sin(i),e=this.a,n=this.rf,s=1/n,r=2*s-Math.pow(s,2),a=this.e=Math.sqrt(r);this.R=this.k0*e*Math.sqrt(1-r)/(1-r*Math.pow(t,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+i/2)),l=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*h+this.alpha*a/2*l}function HM(i){var t=Math.log(Math.tan(Math.PI/4-i.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),n=-this.alpha*(t+e)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),r=this.alpha*(i.x-this.lambda0),a=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(r))),o=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(r));return i.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,i.x=this.R*a+this.x0,i}function JM(i){for(var t=i.x-this.x0,e=i.y-this.y0,n=t/this.R,s=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(s))),o=this.lambda0+a/this.alpha,h=0,l=r,c=-1e3,u=0;Math.abs(l-c)>1e-7;){if(++u>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return i.x=o,i.y=l,i}var QM=["somerc"];const t2={init:$M,forward:HM,inverse:JM,names:QM};var ns=1e-7;function e2(i){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof i.PROJECTION=="object"?Object.keys(i.PROJECTION)[0]:i.PROJECTION;return"no_uoff"in i||"no_off"in i||t.indexOf(e)!==-1}function i2(){var i,t,e,n,s,r,a,o,h,l,c=0,u,d=0,f=0,g=0,_=0,m=0,y=0;this.no_off=e2(this),this.no_rot="no_rot"in this;var p=!1;"alpha"in this&&(p=!0);var x=!1;if("rectified_grid_angle"in this&&(x=!0),p&&(y=this.alpha),x&&(c=this.rectified_grid_angle*Ut),p||x)d=this.longc;else if(f=this.long1,_=this.lat1,g=this.long2,m=this.lat2,Math.abs(_-m)<=ns||(i=Math.abs(_))<=ns||Math.abs(i-A)<=ns||Math.abs(Math.abs(this.lat0)-A)<=ns||Math.abs(Math.abs(m)-A)<=ns)throw new Error;var E=1-this.es;t=Math.sqrt(E),Math.abs(this.lat0)>F?(o=Math.sin(this.lat0),e=Math.cos(this.lat0),i=1-this.es*o*o,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/E),this.A=this.B*this.k0*t/i,n=this.B*t/(e*Math.sqrt(i)),s=n*n-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=n,this.E*=Math.pow(Be(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=s=1),p||x?(p?(u=Math.asin(Math.sin(y)/n),x||(c=y)):(u=c,y=Math.asin(n*Math.sin(u))),this.lam0=d-Math.asin(.5*(s-1/s)*Math.tan(u))/this.B):(r=Math.pow(Be(this.e,_,Math.sin(_)),this.B),a=Math.pow(Be(this.e,m,Math.sin(m)),this.B),s=this.E/r,h=(a-r)/(a+r),l=this.E*this.E,l=(l-a*r)/(l+a*r),i=f-g,i<-Math.pi?g-=Qr:i>Math.pi&&(g+=Qr),this.lam0=k(.5*(f+g)-Math.atan(l*Math.tan(.5*this.B*(f-g))/h)/this.B),u=Math.atan(2*Math.sin(this.B*k(f-this.lam0))/(s-1/s)),c=y=Math.asin(n*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(ut-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(ut+s))}function n2(i){var t={},e,n,s,r,a,o,h,l;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-A)>F){if(a=this.E/Math.pow(Be(this.e,i.y,Math.sin(i.y)),this.B),o=1/a,e=.5*(a-o),n=.5*(a+o),r=Math.sin(this.B*i.x),s=(e*this.singam-r*this.cosgam)/n,Math.abs(Math.abs(s)-1)0?this.v_pole_n:this.v_pole_s,h=this.ArB*i.y;return this.no_rot?(t.x=h,t.y=l):(h-=this.u_0,t.x=l*this.cosrot+h*this.sinrot,t.y=h*this.cosrot-l*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function s2(i){var t,e,n,s,r,a,o,h={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(e=i.y,t=i.x):(e=i.x*this.cosrot-i.y*this.sinrot,t=i.y*this.cosrot+i.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*e),s=.5*(n-1/n),r=.5*(n+1/n),a=Math.sin(this.BrA*t),o=(a*this.cosgam+s*this.singam)/r,Math.abs(Math.abs(o)-1)F?this.ns=Math.log(n/o)/Math.log(s/h):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function h2(i){var t=i.x,e=i.y;Math.abs(2*Math.abs(e)-Math.PI)<=F&&(e=Ua(e)*(A-2*F));var n=Math.abs(Math.abs(e)-A),s,r;if(n>F)s=Be(this.e,e,Math.sin(e)),r=this.a*this.f0*Math.pow(s,this.ns);else{if(n=e*this.ns,n<=0)return null;r=0}var a=this.ns*k(t-this.long0);return i.x=this.k0*(r*Math.sin(a))+this.x0,i.y=this.k0*(this.rh-r*Math.cos(a))+this.y0,i}function l2(i){var t,e,n,s,r,a=(i.x-this.x0)/this.k0,o=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+o*o),e=1):(t=-Math.sqrt(a*a+o*o),e=-1);var h=0;if(t!==0&&(h=Math.atan2(e*a,e*o)),t!==0||this.ns>0){if(e=1/this.ns,n=Math.pow(t/(this.a*this.f0),e),s=ea(this.e,n),s===-9999)return null}else s=-A;return r=k(h/this.ns+this.long0),i.x=r,i.y=s,i}var c2=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const u2={init:o2,forward:h2,inverse:l2,names:c2};function d2(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function f2(i){var t,e,n,s,r,a,o,h=i.x,l=i.y,c=k(h-this.long0);return t=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/t)-this.s45),n=-c*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(n)),r=Math.asin(Math.cos(e)*Math.sin(n)/Math.cos(s)),a=this.n*r,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),i.y=o*Math.cos(a)/1,i.x=o*Math.sin(a)/1,this.czech||(i.y*=-1,i.x*=-1),i}function g2(i){var t,e,n,s,r,a,o,h,l=i.x;i.x=i.y,i.y=l,this.czech||(i.y*=-1,i.x*=-1),a=Math.sqrt(i.x*i.x+i.y*i.y),r=Math.atan2(i.y,i.x),s=r/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),e=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(t)),i.x=this.long0-e/this.alfa,o=t,h=0;var c=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-i.y)<1e-10&&(h=1),o=i.y,c+=1;while(h===0&&c<15);return c>=15?null:i}var _2=["Krovak","krovak"];const m2={init:d2,forward:f2,inverse:g2,names:_2};function te(i,t,e,n,s){return i*s-t*Math.sin(2*s)+e*Math.sin(4*s)-n*Math.sin(6*s)}function ja(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Xa(i){return .375*i*(1+.25*i*(1+.46875*i))}function qa(i){return .05859375*i*i*(1+.75*i)}function Ya(i){return i*i*i*(35/3072)}function Hs(i,t,e){var n=t*e;return i/Math.sqrt(1-n*n)}function hn(i){return Math.abs(i)1e-7?(e=i*t,(1-i*i)*(t/(1-e*e)-.5/i*Math.log((1-e)/(1+e)))):2*t}var M2=1,w2=2,S2=3,R2=4;function C2(){var i=Math.abs(this.lat0);if(Math.abs(i-A)0){var t;switch(this.qp=nn(this.e,1),this.mmf=.5/(1-this.es),this.apa=N2(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=nn(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function I2(i){var t,e,n,s,r,a,o,h,l,c,u=i.x,d=i.y;if(u=k(u-this.long0),this.sphere){if(r=Math.sin(d),c=Math.cos(d),n=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+c*n:1+this.sinph0*r+this.cosph0*c*n,e<=F)return null;e=Math.sqrt(2/e),t=e*c*Math.sin(u),e*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(d+this.lat0)=0?(t=(l=Math.sqrt(a))*s,e=n*(this.mode===this.S_POLE?l:-l)):t=e=0;break}}return i.x=this.a*t+this.x0,i.y=this.a*e+this.y0,i}function b2(i){i.x-=this.x0,i.y-=this.y0;var t=i.x/this.a,e=i.y/this.a,n,s,r,a,o,h,l;if(this.sphere){var c=0,u,d=0;if(u=Math.sqrt(t*t+e*e),s=u*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(d=Math.sin(s),c=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(u)<=F?0:Math.asin(e*d/u),t*=d,e=c*u;break;case this.OBLIQ:s=Math.abs(u)<=F?this.lat0:Math.asin(c*this.sinph0+e*d*this.cosph0/u),t*=d*this.cosph0,e=(c-Math.sin(s)*this.sinph0)*u;break;case this.N_POLE:e=-e,s=A-s;break;case this.S_POLE:s-=A;break}n=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,h=Math.sqrt(t*t+e*e),h1&&(i=i>1?1:-1),Math.asin(i)}function z2(){Math.abs(this.lat1+this.lat2)F?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function W2(i){var t=i.x,e=i.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var n=nn(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,r=this.ns0*k(t-this.long0),a=s*Math.sin(r)+this.x0,o=this.rh-s*Math.cos(r)+this.y0;return i.x=a,i.y=o,i}function B2(i){var t,e,n,s,r,a;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),n=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),n=-1),s=0,t!==0&&(s=Math.atan2(n*i.x,n*i.y)),n=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(e=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,e)),r=k(s/this.ns0+this.long0),i.x=r,i.y=a,i}function U2(i,t){var e,n,s,r,a,o=an(.5*t);if(i0||Math.abs(a)<=F?(o=this.x0+this.a*r*e*Math.sin(n)/a,h=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*e*s)/a):(o=this.x0+this.infinity_dist*e*Math.sin(n),h=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*s)),i.x=o,i.y=h,i}function V2(i){var t,e,n,s,r,a;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(t=Math.sqrt(i.x*i.x+i.y*i.y))?(s=Math.atan2(t,this.rc),e=Math.sin(s),n=Math.cos(s),a=an(n*this.sin_p14+i.y*e*this.cos_p14/t),r=Math.atan2(i.x*e,t*this.cos_p14*n-i.y*this.sin_p14*e),r=k(this.long0+r)):(a=this.phic0,r=0),i.x=r,i.y=a,i}var K2=["gnom"];const Z2={init:q2,forward:Y2,inverse:V2,names:K2};function $2(i,t){var e=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*A:A;for(var n=Math.asin(.5*t),s,r,a,o,h=0;h<30;h++)if(r=Math.sin(n),a=Math.cos(n),o=i*r,s=Math.pow(1-o*o,2)/(2*a)*(t/(1-i*i)-r/(1-o*o)+.5/i*Math.log((1-o)/(1+o))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function H2(){this.sphere||(this.k0=ni(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function J2(i){var t=i.x,e=i.y,n,s,r=k(t-this.long0);if(this.sphere)n=this.x0+this.a*r*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var a=nn(this.e,Math.sin(e));n=this.x0+this.a*this.k0*r,s=this.y0+this.a*a*.5/this.k0}return i.x=n,i.y=s,i}function Q2(i){i.x-=this.x0,i.y-=this.y0;var t,e;return this.sphere?(t=k(this.long0+i.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(e=$2(this.e,2*i.y*this.k0/this.a),t=k(this.long0+i.x/(this.a*this.k0))),i.x=t,i.y=e,i}var tw=["cea"];const ew={init:H2,forward:J2,inverse:Q2,names:tw};function iw(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function nw(i){var t=i.x,e=i.y,n=k(t-this.long0),s=hn(e-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*s,i}function sw(i){var t=i.x,e=i.y;return i.x=k(this.long0+(t-this.x0)/(this.a*this.rc)),i.y=hn(this.lat0+(e-this.y0)/this.a),i}var rw=["Equirectangular","Equidistant_Cylindrical","eqc"];const aw={init:iw,forward:nw,inverse:sw,names:rw};var pd=20;function ow(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ja(this.es),this.e1=Xa(this.es),this.e2=qa(this.es),this.e3=Ya(this.es),this.ml0=this.a*te(this.e0,this.e1,this.e2,this.e3,this.lat0)}function hw(i){var t=i.x,e=i.y,n,s,r,a=k(t-this.long0);if(r=a*Math.sin(e),this.sphere)Math.abs(e)<=F?(n=this.a*a,s=-1*this.a*this.lat0):(n=this.a*Math.sin(r)/Math.tan(e),s=this.a*(hn(e-this.lat0)+(1-Math.cos(r))/Math.tan(e)));else if(Math.abs(e)<=F)n=this.a*a,s=-1*this.ml0;else{var o=Hs(this.a,this.e,Math.sin(e))/Math.tan(e);n=o*Math.sin(r),s=this.a*te(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(r))}return i.x=n+this.x0,i.y=s+this.y0,i}function lw(i){var t,e,n,s,r,a,o,h,l;if(n=i.x-this.x0,s=i.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=F)t=k(n/this.a+this.long0),e=0;else{a=this.lat0+s/this.a,o=n*n/this.a/this.a+a*a,h=a;var c;for(r=pd;r;--r)if(c=Math.tan(h),l=-1*(a*(h*c+1)-h-.5*(h*h+o)*c)/((h-a)/c-1),h+=l,Math.abs(l)<=F){e=h;break}t=k(this.long0+Math.asin(n*Math.tan(h)/this.a)/Math.sin(e))}else if(Math.abs(s+this.ml0)<=F)e=0,t=k(this.long0+n/this.a);else{a=(this.ml0+s)/this.a,o=n*n/this.a/this.a+a*a,h=a;var u,d,f,g,_;for(r=pd;r;--r)if(_=this.e*Math.sin(h),u=Math.sqrt(1-_*_)*Math.tan(h),d=this.a*te(this.e0,this.e1,this.e2,this.e3,h),f=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),g=d/this.a,l=(a*(u*g+1)-g-.5*u*(g*g+o))/(this.es*Math.sin(2*h)*(g*g+o-2*a*g)/(4*u)+(a-g)*(u*f-2/Math.sin(2*h))-f),h-=l,Math.abs(l)<=F){e=h;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=k(this.long0+Math.asin(n*u/this.a)/Math.sin(e))}return i.x=t,i.y=e,i}var cw=["Polyconic","poly"];const uw={init:ow,forward:hw,inverse:lw,names:cw};function dw(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function fw(i){var t,e=i.x,n=i.y,s=n-this.lat0,r=e-this.long0,a=s/Lr*1e-5,o=r,h=1,l=0;for(t=1;t<=10;t++)h=h*a,l=l+this.A[t]*h;var c=l,u=o,d=1,f=0,g,_,m=0,y=0;for(t=1;t<=6;t++)g=d*c-f*u,_=f*c+d*u,d=g,f=_,m=m+this.B_re[t]*d-this.B_im[t]*f,y=y+this.B_im[t]*d+this.B_re[t]*f;return i.x=y*this.a+this.x0,i.y=m*this.a+this.y0,i}function gw(i){var t,e=i.x,n=i.y,s=e-this.x0,r=n-this.y0,a=r/this.a,o=s/this.a,h=1,l=0,c,u,d=0,f=0;for(t=1;t<=6;t++)c=h*a-l*o,u=l*a+h*o,h=c,l=u,d=d+this.C_re[t]*h-this.C_im[t]*l,f=f+this.C_im[t]*h+this.C_re[t]*l;for(var g=0;g.999999999999&&(e=.999999999999),t=Math.asin(e);var n=k(this.long0+i.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var s=Math.asin(e);return i.x=n,i.y=s,i}var Lw=["Mollweide","moll"];const Pw={init:bw,forward:Tw,inverse:Aw,names:Lw};function Ow(){Math.abs(this.lat1+this.lat2)=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),t=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),t=-1);var r=0;if(e!==0&&(r=Math.atan2(t*i.x,t*i.y)),this.sphere)return s=k(this.long0+r/this.ns),n=hn(this.g-e/this.a),i.x=s,i.y=n,i;var a=this.g-e/this.a;return n=jo(a,this.e0,this.e1,this.e2,this.e3),s=k(this.long0+r/this.ns),i.x=s,i.y=n,i}var Fw=["Equidistant_Conic","eqdc"];const kw={init:Ow,forward:Dw,inverse:Nw,names:Fw};function Gw(){this.R=this.a}function zw(i){var t=i.x,e=i.y,n=k(t-this.long0),s,r;Math.abs(e)<=F&&(s=this.x0+this.R*n,r=this.y0);var a=an(2*Math.abs(e/Math.PI));(Math.abs(n)<=F||Math.abs(Math.abs(e)-A)<=F)&&(s=this.x0,e>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*a):r=this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/n-n/Math.PI),h=o*o,l=Math.sin(a),c=Math.cos(a),u=c/(l+c-1),d=u*u,f=u*(2/l-1),g=f*f,_=Math.PI*this.R*(o*(u-g)+Math.sqrt(h*(u-g)*(u-g)-(g+h)*(d-g)))/(g+h);n<0&&(_=-_),s=this.x0+_;var m=h+u;return _=Math.PI*this.R*(f*m-o*Math.sqrt((g+h)*(h+1)-m*m))/(g+h),e>=0?r=this.y0+_:r=this.y0-_,i.x=s,i.y=r,i}function Ww(i){var t,e,n,s,r,a,o,h,l,c,u,d,f;return i.x-=this.x0,i.y-=this.y0,u=Math.PI*this.R,n=i.x/u,s=i.y/u,r=n*n+s*s,a=-Math.abs(s)*(1+r),o=a-2*s*s+n*n,h=-2*a+1+2*s*s+r*r,f=s*s/h+(2*o*o*o/h/h/h-9*a*o/h/h)/27,l=(a-o*o/3/h)/h,c=2*Math.sqrt(-l/3),u=3*f/l/c,Math.abs(u)>1&&(u>=0?u=1:u=-1),d=Math.acos(u)/3,i.y>=0?e=(-c*Math.cos(d+Math.PI/3)-o/3/h)*Math.PI:e=-(-c*Math.cos(d+Math.PI/3)-o/3/h)*Math.PI,Math.abs(n)2*A*this.a?void 0:(e=t/this.a,n=Math.sin(e),s=Math.cos(e),r=this.long0,Math.abs(t)<=F?a=this.lat0:(a=an(s*this.sin_p12+i.y*n*this.cos_p12/t),o=Math.abs(this.lat0)-A,Math.abs(o)<=F?this.lat0>=0?r=k(this.long0+Math.atan2(i.x,-i.y)):r=k(this.long0-Math.atan2(-i.x,i.y)):r=k(this.long0+Math.atan2(i.x*n,t*this.cos_p12*s-i.y*this.sin_p12*n))),i.x=r,i.y=a,i)):(h=ja(this.es),l=Xa(this.es),c=qa(this.es),u=Ya(this.es),Math.abs(this.sin_p12-1)<=F?(d=this.a*te(h,l,c,u,A),t=Math.sqrt(i.x*i.x+i.y*i.y),f=d-t,a=jo(f/this.a,h,l,c,u),r=k(this.long0+Math.atan2(i.x,-1*i.y)),i.x=r,i.y=a,i):Math.abs(this.sin_p12+1)<=F?(d=this.a*te(h,l,c,u,A),t=Math.sqrt(i.x*i.x+i.y*i.y),f=t-d,a=jo(f/this.a,h,l,c,u),r=k(this.long0+Math.atan2(i.x,i.y)),i.x=r,i.y=a,i):(t=Math.sqrt(i.x*i.x+i.y*i.y),m=Math.atan2(i.x,i.y),g=Hs(this.a,this.e,this.sin_p12),y=Math.cos(m),p=this.e*this.cos_p12*y,x=-p*p/(1-this.es),E=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),M=t/g,R=M-x*(1+x)*Math.pow(M,3)/6-E*(1+3*x)*Math.pow(M,4)/24,S=1-x*R*R/2-M*R*R*R/6,_=Math.asin(this.sin_p12*Math.cos(R)+this.cos_p12*Math.sin(R)*y),r=k(this.long0+Math.asin(Math.sin(m)*Math.sin(R)/Math.cos(_))),w=Math.sin(_),a=Math.atan2((w-this.es*S*this.sin_p12)*Math.tan(_),w*(1-this.es)),i.x=r,i.y=a,i))}var Yw=["Azimuthal_Equidistant","aeqd"];const Vw={init:jw,forward:Xw,inverse:qw,names:Yw};function Kw(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Zw(i){var t,e,n,s,r,a,o,h,l=i.x,c=i.y;return n=k(l-this.long0),t=Math.sin(c),e=Math.cos(c),s=Math.cos(n),a=this.sin_p14*t+this.cos_p14*e*s,r=1,(a>0||Math.abs(a)<=F)&&(o=this.a*r*e*Math.sin(n),h=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*e*s)),i.x=o,i.y=h,i}function $w(i){var t,e,n,s,r,a,o;return i.x-=this.x0,i.y-=this.y0,t=Math.sqrt(i.x*i.x+i.y*i.y),e=an(t/this.a),n=Math.sin(e),s=Math.cos(e),a=this.long0,Math.abs(t)<=F?(o=this.lat0,i.x=a,i.y=o,i):(o=an(s*this.sin_p14+i.y*n*this.cos_p14/t),r=Math.abs(this.lat0)-A,Math.abs(r)<=F?(this.lat0>=0?a=k(this.long0+Math.atan2(i.x,-i.y)):a=k(this.long0-Math.atan2(-i.x,i.y)),i.x=a,i.y=o,i):(a=k(this.long0+Math.atan2(i.x*n,t*this.cos_p14*s-i.y*this.sin_p14*n)),i.x=a,i.y=o,i))}var Hw=["ortho"];const Jw={init:Kw,forward:Zw,inverse:$w,names:Hw};var St={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},dt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Qw(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=A-ut/2?this.face=St.TOP:this.lat0<=-(A-ut/2)?this.face=St.BOTTOM:Math.abs(this.long0)<=ut?this.face=St.FRONT:Math.abs(this.long0)<=A+ut?this.face=this.long0>0?St.RIGHT:St.LEFT:this.face=St.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function tS(i){var t={x:0,y:0},e,n,s,r,a,o,h={value:0};if(i.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):e=i.y,n=i.x,this.face===St.TOP)r=A-e,n>=ut&&n<=A+ut?(h.value=dt.AREA_0,s=n-A):n>A+ut||n<=-(A+ut)?(h.value=dt.AREA_1,s=n>0?n-It:n+It):n>-(A+ut)&&n<=-ut?(h.value=dt.AREA_2,s=n+A):(h.value=dt.AREA_3,s=n);else if(this.face===St.BOTTOM)r=A+e,n>=ut&&n<=A+ut?(h.value=dt.AREA_0,s=-n+A):n=-ut?(h.value=dt.AREA_1,s=-n):n<-ut&&n>=-(A+ut)?(h.value=dt.AREA_2,s=-n-A):(h.value=dt.AREA_3,s=n>0?-n+It:-n-It);else{var l,c,u,d,f,g,_;this.face===St.RIGHT?n=ms(n,+A):this.face===St.BACK?n=ms(n,+It):this.face===St.LEFT&&(n=ms(n,-A)),d=Math.sin(e),f=Math.cos(e),g=Math.sin(n),_=Math.cos(n),l=f*_,c=f*g,u=d,this.face===St.FRONT?(r=Math.acos(l),s=uo(r,u,c,h)):this.face===St.RIGHT?(r=Math.acos(c),s=uo(r,u,-l,h)):this.face===St.BACK?(r=Math.acos(-l),s=uo(r,u,-c,h)):this.face===St.LEFT?(r=Math.acos(-c),s=uo(r,u,l,h)):(r=s=0,h.value=dt.AREA_0)}return o=Math.atan(12/It*(s+Math.acos(Math.sin(s)*Math.cos(ut))-A)),a=Math.sqrt((1-Math.cos(r))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(s))))),h.value===dt.AREA_1?o+=A:h.value===dt.AREA_2?o+=It:h.value===dt.AREA_3&&(o+=1.5*It),t.x=a*Math.cos(o),t.y=a*Math.sin(o),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,i.x=t.x,i.y=t.y,i}function eS(i){var t={lam:0,phi:0},e,n,s,r,a,o,h,l,c,u={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,n=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),e=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?u.value=dt.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(u.value=dt.AREA_1,e-=A):i.x<0&&-i.x>=Math.abs(i.y)?(u.value=dt.AREA_2,e=e<0?e+It:e-It):(u.value=dt.AREA_3,e+=A),c=It/12*Math.tan(e),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),s=Math.cos(e),r=Math.tan(n),h=1-s*s*r*r*(1-Math.cos(Math.atan(1/Math.cos(o)))),h<-1?h=-1:h>1&&(h=1),this.face===St.TOP)l=Math.acos(h),t.phi=A-l,u.value===dt.AREA_0?t.lam=o+A:u.value===dt.AREA_1?t.lam=o<0?o+It:o-It:u.value===dt.AREA_2?t.lam=o-A:t.lam=o;else if(this.face===St.BOTTOM)l=Math.acos(h),t.phi=l-A,u.value===dt.AREA_0?t.lam=-o+A:u.value===dt.AREA_1?t.lam=-o:u.value===dt.AREA_2?t.lam=-o-A:t.lam=o<0?-o-It:-o+It;else{var d,f,g;d=h,c=d*d,c>=1?g=0:g=Math.sqrt(1-c)*Math.sin(o),c+=g*g,c>=1?f=0:f=Math.sqrt(1-c),u.value===dt.AREA_1?(c=f,f=-g,g=c):u.value===dt.AREA_2?(f=-f,g=-g):u.value===dt.AREA_3&&(c=f,f=g,g=-c),this.face===St.RIGHT?(c=d,d=-f,f=c):this.face===St.BACK?(d=-d,f=-f):this.face===St.LEFT&&(c=d,d=f,f=-c),t.phi=Math.acos(-g)-A,t.lam=Math.atan2(f,d),this.face===St.RIGHT?t.lam=ms(t.lam,-A):this.face===St.BACK?t.lam=ms(t.lam,-It):this.face===St.LEFT&&(t.lam=ms(t.lam,+A))}if(this.es!==0){var _,m,y;_=t.phi<0?1:0,m=Math.tan(t.phi),y=this.b/Math.sqrt(m*m+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,i.x=t.lam,i.y=t.phi,i}function uo(i,t,e,n){var s;return iut&&s<=A+ut?(n.value=dt.AREA_1,s-=A):s>A+ut||s<=-(A+ut)?(n.value=dt.AREA_2,s=s>=0?s-It:s+It):(n.value=dt.AREA_3,s+=A)),s}function ms(i,t){var e=i+t;return e<-It?e+=Qr:e>+It&&(e-=Qr),e}var iS=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const nS={init:Qw,forward:tS,inverse:eS,names:iS};var Ml=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Cr=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],d0=.8487,f0=1.3523,g0=ti/5,sS=1/g0,us=18,Xo=function(i,t){return i[0]+t*(i[1]+t*(i[2]+t*i[3]))},rS=function(i,t){return i[1]+t*(2*i[2]+t*3*i[3])};function aS(i,t,e,n){for(var s=t;n;--n){var r=i(s);if(s-=r,Math.abs(r)=us&&(n=us-1),e=ti*(e-sS*n);var s={x:Xo(Ml[n],e)*t,y:Xo(Cr[n],e)};return i.y<0&&(s.y=-s.y),s.x=s.x*this.a*d0+this.x0,s.y=s.y*this.a*f0+this.y0,s}function lS(i){var t={x:(i.x-this.x0)/(this.a*d0),y:Math.abs(i.y-this.y0)/(this.a*f0)};if(t.y>=1)t.x/=Ml[us][0],t.y=i.y<0?-A:A;else{var e=Math.floor(t.y*us);for(e<0?e=0:e>=us&&(e=us-1);;)if(Cr[e][0]>t.y)--e;else if(Cr[e+1][0]<=t.y)++e;else break;var n=Cr[e],s=5*(t.y-n[0])/(Cr[e+1][0]-n[0]);s=aS(function(r){return(Xo(n,r)-t.y)/rS(n,r)},s,F,100),t.x/=Xo(Ml[e],s),t.y=(5*e+s)*Ut,i.y<0&&(t.y=-t.y)}return t.x=k(t.x+this.long0),t}var cS=["Robinson","robin"];const uS={init:oS,forward:hS,inverse:lS,names:cS};function dS(){this.name="geocent"}function fS(i){var t=e0(i,this.es,this.a);return t}function gS(i){var t=i0(i,this.es,this.a,this.b);return t}var _S=["Geocentric","geocentric","geocent","Geocent"];const mS={init:dS,forward:fS,inverse:gS,names:_S};var Vt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},yr={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function yS(){if(Object.keys(yr).forEach((function(e){if(typeof this[e]>"u")this[e]=yr[e].def;else{if(yr[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);yr[e].num&&(this[e]=parseFloat(this[e]))}yr[e].degrees&&(this[e]=this[e]*Ut)}).bind(this)),Math.abs(Math.abs(this.lat0)-A)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var i=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(i),this.sw=Math.sin(i)}function pS(i){i.x-=this.long0;var t=Math.sin(i.y),e=Math.cos(i.y),n=Math.cos(i.x),s,r;switch(this.mode){case Vt.OBLIQ:r=this.sinph0*t+this.cosph0*e*n;break;case Vt.EQUIT:r=e*n;break;case Vt.S_POLE:r=-t;break;case Vt.N_POLE:r=t;break}switch(r=this.pn1/(this.p-r),s=r*e*Math.sin(i.x),this.mode){case Vt.OBLIQ:r*=this.cosph0*t-this.sinph0*e*n;break;case Vt.EQUIT:r*=t;break;case Vt.N_POLE:r*=-(e*n);break;case Vt.S_POLE:r*=e*n;break}var a,o;return a=r*this.cg+s*this.sg,o=1/(a*this.sw*this.h1+this.cw),s=(s*this.cg-r*this.sg)*this.cw*o,r=a*o,i.x=s*this.a,i.y=r*this.a,i}function vS(i){i.x/=this.a,i.y/=this.a;var t={x:i.x,y:i.y},e,n,s;s=1/(this.pn1-i.y*this.sw),e=this.pn1*i.x*s,n=this.pn1*i.y*this.cw*s,i.x=e*this.cg+n*this.sg,i.y=n*this.cg-e*this.sg;var r=he(i.x,i.y);if(Math.abs(r)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var i=1-this.es,t=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function wS(i){var t=i.x,e=i.y,n,s,r,a;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var o=this.radius_p/he(this.radius_p*Math.cos(e),Math.sin(e));if(s=o*Math.cos(t)*Math.cos(e),r=o*Math.sin(t)*Math.cos(e),a=o*Math.sin(e),(this.radius_g-s)*s-r*r-a*a*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(r/he(a,n)),i.y=this.radius_g_1*Math.atan(a/n)):(i.x=this.radius_g_1*Math.atan(r/n),i.y=this.radius_g_1*Math.atan(a/he(r,n)))}else this.shape==="sphere"&&(n=Math.cos(e),s=Math.cos(t)*n,r=Math.sin(t)*n,a=Math.sin(e),n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(r/he(a,n)),i.y=this.radius_g_1*Math.atan(a/n)):(i.x=this.radius_g_1*Math.atan(r/n),i.y=this.radius_g_1*Math.atan(a/he(r,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function SS(i){var t=-1,e=0,n=0,s,r,a,o;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),e=Math.tan(i.x/this.radius_g_1)*he(1,n)):(e=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*he(1,e));var h=n/this.radius_p;if(s=e*e+h*h+t*t,r=2*this.radius_g*t,a=r*r-4*s*this.C,a<0)return i.x=Number.NaN,i.y=Number.NaN,i;o=(-r-Math.sqrt(a))/(2*s),t=this.radius_g+o*t,e*=o,n*=o,i.x=Math.atan2(e,t),i.y=Math.atan(n*Math.cos(i.x)/t),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),e=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+n*n)):(e=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+e*e)),s=e*e+n*n+t*t,r=2*this.radius_g*t,a=r*r-4*s*this.C,a<0)return i.x=Number.NaN,i.y=Number.NaN,i;o=(-r-Math.sqrt(a))/(2*s),t=this.radius_g+o*t,e*=o,n*=o,i.x=Math.atan2(e,t),i.y=Math.atan(n*Math.cos(i.x)/t)}return i.x=i.x+this.long0,i}var RS=["Geostationary Satellite View","Geostationary_Satellite","geos"];const CS={init:MS,forward:wS,inverse:SS,names:RS};var Pr=1.340264,Or=-.081106,Dr=893e-6,Nr=.003796,qo=Math.sqrt(3)/2;function IS(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function bS(i){var t=k(i.x-this.long0),e=i.y,n=Math.asin(qo*Math.sin(e)),s=n*n,r=s*s*s;return i.x=t*Math.cos(n)/(qo*(Pr+3*Or*s+r*(7*Dr+9*Nr*s))),i.y=n*(Pr+Or*s+r*(Dr+Nr*s)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function TS(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var t=1e-9,e=12,n=i.y,s,r,a,o,h,l;for(l=0;l=A?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=FS,this.forward=NS)}function OS(i){var t=k(i.x-(this.long0||0)),e=i.y,n,s,r;return n=this.am1+this.m1-rr(e,s=Math.sin(e),r=Math.cos(e),this.en),s=r*t/(n*Math.sqrt(1-this.es*s*s)),i.x=n*Math.sin(s),i.y=this.am1-n*Math.cos(s),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function DS(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var t,e,n,s;if(e=he(i.x,i.y=this.am1-i.y),s=Dc(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(s))ia?(i.x=s*Math.sin(n=t*Math.cos(e)/s),i.y=this.cphi1-s*Math.cos(n)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function FS(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var t,e,n=he(i.x,i.y=this.cphi1-i.y);if(e=this.cphi1+this.phi1-n,Math.abs(e)>A)throw new Error;return Math.abs(Math.abs(e)-A)<=ia?t=0:t=n*Math.atan2(i.x,i.y)/Math.cos(e),i.x=k(t+(this.long0||0)),i.y=hn(e),i}var kS=["bonne","Bonne (Werner lat_1=90)"];const GS={init:PS,names:kS};function zS(i){i.Proj.projections.add(vo),i.Proj.projections.add(xo),i.Proj.projections.add(OM),i.Proj.projections.add(jM),i.Proj.projections.add(ZM),i.Proj.projections.add(t2),i.Proj.projections.add(a2),i.Proj.projections.add(u2),i.Proj.projections.add(m2),i.Proj.projections.add(E2),i.Proj.projections.add(G2),i.Proj.projections.add(X2),i.Proj.projections.add(Z2),i.Proj.projections.add(ew),i.Proj.projections.add(aw),i.Proj.projections.add(uw),i.Proj.projections.add(mw),i.Proj.projections.add(Ew),i.Proj.projections.add(Iw),i.Proj.projections.add(Pw),i.Proj.projections.add(kw),i.Proj.projections.add(Uw),i.Proj.projections.add(Vw),i.Proj.projections.add(Jw),i.Proj.projections.add(nS),i.Proj.projections.add(uS),i.Proj.projections.add(mS),i.Proj.projections.add(ES),i.Proj.projections.add(CS),i.Proj.projections.add(LS),i.Proj.projections.add(GS)}ue.defaultDatum="WGS84";ue.Proj=ei;ue.WGS84=new ue.Proj("WGS84");ue.Point=$s;ue.toPoint=n0;ue.defs=$t;ue.nadgrid=NE;ue.transform=Uo;ue.mgrs=HE;ue.version="__VERSION__";zS(ue);function WS(i){for(const[t,e]of Object.entries(i))ue.defs(t,e);Zx(ue)}const BS=1,Yo=gt.createContext(BS);Yo.displayName="LevelContext";function pC(i){const{title:t,sectionHeadingProps:e,children:n}=i,s=gt.useContext(Yo),r=typeof t=="string"?Ie.jsx(US,{...e,children:t}):t;return Ie.jsxs(Ie.Fragment,{children:[r,Ie.jsx(Yo.Provider,{value:s+1,children:n})]})}const US=gt.forwardRef(function(t,e){const{children:n,...s}=t,r=jS(),a=XS(r);return Ie.jsx(O0,{as:a,ref:e,...s,children:n})});function jS(){const i=gt.useContext(Yo);return Math.min(i,6)}function XS(i){return`h${i}`}var _0={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(i){(function(){var t={}.hasOwnProperty;function e(){for(var r="",a=0;a`(${u} + ${d}px)`,c={};switch(i){case"top-left":c.left=l(wl.ref,r),c.top=l(Rl.ref,o);break;case"top-right":c.right=l(Sl.ref,r),c.top=l(Rl.ref,o);break;case"bottom-left":c.left=l(wl.ref,r),c.bottom=l(Cl.ref,o+h.gap);break;case"bottom-right":c.right=l(Sl.ref,r),c.bottom=l(Cl.ref,o+h.gap);break}for(const[u,d]of Object.entries(c))n[u]=`calc(${d})`;return n.maxH=`calc((100%) - ${fo(c.top,"0px")} - ${fo(c.bottom,h.gap+"px")} - ${o}px - ${h.space}px)`,n.maxW=`calc((100%) - ${fo(c.left,"0px")} - ${fo(c.right,"0px")} - ${r}px)`,n}function fo(i,t){return i??t}const Gc=gt.createContext(void 0);Gc.displayName="MapContainerContext";const KS=Gc.Provider;function ZS(){const i=gt.useContext(Gc);if(!i)throw new Error("Map container context is not available. The component must be a child of the component.");return i}const $S="top-right";function vC(i){const{position:t=$S,children:e,horizontalGap:n,verticalGap:s}=i,{containerProps:r}=m0("map-anchor",i),{mapAnchorsHost:a}=ZS();return N0.createPortal(Ie.jsx(F0,{...r,...VS(t,n,s),children:e}),a)}function HS(i){return{gap:i===void 0?30:0,space:10}}function JS(i,t,e){const n=gt.useContext(Pd);return gt.useMemo(()=>y0("useService",n).getService(i,t,e??{}),[n,i,t,e])}function xC(i){const t=gt.useContext(Pd);return y0("useIntl",t).getIntl(i)}function y0(i,t){if(!t)throw new k0(G0.INTERNAL,`"Failed to access package context from '${i}': react integration was not set up properly.`);return t}const QS="@open-pioneer/map",tR=JS.bind(void 0,QS);function eR(){var i=gt.useRef(!1),t=gt.useCallback(function(){return i.current},[]);return gt.useEffect(function(){return i.current=!0,function(){i.current=!1}},[]),t}function iR(i,t,e){t===void 0&&(t=[]),e===void 0&&(e={loading:!1});var n=gt.useRef(0),s=eR(),r=gt.useState(e),a=r[0],o=r[1],h=gt.useCallback(function(){for(var l=[],c=0;c{const l=h.getType(),c=new Mc({type:l,geometry:h});return c.setStyle(uR(l,e?.highlightStyle)),c}),r=this.olSource,a=this.activeHighlights,o={get isActive(){return a.has(o)},destroy(){if(this.isActive){for(const h of s)r.removeFeature(h);a.delete(o)}}};return r.addFeatures(s),this.activeHighlights.add(o),o}zoomToHighlight(t,e){const n=j(this,pa,Il).call(this,t);if(n.length===0)return;let s=me();for(const f of n)s=nf(s,f.getExtent());const r=Te(s),o=js(s)===0?e?.pointZoom??sR:e?.maxZoom??rR;hR(this.olMap,r);const{top:h=0,right:l=0,bottom:c=0,left:u=0}=e?.viewPadding??aR,d=[h,l,c,u];lR(this.olMap,s,o,d)}addHighlightAndZoom(t,e){const n=this.addHighlight(t,e);return this.zoomToHighlight(t,e),n}clearHighlight(){for(const t of this.activeHighlights)t.destroy()}}pa=new WeakSet,Il=function(t){const e=[];return t.forEach(n=>{"getType"in n&&e.push(n),"geometry"in n&&n.geometry&&e.push(n.geometry)}),e};function hR(i,t){t&&t.length&&i.getView().setCenter(t)}function lR(i,t,e,n){t?i.getView().fit(t,{maxZoom:e,padding:n}):e&&i.getView().setZoom(e)}function cR(i,t){const e=i.get("type");return xg(bl(e))(i,t)}function uR(i,t){if(t&&i in t){const n=t[i];return n||bl(i)}else return bl(i)}function bl(i){return i in Yh?Yh[i]:Yh.Polygon}const Yh={Point:new Ct({image:new Zs({anchor:[.5,1],src:vd})}),MultiPoint:new Ct({image:new Zs({anchor:[.5,1],src:vd})}),LineString:[new Ct({stroke:new Ht({color:"#fff",width:5})}),new Ct({stroke:new Ht({color:"#00ffff",width:3})})],MultiLineString:[new Ct({stroke:new Ht({color:"#fff",width:5})}),new Ct({stroke:new Ht({color:"#00ffff",width:3})})],Polygon:[new Ct({stroke:new Ht({color:"#fff",width:5})}),new Ct({stroke:new Ht({color:"#00ffff",width:3}),fill:new Ci({color:"rgba(224,255,255,0.35)"})})],MultiPolygon:[new Ct({stroke:new Ht({color:"#fff",width:5})}),new Ct({stroke:new Ht({color:"#00ffff",width:3}),fill:new Ci({color:"rgba(224,255,255,0.35)"})})]},ki=Ii("map:LayerCollection"),dR=0,fR=1,gR=9999999;var bn,Xi,Se,qi,Oe,Vo,ce,p0,v0,Eo,x0,E0;class _R{constructor(t){D(this,ce);D(this,bn);D(this,Xi,f_());D(this,Se,new Map);D(this,qi,new WeakMap);D(this,Oe,Kt());D(this,Vo,fR);U(this,bn,t)}destroy(){for(const t of v(this,Se).values())t.destroy();v(this,Xi).clear(),v(this,Se).clear(),v(this,Oe).value=void 0}addLayer(t){xd(t),t.__attachToMap(v(this,bn)),j(this,ce,p0).call(this,t)}getBaseLayers(){return this.getAllLayers().filter(t=>t.isBaseLayer)}getActiveBaseLayer(){return v(this,Oe).value}activateBaseLayer(t){let e;if(t!=null){if(e=v(this,Se).get(t),!(e instanceof qs))return ki.warn(`Cannot activate base layer '${t}: layer has an invalid type.'`),!1;if(!e)return ki.warn(`Cannot activate base layer '${t}': layer is unknown.`),!1;if(!e.isBaseLayer)return ki.warn(`Cannot activate base layer '${t}': layer is not a base layer.`),!1}return j(this,ce,Eo).call(this,e),!0}getOperationalLayers(t){return this.getAllLayers(t).filter(e=>!e.isBaseLayer)}getAllLayers(t){const e=Array.from(v(this,Xi).values());return t?.sortByDisplayOrder&&mR(e),e}getLayerById(t){return v(this,Se).get(t)}removeLayerById(t){const e=v(this,Se).get(t);if(!e){ki.isDebug()&&ki.debug(`Cannot remove layer '${t}': layer is unknown.`);return}j(this,ce,v0).call(this,e)}getLayerByRawInstance(t){return v(this,qi)?.get(t)}}bn=new WeakMap,Xi=new WeakMap,Se=new WeakMap,qi=new WeakMap,Oe=new WeakMap,Vo=new WeakMap,ce=new WeakSet,p0=function(t){j(this,ce,x0).call(this,t);const e=t.olLayer;t.isBaseLayer?(e.setZIndex(dR),!v(this,Oe).value&&t.visible?j(this,ce,Eo).call(this,t):t.__setVisible(!1)):(e.setZIndex(Kc(this,Vo)._++),t.__setVisible(t.visible)),v(this,Xi).add(t),v(this,bn).olMap.addLayer(e)},v0=function(t){if(!v(this,Xi).has(t)){ki.warn(`Cannot remove layer '${t.id}': only top level layers can be removed at this time.`);return}if(!(t instanceof qs))throw new Error("Internal error: expected top level layer to be an instance of AbstractLayer.");if(v(this,bn).olMap.removeLayer(t.olLayer),v(this,Xi).delete(t),j(this,ce,E0).call(this,t),v(this,Oe).value===t){const e=this.getBaseLayers()[0];e&&xd(e),j(this,ce,Eo).call(this,e)}t.destroy()},Eo=function(t){if(v(this,Oe).value!==t){if(ki.isDebug()){const e=n=>n?`'${n.id}'`:void 0;ki.debug(`Switching active base layer from ${e(v(this,Oe).value)} to ${e(t)}`)}Ol(()=>{v(this,Oe).value?.__setVisible(!1),v(this,Oe).value=t,t?.__setVisible(!0)})}},x0=function(t){const e=[],n=s=>{const r=s.id,a="olLayer"in s?s.olLayer:void 0;if(v(this,Se).has(r))throw new Error(`Layer id '${r}' is not unique. Either assign a unique id yourself or skip configuring 'id' for an automatically generated id.`);if(a&&v(this,qi).has(a))throw new Error(`OlLayer used by layer '${r}' has already been used in map.`);v(this,Se).set(r,s),a&&v(this,qi).set(a,s),e.push([r,a]);for(const o of s.layers?.__getRawLayers()??[])n(o);for(const o of s.sublayers?.__getRawSublayers()??[])n(o)};try{n(t)}catch(s){for(const[r,a]of e)v(this,Se).delete(r),a&&v(this,qi).delete(a);throw s}},E0=function(t){const e=n=>{"olLayer"in n&&v(this,qi).delete(n.olLayer),v(this,Se).delete(n.id);for(const s of n.layers?.__getRawLayers()??[])e(s);for(const s of n.sublayers?.__getRawSublayers()??[])e(s)};e(t)};function mR(i){i.sort((t,e)=>{const n=t.olLayer.getZIndex()??1,s=e.olLayer.getZIndex()??1;return n-s})}function xd(i){if(!(i instanceof qs))throw new Error("Layer is not a valid layer instance. Use one of the classes provided by the map package instead.")}const Hn=Ii("map:MapModel"),Ed=25.4/.28,Md=39.37;var va,Re,Fs,xa,yi,Ea,ks,Ma,Yi,Vi,wa,Sa,Ki,pi,Ko,w0;class M0 extends Od{constructor(e){super();D(this,Ko);D(this,va);D(this,Re);D(this,Fs);D(this,xa,new _R(this));D(this,yi);D(this,Ea);D(this,ks,!1);D(this,Ma);D(this,Yi,Kt());D(this,Vi);D(this,wa);D(this,Sa,new AbortController);D(this,Ki);D(this,pi);U(this,va,e.id),U(this,Re,e.olMap),U(this,Fs,br(()=>v(this,Re).getView(),n=>{const s=v(this,Re).on("change:view",n);return()=>ze(s)})),v(this,Yi).value=e.initialExtent,U(this,Ea,{httpService:e.httpService}),U(this,yi,new oR(v(this,Re))),U(this,Ki,"waiting"),j(this,Ko,w0).call(this).then(()=>{U(this,Ki,"ready"),v(this,pi)?.resolve(),U(this,pi,void 0)},n=>{Fr(n)||Hn.error("Failed to initialize map",n),U(this,Ki,"error"),v(this,pi)?.reject(new Error("Failed to initialize map.")),U(this,pi,void 0)}),U(this,Ma,br(()=>v(this,Re).getTargetElement()??void 0,n=>{const s=v(this,Re).on("change:target",n);return()=>ze(s)})),U(this,Vi,kr(()=>yR(v(this,Fs).value))),U(this,wa,kr(()=>{const{projection:n,resolution:s,center:r}=this;if(n==null||s==null||r==null)return;const a=Co(n,s,r);return Math.round(a*Md*Ed)}))}destroy(){if(!v(this,ks)){U(this,ks,!0);try{this.emit("destroy")}catch(e){Hn.warn("Unexpected error from event listener during map model destruction:",e)}v(this,Sa).abort(),v(this,pi)?.reject(new Error("Map model was destroyed.")),v(this,xa).destroy(),v(this,yi).destroy(),v(this,Re).dispose()}}get id(){return v(this,va)}get olMap(){return v(this,Re)}get olView(){return v(this,Fs).value}get projection(){return v(this,Vi).value.projection}get center(){return v(this,Vi).value.center.value}get resolution(){return v(this,Vi).value.resolution.value}get zoomLevel(){return v(this,Vi).value.zoom.value}get scale(){return v(this,wa).value}get layers(){return v(this,xa)}get container(){return v(this,Ma).value}get initialExtent(){return v(this,Yi).value}get __sharedDependencies(){return v(this,Ea)}setScale(e){const n=this.olView,s=this.projection,r=this.center;if(!r)return;const a=s.getMetersPerUnit()??1,o=Md*Ed*a,h=e/Co(s,o,r);n.setResolution(h)}highlight(e,n){return v(this,yi).addHighlight(e,n)}zoom(e,n){v(this,yi).zoomToHighlight(e,n)}highlightAndZoom(e,n){return v(this,yi).addHighlightAndZoom(e,n??{})}removeHighlights(){v(this,yi).clearHighlight()}whenDisplayed(){return v(this,ks)?Promise.reject(new Error("Map model was destroyed.")):v(this,Ki)==="error"?Promise.reject(new Error("Failed to initialize map.")):v(this,Ki)==="ready"?Promise.resolve():(v(this,pi)??U(this,pi,z0())).promise}}va=new WeakMap,Re=new WeakMap,Fs=new WeakMap,xa=new WeakMap,yi=new WeakMap,Ea=new WeakMap,ks=new WeakMap,Ma=new WeakMap,Yi=new WeakMap,Vi=new WeakMap,wa=new WeakMap,Sa=new WeakMap,Ki=new WeakMap,pi=new WeakMap,Ko=new WeakSet,w0=async function(){try{await pR(this.olMap,v(this,Sa).signal)}catch(e){throw Fr(e)?e:new Error("Failed to wait for the map to be displayed.",{cause:e})}try{const n=v(this,Re).getView();if(v(this,Yi).value){const s=v(this,Yi).value,r=[s.xMin,s.yMin,s.xMax,s.yMax],a=Te(r),o=n.getResolutionForExtent(r);Hn.debug("Applying initial extent",s),Hn.debug(" Computed center:",a),Hn.debug(" Computed resolution:",o),n.setCenter(a),n.setResolution(o)}else{const s=n.calculateExtent(),[r=0,a=0,o=0,h=0]=s,l={xMin:r,yMin:a,xMax:o,yMax:h};Hn.debug("Detected initial extent",l),v(this,Yi).value=l}}catch(e){throw new Error("Failed to apply the initial extent.",{cause:e})}};function yR(i){return{resolution:br(()=>i.getResolution(),t=>{const e=i.on("change:resolution",t);return()=>ze(e)}),center:br(()=>i.getCenter(),t=>{const e=i.on("change:center",t);return()=>ze(e)}),zoom:br(()=>i.getZoom(),t=>{const e=i.on("change:resolution",t);return()=>ze(e)}),projection:i.getProjection()}}function pR(i,t){return new Promise((n,s)=>{let r;function a(){const l=i.getSize()??[],[c=0,u=0]=l;l&&c>0&&u>0&&h()}function o(){h($c())}function h(l){r&&(ze(r),r=void 0),t.removeEventListener("abort",o),l?s(l):n(vR(25))}if(t.aborted){h($c());return}t.addEventListener("abort",o),r=i.on("change:size",a)})}function vR(i){return new Promise(t=>setTimeout(t,i))}const zc=gt.createContext(void 0);zc.displayName="DefaultMapContext";function EC(i){const{mapId:t,map:e,children:n}=i,s=gt.useMemo(()=>({mapId:t,map:e}),[t,e]);if(t!=null&&e!=null)throw new Error("Cannot specify both 'mapId' and 'map' in DefaultMapProvider at the same time.");if(t==null&&e==null)throw new Error("Either 'mapId' or 'map' must be specified in DefaultMapProvider.");return Ie.jsx(zc.Provider,{value:s,children:n})}function xR(){return gt.useContext(zc)}function ER(i){const t=MR(i),e=tR("map.MapRegistry"),n=nR(async()=>typeof t=="string"?await e.expectMapModel(t):Promise.resolve(t),[e,t]);return gt.useMemo(()=>n.loading?{kind:"loading"}:n.error?{kind:"rejected",error:n.error}:{kind:"resolved",map:n.value},[n])}function MR(i){if(typeof i=="object"&&i.mapId!=null&&i.map!=null)throw new Error("Cannot specify both 'mapId' and 'map' in useMapModel at the same time.");if(i instanceof M0)throw new Error("Map model instances cannot be passed directly to 'useMapModel' (see TypeScript signature).");const t=gt.useMemo(()=>i==null?{}:typeof i=="string"?{mapId:i}:{mapId:i.mapId,map:i.map},[...typeof i=="string"||i==null?[i]:[i.mapId,i.map]]),e=xR(),n=wd(t)??wd(e);if(n==null)throw new Error("No map specified. You must either specify the map (or its id) via a DefaultMapProvider parent or configure it explicitly.");return n}function wd(i){return i?.map??i?.mapId}const yn=Ii("map:MapContainer");function MC(i){const{viewPadding:t,viewPaddingChangeBehavior:e,children:n,role:s,"aria-label":r,"aria-labelledby":a}=i,{containerProps:o}=m0("map-container",i),h=gt.useRef(null),l=gt.useRef(null),c=ER(i),u=c.map,[d,f]=gt.useState(!1);gt.useEffect(()=>{if(c.kind!=="loading"){if(c.kind==="rejected"){yn.error("Cannot display the map. Caused by ",c.error);return}if(!u){yn.error("No configuration available for the configured map.");return}if(h.current){const _=SR(u,h.current);return()=>_?.destroy()}}},[c,u]),gt.useEffect(()=>{f(!0)},[]);const g=gt.useMemo(()=>({height:"100%",position:"relative",[Rl.definition]:t?.top!=null?t.top+"px":"0px",[Cl.definition]:t?.bottom!=null?t.bottom+"px":"0px",[wl.definition]:t?.left!=null?t.left+"px":"0px",[Sl.definition]:t?.right!=null?t.right+"px":"0px"}),[t]);return Ie.jsxs(Hh.div,{...o,role:s,"aria-label":r,"aria-labelledby":a,ref:h,style:g,tabIndex:0,children:[d&&u&&Ie.jsx(wR,{olMap:u.olMap,mapAnchorsHost:l.current,viewPadding:t,viewPaddingChangeBehavior:e,children:n}),Ie.jsx(Hh.div,{ref:l,className:"map-anchors"})]})}function wR(i){const{olMap:t,mapAnchorsHost:e,viewPadding:n,viewPaddingChangeBehavior:s="preserve-center",children:r}=i,a=gt.useMemo(()=>({left:n?.left??0,right:n?.right??0,top:n?.top??0,bottom:n?.bottom??0}),[n]);gt.useEffect(()=>{const h=t?.getView();if(!t||!h)return;const l=h.getCenter(),c=CR(h.padding),u=RR(t,c);switch(h.padding=IR(a),s){case"preserve-center":h.animate({center:l,duration:300});break;case"preserve-extent":{u&&h.animate({center:l,resolution:h.getResolutionForExtent(u),duration:300});break}}},[a,t,s]);const o=gt.useMemo(()=>({mapAnchorsHost:e}),[e]);return Ie.jsx(KS,{value:o,children:r})}function SR(i,t){const e=i.id,n=i.olMap;if(n.getTarget()){yn.error("Failed to display the map: the map already has a target. There may be more than one .");return}yn.isDebug()&&yn.debug(`Setting target of map '${e}':`,t),n.setTarget(t);let s=!1;return{destroy(){s||(yn.isDebug()&&yn.debug(`Removing target of map '${e}':`,t),n.setTarget(void 0),s=!0)}}}function RR(i,t){const e=i.getSize();if(!e||e.length<2)return;const[n,s]=e,r=i.getCoordinateFromPixel([t.left,t.bottom]),a=i.getCoordinateFromPixel([Math.max(0,n-t.right),Math.max(0,s-t.top)]);if(!r||!a)return;const[o,h]=r,[l,c]=a;return[o,h,l,c]}function CR(i){return{top:i?.[0]??0,right:i?.[1]??0,bottom:i?.[2]??0,left:i?.[3]??0}}function IR(i){const{top:t,right:e,bottom:n,left:s}=i;return[t,e,n,s]}class bR extends mg{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",n=t.tileGrid!==void 0?t.tileGrid:R1({extent:xc(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const TR='© OpenStreetMap contributors.';class AR extends bR{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[TR];const n=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",s=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:n,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:s,wrapX:t.wrapX,zDirection:t.zDirection})}}var Ra,Zo,S0;class wC{constructor(t){D(this,Zo);D(this,Ra);U(this,Ra,t.references.interceptors.map((e,n)=>[t.referencesMeta.interceptors[n].serviceId,e]))}async fetch(t,e){const n=e?.signal??void 0,s=Object.assign({},e?.context),r=PR(e);Vh(n);let a=LR(t);{const h={target:a,signal:n??new AbortController().signal,context:s,options:r};Vh(n),await j(this,Zo,S0).call(this,h),a=h.target}const o=new Request(a,{...r,signal:n});return await window.fetch(o)}}Ra=new WeakMap,Zo=new WeakSet,S0=async function(t){const{signal:e}=t;for(const[n,s]of v(this,Ra))if(Vh(e),s.beforeRequest)try{await s.beforeRequest(t)}catch(r){throw W0(r),new Error(`Interceptor '${n}' failed with an error`,{cause:r})}};function LR(i){return typeof i=="string"?new URL(i,window.location.href):i}function PR(i){const t=i?.method??"GET",e=new Headers(i?.headers??{}),n={...i,method:t,headers:e};for(const s in n)OR[s]&&delete n[s];return n}const OR={context:1,signal:1};function Vh(i){i?.aborted&&B0()}WS({"EPSG:25832":"+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs","EPSG:25833":"+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs"});const Kh=Ii("map:createMapModel");async function DR(i,t,e){return await new NR(i,t,e).createMapModel()}class NR{mapId;mapConfig;httpService;constructor(t,e,n){this.mapId=t,this.mapConfig=e,this.httpService=n}async createMapModel(){const t=this.mapId,e=this.mapConfig,{view:n,...s}=e.advanced??{},r={...s};if(r.controls||(r.controls=[new kg({collapsible:!1})]),!r.interactions){const u=d=>{const f=d.originalEvent;return(f.metaKey||f.ctrlKey)&&f.shiftKey};r.interactions=jg({dragPan:!0,altShiftDragRotate:!1,pinchRotate:!1,mouseWheelZoom:!0}).extend([new Ug({out:!0,condition:u})])}const a=await n??{};this.initializeViewOptions(a),r.view=a instanceof Ce?a:new Ce(a),!r.layers&&!e.layers&&(r.layers=[new fg({source:new AR})]);const o=e.initialView,h=o?.kind==="extent"?o.extent:void 0;Kh.debug("Constructing OpenLayers map with options",r);const l=new qx(r),c=new M0({id:t,olMap:l,initialExtent:h,httpService:this.httpService});try{if(e.layers)for(const u of e.layers)c.layers.addLayer(u);return c}catch(u){throw c.destroy(),u}}initializeViewOptions(t){const e=this.mapId,n=this.mapConfig;if(t instanceof Ce){const a=o=>{Kh.warn(`The advanced configuration for map id '${e}' has provided a fully constructed view instance: ${o} cannot be applied. -Use ViewOptions instead of a View instance.`)};n.projection!=null&&a("projection"),n.initialView!=null&&a("initialView");return}const s=t.projection=this.initializeProjection(n.projection),r=n.initialView;if(r)switch(r.kind){case"position":t.zoom=r.zoom,t.center=[r.center.x,r.center.y];break;case"extent":{const a=r.extent;t.zoom=0,t.center=[a.xMin+(a.xMax-a.xMin)/2,a.yMin+(a.yMax-a.yMin)/2];break}}else this.setViewDefaults(t,s)}setViewDefaults(t,e){if(t.center==null){const n=e.getExtent();n?t.center=Te(n):Kh.warn(`Cannot set default center coordinate because the current projection has no associated extent. -Try to configure 'initialView' explicity.`)}(t.zoom==null||t.resolution==null)&&(t.zoom=0)}initializeProjection(t){if(t==null)return yt("EPSG:3857");const e=yt(t);if(!e)throw new Error(`Failed to retrieve projection for code '${t}'.`);return e}}const Zh=Ii("map:MapRegistry");var Ca,Ia,Zi,$i,ba,Tn,$o,R0;class SC{constructor({references:t}){D(this,$o);D(this,Ca);D(this,Ia,new Map);D(this,Zi,new Map);D(this,$i,new Map);D(this,ba,new WeakMap);D(this,Tn,!1);U(this,Ca,t.httpService);const e=t.providers;for(const n of e)v(this,Ia).set(n.mapId,n)}destroy(){v(this,Tn)||(Zh.info("Destroy map registry and all maps"),U(this,Tn,!0),v(this,Zi).forEach(t=>{t.kind==="model"&&t.model.destroy()}),v(this,Zi).clear(),v(this,$i).clear())}async getMapModel(t){if(v(this,Tn))throw new Error("MapRegistry has already been destroyed.");const e=v(this,$i).get(t);if(e)return $h(await e);const n=v(this,Zi).get(t);if(n)return $h(n);const s=v(this,Ia).get(t);if(!s){Zh.debug(`Failed to find a config provider for map id '${t}'.`);return}const r=j(this,$o,R0).call(this,t,s).catch(a=>{const h={kind:"error",error:new Error(`Failed to construct map '${t}'`,{cause:a})};return v(this,$i).delete(t),v(this,Zi).set(t,h),h});return v(this,$i).set(t,r),$h(await r)}async expectMapModel(t){const e=await this.getMapModel(t);if(!e)throw new Error(`No configuration available for map with id '${t}'.`);return e}getMapModelByRawInstance(t){return v(this,ba).get(t)}}Ca=new WeakMap,Ia=new WeakMap,Zi=new WeakMap,$i=new WeakMap,ba=new WeakMap,Tn=new WeakMap,$o=new WeakSet,R0=async function(t,e){Zh.info(`Creating map with id '${t}'`);const n=await e.getMapConfig(),s=await DR(t,n,v(this,Ca));if(v(this,Tn))throw s.destroy(),new Error("MapRegistry has been destroyed.");const r={kind:"model",model:s};return v(this,Zi).set(t,r),v(this,$i).delete(t),v(this,ba).set(s.olMap,s),r};function $h(i){if(i.kind==="error")throw i.error;return i.model}export{XR as $,Us as A,Qt as B,ka as C,EC as D,Kv as E,Ci as F,So as G,wC as H,kt as I,Ze as J,hf as K,Nn as L,SC as M,le as N,AR as O,Ke as P,Hv as Q,Jv as R,sC as S,fg as T,Og as U,Ce as V,vi as W,mf as X,qR as Y,Yf as Z,$u as _,ux as a,gR as a$,YR as a0,jv as a1,Zu as a2,Lg as a3,ht as a4,no as a5,Ec as a6,xc as a7,R1 as a8,$ as a9,tg as aA,Zs as aB,Rc as aC,jR as aD,ai as aE,df as aF,xi as aG,nC as aH,Tt as aI,it as aJ,bc as aK,He as aL,lh as aM,Sc as aN,Lu as aO,at as aP,Ws as aQ,qt as aR,Ae as aS,nh as aT,WR as aU,_u as aV,wo as aW,Wi as aX,yu as aY,m0 as aZ,Mc as a_,vc as aa,_x as ab,zs as ac,S_ as ad,mg as ae,yt as af,ah as ag,z_ as ah,A1 as ai,Fl as aj,Ne as ak,Mm as al,Xs as am,ym as an,ri as ao,Zd as ap,zr as aq,kn as ar,qx as as,sr as at,_c as au,W1 as av,_i as aw,Ht as ax,An as ay,dC as az,mx as b,Si as b$,Lm as b0,Z_ as b1,Te as b2,YS as b3,kr as b4,Ol as b5,lC as b6,Ly as b7,vt as b8,rC as b9,Gr as bA,Pa as bB,th as bC,o_ as bD,GR as bE,Xl as bF,xg as bG,X_ as bH,j_ as bI,zx as bJ,zg as bK,Fx as bL,P1 as bM,E1 as bN,qs as bO,Lf as bP,oC as bQ,ot as bR,Br as bS,eC as bT,iC as bU,Af as bV,rl as bW,dm as bX,Sf as bY,ZR as bZ,$l as b_,aC as ba,yC as bb,Ba as bc,Nx as bd,fC as be,_C as bf,Px as bg,Hu as bh,Me as bi,se as bj,ef as bk,wt as bl,BR as bm,gi as bn,Ro as bo,sl as bp,$e as bq,ql as br,of as bs,on as bt,B_ as bu,cC as bv,UR as bw,Wa as bx,gC as by,Dx as bz,Ct as c,rf as c0,gm as c1,pf as c2,La as c3,Wg as c4,td as c5,zi as c6,du as c7,eh as c8,ds as c9,Ef as cA,xm as cB,Au as cC,k1 as cD,Hl as cE,ec as cF,Mt as ca,Co as cb,um as cc,Qd as cd,Fa as ce,nf as cf,xf as cg,Mf as ch,hC as ci,Io as cj,Tu as ck,_m as cl,QR as cm,as as cn,tf as co,wf as cp,VR as cq,KR as cr,JR as cs,HR as ct,gu as cu,dx as cv,vm as cw,$R as cx,tC as cy,vf as cz,dr as d,jd as e,JS as f,pC as g,US as h,ER as i,ze as j,j0 as k,MC as l,vC as m,mc as n,bt as o,_t as p,Ys as q,Kt as r,G as s,x1 as t,xC as u,We as v,l_ as w,Ft as x,_e as y,kl as z}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/Fvn-TvW_dbjq.js b/openlayers-base-packages/pr-previews/pr-377/assets/Fvn-TvW_dbjq.js deleted file mode 100644 index 96beef1..0000000 --- a/openlayers-base-packages/pr-previews/pr-377/assets/Fvn-TvW_dbjq.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CR6SzAtaFOeK.js","./CmsKOCeNyeyo.js","./nEjnOjKmH1UU.js","./DbBkdn6FNbgs.js","./DyxVjgSvwe-K.js","./CCXTS-icusD6.js","./CwYOJLhODXKJ.js","./35mnA9_wxNJd.js","./DnYPVZQRsXfx.js"])))=>i.map(i=>d[i]); -var Qt=Object.defineProperty;var Ye=i=>{throw TypeError(i)};var es=(i,e,t)=>e in i?Qt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var _=(i,e,t)=>es(i,typeof e!="symbol"?e+"":e,t),Te=(i,e,t)=>e.has(i)||Ye("Cannot "+t);var v=(i,e,t)=>(Te(i,e,"read from private field"),t?t.call(i):e.get(i)),x=(i,e,t)=>e.has(i)?Ye("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),b=(i,e,t,n)=>(Te(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),se=(i,e,t)=>(Te(i,e,"access private method"),t);import{aE as ts,b6 as ss,b7 as ns,b8 as is,aP as rs,aX as os,b9 as as,ba as ls,J as cs,bb as ds,bc as us,bd as hs,be as gs,bf as St,bg as fs,bh as ms,a as te,b as Pe,aL as ve,bi as Je,bj as q,a9 as Xe,G as k,bk as Ae,a_ as Q,an as Ze,bl as pe,bm as Qe,bn as A,p as C,bo as W,bp as je,bq as ps,br as ys,z as _s,bs as De,bt as vs,bu as Ss,bv as xt,ao as wt,bw as xs,bx as ws,by as et,bz as bs,bA as tt,bB as Ms,bC as st,j as D,r as $e,a$ as Be,bD as bt,bE as Es,b0 as Cs,f as Ue,u as K,aZ as H,i as $,bF as Ps,b3 as Fe,bG as Fs,am as Se,bH as Ls,bI as Is,c as xe,ax as re,F as Re,C as Ts,bJ as nt,bK as As,bL as it,k as rt}from"./DyxVjgSvwe-K.js";import{h as We,u as Mt,o as Et,m as Ct,j as u,g as R,n as Ns,p as Os,r as p,t as ne,q as ot,s as ks,v as js,w as Ds,c as me,d as Pt,B as P,x as at,b as Ft,C as Rs,y as Gs,i as Lt,z as It,V as Vs,l as Hs,I as $s}from"./DbBkdn6FNbgs.js";import{G as Tt,i as Bs}from"./Djes_egHqOHx.js";import{a as Us}from"./jRJMM4_GqJDc.js";import{D as At,S as Ws,I as zs,c as Ks,a as qs}from"./CLvK5IJfz41Q.js";import{u as V}from"./CCXTS-icusD6.js";import{u as B,c as N,s as Nt}from"./nEjnOjKmH1UU.js";import{T as ee,L as Ys}from"./CL68Tre-iuri.js";import{c as Ot}from"./DjAArQ67Dgmx.js";import{L as Ge}from"./D8JwQmCkwKBk.js";import{u as kt,F as we}from"./CwYOJLhODXKJ.js";import{F as be}from"./Ch2CPfq1SbGd.js";import{H as Ve}from"./C520TGz1zAm6.js";import{F as Js}from"./DnYPVZQRsXfx.js";import{_ as Xs}from"./CmsKOCeNyeyo.js";import{s as Zs}from"./VXuNJBviGPoL.js";const ze=We(function(e,t){const{htmlSize:n,...s}=e,r=Mt("Input",s),o=Et(s),a=kt(o),l=Ct("chakra-input",e.className);return u.jsx(R.input,{size:n,...a,__css:r.field,ref:t,className:l})});ze.displayName="Input";ze.id="Input";const jt=We(function(e,t){const{children:n,placeholder:s,className:r,...o}=e;return u.jsxs(R.select,{...o,ref:t,className:Ct("chakra-select",r),children:[s&&u.jsx("option",{value:"",children:s}),n]})});jt.displayName="SelectField";const Ke=We((i,e)=>{const t=Mt("Select",i),{rootProps:n,placeholder:s,icon:r,color:o,height:a,h:l,minH:c,minHeight:d,iconColor:h,iconSize:f,...g}=Et(i),[m,y]=Zs(g,Ns),w=kt(y),F={width:"100%",height:"fit-content",position:"relative",color:o},O={paddingEnd:"2rem",...t.field,_focus:{zIndex:"unset",...t.field?._focus}};return u.jsxs(R.div,{className:"chakra-select__wrapper",__css:F,...m,...n,children:[u.jsx(jt,{ref:e,height:l??a,minH:c??d,placeholder:s,...w,__css:O,children:i.children}),u.jsx(Dt,{"data-disabled":Os(w.disabled),...(h||o)&&{color:h||o},__css:t.icon,...f&&{fontSize:f},children:r})]})});Ke.displayName="Select";const Qs=i=>u.jsx("svg",{viewBox:"0 0 24 24",...i,children:u.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),en=R("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Dt=i=>{const{children:e=u.jsx(Qs,{}),...t}=i,n=p.cloneElement(e,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return u.jsx(en,{...t,className:"chakra-select__icon-wrapper",children:p.isValidElement(e)?n:null})};Dt.displayName="SelectIcon";function tn(i,e){const t=i??"bottom";return{"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[t]?.[e]??t}function sn(i,e){const t=s=>({...e,...s,position:tn(s?.position??e?.position,i)}),n=s=>{const r=t(s),o=ks(r);return ne.notify(o,r)};return n.update=(s,r)=>{ne.update(s,t(r))},n.promise=(s,r)=>{const o=n({...r.loading,status:"loading",duration:null});s.then(a=>n.update(o,{status:"success",duration:5e3,...ot(r.success,a)})).catch(a=>n.update(o,{status:"error",duration:5e3,...ot(r.error,a)}))},n.closeAll=ne.closeAll,n.close=ne.close,n.isActive=ne.isActive,n}function nn(i){const{theme:e}=js(),t=Ds();return p.useMemo(()=>sn(e.direction,{...t,...i}),[i,e.direction,t])}const M={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class Le extends ts{constructor(e){super(),this.on,this.once,this.un,this.options=e,this.id=e.id,this.insertFirst=e.insertFirst!==void 0?e.insertFirst:!0,this.stopEvent=e.stopEvent!==void 0?e.stopEvent:!0,this.element=document.createElement("div"),this.element.className=e.className!==void 0?e.className:"ol-overlay-container "+ss,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=e.autoPan===!0?{}:e.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(M.ELEMENT,this.handleElementChanged),this.addChangeListener(M.MAP,this.handleMapChanged),this.addChangeListener(M.OFFSET,this.handleOffsetChanged),this.addChangeListener(M.POSITION,this.handlePositionChanged),this.addChangeListener(M.POSITIONING,this.handlePositioningChanged),e.element!==void 0&&this.setElement(e.element),this.setOffset(e.offset!==void 0?e.offset:[0,0]),this.setPositioning(e.positioning||"top-left"),e.position!==void 0&&this.setPosition(e.position)}getElement(){return this.get(M.ELEMENT)}getId(){return this.id}getMap(){return this.get(M.MAP)||null}getOffset(){return this.get(M.OFFSET)}getPosition(){return this.get(M.POSITION)}getPositioning(){return this.get(M.POSITIONING)}handleElementChanged(){ns(this.element);const e=this.getElement();e&&this.element.appendChild(e)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),is(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const e=this.getMap();if(e){this.mapPostrenderListenerKey=rs(e,os.POSTRENDER,this.render,this),this.updatePixelPosition();const t=this.stopEvent?e.getOverlayContainerStopEvent():e.getOverlayContainer();this.insertFirst?t.insertBefore(this.element,t.childNodes[0]||null):t.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(e){this.set(M.ELEMENT,e)}setMap(e){this.set(M.MAP,e)}setOffset(e){this.set(M.OFFSET,e)}setPosition(e){this.set(M.POSITION,e)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(e){const t=this.getMap();if(!t||!t.getTargetElement()||!this.get(M.POSITION))return;const n=this.getRect(t.getTargetElement(),t.getSize()),s=this.getElement(),r=this.getRect(s,[as(s),ls(s)]);e=e||{};const o=e.margin===void 0?20:e.margin;if(!cs(n,r)){const a=r[0]-n[0],l=n[2]-r[2],c=r[1]-n[1],d=n[3]-r[3],h=[0,0];if(a<0?h[0]=a-o:l<0&&(h[0]=Math.abs(l)+o),c<0?h[1]=c-o:d<0&&(h[1]=Math.abs(d)+o),h[0]!==0||h[1]!==0){const f=t.getView().getCenterInternal(),g=t.getPixelFromCoordinateInternal(f);if(!g)return;const m=[g[0]+h[0],g[1]+h[1]],y=e.animation||{};t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(m),duration:y.duration,easing:y.easing})}}}getRect(e,t){const n=e.getBoundingClientRect(),s=n.left+window.pageXOffset,r=n.top+window.pageYOffset;return[s,r,s+t[0],r+t[1]]}setPositioning(e){this.set(M.POSITIONING,e)}setVisible(e){this.rendered.visible!==e&&(this.element.style.display=e?"":"none",this.rendered.visible=e)}updatePixelPosition(){const e=this.getMap(),t=this.getPosition();if(!e||!e.isRendered()||!t){this.setVisible(!1);return}const n=e.getPixelFromCoordinate(t),s=e.getSize();this.updateRenderedPosition(n,s)}updateRenderedPosition(e,t){const n=this.element.style,s=this.getOffset(),r=this.getPositioning();this.setVisible(!0);const o=Math.round(e[0]+s[0])+"px",a=Math.round(e[1]+s[1])+"px";let l="0%",c="0%";r=="bottom-right"||r=="center-right"||r=="top-right"?l="-100%":(r=="bottom-center"||r=="center-center"||r=="top-center")&&(l="-50%"),r=="bottom-left"||r=="bottom-center"||r=="bottom-right"?c="-100%":(r=="center-left"||r=="center-center"||r=="center-right")&&(c="-50%");const d=`translate(${l}, ${c}) translate(${o}, ${a})`;this.rendered.transform_!=d&&(this.rendered.transform_=d,n.transform=d)}getOptions(){return this.options}}const Zi=ds,lt=0,oe=1,ct=[0,0,0,0],Y=[],Ne={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class Oe extends wt{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}}class rn extends us{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:hs,this.defaultDeleteCondition_=function(n){return gs(n)&&St(n)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:fs,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new ms,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new te({source:new Pe({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:an(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new ve(this.source_.getFeatures()),this.source_.addEventListener(Je.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Je.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(q.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(q.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}addFeature_(e){const t=e.getGeometry();if(t){const s=this.SEGMENT_WRITERS_[t.getType()];s&&s(e,t)}const n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),e.addEventListener(Xe.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ve;const n=this.featuresBeingModified_.getArray();for(let s=0,r=t.length;s=0;--s){const r=n[s];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);t.remove(r)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){const n=t.getCoordinates(),s={feature:e,geometry:t,segment:[n,n]};this.rBush_.insert(t.getExtent(),s)}writeMultiPointGeometry_(e,t){const n=t.getCoordinates();for(let s=0,r=n.length;s=0;--c)this.insertVertex_(s[c],r)}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const n=this.dragSegments_[t][0],s=n.geometry;if(s.getType()==="Circle"){const r=s.getCenter(),o=n.featureSegments[0],a=n.featureSegments[1];o.segment[0]=r,o.segment[1]=r,a.segment[0]=r,a.segment[1]=r,this.rBush_.update(Ae(r),o);let l=s;this.rBush_.update(l.getExtent(),a)}else this.rBush_.update(k(n.segment),n)}return this.featuresBeingModified_&&(this.dispatchEvent(new Oe(Ne.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.pixel,e.map,e.coordinate)}handlePointerAtPixel_(e,t,n){const s=n||t.getCoordinateFromPixel(e);t.getView().getProjection();const r=function(l,c){return dt(s,l)-dt(s,c)};let o,a;if(this.hitDetection_){const l=typeof this.hitDetection_=="object"?c=>c===this.hitDetection_:void 0;t.forEachFeatureAtPixel(e,(c,d,h)=>{h&&h.getType()==="Point"&&(h=new Ze(je(h.getCoordinates())));const f=h||c.getGeometry();if(c instanceof Q&&this.features_.getArray().includes(c)){a=f;const g=c.getGeometry().getFlatCoordinates().slice(0,2);o=[{feature:c,geometry:a,segment:[g,g]}]}return!0},{layerFilter:l})}if(!o){const l=ps(Ae(s,ct)),c=t.getView().getResolution()*this.pixelTolerance_,d=ys(_s(l,c,ct));o=this.rBush_.getInExtent(d)}if(o&&o.length>0){const l=o.sort(r)[0],c=l.segment;let d=ut(s,l);const h=t.getPixelFromCoordinate(d);let f=Qe(e,h);if(a||f<=this.pixelTolerance_){const g={};if(g[C(c)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-s[0],this.delta_[1]=d[1]-s[1]),l.geometry.getType()==="Circle"&&l.index===oe)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[l.feature],[l.geometry]);else{const m=t.getPixelFromCoordinate(c[0]),y=t.getPixelFromCoordinate(c[1]),w=De(h,m),F=De(h,y);f=Math.sqrt(Math.min(w,F)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(d=w>F?c[1]:c[0]),this.createOrUpdateVertexFeature_(d,[l.feature],[l.geometry]);const O={};O[C(l.geometry)]=!0;for(let S=1,L=o.length;S=0;--l)o=e[l],g=o[0],m=C(g.feature),g.depth&&(m+="-"+g.depth.join("-")),m in t||(t[m]={}),o[1]===0?(t[m].right=g,t[m].index=g.index):o[1]==1&&(t[m].left=g,t[m].index=g.index+1);for(m in t){switch(f=t[m].right,d=t[m].left,c=t[m].index,h=c-1,d!==void 0?g=d:g=f,h<0&&(h=0),a=g.geometry,r=a.getCoordinates(),s=r,n=!1,a.getType()){case"MultiLineString":r[g.depth[0]].length>2&&(r[g.depth[0]].splice(c,1),n=!0);break;case"LineString":r.length>2&&(r.splice(c,1),n=!0);break;case"MultiPolygon":s=s[g.depth[1]];case"Polygon":s=s[g.depth[0]],s.length>4&&(c==s.length-1&&(c=0),s.splice(c,1),n=!0,c===0&&(s.pop(),s.push(s[0]),h=s.length-1));break}if(n){this.setGeometryCoordinates_(a,r);const y=[];if(d!==void 0&&(this.rBush_.remove(d),y.push(d.segment[0])),f!==void 0&&(this.rBush_.remove(f),y.push(f.segment[1])),d!==void 0&&f!==void 0){const w={depth:g.depth,feature:g.feature,geometry:g.geometry,index:h,segment:y};this.rBush_.insert(k(w.segment),w)}this.updateSegmentIndices_(a,c,g.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return n}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,n,s){this.rBush_.forEachInExtent(e.getExtent(),function(r){r.geometry===e&&(n===void 0||r.depth===void 0||vs(r.depth,n))&&r.index>t&&(r.index+=s)})}}function on(i,e){return i.index-e.index}function dt(i,e,t){const n=e.geometry;if(n.getType()==="Circle"){let r=n;if(e.index===oe){const o=De(r.getCenter(),A(i)),a=Math.sqrt(o)-r.getRadius();return a*a}}const s=A(i);return Y[0]=A(e.segment[0]),Y[1]=A(e.segment[1]),xs(s,Y)}function ut(i,e,t){const n=e.geometry;if(n.getType()==="Circle"&&e.index===oe)return je(n.getClosestPoint(A(i)));const s=A(i);return Y[0]=A(e.segment[0]),Y[1]=A(e.segment[1]),je(Ss(s,Y))}function an(){const i=xt();return function(e,t){return i.Point}}const ln={SELECT:"select"};class cn extends wt{constructor(e,t,n,s){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=s}}const ye={};class Rt extends ws{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=e.condition?e.condition:St,this.addCondition_=e.addCondition?e.addCondition:et,this.removeCondition_=e.removeCondition?e.removeCondition:et,this.toggleCondition_=e.toggleCondition?e.toggleCondition:bs,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:tt,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style!==void 0?e.style:dn(),this.features_=e.features||new ve;let t;if(e.layers)if(typeof e.layers=="function")t=e.layers;else{const n=e.layers;t=function(s){return n.includes(s)}}else t=tt;this.layerFilter_=t,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[C(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[C(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(q.ADD,this.boundAddFeature_),this.features_.addEventListener(q.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(q.ADD,this.boundAddFeature_),this.features_.removeEventListener(q.REMOVE,this.boundRemoveFeature_))}addFeature_(e){const t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){const n=this.getMap().getAllLayers().find(function(s){if(s instanceof te&&s.getSource()&&s.getSource().hasFeature(t))return s});n&&this.addFeatureLayerAssociation_(t,n)}}removeFeature_(e){this.style_&&this.restorePreviousStyle_(e.element)}getStyle(){return this.style_}applySelectedStyle_(e){const t=C(e);t in ye||(ye[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(e){const t=this.getMap().getInteractions().getArray();for(let s=t.length-1;s>=0;--s){const r=t[s];if(r!==this&&r instanceof Rt&&r.getStyle()&&r.getFeatures().getArray().lastIndexOf(e)!==-1){e.setStyle(r.getStyle());return}}const n=C(e);e.setStyle(ye[n]),delete ye[n]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[C(e)]}handleEvent(e){if(!this.condition_(e))return!0;const t=this.addCondition_(e),n=this.removeCondition_(e),s=this.toggleCondition_(e),r=!t&&!n&&!s,o=e.map,a=this.getFeatures(),l=[],c=[];if(r){Ms(this.featureLayerAssociation_),o.forEachFeatureAtPixel(e.pixel,(d,h)=>{if(!(!(d instanceof Q)||!this.filter_(d,h)))return this.addFeatureLayerAssociation_(d,h),c.push(d),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let d=a.getLength()-1;d>=0;--d){const h=a.item(d),f=c.indexOf(h);f>-1?c.splice(f,1):(a.remove(h),l.push(h))}c.length!==0&&a.extend(c)}else{o.forEachFeatureAtPixel(e.pixel,(d,h)=>{if(!(!(d instanceof Q)||!this.filter_(d,h)))return(t||s)&&!a.getArray().includes(d)?(this.addFeatureLayerAssociation_(d,h),c.push(d)):(n||s)&&a.getArray().includes(d)&&(l.push(d),this.removeFeatureLayerAssociation_(d)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let d=l.length-1;d>=0;--d)a.remove(l[d]);a.extend(c)}return(c.length>0||l.length>0)&&this.dispatchEvent(new cn(ln.SELECT,c,l,e)),!0}}function dn(){const i=xt();return st(i.Polygon,i.LineString),st(i.GeometryCollection,i.LineString),function(e){return e.getGeometry()?i[e.getGeometry().getType()]:null}}async function un(i,e,t,n){const r=n.getCode().replace("EPSG:","http://www.opengis.net/def/crs/EPSG/0/"),o=await i.fetch(e,{method:"POST",body:JSON.stringify({type:"Feature",properties:{},geometry:t}),headers:{"Content-Type":"application/geo+json; charset=utf-8","Content-Crs":`<${r}>`}});if(!o||!o.ok||o.status!==201)throw new Error("Request failed: "+o.status);const a=o.headers.get("location");if(!a)throw new Error("Request failed: no Location response header");const l=a.substring(a.lastIndexOf("/")+1);return Promise.resolve(l)}async function hn(i,e,t,n,s){const o=s.getCode().replace("EPSG:","http://www.opengis.net/def/crs/EPSG/0/"),a=new URL(`${e.toString()}/${t}`),l=await i.fetch(a,{method:"PATCH",body:JSON.stringify({type:"Feature",properties:{},geometry:n}),headers:{"Content-Type":"application/geo+json; charset=utf-8","Content-Crs":`<${o}>`}});if(!l||!l.ok||l.status!==204)throw new Error("Request failed: "+l.status);return Promise.resolve(t)}function Gt(i,e){const t=document.createElement("div");t.className="editing-tooltip editing-tooltip-hidden",t.role="tooltip";const n=document.createElement("span");n.textContent=e,t.appendChild(n);const s=new Le({element:t,offset:[15,0],positioning:"center-left"}),r=i.on("pointermove",o=>{o.dragging||s.setPosition(o.coordinate)});return i.addOverlay(s),{destroy(){D(r),i.removeOverlay(s)},setVisible(o){t.classList.toggle("editing-tooltip-hidden",!o)},setText(o){n.textContent=o}}}function Vt(i){let e=ht(i.polygon);Array.isArray(e)&&(e=e[0]);let t=ht(i.vertex);Array.isArray(t)&&(t=t[0]);const n=[];return e&&n.push(e),t&&(t.setGeometry(gn),n.push(t)),n}const gn=i=>{if(i){const e=i.getGeometry();if(e&&e.getType()==="Polygon"){const t=e.getCoordinates()[0];if(t)return new Us(t)}}},ht=i=>{const e=new Q,n=new te({style:i}).getStyleFunction();if(!n)throw new Error("can't retrieve style function");const s=n(e,1);if(!s)throw new Error("can't retrieve styles from feature style function");return Array.isArray(s)&&s.length?s.length>1?s:s[0]:s},fn=me("editing:EditingCreateWorkflowImpl");var j;class mn{constructor(e){x(this,j);_(this,"_httpService");_(this,"_intl");_(this,"_map");_(this,"_polygonStyle");_(this,"_vertexStyle");_(this,"_state");_(this,"_editLayerURL");_(this,"_featureId");_(this,"_editingSource");_(this,"_editingLayer");_(this,"_drawInteraction");_(this,"_olMap");_(this,"_tooltip");_(this,"_enterHandler");_(this,"_escapeHandler");_(this,"_error");_(this,"_interactionListener");_(this,"_mapListener");this._httpService=e.httpService,this._intl=e.intl,this._polygonStyle=e.polygonStyle,this._vertexStyle=e.vertexStyle,this._map=e.map,this._olMap=e.map.olMap,this._state=$e("active:initialized"),this._editLayerURL=e.ogcApiFeatureLayerUrl,this._editingSource=new Pe,this._editingLayer=new te({source:this._editingSource,zIndex:Be,properties:{name:"editing-layer"}}),this._drawInteraction=new At({source:this._editingSource,type:"Polygon",style:Vt({polygon:this._polygonStyle,vertex:this._vertexStyle})}),this._tooltip=Gt(this._olMap,this._intl.formatMessage({id:"create.tooltip.begin"})),this._enterHandler=t=>{if((t.code==="Enter"||t.code==="NumpadEnter")&&t.target===this._olMap.getTargetElement()){const n=this._drawInteraction.getOverlay().getSource()?.getFeatures()??[];n[0]&&n[0].getGeometry().getCoordinates()[0].length>4&&this.triggerSave()}},this._escapeHandler=t=>{t.code==="Escape"&&t.target===this._olMap.getTargetElement()&&this.reset()},this._interactionListener=[],this._mapListener=[],this._start()}getDrawInteraction(){return this._drawInteraction}getState(){return this._state.value}_setState(e){this._state.value=e}_save(e){this._setState("active:saving");const t=this._editLayerURL,n=e.getGeometry();if(!n){this._destroy(),this._error=new Error("no geometry available"),v(this,j)?.reject(this._error);return}const s=this._olMap.getView().getProjection(),o=new Tt({dataProjection:s}).writeGeometryObject(n,{rightHanded:!0,decimals:10});this._olMap.removeInteraction(this._drawInteraction),this._tooltip.destroy(),un(this._httpService,t,o,s).then(a=>{this._featureId=a,this._destroy(),v(this,j)?.resolve({featureId:this._featureId})}).catch(a=>{fn.error(a),this._destroy(),this._error=new Error("Failed to save feature",{cause:a}),v(this,j)?.reject(this._error)})}_start(){this._olMap.addLayer(this._editingLayer),this._olMap.addInteraction(this._drawInteraction);const e=bt(()=>{const s=this._map.container;if(s)return s.addEventListener("keydown",this._enterHandler,!1),s.addEventListener("keydown",this._escapeHandler,!1),()=>{s.removeEventListener("keydown",this._enterHandler),s.removeEventListener("keydown",this._escapeHandler)}});this._tooltip.setVisible(!0);const t=this._drawInteraction.on("drawstart",()=>{this._setState("active:drawing"),this._tooltip.setText(this._intl.formatMessage({id:"create.tooltip.continue"}))}),n=this._drawInteraction.on("drawend",s=>{const r=s.feature;if(!r){this._destroy(),this._error=new Error("no feature available"),v(this,j)?.reject(this._error);return}this._save(r)});this._interactionListener.push(t,n),this._mapListener.push(e)}reset(){this._drawInteraction.abortDrawing(),this._tooltip.setText(this._intl.formatMessage({id:"create.tooltip.begin"})),this._setState("active:initialized")}stop(){this._destroy(),v(this,j)?.resolve(void 0)}_destroy(){this._olMap.removeLayer(this._editingLayer),this._olMap.removeInteraction(this._drawInteraction),this._tooltip.destroy(),this._interactionListener.forEach(e=>{D(e)}),this._mapListener.forEach(e=>{e.destroy()}),this._setState("destroyed")}triggerSave(){this._drawInteraction.finishDrawing()}whenComplete(){return this._state.value==="destroyed"?this._error?Promise.reject(this._error):this._featureId?Promise.resolve({featureId:this._featureId}):Promise.resolve(void 0):(v(this,j)??b(this,j,Pt())).promise}}j=new WeakMap;var I;class pn{constructor(e){x(this,I);_(this,"_httpService");_(this,"_intl");_(this,"_map");_(this,"_polygonStyle");_(this,"_vertexStyle");_(this,"_state");_(this,"_editLayerURL");_(this,"_featureId");_(this,"_initialFeature");_(this,"_editFeature");_(this,"_editingSource");_(this,"_editingLayer");_(this,"_modifyInteraction");_(this,"_olMap");_(this,"_tooltip");_(this,"_enterHandler");_(this,"_escapeHandler");_(this,"_error");_(this,"_interactionListener");_(this,"_mapListener");this._httpService=e.httpService,this._intl=e.intl,this._polygonStyle=e.polygonStyle,this._vertexStyle=e.vertexStyle,this._map=e.map,this._olMap=e.map.olMap,this._state=$e("active:initialized"),this._editLayerURL=e.ogcApiFeatureLayerUrl,this._initialFeature=e.feature.clone(),this._initialFeature.setId(e.feature.getId()),this._editFeature=e.feature.clone(),this._editFeature.setId(e.feature.getId()),this._editFeature.setStyle(Vt({polygon:this._polygonStyle,vertex:this._vertexStyle})),this._editingSource=new Pe({features:new ve([this._editFeature])}),this._editingLayer=new te({source:this._editingSource,zIndex:Be,properties:{name:"editing-layer"}}),this._modifyInteraction=new rn({source:this._editingSource}),this._tooltip=Gt(this._olMap,this._intl.formatMessage({id:"create.tooltip.deselect"})),this._enterHandler=t=>{if((t.code==="Enter"||t.code==="NumpadEnter")&&t.target===this._olMap.getTargetElement()){const n=this._editingSource.getFeatures()[0];if(!n)throw Error("no updated feature found");this._save(n)}},this._escapeHandler=t=>{t.code==="Escape"&&t.target===this._olMap.getTargetElement()&&this.reset()},this._interactionListener=[],this._mapListener=[],this._start()}getModifyInteraction(){return this._modifyInteraction}getState(){return this._state.value}_setState(e){this._state.value=e}_save(e){this._setState("active:saving");const t=this._editLayerURL;if(this._featureId=e.getId()?.toString(),!this._featureId){this._destroy(),this._error=new Error("no feature id available"),v(this,I)?.reject(this._error);return}const n=e?.getGeometry();if(!n){this._destroy(),this._error=new Error("no geometry available"),v(this,I)?.reject(this._error);return}const s=this._olMap.getView().getProjection(),o=new Tt({dataProjection:s}).writeGeometryObject(n,{rightHanded:!0,decimals:10});this._olMap.removeInteraction(this._modifyInteraction),this._tooltip.destroy(),hn(this._httpService,t,this._featureId,o,s).then(a=>{this._destroy(),v(this,I)?.resolve({featureId:a})}).catch(a=>{this._destroy(),this._error=new Error("Failed to save feature",{cause:a}),v(this,I)?.reject(this._error)})}_start(){this._olMap.addLayer(this._editingLayer),this._olMap.addInteraction(this._modifyInteraction);const e=this._editingSource.getFeatures()[0];if(e&&!e.getId()?.toString()){this._destroy(),this._error=new Error("no feature id available"),v(this,I)?.reject(this._error);return}const t=bt(()=>{const r=this._map.container;if(r)return r.addEventListener("keydown",this._enterHandler,!1),r.addEventListener("keydown",this._escapeHandler,!1),()=>{r.removeEventListener("keydown",this._enterHandler),r.removeEventListener("keydown",this._escapeHandler)}});this._tooltip.setVisible(!0);const n=this._map.olMap.on("click",r=>{const o=r.coordinate,a=r.originalEvent.altKey,l=this._editingSource.getFeaturesAtCoordinate(o);a||l.length===0&&this.triggerSave()}),s=this._modifyInteraction.on("modifystart",()=>{this._setState("active:drawing")});this._interactionListener.push(n,s),this._mapListener.push(t)}reset(){const e=this._initialFeature.getGeometry()?.clone(),t=this._editingSource.getFeatures()[0];if(!t)throw Error("no updated feature found");t.setGeometry(e),this._setState("active:initialized")}stop(){this._destroy(),v(this,I)?.resolve(void 0)}_destroy(){this._editingSource.clear(),this._olMap.removeLayer(this._editingLayer),this._olMap.removeInteraction(this._modifyInteraction),this._tooltip.destroy(),this._interactionListener.forEach(e=>{D(e)}),this._mapListener.forEach(e=>{e.destroy()}),this._setState("destroyed")}triggerSave(){const e=this._editingSource.getFeatures()[0];if(!e)throw Error("no updated feature found");this._save(e)}whenComplete(){return this._state.value==="destroyed"?this._error?Promise.reject(this._error):this._featureId?Promise.resolve({featureId:this._featureId}):Promise.resolve(void 0):(v(this,I)??b(this,I,Pt())).promise}}I=new WeakMap;class Qi{_serviceOptions;_workflows;constructor(e){this._serviceOptions=e,this._workflows=new Map}createFeature(e,t){if(!t||!e||!e.id)throw new Error("Map, mapId or url is undefined.");const n=e.id;let s=this._workflows.get(n);if(s)throw new Error("EditingWorkflow could not be started. EditingWorkflow already in progress for this map.");return s=new mn({map:e,ogcApiFeatureLayerUrl:t,polygonStyle:this._serviceOptions.properties.polygonStyle,vertexStyle:this._serviceOptions.properties.vertexStyle,httpService:this._serviceOptions.references.httpService,intl:this._serviceOptions.intl}),this._workflows.set(n,s),this._connectToWorkflowDestroyEvent(s,n),s}updateFeature(e,t,n){if(!t||!e||!e.id)throw new Error("Map, mapId or url is undefined.");const s=e.id;let r=this._workflows.get(s);if(r)throw new Error("EditingWorkflow could not be started. EditingWorkflow already in progress for this map.");return r=new pn({map:e,ogcApiFeatureLayerUrl:t,feature:n,polygonStyle:this._serviceOptions.properties.polygonStyle,vertexStyle:this._serviceOptions.properties.vertexStyle,httpService:this._serviceOptions.references.httpService,intl:this._serviceOptions.intl}),this._workflows.set(s,r),this._connectToWorkflowDestroyEvent(r,s),r}stop(e){const t=this._workflows.get(e);t&&t.stop()}reset(e){const t=this._workflows.get(e);if(t)t.reset();else throw new Error("No workflow found for mapId: "+e)}_connectToWorkflowDestroyEvent(e,t){const n=Es(()=>[e.getState()],([s])=>{s==="destroyed"&&(this._workflows.get(t)===e&&this._workflows.delete(t),n.destroy())})}}var z,G,ae,le,ce,He;class yn{constructor(e,t,n){x(this,ce);_(this,"label");x(this,z,$e({kind:"available"}));x(this,G);x(this,ae);x(this,le);this.label=t,b(this,G,e),b(this,le,n),se(this,ce,He).call(this),b(this,ae,v(this,G).on("change:visible",()=>{se(this,ce,He).call(this)}))}destroy(){D(v(this,ae))}get status(){return v(this,z).value}async select(e,t){if(e.type!=="extent")throw new Error(`Unsupported selection kind: ${e.type}`);if(v(this,z).value.kind!=="available"||v(this,G).getSource()===null)return[];const n=[];v(this,G).getSource().forEachFeatureIntersectingExtent(e.extent,o=>{if(!o.getGeometry())return;const a={...o.getProperties()};delete a.geometries;const l={id:o.getId()?.toString()||Cs(),geometry:o.getGeometry(),properties:a};n.push(l)});const s=n.filter(o=>o!=null);return s.length>t.maxResults?s.slice(0,t.maxResults):s}}z=new WeakMap,G=new WeakMap,ae=new WeakMap,le=new WeakMap,ce=new WeakSet,He=function(){const t=v(this,G).getVisible()?{kind:"available"}:{kind:"unavailable",reason:v(this,le)};t.kind!==v(this,z).value.kind&&(v(this,z).value=t)};var de;class er{constructor({intl:e}){x(this,de);b(this,de,e)}createSelectionSource(e){return new yn(e.vectorLayer,e.label,v(this,de).formatMessage({id:"layerNotVisibleReason"}))}}de=new WeakMap;const _n="@open-pioneer/notifier",vn=Ue.bind(void 0,_n),Sn=Ot({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),Ht=Ot({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),xn=!1;function tr(i){const{position:e="top-right"}=i,t=nn(),n=vn("notifier.NotificationService"),[s,r]=p.useState(!xn),o=V(l=>{const c=l.level==="error"?u.jsx(Ht,{h:"100%",w:"100%"}):void 0;t({position:e,title:l.title,description:l.message||null,status:l.level,isClosable:!0,duration:l.displayDuration??null,icon:c})}),a=V(()=>{t.closeAll()});return p.useEffect(()=>{const l=n.registerHandler({showNotification:o,closeAll:a});return()=>l.destroy()},[s,n,o,a]),u.jsx(u.Fragment,{})}const wn="@open-pioneer/coordinate-viewer",bn=K.bind(void 0,wn),Mn=4,En="decimal",sr=i=>{const{precision:e,displayProjectionCode:t,format:n}=i,{containerProps:s}=H("coordinate-viewer",i),{map:r}=$(i),o=r?.olMap,a=B(()=>r?.projection.getCode()??"",[r]);let{coordinates:l}=Pn(o);l=l&&t?Ln(l,a,t):l;const c=Cn(l,e,n),d=t||a,h=c?c+" "+d:"";return u.jsx(P,{...s,children:u.jsx(ee,{className:"coordinate-viewer-text",children:h})})};function Cn(i,e,t){const n=bn();return i?Fn(i,e,n,t):""}function Pn(i){const[e,t]=p.useState();return p.useEffect(()=>{if(!i)return;const n=i.on("pointermove",s=>{t(s.coordinate)});return()=>D(n)},[i]),{coordinates:e}}function Fn(i,e,t,n){if(i[0]==null||i[1]==null)return"";const s=e??Mn,r=n??En,[o,a]=i;let l;if(r==="degree"&&isFinite(o)&&isFinite(a)){const[c,d,h]=gt(o,t,s),[f,g,m]=gt(a,t,s),y=`${Math.abs(c)}°${d}'${h}"${0<=c?"(E)":"(W)"}`,w=`${Math.abs(f)}°${g}'${m}"${0<=f?"(N)":"(S)"}`;l=y+" "+w}else{const c=t.formatNumber(o,{maximumFractionDigits:s,minimumFractionDigits:s}),d=t.formatNumber(a,{maximumFractionDigits:s,minimumFractionDigits:s});l=c+" "+d}return l}function gt(i,e,t){const n=Math.floor(i),s=i-n,r=Math.floor(60*s),a=60*(60*s-r),l=e.formatNumber(a,{maximumFractionDigits:t,minimumFractionDigits:t});return[n,r,l]}function Ln(i,e,t){return Ps(i,e,t)}const nr=i=>{const{displayMode:e="line"}=i,{containerProps:t}=H("scale-bar",i),{map:n}=$(i),s=p.useRef(null);return p.useEffect(()=>{if(s.current&&n){const r=n.olMap,o=new Ws({units:"metric",target:s.current,bar:e==="bar"});return r.addControl(o),()=>{r.removeControl(o)}}},[e,n]),u.jsx(P,{...t,ref:s})},In="@open-pioneer/scale-viewer",Tn=K.bind(void 0,In),ir=i=>{const{containerProps:e}=H("scale-viewer",i),{map:t}=$(i),n=Tn(),s=B(()=>t?.scale??1,[t]),r=s?n.formatNumber(s):void 0;return u.jsx(P,{...e,children:r&&u.jsxs(ee,{children:["1:",r]})})},An="@open-pioneer/legend",$t=K.bind(void 0,An),rr=i=>{const{showBaseLayers:e=!1}=i,{containerProps:t}=H("legend",i),{map:n}=$(i);return u.jsx(P,{...t,children:n?u.jsx(Nn,{map:n,showBaseLayers:e}):null})};function Nn(i){const{map:e,showBaseLayers:t}=i,s=kn(e).map(r=>u.jsx(Bt,{layer:r,showBaseLayers:t},r.id));return u.jsx(Ys,{as:"ul",className:"legend-layer-list",listStyleType:"none",spacing:2,children:s})}function Bt(i){const{layer:e,showBaseLayers:t}=i,n=B(()=>e.visible,[e]),s=jn(e);if(!n||!t&&Bs(e)&&Ut(e))return;const r=[];return s?.length&&s.forEach(o=>{r.push(u.jsx(Bt,{layer:o,showBaseLayers:t},o.id))}),u.jsxs(u.Fragment,{children:[u.jsx(On,{layer:e,showBaseLayers:t}),r]})}function On(i){const e=$t(),{layer:t,showBaseLayers:n}=i,s=Ut(t),r=Dn(t),o=B(()=>t.legend,[t]);let a;return r?.Component?a=u.jsx(r.Component,{layer:t}):r?.imageUrl?a=u.jsx(ft,{layer:t,imageUrl:r.imageUrl}):o&&(a=u.jsx(ft,{layer:t,imageUrl:o})),a?u.jsxs(P,{as:"li",className:Fe("legend-item",`layer-${Rn(t.id)}`),children:[n&&s?u.jsx(ee,{as:"b",children:e.formatMessage({id:"basemapLabel"})}):null,a]}):void 0}function ft(i){const e=$t(),{layer:t,imageUrl:n}=i;return u.jsxs(P,{children:[u.jsx(ee,{children:t.title}),u.jsx(zs,{maxW:"none",maxH:"none",src:n,alt:e.formatMessage({id:"altLabel"},{layerName:t.title}),className:"legend-item__image",fallbackStrategy:"onError",fallback:u.jsx(P,{children:u.jsxs(ee,{children:[u.jsx(Ht,{me:2}),e.formatMessage({id:"fallbackLabel"})]})})})]})}function kn(i){return B(()=>{const e=i.layers.getAllLayers({sortByDisplayOrder:!0})??[];return e.reverse(),e},[i])}function jn(i){return B(()=>{const e=i.sublayers?.getSublayers({sortByDisplayOrder:!0});if(e)return e.reverse(),e},[i])}function Dn(i){return B(()=>i.attributes.legend,[i])}function Ut(i){return!("parentLayer"in i)&&i.isBaseLayer}function Rn(i){return i.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}const Gn="@open-pioneer/measurement",Vn=K.bind(void 0,Gn);class Hn{olMap;messages;activeFeatureStyle;layer;source;draw=void 0;activeMeasurement;predefinedMeasurements=new Map;finishedMeasurements=new Set;helpTooltip;resources=[];measurementChangedHandler;constructor(e,t){this.olMap=e,this.messages=t;const n=this.source=new Pe;this.layer=new te({source:n,zIndex:Be,properties:{name:"measurement-layer"}}),e.addLayer(this.layer);const s=e.on("pointermove",this.handlePointerMove.bind(this));this.resources.push({destroy(){D(s)}});const r=()=>{this.helpTooltip.element.classList.add("hidden")};e.getViewport().addEventListener("mouseout",r),this.resources.push({destroy(){e.getViewport().removeEventListener("mouseout",r)}}),this.helpTooltip=Bn(this.olMap)}destroy(){this.stopMeasurement();for(const e of this.resources)e.destroy();this.resources=[],this.activeMeasurement=at(this.activeMeasurement);for(const e of this.finishedMeasurements)e.destroy();this.finishedMeasurements.clear(),this.helpTooltip.destroy(),this.olMap.removeLayer(this.layer),this.layer.dispose(),this.source.dispose(),this.measurementChangedHandler=void 0,this.predefinedMeasurements.clear()}getVectorLayer(){return this.layer}setFinishedFeatureStyle(e){this.layer.setStyle(e)}setMeasurementSourceChangedHandler(e){this.measurementChangedHandler=e}setPredefinedMeasurements(e){this.updatePredefinedMeasurements(e)}setActiveFeatureStyle(e){const t=Fs(e);this.activeFeatureStyle=(n,...s)=>{const r=n?.getGeometry()?.getType();if(r==="Polygon"||r==="LineString"||r==="Point")return t(n,...s)},this.draw?.getOverlay().setStyle(this.activeFeatureStyle)}clearMeasurements(){const e=this.source.getFeatures();this.source.clear(),e.forEach(t=>{this.raiseMeasurementsChangeEvent("remove-measurement",t)}),this.predefinedMeasurements.clear();for(const t of this.finishedMeasurements)t.destroy();this.finishedMeasurements.clear()}startMeasurement(e){if(this.draw)throw new Error("Internal error: another measurement interaction is still active.");const t=e==="area"?"Polygon":"LineString",n=this.draw=new At({source:this.source,type:t,style:this.activeFeatureStyle});this.olMap.addInteraction(n);let s,r;n.on("drawstart",o=>{const a=o.feature;a&&(s=this.activeMeasurement=new mt("active",a,this),r=a.getGeometry()?.on("change",()=>{s?.updateTooltipContent(),s?.updateTooltipPosition()}))}),n.on("drawend",()=>{if(s&&s===this.activeMeasurement){const o=s;o.updateState("finished"),this.finishedMeasurements.add(o),this.raiseMeasurementsChangeEvent("add-measurement",o.feature),this.activeMeasurement=s=void 0}s=void 0,r&&D(r)}),n.on("drawabort",()=>{s&&(s.destroy(),s===this.activeMeasurement&&(this.activeMeasurement=void 0),s=void 0),r&&D(r)})}stopMeasurement(){this.draw&&(this.olMap.removeInteraction(this.draw),this.draw.abortDrawing(),this.draw.dispose(),this.draw=void 0),this.activeMeasurement=at(this.activeMeasurement)}handlePointerMove(e){if(e.dragging)return;const t=this.helpTooltip,n=Wn(this.messages,this.activeMeasurement);t.setText(n),t.overlay.setPosition(e.coordinate),t.element.classList.remove("hidden")}updatePredefinedMeasurements(e){const t=e.filter(s=>!this.predefinedMeasurements.has(s)),n=[];for(const s of this.predefinedMeasurements.keys())e.includes(s)||n.push(s);t.forEach(s=>{const r=new Q(s);this.source.addFeature(r);const o=new mt("finished",r,this);this.finishedMeasurements.add(o),this.predefinedMeasurements.set(s,o),this.raiseMeasurementsChangeEvent("add-measurement",r)}),n.forEach(s=>{const r=this.predefinedMeasurements.get(s);r&&(this.source.removeFeature(r.feature),this.finishedMeasurements.delete(r),r.destroy(),this.raiseMeasurementsChangeEvent("remove-measurement",r.feature)),this.predefinedMeasurements.delete(s)})}raiseMeasurementsChangeEvent(e,t){const n=t.getGeometry();this.measurementChangedHandler&&n&&this.measurementChangedHandler({kind:e,geometry:(n instanceof Se,n)})}}class mt{controller;feature;_state;tooltip;constructor(e,t,n){this.controller=n,this._state=e,this.feature=t,this.tooltip=Un(this.olMap),this.updateTooltipContent(),this.updateTooltipPosition(),this.tooltip.setActive(e==="active")}destroy(){this.tooltip.destroy()}get state(){return this._state}updateState(e){this._state!==e&&(this._state=e,this.tooltip.setActive(e==="active"))}updateTooltipContent(){const e=this.feature.getGeometry();if(!e)return;const t=this.olMap.getView().getProjection();let n;e instanceof Se?n=zn(e,t,this.messages):e instanceof Ge&&(n=Kn(e,t,this.messages)),n&&this.tooltip.setHtml(n)}updateTooltipPosition(){const e=this.feature.getGeometry();if(!e)return;let t;if(e instanceof Se)t=e.getInteriorPoint().getCoordinates()||null;else if(e instanceof Ge)t=e.getLastCoordinate()||null;else return;this.tooltip.overlay.setPosition(t)}get olMap(){return this.controller.olMap}get messages(){return this.controller.messages}}const pt=[0,-15],$n=[0,-7];function Bn(i){const e=document.createElement("div");e.className="measurement-tooltip printing-hide hidden",e.role="tooltip";const t=document.createElement("span");e.appendChild(t);const n=new Le({element:e,offset:[15,0],positioning:"center-left"});return i.addOverlay(n),{overlay:n,element:e,destroy(){i.removeOverlay(n)},setText(s){t.textContent=s},setHtml(s){t.innerHTML=s}}}function Un(i){const e=document.createElement("div");e.role="tooltip",e.className="measurement-tooltip measurement-active-tooltip printing-hide";const t=document.createElement("span");e.appendChild(t);const n=new Le({element:e,offset:pt,positioning:"bottom-center",stopEvent:!1,insertFirst:!1});return i.addOverlay(n),{overlay:n,element:e,destroy(){i.removeOverlay(n)},setActive(s){s?(e.className="measurement-tooltip measurement-active-tooltip printing-hide",n.setOffset(pt)):(e.className="measurement-tooltip measurement-finished-tooltip",n.setOffset($n))},setText(s){t.textContent=s},setHtml(s){t.innerHTML=s}}}function Wn(i,e){if(e){const t=e.feature.getGeometry();if(t instanceof Se||t instanceof Ge)return i.getContinueMessage()}return i.getHelpMessage()}function zn(i,e,t){const n=Ls(i,{projection:e});let s;return n>=1e6?s=`${t.formatNumber(n/1e6)} km2`:s=`${t.formatNumber(n)} m2`,s}function Kn(i,e,t){const n=Is(i,{projection:e});let s;return n>=1e3?s=`${t.formatNumber(n/1e3)} km`:s=`${t.formatNumber(n)} m`,s}const or=i=>{const e=Vn(),{containerProps:t}=H("measurement",i),[n,s]=p.useState("distance"),r=d=>e.formatMessage({id:d}),o=$(i),a=qn(o.map,i,e);p.useEffect(()=>{if(a)return a.startMeasurement(n),()=>{a.stopMeasurement()}},[a,n]);function l(d){if(d==="distance"||d==="area")s(d);else throw new Error(`Unexpected measurement type: '${d}'.`)}function c(){a?.clearMeasurements()}return u.jsxs(P,{...t,children:[u.jsx(ee,{mb:3,children:e.formatMessage({id:"measurementInfoText"})}),u.jsx(we,{mb:4,alignItems:"center",children:u.jsxs(Ve,{mb:2,children:[u.jsx(be,{mb:1,children:r("measurementLabel")}),u.jsxs(Ke,{value:n,onChange:d=>l(d.target.value),className:"measurement-select",children:[u.jsx("option",{value:"distance",children:r("distance")}),u.jsx("option",{value:"area",children:r("area")})]})]})}),u.jsx(Ft,{padding:2,className:"measurement-delete-button",onClick:c,width:"100%",children:r("deleteMeasurementLabel")})]})};function qn(i,e,t){const{activeFeatureStyle:n,finishedFeatureStyle:s,onMeasurementsChange:r,predefinedMeasurements:o}=e,[a,l]=p.useState(void 0);return p.useEffect(()=>{if(!i)return;const c=new Hn(i.olMap,{getContinueMessage(){return t.formatMessage({id:"tooltips.continue"})},getHelpMessage(){return t.formatMessage({id:"tooltips.help"})},formatNumber(d){return t.formatNumber(d,{maximumFractionDigits:2})}});return l(c),()=>{c.destroy(),l(void 0)}},[i,t]),p.useEffect(()=>{a?.setActiveFeatureStyle(n??Yn())},[a,n]),p.useEffect(()=>{a?.setFinishedFeatureStyle(s??Jn())},[a,s]),p.useEffect(()=>{a?.setMeasurementSourceChangedHandler(r)},[a,r]),p.useEffect(()=>{a?.setPredefinedMeasurements(o??[])},[a,o]),a}function Yn(){return[new xe({stroke:new re({color:"#fff",lineDash:[10,10],width:5})}),new xe({fill:new Re({color:"rgba(0,0,0,0.15)"}),stroke:new re({color:"rgba(0, 0, 0, 0.7)",lineDash:[10,10],width:3}),image:new Ts({radius:5,stroke:new re({color:"rgba(0, 0, 0, 0.7)",width:2}),fill:new Re({color:"rgba(255, 255, 255, 0.2)"})})})]}function Jn(){return[new xe({stroke:new re({color:"#fff",width:5})}),new xe({stroke:new re({color:"#0b96fc",width:3}),fill:new Re({color:"rgba(11,150,252,0.15)"})})]}const Xn="@open-pioneer/search",Ie=K.bind(void 0,Xn);function Zn(i){const e=i.selectProps.inputValue.length>0,t={...i,className:Fe(i.className,{"search-invisible":!e})};return u.jsx(N.Menu,{...t,children:i.children})}function Qn(i){const e=i.data.label,t={...i.innerProps,"aria-label":e,role:"group"};return u.jsx(N.Group,{...i,innerProps:t})}function ei(i){const t=Ie().formatMessage({id:"noOptionsText"});return u.jsx(N.NoOptionsMessage,{...i,children:u.jsx(R.span,{className:"search-no-match",children:t})})}function ti(i){const t=Ie().formatMessage({id:"loadingText"});return u.jsx(N.LoadingMessage,{...i,children:u.jsx(R.span,{className:"search-loading-text",children:t})})}function si({children:i,...e}){const t={...e,className:Fe(e.className,"search-value-container")};return u.jsxs(N.ValueContainer,{...t,children:[!!i&&u.jsx(Sn,{style:{position:"absolute",left:8}}),i]})}function ni(i){const e={...i,isHidden:!1};return u.jsx(N.Input,{...e})}function ii(i){return null}function ri(i){return u.jsxs(N.IndicatorsContainer,{...i,children:[i.children,!i.selectProps.isLoading&&i.selectProps.inputValue&&u.jsx(oi,{selectProps:i.selectProps,clearValue:i.clearValue})]})}function oi(i){const t=Ie().formatMessage({id:"ariaLabel.clearButton"}),n=s=>{s.preventDefault(),s.stopPropagation(),i.clearValue()};return u.jsx(Rs,{role:"button",size:"md",mr:1,"aria-label":t,onClick:n,onTouchEnd:n,onMouseDown:s=>s.preventDefault()})}function ai(i){return null}function li(i){const e=i.selectProps.inputValue,t=i.data.label,n={...i,className:Fe(i.className,"search-option")};return u.jsx(N.Option,{...n,children:u.jsx(R.div,{className:"search-option-label",children:e.trim().length>0?ci(t,e):t})})}function ci(i,e){const t=i.toLowerCase().indexOf(e.toLowerCase());return t>=0?u.jsxs(u.Fragment,{children:[i.substring(0,t),u.jsx(R.span,{className:"search-highlighted-match",children:i.substring(t,t+e.length)},"highlighted"),i.substring(t+e.length)]}):i}const yt=me("search:SearchController"),_t=200,vt=5;var ue,J,X,Z,T,Ee,Wt;class di{constructor(e,t){x(this,Ee);x(this,ue);x(this,J,[]);x(this,X,vt);x(this,Z,_t);x(this,T);b(this,ue,e),b(this,J,t)}destroy(){v(this,T)?.abort(),b(this,T,void 0)}async search(e){if(v(this,T)?.abort(),b(this,T,void 0),!e)return[];const t=b(this,T,new AbortController);try{return await ui(t.signal,v(this,Z)),t.signal.aborted&&(yt.debug(`search canceled with ${e}`),Gs()),(await Promise.all(v(this,J).map(s=>se(this,Ee,Wt).call(this,s,e,t.signal)))).filter(s=>s!=null)}finally{v(this,T)===t&&b(this,T,void 0)}}get searchTypingDelay(){return v(this,Z)}set searchTypingDelay(e){b(this,Z,e??_t)}get maxResultsPerSource(){return v(this,X)}set maxResultsPerSource(e){b(this,X,e??vt)}get sources(){return v(this,J)}}ue=new WeakMap,J=new WeakMap,X=new WeakMap,Z=new WeakMap,T=new WeakMap,Ee=new WeakSet,Wt=async function(e,t,n){const s=e.label,r=v(this,ue).olMap.getView().getProjection();try{const o=v(this,X);let a=await e.search(t,{maxResults:o,signal:n,mapProjection:r});return a.length>o&&(a=a.slice(0,o)),{label:s,source:e,results:a}}catch(o){Lt(o)||yt.error(`search for source ${s} failed`,o);return}};async function ui(i,e){i.aborted||await new Promise(t=>{const n=()=>{i.removeEventListener("abort",n),clearTimeout(s),t()};i.addEventListener("abort",n);const s=setTimeout(n,e)})}const Me=me("search:Search"),ar=i=>{const{sources:e,searchTypingDelay:t,maxResultsPerGroup:n,onSelect:s,onClear:r}=i,{containerProps:o}=H("search",i),{map:a}=$(i),l=Ie(),c=mi(e,t,n,a),{input:d,search:h,selectedOption:f,onInputChanged:g,onResultConfirmed:m}=pi(c),y=fi(),w=hi(l),F=gi(),O=V((E,U)=>{U.action==="input-change"&&g(E)}),S=V((E,U)=>{switch(U.action){case"select-option":E&&(m(E),s?.({source:E.source,result:E.result}));break;case"clear":g(""),L.current?.blur(),L.current?.focus(),r?.();break;default:Me.debug(`Unhandled action type '${U.action}'.`);break}}),L=p.useRef(null);return u.jsx(P,{...o,children:u.jsx(Nt,{className:"search-component",classNamePrefix:"react-select",ref:L,inputValue:d,onInputChange:O,"aria-label":l.formatMessage({id:"ariaLabel.search"}),ariaLiveMessages:w,tagColorScheme:"trails",selectedOptionStyle:"color",selectedOptionColorScheme:"trails",chakraStyles:y,isClearable:!0,placeholder:l.formatMessage({id:"searchPlaceholder"}),closeMenuOnSelect:!0,isLoading:h.kind==="loading",options:h.kind==="ready"?h.results:void 0,filterOption:()=>!0,tabSelectsValue:!1,components:F,onChange:S,value:f,menuPosition:"fixed"})})};function hi(i){return p.useMemo(()=>({onFocus:()=>"",onChange:()=>"",guidance:()=>`${i.formatMessage({id:"ariaLabel.instructions"})}`,onFilter:()=>""}),[i])}function gi(){return p.useMemo(()=>({Menu:Zn,Input:ni,SingleValue:ii,Option:li,NoOptionsMessage:ei,LoadingMessage:ti,ValueContainer:si,IndicatorsContainer:ri,ClearIndicator:ai,Group:Qn}),[])}function fi(){const[i,e]=It("colors",["trails.100","trails.50"],["#d5e5ec","#eaf2f5"]);return p.useMemo(()=>({groupHeading:n=>({...n,backgroundColor:i,padding:"8px 12px",fontSize:"inherit",fontWeight:"inherit"}),option:n=>({...n,backgroundColor:"inherit",_focus:{backgroundColor:e}}),dropdownIndicator:n=>({...n,display:"none"})}),[i,e])}function mi(i,e,t,n){const[s,r]=p.useState(void 0);return p.useEffect(()=>{if(!n)return;const o=new di(n,i);return r(o),()=>{o.destroy(),r(void 0)}},[n,i]),p.useEffect(()=>{s&&(s.searchTypingDelay=e)},[s,e]),p.useEffect(()=>{s&&(s.maxResultsPerSource=t)},[s,t]),s}function pi(i){const[e,t]=p.useReducer((a,l)=>{switch(l.kind){case"input":return{...a,query:l.query,selectedOption:null};case"select-option":return{...a,selectedOption:l.option,query:l.option.label};case"load-results":return{...a,search:{kind:"loading"}};case"accept-results":return{...a,search:{kind:"ready",results:l.results}}}},void 0,()=>({query:"",selectedOption:null,search:{kind:"ready",results:[]}})),n=p.useRef(),s=V(a=>{if(!i){n.current=void 0,t({kind:"accept-results",results:[]});return}Me.isDebug()&&Me.debug(`Starting new search for query ${JSON.stringify(a)}.`),t({kind:"load-results"});const l=n.current=yi(i,a).then(c=>{n.current===l&&t({kind:"accept-results",results:c})})}),r=p.useCallback(a=>{t({kind:"select-option",option:a})},[]),o=p.useCallback(a=>{t({kind:"input",query:a}),s(a)},[s]);return{input:e.query,search:e.search,selectedOption:e.selectedOption,onResultConfirmed:r,onInputChanged:o}}async function yi(i,e){let t;try{t=await i.search(e)}catch(n){Lt(n)||Me.error("Search failed",n),t=[]}return _i(t)}function _i(i){return i.map((t,n)=>({label:t.label,options:t.results.map(s=>({value:`${n}-${s.id}`,label:s.label,source:t.source,result:s}))}))}const zt="@open-pioneer/selection",vi=Ue.bind(void 0,zt),qe=K.bind(void 0,zt),ie="selection-active",_e="selection-inactive";class Si{tooltip;interactionResources=[];olMap;isActive=!0;tooltipMessage;tooltipDisabledMessage;constructor(e,t,n,s){const r=this.initViewport(e);this.interactionResources.push(this.createDragBox(e,s,r,this.interactionResources)),this.interactionResources.push(this.createDrag(e,r,this.interactionResources)),this.tooltip=this.createHelpTooltip(e,t),this.olMap=e,this.tooltipMessage=t,this.tooltipDisabledMessage=n}initViewport(e){const t=e.getViewport();return t.classList.add(ie),t.oncontextmenu=n=>(n.preventDefault(),!1),t}destroy(){this.tooltip.destroy(),this.interactionResources.forEach(e=>{e.destroy()})}setActive(e){if(this.isActive===e)return;const t=this.olMap.getViewport();e?(this.interactionResources.forEach(n=>this.olMap.addInteraction(n.interaction)),this.tooltip.setText(this.tooltipMessage),t.classList.remove(_e),t.classList.add(ie),this.isActive=!0):(this.interactionResources.forEach(n=>this.olMap.removeInteraction(n.interaction)),this.tooltip.setText(this.tooltipDisabledMessage),t.classList.remove(ie),t.classList.add(_e),this.isActive=!1)}createDragBox(e,t,n,s){const r=new nt({className:"selection-drag-box",condition:As});return e.addInteraction(r),r.on("boxend",function(){t(r.getGeometry())}),{interaction:r,destroy(){e.removeInteraction(r),s.splice(s.indexOf(this)),r.dispose(),n.classList.remove(ie),n.classList.remove(_e),n.oncontextmenu=null}}}createDrag(e,t,n){const s=function(a){return a.originalEvent.button==2},r=new it({condition:s});return e.addInteraction(r),{interaction:r,destroy(){e.removeInteraction(r),n.splice(n.indexOf(this)),r.dispose(),t.classList.remove(ie),t.classList.remove(_e),t.oncontextmenu=null}}}createHelpTooltip(e,t){const n=document.createElement("div");n.className="selection-tooltip printing-hide",n.role="tooltip";const s=document.createElement("span");s.textContent=t,n.appendChild(s);const r=new Le({element:n,offset:[15,0],positioning:"center-left"}),o=e.on("pointermove",a=>{r.setPosition(a.coordinate)});return e.addOverlay(r),{overlay:r,element:n,destroy(){e.removeOverlay(r),r.dispose(),D(o)},setText(a){s.textContent=a}}}getDragboxInteraction(){return this.interactionResources.find(e=>e.interaction instanceof nt)}getDragPanInteraction(){return this.interactionResources.find(e=>e.interaction instanceof it)}}const ke=me("selection:SelectionController"),xi=1e4;var he,ge,fe,Ce,Kt;class wi{constructor(e){x(this,Ce);x(this,he);x(this,ge);x(this,fe);const{mapModel:t,onError:n,maxResults:s=xi}=e;b(this,he,t),b(this,ge,s),b(this,fe,n)}destroy(){}async select(e,t){if(t)return await se(this,Ce,Kt).call(this,e,t)}}he=new WeakMap,ge=new WeakMap,fe=new WeakMap,Ce=new WeakSet,Kt=async function(e,t){const n=v(this,he).olMap.getView().getProjection();try{ke.debug(`Starting selection on source '${e.label}'`);const s=v(this,ge);let r=await e.select({type:"extent",extent:t},{maxResults:s,mapProjection:n,signal:new AbortController().signal});return r.length>s&&(r=r.slice(0,s)),ke.debug(`Found ${r.length} results on source '${e.label}'`),{source:e,results:r}}catch(s){ke.error(`selection from source ${e.label} failed`,s),v(this,fe).call(this);return}};const bi={classNamePrefix:"react-select",menuPosition:"fixed",isSearchable:!1,isClearable:!1},lr=i=>{const e=qe(),{sources:t,onSelectionComplete:n,onSelectionSourceChanged:s}=i,{containerProps:r}=H("selection",i),o=e.formatMessage({id:"sourceNotAvailable"}),[a,l]=Ci(t,s),c=Jt(a,o),d=$(i),{onExtentSelected:h}=Pi(d.map,t,a,n),f=Li(),[g,m]=p.useState(!1);Fi(d.map,e,h,c.kind==="available",!!a);const y=p.useMemo(()=>t.map(S=>({label:S.label,value:S})),[t]),w=p.useMemo(()=>y.find(L=>L.value===a)||null,[y,a]),F=V(S=>{l(S?.value)}),O=V(S=>{!g&&S.key==="Enter"&&m(!0)});return u.jsx(Vs,{...r,spacing:2,children:u.jsxs(we,{children:[u.jsx(be,{children:e.formatMessage({id:"selectSource"})}),u.jsx(Nt,{className:"selection-source react-select",...bi,options:y,placeholder:e.formatMessage({id:"selectionPlaceholder"}),value:w,onChange:F,components:{Option:Mi,SingleValue:Ei},isOptionDisabled:()=>!1,getOptionLabel:S=>{const L=S.label,E=Yt(S.value,o);return E.kind=="available"?L:L+" "+E.reason},ariaLiveMessages:{guidance:()=>"",onChange:S=>S.action=="select-option"||S.action=="initial-input-focus"?S.label+" "+e.formatMessage({id:"selected"}):"",onFilter:()=>"",onFocus:()=>""},chakraStyles:f,onKeyDown:O,menuIsOpen:g,onMenuOpen:()=>m(!0),onMenuClose:()=>m(!1)})]})})};function Mi(i){const{value:e}=i.data,{isAvailable:t,content:n}=qt(e,!1);return u.jsx(N.Option,{...i,isDisabled:!t,className:"selection-source-option",children:n})}function Ei(i){const{value:e}=i.data,{isAvailable:t,content:n}=qt(e,!0),s=t?"selection-source-value":"selection-source-value selection-source-value--disabled";return u.jsx(N.SingleValue,{...i,isDisabled:!t,className:s,children:n})}function Ci(i,e){const[t,n]=p.useState(()=>i[0]);p.useEffect(()=>{t&&!i.includes(t)&&n(void 0)},[i,t]);const s=p.useRef(void 0);return p.useEffect(()=>{t!==s.current&&(s.current=t,e?.({source:t}))},[t,e]),[t,n]}function qt(i,e){const t=qe(),n=i?.label,s=t.formatMessage({id:"sourceNotAvailable"}),r=Jt(i,s);return{isAvailable:r.kind==="available",content:u.jsxs(rt,{direction:"row",alignItems:"center",grow:1,children:[!e&&u.jsx(rt,{grow:1,children:n}),r.kind==="unavailable"&&u.jsx(P,{ml:2,children:u.jsx(Hs,{label:r.reason,placement:"right",openDelay:500,children:u.jsx(R.span,{children:u.jsx($s,{as:Js,color:"red",className:"warning-icon","aria-label":r.reason})})})}),e&&n]})}}function Pi(i,e,t,n){const s=vi("notifier.NotificationService"),r=qe(),[o,a]=p.useState(void 0);p.useEffect(()=>{if(!i)return;const c=new wi({mapModel:i,onError(){s.notify({level:"error",message:r.formatMessage({id:"selectionFailed"})})}});return a(c),()=>{c.destroy()}},[i,s,e,r]);const l=V(async c=>{if(!o||!t)return;const d=await o.select(t,c.getExtent());d&&n?.(d)});return{controller:o,onExtentSelected:l}}function Yt(i,e){const t=i.status??"available",n=typeof t=="string"?{kind:t}:t;return n.kind==="available"?n:{kind:"unavailable",reason:n.reason??e}}function Jt(i,e){return B(()=>i?Yt(i,e):{kind:"unavailable",reason:e},[i,e])}function Fi(i,e,t,n,s){p.useEffect(()=>{if(!i)return;const r=s?e.formatMessage({id:"disabledTooltip"}):e.formatMessage({id:"noSourceTooltip"}),o=new Si(i.olMap,e.formatMessage({id:"tooltip"}),r,t);return o.setActive(n),()=>{o?.destroy()}},[i,e,t,n,s])}function Li(){const[i,e]=It("colors",["background_body","border"],["#ffffff","#ffffff"]);return p.useMemo(()=>({control:n=>({...n,cursor:"pointer"}),indicatorSeparator:n=>({...n,borderColor:e}),dropdownIndicator:n=>({...n,backgroundColor:i})}),[i,e])}const Xt="@open-pioneer/printing",Zt=Ue.bind(void 0,Xt),Ii=K.bind(void 0,Xt),Ti="map";class Ai{olMap;i18n;printingService;viewPadding;printMap=void 0;overlay=void 0;constructor(e,t,n){this.olMap=e,this.printingService=t,this.i18n=n}destroy(){this.reset()}setViewPadding(e){this.viewPadding=e}async handleMapExport(e){if(this.olMap)try{this.begin(),this.printMap=await this.printingService.printMap(this.olMap,{blockUserInteraction:!1,viewPadding:this.viewPadding});const t=this.printMap.getCanvas();if(t)e.fileFormat=="png"?await this.exportMapInPNG(t,e):await this.exportMapInPDF(t,e);else throw new Error("Canvas export failed")}finally{this.reset()}}begin(){const e=this.olMap.getTargetElement();e&&(this.overlay=Ks(e,this.i18n.overlayText))}reset(){this.overlay?.destroy(),this.overlay=void 0}getTitleAndFileName(e){const t=e.title||"",n=e.title||Ti;return{title:t,fileName:n}}async exportMapInPNG(e,t){const n=document.createElement("canvas");n.width=e.width,n.height=e.height+50,n.style.backgroundColor="#fff";const s=n.getContext("2d");if(!s)throw new Error("2d canvas rendering context not available");const{title:r,fileName:o}=this.getTitleAndFileName(t);s.fillStyle="#fff",s.fillRect(0,0,n.width,n.height),s.font="20px bold sans-serif",s.textAlign="center",s.fillStyle="#000";const a=n.width/2;s.fillText(r,a,20),s.drawImage(e,0,50);const l=document.createElement("a");l.setAttribute("download",o+".png");const c=qs(n);if(!c)throw new Error("Failed to get image data URL");l.href=c,l.click()}async exportMapInPDF(e,t){const{jsPDF:n}=await Xs(async()=>{const{jsPDF:F}=await import("./CR6SzAtaFOeK.js");return{jsPDF:F}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),s=new n({orientation:"landscape",unit:"mm",format:"a4"}),r=s.internal.pageSize.getWidth(),o=s.internal.pageSize.getHeight(),a=15,l=20,c=o-l;s.setFontSize(20);const{title:d,fileName:h}=this.getTitleAndFileName(t);s.text(d,r/2,a,{align:"center"});const f=e.width/e.height;let g=c,m=g*f;m>=r&&(m=r,g=m/f);const y=(r-m)/2,w=l+(c-g)/2;s.addImage(e,"",y,w,m,g),s.save(h+".pdf")}}const Ni=me("printing"),cr=i=>{const e=Ii(),{viewPadding:t="auto"}=i,{containerProps:n}=H("printing",i),[s,r]=p.useState("pdf"),[o,a]=p.useState(""),[l,c]=p.useState(!1),d=Zt("notifier.NotificationService"),{map:h}=$(i),f=Oi(h,e,t);function g(y){(y==="png"||y==="pdf")&&r(y)}function m(){l||!f||(c(!0),f.handleMapExport({title:o,fileFormat:s}).catch(y=>{const w=e.formatMessage({id:"printingFailed"});d.notify({level:"error",message:w}),Ni.error("Failed to print the map",y)}).finally(()=>{c(!1)}))}return u.jsx(P,{...n,children:u.jsxs(P,{as:"form",m:2,alignItems:"center",onSubmit:y=>{y.preventDefault(),m()},children:[u.jsxs(we,{as:Ve,mb:2,children:[u.jsx(be,{minWidth:"82",mb:1,children:e.formatMessage({id:"title"})}),u.jsx(ze,{placeholder:e.formatMessage({id:"input.placeholder"}),value:o,onChange:y=>{a(y.target.value)},autoFocus:!0})]}),u.jsxs(we,{as:Ve,mb:2,children:[u.jsx(be,{minWidth:"82",mb:1,children:e.formatMessage({id:"fileFormat"})}),u.jsxs(Ke,{value:s,onChange:y=>g(y.target.value),className:"printing-select",children:[u.jsx("option",{value:"png",children:"PNG"}),u.jsx("option",{value:"pdf",children:"PDF"})]})]}),u.jsx(Ft,{isLoading:l,loadingText:e.formatMessage({id:"printingMap"}),disabled:l,mt:2,p:2,className:"printing-export-button",type:"submit",width:"100%",children:e.formatMessage({id:"export"})})]})})};function Oi(i,e,t){const n=Zt("printing.PrintingService"),[s,r]=p.useState(void 0);return p.useEffect(()=>{if(!i)return;const o=new Ai(i.olMap,n,{overlayText:e.formatMessage({id:"printingMap"})});return r(o),()=>{o.destroy(),r(void 0)}},[i,e,n]),p.useEffect(()=>{s?.setViewPadding(t)},[s,t]),s}export{sr as C,Qi as E,ze as I,rr as L,or as M,tr as N,Le as O,cr as P,Rt as S,er as V,Zi as W,nr as a,ir as b,ar as c,lr as d,Ke as e}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/WUfcarXw4YPE.js b/openlayers-base-packages/pr-previews/pr-377/assets/WUfcarXw4YPE.js new file mode 100644 index 0000000..3629ff9 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/WUfcarXw4YPE.js @@ -0,0 +1,19 @@ +import{a as Ki,j as K,B as yn,V as Ji,f as Yi}from"./B60Dx_GOYdnk.js";import{t as Qi}from"./DjS5-7IPlotu.js";import{n as ti,o as eo,p as ye,q as to,s as q,t as ro,v as no,x as je,y as ri,z as lt,A as io,B as Re,E as oo,G as ao,I as so,J as lo,K as uo,L as ni,N as ii,P as er,Q as co,R as po,U as gn,W as fo,X as ho,Y as tr,Z as mo,_ as xn,$ as bn,a0 as yo,a1 as go,a2 as xo,a3 as bo,a4 as vo,a5 as Tt,a6 as wo,a7 as oi,a8 as jr,a9 as Tr,aa as ai,ab as To,ac as ko,ad as zo,ae as So,af as Xe,ag as Fo,ah as Eo,ai as Co,aj as Io,ak as kr,al as _o,am as Po,an as Ro,a as zr,ao as Mo,ap as Mt,aq as Ao,ar as si,as as Do,at as jo,au as Lo,av as $o,aw as Oo,ax as st,F as Ge,ay as qo,b as rr,az as Go,aA as Vo,c as Ee,aB as vn,C as li,aC as No,aD as wn,S as it,T as Uo,O as Bo,H as Zo,M as Ho,u as Xo,k as nr,g as Tn,h as kn,l as Wo,m as ir}from"./j0mck_Meu7Xh.js";import{F as Ko,t as Jo,G as zn,e as Yo}from"./CYroAbEI2PyD.js";import{L as Qo}from"./ajAX9OmvUsbZ.js";import{M as ea,a as ta,b as ra}from"./BWf1FusGPLsb.js";import{V as na,S as ia,I as oa,Z as aa,a as sa}from"./cFp2KtAGHfQy.js";import{_ as Sn}from"./CmsKOCeNyeyo.js";import{T as or}from"./BKR6R-cAnIXt.js";import"./DSjrbd_eKbZM.js";import"./BpQSjk0kyblh.js";import"./vepZWq5kkQUw.js";import"./C9VJq5Ka7299.js";import"./2C0geDG_OBHU.js";import"./BXfBNJYYR7xb.js";import"./BlACKGYldMfy.js";import"./CMfwYEDRd35m.js";import"./CG5nmvkyugDn.js";const Fn=[];class la extends ti{constructor(e,t,n,i,o){super(e,t,{transition:0}),this.context_=null,this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=i.bind(void 0,this),this.removeSourceTiles_=o,this.wrappedTileCoord=n}getContext(){return this.context_||(this.context_=eo(1,1,Fn)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){const t=ye(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&(to(this.context_),Fn.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let ui=class extends ti{constructor(e,t,n,i,o,a){super(e,t,a),this.extent=null,this.format_=i,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=o,this.url_=n,this.key=n}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==q.IDLE&&(this.setState(q.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(q.ERROR)}setFeatures(e){this.features_=e,this.setState(q.LOADED)}setLoader(e){this.loader_=e}};const ua={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},En={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class ca extends ro{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=no(),this.tileClipContexts_=null}drawTile(e,t,n,i,o,a,s,l){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,n,i,o,a,s,l)}getTile(e,t,n,i){const o=this.getOrCreateTile(e,t,n,i);if(!o)return null;const s=i.viewState.resolution,l=i.viewHints;return(!(l[je.ANIMATING]||l[je.INTERACTING])||!o.wantedResolution)&&(o.wantedResolution=s),o}prepareFrame(e){const t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,n){const i=this.getLayer(),o=i.getRevision(),a=i.getRenderOrder()||null,s=e.wantedResolution,l=e.getReplayState(i);if(!l.dirty&&l.renderedResolution===s&&l.renderedRevision==o&&l.renderedRenderOrder==a)return;const u=i.getSource(),c=!!i.getDeclutter(),d=u.getTileGrid(),h=u.getTileGridForProjection(n).getTileCoordExtent(e.wrappedTileCoord),f=u.getSourceTiles(t,n,e),x=ye(i);delete e.hitDetectionImageData[x],e.executorGroups[x]=[],l.dirty=!1;for(let m=0,D=f.length;mE.value):null;let I;e:for(let E=0,C=f.length;E{const i=this.getLayer(),o=i.getSource(),a=this.renderedProjection,s=a.getExtent(),l=this.renderedResolution,u=o.getTileGridForProjection(a),c=so(this.renderedPixelToCoordinateTransform_,e.slice()),d=u.getTileCoordForCoordAndResolution(c,l).toString(),p=this.renderedTiles.find(E=>E.tileCoord.toString()===d&&E.getState()===q.LOADED);if(!p||p.loadingSourceTiles>0){t([]);return}o.getWrapX()&&a.canWrapX()&&!lo(s,u.getTileCoordExtent(p.tileCoord))&&uo(c,a);const h=ye(i),f=u.getTileCoordExtent(p.wrappedTileCoord),x=ni(f),m=[(c[0]-x[0])/l,(x[1]-c[1])/l],D=p.getSourceTiles().reduce((E,C)=>E.concat(C.getFeatures()),[]);let I=p.hitDetectionImageData[h];if(!I){const E=ii(u.getTileSize(u.getZForResolution(l,o.zDirection))),C=this.renderedRotation_,z=[this.getRenderTransform(u.getTileCoordCenter(p.wrappedTileCoord),l,0,er,E[0]*er,E[1]*er,0)];I=co(E,z,D,i.getStyleFunction(),u.getTileCoordExtent(p.wrappedTileCoord),p.getReplayState(i).renderedResolution,C),p.hitDetectionImageData[h]=I}t(po(m,D,I))})}getFeaturesInExtent(e){const t=[],n=this.getTileCache();if(n.getCount()===0)return t;const o=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),a=o.getZForResolution(this.renderedResolution),s={};return n.forEach(l=>{if(l.tileCoord[0]!==a||l.getState()!==q.LOADED)return;const u=l.getSourceTiles();for(let c=0,d=u.length;c=0;--m)x[m].execute(this.context,s,this.getTileRenderTransform(f,e),e.viewState.rotation,a,gn,u)}n.globalAlpha=i}renderDeferredInternal(e){const t=this.renderedTiles,n=ye(this.getLayer()),i=t.reduce((l,u,c)=>(u.executorGroups[n].forEach(d=>l.push({executorGroup:d,index:c})),l),[]),o=i.map(({executorGroup:l})=>l.getDeferredZIndexContexts()),a={};for(let l=0,u=i.length;l{o.forEach((u,c)=>{u[l]&&(u[l].forEach(d=>{const{executorGroup:p,index:h}=i[c],f=p.getRenderedContext(),x=f.globalAlpha;f.globalAlpha=this.renderedOpacity_;const m=this.tileClipContexts_[h];m&&m.draw(f),d.draw(f),m&&f.restore(),f.globalAlpha=x,d.clear()}),u[l].length=0)})})}getTileRenderTransform(e,t){const n=t.pixelRatio,i=t.viewState,o=i.center,a=i.resolution,s=i.rotation,l=t.size,u=Math.round(l[0]*n),c=Math.round(l[1]*n),p=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),h=e.tileCoord,f=p.getTileCoordExtent(e.wrappedTileCoord),x=p.getTileCoordExtent(h,this.tempExtent)[0]-f[0];return ho(tr(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(o,a,s,n,u,c,x))}postRender(e,t){const n=t.viewHints,i=!(n[je.ANIMATING]||n[je.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;const o=this.getLayer(),a=o.getRenderMode(),s=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;const l=o.getDeclutter(),u=l?En[a].filter(z=>!gn.includes(z)):En[a],c=t.viewState,d=c.rotation,p=o.getSource(),f=p.getTileGridForProjection(c.projection).getZForResolution(c.resolution,p.zDirection),x=this.renderedTiles,m=[],D=[],I=[],E=ye(o);let C=!0;for(let z=x.length-1;z>=0;--z){const A=x[z];C=C&&!A.getReplayState(o).dirty;const T=A.executorGroups[E].filter(b=>b.hasExecutors(u));if(T.length===0)continue;const F=this.getTileRenderTransform(A,t),L=A.tileCoord[0];let Y=!1;const G=T[0].getClipCoords(F);let g=e,J;if(G){J=new mo,g=J.getContext();for(let b=0,k=m.length;b{const h=this.tileUrlFunction(p,e,t);this.sourceTiles_[h]||(this.sourceTiles_[h]=new this.tileClass(p,h?q.IDLE:q.EMPTY,h,this.format_,this.tileLoadFunction));const f=this.sourceTiles_[h];n.sourceTiles.push(f),this.tileKeysBySourceTileUrl_[h]||(this.tileKeysBySourceTileUrl_[h]=[]),this.tileKeysBySourceTileUrl_[h].push(n.getKey());const x=f.getState();if(x{this.handleTileChange(D);const I=f.getState();if(I===q.LOADED||I===q.ERROR){const E=f.getKey();E in n.errorTileKeys?f.getState()===q.LOADED&&delete n.errorTileKeys[E]:n.loadingSourceTiles--,I===q.ERROR?n.errorTileKeys[E]=!0:f.removeEventListener(Tr.CHANGE,m),n.loadingSourceTiles===0&&n.setState(ko(n.errorTileKeys)?q.LOADED:q.ERROR)}};f.addEventListener(Tr.CHANGE,m),n.loadingSourceTiles++}x===q.IDLE&&(f.extent=u.getTileCoordExtent(p),f.projection=t,f.resolution=u.getResolution(p[0]),f.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(p=>p.getState()===q.ERROR)?q.ERROR:q.LOADED)}return n.sourceTiles}removeSourceTiles(e){const t=e.sourceTiles;for(let n=0,i=t.length;n{c=c&&!this.tileUrlFunction(m,i,o)})}const d=new la(a,c?q.EMPTY:q.IDLE,s,this.getSourceTiles.bind(this,i,o),this.removeSourceTiles.bind(this));return d.key=this.getKey(),d}getTileGridForProjection(e){const t=e.getCode();let n=this.tileGrids_[t];if(!n){const i=this.tileGrid,o=i.getResolutions().slice(),a=o.map(function(u,c){return i.getOrigin(c)}),s=o.map(function(u,c){return i.getTileSize(c)}),l=zo+1;for(let u=o.length;u=200&&t.status<300){let n;try{n=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(n)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){const t=Xe("EPSG:4326"),n=this.getProjection();let i;if(e.bounds!==void 0){const u=Fo(t,n);i=Eo(e.bounds,u)}const o=oi(n),a=e.minzoom||0,s=e.maxzoom||22,l=jr({extent:o,maxZoom:s,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=Co(e.tiles,l),e.attribution&&!this.getAttributions()){const u=i!==void 0?i:o;this.setAttributions(function(c){return Re(u,c.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}const Sr=65536*65536,Cn=1/Sr,fa=12,In=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),ar=0,kt=1,ot=2,zt=5;class ha{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,n=this.length){for(;this.pos>3,a=this.pos;this.type=i&7,e(o,t,this),this.pos===a&&this.skip(i)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Sr;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Sr;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let n,i;return i=t[this.pos++],n=i&127,i<128||(i=t[this.pos++],n|=(i&127)<<7,i<128)||(i=t[this.pos++],n|=(i&127)<<14,i<128)||(i=t[this.pos++],n|=(i&127)<<21,i<128)?n:(i=t[this.pos],n|=(i&15)<<28,ma(n,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=fa&&In?In.decode(this.buf.subarray(t,e)):Ca(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const n=this.readPackedEnd();for(;this.pos127;);else if(t===ot)this.pos=this.readVarint()+this.pos;else if(t===zt)this.pos+=4;else if(t===kt)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t268435455||e<0){ya(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;const t=this.pos;this.pos=Ia(this.buf,e,this.pos);const n=this.pos-t;n>=128&&_n(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let n=0;n=128&&_n(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeMessage(e,t,n){this.writeTag(e,ot),this.writeRawMessage(t,n)}writePackedVarint(e,t){t.length&&this.writeMessage(e,ba,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,va,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,ka,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,wa,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Ta,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,za,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Sa,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Fa,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Ea,t)}writeBytesField(e,t){this.writeTag(e,ot),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,zt),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,zt),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,kt),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,kt),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,ar),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,ar),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,ot),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,zt),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,kt),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function ma(r,e,t){const n=t.buf;let i,o;if(o=n[t.pos++],i=(o&112)>>4,o<128||(o=n[t.pos++],i|=(o&127)<<3,o<128)||(o=n[t.pos++],i|=(o&127)<<10,o<128)||(o=n[t.pos++],i|=(o&127)<<17,o<128)||(o=n[t.pos++],i|=(o&127)<<24,o<128)||(o=n[t.pos++],i|=(o&1)<<31,o<128))return Le(r,i,e);throw new Error("Expected varint not more than 10 bytes")}function Le(r,e,t){return t?e*4294967296+(r>>>0):(e>>>0)*4294967296+(r>>>0)}function ya(r,e){let t,n;if(r>=0?(t=r%4294967296|0,n=r/4294967296|0):(t=~(-r%4294967296),n=~(-r/4294967296),t^4294967295?t=t+1|0:(t=0,n=n+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),ga(t,n,e),xa(n,e)}function ga(r,e,t){t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos]=r&127}function xa(r,e){const t=(r&7)<<4;e.buf[e.pos++]|=t|((r>>>=3)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127)))))}function _n(r,e,t){const n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(n);for(let i=t.pos-1;i>=r;i--)t.buf[i+n]=t.buf[i]}function ba(r,e){for(let t=0;t239?4:o>223?3:o>191?2:1;if(i+s>t)break;let l,u,c;s===1?o<128&&(a=o):s===2?(l=r[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=r[i+1],u=r[i+2],(l&192)===128&&(u&192)===128&&(a=(o&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=r[i+1],u=r[i+2],c=r[i+3],(l&192)===128&&(u&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function Ia(r,e,t){for(let n=0,i,o;n55295&&i<57344)if(o)if(i<56320){r[t++]=239,r[t++]=191,r[t++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(r[t++]=239,r[t++]=191,r[t++]=189):o=i;continue}else o&&(r[t++]=239,r[t++]=191,r[t++]=189,o=null);i<128?r[t++]=i:(i<2048?r[t++]=i>>6|192:(i<65536?r[t++]=i>>12|224:(r[t++]=i>>18|240,r[t++]=i>>12&63|128),r[t++]=i>>6&63|128),r[t++]=i&63|128)}return t}class $r extends Ko{constructor(e){super(),e=e||{},this.dataProjection=new Io({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:kr,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.idProperty_=e.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,n,i){e.pos=t.geometry;const o=e.readVarint()+e.pos;let a=1,s=0,l=0,u=0,c=0,d=0;for(;e.pos>3}if(s--,a===1||a===2)l+=e.readSVarint(),u+=e.readSVarint(),a===1&&c>d&&(i.push(c),d=c),n.push(l,u),c+=2;else if(a===7)c>d&&(n.push(n[d],n[d+1]),c+=2);else throw new Error("Invalid command found in the PBF")}c>d&&(i.push(c),d=c)}createFeature_(e,t,n){const i=t.type;if(i===0)return null;let o;const a=t.properties;let s;this.idProperty_?(s=a[this.idProperty_],delete a[this.idProperty_]):s=t.id,a[this.layerName_]=t.layer.name;const l=[],u=[];this.readRawGeometry_(e,t,l,u);const c=Aa(i,u.length);if(this.featureClass===kr)o=new this.featureClass(c,l,u,2,a,s),o.transform(n.dataProjection);else{let d;if(c=="Polygon"){const f=_o(l,u);d=f.length>1?new ea(l,"XY",f):new Po(l,"XY",u)}else d=c==="Point"?new Ro(l,"XY"):c==="LineString"?new Qo(l,"XY"):c==="MultiPoint"?new ta(l,"XY"):c==="MultiLineString"?new ra(l,"XY",u):null;const p=this.featureClass;o=new p,this.geometryName_&&o.setGeometryName(this.geometryName_);const h=Jo(d,!1,n);o.setGeometry(h),s!==void 0&&o.setId(s),o.setProperties(a,!0)}return o}getType(){return"arraybuffer"}readFeatures(e,t){const n=this.layers_;t=this.adaptOptions(t);const i=Xe(t.dataProjection);i.setWorldExtent(t.extent),t.dataProjection=i;const o=new ha(e),a=o.readFields(_a,{}),s=[];for(const l in a){if(n&&!n.includes(l))continue;const u=a[l],c=u?[0,0,u.extent,u.extent]:null;i.setExtent(c);for(let d=0,p=u.length;d>3,n=r===1?t.readString():r===2?t.readFloat():r===3?t.readDouble():r===4?t.readVarint64():r===5?t.readVarint():r===6?t.readSVarint():r===7?t.readBoolean():null;e.values.push(n)}}function Ra(r,e,t){if(r==1)e.id=t.readVarint();else if(r==2){const n=t.readVarint()+t.pos;for(;t.pos255?255:r}function Rn(r){return r<0?0:r>1?1:r}function sr(r){return r[r.length-1]==="%"?ct(parseFloat(r)/100*255):ct(parseInt(r))}function St(r){return r[r.length-1]==="%"?Rn(parseFloat(r)/100):Rn(parseFloat(r))}function lr(r,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?r+(e-r)*t*6:t*2<1?e:t*3<2?r+(e-r)*(2/3-t)*6:r}function ja(r){var e=r.replace(/ /g,"").toLowerCase();if(e in Pn)return Pn[e].slice();if(e[0]==="#"){if(e.length===4){var t=parseInt(e.substr(1),16);return t>=0&&t<=4095?[(t&3840)>>4|(t&3840)>>8,t&240|(t&240)>>4,t&15|(t&15)<<4,1]:null}else if(e.length===7){var t=parseInt(e.substr(1),16);return t>=0&&t<=16777215?[(t&16711680)>>16,(t&65280)>>8,t&255,1]:null}return null}var n=e.indexOf("("),i=e.indexOf(")");if(n!==-1&&i+1===e.length){var o=e.substr(0,n),a=e.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(a.length!==4)return null;s=St(a.pop());case"rgb":return a.length!==3?null:[sr(a[0]),sr(a[1]),sr(a[2]),s];case"hsla":if(a.length!==4)return null;s=St(a.pop());case"hsl":if(a.length!==3)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=St(a[1]),c=St(a[2]),d=c<=.5?c*(u+1):c+u-c*u,p=c*2-d;return[ct(lr(p,d,l+1/3)*255),ct(lr(p,d,l)*255),ct(lr(p,d,l-1/3)*255),s];default:return null}}return null}try{di=Da.parseCSSColor=ja}catch{}class ae{constructor(e,t,n,i=1){this.r=e,this.g=t,this.b=n,this.a=i}static parse(e){if(!e)return;if(e instanceof ae)return e;if(typeof e!="string")return;const t=di(e);if(t)return new ae(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}toString(){const[e,t,n,i]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(n)},${i})`}toArray(){const{r:e,g:t,b:n,a:i}=this;return i===0?[0,0,0,0]:[e*255/i,t*255/i,n*255/i,i]}toArray01(){const{r:e,g:t,b:n,a:i}=this;return i===0?[0,0,0,0]:[e/i,t/i,n/i,i]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:n,a:i}=this;return[e,t,n,i]}}ae.black=new ae(0,0,0,1);ae.white=new ae(1,1,1,1);ae.transparent=new ae(0,0,0,0);ae.red=new ae(1,0,0,1);ae.blue=new ae(0,0,1,1);var ue=ae;function ft(r){return typeof r=="object"?["literal",r]:r}function La(r,e){let t=r.stops;if(!t)return $a(r,e);const n=t&&typeof t[0][0]=="object",i=n||r.property!==void 0,o=n||!i;return t=t.map(a=>!i&&e.tokens&&typeof a[1]=="string"?[a[0],Va(a[1])]:[a[0],ft(a[1])]),n?Oa(r,e,t):o?Ga(r,e,t):Fr(r,e,t)}function $a(r,e){const t=["get",r.property];if(r.default===void 0)return e.type==="string"?["string",t]:t;if(e.type==="enum")return["match",t,Object.keys(e.values),t,r.default];{const n=[e.type==="color"?"to-color":e.type,t,ft(r.default)];return e.type==="array"&&n.splice(1,0,e.value,e.length||null),n}}function Or(r){switch(r.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Oa(r,e,t){const n={},i={},o=[];for(let s=0;s3&&e===r[r.length-2]||(n&&r.length===2||r.push(e),r.push(t))}function Gr(r,e){return r.type?r.type:e.expression.interpolated?"exponential":"interval"}function Va(r){const e=["concat"],t=/{([^{}]+)}/g;let n=0;for(let i=t.exec(r);i!==null;i=t.exec(r)){const o=r.slice(n,t.lastIndex-i[0].length);n=t.lastIndex,o.length>0&&e.push(o),e.push(["get",i[1]])}if(e.length===1)return r;if(n`:r.itemType.kind==="value"?"array":`array<${e}>`}else return r.kind}const Za=[Nt,y,R,_,ze,Bt,Be,me(P),yt];function ht(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!ht(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(const t of Za)if(!ht(t,e))return null}}return`Expected ${N(r)} but found ${N(e)} instead.`}function Nr(r,e){return e.some(t=>t.kind===r.kind)}function mt(r,e){return e.some(t=>t==="null"?r===null:t==="array"?Array.isArray(r):t==="object"?r&&!Array.isArray(r)&&typeof r=="object":t===typeof r)}class Ur{constructor(e,t,n){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Er{constructor(e,t,n,i,o){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=n,this.fontStack=i,this.textColor=o}}class ve{constructor(e){this.sections=e}static fromString(e){return new ve([new Er(e,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof ve?e:ve.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const n={};t.fontStack&&(n["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(n["font-scale"]=t.scale),t.textColor&&(n["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(n)}return e}}class Ie{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Ie({name:e,available:!1}):null}serialize(){return["image",this.name]}}function fi(r,e,t,n){return typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255?typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[r,e,t,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[r,e,t,n]:[r,e,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function At(r){if(r===null)return!0;if(typeof r=="string")return!0;if(typeof r=="boolean")return!0;if(typeof r=="number")return!0;if(r instanceof ue)return!0;if(r instanceof Ur)return!0;if(r instanceof ve)return!0;if(r instanceof Ie)return!0;if(Array.isArray(r)){for(const e of r)if(!At(e))return!1;return!0}else if(typeof r=="object"){for(const e in r)if(!At(r[e]))return!1;return!0}else return!1}function Q(r){if(r===null)return Nt;if(typeof r=="string")return R;if(typeof r=="boolean")return _;if(typeof r=="number")return y;if(r instanceof ue)return ze;if(r instanceof Ur)return Ut;if(r instanceof ve)return Bt;if(r instanceof Ie)return yt;if(Array.isArray(r)){const e=r.length;let t;for(const n of r){const i=Q(n);if(!t)t=i;else{if(t===i)continue;t=P;break}}return me(t||P,e)}else return Be}function pt(r){const e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof ue||r instanceof ve||r instanceof Ie?r.toString():JSON.stringify(r)}class Br{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!At(e[1]))return t.error("invalid value");const n=e[1];let i=Q(n);const o=t.expectedType;return i.kind==="array"&&i.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(i=o),new Br(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof ue?["rgba"].concat(this.value.toArray()):this.value instanceof ve?this.value.serialize():this.value}}var Dt=Br;class Ha{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}var te=Ha;const ur={string:R,number:y,boolean:_,object:Be};class Zr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let n=1,i;const o=e[0];if(o==="array"){let s;if(e.length>2){const u=e[1];if(typeof u!="string"||!(u in ur)||u==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);s=ur[u],n++}else s=P;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);l=e[2],n++}i=me(s,l)}else i=ur[o];const a=[];for(;ne.outputDefined())}serialize(){const e=this.type,t=[e.kind];if(e.kind==="array"){const n=e.itemType;if(n.kind==="string"||n.kind==="number"||n.kind==="boolean"){t.push(n.kind);const i=e.N;(typeof i=="number"||this.args.length>1)&&t.push(i)}}return t.concat(this.args.map(n=>n.serialize()))}}var ke=Zr;class Zt{constructor(e){this.type=Bt,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&typeof n=="object")return t.error("First argument must be an image or text section.");const i=[];let o=!1;for(let a=1;a<=e.length-1;++a){const s=e[a];if(o&&typeof s=="object"&&!Array.isArray(s)){o=!1;let l=null;if(s["font-scale"]&&(l=t.parse(s["font-scale"],1,y),!l))return null;let u=null;if(s["text-font"]&&(u=t.parse(s["text-font"],1,me(R)),!u))return null;let c=null;if(s["text-color"]&&(c=t.parse(s["text-color"],1,ze),!c))return null;const d=i[i.length-1];d.scale=l,d.font=u,d.textColor=c}else{const l=t.parse(e[a],1,P);if(!l)return null;const u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,i.push({content:l,scale:null,font:null,textColor:null})}}return new Zt(i)}evaluate(e){const t=n=>{const i=n.content.evaluate(e);return Q(i)===yt?new Er("",i,null,null,null):new Er(pt(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null)};return new ve(this.sections.map(t))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const n={};t.scale&&(n["font-scale"]=t.scale.serialize()),t.font&&(n["text-font"]=t.font.serialize()),t.textColor&&(n["text-color"]=t.textColor.serialize()),e.push(n)}return e}}class Ht{constructor(e){this.type=yt,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const n=t.parse(e[1],1,R);return n?new Ht(n):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),n=Ie.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Xa={"to-boolean":_,"to-color":ze,"to-number":y,"to-string":R};class Hr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[0];if((n==="to-boolean"||n==="to-string")&&e.length!==2)return t.error("Expected one argument.");const i=Xa[n],o=[];for(let a=1;a4?n=`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:n=fi(t[0],t[1],t[2],t[3]),!n))return new ue(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new te(n||`Could not parse color from value '${typeof t=="string"?t:String(JSON.stringify(t))}'`)}else if(this.type.kind==="number"){let t=null;for(const n of this.args){if(t=n.evaluate(e),t===null)return 0;const i=Number(t);if(!isNaN(i))return i}throw new te(`Could not convert ${JSON.stringify(t)} to number.`)}else return this.type.kind==="formatted"?ve.fromString(pt(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Ie.fromString(pt(this.args[0].evaluate(e))):pt(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Zt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ht(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(t=>{e.push(t.serialize())}),e}}var Ve=Hr;const Wa=["Unknown","Point","LineString","Polygon"];class Ka{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Wa[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:n,y:i}=this.featureTileCoord,o=n*t-e[0],a=i*t-e[1],s=this.featureDistanceData.bearing[0],l=this.featureDistanceData.bearing[1];return s*o+l*a}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=ue.parse(e)),t}}var hi=Ka;class Ne{constructor(e,t,n,i){this.name=e,this.type=t,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,t){const n=e[0],i=Ne.definitions[n];if(!i)return t.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter(([u])=>!Array.isArray(u)||u.length===e.length-1);let l=null;for(const[u,c]of s){l=new bi(t.registry,t.path,null,t.scope);const d=[];let p=!1;for(let h=1;hJa(p)).join(" | "),d=[];for(let p=1;p=e[2]||r[1]<=e[1]||r[3]>=e[3])}function es(r,e){const t=Ya(r[0]),n=Qa(r[1]),i=Math.pow(2,e.z);return[Math.round(t*i*Ce),Math.round(n*i*Ce)]}function ts(r,e,t){const n=r[0]-e[0],i=r[1]-e[1],o=r[0]-t[0],a=r[1]-t[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}function rs(r,e,t){return e[1]>r[1]!=t[1]>r[1]&&r[0]<(t[0]-e[0])*(r[1]-e[1])/(t[1]-e[1])+e[0]}function Wr(r,e){let t=!1;for(let n=0,i=e.length;n0&&d<0||c<0&&d>0}function os(r,e,t,n){const i=[e[0]-r[0],e[1]-r[1]],o=[n[0]-t[0],n[1]-t[1]];return is(o,i)===0?!1:!!(An(r,e,t,n)&&An(t,n,r,e))}function as(r,e,t){for(const n of t)for(let i=0;it[2]){const i=n*.5;let o=r[0]-t[0]>i?-n:t[0]-r[0]>i?n:0;o===0&&(o=r[0]-t[2]>i?-n:t[2]-r[0]>i?n:0),r[0]+=o}Xr(e,r)}function ls(r){r[0]=r[1]=1/0,r[2]=r[3]=-1/0}function Dn(r,e,t,n){const i=Math.pow(2,n.z)*Ce,o=[n.x*Ce,n.y*Ce],a=[];if(!r)return a;for(const s of r)for(const l of s){const u=[l.x+o[0],l.y+o[1]];gi(u,e,t,i),a.push(u)}return a}function jn(r,e,t,n){const i=Math.pow(2,n.z)*Ce,o=[n.x*Ce,n.y*Ce],a=[];if(!r)return a;for(const s of r){const l=[];for(const u of s){const c=[u.x+o[0],u.y+o[1]];Xr(e,c),l.push(c)}a.push(l)}if(e[2]-e[0]<=i/2){ls(e);for(const s of a)for(const l of s)gi(l,e,t,i)}return a}function us(r,e){const t=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=r.canonicalID();if(!i)return!1;if(e.type==="Polygon"){const o=Kr(e.coordinates,n,i),a=Dn(r.geometry(),t,n,i);if(!jt(t,n))return!1;for(const s of a)if(!Wr(s,o))return!1}if(e.type==="MultiPolygon"){const o=yi(e.coordinates,n,i),a=Dn(r.geometry(),t,n,i);if(!jt(t,n))return!1;for(const s of a)if(!ns(s,o))return!1}return!0}function cs(r,e){const t=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=r.canonicalID();if(!i)return!1;if(e.type==="Polygon"){const o=Kr(e.coordinates,n,i),a=jn(r.geometry(),t,n,i);if(!jt(t,n))return!1;for(const s of a)if(!mi(s,o))return!1}if(e.type==="MultiPolygon"){const o=yi(e.coordinates,n,i),a=jn(r.geometry(),t,n,i);if(!jt(t,n))return!1;for(const s of a)if(!ss(s,o))return!1}return!0}class dt{constructor(e,t){this.type=_,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(At(e[1])){const n=e[1];if(n.type==="FeatureCollection")for(let i=0;i{e&&!Wt(t)&&(e=!1)}),e}function Yr(r){if(r instanceof Ke&&r.name==="feature-state")return!1;let e=!0;return r.eachChild(t=>{e&&!Yr(t)&&(e=!1)}),e}function Qr(r,e){if(r instanceof Ke&&e.indexOf(r.name)>=0)return!1;let t=!0;return r.eachChild(n=>{t&&!Qr(n,e)&&(t=!1)}),t}class en{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");const n=e[1];return t.scope.has(n)?new en(n,t.scope.get(n)):t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var xi=en;class tn{constructor(e,t=[],n,i=new Ua,o=[]){this.registry=e,this.path=t,this.key=t.map(a=>`[${a}]`).join(""),this.scope=i,this.errors=o,this.expectedType=n}parse(e,t,n,i,o={}){return t?this.concat(t,n,i)._parse(e,o):this._parse(e,o)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,o,a){return a==="assert"?new ke(o,[i]):a==="coerce"?new Ve(o,[i]):i}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=e[0];if(typeof i!="string")return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[i];if(o){let a=o.parse(e,this);if(!a)return null;if(this.expectedType){const s=this.expectedType,l=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&l.kind==="value")a=n(a,s,t.typeAnnotation||"assert");else if((s.kind==="color"||s.kind==="formatted"||s.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))a=n(a,s,t.typeAnnotation||"coerce");else if(this.checkSubtype(s,l))return null}if(!(a instanceof Dt)&&a.type.kind!=="resolvedImage"&&Cr(a)){const s=new hi;try{a=new Dt(a.type,a.evaluate(s))}catch(l){return this.error(l.message),null}}return a}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,n){const i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new tn(this.registry,i,t||null,o,this.errors)}error(e,...t){const n=`${this.key}${t.map(i=>`[${i}]`).join("")}`;this.errors.push(new be(n,e))}checkSubtype(e,t){const n=ht(e,t);return n&&this.error(n),n}}var bi=tn;function Cr(r){if(r instanceof xi)return Cr(r.boundExpression);if(r instanceof Ke&&r.name==="error")return!1;if(r instanceof Xt)return!1;if(r instanceof Jr)return!1;const e=r instanceof Ve||r instanceof ke;let t=!0;return r.eachChild(n=>{e?t=t&&Cr(n):t=t&&n instanceof Dt}),t?Wt(r)&&Qr(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]):!1}function vi(r,e){const t=r.length-1;let n=0,i=t,o=0,a,s;for(;n<=i;)if(o=Math.floor((n+i)/2),a=r[o],s=r[o+1],a<=e){if(o===t||ee)i=o-1;else throw new te("Input is not a number.");return 0}class rn{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[i,o]of n)this.labels.push(i),this.outputs.push(o)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");const n=t.parse(e[1],1,y);if(!n)return null;const i=[];let o=null;t.expectedType&&t.expectedType.kind!=="value"&&(o=t.expectedType);for(let a=1;a=s)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);const d=t.parse(l,c,o);if(!d)return null;o=o||d.type,i.push([s,d])}return new rn(o,n,i)}evaluate(e){const t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return n[0].evaluate(e);const o=t.length;if(i>=t[o-1])return n[o-1].evaluate(e);const a=vi(t,i);return n[a].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let t=0;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var wi=rn,ps=Je;function Je(r,e,t,n){this.cx=3*r,this.bx=3*(t-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=n,this.p2x=t,this.p2y=n}Je.prototype.sampleCurveX=function(r){return((this.ax*r+this.bx)*r+this.cx)*r};Je.prototype.sampleCurveY=function(r){return((this.ay*r+this.by)*r+this.cy)*r};Je.prototype.sampleCurveDerivativeX=function(r){return(3*this.ax*r+2*this.bx)*r+this.cx};Je.prototype.solveCurveX=function(r,e){typeof e>"u"&&(e=1e-6);var t,n,i,o,a;for(i=r,a=0;a<8;a++){if(o=this.sampleCurveX(i)-r,Math.abs(o)n)return n;for(;to?t=i:n=i,i=(n-t)*.5+t}return i};Je.prototype.solve=function(r,e){return this.sampleCurveY(this.solveCurveX(r,e))};var ds=pi(ps);function le(r,e,t){return r*(1-t)+e*t}function fs(r,e,t){return new ue(le(r.r,e.r,t),le(r.g,e.g,t),le(r.b,e.b,t),le(r.a,e.a,t))}function hs(r,e,t){return r.map((n,i)=>le(n,e[i],t))}var ms=Object.freeze({__proto__:null,number:le,color:fs,array:hs});const Ti=.95047,ki=1,zi=1.08883,Si=4/29,Ze=6/29,Fi=3*Ze*Ze,ys=Ze*Ze*Ze,gs=Math.PI/180,xs=180/Math.PI;function cr(r){return r>ys?Math.pow(r,1/3):r/Fi+Si}function pr(r){return r>Ze?r*r*r:Fi*(r-Si)}function dr(r){return 255*(r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055)}function fr(r){return r/=255,r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function Ei(r){const e=fr(r.r),t=fr(r.g),n=fr(r.b),i=cr((.4124564*e+.3575761*t+.1804375*n)/Ti),o=cr((.2126729*e+.7151522*t+.072175*n)/ki),a=cr((.0193339*e+.119192*t+.9503041*n)/zi);return{l:116*o-16,a:500*(i-o),b:200*(o-a),alpha:r.a}}function Ci(r){let e=(r.l+16)/116,t=isNaN(r.a)?e:e+r.a/500,n=isNaN(r.b)?e:e-r.b/200;return e=ki*pr(e),t=Ti*pr(t),n=zi*pr(n),new ue(dr(3.2404542*t-1.5371385*e-.4985314*n),dr(-.969266*t+1.8760108*e+.041556*n),dr(.0556434*t-.2040259*e+1.0572252*n),r.alpha)}function bs(r,e,t){return{l:le(r.l,e.l,t),a:le(r.a,e.a,t),b:le(r.b,e.b,t),alpha:le(r.alpha,e.alpha,t)}}function vs(r){const{l:e,a:t,b:n}=Ei(r),i=Math.atan2(n,t)*xs;return{h:i<0?i+360:i,c:Math.sqrt(t*t+n*n),l:e,alpha:r.a}}function ws(r){const e=r.h*gs,t=r.c,n=r.l;return Ci({l:n,a:Math.cos(e)*t,b:Math.sin(e)*t,alpha:r.alpha})}function Ts(r,e,t){const n=e-r;return r+t*(n>180||n<-180?n-360*Math.round(n/360):n)}function ks(r,e,t){return{h:Ts(r.h,e.h,t),c:le(r.c,e.c,t),l:le(r.l,e.l,t),alpha:le(r.alpha,e.alpha,t)}}const Ft={forward:Ei,reverse:Ci,interpolate:bs},Et={forward:vs,reverse:ws,interpolate:ks};class Lt{constructor(e,t,n,i,o){this.type=e,this.operator=t,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(const[a,s]of o)this.labels.push(a),this.outputs.push(s)}static interpolationFactor(e,t,n,i){let o=0;if(e.name==="exponential")o=hr(t,e.base,n,i);else if(e.name==="linear")o=hr(t,1,n,i);else if(e.name==="cubic-bezier"){const a=e.controlPoints;o=new ds(a[0],a[1],a[2],a[3]).solve(hr(t,1,n,i))}return o}static parse(e,t){let[n,i,o,...a]=e;if(!Array.isArray(i)||i.length===0)return t.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){const u=i[1];if(typeof u!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:u}}else if(i[0]==="cubic-bezier"){const u=i.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:u}}else return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,y),!o)return null;const s=[];let l=null;n==="interpolate-hcl"||n==="interpolate-lab"?l=ze:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let u=0;u=c)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);const f=t.parse(d,h,l);if(!f)return null;l=l||f.type,s.push([c,f])}return l.kind!=="number"&&l.kind!=="color"&&!(l.kind==="array"&&l.itemType.kind==="number"&&typeof l.N=="number")?t.error(`Type ${N(l)} is not interpolatable.`):new Lt(l,n,i,o,s)}evaluate(e){const t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return n[0].evaluate(e);const o=t.length;if(i>=t[o-1])return n[o-1].evaluate(e);const a=vi(t,i),s=t[a],l=t[a+1],u=Lt.interpolationFactor(this.interpolation,i,s,l),c=n[a].evaluate(e),d=n[a+1].evaluate(e);return this.operator==="interpolate"?ms[this.type.kind.toLowerCase()](c,d,u):this.operator==="interpolate-hcl"?Et.reverse(Et.interpolate(Et.forward(c),Et.forward(d),u)):Ft.reverse(Ft.interpolate(Ft.forward(c),Ft.forward(d),u))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;this.interpolation.name==="linear"?e=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?e=["linear"]:e=["exponential",this.interpolation.base]:e=["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let n=0;nht(i,s.type))?new $t(P,o):new $t(n,o)}evaluate(e){let t=null,n=0,i;for(const o of this.args){if(n++,t=o.evaluate(e),t&&t instanceof Ie&&!t.available&&(i||(i=t),t=null,n===this.args.length))return i;if(t!==null)break}return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(t=>{e.push(t.serialize())}),e}}var Ii=$t;class nn{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let o=1;o=n.length)throw new te(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new te(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var zs=on;class an{constructor(e,t){this.type=_,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,P),i=t.parse(e[2],2,P);return!n||!i?null:Nr(n.type,[_,R,y,Nt,P])?new an(n,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(n.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(n==null)return!1;if(!mt(t,["boolean","string","number","null"]))throw new te(`Expected first argument to be of type boolean, string, number or null, but found ${N(Q(t))} instead.`);if(!mt(n,["string","array"]))throw new te(`Expected second argument to be of type array or string, but found ${N(Q(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ss=an;class Ot{constructor(e,t,n){this.type=y,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,P),i=t.parse(e[2],2,P);if(!n||!i)return null;if(!Nr(n.type,[_,R,y,Nt,P]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(n.type)} instead`);if(e.length===4){const o=t.parse(e[3],3,y);return o?new Ot(n,i,o):null}else return new Ot(n,i)}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!mt(t,["boolean","string","number","null"]))throw new te(`Expected first argument to be of type boolean, string, number or null, but found ${N(Q(t))} instead.`);if(!mt(n,["string","array"]))throw new te(`Expected second argument to be of type array or string, but found ${N(Q(n))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(e);return n.indexOf(t,i)}return n.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Fs=Ot;class sn{constructor(e,t,n,i,o,a){this.inputType=e,this.type=t,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return t.error("Expected an even number of arguments.");let n,i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);const o={},a=[];for(let u=2;uNumber.MAX_SAFE_INTEGER)return p.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof f=="number"&&Math.floor(f)!==f)return p.error("Numeric branch labels must be integer values.");if(!n)n=Q(f);else if(p.checkSubtype(n,Q(f)))return null;if(typeof o[String(f)]<"u")return p.error("Branch labels must be unique.");o[String(f)]=a.length}const h=t.parse(d,u,i);if(!h)return null;i=i||h.type,a.push(h)}const s=t.parse(e[1],1,P);if(!s)return null;const l=t.parse(e[e.length-1],e.length-1,i);return!l||s.type.kind!=="value"&&t.concat(1).checkSubtype(n,s.type)?null:new sn(n,i,s,o,a,l)}evaluate(e){const t=this.input.evaluate(e);return(Q(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),n=[],i={};for(const a of t){const s=i[this.cases[a]];s===void 0?(i[this.cases[a]]=n.length,n.push([this.cases[a],[a]])):n[s][1].push(a)}const o=a=>this.inputType.kind==="number"?Number(a):a;for(const[a,s]of n)s.length===1?e.push(o(s[0])):e.push(s.map(o)),e.push(this.outputs[a].serialize());return e.push(this.otherwise.serialize()),e}}var Es=sn;class ln{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let n;t.expectedType&&t.expectedType.kind!=="value"&&(n=t.expectedType);const i=[];for(let a=1;at.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(t=>{e.push(t.serialize())}),e}}var Cs=ln;class qt{constructor(e,t,n,i){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,P),i=t.parse(e[2],2,y);if(!n||!i)return null;if(!Nr(n.type,[me(P),R,P]))return t.error(`Expected first argument to be of type array or string, but found ${N(n.type)} instead`);if(e.length===4){const o=t.parse(e[3],3,y);return o?new qt(n.type,n,i,o):null}else return new qt(n.type,n,i)}evaluate(e){const t=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!mt(t,["string","array"]))throw new te(`Expected first argument to be of type array or string, but found ${N(Q(t))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(e);return t.slice(n,i)}return t.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Is=qt;function Ln(r,e){return r==="=="||r==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function _s(r,e,t){return e===t}function Ps(r,e,t){return e!==t}function Rs(r,e,t){return et}function As(r,e,t){return e<=t}function Ds(r,e,t){return e>=t}function Pi(r,e,t,n){return n.compare(e,t)===0}function js(r,e,t,n){return!Pi(r,e,t,n)}function Ls(r,e,t,n){return n.compare(e,t)<0}function $s(r,e,t,n){return n.compare(e,t)>0}function Os(r,e,t,n){return n.compare(e,t)<=0}function qs(r,e,t,n){return n.compare(e,t)>=0}function Ye(r,e,t){const n=r!=="=="&&r!=="!=";return class Ri{constructor(o,a,s){this.type=_,this.lhs=o,this.rhs=a,this.collator=s,this.hasUntypedArgument=o.type.kind==="value"||a.type.kind==="value"}static parse(o,a){if(o.length!==3&&o.length!==4)return a.error("Expected two or three arguments.");const s=o[0];let l=a.parse(o[1],1,P);if(!l)return null;if(!Ln(s,l.type))return a.concat(1).error(`"${s}" comparisons are not supported for type '${N(l.type)}'.`);let u=a.parse(o[2],2,P);if(!u)return null;if(!Ln(s,u.type))return a.concat(2).error(`"${s}" comparisons are not supported for type '${N(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error(`Cannot compare types '${N(l.type)}' and '${N(u.type)}'.`);n&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new ke(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new ke(l.type,[u])));let c=null;if(o.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error("Cannot use collator to compare non-string types.");if(c=a.parse(o[3],3,Ut),!c)return null}return new Ri(l,u,c)}evaluate(o){const a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const l=Q(a),u=Q(s);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new te(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const l=Q(a),u=Q(s);if(l.kind!=="string"||u.kind!=="string")return e(o,a,s)}return this.collator?t(o,a,s,this.collator.evaluate(o)):e(o,a,s)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}serialize(){const o=[r];return this.eachChild(a=>{o.push(a.serialize())}),o}}}const Gs=Ye("==",_s,Pi),Vs=Ye("!=",Ps,js),Ns=Ye("<",Rs,Ls),Us=Ye(">",Ms,$s),Bs=Ye("<=",As,Os),Zs=Ye(">=",Ds,qs);class un{constructor(e,t,n,i,o,a){this.type=R,this.number=e,this.locale=t,this.currency=n,this.unit=i,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const n=t.parse(e[1],1,y);if(!n)return null;const i=e[2];if(typeof i!="object"||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let o=null;if(i.locale&&(o=t.parse(i.locale,1,R),!o))return null;let a=null;if(i.currency&&(a=t.parse(i.currency,1,R),!a))return null;let s=null;if(i.unit&&(s=t.parse(i.unit,1,R),!s))return null;let l=null;if(i["min-fraction-digits"]&&(l=t.parse(i["min-fraction-digits"],1,y),!l))return null;let u=null;return i["max-fraction-digits"]&&(u=t.parse(i["max-fraction-digits"],1,y),!u)?null:new un(n,o,a,s,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency&&"currency"||this.unit&&"unit"||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class cn{constructor(e){this.type=y,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=t.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${N(n.type)} instead.`):new cn(n):null}evaluate(e){const t=this.input.evaluate(e);if(typeof t=="string")return t.length;if(Array.isArray(t))return t.length;throw new te(`Expected value to be of type string or array, but found ${N(Q(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(t=>{e.push(t.serialize())}),e}}var Hs=cn;const Mi={"==":Gs,"!=":Vs,">":Us,"<":Ns,">=":Zs,"<=":Bs,array:ke,at:zs,boolean:ke,case:Cs,coalesce:Ii,collator:Xt,format:Zt,image:Ht,in:Ss,"index-of":Fs,interpolate:Me,"interpolate-hcl":Me,"interpolate-lab":Me,length:Hs,let:_i,literal:Dt,match:Es,number:ke,"number-format":un,object:ke,slice:Is,step:wi,string:ke,"to-boolean":Ve,"to-color":Ve,"to-number":Ve,"to-string":Ve,var:xi,within:Jr};function $n(r,[e,t,n,i]){e=e.evaluate(r),t=t.evaluate(r),n=n.evaluate(r);const o=i?i.evaluate(r):1,a=fi(e,t,n,o);if(a)throw new te(a);return new ue(e/255*o,t/255*o,n/255*o,o)}function On(r,e){return r in e}function mr(r,e){const t=e[r];return typeof t>"u"?null:t}function Xs(r,e,t,n){for(;t<=n;){const i=t+n>>1;if(e[i]===r)return!0;e[i]>r?n=i-1:t=i+1}return!1}function _e(r){return{type:r}}Ke.register(Mi,{error:[Ba,[R],(r,[e])=>{throw new te(e.evaluate(r))}],typeof:[R,[P],(r,[e])=>N(Q(e.evaluate(r)))],"to-rgba":[me(y,4),[ze],(r,[e])=>e.evaluate(r).toArray()],rgb:[ze,[y,y,y],$n],rgba:[ze,[y,y,y,y],$n],has:{type:_,overloads:[[[R],(r,[e])=>On(e.evaluate(r),r.properties())],[[R,Be],(r,[e,t])=>On(e.evaluate(r),t.evaluate(r))]]},get:{type:P,overloads:[[[R],(r,[e])=>mr(e.evaluate(r),r.properties())],[[R,Be],(r,[e,t])=>mr(e.evaluate(r),t.evaluate(r))]]},"feature-state":[P,[R],(r,[e])=>mr(e.evaluate(r),r.featureState||{})],properties:[Be,[],r=>r.properties()],"geometry-type":[R,[],r=>r.geometryType()],id:[P,[],r=>r.id()],zoom:[y,[],r=>r.globals.zoom],pitch:[y,[],r=>r.globals.pitch||0],"distance-from-center":[y,[],r=>r.distanceFromCenter()],"heatmap-density":[y,[],r=>r.globals.heatmapDensity||0],"line-progress":[y,[],r=>r.globals.lineProgress||0],"sky-radial-progress":[y,[],r=>r.globals.skyRadialProgress||0],accumulated:[P,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[y,_e(y),(r,e)=>{let t=0;for(const n of e)t+=n.evaluate(r);return t}],"*":[y,_e(y),(r,e)=>{let t=1;for(const n of e)t*=n.evaluate(r);return t}],"-":{type:y,overloads:[[[y,y],(r,[e,t])=>e.evaluate(r)-t.evaluate(r)],[[y],(r,[e])=>-e.evaluate(r)]]},"/":[y,[y,y],(r,[e,t])=>e.evaluate(r)/t.evaluate(r)],"%":[y,[y,y],(r,[e,t])=>e.evaluate(r)%t.evaluate(r)],ln2:[y,[],()=>Math.LN2],pi:[y,[],()=>Math.PI],e:[y,[],()=>Math.E],"^":[y,[y,y],(r,[e,t])=>Math.pow(e.evaluate(r),t.evaluate(r))],sqrt:[y,[y],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[y,[y],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[y,[y],(r,[e])=>Math.log(e.evaluate(r))],log2:[y,[y],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[y,[y],(r,[e])=>Math.sin(e.evaluate(r))],cos:[y,[y],(r,[e])=>Math.cos(e.evaluate(r))],tan:[y,[y],(r,[e])=>Math.tan(e.evaluate(r))],asin:[y,[y],(r,[e])=>Math.asin(e.evaluate(r))],acos:[y,[y],(r,[e])=>Math.acos(e.evaluate(r))],atan:[y,[y],(r,[e])=>Math.atan(e.evaluate(r))],min:[y,_e(y),(r,e)=>Math.min(...e.map(t=>t.evaluate(r)))],max:[y,_e(y),(r,e)=>Math.max(...e.map(t=>t.evaluate(r)))],abs:[y,[y],(r,[e])=>Math.abs(e.evaluate(r))],round:[y,[y],(r,[e])=>{const t=e.evaluate(r);return t<0?-Math.round(-t):Math.round(t)}],floor:[y,[y],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[y,[y],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[_,[R,P],(r,[e,t])=>r.properties()[e.value]===t.value],"filter-id-==":[_,[P],(r,[e])=>r.id()===e.value],"filter-type-==":[_,[R],(r,[e])=>r.geometryType()===e.value],"filter-<":[_,[R,P],(r,[e,t])=>{const n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n{const t=r.id(),n=e.value;return typeof t==typeof n&&t":[_,[R,P],(r,[e,t])=>{const n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n>i}],"filter-id->":[_,[P],(r,[e])=>{const t=r.id(),n=e.value;return typeof t==typeof n&&t>n}],"filter-<=":[_,[R,P],(r,[e,t])=>{const n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[_,[P],(r,[e])=>{const t=r.id(),n=e.value;return typeof t==typeof n&&t<=n}],"filter->=":[_,[R,P],(r,[e,t])=>{const n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[_,[P],(r,[e])=>{const t=r.id(),n=e.value;return typeof t==typeof n&&t>=n}],"filter-has":[_,[P],(r,[e])=>e.value in r.properties()],"filter-has-id":[_,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[_,[me(R)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[_,[me(P)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[_,[R,me(P)],(r,[e,t])=>t.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[_,[R,me(P)],(r,[e,t])=>Xs(r.properties()[e.value],t.value,0,t.value.length-1)],all:{type:_,overloads:[[[_,_],(r,[e,t])=>e.evaluate(r)&&t.evaluate(r)],[_e(_),(r,e)=>{for(const t of e)if(!t.evaluate(r))return!1;return!0}]]},any:{type:_,overloads:[[[_,_],(r,[e,t])=>e.evaluate(r)||t.evaluate(r)],[_e(_),(r,e)=>{for(const t of e)if(t.evaluate(r))return!0;return!1}]]},"!":[_,[_],(r,[e])=>!e.evaluate(r)],"is-supported-script":[_,[R],(r,[e])=>{const t=r.globals&&r.globals.isSupportedScript;return t?t(e.evaluate(r)):!0}],upcase:[R,[R],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[R,[R],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[R,_e(P),(r,e)=>e.map(t=>pt(t.evaluate(r))).join("")],"resolved-locale":[R,[Ut],(r,[e])=>e.evaluate(r).resolvedLocale()]});var Ai=Mi;function Ir(r){return{result:"success",value:r}}function Oe(r){return{result:"error",value:r}}function Ws(r){return r["property-type"]==="data-driven"}function Ks(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function Js(r){return!!r.expression&&r.expression.interpolated}function Di(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}class Ys{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new hi,this._defaultValue=t?rl(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,n,i,o,a,s,l){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=i||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=l||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,i,o,a,s,l){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=l||null;try{const u=this.expression.evaluate(this._evaluator);if(u==null||typeof u=="number"&&u!==u)return this._defaultValue;if(this._enumValues&&!(u in this._enumValues))throw new te(`Expected value to be one of ${Object.keys(this._enumValues).map(c=>JSON.stringify(c)).join(", ")}, but found ${JSON.stringify(u)} instead.`);return u}catch(u){return this._warningHistory[u.message]||(this._warningHistory[u.message]=!0,typeof console<"u"&&console.warn(u.message)),this._defaultValue}}}function Qs(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Ai}function _r(r,e){const t=new bi(Ai,[],e?tl(e):void 0),n=t.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Ir(new Ys(n,e)):Oe(t.errors)}class qn{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Yr(t.expression)}evaluateWithoutErrorHandling(e,t,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,i,o,a)}evaluate(e,t,n,i,o,a){return this._styleExpression.evaluate(e,t,n,i,o,a)}}class Gn{constructor(e,t,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Yr(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,i,o,a)}evaluate(e,t,n,i,o,a){return this._styleExpression.evaluate(e,t,n,i,o,a)}interpolationFactor(e,t,n){return this.interpolationType?Me.interpolationFactor(this.interpolationType,e,t,n):0}}function el(r,e){if(r=_r(r,e),r.result==="error")return r;const t=r.value.expression,n=Wt(t);if(!n&&!Ws(e))return Oe([new be("","data expressions not supported")]);const i=Qr(t,["zoom","pitch","distance-from-center"]);if(!i&&!Ks(e))return Oe([new be("","zoom expressions not supported")]);const o=Pt(t);if(!o&&!i)return Oe([new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof be)return Oe([o]);if(o instanceof Me&&!Js(e))return Oe([new be("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Ir(n?new qn("constant",r.value):new qn("source",r.value));const a=o instanceof Me?o.interpolation:void 0;return Ir(n?new Gn("camera",r.value,o.labels,a):new Gn("composite",r.value,o.labels,a))}function Pt(r){let e=null;if(r instanceof _i)e=Pt(r.result);else if(r instanceof Ii){for(const t of r.args)if(e=Pt(t),e)break}else(r instanceof wi||r instanceof Me)&&r.input instanceof Ke&&r.input.name==="zoom"&&(e=r);return e instanceof be||r.eachChild(t=>{const n=Pt(t);n instanceof be?e=n:!e&&n?e=new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new be("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function tl(r){const e={color:ze,string:R,number:y,enum:R,boolean:_,formatted:Bt,resolvedImage:yt};return r.type==="array"?me(e[r.value]||P,r.length):e[r.type]}function rl(r){return r.type==="color"&&(Di(r.default)||Array.isArray(r.default))?new ue(0,0,0,0):r.type==="color"?ue.parse(r.default)||null:r.default===void 0?null:r.default}function nl(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function Pr(r){if(Array.isArray(r))return r.map(Pr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const e={};for(const t in r)e[t]=Pr(r[t]);return e}return nl(r)}var ji={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{},globe:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["source"]}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["fill-extrusion-edge-radius"]}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function Li(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const e of r.slice(1))if(!Li(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function il(r,e="fill"){if(r==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Li(r)||(r=Gt(r));const t=r;let n=!0;try{n=ol(t)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. +This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md +and paste the contents of this message in the report. +Thank you! +Filter Expression: +${JSON.stringify(t,null,2)} + `)}const i=ji[`filter_${e}`],o=_r(n,i);let a=null;if(o.result==="error")throw new Error(o.value.map(c=>`${c.key}: ${c.message}`).join(", "));a=(c,d,p)=>o.value.evaluate(c,d,{},p);let s=null,l=null;if(n!==t){const c=_r(t,i);if(c.result==="error")throw new Error(c.value.map(d=>`${d.key}: ${d.message}`).join(", "));s=(d,p,h,f,x)=>c.value.evaluate(d,p,{},h,void 0,void 0,f,x),l=!Wt(c.value.expression)}a=a;const u=qi(n);return{filter:a,dynamicFilter:s||void 0,needGeometry:u,needFeature:!!l}}function ol(r){if(!He(r))return r;let e=Pr(r);return Oi(e),e=$i(e),e}function $i(r){if(!Array.isArray(r))return r;const e=ll(r);return e===!0?e:e.map(t=>$i(t))}function Oi(r){let e=!1;const t=[];if(r[0]==="case"){for(let n=1;n",">=","<","<=","to-boolean"]);function ll(r){if(sl.has(r[0]))for(let e=1;ee?1:0}function qi(r){if(!Array.isArray(r))return!1;if(r[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?yr(r[1],r[2],e):e==="any"?cl(r.slice(1)):e==="all"?["all"].concat(r.slice(1).map(Gt)):e==="none"?["all"].concat(r.slice(1).map(Gt).map(Ct)):e==="in"?Vn(r[1],r.slice(2)):e==="!in"?Ct(Vn(r[1],r.slice(2))):e==="has"?Nn(r[1]):e==="!has"?Ct(Nn(r[1])):e==="within"?r:!0}function yr(r,e,t){switch(r){case"$type":return[`filter-type-${t}`,e];case"$id":return[`filter-id-${t}`,e];default:return[`filter-${t}`,r,e]}}function cl(r){return["any"].concat(r.map(Gt))}function Vn(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",r,["literal",e.sort(ul)]]:["filter-in-small",r,["literal",e]]}}function Nn(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Ct(r){return["!",r]}var pl=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dl(r,e){const t={};for(const n in r)n!=="ref"&&(t[n]=r[n]);return pl.forEach(n=>{n in e&&(t[n]=e[n])}),t}function fl(r){r=r.slice();const e=Object.create(null);for(let t=0;t1?p[p.length-2].toLowerCase():"";if(h==f||h==f.replace("-","")||x+"-"+h==f){i=s?i:Un[f],p.pop(),x&&f.startsWith(x)&&p.pop();break}}!s&&typeof h=="number"&&(i=h,s=!0);var m=p.join(at).replace("Klokantech Noto Sans","Noto Sans");m.indexOf(at)!==-1&&(m='"'+m+'"'),a.push(m)}n=Zn[r]=[o,i,a]}return n[0]+at+n[1]+at+e+"px"+(t?"/"+t:"")+at+n[2]},Rr=pi(hl);const Gi="https://api.mapbox.com";function pn(r){const e="mapbox://";return r.indexOf(e)!==0?"":r.slice(e.length)}function ml(r,e,t){const n=pn(r);if(!n)return decodeURI(new URL(r,t).href);const i="sprites/";if(n.indexOf(i)!==0)throw new Error(`unexpected sprites url: ${r}`);const o=n.slice(i.length);return`${Gi}/styles/v1/${o}/sprite?access_token=${e}`}function Vi(r,e){const t=pn(r);if(!t)return decodeURI(new URL(r,location.href).href);const n="styles/";if(t.indexOf(n)!==0)throw new Error(`unexpected style url: ${r}`);const i=t.slice(n.length);return`${Gi}/styles/v1/${i}?&access_token=${e}`}function Rt(r,e,t,n){const i=new URL(r,n),o=pn(r);if(!o)return e&&(i.searchParams.has(t)||i.searchParams.set(t,e)),decodeURI(i.href);if(o==="mapbox.satellite"){const a=window.devicePixelRatio>=1.5?"@2x":"";return`https://api.mapbox.com/v4/${o}/{z}/{x}/{y}${a}.webp?access_token=${e}`}return`https://{a-d}.tiles.mapbox.com/v4/${o}/{z}/{x}/{y}.vector.pbf?access_token=${e}`}const Hn={},Xn={};let yl=0;function dn(r){return r.id||(r.id=yl++),r.id}function gl(r,e){return dn(r)+"."+ye(e)}function xl(r){let e=Hn[r.id];return e||(e={},Hn[dn(r)]=e),e}function bl(r){let e=Xn[r.id];return e||(e={},Xn[dn(r)]=e),e}function gr(r){return r*Math.PI/180}const Kt=function(){const r=[];for(let e=78271.51696402048;r.length<=24;e/=2)r.push(e);return r}();function Jt(r,e){if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<"u")return new OffscreenCanvas(r,e);const t=document.createElement("canvas");return t.width=r,t.height=e,t}function Ni(r,e){let t=0;const n=e.length;for(;ti).then(a=>(a instanceof Request||(a=new Request(a)),a.headers.get("Accept")||a.headers.set("Accept","application/json"),n&&(n.request=a),fetch(a).then(function(s){return delete $e[e],s.ok?s.json():Promise.reject(new Error("Error fetching source "+e))}).catch(function(s){return delete $e[e],Promise.reject(new Error("Error fetching source "+e))})));return $e[e]=[i,o],o}function Ui(r,e){if(typeof r=="string")if(r.trim().startsWith("{"))try{const t=JSON.parse(r);return Promise.resolve(t)}catch(t){return Promise.reject(t)}else return r=Vi(r,e.accessToken),We("Style",r,e);else return Promise.resolve(r)}const Wn={};function wl(r,e,t={}){const n=[e,JSON.stringify(r)].toString();let i=Wn[n];if(!i||t.transformRequest){let o;t.transformRequest&&(o=(s,l)=>{const u=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(s instanceof ui)s.setLoader((c,d,p)=>{Mt(()=>u).then(h=>{fetch(h).then(f=>f.arrayBuffer()).then(f=>{const m=s.getFormat().readFeatures(f,{extent:c,featureProjection:p});s.setFeatures(m)}).catch(f=>s.setState(q.ERROR))})});else{const c=s.getImage();Mt(()=>u).then(d=>{d instanceof Request?fetch(d).then(p=>p.blob()).then(p=>{const h=URL.createObjectURL(p);c.addEventListener("load",()=>URL.revokeObjectURL(h)),c.addEventListener("error",()=>URL.revokeObjectURL(h)),c.src=h}).catch(p=>s.setState(q.ERROR)):c.src=d})}});const a=r.url;if(a&&!r.tiles){const s=Rt(a,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(a.startsWith("mapbox://"))i=Promise.resolve({tileJson:Object.assign({},r,{url:void 0,tiles:Vo(s)}),tileLoadFunction:o});else{const l={};i=We("Source",s,t,l).then(function(u){return u.tiles=u.tiles.map(function(c){return u.scheme==="tms"&&(c=c.replace("{y}","{-y}")),Rt(c,t.accessToken,t.accessTokenParam||"access_token",l.request.url)}),Promise.resolve({tileJson:u,tileLoadFunction:o})})}}else r=Object.assign({},r,{tiles:r.tiles.map(function(s){return r.scheme==="tms"&&(s=s.replace("{y}","{-y}")),Rt(s,t.accessToken,t.accessTokenParam||"access_token",e||location.href)})}),i=Promise.resolve({tileJson:Object.assign({},r),tileLoadFunction:o});Wn[n]=i}return i}function Kn(r,e,t,n){const i=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],o=Jt(i[0],i[1]),a=o.getContext("2d");a.drawImage(r,e.x,e.y,e.width,e.height,t*e.pixelRatio,t*e.pixelRatio,e.width,e.height);const s=a.getImageData(0,0,i[0],i[1]);a.globalCompositeOperation="destination-over",a.fillStyle=`rgba(${n.r*255},${n.g*255},${n.b*255},${n.a})`;const l=s.data;for(let u=0,c=s.width;u0&&a.arc(u,d,t*e.pixelRatio,0,2*Math.PI)}return a.fill(),o}function Tl(r,e,t){const n=Math.max(0,Math.min(1,(t-r)/(e-r)));return n*n*(3-2*n)}function Jn(r,e,t){const n=Jt(e.width,e.height),i=n.getContext("2d");i.drawImage(r,e.x,e.y,e.width,e.height,0,0,e.width,e.height);const o=i.getImageData(0,0,e.width,e.height),a=o.data;for(let s=0,l=o.width;s0?(a[d+0]=Math.round(255*t.r*x),a[d+1]=Math.round(255*t.g*x),a[d+2]=Math.round(255*t.b*x),a[d+3]=Math.round(255*x)):a[d+3]=0}return i.putImageData(o,0,0),n}const kl=Array(256).join(" ");function Mr(r,e){if(e>=.05){let t="";const n=r.split(` +`),i=kl.slice(0,Math.round(e/.1));for(let o=0,a=n.length;o0&&(t+=` +`),t+=n[o].split("").join(i);return t}return r}let xr;function Bi(){return xr||(xr=Jt(1,1).getContext("2d")),xr}function Pe(r,e){return Bi().measureText(r).width+(r.length-1)*e}const Yn={};function Ar(r,e,t,n){if(r.indexOf(` +`)!==-1){const a=r.split(` +`),s=[];for(let l=0,u=a.length;l1){const s=Bi();s.font=e;const u=s.measureText("M").width*t;let c="";const d=[];for(let p=0,h=a.length;p1;++p){const f=d[p];if(Pe(f,n)0?Pe(d[p-1],n):1/0,m=pu*.7&&Pe(x,n)`${n.key}: ${n.message}`).join(", "));return t.value},Dr={},Vt={zoom:0};let _t,vr;function S(r,e,t,n,i,o,a){const s=r.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[s]||(o[s]={});const l=o[s];if(!l[t]){let u=(r[e]||Dr)[t];const c=ji[`${e}_${r.type}`][t];u===void 0&&(u=c.default);let d=Qs(u);if(!d&&Di(u)&&(u=La(u,c),d=!0),d){const p=_l(u,c);l[t]=p.evaluate.bind(p)}else c.type=="color"&&(u=ue.parse(u)),l[t]=function(){return u}}return Vt.zoom=n,l[t](Vt,i,a)}function Qn(r,e,t,n,i){return S(r,"layout",`${n}-allow-overlap`,e,t,i)?S(r,"layout",`${n}-ignore-placement`,e,t,i)?"none":"obstacle":"declutter"}function Pl(r,e,t,n,i){return i||console.warn("No filterCache provided to evaluateFilter()"),r in i||(i[r]=il(e).filter),Vt.zoom=n,i[r](Vt,t)}function Fe(r,e){if(r){if(r.a===0||e===0)return;const t=r.a;return e=e===void 0?1:e,t===0?"transparent":"rgba("+Math.round(r.r*255/t)+","+Math.round(r.g*255/t)+","+Math.round(r.b*255/t)+","+t*e+")"}return r}const Rl=/\{[^{}}]*\}/g;function wr(r,e){return r.replace(Rl,function(t){return e[t.slice(1,-1)]||""})}const Ml={};function Al(r,e,t,n=Kt,i=void 0,o=void 0,a=void 0,s=void 0){if(typeof e=="string"&&(e=JSON.parse(e)),e.version!=8)throw new Error("glStyle version 8 required.");Ml[gl(e,r)]=Array.from(arguments);let l,u,c;if(o){if(typeof Image<"u"){const T=new Image;let F;Mt(()=>o).then(L=>{L instanceof Request?fetch(L).then(Y=>Y.blob()).then(Y=>{F=URL.createObjectURL(Y),T.src=F}).catch(()=>{}):(T.crossOrigin="anonymous",T.src=L,F&&URL.revokeObjectURL(F))}),T.onload=function(){l=T,u=[T.width,T.height],r.changed(),T.onload=null}}else if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){const T=self;T.postMessage({action:"loadImage",src:o}),T.addEventListener("message",function(L){L.data.action==="imageLoaded"&&L.data.src===o&&(l=L.data.image,u=[l.width,l.height])})}}const d=fl(e.layers),p={},h=[],f={},x={},m=xl(e),D=bl(e);let I;for(let T=0,F=d.length;T=v.maxzoom)continue;const hn=v.filter;if(!hn||Pl(fn,hn,b,g,D)){let ce,we,vt,xe,Te,w;const De=xt.index;if(J==3&&(v.type=="fill"||v.type=="fill-extrusion"))if(we=S(v,"paint",v.type+"-opacity",g,b,m,k),v.type+"-pattern"in Ae){const U=S(v,"paint",v.type+"-pattern",g,b,m,k);if(U){const B=typeof U=="string"?wr(U,Y):U.toString();if(l&&i&&i[B]){++M,w=z[M],(!w||!w.getFill()||w.getStroke()||w.getText())&&(w=new Ee({fill:new Ge}),z[M]=w),vt=w.getFill(),w.setZIndex(De);const V=B+"."+we;let Z=x[V];if(!Z){const j=i[B],$=Jt(j.width,j.height),X=$.getContext("2d");X.globalAlpha=we,X.drawImage(l,j.x,j.y,j.width,j.height,0,0,j.width,j.height),Z=X.createPattern($,"repeat"),x[V]=Z}vt.setColor(Z)}}}else ce=Fe(S(v,"paint",v.type+"-color",g,b,m,k),we),v.type+"-outline-color"in Ae&&(Te=Fe(S(v,"paint",v.type+"-outline-color",g,b,m,k),we)),Te||(Te=ce),(ce||Te)&&(++M,w=z[M],(!w||ce&&!w.getFill()||!ce&&w.getFill()||Te&&!w.getStroke()||!Te&&w.getStroke()||w.getText())&&(w=new Ee({fill:ce?new Ge:void 0,stroke:Te?new st:void 0}),z[M]=w),ce&&(vt=w.getFill(),vt.setColor(ce)),Te&&(xe=w.getStroke(),xe.setColor(Te),xe.setWidth(.5)),w.setZIndex(De));if(J!=1&&v.type=="line"){"line-pattern"in Ae?ce=void 0:ce=Fe(S(v,"paint","line-color",g,b,m,k),S(v,"paint","line-opacity",g,b,m,k));const U=S(v,"paint","line-width",g,b,m,k);ce&&U>0&&(++M,w=z[M],(!w||!w.getStroke()||w.getFill()||w.getText())&&(w=new Ee({stroke:new st}),z[M]=w),xe=w.getStroke(),xe.setLineCap(S(v,"layout","line-cap",g,b,m,k)),xe.setLineJoin(S(v,"layout","line-join",g,b,m,k)),xe.setMiterLimit(S(v,"layout","line-miter-limit",g,b,m,k)),xe.setColor(ce),xe.setWidth(U),xe.setLineDash(Ae["line-dasharray"]?S(v,"paint","line-dasharray",g,b,m,k).map(function(B){return B*U}):null),w.setZIndex(De))}let wt=!1,O=null,mn=0,Qe,ne,Yt;if((J==1||J==2)&&"icon-image"in bt){const U=S(v,"layout","icon-image",g,b,m,k);if(U){Qe=typeof U=="string"?wr(U,Y):U.toString();let B;const V=s?s(r,Qe):void 0;if(l&&i&&i[Qe]||V){const Z=S(v,"layout","icon-rotation-alignment",g,b,m,k);if(J==2){const j=T.getGeometry();if(j.getFlatMidpoint||j.getFlatMidpoints){const $=j.getExtent();if(Math.sqrt(Math.max(Math.pow(($[2]-$[0])/F,2),Math.pow(($[3]-$[1])/F,2)))>150){const W=j.getType()==="MultiLineString"?j.getFlatMidpoints():j.getFlatMidpoint();if(vr||(_t=[NaN,NaN],vr=new kr("Point",_t,[],2,{},void 0)),B=vr,_t[0]=W[0],_t[1]=W[1],S(v,"layout","symbol-placement",g,b,m,k)==="line"&&Z==="map"){const se=j.getStride(),ie=j.getFlatCoordinates();for(let oe=0,H=ie.length-se;oe=nt&&W[0]<=Xi&&W[1]>=Hi&&W[1]<=Wi){mn=Math.atan2(fe-re,he-de);break}}}}}}if(J!==2||B){const j=S(v,"layout","icon-size",g,b,m,k),$=Ae["icon-color"]!==void 0?S(v,"paint","icon-color",g,b,m,k):null;if(!$||$.a!==0){const X=S(v,"paint","icon-halo-color",g,b,m,k),W=S(v,"paint","icon-halo-width",g,b,m,k);let pe=`${Qe}.${j}.${W}.${X}`;if($!==null&&(pe+=`.${$}`),ne=f[pe],!ne){const se=Qn(v,g,b,"icon",m);let ie;"icon-offset"in bt&&(ie=S(v,"layout","icon-offset",g,b,m,k).slice(0),ie[0]*=j,ie[1]*=-j);let oe=$?[$.r*255,$.g*255,$.b*255,$.a]:void 0;if(V){const H={color:oe,rotateWithView:Z==="map",displacement:ie,declutterMode:se,scale:j};typeof V=="string"?H.src=V:(H.img=V,H.imgSize=[V.width,V.height]),ne=new vn(H)}else{const H=i[Qe];let de,fe,he;W?H.sdf?(de=Kn(Jn(l,H,$||[0,0,0,1]),{x:0,y:0,width:H.width,height:H.height,pixelRatio:H.pixelRatio},W,X),oe=void 0):de=Kn(l,H,W,X):(H.sdf?(c||(c=Jn(l,{x:0,y:0,width:u[0],height:u[1]},{r:1,g:1,b:1,a:1})),de=c):de=l,fe=[H.width,H.height],he=[H.x,H.y]),ne=new vn({color:oe,img:de,imgSize:u,size:fe,offset:he,rotateWithView:Z==="map",scale:j/H.pixelRatio,displacement:ie,declutterMode:se})}f[pe]=ne}}ne&&(++M,w=z[M],(!w||!w.getImage()||w.getFill()||w.getStroke())&&(w=new Ee,z[M]=w),w.setGeometry(B),ne.setRotation(mn+gr(S(v,"layout","icon-rotate",g,b,m,k))),ne.setOpacity(S(v,"paint","icon-opacity",g,b,m,k)),ne.setAnchor(Il[S(v,"layout","icon-anchor",g,b,m,k)]),w.setImage(ne),O=w.getText(),w.setText(void 0),w.setZIndex(De),wt=!0,Yt=!1)}else Yt=!0}}}if(J==1&&v.type==="circle"){++M,w=z[M],(!w||!w.getImage()||w.getFill()||w.getStroke())&&(w=new Ee,z[M]=w);const U="circle-radius"in Ae?S(v,"paint","circle-radius",g,b,m,k):5,B=Fe(S(v,"paint","circle-stroke-color",g,b,m,k),S(v,"paint","circle-stroke-opacity",g,b,m,k)),V=S(v,"paint","circle-translate",g,b,m,k),Z=Fe(S(v,"paint","circle-color",g,b,m,k),S(v,"paint","circle-opacity",g,b,m,k)),j=S(v,"paint","circle-stroke-width",g,b,m,k),$=U+"."+B+"."+Z+"."+j+"."+V[0]+"."+V[1];ne=f[$],ne||(ne=new li({radius:U,displacement:[V[0],-V[1]],stroke:B&&j>0?new st({width:j,color:B}):void 0,fill:Z?new Ge({color:Z}):void 0,declutterMode:"none"}),f[$]=ne),w.setImage(ne),O=w.getText(),w.setText(void 0),w.setGeometry(void 0),w.setZIndex(De),wt=!0}let ee,et,tt,Se,rt,Qt;if("text-field"in bt){Se=Math.round(S(v,"layout","text-size",g,b,m,k));const U=S(v,"layout","text-font",g,b,m,k);tt=S(v,"layout","text-line-height",g,b,m,k),et=Rr(a?a(U,e.metadata?e.metadata["ol:webfonts"]:void 0):U,Se,tt),et.includes("sans-serif")||(et+=",sans-serif"),rt=S(v,"layout","text-letter-spacing",g,b,m,k),Qt=S(v,"layout","text-max-width",g,b,m,k);const B=S(v,"layout","text-field",g,b,m,k);typeof B=="object"&&B.sections?B.sections.length===1?ee=B.toString():ee=B.sections.reduce((V,Z,j)=>{const $=Z.fontStack?Z.fontStack.split(","):U,X=Rr(a?a($):$,Se*(Z.scale||1),tt);let W=Z.text;if(W===` +`)return V.push(` +`,""),V;if(J==2){V.push(Mr(W,rt),X);return}W=Ar(W,X,Qt,rt).split(` +`);for(let pe=0,se=W.length;pe0&&V.push(` +`,""),V.push(W[pe],X);return V},[]):ee=wr(B,Y).trim(),we=S(v,"paint","text-opacity",g,b,m,k)}if(ee&&we&&!Yt){wt||(++M,w=z[M],(!w||!w.getText()||w.getFill()||w.getStroke())&&(w=new Ee,z[M]=w),w.setImage(void 0),w.setGeometry(void 0));const U=Qn(v,g,b,"text",m);w.getText()||w.setText(O),O=w.getText(),(!O||"getDeclutterMode"in O&&O.getDeclutterMode()!==U)&&(O=new No({padding:[2,2,2,2],declutterMode:U}),w.setText(O));const B=S(v,"layout","text-transform",g,b,m,k);B=="uppercase"?ee=Array.isArray(ee)?ee.map((re,nt)=>nt%2?re:re.toUpperCase()):ee.toUpperCase():B=="lowercase"&&(ee=Array.isArray(ee)?ee.map((re,nt)=>nt%2?re:re.toLowerCase()):ee.toLowerCase());const V=Array.isArray(ee)?ee:J==2?Mr(ee,rt):Ar(ee,et,Qt,rt);O.setText(V),O.setFont(et),O.setRotation(gr(S(v,"layout","text-rotate",g,b,m,k)));const Z=S(v,"layout","text-anchor",g,b,m,k),j=wt||J==1?"point":S(v,"layout","symbol-placement",g,b,m,k);let $;if(j==="line-center"?(O.setPlacement("line"),$="center"):O.setPlacement(j),j==="line"&&typeof O.setRepeat=="function"){const re=S(v,"layout","symbol-spacing",g,b,m,k);O.setRepeat(re*2)}O.setOverflow(j==="point");let X=S(v,"paint","text-halo-width",g,b,m,k);const W=S(v,"layout","text-offset",g,b,m,k),pe=S(v,"paint","text-translate",g,b,m,k);let se=0,ie=0;if(j=="point"){$="center",Z.indexOf("left")!==-1?($="left",ie=X):Z.indexOf("right")!==-1&&($="right",ie=-X);const re=S(v,"layout","text-rotation-alignment",g,b,m,k);O.setRotateWithView(re=="map")}else O.setMaxAngle(gr(S(v,"layout","text-max-angle",g,b,m,k))*ee.length/V.length),O.setRotateWithView(!1);O.setTextAlign($);let oe="middle";Z.indexOf("bottom")==0?(oe="bottom",se=-X-.5*(tt-1)*Se):Z.indexOf("top")==0&&(oe="top",se=X+.5*(tt-1)*Se),O.setTextBaseline(oe);const H=S(v,"layout","text-justify",g,b,m,k);O.setJustify(H==="auto"?void 0:H),O.setOffsetX(W[0]*Se+ie+pe[0]),O.setOffsetY(W[1]*Se+se+pe[1]),C.setColor(Fe(S(v,"paint","text-color",g,b,m,k),we)),O.setFill(C);const de=Fe(S(v,"paint","text-halo-color",g,b,m,k),we);if(de&&X>0){E.setColor(de),X*=2;const re=.5*Se;E.setWidth(X<=re?X:re),O.setStroke(E)}else O.setStroke(void 0);const fe=S(v,"layout","text-padding",g,b,m,k),he=O.getPadding();fe!==he[0]&&(he[0]=fe,he[1]=fe,he[2]=fe,he[3]=fe),w.setZIndex(De)}}}if(M>-1)return z.length=M+1,z};return r.setStyle(A),r.set("mapbox-source",I),r.set("mapbox-layers",h),r.set("mapbox-featurestate",r.get("mapbox-featurestate")||{}),A}function Dl(r,e=512){return r.getExtent()?jr({extent:r.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Kt}function jl(r,e){return e.accessToken||(e=Object.assign({},e),new URL(r).searchParams.forEach((n,i)=>{e.accessToken=n,e.accessTokenParam=i})),e}function Ll(r,e,t="",n={},i=void 0){let o,a,s,l,u=!0;return typeof t!="string"&&!Array.isArray(t)?(s=t,l=s.source||s.layers,n=s):l=t,typeof n=="string"?(o=n,s={}):(o=n.styleUrl,s=n),s.updateSource===!1&&(u=!1),i||(i=s.resolutions),!o&&typeof e=="string"&&!e.trim().startsWith("{")&&(o=e),o&&(o=o.startsWith("data:")?location.href:Vi(o,s.accessToken),s=jl(o,s)),new Promise(function(c,d){Ui(e,s).then(function(p){if(p.version!=8)return d(new Error("glStyle version 8 required."));if(!(r instanceof zr||r instanceof ut))return d(new Error("Can only apply to VectorLayer or VectorTileLayer"));const h=r instanceof ut?"vector":"geojson";if(l?Array.isArray(l)?a=p.layers.find(function(C){return C.id===l[0]}).source:a=l:(a=Object.keys(p.sources).find(function(C){return p.sources[C].type===h}),l=a),!a)return d(new Error(`No ${h} source found in the glStyle.`));function f(){if(!u)return Promise.resolve();if(r instanceof ut)return Nl(p.sources[a],o,s).then(function(T){const F=r.getSource();F?T!==F&&(F.setTileUrlFunction(T.getTileUrlFunction()),typeof F.setUrls=="function"&&typeof T.getUrls=="function"&&F.setUrls(T.getUrls()),F.format_||(F.format_=T.format_),F.getAttributions()||F.setAttributions(T.getAttributions()),F.getTileLoadFunction()===ci&&F.setTileLoadFunction(T.getTileLoadFunction()),qo(F.getProjection(),T.getProjection())&&(F.tileGrid=T.getTileGrid())):r.setSource(T);const L=r.getSource().getTileGrid();!isFinite(r.getMaxResolution())&&!isFinite(r.getMinZoom())&&L.getMinZoom()>0&&r.setMaxResolution(vl(Math.max(0,L.getMinZoom()-1e-12),L.getResolutions()))});const C=p.sources[a];let z=r.getSource();(!z||z.get("mapbox-source")!==C)&&(z=Bl(C,o,s));const A=r.getSource();return A?z!==A&&(A.getAttributions()||A.setAttributions(z.getAttributions()),A.format_||(A.format_=z.getFormat()),A.url_=z.getUrl()):r.setSource(z),Promise.resolve()}let x,m,D,I;function E(){if(!I&&(!p.sprite||m)){if(s.projection&&!i){const z=Xe(s.projection).getUnits();z!=="m"&&(i=Kt.map(A=>A/Ao[z]))}I=Al(r,p,l,i,m,D,(C,z=s.webfonts)=>El(C,z),s.getImage),r.getStyle()?f().then(c).catch(d):d(new Error(`Nothing to show for source [${a}]`))}else I?(r.setStyle(I),f().then(c).catch(d)):d(new Error("Something went wrong trying to apply style."))}if(p.sprite){const C=new URL(ml(p.sprite,s.accessToken,o||location.href));x=window.devicePixelRatio>=1.5?.5:1;const z=x==.5?"@2x":"";let A=C.origin+C.pathname+z+".json"+C.search;new Promise(function(T,F){We("Sprite",A,s).then(T).catch(function(L){A=C.origin+C.pathname+".json"+C.search,We("Sprite",A,s).then(T).catch(F)})}).then(function(T){if(T===void 0&&d(new Error("No sprites found.")),m=T,D=C.origin+C.pathname+z+".png"+C.search,s.transformRequest){const F=s.transformRequest(D,"SpriteImage")||D;(F instanceof Request||F instanceof Promise)&&(D=F)}E()}).catch(function(T){d(new Error(`Sprites cannot be loaded: ${A}: ${T.message}`))})}else E()}).catch(d)})}const ei={};function $l(r,e,t){e.layers.some(function(n){if(n.type==="background"){if(r instanceof si)return r.setBackground(function(i){return Zi(n,i,t,{})}),!0;if(r instanceof Do||r instanceof jo)return r.getLayers().insertAt(0,Vl(n,t,{})),!0}})}function Ol(r,e,t={}){return Ui(e,t).then(function(n){$l(r,n,t)})}function ql(r,e){const t=r.bounds;if(t){const n=wn([t[0],t[1]],e),i=wn([t[2],t[3]],e);return[n[0],n[1],i[0],i[1]]}return Xe(e).getExtent()}function Gl(r,e,t){const n=new da({tileJSON:e,tileSize:r.tileSize||e.tileSize||512}),i=n.getTileJSON(),o=n.getTileGrid(),a=Xe(t.projection||"EPSG:3857"),s=ql(i,a),l=a.getExtent(),u=i.minzoom||0,c=i.maxzoom||22,d={attributions:n.getAttributions(),projection:a,tileGrid:new ai({origin:l?ni(l):o.getOrigin(0),extent:s||o.getExtent(),minZoom:u,resolutions:Dl(a,e.tileSize).slice(0,c+1),tileSize:o.getTileSize(0)})};return Array.isArray(i.tiles)?d.urls=i.tiles:d.url=i.tiles,d}function Zi(r,e,t,n){const i={id:r.id,type:r.type},o=r.layout||{},a=r.paint||{};i.paint=a;const s=Ni(e,t.resolutions||Kt);let l;const u=S(i,"paint","background-color",s,ei,n);return a["background-opacity"]!==void 0&&(l=S(i,"paint","background-opacity",s,ei,n)),o.visibility=="none"?void 0:Fe(u,l)}function Vl(r,e,t){const n=document.createElement("div");return n.className="ol-mapbox-style-background",n.style.position="absolute",n.style.width="100%",n.style.height="100%",new si({source:new Lo({}),render(i){const o=Zi(r,i.viewState.resolution,e,t);return n.style.backgroundColor=o,n}})}function Nl(r,e,t){return new Promise(function(n,i){wl(r,e,t).then(function({tileJson:o,tileLoadFunction:a}){const s=Gl(r,o,t);s.tileLoadFunction=a,s.format=new $r,n(new Lr(s))}).catch(i)})}function Ul(r){return`{bbox-${(r?r.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function Bl(r,e,t){const n=t.projection?new zn({dataProjection:t.projection}):new zn,i=r.data,o={};if(typeof i=="string"){const s=Rt(i,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(s)){const u=(d,p,h)=>{const f=Ul(h);return s.replace(f,`${d.join(",")}`)},c=new rr({attributions:r.attribution,format:n,loader:(d,p,h,f,x)=>{const m=typeof u=="function"?u(d,p,h):u;We("GeoJSON",m,t).then(D=>{const I=c.getFormat().readFeatures(D,{featureProjection:h});c.addFeatures(I),f(I)}).catch(D=>{c.removeLoadedExtent(d),x()})},strategy:Go});return c.set("mapbox-source",r),c}const l=new rr({attributions:r.attribution,format:n,url:s,loader:(u,c,d,p,h)=>{We("GeoJSON",s,t).then(f=>{const x=l.getFormat().readFeatures(f,{featureProjection:d});l.addFeatures(x),p(x)}).catch(f=>{l.removeLoadedExtent(u),h()})}});return l}o.features=n.readFeatures(i,{featureProjection:"EPSG:3857"});const a=new rr(Object.assign({attributions:r.attribution,format:n},o));return a.set("mapbox-source",r),a}class Zl extends Mo{constructor(e){super(Tr.ERROR),this.error=e}}class Hl extends ut{constructor(e){const t="declutter"in e?e.declutter:!0,n=new Lr({state:"loading",format:new $r});super({source:n,background:e.background===!1?null:e.background,declutter:t,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties}),e.accessToken&&(this.accessToken=e.accessToken);const i=e.styleUrl,o=[Ll(this,i,e.layers||e.source,{accessToken:this.accessToken})];this.getBackground()===void 0&&o.push(Ol(this,e.styleUrl,{accessToken:this.accessToken})),Promise.all(o).then(()=>{n.setState("ready")}).catch(a=>{this.dispatchEvent(new Zl(a)),this.getSource().setState("error")})}}const qe="main";class Xl{mapId=qe;vectorSourceFactory;constructor({references:e}){this.vectorSourceFactory=e.vectorSourceFactory}async getMapConfig(){return{projection:"EPSG:3857",initialView:{kind:"position",center:{x:848890,y:6793350},zoom:13},layers:[new it({title:"OSM",visible:!0,isBaseLayer:!0,olLayer:new Uo({source:new Bo})}),new it({id:"inspire-us-kindergarten",title:"Kindertageseinrichtungen in NRW",visible:!0,olLayer:new zr({style:new Ee({image:new li({fill:new Ge({color:"blue"}),radius:5})}),source:this.vectorSourceFactory.createVectorSource({baseUrl:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1",collectionId:"governmentalservice",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:"Datenlizenz Deutschland - Namensnennung - Version 2.0"})})}),new it({id:"ogc_katasterbezirk",title:"Liegenschaftskatasterbezirke in NRW (viele Daten)",visible:!1,olLayer:new zr({source:this.vectorSourceFactory.createVectorSource({baseUrl:"https://ogc-api.nrw.de/lika/v1",collectionId:"katasterbezirk",limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:"Datenlizenz Deutschland - Namensnennung - Version 2.0"})})}),new it({title:"Abschnitte / Äste mit Unfällen (Mapbox Style)",visible:!1,olLayer:new Hl({styleUrl:"https://demo.ldproxy.net/strassen/styles/default?f=mbs"})}),new it({title:"Pendleratlas",visible:!0,olLayer:new ut({source:new Lr({url:"https://pendleratlas.statistikportal.de/_vector_tiles/2022/vg250/{z}/{x}/{y}.pbf",format:new $r,projection:"EPSG:3857",attributions:`© Statistische Ämter der Länder ${new Date().getFullYear()} | GeoBasis-DE/BKG ${new Date().getFullYear()}`}),style:new Ee({fill:new Ge({color:"rgba(173, 209, 158, 0.6)"}),stroke:new st({color:"#2d7d9f",width:3})})})})]}}}class Wl{beforeRequest({target:e,options:t}){e.protocol==="https:"&&e.hostname==="ogc-api.nrw.de"&&t.headers.set("Authorization","Bearer 12345")}}const Kl={"ogc-api-app":{name:"ogc-api-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Xl,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},SampleTokenInterceptor:{name:"SampleTokenInterceptor",clazz:Wl,provides:[{name:"http.Interceptor",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:Zo,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:Ho,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:na,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:ia,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}}},Jl=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',Yl=["en","de"];function Ql(r){switch(r){case"en":return Sn(()=>import("./CQRU2o-rqIdt.js"),[],import.meta.url).then(e=>e.default);case"de":return Sn(()=>import("./ysjsThxdLmKR.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${r}'`)}const eu=Ki(Jl),tu=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:Ql,locales:Yl,packages:Kl,styles:eu},Symbol.toStringTag,{value:"Module"})),ru="ogc-api-app",nu=Xo.bind(void 0,ru);function iu(){const r=nu();return K.jsx(nr,{height:"100%",direction:"column",overflow:"hidden",children:K.jsx(Tn,{title:K.jsx(yn,{textAlign:"center",py:1,children:K.jsx(kn,{size:"md",children:"Open Pioneer - OGC API Features and OGC API Tiles Sample"})}),children:K.jsx(nr,{flex:"1",direction:"column",position:"relative",children:K.jsxs(Wo,{mapId:qe,children:[K.jsx(ir,{position:"top-left",horizontalGap:20,verticalGap:20,children:K.jsx(yn,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:K.jsx(Tn,{title:K.jsx(kn,{size:"md",children:r.formatMessage({id:"tocTitle"})}),children:K.jsx(Yo,{mapId:qe,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})})}),K.jsx(ir,{position:"top-right",horizontalGap:10,verticalGap:10,children:K.jsxs(Ji,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[K.jsx(or,{as:"b",children:"Description"}),K.jsx(or,{children:"This application can be used to test OGC API Features and OGC API Tiles."}),K.jsx(or,{children:"Vector Tiles cannot be reprojected and require the map to use the same projection. Currently all known MVT vector tile sets are using WebMercator, making them unusable in the Default Sample App which uses ETRS89/UTM zone 32N. This Sample App uses WebMercator."})]})}),K.jsx(ir,{position:"bottom-right",horizontalGap:10,verticalGap:30,children:K.jsxs(nr,{direction:"column",gap:1,padding:1,children:[K.jsx(oa,{mapId:qe}),K.jsx(aa,{mapId:qe}),K.jsx(sa,{mapId:qe})]})})]})})})})}const ou=Yi({component:iu,theme:Qi,appMetadata:tu,async resolveConfig(r){const e=r.getAttribute("forced-locale");if(e)return{locale:e}}});customElements.define("ogc-api-app",ou);const au=document.getElementsByTagName("body")[0];su();function su(){const r=window.location.search,t=new URLSearchParams(r).get("lang"),n=document.createElement("ogc-api-app");n.classList.add("full-height"),n.setAttribute("id","test"),t&&n.setAttribute("forced-locale",t),au.appendChild(n)} diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CR6SzAtaFOeK.js b/openlayers-base-packages/pr-previews/pr-377/assets/__kfMbro-lod.js similarity index 99% rename from openlayers-base-packages/pr-previews/pr-377/assets/CR6SzAtaFOeK.js rename to openlayers-base-packages/pr-previews/pr-377/assets/__kfMbro-lod.js index a367f39..2d8b257 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CR6SzAtaFOeK.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/__kfMbro-lod.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CLzYDcnWEay-.js","./DbBkdn6FNbgs.js","./nEjnOjKmH1UU.js","./DyxVjgSvwe-K.js","./CCXTS-icusD6.js","./CwYOJLhODXKJ.js","./35mnA9_wxNJd.js","./DnYPVZQRsXfx.js"])))=>i.map(i=>d[i]); -import{_ as gs}from"./CmsKOCeNyeyo.js";import{_ as ve}from"./nEjnOjKmH1UU.js";import"./DbBkdn6FNbgs.js";import"./DyxVjgSvwe-K.js";import"./CCXTS-icusD6.js";import"./CwYOJLhODXKJ.js";import"./35mnA9_wxNJd.js";import"./DnYPVZQRsXfx.js";var tn=Uint8Array,vn=Uint16Array,Ps=Int32Array,go=new tn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mo=new tn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ms=new tn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xc=function(r,e){for(var n=new vn(31),a=0;a<31;++a)n[a]=e+=1<>1|(we&21845)<<1;kr=(kr&52428)>>2|(kr&13107)<<2,kr=(kr&61680)>>4|(kr&3855)<<4,bs[we]=((kr&65280)>>8|(kr&255)<<8)>>1}var tr=function(r,e,n){for(var a=r.length,c=0,o=new vn(e);c>f]=g}else for(h=new vn(a),c=0;c>15-r[c]);return h},Cr=new tn(288);for(var we=0;we<144;++we)Cr[we]=8;for(var we=144;we<256;++we)Cr[we]=9;for(var we=256;we<280;++we)Cr[we]=7;for(var we=280;we<288;++we)Cr[we]=8;var da=new tn(32);for(var we=0;we<32;++we)da[we]=5;var Fu=tr(Cr,9,0),Iu=tr(Cr,9,1),Cu=tr(da,5,0),ju=tr(da,5,1),os=function(r){for(var e=r[0],n=1;ne&&(e=r[n]);return e},qn=function(r,e,n){var a=e/8|0;return(r[a]|r[a+1]<<8)>>(e&7)&n},ss=function(r,e){var n=e/8|0;return(r[n]|r[n+1]<<8|r[n+2]<<16)>>(e&7)},ks=function(r){return(r+7)/8|0},kc=function(r,e,n){return(n==null||n>r.length)&&(n=r.length),new tn(r.subarray(e,n))},Ou=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Rn=function(r,e,n){var a=new Error(e||Ou[r]);if(a.code=r,Error.captureStackTrace&&Error.captureStackTrace(a,Rn),!n)throw a;return a},Bu=function(r,e,n,a){var c=r.length,o=0;if(!c||e.f&&!e.l)return n||new tn(0);var l=!n,h=l||e.i!=2,f=e.i;l&&(n=new tn(c*3));var g=function(Nt){var Ft=n.length;if(Nt>Ft){var _t=new tn(Math.max(Ft*2,Nt));_t.set(n),n=_t}},y=e.f||0,w=e.p||0,S=e.b||0,p=e.l,O=e.d,F=e.m,q=e.n,_=c*8;do{if(!p){y=qn(r,w,1);var B=qn(r,w+1,3);if(w+=3,B)if(B==1)p=Iu,O=ju,F=9,q=5;else if(B==2){var wt=qn(r,w,31)+257,tt=qn(r,w+10,15)+4,z=wt+qn(r,w+5,31)+1;w+=14;for(var rt=new tn(z),dt=new tn(19),P=0;P>4;if(Y<16)rt[P++]=Y;else{var it=0,lt=0;for(Y==16?(lt=3+qn(r,w,3),w+=2,it=rt[P-1]):Y==17?(lt=3+qn(r,w,7),w+=3):Y==18&&(lt=11+qn(r,w,127),w+=7);lt--;)rt[P++]=it}}var $=rt.subarray(0,wt),ht=rt.subarray(wt);F=os($),q=os(ht),p=tr($,F,1),O=tr(ht,q,1)}else Rn(1);else{var Y=ks(w)+4,ot=r[Y-4]|r[Y-3]<<8,ut=Y+ot;if(ut>c){f&&Rn(0);break}h&&g(S+ot),n.set(r.subarray(Y,ut),S),e.b=S+=ot,e.p=w=ut*8,e.f=y;continue}if(w>_){f&&Rn(0);break}}h&&g(S+131072);for(var pt=(1<>4;if(w+=it&15,w>_){f&&Rn(0);break}if(it||Rn(2),C<256)n[S++]=C;else if(C==256){N=w,p=null;break}else{var M=C-254;if(C>264){var P=C-257,T=go[P];M=qn(r,w,(1<>4;J||Rn(3),w+=J&15;var ht=ku[Q];if(Q>3){var T=mo[Q];ht+=ss(r,w)&(1<_){f&&Rn(0);break}h&&g(S+131072);var et=S+M;if(S>8},la=function(r,e,n){n<<=e&7;var a=e/8|0;r[a]|=n,r[a+1]|=n>>8,r[a+2]|=n>>16},cs=function(r,e){for(var n=[],a=0;aS&&(S=o[a].s);var p=new vn(S+1),O=ys(n[y-1],p,0);if(O>e){var a=0,F=0,q=O-e,_=1<e)F+=_-(1<>=q;F>0;){var Y=o[a].s;p[Y]=0&&F;--a){var ot=o[a].s;p[ot]==e&&(--p[ot],++F)}O=e}return{t:new tn(p),l:O}},ys=function(r,e,n){return r.s==-1?Math.max(ys(r.l,e,n+1),ys(r.r,e,n+1)):e[r.s]=n},ac=function(r){for(var e=r.length;e&&!r[--e];);for(var n=new vn(++e),a=0,c=r[0],o=1,l=function(f){n[a++]=f},h=1;h<=e;++h)if(r[h]==c&&h!=e)++o;else{if(!c&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(c),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(c);o=1,c=r[h]}return{c:n.subarray(0,a),n:e}},ha=function(r,e){for(var n=0,a=0;a>8,r[c+2]=r[c]^255,r[c+3]=r[c+1]^255;for(var o=0;o4&&!dt[ms[k-1]];--k);var W=g+5<<3,D=ha(c,Cr)+ha(o,da)+l,st=ha(c,S)+ha(o,F)+l+14+3*k+ha(tt,dt)+2*tt[16]+3*tt[17]+7*tt[18];if(f>=0&&W<=D&&W<=st)return Fc(e,y,r.subarray(f,f+g));var it,lt,$,ht;if(dr(e,y,1+(st15&&(dr(e,y,C[z]>>5&127),y+=C[z]>>12)}}else it=Fu,lt=Cr,$=Cu,ht=da;for(var z=0;z255){var M=T>>18&31;la(e,y,it[M+257]),y+=lt[M+257],M>7&&(dr(e,y,T>>23&31),y+=go[M]);var J=T&31;la(e,y,$[J]),y+=ht[J],J>3&&(la(e,y,T>>5&8191),y+=mo[J])}else la(e,y,it[T]),y+=lt[T]}return la(e,y,it[256]),y+lt[256]},Mu=new Ps([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ic=new tn(0),Eu=function(r,e,n,a,c,o){var l=o.z||r.length,h=new tn(a+l+5*(1+Math.ceil(l/7e3))+c),f=h.subarray(a,h.length-c),g=o.l,y=(o.r||0)&7;if(e){y&&(f[0]=o.r>>3);for(var w=Mu[e-1],S=w>>13,p=w&8191,O=(1<7e3||dt>24576)&&(it>423||!g)){y=oc(r,f,0,ot,ut,wt,z,dt,k,rt-k,y),dt=tt=z=0,k=rt;for(var lt=0;lt<286;++lt)ut[lt]=0;for(var lt=0;lt<30;++lt)wt[lt]=0}var $=2,ht=0,pt=p,It=D-st&32767;if(it>2&&W==Y(rt-It))for(var N=Math.min(S,it)-1,C=Math.min(32767,rt),M=Math.min(258,it);It<=C&&--pt&&D!=st;){if(r[rt+$]==r[rt+$-It]){for(var T=0;T$){if($=T,ht=It,T>N)break;for(var J=Math.min(It,T-2),Q=0,lt=0;ltQ&&(Q=At,st=et)}}}D=st,st=F[D],It+=D-st&32767}if(ht){ot[dt++]=268435456|vs[$]<<18|ic[ht];var Nt=vs[$]&31,Ft=ic[ht]&31;z+=go[Nt]+mo[Ft],++ut[257+Nt],++wt[Ft],P=rt+$,++tt}else ot[dt++]=r[rt],++ut[r[rt]]}}for(rt=Math.max(rt,P);rt=l&&(f[y/8|0]=g,_t=l),y=Fc(f,y+1,r.subarray(rt,_t))}o.i=l}return kc(h,0,a+ks(y)+c)},Cc=function(){var r=1,e=0;return{p:function(n){for(var a=r,c=e,o=n.length|0,l=0;l!=o;){for(var h=Math.min(l+2655,o);l>16),c=(c&65535)+15*(c>>16)}r=a,e=c},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},qu=function(r,e,n,a,c){if(!c&&(c={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),l=new tn(o.length+r.length);l.set(o),l.set(r,o.length),r=l,c.w=o.length}return Eu(r,e.level==null?6:e.level,e.mem==null?c.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,n,a,c)},jc=function(r,e,n){for(;n;++e)r[e]=n,n>>>=8},Du=function(r,e){var n=e.level,a=n==0?0:n<6?1:n==9?3:2;if(r[0]=120,r[1]=a<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var c=Cc();c.p(e.dictionary),jc(r,2,c.d())}},Ru=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&Rn(6,"invalid zlib data"),(r[1]>>5&1)==+!e&&Rn(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function ws(r,e){e||(e={});var n=Cc();n.p(r);var a=qu(r,e,e.dictionary?6:2,4);return Du(a,e),jc(a,a.length-4,n.d()),a}function Tu(r,e){return Bu(r.subarray(Ru(r,e),-4),{i:2},e,e)}var zu=typeof TextDecoder<"u"&&new TextDecoder,Uu=0;try{zu.decode(Ic,{stream:!0}),Uu=1}catch{}var Ht=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function us(){Ht.console&&typeof Ht.console.log=="function"&&Ht.console.log.apply(Ht.console,arguments)}var me={log:us,warn:function(r){Ht.console&&(typeof Ht.console.warn=="function"?Ht.console.warn.apply(Ht.console,arguments):us.call(null,arguments))},error:function(r){Ht.console&&(typeof Ht.console.error=="function"?Ht.console.error.apply(Ht.console,arguments):us(r))}};function ls(r,e,n){var a=new XMLHttpRequest;a.open("GET",r),a.responseType="blob",a.onload=function(){Gr(a.response,e,n)},a.onerror=function(){me.error("could not download file")},a.send()}function sc(r){var e=new XMLHttpRequest;e.open("HEAD",r,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function io(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(e)}}var fa,Ls,Gr=Ht.saveAs||((typeof window>"u"?"undefined":ve(window))!=="object"||window!==Ht?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(r,e,n){var a=Ht.URL||Ht.webkitURL,c=document.createElement("a");e=e||r.name||"download",c.download=e,c.rel="noopener",typeof r=="string"?(c.href=r,c.origin!==location.origin?sc(c.href)?ls(r,e,n):io(c,c.target="_blank"):io(c)):(c.href=a.createObjectURL(r),setTimeout(function(){a.revokeObjectURL(c.href)},4e4),setTimeout(function(){io(c)},0))}:"msSaveOrOpenBlob"in navigator?function(r,e,n){if(e=e||r.name||"download",typeof r=="string")if(sc(r))ls(r,e,n);else{var a=document.createElement("a");a.href=r,a.target="_blank",setTimeout(function(){io(a)})}else navigator.msSaveOrOpenBlob(function(c,o){return o===void 0?o={autoBom:!1}:ve(o)!=="object"&&(me.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}(r,n),e)}:function(r,e,n,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),typeof r=="string")return ls(r,e,n);var c=r.type==="application/octet-stream",o=/constructor/i.test(Ht.HTMLElement)||Ht.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||c&&o)&&(typeof FileReader>"u"?"undefined":ve(FileReader))==="object"){var h=new FileReader;h.onloadend=function(){var y=h.result;y=l?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=y:location=y,a=null},h.readAsDataURL(r)}else{var f=Ht.URL||Ht.webkitURL,g=f.createObjectURL(r);a?a.location=g:location.href=g,a=null,setTimeout(function(){f.revokeObjectURL(g)},4e4)}});/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BYONkh1IVI5I.js","./B60Dx_GOYdnk.js","./DSjrbd_eKbZM.js","./j0mck_Meu7Xh.js","./BpQSjk0kyblh.js","./vepZWq5kkQUw.js","./C9VJq5Ka7299.js","./2C0geDG_OBHU.js"])))=>i.map(i=>d[i]); +import{_ as gs}from"./CmsKOCeNyeyo.js";import{_ as ve}from"./DSjrbd_eKbZM.js";import"./B60Dx_GOYdnk.js";import"./j0mck_Meu7Xh.js";import"./BpQSjk0kyblh.js";import"./vepZWq5kkQUw.js";import"./C9VJq5Ka7299.js";import"./2C0geDG_OBHU.js";var tn=Uint8Array,vn=Uint16Array,Ps=Int32Array,go=new tn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mo=new tn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ms=new tn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xc=function(r,e){for(var n=new vn(31),a=0;a<31;++a)n[a]=e+=1<>1|(we&21845)<<1;kr=(kr&52428)>>2|(kr&13107)<<2,kr=(kr&61680)>>4|(kr&3855)<<4,bs[we]=((kr&65280)>>8|(kr&255)<<8)>>1}var tr=function(r,e,n){for(var a=r.length,c=0,o=new vn(e);c>f]=g}else for(h=new vn(a),c=0;c>15-r[c]);return h},Cr=new tn(288);for(var we=0;we<144;++we)Cr[we]=8;for(var we=144;we<256;++we)Cr[we]=9;for(var we=256;we<280;++we)Cr[we]=7;for(var we=280;we<288;++we)Cr[we]=8;var da=new tn(32);for(var we=0;we<32;++we)da[we]=5;var Fu=tr(Cr,9,0),Iu=tr(Cr,9,1),Cu=tr(da,5,0),ju=tr(da,5,1),os=function(r){for(var e=r[0],n=1;ne&&(e=r[n]);return e},qn=function(r,e,n){var a=e/8|0;return(r[a]|r[a+1]<<8)>>(e&7)&n},ss=function(r,e){var n=e/8|0;return(r[n]|r[n+1]<<8|r[n+2]<<16)>>(e&7)},ks=function(r){return(r+7)/8|0},kc=function(r,e,n){return(n==null||n>r.length)&&(n=r.length),new tn(r.subarray(e,n))},Ou=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Rn=function(r,e,n){var a=new Error(e||Ou[r]);if(a.code=r,Error.captureStackTrace&&Error.captureStackTrace(a,Rn),!n)throw a;return a},Bu=function(r,e,n,a){var c=r.length,o=0;if(!c||e.f&&!e.l)return n||new tn(0);var l=!n,h=l||e.i!=2,f=e.i;l&&(n=new tn(c*3));var g=function(Nt){var Ft=n.length;if(Nt>Ft){var _t=new tn(Math.max(Ft*2,Nt));_t.set(n),n=_t}},y=e.f||0,w=e.p||0,S=e.b||0,p=e.l,O=e.d,F=e.m,q=e.n,_=c*8;do{if(!p){y=qn(r,w,1);var B=qn(r,w+1,3);if(w+=3,B)if(B==1)p=Iu,O=ju,F=9,q=5;else if(B==2){var wt=qn(r,w,31)+257,tt=qn(r,w+10,15)+4,z=wt+qn(r,w+5,31)+1;w+=14;for(var rt=new tn(z),dt=new tn(19),P=0;P>4;if(Y<16)rt[P++]=Y;else{var it=0,lt=0;for(Y==16?(lt=3+qn(r,w,3),w+=2,it=rt[P-1]):Y==17?(lt=3+qn(r,w,7),w+=3):Y==18&&(lt=11+qn(r,w,127),w+=7);lt--;)rt[P++]=it}}var $=rt.subarray(0,wt),ht=rt.subarray(wt);F=os($),q=os(ht),p=tr($,F,1),O=tr(ht,q,1)}else Rn(1);else{var Y=ks(w)+4,ot=r[Y-4]|r[Y-3]<<8,ut=Y+ot;if(ut>c){f&&Rn(0);break}h&&g(S+ot),n.set(r.subarray(Y,ut),S),e.b=S+=ot,e.p=w=ut*8,e.f=y;continue}if(w>_){f&&Rn(0);break}}h&&g(S+131072);for(var pt=(1<>4;if(w+=it&15,w>_){f&&Rn(0);break}if(it||Rn(2),C<256)n[S++]=C;else if(C==256){N=w,p=null;break}else{var M=C-254;if(C>264){var P=C-257,T=go[P];M=qn(r,w,(1<>4;J||Rn(3),w+=J&15;var ht=ku[Q];if(Q>3){var T=mo[Q];ht+=ss(r,w)&(1<_){f&&Rn(0);break}h&&g(S+131072);var et=S+M;if(S>8},la=function(r,e,n){n<<=e&7;var a=e/8|0;r[a]|=n,r[a+1]|=n>>8,r[a+2]|=n>>16},cs=function(r,e){for(var n=[],a=0;aS&&(S=o[a].s);var p=new vn(S+1),O=ys(n[y-1],p,0);if(O>e){var a=0,F=0,q=O-e,_=1<e)F+=_-(1<>=q;F>0;){var Y=o[a].s;p[Y]=0&&F;--a){var ot=o[a].s;p[ot]==e&&(--p[ot],++F)}O=e}return{t:new tn(p),l:O}},ys=function(r,e,n){return r.s==-1?Math.max(ys(r.l,e,n+1),ys(r.r,e,n+1)):e[r.s]=n},ac=function(r){for(var e=r.length;e&&!r[--e];);for(var n=new vn(++e),a=0,c=r[0],o=1,l=function(f){n[a++]=f},h=1;h<=e;++h)if(r[h]==c&&h!=e)++o;else{if(!c&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(c),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(c);o=1,c=r[h]}return{c:n.subarray(0,a),n:e}},ha=function(r,e){for(var n=0,a=0;a>8,r[c+2]=r[c]^255,r[c+3]=r[c+1]^255;for(var o=0;o4&&!dt[ms[k-1]];--k);var W=g+5<<3,D=ha(c,Cr)+ha(o,da)+l,st=ha(c,S)+ha(o,F)+l+14+3*k+ha(tt,dt)+2*tt[16]+3*tt[17]+7*tt[18];if(f>=0&&W<=D&&W<=st)return Fc(e,y,r.subarray(f,f+g));var it,lt,$,ht;if(dr(e,y,1+(st15&&(dr(e,y,C[z]>>5&127),y+=C[z]>>12)}}else it=Fu,lt=Cr,$=Cu,ht=da;for(var z=0;z255){var M=T>>18&31;la(e,y,it[M+257]),y+=lt[M+257],M>7&&(dr(e,y,T>>23&31),y+=go[M]);var J=T&31;la(e,y,$[J]),y+=ht[J],J>3&&(la(e,y,T>>5&8191),y+=mo[J])}else la(e,y,it[T]),y+=lt[T]}return la(e,y,it[256]),y+lt[256]},Mu=new Ps([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ic=new tn(0),Eu=function(r,e,n,a,c,o){var l=o.z||r.length,h=new tn(a+l+5*(1+Math.ceil(l/7e3))+c),f=h.subarray(a,h.length-c),g=o.l,y=(o.r||0)&7;if(e){y&&(f[0]=o.r>>3);for(var w=Mu[e-1],S=w>>13,p=w&8191,O=(1<7e3||dt>24576)&&(it>423||!g)){y=oc(r,f,0,ot,ut,wt,z,dt,k,rt-k,y),dt=tt=z=0,k=rt;for(var lt=0;lt<286;++lt)ut[lt]=0;for(var lt=0;lt<30;++lt)wt[lt]=0}var $=2,ht=0,pt=p,It=D-st&32767;if(it>2&&W==Y(rt-It))for(var N=Math.min(S,it)-1,C=Math.min(32767,rt),M=Math.min(258,it);It<=C&&--pt&&D!=st;){if(r[rt+$]==r[rt+$-It]){for(var T=0;T$){if($=T,ht=It,T>N)break;for(var J=Math.min(It,T-2),Q=0,lt=0;ltQ&&(Q=At,st=et)}}}D=st,st=F[D],It+=D-st&32767}if(ht){ot[dt++]=268435456|vs[$]<<18|ic[ht];var Nt=vs[$]&31,Ft=ic[ht]&31;z+=go[Nt]+mo[Ft],++ut[257+Nt],++wt[Ft],P=rt+$,++tt}else ot[dt++]=r[rt],++ut[r[rt]]}}for(rt=Math.max(rt,P);rt=l&&(f[y/8|0]=g,_t=l),y=Fc(f,y+1,r.subarray(rt,_t))}o.i=l}return kc(h,0,a+ks(y)+c)},Cc=function(){var r=1,e=0;return{p:function(n){for(var a=r,c=e,o=n.length|0,l=0;l!=o;){for(var h=Math.min(l+2655,o);l>16),c=(c&65535)+15*(c>>16)}r=a,e=c},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},qu=function(r,e,n,a,c){if(!c&&(c={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),l=new tn(o.length+r.length);l.set(o),l.set(r,o.length),r=l,c.w=o.length}return Eu(r,e.level==null?6:e.level,e.mem==null?c.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,n,a,c)},jc=function(r,e,n){for(;n;++e)r[e]=n,n>>>=8},Du=function(r,e){var n=e.level,a=n==0?0:n<6?1:n==9?3:2;if(r[0]=120,r[1]=a<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var c=Cc();c.p(e.dictionary),jc(r,2,c.d())}},Ru=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&Rn(6,"invalid zlib data"),(r[1]>>5&1)==+!e&&Rn(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function ws(r,e){e||(e={});var n=Cc();n.p(r);var a=qu(r,e,e.dictionary?6:2,4);return Du(a,e),jc(a,a.length-4,n.d()),a}function Tu(r,e){return Bu(r.subarray(Ru(r,e),-4),{i:2},e,e)}var zu=typeof TextDecoder<"u"&&new TextDecoder,Uu=0;try{zu.decode(Ic,{stream:!0}),Uu=1}catch{}var Ht=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function us(){Ht.console&&typeof Ht.console.log=="function"&&Ht.console.log.apply(Ht.console,arguments)}var me={log:us,warn:function(r){Ht.console&&(typeof Ht.console.warn=="function"?Ht.console.warn.apply(Ht.console,arguments):us.call(null,arguments))},error:function(r){Ht.console&&(typeof Ht.console.error=="function"?Ht.console.error.apply(Ht.console,arguments):us(r))}};function ls(r,e,n){var a=new XMLHttpRequest;a.open("GET",r),a.responseType="blob",a.onload=function(){Gr(a.response,e,n)},a.onerror=function(){me.error("could not download file")},a.send()}function sc(r){var e=new XMLHttpRequest;e.open("HEAD",r,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function io(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(e)}}var fa,Ls,Gr=Ht.saveAs||((typeof window>"u"?"undefined":ve(window))!=="object"||window!==Ht?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(r,e,n){var a=Ht.URL||Ht.webkitURL,c=document.createElement("a");e=e||r.name||"download",c.download=e,c.rel="noopener",typeof r=="string"?(c.href=r,c.origin!==location.origin?sc(c.href)?ls(r,e,n):io(c,c.target="_blank"):io(c)):(c.href=a.createObjectURL(r),setTimeout(function(){a.revokeObjectURL(c.href)},4e4),setTimeout(function(){io(c)},0))}:"msSaveOrOpenBlob"in navigator?function(r,e,n){if(e=e||r.name||"download",typeof r=="string")if(sc(r))ls(r,e,n);else{var a=document.createElement("a");a.href=r,a.target="_blank",setTimeout(function(){io(a)})}else navigator.msSaveOrOpenBlob(function(c,o){return o===void 0?o={autoBom:!1}:ve(o)!=="object"&&(me.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}(r,n),e)}:function(r,e,n,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),typeof r=="string")return ls(r,e,n);var c=r.type==="application/octet-stream",o=/constructor/i.test(Ht.HTMLElement)||Ht.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||c&&o)&&(typeof FileReader>"u"?"undefined":ve(FileReader))==="object"){var h=new FileReader;h.onloadend=function(){var y=h.result;y=l?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=y:location=y,a=null},h.readAsDataURL(r)}else{var f=Ht.URL||Ht.webkitURL,g=f.createObjectURL(r);a?a.location=g:location.href=g,a=null,setTimeout(function(){f.revokeObjectURL(g)},4e4)}});/** * A class to parse color values * @author Stoyan Stefanov * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} @@ -164,7 +164,7 @@ endobj\r * http://opensource.org/licenses/mit-license */function Dn(r,e){if(this.pos=0,this.buffer=r,this.datav=new DataView(r.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Nc(r){function e(z){if(!z)throw Error("assert :P")}function n(z,rt,dt){for(var P=0;4>P;P++)if(z[rt+P]!=dt.charCodeAt(P))return!0;return!1}function a(z,rt,dt,P,k){for(var W=0;WW+1?[]:new rt),!(D.length>>0;t&u;)u>>>=1;return u?(t&u-1)+u:t}function dt(t,i,u,d,m){e(!(d%u));do t[i+(d-=u)]=m;while(0=m),512>=m)var b=o(512);else if((b=o(m))==null)return 0;return function(L,A,x,I,U,K){var Z,G,vt=A,at=1<Z;++Z){if(H[Z]>1<(Rt-=H[Z]))return 0;for(;0=Z;++Z,U<<=1){if(St+=Rt<<=1,0>(Rt-=H[Z]))return 0;for(;0bt&&!(0>=(gt-=H[bt]));)++bt,gt<<=1;at+=Pt=1<<(gt=bt-x),L[A+(bt=Bt&mt)].g=gt+x,L[A+bt].value=vt-A-bt}I.g=Z-x,I.value=K[G++],dt(L,vt+(Bt>>x),U,Pt,I),Bt=rt(Bt,Z)}}return St!=2*V[15]-1?0:at}(t,i,u,d,m,b)}function k(){this.value=this.g=0}function W(){this.value=this.g=0}function D(){this.G=l(5,k),this.H=o(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=l(Ve,W)}function st(t,i,u,d){e(t!=null),e(i!=null),e(2147483648>d),t.Ca=254,t.I=0,t.b=-8,t.Ka=0,t.oa=i,t.pa=u,t.Jd=i,t.Yc=u+d,t.Zc=4<=d?u+d-4+1:u,Q(t)}function it(t,i){for(var u=0;0d),t.Sb=d,t.Ra=0,t.u=0,t.h=0,4>>=8,t.Ra+=t.oa[t.pa+t.bb]<>>0,++t.bb,t.u-=8;M(t)&&(t.h=1,t.u=0)}function pt(t,i){if(e(0<=i),!t.h&&i<=pi){var u=C(t)&di[i];return t.u+=i,ht(t),u}return t.h=1,t.u=0}function It(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function N(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function C(t){return t.Ra>>>(t.u&gi-1)>>>0}function M(t){return e(t.bb<=t.Sb),t.h||t.bb==t.Sb&&t.u>gi}function T(t,i){t.u=i,t.h=M(t)}function J(t){t.u>=$i&&(e(t.u>=$i),ht(t))}function Q(t){e(t!=null&&t.oa!=null),t.pa>>0,t.b+=8):(e(t!=null&&t.oa!=null),t.pat.b&&Q(t);var d=t.b,m=u*i>>>8,b=(t.I>>>d>m)+0;for(b?(u-=m,t.I-=m+1<>>0):u=m+1,d=u,m=0;256<=d;)m+=8,d>>=8;return d=7^m+sn[d],t.b-=d,t.Ca=(u<>24&255,t[i+1]=u>>16&255,t[i+2]=u>>8&255,t[i+3]=u>>0&255}function Nt(t,i){return t[i+0]<<0|t[i+1]<<8}function Ft(t,i){return Nt(t,i)|t[i+2]<<16}function _t(t,i){return Nt(t,i)|Nt(t,i+2)<<16}function zt(t,i){var u=1<=m||0>=b?0:(u[0]=m,d[0]=b,1)}function Et(t,i){return t+(1<>>i}function Lt(t,i){return((4278255360&t)+(4278255360&i)>>>0&4278255360)+((16711935&t)+(16711935&i)>>>0&16711935)>>>0}function xt(t,i){z[i]=function(u,d,m,b,L,A,x){var I;for(I=0;I>>1)+(t&i)>>>0}function qt(t){return 0<=t&&256>t?t:0>t?0:255>1))}function Qt(t,i,u){return Math.abs(i-u)-Math.abs(t-u)}function te(t,i,u,d,m,b,L){for(d=b[L-1],u=0;u>8&255,x=16711935&(x=(x=16711935&L)+((A<<16)+A));d[m+b]=(4278255360&L)+x>>>0}}function fe(t,i){i.jd=t>>0&255,i.hd=t>>8&255,i.ud=t>>16&255}function Wt(t,i,u,d,m,b){var L;for(L=0;L>>8,I=A,U=255&(U=(U=A>>>16)+((t.jd<<24>>24)*(x<<24>>24)>>>5));I=255&(I=(I=I+((t.hd<<24>>24)*(x<<24>>24)>>>5))+((t.ud<<24>>24)*(U<<24>>24)>>>5)),m[b+L]=(4278255360&A)+(U<<16)+I}}function ee(t,i,u,d,m){z[i]=function(b,L,A,x,I,U,K,Z,G){for(x=K;x>b.b,G=b.Ea,vt=b.K[0],at=b.w;if(8>Z)for(b=(1<>=Z}else z["VP8LMapColor"+u](x,I,vt,at,U,K,L,A,G)}}function jt(t,i,u,d,m){for(u=i+u;i>16&255,d[m++]=b>>8&255,d[m++]=b>>0&255}}function Je(t,i,u,d,m){for(u=i+u;i>16&255,d[m++]=b>>8&255,d[m++]=b>>0&255,d[m++]=b>>24&255}}function oe(t,i,u,d,m){for(u=i+u;i>16&240|L>>12&15,L=L>>0&240|L>>28&15;d[m++]=b,d[m++]=L}}function _n(t,i,u,d,m){for(u=i+u;i>16&248|L>>13&7,L=L>>5&224|L>>3&31;d[m++]=b,d[m++]=L}}function pe(t,i,u,d,m){for(u=i+u;i>0&255,d[m++]=b>>8&255,d[m++]=b>>16&255}}function Le(t,i,u,d,m,b){if(b==0)for(u=i+u;i>24|b[1]>>8&65280|b[2]<<8&16711680|b[3]<<24)>>>0),m+=32;else a(d,m,t,i,u)}function Un(t,i){z[i][0]=z[t+"0"],z[i][1]=z[t+"1"],z[i][2]=z[t+"2"],z[i][3]=z[t+"3"],z[i][4]=z[t+"4"],z[i][5]=z[t+"5"],z[i][6]=z[t+"6"],z[i][7]=z[t+"7"],z[i][8]=z[t+"8"],z[i][9]=z[t+"9"],z[i][10]=z[t+"10"],z[i][11]=z[t+"11"],z[i][12]=z[t+"12"],z[i][13]=z[t+"13"],z[i][14]=z[t+"0"],z[i][15]=z[t+"0"]}function ce(t){return t==Vo||t==Go||t==Wa||t==Jo}function Or(){this.eb=[],this.size=this.A=this.fb=0}function Ae(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Pn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Or,this.f.kb=new Ae,this.sd=null}function nr(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function xe(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Jt(t){return alert("todo:WebPSamplerProcessPlane"),t.T}function ue(t,i){var u=t.T,d=i.ba.f.RGBA,m=d.eb,b=d.fb+t.ka*d.A,L=xn[i.ba.S],A=t.y,x=t.O,I=t.f,U=t.N,K=t.ea,Z=t.W,G=i.cc,vt=i.dc,at=i.Mc,H=i.Nc,V=t.ka,gt=t.ka+t.T,bt=t.U,mt=bt+1>>1;for(V==0?L(A,x,null,null,I,U,K,Z,I,U,K,Z,m,b,null,null,bt):(L(i.ec,i.fc,A,x,G,vt,at,H,I,U,K,Z,m,b-d.A,m,b,bt),++u);V+2u,m=u==za||u==Ua||u==Ha||u==Wo||u==12||ce(u);if(i.memory=null,i.Ib=null,i.Jb=null,i.Nd=null,!Ki(i.Oa,t,m?11:12))return 0;if(m&&ce(u)&&yt(),t.da)alert("todo:use_scaling");else{if(d){if(i.Ib=Jt,t.Kb){if(u=t.U+1>>1,i.memory=o(t.U+2*u),i.memory==null)return 0;i.ec=i.memory,i.fc=0,i.cc=i.ec,i.dc=i.fc+t.U,i.Mc=i.cc,i.Nc=i.dc+u,i.Ib=ue,yt()}}else alert("todo:EmitYUV");m&&(i.Jb=Br,d&&X())}if(d&&!Ts){for(t=0;256>t;++t)uu[t]=89858*(t-128)+Ga>>Va,fu[t]=-22014*(t-128)+Ga,hu[t]=-45773*(t-128),lu[t]=113618*(t-128)+Ga>>Va;for(t=aa;t>Va,du[t-aa]=dn(i,255),pu[t-aa]=dn(i+8>>4,15);Ts=1}return 1}function Hn(t){var i=t.ma,u=t.U,d=t.T;return e(!(1&t.ka)),0>=u||0>=d?0:(u=i.Ib(t,i),i.Jb!=null&&i.Jb(t,i,u),i.Dc+=u,1)}function Wn(t){t.ma.memory=null}function Tt(t,i,u,d){return pt(t,8)!=47?0:(i[0]=pt(t,14)+1,u[0]=pt(t,14)+1,d[0]=pt(t,1),pt(t,3)!=0?0:!t.h)}function kn(t,i){if(4>t)return t+1;var u=t-2>>1;return(2+(1&t)<>4)*t+(8-(15&u)))?u:1;var u}function an(t,i,u){var d=C(u),m=t[i+=255&d].g-8;return 0>>0,e(8>=u.g),t.g}function Be(t,i,u){var d=t.xc;return e((i=d==0?0:t.vc[t.md*(u>>d)+(i>>d)])>Pt.b)*St;atbt&&(ne=bt),(0,vr[se[le++]>>8&15])(Z,G+ +ae,V,gt+ae-bt,ne-ae,V,gt+ae),ae=ne}G+=bt,gt+=bt,++at&Bt||(Pt+=St)}K!=I.nc&&a(x,A-vt,x,A+(K-U-1)*vt,vt);break;case 1:for(vt=Z,H=G,bt=(Z=I.Ea)-(gt=Z&~(V=(G=1<>I.b)*at;U=m),0b.o&&(d=b.o),u=d?u=0:(m[0]+=4*b.v,b.ka=u-b.j,b.U=b.va-b.v,b.T=d-u,u=1),u){if(A=A[0],11>(u=t.ca).S){var U=u.f.RGBA,K=(d=u.S,m=b.U,b=b.T,I=U.eb,U.A),Z=b;for(U=U.fb+t.Ma*U.A;0d){var m=t.l.width,b=u.ca,L=u.tb+m*d,A=t.V,x=t.Ba+t.c*d,I=t.gc;e(t.ab==1),e(I[0].hc==3),Ma(I[0],d,i,A,x,b,L),Fn(u,d,i,b,L,m)}t.C=t.Ma=i}function Cn(t,i,u,d,m,b,L){var A=t.$/d,x=t.$%d,I=t.m,U=t.s,K=u+t.$,Z=K;m=u+d*m;var G=u+d*b,vt=280+U.ua,at=t.Pb?A:16777216,H=0=at){var Bt=K-u;e((at=t).Pb),at.wd=at.m,at.xd=Bt,0Rt.g?(T(mt,mt.u+Rt.g),Bt[St]=Rt.value,mt=0):(T(mt,mt.u+Rt.g-256),e(256<=Rt.value),mt=Rt.value),mt==0&&(bt=!0)}else mt=an(gt.G[0],gt.H[0],I);if(I.h)break;if(bt||256>mt){if(!bt)if(gt.nd)i[K]=(gt.qb|mt<<8)>>>0;else{if(J(I),bt=an(gt.G[1],gt.H[1],I),J(I),Bt=an(gt.G[2],gt.H[2],I),St=an(gt.G[3],gt.H[3],I),I.h)break;i[K]=(St<<24|bt<<16|mt<<8|Bt)>>>0}if(bt=!1,++K,++x>=d&&(x=0,++A,L!=null&&A<=b&&!(A%16)&&L(t,A),H!=null))for(;Z>>H.Mb]=mt}else if(280>mt){if(mt=kn(mt-256,I),Bt=an(gt.G[4],gt.H[4],I),J(I),Bt=Vn(d,Bt=kn(Bt,I)),I.h)break;if(K-u=d;)x-=d,++A,L!=null&&A<=b&&!(A%16)&&L(t,A);if(e(K<=m),x&V&&(gt=Be(U,x,A)),H!=null)for(;Z>>H.Mb]=mt}else{if(!(mt>>H.Mb]=mt;mt=K,e(!(bt>>>(Bt=H).Xa)),i[mt]=Bt.X[bt],bt=!0}bt||e(I.h==M(I))}if(t.Pb&&I.h&&Kb?b:A),t.a=0,t.$=K-u}return 1}return t.a=3,0}function Gn(t){e(t!=null),t.vc=null,t.yc=null,t.Ya=null;var i=t.Wa;i!=null&&(i.X=null),t.vb=null,e(t!=null)}function bn(){var t=new zo;return t==null?null:(t.a=0,t.xb=Bs,Un("Predictor","VP8LPredictors"),Un("Predictor","VP8LPredictors_C"),Un("PredictorAdd","VP8LPredictorsAdd"),Un("PredictorAdd","VP8LPredictorsAdd_C"),Ba=ie,Tr=Wt,cn=jt,en=Je,br=oe,or=_n,sr=pe,z.VP8LMapColor32b=mi,z.VP8LMapColor8b=Ea,t)}function Jn(t,i,u,d,m){var b=1,L=[t],A=[i],x=d.m,I=d.s,U=null,K=0;t:for(;;){if(u)for(;b&&pt(x,1);){var Z=L,G=A,vt=d,at=1,H=vt.m,V=vt.gc[vt.ab],gt=pt(H,2);if(vt.Oc&1<=vt.ab),gt){case 0:case 1:V.b=pt(H,3)+2,at=Jn(Et(V.Ea,V.b),Et(V.nc,V.b),0,vt,V.K),V.K=V.K[0];break;case 3:var bt,mt=pt(H,8)+1,Bt=16>Pt.b),le=o(se);if(le==null)bt=0;else{var ae=Pt.K[0],ne=Pt.w;for(le[0]=Pt.K[0][0],St=1;St<1*Rt;++St)le[St]=Lt(ae[ne+St],le[St-1]);for(;St<4*se;++St)le[St]=0;Pt.K[0]=null,Pt.K[0]=le,bt=1}}at=bt;break;case 2:break;default:e(0)}b=at}}if(L=L[0],A=A[0],b&&pt(x,1)&&!(b=1<=(K=pt(x,4))&&11>=K)){d.a=3;break t}var ge;if(ge=b)e:{var de,$t,Ee,un=d,qe=L,ln=A,he=K,gn=u,mn=un.m,ze=un.s,Ge=[null],rn=1,Sn=0,Zn=Kc[he];n:for(;;){if(gn&&pt(mn,1)){var Ue=pt(mn,3)+2,hr=Et(qe,Ue),Vr=Et(ln,Ue),Li=hr*Vr;if(!Jn(hr,Vr,0,un,Ge))break n;for(Ge=Ge[0],ze.xc=Ue,de=0;de>8&65535;Ge[de]=Ar,Ar>=rn&&(rn=Ar+1)}}if(mn.h)break n;for($t=0;5>$t;++$t){var _e=js[$t];!$t&&0=Hs),Ya=Ws;var oa=o(Sn);if(Ya==null||oa==null||Zo==null){un.a=1;break n}var Xa=Zo;for(de=Ee=0;de$t;++$t){_e=js[$t],Ni[$t]=Xa,Ai[$t]=Ee,!$t&&0eo)break r}else ts=eo;for(ca=0;caxi)Zs[ca++]=xi,xi!=0&&($s=xi);else{var xu=xi==16,ec=xi-16,Su=Gc[ec],nc=pt(Sr,Vc[ec])+Su;if(ca+nc>eo)break r;for(var _u=xu?$s:0;0=$t){var ua,ns=oa[0];for(ua=1;ua<_e;++ua)oa[ua]>ns&&(ns=oa[ua]);Gs+=ns}}if(En.nd=Ka,En.Qb=0,Ka&&(En.qb=(Ni[3][Ai[3]+0].value<<24|Ni[1][Ai[1]+0].value<<16|Ni[2][Ai[2]+0].value)>>>0,Vs==0&&256>Ni[0][Ai[0]+0].value&&(En.Qb=1,En.qb+=Ni[0][Ai[0]+0].value<<8)),En.jc=!En.Qb&&6>Gs,En.jc){var no,fr=En;for(no=0;no>=De(ro,8,Pr),_r>>=De(fr.G[1][fr.H[1]+_r],16,Pr),_r>>=De(fr.G[2][fr.H[2]+_r],0,Pr),De(fr.G[3][fr.H[3]+_r],24,Pr))}}}ze.vc=Ge,ze.Wb=rn,ze.Ya=Ya,ze.yc=Zo,ge=1;break e}ge=0}if(!(b=ge)){d.a=3;break t}if(0d+1?[]:0),!(m.lengthm)return ke(t,7,"Truncated header.");var b=u[d+0]|u[d+1]<<8|u[d+2]<<16,L=t.Od;if(L.Rb=!(1&b),L.td=b>>1&7,L.yd=b>>4&1,L.ub=b>>5,3m)return ke(t,7,"cannot parse picture header");if(!va(u,d,m))return ke(t,3,"Bad code word");A.c=16383&(u[d+4]<<8|u[d+3]),A.Td=u[d+4]>>6,A.i=16383&(u[d+6]<<8|u[d+5]),A.Ud=u[d+6]>>6,d+=7,m-=7,t.za=A.c+15>>4,t.Ub=A.i+15>>4,i.width=A.c,i.height=A.i,i.Da=0,i.j=0,i.v=0,i.va=i.width,i.o=i.height,i.da=0,i.ib=i.width,i.hb=i.height,i.U=i.width,i.T=i.height,c((b=t.Pa).jb,0,255,b.jb.length),e((b=t.Qa)!=null),b.Cb=0,b.Bb=0,b.Fb=1,c(b.Zb,0,0,b.Zb.length),c(b.Lb,0,0,b.Lb)}if(L.ub>m)return ke(t,7,"bad partition length");st(b=t.m,u,d,L.ub),d+=L.ub,m-=L.ub,L.Rb&&(A.Ld=et(b),A.Kd=et(b)),A=t.Qa;var x,I=t.Pa;if(e(b!=null),e(A!=null),A.Cb=et(b),A.Cb){if(A.Bb=et(b),et(b)){for(A.Fb=et(b),x=0;4>x;++x)A.Zb[x]=et(b)?lt(b,7):0;for(x=0;4>x;++x)A.Lb[x]=et(b)?lt(b,6):0}if(A.Bb)for(x=0;3>x;++x)I.jb[x]=et(b)?it(b,8):255}else A.Bb=0;if(b.Ka)return ke(t,3,"cannot parse segment header");if((A=t.ed).zd=et(b),A.Tb=it(b,6),A.wb=it(b,3),A.Pc=et(b),A.Pc&&et(b)){for(I=0;4>I;++I)et(b)&&(A.vd[I]=lt(b,6));for(I=0;4>I;++I)et(b)&&(A.od[I]=lt(b,6))}if(t.L=A.Tb==0?0:A.zd?1:2,b.Ka)return ke(t,3,"cannot parse filter header");var U=m;if(m=x=d,d=x+U,A=U,t.Xb=(1<A&&(K=A),st(t.Jc[+U],u,x,K),x+=K,A-=K,m+=3}st(t.Jc[+I],u,x,A),u=xK;++K){if(U.Cb){var Z=U.Zb[K];U.Fb||(Z+=u)}else{if(0>16,8>G.Eb[1]&&(G.Eb[1]=8),G.Qc[0]=Yo[dn(Z+I,117)],G.Qc[1]=Xo[dn(Z+x,127)],G.lc=Z+x}if(!L.Rb)return ke(t,4,"Not a key frame.");for(et(b),L=t.Pa,u=0;4>u;++u){for(m=0;8>m;++m)for(d=0;3>d;++d)for(A=0;11>A;++A)I=nt(b,nu[u][m][d][A])?it(b,8):tu[u][m][d][A],L.Wc[u][m].Yb[d][A]=I;for(m=0;17>m;++m)L.Xc[u][m]=L.Wc[u][ru[m]]}return t.kc=et(b),t.kc&&(t.Bd=it(b,8)),t.cb=1}function ya(t,i,u,d,m,b,L){var A=i[m].Yb[u];for(u=0;16>m;++m){if(!nt(t,A[u+0]))return m;for(;!nt(t,A[u+1]);)if(A=i[++m].Yb[0],u=0,m==16)return 16;var x=i[m+1].Yb;if(nt(t,A[u+2])){var I=t,U=0;if(nt(I,(Z=A)[(K=u)+3]))if(nt(I,Z[K+6])){for(A=0,K=2*(U=nt(I,Z[K+8]))+(Z=nt(I,Z[K+9+U])),U=0,Z=$c[K];Z[A];++A)U+=U+nt(I,Z[A]);U+=3+(8<(I=t).b&&Q(I);var K,Z=I.b,G=(K=I.Ca>>1)-(I.I>>Z)>>31;--I.b,I.Ca+=G,I.Ca|=1,I.I-=(K+1&G)<>4,t.zb=i.j-u>>4,0>t.yb&&(t.yb=0),0>t.zb&&(t.zb=0)),t.Va=i.o+15+u>>4,t.Hb=i.va+15+u>>4,t.Hb>t.za&&(t.Hb=t.za),t.Va>t.Ub&&(t.Va=t.Ub),0u;++u){var m;if(t.Qa.Cb){var b=t.Qa.Lb[u];t.Qa.Fb||(b+=d.Tb)}else b=d.Tb;for(m=0;1>=m;++m){var L=t.gd[u][m],A=b;if(d.Pc&&(A+=d.vd[0],m&&(A+=d.od[0])),0<(A=0>A?0:63>2:x>>1)>9-d.wb&&(x=9-d.wb),1>x&&(x=1),L.dd=x,L.tc=2*A+x,L.ld=40<=A?2:15<=A?1:0}else L.tc=0;L.La=m}}}u=0}else ke(t,6,"Frame setup failed"),u=t.a;if(u=u==0){if(u){t.$c=0,0t.Vb){if(t.Vb=0,t.Ec=o(L),t.Fc=0,t.Ec==null){u=ke(t,1,"no memory during frame initialization.");break t}t.Vb=L}L=t.Ec,A=t.Fc,t.Ac=L,t.Bc=A,A+=d,t.Gd=l(I,ma),t.Hd=0,t.rb=l(U+1,ga),t.sb=1,t.wa=K?l(K,ei):null,t.Y=0,t.D.Nb=0,t.D.wa=t.wa,t.D.Y=t.Y,0=u;++u)Re[255+u]=0>u?-u:u;for(u=-1020;1020>=u;++u)ur[1020+u]=-128>u?-128:127=u;++u)ra[112+u]=-16>u?-16:15=u;++u)wi[255+u]=0>u?0:255mt;++mt){var ae,ne=Rt[0+mt];for(ae=0;4>ae;++ae){ne=eu[Bt[St+ae]][ne];for(var ge=Os[nt(bt,ne[0])];0>3;for(ge=0;256>ge;ge+=16)mt[se+ge]=ln}Ee=1,un=St[0]}var he=15&bt.la,gn=15&le.la;for(ge=0;4>ge;++ge){var mn=1&gn;for(ln=$t=0;4>ln;++ln)he=he>>1|(mn=(qe=ia(Bt,un,qe=mn+(1&he),Pt.Sc,Ee,mt,se))>Ee)<<7,$t=$t<<2|(3>=4,gn=gn>>1|mn<<7,ae=(ae<<8|$t)>>>0}for(un=he,Ee=gn>>4,de=0;4>de;de+=2){for($t=0,he=bt.la>>4+de,gn=le.la>>4+de,ge=0;2>ge;++ge){for(mn=1&gn,ln=0;2>ln;++ln)qe=mn+(1&he),he=he>>1|(mn=0<(qe=ia(Bt,St[2],qe,Pt.Qc,0,mt,se)))<<3,$t=$t<<2|(3>=2,gn=gn>>1|mn<<5}ne|=$t<<4*de,un|=he<<4<=H.zb&&H.M<=H.Va,H.Aa==0)t:{if(at.M=H.M,at.uc=bt,Xi(H,at),gt=1,at=($t=H.D).Nb,bt=(ne=Ja[H.L])*H.R,Bt=ne/2*H.B,ge=16*at*H.R,ln=8*at*H.B,St=H.sa,Rt=H.ta-bt+ge,Pt=H.qa,mt=H.ra-Bt+ln,se=H.Ha,le=H.Ia-Bt+ln,gn=(he=$t.M)==0,ae=he>=H.Va-1,H.Aa==2&&Xi(H,$t),$t.uc)for(mn=(qe=H).D.M,e(qe.D.uc),$t=qe.yb;$tV.o&&(he=V.o),V.F=null,V.J=null,H.Fa!=null&&0>1),V.W+=H.B*(ne>>1),V.F!=null&&(V.J+=V.width*ne)),$t>1,V.W+=V.v>>1,V.F!=null&&(V.J+=V.v),V.ka=$t-V.j,V.U=V.va-V.v,V.T=he-$t,gt=V.put(V))}at+1!=H.Ic||ae||(a(H.sa,H.ta-bt,St,Rt+16*H.R,bt),a(H.qa,H.ra-Bt,Pt,mt+8*H.B,Bt),a(H.Ha,H.Ia-Bt,se,le+8*H.B,Bt))}if(!gt)return ke(G,6,"Output aborted.")}return 1}(t,i)),i.bc!=null&&i.bc(i),u&=1}return u?(t.cb=0,u):0}function jn(t,i,u,d,m){m=t[i+u+32*d]+(m>>3),t[i+u+32*d]=-256&m?0>m?0:255:m}function ri(t,i,u,d,m,b){jn(t,i,0,u,d+m),jn(t,i,1,u,d+b),jn(t,i,2,u,d-b),jn(t,i,3,u,d-m)}function on(t){return(20091*t>>16)+t}function Ei(t,i,u,d){var m,b=0,L=o(16);for(m=0;4>m;++m){var A=t[i+0]+t[i+8],x=t[i+0]-t[i+8],I=(35468*t[i+4]>>16)-on(t[i+12]),U=on(t[i+4])+(35468*t[i+12]>>16);L[b+0]=A+U,L[b+1]=x+I,L[b+2]=x-I,L[b+3]=A-U,b+=4,i++}for(m=b=0;4>m;++m)A=(t=L[b+0]+4)+L[b+8],x=t-L[b+8],I=(35468*L[b+4]>>16)-on(L[b+12]),jn(u,d,0,0,A+(U=on(L[b+4])+(35468*L[b+12]>>16))),jn(u,d,1,0,x+I),jn(u,d,2,0,x-I),jn(u,d,3,0,A-U),b++,d+=32}function wa(t,i,u,d){var m=t[i+0]+4,b=35468*t[i+4]>>16,L=on(t[i+4]),A=35468*t[i+1]>>16;ri(u,d,0,m+L,t=on(t[i+1]),A),ri(u,d,1,m+b,t,A),ri(u,d,2,m-b,t,A),ri(u,d,3,m-L,t,A)}function So(t,i,u,d,m){Ei(t,i,u,d),m&&Ei(t,i+16,u,d+4)}function La(t,i,u,d){cr(t,i+0,u,d,1),cr(t,i+32,u,d+128,1)}function _o(t,i,u,d){var m;for(t=t[i+0]+4,m=0;4>m;++m)for(i=0;4>i;++i)jn(u,d,i,m,t)}function Na(t,i,u,d){t[i+0]&&nn(t,i+0,u,d),t[i+16]&&nn(t,i+16,u,d+4),t[i+32]&&nn(t,i+32,u,d+128),t[i+48]&&nn(t,i+48,u,d+128+4)}function Po(t,i,u,d){var m,b=o(16);for(m=0;4>m;++m){var L=t[i+0+m]+t[i+12+m],A=t[i+4+m]+t[i+8+m],x=t[i+4+m]-t[i+8+m],I=t[i+0+m]-t[i+12+m];b[0+m]=L+A,b[8+m]=L-A,b[4+m]=I+x,b[12+m]=I-x}for(m=0;4>m;++m)L=(t=b[0+4*m]+3)+b[3+4*m],A=b[1+4*m]+b[2+4*m],x=b[1+4*m]-b[2+4*m],I=t-b[3+4*m],u[d+0]=L+A>>3,u[d+16]=I+x>>3,u[d+32]=L-A>>3,u[d+48]=I-x>>3,d+=64}function qi(t,i,u){var d,m=i-32,b=pn,L=255-t[m-1];for(d=0;du;++u)a(t,i+32*u,t,i-32,16)}function ii(t,i){var u;for(u=16;0d;++d)c(i,u+32*d,t,16)}function Aa(t,i){var u,d=16;for(u=0;16>u;++u)d+=t[i-1+32*u]+t[i+u-32];ai(d>>5,t,i)}function Ye(t,i){var u,d=8;for(u=0;16>u;++u)d+=t[i-1+32*u];ai(d>>4,t,i)}function Co(t,i){var u,d=8;for(u=0;16>u;++u)d+=t[i+u-32];ai(d>>4,t,i)}function xa(t,i){ai(128,t,i)}function Vt(t,i,u){return t+2*i+u+2>>2}function jo(t,i){var u,d=i-32;for(d=new Uint8Array([Vt(t[d-1],t[d+0],t[d+1]),Vt(t[d+0],t[d+1],t[d+2]),Vt(t[d+1],t[d+2],t[d+3]),Vt(t[d+2],t[d+3],t[d+4])]),u=0;4>u;++u)a(t,i+32*u,d,0,d.length)}function Oo(t,i){var u=t[i-1],d=t[i-1+32],m=t[i-1+64],b=t[i-1+96];At(t,i+0,16843009*Vt(t[i-1-32],u,d)),At(t,i+32,16843009*Vt(u,d,m)),At(t,i+64,16843009*Vt(d,m,b)),At(t,i+96,16843009*Vt(m,b,b))}function Yn(t,i){var u,d=4;for(u=0;4>u;++u)d+=t[i+u-32]+t[i-1+32*u];for(d>>=3,u=0;4>u;++u)c(t,i+32*u,d,4)}function Sa(t,i){var u=t[i-1+0],d=t[i-1+32],m=t[i-1+64],b=t[i-1-32],L=t[i+0-32],A=t[i+1-32],x=t[i+2-32],I=t[i+3-32];t[i+0+96]=Vt(d,m,t[i-1+96]),t[i+1+96]=t[i+0+64]=Vt(u,d,m),t[i+2+96]=t[i+1+64]=t[i+0+32]=Vt(b,u,d),t[i+3+96]=t[i+2+64]=t[i+1+32]=t[i+0+0]=Vt(L,b,u),t[i+3+64]=t[i+2+32]=t[i+1+0]=Vt(A,L,b),t[i+3+32]=t[i+2+0]=Vt(x,A,L),t[i+3+0]=Vt(I,x,A)}function _a(t,i){var u=t[i+1-32],d=t[i+2-32],m=t[i+3-32],b=t[i+4-32],L=t[i+5-32],A=t[i+6-32],x=t[i+7-32];t[i+0+0]=Vt(t[i+0-32],u,d),t[i+1+0]=t[i+0+32]=Vt(u,d,m),t[i+2+0]=t[i+1+32]=t[i+0+64]=Vt(d,m,b),t[i+3+0]=t[i+2+32]=t[i+1+64]=t[i+0+96]=Vt(m,b,L),t[i+3+32]=t[i+2+64]=t[i+1+96]=Vt(b,L,A),t[i+3+64]=t[i+2+96]=Vt(L,A,x),t[i+3+96]=Vt(A,x,x)}function oi(t,i){var u=t[i-1+0],d=t[i-1+32],m=t[i-1+64],b=t[i-1-32],L=t[i+0-32],A=t[i+1-32],x=t[i+2-32],I=t[i+3-32];t[i+0+0]=t[i+1+64]=b+L+1>>1,t[i+1+0]=t[i+2+64]=L+A+1>>1,t[i+2+0]=t[i+3+64]=A+x+1>>1,t[i+3+0]=x+I+1>>1,t[i+0+96]=Vt(m,d,u),t[i+0+64]=Vt(d,u,b),t[i+0+32]=t[i+1+96]=Vt(u,b,L),t[i+1+32]=t[i+2+96]=Vt(b,L,A),t[i+2+32]=t[i+3+96]=Vt(L,A,x),t[i+3+32]=Vt(A,x,I)}function Di(t,i){var u=t[i+0-32],d=t[i+1-32],m=t[i+2-32],b=t[i+3-32],L=t[i+4-32],A=t[i+5-32],x=t[i+6-32],I=t[i+7-32];t[i+0+0]=u+d+1>>1,t[i+1+0]=t[i+0+64]=d+m+1>>1,t[i+2+0]=t[i+1+64]=m+b+1>>1,t[i+3+0]=t[i+2+64]=b+L+1>>1,t[i+0+32]=Vt(u,d,m),t[i+1+32]=t[i+0+96]=Vt(d,m,b),t[i+2+32]=t[i+1+96]=Vt(m,b,L),t[i+3+32]=t[i+2+96]=Vt(b,L,A),t[i+3+64]=Vt(L,A,x),t[i+3+96]=Vt(A,x,I)}function Bo(t,i){var u=t[i-1+0],d=t[i-1+32],m=t[i-1+64],b=t[i-1+96];t[i+0+0]=u+d+1>>1,t[i+2+0]=t[i+0+32]=d+m+1>>1,t[i+2+32]=t[i+0+64]=m+b+1>>1,t[i+1+0]=Vt(u,d,m),t[i+3+0]=t[i+1+32]=Vt(d,m,b),t[i+3+32]=t[i+1+64]=Vt(m,b,b),t[i+3+64]=t[i+2+64]=t[i+0+96]=t[i+1+96]=t[i+2+96]=t[i+3+96]=b}function Mo(t,i){var u=t[i-1+0],d=t[i-1+32],m=t[i-1+64],b=t[i-1+96],L=t[i-1-32],A=t[i+0-32],x=t[i+1-32],I=t[i+2-32];t[i+0+0]=t[i+2+32]=u+L+1>>1,t[i+0+32]=t[i+2+64]=d+u+1>>1,t[i+0+64]=t[i+2+96]=m+d+1>>1,t[i+0+96]=b+m+1>>1,t[i+3+0]=Vt(A,x,I),t[i+2+0]=Vt(L,A,x),t[i+1+0]=t[i+3+32]=Vt(u,L,A),t[i+1+32]=t[i+3+64]=Vt(d,u,L),t[i+1+64]=t[i+3+96]=Vt(m,d,u),t[i+1+96]=Vt(b,m,d)}function Eo(t,i){var u;for(u=0;8>u;++u)a(t,i+32*u,t,i-32,8)}function Ri(t,i){var u;for(u=0;8>u;++u)c(t,i,t[i-1],8),i+=32}function Er(t,i,u){var d;for(d=0;8>d;++d)c(i,u+32*d,t,8)}function pr(t,i){var u,d=8;for(u=0;8>u;++u)d+=t[i+u-32]+t[i-1+32*u];Er(d>>4,t,i)}function qo(t,i){var u,d=4;for(u=0;8>u;++u)d+=t[i+u-32];Er(d>>3,t,i)}function qr(t,i){var u,d=4;for(u=0;8>u;++u)d+=t[i-1+32*u];Er(d>>3,t,i)}function Ti(t,i){Er(128,t,i)}function si(t,i,u){var d=t[i-u],m=t[i+0],b=3*(m-d)+Ho[1020+t[i-2*u]-t[i+u]],L=Ra[112+(b+4>>3)];t[i-u]=pn[255+d+Ra[112+(b+3>>3)]],t[i+0]=pn[255+m-L]}function Pa(t,i,u,d){var m=t[i+0],b=t[i+u];return An[255+t[i-2*u]-t[i-u]]>d||An[255+b-m]>d}function ka(t,i,u,d){return 4*An[255+t[i-u]-t[i+0]]+An[255+t[i-2*u]-t[i+u]]<=d}function Fa(t,i,u,d,m){var b=t[i-3*u],L=t[i-2*u],A=t[i-u],x=t[i+0],I=t[i+u],U=t[i+2*u],K=t[i+3*u];return 4*An[255+A-x]+An[255+L-I]>d?0:An[255+t[i-4*u]-b]<=m&&An[255+b-L]<=m&&An[255+L-A]<=m&&An[255+K-U]<=m&&An[255+U-I]<=m&&An[255+I-x]<=m}function Ia(t,i,u,d){var m=2*d+1;for(d=0;16>d;++d)ka(t,i+d,u,m)&&si(t,i+d,u)}function Xn(t,i,u,d){var m=2*d+1;for(d=0;16>d;++d)ka(t,i+d*u,1,m)&&si(t,i+d*u,1)}function ar(t,i,u,d){var m;for(m=3;0>7,V=18*gt+63>>7,gt=9*gt+63>>7;x[I-3*U]=pn[255+x[I-3*U]+gt],x[I-2*U]=pn[255+K+V],x[I-U]=pn[255+Z+H],x[I+0]=pn[255+G-H],x[I+U]=pn[255+vt-V],x[I+2*U]=pn[255+at-gt]}i+=d}}function On(t,i,u,d,m,b,L,A){for(b=2*b+1;0>3)],at=Ra[112+(at+3>>3)],H=vt+1>>1;x[I-2*U]=pn[255+x[I-2*U]+H],x[I-U]=pn[255+K+at],x[I+0]=pn[255+Z-vt],x[I+U]=pn[255+G-H]}i+=d}}function zi(t,i,u,d,m,b){gr(t,i,u,1,16,d,m,b)}function Dr(t,i,u,d,m,b){gr(t,i,1,u,16,d,m,b)}function Ro(t,i,u,d,m,b){var L;for(L=3;0I?0:255:I)&255,I=x,m[b+A]=U}}function Ji(t,i,u,d){var m=i.width,b=i.o;if(e(t!=null&&i!=null),0>u||0>=d||u+d>b)return null;if(!t.Cc){if(t.ga==null){var L;if(t.ga=new li,(L=t.ga==null)||(L=i.width*i.o,e(t.Gb.length==0),t.Gb=o(L),t.Uc=0,t.Gb==null?L=0:(t.mb=t.Gb,t.nb=t.Uc,t.rc=null,L=1),L=!L),!L){L=t.ga;var A=t.Fa,x=t.P,I=t.qc,U=t.mb,K=t.nb,Z=x+1,G=I-1,vt=L.l;if(e(A!=null&&U!=null&&i!=null),Nr[0]=null,Nr[1]=Rr,Nr[2]=Gi,Nr[3]=mr,L.ca=U,L.tb=K,L.c=i.width,L.i=i.height,e(0=I)i=0;else if(L.$a=A[x+0]>>0&3,L.Z=A[x+0]>>2&3,L.Lc=A[x+0]>>4&3,x=A[x+0]>>6&3,0>L.$a||1=L.c*L.i;L=!i}if(L)return null;t.ga.Lc!=1?t.Ga=0:d=b-u}e(t.ga!=null),e(u+d<=b);t:{if(i=(A=t.ga).c,b=A.l.o,A.$a==0){if(Z=t.rc,G=t.Vc,vt=t.Fa,x=t.P+1+u*i,I=t.mb,U=t.nb+u*i,e(x<=t.P+t.qc),A.Z!=0)for(e(Nr[A.Z]!=null),L=0;L=i)i=1;else if(A.ic||X(),A.ic){A=L.V,Z=L.Ba,G=L.c;var at=L.i,H=(vt=1,x=L.$/G,I=L.$%G,U=L.m,K=L.s,L.$),V=G*at,gt=G*i,bt=K.wc,mt=H(at=an(mt.G[0],mt.H[0],U)))A[Z+H]=at,++H,++I>=G&&(I=0,++x<=i&&!(x%16)&&In(L,x));else{if(!(280>at)){vt=0;break e}at=kn(at-256,U);var Bt,St=an(mt.G[4],mt.H[4],U);if(J(U),!(H>=(St=Vn(G,St=kn(St,U)))&&V-H>=at)){vt=0;break e}for(Bt=0;Bt=G;)I-=G,++x<=i&&!(x%16)&&In(L,x);Hi?i:x);break e}!vt||U.h&&H=b&&(t.Cc=1),d=1}if(!d)return null;if(t.Cc&&((d=t.ga)!=null&&(d.mc=null),t.ga=null,0>23,A[x+4*L+1]=A[x+4*L+1]*K>>23,A[x+4*L+2]=A[x+4*L+2]*K>>23)}i+=b}}function v(t,i,u,d,m){for(;0>4)*x>>16;t[i+2*b+0]=(240&L|L>>4)*x>>16&240|(15&L|L<<4)*x>>16>>4&15,t[i+2*b+1]=240&I|A}i+=m}}function j(t,i,u,d,m,b,L,A){var x,I,U=255;for(I=0;I>8}function X(){Nn=s,be=v,ye=j,Ie=R}function ct(t,i,u){z[t]=function(d,m,b,L,A,x,I,U,K,Z,G,vt,at,H,V,gt,bt){var mt,Bt=bt-1>>1,St=A[x+0]|I[U+0]<<16,Rt=K[Z+0]|G[vt+0]<<16;e(d!=null);var Pt=3*St+Rt+131074>>2;for(i(d[m+0],255&Pt,Pt>>16,at,H),b!=null&&(Pt=3*Rt+St+131074>>2,i(b[L+0],255&Pt,Pt>>16,V,gt)),mt=1;mt<=Bt;++mt){var se=A[x+mt]|I[U+mt]<<16,le=K[Z+mt]|G[vt+mt]<<16,ae=St+se+Rt+le+524296,ne=ae+2*(se+Rt)>>3;Pt=ne+St>>1,St=(ae=ae+2*(St+le)>>3)+se>>1,i(d[m+2*mt-1],255&Pt,Pt>>16,at,H+(2*mt-1)*u),i(d[m+2*mt-0],255&St,St>>16,at,H+(2*mt-0)*u),b!=null&&(Pt=ae+Rt>>1,St=ne+le>>1,i(b[L+2*mt-1],255&Pt,Pt>>16,V,gt+(2*mt-1)*u),i(b[L+2*mt+0],255&St,St>>16,V,gt+(2*mt+0)*u)),St=se,Rt=le}1&bt||(Pt=3*St+Rt+131074>>2,i(d[m+bt-1],255&Pt,Pt>>16,at,H+(bt-1)*u),b!=null&&(Pt=3*Rt+St+131074>>2,i(b[L+bt-1],255&Pt,Pt>>16,V,gt+(bt-1)*u)))}}function yt(){xn[Ta]=au,xn[za]=Ms,xn[Is]=ou,xn[Ua]=Es,xn[Ha]=qs,xn[Wo]=Ds,xn[Cs]=su,xn[Vo]=Ms,xn[Go]=Es,xn[Wa]=qs,xn[Jo]=Ds}function Ot(t){return t&~cu?0>t?0:255:t>>Rs}function Dt(t,i){return Ot((19077*t>>8)+(26149*i>>8)-14234)}function Zt(t,i,u){return Ot((19077*t>>8)-(6419*i>>8)-(13320*u>>8)+8708)}function Yt(t,i){return Ot((19077*t>>8)+(33050*i>>8)-17685)}function re(t,i,u,d,m){d[m+0]=Dt(t,u),d[m+1]=Zt(t,i,u),d[m+2]=Yt(t,i)}function Ne(t,i,u,d,m){d[m+0]=Yt(t,i),d[m+1]=Zt(t,i,u),d[m+2]=Dt(t,u)}function Se(t,i,u,d,m){var b=Zt(t,i,u);i=b<<3&224|Yt(t,i)>>3,d[m+0]=248&Dt(t,u)|b>>5,d[m+1]=i}function Me(t,i,u,d,m){var b=240&Yt(t,i)|15;d[m+0]=240&Dt(t,u)|Zt(t,i,u)>>4,d[m+1]=b}function Xe(t,i,u,d,m){d[m+0]=255,re(t,i,u,d,m+1)}function Te(t,i,u,d,m){Ne(t,i,u,d,m),d[m+3]=255}function Bn(t,i,u,d,m){re(t,i,u,d,m),d[m+3]=255}function dn(t,i){return 0>t?0:t>i?i:t}function Kn(t,i,u){z[t]=function(d,m,b,L,A,x,I,U,K){for(var Z=U+(-2&K)*u;U!=Z;)i(d[m+0],b[L+0],A[x+0],I,U),i(d[m+1],b[L+0],A[x+0],I,U+u),m+=2,++L,++x,U+=2*u;1&K&&i(d[m+0],b[L+0],A[x+0],I,U)}}function Oa(t,i,u){return u==0?t==0?i==0?6:5:i==0?4:0:u}function Yi(t,i,u,d,m){switch(t>>>30){case 3:cr(i,u,d,m,0);break;case 2:Fe(i,u,d,m);break;case 1:nn(i,u,d,m)}}function Xi(t,i){var u,d,m=i.M,b=i.Nb,L=t.oc,A=t.pc+40,x=t.oc,I=t.pc+584,U=t.oc,K=t.pc+600;for(u=0;16>u;++u)L[A+32*u-1]=129;for(u=0;8>u;++u)x[I+32*u-1]=129,U[K+32*u-1]=129;for(0u;++u)a(L,A+32*u-4,L,A+32*u+12,4);for(u=-1;8>u;++u)a(x,I+32*u-4,x,I+32*u+4,4),a(U,K+32*u-4,U,K+32*u+4,4)}var G=t.Gd,vt=t.Hd+d,at=Z.ad,H=Z.Hc;if(0=t.za-1?c(V,gt,G[vt].y[15],4):a(V,gt,G[vt+1].y,0,4)),u=0;4>u;u++)V[gt+128+u]=V[gt+256+u]=V[gt+384+u]=V[gt+0+u];for(u=0;16>u;++u,H<<=2)V=L,gt=A+zs[u],Mn[Z.Ob[u]](V,gt),Yi(H,at,16*+u,V,gt)}else if(V=Oa(d,m,Z.Ob[0]),Lr[V](L,A),H!=0)for(u=0;16>u;++u,H<<=2)Yi(H,at,16*+u,L,A+zs[u]);for(u=Z.Gc,V=Oa(d,m,Z.Dd),lr[V](x,I),lr[V](U,K),H=at,V=x,gt=I,255&(Z=u>>0)&&(170&Z?ta(H,256,V,gt):wn(H,256,V,gt)),Z=U,H=K,255&(u>>=8)&&(170&u?ta(at,320,Z,H):wn(at,320,Z,H)),mu;++u)a(G,vt+u*t.R,L,A+32*u,16);for(u=0;8>u;++u)a(at,Z+u*t.B,x,I+32*u,8),a(H,V+u*t.B,U,K+32*u,8)}}function hi(t,i,u,d,m,b,L,A,x){var I=[0],U=[0],K=0,Z=x!=null?x.kd:0,G=x??new Wi;if(t==null||12>u)return 7;G.data=t,G.w=i,G.ha=u,i=[i],u=[u],G.gb=[G.gb];t:{var vt=i,at=u,H=G.gb;if(e(t!=null),e(at!=null),e(H!=null),H[0]=0,12<=at[0]&&!n(t,vt[0],"RIFF")){if(n(t,vt[0]+8,"WEBP")){H=3;break t}var V=_t(t,vt[0]+4);if(12>V||4294967286at[0]-8){H=7;break t}H[0]=V,vt[0]+=12,at[0]-=12}H=0}if(H!=0)return H;for(V=0H[0])H=7;else{if(!n(gt,at[0],"VP8X")){if(_t(gt,at[0]+4)!=10){H=3;break t}if(18>H[0]){H=7;break t}var St=_t(gt,at[0]+8),Rt=1+Ft(gt,at[0]+12);if(2147483648<=Rt*(gt=1+Ft(gt,at[0]+15))){H=3;break t}Bt!=null&&(Bt[0]=St),bt!=null&&(bt[0]=Rt),mt!=null&&(mt[0]=gt),at[0]+=18,H[0]-=18,Pt[0]=1}H=0}}if(K=K[0],vt=vt[0],H!=0)return H;if(at=!!(2&vt),!V&&K)return 3;if(b!=null&&(b[0]=!!(16&vt)),L!=null&&(L[0]=at),A!=null&&(A[0]=0),L=I[0],vt=U[0],K&&at&&x==null){H=0;break}if(4>u){H=7;break}if(V&&K||!V&&!K&&!n(t,i[0],"ALPH")){u=[u],G.na=[G.na],G.P=[G.P],G.Sa=[G.Sa];t:{St=t,H=i,V=u;var Pt=G.gb;bt=G.na,mt=G.P,Bt=G.Sa,Rt=22,e(St!=null),e(V!=null),gt=H[0];var se=V[0];for(e(bt!=null),e(Bt!=null),bt[0]=null,mt[0]=null,Bt[0]=0;;){if(H[0]=gt,V[0]=se,8>se){H=7;break t}var le=_t(St,gt+4);if(4294967286Pt){H=3;break t}if(!n(St,gt,"VP8 ")||!n(St,gt,"VP8L")){H=0;break t}if(se[0]V[0])H=7;else{if(gt||Rt){if(Pt=_t(Pt,St+4),12<=bt&&Pt>bt-12){H=3;break t}if(Z&&Pt>V[0]-8){H=7;break t}mt[0]=Pt,H[0]+=8,V[0]-=8,Bt[0]=Rt}else Bt[0]=5<=V[0]&&Pt[St+0]==47&&!(Pt[St+4]>>5),mt[0]=V[0];H=0}if(u=u[0],G.Ja=G.Ja[0],G.xa=G.xa[0],i=i[0],H!=0)break;if(4294967286u){H=7;break}A=L,Z=vt,at=b,t==null||5>u?t=0:5<=u&&t[i+0]==47&&!(t[i+4]>>5)?(V=[0],Pt=[0],bt=[0],$(mt=new N,t,i,u),Tt(mt,V,Pt,bt)?(A!=null&&(A[0]=V[0]),Z!=null&&(Z[0]=Pt[0]),at!=null&&(at[0]=bt[0]),t=1):t=0):t=0}else{if(10>u){H=7;break}A=vt,t==null||10>u||!va(t,i+3,u-3)?t=0:(Z=t[i+0]|t[i+1]<<8|t[i+2]<<16,at=16383&(t[i+7]<<8|t[i+6]),t=16383&(t[i+9]<<8|t[i+8]),1&Z||3<(Z>>1&7)||!(Z>>4&1)||Z>>5>=G.Ja||!at||!t?t=0:(L&&(L[0]=at),A&&(A[0]=t),t=1))}if(!t||(L=L[0],vt=vt[0],K&&(I[0]!=L||U[0]!=vt)))return 3;x!=null&&(x[0]=G,x.offset=i-x.w,e(4294967286>i-x.w),e(x.offset==x.ha-u));break}return H==0||H==7&&K&&x==null?(b!=null&&(b[0]|=G.na!=null&&0u||(b&=-2,L&=-2),0>b||0>L||0>=A||0>=x||b+A>d||L+x>m))return 0;if(i.v=b,i.j=L,i.va=b+A,i.o=L+x,i.U=A,i.T=x,i.da=t!=null&&0t.S){var i=t.f.RGBA;i.fb+=(t.height-1)*i.A,i.A=-i.A}else i=t.f.kb,t=t.height,i.O+=(t-1)*i.fa,i.fa=-i.fa,i.N+=(t-1>>1)*i.Ab,i.Ab=-i.Ab,i.W+=(t-1>>1)*i.Db,i.Db=-i.Db,i.F!=null&&(i.J+=(t-1)*i.lb,i.lb=-i.lb);return 0}function fi(t,i,u,d){if(d==null||0>=t||0>=i)return 2;if(u!=null){if(u.Da){var m=u.cd,b=u.bd,L=-2&u.v,A=-2&u.j;if(0>L||0>A||0>=m||0>=b||L+m>t||A+b>i)return 2;t=m,i=b}if(u.da){if(!Kt(t,i,m=[u.ib],b=[u.hb]))return 2;t=m[0],i=b[0]}}d.width=t,d.height=i;t:{var x=d.width,I=d.height;if(t=d.S,0>=x||0>=I||!(t>=Ta&&13>t))t=2;else{if(0>=d.Rd&&d.sd==null){L=b=m=i=0;var U=(A=x*Us[t])*I;if(11>t||(b=(I+1)/2*(i=(x+1)/2),t==12&&(L=(m=x)*I)),(I=o(U+2*b+L))==null){t=1;break t}d.sd=I,11>t?((x=d.f.RGBA).eb=I,x.fb=0,x.A=A,x.size=U):((x=d.f.kb).y=I,x.O=0,x.fa=A,x.Fd=U,x.f=I,x.N=0+U,x.Ab=i,x.Cd=b,x.ea=I,x.W=0+U+b,x.Db=i,x.Ed=b,t==12&&(x.F=I,x.J=0+U+2*b),x.Tc=L,x.lb=m)}if(i=1,m=d.S,b=d.width,L=d.height,m>=Ta&&13>m)if(11>m)t=d.f.RGBA,i&=(A=Math.abs(t.A))*(L-1)+b<=t.size,i&=A>=b*Us[m],i&=t.eb!=null;else{t=d.f.kb,A=(b+1)/2,U=(L+1)/2,x=Math.abs(t.fa),I=Math.abs(t.Ab);var K=Math.abs(t.Db),Z=Math.abs(t.lb),G=Z*(L-1)+b;i&=x*(L-1)+b<=t.Fd,i&=I*(U-1)+A<=t.Cd,i=(i&=K*(U-1)+A<=t.Ed)&x>=b&I>=A&K>=A,i&=t.y!=null,i&=t.f!=null,i&=t.ea!=null,m==12&&(i&=Z>=b,i&=G<=t.Tc,i&=t.F!=null)}else i=0;t=i?0:2}}return t!=0||u!=null&&u.fd&&(t=Zi(d)),t}var Ve=64,di=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],pi=24,gi=32,$i=8,sn=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];xt("Predictor0","PredictorAdd0"),z.Predictor0=function(){return 4278190080},z.Predictor1=function(t){return t},z.Predictor2=function(t,i,u){return i[u+0]},z.Predictor3=function(t,i,u){return i[u+1]},z.Predictor4=function(t,i,u){return i[u-1]},z.Predictor5=function(t,i,u){return kt(kt(t,i[u+1]),i[u+0])},z.Predictor6=function(t,i,u){return kt(t,i[u-1])},z.Predictor7=function(t,i,u){return kt(t,i[u+0])},z.Predictor8=function(t,i,u){return kt(i[u-1],i[u+0])},z.Predictor9=function(t,i,u){return kt(i[u+0],i[u+1])},z.Predictor10=function(t,i,u){return kt(kt(t,i[u-1]),kt(i[u+0],i[u+1]))},z.Predictor11=function(t,i,u){var d=i[u+0];return 0>=Qt(d>>24&255,t>>24&255,(i=i[u-1])>>24&255)+Qt(d>>16&255,t>>16&255,i>>16&255)+Qt(d>>8&255,t>>8&255,i>>8&255)+Qt(255&d,255&t,255&i)?d:t},z.Predictor12=function(t,i,u){var d=i[u+0];return(qt((t>>24&255)+(d>>24&255)-((i=i[u-1])>>24&255))<<24|qt((t>>16&255)+(d>>16&255)-(i>>16&255))<<16|qt((t>>8&255)+(d>>8&255)-(i>>8&255))<<8|qt((255&t)+(255&d)-(255&i)))>>>0},z.Predictor13=function(t,i,u){var d=i[u-1];return(Gt((t=kt(t,i[u+0]))>>24&255,d>>24&255)<<24|Gt(t>>16&255,d>>16&255)<<16|Gt(t>>8&255,d>>8&255)<<8|Gt(t>>0&255,d>>0&255))>>>0};var Uo=z.PredictorAdd0;z.PredictorAdd1=te,xt("Predictor2","PredictorAdd2"),xt("Predictor3","PredictorAdd3"),xt("Predictor4","PredictorAdd4"),xt("Predictor5","PredictorAdd5"),xt("Predictor6","PredictorAdd6"),xt("Predictor7","PredictorAdd7"),xt("Predictor8","PredictorAdd8"),xt("Predictor9","PredictorAdd9"),xt("Predictor10","PredictorAdd10"),xt("Predictor11","PredictorAdd11"),xt("Predictor12","PredictorAdd12"),xt("Predictor13","PredictorAdd13");var Qi=z.PredictorAdd2;ee("ColorIndexInverseTransform","MapARGB","32b",function(t){return t>>8&255},function(t){return t}),ee("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(t){return t},function(t){return t>>8&255});var Ba,yn=z.ColorIndexInverseTransform,mi=z.MapARGB,Ma=z.VP8LColorIndexInverseTransformAlpha,Ea=z.MapAlpha,vr=z.VP8LPredictorsAdd=[];vr.length=16,(z.VP8LPredictors=[]).length=16,(z.VP8LPredictorsAdd_C=[]).length=16,(z.VP8LPredictors_C=[]).length=16;var Tr,cn,en,br,or,sr,vi,cr,Fe,ta,nn,wn,bi,qa,ea,zr,Ur,yr,Hr,yi,Wr,wr,na,Ln,Nn,be,ye,Ie,Re=o(511),ur=o(2041),ra=o(225),wi=o(767),Da=0,Ho=ur,Ra=ra,pn=wi,An=Re,Ta=0,za=1,Is=2,Ua=3,Ha=4,Wo=5,Cs=6,Vo=7,Go=8,Wa=9,Jo=10,Vc=[2,3,7],Gc=[3,3,11],js=[280,256,256,256,40],Jc=[0,1,1,1,0],Yc=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Xc=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Kc=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Zc=8,Yo=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Xo=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ia=null,$c=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Qc=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Os=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],tu=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],eu=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],nu=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],ru=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Lr=[],Mn=[],lr=[],iu=1,Bs=2,Nr=[],xn=[];ct("UpsampleRgbLinePair",re,3),ct("UpsampleBgrLinePair",Ne,3),ct("UpsampleRgbaLinePair",Bn,4),ct("UpsampleBgraLinePair",Te,4),ct("UpsampleArgbLinePair",Xe,4),ct("UpsampleRgba4444LinePair",Me,2),ct("UpsampleRgb565LinePair",Se,2);var au=z.UpsampleRgbLinePair,ou=z.UpsampleBgrLinePair,Ms=z.UpsampleRgbaLinePair,Es=z.UpsampleBgraLinePair,qs=z.UpsampleArgbLinePair,Ds=z.UpsampleRgba4444LinePair,su=z.UpsampleRgb565LinePair,Va=16,Ga=1<d.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),d.ca.f.kb.F!=null&&X()),d.Pb&&0(x=u.Md)?0:100I;++I)12>(K=m.pb[I]).lc&&(K.ia=x*gu[0>K.lc?0:K.lc]>>3),U|=K.ia;U&&(alert("todo:VP8InitRandom"),m.ia=1)}m.Ga=u.Id,100m.Ga&&(m.Ga=0)}xo(t,d)||(i=t.a)}}else i=t.a}i==0&&L.Oa!=null&&L.Oa.fd&&(i=Zi(L.ba))}L=i}b=L!=0?null:11>b?A.f.RGBA.eb:A.f.kb.y}else b=null;return b};var Us=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function g(z,rt){for(var dt="",P=0;P<4;P++)dt+=String.fromCharCode(z[rt++]);return dt}function y(z,rt){return(z[rt+0]<<0|z[rt+1]<<8|z[rt+2]<<16)>>>0}function w(z,rt){return(z[rt+0]<<0|z[rt+1]<<8|z[rt+2]<<16|z[rt+3]<<24)>>>0}new f;var S=[0],p=[0],O=[],F=new f,q=r,_=function(z,rt){var dt={},P=0,k=!1,W=0,D=0;if(dt.frames=[],!function(C,M,T,J){for(var Q=0;Q>1&1}lt!="ANMF"&&(rt+=ht)}return dt}}(q,0);_.response=q,_.rgbaoutput=!0,_.dataurl=!1;var B=_.header?_.header:null,Y=_.frames?_.frames:null;if(B){B.loop_counter=B.loop_count,S=[B.canvas_height],p=[B.canvas_width];for(var ot=0;ot>>1)&255;return _},f=function(S,p,O){var F,q,_,B,Y=[],ot=S.length;Y[0]=4;for(var ut=0;ut>>lt&255,lt+=B.bits;rt[W]=k>>>lt&255}}if(B.bits===16){z=(tt=new Uint32Array(B.decodePixels().buffer)).length,dt=new Uint8Array(z*(32/B.pixelBitlength)*B.colors),rt=new Uint8Array(z*(32/B.pixelBitlength)),P=B.colors>1,W=0,D=0;for(var ht=0;W>>0&255,P&&(dt[D++]=k>>>16&255,k=tt[W++],dt[D++]=k>>>0&255),rt[ht++]=k>>>16&255;_=8}F!==r.image_compression.NONE&&e()?(S=n(dt,B.width*B.colors,B.colors,F),wt=n(rt,B.width,1,F)):(S=dt,wt=rt,st=void 0)}if(B.colorType===3&&(q=this.color_spaces.INDEXED,ut=B.palette,B.transparency.indexed)){var pt=B.transparency.indexed,It=0;for(W=0,z=pt.length;W=0;r--){for(var a=this.bottom_up?r:this.height-1-r,c=0;c>7-h&1];this.data[l+4*h]=f.blue,this.data[l+4*h+1]=f.green,this.data[l+4*h+2]=f.red,this.data[l+4*h+3]=255}n!==0&&(this.pos+=4-n)}},Dn.prototype.bit4=function(){for(var r=Math.ceil(this.width/2),e=r%4,n=this.height-1;n>=0;n--){for(var a=this.bottom_up?n:this.height-1-n,c=0;c>4,f=15&o,g=this.palette[h];if(this.data[l]=g.blue,this.data[l+1]=g.green,this.data[l+2]=g.red,this.data[l+3]=255,2*c+1>=this.width)break;g=this.palette[f],this.data[l+4]=g.blue,this.data[l+4+1]=g.green,this.data[l+4+2]=g.red,this.data[l+4+3]=255}e!==0&&(this.pos+=4-e)}},Dn.prototype.bit8=function(){for(var r=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,a=0;a=0;n--){for(var a=this.bottom_up?n:this.height-1-n,c=0;c>5&e)/e*255|0,f=(o>>10&e)/e*255|0,g=o>>15?255:0,y=a*this.width*4+4*c;this.data[y]=f,this.data[y+1]=h,this.data[y+2]=l,this.data[y+3]=g}this.pos+=r}},Dn.prototype.bit16=function(){for(var r=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),a=this.height-1;a>=0;a--){for(var c=this.bottom_up?a:this.height-1-a,o=0;o>5&n)/n*255|0,g=(l>>11)/e*255|0,y=c*this.width*4+4*o;this.data[y]=g,this.data[y+1]=f,this.data[y+2]=h,this.data[y+3]=255}this.pos+=r}},Dn.prototype.bit24=function(){for(var r=this.height-1;r>=0;r--){for(var e=this.bottom_up?r:this.height-1-r,n=0;n=0;r--)for(var e=this.bottom_up?r:this.height-1-r,n=0;na&&(c.push(r.slice(f,o)),h=0,f=o),h+=e[o],o++;return f!==o&&c.push(r.slice(f,o)),c},wc=function(r,e,n){n||(n={});var a,c,o,l,h,f,g,y=[],w=[y],S=n.textIndent||0,p=0,O=0,F=r.split(" "),q=so.apply(this,[" ",n])[0];if(f=n.lineIndent===-1?F[0].length+2:n.lineIndent||0){var _=Array(f).join(" "),B=[];F.map(function(ot){(ot=ot.split(/\s*\n/)).length>1?B=B.concat(ot.map(function(ut,wt){return(wt&&ut.length?` `:"")+ut})):B.push(ot[0])}),F=B,f=bc.apply(this,[_,n])}for(o=0,l=F.length;oe||Y){if(O>e){for(h=yc.apply(this,[a,c,e-(S+p),e]),y.push(h.shift()),y=[h.pop()];h.length;)w.push([h.shift()]);O=c.slice(a.length-(y[0]?y[0].length:0)).reduce(function(ot,ut){return ot+ut},0)}else y=[a];w.push(y),S=O+f,p=q}else y.push(a),S+=p+O,p=q}return g=f?function(ot,ut){return(ut?_:"")+ot.join(" ")}:function(ot){return ot.join(" ")},w.map(g)},_i.splitTextToSize=function(r,e,n){var a,c=(n=n||{}).fontSize||this.internal.getFontSize(),o=(function(y){if(y.widths&&y.kerning)return{widths:y.widths,kerning:y.kerning};var w=this.internal.getFont(y.fontName,y.fontStyle);return w.metadata.Unicode?{widths:w.metadata.Unicode.widths||{0:1},kerning:w.metadata.Unicode.kerning||{}}:{font:w.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);a=Array.isArray(r)?r:String(r).split(/\r?\n/);var l=1*this.internal.scaleFactor*e/c;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/c:0,o.lineIndent=n.lineIndent;var h,f,g=[];for(h=0,f=a.length;himport("./CLzYDcnWEay-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)).catch(function(n){return Promise.reject(new Error("Could not load canvg: "+n))}).then(function(n){return n.default?n.default:n})}Ut.API.addSvgAsImage=function(n,a,c,o,l,h,f,g){if(isNaN(a)||isNaN(c))throw me.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(o)||isNaN(l))throw me.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var y=document.createElement("canvas");y.width=o,y.height=l;var w=y.getContext("2d");w.fillStyle="#fff",w.fillRect(0,0,y.width,y.height);var S={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},p=this;return e().then(function(O){return O.fromString(w,n,S)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(O){return O.render(S)}).then(function(){p.addImage(y.toDataURL("image/jpeg",1),a,c,o,l,f,g)})}}(),Ut.API.putTotalPages=function(r){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(r,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(r,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var a=1;a<=this.internal.getNumberOfPages();a++)for(var c=0;c1){for(y=0;ye||Y){if(O>e){for(h=yc.apply(this,[a,c,e-(S+p),e]),y.push(h.shift()),y=[h.pop()];h.length;)w.push([h.shift()]);O=c.slice(a.length-(y[0]?y[0].length:0)).reduce(function(ot,ut){return ot+ut},0)}else y=[a];w.push(y),S=O+f,p=q}else y.push(a),S+=p+O,p=q}return g=f?function(ot,ut){return(ut?_:"")+ot.join(" ")}:function(ot){return ot.join(" ")},w.map(g)},_i.splitTextToSize=function(r,e,n){var a,c=(n=n||{}).fontSize||this.internal.getFontSize(),o=(function(y){if(y.widths&&y.kerning)return{widths:y.widths,kerning:y.kerning};var w=this.internal.getFont(y.fontName,y.fontStyle);return w.metadata.Unicode?{widths:w.metadata.Unicode.widths||{0:1},kerning:w.metadata.Unicode.kerning||{}}:{font:w.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);a=Array.isArray(r)?r:String(r).split(/\r?\n/);var l=1*this.internal.scaleFactor*e/c;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/c:0,o.lineIndent=n.lineIndent;var h,f,g=[];for(h=0,f=a.length;himport("./BYONkh1IVI5I.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)).catch(function(n){return Promise.reject(new Error("Could not load canvg: "+n))}).then(function(n){return n.default?n.default:n})}Ut.API.addSvgAsImage=function(n,a,c,o,l,h,f,g){if(isNaN(a)||isNaN(c))throw me.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(o)||isNaN(l))throw me.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var y=document.createElement("canvas");y.width=o,y.height=l;var w=y.getContext("2d");w.fillStyle="#fff",w.fillRect(0,0,y.width,y.height);var S={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},p=this;return e().then(function(O){return O.fromString(w,n,S)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(O){return O.render(S)}).then(function(){p.addImage(y.toDataURL("image/jpeg",1),a,c,o,l,f,g)})}}(),Ut.API.putTotalPages=function(r){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(r,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(r,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var a=1;a<=this.internal.getNumberOfPages();a++)for(var c=0;c1){for(y=0;y{throw TypeError(t)};var re=(t,e,s)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var x=(t,e,s)=>re(t,typeof e!="symbol"?e+"":e,s),A=(t,e,s)=>e.has(t)||$("Cannot "+s);var h=(t,e,s)=>(A(t,e,"read from private field"),s?s.call(t):e.get(t)),v=(t,e,s)=>e.has(t)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),S=(t,e,s,r)=>(A(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s),y=(t,e,s)=>(A(t,e,"access private method"),s);import{c as oe,i as B,r as p,j as m}from"./DbBkdn6FNbgs.js";import{G as H,T as q}from"./Djes_egHqOHx.js";import{b as ae,az as ne,b0 as ie,u as ce,aZ as z,i as Z,b3 as T,e as ue,r as le,j as fe,V as de}from"./DyxVjgSvwe-K.js";import{a as he,b as me,c as we,d as ge,e as be}from"./DnYPVZQRsXfx.js";import{u as pe}from"./nEjnOjKmH1UU.js";const ve="next";function ye(t,e,s,r){const o=new URL(t),n=o.searchParams;return n.set("bbox",e.join(",")),n.set("bbox-crs",s),n.set("crs",s),n.set("f","json"),r?.(new URL(o))??o}function Re(t,e,s){const r=new URL(t),o=r.searchParams;return o.set("offset",e.toString()),o.set("limit",s.toString()),r.toString()}function G(t){if(!Array.isArray(t))return;const s=t.filter(r=>r.rel===ve);if(s.length===1)return s[0]?.href}async function K(t,e,s,r){let o=[];const n={headers:{Accept:"application/geo+json"},signal:r},a=await s.fetch(t,n);if(a.status!==200)throw new Error(`Failed to query features from service (status code ${a.status})`);const i=await a.json();e&&(o=e.readFeatures(i));const c=G(i.links);return{features:o,numberMatched:i.numberMatched,nextURL:c}}async function xe(t,e){const s={supportsOffsetStrategy:!1},r=new URL(t);r.searchParams.set("limit","1"),r.searchParams.set("f","json");const o=await e.fetch(r.toString(),{headers:{Accept:"application/geo+json"}});if(o.status!==200)throw new Error(`Failed to probe collection information (status code ${o.status})`);const n=await o.json(),a=G(n.links);if(!a)return s;const c=new URL(a).searchParams.has("offset");return s.supportsOffsetStrategy=c,s}async function Fe(t){const{fullURL:e,featureFormat:s,signal:r,addFeatures:o,queryFeatures:n}=t,a=t.limit,i=t.maxConcurrentRequests;let c=0,l=e;const f=[];let u;for(;l;){let g;u==null?g=i:g=Math.ceil((u-c)/a),g=Math.max(1,Math.min(g,i));const R=[];for(let F=0;F{l??=a(r,s);let I;try{I=await l}catch(L){U.error("Failed to retrieve collection information",L),F?.(),l=void 0;return}c?.abort("Extent changed"),c=new AbortController;const te=ye(r,u,t.crs,t.rewriteUrl);let N=t?.strategy||(I?.supportsOffsetStrategy?"offset":"next");N==="offset"&&!I?.supportsOffsetStrategy&&(N="next");try{const L=await Me(N,{fullURL:te.toString(),httpService:s,featureFormat:o.getFormat(),queryFeatures:n,addFeatures:i,limit:t.limit??Le,maxConcurrentRequests:t.maxConcurrentRequests??Se,signal:c.signal,collectionInfos:I});d?.(L),U.debug("Finished loading features for extent:",u)}catch(L){B(L)?(U.debug("Query-Feature-Request aborted",L),o.removeLoadedExtent(u),F?.()):U.error("Failed to load features",L)}};return o.setLoader(f),o}function Me(t,e){switch(t){case"next":return Pe(e);case"offset":return Fe(e)}}async function Pe(t){const e=t.limit;let s=new URL(t.fullURL);s.searchParams.set("limit",e.toString());let r=[];do{const o=await J([s.toString()],t.featureFormat,t.httpService,t.signal,t.addFeatures,t.queryFeatures);if(r=r.concat(o.features),!o.nextURL)break;s=new URL(o.nextURL)}while(!0);return r}async function J(t,e,s,r,o,n=K){const a={nextURL:void 0,numberMatched:void 0,features:[]},i=t.map(async(c,l)=>{const f=l===t.length-1,u=await n(c,e,s,r);o(u.features),U.debug(`NextURL for index = ${l} (isLast = ${f}): ${u.nextURL||"No Next URL"}`),a.features.push(...u.features),f&&(a.numberMatched=u.numberMatched,a.nextURL=u.nextURL)});return await Promise.all(i),a}var b,P,V,C,M,W,X;class Ve{constructor(e,s){v(this,M);x(this,"label");v(this,b);v(this,P);v(this,V);v(this,C);this.label=e.label,S(this,b,e),S(this,P,s);const{baseUrl:r,params:o}=je(e.baseUrl);S(this,V,r),S(this,C,o)}async search(e,{mapProjection:s,maxResults:r,signal:o}){const n=y(this,M,X).call(this,e,r),a=new H({dataProjection:"EPSG:4326",featureProjection:s});return(await Ce(h(this,P),n,o)).features.map(c=>y(this,M,W).call(this,c,a))}}b=new WeakMap,P=new WeakMap,V=new WeakMap,C=new WeakMap,M=new WeakSet,W=function(e,s){const r=h(this,b).renderLabel?.(e),o=e.properties[h(this,b).labelProperty],n=e.properties[h(this,b).searchProperty],a=r||(o!==void 0?String(o):n!==void 0?String(n):"");return{id:e.id??ie(),label:a,geometry:s.readGeometry(e.geometry),properties:e.properties}},X=function(e,s){const r=new URL(`${h(this,V)}/collections/${h(this,b).collectionId}/items`);for(const[o,n]of h(this,C))r.searchParams.append(o,n);return r.searchParams.set(h(this,b).searchProperty,`*${e}*`),r.searchParams.set("limit",String(s)),r.searchParams.set("f","json"),h(this,b).rewriteUrl?.(new URL(r))??r};async function Ce(t,e,s){try{const r=await t.fetch(e,{signal:s,headers:{Accept:"application/json"}});if(!r.ok)throw new Error("Request failed with status "+r.status);return await r.json()}catch(r){throw B(r)?r:new Error("Failed to search on OGC API Features service",{cause:r})}}function je(t){const e=new URL(t),s=new URLSearchParams(e.searchParams);return e.search="",{baseUrl:e.href.replace(/\/+$/,""),params:s}}var j;class He{constructor({references:e}){v(this,j);S(this,j,e.httpService)}createVectorSource(e){return Ie(e,h(this,j))}}j=new WeakMap;var E;class Te{constructor({references:e}){v(this,E);S(this,E,e.httpService)}createSearchSource(e){return new Ve(e,h(this,E))}}E=new WeakMap;const Ee="@open-pioneer/map-navigation",D=ce.bind(void 0,Ee),Ge=p.forwardRef(function(e,s){const{containerProps:r}=z("initial-extent",e),{map:o}=Z(e),n=D();function a(){const i=o?.initialExtent;if(i){const c=[i.xMin,i.yMin,i.xMax,i.yMax];o.olView.fit(c,{duration:200})}}return m.jsx(q,{ref:s,label:n.formatMessage({id:"initial-extent.title"}),icon:m.jsx(he,{}),onClick:a,...r})}),Ke=p.forwardRef(function(e,s){return m.jsx(Q,{zoomDirection:"in",ref:s,...e})}),Je=p.forwardRef(function(e,s){return m.jsx(Q,{zoomDirection:"out",ref:s,...e})}),Q=p.forwardRef(function(e,s){const{zoomDirection:r}=e,{map:o}=Z(e),n=D(),[a,i]=p.useState(!1),{defaultClassName:c,buttonLabel:l,buttonIcon:f}=ke(n,r),{containerProps:u}=z(T("zoom",c),e);function g(){if(a)return;i(!0);const R=o?.olView;let d=o?.zoomLevel;const F=R?.getMaxZoom()||Number.MAX_SAFE_INTEGER,I=R?.getMinZoom()||0;R&&d!==void 0&&(r==="in"&&dI&&--d,R.animate({zoom:d,duration:200},()=>i(!1)))}return m.jsx(q,{ref:s,label:l,icon:f,onClick:g,...u})});function ke(t,e){switch(e){case"in":return{defaultClassName:"zoom-in",buttonLabel:t.formatMessage({id:"zoom-in.title"}),buttonIcon:m.jsx(we,{})};case"out":return{defaultClassName:"zoom-out",buttonLabel:t.formatMessage({id:"zoom-out.title"}),buttonIcon:m.jsx(me,{})}}}const Ne=200;var w,_,k,Y;class Ae{constructor(e){v(this,w);x(this,"olMap");x(this,"handle");x(this,"_mapViews",ue());x(this,"_activeViewId",le(0));x(this,"backward",()=>{if(this.canBackward)y(this,w,k).call(this,this.activeViewId-1),y(this,w,_).call(this,this.activeViewId);else throw new Error("Backward is not possible at the moment")});x(this,"forward",()=>{if(this.canForward)y(this,w,k).call(this,this.activeViewId+1),y(this,w,_).call(this,this.activeViewId);else throw new Error("Forward is not possible at the moment")});this.olMap=e.olMap,this.handle=y(this,w,Y).call(this)}destroy(){this.handle&&fe(this.handle),this.handle=void 0}get activeViewId(){return this._activeViewId.value}get mapViews(){return this._mapViews}get canBackward(){return this.mapViews.get(this.activeViewId-1)!=null}get canForward(){return this.mapViews.get(this.activeViewId+1)!=null}}w=new WeakSet,_=function(e){const s=this.olMap.getView();this.olMap.setView(new de({center:this.mapViews.get(e).center,resolution:this.mapViews.get(e).resolution,projection:s.getProjection()}))},k=function(e){this._activeViewId.value=e},Y=function(){const e=this.olMap.on("moveend",()=>{s()}),s=()=>{const r=this.olMap,o=this.mapViews,n=r.getView(),a=n.getResolution(),i=n.getCenter();if(a!=null&&i!=null&&(i!==o.get(this.activeViewId)?.center||a!==o.get(this.activeViewId)?.resolution)){const c={resolution:a,center:i},l=this.activeViewId+1;for(const f of o.keys())f>l&&o.delete(f);for(const f of o.keys()){if(o.size{if(!t)return;let r=O.get(t);return r==null?(r={vm:new Ae(t),useCount:1},O.set(t,r)):r.useCount++,s(r.vm),()=>{s(void 0),r.useCount--,r.useCount===0&&(r.vm.destroy(),O.delete(t))}},[t]),e}const We=p.forwardRef(function(e,s){return m.jsx(ee,{viewDirection:"forward",ref:s,...e})}),Xe=p.forwardRef(function(e,s){return m.jsx(ee,{viewDirection:"backward",ref:s,...e})}),ee=p.forwardRef(function(e,s){const r=D(),{viewDirection:o}=e,{map:n}=Z(e),a=Oe(n),{defaultClassName:i,buttonLabel:c,buttonIcon:l}=_e(r,o),{containerProps:f}=z(T("view",i),e),u=pe(()=>a?o==="forward"?a.canForward:a.canBackward:!1,[a,o]),g=()=>{a&&(o==="forward"?a.forward():a.backward())};return a&&m.jsx(q,{ref:s,...f,label:c,icon:l,onClick:g,isDisabled:!u})});function _e(t,e){switch(e){case"forward":return{defaultClassName:"view-forward",buttonLabel:t.formatMessage({id:"view-forward.title"}),buttonIcon:m.jsx(be,{})};case"backward":return{defaultClassName:"view-backward",buttonLabel:t.formatMessage({id:"view-backward.title"}),buttonIcon:m.jsx(ge,{})}}}export{Xe as H,Ge as I,Te as S,He as V,Ke as Z,Je as a,We as b}; +var se=Object.defineProperty;var $=t=>{throw TypeError(t)};var re=(t,e,s)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var x=(t,e,s)=>re(t,typeof e!="symbol"?e+"":e,s),A=(t,e,s)=>e.has(t)||$("Cannot "+s);var h=(t,e,s)=>(A(t,e,"read from private field"),s?s.call(t):e.get(t)),v=(t,e,s)=>e.has(t)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),S=(t,e,s,r)=>(A(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s),y=(t,e,s)=>(A(t,e,"access private method"),s);import{c as oe,i as B,r as p,j as m}from"./B60Dx_GOYdnk.js";import{G as H,T as q}from"./CYroAbEI2PyD.js";import{b as ae,az as ne,b0 as ie,u as ce,aZ as z,i as Z,b3 as T,e as ue,r as le,j as fe,V as de}from"./j0mck_Meu7Xh.js";import{a as he,b as me,c as we,d as ge,e as be}from"./2C0geDG_OBHU.js";import{u as pe}from"./DSjrbd_eKbZM.js";const ve="next";function ye(t,e,s,r){const o=new URL(t),n=o.searchParams;return n.set("bbox",e.join(",")),n.set("bbox-crs",s),n.set("crs",s),n.set("f","json"),r?.(new URL(o))??o}function Re(t,e,s){const r=new URL(t),o=r.searchParams;return o.set("offset",e.toString()),o.set("limit",s.toString()),r.toString()}function G(t){if(!Array.isArray(t))return;const s=t.filter(r=>r.rel===ve);if(s.length===1)return s[0]?.href}async function K(t,e,s,r){let o=[];const n={headers:{Accept:"application/geo+json"},signal:r},a=await s.fetch(t,n);if(a.status!==200)throw new Error(`Failed to query features from service (status code ${a.status})`);const i=await a.json();e&&(o=e.readFeatures(i));const c=G(i.links);return{features:o,numberMatched:i.numberMatched,nextURL:c}}async function xe(t,e){const s={supportsOffsetStrategy:!1},r=new URL(t);r.searchParams.set("limit","1"),r.searchParams.set("f","json");const o=await e.fetch(r.toString(),{headers:{Accept:"application/geo+json"}});if(o.status!==200)throw new Error(`Failed to probe collection information (status code ${o.status})`);const n=await o.json(),a=G(n.links);if(!a)return s;const c=new URL(a).searchParams.has("offset");return s.supportsOffsetStrategy=c,s}async function Fe(t){const{fullURL:e,featureFormat:s,signal:r,addFeatures:o,queryFeatures:n}=t,a=t.limit,i=t.maxConcurrentRequests;let c=0,l=e;const f=[];let u;for(;l;){let g;u==null?g=i:g=Math.ceil((u-c)/a),g=Math.max(1,Math.min(g,i));const R=[];for(let F=0;F{l??=a(r,s);let I;try{I=await l}catch(L){U.error("Failed to retrieve collection information",L),F?.(),l=void 0;return}c?.abort("Extent changed"),c=new AbortController;const te=ye(r,u,t.crs,t.rewriteUrl);let N=t?.strategy||(I?.supportsOffsetStrategy?"offset":"next");N==="offset"&&!I?.supportsOffsetStrategy&&(N="next");try{const L=await Me(N,{fullURL:te.toString(),httpService:s,featureFormat:o.getFormat(),queryFeatures:n,addFeatures:i,limit:t.limit??Le,maxConcurrentRequests:t.maxConcurrentRequests??Se,signal:c.signal,collectionInfos:I});d?.(L),U.debug("Finished loading features for extent:",u)}catch(L){B(L)?(U.debug("Query-Feature-Request aborted",L),o.removeLoadedExtent(u),F?.()):U.error("Failed to load features",L)}};return o.setLoader(f),o}function Me(t,e){switch(t){case"next":return Pe(e);case"offset":return Fe(e)}}async function Pe(t){const e=t.limit;let s=new URL(t.fullURL);s.searchParams.set("limit",e.toString());let r=[];do{const o=await J([s.toString()],t.featureFormat,t.httpService,t.signal,t.addFeatures,t.queryFeatures);if(r=r.concat(o.features),!o.nextURL)break;s=new URL(o.nextURL)}while(!0);return r}async function J(t,e,s,r,o,n=K){const a={nextURL:void 0,numberMatched:void 0,features:[]},i=t.map(async(c,l)=>{const f=l===t.length-1,u=await n(c,e,s,r);o(u.features),U.debug(`NextURL for index = ${l} (isLast = ${f}): ${u.nextURL||"No Next URL"}`),a.features.push(...u.features),f&&(a.numberMatched=u.numberMatched,a.nextURL=u.nextURL)});return await Promise.all(i),a}var b,P,V,C,M,W,X;class Ve{constructor(e,s){v(this,M);x(this,"label");v(this,b);v(this,P);v(this,V);v(this,C);this.label=e.label,S(this,b,e),S(this,P,s);const{baseUrl:r,params:o}=je(e.baseUrl);S(this,V,r),S(this,C,o)}async search(e,{mapProjection:s,maxResults:r,signal:o}){const n=y(this,M,X).call(this,e,r),a=new H({dataProjection:"EPSG:4326",featureProjection:s});return(await Ce(h(this,P),n,o)).features.map(c=>y(this,M,W).call(this,c,a))}}b=new WeakMap,P=new WeakMap,V=new WeakMap,C=new WeakMap,M=new WeakSet,W=function(e,s){const r=h(this,b).renderLabel?.(e),o=e.properties[h(this,b).labelProperty],n=e.properties[h(this,b).searchProperty],a=r||(o!==void 0?String(o):n!==void 0?String(n):"");return{id:e.id??ie(),label:a,geometry:s.readGeometry(e.geometry),properties:e.properties}},X=function(e,s){const r=new URL(`${h(this,V)}/collections/${h(this,b).collectionId}/items`);for(const[o,n]of h(this,C))r.searchParams.append(o,n);return r.searchParams.set(h(this,b).searchProperty,`*${e}*`),r.searchParams.set("limit",String(s)),r.searchParams.set("f","json"),h(this,b).rewriteUrl?.(new URL(r))??r};async function Ce(t,e,s){try{const r=await t.fetch(e,{signal:s,headers:{Accept:"application/json"}});if(!r.ok)throw new Error("Request failed with status "+r.status);return await r.json()}catch(r){throw B(r)?r:new Error("Failed to search on OGC API Features service",{cause:r})}}function je(t){const e=new URL(t),s=new URLSearchParams(e.searchParams);return e.search="",{baseUrl:e.href.replace(/\/+$/,""),params:s}}var j;class He{constructor({references:e}){v(this,j);S(this,j,e.httpService)}createVectorSource(e){return Ie(e,h(this,j))}}j=new WeakMap;var E;class Te{constructor({references:e}){v(this,E);S(this,E,e.httpService)}createSearchSource(e){return new Ve(e,h(this,E))}}E=new WeakMap;const Ee="@open-pioneer/map-navigation",D=ce.bind(void 0,Ee),Ge=p.forwardRef(function(e,s){const{containerProps:r}=z("initial-extent",e),{map:o}=Z(e),n=D();function a(){const i=o?.initialExtent;if(i){const c=[i.xMin,i.yMin,i.xMax,i.yMax];o.olView.fit(c,{duration:200})}}return m.jsx(q,{ref:s,label:n.formatMessage({id:"initial-extent.title"}),icon:m.jsx(he,{}),onClick:a,...r})}),Ke=p.forwardRef(function(e,s){return m.jsx(Q,{zoomDirection:"in",ref:s,...e})}),Je=p.forwardRef(function(e,s){return m.jsx(Q,{zoomDirection:"out",ref:s,...e})}),Q=p.forwardRef(function(e,s){const{zoomDirection:r}=e,{map:o}=Z(e),n=D(),[a,i]=p.useState(!1),{defaultClassName:c,buttonLabel:l,buttonIcon:f}=ke(n,r),{containerProps:u}=z(T("zoom",c),e);function g(){if(a)return;i(!0);const R=o?.olView;let d=o?.zoomLevel;const F=R?.getMaxZoom()||Number.MAX_SAFE_INTEGER,I=R?.getMinZoom()||0;R&&d!==void 0&&(r==="in"&&dI&&--d,R.animate({zoom:d,duration:200},()=>i(!1)))}return m.jsx(q,{ref:s,label:l,icon:f,onClick:g,...u})});function ke(t,e){switch(e){case"in":return{defaultClassName:"zoom-in",buttonLabel:t.formatMessage({id:"zoom-in.title"}),buttonIcon:m.jsx(we,{})};case"out":return{defaultClassName:"zoom-out",buttonLabel:t.formatMessage({id:"zoom-out.title"}),buttonIcon:m.jsx(me,{})}}}const Ne=200;var w,_,k,Y;class Ae{constructor(e){v(this,w);x(this,"olMap");x(this,"handle");x(this,"_mapViews",ue());x(this,"_activeViewId",le(0));x(this,"backward",()=>{if(this.canBackward)y(this,w,k).call(this,this.activeViewId-1),y(this,w,_).call(this,this.activeViewId);else throw new Error("Backward is not possible at the moment")});x(this,"forward",()=>{if(this.canForward)y(this,w,k).call(this,this.activeViewId+1),y(this,w,_).call(this,this.activeViewId);else throw new Error("Forward is not possible at the moment")});this.olMap=e.olMap,this.handle=y(this,w,Y).call(this)}destroy(){this.handle&&fe(this.handle),this.handle=void 0}get activeViewId(){return this._activeViewId.value}get mapViews(){return this._mapViews}get canBackward(){return this.mapViews.get(this.activeViewId-1)!=null}get canForward(){return this.mapViews.get(this.activeViewId+1)!=null}}w=new WeakSet,_=function(e){const s=this.olMap.getView();this.olMap.setView(new de({center:this.mapViews.get(e).center,resolution:this.mapViews.get(e).resolution,projection:s.getProjection()}))},k=function(e){this._activeViewId.value=e},Y=function(){const e=this.olMap.on("moveend",()=>{s()}),s=()=>{const r=this.olMap,o=this.mapViews,n=r.getView(),a=n.getResolution(),i=n.getCenter();if(a!=null&&i!=null&&(i!==o.get(this.activeViewId)?.center||a!==o.get(this.activeViewId)?.resolution)){const c={resolution:a,center:i},l=this.activeViewId+1;for(const f of o.keys())f>l&&o.delete(f);for(const f of o.keys()){if(o.size{if(!t)return;let r=O.get(t);return r==null?(r={vm:new Ae(t),useCount:1},O.set(t,r)):r.useCount++,s(r.vm),()=>{s(void 0),r.useCount--,r.useCount===0&&(r.vm.destroy(),O.delete(t))}},[t]),e}const We=p.forwardRef(function(e,s){return m.jsx(ee,{viewDirection:"forward",ref:s,...e})}),Xe=p.forwardRef(function(e,s){return m.jsx(ee,{viewDirection:"backward",ref:s,...e})}),ee=p.forwardRef(function(e,s){const r=D(),{viewDirection:o}=e,{map:n}=Z(e),a=Oe(n),{defaultClassName:i,buttonLabel:c,buttonIcon:l}=_e(r,o),{containerProps:f}=z(T("view",i),e),u=pe(()=>a?o==="forward"?a.canForward:a.canBackward:!1,[a,o]),g=()=>{a&&(o==="forward"?a.forward():a.backward())};return a&&m.jsx(q,{ref:s,...f,label:c,icon:l,onClick:g,isDisabled:!u})});function _e(t,e){switch(e){case"forward":return{defaultClassName:"view-forward",buttonLabel:t.formatMessage({id:"view-forward.title"}),buttonIcon:m.jsx(be,{})};case"backward":return{defaultClassName:"view-backward",buttonLabel:t.formatMessage({id:"view-backward.title"}),buttonIcon:m.jsx(ge,{})}}}export{Xe as H,Ge as I,Te as S,He as V,Ke as Z,Je as a,We as b}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/j0mck_Meu7Xh.js b/openlayers-base-packages/pr-previews/pr-377/assets/j0mck_Meu7Xh.js new file mode 100644 index 0000000..7027357 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/j0mck_Meu7Xh.js @@ -0,0 +1,92 @@ +var s_=Object.defineProperty;var fu=e=>{throw TypeError(e)};var r_=(e,t,i)=>t in e?s_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Oi=(e,t,i)=>r_(e,typeof t!="symbol"?t+"":t,i),Fh=(e,t,i)=>t.has(e)||fu("Cannot "+i);var x=(e,t,i)=>(Fh(e,t,"read from private field"),i?i.call(e):t.get(e)),N=(e,t,i)=>t.has(e)?fu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Y=(e,t,i,n)=>(Fh(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),V=(e,t,i)=>(Fh(e,t,"access private method"),i);var gu=(e,t,i,n)=>({set _(s){Y(e,t,s,i)},get _(){return x(e,t,n)}});import{h as a_,j as Ie,g as dl,c as Ai,C as nf,i as Wr,r as vt,ai as o_,aj as h_,a2 as l_,B as c_,ak as sf,E as u_,al as d_,am as _u,d as f_,e as mu,an as g_,G as __}from"./B60Dx_GOYdnk.js";const Qa=Symbol("EventEmitterState");class rf{[Qa]=new m_;on(t,i){return this[Qa].on(t,{listener:i})}once(t,i){return this[Qa].on(t,{listener:i,once:!0})}emit(t,...i){this[Qa].emit(t,i[0])}}class m_{handlers=new Map;on(t,i){let n=this.handlers.get(t);return n||(n=new Set,this.handlers.set(t,n)),n.add(i),{destroy(){i.removed=!0,n?.delete(i),n=void 0}}}emit(t,i){const n=this.handlers.get(t);if(!n)return;const s=[...n];for(const r of s)r.removed||(r.once&&(r.removed=!0,n.delete(r)),r.listener(i))}}const y_=a_(function(t,i){const{direction:n,align:s,justify:r,wrap:a,basis:o,grow:h,shrink:l,...c}=t,u={display:"flex",flexDirection:n,alignItems:s,justifyContent:r,flexWrap:a,flexBasis:o,flexGrow:h,flexShrink:l};return Ie.jsx(dl.div,{ref:i,__css:u,...c})});y_.displayName="Flex";var p_=Symbol.for("preact-signals");function ah(){if(nn>1)nn--;else{for(var e,t=!1;Or!==void 0;){var i=Or;for(Or=void 0,fl++;i!==void 0;){var n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&of(i))try{i.c()}catch(s){t||(e=s,t=!0)}i=n}}if(fl=0,nn--,t)throw e}}function v_(e){if(nn>0)return e();nn++;try{return e()}finally{ah()}}var pt=void 0;function Oa(e){var t=pt;pt=void 0;try{return e()}finally{pt=t}}var Or=void 0,nn=0,fl=0,To=0;function af(e){if(pt!==void 0){var t=e.n;if(t===void 0||t.t!==pt)return t={i:0,S:e,p:pt.s,n:void 0,t:pt,e:void 0,x:void 0,r:t},pt.s!==void 0&&(pt.s.n=t),pt.s=t,e.n=t,32&pt.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=pt.s,t.n=void 0,pt.s.n=t,pt.s=t),t}}function ie(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ie.prototype.brand=p_;ie.prototype.h=function(){return!0};ie.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};ie.prototype.U=function(e){if(this.t!==void 0){var t=e.e,i=e.x;t!==void 0&&(t.x=i,e.e=void 0),i!==void 0&&(i.e=t,e.x=void 0),e===this.t&&(this.t=i)}};ie.prototype.subscribe=function(e){var t=this;return Hl(function(){var i=t.value,n=pt;pt=void 0;try{e(i)}finally{pt=n}})};ie.prototype.valueOf=function(){return this.value};ie.prototype.toString=function(){return this.value+""};ie.prototype.toJSON=function(){return this.value};ie.prototype.peek=function(){var e=pt;pt=void 0;try{return this.value}finally{pt=e}};Object.defineProperty(ie.prototype,"value",{get:function(){var e=af(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(fl>100)throw new Error("Cycle detected");this.v=e,this.i++,To++,nn++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{ah()}}}});function Kl(e){return new ie(e)}function of(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function hf(e){for(var t=e.s;t!==void 0;t=t.n){var i=t.S.n;if(i!==void 0&&(t.r=i),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function lf(e){for(var t=e.s,i=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):i=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=i}function ar(e){ie.call(this,void 0),this.x=e,this.s=void 0,this.g=To-1,this.f=4}(ar.prototype=new ie).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===To))return!0;if(this.g=To,this.f|=1,this.i>0&&!of(this))return this.f&=-2,!0;var e=pt;try{hf(this),pt=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return pt=e,lf(this),this.f&=-2,!0};ar.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ie.prototype.S.call(this,e)};ar.prototype.U=function(e){if(this.t!==void 0&&(ie.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};ar.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(ar.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=af(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function $l(e){return new ar(e)}function cf(e){var t=e.u;if(e.u=void 0,typeof t=="function"){nn++;var i=pt;pt=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Zl(e),n}finally{pt=i,ah()}}}function Zl(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,cf(e)}function x_(e){if(pt!==this)throw new Error("Out-of-order effect");lf(this),pt=e,this.f&=-2,8&this.f&&Zl(this),ah()}function Da(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Da.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};Da.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,cf(this),hf(this),nn++;var e=pt;return pt=this,x_.bind(this,e)};Da.prototype.N=function(){2&this.f||(this.f|=2,this.o=Or,Or=this)};Da.prototype.d=function(){this.f|=8,1&this.f||Zl(this)};function Hl(e){var t=new Da(e);try{t.c()}catch(i){throw t.d(),i}return t.d.bind(t)}function E_(e){let t;return{destroy:Hl(function(){this[M_]=e.bind(void 0),t=this[w_].bind(this)}),start:t}}var M_="N",w_="S",yu="S",pu="U";function S_(e,t){const i=$l(e),n=i[yu],s=i[pu];let r=0,a;return i[yu]=function(h){n.call(this,h),r++===0&&(a=t())},i[pu]=function(h){s.call(this,h),--r===0&&(a?.(),a=void 0)},i}function $t(e,t){return new T_(e,t?.equal)}function Xr(e,t){return new C_(e,t?.equal)}function R_(e,t){const i=Kl(!1),n=()=>{i.value=!i.peek()},s=Xr(()=>(i.value,Oa(()=>e())),t);return s.trigger=n,s}function Dr(e,t){return new I_(e,t)}function Jl(e){return v_(e)}function uf(e){return Oa(e)}var ns=Symbol("signal"),Fr=Symbol("equals"),Ql=class{[ns];constructor(e){this[ns]=e}get value(){return this[ns].value}set value(e){throw new Error("Cannot update a readonly reactive object.")}trigger(){throw new Error("Cannot trigger this reactive object.")}peek(){return this[ns].peek()}toJSON(){return this.value}toString(){return`Reactive[value=${L_(this[ns].value)}]`}},C_=class extends Ql{[Fr];constructor(e,t){const i=$l(t?A_(e,t):e);super(i),this[Fr]=t}},T_=class extends Ql{[Fr];constructor(e,t){super(Kl(e)),this[Fr]=t}get value(){return super.value}set value(e){Oa(()=>this[Fr]?.(this.value,e))||(this[ns].value=e)}},to=Symbol("invalidate_signal"),eo=Symbol("is_watched"),b_=Symbol("has_scheduled_invalidate"),$d,Zd,Hd,Jd,Ss,Qd,I_=(Qd=class extends(Jd=Ql,Hd=to,Zd=eo,$d=b_,Jd){constructor(t,i){const n=S_(()=>(this[to].value,this[eo]||x(this,Ss).call(this),Oa(()=>t())),()=>{this[eo]=!0;const s=i(x(this,Ss));return()=>{this[eo]=!1,s(),x(this,Ss).call(this)}});super(n);Oi(this,Hd,Kl(!1));Oi(this,Zd,!1);Oi(this,$d,!1);N(this,Ss,()=>{this[to].value=!this[to].peek()})}},Ss=new WeakMap,Qd);function A_(e,t){let i=!0,n;return function(){const r=e();return Oa(()=>((i||!t(n,r))&&(n=r,i=!1),n))}}function L_(e){return typeof e=="string"?JSON.stringify(e):String(e)}function df(e,t){return e===t?!0:e.length===t.length&&e.every((i,n)=>i===t[n])}function ff(e,t,i,n){const s=$l(t),r=n?.immediate??!1,a=n?.equal??P_;let o=!0,h,l;function c(){const g=l;l=void 0;try{g?.()}catch(f){throw d.destroy(),f}}const u=e(()=>{const g=s.value;uf(()=>{const f=h,_=o&&r||!o&&!a(f,g);(_||o)&&(h=g,o=!1),_&&(c(),l=i(g,f))})}),d={destroy(){try{c()}finally{u.destroy()}}};return d}function P_(e,t){return e===t}function O_(e){return{destroy:Hl(e)}}function zC(e,t,i){return ff(O_,e,t,{equal:df,...i})}function gf(e){Promise.reject(new Error("Error in effect or watch callback",{cause:e}))}var D_=class{queue=[];channel=new MessageChannel;constructor(){this.channel.port2.start()}enqueue(e){const t={fn:e,destroyed:!1};return this.queue.push(t),this.queue.length===1&&this.scheduleIteration(),{destroy(){t.destroyed||(t.destroyed=!0)}}}messageHandler=()=>this.runIteration();scheduleIteration(){const e=this.channel;e.port2.addEventListener("message",this.messageHandler),e.port1.postMessage("")}runIteration(){this.channel.port2.removeEventListener("message",this.messageHandler);const e=this.queue;this.queue=[];for(const t of e)if(!t.destroyed)try{t.fn()}catch(i){gf(i)}}};function F_(e){const t=new N_(e);return{destroy:t.destroy.bind(t)}}var N_=class{callback;cleanup;watcher;scheduledExecution;isDestroyed=!1;initialExecution=!0;isExecuting=!1;constructor(e){this.callback=e,this.watcher=E_(this.scheduleExecution),this.execute(),this.initialExecution=!1}destroy(){if(!this.isDestroyed){this.isDestroyed=!0;try{this.triggerCleanup()}finally{this.watcher?.destroy(),this.watcher=void 0,this.scheduledExecution?.destroy(),this.scheduledExecution=void 0}}}execute(){const e=this.watcher;if(!e)return;this.isExecuting=!0;const t=e.start();try{if(this.initialExecution)try{this.triggerCallback()}catch(i){throw this.destroy(),i}else try{this.triggerCallback()}catch(i){gf(i)}}finally{t(),this.isExecuting=!1}this.isDestroyed&&this.triggerCleanup()}triggerCallback(){if(!this.isDestroyed){this.triggerCleanup();const e=this.callback();typeof e=="function"&&(this.cleanup=e)}}triggerCleanup(){const e=this.cleanup;this.cleanup=void 0;try{e&&uf(e)}catch(t){throw this.destroy(),t}}scheduleExecution=()=>{if(!this.isDestroyed){if(this.isExecuting)throw new Error("Cycle detected");this.scheduledExecution||(this.scheduledExecution=z_(()=>{try{this.execute()}finally{this.scheduledExecution=void 0}}))}}};function k_(e,t,i){return ff(F_,e,t,{equal:df,...i})}var G_=new D_;function z_(e){return G_.enqueue(e)}function _f(e){return new U_(e)}var Vt,Rs,Bt,Ui,yo,mf,yf,tf,U_=(tf=class{constructor(e){N(this,Bt);N(this,Vt,new Map);N(this,Rs,$t(!1));if(e)for(const[t,i]of e)x(this,Vt).set(t,$t(i))}get size(){return V(this,Bt,Ui).call(this),x(this,Vt).size}forEach(e){V(this,Bt,Ui).call(this);const t=x(this,Vt).entries();for(const[i,n]of t)e(n.value,i)}entries(){return V(this,Bt,Ui).call(this),V(this,Bt,mf).call(this)}keys(){return V(this,Bt,Ui).call(this),x(this,Vt).keys()}values(){return V(this,Bt,Ui).call(this),V(this,Bt,yf).call(this)}[Symbol.iterator](){return this.entries()}clear(){const e=!!x(this,Vt).size;x(this,Vt).clear(),e&&V(this,Bt,yo).call(this)}delete(e){const t=x(this,Vt).delete(e);return t&&V(this,Bt,yo).call(this),t}get(e){return V(this,Bt,Ui).call(this),x(this,Vt).get(e)?.value}has(e){return V(this,Bt,Ui).call(this),x(this,Vt).has(e)}set(e,t){const i=x(this,Vt).get(e);return i?i.value=t:(x(this,Vt).set(e,$t(t)),V(this,Bt,yo).call(this)),this}},Vt=new WeakMap,Rs=new WeakMap,Bt=new WeakSet,Ui=function(){x(this,Rs).value},yo=function(){x(this,Rs).value=!x(this,Rs).peek()},mf=function*(){const e=x(this,Vt).entries();for(const[t,i]of e)yield[t,i.value]},yf=function*(){const e=x(this,Vt).values();for(const t of e)yield t.value},tf);function B_(e){return new W_(e)}var ke,ef,W_=(ef=class{constructor(e){N(this,ke);Y(this,ke,_f(e?X_(e):void 0))}get size(){return x(this,ke).size}clear(){x(this,ke).clear()}has(e){return x(this,ke).has(e)}add(e){return x(this,ke).set(e,void 0),this}delete(e){return x(this,ke).delete(e)}forEach(e){x(this,ke).forEach((t,i)=>e(i,i))}entries(){return j_(this.values())}values(){return x(this,ke).keys()}[Symbol.iterator](){return this.values()}},ke=new WeakMap,ef);function*X_(e){for(const t of e)yield[t,void 0]}function*j_(e){for(const t of e)yield[t,t]}function pr(e){return new Y_(e)}var St,Cs,ht,yn,po,pf,vf,Ne,pn,Ts,Y_=(Ts=class{constructor(t){N(this,ht);N(this,St);N(this,Cs,$t(!1));Y(this,St,t?Array.from(t).map(i=>$t(i)):[])}get length(){return V(this,ht,Ne).call(this),x(this,St).length}push(...t){x(this,St).push(...t.map(i=>$t(i))),V(this,ht,pn).call(this)}pop(){if(x(this,St).length===0)return;const t=x(this,St).pop();return V(this,ht,pn).call(this),t.value}unshift(...t){x(this,St).unshift(...t.map(i=>$t(i))),V(this,ht,pn).call(this)}shift(){if(x(this,St).length===0)return;const t=x(this,St).shift();return V(this,ht,pn).call(this),t.value}splice(t,i,...n){const s=x(this,St).splice(t,i??x(this,St).length,...n.map(r=>$t(r)));return(n!=null&&n.length!==0||s.length!==0)&&V(this,ht,pn).call(this),s.map(r=>r.value)}sort(t){x(this,St).sort((i,n)=>t(i.value,n.value)),V(this,ht,pn).call(this)}getItems(){return V(this,ht,Ne).call(this),x(this,St).map(t=>t.value)}at(t){return V(this,ht,Ne).call(this),x(this,St).at(t)?.value}get(t){return V(this,ht,Ne).call(this),x(this,St)[t]?.value}set(t,i){if(t<0||t>=x(this,St).length)throw new Error("index out of bounds");const n=x(this,St)[t];n.value=i}slice(...t){V(this,ht,Ne).call(this);const i=x(this,St).slice(...t).map(n=>n.value);return pr(i)}concat(...t){const i=this.getItems().concat(...t.map(n=>n instanceof Ts?n.getItems():n));return pr(i)}includes(t,i){return V(this,ht,yn).call(this,n=>n===t,i)!==-1}indexOf(t,i){return V(this,ht,yn).call(this,n=>n===t,i)}lastIndexOf(t){return V(this,ht,po).call(this,i=>i===t)}find(t){const i=V(this,ht,yn).call(this,t);return this.get(i)}findLast(t){const i=V(this,ht,po).call(this,t);return this.get(i)}findIndex(t){return V(this,ht,yn).call(this,t)}findLastIndex(t){return V(this,ht,po).call(this,t)}some(t){return V(this,ht,yn).call(this,t)!==-1}every(t){return V(this,ht,yn).call(this,(i,n)=>!t(i,n))===-1}forEach(t){for(const[i,n]of this.entries())t(n,i)}filter(t){return pr(this.getItems().filter((i,n)=>t(i,n)))}map(t){return pr(this.getItems().map((i,n)=>t(i,n)))}flatMap(t){return pr(this.getItems().flatMap((i,n)=>t(i,n)))}reduce(t,...i){return V(this,ht,Ne).call(this),x(this,St).reduce((n,s,r)=>t(n,s.value,r),...i)}reduceRight(t,...i){return V(this,ht,Ne).call(this),x(this,St).reduceRight((n,s,r)=>t(n,s.value,r),...i)}keys(){return V(this,ht,Ne).call(this),x(this,St).keys()}values(){return V(this,ht,Ne).call(this),V(this,ht,pf).call(this)}entries(){return V(this,ht,Ne).call(this),V(this,ht,vf).call(this)}[Symbol.iterator](){return this.values()}},St=new WeakMap,Cs=new WeakMap,ht=new WeakSet,yn=function(t,i){for(let n=i??0,s=this.length;n0;){const n=this.get(i);if(t(n,i))return i}return-1},pf=function*(){for(const t of x(this,St))yield t.value},vf=function*(){for(const[t,i]of x(this,St).entries())yield[t,i.value]},Ne=function(){x(this,Cs).value},pn=function(){x(this,Cs).value=!x(this,Cs).peek()},Ts);class oh{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}class li{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function q_(e,t,i){let n,s;i=i||wi;let r=0,a=e.length,o=!1;for(;r>1),s=+i(e[n],t),s<0?r=n+1:(a=n,o=!s);return o?r:~r}function wi(e,t){return e>t?1:et?-1:0}function hh(e,t,i){if(e[0]<=t)return 0;const n=e.length;if(t<=e[n-1])return n-1;if(typeof i=="function"){for(let s=1;s0?s-1:s}return n-1}if(i>0){for(let s=1;s0||a===0)})}function jr(){return!0}function Fa(){return!1}function Ys(){}function xf(e){let t,i,n;return function(){const s=Array.prototype.slice.call(arguments);return(!i||this!==n||!ln(s,i))&&(n=this,i=s,t=e.apply(this,arguments)),t}}function Ef(e){function t(){let i;try{i=e()}catch(n){return Promise.reject(n)}return i instanceof Promise?i:Promise.resolve(i)}return t()}function Na(e){for(const t in e)delete e[t]}function qs(e){let t;for(t in e)return!1;return!t}class ka extends oh{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,i){if(!t||!i)return;const n=this.listeners_||(this.listeners_={}),s=n[t]||(n[t]=[]);s.includes(i)||s.push(i)}dispatchEvent(t){const i=typeof t=="string",n=i?t:t.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=i?new li(t):t;r.target||(r.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});n in a||(a[n]=0,o[n]=0),++a[n];let h;for(let l=0,c=s.length;l0:!1}removeEventListener(t,i){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const s=n.indexOf(i);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[s]=Ys,++this.pendingRemovals_[t]):(n.splice(s,1),n.length===0&&delete this.listeners_[t]))}}const Q={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function lt(e,t,i,n,s){if(s){const a=i;i=function(){e.removeEventListener(t,i),a.apply(n??this,arguments)}}else n&&n!==e&&(i=i.bind(n));const r={target:e,type:t,listener:i};return e.addEventListener(t,i),r}function bo(e,t,i,n){return lt(e,t,i,n,!0)}function wt(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Na(e))}class Ga extends ka{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(Q.CHANGE)}getRevision(){return this.revision_}onInternal(t,i){if(Array.isArray(t)){const n=t.length,s=new Array(n);for(let r=0;r1?(i=s,n=r):h>0&&(i+=a*h,n+=o*h)}return ys(e,t,i,n)}function ys(e,t,i,n){const s=i-e,r=n-t;return s*s+r*r}function J_(e){const t=e.length;for(let n=0;nr&&(r=h,s=o)}if(r===0)return null;const a=e[s];e[s]=e[n],e[n]=a;for(let o=n+1;o=0;n--){i[n]=e[n][t]/e[n][n];for(let s=n-1;s>=0;s--)e[s][t]-=e[s][n]*i[n]}return i}function Io(e){return e*180/Math.PI}function pe(e){return e*Math.PI/180}function ps(e,t){const i=e%t;return i*t<0?i+t:i}function me(e,t,i){return e+i*(t-e)}function ch(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}function xu(e,t){return Math.round(ch(e,t))}function ls(e,t){return Math.floor(ch(e,t))}function Qi(e,t){return Math.ceil(ch(e,t))}function gl(e,t,i){if(e>=t&&e1?i:2,n=n??i,t===void 0&&(i>2?t=e.slice():t=new Array(s));for(let r=0;rio?a=io:a<-io&&(a=-io),t[r+1]=a}return t}function nm(e,t,i,n){const s=e.length;i=i>1?i:2,n=n??i,t===void 0&&(i>2?t=e.slice():t=new Array(s));for(let r=0;rs&&(h=h|zt.RIGHT),or&&(h=h|zt.ABOVE),h===zt.UNKNOWN&&(h=zt.INTERSECTING),h}function de(){return[1/0,1/0,-1/0,-1/0]}function Ci(e,t,i,n,s){return s?(s[0]=e,s[1]=t,s[2]=i,s[3]=n,s):[e,t,i,n]}function Ua(e){return Ci(1/0,1/0,-1/0,-1/0,e)}function Cf(e,t){const i=e[0],n=e[1];return Ci(i,n,i,n,t)}function ic(e,t,i,n,s){const r=Ua(s);return Tf(r,e,t,i,n)}function Ks(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function nc(e,t){return t[0]e[2]&&(e[2]=t[2]),t[1]e[3]&&(e[3]=t[3]),e}function Nr(e,t){t[0]e[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function Tf(e,t,i,n,s){for(;it[0]?n[0]=e[0]:n[0]=t[0],e[1]>t[1]?n[1]=e[1]:n[1]=t[1],e[2]=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Un(e){return e[2]=a&&_<=h),!n&&r&zt.RIGHT&&!(s&zt.RIGHT)&&(m=g-(d-h)*f,n=m>=o&&m<=l),!n&&r&zt.BELOW&&!(s&zt.BELOW)&&(_=d-(g-o)/f,n=_>=a&&_<=h),!n&&r&zt.LEFT&&!(s&zt.LEFT)&&(m=g-(d-a)*f,n=m>=o&&m<=l)}return n}function fm(e,t,i,n){if(Un(e))return Ua(i);let s=[];s=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]],t(s,s,2);const r=[],a=[];for(let o=0,h=s.length;o=i[2])){const s=st(i),a=Math.floor((n[0]-i[0])/s)*s;e[0]-=a,e[2]-=a}return e}function sc(e,t,i){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[n[0],e[1],n[2],e[3]]];If(e,t);const s=st(n);if(st(e)>s&&!i)return[[n[0],e[1],n[2],e[3]]];if(e[0]n[2])return[[e[0],e[1],n[2],e[3]],[n[0],e[1],e[2]-s,e[3]]]}return[e]}function rc(e,t){const i=(""+e).split("."),n=(""+t).split(".");for(let s=0;sa)return 1;if(a>r)return-1}return 0}function gm(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function _m(e,t){const i=e[0],n=e[1],s=t[0],r=t[1],a=s[0],o=s[1],h=r[0],l=r[1],c=h-a,u=l-o,d=c===0&&u===0?0:(c*(i-a)+u*(n-o))/(c*c+u*u||0);let g,f;return d<=0?(g=a,f=o):d>=1?(g=h,f=l):(g=a+d*c,f=o+d*u),[g,f]}function Lo(e,t){let i=!0;for(let n=e.length-1;n>=0;--n)if(e[n]!=t[n]){i=!1;break}return i}function ac(e,t){const i=Math.cos(t),n=Math.sin(t),s=e[0]*i-e[1]*n,r=e[1]*i+e[0]*n;return e[0]=s,e[1]=r,e}function mm(e,t){return e[0]*=t,e[1]*=t,e}function Af(e,t){const i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function WC(e,t){return Math.sqrt(Af(e,t))}function XC(e,t){return Af(e,_m(e,t))}function Lf(e,t){if(t.canWrapX()){const i=st(t.getExtent()),n=Pf(e,t,i);n&&(e[0]-=n*i)}return e}function Pf(e,t,i){const n=t.getExtent();let s=0;return t.canWrapX()&&(e[0]n[2])&&(i=i||st(n),s=Math.floor((e[0]-n[0])/i)),s}const _h=63710088e-1;function yl(e,t,i){i=i||_h;const n=pe(e[1]),s=pe(t[1]),r=(s-n)/2,a=pe(t[0]-e[0])/2,o=Math.sin(r)*Math.sin(r)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(s);return 2*i*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))}function Nh(e,t){let i=0;for(let n=0,s=e.length;nCu&&(t=Cu);const n=pe(t),s=Math.sin(n),r=Math.cos(n),a=s/r,o=a*a,h=o*o,l=pe(e),c=Nf(i.number),u=pe(c),d=Oo/Math.sqrt(1-Pe*s**2),g=En*r**2,f=r*gl(l-u,-Math.PI,Math.PI),_=f*f,m=_*f,p=m*f,y=p*f,M=y*f,v=Oo*(Ff*n-xm*Math.sin(2*n)+Em*Math.sin(4*n)-Mm*Math.sin(6*n)),E=Po*d*(f+m/6*(1-o+g)+y/120*(5-18*o+h+72*g-58*En))+5e5;let w=Po*(v+d*a*(_/2+p/24*(5-o+9*g+4*g**2)+M/720*(61-58*o+h+600*g-330*En)));return i.north||(w+=1e7),[E,w]}function Nf(e){return(e-1)*6-180+3}const Lm=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function kf(e){let t=0;for(const s of Lm){const r=e.match(s);if(r){t=parseInt(r[1]);break}}if(!t)return null;let i=0,n=!1;return t>32700&&t<32761?i=t-32700:t>32600&&t<32661&&(n=!0,i=t-32600),i?{number:i,north:n}:null}function Tu(e,t){return function(i,n,s,r){const a=i.length;s=s>1?s:2,r=r??s,n||(s>2?n=i.slice():n=new Array(a));for(let o=0;o=h?t[a+l]:o[l]}return i}}function Gm(e,t,i,n){const s=Mt(e),r=Mt(t);Fn(s,r,xl(i)),Fn(r,s,xl(n))}function YC(e,t){return zf(),vh(e,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function Dn(e,t){if(e===t)return!0;const i=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||ph(e,t)===lc)&&i}function ph(e,t){const i=e.getCode(),n=t.getCode();let s=xo(i,n);if(s)return s;let r=null,a=null;for(const h of Dm)r||(r=h(e)),a||(a=h(t));if(!r&&!a)return null;const o="EPSG:4326";if(a)if(r)s=kh(r.inverse,a.forward);else{const h=xo(i,o);h&&(s=kh(h,a.forward))}else{const h=xo(o,n);h&&(s=kh(r.inverse,h))}return s&&(Do(e),Do(t),Fn(e,t,s)),s}function kh(e,t){return function(i,n,s,r){return n=e(i,n,s,r),t(n,n,s,r)}}function Vr(e,t){const i=Mt(e),n=Mt(t);return ph(i,n)}function vh(e,t,i){const n=Vr(t,i);if(!n){const s=Mt(t).getCode(),r=Mt(i).getCode();throw new Error(`No transform available between ${s} and ${r}`)}return n(e,void 0,e.length)}function zm(e,t,i,n){const s=Vr(t,i);return fm(e,s,void 0)}let Um=null;function Bm(){return Um}function El(e,t){return e}function pi(e,t){return pl&&!Lo(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(pl=!1,Gf("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),e}function uc(e,t){return e}function ei(e,t){return e}function bu(e,t,i){return function(n){let s,r;if(e.canWrapX()){const a=e.getExtent(),o=st(a);n=n.slice(0),r=Pf(n,e,o),r&&(n[0]=n[0]-r*o),n[0]=Rt(n[0],a[0],a[2]),n[1]=Rt(n[1],a[1],a[3]),s=i(n)}else s=i(n);return r&&t.canWrapX()&&(s[0]+=r*st(t.getExtent())),s}}function Wm(){vl(Eu),vl(wu),km(wu,Eu,im,nm)}Wm();function Iu(e,t,i){return function(n,s,r,a,o){if(!n)return;if(!s&&!t)return n;const h=t?0:r[0]*s,l=t?0:r[1]*s,c=o?o[0]:0,u=o?o[1]:0;let d=e[0]+h/2+c,g=e[2]-h/2+c,f=e[1]+l/2+u,_=e[3]-l/2+u;d>g&&(d=(g+d)/2,g=d),f>_&&(f=(_+f)/2,_=f);let m=Rt(n[0],d,g),p=Rt(n[1],f,_);if(a&&i&&s){const y=30*s;m+=-y*Math.log(1+Math.max(0,d-n[0])/y)+y*Math.log(1+Math.max(0,n[0]-g)/y),p+=-y*Math.log(1+Math.max(0,f-n[1])/y)+y*Math.log(1+Math.max(0,n[1]-_)/y)}return[m,p]}}function Xm(e){return e}function dc(e,t,i,n){const s=st(t)/i[0],r=It(t)/i[1];return n?Math.min(e,Math.max(s,r)):Math.min(e,Math.min(s,r))}function fc(e,t,i){let n=Math.min(e,t);const s=50;return n*=Math.log(1+s*Math.max(0,e/t-1))/s+1,i&&(n=Math.max(n,i),n/=Math.log(1+s*Math.max(0,i/e-1))/s+1),Rt(n,i/2,t*2)}function jm(e,t,i,n){return t=t!==void 0?t:!0,function(s,r,a,o){if(s!==void 0){const h=e[0],l=e[e.length-1],c=i?dc(h,i,a,n):h;if(o)return t?fc(s,c,l):Rt(s,l,c);const u=Math.min(c,s),d=Math.floor(hh(e,u,r));return e[d]>c&&dMath.round(i*Pu[n])/Pu[n]).join(", ")+")"}function sn(e,t,i,n,s,r,a){r=r||[],a=a||2;let o=0;for(let h=t;h{if(!n)return this.getSimplifiedGeometry(i);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(i)})}simplifyTransformed(t,i){return this.simplifyTransformedInternal(this.getRevision(),t,i)}clone(){return ct()}closestPointXY(t,i,n,s){return ct()}containsXY(t,i){const n=this.getClosestPoint([t,i]);return n[0]===t&&n[1]===i}getClosestPoint(t,i){return i=i||[NaN,NaN],this.closestPointXY(t[0],t[1],i,1/0),i}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return ct()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const i=this.computeExtent(this.extent_);(isNaN(i[0])||isNaN(i[1]))&&Ua(i),this.extentRevision_=this.getRevision()}return um(this.extent_,t)}rotate(t,i){ct()}scale(t,i,n){ct()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return ct()}getType(){return ct()}applyTransform(t){ct()}intersectsExtent(t){return ct()}translate(t,i){ct()}transform(t,i){const n=Mt(t),s=n.getUnits()=="tile-pixels"?function(r,a,o){const h=n.getExtent(),l=n.getWorldExtent(),c=It(l)/It(h);ai(Ou,l[0],l[3],c,-c,0,0,0);const u=sn(r,0,r.length,o,Ou,a),d=Vr(n,i);return d?d(u,u,o):u}:Vr(n,i);return this.applyTransform(s),this}}class mc extends ey{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return ic(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return ct()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length1)u=i;else if(d>0){for(let g=0;gs&&(s=l),r=o,a=h}return s}function qf(e,t,i,n,s){for(let r=0,a=i.length;r0;){const u=l.pop(),d=l.pop();let g=0;const f=e[d],_=e[d+1],m=e[u],p=e[u+1];for(let y=d+n;yg&&(c=y,g=E)}g>s&&(h[(c-t)/n]=1,d+n0&&_>g)&&(f<0&&m0&&m>f)){l=u,c=d;continue}r[a++]=l,r[a++]=c,o=l,h=c,l=u,c=d}return r[a++]=l,r[a++]=c,a}function pc(e,t,i,n,s,r,a,o){for(let h=0,l=i.length;hr&&(l-o)*(r-h)-(s-o)*(c-h)>0&&a++:c<=r&&(l-o)*(r-h)-(s-o)*(c-h)<0&&a--,o=l,h=c}return a!==0}function vc(e,t,i,n,s,r){if(i.length===0||!Mn(e,t,i[0],n,s,r))return!1;for(let a=1,o=i.length;ap&&(l=(c+u)/2,vc(e,t,i,n,l,f)&&(m=l,p=y)),c=u}return isNaN(m)&&(m=s[r]),a?(a.push(m,f,p),a):[m,f,p]}function ly(e,t,i,n,s){let r=[];for(let a=0,o=i.length;a=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:cy(e,t,i,n,function(a,o){return dm(s,a,o)}):!1}function eT(e,t,i,n,s){for(let r=0,a=i.length;r0}function ig(e,t,i,n,s){s=s!==void 0?s:!1;for(let r=0,a=i.length;r1&&typeof arguments[i-1]=="function"&&(n=arguments[i-1],--i);let s=0;for(;s0}getInteracting(){return this.hints_[Ut.INTERACTING]>0}cancelAnimations(){this.setHint(Ut.ANIMATING,-this.hints_[Ut.ANIMATING]);let t;for(let i=0,n=this.animations_.length;i=0;--n){const s=this.animations_[n];let r=!0;for(let a=0,o=s.length;a0?l/h.duration:1;c>=1?(h.complete=!0,c=1):r=!1;const u=h.easing(c);if(h.sourceCenter){const d=h.sourceCenter[0],g=h.sourceCenter[1],f=h.targetCenter[0],_=h.targetCenter[1];this.nextCenter_=h.targetCenter;const m=d+u*(f-d),p=g+u*(_-g);this.targetCenter_=[m,p]}if(h.sourceResolution&&h.targetResolution){const d=u===1?h.targetResolution:h.sourceResolution+u*(h.targetResolution-h.sourceResolution);if(h.anchor){const g=this.getViewportSize_(this.getRotation()),f=this.constraints_.resolution(d,0,g,!0);this.targetCenter_=this.calculateCenterZoom(f,h.anchor)}this.nextResolution_=h.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(h.sourceRotation!==void 0&&h.targetRotation!==void 0){const d=u===1?ps(h.targetRotation+Math.PI,2*Math.PI)-Math.PI:h.sourceRotation+u*(h.targetRotation-h.sourceRotation);if(h.anchor){const g=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(g,h.anchor)}this.nextRotation_=h.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),i=!0,!h.complete)break}if(r){this.animations_[n]=null,this.setHint(Ut.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const a=s[0].callback;a&&so(a,!0)}}this.animations_=this.animations_.filter(Boolean),i&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,i){let n;const s=this.getCenterInternal();return s!==void 0&&(n=[s[0]-i[0],s[1]-i[1]],ac(n,t-this.getRotation()),gm(n,i)),n}calculateCenterZoom(t,i){let n;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const a=i[0]-t*(i[0]-s[0])/r,o=i[1]-t*(i[1]-s[1])/r;n=[a,o]}return n}getViewportSize_(t){const i=this.viewportSize_;if(t){const n=i[0],s=i[1];return[Math.abs(n*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(s*Math.cos(t))]}return i}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&El(t,this.getProjection())}getCenterInternal(){return this.get(Fe.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const i=this.calculateExtentInternal(t);return uc(i,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const i=this.getCenterInternal();ut(i,"The view center is not defined");const n=this.getResolution();ut(n!==void 0,"The view resolution is not defined");const s=this.getRotation();return ut(s!==void 0,"The view rotation is not defined"),qr(i,n,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Fe.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,i){return this.getResolutionForExtentInternal(ei(t,this.getProjection()),i)}getResolutionForExtentInternal(t,i){i=i||this.getViewportSizeMinusPadding_();const n=st(t)/i[0],s=It(t)/i[1];return Math.max(n,s)}getResolutionForValueFunction(t){t=t||2;const i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(i/n)/Math.log(t);return function(r){return i/Math.pow(t,r*s)}}getRotation(){return this.get(Fe.ROTATION)}getValueForResolutionFunction(t){const i=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(n/s)/i;return function(a){return Math.log(n/a)/i/r}}getViewportSizeMinusPadding_(t){let i=this.getViewportSize_(t);const n=this.padding_;return n&&(i=[i[0]-n[1]-n[3],i[1]-n[0]-n[2]]),i}getState(){const t=this.getProjection(),i=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const a=this.getViewportSizeMinusPadding_();s=zh(s,this.getViewportSize_(),[a[0]/2+r[3],a[1]/2+r[0]],i,n)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:i,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const i=this.getResolution();return i!==void 0&&(t=this.getZoomForResolution(i)),t}getZoomForResolution(t){let i=this.minZoom_||0,n,s;if(this.resolutions_){const r=hh(this.resolutions_,t,1);i=r,n=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=n/this.resolutions_[r+1]}else n=this.maxResolution_,s=this.zoomFactor_;return i+Math.log(n/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const i=Rt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[i]/this.resolutions_[i+1];return this.resolutions_[i]/Math.pow(n,Rt(t-i,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,i){let n;if(ut(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){ut(!Un(t),"Cannot fit empty extent provided as `geometry`");const s=ei(t,this.getProjection());n=ku(s)}else if(t.getType()==="Circle"){const s=ei(t.getExtent(),this.getProjection());n=ku(s),n.rotate(this.getRotation(),Oe(s))}else n=t;this.fitInternal(n,i)}rotatedExtentForGeometry(t){const i=this.getRotation(),n=Math.cos(i),s=Math.sin(-i),r=t.getFlatCoordinates(),a=t.getStride();let o=1/0,h=1/0,l=-1/0,c=-1/0;for(let u=0,d=r.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let i;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof be?i={viewState:t.getState(),extent:t.calculateExtent()}:i=t,!i.layerStatesArray&&n&&(i.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let s;if(i.layerStatesArray){if(s=i.layerStatesArray.find(a=>a.layer===this),!s)return!1}else s=this.getLayerState();const r=this.getExtent();return wc(s,i.viewState)&&(!r||te(r,i.extent))}getAttributions(t){if(!this.isVisible(t))return[];const i=this.getSource()?.getAttributions();if(!i)return[];const n=t instanceof be?t.getViewStateAndExtent():t;let s=i(n);return Array.isArray(s)||(s=[s]),s}render(t,i){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,i)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,i){}renderDeferred(t){const i=this.getRenderer();i&&i.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(xt.MAP,t)}getMapInternal(){return this.get(xt.MAP)}setMap(t){this.mapPrecomposeKey_&&(wt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(wt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=lt(t,Ae.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=lt(this,Q.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const i=t.frameState.layerStatesArray,n=this.getLayerState(!1);ut(!i.some(s=>s.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),i.push(n)}setSource(t){this.set(xt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function wc(e,t){if(!e.visible)return!1;const i=t.resolution;if(i=e.maxResolution)return!1;const n=t.zoom;return n>e.minZoom&&n<=e.maxZoom}var Wt=[];for(var Uh=0;Uh<256;++Uh)Wt.push((Uh+256).toString(16).slice(1));function yy(e,t=0){return(Wt[e[t+0]]+Wt[e[t+1]]+Wt[e[t+2]]+Wt[e[t+3]]+"-"+Wt[e[t+4]]+Wt[e[t+5]]+"-"+Wt[e[t+6]]+Wt[e[t+7]]+"-"+Wt[e[t+8]]+Wt[e[t+9]]+"-"+Wt[e[t+10]]+Wt[e[t+11]]+Wt[e[t+12]]+Wt[e[t+13]]+Wt[e[t+14]]+Wt[e[t+15]]).toLowerCase()}var ro,py=new Uint8Array(16);function vy(){if(!ro&&(ro=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ro))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ro(py)}var xy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Gu={randomUUID:xy};function Ey(e,t,i){if(Gu.randomUUID&&!t&&!e)return Gu.randomUUID();e=e||{};var n=e.random||(e.rng||vy)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,yy(n)}const My=Ai("map:AbstractLayerModel");var bs,ji,oa,Is,As,Ls,ha,Ps;class ng extends rf{constructor(i){super();N(this,bs);N(this,ji);N(this,oa);N(this,Is);N(this,As);N(this,Ls,_f());N(this,ha);N(this,Ps,!1);Y(this,oa,i.id??Ey()),Y(this,ha,Xr(()=>Object.fromEntries(x(this,Ls).entries()))),Y(this,Is,$t(i.title)),Y(this,As,$t(i.description??"")),i.attributes&&this.updateAttributes(i.attributes)}get __destroyed(){return x(this,Ps)}get map(){const i=x(this,bs);if(!i)throw new Error(`Layer '${this.id}' has not been attached to a map yet.`);return i}get id(){return x(this,oa)}get title(){return x(this,Is).value}get description(){return x(this,As).value}get attributes(){return x(this,ha).value}get parent(){return x(this,ji)}get children(){return this.layers??this.sublayers??void 0}destroy(){if(!x(this,Ps)){Y(this,Ps,!0),this.sublayers?.destroy(),this.layers?.destroy();try{this.emit("destroy")}catch(i){My.warn("Unexpected error from event listener during layer destruction:",i)}}}__attachToMap(i){if(x(this,bs))throw new Error(`Layer '${this.id}' has already been attached to the map '${this.map.id}'`);Y(this,bs,i)}__attachToGroup(i){if(x(this,ji))throw new Error(`Layer '${this.id}' has already been attached to the group layer '${x(this,ji).id}'`);Y(this,ji,i)}__detachFromGroup(){Y(this,ji,void 0)}setTitle(i){x(this,Is).value=i}setDescription(i){x(this,As).value=i}updateAttributes(i){const n=Reflect.ownKeys(i);Jl(()=>{for(const s of n)x(this,Ls).set(s,i[s])})}deleteAttribute(i){x(this,Ls).delete(i)}}bs=new WeakMap,ji=new WeakMap,oa=new WeakMap,Is=new WeakMap,As=new WeakMap,Ls=new WeakMap,ha=new WeakMap,Ps=new WeakMap;const Eo=Ai("map:AbstractLayer");var Je,la,ca,Os,Tn,bn,Ds;class Js extends ng{constructor(i){super(i);N(this,Je);N(this,la);N(this,ca);N(this,Os);N(this,Tn);N(this,bn);N(this,Ds);Y(this,Je,i.olLayer),Y(this,la,i.isBaseLayer??!1),Y(this,ca,i.healthCheck),Y(this,Os,R_(()=>x(this,Je).getVisible())),Y(this,bn,x(this,Je).on("change:visible",x(this,Os).trigger)),Y(this,Tn,$t(Sl(wl(x(this,Je))))),this.__setVisible(i.visible??!0)}get visible(){return x(this,Os).value}get olLayer(){return x(this,Je)}get isBaseLayer(){return x(this,la)}get loadState(){return x(this,Tn).value}destroy(){this.__destroyed||(Y(this,Ds,nf(x(this,Ds))),x(this,bn)&&je(x(this,bn)),Y(this,bn,void 0),this.olLayer.dispose(),super.destroy())}__attachToMap(i){super.__attachToMap(i);const{initial:n,resource:s}=wy(this,x(this,ca),r=>{x(this,Tn).value=r});Y(this,Ds,s),x(this,Tn).value=n}setVisible(i){if(this.isBaseLayer){Eo.warn(`Cannot change visibility of base layer '${this.id}': use activateBaseLayer() on the map's LayerCollection instead.`);return}this.__setVisible(i)}__setVisible(i){x(this,Je).getVisible()!==i&&x(this,Je).setVisible(i)}}Je=new WeakMap,la=new WeakMap,ca=new WeakMap,Os=new WeakMap,Tn=new WeakMap,bn=new WeakMap,Ds=new WeakMap;function wy(e,t,i){const n=e.olLayer;if(!(n instanceof Bn))return{initial:"loaded",resource:{destroy(){}}};let s=wl(n);const r=Sl(s);let a=r,o="loading";r!=="error"&&Sy(e,t).then(u=>{o=u,h()});const h=()=>{const u=Sl(s),d=o==="error"?"error":u;a!==d&&(a=d,i(a))};let l;l=s?.on("change",()=>{h()});const c=n.on("change:source",()=>{l&&je(l),l=void 0,s=wl(n),l=s?.on("change",()=>{h()}),h()});return{initial:a,resource:{destroy(){l&&je(l),je(c)}}}}async function Sy(e,t){if(t==null)return"loaded";let i;if(typeof t=="function")i=t;else if(typeof t=="string")i=async()=>{const s=await e.map.__sharedDependencies.httpService.fetch(t);return s.ok?"loaded":(Eo.warn(`Health check failed for layer '${e.id}' (http status ${s.status})`),"error")};else return Eo.error(`Unexpected object for 'healthCheck' parameter of layer '${e.id}'`,t),"error";try{return await i(e)}catch(n){return Eo.warn(`Health check failed for layer '${e.id}'`,n),"error"}}function wl(e){if(e instanceof Bn)return e?.getSource()??void 0}function Sl(e){switch(e?.getState()){case void 0:return"loaded";case"undefined":return"not-loaded";case"loading":return"loading";case"ready":return"loaded";case"error":return"error"}}class Ry extends Js{get type(){return"simple"}get legend(){}get layers(){}get sublayers(){}}const aT=Ry;function Sc(e,t){return sg(e,t,[]).join("")}function sg(e,t,i){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)i.push(e.nodeValue);else{let n;for(n=e.firstChild;n;n=n.nextSibling)sg(n,t,i)}return i}function Cy(e){return"documentElement"in e}function Ty(e){return new DOMParser().parseFromString(e,"application/xml")}function $r(e,t){return function(i,n){const s=e.call(this,i,n);s!==void 0&&n[n.length-1].push(s)}}function ft(e,t,i){return function(n,s){const r=e.call(this,n,s);if(r!==void 0){const a=s[s.length-1],o=n.localName;let h;o in a?h=a[o]:(h=[],a[o]=h),h.push(r)}}}function A(e,t,i){return function(n,s){const r=e.call(this,n,s);if(r!==void 0){const a=s[s.length-1],o=n.localName;a[o]=r}}}function Z(e,t,i){i=i!==void 0?i:{};let n,s;for(n=0,s=e.length;n=0}const Ay=Z(Dt,{Service:A(Qy),Capability:A(Jy)}),rg={Request:A(h1),Exception:A(n1),Layer:A(s1)},Ly=Z(Dt,{...rg,UserDefinedSymbolization:A(Zy)}),Py=Z(Dt,rg);class Oy extends Rc{constructor(){super(),this.version=void 0}readFromNode(t){this.version=t.getAttribute("version").trim();const i=et({version:this.version},Ay,t,[]);return i||null}}const ag={Name:A(X),Title:A(X),Abstract:A(X),KeywordList:A(dg),OnlineResource:A(hr),ContactInformation:A(t1),Fees:A(X),AccessConstraints:A(X)},Dy=Z(Dt,ag),Fy=Z(Dt,{...ag,LayerLimit:A(Xe),MaxWidth:A(Xe),MaxHeight:A(Xe)}),Ny=Z(Dt,{ContactPersonPrimary:A(e1),ContactPosition:A(X),ContactAddress:A(i1),ContactVoiceTelephone:A(X),ContactFacsimileTelephone:A(X),ContactElectronicMailAddress:A(X)}),ky=Z(Dt,{ContactPerson:A(X),ContactOrganization:A(X)}),Gy=Z(Dt,{AddressType:A(X),Address:A(X),City:A(X),StateOrProvince:A(X),PostCode:A(X),Country:A(X)}),zy=Z(Dt,{Format:$r(X)}),og={Name:A(X),Title:A(X),Abstract:A(X),KeywordList:A(dg),BoundingBox:ft(cg),Dimension:ft(r1),Attribution:A($y),AuthorityURL:ft(u1),Identifier:ft(X),MetadataURL:ft(d1),DataURL:ft(bi),FeatureListURL:ft(bi),Style:ft(f1),Layer:ft(xh)},hg=Z(Dt,{...og,SRS:ft(X),Extent:A(a1),ScaleHint:ft(o1),LatLonBoundingBox:A((e,t)=>cg(e,t,!1)),Layer:ft(xh)}),lg=Z(Dt,{...og,CRS:ft(X),EX_GeographicBoundingBox:A(Hy),MinScaleDenominator:A(wn),MaxScaleDenominator:A(wn),Layer:ft(xh)}),Uy=Z(Dt,{Title:A(X),OnlineResource:A(hr),LogoURL:A(ug)}),By=Z(Dt,{westBoundLongitude:A(wn),eastBoundLongitude:A(wn),southBoundLatitude:A(wn),northBoundLatitude:A(wn)}),Wy=Z(Dt,{GetCapabilities:A(Bh),GetMap:A(Bh),GetFeatureInfo:A(Bh)}),Xy=Z(Dt,{Format:ft(X),DCPType:ft(l1)}),jy=Z(Dt,{HTTP:A(c1)}),Yy=Z(Dt,{Get:A(bi),Post:A(bi)}),qy=Z(Dt,{Name:A(X),Title:A(X),Abstract:A(X),LegendURL:ft(ug),StyleSheetURL:A(bi),StyleURL:A(bi)}),Vy=Z(Dt,{Format:A(X),OnlineResource:A(hr)}),Ky=Z(Dt,{Keyword:$r(X)});function $y(e,t){return et({},Uy,e,t)}function Zy(e,t){return{SupportSLD:!!We(e.getAttribute("UserDefinedSymbolization")),UserLayer:!!We(e.getAttribute("UserLayer")),UserStyle:!!We(e.getAttribute("UserStyle")),RemoteWFS:!!We(e.getAttribute("RemoteWFS"))}}function cg(e,t,i=!0){const n=[ze(e.getAttribute("minx")),ze(e.getAttribute("miny")),ze(e.getAttribute("maxx")),ze(e.getAttribute("maxy"))],s=[ze(e.getAttribute("resx")),ze(e.getAttribute("resy"))],r={extent:n,res:s};return i&&(lr(t)?r.crs=e.getAttribute("CRS"):r.srs=e.getAttribute("SRS")),r}function Hy(e,t){const i=et({},By,e,t);if(!i)return;const n=i.westBoundLongitude,s=i.southBoundLatitude,r=i.eastBoundLongitude,a=i.northBoundLatitude;if(!(n===void 0||s===void 0||r===void 0||a===void 0))return[n,s,r,a]}function Jy(e,t){return et({},lr(t)?Py:Ly,e,t)}function Qy(e,t){return et({},lr(t)?Fy:Dy,e,t)}function t1(e,t){return et({},Ny,e,t)}function e1(e,t){return et({},ky,e,t)}function i1(e,t){return et({},Gy,e,t)}function n1(e,t){return et([],zy,e,t)}function s1(e,t){const i=et({},lr(t)?lg:hg,e,t);return i.Layer===void 0?Object.assign(i,xh(e,t)):i}function xh(e,t){const i=lr(t),n=t[t.length-1],s=et({},i?lg:hg,e,t);if(!s)return;let r=We(e.getAttribute("queryable"));r===void 0&&(r=n.queryable),s.queryable=r!==void 0?r:!1;let a=ko(e.getAttribute("cascaded"));a===void 0&&(a=n.cascaded),s.cascaded=a;let o=We(e.getAttribute("opaque"));o===void 0&&(o=n.opaque),s.opaque=o!==void 0?o:!1;let h=We(e.getAttribute("noSubsets"));h===void 0&&(h=n.noSubsets),s.noSubsets=h!==void 0?h:!1;let l=ze(e.getAttribute("fixedWidth"));l||(l=n.fixedWidth),s.fixedWidth=l;let c=ze(e.getAttribute("fixedHeight"));c||(c=n.fixedHeight),s.fixedHeight=c;const u=["Style","AuthorityURL"];i?u.push("CRS"):u.push("SRS","Dimension"),u.forEach(function(g){if(g in n){const f=s[g]||[];s[g]=f.concat(n[g])}});const d=["BoundingBox","Attribution"];return i?d.push("Dimension","EX_GeographicBoundingBox","MinScaleDenominator","MaxScaleDenominator"):d.push("LatLonBoundingBox","ScaleHint","Extent"),d.forEach(function(g){if(!(g in s)){const f=n[g];s[g]=f}}),s}function r1(e,t){const i={name:e.getAttribute("name"),units:e.getAttribute("units"),unitSymbol:e.getAttribute("unitSymbol")};return lr(t)&&Object.assign(i,{default:e.getAttribute("default"),multipleValues:We(e.getAttribute("multipleValues")),nearestValue:We(e.getAttribute("nearestValue")),current:We(e.getAttribute("current")),values:X(e)}),i}function a1(e,t){return{name:e.getAttribute("name"),default:e.getAttribute("default"),nearestValue:We(e.getAttribute("nearestValue"))}}function o1(e,t){return{min:ze(e.getAttribute("min")),max:ze(e.getAttribute("max"))}}function bi(e,t){return et({},Vy,e,t)}function h1(e,t){return et({},Wy,e,t)}function l1(e,t){return et({},jy,e,t)}function c1(e,t){return et({},Yy,e,t)}function Bh(e,t){return et({},Xy,e,t)}function ug(e,t){const i=bi(e,t);if(i){const n=[ko(e.getAttribute("width")),ko(e.getAttribute("height"))];return i.size=n,i}}function u1(e,t){const i=bi(e,t);if(i)return i.name=e.getAttribute("name"),i}function d1(e,t){const i=bi(e,t);if(i)return i.type=e.getAttribute("type"),i}function f1(e,t){return et({},qy,e,t)}function dg(e,t){return et([],Ky,e,t)}class g1 extends Bn{constructor(t){t=t||{},super(t)}}const q={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},_1=5;class m1 extends Ga{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=_1}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return ct()}getData(t){return null}prepareFrame(t){return ct()}renderFrame(t,i){return ct()}forEachFeatureAtCoordinate(t,i,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const i=t.target;(i.getState()===q.LOADED||i.getState()===q.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let i=t.getState();return i!=q.LOADED&&i!=q.ERROR&&t.addEventListener(Q.CHANGE,this.boundHandleImageChange_),i==q.IDLE&&(t.load(),i=t.getState()),i==q.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class fg extends li{constructor(t,i,n,s){super(t),this.inversePixelTransform=i,this.frameState=n,this.context=s}}const an=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",y1=an.includes("firefox"),p1=an.includes("safari")&&!an.includes("chrom");p1&&(an.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(an));const v1=an.includes("webkit")&&!an.includes("edge"),gg=an.includes("macintosh"),_g=typeof devicePixelRatio<"u"?devicePixelRatio:1,Cc=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Tc=typeof Image<"u"&&Image.prototype.decode,x1=typeof createImageBitmap=="function",mg=function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return e}();function Ot(e,t,i,n){let s;return i&&i.length?s=i.shift():Cc?s=new OffscreenCanvas(e||300,t||300):s=document.createElement("canvas"),e&&(s.width=e),t&&(s.height=t),s.getContext("2d",n)}let Wh;function Go(){return Wh||(Wh=Ot(1,1)),Wh}function Eh(e){const t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function oT(e){let t=e.offsetWidth;const i=getComputedStyle(e);return t+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10),t}function hT(e){let t=e.offsetHeight;const i=getComputedStyle(e);return t+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10),t}function zu(e,t){const i=t.parentNode;i&&i.replaceChild(e,t)}function E1(e){for(;e.lastChild;)e.lastChild.remove()}function M1(e,t){const i=e.childNodes;for(let n=0;;++n){const s=i[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){e.appendChild(r);continue}if(!r){e.removeChild(s),--n;continue}e.insertBefore(r,s)}}}class yg{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Go(),{get:(t,i)=>{if(typeof Go()[i]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(i),this.pushMethodArgs_},set:(t,i,n)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(i,n),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(i=>{for(let n=0,s=i.length;n.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[r*255,a*255,o*255]};Zr.xyz=function(e,t){var i=e[0]/255,n=e[1]/255,s=e[2]/255;i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=i*.41239079926595+n*.35758433938387+s*.18048078840183,a=i*.21263900587151+n*.71516867876775+s*.072192315360733,o=i*.019330818715591+n*.11919477979462+s*.95053215224966;return t=t||jt.whitepoint[2].E,[r*t[0],a*t[1],o*t[2]]};const bc={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(e,t,i){var n,s,r,a,o,h,l,c,u,d,g,f,_;if(r=e[0],a=e[1],o=e[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",i=i||2,u=jt.whitepoint[i][t][0],d=jt.whitepoint[i][t][1],g=jt.whitepoint[i][t][2],f=4*u/(u+15*d+3*g),_=9*d/(u+15*d+3*g),n=a/(13*r)+f||0,s=o/(13*r)+_||0,l=r>8?d*Math.pow((r+16)/116,3):d*r*m,h=l*9*n/(4*s)||0,c=l*(12-3*n-20*s)/(4*s)||0,[h,l,c]}};jt.luv=function(e,t,i){var n,s,r,a,o,h,l,c,u,d,g,f,_,m=.008856451679035631,p=903.2962962962961;t=t||"D65",i=i||2,u=jt.whitepoint[i][t][0],d=jt.whitepoint[i][t][1],g=jt.whitepoint[i][t][2],f=4*u/(u+15*d+3*g),_=9*d/(u+15*d+3*g),h=e[0],l=e[1],c=e[2],n=4*h/(h+15*l+3*c)||0,s=9*l/(h+15*l+3*c)||0;var y=l/d;return r=y<=m?p*y:116*Math.pow(y,1/3)-16,a=13*r*(n-f),o=13*r*(s-_),[r,a,o]};var pg={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(e){var t=e[0],i=e[1],n=e[2],s,r,a;return a=n/360*2*Math.PI,s=i*Math.cos(a),r=i*Math.sin(a),[t,s,r]},xyz:function(e){return bc.xyz(pg.luv(e))}};bc.lchuv=function(e){var t=e[0],i=e[1],n=e[2],s=Math.sqrt(i*i+n*n),r=Math.atan2(n,i),a=r*360/2/Math.PI;return a<0&&(a+=360),[t,s,a]};jt.lchuv=function(e){return bc.lchuv(jt.luv(e))};const Uu={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Bu={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function w1(e){var t,i=[],n=1,s;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),Uu[e])i=Uu[e].slice(),s="rgb";else if(e==="transparent")n=0,s="rgb",i=[0,0,0];else if(e[0]==="#"){var r=e.slice(1),a=r.length,o=a<=4;n=1,o?(i=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],a===4&&(n=parseInt(r[3]+r[3],16)/255)):(i=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],a===8&&(n=parseInt(r[6]+r[7],16)/255)),i[0]||(i[0]=0),i[1]||(i[1]=0),i[2]||(i[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var h=t[1];s=h.replace(/a$/,"");var l=s==="cmyk"?4:s==="gray"?1:3;i=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=i.shift()),i=i.map(function(c,u){if(c[c.length-1]==="%")return c=parseFloat(c)/100,u===3?c:s==="rgb"?c*255:s[0]==="h"||s[0]==="l"&&!u?c*100:s==="lab"?c*125:s==="lch"?u<2?c*150:c*360:s[0]==="o"&&!u?c:s==="oklab"?c*.4:s==="oklch"?u<2?c*.4:c*360:c;if(s[u]==="h"||u===2&&s[s.length-1]==="h"){if(Bu[c]!==void 0)return Bu[c];if(c.endsWith("deg"))return parseFloat(c);if(c.endsWith("turn"))return parseFloat(c)*360;if(c.endsWith("grad"))return parseFloat(c)*360/400;if(c.endsWith("rad"))return parseFloat(c)*180/Math.PI}return c==="none"?0:parseFloat(c)}),n=i.length>l?i.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(i=e.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),s=e.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:i,alpha:n}}const Xh={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t=e[0]/360,i=e[1]/100,n=e[2]/100,s,r,a,o,h,l=0;if(i===0)return h=n*255,[h,h,h];for(r=n<.5?n*(1+i):n+i-n*i,s=2*n-r,o=[0,0,0];l<3;)a=t+1/3*-(l-1),a<0?a++:a>1&&a--,h=6*a<1?s+(r-s)*6*a:2*a<1?r:3*a<2?s+(r-s)*(2/3-a)*6:s,o[l++]=h*255;return o}};Zr.hsl=function(e){var t=e[0]/255,i=e[1]/255,n=e[2]/255,s=Math.min(t,i,n),r=Math.max(t,i,n),a=r-s,o,h,l;return r===s?o=0:t===r?o=(i-n)/a:i===r?o=2+(n-t)/a:n===r&&(o=4+(t-i)/a),o=Math.min(o*60,360),o<0&&(o+=360),l=(s+r)/2,r===s?h=0:l<=.5?h=a/(r+s):h=a/(2-r-s),[o,h*100,l*100]};function S1(e){Array.isArray(e)&&e.raw&&(e=String.raw(...arguments)),e instanceof Number&&(e=+e);var t,i=w1(e);if(!i.space)return[];const n=i.space[0]==="h"?Xh.min:Zr.min,s=i.space[0]==="h"?Xh.max:Zr.max;return t=Array(3),t[0]=Math.min(Math.max(i.values[0],n[0]),s[0]),t[1]=Math.min(Math.max(i.values[1],n[1]),s[1]),t[2]=Math.min(Math.max(i.values[2],n[2]),s[2]),i.space[0]==="h"&&(t=Xh.rgb(t)),t.push(Math.min(Math.max(i.alpha,0),1)),t}const Ic=[NaN,NaN,NaN,0];function R1(e){return typeof e=="string"?e:Lc(e)}const C1=1024,vr={};let jh=0;function T1(e){if(e.length===4)return e;const t=e.slice();return t[3]=1,t}function Wu(e){const t=jt.lchuv(Zr.xyz(e));return t[3]=e[3],t}function b1(e){const t=jt.rgb(pg.xyz(e));return t[3]=e[3],t}function Ac(e){if(e==="none")return Ic;if(vr.hasOwnProperty(e))return vr[e];if(jh>=C1){let i=0;for(const n in vr)i++&3||(delete vr[n],--jh)}const t=S1(e);if(t.length!==4)throw new Error('failed to parse "'+e+'" as color');for(const i of t)if(isNaN(i))throw new Error('failed to parse "'+e+'" as color');return vg(t),vr[e]=t,++jh,t}function Qs(e){return Array.isArray(e)?e:Ac(e)}function vg(e){return e[0]=Rt(e[0]+.5|0,0,255),e[1]=Rt(e[1]+.5|0,0,255),e[2]=Rt(e[2]+.5|0,0,255),e[3]=Rt(e[3],0,1),e}function Lc(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let i=e[1];i!=(i|0)&&(i=i+.5|0);let n=e[2];n!=(n|0)&&(n=n+.5|0);const s=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return"rgba("+t+","+i+","+n+","+s+")"}const Xu=[];let ss=null;function I1(){ss=Ot(1,1,void 0,{willReadFrequently:!0})}class Pc extends m1{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Ye(),this.pixelTransform=Ye(),this.inversePixelTransform=Ye(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,i,n){ss||I1(),ss.clearRect(0,0,1,1);let s;try{ss.drawImage(t,i,n,1,1,0,0,1,1),s=ss.getImageData(0,0,1,1).data}catch{return ss=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,i,n){const s=this.getLayer().getClassName();let r,a;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&ln(Qs(t.style.backgroundColor),Qs(n)))){const o=t.firstElementChild;o instanceof HTMLCanvasElement&&(a=o.getContext("2d"))}if(a&&a.canvas.style.transform===i?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){r=document.createElement("div"),r.className=s;let o=r.style;o.position="absolute",o.width="100%",o.height="100%",a=Ot();const h=a.canvas;r.appendChild(h),o=h.style,o.position="absolute",o.left="0",o.transformOrigin="top left",this.container=r,this.context=a}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,i,n){const s=Ti(n),r=gh(n),a=fh(n),o=dh(n);Nt(i.coordinateToPixelTransform,s),Nt(i.coordinateToPixelTransform,r),Nt(i.coordinateToPixelTransform,a),Nt(i.coordinateToPixelTransform,o);const h=this.inversePixelTransform;Nt(h,s),Nt(h,r),Nt(h,a),Nt(h,o),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,i){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,a=t.pixelRatio,o=Math.round(st(n)/s*a),h=Math.round(It(n)/s*a);ai(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,r,-o/2,-h/2),Xf(this.inversePixelTransform,this.pixelTransform);const l=Jm(this.pixelTransform);if(this.useContainer(i,l,this.getBackground(t)),!this.containerReused){const c=this.context.canvas;c.width!=o||c.height!=h?(c.width=o,c.height=h):this.context.clearRect(0,0,o,h),l!==c.style.transform&&(c.style.transform=l)}}dispatchRenderEvent_(t,i,n){const s=this.getLayer();if(s.hasListener(t)){const r=new fg(t,this.inversePixelTransform,n,i);s.dispatchEvent(r)}}preRender(t,i){this.frameState=i,!i.declutter&&this.dispatchRenderEvent_(Ae.PRERENDER,t,i)}postRender(t,i){i.declutter||this.dispatchRenderEvent_(Ae.POSTRENDER,t,i)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new yg),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(Ae.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(Ae.POSTRENDER,this.context,t))}getRenderTransform(t,i,n,s,r,a,o){const h=r/2,l=a/2,c=s/i,u=-c,d=-t[0]+o,g=-t[1];return ai(this.tempTransform,h,l,c,u,-n,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class A1 extends Pc{constructor(t){super(t),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(t){const i=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,s=t.viewState,r=s.resolution,a=this.getLayer().getSource(),o=t.viewHints;let h=t.extent;if(i.extent!==void 0&&(h=ye(h,ei(i.extent,s.projection))),!o[Ut.ANIMATING]&&!o[Ut.INTERACTING]&&!Un(h))if(a){const l=s.projection,c=a.getImage(h,r,n,l);c&&(this.loadImage(c)?this.image=c:c.getState()===q.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(t){const i=this.frameState;if(!i)return null;const n=this.getLayer(),s=Nt(i.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!Nn(r,s))return null;const a=this.image.getExtent(),o=this.image.getImage(),h=st(a),l=Math.floor(o.width*((s[0]-a[0])/h));if(l<0||l>=o.width)return null;const c=It(a),u=Math.floor(o.height*((a[3]-s[1])/c));return u<0||u>=o.height?null:this.getImageData(o,l,u)}renderFrame(t,i){const n=this.image,s=n.getExtent(),r=n.getResolution(),[a,o]=Array.isArray(r)?r:[r,r],h=n.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],c=t.pixelRatio,u=t.viewState,d=u.center,g=u.resolution,f=c*a/(g*h),_=c*o/(g*h);this.prepareContainer(t,i);const m=this.context.canvas.width,p=this.context.canvas.height,y=this.getRenderContext(t);let M=!1,v=!0;if(l.extent){const R=ei(l.extent,u.projection);v=te(R,t.extent),M=v&&!ti(R,t.extent),M&&this.clipUnrotated(y,t,R)}const E=n.getImage(),w=ai(this.tempTransform,m/2,p/2,f,_,0,h*(s[0]-d[0])/a,h*(d[1]-s[3])/o);this.renderedResolution=o*c/h;const b=E.width*w[0],S=E.height*w[3];if(this.getLayer().getSource().getInterpolate()||(y.imageSmoothingEnabled=!1),this.preRender(y,t),v&&b>=.5&&S>=.5){const R=w[4],I=w[5],O=l.opacity;O!==1&&(y.save(),y.globalAlpha=O),y.drawImage(E,0,0,+E.width,+E.height,R,I,b,S),O!==1&&y.restore()}return this.postRender(this.context,t),M&&y.restore(),y.imageSmoothingEnabled=!0,this.container}}class L1 extends g1{constructor(t){super(t)}createRenderer(){return new A1(this)}getData(t){return super.getData(t)}}class xg extends ka{constructor(t,i,n,s){super(),this.extent=t,this.pixelRatio_=n,this.resolution=i,this.state=typeof s=="function"?q.IDLE:s,this.image_=null,this.loader=typeof s=="function"?s:null}changed(){this.dispatchEvent(Q.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==q.IDLE&&this.loader){this.state=q.LOADING,this.changed();const t=this.getResolution(),i=Array.isArray(t)?t[0]:t;Ef(()=>this.loader(this.getExtent(),i,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=q.LOADED}).catch(n=>{this.state=q.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function P1(e,t,i){const n=e;let s=!0,r=!1,a=!1;const o=[bo(n,Q.LOAD,function(){a=!0,r||t()})];return n.src&&Tc?(r=!0,n.decode().then(function(){s&&t()}).catch(function(h){s&&(a?t():i())})):o.push(bo(n,Q.ERROR,i)),function(){s=!1,o.forEach(wt)}}function O1(e,t){return new Promise((i,n)=>{function s(){a(),i(e)}function r(){a(),n(new Error("Image load error"))}function a(){e.removeEventListener("load",s),e.removeEventListener("error",r)}e.addEventListener("load",s),e.addEventListener("error",r)})}function Eg(e,t){return t&&(e.src=t),e.src&&Tc?new Promise((i,n)=>e.decode().then(()=>i(e)).catch(s=>e.complete&&e.width?i(e):n(s))):O1(e)}function Mg(e,t){return t&&(e.src=t),e.src&&Tc&&x1?e.decode().then(()=>createImageBitmap(e)).catch(i=>{if(e.complete&&e.width)return e;throw i}):Eg(e)}const Oc=.5,D1=10,ju=.25;class Dc{constructor(t,i,n,s,r,a,o){this.sourceProj_=t,this.targetProj_=i;let h={};const l=o?xl(M=>Nt(o,vh(M,this.targetProj_,this.sourceProj_))):Vr(this.targetProj_,this.sourceProj_);this.transformInv_=function(M){const v=M[0]+"/"+M[1];return h[v]||(h[v]=l(M)),h[v]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&st(s)>=st(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?st(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?st(this.targetProj_.getExtent()):null;const c=Ti(n),u=gh(n),d=fh(n),g=dh(n),f=this.transformInv_(c),_=this.transformInv_(u),m=this.transformInv_(d),p=this.transformInv_(g),y=D1+(a?Math.max(0,Math.ceil(Math.log2($s(n)/(a*a*256*256)))):0);if(this.addQuad_(c,u,d,g,f,_,m,p,y),this.wrapsXInSource_){let M=1/0;this.triangles_.forEach(function(v,E,w){M=Math.min(M,v.source[0][0],v.source[1][0],v.source[2][0])}),this.triangles_.forEach(v=>{if(Math.max(v.source[0][0],v.source[1][0],v.source[2][0])-M>this.sourceWorldWidth_/2){const E=[[v.source[0][0],v.source[0][1]],[v.source[1][0],v.source[1][1]],[v.source[2][0],v.source[2][1]]];E[0][0]-M>this.sourceWorldWidth_/2&&(E[0][0]-=this.sourceWorldWidth_),E[1][0]-M>this.sourceWorldWidth_/2&&(E[1][0]-=this.sourceWorldWidth_),E[2][0]-M>this.sourceWorldWidth_/2&&(E[2][0]-=this.sourceWorldWidth_);const w=Math.min(E[0][0],E[1][0],E[2][0]);Math.max(E[0][0],E[1][0],E[2][0])-w.5&&u<1;let f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=Ao([t,i,n,s]);f=st(m)/this.targetWorldWidth_>ju||f}!g&&this.sourceProj_.isGlobal()&&u&&(f=u>ju||f)}if(!f&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!te(c,this.maxSourceExtent_))return;let _=0;if(!f&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(h[0])||!isFinite(h[1]))){if(l>0)f=!0;else if(_=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(h[0])||!isFinite(h[1])?1:0),_!=1&&_!=2&&_!=4&&_!=8)return}if(l>0){if(!f){const m=[(t[0]+n[0])/2,(t[1]+n[1])/2],p=this.transformInv_(m);let y;g?y=(ps(r[0],d)+ps(o[0],d))/2-ps(p[0],d):y=(r[0]+o[0])/2-p[0];const M=(r[1]+o[1])/2-p[1];f=y*y+M*M>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const m=[(i[0]+n[0])/2,(i[1]+n[1])/2],p=this.transformInv_(m),y=[(s[0]+t[0])/2,(s[1]+t[1])/2],M=this.transformInv_(y);this.addQuad_(t,i,m,y,r,a,p,M,l-1),this.addQuad_(y,m,n,s,M,p,o,h,l-1)}else{const m=[(t[0]+i[0])/2,(t[1]+i[1])/2],p=this.transformInv_(m),y=[(n[0]+s[0])/2,(n[1]+s[1])/2],M=this.transformInv_(y);this.addQuad_(t,m,y,s,r,p,M,h,l-1),this.addQuad_(m,i,n,y,p,a,o,M,l-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}_&11||this.addTriangle_(t,n,s,r,o,h),_&14||this.addTriangle_(t,n,i,r,o,a),_&&(_&13||this.addTriangle_(i,s,t,a,h,r),_&7||this.addTriangle_(i,s,n,a,h,o))}calculateSourceExtent(){const t=de();return this.triangles_.forEach(function(i,n,s){const r=i.source;Nr(t,r[0]),Nr(t,r[1]),Nr(t,r[2])}),t}getTriangles(){return this.triangles_}}let Yh;const xs=[];function Yu(e,t,i,n,s){e.beginPath(),e.moveTo(0,0),e.lineTo(t,i),e.lineTo(n,s),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,n)+1,Math.max(i,s)),e.restore()}function qh(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function F1(){if(Yh===void 0){const e=Ot(6,6,xs);e.globalCompositeOperation="lighter",e.fillStyle="rgba(210, 0, 0, 0.75)",Yu(e,4,5,4,0),Yu(e,4,5,0,5);const t=e.getImageData(0,0,3,3).data;Yh=qh(t,0)||qh(t,4)||qh(t,8),Eh(e),xs.push(e.canvas)}return Yh}function zo(e,t,i,n){const s=vh(i,t,e);let r=Fo(t,n,i);const a=t.getMetersPerUnit();a!==void 0&&(r*=a);const o=e.getMetersPerUnit();o!==void 0&&(r/=o);const h=e.getExtent();if(!h||Nn(h,s)){const l=Fo(e,r,s)/r;isFinite(l)&&l>0&&(r/=l)}return r}function wg(e,t,i,n){const s=Oe(i);let r=zo(e,t,s,n);return(!isFinite(r)||r<=0)&&bf(i,function(a){return r=zo(e,t,a,n),isFinite(r)&&r>0}),r}function Sg(e,t,i,n,s,r,a,o,h,l,c,u,d,g){const f=Ot(Math.round(i*e),Math.round(i*t),xs);if(u||(f.imageSmoothingEnabled=!1),h.length===0)return f.canvas;f.scale(i,i);function _(E){return Math.round(E*i)/i}f.globalCompositeOperation="lighter";const m=de();h.forEach(function(E,w,b){nc(m,E.extent)});let p;const y=i/n,M=(u?1:1+Math.pow(2,-24))/y;if(!d||h.length!==1||l!==0){if(p=Ot(Math.round(st(m)*y),Math.round(It(m)*y),xs),u||(p.imageSmoothingEnabled=!1),s&&g){const E=(s[0]-m[0])*y,w=-(s[3]-m[3])*y,b=st(s)*y,S=It(s)*y;p.rect(E,w,b,S),p.clip()}h.forEach(function(E,w,b){if(E.image.width>0&&E.image.height>0){if(E.clipExtent){p.save();const C=(E.clipExtent[0]-m[0])*y,D=-(E.clipExtent[3]-m[3])*y,F=st(E.clipExtent)*y,G=It(E.clipExtent)*y;p.rect(u?C:Math.round(C),u?D:Math.round(D),u?F:Math.round(C+F)-Math.round(C),u?G:Math.round(D+G)-Math.round(D)),p.clip()}const S=(E.extent[0]-m[0])*y,R=-(E.extent[3]-m[3])*y,I=st(E.extent)*y,O=It(E.extent)*y;p.drawImage(E.image,l,l,E.image.width-2*l,E.image.height-2*l,u?S:Math.round(S),u?R:Math.round(R),u?I:Math.round(S+I)-Math.round(S),u?O:Math.round(R+O)-Math.round(R)),E.clipExtent&&p.restore()}})}const v=Ti(a);return o.getTriangles().forEach(function(E,w,b){const S=E.source,R=E.target;let I=S[0][0],O=S[0][1],C=S[1][0],D=S[1][1],F=S[2][0],G=S[2][1];const z=_((R[0][0]-v[0])/r),k=_(-(R[0][1]-v[1])/r),H=_((R[1][0]-v[0])/r),it=_(-(R[1][1]-v[1])/r),j=_((R[2][0]-v[0])/r),K=_(-(R[2][1]-v[1])/r),rt=I,at=O;I=0,O=0,C-=rt,D-=at,F-=rt,G-=at;const P=[[C,D,0,0,H-z],[F,G,0,0,j-z],[0,0,C,D,it-k],[0,0,F,G,K-k]],_t=J_(P);if(!_t)return;if(f.save(),f.beginPath(),F1()||!u){f.moveTo(H,it);const Ct=4,ve=z-H,De=k-it;for(let ne=0;ne{const n=this.sourceImage_.getState();(n==q.LOADED||n==q.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){wt(this.sourceListenerKey_),this.sourceListenerKey_=null}}class Fc extends ci{constructor(t){super(),this.projection=Mt(t.projection),this.attributions_=qu(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const i=this;this.viewPromise_=new Promise(function(n,s){i.viewResolver=n,i.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=qu(t),this.changed()}setState(t){this.state_=t,this.changed()}}function qu(e){return e?typeof e=="function"?e:(Array.isArray(e)||(e=[e]),t=>e):null}const tn=4,Vh={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class k1 extends li{constructor(t,i){super(t),this.image=i}}class G1 extends Fc{constructor(t){super({attributions:t.attributions,projection:t.projection,state:t.state,interpolate:t.interpolate!==void 0?t.interpolate:!0}),this.on,this.once,this.un,this.loader=t.loader||null,this.resolutions_=t.resolutions!==void 0?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=t.loader?t.loader.length===0:!1,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(t){this.resolutions_=t}findNearestResolution(t){const i=this.getResolutions();if(i){const n=hh(i,t,0);t=i[n]}return t}getImage(t,i,n,s){const r=this.getProjection();if(!r||!s||Dn(r,s))return r&&(s=r),this.getImageInternal(t,i,n,s);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Dn(this.reprojectedImage_.getProjection(),s)&&this.reprojectedImage_.getResolution()==i&&Ks(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new N1(r,s,t,i,n,(a,o,h)=>this.getImageInternal(a,o,h,r),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,i,n,s){if(this.loader){const r=Rg(t,i,n,1),a=this.findNearestResolution(i);if(this.image&&(this.static_||this.wantedProjection_===s&&(this.wantedExtent_&&ti(this.wantedExtent_,r)||ti(this.image.getExtent(),r))&&(this.wantedResolution_&&Rl(this.wantedResolution_)===a||Rl(this.image.getResolution())===a)))return this.image;this.wantedProjection_=s,this.wantedExtent_=r,this.wantedResolution_=a,this.image=new xg(r,a,n,this.loader),this.image.addEventListener(Q.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const i=t.target;let n;switch(i.getState()){case q.LOADING:this.loading=!0,n=Vh.IMAGELOADSTART;break;case q.LOADED:this.loading=!1,n=Vh.IMAGELOADEND;break;case q.ERROR:this.loading=!1,n=Vh.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new k1(n,i))}}function z1(e,t){e.getImage().src=t}function Rg(e,t,i,n){const s=t/i,r=Oe(e),a=Qi(st(e)/s,tn),o=Qi(It(e)/s,tn),h=Qi((n-1)*a/2,tn),l=a+2*h,c=Qi((n-1)*o/2,tn),u=o+2*c;return qr(r,s,0,[l,u])}function Uo(e,t,i,n){return n!==void 0?(n[0]=e,n[1]=t,n[2]=i,n):[e,t,i]}function U1(e,t,i){return e+"/"+t+"/"+i}function B1(e){return W1(e[0],e[1],e[2])}function W1(e,t,i){return(t<i||i>t.getMaxZoom())return!1;const r=t.getFullTileRange(i);return r?r.containsXY(n,s):!0}function Bo(e,t){const i=[];Object.keys(t).forEach(function(s){t[s]!==null&&t[s]!==void 0&&i.push(s+"="+encodeURIComponent(t[s]))});const n=i.join("&");return e=e.replace(/[?&]$/,""),e+=e.includes("?")?"&":"?",e+n}const j1=/\{z\}/g,Y1=/\{x\}/g,q1=/\{y\}/g,V1=/\{-y\}/g;function K1(e,t,i,n,s){return e.replace(j1,t.toString()).replace(Y1,i.toString()).replace(q1,n.toString()).replace(V1,function(){if(s===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(s-n).toString()})}function Cg(e){const t=[];let i=/\{([a-z])-([a-z])\}/.exec(e);if(i){const n=i[1].charCodeAt(0),s=i[2].charCodeAt(0);let r;for(r=n;r<=s;++r)t.push(e.replace(i[0],String.fromCharCode(r)));return t}if(i=/\{(\d+)-(\d+)\}/.exec(e),i){const n=parseInt(i[2],10);for(let s=parseInt(i[1],10);s<=n;s++)t.push(e.replace(i[0],s.toString()));return t}return t.push(e),t}const Tg="1.3.0",Vu=[101,101];function bg(e,t,i,n,s){s.WIDTH=i[0],s.HEIGHT=i[1];const r=n.getAxisOrientation(),a=rc(s.VERSION,"1.3")>=0;s[a?"CRS":"SRS"]=n.getCode();const o=a&&r.startsWith("ne")?[t[1],t[0],t[3],t[2]]:t;return s.BBOX=o.join(","),Bo(e,s)}function $1(e,t,i,n,s,r,a){r=Object.assign({REQUEST:"GetMap"},r);const o=t/i,h=[xu(st(e)/o,tn),xu(It(e)/o,tn)];if(i!=1)switch(a){case"geoserver":const c=90*i+.5|0;"FORMAT_OPTIONS"in r?r.FORMAT_OPTIONS+=";dpi:"+c:r.FORMAT_OPTIONS="dpi:"+c;break;case"mapserver":r.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":r.DPI=90*i;break;default:throw new Error("Unknown `serverType` configured")}return bg(s,e,h,n,r)}function Ig(e,t){return Object.assign({REQUEST:t,SERVICE:"WMS",VERSION:Tg,FORMAT:"image/png",STYLES:"",TRANSPARENT:!0},e)}function Z1(e){const t=e.hidpi===void 0?!0:e.hidpi,i=Mt(e.projection||"EPSG:3857"),n=e.ratio||1.5,s=e.load||Mg,r=e.crossOrigin??null;return(a,o,h)=>{a=Rg(a,o,h,n),h!=1&&(!t||e.serverType===void 0)&&(h=1);const l=$1(a,o,h,i,e.url,Ig(e.params,"GetMap"),e.serverType),c=new Image;return c.crossOrigin=r,s(c,l).then(u=>({image:u,extent:a,pixelRatio:h}))}}function H1(e,t,i){if(e.url===void 0)return;const n=Mt(e.projection||"EPSG:3857"),s=qr(t,i,0,Vu),r={QUERY_LAYERS:e.params.LAYERS,INFO_FORMAT:"application/json"};Object.assign(r,Ig(e.params,"GetFeatureInfo"),e.params);const a=ls((t[0]-s[0])/i,tn),o=ls((s[3]-t[1])/i,tn),h=rc(r.VERSION,"1.3")>=0;return r[h?"I":"X"]=a,r[h?"J":"Y"]=o,bg(e.url,s,Vu,n,r)}function J1(e,t){if(e.url===void 0)return;const i={SERVICE:"WMS",VERSION:Tg,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(t!==void 0){const n=Mt(e.projection||"EPSG:3857").getMetersPerUnit()||1,s=28e-5;i.SCALE=t*n/s}if(Object.assign(i,e.params),e.params!==void 0&&i.LAYER===void 0){const n=i.LAYERS;if(!(!Array.isArray(n)||n.length!==1))return;i.LAYER=n}return Bo(e.url,i)}class Q1 extends G1{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:z1,this.params_=Object.assign({},t.params),this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5,this.loaderProjection_=null}getFeatureInfoUrl(t,i,n,s){const r=Mt(n),a=this.getProjection();a&&a!==r&&(i=zo(a,r,t,i),t=vh(t,r,a));const o={url:this.url_,params:{...this.params_,...s},projection:a||r};return H1(o,t,i)}getLegendUrl(t,i){return J1({url:this.url_,params:{...this.params_,...i}},t)}getParams(){return this.params_}getImageInternal(t,i,n,s){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==s)&&(this.loaderProjection_=s,this.loader=Z1({crossOrigin:this.crossOrigin_,params:this.params_,projection:s,serverType:this.serverType_,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(r,a)=>(this.image.setImage(r),this.imageLoadFunction_(this.image,a),Mg(r))})),super.getImageInternal(t,i,n,s))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}async function Ag(e,t,i){const n=await t.fetch(e,{signal:i});if(!n.ok)throw new Error("Request failed: "+n.status);return await n.text()}var Yi;class Lg{constructor(t){N(this,Yi);Y(this,Yi,t)}destroy(){for(const t of x(this,Yi))t.destroy();Y(this,Yi,[])}getItems(t){return this.getSublayers(t)}getSublayers(t){return x(this,Yi).slice()}__getRawSublayers(){return x(this,Yi)}}Yi=new WeakMap;const Mo=Ai("map:WMSLayer");var Fs,In,Ns,ks,ua,da,fa,Gs,hi,Pg,Og,Dg,Fg;class lT extends Js{constructor(i){const n=new L1;super({...i,olLayer:n});N(this,hi);N(this,Fs);N(this,In);N(this,Ns);N(this,ks);N(this,ua);N(this,da,new AbortController);N(this,fa);N(this,Gs);const s=new Q1({...i.sourceOptions,url:i.url,params:{...i.sourceOptions?.params},imageLoadFunction:(r,a)=>V(this,hi,Fg).call(this,r,a).catch(o=>{Mo.error(`Failed to load tile at '${a}'`,o)})});Y(this,Fs,i.url),Y(this,ks,s),Y(this,Ns,n),Y(this,In,new Lg(Ng(i.sublayers))),Y(this,fa,Xr(()=>V(this,hi,Og).call(this),{equal(r,a){return r.length===a.length&&r.every((o,h)=>o===a[h])}})),Y(this,Gs,k_(()=>[x(this,fa).value],([r])=>{V(this,hi,Pg).call(this,r)},{immediate:!0}))}destroy(){x(this,da).abort(),Y(this,Gs,nf(x(this,Gs))),super.destroy()}get type(){return"wms"}get legend(){}get url(){return x(this,Fs)}get layers(){}get sublayers(){return x(this,In)}get capabilities(){return x(this,ua)}__attachToMap(i){super.__attachToMap(i);for(const s of x(this,In).getSublayers())s.__attach(i,this,this);const n=(s,r)=>{for(const a of s){const o=a.sublayers.getSublayers();o.length?n(o,r):a.name&&r.push(a)}};V(this,hi,Dg).call(this).then(s=>{Jl(()=>{const a=new Oy().read(s);Y(this,ua,a);const o=[];n(x(this,In).getSublayers(),o);for(const h of o){const l=ep(a,h.name);h.__setLegend(l)}})}).catch(s=>{if(Wr(s)){Mo.debug(`Layer ${this.id} has been destroyed before fetching capabilities`);return}Mo.error(`Failed to fetch WMS capabilities for layer ${this.id}`,s)})}}Fs=new WeakMap,In=new WeakMap,Ns=new WeakMap,ks=new WeakMap,ua=new WeakMap,da=new WeakMap,fa=new WeakMap,Gs=new WeakMap,hi=new WeakSet,Pg=function(i){x(this,ks).updateParams({LAYERS:i});const n=i.length===0?null:x(this,ks);x(this,Ns).getSource()!==n&&x(this,Ns).setSource(n)},Og=function(){const i=[],n=s=>{if(!s.visible)return;const r=s.sublayers.__getRawSublayers();if(r.length)for(const a of r)n(a);else s.name&&i.push(s.name)};for(const s of this.sublayers.__getRawSublayers())n(s);return i},Dg=async function(){const i=this.map.__sharedDependencies.httpService,n=`${x(this,Fs)}?LANGUAGE=ger&SERVICE=WMS&REQUEST=GetCapabilities`;return Ag(n,i,x(this,da).signal)},Fg=async function(i,n){const s=this.map.__sharedDependencies.httpService,r=i.getImage(),a=await s.fetch(n);if(!a.ok)throw new Error(`Request failed with status ${a.status}.`);const o=await a.blob(),h=URL.createObjectURL(o),l=()=>{URL.revokeObjectURL(h),r.removeEventListener("load",l),r.removeEventListener("error",l)};r.addEventListener("load",l),r.addEventListener("error",l),r.src=h};var An,Ln,ga,_a,ma,zs;class tp extends ng{constructor(i){super(i);N(this,An);N(this,Ln);N(this,ga);N(this,_a,$t());N(this,ma);N(this,zs);Y(this,ga,i.name),Y(this,zs,$t(i.visible??!0)),Y(this,ma,new Lg(Ng(i.sublayers)))}get type(){return"wms-sublayer"}get name(){return x(this,ga)}get layers(){}get sublayers(){return x(this,ma)}get parent(){const i=x(this,An);if(!i)throw new Error(`WMS sublayer ${this.id} has not been attached to its parent yet.`);return i}get parentLayer(){const i=x(this,Ln);if(!i)throw new Error(`WMS sublayer ${this.id} has not been attached to its parent yet.`);return i}get legend(){return x(this,_a).value}get visible(){return x(this,zs).value}__attach(i,n,s){if(super.__attachToMap(i),x(this,An))throw new Error(`WMS sublayer '${this.id}' has already been attached to parent '${x(this,An).id}'`);if(Y(this,An,s),x(this,Ln))throw new Error(`WMS sublayer '${this.id}' has already been attached to parent layer '${x(this,Ln).id}'`);Y(this,Ln,n);for(const r of this.sublayers.__getRawSublayers())r.__attach(i,n,this)}__setLegend(i){x(this,_a).value=i}setVisible(i){x(this,zs).value=i}}An=new WeakMap,Ln=new WeakMap,ga=new WeakMap,_a=new WeakMap,ma=new WeakMap,zs=new WeakMap;function Ng(e=[]){const t=[];try{for(const i of e)t.push(new tp(i));return t}catch(i){for(;t.length;)t.pop()?.destroy();throw new Error("Failed to construct sublayers.",{cause:i})}}function ep(e,t){const n=e?.Capability?.Layer;let s;const r=a=>{for(const o of a)if(o?.Name===t){const l=o.Style;if(!l||!l.length){Mo.debug("No style in WMS layer capabilities - giving up.");return}s=l[0].LegendURL?.[0]?.OnlineResource}else o.Layer&&r(o.Layer)};return n&&r(n.Layer),s}const W={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},ge=[null,"http://www.opengis.net/ows/1.1"],ip=Z(ge,{ServiceIdentification:A(Tp),ServiceProvider:A(Ip),OperationsMetadata:A(Rp)});class np extends Rc{constructor(){super()}readFromNode(t){const i=et({},ip,t,[]);return i||null}}const sp=Z(ge,{DeliveryPoint:A(X),City:A(X),AdministrativeArea:A(X),PostalCode:A(X),Country:A(X),ElectronicMailAddress:A(X)}),rp=Z(ge,{Value:ft(Ap)}),ap=Z(ge,{AllowedValues:A(pp)}),op=Z(ge,{Phone:A(Cp),Address:A(yp)}),hp=Z(ge,{HTTP:A(wp)}),lp=Z(ge,{Get:ft(Mp),Post:void 0}),cp=Z(ge,{DCP:A(Ep)}),up=Z(ge,{Operation:Sp}),dp=Z(ge,{Voice:A(X),Facsimile:A(X)}),fp=Z(ge,{Constraint:ft(vp)}),gp=Z(ge,{IndividualName:A(X),PositionName:A(X),ContactInfo:A(xp)}),_p=Z(ge,{Abstract:A(X),AccessConstraints:A(X),Fees:A(X),Title:A(X),ServiceTypeVersion:A(X),ServiceType:A(X)}),mp=Z(ge,{ProviderName:A(X),ProviderSite:A(hr),ServiceContact:A(bp)});function yp(e,t){return et({},sp,e,t)}function pp(e,t){return et({},rp,e,t)}function vp(e,t){const i=e.getAttribute("name");if(i)return et({name:i},ap,e,t)}function xp(e,t){return et({},op,e,t)}function Ep(e,t){return et({},hp,e,t)}function Mp(e,t){const i=hr(e);if(i)return et({href:i},fp,e,t)}function wp(e,t){return et({},lp,e,t)}function Sp(e,t){const i=e.getAttribute("name"),n=et({},cp,e,t);if(!n)return;const s=t[t.length-1];s[i]=n}function Rp(e,t){return et({},up,e,t)}function Cp(e,t){return et({},dp,e,t)}function Tp(e,t){return et({},_p,e,t)}function bp(e,t){return et({},gp,e,t)}function Ip(e,t){return et({},mp,e,t)}function Ap(e,t){return X(e)}const ui=[null,"http://www.opengis.net/wmts/1.0"],cr=[null,"http://www.opengis.net/ows/1.1"],Lp=Z(ui,{Contents:A(Wp)});class Pp extends Rc{constructor(){super(),this.owsParser_=new np}readFromNode(t){let i=t.getAttribute("version");i&&(i=i.trim());let n=this.owsParser_.readFromNode(t);return n?(n.version=i,n=et(n,Lp,t,[]),n||null):null}}const Op=Z(ui,{Layer:ft(Xp),TileMatrixSet:ft(jp)}),Dp=Z(ui,{Style:ft(Yp),Format:ft(X),TileMatrixSetLink:ft(qp),Dimension:ft(Vp),ResourceURL:ft(Kp)},Z(cr,{Title:A(X),Abstract:A(X),WGS84BoundingBox:A(Gg),BoundingBox:ft($p),Identifier:A(X)})),Fp=Z(ui,{LegendURL:ft(Zp)},Z(cr,{Title:A(X),Identifier:A(X)})),Np=Z(ui,{TileMatrixSet:A(X),TileMatrixSetLimits:A(Jp)}),kp=Z(ui,{TileMatrixLimits:$r(Qp)}),Gp=Z(ui,{TileMatrix:A(X),MinTileRow:A(Xe),MaxTileRow:A(Xe),MinTileCol:A(Xe),MaxTileCol:A(Xe)}),zp=Z(ui,{Default:A(X),Value:ft(X)},Z(cr,{Identifier:A(X)})),kg=Z(cr,{LowerCorner:$r(Cl),UpperCorner:$r(Cl)}),Up=Z(ui,{WellKnownScaleSet:A(X),TileMatrix:ft(Hp)},Z(cr,{SupportedCRS:A(X),Identifier:A(X),BoundingBox:A(Gg)})),Bp=Z(ui,{TopLeftCorner:A(Cl),ScaleDenominator:A(wn),TileWidth:A(Xe),TileHeight:A(Xe),MatrixWidth:A(Xe),MatrixHeight:A(Xe)},Z(cr,{Identifier:A(X)}));function Wp(e,t){return et({},Op,e,t)}function Xp(e,t){return et({},Dp,e,t)}function jp(e,t){return et({},Up,e,t)}function Yp(e,t){const i=et({},Fp,e,t);if(!i)return;const n=e.getAttribute("isDefault")==="true";return i.isDefault=n,i}function qp(e,t){return et({},Np,e,t)}function Vp(e,t){return et({},zp,e,t)}function Kp(e,t){const i=e.getAttribute("format"),n=e.getAttribute("template"),s=e.getAttribute("resourceType"),r={};return i&&(r.format=i),n&&(r.template=n),s&&(r.resourceType=s),r}function Gg(e,t){const i=et([],kg,e,t);if(i.length==2)return Ao(i)}function $p(e,t){const i=e.getAttribute("crs"),n=et([],kg,e,t);if(n.length==2)return{extent:Ao(n),crs:i}}function Zp(e,t){const i={};return i.format=e.getAttribute("format"),i.href=hr(e),i}function Cl(e,t){const i=X(e).split(/\s+/);if(!i||i.length!=2)return;const n=+i[0],s=+i[1];if(!(isNaN(n)||isNaN(s)))return[n,s]}function Hp(e,t){return et({},Bp,e,t)}function Jp(e,t){return et([],kp,e,t)}function Qp(e,t){return et({},Gp,e,t)}const ao={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class tv extends Bn{constructor(t){t=t||{};const i=Object.assign({},t),n=t.cacheSize;delete t.cacheSize,delete i.preload,delete i.useInterimTilesOnError,super(i),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(ao.PRELOAD)}setPreload(t){this.set(ao.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(ao.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(ao.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class Nc extends ka{constructor(t,i,n){super(),n=n||{},this.tileCoord=t,this.state=i,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(Q.CHANGE)}release(){this.state===W.ERROR&&this.setState(W.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==W.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){ct()}getAlpha(t,i){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=i,this.transitionStarts_[t]=n;else if(n===-1)return 1;const s=i-n+1e3/60;return s>=this.transition_?1:Uf(s/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}function Wo(e){return e instanceof Image||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageBitmap?e:null}function ev(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e instanceof DataView?e:null}const iv=new Error("disposed");let $n=null;function nv(e){$n||($n=Ot(e.width,e.height,void 0,{willReadFrequently:!0}));const t=$n.canvas,i=e.width;t.width!==i&&(t.width=i);const n=e.height;return t.height!==n&&(t.height=n),$n.clearRect(0,0,i,n),$n.drawImage(e,0,0),$n.getImageData(0,0,i,n).data}const sv=[256,256];class Tl extends Nc{constructor(t){const i=W.IDLE;super(t.tileCoord,i,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=Wo(this.data_);return t?[t.width,t.height]:sv}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==W.IDLE&&this.state!==W.ERROR)return;this.state=W.LOADING,this.changed();const t=this;this.loader_().then(function(i){t.data_=i,t.state=W.LOADED,t.changed()}).catch(function(i){t.error_=i,t.state=W.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(iv),this.controller_=null),super.disposeInternal()}}class kc extends Nc{constructor(t,i,n,s,r,a){super(t,i,a),this.crossOrigin_=s,this.src_=n,this.key=n,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=W.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=W.ERROR,this.unlistenImage_(),this.image_=rv(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=W.LOADED:this.state=W.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==W.ERROR&&(this.state=W.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==W.IDLE&&(this.state=W.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=P1(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function rv(){const e=Ot(1,1);return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),e.canvas}class av{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const t=this.pop();t instanceof oh&&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 i=this.oldest_;for(;i;)t(i.value_,i.key_,this),i=i.newer}get(t,i){const n=this.entries_[t];return ut(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const i=this.entries_[t];return ut(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_?(this.newest_=i.older,this.newest_&&(this.newest_.newer=null)):i===this.oldest_?(this.oldest_=i.newer,this.oldest_&&(this.oldest_.older=null)):(i.newer.older=i.older,i.older.newer=i.newer),delete this.entries_[t],--this.count_,i.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let i=0,n;for(n=this.newest_;n;n=n.older)t[i++]=n.key_;return t}getValues(){const t=new Array(this.count_);let i=0,n;for(n=this.newest_;n;n=n.older)t[i++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,i){this.get(t),this.entries_[t].value_=i}set(t,i){ut(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:i};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}function Mh(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function bl(e,t,i,n,s,r,a){a=a??Mh();const o=1/(e-t),h=1/(i-n),l=1/(s-r);return a[0]=-2*o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*l,a[11]=0,a[12]=(e+t)*o,a[13]=(n+i)*h,a[14]=(r+s)*l,a[15]=1,a}function Ku(e,t,i,n,s){return s=s??Mh(),s[0]=e[0]*t,s[1]=e[1]*t,s[2]=e[2]*t,s[3]=e[3]*t,s[4]=e[4]*i,s[5]=e[5]*i,s[6]=e[6]*i,s[7]=e[7]*i,s[8]=e[8]*n,s[9]=e[9]*n,s[10]=e[10]*n,s[11]=e[11]*n,s[12]=e[12],s[13]=e[13],s[14]=e[14],s[15]=e[15],s}function ov(e,t,i,n,s){s=s??Mh();let r,a,o,h,l,c,u,d,g,f,_,m;return e===s?(s[12]=e[0]*t+e[4]*i+e[8]*n+e[12],s[13]=e[1]*t+e[5]*i+e[9]*n+e[13],s[14]=e[2]*t+e[6]*i+e[10]*n+e[14],s[15]=e[3]*t+e[7]*i+e[11]*n+e[15]):(r=e[0],a=e[1],o=e[2],h=e[3],l=e[4],c=e[5],u=e[6],d=e[7],g=e[8],f=e[9],_=e[10],m=e[11],s[0]=r,s[1]=a,s[2]=o,s[3]=h,s[4]=l,s[5]=c,s[6]=u,s[7]=d,s[8]=g,s[9]=f,s[10]=_,s[11]=m,s[12]=r*t+l*i+g*n+e[12],s[13]=a*t+c*i+f*n+e[13],s[14]=o*t+u*i+_*n+e[14],s[15]=h*t+d*i+m*n+e[15]),s}function hv(e,t,i,n){return n=n??Mh(),n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=e,n[13]=t,n[14]=i,n[15]=1,n}const lv=` + attribute vec4 a_position; + attribute vec4 a_texcoord; + + uniform mat4 u_matrix; + uniform mat4 u_textureMatrix; + + varying vec2 v_texcoord; + + void main() { + gl_Position = u_matrix * a_position; + vec2 texcoord = (u_textureMatrix * a_texcoord).xy; + v_texcoord = texcoord; + } +`,cv=` + precision mediump float; + + varying vec2 v_texcoord; + + uniform sampler2D u_texture; + + void main() { + if ( + v_texcoord.x < 0.0 || + v_texcoord.y < 0.0 || + v_texcoord.x > 1.0 || + v_texcoord.y > 1.0 + ) { + discard; + } + gl_FragColor = texture2D(u_texture, v_texcoord); + } +`;class uv{constructor(t){this.gl_=t,this.program_=Il(t,cv,lv),this.positionLocation=t.getAttribLocation(this.program_,"a_position"),this.texcoordLocation=t.getAttribLocation(this.program_,"a_texcoord"),this.matrixLocation=t.getUniformLocation(this.program_,"u_matrix"),this.textureMatrixLocation=t.getUniformLocation(this.program_,"u_textureMatrix"),this.textureLocation=t.getUniformLocation(this.program_,"u_texture"),this.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.positionBuffer),this.positions=[0,0,0,1,1,0,1,0,0,1,1,1],t.bufferData(t.ARRAY_BUFFER,new Float32Array(this.positions),t.STATIC_DRAW),this.texcoordBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.texcoordBuffer),this.texcoords=[0,0,0,1,1,0,1,0,0,1,1,1],t.bufferData(t.ARRAY_BUFFER,new Float32Array(this.texcoords),t.STATIC_DRAW)}drawImage(t,i,n,s,r,a,o,h,l,c,u,d,g){const f=this.gl_;h===void 0&&(h=s),l===void 0&&(l=r),a===void 0&&(a=i),o===void 0&&(o=n),c===void 0&&(c=a),u===void 0&&(u=o),d===void 0&&(d=f.canvas.width),g===void 0&&(g=f.canvas.height),f.bindTexture(f.TEXTURE_2D,t),f.useProgram(this.program_),f.bindBuffer(f.ARRAY_BUFFER,this.positionBuffer),f.enableVertexAttribArray(this.positionLocation),f.vertexAttribPointer(this.positionLocation,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.texcoordBuffer),f.enableVertexAttribArray(this.texcoordLocation),f.vertexAttribPointer(this.texcoordLocation,2,f.FLOAT,!1,0,0);let _=bl(0,d,0,g,-1,1);_=ov(_,h,l,0),_=Ku(_,c,u,1),f.uniformMatrix4fv(this.matrixLocation,!1,_);let m=hv(s/i,r/n,0);m=Ku(m,a/i,o/n,1),f.uniformMatrix4fv(this.textureMatrixLocation,!1,m),f.uniform1i(this.textureLocation,0),f.drawArrays(f.TRIANGLES,0,this.positions.length/2)}}function $u(e,t,i){const n=e.createShader(t);if(n===null)throw new Error("Shader compilation failed");if(e.shaderSource(n,i),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){const s=e.getShaderInfoLog(n);throw s===null?new Error("Shader info log creation failed"):new Error(s)}return n}function Il(e,t,i){const n=e.createProgram(),s=$u(e,e.VERTEX_SHADER,i),r=$u(e,e.FRAGMENT_SHADER,t);if(n===null)throw new Error("Program creation failed");if(e.attachShader(n,s),e.attachShader(n,r),e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS))throw e.getProgramInfoLog(n)===null?new Error("Program info log creation failed"):new Error;return n}const dv=` + attribute vec4 a_position; + + uniform mat4 u_matrix; + + void main() { + gl_Position = u_matrix * a_position; + } +`,fv=` + precision mediump float; + + uniform vec4 u_val; + void main() { + gl_FragColor = u_val; + } +`,gv=` + attribute vec4 a_position; + attribute vec2 a_texcoord; + + varying vec2 v_texcoord; + + uniform mat4 u_matrix; + + void main() { + gl_Position = u_matrix * a_position; + v_texcoord = a_texcoord; + } +`,_v=` + precision mediump float; + + varying vec2 v_texcoord; + + uniform sampler2D u_texture; + + void main() { + if (v_texcoord.x < 0.0 || v_texcoord.x > 1.0 || v_texcoord.y < 0.0 || v_texcoord.y > 1.0) { + discard; + } + gl_FragColor = texture2D(u_texture, v_texcoord); + } +`;function mv(e,t,i,n){let s;return i&&i.length?s=i.shift():Cc?s=new OffscreenCanvas(e||300,t||300):s=document.createElement("canvas"),e&&(s.width=e),t&&(s.height=t),s.getContext("webgl",n)}function yv(e){const t=e.canvas;t.width=1,t.height=1,e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)}const Zu=[];function pv(e,t,i,n,s,r,a,o,h,l,c,u,d,g){const f=Math.round(n*t),_=Math.round(n*i);e.canvas.width=f,e.canvas.height=_;let m,p;if(p=e.createTexture(),e.bindTexture(e.TEXTURE_2D,p),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),d?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,f,_,0,e.RGBA,c,null),m=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,m),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,p,0),m===null)throw new Error("Could not create framebuffer");if(p===null)throw new Error("Could not create texture");if(h.length===0)return{width:f,height:_,framebuffer:m,texture:p};const y=de();h.forEach(function(I,O,C){nc(y,I.extent)});let M,v,E;const w=1/s;{if(M=e.createTexture(),p===null)throw new Error("Could not create texture");v=Math.round(st(y)*w),E=Math.round(It(y)*w);const I=e.getParameter(e.MAX_TEXTURE_SIZE),O=Math.max(v,E),C=O>I?I/O:1,D=Math.round(v*C),F=Math.round(E*C);e.bindTexture(e.TEXTURE_2D,M),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),d?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,D,F,0,e.RGBA,c,null);const G=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,G),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,M,0);const z=new uv(e);h.forEach(function(k,H,it){const j=(k.extent[0]-y[0])*w*C,K=-(k.extent[3]-y[3])*w*C,rt=st(k.extent)*w*C,at=It(k.extent)*w*C;if(e.bindFramebuffer(e.FRAMEBUFFER,G),e.viewport(0,0,D,F),k.clipExtent){const P=(k.clipExtent[0]-y[0])*w*C,_t=-(k.clipExtent[3]-y[3])*w*C,Et=st(k.clipExtent)*w*C,Ct=It(k.clipExtent)*w*C;e.enable(e.SCISSOR_TEST),e.scissor(d?P:Math.round(P),d?_t:Math.round(_t),d?Et:Math.round(P+Et)-Math.round(P),d?Ct:Math.round(_t+Ct)-Math.round(_t))}z.drawImage(k.texture,k.width,k.height,l,l,k.width-2*l,k.height-2*l,d?j:Math.round(j),d?K:Math.round(K),d?rt:Math.round(j+rt)-Math.round(j),d?at:Math.round(K+at)-Math.round(K),D,F),e.disable(e.SCISSOR_TEST)}),e.deleteFramebuffer(G)}const b=Ti(a),S=Ti(y),R=I=>{const O=(I[0][0]-b[0])/r*n,C=-(I[0][1]-b[1])/r*n,D=(I[1][0]-b[0])/r*n,F=-(I[1][1]-b[1])/r*n,G=(I[2][0]-b[0])/r*n,z=-(I[2][1]-b[1])/r*n;return{u1:D,v1:F,u0:O,v0:C,u2:G,v2:z}};e.bindFramebuffer(e.FRAMEBUFFER,m),e.viewport(0,0,f,_);{const I=[],O=[],C=Il(e,_v,gv);e.useProgram(C);const D=e.getUniformLocation(C,"u_texture");e.bindTexture(e.TEXTURE_2D,M),e.uniform1i(D,0),o.getTriangles().forEach(function(j,K,rt){const at=j.source,P=j.target,{u1:_t,v1:Et,u0:Ct,v0:ve,u2:De,v2:ne}=R(P),Ke=(at[0][0]-S[0])/s/v,un=-(at[0][1]-S[1])/s/E,Xn=(at[1][0]-S[0])/s/v,fr=-(at[1][1]-S[1])/s/E,dn=(at[2][0]-S[0])/s/v,di=-(at[2][1]-S[1])/s/E;I.push(_t,Et,Ct,ve,De,ne),O.push(Xn,fr,Ke,un,dn,di)});const F=bl(0,f,_,0,-1,1),G=e.getUniformLocation(C,"u_matrix");e.uniformMatrix4fv(G,!1,F);const z=e.getAttribLocation(C,"a_position"),k=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,k),e.bufferData(e.ARRAY_BUFFER,new Float32Array(I),e.STATIC_DRAW),e.vertexAttribPointer(z,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(z);const H=e.getAttribLocation(C,"a_texcoord"),it=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,it),e.bufferData(e.ARRAY_BUFFER,new Float32Array(O),e.STATIC_DRAW),e.vertexAttribPointer(H,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(H),e.drawArrays(e.TRIANGLES,0,I.length/2)}if(u){const I=Il(e,fv,dv);e.useProgram(I);const O=bl(0,f,_,0,-1,1),C=e.getUniformLocation(I,"u_matrix");e.uniformMatrix4fv(C,!1,O);const D=Array.isArray(u)?u:[0,0,0,255],F=e.getUniformLocation(I,"u_val");e.uniform4fv(F,D);const G=e.getAttribLocation(I,"a_position"),z=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,z),e.vertexAttribPointer(G,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(G);const k=o.getTriangles().reduce(function(H,it){const j=it.target,{u1:K,v1:rt,u0:at,v0:P,u2:_t,v2:Et}=R(j);return H.concat([K,rt,at,P,at,P,_t,Et,_t,Et,K,rt])},[]);e.bufferData(e.ARRAY_BUFFER,new Float32Array(k),e.STATIC_DRAW),e.drawArrays(e.LINES,0,k.length/2)}return{width:f,height:_,framebuffer:m,texture:p}}class vv extends Tl{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:t.interpolate,transition:t.transition}),this.renderEdges_=t.renderEdges!==void 0?t.renderEdges:!1,this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const i=t.sourceProj,n=i.getExtent(),s=t.sourceTileGrid.getExtent();this.clipExtent_=i.canWrapX()?s?ye(n,s):n:s;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),a=this.targetTileGrid_.getExtent();let o=this.sourceTileGrid_.getExtent();const h=a?ye(r,a):r;if($s(h)===0){this.state=W.EMPTY;return}n&&(o?o=ye(o,n):o=n);const l=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),c=t.targetProj,u=wg(i,c,h,l);if(!isFinite(u)||u<=0){this.state=W.EMPTY;return}const d=t.errorThreshold!==void 0?t.errorThreshold:Oc;if(this.triangulation_=new Dc(i,c,h,o,u*d,l,t.transformMatrix),this.triangulation_.getTriangles().length===0){this.state=W.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let g=this.triangulation_.calculateSourceExtent();if(o&&(i.canWrapX()?(g[1]=Rt(g[1],o[1],o[3]),g[3]=Rt(g[3],o[1],o[3])):g=ye(g,o)),!$s(g))this.state=W.EMPTY;else{let f=0,_=0;i.canWrapX()&&(f=st(n),_=Math.floor((g[0]-n[0])/f)),sc(g.slice(),i,!0).forEach(p=>{const y=this.sourceTileGrid_.getTileRangeForExtentAndZ(p,this.sourceZ_),M=t.getTileFunction;for(let v=y.minX;v<=y.maxX;v++)for(let E=y.minY;E<=y.maxY;E++){const w=M(this.sourceZ_,v,E,this.pixelRatio_);if(w){const b=_*f;this.sourceTiles_.push({tile:w,offset:b})}}++_}),this.sourceTiles_.length===0&&(this.state=W.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];let i=!1;if(this.sourceTiles_.forEach(v=>{const E=v.tile;if(!E||E.getState()!==W.LOADED)return;const w=E.getSize(),b=this.gutter_;let S;const R=ev(E.getData());R?S=R:(i=!0,S=nv(Wo(E.getData())));const I=[w[0]+2*b,w[1]+2*b],O=S instanceof Float32Array,C=I[0]*I[1],D=O?Float32Array:Uint8ClampedArray,F=new D(S.buffer),G=D.BYTES_PER_ELEMENT,z=G*F.length/C,k=F.byteLength/I[1],H=Math.floor(k/G/I[0]),it=this.sourceTileGrid_.getTileCoordExtent(E.tileCoord);it[0]+=v.offset,it[2]+=v.offset;const j=this.clipExtent_?.slice();j&&(j[0]+=v.offset,j[2]+=v.offset),t.push({extent:it,clipExtent:j,data:F,dataType:D,bytesPerPixel:z,pixelSize:I,bandCount:H})}),this.sourceTiles_.length=0,t.length===0){this.state=W.ERROR,this.changed();return}const n=this.wrappedTileCoord_[0],s=this.targetTileGrid_.getTileSize(n),r=typeof s=="number"?s:s[0],a=typeof s=="number"?s:s[1],o=r*this.pixelRatio_,h=a*this.pixelRatio_,l=this.targetTileGrid_.getResolution(n),c=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),d=t[0].bandCount,g=new t[0].dataType(d*o*h),f=mv(o,h,Zu,{premultipliedAlpha:!1,antialias:!1});let _;const m=f.RGBA;let p;t[0].dataType==Float32Array?(p=f.FLOAT,f.getExtension("WEBGL_color_buffer_float"),f.getExtension("OES_texture_float"),f.getExtension("EXT_float_blend"),_=f.getExtension("OES_texture_float_linear")!==null&&this.interpolate):(p=f.UNSIGNED_BYTE,_=this.interpolate);const y=4,M=Math.ceil(d/y);for(let v=M-1;v>=0;--v){const E=[];for(let D=0,F=t.length;D{const n=i.getState();if(n!==W.IDLE&&n!==W.LOADING)return;t++;const s=lt(i,Q.CHANGE,()=>{const r=i.getState();(r==W.LOADED||r==W.ERROR||r==W.EMPTY)&&(wt(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:i}){i.getState()==W.IDLE&&i.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(wt),this.sourcesListenerKeys_=null}}class Al extends Nc{constructor(t,i,n,s,r,a,o,h,l,c,u,d){super(r,W.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=o,this.gutter_=h,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=s,this.wrappedTileCoord_=a||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const g=s.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent();let _=this.sourceTileGrid_.getExtent();const m=f?ye(g,f):g;if($s(m)===0){this.state=W.EMPTY;return}const p=t.getExtent();p&&(_?_=ye(_,p):_=p);const y=s.getResolution(this.wrappedTileCoord_[0]),M=wg(t,n,m,y);if(!isFinite(M)||M<=0){this.state=W.EMPTY;return}const v=c!==void 0?c:Oc;if(this.triangulation_=new Dc(t,n,m,_,M*v,y),this.triangulation_.getTriangles().length===0){this.state=W.EMPTY;return}this.sourceZ_=i.getZForResolution(M);let E=this.triangulation_.calculateSourceExtent();if(_&&(t.canWrapX()?(E[1]=Rt(E[1],_[1],_[3]),E[3]=Rt(E[3],_[1],_[3])):E=ye(E,_)),!$s(E))this.state=W.EMPTY;else{let w=0,b=0;t.canWrapX()&&(w=st(p),b=Math.floor((E[0]-p[0])/w)),sc(E.slice(),t,!0).forEach(R=>{const I=i.getTileRangeForExtentAndZ(R,this.sourceZ_);for(let O=I.minX;O<=I.maxX;O++)for(let C=I.minY;C<=I.maxY;C++){const D=l(this.sourceZ_,O,C,o);if(D){const F=b*w;this.sourceTiles_.push({tile:D,offset:F})}}++b}),this.sourceTiles_.length===0&&(this.state=W.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(i=>{const n=i.tile;if(n&&n.getState()==W.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);s[0]+=i.offset,s[2]+=i.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=i.offset,r[2]+=i.offset),t.push({extent:s,clipExtent:r,image:n.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=W.ERROR;else{const i=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(i),s=typeof n=="number"?n:n[0],r=typeof n=="number"?n:n[1],a=this.targetTileGrid_.getResolution(i),o=this.sourceTileGrid_.getResolution(this.sourceZ_),h=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Sg(s,r,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,h,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=W.LOADED}this.changed()}load(){if(this.state==W.IDLE){this.state=W.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:i})=>{const n=i.getState();if(n==W.IDLE||n==W.LOADING){t++;const s=lt(i,Q.CHANGE,r=>{const a=i.getState();(a==W.LOADED||a==W.ERROR||a==W.EMPTY)&&(wt(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:i},n,s){i.getState()==W.IDLE&&i.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(wt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Eh(this.canvas_.getContext("2d")),xs.push(this.canvas_),this.canvas_=null),super.release()}}class Gc{constructor(t,i,n,s){this.minX=t,this.maxX=i,this.minY=n,this.maxY=s}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function Zn(e,t,i,n,s){return s!==void 0?(s.minX=e,s.maxX=t,s.minY=i,s.maxY=n,s):new Gc(e,t,i,n)}function Hu(e){return e[0]>0&&e[1]>0}function xv(e,t,i){return i===void 0&&(i=[0,0]),i[0]=e[0]*t+.5|0,i[1]=e[1]*t+.5|0,i}function ce(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}function Kh(e,t,i,n){return`${e},${U1(t,i,n)}`}function $h(e,t,i){if(!(i in e))return e[i]=new Set([t]),!0;const n=e[i],s=n.has(t);return s||n.add(t),!s}function Ev(e,t,i){const n=e[i];return n?n.delete(t):!1}function Ju(e,t){const i=e.layerStatesArray[e.layerIndex];i.extent&&(t=ye(t,ei(i.extent,e.viewState.projection)));const n=i.layer.getRenderSource();if(!n.getWrapX()){const s=n.getTileGridForProjection(e.viewState.projection).getExtent();s&&(t=ye(t,s))}return t}class Mv extends Pc{constructor(t,i){super(t),i=i||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=de(),this.tempTileRange_=new Gc(0,0,0,0),this.tempTileCoord_=Uo(0,0,0);const n=i.cacheSize!==void 0?i.cacheSize:512;this.tileCache_=new av(n),this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getOrCreateTile(t,i,n,s){const r=this.tileCache_,o=this.getLayer().getSource(),h=Kh(o.getKey(),t,i,n);let l;if(r.containsKey(h))l=r.get(h);else{if(l=o.getTile(t,i,n,s.pixelRatio,s.viewState.projection),!l)return null;r.set(h,l)}return l}getTile(t,i,n,s){const r=this.getOrCreateTile(t,i,n,s);return r||null}getData(t){const i=this.frameState;if(!i)return null;const n=this.getLayer(),s=Nt(i.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!Nn(r,s))return null;const a=i.viewState,o=n.getRenderSource(),h=o.getTileGridForProjection(a.projection),l=o.getTilePixelRatio(i.pixelRatio);for(let c=h.getZForResolution(a.resolution);c>=h.getMinZoom();--c){const u=h.getTileCoordForCoordAndZ(s,c),d=this.getTile(c,u[1],u[2],i);if(!d||d.getState()!==W.LOADED)continue;const g=h.getOrigin(c),f=ce(h.getTileSize(c)),_=h.getResolution(c);let m;if(d instanceof kc||d instanceof Al)m=d.getImage();else if(d instanceof Tl){if(m=Wo(d.getData()),!m)continue}else continue;const p=Math.floor(l*((s[0]-g[0])/_-u[1]*f[0])),y=Math.floor(l*((g[1]-s[1])/_-u[2]*f[1])),M=Math.round(l*o.getGutterForProjection(a.projection));return this.getImageData(m,p+M,y+M)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;const i=this.getLayer().getSource();if(!i)return!1;const n=i.getRevision();return this.renderedRevision_?this.renderedRevision_!==n&&(this.renderedRevision_=n,this.renderedSourceKey_===i.getKey()&&this.tileCache_.clear()):this.renderedRevision_=n,!0}enqueueTiles(t,i,n,s,r){const a=t.viewState,o=this.getLayer(),h=o.getRenderSource(),l=h.getTileGridForProjection(a.projection),c=gt(h);c in t.wantedTiles||(t.wantedTiles[c]={});const u=t.wantedTiles[c],d=o.getMapInternal(),g=Math.max(n-r,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),h.zDirection));for(let f=n;f>=g;--f){const _=l.getTileRangeForExtentAndZ(i,f,this.tempTileRange_),m=l.getResolution(f);for(let p=_.minX;p<=_.maxX;++p)for(let y=_.minY;y<=_.maxY;++y){const M=this.getTile(f,p,y,t);if(!M||!$h(s,M,f))continue;const E=M.getKey();if(u[E]=!0,M.getState()===W.IDLE&&!t.tileQueue.isKeyQueued(E)){const w=Uo(f,p,y,this.tempTileCoord_);t.tileQueue.enqueue([M,c,l.getTileCoordCenter(w),m])}}}}findStaleTile_(t,i){const n=this.tileCache_,s=t[0],r=t[1],a=t[2],o=this.getStaleKeys();for(let h=0;h0&&setTimeout(()=>{this.enqueueTiles(t,O,f-1,R,I-1)},0),!(f in R))return this.container;const C=gt(this),D=t.time;for(const j of R[f]){const K=j.getState();if((j instanceof Al||j instanceof vv)&&K===W.EMPTY)continue;const rt=j.tileCoord;if(K===W.LOADED&&j.getAlpha(C,D)===1){j.endTransition(C);continue}if(K!==W.IDLE&&(n=!1),K!==W.ERROR&&(this.renderComplete=!1),this.findStaleTile_(rt,R)){Ev(R,j,f),t.animate=!0;continue}if(this.findAltTiles_(g,rt,f+1,R))continue;const _t=g.getMinZoom();for(let Et=f-1;Et>=_t&&!this.findAltTiles_(g,rt,Et,R);--Et);}const F=_/o*l/y,G=this.getRenderContext(t);ai(this.tempTransform,M/2,v/2,F,F,0,-M/2,-v/2),s.extent&&this.clipUnrotated(G,t,E),u.getInterpolate()||(G.imageSmoothingEnabled=!1),this.preRender(G,t);const z=Object.keys(R).map(Number);z.sort(wi);let k;const H=[],it=[];for(let j=z.length-1;j>=0;--j){const K=z[j],rt=u.getTilePixelSize(K,l,a),P=g.getResolution(K)/_,_t=rt[0]*P*F,Et=rt[1]*P*F,Ct=g.getTileCoordForCoordAndZ(Ti(S),K),ve=g.getTileCoordExtent(Ct),De=Nt(this.tempTransform,[y*(ve[0]-S[0])/_,y*(S[3]-ve[3])/_]),ne=y*u.getGutterForProjection(a);for(const Ke of R[K]){if(Ke.getState()!==W.LOADED)continue;const un=Ke.tileCoord,Xn=Ct[1]-un[1],fr=Math.round(De[0]-(Xn-1)*_t),dn=Ct[2]-un[2],di=Math.round(De[1]-(dn-1)*Et),xe=Math.round(De[0]-Xn*_t),$e=Math.round(De[1]-dn*Et),jn=fr-xe,Yn=di-$e,gr=z.length===1;let fn=!1;k=[xe,$e,xe+jn,$e,xe+jn,$e+Yn,xe,$e+Yn];for(let qn=0,Vn=H.length;qn{const at=gt(u),P=rt.wantedTiles[at],_t=P?Object.keys(P).length:0;this.updateCacheSize(_t),this.tileCache_.expireCache()};t.postRenderFunctions.push(j)}return!this.renderComplete&&!n&&(t.animate=!0),this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,i,n,s,r,a,o,h){let l;if(t instanceof Tl){if(l=Wo(t.getData()),!l)throw new Error("Rendering array data is not yet supported")}else l=this.getTileImage(t);if(!l)return;const c=this.getRenderContext(i),u=gt(this),d=i.layerStatesArray[i.layerIndex],g=d.opacity*(h?t.getAlpha(u,i.time):1),f=g!==c.globalAlpha;f&&(c.save(),c.globalAlpha=g),c.drawImage(l,o,o,l.width-2*o,l.height-2*o,n,s,r,a),f&&c.restore(),g!==d.opacity?i.animate=!0:h&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,i,n){const s=gt(i);s in t||(t[s]={}),t[s][n.getKey()]=!0}}class zg extends tv{constructor(t){super(t)}createRenderer(){return new Mv(this,{cacheSize:this.getCacheSize()})}}const Zh={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},Hn=[0,0,0],Di=5;class zc{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,ut($_(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let i;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s{const a=new Gc(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(n){const o=this.getTileRangeForExtentAndZ(n,r);a.minX=Math.max(o.minX,a.minX),a.maxX=Math.min(o.maxX,a.maxX),a.minY=Math.max(o.minY,a.minY),a.maxY=Math.min(o.maxY,a.maxY)}return a}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,i,n){const s=this.getTileRangeForExtentAndZ(t,i);for(let r=s.minX,a=s.maxX;r<=a;++r)for(let o=s.minY,h=s.maxY;o<=h;++o)n([i,r,o])}forEachTileCoordParentTileRange(t,i,n,s){let r,a,o,h=null,l=t[0]-1;for(this.zoomFactor_===2?(a=t[1],o=t[2]):h=this.getTileCoordExtent(t,s);l>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),r=Zn(a,a,o,o,n)):r=this.getTileRangeForExtentAndZ(h,l,n),i(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,i,n){if(t[0]this.maxZoom||i0?v=i.find(function(E){return M[c]==E[l]?!0:M[c].includes(":")?!1:e[c]+":"+M[c]===E[l]}):v=!0,v){s.push(M[c]);const E=M[u]*28e-5/p,w=M[g],b=M[f];y?r.push([M[d][1],M[d][0]]):r.push(M[d]),n.push(E),a.push(w==b?w:[w,b]),o.push([M.MatrixWidth,M.MatrixHeight])}}),new wv({extent:t,origins:r,resolutions:n,matrixIds:s,tileSizes:a,sizes:o})}function Ug(e){let t=e.getDefaultTileGrid();return t||(t=bv(e),e.setDefaultTileGrid(t)),t}function Rv(e,t,i){const n=t[0],s=e.getTileCoordCenter(t),r=Uc(i);if(!Nn(r,s)){const a=st(r),o=Math.ceil((r[0]-s[0])/a);return s[0]+=a*o,e.getTileCoordForCoordAndZ(s,n)}return t}function Cv(e,t,i,n){n=n!==void 0?n:"top-left";const s=Bg(e,t,i);return new zc({extent:e,origin:lm(e,n),resolutions:s,tileSize:i})}function Tv(e){const t=e||{},i=t.extent||Mt("EPSG:3857").getExtent(),n={extent:i,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:Bg(i,t.maxZoom,t.tileSize,t.maxResolution)};return new zc(n)}function Bg(e,t,i,n){t=t!==void 0?t:Q_,i=ce(i!==void 0?i:tc);const s=It(e),r=st(e);n=n>0?n:Math.max(r/i[0],s/i[1]);const a=t+1,o=new Array(a);for(let h=0;hthis.getTileInternal(g,f,_,m,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=h,d}getTileInternal(t,i,n,s,r){const a=this.getKey();return this.createTile_(t,i,n,s,r,a)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,i){const n=Mt(t);if(n){const s=gt(n);s in this.tileGridForProjection||(this.tileGridForProjection[s]=i)}}}function Ov(e,t){e.getImage().src=t}class Dv extends Wg{constructor(t){const i=t.requestEncoding!==void 0?t.requestEncoding:"KVP",n=t.tileGrid;let s=t.urls;s===void 0&&t.url!==void 0&&(s=Cg(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:s,wrapX:t.wrapX!==void 0?t.wrapX:!1,transition:t.transition,zDirection:t.zDirection}),this.version_=t.version!==void 0?t.version:"1.0.0",this.format_=t.format!==void 0?t.format:"image/jpeg",this.dimensions_=t.dimensions!==void 0?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=i,this.setKey(this.getKeyForDimensions_()),s&&s.length>0&&(this.tileUrlFunction=Ll(s.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const i=t.join(` +`);this.setTileUrlFunction(Ll(t.map(this.createFromWMTSTemplate.bind(this))),i)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const i in this.dimensions_)t.push(i+"-"+this.dimensions_[i]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const i=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};i=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=i=="KVP"?Bo(t,n):t.replace(/\{(\w+?)\}/g,function(a,o){return o.toLowerCase()in n?n[o.toLowerCase()]:a});const s=this.tileGrid,r=this.dimensions_;return function(a,o,h){if(!a)return;const l={TileMatrix:s.getMatrixId(a[0]),TileCol:a[1],TileRow:a[2]};Object.assign(l,r);let c=t;return i=="KVP"?c=Bo(c,l):c=c.replace(/\{(\w+?)\}/g,function(u,d){return encodeURIComponent(l[d])}),c}}}function Fv(e,t){const n=e.Contents.Layer?.find(function(C){return C.Identifier==t.layer});if(!n)return null;const s=e.Contents.TileMatrixSet;let r;n.TileMatrixSetLink.length>1?"projection"in t?r=n.TileMatrixSetLink.findIndex(function(C){const F=s.find(function(k){return k.Identifier==C.TileMatrixSet}).SupportedCRS,G=Mt(F),z=Mt(t.projection);return G&&z?Dn(G,z):F==t.projection}):r=n.TileMatrixSetLink.findIndex(function(C){return C.TileMatrixSet==t.matrixSet}):r=0,r<0&&(r=0);const a=n.TileMatrixSetLink[r].TileMatrixSet,o=n.TileMatrixSetLink[r].TileMatrixSetLimits;let h=n.Format[0];"format"in t&&(h=t.format),r=n.Style.findIndex(function(C){return"style"in t?C.Title==t.style:C.isDefault}),r<0&&(r=0);const l=n.Style[r].Identifier,c={};"Dimension"in n&&n.Dimension.forEach(function(C,D,F){const G=C.Identifier;let z=C.Default;z===void 0&&(z=C.Value[0]),c[G]=z});const d=e.Contents.TileMatrixSet.find(function(C){return C.Identifier==a});let g;const f=d.SupportedCRS;if(f&&(g=Mt(f)),"projection"in t){const C=Mt(t.projection);C&&(!g||Dn(C,g))&&(g=C)}let _=!1;const m=g.getAxisOrientation().startsWith("ne");let p=d.TileMatrix[0],y={MinTileCol:0,MinTileRow:0,MaxTileCol:p.MatrixWidth-1,MaxTileRow:p.MatrixHeight-1};if(o){y=o[o.length-1];const C=d.TileMatrix.find(D=>D.Identifier===y.TileMatrix||d.Identifier+":"+D.Identifier===y.TileMatrix);C&&(p=C)}const M=p.ScaleDenominator*28e-5/g.getMetersPerUnit(),v=m?[p.TopLeftCorner[1],p.TopLeftCorner[0]]:p.TopLeftCorner,E=p.TileWidth*M,w=p.TileHeight*M;let b=d.BoundingBox;b&&m&&(b=[b[1],b[0],b[3],b[2]]);let S=[v[0]+E*y.MinTileCol,v[1]-w*(1+y.MaxTileRow),v[0]+E*(1+y.MaxTileCol),v[1]-w*y.MinTileRow];if(b!==void 0&&!ti(b,S)){const C=n.WGS84BoundingBox,D=Mt("EPSG:4326").getExtent();if(S=b,C)_=C[0]===D[0]&&C[2]===D[2];else{const F=zm(b,d.SupportedCRS,"EPSG:4326");_=F[0]-1e-10<=D[0]&&F[2]+1e-10>=D[2]}}const R=Sv(d,S,o),I=[];let O=t.requestEncoding;if(O=O!==void 0?O:"","OperationsMetadata"in e&&"GetTile"in e.OperationsMetadata){const C=e.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let D=0,F=C.length;D0;)this.pop()}extend(t){for(let i=0,n=t.length;ithis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(i),this.array_.splice(t,0,i),this.updateLength_(),this.dispatchEvent(new oo(re.ADD,i,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const i=this.getLength();return this.insertAt(i,t),this.getLength()}remove(t){const i=this.array_;for(let n=0,s=i.length;n=this.getLength())return;const i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new oo(re.REMOVE,i,t)),i}setAt(t,i){const n=this.getLength();if(t>=n){this.insertAt(t,i);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(i,t);const s=this.array_[t];this.array_[t]=i,this.dispatchEvent(new oo(re.REMOVE,s,t)),this.dispatchEvent(new oo(re.ADD,i,t))}updateLength_(){this.set(Qu.LENGTH,this.array_.length)}assertUnique_(t,i){for(let n=0,s=this.array_.length;nthis.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const i in this.cache_){const n=this.cache_[i];!(t++&3)&&!n.hasListener()&&(delete this.cache_[i],delete this.patternCache_[i],--this.cacheSize_)}}}get(t,i,n){const s=Hh(t,i,n);return s in this.cache_?this.cache_[s]:null}getPattern(t,i,n){const s=Hh(t,i,n);return s in this.patternCache_?this.patternCache_[s]:null}set(t,i,n,s,r){const a=Hh(t,i,n),o=a in this.cache_;this.cache_[a]=s,r&&(s.getImageState()===q.IDLE&&s.load(),s.getImageState()===q.LOADING?s.ready().then(()=>{this.patternCache_[a]=Go().createPattern(s.getImage(1),"repeat")}):this.patternCache_[a]=Go().createPattern(s.getImage(1),"repeat")),o||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Hh(e,t,i){const n=i?Qs(i):"null";return t+":"+e+":"+n}const Le=new kv;let xr=null;class Xg extends ka{constructor(t,i,n,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=s===void 0?q.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=i,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===q.LOADED){xr||(xr=Ot(1,1,void 0,{willReadFrequently:!0})),xr.drawImage(this.image_,0,0);try{xr.getImageData(0,0,1,1),this.tainted_=!1}catch{xr=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(Q.CHANGE)}handleImageError_(){this.imageState_=q.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=q.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],i=this.size_[1],n=Ot(t,i);n.fillRect(0,0,t,i),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===q.IDLE){this.image_||this.initializeImage_(),this.imageState_=q.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Eg(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==q.LOADED)return;const i=this.image_,n=Ot(Math.ceil(i.width*t),Math.ceil(i.height*t)),s=n.canvas;n.scale(t,t),n.drawImage(i,0,0),n.globalCompositeOperation="multiply",n.fillStyle=R1(this.color_),n.fillRect(0,0,s.width/t,s.height/t),n.globalCompositeOperation="destination-in",n.drawImage(i,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===q.LOADED||this.imageState_===q.ERROR)t();else{const i=()=>{(this.imageState_===q.LOADED||this.imageState_===q.ERROR)&&(this.removeEventListener(Q.CHANGE,i),t())};this.addEventListener(Q.CHANGE,i)}})),this.ready_}}function Xc(e,t,i,n,s,r){let a=t===void 0?void 0:Le.get(t,i,s);return a||(a=new Xg(e,e&&"src"in e?e.src||void 0:t,i,n,s),Le.set(t,i,s,a,r)),r&&a&&!Le.getPattern(t,i,s)&&Le.set(t,i,s,a,r),a}class Ii{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new Ii({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const i=Xc(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));i.ready().then(()=>{this.patternImage_=null}),i.getImageState()===q.IDLE&&i.load(),i.getImageState()===q.LOADING&&(this.patternImage_=i)}this.color_=t}getKey(){const t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?gt(t):typeof t=="object"&&"src"in t?t.src+":"+t.offset:Qs(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function td(e,t,i,n,s,r,a){let o,h;const l=(i-t)/n;if(l===1)o=t;else if(l===2)o=t,h=s;else if(l!==0){let c=e[t],u=e[t+1],d=0;const g=[0];for(let m=t+n;m1?a:2,r=r||new Array(a);for(let c=0;c>1;sMath.max(s,jo(e,r)),0);return i[t]=n,n}function Xv(e,t){const i=[],n=[],s=[];let r=0,a=0,o=0,h=0;for(let l=0,c=t.length;l<=c;l+=2){const u=t[l];if(u===` +`||l===c){r=Math.max(r,a),s.push(a),a=0,o+=h,h=0;continue}const d=t[l+1]||e.font,g=jo(d,u);i.push(g),a+=g;const f=Wv(d);n.push(f),h=Math.max(h,f)}return{width:r,height:o,widths:i,heights:n,lineWidths:s}}function jv(e,t,i,n,s,r,a,o,h,l,c){e.save(),i!==1&&(e.globalAlpha===void 0?e.globalAlpha=u=>u.globalAlpha*=i:e.globalAlpha*=i),t&&e.transform.apply(e,t),n.contextInstructions?(e.translate(h,l),e.scale(c[0],c[1]),Yv(n,e)):c[0]<0||c[1]<0?(e.translate(h,l),e.scale(c[0],c[1]),e.drawImage(n,s,r,a,o,0,0,a,o)):e.drawImage(n,s,r,a,o,h,l,a*c[0],o*c[1]),e.restore()}function Yv(e,t){const i=e.contextInstructions;for(let n=0,s=i.length;nthis.imageState_=q.LOADED),this.render()}clone(){const t=this.getScale(),i=new Rh({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 i.setOpacity(this.getOpacity()),i}getAnchor(){const t=this.size_,i=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-i[0]/n[0],t[1]/2+i[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){const i=this.fill_?.getKey(),n=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${i}`+Object.values(this.renderOptions_).join(",");let s=Le.get(n,null,null)?.getImage(1);if(!s){const r=this.renderOptions_,a=Math.ceil(r.size*t),o=Ot(a,a);this.draw_(r,o,t),s=o.canvas,Le.set(n,null,null,new Xg(s,void 0,null,q.LOADED,null))}return s}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,i,n){if(i===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return i;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(si;){if(n-i>600){const h=n-i+1,l=t-i+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),g=Math.max(i,Math.floor(t-l*u/h+d)),f=Math.min(n,Math.floor(t+(h-l)*u/h+d));$g(e,t,g,f,s)}const r=e[t];let a=i,o=n;for(Er(e,i,t),s(e[n],r)>0&&Er(e,i,n);a0;)o--}s(e[i],r)===0?Er(e,i,o):(o++,Er(e,o,n)),o<=t&&(i=o+1),t<=o&&(n=o-1)}}function Er(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function Vv(e,t){return et?1:0}let Zg=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let i=this.data;const n=[];if(!co(t,i))return n;const s=this.toBBox,r=[];for(;i;){for(let a=0;a=0&&r[i].children.length>this._maxEntries;)this._split(r,i),i--;this._adjustParentBBoxes(s,r,i)}_split(t,i){const n=t[i],s=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,s);const a=this._chooseSplitIndex(n,r,s),o=as(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,Jn(n,this.toBBox),Jn(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)}_splitRoot(t,i){this.data=as([t,i]),this.data.height=t.height+1,this.data.leaf=!1,Jn(this.data,this.toBBox)}_chooseSplitIndex(t,i,n){let s,r=1/0,a=1/0;for(let o=i;o<=n-i;o++){const h=Sr(t,0,o,this.toBBox),l=Sr(t,o,n,this.toBBox),c=Jv(h,l),u=Qh(h)+Qh(l);c=i;l--){const c=t.children[l];Rr(o,t.leaf?r(c):c),h+=lo(o)}return h}_adjustParentBBoxes(t,i,n){for(let s=n;s>=0;s--)Rr(i[s],t)}_condense(t){for(let i=t.length-1,n;i>=0;i--)t[i].children.length===0?i>0?(n=t[i-1].children,n.splice(n.indexOf(t[i]),1)):this.clear():Jn(t[i],this.toBBox)}};function Kv(e,t,i){if(!i)return t.indexOf(e);for(let n=0;n=e.minX&&t.maxY>=e.minY}function as(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ad(e,t,i,n,s){const r=[t,i];for(;r.length;){if(i=r.pop(),t=r.pop(),i-t<=n)continue;const a=t+Math.ceil((i-t)/n/2)*n;$g(e,a,t,i,s),r.push(t,a,a,i)}}function od(e,t,i,n){return i!==void 0&&n!==void 0?[i/e,n/t]:i!==void 0?i/e:n!==void 0?n/t:1}class ir extends wh{constructor(t){t=t||{};const i=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,r=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:i,rotation:n,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const a=t.img!==void 0?t.img:null;let o=t.src;ut(!(o!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(o===void 0||o.length===0)&&a&&(o=a.src||gt(a)),ut(o!==void 0&&o.length>0,"A defined and non-empty `src` or `image` must be provided"),ut(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let h;if(t.src!==void 0?h=q.IDLE:a!==void 0&&("complete"in a?a.complete?h=a.src?q.LOADED:q.IDLE:h=q.LOADING:h=q.LOADED),this.color_=t.color!==void 0?Qs(t.color):null,this.iconImage_=Xc(a,o,this.crossOrigin_,h,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,this.initialOptions_,t.width!==void 0||t.height!==void 0){let l,c;if(t.size)[l,c]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)l=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(od(g[0],g[1],t.width,t.height))};this.listenImageChange(d);return}}l!==void 0&&this.setScale(od(l,c,t.width,t.height))}}clone(){let t,i,n;return this.initialOptions_?(i=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new ir({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:i,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=s[0]),this.anchorYUnits_=="fraction"&&(t[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const i=this.getDisplacement(),n=this.getScaleArray();return[t[0]-i[0]/n[0],t[1]+i[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-i[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-i[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==q.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==q.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(Q.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(Q.CHANGE,t)}ready(){return this.iconImage_.ready()}}let Wn=0;const Qt=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},ix={[T.Get]:J(nt(1,1/0),hd),[T.Var]:J(nt(1,1),nx),[T.Has]:J(nt(1,1/0),hd),[T.Id]:J(sx,Qn),[T.Concat]:J(nt(2,1/0),dt(oe)),[T.GeometryType]:J(rx,Qn),[T.LineMetric]:J(Qn),[T.Resolution]:J(Qn),[T.Zoom]:J(Qn),[T.Time]:J(Qn),[T.Any]:J(nt(2,1/0),dt(Qt)),[T.All]:J(nt(2,1/0),dt(Qt)),[T.Not]:J(nt(1,1),dt(Qt)),[T.Equal]:J(nt(2,2),dt(uo)),[T.NotEqual]:J(nt(2,2),dt(uo)),[T.GreaterThan]:J(nt(2,2),dt(ot)),[T.GreaterThanOrEqualTo]:J(nt(2,2),dt(ot)),[T.LessThan]:J(nt(2,2),dt(ot)),[T.LessThanOrEqualTo]:J(nt(2,2),dt(ot)),[T.Multiply]:J(nt(2,1/0),ld),[T.Coalesce]:J(nt(2,1/0),ld),[T.Divide]:J(nt(2,2),dt(ot)),[T.Add]:J(nt(2,1/0),dt(ot)),[T.Subtract]:J(nt(2,2),dt(ot)),[T.Clamp]:J(nt(3,3),dt(ot)),[T.Mod]:J(nt(2,2),dt(ot)),[T.Pow]:J(nt(2,2),dt(ot)),[T.Abs]:J(nt(1,1),dt(ot)),[T.Floor]:J(nt(1,1),dt(ot)),[T.Ceil]:J(nt(1,1),dt(ot)),[T.Round]:J(nt(1,1),dt(ot)),[T.Sin]:J(nt(1,1),dt(ot)),[T.Cos]:J(nt(1,1),dt(ot)),[T.Atan]:J(nt(1,2),dt(ot)),[T.Sqrt]:J(nt(1,1),dt(ot)),[T.Match]:J(nt(4,1/0),cd,ox),[T.Between]:J(nt(3,3),dt(ot)),[T.Interpolate]:J(nt(6,1/0),cd,hx),[T.Case]:J(nt(3,1/0),ax,lx),[T.In]:J(nt(2,2),cx),[T.Number]:J(nt(1,1/0),dt(uo)),[T.String]:J(nt(1,1/0),dt(uo)),[T.Array]:J(nt(1,1/0),dt(ot)),[T.Color]:J(nt(1,4),dt(ot)),[T.Band]:J(nt(1,3),dt(ot)),[T.Palette]:J(nt(2,2),ux),[T.ToString]:J(nt(1,1),dt(Qt|ot|oe|Be))};function hd(e,t,i){const n=e.length-1,s=new Array(n);for(let r=0;rt){const o=t===1/0?`${e} or more`:`${e} to ${t}`;throw new Error(`expected ${o} arguments for ${r}, got ${a}`)}}}function ld(e,t,i){const n=e.length-1,s=new Array(n);for(let r=0;rn.featureId;case T.GeometryType:return n=>n.geometryType;case T.Concat:{const n=e.args.map(s=>Ve(s));return s=>"".concat(...n.map(r=>r(s).toString()))}case T.Resolution:return n=>n.resolution;case T.Any:case T.All:case T.Between:case T.In:case T.Not:return mx(e);case T.Equal:case T.NotEqual:case T.LessThan:case T.LessThanOrEqualTo:case T.GreaterThan:case T.GreaterThanOrEqualTo:return _x(e);case T.Multiply:case T.Divide:case T.Add:case T.Subtract:case T.Clamp:case T.Mod:case T.Pow:case T.Abs:case T.Floor:case T.Ceil:case T.Round:case T.Sin:case T.Cos:case T.Atan:case T.Sqrt:return yx(e);case T.Case:return px(e);case T.Match:return vx(e);case T.Interpolate:return xx(e);case T.ToString:return Ex(e);default:throw new Error(`Unsupported operator ${i}`)}}function fx(e,t){const i=e.operator,n=e.args.length,s=new Array(n);for(let r=0;r{for(let a=0;a{for(let a=0;a{const r=e.args;let a=s.properties[n];for(let o=1,h=r.length;os.variables[n];case T.Has:return s=>{const r=e.args;if(!(n in s.properties))return!1;let a=s.properties[n];for(let o=1,h=r.length;on(r)===s(r);case T.NotEqual:return r=>n(r)!==s(r);case T.LessThan:return r=>n(r)n(r)<=s(r);case T.GreaterThan:return r=>n(r)>s(r);case T.GreaterThanOrEqualTo:return r=>n(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${i}`)}}function mx(e,t){const i=e.operator,n=e.args.length,s=new Array(n);for(let r=0;r{for(let a=0;a{for(let a=0;a{const a=s[0](r),o=s[1](r),h=s[2](r);return a>=o&&a<=h};case T.In:return r=>{const a=s[0](r);for(let o=1;o!s[0](r);default:throw new Error(`Unsupported logical operator ${i}`)}}function yx(e,t){const i=e.operator,n=e.args.length,s=new Array(n);for(let r=0;r{let a=1;for(let o=0;os[0](r)/s[1](r);case T.Add:return r=>{let a=0;for(let o=0;os[0](r)-s[1](r);case T.Clamp:return r=>{const a=s[0](r),o=s[1](r);if(ah?h:a};case T.Mod:return r=>s[0](r)%s[1](r);case T.Pow:return r=>Math.pow(s[0](r),s[1](r));case T.Abs:return r=>Math.abs(s[0](r));case T.Floor:return r=>Math.floor(s[0](r));case T.Ceil:return r=>Math.ceil(s[0](r));case T.Round:return r=>Math.round(s[0](r));case T.Sin:return r=>Math.sin(s[0](r));case T.Cos:return r=>Math.cos(s[0](r));case T.Atan:return n===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case T.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${i}`)}}function px(e,t){const i=e.args.length,n=new Array(i);for(let s=0;s{for(let r=0;r{const r=n[0](s);for(let a=1;a{const r=n[0](s),a=n[1](s);let o,h;for(let l=2;l=a)return l===2?u:d?Mx(r,a,o,h,c,u):Ir(r,a,o,h,c,u);o=c,h=u}return h}}function Ex(e,t){const i=e.operator,n=e.args.length,s=new Array(n);for(let r=0;r{const a=s[0](r);return e.args[0].type===Be?Lc(a):a.toString()};default:throw new Error(`Unsupported convert operator ${i}`)}}function Ir(e,t,i,n,s,r){const a=s-i;if(a===0)return n;const o=t-i,h=e===1?o/a:(Math.pow(e,o)-1)/(Math.pow(e,a)-1);return n+h*(r-n)}function Mx(e,t,i,n,s,r){if(s-i===0)return n;const o=Wu(n),h=Wu(r);let l=h[2]-o[2];l>180?l-=360:l<-180&&(l+=360);const c=[Ir(e,t,i,o[0],s,h[0]),Ir(e,t,i,o[1],s,h[1]),o[2]+Ir(e,t,i,0,s,l),Ir(e,t,i,n[3],s,r[3])];return vg(b1(c))}function wx(e){return!0}function Sx(e){const t=Hg(),i=Rx(e,t),n=Qg();return function(s,r){if(n.properties=s.getPropertiesInternal(),n.resolution=r,t.featureId){const a=s.getId();a!==void 0?n.featureId=a:n.featureId=null}return t.geometryType&&(n.geometryType=Jg(s.getGeometry())),i(n)}}function ud(e){const t=Hg(),i=e.length,n=new Array(i);for(let a=0;anull;n=Vc(e,t+"fill-color",i)}if(!n)return null;const s=new Ii;return function(r){const a=n(r);return a===Ic?null:(s.setColor(a),s)}}function ia(e,t,i){const n=he(e,t+"stroke-width",i),s=Vc(e,t+"stroke-color",i);if(!n&&!s)return null;const r=xi(e,t+"stroke-line-cap",i),a=xi(e,t+"stroke-line-join",i),o=t0(e,t+"stroke-line-dash",i),h=he(e,t+"stroke-line-dash-offset",i),l=he(e,t+"stroke-miter-limit",i),c=new Jt;return function(u){if(s){const d=s(u);if(d===Ic)return null;c.setColor(d)}if(n&&c.setWidth(n(u)),r){const d=r(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");c.setLineCap(d)}if(a){const d=a(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");c.setLineJoin(d)}return o&&c.setLineDash(o(u)),h&&c.setLineDashOffset(h(u)),l&&c.setMiterLimit(l(u)),c}}function Cx(e,t){const i="text-",n=xi(e,i+"value",t);if(!n)return null;const s=ea(e,i,t),r=ea(e,i+"background-",t),a=ia(e,i,t),o=ia(e,i+"background-",t),h=xi(e,i+"font",t),l=he(e,i+"max-angle",t),c=he(e,i+"offset-x",t),u=he(e,i+"offset-y",t),d=Es(e,i+"overflow",t),g=xi(e,i+"placement",t),f=he(e,i+"repeat",t),_=Ch(e,i+"scale",t),m=Es(e,i+"rotate-with-view",t),p=he(e,i+"rotation",t),y=xi(e,i+"align",t),M=xi(e,i+"justify",t),v=xi(e,i+"baseline",t),E=Es(e,i+"keep-upright",t),w=t0(e,i+"padding",t),b=Th(e,i+"declutter-mode"),S=new Yc({declutterMode:b});return function(R){if(S.setText(n(R)),s&&S.setFill(s(R)),r&&S.setBackgroundFill(r(R)),a&&S.setStroke(a(R)),o&&S.setBackgroundStroke(o(R)),h&&S.setFont(h(R)),l&&S.setMaxAngle(l(R)),c&&S.setOffsetX(c(R)),u&&S.setOffsetY(u(R)),d&&S.setOverflow(d(R)),g){const I=g(R);if(I!=="point"&&I!=="line")throw new Error("Expected point or line for text-placement");S.setPlacement(I)}if(f&&S.setRepeat(f(R)),_&&S.setScale(_(R)),m&&S.setRotateWithView(m(R)),p&&S.setRotation(p(R)),y){const I=y(R);if(I!=="left"&&I!=="center"&&I!=="right"&&I!=="end"&&I!=="start")throw new Error("Expected left, right, center, start, or end for text-align");S.setTextAlign(I)}if(M){const I=M(R);if(I!=="left"&&I!=="right"&&I!=="center")throw new Error("Expected left, right, or center for text-justify");S.setJustify(I)}if(v){const I=v(R);if(I!=="bottom"&&I!=="top"&&I!=="middle"&&I!=="alphabetic"&&I!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");S.setTextBaseline(I)}return w&&S.setPadding(w(R)),E&&S.setKeepUpright(E(R)),S}}function Tx(e,t){return"icon-src"in e?bx(e,t):"shape-points"in e?Ix(e,t):"circle-radius"in e?Ax(e,t):null}function bx(e,t){const i="icon-",n=i+"src",s=e0(e[n],n),r=Yo(e,i+"anchor",t),a=Ch(e,i+"scale",t),o=he(e,i+"opacity",t),h=Yo(e,i+"displacement",t),l=he(e,i+"rotation",t),c=Es(e,i+"rotate-with-view",t),u=fd(e,i+"anchor-origin"),d=gd(e,i+"anchor-x-units"),g=gd(e,i+"anchor-y-units"),f=Fx(e,i+"color"),_=Ox(e,i+"cross-origin"),m=Dx(e,i+"offset"),p=fd(e,i+"offset-origin"),y=qo(e,i+"width"),M=qo(e,i+"height"),v=Px(e,i+"size"),E=Th(e,i+"declutter-mode"),w=new ir({src:s,anchorOrigin:u,anchorXUnits:d,anchorYUnits:g,color:f,crossOrigin:_,offset:m,offsetOrigin:p,height:M,width:y,size:v,declutterMode:E});return function(b){return o&&w.setOpacity(o(b)),h&&w.setDisplacement(h(b)),l&&w.setRotation(l(b)),c&&w.setRotateWithView(c(b)),a&&w.setScale(a(b)),r&&w.setAnchor(r(b)),w}}function Ix(e,t){const i="shape-",n=i+"points",s=i+"radius",r=Fl(e[n],n),a=Fl(e[s],s),o=ea(e,i,t),h=ia(e,i,t),l=Ch(e,i+"scale",t),c=Yo(e,i+"displacement",t),u=he(e,i+"rotation",t),d=Es(e,i+"rotate-with-view",t),g=qo(e,i+"radius2"),f=qo(e,i+"angle"),_=Th(e,i+"declutter-mode"),m=new Rh({points:r,radius:a,radius2:g,angle:f,declutterMode:_});return function(p){return o&&m.setFill(o(p)),h&&m.setStroke(h(p)),c&&m.setDisplacement(c(p)),u&&m.setRotation(u(p)),d&&m.setRotateWithView(d(p)),l&&m.setScale(l(p)),m}}function Ax(e,t){const i="circle-",n=ea(e,i,t),s=ia(e,i,t),r=he(e,i+"radius",t),a=Ch(e,i+"scale",t),o=Yo(e,i+"displacement",t),h=he(e,i+"rotation",t),l=Es(e,i+"rotate-with-view",t),c=Th(e,i+"declutter-mode"),u=new Ba({radius:5,declutterMode:c});return function(d){return r&&u.setRadius(r(d)),n&&u.setFill(n(d)),s&&u.setStroke(s(d)),o&&u.setDisplacement(o(d)),h&&u.setRotation(h(d)),l&&u.setRotateWithView(l(d)),a&&u.setScale(a(d)),u}}function he(e,t,i){if(!(t in e))return;const n=Li(e[t],ot,i);return function(s){return Fl(n(s),t)}}function xi(e,t,i){if(!(t in e))return null;const n=Li(e[t],oe,i);return function(s){return e0(n(s),t)}}function Lx(e,t,i){const n=xi(e,t+"pattern-src",i),s=dd(e,t+"pattern-offset",i),r=dd(e,t+"pattern-size",i),a=Vc(e,t+"color",i);return function(o){return{src:n(o),offset:s&&s(o),size:r&&r(o),color:a&&a(o)}}}function Es(e,t,i){if(!(t in e))return null;const n=Li(e[t],Qt,i);return function(s){const r=n(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${t}`);return r}}function Vc(e,t,i){if(!(t in e))return null;const n=Li(e[t],Be,i);return function(s){return i0(n(s),t)}}function t0(e,t,i){if(!(t in e))return null;const n=Li(e[t],kn,i);return function(s){return Wa(n(s),t)}}function Yo(e,t,i){if(!(t in e))return null;const n=Li(e[t],kn,i);return function(s){const r=Wa(n(s),t);if(r.length!==2)throw new Error(`Expected two numbers for ${t}`);return r}}function dd(e,t,i){if(!(t in e))return null;const n=Li(e[t],kn,i);return function(s){return n0(n(s),t)}}function Ch(e,t,i){if(!(t in e))return null;const n=Li(e[t],kn|ot,i);return function(s){return Nx(n(s),t)}}function qo(e,t){const i=e[t];if(i!==void 0){if(typeof i!="number")throw new Error(`Expected a number for ${t}`);return i}}function Px(e,t){const i=e[t];if(i!==void 0){if(typeof i=="number")return ce(i);if(!Array.isArray(i))throw new Error(`Expected a number or size array for ${t}`);if(i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return i}}function Ox(e,t){const i=e[t];if(i!==void 0){if(typeof i!="string")throw new Error(`Expected a string for ${t}`);return i}}function fd(e,t){const i=e[t];if(i!==void 0){if(i!=="bottom-left"&&i!=="bottom-right"&&i!=="top-left"&&i!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return i}}function gd(e,t){const i=e[t];if(i!==void 0){if(i!=="pixels"&&i!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return i}}function Dx(e,t){const i=e[t];if(i!==void 0)return Wa(i,t)}function Th(e,t){const i=e[t];if(i!==void 0){if(typeof i!="string")throw new Error(`Expected a string for ${t}`);if(i!=="declutter"&&i!=="obstacle"&&i!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return i}}function Fx(e,t){const i=e[t];if(i!==void 0)return i0(i,t)}function Wa(e,t){if(!Array.isArray(e))throw new Error(`Expected an array for ${t}`);const i=e.length;for(let n=0;n4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return i}function n0(e,t){const i=Wa(e,t);if(i.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return i}function Nx(e,t){return typeof e=="number"?e:n0(e,t)}const _d={RENDER_ORDER:"renderOrder"};class s0 extends Bn{constructor(t){t=t||{};const i=Object.assign({},t);delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,super(i),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(_d.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,i){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new Zg(9)),this.getRenderer().renderDeclutter(t,i)}setRenderOrder(t){this.set(_d.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?Kg:t;const i=kx(t);this.styleFunction_=t===null?void 0:Vg(i),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}}function kx(e){if(e===void 0)return Kg;if(!e)return null;if(typeof e=="function"||e instanceof Lt)return e;if(!Array.isArray(e))return ud([e]);if(e.length===0)return[];const t=e.length,i=e[0];if(i instanceof Lt){const s=new Array(t);for(let r=0;rh&&(this.instructions.push([$.CUSTOM,h,c,t,n,us,r]),this.hitDetectionInstructions.push([$.CUSTOM,h,c,t,s||n,us,r]));break;case"Point":l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),c=this.coordinates.length,this.instructions.push([$.CUSTOM,h,c,t,n,void 0,r]),this.hitDetectionInstructions.push([$.CUSTOM,h,c,t,s||n,void 0,r]);break}this.endGeometry(i)}beginGeometry(t,i,n){this.beginGeometryInstruction1_=[$.BEGIN_GEOMETRY,i,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[$.BEGIN_GEOMETRY,i,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let i;const n=t.length;let s,r,a=-1;for(i=0;ithis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0}createFill(t){const i=t.fillStyle,n=[$.SET_FILL_STYLE,i];return typeof i!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[$.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,i){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(i.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,i){const n=t.strokeStyle,s=t.lineCap,r=t.lineDash,a=t.lineDashOffset,o=t.lineJoin,h=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=s||r!=t.currentLineDash&&!ln(t.currentLineDash,r)||t.currentLineDashOffset!=a||t.currentLineJoin!=o||t.currentLineWidth!=h||t.currentMiterLimit!=l)&&(n!==void 0&&i.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=a,t.currentLineJoin=o,t.currentLineWidth=h,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const i=[$.END_GEOMETRY,t];this.instructions.push(i),this.hitDetectionInstructions.push(i)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=wf(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;ec(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class Gx extends Xa{constructor(t,i,n,s){super(t,i,n,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,i,n){if(!this.image_||this.maxExtent&&!Nn(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,i,n);const s=t.getFlatCoordinates(),r=t.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(s,r);this.instructions.push([$.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([$.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(i)}drawMultiPoint(t,i,n){if(!this.image_)return;this.beginGeometry(t,i,n);const s=t.getFlatCoordinates(),r=[];for(let h=0,l=s.length;h=e){const f=(e-o+g)/g,_=me(l,u,f),m=me(c,d,f);h.push(_,m),r.push(h),h=[_,m],o==e&&(a+=s),o=0}else if(o0&&r.push(h),r}function Bx(e,t,i,n,s){let r=i,a=i,o=0,h=0,l=i,c,u,d,g,f,_,m,p,y,M;for(u=i;ue&&(h>o&&(o=h,r=l,a=u),h=0,l=u-s)),d=g,m=y,p=M),f=v,_=E}return h+=g,h>o?[l,u]:[r,a]}const Vo={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class Wx extends Xa{constructor(t,i,n,s){super(t,i,n,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[ae]={fillStyle:ae},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,i,n){const s=this.textFillState_,r=this.textStrokeState_,a=this.textState_;if(this.text_===""||!a||!s&&!r)return;const o=this.coordinates;let h=o.length;const l=t.getType();let c=null,u=t.getStride();if(a.placement==="line"&&(l=="LineString"||l=="MultiLineString"||l=="Polygon"||l=="MultiPolygon")){if(!te(this.maxExtent,t.getExtent()))return;let d;if(c=t.getFlatCoordinates(),l=="LineString")d=[c.length];else if(l=="MultiLineString")d=t.getEnds();else if(l=="Polygon")d=t.getEnds().slice(0,1);else if(l=="MultiPolygon"){const m=t.getEndss();d=[];for(let p=0,y=m.length;p{const E=o[(y+v)*2]===c[v*u]&&o[(y+v)*2+1]===c[v*u+1];return E||--y,E})}this.saveTextStates_(),(a.backgroundFill||a.backgroundStroke)&&(this.setFillStrokeStyle(a.backgroundFill,a.backgroundStroke),a.backgroundFill&&this.updateFillStyle(this.state,this.createFill),a.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,i,n);let f=a.padding;if(f!=Sn&&(a.scale[0]<0||a.scale[1]<0)){let y=a.padding[0],M=a.padding[1],v=a.padding[2],E=a.padding[3];a.scale[0]<0&&(M=-M,E=-E),a.scale[1]<0&&(y=-y,v=-v),f=[y,M,v,E]}const _=this.pixelRatio;this.instructions.push([$.DRAW_IMAGE,h,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,f==Sn?Sn:f.map(function(y){return y*_}),!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const m=1/_,p=this.state.fillStyle;a.backgroundFill&&(this.state.fillStyle=ae,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([$.DRAW_IMAGE,h,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterMode_,this.declutterImageWithText_,f,!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?ae:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),a.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(i)}}saveTextStates_(){const t=this.textStrokeState_,i=this.textState_,n=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:i.font,textAlign:i.textAlign||Qr,justify:i.justify,textBaseline:i.textBaseline||Xo,scale:i.scale});const a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(t,i){const n=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();const h=this.pixelRatio,l=Vo[s.textBaseline],c=this.textOffsetY_*h,u=this.text_,d=n?n.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([$.DRAW_CHARS,t,i,l,s.overflow,o,s.maxAngle,h,c,r,d*h,u,a,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([$.DRAW_CHARS,t,i,l,s.overflow,o&&ae,s.maxAngle,h,c,r,d*h,u,a,1/h,this.declutterMode_,this.textKeepUpright_])}setTextStyle(t,i){let n,s,r;if(!t)this.text_="";else{const a=t.getFill();a?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=ni(a.getColor()||ae)):(s=null,this.textFillState_=s);const o=t.getStroke();if(!o)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const _=o.getLineDash(),m=o.getLineDashOffset(),p=o.getWidth(),y=o.getMiterLimit();r.lineCap=o.getLineCap()||tr,r.lineDash=_?_.slice():Si,r.lineDashOffset=m===void 0?Ri:m,r.lineJoin=o.getLineJoin()||er,r.lineWidth=p===void 0?ta:p,r.miterLimit=y===void 0?Hr:y,r.strokeStyle=ni(o.getColor()||Jr)}n=this.textState_;const h=t.getFont()||Yg;Bv(h);const l=t.getScaleArray();n.overflow=t.getOverflow(),n.font=h,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Xo,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Sn,n.scale=l===void 0?[1,1]:l;const c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),g=t.getKeepUpright(),f=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textKeepUpright_=g===void 0?!0:g,this.textRotation_=f===void 0?0:f,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:gt(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+gt(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=i}}const Xx={Circle:yd,Default:Xa,Image:Gx,LineString:zx,Polygon:yd,Text:Wx};class jx{constructor(t,i,n,s){this.tolerance_=t,this.maxExtent_=i,this.pixelRatio_=s,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const i in this.buildersByZIndex_){t[i]=t[i]||{};const n=this.buildersByZIndex_[i];for(const s in n){const r=n[s].finish();t[i][s]=r}}return t}getBuilder(t,i){const n=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[n];s===void 0&&(s={},this.buildersByZIndex_[n]=s);let r=s[i];if(r===void 0){const a=Xx[i];r=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[i]=r}return r}}function Yx(e,t,i,n,s,r,a,o,h,l,c,u,d=!0){let g=e[t],f=e[t+1],_=0,m=0,p=0,y=0;function M(){_=g,m=f,t+=n,g=e[t],f=e[t+1],y+=p,p=Math.sqrt((g-_)*(g-_)+(f-m)*(f-m))}do M();while(tk[2]}else C=E>I;const D=Math.PI,F=[],G=b+n===t;t=b,p=0,y=S,g=e[t],f=e[t+1];let z;if(G){M(),z=Math.atan2(f-m,g-_),C&&(z+=z>0?-D:D);const k=(I+E)/2,H=(O+w)/2;return F[0]=[k,H,(R-r)/2,z,s],F}s=s.replace(/\n/g," ");for(let k=0,H=s.length;k0?-D:D),z!==void 0){let _t=it-z;if(_t+=_t>D?-2*D:_t<-D?2*D:0,Math.abs(_t)>a)return null}z=it;const j=k;let K=0;for(;k0&&e.push(` +`,""),e.push(t,""),e}class Vx{constructor(t,i,n,s,r){this.overlaps=n,this.pixelRatio=i,this.resolution=t,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=Ye(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new yg:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,i,n,s){const r=t+i+n+s;if(this.labels_[r])return this.labels_[r];const a=s?this.strokeStates[s]:null,o=n?this.fillStates[n]:null,h=this.textStates[i],l=this.pixelRatio,c=[h.scale[0]*l,h.scale[1]*l],u=h.justify?Vo[h.justify]:el(Array.isArray(t)?t[0]:t,h.textAlign||Qr),d=s&&a.lineWidth?a.lineWidth:0,g=Array.isArray(t)?t:String(t).split(` +`).reduce(qx,[]),{width:f,height:_,widths:m,heights:p,lineWidths:y}=Xv(h,g),M=f+d,v=[],E=(M+2)*c[0],w=(_+d)*c[1],b={width:E<0?Math.floor(E):Math.ceil(E),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:v};(c[0]!=1||c[1]!=1)&&v.push("scale",c),s&&(v.push("strokeStyle",a.strokeStyle),v.push("lineWidth",d),v.push("lineCap",a.lineCap),v.push("lineJoin",a.lineJoin),v.push("miterLimit",a.miterLimit),v.push("setLineDash",[a.lineDash]),v.push("lineDashOffset",a.lineDashOffset)),n&&v.push("fillStyle",o.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");const S=.5-u;let R=u*M+S*d;const I=[],O=[];let C=0,D=0,F=0,G=0,z;for(let k=0,H=g.length;kt?t-l:r,v=a+c>i?i-c:a,E=f[3]+M*d[0]+f[1],w=f[0]+v*d[1]+f[2],b=p-f[3],S=y-f[0];(_||u!==0)&&(Ni[0]=b,ki[0]=b,Ni[1]=S,mi[1]=S,mi[0]=b+E,yi[0]=mi[0],yi[1]=S+w,ki[1]=yi[1]);let R;return u!==0?(R=ai(Ye(),n,s,1,1,u,-n,-s),Nt(R,Ni),Nt(R,mi),Nt(R,yi),Nt(R,ki),Ci(Math.min(Ni[0],mi[0],yi[0],ki[0]),Math.min(Ni[1],mi[1],yi[1],ki[1]),Math.max(Ni[0],mi[0],yi[0],ki[0]),Math.max(Ni[1],mi[1],yi[1],ki[1]),ts)):Ci(Math.min(b,b+E),Math.min(S,S+w),Math.max(b,b+E),Math.max(S,S+w),ts),g&&(p=Math.round(p),y=Math.round(y)),{drawImageX:p,drawImageY:y,drawImageW:M,drawImageH:v,originX:l,originY:c,declutterBox:{minX:ts[0],minY:ts[1],maxX:ts[2],maxY:ts[3],value:m},canvasTransform:R,scale:d}}replayImageOrLabel_(t,i,n,s,r,a,o){const h=!!(a||o),l=s.declutterBox,c=o?o[2]*s.scale[0]/2:0;return l.minX-c<=i[0]&&l.maxX+c>=0&&l.minY-c<=i[1]&&l.maxY+c>=0&&(h&&this.replayTextBackground_(t,Ni,mi,yi,ki,a,o),jv(t,s.canvasTransform,r,n,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const i=this.alignAndScaleFill_;if(i){const n=Nt(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(n[0]%s,n[1]%s),i!==1&&t.scale(i,i),t.rotate(this.viewRotation_)}t.fill(),i&&t.restore()}setStrokeStyle_(t,i){t.strokeStyle=i[1],t.lineWidth=i[2],t.lineCap=i[3],t.lineJoin=i[4],t.miterLimit=i[5],t.lineDashOffset=i[7],t.setLineDash(i[6])}drawLabelWithPointPlacement_(t,i,n,s){const r=this.textStates[i],a=this.createLabel(t,i,s,n),o=this.strokeStates[n],h=this.pixelRatio,l=el(Array.isArray(t)?t[0]:t,r.textAlign||Qr),c=Vo[r.textBaseline||Xo],u=o&&o.lineWidth?o.lineWidth:0,d=a.width/h-2*r.scale[0],g=l*d+2*(.5-l)*u,f=c*a.height/h+2*(.5-c)*u;return{label:a,anchorX:g,anchorY:f}}execute_(t,i,n,s,r,a,o,h){const l=this.zIndexContext_;let c;this.pixelCoordinates_&&ln(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=sn(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Zm(this.renderedTransform_,n));let u=0;const d=s.length;let g=0,f,_,m,p,y,M,v,E,w,b,S,R,I,O=0,C=0,D=null,F=null;const G=this.coordinateCache_,z=this.viewRotation_,k=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,H={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:z},it=this.instructions!=s||this.overlaps?0:200;let j,K,rt,at;for(;uit&&(this.fill_(t),O=0),C>it&&(t.stroke(),C=0),!O&&!C&&(t.beginPath(),y=NaN,M=NaN),++u;break;case $.CIRCLE:g=P[1];const Et=c[g],Ct=c[g+1],ve=c[g+2],De=c[g+3],ne=ve-Et,Ke=De-Ct,un=Math.sqrt(ne*ne+Ke*Ke);t.moveTo(Et+un,Ct),t.arc(Et,Ct,un,0,2*Math.PI,!0),++u;break;case $.CLOSE_PATH:t.closePath(),++u;break;case $.CUSTOM:g=P[1],f=P[2];const Xn=P[3],fr=P[4],dn=P[5];H.geometry=Xn,H.feature=j,u in G||(G[u]=[]);const di=G[u];dn?dn(c,g,f,2,di):(di[0]=c[g],di[1]=c[g+1],di.length=2),l&&(l.zIndex=P[6]),fr(di,H),++u;break;case $.DRAW_IMAGE:g=P[1],f=P[2],w=P[3],_=P[4],m=P[5];let xe=P[6];const $e=P[7],jn=P[8],Yn=P[9],gr=P[10];let fn=P[11];const qn=P[12];let Vn=P[13];p=P[14]||"declutter";const Gt=P[15];if(!w&&P.length>=20){b=P[19],S=P[20],R=P[21],I=P[22];const Ee=this.drawLabelWithPointPlacement_(b,S,R,I);w=Ee.label,P[3]=w;const gn=P[23];_=(Ee.anchorX-gn)*this.pixelRatio,P[4]=_;const Me=P[24];m=(Ee.anchorY-Me)*this.pixelRatio,P[5]=m,xe=w.height,P[6]=xe,Vn=w.width,P[13]=Vn}let Ah;P.length>25&&(Ah=P[25]);let Lh,Ha,Ja;P.length>17?(Lh=P[16],Ha=P[17],Ja=P[18]):(Lh=Sn,Ha=!1,Ja=!1),gr&&k?fn+=z:!gr&&!k&&(fn-=z);let Q0=0;for(;g!a0.includes(e));class $x{constructor(t,i,n,s,r,a,o){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=n,this.resolution_=i,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Ye(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,o)}clip(t,i){const n=this.getClipCoords(i);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,i){for(const n in t){let s=this.executorsByZIndex_[n];s===void 0&&(s={},this.executorsByZIndex_[n]=s);const r=t[n];for(const a in r){const o=r[a];s[a]=new Vx(this.resolution_,this.pixelRatio_,this.overlaps_,o,i)}}}hasExecutors(t){for(const i in this.executorsByZIndex_){const n=this.executorsByZIndex_[i];for(let s=0,r=t.length;s0){if(!a||b==="none"||g!=="Image"&&g!=="Text"||a.includes(E)){const O=(d[R]-3)/4,C=s-O%o,D=s-(O/o|0),F=r(E,w,C*C+D*D);if(F)return F}c.clearRect(0,0,o,o);break}}const _=Object.keys(this.executorsByZIndex_).map(Number);_.sort(wi);let m,p,y,M,v;for(m=_.length-1;m>=0;--m){const E=_[m].toString();for(y=this.executorsByZIndex_[E],p=ds.length-1;p>=0;--p)if(g=ds[p],M=y[g],M!==void 0&&(v=M.executeHitDetection(c,h,n,f,u),v))return v}}getClipCoords(t){const i=this.maxExtent_;if(!i)return null;const n=i[0],s=i[1],r=i[2],a=i[3],o=[n,s,n,a,r,a,r,s];return sn(o,0,8,2,t,o),o}isEmpty(){return qs(this.executorsByZIndex_)}execute(t,i,n,s,r,a,o){const h=Object.keys(this.executorsByZIndex_).map(Number);h.sort(o?V_:wi),a=a||ds;const l=ds.length;for(let c=0,u=h.length;cp.execute(E,i,n,s,r,o)),v&&M.restore(),y){y.offset();const E=h[c]*l+f;this.deferredZIndexContexts_[E]||(this.deferredZIndexContexts_[E]=[]),this.deferredZIndexContexts_[E].push(y)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,i=Object.keys(t).map(Number).sort(wi);for(let n=0,s=i.length;n{r.draw(this.renderedContext_),r.clear()}),t[i[n]].length=0}}const il={};function Zx(e){if(il[e]!==void 0)return il[e];const t=e*2+1,i=e*e,n=new Array(i+1);for(let r=0;r<=e;++r)for(let a=0;a<=e;++a){const o=r*r+a*a;if(o>i)break;let h=n[o];h||(h=[],n[o]=h),h.push(((e+r)*t+(e+a))*4+3),r>0&&h.push(((e-r)*t+(e+a))*4+3),a>0&&(h.push(((e+r)*t+(e-a))*4+3),r>0&&h.push(((e-r)*t+(e-a))*4+3))}const s=[];for(let r=0,a=n.length;ru*this.pixelRatio_),lineDashOffset:(a||Ri)*this.pixelRatio_,lineJoin:o!==void 0?o:er,lineWidth:(h!==void 0?h:ta)*this.pixelRatio_,miterLimit:l!==void 0?l:Hr,strokeStyle:ni(n||Jr)}}}setImageStyle(t){let i;if(!t||!(i=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*n,this.imageAnchorY_=s[1]*n,this.imageHeight_=i[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const a=t.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=i[0]*n}setTextStyle(t){if(!t)this.text_="";else{const i=t.getFill();if(!i)this.textFillState_=null;else{const g=i.getColor();this.textFillState_={fillStyle:ni(g||ae)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const g=n.getColor(),f=n.getLineCap(),_=n.getLineDash(),m=n.getLineDashOffset(),p=n.getLineJoin(),y=n.getWidth(),M=n.getMiterLimit();this.textStrokeState_={lineCap:f!==void 0?f:tr,lineDash:_||Si,lineDashOffset:m||Ri,lineJoin:p!==void 0?p:er,lineWidth:y!==void 0?y:ta,miterLimit:M!==void 0?M:Hr,strokeStyle:ni(g||Jr)}}const s=t.getFont(),r=t.getOffsetX(),a=t.getOffsetY(),o=t.getRotateWithView(),h=t.getRotation(),l=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:s!==void 0?s:Yg,textAlign:u!==void 0?u:Qr,textBaseline:d!==void 0?d:Xo},this.text_=c!==void 0?Array.isArray(c)?c.reduce((g,f,_)=>g+=_%2?" ":f,""):c:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=a!==void 0?this.pixelRatio_*a:0,this.textRotateWithView_=o!==void 0?o:!1,this.textRotation_=h!==void 0?h:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}}}const Qe=.5;function Jx(e,t,i,n,s,r,a,o,h){const l=h?uc(s):s,c=e[0]*Qe,u=e[1]*Qe,d=Ot(c,u);d.imageSmoothingEnabled=!1;const g=d.canvas,f=new Hx(d,Qe,s,null,a,o,h?ph(Bm(),h):null),_=i.length,m=Math.floor((256*256*256-1)/_),p={};for(let M=1;M<=_;++M){const v=i[M-1],E=v.getStyleFunction()||n;if(!E)continue;let w=E(v,r);if(!w)continue;Array.isArray(w)||(w=[w]);const S=(M*m).toString(16).padStart(7,"#00000");for(let R=0,I=w.length;R0;return u&&Promise.all(h).then(()=>s(null)),nE(e,t,i,n,r,a,o),u}function nE(e,t,i,n,s,r,a){const o=i.getGeometryFunction()(t);if(!o)return;const h=o.simplifyTransformed(n,s);if(i.getRenderer())l0(e,h,i,t,a);else{const c=o0[h.getType()];c(e,h,i,t,a,r)}}function l0(e,t,i,n,s){if(t.getType()=="GeometryCollection"){const a=t.getGeometries();for(let o=0,h=a.length;o{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,a=this.renderedRotation_,o=this.renderedProjection_,h=this.wrappedRenderedExtent_,l=this.getLayer(),c=[],u=n[0]*Qe,d=n[1]*Qe;c.push(this.getRenderTransform(s,r,a,Qe,u,d,0).slice());const g=l.getSource(),f=o.getExtent();if(g.getWrapX()&&o.canWrapX()&&!ti(f,h)){let _=h[0];const m=st(f);let p=0,y;for(;_f[2];)++p,y=m*p,c.push(this.getRenderTransform(s,r,a,Qe,u,d,y).slice()),_-=m}this.hitDetectionImageData_=Jx(n,c,this.renderedFeatures_,l.getStyleFunction(),h,r,a,xd(r,this.renderedPixelRatio_),null)}i(Qx(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,i,n,s,r){if(!this.replayGroup_)return;const a=i.viewState.resolution,o=i.viewState.rotation,h=this.getLayer(),l={},c=function(d,g,f){const _=gt(d),m=l[_];if(m){if(m!==!0&&fd.value):null)}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const i=this.getLayer(),n=i.getSource();if(!n)return!1;const s=t.viewHints[Ut.ANIMATING],r=t.viewHints[Ut.INTERACTING],a=i.getUpdateWhileAnimating(),o=i.getUpdateWhileInteracting();if(this.ready&&!a&&s||!o&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const h=t.extent,l=t.viewState,c=l.projection,u=l.resolution,d=t.pixelRatio,g=i.getRevision(),f=i.getRenderBuffer();let _=i.getRenderOrder();_===void 0&&(_=eE);const m=l.center.slice(),p=ec(h,f*u),y=p.slice(),M=[p.slice()],v=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!ti(v,t.extent)){const F=st(v),G=Math.max(st(p)/2,F);p[0]=v[0]-G,p[2]=v[2]+G,Lf(m,c);const z=If(M[0],c);z[0]v[0]&&z[2]>v[2]&&M.push([z[0]-F,z[1],z[2]-F,z[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==_&&this.renderedFrameDeclutter_===!!t.declutter&&ti(this.wrappedRenderedExtent_,p))return ln(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const E=new jx(h0(u,d),p,u,d);let w;for(let F=0,G=M.length;F{let z;const k=F.getStyleFunction()||i.getStyleFunction();if(k&&(z=k(F,u)),z){const H=this.renderFeature(F,b,z,E,w,this.getLayer().getDeclutter(),G);S=S&&!H}},I=uc(p),O=n.getFeaturesInExtent(I);_&&O.sort(_);for(let F=0,G=O.length;F{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),i&&this.simplifiedGeometry_.applyTransform(i);const n=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":n.length=yc(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),s=[n.length];break;case"MultiLineString":s=[],n.length=ry(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,s);break;case"Polygon":s=[],n.length=pc(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,s);break}return s&&(this.simplifiedGeometry_=new Ue(this.type_,n,s,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Ue.prototype.getFlatCoordinates=Ue.prototype.getOrientedFlatCoordinates;const Se={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function gE(e,t){return[[-1/0,-1/0,1/0,1/0]]}function gT(e,t){return[e]}let _E=!1;function mE(e,t,i,n,s,r,a){const o=new XMLHttpRequest;o.open("GET",typeof e=="function"?e(i,n,s):e,!0),t.getType()=="arraybuffer"&&(o.responseType="arraybuffer"),o.withCredentials=_E,o.onload=function(h){if(!o.status||o.status>=200&&o.status<300){const l=t.getType();try{let c;l=="text"||l=="json"?c=o.responseText:l=="xml"?c=o.responseXML||o.responseText:l=="arraybuffer"&&(c=o.response),c?r(t.readFeatures(c,{extent:i,featureProjection:s}),t.readProjection(c)):a()}catch{a()}}else a()},o.onerror=a,o.send()}function Sd(e,t){return function(i,n,s,r,a){const o=this;mE(e,t,i,n,s,function(h,l){o.addFeatures(h),r!==void 0&&r(h)},a||Ys)}}class Gi extends li{constructor(t,i,n){super(t),this.feature=i,this.features=n}}class yE extends Fc{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Ys,this.format_=t.format||null,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(ut(this.format_,"`format` must be set when `url` is set"),this.loader_=Sd(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:gE;const i=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=i?new Md:null,this.loadedExtentsRtree_=new Md,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,s;Array.isArray(t.features)?s=t.features:t.features&&(n=t.features,s=n.getArray()),!i&&n===void 0&&(n=new ii(s)),s!==void 0&&this.addFeaturesInternal(s),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const i=gt(t);if(!this.addToIndex_(i,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(i,t);const n=t.getGeometry();if(n){const s=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[i]=t;this.dispatchEvent(new Gi(Se.ADDFEATURE,t))}setupChangeEvents_(t,i){i instanceof Ue||(this.featureChangeKeys_[t]=[lt(i,Q.CHANGE,this.handleFeatureChange_,this),lt(i,Vs.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,i){let n=!0;if(i.getId()!==void 0){const s=String(i.getId());if(!(s in this.idIndex_))this.idIndex_[s]=i;else if(i instanceof Ue){const r=this.idIndex_[s];r instanceof Ue?Array.isArray(r)?r.push(i):this.idIndex_[s]=[r,i]:n=!1}else n=!1}return n&&(ut(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=i),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const i=[],n=[],s=[];for(let r=0,a=t.length;r{i||(i=!0,this.addFeature(n.element),i=!1)}),t.addEventListener(re.REMOVE,n=>{i||(i=!0,this.removeFeature(n.element),i=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(wt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(n=>{this.removeFeatureInternal(n)});for(const n in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const i=new Gi(Se.CLEAR);this.dispatchEvent(i),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,i){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(s){const r=s.getGeometry();if(r instanceof Ue||r.intersectsCoordinate(t))return i(s)})}forEachFeatureInExtent(t,i){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,i);this.featuresCollection_&&this.featuresCollection_.forEach(i)}forEachFeatureIntersectingExtent(t,i){return this.forEachFeatureInExtent(t,function(n){const s=n.getGeometry();if(s instanceof Ue||s.intersectsExtent(t)){const r=i(n);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),qs(this.nullGeometryFeatures_)||lh(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const i=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){i.push(n)}),i}getFeaturesInExtent(t,i){if(this.featuresRtree_){if(!(i&&i.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=sc(t,i);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,i){const n=t[0],s=t[1];let r=null;const a=[NaN,NaN];let o=1/0;const h=[-1/0,-1/0,1/0,1/0];return i=i||jr,this.featuresRtree_.forEachInExtent(h,function(l){if(i(l)){const c=l.getGeometry(),u=o;if(o=c instanceof Ue?0:c.closestPointXY(n,s,a,o),o{--this.loadingExtentsCount_,this.dispatchEvent(new Gi(Se.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Gi(Se.FEATURESLOADERROR))}),s.insert(h,{extent:h.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const i=this.loadedExtentsRtree_,n=i.forEachInExtent(t,function(s){if(Ks(s.extent,t))return s});n&&i.remove(n)}removeFeatures(t){let i=!1;for(let n=0,s=t.length;n0&&this.points_[n+2]>t;)n-=3;const s=this.points_[i+2]-this.points_[n+2];if(s<1e3/60)return!1;const r=this.points_[i]-this.points_[n],a=this.points_[i+1]-this.points_[n+1];return this.angle_=Math.atan2(a,r),this.initialVelocity_=Math.sqrt(r*r+a*a)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}class vE extends oh{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,i){ct()}calculateMatrices2D(t){const i=t.viewState,n=t.coordinateToPixelTransform,s=t.pixelToCoordinateTransform;ai(n,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]),Xf(s,n)}forEachFeatureAtCoordinate(t,i,n,s,r,a,o,h){let l;const c=i.viewState;function u(v,E,w,b){return r.call(a,E,v?w:null,b)}const d=c.projection,g=Lf(t.slice(),d),f=[[0,0]];if(d.canWrapX()&&s){const v=d.getExtent(),E=st(v);f.push([-E,0],[E,0])}const _=i.layerStatesArray,m=_.length,p=[],y=[];for(let v=0;v=0;--E){const w=_[E],b=w.layer;if(b.hasRenderer()&&wc(w,c)&&o.call(h,b)){const S=b.getRenderer(),R=b.getSource();if(S&&R){const I=R.getWrapX()?g:t,O=u.bind(null,w.managed);y[0]=I[0]+f[v][0],y[1]=I[1]+f[v][1],l=S.forEachFeatureAtCoordinate(y,i,n,O,p)}if(l)return l}}if(p.length===0)return;const M=1/p.length;return p.forEach((v,E)=>v.distanceSq+=E*M),p.sort((v,E)=>v.distanceSq-E.distanceSq),p.some(v=>l=v.callback(v.feature,v.layer,v.geometry)),l}hasFeatureAtCoordinate(t,i,n,s,r,a){return this.forEachFeatureAtCoordinate(t,i,n,s,jr,this,r,a)!==void 0}getMap(){return this.map_}renderFrame(t){ct()}scheduleExpireIconCache(t){Le.canExpireCache()&&t.postRenderFunctions.push(xE)}}function xE(e,t){Le.expire()}class EE extends vE{constructor(t){super(t),this.fontChangeListenerKey_=lt(vi,Vs.PROPERTYCHANGE,t.redrawText,t),this.element_=document.createElement("div");const i=this.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",this.element_.className=Sh+" ol-layers";const n=t.getViewport();n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,i){const n=this.getMap();if(n.hasListener(t)){const s=new fg(t,void 0,i);n.dispatchEvent(s)}}disposeInternal(){wt(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(Ae.PRECOMPOSE,t);const i=t.layerStatesArray.sort((o,h)=>o.zIndex-h.zIndex);i.some(o=>o.layer instanceof s0&&o.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const r=[];let a=null;for(let o=0,h=i.length;o=0;--n){const s=i[n],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}i.forEach(n=>n.layer.renderDeferred(t))}}}class Xi extends li{constructor(t,i){super(t),this.layer=i}}const nl={LAYERS:"layers"};class ur extends Mf{constructor(t){t=t||{};const i=Object.assign({},t);delete i.layers;let n=t.layers;super(i),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(nl.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new ii(n.slice(),{unique:!0}):ut(typeof n.getArray=="function","Expected `layers` to be an array or a `Collection`"):n=new ii(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(wt),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(lt(t,re.ADD,this.handleLayersAdd_,this),lt(t,re.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(wt);Na(this.listenerKeys_);const i=t.getArray();for(let n=0,s=i.length;n{this.clickTimeoutId_=void 0;const n=new Bi(Tt.SINGLECLICK,this.map_,t);this.dispatchEvent(n)},250)}updateActivePointers_(t){const i=t,n=i.pointerId;if(i.type==Tt.POINTERUP||i.type==Tt.POINTERCANCEL){delete this.trackedTouches_[n];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==i.target){delete this.trackedTouches_[s];break}}else(i.type==Tt.POINTERDOWN||i.type==Tt.POINTERMOVE)&&(this.trackedTouches_[n]=i);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const i=new Bi(Tt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(i),this.emulateClicks_&&!i.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(wt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const i=new Bi(Tt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(i),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(lt(n,Tt.POINTERMOVE,this.handlePointerMove_,this),lt(n,Tt.POINTERUP,this.handlePointerUp_,this),lt(this.element_,Tt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(lt(this.element_.getRootNode(),Tt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const i=new Bi(Tt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(i)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const i=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Bi(Tt.POINTERMOVE,this.map_,t,i))}handleTouchMove_(t){const i=this.originalPointerMoveEvent_;(!i||i.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(wt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Q.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(wt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(wt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Wi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},qt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Ko=1/0;class wE{constructor(t,i){this.priorityFunction_=t,this.keyFunction_=i,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Na(this.queuedElements_)}dequeue(){const t=this.elements_,i=this.priorities_,n=t[0];t.length==1?(t.length=0,i.length=0):(t[0]=t.pop(),i[0]=i.pop(),this.siftUp_(0));const s=this.keyFunction_(n);return delete this.queuedElements_[s],n}enqueue(t){ut(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const i=this.priorityFunction_(t);return i!=Ko?(this.elements_.push(t),this.priorities_.push(i),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const i=this.elements_,n=this.priorities_,s=i.length,r=i[t],a=n[t],o=t;for(;t>1;){const h=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),c=lt;){const o=this.getParentIndex_(i);if(s[o]>a)n[i]=n[o],s[i]=s[o],i=o;else break}n[i]=r,s[i]=a}reprioritize(){const t=this.priorityFunction_,i=this.elements_,n=this.priorities_;let s=0;const r=i.length;let a,o,h;for(o=0;o0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===W.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,s.load())}}}function RE(e,t,i,n,s){if(!e||!(i in e.wantedTiles)||!e.wantedTiles[i][t.getKey()])return Ko;const r=e.viewState.center,a=n[0]-r[0],o=n[1]-r[1];return 65536*Math.log(s)+Math.sqrt(a*a+o*o)/s}class Kc extends ci{constructor(t){super();const i=t.element;i&&!t.target&&!i.style.pointerEvents&&(i.style.pointerEvents="auto"),this.element=i||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 i=0,n=this.listenerKeys.length;is.getAttributions(t)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>n.add(s)):n.add(this.attributions_)),!this.overrideCollapsible_){const s=!i.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(n)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const i=await Promise.all(this.collectSourceAttributions_(t).map(s=>Ef(()=>s))),n=i.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!ln(i,this.renderedAttributions_)){E1(this.ulElement_);for(let s=0,r=i.length;s0&&n%(2*Math.PI)!==0?i.animate({rotation:0,duration:this.duration_,easing:or}):i.setRotation(0))}render(t){const i=t.frameState;if(!i)return;const n=i.viewState.rotation;if(n!=this.rotation_){const s="rotate("+n+"rad)";if(this.autoHide_){const r=this.element.classList.contains(ho);!r&&n===0?this.element.classList.add(ho):r&&n!==0&&this.element.classList.remove(ho)}this.label_.style.transform=s}this.rotation_=n}}class TE extends Kc{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const i=t.className!==void 0?t.className:"ol-zoom",n=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:i+"-in",r=t.zoomOutClassName!==void 0?t.zoomOutClassName:i+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",o=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",h=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",l=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=h,c.appendChild(typeof a=="string"?document.createTextNode(a):a),c.addEventListener(Q.CLICK,this.handleClick_.bind(this,n),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=l,u.appendChild(typeof o=="string"?document.createTextNode(o):o),u.addEventListener(Q.CLICK,this.handleClick_.bind(this,-n),!1);const d=i+" "+Sh+" "+jc,g=this.element;g.className=d,g.appendChild(c),g.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,i){i.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const n=this.getMap().getView();if(!n)return;const s=n.getZoom();if(s!==void 0){const r=n.getConstrainedZoom(s+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.duration_,easing:or})):n.setZoom(r)}}}function bE(e){e=e||{};const t=new ii;return(e.zoom!==void 0?e.zoom:!0)&&t.push(new TE(e.zoomOptions)),(e.rotate!==void 0?e.rotate:!0)&&t.push(new CE(e.rotateOptions)),(e.attribution!==void 0?e.attribution:!0)&&t.push(new c0(e.attributionOptions)),t}const Rd={ACTIVE:"active"};class ja extends ci{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(Rd.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(Rd.ACTIVE,t)}setMap(t){this.map_=t}}function IE(e,t,i){const n=e.getCenterInternal();if(n){const s=[n[0]+t[0],n[1]+t[1]];e.animateInternal({duration:i!==void 0?i:250,easing:$m,center:e.getConstrainedCenter(s)})}}function $c(e,t,i,n){const s=e.getZoom();if(s===void 0)return;const r=e.getConstrainedZoom(s+t),a=e.getResolutionForZoom(r);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:a,anchor:i,duration:n!==void 0?n:250,easing:or})}class AE extends ja{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let i=!1;if(t.type==Tt.DBLCLICK){const n=t.originalEvent,s=t.map,r=t.coordinate,a=n.shiftKey?-this.delta_:this.delta_,o=s.getView();$c(o,a,r,this.duration_),n.preventDefault(),i=!0}return!i}}class Ya extends ja{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let i=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Tt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Tt.POINTERUP){const n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==Tt.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,i=this.stopDown(n)}else t.type==Tt.POINTERMOVE&&this.handleMoveEvent(t);return!i}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function Zc(e){const t=e.length;let i=0,n=0;for(let s=0;s0&&this.condition_(t)){const n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class GE extends Ya{constructor(t){t=t||{},super({stopDown:Fa}),this.condition_=t.condition?t.condition:LE,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!sl(t))return;const i=t.map,n=i.getView();if(n.getConstraints().rotation===gc)return;const s=i.getSize(),r=t.pixel,a=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const o=a-this.lastAngle_;n.adjustRotationInternal(-o)}this.lastAngle_=a}handleUpEvent(t){return sl(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return sl(t)&&d0(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class zE extends oh{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,i=this.endPixel_,n="px",s=this.element_.style;s.left=Math.min(t[0],i[0])+n,s.top=Math.min(t[1],i[1])+n,s.width=Math.abs(i[0]-t[0])+n,s.height=Math.abs(i[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const i=this.element_.style;i.left="inherit",i.top="inherit",i.width="inherit",i.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,i){this.startPixel_=t,this.endPixel_=i,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,i=this.endPixel_,s=[t,[t[0],i[1]],i,[i[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new Hs([s])}getGeometry(){return this.geometry_}}const es={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Mr extends li{constructor(t,i,n){super(t),this.coordinate=i,this.mapBrowserEvent=n}}class UE extends Ya{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new zE(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??d0,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,i,n){const s=n[0]-i[0],r=n[1]-i[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Mr(es.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const i=this.boxEndCondition_(t,this.startPixel_,t.pixel);return i&&this.onBoxEnd(t),this.dispatchEvent(new Mr(i?es.BOXEND:es.BOXCANCEL,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Mr(es.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Mr(es.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Mr(es.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class _0 extends UE{constructor(t){t=t||{};const i=t.condition?t.condition:FE;super({condition:i,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const n=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=n.rotatedExtentForGeometry(s),a=n.getResolutionForExtentInternal(r),o=n.getResolution()/a;s=s.clone(),s.scale(o*o)}n.fitInternal(s,{duration:this.duration_,easing:or})}}const mn={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class BE extends ja{constructor(t){super(),t=t||{},this.defaultCondition_=function(i){return f0(i)&&g0(i)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let i=!1;if(t.type==Q.KEYDOWN){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==mn.DOWN||s==mn.LEFT||s==mn.RIGHT||s==mn.UP)){const a=t.map.getView(),o=a.getResolution()*this.pixelDelta_;let h=0,l=0;s==mn.DOWN?l=-o:s==mn.LEFT?h=-o:s==mn.RIGHT?h=o:l=o;const c=[h,l];ac(c,a.getRotation()),IE(a,c,this.duration_),n.preventDefault(),i=!0}}return!i}}class WE extends ja{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(i){return!DE(i)&&g0(i)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let i=!1;if(t.type==Q.KEYDOWN||t.type==Q.KEYPRESS){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==="+"||s==="-")){const r=t.map,a=s==="+"?this.delta_:-this.delta_,o=r.getView();$c(o,a,void 0,this.duration_),n.preventDefault(),i=!0}}return!i}}class XE extends ja{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const i=t.condition?t.condition:OE;this.condition_=t.onFocusOnly?kl(u0,i):i,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==Q.WHEEL)return!0;const n=t.map,s=t.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let r;if(t.type==Q.WHEEL&&(r=s.deltaY,y1&&s.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(r/=_g),s.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=40)),r===0)return!1;this.lastDelta_=r;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const o=n.getView();if(this.mode_==="trackpad"&&!(o.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?n.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=a,!1;this.totalDelta_+=r;const h=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),h),!1}handleWheelZoom_(t){const i=t.getView();i.getAnimating()&&i.cancelAnimations();let n=-Rt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(i.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),$c(i,n,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class jE extends Ya{constructor(t){t=t||{};const i=t;i.stopDown||(i.stopDown=Fa),super(i),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let i=0;const n=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-n.clientY,s.clientX-n.clientX);if(this.lastAngle_!==void 0){const h=r-this.lastAngle_;this.rotationDelta_+=h,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),i=h}this.lastAngle_=r;const a=t.map,o=a.getView();o.getConstraints().rotation!==gc&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(Zc(this.targetPointers))),this.rotating_&&(a.render(),o.adjustRotationInternal(i,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const i=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||i.getView().beginInteraction(),!0}return!1}}class YE extends Ya{constructor(t){t=t||{};const i=t;i.stopDown||(i.stopDown=Fa),super(i),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let i=1;const n=this.targetPointers[0],s=this.targetPointers[1],r=n.clientX-s.clientX,a=n.clientY-s.clientY,o=Math.sqrt(r*r+a*a);this.lastDistance_!==void 0&&(i=this.lastDistance_/o),this.lastDistance_=o;const h=t.map,l=h.getView();i!=1&&(this.lastScaleDelta_=i),this.anchor_=h.getCoordinateFromPixelInternal(h.getEventPixel(Zc(this.targetPointers))),h.render(),l.adjustResolutionInternal(i,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const n=t.map.getView(),s=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const i=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||i.getView().beginInteraction(),!0}return!1}}function m0(e){e=e||{};const t=new ii,i=new pE(-.005,.05,100);return(e.altShiftDragRotate!==void 0?e.altShiftDragRotate:!0)&&t.push(new GE),(e.doubleClickZoom!==void 0?e.doubleClickZoom:!0)&&t.push(new AE({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan!==void 0?e.dragPan:!0)&&t.push(new kE({onFocusOnly:e.onFocusOnly,kinetic:i})),(e.pinchRotate!==void 0?e.pinchRotate:!0)&&t.push(new jE),(e.pinchZoom!==void 0?e.pinchZoom:!0)&&t.push(new YE({duration:e.zoomDuration})),(e.keyboard!==void 0?e.keyboard:!0)&&(t.push(new BE),t.push(new WE({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom!==void 0?e.mouseWheelZoom:!0)&&t.push(new XE({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom!==void 0?e.shiftDragZoom:!0)&&t.push(new _0({duration:e.zoomDuration})),t}function y0(e){if(e instanceof Bn){e.setMapInternal(null);return}e instanceof ur&&e.getLayers().forEach(y0)}function p0(e,t){if(e instanceof Bn){e.setMapInternal(t);return}if(e instanceof ur){const i=e.getLayers().getArray();for(let n=0,s=i.length;nthis.updateSize()),this.controls=i.controls||bE(),this.interactions=i.interactions||m0({onFocusOnly:!0}),this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new SE(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(qt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(qt.VIEW,this.handleViewChanged_),this.addChangeListener(qt.SIZE,this.handleSizeChanged_),this.addChangeListener(qt.TARGET,this.handleTargetChanged_),this.setProperties(i.values);const n=this;t.view&&!(t.view instanceof be)&&t.view.then(function(s){n.setView(new be(s))}),this.controls.addEventListener(re.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(re.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(re.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(re.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(re.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(re.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){p0(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const i=t.getId();i!==void 0&&(this.overlayIdIndex_[i.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,i,n){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(t);n=n!==void 0?n:{};const r=n.hitTolerance!==void 0?n.hitTolerance:0,a=n.layerFilter!==void 0?n.layerFilter:jr,o=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,o,i,null,a,null)}getFeaturesAtPixel(t,i){const n=[];return this.forEachFeatureAtPixel(t,function(s){n.push(s)},i),n}getAllLayers(){const t=[];function i(n){n.forEach(function(s){s instanceof ur?i(s.getLayers()):t.push(s)})}return i(this.getLayers()),t}hasFeatureAtPixel(t,i){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const s=i.layerFilter!==void 0?i.layerFilter:jr,r=i.hitTolerance!==void 0?i.hitTolerance:0,a=i.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,a,s,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const n=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=n.width/s[0],a=n.height/s[1],o="changedTouches"in t?t.changedTouches[0]:t;return[(o.clientX-n.left)/r,(o.clientY-n.top)/a]}getTarget(){return this.get(qt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return El(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const i=this.frameState_;return i?Nt(i.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const i=this.overlayIdIndex_[t.toString()];return i!==void 0?i:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(qt.LAYERGROUP)}setLayers(t){const i=this.getLayerGroup();if(t instanceof ii){i.setLayers(t);return}const n=i.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let i=0,n=t.length;i=0;r--){const a=s[r];if(a.getMap()!==this||!a.getActive()||!this.getTargetElement())continue;if(!a.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,i=this.tileQueue_;if(!i.isEmpty()){let s=this.maxTilesLoading_,r=s;if(t){const a=t.viewHints;if(a[Ut.ANIMATING]||a[Ut.INTERACTING]){const o=Date.now()-t.time>8;s=o?0:8,r=o?0:2}}i.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const i=this.getLayerGroup();i&&this.handleLayerRemove_(new Xi("removelayer",i)),this.set(qt.LAYERGROUP,t)}setSize(t){this.set(qt.SIZE,t)}setTarget(t){this.set(qt.TARGET,t)}setView(t){if(!t||t instanceof be){this.set(qt.VIEW,t);return}this.set(qt.VIEW,new be);const i=this;t.then(function(n){i.setView(new be(n))})}updateSize(){const t=this.getTargetElement();let i;if(t){const s=getComputedStyle(t),r=t.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),a=t.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(a)&&(i=[Math.max(0,r),Math.max(0,a)],!Hu(i)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Gf("No map visible because the map container's width or height are 0."))}const n=this.getSize();i&&(!n||!ln(i,n))&&(this.setSize(i),this.updateViewportSize_(i))}updateViewportSize_(t){const i=this.getView();i&&i.setViewportSize(t)}};function VE(e){let t=null;e.keyboardEventTarget!==void 0&&(t=typeof e.keyboardEventTarget=="string"?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);const i={},n=e.layers&&typeof e.layers.getLayers=="function"?e.layers:new ur({layers:e.layers});i[qt.LAYERGROUP]=n,i[qt.TARGET]=e.target,i[qt.VIEW]=e.view instanceof be?e.view:new be;let s;e.controls!==void 0&&(Array.isArray(e.controls)?s=new ii(e.controls.slice()):(ut(typeof e.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=e.controls));let r;e.interactions!==void 0&&(Array.isArray(e.interactions)?r=new ii(e.interactions.slice()):(ut(typeof e.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=e.interactions));let a;return e.overlays!==void 0?Array.isArray(e.overlays)?a=new ii(e.overlays.slice()):(ut(typeof e.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),a=e.overlays):a=new ii,{controls:s,interactions:r,keyboardEventTarget:t,overlays:a,values:i}}const Cn=Ai("map:WMTSLayer");var Us,Bs,Ws,ya,pa,va,xa,Ea,rr,v0,x0;class vT extends Js{constructor(i){const n=new zg;super({...i,olLayer:n});N(this,rr);N(this,Us);N(this,Bs);N(this,Ws);N(this,ya);N(this,pa);N(this,va);N(this,xa,$t());N(this,Ea,new AbortController);Y(this,Us,i.url),Y(this,Bs,i.name),Y(this,ya,n),Y(this,Ws,i.matrixSet),Y(this,va,i.sourceOptions)}get type(){return"wmts"}destroy(){x(this,Ea).abort(),super.destroy()}get legend(){return x(this,xa).value}get sublayers(){}get layers(){}__attachToMap(i){super.__attachToMap(i),V(this,rr,v0).call(this).then(n=>{const r=new Pp().read(n),a=Fv(r,{layer:x(this,Bs),matrixSet:x(this,Ws)});if(!a)throw new Error("Layer was not found in capabilities");const o=new Dv({...a,...x(this,va),tileLoadFunction:(c,u)=>{V(this,rr,x0).call(this,c,u)}});Y(this,pa,o),x(this,ya).setSource(x(this,pa));const h=o.getStyle(),l=$E(r,this.name,h);x(this,xa).value=l}).catch(n=>{if(Wr(n)){Cn.error(`Layer ${this.name} has been destroyed before fetching the data`);return}Cn.error(`Failed fetching WMTS capabilities for Layer ${this.name}`,n)})}get url(){return x(this,Us)}get name(){return x(this,Bs)}get matrixSet(){return x(this,Ws)}}Us=new WeakMap,Bs=new WeakMap,Ws=new WeakMap,ya=new WeakMap,pa=new WeakMap,va=new WeakMap,xa=new WeakMap,Ea=new WeakMap,rr=new WeakSet,v0=async function(){const i=this.map.__sharedDependencies.httpService;return Ag(x(this,Us),i,x(this,Ea).signal)},x0=async function(i,n){const s=this.map.__sharedDependencies.httpService;try{if(!(i instanceof kc))throw new Error("Only 'ImageTile' is supported for now.");const r=i.getImage();if(!KE(r))throw new Error("Only tags are supported as tiles for now.");const a=await s.fetch(n);if(!a.ok)throw new Error(`Tile request failed with status ${a.status}.`);const o=await a.blob(),h=URL.createObjectURL(o),l=()=>{URL.revokeObjectURL(h),r.removeEventListener("load",l),r.removeEventListener("error",l)};r.addEventListener("load",l),r.addEventListener("error",l),r.src=h}catch(r){i.setState(W.ERROR),Wr(r)||Cn.error("Failed to load tile",r)}};function KE(e){return e.tagName==="IMG"}function $E(e,t,i){const s=e?.Contents?.Layer;let r=s?.find(l=>l?.Identifier===t);if(!r&&(Cn.debug("Failed to find the active layer in WMTS layer capabilities."),r=s?.[0],!r)){Cn.debug("No layer in WMTS capabilities - giving up.");return}const a=r.Style;let o=a?.find(l=>l?.Identifier===i);if(!o&&(Cn.debug("Failed to find active style in WMTS layer."),o=a?.[0],!o)){Cn.debug("No style in WMTS layer capabilities - giving up.");return}return o.LegendURL?.[0]?.href}function ZE(e){const t=Object.keys(e.defs),i=t.length;let n,s;for(n=0;n=this.text.length)return;e=this.text[this.place++]}switch(this.state){case sa:return this.neutral(e);case E0:return this.keyword(e);case $o:return this.quoted(e);case w0:return this.afterquote(e);case M0:return this.number(e);case Hc:return}};Pi.prototype.afterquote=function(e){if(e==='"'){this.word+='"',this.state=$o;return}if(bh.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in afterquote yet, index '+this.place)};Pi.prototype.afterItem=function(e){if(e===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=sa;return}if(e==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=sa,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Hc);return}};Pi.prototype.number=function(e){if(S0.test(e)){this.word+=e;return}if(bh.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in number yet, index '+this.place)};Pi.prototype.quoted=function(e){if(e==='"'){this.state=w0;return}this.word+=e};Pi.prototype.keyword=function(e){if(aM.test(e)){this.word+=e;return}if(e==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=sa;return}if(bh.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in keyword yet, index '+this.place)};Pi.prototype.neutral=function(e){if(rM.test(e)){this.word=e,this.state=E0;return}if(e==='"'){this.word="",this.state=$o;return}if(S0.test(e)){this.word=e,this.state=M0;return}if(bh.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in neutral yet, index '+this.place)};Pi.prototype.output=function(){for(;this.place0?90:-90),e.lat_ts=e.lat1):!e.lat_ts&&e.lat0&&e.projName==="Polar_Stereographic"&&(e.lat_ts=e.lat0,e.lat0=He(e.lat0>0?90:-90))}function R0(e){var t=oM(e),i=t.shift(),n=t.shift();t.unshift(["name",n]),t.unshift(["type",i]);var s={};return fs(t,s),cM(s),s}function Ht(e){var t=this;if(arguments.length===2){var i=arguments[1];typeof i=="string"?i.charAt(0)==="+"?Ht[e]=zl(arguments[1]):Ht[e]=R0(arguments[1]):Ht[e]=i}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(n){Array.isArray(n)?Ht.apply(t,n):Ht(n)});if(typeof e=="string"){if(e in Ht)return Ht[e]}else"EPSG"in e?Ht["EPSG:"+e.EPSG]=e:"ESRI"in e?Ht["ESRI:"+e.ESRI]=e:"IAU2000"in e?Ht["IAU2000:"+e.IAU2000]=e:console.log(e);return}}HE(Ht);function uM(e){return typeof e=="string"}function dM(e){return e in Ht}var fM=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function gM(e){return fM.some(function(t){return e.indexOf(t)>-1})}var _M=["3857","900913","3785","102113"];function mM(e){var t=on(e,"authority");if(t){var i=on(t,"epsg");return i&&_M.indexOf(i)>-1}}function yM(e){var t=on(e,"extension");if(t)return on(t,"proj4")}function pM(e){return e[0]==="+"}function vM(e){if(uM(e)){if(dM(e))return Ht[e];if(gM(e)){var t=R0(e);if(mM(t))return Ht["EPSG:3857"];var i=yM(t);return i?zl(i):t}if(pM(e))return zl(e)}else return e}function Ad(e,t){e=e||{};var i,n;if(!t)return e;for(n in t)i=t[n],i!==void 0&&(e[n]=i);return e}function oi(e,t,i){var n=e*t;return i/Math.sqrt(1-n*n)}function qa(e){return e<0?-1:1}function B(e){return Math.abs(e)<=Pt?e:e-qa(e)*na}function qe(e,t,i){var n=e*i,s=.5*e;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*(L-t))/n}function ra(e,t){for(var i=.5*e,n,s,r=L-2*Math.atan(t),a=0;a<=15;a++)if(n=e*Math.sin(r),s=L-2*Math.atan(t*Math.pow((1-n)/(1+n),i))-r,r+=s,Math.abs(s)<=1e-10)return r;return-9999}function xM(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=oi(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function EM(e){var t=e.x,i=e.y;if(i*si>90&&i*si<-90&&t*si>180&&t*si<-180)return null;var n,s;if(Math.abs(Math.abs(i)-L)<=U)return null;if(this.sphere)n=this.x0+this.a*this.k0*B(t-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(mt+.5*i));else{var r=Math.sin(i),a=qe(this.e,i,r);n=this.x0+this.a*this.k0*B(t-this.long0),s=this.y0-this.a*this.k0*Math.log(a)}return e.x=n,e.y=s,e}function MM(e){var t=e.x-this.x0,i=e.y-this.y0,n,s;if(this.sphere)s=L-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var r=Math.exp(-i/(this.a*this.k0));if(s=ra(this.e,r),s===-9999)return null}return n=B(this.long0+t/(this.a*this.k0)),e.x=n,e.y=s,e}var wM=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const SM={init:xM,forward:EM,inverse:MM,names:wM};function RM(){}function Ld(e){return e}var CM=["longlat","identity"];const TM={init:RM,forward:Ld,inverse:Ld,names:CM};var bM=[SM,TM],wo={},Zo=[];function C0(e,t){var i=Zo.length;return e.names?(Zo[i]=e,e.names.forEach(function(n){wo[n.toLowerCase()]=i}),this):(console.log(t),!0)}function IM(e){if(!e)return!1;var t=e.toLowerCase();if(typeof wo[t]<"u"&&Zo[wo[t]])return Zo[wo[t]]}function AM(){bM.forEach(C0)}const LM={start:AM,add:C0,get:IM};var tt={};tt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};tt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};tt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};tt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};tt.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};tt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};tt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};tt.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};tt.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};tt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};tt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};tt.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};tt.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};tt.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};tt.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};tt.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};tt.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};tt.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};tt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};tt.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};tt.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};tt.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};tt.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};tt.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};tt.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};tt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};tt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};tt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};tt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};tt.hough={a:6378270,rf:297,ellipseName:"Hough"};tt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};tt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};tt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};tt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};tt.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};tt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};tt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};tt.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};tt.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};tt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};tt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};tt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var PM=tt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};tt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function OM(e,t,i,n){var s=e*e,r=t*t,a=(s-r)/s,o=0;n?(e*=1-a*(tM+a*(eM+a*iM)),s=e*e,a=0):o=Math.sqrt(a);var h=(s-r)/r;return{es:a,e:o,ep2:h}}function DM(e,t,i,n,s){if(!e){var r=on(tt,n);r||(r=PM),e=r.a,t=r.b,i=r.rf}return i&&!t&&(t=(1-1/i)*e),(i===0||Math.abs(e-t)3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=zn,o.datum_params[3]*=kr,o.datum_params[4]*=kr,o.datum_params[5]*=kr,o.datum_params[6]=o.datum_params[6]/1e6+1)),a&&(o.datum_type=Ms,o.grids=a),o.a=i,o.b=n,o.es=s,o.ep2=r,o}var T0={};function NM(e,t){var i=new DataView(t),n=zM(i),s=UM(i,n),r=BM(i,s,n),a={header:s,subgrids:r};return T0[e]=a,a}function kM(e){if(e===void 0)return null;var t=e.split(",");return t.map(GM)}function GM(e){if(e.length===0)return null;var t=e[0]==="@";return t&&(e=e.slice(1)),e==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:T0[e]||null,isNull:!1}}function gs(e){return e/3600*Math.PI/180}function zM(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function UM(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:Ul(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function Ul(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function BM(e,t,i){for(var n=176,s=[],r=0;r5e-11?!1:e.datum_type===Gn?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===zn?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function b0(e,t,i){var n=e.x,s=e.y,r=e.z?e.z:0,a,o,h,l;if(s<-L&&s>-1.001*L)s=-L;else if(s>L&&s<1.001*L)s=L;else{if(s<-L)return{x:-1/0,y:-1/0,z:e.z};if(s>L)return{x:1/0,y:1/0,z:e.z}}return n>Math.PI&&(n-=2*Math.PI),o=Math.sin(s),l=Math.cos(s),h=o*o,a=i/Math.sqrt(1-t*h),{x:(a+r)*l*Math.cos(n),y:(a+r)*l*Math.sin(n),z:(a*(1-t)+r)*o}}function I0(e,t,i,n){var s=1e-12,r=s*s,a=30,o,h,l,c,u,d,g,f,_,m,p,y,M,v=e.x,E=e.y,w=e.z?e.z:0,b,S,R;if(o=Math.sqrt(v*v+E*E),h=Math.sqrt(v*v+E*E+w*w),o/ir&&Mn.y||g>n.x||mo&&Math.abs(h.y)>o);if(a<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=B(r.x+i.ll[0]),n.y=r.y+i.ll[1]}else isNaN(r.x)||(n.x=e.x+r.x,n.y=e.y+r.y);return n}function Od(e,t){var i={x:e.x/t.del[0],y:e.y/t.del[1]},n={x:Math.floor(i.x),y:Math.floor(i.y)},s={x:i.x-1*n.x,y:i.y-1*n.y},r={x:Number.NaN,y:Number.NaN},a;if(n.x<0||n.x>=t.lim[0]||n.y<0||n.y>=t.lim[1])return r;a=n.y*t.lim[0]+n.x;var o={x:t.cvs[a][0],y:t.cvs[a][1]};a++;var h={x:t.cvs[a][0],y:t.cvs[a][1]};a+=t.lim[0];var l={x:t.cvs[a][0],y:t.cvs[a][1]};a--;var c={x:t.cvs[a][0],y:t.cvs[a][1]},u=s.x*s.y,d=s.x*(1-s.y),g=(1-s.x)*(1-s.y),f=(1-s.x)*s.y;return r.x=g*o.x+d*h.x+f*c.x+u*l.x,r.y=g*o.y+d*h.y+f*c.y+u*l.y,r}function Dd(e,t,i){var n=i.x,s=i.y,r=i.z||0,a,o,h,l={};for(h=0;h<3;h++)if(!(t&&h===2&&i.z===void 0))switch(h===0?(a=n,"ew".indexOf(e.axis[h])!==-1?o="x":o="y"):h===1?(a=s,"ns".indexOf(e.axis[h])!==-1?o="y":o="x"):(a=r,o="z"),e.axis[h]){case"e":l[o]=a;break;case"w":l[o]=-a;break;case"n":l[o]=a;break;case"s":l[o]=-a;break;case"u":i[o]!==void 0&&(l.z=a);break;case"d":i[o]!==void 0&&(l.z=-a);break;default:return null}return l}function A0(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function ZM(e){Fd(e.x),Fd(e.y)}function Fd(e){if(typeof Number.isFinite=="function"){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if(typeof e!="number"||e!==e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function HM(e,t){return(e.datum.datum_type===Gn||e.datum.datum_type===zn||e.datum.datum_type===Ms)&&t.datumCode!=="WGS84"||(t.datum.datum_type===Gn||t.datum.datum_type===zn||t.datum.datum_type===Ms)&&e.datumCode!=="WGS84"}function Ho(e,t,i,n){var s;Array.isArray(i)?i=A0(i):i={x:i.x,y:i.y,z:i.z,m:i.m};var r=i.z!==void 0;if(ZM(i),e.datum&&t.datum&&HM(e,t)&&(s=new ri("WGS84"),i=Ho(e,s,i,n),e=s),n&&e.axis!=="enu"&&(i=Dd(e,!1,i)),e.projName==="longlat")i={x:i.x*Xt,y:i.y*Xt,z:i.z||0};else if(e.to_meter&&(i={x:i.x*e.to_meter,y:i.y*e.to_meter,z:i.z||0}),i=e.inverse(i),!i)return;if(e.from_greenwich&&(i.x+=e.from_greenwich),i=KM(e.datum,t.datum,i),!!i)return t.from_greenwich&&(i={x:i.x-t.from_greenwich,y:i.y,z:i.z||0}),t.projName==="longlat"?i={x:i.x*si,y:i.y*si,z:i.z||0}:(i=t.forward(i),t.to_meter&&(i={x:i.x/t.to_meter,y:i.y/t.to_meter,z:i.z||0})),n&&t.axis!=="enu"?Dd(t,!0,i):(i&&!r&&delete i.z,i)}var Nd=ri("WGS84");function rl(e,t,i,n){var s,r,a;return Array.isArray(i)?(s=Ho(e,t,i,n)||{x:NaN,y:NaN},i.length>2?typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(i.slice(3)):[s.x,s.y,i[2]].concat(i.slice(3)):[s.x,s.y].concat(i.slice(2)):[s.x,s.y]):(r=Ho(e,t,i,n),a=Object.keys(i),a.length===2||a.forEach(function(o){if(typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(o==="x"||o==="y"||o==="z")return}else if(o==="x"||o==="y")return;r[o]=i[o]}),r)}function kd(e){return e instanceof ri?e:e.oProj?e.oProj:ri(e)}function fe(e,t,i){e=kd(e);var n=!1,s;return typeof t>"u"?(t=e,e=Nd,n=!0):(typeof t.x<"u"||Array.isArray(t))&&(i=t,t=e,e=Nd,n=!0),t=kd(t),i?rl(e,t,i):(s={forward:function(r,a){return rl(e,t,r,a)},inverse:function(r,a){return rl(t,e,r,a)}},n&&(s.oProj=t),s)}var Gd=6,L0="AJSAJS",P0="AFAFAF",_s=65,se=73,Re=79,Ar=86,Lr=90;const JM={forward:O0,inverse:QM,toPoint:D0};function O0(e,t){return t=t||5,i2(t2({lat:e[1],lon:e[0]}),t)}function QM(e){var t=Jc(N0(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function D0(e){var t=Jc(N0(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function al(e){return e*(Math.PI/180)}function zd(e){return 180*(e/Math.PI)}function t2(e){var t=e.lat,i=e.lon,n=6378137,s=.00669438,r=.9996,a,o,h,l,c,u,d,g=al(t),f=al(i),_,m;m=Math.floor((i+180)/6)+1,i===180&&(m=60),t>=56&&t<64&&i>=3&&i<12&&(m=32),t>=72&&t<84&&(i>=0&&i<9?m=31:i>=9&&i<21?m=33:i>=21&&i<33?m=35:i>=33&&i<42&&(m=37)),a=(m-1)*6-180+3,_=al(a),o=s/(1-s),h=n/Math.sqrt(1-s*Math.sin(g)*Math.sin(g)),l=Math.tan(g)*Math.tan(g),c=o*Math.cos(g)*Math.cos(g),u=Math.cos(g)*(f-_),d=n*((1-s/4-3*s*s/64-5*s*s*s/256)*g-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*g)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*g)-35*s*s*s/3072*Math.sin(6*g));var p=r*h*(u+(1-l+c)*u*u*u/6+(5-18*l+l*l+72*c-58*o)*u*u*u*u*u/120)+5e5,y=r*(d+h*Math.tan(g)*(u*u/2+(5-l+9*c+4*c*c)*u*u*u*u/24+(61-58*l+l*l+600*c-330*o)*u*u*u*u*u*u/720));return t<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(p),zoneNumber:m,zoneLetter:e2(t)}}function Jc(e){var t=e.northing,i=e.easting,n=e.zoneLetter,s=e.zoneNumber;if(s<0||s>60)return null;var r=.9996,a=6378137,o=.00669438,h,l=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),c,u,d,g,f,_,m,p,y,M=i-5e5,v=t;n<"N"&&(v-=1e7),m=(s-1)*6-180+3,h=o/(1-o),_=v/r,p=_/(a*(1-o/4-3*o*o/64-5*o*o*o/256)),y=p+(3*l/2-27*l*l*l/32)*Math.sin(2*p)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*p)+151*l*l*l/96*Math.sin(6*p),c=a/Math.sqrt(1-o*Math.sin(y)*Math.sin(y)),u=Math.tan(y)*Math.tan(y),d=h*Math.cos(y)*Math.cos(y),g=a*(1-o)/Math.pow(1-o*Math.sin(y)*Math.sin(y),1.5),f=M/(c*r);var E=y-c*Math.tan(y)/g*(f*f/2-(5+3*u+10*d-4*d*d-9*h)*f*f*f*f/24+(61+90*u+298*d+45*u*u-252*h-3*d*d)*f*f*f*f*f*f/720);E=zd(E);var w=(f-(1+2*u+d)*f*f*f/6+(5-2*d+28*u-3*d*d+8*h+24*u*u)*f*f*f*f*f/120)/Math.cos(y);w=m+zd(w);var b;if(e.accuracy){var S=Jc({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});b={top:S.lat,right:S.lon,bottom:E,left:w}}else b={lat:E,lon:w};return b}function e2(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function i2(e,t){var i="00000"+e.easting,n="00000"+e.northing;return e.zoneNumber+e.zoneLetter+n2(e.easting,e.northing,e.zoneNumber)+i.substr(i.length-5,t)+n.substr(n.length-5,t)}function n2(e,t,i){var n=F0(i),s=Math.floor(e/1e5),r=Math.floor(t/1e5)%20;return s2(s,r,n)}function F0(e){var t=e%Gd;return t===0&&(t=Gd),t}function s2(e,t,i){var n=i-1,s=L0.charCodeAt(n),r=P0.charCodeAt(n),a=s+e-1,o=r+t,h=!1;a>Lr&&(a=a-Lr+_s-1,h=!0),(a===se||sse||(a>se||sRe||(a>Re||sLr&&(a=a-Lr+_s-1),o>Ar?(o=o-Ar+_s-1,h=!0):h=!1,(o===se||rse||(o>se||rRe||(o>Re||rAr&&(o=o-Ar+_s-1);var l=String.fromCharCode(a)+String.fromCharCode(o);return l}function N0(e){if(e&&e.length===0)throw"MGRSPoint coverting from nothing";for(var t=e.length,i=null,n="",s,r=0;!/[A-Z]/.test(s=e.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+e;n+=s,r++}var a=parseInt(n,10);if(r===0||r+3>t)throw"MGRSPoint bad conversion from: "+e;var o=e.charAt(r++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+e;i=e.substring(r,r+=2);for(var h=F0(a),l=r2(i.charAt(0),h),c=a2(i.charAt(1),h);c0&&(_=1e5/Math.pow(10,d),m=e.substring(r,r+d),g=parseFloat(m)*_,p=e.substring(r+d),f=parseFloat(p)*_),y=g+l,M=f+c,{easting:y,northing:M,zoneLetter:o,zoneNumber:a,accuracy:_}}function r2(e,t){for(var i=L0.charCodeAt(t-1),n=1e5,s=!1;i!==e.charCodeAt(0);){if(i++,i===se&&i++,i===Re&&i++,i>Lr){if(s)throw"Bad character: "+e;i=_s,s=!0}n+=1e5}return n}function a2(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var i=P0.charCodeAt(t-1),n=0,s=!1;i!==e.charCodeAt(0);){if(i++,i===se&&i++,i===Re&&i++,i>Ar){if(s)throw"Bad character: "+e;i=_s,s=!0}n+=1e5}return n}function o2(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function nr(e,t,i){if(!(this instanceof nr))return new nr(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof t>"u"){var n=e.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}nr.fromMGRS=function(e){return new nr(D0(e))};nr.prototype.toMGRS=function(e){return O0([this.x,this.y],e)};var h2=1,l2=.25,Ud=.046875,Bd=.01953125,Wd=.01068115234375,c2=.75,u2=.46875,d2=.013020833333333334,f2=.007120768229166667,g2=.3645833333333333,_2=.005696614583333333,m2=.3076171875;function Qc(e){var t=[];t[0]=h2-e*(l2+e*(Ud+e*(Bd+e*Wd))),t[1]=e*(c2-e*(Ud+e*(Bd+e*Wd)));var i=e*e;return t[2]=i*(u2-e*(d2+e*f2)),i*=e,t[3]=i*(g2-e*_2),t[4]=i*e*m2,t}function dr(e,t,i,n){return i*=t,t*=t,n[0]*e-i*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var y2=20;function tu(e,t,i){for(var n=1/(1-t),s=e,r=y2;r;--r){var a=Math.sin(s),o=1-t*a*a;if(o=(dr(s,a,Math.cos(s),i)-e)*(o*Math.sqrt(o))*n,s-=o,Math.abs(o)U?Math.tan(i):0,_=Math.pow(f,2),m=Math.pow(_,2);s=1-this.es*Math.pow(o,2),c=c/Math.sqrt(s);var p=dr(i,o,h,this.en);r=this.a*(this.k0*c*(1+u/6*(1-_+d+u/20*(5-18*_+m+14*d-58*_*d+u/42*(61+179*m-m*_-479*_)))))+this.x0,a=this.a*(this.k0*(p-this.ml0+o*n*c/2*(1+u/12*(5-_+9*d+4*g+u/30*(61+m-58*_+270*d-330*_*d+u/56*(1385+543*m-m*_-3111*_))))))+this.y0}else{var l=h*Math.sin(n);if(Math.abs(Math.abs(l)-1)=1){if(l-1>U)return 93;a=0}else a=Math.acos(a);i<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return e.x=r,e.y=a,e}function x2(e){var t,i,n,s,r=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,i=tu(t,this.es,this.en),Math.abs(i)U?Math.tan(i):0,f=this.ep2*Math.pow(d,2),_=Math.pow(f,2),m=Math.pow(g,2),p=Math.pow(m,2);t=1-this.es*Math.pow(u,2);var y=r*Math.sqrt(t)/this.k0,M=Math.pow(y,2);t=t*g,n=i-t*M/(1-this.es)*.5*(1-M/12*(5+3*m-9*f*m+f-4*_-M/30*(61+90*m-252*f*m+45*p+46*f-M/56*(1385+3633*m+4095*p+1574*p*m)))),s=B(this.long0+y*(1-M/6*(1+2*m+f-M/20*(5+28*m+24*p+8*f*m+6*f-M/42*(61+662*m+1320*p+720*p*m))))/d)}else n=L*qa(a),s=0;else{var o=Math.exp(r/this.k0),h=.5*(o-1/o),l=this.lat0+a/this.k0,c=Math.cos(l);t=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(h,2))),n=Math.asin(t),a<0&&(n=-n),h===0&&c===0?s=0:s=B(Math.atan2(h,c)+this.long0)}return e.x=s,e.y=n,e}var E2=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const So={init:p2,forward:v2,inverse:x2,names:E2};function k0(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function le(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),n=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(n,2))}function M2(e){var t=1+e,i=t-1;return i===0?e:e*Math.log(t)/i}function w2(e){var t=Math.abs(e);return t=M2(t*(1+t/(le(1,t)+1))),e<0?-t:t}function eu(e,t){for(var i=2*Math.cos(2*t),n=e.length-1,s=e[n],r=0,a;--n>=0;)a=-r+i*s+e[n],r=s,s=a;return t+a*Math.sin(2*t)}function S2(e,t){for(var i=2*Math.cos(t),n=e.length-1,s=e[n],r=0,a;--n>=0;)a=-r+i*s+e[n],r=s,s=a;return Math.sin(t)*a}function R2(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function G0(e,t,i){for(var n=Math.sin(t),s=Math.cos(t),r=k0(i),a=R2(i),o=2*s*a,h=-2*n*r,l=e.length-1,c=e[l],u=0,d=0,g=0,f,_;--l>=0;)f=d,_=u,d=c,u=g,c=-f+o*d-h*u+e[l],g=-_+h*d+o*u;return o=n*a,h=s*r,[o*c-h*g,o*g+h*c]}function C2(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(So.init.apply(this),this.forward=So.forward,this.inverse=So.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),i=i*t,this.cgb[1]=i*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i=i*t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),i=i*t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(-12/5+t*(-24832/14175))),i=i*t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i=i*t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),i=i*t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i=i*t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i=i*t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i=i*t,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=i*(212378941/319334400);var n=eu(this.cbg,this.lat0);this.Zb=-this.Qn*(n+S2(this.gtu,2*n))}function T2(e){var t=B(e.x-this.long0),i=e.y;i=eu(this.cbg,i);var n=Math.sin(i),s=Math.cos(i),r=Math.sin(t),a=Math.cos(t);i=Math.atan2(n,a*s),t=Math.atan2(r*s,le(n,s*a)),t=w2(Math.tan(t));var o=G0(this.gtu,2*i,2*t);i=i+o[0],t=t+o[1];var h,l;return Math.abs(t)<=2.623395162778?(h=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(h=1/0,l=1/0),e.x=h,e.y=l,e}function b2(e){var t=(e.x-this.x0)*(1/this.a),i=(e.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,t=t/this.Qn;var n,s;if(Math.abs(t)<=2.623395162778){var r=G0(this.utg,2*i,2*t);i=i+r[0],t=t+r[1],t=Math.atan(k0(t));var a=Math.sin(i),o=Math.cos(i),h=Math.sin(t),l=Math.cos(t);i=Math.atan2(a*l,le(h,l*o)),t=Math.atan2(h,l*o),n=B(t+this.long0),s=eu(this.cgb,i)}else n=1/0,s=1/0;return e.x=n,e.y=s,e}var I2=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Ro={init:C2,forward:T2,inverse:b2,names:I2};function A2(e,t){if(e===void 0){if(e=Math.floor((B(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var L2="etmerc";function P2(){var e=A2(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*Xt,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ro.init.apply(this),this.forward=Ro.forward,this.inverse=Ro.inverse}var O2=["Universal Transverse Mercator System","utm"];const D2={init:P2,names:O2,dependsOn:L2};function iu(e,t){return Math.pow((1-e)/(1+e),t)}var F2=20;function N2(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+mt)/(Math.pow(Math.tan(.5*this.lat0+mt),this.C)*iu(this.e*e,this.ratexp))}function k2(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+mt),this.C)*iu(this.e*Math.sin(i),this.ratexp))-L,e.x=this.C*t,e}function G2(e){for(var t=1e-14,i=e.x/this.C,n=e.y,s=Math.pow(Math.tan(.5*n+mt)/this.K,1/this.C),r=F2;r>0&&(n=2*Math.atan(s*iu(this.e*Math.sin(e.y),-.5*this.e))-L,!(Math.abs(n-e.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=U&&Math.abs(Math.cos(this.lat_ts))>U&&(this.k0=.5*this.cons*oi(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/qe(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=oi(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-L,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function V2(e){var t=e.x,i=e.y,n=Math.sin(i),s=Math.cos(i),r,a,o,h,l,c,u=B(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=U&&Math.abs(i+this.lat0)<=U?(e.x=NaN,e.y=NaN,e):this.sphere?(r=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(u)),e.x=this.a*r*s*Math.sin(u)+this.x0,e.y=this.a*r*(this.coslat0*n-this.sinlat0*s*Math.cos(u))+this.y0,e):(a=2*Math.atan(this.ssfn_(i,n,this.e))-L,h=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=U?(l=qe(this.e,i*this.con,this.con*n),c=2*this.a*this.k0*l/this.cons,e.x=this.x0+c*Math.sin(t-this.long0),e.y=this.y0-this.con*c*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)0?t=B(this.long0+Math.atan2(e.x,-1*e.y)):t=B(this.long0+Math.atan2(e.x,e.y)):t=B(this.long0+Math.atan2(e.x*Math.sin(o),a*this.coslat0*Math.cos(o)-e.y*this.sinlat0*Math.sin(o))),e.x=t,e.y=i,e)}else if(Math.abs(this.coslat0)<=U){if(a<=U)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,n=a*this.cons/(2*this.a*this.k0),i=this.con*ra(this.e,n),t=this.con*B(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else s=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=U?r=this.X0:(r=Math.asin(Math.cos(s)*this.sinX0+e.y*Math.sin(s)*this.cosX0/a),t=B(this.long0+Math.atan2(e.x*Math.sin(s),a*this.cosX0*Math.cos(s)-e.y*this.sinX0*Math.sin(s)))),i=-1*ra(this.e,Math.tan(.5*(L+r)));return e.x=t,e.y=i,e}var $2=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const Z2={init:q2,forward:V2,inverse:K2,names:$2,ssfn_:Y2};function H2(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,n=this.rf,s=1/n,r=2*s-Math.pow(s,2),a=this.e=Math.sqrt(r);this.R=this.k0*i*Math.sqrt(1-r)/(1-r*Math.pow(t,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*h+this.alpha*a/2*l}function J2(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),n=-this.alpha*(t+i)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),r=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(r))),o=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(r));return e.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,e.x=this.R*a+this.x0,e}function Q2(e){for(var t=e.x-this.x0,i=e.y-this.y0,n=t/this.R,s=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(s))),o=this.lambda0+a/this.alpha,h=0,l=r,c=-1e3,u=0;Math.abs(l-c)>1e-7;){if(++u>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return e.x=o,e.y=l,e}var tw=["somerc"];const ew={init:H2,forward:J2,inverse:Q2,names:tw};var hs=1e-7;function iw(e){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],i=typeof e.PROJECTION=="object"?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||t.indexOf(i)!==-1}function nw(){var e,t,i,n,s,r,a,o,h,l,c=0,u,d=0,g=0,f=0,_=0,m=0,p=0;this.no_off=iw(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var M=!1;if("rectified_grid_angle"in this&&(M=!0),y&&(p=this.alpha),M&&(c=this.rectified_grid_angle*Xt),y||M)d=this.longc;else if(g=this.long1,_=this.lat1,f=this.long2,m=this.lat2,Math.abs(_-m)<=hs||(e=Math.abs(_))<=hs||Math.abs(e-L)<=hs||Math.abs(Math.abs(this.lat0)-L)<=hs||Math.abs(Math.abs(m)-L)<=hs)throw new Error;var v=1-this.es;t=Math.sqrt(v),Math.abs(this.lat0)>U?(o=Math.sin(this.lat0),i=Math.cos(this.lat0),e=1-this.es*o*o,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/v),this.A=this.B*this.k0*t/e,n=this.B*t/(i*Math.sqrt(e)),s=n*n-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=n,this.E*=Math.pow(qe(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=s=1),y||M?(y?(u=Math.asin(Math.sin(p)/n),M||(c=p)):(u=c,p=Math.asin(n*Math.sin(u))),this.lam0=d-Math.asin(.5*(s-1/s)*Math.tan(u))/this.B):(r=Math.pow(qe(this.e,_,Math.sin(_)),this.B),a=Math.pow(qe(this.e,m,Math.sin(m)),this.B),s=this.E/r,h=(a-r)/(a+r),l=this.E*this.E,l=(l-a*r)/(l+a*r),e=g-f,e<-Math.pi?f-=na:e>Math.pi&&(f+=na),this.lam0=B(.5*(g+f)-Math.atan(l*Math.tan(.5*this.B*(g-f))/h)/this.B),u=Math.atan(2*Math.sin(this.B*B(g-this.lam0))/(s-1/s)),c=p=Math.asin(n*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(p))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(mt-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(mt+s))}function sw(e){var t={},i,n,s,r,a,o,h,l;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-L)>U){if(a=this.E/Math.pow(qe(this.e,e.y,Math.sin(e.y)),this.B),o=1/a,i=.5*(a-o),n=.5*(a+o),r=Math.sin(this.B*e.x),s=(i*this.singam-r*this.cosgam)/n,Math.abs(Math.abs(s)-1)0?this.v_pole_n:this.v_pole_s,h=this.ArB*e.y;return this.no_rot?(t.x=h,t.y=l):(h-=this.u_0,t.x=l*this.cosrot+h*this.sinrot,t.y=h*this.cosrot-l*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function rw(e){var t,i,n,s,r,a,o,h={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*i),s=.5*(n-1/n),r=.5*(n+1/n),a=Math.sin(this.BrA*t),o=(a*this.cosgam+s*this.singam)/r,Math.abs(Math.abs(o)-1)U?this.ns=Math.log(n/o)/Math.log(s/h):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function lw(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=U&&(i=qa(i)*(L-2*U));var n=Math.abs(Math.abs(i)-L),s,r;if(n>U)s=qe(this.e,i,Math.sin(i)),r=this.a*this.f0*Math.pow(s,this.ns);else{if(n=i*this.ns,n<=0)return null;r=0}var a=this.ns*B(t-this.long0);return e.x=this.k0*(r*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-r*Math.cos(a))+this.y0,e}function cw(e){var t,i,n,s,r,a=(e.x-this.x0)/this.k0,o=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+o*o),i=1):(t=-Math.sqrt(a*a+o*o),i=-1);var h=0;if(t!==0&&(h=Math.atan2(i*a,i*o)),t!==0||this.ns>0){if(i=1/this.ns,n=Math.pow(t/(this.a*this.f0),i),s=ra(this.e,n),s===-9999)return null}else s=-L;return r=B(h/this.ns+this.long0),e.x=r,e.y=s,e}var uw=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const dw={init:hw,forward:lw,inverse:cw,names:uw};function fw(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function gw(e){var t,i,n,s,r,a,o,h=e.x,l=e.y,c=B(h-this.long0);return t=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/t)-this.s45),n=-c*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(s)),a=this.n*r,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),e.y=o*Math.cos(a)/1,e.x=o*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e}function _w(e){var t,i,n,s,r,a,o,h,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),r=Math.atan2(e.y,e.x),s=r/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),i=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(t)),e.x=this.long0-i/this.alfa,o=t,h=0;var c=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(h=1),o=e.y,c+=1;while(h===0&&c<15);return c>=15?null:e}var mw=["Krovak","krovak"];const yw={init:fw,forward:gw,inverse:_w,names:mw};function ee(e,t,i,n,s){return e*s-t*Math.sin(2*s)+i*Math.sin(4*s)-n*Math.sin(6*s)}function Va(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function Ka(e){return .375*e*(1+.25*e*(1+.46875*e))}function $a(e){return .05859375*e*e*(1+.75*e)}function Za(e){return e*e*e*(35/3072)}function sr(e,t,i){var n=t*i;return e/Math.sqrt(1-n*n)}function cn(e){return Math.abs(e)1e-7?(i=e*t,(1-e*e)*(t/(1-i*i)-.5/e*Math.log((1-i)/(1+i)))):2*t}var ww=1,Sw=2,Rw=3,Cw=4;function Tw(){var e=Math.abs(this.lat0);if(Math.abs(e-L)0){var t;switch(this.qp=rn(this.e,1),this.mmf=.5/(1-this.es),this.apa=Nw(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=rn(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function bw(e){var t,i,n,s,r,a,o,h,l,c,u=e.x,d=e.y;if(u=B(u-this.long0),this.sphere){if(r=Math.sin(d),c=Math.cos(d),n=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+c*n:1+this.sinph0*r+this.cosph0*c*n,i<=U)return null;i=Math.sqrt(2/i),t=i*c*Math.sin(u),i*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(d+this.lat0)=0?(t=(l=Math.sqrt(a))*s,i=n*(this.mode===this.S_POLE?l:-l)):t=i=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e}function Iw(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,i=e.y/this.a,n,s,r,a,o,h,l;if(this.sphere){var c=0,u,d=0;if(u=Math.sqrt(t*t+i*i),s=u*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(d=Math.sin(s),c=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(u)<=U?0:Math.asin(i*d/u),t*=d,i=c*u;break;case this.OBLIQ:s=Math.abs(u)<=U?this.lat0:Math.asin(c*this.sinph0+i*d*this.cosph0/u),t*=d*this.cosph0,i=(c-Math.sin(s)*this.sinph0)*u;break;case this.N_POLE:i=-i,s=L-s;break;case this.S_POLE:s-=L;break}n=i===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,i)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,i*=this.dd,h=Math.sqrt(t*t+i*i),h1&&(e=e>1?1:-1),Math.asin(e)}function Uw(){Math.abs(this.lat1+this.lat2)U?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Bw(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var n=rn(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,r=this.ns0*B(t-this.long0),a=s*Math.sin(r)+this.x0,o=this.rh-s*Math.cos(r)+this.y0;return e.x=a,e.y=o,e}function Ww(e){var t,i,n,s,r,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),s=0,t!==0&&(s=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(i=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,i)),r=B(s/this.ns0+this.long0),e.x=r,e.y=a,e}function Xw(e,t){var i,n,s,r,a,o=hn(.5*t);if(e0||Math.abs(a)<=U?(o=this.x0+this.a*r*i*Math.sin(n)/a,h=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*i*s)/a):(o=this.x0+this.infinity_dist*i*Math.sin(n),h=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*s)),e.x=o,e.y=h,e}function Kw(e){var t,i,n,s,r,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(s=Math.atan2(t,this.rc),i=Math.sin(s),n=Math.cos(s),a=hn(n*this.sin_p14+e.y*i*this.cos_p14/t),r=Math.atan2(e.x*i,t*this.cos_p14*n-e.y*this.sin_p14*i),r=B(this.long0+r)):(a=this.phic0,r=0),e.x=r,e.y=a,e}var $w=["gnom"];const Zw={init:qw,forward:Vw,inverse:Kw,names:$w};function Hw(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*L:L;for(var n=Math.asin(.5*t),s,r,a,o,h=0;h<30;h++)if(r=Math.sin(n),a=Math.cos(n),o=e*r,s=Math.pow(1-o*o,2)/(2*a)*(t/(1-e*e)-r/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function Jw(){this.sphere||(this.k0=oi(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Qw(e){var t=e.x,i=e.y,n,s,r=B(t-this.long0);if(this.sphere)n=this.x0+this.a*r*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=rn(this.e,Math.sin(i));n=this.x0+this.a*this.k0*r,s=this.y0+this.a*a*.5/this.k0}return e.x=n,e.y=s,e}function tS(e){e.x-=this.x0,e.y-=this.y0;var t,i;return this.sphere?(t=B(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=Hw(this.e,2*e.y*this.k0/this.a),t=B(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e}var eS=["cea"];const iS={init:Jw,forward:Qw,inverse:tS,names:eS};function nS(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function sS(e){var t=e.x,i=e.y,n=B(t-this.long0),s=cn(i-this.lat0);return e.x=this.x0+this.a*n*this.rc,e.y=this.y0+this.a*s,e}function rS(e){var t=e.x,i=e.y;return e.x=B(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=cn(this.lat0+(i-this.y0)/this.a),e}var aS=["Equirectangular","Equidistant_Cylindrical","eqc"];const oS={init:nS,forward:sS,inverse:rS,names:aS};var Xd=20;function hS(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Va(this.es),this.e1=Ka(this.es),this.e2=$a(this.es),this.e3=Za(this.es),this.ml0=this.a*ee(this.e0,this.e1,this.e2,this.e3,this.lat0)}function lS(e){var t=e.x,i=e.y,n,s,r,a=B(t-this.long0);if(r=a*Math.sin(i),this.sphere)Math.abs(i)<=U?(n=this.a*a,s=-1*this.a*this.lat0):(n=this.a*Math.sin(r)/Math.tan(i),s=this.a*(cn(i-this.lat0)+(1-Math.cos(r))/Math.tan(i)));else if(Math.abs(i)<=U)n=this.a*a,s=-1*this.ml0;else{var o=sr(this.a,this.e,Math.sin(i))/Math.tan(i);n=o*Math.sin(r),s=this.a*ee(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+o*(1-Math.cos(r))}return e.x=n+this.x0,e.y=s+this.y0,e}function cS(e){var t,i,n,s,r,a,o,h,l;if(n=e.x-this.x0,s=e.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=U)t=B(n/this.a+this.long0),i=0;else{a=this.lat0+s/this.a,o=n*n/this.a/this.a+a*a,h=a;var c;for(r=Xd;r;--r)if(c=Math.tan(h),l=-1*(a*(h*c+1)-h-.5*(h*h+o)*c)/((h-a)/c-1),h+=l,Math.abs(l)<=U){i=h;break}t=B(this.long0+Math.asin(n*Math.tan(h)/this.a)/Math.sin(i))}else if(Math.abs(s+this.ml0)<=U)i=0,t=B(this.long0+n/this.a);else{a=(this.ml0+s)/this.a,o=n*n/this.a/this.a+a*a,h=a;var u,d,g,f,_;for(r=Xd;r;--r)if(_=this.e*Math.sin(h),u=Math.sqrt(1-_*_)*Math.tan(h),d=this.a*ee(this.e0,this.e1,this.e2,this.e3,h),g=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),f=d/this.a,l=(a*(u*f+1)-f-.5*u*(f*f+o))/(this.es*Math.sin(2*h)*(f*f+o-2*a*f)/(4*u)+(a-f)*(u*g-2/Math.sin(2*h))-g),h-=l,Math.abs(l)<=U){i=h;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=B(this.long0+Math.asin(n*u/this.a)/Math.sin(i))}return e.x=t,e.y=i,e}var uS=["Polyconic","poly"];const dS={init:hS,forward:lS,inverse:cS,names:uS};function fS(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function gS(e){var t,i=e.x,n=e.y,s=n-this.lat0,r=i-this.long0,a=s/kr*1e-5,o=r,h=1,l=0;for(t=1;t<=10;t++)h=h*a,l=l+this.A[t]*h;var c=l,u=o,d=1,g=0,f,_,m=0,p=0;for(t=1;t<=6;t++)f=d*c-g*u,_=g*c+d*u,d=f,g=_,m=m+this.B_re[t]*d-this.B_im[t]*g,p=p+this.B_im[t]*d+this.B_re[t]*g;return e.x=p*this.a+this.x0,e.y=m*this.a+this.y0,e}function _S(e){var t,i=e.x,n=e.y,s=i-this.x0,r=n-this.y0,a=r/this.a,o=s/this.a,h=1,l=0,c,u,d=0,g=0;for(t=1;t<=6;t++)c=h*a-l*o,u=l*a+h*o,h=c,l=u,d=d+this.C_re[t]*h-this.C_im[t]*l,g=g+this.C_im[t]*h+this.C_re[t]*l;for(var f=0;f.999999999999&&(i=.999999999999),t=Math.asin(i);var n=B(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var s=Math.asin(i);return e.x=n,e.y=s,e}var PS=["Mollweide","moll"];const OS={init:IS,forward:AS,inverse:LS,names:PS};function DS(){Math.abs(this.lat1+this.lat2)=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var r=0;if(i!==0&&(r=Math.atan2(t*e.x,t*e.y)),this.sphere)return s=B(this.long0+r/this.ns),n=cn(this.g-i/this.a),e.x=s,e.y=n,e;var a=this.g-i/this.a;return n=Jo(a,this.e0,this.e1,this.e2,this.e3),s=B(this.long0+r/this.ns),e.x=s,e.y=n,e}var kS=["Equidistant_Conic","eqdc"];const GS={init:DS,forward:FS,inverse:NS,names:kS};function zS(){this.R=this.a}function US(e){var t=e.x,i=e.y,n=B(t-this.long0),s,r;Math.abs(i)<=U&&(s=this.x0+this.R*n,r=this.y0);var a=hn(2*Math.abs(i/Math.PI));(Math.abs(n)<=U||Math.abs(Math.abs(i)-L)<=U)&&(s=this.x0,i>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*a):r=this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/n-n/Math.PI),h=o*o,l=Math.sin(a),c=Math.cos(a),u=c/(l+c-1),d=u*u,g=u*(2/l-1),f=g*g,_=Math.PI*this.R*(o*(u-f)+Math.sqrt(h*(u-f)*(u-f)-(f+h)*(d-f)))/(f+h);n<0&&(_=-_),s=this.x0+_;var m=h+u;return _=Math.PI*this.R*(g*m-o*Math.sqrt((f+h)*(h+1)-m*m))/(f+h),i>=0?r=this.y0+_:r=this.y0-_,e.x=s,e.y=r,e}function BS(e){var t,i,n,s,r,a,o,h,l,c,u,d,g;return e.x-=this.x0,e.y-=this.y0,u=Math.PI*this.R,n=e.x/u,s=e.y/u,r=n*n+s*s,a=-Math.abs(s)*(1+r),o=a-2*s*s+n*n,h=-2*a+1+2*s*s+r*r,g=s*s/h+(2*o*o*o/h/h/h-9*a*o/h/h)/27,l=(a-o*o/3/h)/h,c=2*Math.sqrt(-l/3),u=3*g/l/c,Math.abs(u)>1&&(u>=0?u=1:u=-1),d=Math.acos(u)/3,e.y>=0?i=(-c*Math.cos(d+Math.PI/3)-o/3/h)*Math.PI:i=-(-c*Math.cos(d+Math.PI/3)-o/3/h)*Math.PI,Math.abs(n)2*L*this.a?void 0:(i=t/this.a,n=Math.sin(i),s=Math.cos(i),r=this.long0,Math.abs(t)<=U?a=this.lat0:(a=hn(s*this.sin_p12+e.y*n*this.cos_p12/t),o=Math.abs(this.lat0)-L,Math.abs(o)<=U?this.lat0>=0?r=B(this.long0+Math.atan2(e.x,-e.y)):r=B(this.long0-Math.atan2(-e.x,e.y)):r=B(this.long0+Math.atan2(e.x*n,t*this.cos_p12*s-e.y*this.sin_p12*n))),e.x=r,e.y=a,e)):(h=Va(this.es),l=Ka(this.es),c=$a(this.es),u=Za(this.es),Math.abs(this.sin_p12-1)<=U?(d=this.a*ee(h,l,c,u,L),t=Math.sqrt(e.x*e.x+e.y*e.y),g=d-t,a=Jo(g/this.a,h,l,c,u),r=B(this.long0+Math.atan2(e.x,-1*e.y)),e.x=r,e.y=a,e):Math.abs(this.sin_p12+1)<=U?(d=this.a*ee(h,l,c,u,L),t=Math.sqrt(e.x*e.x+e.y*e.y),g=t-d,a=Jo(g/this.a,h,l,c,u),r=B(this.long0+Math.atan2(e.x,e.y)),e.x=r,e.y=a,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),m=Math.atan2(e.x,e.y),f=sr(this.a,this.e,this.sin_p12),p=Math.cos(m),y=this.e*this.cos_p12*p,M=-y*y/(1-this.es),v=3*this.es*(1-M)*this.sin_p12*this.cos_p12*p/(1-this.es),E=t/f,w=E-M*(1+M)*Math.pow(E,3)/6-v*(1+3*M)*Math.pow(E,4)/24,b=1-M*w*w/2-E*w*w*w/6,_=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*p),r=B(this.long0+Math.asin(Math.sin(m)*Math.sin(w)/Math.cos(_))),S=Math.sin(_),a=Math.atan2((S-this.es*b*this.sin_p12)*Math.tan(_),S*(1-this.es)),e.x=r,e.y=a,e))}var VS=["Azimuthal_Equidistant","aeqd"];const KS={init:jS,forward:YS,inverse:qS,names:VS};function $S(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function ZS(e){var t,i,n,s,r,a,o,h,l=e.x,c=e.y;return n=B(l-this.long0),t=Math.sin(c),i=Math.cos(c),s=Math.cos(n),a=this.sin_p14*t+this.cos_p14*i*s,r=1,(a>0||Math.abs(a)<=U)&&(o=this.a*r*i*Math.sin(n),h=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*i*s)),e.x=o,e.y=h,e}function HS(e){var t,i,n,s,r,a,o;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=hn(t/this.a),n=Math.sin(i),s=Math.cos(i),a=this.long0,Math.abs(t)<=U?(o=this.lat0,e.x=a,e.y=o,e):(o=hn(s*this.sin_p14+e.y*n*this.cos_p14/t),r=Math.abs(this.lat0)-L,Math.abs(r)<=U?(this.lat0>=0?a=B(this.long0+Math.atan2(e.x,-e.y)):a=B(this.long0-Math.atan2(-e.x,e.y)),e.x=a,e.y=o,e):(a=B(this.long0+Math.atan2(e.x*n,t*this.cos_p14*s-e.y*this.sin_p14*n)),e.x=a,e.y=o,e))}var JS=["ortho"];const QS={init:$S,forward:ZS,inverse:HS,names:JS};var bt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},yt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function tR(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=L-mt/2?this.face=bt.TOP:this.lat0<=-(L-mt/2)?this.face=bt.BOTTOM:Math.abs(this.long0)<=mt?this.face=bt.FRONT:Math.abs(this.long0)<=L+mt?this.face=this.long0>0?bt.RIGHT:bt.LEFT:this.face=bt.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function eR(e){var t={x:0,y:0},i,n,s,r,a,o,h={value:0};if(e.x-=this.long0,this.es!==0?i=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):i=e.y,n=e.x,this.face===bt.TOP)r=L-i,n>=mt&&n<=L+mt?(h.value=yt.AREA_0,s=n-L):n>L+mt||n<=-(L+mt)?(h.value=yt.AREA_1,s=n>0?n-Pt:n+Pt):n>-(L+mt)&&n<=-mt?(h.value=yt.AREA_2,s=n+L):(h.value=yt.AREA_3,s=n);else if(this.face===bt.BOTTOM)r=L+i,n>=mt&&n<=L+mt?(h.value=yt.AREA_0,s=-n+L):n=-mt?(h.value=yt.AREA_1,s=-n):n<-mt&&n>=-(L+mt)?(h.value=yt.AREA_2,s=-n-L):(h.value=yt.AREA_3,s=n>0?-n+Pt:-n-Pt);else{var l,c,u,d,g,f,_;this.face===bt.RIGHT?n=ws(n,+L):this.face===bt.BACK?n=ws(n,+Pt):this.face===bt.LEFT&&(n=ws(n,-L)),d=Math.sin(i),g=Math.cos(i),f=Math.sin(n),_=Math.cos(n),l=g*_,c=g*f,u=d,this.face===bt.FRONT?(r=Math.acos(l),s=_o(r,u,c,h)):this.face===bt.RIGHT?(r=Math.acos(c),s=_o(r,u,-l,h)):this.face===bt.BACK?(r=Math.acos(-l),s=_o(r,u,-c,h)):this.face===bt.LEFT?(r=Math.acos(-c),s=_o(r,u,l,h)):(r=s=0,h.value=yt.AREA_0)}return o=Math.atan(12/Pt*(s+Math.acos(Math.sin(s)*Math.cos(mt))-L)),a=Math.sqrt((1-Math.cos(r))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(s))))),h.value===yt.AREA_1?o+=L:h.value===yt.AREA_2?o+=Pt:h.value===yt.AREA_3&&(o+=1.5*Pt),t.x=a*Math.cos(o),t.y=a*Math.sin(o),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function iR(e){var t={lam:0,phi:0},i,n,s,r,a,o,h,l,c,u={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,n=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),i=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?u.value=yt.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(u.value=yt.AREA_1,i-=L):e.x<0&&-e.x>=Math.abs(e.y)?(u.value=yt.AREA_2,i=i<0?i+Pt:i-Pt):(u.value=yt.AREA_3,i+=L),c=Pt/12*Math.tan(i),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),s=Math.cos(i),r=Math.tan(n),h=1-s*s*r*r*(1-Math.cos(Math.atan(1/Math.cos(o)))),h<-1?h=-1:h>1&&(h=1),this.face===bt.TOP)l=Math.acos(h),t.phi=L-l,u.value===yt.AREA_0?t.lam=o+L:u.value===yt.AREA_1?t.lam=o<0?o+Pt:o-Pt:u.value===yt.AREA_2?t.lam=o-L:t.lam=o;else if(this.face===bt.BOTTOM)l=Math.acos(h),t.phi=l-L,u.value===yt.AREA_0?t.lam=-o+L:u.value===yt.AREA_1?t.lam=-o:u.value===yt.AREA_2?t.lam=-o-L:t.lam=o<0?-o-Pt:-o+Pt;else{var d,g,f;d=h,c=d*d,c>=1?f=0:f=Math.sqrt(1-c)*Math.sin(o),c+=f*f,c>=1?g=0:g=Math.sqrt(1-c),u.value===yt.AREA_1?(c=g,g=-f,f=c):u.value===yt.AREA_2?(g=-g,f=-f):u.value===yt.AREA_3&&(c=g,g=f,f=-c),this.face===bt.RIGHT?(c=d,d=-g,g=c):this.face===bt.BACK?(d=-d,g=-g):this.face===bt.LEFT&&(c=d,d=g,g=-c),t.phi=Math.acos(-f)-L,t.lam=Math.atan2(g,d),this.face===bt.RIGHT?t.lam=ws(t.lam,-L):this.face===bt.BACK?t.lam=ws(t.lam,-Pt):this.face===bt.LEFT&&(t.lam=ws(t.lam,+L))}if(this.es!==0){var _,m,p;_=t.phi<0?1:0,m=Math.tan(t.phi),p=this.b/Math.sqrt(m*m+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function _o(e,t,i,n){var s;return emt&&s<=L+mt?(n.value=yt.AREA_1,s-=L):s>L+mt||s<=-(L+mt)?(n.value=yt.AREA_2,s=s>=0?s-Pt:s+Pt):(n.value=yt.AREA_3,s+=L)),s}function ws(e,t){var i=e+t;return i<-Pt?i+=na:i>+Pt&&(i-=na),i}var nR=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const sR={init:tR,forward:eR,inverse:iR,names:nR};var Bl=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Pr=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],z0=.8487,U0=1.3523,B0=si/5,rR=1/B0,ms=18,Qo=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},aR=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function oR(e,t,i,n){for(var s=t;n;--n){var r=e(s);if(s-=r,Math.abs(r)=ms&&(n=ms-1),i=si*(i-rR*n);var s={x:Qo(Bl[n],i)*t,y:Qo(Pr[n],i)};return e.y<0&&(s.y=-s.y),s.x=s.x*this.a*z0+this.x0,s.y=s.y*this.a*U0+this.y0,s}function cR(e){var t={x:(e.x-this.x0)/(this.a*z0),y:Math.abs(e.y-this.y0)/(this.a*U0)};if(t.y>=1)t.x/=Bl[ms][0],t.y=e.y<0?-L:L;else{var i=Math.floor(t.y*ms);for(i<0?i=0:i>=ms&&(i=ms-1);;)if(Pr[i][0]>t.y)--i;else if(Pr[i+1][0]<=t.y)++i;else break;var n=Pr[i],s=5*(t.y-n[0])/(Pr[i+1][0]-n[0]);s=oR(function(r){return(Qo(n,r)-t.y)/aR(n,r)},s,U,100),t.x/=Qo(Bl[i],s),t.y=(5*i+s)*Xt,e.y<0&&(t.y=-t.y)}return t.x=B(t.x+this.long0),t}var uR=["Robinson","robin"];const dR={init:hR,forward:lR,inverse:cR,names:uR};function fR(){this.name="geocent"}function gR(e){var t=b0(e,this.es,this.a);return t}function _R(e){var t=I0(e,this.es,this.a,this.b);return t}var mR=["Geocentric","geocentric","geocent","Geocent"];const yR={init:fR,forward:gR,inverse:_R,names:mR};var Kt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},wr={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function pR(){if(Object.keys(wr).forEach((function(i){if(typeof this[i]>"u")this[i]=wr[i].def;else{if(wr[i].num&&isNaN(this[i]))throw new Error("Invalid parameter value, must be numeric "+i+" = "+this[i]);wr[i].num&&(this[i]=parseFloat(this[i]))}wr[i].degrees&&(this[i]=this[i]*Xt)}).bind(this)),Math.abs(Math.abs(this.lat0)-L)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function vR(e){e.x-=this.long0;var t=Math.sin(e.y),i=Math.cos(e.y),n=Math.cos(e.x),s,r;switch(this.mode){case Kt.OBLIQ:r=this.sinph0*t+this.cosph0*i*n;break;case Kt.EQUIT:r=i*n;break;case Kt.S_POLE:r=-t;break;case Kt.N_POLE:r=t;break}switch(r=this.pn1/(this.p-r),s=r*i*Math.sin(e.x),this.mode){case Kt.OBLIQ:r*=this.cosph0*t-this.sinph0*i*n;break;case Kt.EQUIT:r*=t;break;case Kt.N_POLE:r*=-(i*n);break;case Kt.S_POLE:r*=i*n;break}var a,o;return a=r*this.cg+s*this.sg,o=1/(a*this.sw*this.h1+this.cw),s=(s*this.cg-r*this.sg)*this.cw*o,r=a*o,e.x=s*this.a,e.y=r*this.a,e}function xR(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},i,n,s;s=1/(this.pn1-e.y*this.sw),i=this.pn1*e.x*s,n=this.pn1*e.y*this.cw*s,e.x=i*this.cg+n*this.sg,e.y=n*this.cg-i*this.sg;var r=le(e.x,e.y);if(Math.abs(r)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function SR(e){var t=e.x,i=e.y,n,s,r,a;if(t=t-this.long0,this.shape==="ellipse"){i=Math.atan(this.radius_p2*Math.tan(i));var o=this.radius_p/le(this.radius_p*Math.cos(i),Math.sin(i));if(s=o*Math.cos(t)*Math.cos(i),r=o*Math.sin(t)*Math.cos(i),a=o*Math.sin(i),(this.radius_g-s)*s-r*r-a*a*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=this.radius_g-s,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/le(a,n)),e.y=this.radius_g_1*Math.atan(a/n)):(e.x=this.radius_g_1*Math.atan(r/n),e.y=this.radius_g_1*Math.atan(a/le(r,n)))}else this.shape==="sphere"&&(n=Math.cos(i),s=Math.cos(t)*n,r=Math.sin(t)*n,a=Math.sin(i),n=this.radius_g-s,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/le(a,n)),e.y=this.radius_g_1*Math.atan(a/n)):(e.x=this.radius_g_1*Math.atan(r/n),e.y=this.radius_g_1*Math.atan(a/le(r,n))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function RR(e){var t=-1,i=0,n=0,s,r,a,o;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(e.y/this.radius_g_1),i=Math.tan(e.x/this.radius_g_1)*le(1,n)):(i=Math.tan(e.x/this.radius_g_1),n=Math.tan(e.y/this.radius_g_1)*le(1,i));var h=n/this.radius_p;if(s=i*i+h*h+t*t,r=2*this.radius_g*t,a=r*r-4*s*this.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-r-Math.sqrt(a))/(2*s),t=this.radius_g+o*t,i*=o,n*=o,e.x=Math.atan2(i,t),e.y=Math.atan(n*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(e.y/this.radius_g_1),i=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+n*n)):(i=Math.tan(e.x/this.radius_g_1),n=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+i*i)),s=i*i+n*n+t*t,r=2*this.radius_g*t,a=r*r-4*s*this.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-r-Math.sqrt(a))/(2*s),t=this.radius_g+o*t,i*=o,n*=o,e.x=Math.atan2(i,t),e.y=Math.atan(n*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var CR=["Geostationary Satellite View","Geostationary_Satellite","geos"];const TR={init:wR,forward:SR,inverse:RR,names:CR};var Gr=1.340264,zr=-.081106,Ur=893e-6,Br=.003796,th=Math.sqrt(3)/2;function bR(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function IR(e){var t=B(e.x-this.long0),i=e.y,n=Math.asin(th*Math.sin(i)),s=n*n,r=s*s*s;return e.x=t*Math.cos(n)/(th*(Gr+3*zr*s+r*(7*Ur+9*Br*s))),e.y=n*(Gr+zr*s+r*(Ur+Br*s)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function AR(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,i=12,n=e.y,s,r,a,o,h,l;for(l=0;l=L?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=kR,this.forward=NR)}function DR(e){var t=B(e.x-(this.long0||0)),i=e.y,n,s,r;return n=this.am1+this.m1-dr(i,s=Math.sin(i),r=Math.cos(i),this.en),s=r*t/(n*Math.sqrt(1-this.es*s*s)),e.x=n*Math.sin(s),e.y=this.am1-n*Math.cos(s),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function FR(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,i,n,s;if(i=le(e.x,e.y=this.am1-e.y),s=tu(this.am1+this.m1-i,this.es,this.en),(t=Math.abs(s))aa?(e.x=s*Math.sin(n=t*Math.cos(i)/s),e.y=this.cphi1-s*Math.cos(n)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function kR(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,i,n=le(e.x,e.y=this.cphi1-e.y);if(i=this.cphi1+this.phi1-n,Math.abs(i)>L)throw new Error;return Math.abs(Math.abs(i)-L)<=aa?t=0:t=n*Math.atan2(e.x,e.y)/Math.cos(i),e.x=B(t+(this.long0||0)),e.y=cn(i),e}var GR=["bonne","Bonne (Werner lat_1=90)"];const zR={init:OR,names:GR};function UR(e){e.Proj.projections.add(So),e.Proj.projections.add(Ro),e.Proj.projections.add(D2),e.Proj.projections.add(j2),e.Proj.projections.add(Z2),e.Proj.projections.add(ew),e.Proj.projections.add(ow),e.Proj.projections.add(dw),e.Proj.projections.add(yw),e.Proj.projections.add(Mw),e.Proj.projections.add(zw),e.Proj.projections.add(Yw),e.Proj.projections.add(Zw),e.Proj.projections.add(iS),e.Proj.projections.add(oS),e.Proj.projections.add(dS),e.Proj.projections.add(yS),e.Proj.projections.add(MS),e.Proj.projections.add(bS),e.Proj.projections.add(OS),e.Proj.projections.add(GS),e.Proj.projections.add(XS),e.Proj.projections.add(KS),e.Proj.projections.add(QS),e.Proj.projections.add(sR),e.Proj.projections.add(dR),e.Proj.projections.add(yR),e.Proj.projections.add(MR),e.Proj.projections.add(TR),e.Proj.projections.add(PR),e.Proj.projections.add(zR)}fe.defaultDatum="WGS84";fe.Proj=ri;fe.WGS84=new fe.Proj("WGS84");fe.Point=nr;fe.toPoint=A0;fe.defs=Ht;fe.nadgrid=NM;fe.transform=Ho;fe.mgrs=JM;fe.version="__VERSION__";UR(fe);function BR(e){for(const[t,i]of Object.entries(e))fe.defs(t,i);ZE(fe)}const WR=1,eh=vt.createContext(WR);eh.displayName="LevelContext";function xT(e){const{title:t,sectionHeadingProps:i,children:n}=e,s=vt.useContext(eh),r=typeof t=="string"?Ie.jsx(XR,{...i,children:t}):t;return Ie.jsxs(Ie.Fragment,{children:[r,Ie.jsx(eh.Provider,{value:s+1,children:n})]})}const XR=vt.forwardRef(function(t,i){const{children:n,...s}=t,r=jR(),a=YR(r);return Ie.jsx(o_,{as:a,ref:i,...s,children:n})});function jR(){const e=vt.useContext(eh);return Math.min(e,6)}function YR(e){return`h${e}`}var W0={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function i(){for(var r="",a=0;a`(${u} + ${d}px)`,c={};switch(e){case"top-left":c.left=l(Wl.ref,r),c.top=l(jl.ref,o);break;case"top-right":c.right=l(Xl.ref,r),c.top=l(jl.ref,o);break;case"bottom-left":c.left=l(Wl.ref,r),c.bottom=l(Yl.ref,o+h.gap);break;case"bottom-right":c.right=l(Xl.ref,r),c.bottom=l(Yl.ref,o+h.gap);break}for(const[u,d]of Object.entries(c))n[u]=`calc(${d})`;return n.maxH=`calc((100%) - ${mo(c.top,"0px")} - ${mo(c.bottom,h.gap+"px")} - ${o}px - ${h.space}px)`,n.maxW=`calc((100%) - ${mo(c.left,"0px")} - ${mo(c.right,"0px")} - ${r}px)`,n}function mo(e,t){return e??t}const su=vt.createContext(void 0);su.displayName="MapContainerContext";const $R=su.Provider;function ZR(){const e=vt.useContext(su);if(!e)throw new Error("Map container context is not available. The component must be a child of the component.");return e}const HR="top-right";function ET(e){const{position:t=HR,children:i,horizontalGap:n,verticalGap:s}=e,{containerProps:r}=X0("map-anchor",e),{mapAnchorsHost:a}=ZR();return l_.createPortal(Ie.jsx(c_,{...r,...KR(t,n,s),children:i}),a)}function JR(e){return{gap:e===void 0?30:0,space:10}}function QR(e,t,i){const n=vt.useContext(sf);return vt.useMemo(()=>j0("useService",n).getService(e,t,i??{}),[n,e,t,i])}function MT(e){const t=vt.useContext(sf);return j0("useIntl",t).getIntl(e)}function j0(e,t){if(!t)throw new u_(d_.INTERNAL,`"Failed to access package context from '${e}': react integration was not set up properly.`);return t}const tC="@open-pioneer/map",eC=QR.bind(void 0,tC);function iC(){var e=vt.useRef(!1),t=vt.useCallback(function(){return e.current},[]);return vt.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function nC(e,t,i){t===void 0&&(t=[]),i===void 0&&(i={loading:!1});var n=vt.useRef(0),s=iC(),r=vt.useState(i),a=r[0],o=r[1],h=vt.useCallback(function(){for(var l=[],c=0;c{const l=h.getType(),c=new Wc({type:l,geometry:h});return c.setStyle(dC(l,i?.highlightStyle)),c}),r=this.olSource,a=this.activeHighlights,o={get isActive(){return a.has(o)},destroy(){if(this.isActive){for(const h of s)r.removeFeature(h);a.delete(o)}}};return r.addFeatures(s),this.activeHighlights.add(o),o}zoomToHighlight(t,i){const n=V(this,Ma,ql).call(this,t);if(n.length===0)return;let s=de();for(const g of n)s=nc(s,g.getExtent());const r=Oe(s),o=$s(s)===0?i?.pointZoom??rC:i?.maxZoom??aC;lC(this.olMap,r);const{top:h=0,right:l=0,bottom:c=0,left:u=0}=i?.viewPadding??oC,d=[h,l,c,u];cC(this.olMap,s,o,d)}addHighlightAndZoom(t,i){const n=this.addHighlight(t,i);return this.zoomToHighlight(t,i),n}clearHighlight(){for(const t of this.activeHighlights)t.destroy()}}Ma=new WeakSet,ql=function(t){const i=[];return t.forEach(n=>{"getType"in n&&i.push(n),"geometry"in n&&n.geometry&&i.push(n.geometry)}),i};function lC(e,t){t&&t.length&&e.getView().setCenter(t)}function cC(e,t,i,n){t?e.getView().fit(t,{maxZoom:i,padding:n}):i&&e.getView().setZoom(i)}function uC(e,t){const i=e.get("type");return Vg(Vl(i))(e,t)}function dC(e,t){if(t&&e in t){const n=t[e];return n||Vl(e)}else return Vl(e)}function Vl(e){return e in ol?ol[e]:ol.Polygon}const ol={Point:new Lt({image:new ir({anchor:[.5,1],src:jd})}),MultiPoint:new Lt({image:new ir({anchor:[.5,1],src:jd})}),LineString:[new Lt({stroke:new Jt({color:"#fff",width:5})}),new Lt({stroke:new Jt({color:"#00ffff",width:3})})],MultiLineString:[new Lt({stroke:new Jt({color:"#fff",width:5})}),new Lt({stroke:new Jt({color:"#00ffff",width:3})})],Polygon:[new Lt({stroke:new Jt({color:"#fff",width:5})}),new Lt({stroke:new Jt({color:"#00ffff",width:3}),fill:new Ii({color:"rgba(224,255,255,0.35)"})})],MultiPolygon:[new Lt({stroke:new Jt({color:"#fff",width:5})}),new Lt({stroke:new Jt({color:"#00ffff",width:3}),fill:new Ii({color:"rgba(224,255,255,0.35)"})})]},zi=Ai("map:LayerCollection"),fC=0,gC=1,_C=9999999;var Pn,qi,Ce,Vi,Ge,ih,ue,Y0,q0,Co,V0,K0;class mC{constructor(t){N(this,ue);N(this,Pn);N(this,qi,B_());N(this,Ce,new Map);N(this,Vi,new WeakMap);N(this,Ge,$t());N(this,ih,gC);Y(this,Pn,t)}destroy(){for(const t of x(this,Ce).values())t.destroy();x(this,qi).clear(),x(this,Ce).clear(),x(this,Ge).value=void 0}addLayer(t){Yd(t),t.__attachToMap(x(this,Pn)),V(this,ue,Y0).call(this,t)}getBaseLayers(){return this.getAllLayers().filter(t=>t.isBaseLayer)}getActiveBaseLayer(){return x(this,Ge).value}activateBaseLayer(t){let i;if(t!=null){if(i=x(this,Ce).get(t),!(i instanceof Js))return zi.warn(`Cannot activate base layer '${t}: layer has an invalid type.'`),!1;if(!i)return zi.warn(`Cannot activate base layer '${t}': layer is unknown.`),!1;if(!i.isBaseLayer)return zi.warn(`Cannot activate base layer '${t}': layer is not a base layer.`),!1}return V(this,ue,Co).call(this,i),!0}getOperationalLayers(t){return this.getAllLayers(t).filter(i=>!i.isBaseLayer)}getAllLayers(t){const i=Array.from(x(this,qi).values());return t?.sortByDisplayOrder&&yC(i),i}getLayerById(t){return x(this,Ce).get(t)}removeLayerById(t){const i=x(this,Ce).get(t);if(!i){zi.isDebug()&&zi.debug(`Cannot remove layer '${t}': layer is unknown.`);return}V(this,ue,q0).call(this,i)}getLayerByRawInstance(t){return x(this,Vi)?.get(t)}}Pn=new WeakMap,qi=new WeakMap,Ce=new WeakMap,Vi=new WeakMap,Ge=new WeakMap,ih=new WeakMap,ue=new WeakSet,Y0=function(t){V(this,ue,V0).call(this,t);const i=t.olLayer;t.isBaseLayer?(i.setZIndex(fC),!x(this,Ge).value&&t.visible?V(this,ue,Co).call(this,t):t.__setVisible(!1)):(i.setZIndex(gu(this,ih)._++),t.__setVisible(t.visible)),x(this,qi).add(t),x(this,Pn).olMap.addLayer(i)},q0=function(t){if(!x(this,qi).has(t)){zi.warn(`Cannot remove layer '${t.id}': only top level layers can be removed at this time.`);return}if(!(t instanceof Js))throw new Error("Internal error: expected top level layer to be an instance of AbstractLayer.");if(x(this,Pn).olMap.removeLayer(t.olLayer),x(this,qi).delete(t),V(this,ue,K0).call(this,t),x(this,Ge).value===t){const i=this.getBaseLayers()[0];i&&Yd(i),V(this,ue,Co).call(this,i)}t.destroy()},Co=function(t){if(x(this,Ge).value!==t){if(zi.isDebug()){const i=n=>n?`'${n.id}'`:void 0;zi.debug(`Switching active base layer from ${i(x(this,Ge).value)} to ${i(t)}`)}Jl(()=>{x(this,Ge).value?.__setVisible(!1),x(this,Ge).value=t,t?.__setVisible(!0)})}},V0=function(t){const i=[],n=s=>{const r=s.id,a="olLayer"in s?s.olLayer:void 0;if(x(this,Ce).has(r))throw new Error(`Layer id '${r}' is not unique. Either assign a unique id yourself or skip configuring 'id' for an automatically generated id.`);if(a&&x(this,Vi).has(a))throw new Error(`OlLayer used by layer '${r}' has already been used in map.`);x(this,Ce).set(r,s),a&&x(this,Vi).set(a,s),i.push([r,a]);for(const o of s.layers?.__getRawLayers()??[])n(o);for(const o of s.sublayers?.__getRawSublayers()??[])n(o)};try{n(t)}catch(s){for(const[r,a]of i)x(this,Ce).delete(r),a&&x(this,Vi).delete(a);throw s}},K0=function(t){const i=n=>{"olLayer"in n&&x(this,Vi).delete(n.olLayer),x(this,Ce).delete(n.id);for(const s of n.layers?.__getRawLayers()??[])i(s);for(const s of n.sublayers?.__getRawSublayers()??[])i(s)};i(t)};function yC(e){e.sort((t,i)=>{const n=t.olLayer.getZIndex()??1,s=i.olLayer.getZIndex()??1;return n-s})}function Yd(e){if(!(e instanceof Js))throw new Error("Layer is not a valid layer instance. Use one of the classes provided by the map package instead.")}const is=Ai("map:MapModel"),qd=25.4/.28,Vd=39.37;var wa,Te,Xs,Sa,Ei,Ra,js,Ca,Ki,$i,Ta,ba,Zi,Mi,nh,Z0;class $0 extends rf{constructor(i){super();N(this,nh);N(this,wa);N(this,Te);N(this,Xs);N(this,Sa,new mC(this));N(this,Ei);N(this,Ra);N(this,js,!1);N(this,Ca);N(this,Ki,$t());N(this,$i);N(this,Ta);N(this,ba,new AbortController);N(this,Zi);N(this,Mi);Y(this,wa,i.id),Y(this,Te,i.olMap),Y(this,Xs,Dr(()=>x(this,Te).getView(),n=>{const s=x(this,Te).on("change:view",n);return()=>je(s)})),x(this,Ki).value=i.initialExtent,Y(this,Ra,{httpService:i.httpService}),Y(this,Ei,new hC(x(this,Te))),Y(this,Zi,"waiting"),V(this,nh,Z0).call(this).then(()=>{Y(this,Zi,"ready"),x(this,Mi)?.resolve(),Y(this,Mi,void 0)},n=>{Wr(n)||is.error("Failed to initialize map",n),Y(this,Zi,"error"),x(this,Mi)?.reject(new Error("Failed to initialize map.")),Y(this,Mi,void 0)}),Y(this,Ca,Dr(()=>x(this,Te).getTargetElement()??void 0,n=>{const s=x(this,Te).on("change:target",n);return()=>je(s)})),Y(this,$i,Xr(()=>pC(x(this,Xs).value))),Y(this,Ta,Xr(()=>{const{projection:n,resolution:s,center:r}=this;if(n==null||s==null||r==null)return;const a=Fo(n,s,r);return Math.round(a*Vd*qd)}))}destroy(){if(!x(this,js)){Y(this,js,!0);try{this.emit("destroy")}catch(i){is.warn("Unexpected error from event listener during map model destruction:",i)}x(this,ba).abort(),x(this,Mi)?.reject(new Error("Map model was destroyed.")),x(this,Sa).destroy(),x(this,Ei).destroy(),x(this,Te).dispose()}}get id(){return x(this,wa)}get olMap(){return x(this,Te)}get olView(){return x(this,Xs).value}get projection(){return x(this,$i).value.projection}get center(){return x(this,$i).value.center.value}get resolution(){return x(this,$i).value.resolution.value}get zoomLevel(){return x(this,$i).value.zoom.value}get scale(){return x(this,Ta).value}get layers(){return x(this,Sa)}get container(){return x(this,Ca).value}get initialExtent(){return x(this,Ki).value}get __sharedDependencies(){return x(this,Ra)}setScale(i){const n=this.olView,s=this.projection,r=this.center;if(!r)return;const a=s.getMetersPerUnit()??1,o=Vd*qd*a,h=i/Fo(s,o,r);n.setResolution(h)}highlight(i,n){return x(this,Ei).addHighlight(i,n)}zoom(i,n){x(this,Ei).zoomToHighlight(i,n)}highlightAndZoom(i,n){return x(this,Ei).addHighlightAndZoom(i,n??{})}removeHighlights(){x(this,Ei).clearHighlight()}whenDisplayed(){return x(this,js)?Promise.reject(new Error("Map model was destroyed.")):x(this,Zi)==="error"?Promise.reject(new Error("Failed to initialize map.")):x(this,Zi)==="ready"?Promise.resolve():(x(this,Mi)??Y(this,Mi,f_())).promise}}wa=new WeakMap,Te=new WeakMap,Xs=new WeakMap,Sa=new WeakMap,Ei=new WeakMap,Ra=new WeakMap,js=new WeakMap,Ca=new WeakMap,Ki=new WeakMap,$i=new WeakMap,Ta=new WeakMap,ba=new WeakMap,Zi=new WeakMap,Mi=new WeakMap,nh=new WeakSet,Z0=async function(){try{await vC(this.olMap,x(this,ba).signal)}catch(i){throw Wr(i)?i:new Error("Failed to wait for the map to be displayed.",{cause:i})}try{const n=x(this,Te).getView();if(x(this,Ki).value){const s=x(this,Ki).value,r=[s.xMin,s.yMin,s.xMax,s.yMax],a=Oe(r),o=n.getResolutionForExtent(r);is.debug("Applying initial extent",s),is.debug(" Computed center:",a),is.debug(" Computed resolution:",o),n.setCenter(a),n.setResolution(o)}else{const s=n.calculateExtent(),[r=0,a=0,o=0,h=0]=s,l={xMin:r,yMin:a,xMax:o,yMax:h};is.debug("Detected initial extent",l),x(this,Ki).value=l}}catch(i){throw new Error("Failed to apply the initial extent.",{cause:i})}};function pC(e){return{resolution:Dr(()=>e.getResolution(),t=>{const i=e.on("change:resolution",t);return()=>je(i)}),center:Dr(()=>e.getCenter(),t=>{const i=e.on("change:center",t);return()=>je(i)}),zoom:Dr(()=>e.getZoom(),t=>{const i=e.on("change:resolution",t);return()=>je(i)}),projection:e.getProjection()}}function vC(e,t){return new Promise((n,s)=>{let r;function a(){const l=e.getSize()??[],[c=0,u=0]=l;l&&c>0&&u>0&&h()}function o(){h(mu())}function h(l){r&&(je(r),r=void 0),t.removeEventListener("abort",o),l?s(l):n(xC(25))}if(t.aborted){h(mu());return}t.addEventListener("abort",o),r=e.on("change:size",a)})}function xC(e){return new Promise(t=>setTimeout(t,e))}const ru=vt.createContext(void 0);ru.displayName="DefaultMapContext";function wT(e){const{mapId:t,map:i,children:n}=e,s=vt.useMemo(()=>({mapId:t,map:i}),[t,i]);if(t!=null&&i!=null)throw new Error("Cannot specify both 'mapId' and 'map' in DefaultMapProvider at the same time.");if(t==null&&i==null)throw new Error("Either 'mapId' or 'map' must be specified in DefaultMapProvider.");return Ie.jsx(ru.Provider,{value:s,children:n})}function EC(){return vt.useContext(ru)}function MC(e){const t=wC(e),i=eC("map.MapRegistry"),n=sC(async()=>typeof t=="string"?await i.expectMapModel(t):Promise.resolve(t),[i,t]);return vt.useMemo(()=>n.loading?{kind:"loading"}:n.error?{kind:"rejected",error:n.error}:{kind:"resolved",map:n.value},[n])}function wC(e){if(typeof e=="object"&&e.mapId!=null&&e.map!=null)throw new Error("Cannot specify both 'mapId' and 'map' in useMapModel at the same time.");if(e instanceof $0)throw new Error("Map model instances cannot be passed directly to 'useMapModel' (see TypeScript signature).");const t=vt.useMemo(()=>e==null?{}:typeof e=="string"?{mapId:e}:{mapId:e.mapId,map:e.map},[...typeof e=="string"||e==null?[e]:[e.mapId,e.map]]),i=EC(),n=Kd(t)??Kd(i);if(n==null)throw new Error("No map specified. You must either specify the map (or its id) via a DefaultMapProvider parent or configure it explicitly.");return n}function Kd(e){return e?.map??e?.mapId}const xn=Ai("map:MapContainer");function ST(e){const{viewPadding:t,viewPaddingChangeBehavior:i,children:n,role:s,"aria-label":r,"aria-labelledby":a}=e,{containerProps:o}=X0("map-container",e),h=vt.useRef(null),l=vt.useRef(null),c=MC(e),u=c.map,[d,g]=vt.useState(!1);vt.useEffect(()=>{if(c.kind!=="loading"){if(c.kind==="rejected"){xn.error("Cannot display the map. Caused by ",c.error);return}if(!u){xn.error("No configuration available for the configured map.");return}if(h.current){const _=RC(u,h.current);return()=>_?.destroy()}}},[c,u]),vt.useEffect(()=>{g(!0)},[]);const f=vt.useMemo(()=>({height:"100%",position:"relative",[jl.definition]:t?.top!=null?t.top+"px":"0px",[Yl.definition]:t?.bottom!=null?t.bottom+"px":"0px",[Wl.definition]:t?.left!=null?t.left+"px":"0px",[Xl.definition]:t?.right!=null?t.right+"px":"0px"}),[t]);return Ie.jsxs(dl.div,{...o,role:s,"aria-label":r,"aria-labelledby":a,ref:h,style:f,tabIndex:0,children:[d&&u&&Ie.jsx(SC,{olMap:u.olMap,mapAnchorsHost:l.current,viewPadding:t,viewPaddingChangeBehavior:i,children:n}),Ie.jsx(dl.div,{ref:l,className:"map-anchors"})]})}function SC(e){const{olMap:t,mapAnchorsHost:i,viewPadding:n,viewPaddingChangeBehavior:s="preserve-center",children:r}=e,a=vt.useMemo(()=>({left:n?.left??0,right:n?.right??0,top:n?.top??0,bottom:n?.bottom??0}),[n]);vt.useEffect(()=>{const h=t?.getView();if(!t||!h)return;const l=h.getCenter(),c=TC(h.padding),u=CC(t,c);switch(h.padding=bC(a),s){case"preserve-center":h.animate({center:l,duration:300});break;case"preserve-extent":{u&&h.animate({center:l,resolution:h.getResolutionForExtent(u),duration:300});break}}},[a,t,s]);const o=vt.useMemo(()=>({mapAnchorsHost:i}),[i]);return Ie.jsx($R,{value:o,children:r})}function RC(e,t){const i=e.id,n=e.olMap;if(n.getTarget()){xn.error("Failed to display the map: the map already has a target. There may be more than one .");return}if(xn.isDebug()&&xn.debug(`Setting target of map '${i}':`,t),!("keyboardEventTarget_"in n))throw new Error("Internal error: failed to override keyboard event target. The property is no longer present.");n.keyboardEventTarget_=t,n.setTarget(t);let s=!1;return{destroy(){s||(xn.isDebug()&&xn.debug(`Removing target of map '${i}':`,t),n.keyboardEventTarget_=void 0,n.setTarget(void 0),s=!0)}}}function CC(e,t){const i=e.getSize();if(!i||i.length<2)return;const[n,s]=i,r=e.getCoordinateFromPixel([t.left,t.bottom]),a=e.getCoordinateFromPixel([Math.max(0,n-t.right),Math.max(0,s-t.top)]);if(!r||!a)return;const[o,h]=r,[l,c]=a;return[o,h,l,c]}function TC(e){return{top:e?.[0]??0,right:e?.[1]??0,bottom:e?.[2]??0,left:e?.[3]??0}}function bC(e){const{top:t,right:i,bottom:n,left:s}=e;return[t,i,n,s]}class IC extends Wg{constructor(t){t=t||{};const i=t.projection!==void 0?t.projection:"EPSG:3857",n=t.tileGrid!==void 0?t.tileGrid:Tv({extent:Uc(i),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:i,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const AC='© OpenStreetMap contributors.';class LC extends IC{constructor(t){t=t||{};let i;t.attributions!==void 0?i=t.attributions:i=[AC];const n=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",s=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:i,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:n,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:s,wrapX:t.wrapX,zDirection:t.zDirection})}}var Ia,sh,H0;class RT{constructor(t){N(this,sh);N(this,Ia);Y(this,Ia,t.references.interceptors.map((i,n)=>[t.referencesMeta.interceptors[n].serviceId,i]))}async fetch(t,i){const n=i?.signal??void 0,s=Object.assign({},i?.context),r=OC(i);hl(n);let a=PC(t);{const h={target:a,signal:n??new AbortController().signal,context:s,options:r};hl(n),await V(this,sh,H0).call(this,h),a=h.target}const o=new Request(a,{...r,signal:n});return await window.fetch(o)}}Ia=new WeakMap,sh=new WeakSet,H0=async function(t){const{signal:i}=t;for(const[n,s]of x(this,Ia))if(hl(i),s.beforeRequest)try{await s.beforeRequest(t)}catch(r){throw g_(r),new Error(`Interceptor '${n}' failed with an error`,{cause:r})}};function PC(e){return typeof e=="string"?new URL(e,window.location.href):e}function OC(e){const t=e?.method??"GET",i=new Headers(e?.headers??{}),n={...e,method:t,headers:i};for(const s in n)DC[s]&&delete n[s];return n}const DC={context:1,signal:1};function hl(e){e?.aborted&&__()}BR({"EPSG:25832":"+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs","EPSG:25833":"+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs"});const ll=Ai("map:createMapModel");async function FC(e,t,i){return await new NC(e,t,i).createMapModel()}class NC{mapId;mapConfig;httpService;constructor(t,i,n){this.mapId=t,this.mapConfig=i,this.httpService=n}async createMapModel(){const t=this.mapId,i=this.mapConfig,{view:n,...s}=i.advanced??{},r={...s};if(r.controls||(r.controls=[new c0({collapsible:!1})]),!r.interactions){const u=d=>{const g=d.originalEvent;return(g.metaKey||g.ctrlKey)&&g.shiftKey};r.interactions=m0({dragPan:!0,altShiftDragRotate:!1,pinchRotate:!1,mouseWheelZoom:!0}).extend([new _0({out:!0,condition:u})])}const a=await n??{};this.initializeViewOptions(a),r.view=a instanceof be?a:new be(a),!r.layers&&!i.layers&&(r.layers=[new zg({source:new LC})]);const o=i.initialView,h=o?.kind==="extent"?o.extent:void 0;ll.debug("Constructing OpenLayers map with options",r);const l=new qE(r),c=new $0({id:t,olMap:l,initialExtent:h,httpService:this.httpService});try{if(i.layers)for(const u of i.layers)c.layers.addLayer(u);return c}catch(u){throw c.destroy(),u}}initializeViewOptions(t){const i=this.mapId,n=this.mapConfig;if(t instanceof be){const a=o=>{ll.warn(`The advanced configuration for map id '${i}' has provided a fully constructed view instance: ${o} cannot be applied. +Use ViewOptions instead of a View instance.`)};n.projection!=null&&a("projection"),n.initialView!=null&&a("initialView");return}const s=t.projection=this.initializeProjection(n.projection),r=n.initialView;if(r)switch(r.kind){case"position":t.zoom=r.zoom,t.center=[r.center.x,r.center.y];break;case"extent":{const a=r.extent;t.zoom=0,t.center=[a.xMin+(a.xMax-a.xMin)/2,a.yMin+(a.yMax-a.yMin)/2];break}}else this.setViewDefaults(t,s)}setViewDefaults(t,i){if(t.center==null){const n=i.getExtent();n?t.center=Oe(n):ll.warn(`Cannot set default center coordinate because the current projection has no associated extent. +Try to configure 'initialView' explicity.`)}(t.zoom==null||t.resolution==null)&&(t.zoom=0)}initializeProjection(t){if(t==null)return Mt("EPSG:3857");const i=Mt(t);if(!i)throw new Error(`Failed to retrieve projection for code '${t}'.`);return i}}const cl=Ai("map:MapRegistry");var Aa,La,Hi,Ji,Pa,On,rh,J0;class CT{constructor({references:t}){N(this,rh);N(this,Aa);N(this,La,new Map);N(this,Hi,new Map);N(this,Ji,new Map);N(this,Pa,new WeakMap);N(this,On,!1);Y(this,Aa,t.httpService);const i=t.providers;for(const n of i)x(this,La).set(n.mapId,n)}destroy(){x(this,On)||(cl.info("Destroy map registry and all maps"),Y(this,On,!0),x(this,Hi).forEach(t=>{t.kind==="model"&&t.model.destroy()}),x(this,Hi).clear(),x(this,Ji).clear())}async getMapModel(t){if(x(this,On))throw new Error("MapRegistry has already been destroyed.");const i=x(this,Ji).get(t);if(i)return ul(await i);const n=x(this,Hi).get(t);if(n)return ul(n);const s=x(this,La).get(t);if(!s){cl.debug(`Failed to find a config provider for map id '${t}'.`);return}const r=V(this,rh,J0).call(this,t,s).catch(a=>{const h={kind:"error",error:new Error(`Failed to construct map '${t}'`,{cause:a})};return x(this,Ji).delete(t),x(this,Hi).set(t,h),h});return x(this,Ji).set(t,r),ul(await r)}async expectMapModel(t){const i=await this.getMapModel(t);if(!i)throw new Error(`No configuration available for map with id '${t}'.`);return i}getMapModelByRawInstance(t){return x(this,Pa).get(t)}}Aa=new WeakMap,La=new WeakMap,Hi=new WeakMap,Ji=new WeakMap,Pa=new WeakMap,On=new WeakMap,rh=new WeakSet,J0=async function(t,i){cl.info(`Creating map with id '${t}'`);const n=await i.getMapConfig(),s=await FC(t,n,x(this,Aa));if(x(this,On))throw s.destroy(),new Error("MapRegistry has been destroyed.");const r={kind:"model",model:s};return x(this,Hi).set(t,r),x(this,Ji).delete(t),x(this,Pa).set(s.olMap,s),r};function ul(e){if(e.kind==="error")throw e.error;return e.model}export{qC as $,Ks as A,te as B,Ba as C,wT as D,$x as E,Ii as F,Ao as G,RT as H,Nt as I,ti as J,Lf as K,Ti as L,CT as M,ce as N,LC as O,Qe as P,Jx as Q,Qx as R,aT as S,zg as T,a0 as U,be as V,wi as W,Wf as X,VC as Y,yg as Z,Ed as _,dE as a,_C as a$,KC as a0,jx as a1,xd as a2,s0 as a3,ut as a4,ao as a5,Bc as a6,Uc as a7,Tv as a8,Q as a9,Cg as aA,ir as aB,Yc as aC,YC as aD,ci as aE,jC as aF,pe as aG,rT as aH,It as aI,st as aJ,Kc as aK,ii as aL,Sh as aM,jc as aN,id as aO,lt as aP,Vs as aQ,qt as aR,Fe as aS,fh as aT,BC as aU,ku as aV,bo as aW,Wi as aX,zu as aY,X0 as aZ,Wc as a_,zc as aa,mE as ab,qs as ac,Q_ as ad,Wg as ae,Mt as af,ph as ag,fm as ah,Pv as ai,uh as aj,Ue as ak,dy as al,Hs as am,oy as an,li as ao,Ef as ap,Yr as aq,Bn as ar,qE as as,ur as at,Fc as au,Bv as av,vi as aw,Jt as ax,Dn as ay,gT as az,yE as b,Ci as b$,Ey as b0,zm as b1,Oe as b2,VR as b3,vh as b4,Xr as b5,Jl as b6,uT as b7,E1 as b8,wt as b9,FE as bA,jr as bB,Na as bC,lh as bD,F_ as bE,zC as bF,Vg as bG,pm as bH,ym as bI,UE as bJ,d0 as bK,kE as bL,Dv as bM,wv as bN,Js as bO,ng as bP,lT as bQ,ct as bR,Vr as bS,nT as bT,sT as bU,ig as bV,Ml as bW,iy as bX,Zf as bY,HC as bZ,mc as b_,oT as ba,hT as bb,vT as bc,Ya as bd,NE as be,_T as bf,yT as bg,OE as bh,Md as bi,Se as bj,re as bk,Cf as bl,Tt as bm,Lo as bn,WC as bo,pi as bp,El as bq,ei as br,uc as bs,Af as bt,ln as bu,_m as bv,dT as bw,XC as bx,ja as by,mT as bz,Lt as c,bf as c0,sy as c1,jf as c2,Fa as c3,f0 as c4,Rd as c5,Bi as c6,Du as c7,ch as c8,ys as c9,Vf as cA,cy as cB,ed as cC,Gv as cD,yc as cE,Ec as cF,Rt as ca,Fo as cb,ey as cc,Sf as cd,Ua as ce,nc as cf,qf as cg,Kf as ch,cT as ci,No as cj,td as ck,ry as cl,eT as cm,us as cn,Rf as co,$f as cp,$C as cq,ZC as cr,tT as cs,QC as ct,Nu as cu,fE as cv,ly as cw,JC as cx,iT as cy,Yf as cz,pr as d,_f as e,QR as f,xT as g,XR as h,MC as i,je as j,y_ as k,ST as l,ET as m,Nc as n,Ot as o,gt as p,Eh as q,$t as r,W as s,Mv as t,MT as u,Ye as v,k_ as w,Ut as x,ye as y,ec as z}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/Znh2j7vplK2r.js b/openlayers-base-packages/pr-previews/pr-377/assets/jI8ea5EYTjZP.js similarity index 82% rename from openlayers-base-packages/pr-previews/pr-377/assets/Znh2j7vplK2r.js rename to openlayers-base-packages/pr-previews/pr-377/assets/jI8ea5EYTjZP.js index 22c2c4e..f61b790 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/Znh2j7vplK2r.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/jI8ea5EYTjZP.js @@ -1 +1 @@ -import{a as v,j as e,B as m,S as f,V as w,r as y,b as d,f as k}from"./DbBkdn6FNbgs.js";import{t as z}from"./CFax2WnWeOWk.js";import{bM as S,bN as j,S as h,T as x,O as M,M as I,H as L,u as T,k as b,g as _,h as B,l as C,m as g,i as u}from"./DyxVjgSvwe-K.js";import{_ as A}from"./CmsKOCeNyeyo.js";import{B as P}from"./nEjnOjKmH1UU.js";import{T as p,U as E,a as c}from"./CL68Tre-iuri.js";import{F}from"./CwYOJLhODXKJ.js";import{F as R}from"./Ch2CPfq1SbGd.js";import"./CCXTS-icusD6.js";import"./35mnA9_wxNJd.js";import"./DnYPVZQRsXfx.js";class q extends S{constructor(a){const r=[-380316598427299e-8,880590808284866e-8],i=[4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.874056570353,76.4370282851763,38.2185141425881,19.1092570712941,9.55462853564703,4.77731426782352,2.38865713391176,1.19432856695588,.59716428347794],n=new Array(i.length);for(let t=0;tDatenquellen`})}}const s="main";class G{mapId=s;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new h({title:"OSM",isBaseLayer:!0,olLayer:new x({source:new M})})]}}}const O={"basemap-switcher-app":{name:"basemap-switcher-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:G,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:I,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:L,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}}},H=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',D=["en"];function U(o){switch(o){case"en":return A(()=>import("./BFyPnFni35WZ.js"),[],import.meta.url).then(a=>a.default)}throw new Error(`Unsupported locale: '${o}'`)}const W=v(H),N=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:U,locales:D,packages:O,styles:W},Symbol.toStringTag,{value:"Module"})),V="basemap-switcher-app",$=T.bind(void 0,V);function K(){const o=$();return e.jsx(b,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(_,{title:e.jsx(m,{textAlign:"center",py:1,children:e.jsx(B,{size:"md",children:"OpenLayers Base Packages - Basemap Switcher"})}),children:e.jsx(b,{flex:"1",direction:"column",position:"relative",children:e.jsxs(C,{mapId:s,children:[e.jsx(g,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsxs(m,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:[e.jsxs(F,{children:[e.jsx(R,{ps:1,children:e.jsx(p,{as:"b",children:o.formatMessage({id:"basemapLabel"})})}),e.jsx(P,{allowSelectingEmptyBasemap:!0,mapId:s})]}),e.jsxs(f,{pt:5,children:[e.jsx(p,{align:"center",children:"Test Controls:"}),e.jsx(Y,{mapId:s}),e.jsx(J,{mapId:s}),e.jsx(Q,{mapId:s})]})]})}),e.jsx(g,{position:"top-right",horizontalGap:10,verticalGap:10,children:e.jsxs(w,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[e.jsx(p,{as:"b",children:"Description"}),e.jsx(p,{children:"This application can be used to test the basemap switcher. The basemap switcher synchronizes with the state of the shared map model. If the map model is changed (for example, by changing the current basemap), the basemap switcher must update itself accordingly."}),e.jsxs(E,{children:[e.jsx(c,{children:"Adding a new basemap updates the dropdown menu (new option)"}),e.jsx(c,{children:"Changing the current basemap to another basemap updates the selected option"}),e.jsxs(c,{children:["Setting the current basemap to ","'undefined'"," also updates the selection"]})]})]})})]})})})})}function Y(o){const{mapId:a}=o,{map:r}=u(a),i=y.useRef(1),n=()=>{if(!r)return;const l=i.current++,t=new h({title:`New Layer ${l}`,isBaseLayer:!0,olLayer:new x({source:new q({layer:"web_grau"})})});r.layers.addLayer(t),console.log("generated base layer with id",t.id)};return e.jsx(d,{onClick:n,children:"Add base layer"})}function J(o){const{mapId:a}=o,{map:r}=u(a),i=()=>{if(!r)return;const n=r.layers.getAllLayers();if(n.length===0){console.error("There is no base layer");return}const l=Math.floor(Math.random()*n.length),t=n[l];if(!t){console.error("Failed to find a layer");return}console.log("activating base layer",t.id),r.layers.activateBaseLayer(t.id)};return e.jsx(d,{onClick:i,children:"Activate random base layer"})}function Q(o){const{mapId:a}=o,{map:r}=u(a),i=()=>{r&&(console.log("setting active base layer to undefined"),r.layers.activateBaseLayer(void 0))};return e.jsx(d,{onClick:i,children:"Clear base layer"})}const X=k({component:K,theme:z,appMetadata:N});customElements.define("basemap-switcher-app",X); +import{a as v,j as e,B as m,S as f,V as w,r as y,b as d,f as k}from"./B60Dx_GOYdnk.js";import{t as z}from"./DjS5-7IPlotu.js";import{bM as S,bN as j,S as h,T as x,O as M,M as I,H as L,u as T,k as b,g as _,h as B,l as C,m as g,i as u}from"./j0mck_Meu7Xh.js";import{_ as A}from"./CmsKOCeNyeyo.js";import{B as P}from"./DSjrbd_eKbZM.js";import{T as p,U as E,a as c}from"./BKR6R-cAnIXt.js";import{F}from"./vepZWq5kkQUw.js";import{F as R}from"./Dko_2nwYwIor.js";import"./BpQSjk0kyblh.js";import"./C9VJq5Ka7299.js";import"./2C0geDG_OBHU.js";class q extends S{constructor(a){const r=[-380316598427299e-8,880590808284866e-8],i=[4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.874056570353,76.4370282851763,38.2185141425881,19.1092570712941,9.55462853564703,4.77731426782352,2.38865713391176,1.19432856695588,.59716428347794],n=new Array(i.length);for(let t=0;tDatenquellen`})}}const s="main";class G{mapId=s;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new h({title:"OSM",isBaseLayer:!0,olLayer:new x({source:new M})})]}}}const O={"basemap-switcher-app":{name:"basemap-switcher-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:G,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:I,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:L,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},H=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',D=["en"];function U(o){switch(o){case"en":return A(()=>import("./BFyPnFni35WZ.js"),[],import.meta.url).then(a=>a.default)}throw new Error(`Unsupported locale: '${o}'`)}const W=v(H),N=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:U,locales:D,packages:O,styles:W},Symbol.toStringTag,{value:"Module"})),V="basemap-switcher-app",$=T.bind(void 0,V);function K(){const o=$();return e.jsx(b,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(_,{title:e.jsx(m,{textAlign:"center",py:1,children:e.jsx(B,{size:"md",children:"OpenLayers Base Packages - Basemap Switcher"})}),children:e.jsx(b,{flex:"1",direction:"column",position:"relative",children:e.jsxs(C,{mapId:s,children:[e.jsx(g,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsxs(m,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:[e.jsxs(F,{children:[e.jsx(R,{ps:1,children:e.jsx(p,{as:"b",children:o.formatMessage({id:"basemapLabel"})})}),e.jsx(P,{allowSelectingEmptyBasemap:!0,mapId:s})]}),e.jsxs(f,{pt:5,children:[e.jsx(p,{align:"center",children:"Test Controls:"}),e.jsx(Y,{mapId:s}),e.jsx(J,{mapId:s}),e.jsx(Q,{mapId:s})]})]})}),e.jsx(g,{position:"top-right",horizontalGap:10,verticalGap:10,children:e.jsxs(w,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[e.jsx(p,{as:"b",children:"Description"}),e.jsx(p,{children:"This application can be used to test the basemap switcher. The basemap switcher synchronizes with the state of the shared map model. If the map model is changed (for example, by changing the current basemap), the basemap switcher must update itself accordingly."}),e.jsxs(E,{children:[e.jsx(c,{children:"Adding a new basemap updates the dropdown menu (new option)"}),e.jsx(c,{children:"Changing the current basemap to another basemap updates the selected option"}),e.jsxs(c,{children:["Setting the current basemap to ","'undefined'"," also updates the selection"]})]})]})})]})})})})}function Y(o){const{mapId:a}=o,{map:r}=u(a),i=y.useRef(1),n=()=>{if(!r)return;const l=i.current++,t=new h({title:`New Layer ${l}`,isBaseLayer:!0,olLayer:new x({source:new q({layer:"web_grau"})})});r.layers.addLayer(t),console.log("generated base layer with id",t.id)};return e.jsx(d,{onClick:n,children:"Add base layer"})}function J(o){const{mapId:a}=o,{map:r}=u(a),i=()=>{if(!r)return;const n=r.layers.getAllLayers();if(n.length===0){console.error("There is no base layer");return}const l=Math.floor(Math.random()*n.length),t=n[l];if(!t){console.error("Failed to find a layer");return}console.log("activating base layer",t.id),r.layers.activateBaseLayer(t.id)};return e.jsx(d,{onClick:i,children:"Activate random base layer"})}function Q(o){const{mapId:a}=o,{map:r}=u(a),i=()=>{r&&(console.log("setting active base layer to undefined"),r.layers.activateBaseLayer(void 0))};return e.jsx(d,{onClick:i,children:"Clear base layer"})}const X=k({component:K,theme:z,appMetadata:N});customElements.define("basemap-switcher-app",X); diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/pazOBFR22sbz.js b/openlayers-base-packages/pr-previews/pr-377/assets/pazOBFR22sbz.js new file mode 100644 index 0000000..bea5204 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-377/assets/pazOBFR22sbz.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"showcase-app":{"header.title":"Component Showcase","ariaLabels.map":"Map. Use the arrow keys to move the map. Zoom in with the plus button and zoom out with the minus button.","demos.geolocation.title":"Geolocation","demos.geolocation.description":"This demo shows how to use the Geolocation tool to get the current position of the device.","demos.printing.title":"Printing","demos.printing.description":"This demo shows how to use the Printing component to export a screenshot of the map.","demos.spatialBookmarks.title":"Spatial Bookmarks","demos.spatialBookmarks.description":"This demo shows how to use the SpatialBookmarks component to save und load spatial bookmarks.","demos.overviewMap.title":"Overview map","demos.overviewMap.description":"This demo shows how to use the OverviewMap.","demos.mapNavigation.title":"Map navigation tools","demos.mapNavigation.description":"This demo shows how to use the map navigation tools: ZoomIn, ZoomOut, InitialExtent","demos.searchAndHighlight.title":"Search and Feature-Highlight","demos.searchAndHighlight.description":"This demo shows how to use the Search component and how features can be highlighted in the map.","demos.coordinateViewer.title":"Coordinate viewer","demos.coordinateViewer.description":"This demo shows how to use the CoordinateViewer component to show the coordinates at the users current mouse position.","demos.coordinateInput.title":"Coordinate input","demos.coordinateInput.description":"This demo shows how to use the CoordinateInput component to allow users to enter coordinates. The validation checks if the input is a valid coordinate for the selected projection.","demos.coordinateInput.cleared":"Input field cleared","demos.coordinateInput.entered":"Coordinate entered: {coordinates} in {projection}","demos.coordinateInput.placeholder":"Enter coordinate here","demos.coordinateInput.setInput":"Set input value","demos.coordinateSearch.title":"Coordinate search","demos.coordinateSearch.description":"This demo shows how to use the CoordinateSearch component to show the coordinates at the users current mouse position and to search for coordinates. It is possible to switch between different projections.","demos.coordinateSearch.cleared":"Input field cleared","demos.coordinateSearch.entered":"Coordinate entered: {coordinates} in {projection}","demos.scaleViewer.title":"Scale viewer","demos.scaleViewer.description":"This demo shows how to use the ScaleViewer component.","demos.scaleSetter.title":"Scale setter","demos.scaleSetter.description":"This demo shows how to use the ScaleSetter component to change the scale of the map.","demos.scaleBar.title":"Scale bar","demos.scaleBar.description":"This demo shows how to use the ScaleBar component.","demos.measurement.title":"Measurement","demos.measurement.description":"This demo shows how to use the Measurement component for measuring distances and areas. Measurement component for measuring distances and areas.","demos.tocLegend.title":"Toc, BasemapSwitcher and Legend","demos.tocLegend.description":"This demo shows how to use the Toc, BasemapSwitcher and Legend components to control the map content and to show the legend for the contents.","demos.tocLegend.tocTitle":"TOC","demos.tocLegend.legendTitle":"Legend","demos.selectionResultList.title":"Selection and Result List","demos.selectionResultList.description":"This demo shows how to use the Selection component to select feature in the map and how to use the ResultList component to display feature attributes in a table.","demos.editing.title":"Editing","demos.editing.description":"This demo shows how the API of the editing package can be used to provide editing functionality.","demos.editing.startCreateButton":"create feature","demos.editing.startUpdateButton":"update feature","demos.editing.stopButton":"stop editing","demos.editing.create.startTitle":"Editing - Create new feature","demos.editing.create.featureCreated":"Created feature with ID: {featureId}","demos.editing.update.startTitle":"Editing - Modify feature","demos.editing.update.featureModified":"Modified feature with ID: {featureId}","demos.editing.update.tooltip.select":"Select geometry to start editing","demos.editing.update.savingStared":"Feature is being saved...","demos.editing.activeInfo":"Status: editing active","demos.editing.inactiveInfo":"Status: editing inactive","demoSelection.label":"Demo:","demoSelection.notFound":"Demo ''{demoId}'' was not found.","localeSwitcher.label":"Language:","localeSwitcher.locale.de":"German","localeSwitcher.locale.en":"English"},"@open-pioneer/coordinate-search":{"coordinateInput.ariaLabel":"Coordinate input","coordinateInput.copyPlaceholder":"Copy","coordinateInput.clearPlaceholder":"Clear","tooltip.basic":"Invalid input","tooltip.space":"Invalid input: Please enter the coordinates seperated by a space.","tooltip.spaceOne":"Invalid input: Please use exactly one space to separate the coordinates.","tooltip.2coords":"Invalid input: Please enter two numbers.","tooltip.invalidNumbers":"Invalid input: Please enter two valid numbers.","tooltip.extent":"The coordinates are not in the bounds of the reference system. Please change the projection or coordinates.","tooltip.projection":"The projection is not working. Please change to another projection.","selected":"selected"},"@open-pioneer/editing":{"title":"Editing","create.tooltip.begin":"Click to start creating the geometry","create.tooltip.continue":"Double click to finish the geometry and save the feature","create.tooltip.deselect":"Click outside the geometry in the map to save changes"},"@open-pioneer/geolocation":{"locateNotSupported":"Geolocation is not supported.","locateMeStart":"Start geolocation","locateMeEnd":"Stop geolocation","error":"Error","permissionDenied":"Geolocation was canceled.","positionUnavailable":"Geolocation position cannot be determined.","timeout":"Geolocation was canceled due to timeout.","unknownError":"An unexpected error occurred during geolocation."},"@open-pioneer/legend":{"altLabel":"legend image for layer {layerName}","fallbackLabel":"legend not available","basemapLabel":"Basemap"},"@open-pioneer/map-navigation":{"initial-extent.title":"Zoom to initial extent","zoom-in.title":"Zoom in map","zoom-out.title":"Zoom out map","view-backward.title":"One map view back","view-forward.title":"One map view ahead"},"@open-pioneer/measurement":{"measurementLabel":"Mode","distance":"Distance","area":"Area","deleteMeasurementLabel":"Delete measurements","measurementInfoText":"Click in the map to start a measurement.","tooltips.help":"Click to start measuring.","tooltips.continue":"Double click to end the measurement."},"@open-pioneer/printing":{"title":"Title","fileFormat":"File format","export":"Export map","input.placeholder":"Enter title","printingMap":"Map is printing ...","printingFailed":"Failed to print the map."},"@open-pioneer/result-list":{"selectAllTooltip":"Select all","deSelectAllTooltip":"Deselect all","noDataMessage":"No data available","displayBoolean.true":"yes","displayBoolean.false":"no","ariaLabel.selectSingle":"Press space to select or deselect."},"@open-pioneer/scale-setter":{"button.ariaLabel":"Current scale: {scale}.","button.ariaDescription":"Press Enter to change the scale."},"@open-pioneer/search":{"noOptionsText":"No results found","loadingText":"Loading...","searchPlaceholder":"Search...","ariaLabel.search":"Search bar","ariaLabel.instructions":"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.","ariaLabel.searchFocus":"focused","ariaLabel.searchSelect":"selected","ariaLabel.searchClear":"cleared","ariaLabel.clearButton":"Empty the search"},"@open-pioneer/selection":{"selectMethod":"Select method","EXTENT":"Rechteck","POLYGON":"Polygon","FREEPOLYGON":"Freies Zeichnen","CIRCLE":"Kreis","selectSource":"Select source","tooltip":"Click on the map, hold down the mouse button and draw a rectangle","disabledTooltip":"The current selection source is not available","noSourceTooltip":"No selection source selected. Please choose a selection source to start.","sourceNotAvailable":"Source not available","selectionFailed":"Spatial selection failed","selectionPlaceholder":"No source selected","layerNotVisibleReason":"Matching layer is not visible.","selected":"selected"},"@open-pioneer/spatial-bookmarks":{"bookmark.button.create":"Add new bookmark","bookmark.button.deleteAll":"Delete all bookmarks","bookmark.button.deleteOne":"Delete bookmark","bookmark.button.save":"Save","bookmark.button.cancel":"Cancel","bookmark.button.cancelDelete":"No","bookmark.button.confirmDelete":"Yes","bookmark.input.label":"Name","bookmark.input.placeholder":"Enter bookmark name","bookmark.alert.create":"After entering a name you can save the new bookmark. The current map extent is used as the basis for the position.","bookmark.alert.delete":"Do you really want to delete all spatial bookmarks?","bookmark.alert.noSaved":"No bookmarks saved","bookmark.list.label":"Spatial bookmarks"},"@open-pioneer/toc":{"basemapsLabel":"Basemaps","descriptionLabel":"Layer description","operationalLayerLabel":"Operational layers","childgroupLabel":"Layer group {title}","missingLayers":"There are no layers to display.","group.expand":"Expand group {title}","group.collapse":"Collapse group {title}","error":"Error while creating map content.","layerNotAvailable":"Layer not available","toolsLabel":"Map tools","tools.hideAllLayers":"Hide all layers","tools.collapseAllGroups":"Collapse all groups"},"@open-pioneer/basemap-switcher":{"emptyBasemapLabel":"Without basemap","layerNotAvailable":"Layer not available","selected":"selected"}}`);export{e as default}; diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/zAWMMVSLb5Gc.js b/openlayers-base-packages/pr-previews/pr-377/assets/uQ1goSLJpXIo.js similarity index 96% rename from openlayers-base-packages/pr-previews/pr-377/assets/zAWMMVSLb5Gc.js rename to openlayers-base-packages/pr-previews/pr-377/assets/uQ1goSLJpXIo.js index 86736e5..ba3da62 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/zAWMMVSLb5Gc.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/uQ1goSLJpXIo.js @@ -1 +1 @@ -var w=o=>{throw TypeError(o)};var x=(o,e,t)=>e.has(o)||w("Cannot "+t);var i=(o,e,t)=>(x(o,e,"read from private field"),t?t.call(o):e.get(o)),m=(o,e,t)=>e.has(o)?w("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),c=(o,e,t,r)=>(x(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t);import{a as j,r as y,j as n,B as g,V as R,f as G}from"./DbBkdn6FNbgs.js";import{bO as T,at as A,bP as E,S as s,T as M,O,bM as W,bN as q,b as I,a as P,M as B,H,u as N,k as b,g as k,h as S,l as U,m as h}from"./DyxVjgSvwe-K.js";import{W as D,b as V}from"./CJwLdrVebURZ.js";import{G as C,e as F,T as K}from"./Djes_egHqOHx.js";import{_}from"./CmsKOCeNyeyo.js";import{T as z}from"./CL68Tre-iuri.js";import"./DnYPVZQRsXfx.js";import"./jRJMM4_GqJDc.js";import"./D8JwQmCkwKBk.js";import"./nEjnOjKmH1UU.js";import"./CCXTS-icusD6.js";import"./CwYOJLhODXKJ.js";import"./35mnA9_wxNJd.js";import"./B_KTQkWPSzAO.js";import"./DjAArQ67Dgmx.js";import"./Ca8Zt9kwahLC.js";import"./B6P_btgblpGb.js";var u;class $ extends T{constructor(t){const r=t.layers,p=new A({layers:r.map(l=>l.olLayer)});super({...t,olLayer:p});m(this,u);c(this,u,new J(r,this))}get type(){return"group"}get legend(){}get layers(){return i(this,u)}get sublayers(){}get olLayer(){return super.olLayer}__attachToMap(t){super.__attachToMap(t),this.layers.__getRawLayers().forEach(r=>r.__attachToMap(t))}}u=new WeakMap;var a,d;class J{constructor(e,t){m(this,a);m(this,d);e=e.slice();for(const r of e)if(r instanceof T)r.__attachToGroup(t);else throw new Error(`Layer '${r.id}' of group '${t.id}' does not implement abstract class '${E.name}`);c(this,a,e),c(this,d,t)}destroy(){for(const e of i(this,a))e.__detachFromGroup(),e.destroy();c(this,a,[])}getItems(e){return this.getLayers(e)}getLayers(e){return i(this,a).slice()}__getRawLayers(){return i(this,a)}__getParent(){return i(this,d)}}a=new WeakMap,d=new WeakMap;const L=$,f="main";class Y{mapId=f;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},projection:"EPSG:25832",layers:[new s({id:"topplus_open",title:"TopPlus Open",isBaseLayer:!0,visible:!0,healthCheck:"https://sgx.geodatenzentrum.de/wmts_topplus_openERROR/1.0.0/WMTSCapabilities.xml",olLayer:v("web")}),new s({id:"topplus_open_grau",title:"TopPlus Open (Grau)",isBaseLayer:!0,visible:!1,healthCheck:async()=>{function e(t){return new Promise(r=>setTimeout(r,t))}return await e(2e3),"error"},olLayer:v("web_grau")}),new s({id:"topplus_open_light",title:"TopPlus Open (Light)",isBaseLayer:!0,visible:!1,healthCheck:"https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml",olLayer:v("web_light")}),new s({title:"OSM",visible:!1,isBaseLayer:!0,olLayer:new M({source:new O})}),new L({id:"group_edu",title:"Bildung",layers:[new s({title:"Kindertagesstätten",id:"kitas",visible:!0,healthCheck:"https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml",olLayer:Q()}),X()]}),new L({title:"Verkehr",id:"group_transport",layers:[new s({title:"Haltestellen Stadt Rostock",id:"bustops",visible:!0,description:"Haltestellen des öffentlichen Personenverkehrs in der Hanse- und Universitätsstadt Rostock.",olLayer:Z()}),ee()]})]}}}function v(o){const e=[-380316598427299e-8,880590808284866e-8],t=[4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.874056570353,76.4370282851763,38.2185141425881,19.1092570712941,9.55462853564703,4.77731426782352,2.38865713391176,1.19432856695588,.59716428347794],r=new Array(t.length);for(let l=0;lDatenquellen`});return new M({source:p})}function Z(){const o=new I({url:"https://geo.sv.rostock.de/download/opendata/haltestellen/haltestellen.json",format:new C,attributions:"Haltestellen Stadt Rostock, Creative Commons CC Zero License (cc-zero)"});return new P({source:o})}function Q(){const o=new I({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new C,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'});return new P({source:o})}function X(){return new D({title:"Schulstandorte",id:"schools",description:"Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.",visible:!0,healthCheck:async()=>{function o(e){return new Promise(t=>setTimeout(t,e))}return await o(3e3),"error"},url:"https://www.wms.nrw.de/wms/wms_nw_inspire-schulen",sublayers:[{name:"US.education",title:"INSPIRE - WMS Schulstandorte NRW"}],sourceOptions:{ratio:1}})}function ee(){return new D({title:"Straßennetz Landesbetrieb Straßenbau NRW",url:"https://www.wms.nrw.de/wms/strassen_nrw_wms",sublayers:[{name:"1",title:"Verwaltungen"},{name:"4",title:"Abschnitte und Äste"},{name:"6",title:"Unfälle"}]})}const oe={"toc-map":{name:"toc-map",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Y,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:B,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:H,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},te=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',re=["en","de"];function ne(o){switch(o){case"en":return _(()=>import("./fVMMSzaG1pJC.js"),[],import.meta.url).then(e=>e.default);case"de":return _(()=>import("./Bo8AHkoDbcBT.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${o}'`)}const ae=j(te),le=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:ne,locales:re,packages:oe,styles:ae},Symbol.toStringTag,{value:"Module"})),ie="toc-map",se=N.bind(void 0,ie);function pe(){const o=se(),e=y.useId(),[t,r]=y.useState(!0);function p(){r(!t)}return n.jsx(b,{height:"100%",direction:"column",overflow:"hidden",children:n.jsx(k,{title:n.jsx(g,{role:"region","aria-label":o.formatMessage({id:"ariaLabel.header"}),textAlign:"center",py:1,children:n.jsx(S,{size:"md",children:"OpenLayers Base Packages - TOC and Health Check Sample"})}),children:n.jsx(b,{flex:"1",direction:"column",children:n.jsxs(U,{mapId:f,role:"main","aria-label":o.formatMessage({id:"ariaLabel.map"}),children:[n.jsx(h,{position:"top-left",horizontalGap:10,verticalGap:10,children:t&&n.jsx(g,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",width:350,children:t&&n.jsx(g,{role:"dialog","aria-labelledby":e,children:n.jsx(k,{title:n.jsx(S,{id:e,size:"md",mb:2,children:o.formatMessage({id:"tocTitle"})}),children:n.jsx(F,{mapId:f,showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0},collapsibleGroups:!0})})})})}),n.jsx(h,{position:"top-right",horizontalGap:10,verticalGap:10,children:n.jsxs(R,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[n.jsx(z,{as:"b",children:"Description"}),n.jsxs(z,{children:["This application can be used to test the TOC, including health checks for configured layers. Two base layers (",'"',"TopPlus Open",'"'," and ",'"',"TopPlus Open (Grau)",'"',") and one operational layer (",'"',"Schulstandorte",'"',") will be unavailable and should be marked as such by the UI."]})]})}),n.jsx(h,{position:"bottom-right",horizontalGap:10,verticalGap:45,children:n.jsx(b,{role:"toolbar","aria-label":o.formatMessage({id:"ariaLabel.toolbar"}),direction:"column",gap:1,padding:1,children:n.jsx(K,{label:o.formatMessage({id:"tocTitle"}),icon:n.jsx(V,{}),isActive:t,onClick:p})})})]})})})})}const ce=G({component:pe,appMetadata:le,async resolveConfig(o){const e=o.getAttribute("forced-locale");if(e)return{locale:e}}});customElements.define("toc-map-app",ce);const ue=document.getElementsByTagName("body")[0];de();function de(){const o=window.location.search,t=new URLSearchParams(o).get("lang"),r=document.createElement("toc-map-app");r.classList.add("full-height"),r.classList.add("app"),r.setAttribute("id","test"),t&&r.setAttribute("forced-locale",t),ue.appendChild(r)} +var w=o=>{throw TypeError(o)};var x=(o,e,t)=>e.has(o)||w("Cannot "+t);var i=(o,e,t)=>(x(o,e,"read from private field"),t?t.call(o):e.get(o)),m=(o,e,t)=>e.has(o)?w("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),c=(o,e,t,r)=>(x(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t);import{a as j,r as y,j as n,B as g,V as R,f as G}from"./B60Dx_GOYdnk.js";import{bO as T,at as A,bP as E,S as s,T as M,O,bM as W,bN as q,b as I,a as P,M as B,H,u as N,k as b,g as k,h as S,l as U,m as h}from"./j0mck_Meu7Xh.js";import{W as D,b as V}from"./BLfEaHvmX9OI.js";import{G as C,e as F,T as K}from"./CYroAbEI2PyD.js";import{_}from"./CmsKOCeNyeyo.js";import{T as z}from"./BKR6R-cAnIXt.js";import"./2C0geDG_OBHU.js";import"./BWf1FusGPLsb.js";import"./ajAX9OmvUsbZ.js";import"./DSjrbd_eKbZM.js";import"./BpQSjk0kyblh.js";import"./vepZWq5kkQUw.js";import"./C9VJq5Ka7299.js";import"./BXfBNJYYR7xb.js";import"./BlACKGYldMfy.js";import"./CMfwYEDRd35m.js";import"./CG5nmvkyugDn.js";var u;class $ extends T{constructor(t){const r=t.layers,p=new A({layers:r.map(l=>l.olLayer)});super({...t,olLayer:p});m(this,u);c(this,u,new J(r,this))}get type(){return"group"}get legend(){}get layers(){return i(this,u)}get sublayers(){}get olLayer(){return super.olLayer}__attachToMap(t){super.__attachToMap(t),this.layers.__getRawLayers().forEach(r=>r.__attachToMap(t))}}u=new WeakMap;var a,d;class J{constructor(e,t){m(this,a);m(this,d);e=e.slice();for(const r of e)if(r instanceof T)r.__attachToGroup(t);else throw new Error(`Layer '${r.id}' of group '${t.id}' does not implement abstract class '${E.name}`);c(this,a,e),c(this,d,t)}destroy(){for(const e of i(this,a))e.__detachFromGroup(),e.destroy();c(this,a,[])}getItems(e){return this.getLayers(e)}getLayers(e){return i(this,a).slice()}__getRawLayers(){return i(this,a)}__getParent(){return i(this,d)}}a=new WeakMap,d=new WeakMap;const L=$,f="main";class Y{mapId=f;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},projection:"EPSG:25832",layers:[new s({id:"topplus_open",title:"TopPlus Open",isBaseLayer:!0,visible:!0,healthCheck:"https://sgx.geodatenzentrum.de/wmts_topplus_openERROR/1.0.0/WMTSCapabilities.xml",olLayer:v("web")}),new s({id:"topplus_open_grau",title:"TopPlus Open (Grau)",isBaseLayer:!0,visible:!1,healthCheck:async()=>{function e(t){return new Promise(r=>setTimeout(r,t))}return await e(2e3),"error"},olLayer:v("web_grau")}),new s({id:"topplus_open_light",title:"TopPlus Open (Light)",isBaseLayer:!0,visible:!1,healthCheck:"https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml",olLayer:v("web_light")}),new s({title:"OSM",visible:!1,isBaseLayer:!0,olLayer:new M({source:new O})}),new L({id:"group_edu",title:"Bildung",layers:[new s({title:"Kindertagesstätten",id:"kitas",visible:!0,healthCheck:"https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml",olLayer:Q()}),X()]}),new L({title:"Verkehr",id:"group_transport",layers:[new s({title:"Haltestellen Stadt Rostock",id:"bustops",visible:!0,description:"Haltestellen des öffentlichen Personenverkehrs in der Hanse- und Universitätsstadt Rostock.",olLayer:Z()}),ee()]})]}}}function v(o){const e=[-380316598427299e-8,880590808284866e-8],t=[4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.874056570353,76.4370282851763,38.2185141425881,19.1092570712941,9.55462853564703,4.77731426782352,2.38865713391176,1.19432856695588,.59716428347794],r=new Array(t.length);for(let l=0;lDatenquellen`});return new M({source:p})}function Z(){const o=new I({url:"https://geo.sv.rostock.de/download/opendata/haltestellen/haltestellen.json",format:new C,attributions:"Haltestellen Stadt Rostock, Creative Commons CC Zero License (cc-zero)"});return new P({source:o})}function Q(){const o=new I({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new C,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'});return new P({source:o})}function X(){return new D({title:"Schulstandorte",id:"schools",description:"Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.",visible:!0,healthCheck:async()=>{function o(e){return new Promise(t=>setTimeout(t,e))}return await o(3e3),"error"},url:"https://www.wms.nrw.de/wms/wms_nw_inspire-schulen",sublayers:[{name:"US.education",title:"INSPIRE - WMS Schulstandorte NRW"}],sourceOptions:{ratio:1}})}function ee(){return new D({title:"Straßennetz Landesbetrieb Straßenbau NRW",url:"https://www.wms.nrw.de/wms/strassen_nrw_wms",sublayers:[{name:"1",title:"Verwaltungen"},{name:"4",title:"Abschnitte und Äste"},{name:"6",title:"Unfälle"}]})}const oe={"toc-map":{name:"toc-map",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Y,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:B,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:H,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},te=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',re=["en","de"];function ne(o){switch(o){case"en":return _(()=>import("./fVMMSzaG1pJC.js"),[],import.meta.url).then(e=>e.default);case"de":return _(()=>import("./Bo8AHkoDbcBT.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${o}'`)}const ae=j(te),le=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:ne,locales:re,packages:oe,styles:ae},Symbol.toStringTag,{value:"Module"})),ie="toc-map",se=N.bind(void 0,ie);function pe(){const o=se(),e=y.useId(),[t,r]=y.useState(!0);function p(){r(!t)}return n.jsx(b,{height:"100%",direction:"column",overflow:"hidden",children:n.jsx(k,{title:n.jsx(g,{role:"region","aria-label":o.formatMessage({id:"ariaLabel.header"}),textAlign:"center",py:1,children:n.jsx(S,{size:"md",children:"OpenLayers Base Packages - TOC and Health Check Sample"})}),children:n.jsx(b,{flex:"1",direction:"column",children:n.jsxs(U,{mapId:f,role:"main","aria-label":o.formatMessage({id:"ariaLabel.map"}),children:[n.jsx(h,{position:"top-left",horizontalGap:10,verticalGap:10,children:t&&n.jsx(g,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",width:350,children:t&&n.jsx(g,{role:"dialog","aria-labelledby":e,children:n.jsx(k,{title:n.jsx(S,{id:e,size:"md",mb:2,children:o.formatMessage({id:"tocTitle"})}),children:n.jsx(F,{mapId:f,showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0},collapsibleGroups:!0})})})})}),n.jsx(h,{position:"top-right",horizontalGap:10,verticalGap:10,children:n.jsxs(R,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[n.jsx(z,{as:"b",children:"Description"}),n.jsxs(z,{children:["This application can be used to test the TOC, including health checks for configured layers. Two base layers (",'"',"TopPlus Open",'"'," and ",'"',"TopPlus Open (Grau)",'"',") and one operational layer (",'"',"Schulstandorte",'"',") will be unavailable and should be marked as such by the UI."]})]})}),n.jsx(h,{position:"bottom-right",horizontalGap:10,verticalGap:45,children:n.jsx(b,{role:"toolbar","aria-label":o.formatMessage({id:"ariaLabel.toolbar"}),direction:"column",gap:1,padding:1,children:n.jsx(K,{label:o.formatMessage({id:"tocTitle"}),icon:n.jsx(V,{}),isActive:t,onClick:p})})})]})})})})}const ce=G({component:pe,appMetadata:le,async resolveConfig(o){const e=o.getAttribute("forced-locale");if(e)return{locale:e}}});customElements.define("toc-map-app",ce);const ue=document.getElementsByTagName("body")[0];de();function de(){const o=window.location.search,t=new URLSearchParams(o).get("lang"),r=document.createElement("toc-map-app");r.classList.add("full-height"),r.classList.add("app"),r.setAttribute("id","test"),t&&r.setAttribute("forced-locale",t),ue.appendChild(r)} diff --git a/openlayers-base-packages/pr-previews/pr-377/assets/CwYOJLhODXKJ.js b/openlayers-base-packages/pr-previews/pr-377/assets/vepZWq5kkQUw.js similarity index 60% rename from openlayers-base-packages/pr-previews/pr-377/assets/CwYOJLhODXKJ.js rename to openlayers-base-packages/pr-previews/pr-377/assets/vepZWq5kkQUw.js index b5aec4f..f882c82 100644 --- a/openlayers-base-packages/pr-previews/pr-377/assets/CwYOJLhODXKJ.js +++ b/openlayers-base-packages/pr-previews/pr-377/assets/vepZWq5kkQUw.js @@ -1 +1 @@ -import{J as T,h as k,u as $,o as w,m as H,j as y,g as q,r as d,N as g,p as c,a4 as p,O as I}from"./DbBkdn6FNbgs.js";const[A,E]=T({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[M,O]=T({strict:!1,name:"FormControlContext"});function J(l){const{id:e,isRequired:i,isInvalid:s,isDisabled:t,isReadOnly:o,...u}=l,f=d.useId(),r=e||`field-${f}`,b=`${r}-label`,F=`${r}-feedback`,x=`${r}-helptext`,[C,m]=d.useState(!1),[S,R]=d.useState(!1),[h,P]=d.useState(!1),j=d.useCallback((a={},n=null)=>({id:x,...a,ref:g(n,v=>{v&&R(!0)})}),[x]),N=d.useCallback((a={},n=null)=>({...a,ref:n,"data-focus":c(h),"data-disabled":c(t),"data-invalid":c(s),"data-readonly":c(o),id:a.id!==void 0?a.id:b,htmlFor:a.htmlFor!==void 0?a.htmlFor:r}),[r,t,h,s,o,b]),_=d.useCallback((a={},n=null)=>({id:F,...a,ref:g(n,v=>{v&&m(!0)}),"aria-live":"polite"}),[F]),D=d.useCallback((a={},n=null)=>({...a,...u,ref:n,role:"group","data-focus":c(h),"data-disabled":c(t),"data-invalid":c(s),"data-readonly":c(o)}),[u,t,h,s,o]),B=d.useCallback((a={},n=null)=>({...a,ref:n,role:"presentation","aria-hidden":!0,children:a.children||"*"}),[]);return{isRequired:!!i,isInvalid:!!s,isReadOnly:!!o,isDisabled:!!t,isFocused:!!h,onFocus:()=>P(!0),onBlur:()=>P(!1),hasFeedbackText:C,setHasFeedbackText:m,hasHelpText:S,setHasHelpText:R,id:r,labelId:b,feedbackId:F,helpTextId:x,htmlProps:u,getHelpTextProps:j,getErrorMessageProps:_,getRootProps:D,getLabelProps:N,getRequiredIndicatorProps:B}}const L=k(function(e,i){const s=$("Form",e),t=w(e),{getRootProps:o,htmlProps:u,...f}=J(t),r=H("chakra-form-control",e.className);return y.jsx(M,{value:f,children:y.jsx(A,{value:s,children:y.jsx(q.div,{...o({},i),className:r,__css:s.container})})})});L.displayName="FormControl";const z=k(function(e,i){const s=O(),t=E(),o=H("chakra-form__helper-text",e.className);return y.jsx(q.div,{...s?.getHelpTextProps(e,i),__css:t.helperText,className:o})});z.displayName="FormHelperText";function Q(l){const{isDisabled:e,isInvalid:i,isReadOnly:s,isRequired:t,...o}=G(l);return{...o,disabled:e,readOnly:s,required:t,"aria-invalid":p(i),"aria-required":p(t),"aria-readonly":p(s)}}function G(l){const e=O(),{id:i,disabled:s,readOnly:t,required:o,isRequired:u,isInvalid:f,isReadOnly:r,isDisabled:b,onFocus:F,onBlur:x,...C}=l,m=l["aria-describedby"]?[l["aria-describedby"]]:[];return e?.hasFeedbackText&&e?.isInvalid&&m.push(e.feedbackId),e?.hasHelpText&&m.push(e.helpTextId),{...C,"aria-describedby":m.join(" ")||void 0,id:i??e?.id,isDisabled:s??b??e?.isDisabled,isReadOnly:t??r??e?.isReadOnly,isRequired:o??u??e?.isRequired,isInvalid:f??e?.isInvalid,onFocus:I(e?.onFocus,F),onBlur:I(e?.onBlur,x)}}export{L as F,O as a,E as b,G as c,Q as u}; +import{k as I,h as T,u as $,o as w,l as H,j as y,g as q,r as d,P as g,t as c,a6 as p,Q as k}from"./B60Dx_GOYdnk.js";const[A,E]=I({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[M,S]=I({strict:!1,name:"FormControlContext"});function L(l){const{id:e,isRequired:i,isInvalid:s,isDisabled:t,isReadOnly:o,...u}=l,f=d.useId(),r=e||`field-${f}`,b=`${r}-label`,F=`${r}-feedback`,x=`${r}-helptext`,[C,m]=d.useState(!1),[O,R]=d.useState(!1),[h,P]=d.useState(!1),j=d.useCallback((a={},n=null)=>({id:x,...a,ref:g(n,v=>{v&&R(!0)})}),[x]),_=d.useCallback((a={},n=null)=>({...a,ref:n,"data-focus":c(h),"data-disabled":c(t),"data-invalid":c(s),"data-readonly":c(o),id:a.id!==void 0?a.id:b,htmlFor:a.htmlFor!==void 0?a.htmlFor:r}),[r,t,h,s,o,b]),D=d.useCallback((a={},n=null)=>({id:F,...a,ref:g(n,v=>{v&&m(!0)}),"aria-live":"polite"}),[F]),N=d.useCallback((a={},n=null)=>({...a,...u,ref:n,role:"group","data-focus":c(h),"data-disabled":c(t),"data-invalid":c(s),"data-readonly":c(o)}),[u,t,h,s,o]),B=d.useCallback((a={},n=null)=>({...a,ref:n,role:"presentation","aria-hidden":!0,children:a.children||"*"}),[]);return{isRequired:!!i,isInvalid:!!s,isReadOnly:!!o,isDisabled:!!t,isFocused:!!h,onFocus:()=>P(!0),onBlur:()=>P(!1),hasFeedbackText:C,setHasFeedbackText:m,hasHelpText:O,setHasHelpText:R,id:r,labelId:b,feedbackId:F,helpTextId:x,htmlProps:u,getHelpTextProps:j,getErrorMessageProps:D,getRootProps:N,getLabelProps:_,getRequiredIndicatorProps:B}}const Q=T(function(e,i){const s=$("Form",e),t=w(e),{getRootProps:o,htmlProps:u,...f}=L(t),r=H("chakra-form-control",e.className);return y.jsx(M,{value:f,children:y.jsx(A,{value:s,children:y.jsx(q.div,{...o({},i),className:r,__css:s.container})})})});Q.displayName="FormControl";const z=T(function(e,i){const s=S(),t=E(),o=H("chakra-form__helper-text",e.className);return y.jsx(q.div,{...s?.getHelpTextProps(e,i),__css:t.helperText,className:o})});z.displayName="FormHelperText";function K(l){const{isDisabled:e,isInvalid:i,isReadOnly:s,isRequired:t,...o}=G(l);return{...o,disabled:e,readOnly:s,required:t,"aria-invalid":p(i),"aria-required":p(t),"aria-readonly":p(s)}}function G(l){const e=S(),{id:i,disabled:s,readOnly:t,required:o,isRequired:u,isInvalid:f,isReadOnly:r,isDisabled:b,onFocus:F,onBlur:x,...C}=l,m=l["aria-describedby"]?[l["aria-describedby"]]:[];return e?.hasFeedbackText&&e?.isInvalid&&m.push(e.feedbackId),e?.hasHelpText&&m.push(e.helpTextId),{...C,"aria-describedby":m.join(" ")||void 0,id:i??e?.id,isDisabled:s??b??e?.isDisabled,isReadOnly:t??r??e?.isReadOnly,isRequired:o??u??e?.isRequired,isInvalid:f??e?.isInvalid,onFocus:k(e?.onFocus,F),onBlur:k(e?.onBlur,x)}}export{Q as F,S as a,E as b,G as c,K as u}; diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/experimental-sidebar/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/experimental-sidebar/index.html index aa07767..8d9d39c 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/experimental-sidebar/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/experimental-sidebar/index.html @@ -16,14 +16,14 @@ max-height: 100%; } - - - - + + + + - - - + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/map-sample/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/map-sample/index.html index f6148ca..983b3f1 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/map-sample/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/map-sample/index.html @@ -17,31 +17,31 @@ overflow: hidden; } - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/ogc-api-sample/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/ogc-api-sample/index.html index f76762c..bbb420f 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/ogc-api-sample/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/ogc-api-sample/index.html @@ -16,24 +16,24 @@ max-height: 100%; } - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/showcase/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/showcase/index.html index bf7f285..33e67a6 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/showcase/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/showcase/index.html @@ -17,30 +17,30 @@ overflow: hidden; } - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - + + + + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/test-basemap-switcher/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/test-basemap-switcher/index.html index 0df5269..cf85a20 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/test-basemap-switcher/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/test-basemap-switcher/index.html @@ -16,18 +16,18 @@ max-height: 100%; } - - - - + + + + - - - - - - - + + + + + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/test-highlight-and-zoom/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/test-highlight-and-zoom/index.html index fbd8cda..2762273 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/test-highlight-and-zoom/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/test-highlight-and-zoom/index.html @@ -16,14 +16,14 @@ max-height: 100%; } - - - - - - - - + + + + + + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/test-menu-fix/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/test-menu-fix/index.html index ea46831..0acfc42 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/test-menu-fix/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/test-menu-fix/index.html @@ -11,14 +11,14 @@ margin: 0px; } - - - - - - - - + + + + + + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/test-printing-api/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/test-printing-api/index.html index 9986678..1bfe561 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/test-printing-api/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/test-printing-api/index.html @@ -16,15 +16,15 @@ max-height: 100%; } - - - - + + + + - - - - + + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/test-result-list/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/test-result-list/index.html index 9bc35fa..9a3636f 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/test-result-list/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/test-result-list/index.html @@ -16,20 +16,20 @@ max-height: 100%; } - - - - + + + + - - - - - - - - - + + + + + + + + + diff --git a/openlayers-base-packages/pr-previews/pr-377/samples/test-toc/index.html b/openlayers-base-packages/pr-previews/pr-377/samples/test-toc/index.html index 2ce7edd..ba4d2b9 100644 --- a/openlayers-base-packages/pr-previews/pr-377/samples/test-toc/index.html +++ b/openlayers-base-packages/pr-previews/pr-377/samples/test-toc/index.html @@ -17,23 +17,23 @@ overflow: hidden; } - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +