@geoimpact/sep-map-sdk 1.0.31 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2716,11 +2716,25 @@ interface EventMap {
2716
2716
  polygon: GeoJSON.Polygon;
2717
2717
  addresses: Address[];
2718
2718
  };
2719
+ /**
2720
+ * A recoverable error occurred. `status` is the HTTP status code when the
2721
+ * error originated from an API request (e.g. 401/403 for auth failures).
2722
+ */
2719
2723
  error: {
2720
2724
  type: string;
2721
2725
  message: string;
2726
+ status?: number;
2722
2727
  error?: Error;
2723
2728
  };
2729
+ /**
2730
+ * Emitted when an API request fails with 401 or 403 (expired/invalid token or
2731
+ * insufficient permissions). Lets the host app redirect to login. Also emitted
2732
+ * alongside the corresponding `error` event.
2733
+ */
2734
+ unauthorized: {
2735
+ status: number;
2736
+ message: string;
2737
+ };
2724
2738
  languageChanged: {
2725
2739
  locale: SupportedLocale;
2726
2740
  };
@@ -11,14 +11,14 @@ return F.jsx("div",{className:"sep-search-results",children:/* @__PURE__ */F.jsx
11
11
  /* @__PURE__ */F.jsx("span",{children:u("search.error")})]})});if(0===e.length)/* @__PURE__ */
12
12
  return F.jsx("div",{className:"sep-search-results",children:/* @__PURE__ */F.jsx("div",{className:"sep-search-status sep-search-status--empty",children:u("search.noResults")})});let g=0;const _=e.length>1;/* @__PURE__ */
13
13
  return F.jsx("div",{ref:d,className:"sep-search-results",role:"listbox",children:e.map(e=>/* @__PURE__ */F.jsxs("div",{className:"sep-search-group",children:[_&&/* @__PURE__ */F.jsxs("div",{className:"sep-search-group__header",children:[e.label," (",e.items.length,")"]}),e.items.map((t,i)=>{const r=g++,o=r===n;/* @__PURE__ */
14
- return F.jsx("div",{ref:o?p:void 0,children:/* @__PURE__ */F.jsx(ii,{groupItem:t,isHighlighted:o,onClick:()=>m(t),onMouseEnter:()=>c(r),renderChip:f})},((e,t,i)=>{switch(t.kind){case"address":return`${e.id}-addr-${t.data.id}`;case"perimeter":return`${e.id}-perim-${t.data.id}`;case"municipality":return`${e.id}-muni-${t.data.label}`;case"region":return`${e.id}-region-${i}-${t.data.swissZipCode}-${t.data.town}`;case"parcel":return`${e.id}-parcel-${i}`;case"custom":return`${e.id}-custom-${t.data.id}-${i}`}})(e,t,i))})]},e.id))})}),ri=k.forwardRef(function({onSelect:e,onPerimeterSelect:t,onMunicipalitySelect:i,onRegionSelect:n,onCustomResultSelect:r,onSearchClear:o,placement:a="top-left",externalContainer:s,placeholder:l,className:c="",includePerimeters:u=!0,autoFocus:h=!1,value:d,onChange:p,style:f},m){const{t:g}=Pt(),_=k.useRef(null),y=k.useRef(null),v=k.useRef(""),{query:b,setQuery:x,resultGroups:w,isLoading:T,error:S,isOpen:P,highlightedIndex:C,clear:E,open:M,close:I,highlightNext:z,highlightPrev:A,selectHighlighted:L,totalResults:D,flatResults:R,showPrefetchedResults:O,hasPrefetchedData:B,setHighlightedIndex:N}=function(e={}){const{debounceMs:t=300,minQueryLength:i=2,includePerimeters:n=!0}=e,{services:r,config:o,t:a}=Tt(),[s,l]=k.useState(""),[c,u]=k.useState([]),[h,d]=k.useState(!1),[p,f]=k.useState(null),[m,g]=k.useState(!1),[_,y]=k.useState(-1),v=k.useRef(null),b=k.useRef(null);k.useEffect(()=>()=>{v.current&&clearTimeout(v.current),b.current?.abort()},[]);const x=k.useMemo(()=>function(e){const t=[];for(const i of e)for(const e of i.items)switch(e.kind){case"address":t.push({type:"address",item:e.data});break;case"perimeter":t.push({type:"perimeter",item:e.data});break;case"municipality":t.push({type:"municipality",item:e.data});break;case"parcel":t.push({type:"parcel",item:e.data});break;case"region":t.push({type:"region",item:e.data});break;case"custom":t.push({type:"custom",item:e.data,endpointId:e.endpointId})}return t}(c),[c]),w=x.length;k.useEffect(()=>{o.features?.search?.prefetchPerimeters&&o.features.perimeterSelection&&r.perimeter.getAll().catch(console.error)},[o.features?.search?.prefetchPerimeters,o.features?.perimeterSelection,r.perimeter]),k.useEffect(()=>{const e=o.features?.search?.customSearchTypes??[];for(const t of e)t.prefetch&&!1!==t.enabled&&r.customSearch.fetchAll(t).catch(console.error)},[o.features?.search?.customSearchTypes,r.customSearch]);const T=k.useCallback(async e=>{if(b.current?.abort(),e.length<i){f(null);const t=!(!o.features?.search?.prefetchPerimeters||!o.features?.perimeterSelection),i=(o.features?.search?.customSearchTypes??[]).filter(e=>e.prefetch&&!1!==e.enabled),n=i.length>0;if(t||n)try{const n=t?await r.perimeter.getAll():[],s={};for(const t of i){const i=r.customSearch.searchLocal(t.id,e);i.length>0&&(s[t.id]=i)}if(n.length>0||Object.keys(s).length>0){const e=Mt([],[],[],n,[],s,kt(o.features?.search),i,a);return u(e),void g(!0)}}catch{}return u([]),void g(!1)}b.current=new AbortController;const t=b.current.signal;d(!0),f(null),y(-1);const s=o.features?.search,l=kt(s);try{const c=[],h=[],d={signal:t,districts:s?.districts};for(const t of l)switch(t.type){case"address":c.push(r.address.search(e,d)),h.push("address");break;case"address-advanced":c.push(r.address.searchAdvanced(e,d)),h.push("address-advanced");break;case"parcel":c.push(r.address.searchParcel(e,d)),h.push("parcel");break;case"region-town":c.push(r.address.searchTown(e,d)),h.push("region-town");break;case"region-plz":c.push(r.address.searchPostalCode(e,d)),h.push("region-plz");break;case"municipality":c.push(r.municipality.search(e,d)),h.push("municipality");break;case"perimeter":n&&o.features?.perimeterSelection&&(c.push(r.perimeter.search(e)),h.push("perimeter"))}const p=(s?.customSearchTypes??[]).filter(e=>!1!==e.enabled);for(const n of p){const o=n.minQueryLength??i;e.length>=o&&(n.prefetch?c.push(Promise.resolve(r.customSearch.searchLocal(n.id,e))):c.push(r.customSearch.search(n,e,t)),h.push(`custom:${n.id}`))}const f=await Promise.allSettled(c);if(t.aborted)return;const m=[],_=[],y=[],v=[],b=[],x={};f.forEach((e,t)=>{if("rejected"===e.status){const t=e.reason;return void(t instanceof Error&&t.name)}const i=e.value,n=h[t];if(n.startsWith("custom:")){const e=n.substring(7);x[e]=i}else switch(n){case"address":case"address-advanced":m.push(...i);break;case"parcel":_.push(...i);break;case"region-town":case"region-plz":y.push(...i);break;case"perimeter":v.push(...i);break;case"municipality":b.push(...i)}});const w=Mt(m,_,y,v,b,x,l,p,a);u(w),g(!0)}catch(c){if(c instanceof Error&&"AbortError"===c.name)return;f(c instanceof Error?c.message:"Search failed"),u([])}finally{b.current?.signal.aborted||d(!1)}},[r,o.features,n,i,a]),S=k.useCallback(e=>new Promise(i=>{v.current&&clearTimeout(v.current),v.current=setTimeout(async()=>{await T(e),i()},t)}),[T,t]),P=k.useCallback((e,t)=>{if(t?.silent)return v.current&&(clearTimeout(v.current),v.current=null),b.current?.abort(),l(e),f(null),u([]),g(!1),void y(-1);l(e),S(e)},[S]),C=k.useCallback(()=>{l(""),u([]),f(null),g(!1),y(-1),b.current?.abort()},[]),E=k.useCallback(()=>{(c.length>0||s.length>=i)&&g(!0)},[c,s,i]),M=k.useCallback(async()=>{const e=!(!o.features?.search?.prefetchPerimeters||!o.features?.perimeterSelection),t=(o.features?.search?.customSearchTypes??[]).filter(e=>e.prefetch&&!1!==e.enabled),i=t.length>0;if(e||i){d(!0),g(!0);try{const i=e?await r.perimeter.getAll():[],n={};for(const e of t){const t=r.customSearch.searchLocal(e.id,"");t.length>0&&(n[e.id]=t)}if(i.length>0||Object.keys(n).length>0){const e=Mt([],[],[],i,[],n,kt(o.features?.search),t,a);u(e)}else g(!1),u([])}catch(n){g(!1),u([])}finally{d(!1)}}},[r.perimeter,r.customSearch,o.features?.search,o.features?.perimeterSelection,a]),I=!!(o.features?.search?.prefetchPerimeters&&o.features?.perimeterSelection||(o.features?.search?.customSearchTypes??[]).some(e=>e.prefetch&&!1!==e.enabled)),z=k.useCallback(()=>{g(!1),y(-1)},[]),A=k.useCallback(()=>{0!==x.length&&y(e=>{const t=e+1;return t>=x.length?0:t})},[x]),L=k.useCallback(()=>{0!==x.length&&y(e=>{const t=e-1;return t<0?x.length-1:t})},[x]),D=k.useCallback(()=>_<0||_>=x.length?null:x[_].item,[x,_]);return{query:s,resultGroups:c,isLoading:h,error:p,isOpen:m,highlightedIndex:_,setHighlightedIndex:y,setQuery:P,search:T,clear:C,open:E,close:z,showPrefetchedResults:M,hasPrefetchedData:I,highlightNext:A,highlightPrev:L,selectHighlighted:D,totalResults:w,flatResults:x}}({includePerimeters:u});k.useImperativeHandle(m,()=>({setQuery:(e,t)=>{x(e,t),_.current&&(_.current.value=e)}}),[x]);const j=void 0!==d,V=j?d:b,U=k.useCallback(e=>{const t=e.target.value,i=v.current;j&&p?.(t),x(t),i.length>0&&0===t.length&&o?.(),v.current=t},[j,p,x,o]),Z=k.useCallback(()=>{B&&V.length<2?O():(V.length>=2||w.length>0)&&M()},[V,w,M,B,O]);k.useEffect(()=>{const e=e=>{if(!y.current)return;e.composedPath().includes(y.current)||I()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[I]),k.useEffect(()=>{h&&_.current&&_.current.focus()},[h]);const G=k.useCallback(t=>{j?p?.(t.label):x(t.label),I(),e(t),_.current?.blur()},[j,p,x,I,e]),q=k.useCallback(e=>{j?p?.(e.name):x(e.name),I(),t?.(e),_.current?.blur()},[j,p,x,I,t]),$=k.useCallback(e=>{j?p?.(e.label):x(e.label),I(),i?.(e),_.current?.blur()},[j,p,x,I,i]),H=k.useCallback(e=>{const t=[e.swissZipCode||"",e.town||""].filter(Boolean).join(" ");j?p?.(t):x(t),I(),n?.(e),_.current?.blur()},[j,p,x,I,n]),W=k.useCallback((e,t)=>{const i=t.label||"";j?p?.(i):x(i),I(),r?.(e,t),_.current?.blur()},[j,p,x,I,r]),X=k.useCallback(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),!P&&V.length>=2?M():z();break;case"ArrowUp":e.preventDefault(),A();break;case"Enter":if(e.preventDefault(),P&&C>=0){const e=L();if(e){const t=R[C];"custom"===t.type?W(t.endpointId,e):"address"===t.type?G(e):"region"===t.type?H(e):"municipality"===t.type?$(e):q(e)}}break;case"Escape":e.preventDefault(),P?I():(E(),_.current?.blur());break;case"Tab":I()}},[P,V,C,M,I,E,z,A,L,R,G,q,$,H,W]),Y=k.useCallback(()=>{j&&p?.(""),B?(x(""),O()):E(),o?.(),v.current="",_.current?.focus()},[j,p,B,x,O,E,o]),K=k.useCallback(e=>{N(e)},[N]),Q="external"!==a?`sep-search--${a}`:"sep-search--external",J=T||S||w.length>0,ee=/* @__PURE__ */F.jsxs("div",{ref:y,className:`sep-search ${Q} ${c}`.trim(),style:f,role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-owns":"sep-search-results",children:[
14
+ return F.jsx("div",{ref:o?p:void 0,children:/* @__PURE__ */F.jsx(ii,{groupItem:t,isHighlighted:o,onClick:()=>m(t),onMouseEnter:()=>c(r),renderChip:f})},((e,t,i)=>{switch(t.kind){case"address":return`${e.id}-addr-${t.data.id}`;case"perimeter":return`${e.id}-perim-${t.data.id}`;case"municipality":return`${e.id}-muni-${t.data.label}`;case"region":return`${e.id}-region-${i}-${t.data.swissZipCode}-${t.data.town}`;case"parcel":return`${e.id}-parcel-${i}`;case"custom":return`${e.id}-custom-${t.data.id}-${i}`}})(e,t,i))})]},e.id))})}),ri=k.forwardRef(function({onSelect:e,onPerimeterSelect:t,onMunicipalitySelect:i,onRegionSelect:n,onCustomResultSelect:r,onSearchClear:o,onError:a,placement:s="top-left",externalContainer:l,placeholder:c,className:u="",includePerimeters:h=!0,autoFocus:d=!1,value:p,onChange:f,style:m},g){const{t:_}=Pt(),y=k.useRef(null),v=k.useRef(null),b=k.useRef(""),{query:x,setQuery:w,resultGroups:T,isLoading:S,error:P,isOpen:C,highlightedIndex:E,clear:M,open:I,close:z,highlightNext:A,highlightPrev:L,selectHighlighted:D,totalResults:R,flatResults:O,showPrefetchedResults:B,hasPrefetchedData:N,setHighlightedIndex:j}=function(e={}){const{debounceMs:t=300,minQueryLength:i=2,includePerimeters:n=!0}=e,{services:r,config:o,t:a}=Tt(),[s,l]=k.useState(""),[c,u]=k.useState([]),[h,d]=k.useState(!1),[p,f]=k.useState(null),[m,g]=k.useState(!1),[_,y]=k.useState(-1),v=k.useRef(null),b=k.useRef(null),x=k.useRef(e.onError);x.current=e.onError,k.useEffect(()=>()=>{v.current&&clearTimeout(v.current),b.current?.abort()},[]);const w=k.useMemo(()=>function(e){const t=[];for(const i of e)for(const e of i.items)switch(e.kind){case"address":t.push({type:"address",item:e.data});break;case"perimeter":t.push({type:"perimeter",item:e.data});break;case"municipality":t.push({type:"municipality",item:e.data});break;case"parcel":t.push({type:"parcel",item:e.data});break;case"region":t.push({type:"region",item:e.data});break;case"custom":t.push({type:"custom",item:e.data,endpointId:e.endpointId})}return t}(c),[c]),T=w.length;k.useEffect(()=>{o.features?.search?.prefetchPerimeters&&o.features.perimeterSelection&&r.perimeter.getAll().catch(console.error)},[o.features?.search?.prefetchPerimeters,o.features?.perimeterSelection,r.perimeter]),k.useEffect(()=>{const e=o.features?.search?.customSearchTypes??[];for(const t of e)t.prefetch&&!1!==t.enabled&&r.customSearch.fetchAll(t).catch(console.error)},[o.features?.search?.customSearchTypes,r.customSearch]);const S=k.useCallback(async e=>{if(b.current?.abort(),e.length<i){f(null);const t=!(!o.features?.search?.prefetchPerimeters||!o.features?.perimeterSelection),i=(o.features?.search?.customSearchTypes??[]).filter(e=>e.prefetch&&!1!==e.enabled),n=i.length>0;if(t||n)try{const n=t?await r.perimeter.getAll():[],s={};for(const t of i){const i=r.customSearch.searchLocal(t.id,e);i.length>0&&(s[t.id]=i)}if(n.length>0||Object.keys(s).length>0){const e=Mt([],[],[],n,[],s,kt(o.features?.search),i,a);return u(e),void g(!0)}}catch{}return u([]),void g(!1)}b.current=new AbortController;const t=b.current.signal;d(!0),f(null),y(-1);const s=o.features?.search,l=kt(s);try{const c=[],h=[],d={signal:t,districts:s?.districts};for(const t of l)switch(t.type){case"address":c.push(r.address.search(e,d)),h.push("address");break;case"address-advanced":c.push(r.address.searchAdvanced(e,d)),h.push("address-advanced");break;case"parcel":c.push(r.address.searchParcel(e,d)),h.push("parcel");break;case"region-town":c.push(r.address.searchTown(e,d)),h.push("region-town");break;case"region-plz":c.push(r.address.searchPostalCode(e,d)),h.push("region-plz");break;case"municipality":c.push(r.municipality.search(e,d)),h.push("municipality");break;case"perimeter":n&&o.features?.perimeterSelection&&(c.push(r.perimeter.search(e)),h.push("perimeter"))}const p=(s?.customSearchTypes??[]).filter(e=>!1!==e.enabled);for(const n of p){const o=n.minQueryLength??i;e.length>=o&&(n.prefetch?c.push(Promise.resolve(r.customSearch.searchLocal(n.id,e))):c.push(r.customSearch.search(n,e,t)),h.push(`custom:${n.id}`))}const f=await Promise.allSettled(c);if(t.aborted)return;const m=[],_=[],y=[],v=[],b=[],w={};f.forEach((e,t)=>{if("rejected"===e.status){const i=e.reason;if(i instanceof Error&&"AbortError"===i.name)return;const n=i?.statusCode,r=i instanceof Error?i.message:"Search failed";return void x.current?.({type:`search:${h[t]}`,message:r,status:n})}const i=e.value,n=h[t];if(n.startsWith("custom:")){const e=n.substring(7);w[e]=i}else switch(n){case"address":case"address-advanced":m.push(...i);break;case"parcel":_.push(...i);break;case"region-town":case"region-plz":y.push(...i);break;case"perimeter":v.push(...i);break;case"municipality":b.push(...i)}});const T=Mt(m,_,y,v,b,w,l,p,a);u(T),g(!0)}catch(c){if(c instanceof Error&&"AbortError"===c.name)return;f(c instanceof Error?c.message:"Search failed"),u([])}finally{b.current?.signal.aborted||d(!1)}},[r,o.features,n,i,a]),P=k.useCallback(e=>new Promise(i=>{v.current&&clearTimeout(v.current),v.current=setTimeout(async()=>{await S(e),i()},t)}),[S,t]),C=k.useCallback((e,t)=>{if(t?.silent)return v.current&&(clearTimeout(v.current),v.current=null),b.current?.abort(),l(e),f(null),u([]),g(!1),void y(-1);l(e),P(e)},[P]),E=k.useCallback(()=>{l(""),u([]),f(null),g(!1),y(-1),b.current?.abort()},[]),M=k.useCallback(()=>{(c.length>0||s.length>=i)&&g(!0)},[c,s,i]),I=k.useCallback(async()=>{const e=!(!o.features?.search?.prefetchPerimeters||!o.features?.perimeterSelection),t=(o.features?.search?.customSearchTypes??[]).filter(e=>e.prefetch&&!1!==e.enabled),i=t.length>0;if(e||i){d(!0),g(!0);try{const i=e?await r.perimeter.getAll():[],n={};for(const e of t){const t=r.customSearch.searchLocal(e.id,"");t.length>0&&(n[e.id]=t)}if(i.length>0||Object.keys(n).length>0){const e=Mt([],[],[],i,[],n,kt(o.features?.search),t,a);u(e)}else g(!1),u([])}catch(n){g(!1),u([])}finally{d(!1)}}},[r.perimeter,r.customSearch,o.features?.search,o.features?.perimeterSelection,a]),z=!!(o.features?.search?.prefetchPerimeters&&o.features?.perimeterSelection||(o.features?.search?.customSearchTypes??[]).some(e=>e.prefetch&&!1!==e.enabled)),A=k.useCallback(()=>{g(!1),y(-1)},[]),L=k.useCallback(()=>{0!==w.length&&y(e=>{const t=e+1;return t>=w.length?0:t})},[w]),D=k.useCallback(()=>{0!==w.length&&y(e=>{const t=e-1;return t<0?w.length-1:t})},[w]),R=k.useCallback(()=>_<0||_>=w.length?null:w[_].item,[w,_]);return{query:s,resultGroups:c,isLoading:h,error:p,isOpen:m,highlightedIndex:_,setHighlightedIndex:y,setQuery:C,search:S,clear:E,open:M,close:A,showPrefetchedResults:I,hasPrefetchedData:z,highlightNext:L,highlightPrev:D,selectHighlighted:R,totalResults:T,flatResults:w}}({includePerimeters:h,onError:a});k.useImperativeHandle(g,()=>({setQuery:(e,t)=>{w(e,t),y.current&&(y.current.value=e)}}),[w]);const V=void 0!==p,U=V?p:x,Z=k.useCallback(e=>{const t=e.target.value,i=b.current;V&&f?.(t),w(t),i.length>0&&0===t.length&&o?.(),b.current=t},[V,f,w,o]),G=k.useCallback(()=>{N&&U.length<2?B():(U.length>=2||T.length>0)&&I()},[U,T,I,N,B]);k.useEffect(()=>{const e=e=>{if(!v.current)return;e.composedPath().includes(v.current)||z()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[z]),k.useEffect(()=>{d&&y.current&&y.current.focus()},[d]);const q=k.useCallback(t=>{V?f?.(t.label):w(t.label),z(),e(t),y.current?.blur()},[V,f,w,z,e]),$=k.useCallback(e=>{V?f?.(e.name):w(e.name),z(),t?.(e),y.current?.blur()},[V,f,w,z,t]),H=k.useCallback(e=>{V?f?.(e.label):w(e.label),z(),i?.(e),y.current?.blur()},[V,f,w,z,i]),W=k.useCallback(e=>{const t=[e.swissZipCode||"",e.town||""].filter(Boolean).join(" ");V?f?.(t):w(t),z(),n?.(e),y.current?.blur()},[V,f,w,z,n]),X=k.useCallback((e,t)=>{const i=t.label||"";V?f?.(i):w(i),z(),r?.(e,t),y.current?.blur()},[V,f,w,z,r]),Y=k.useCallback(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),!C&&U.length>=2?I():A();break;case"ArrowUp":e.preventDefault(),L();break;case"Enter":if(e.preventDefault(),C&&E>=0){const e=D();if(e){const t=O[E];"custom"===t.type?X(t.endpointId,e):"address"===t.type?q(e):"region"===t.type?W(e):"municipality"===t.type?H(e):$(e)}}break;case"Escape":e.preventDefault(),C?z():(M(),y.current?.blur());break;case"Tab":z()}},[C,U,E,I,z,M,A,L,D,O,q,$,H,W,X]),K=k.useCallback(()=>{V&&f?.(""),N?(w(""),B()):M(),o?.(),b.current="",y.current?.focus()},[V,f,N,w,B,M,o]),Q=k.useCallback(e=>{j(e)},[j]),J="external"!==s?`sep-search--${s}`:"sep-search--external",ee=S||P||T.length>0,te=/* @__PURE__ */F.jsxs("div",{ref:v,className:`sep-search ${J} ${u}`.trim(),style:m,role:"combobox","aria-expanded":C,"aria-haspopup":"listbox","aria-owns":"sep-search-results",children:[
15
15
  /* @__PURE__ */F.jsxs("div",{className:"sep-search__input-container",children:[
16
16
  /* @__PURE__ */F.jsx("span",{className:"sep-search__icon","aria-hidden":"true",children:/* @__PURE__ */F.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[
17
17
  /* @__PURE__ */F.jsx("circle",{cx:"11",cy:"11",r:"8"}),
18
18
  /* @__PURE__ */F.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),
19
- /* @__PURE__ */F.jsx("input",{ref:_,type:"text",className:"sep-search__input",placeholder:l||g("search.placeholder"),value:V,onChange:U,onFocus:Z,onKeyDown:X,"aria-label":g("accessibility.searchLabel"),"aria-autocomplete":"list","aria-controls":"sep-search-results","aria-activedescendant":C>=0?`sep-search-item-${C}`:void 0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),T&&/* @__PURE__ */F.jsx("span",{className:"sep-search__spinner","aria-hidden":"true",children:/* @__PURE__ */F.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",className:"sep-search__spinner-icon",children:/* @__PURE__ */F.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:"32",strokeLinecap:"round",strokeLinejoin:"round"})})}),V&&!T&&/* @__PURE__ */F.jsx("button",{type:"button",className:"sep-search__clear",onClick:Y,"aria-label":g("search.clear")||"Clear search",children:/* @__PURE__ */F.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[
19
+ /* @__PURE__ */F.jsx("input",{ref:y,type:"text",className:"sep-search__input",placeholder:c||_("search.placeholder"),value:U,onChange:Z,onFocus:G,onKeyDown:Y,"aria-label":_("accessibility.searchLabel"),"aria-autocomplete":"list","aria-controls":"sep-search-results","aria-activedescendant":E>=0?`sep-search-item-${E}`:void 0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),S&&/* @__PURE__ */F.jsx("span",{className:"sep-search__spinner","aria-hidden":"true",children:/* @__PURE__ */F.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",className:"sep-search__spinner-icon",children:/* @__PURE__ */F.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:"32",strokeLinecap:"round",strokeLinejoin:"round"})})}),U&&!S&&/* @__PURE__ */F.jsx("button",{type:"button",className:"sep-search__clear",onClick:K,"aria-label":_("search.clear")||"Clear search",children:/* @__PURE__ */F.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[
20
20
  /* @__PURE__ */F.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),
21
- /* @__PURE__ */F.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),P&&J&&/* @__PURE__ */F.jsx("div",{id:"sep-search-results",className:"sep-search__dropdown",children:/* @__PURE__ */F.jsx(ni,{resultGroups:w,isLoading:T,error:S,highlightedIndex:C,onSelectAddress:G,onSelectPerimeter:q,onSelectMunicipality:$,onSelectRegion:H,onSelectCustomResult:W,onHighlight:K})}),P&&D>0&&/* @__PURE__ */F.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:g("search.resultsCount",{count:D})})]});return"external"===a&&s?wt.createPortal(ee,s):ee});const oi=k.createContext(null);function ai(){return function(){const e=k.use(oi);if(null==e)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}().map}function si({bounds:e,boundsOptions:t,center:i,children:n,className:r,id:o,placeholder:a,style:s,whenReady:l,zoom:c,...u},h){const[d]=k.useState({className:r,id:o,style:s}),[p,f]=k.useState(null),m=k.useRef(void 0);k.useImperativeHandle(h,()=>p?.map??null,[p]);const g=k.useCallback(n=>{if(null!==n&&!m.current){const r=new I.Map(n,u);m.current=r,null!=i&&null!=c?r.setView(i,c):null!=e&&r.fitBounds(e,t),null!=l&&r.whenReady(l),f(function(e){return Object.freeze({__version:1,map:e})}(r))}},[]);k.useEffect(()=>()=>{p?.map.remove()},[p]);const _=p?/* @__PURE__ */C.createElement(oi,{value:p},n):a??null;/* @__PURE__ */
21
+ /* @__PURE__ */F.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),C&&ee&&/* @__PURE__ */F.jsx("div",{id:"sep-search-results",className:"sep-search__dropdown",children:/* @__PURE__ */F.jsx(ni,{resultGroups:T,isLoading:S,error:P,highlightedIndex:E,onSelectAddress:q,onSelectPerimeter:$,onSelectMunicipality:H,onSelectRegion:W,onSelectCustomResult:X,onHighlight:Q})}),C&&R>0&&/* @__PURE__ */F.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:_("search.resultsCount",{count:R})})]});return"external"===s&&l?wt.createPortal(te,l):te});const oi=k.createContext(null);function ai(){return function(){const e=k.use(oi);if(null==e)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}().map}function si({bounds:e,boundsOptions:t,center:i,children:n,className:r,id:o,placeholder:a,style:s,whenReady:l,zoom:c,...u},h){const[d]=k.useState({className:r,id:o,style:s}),[p,f]=k.useState(null),m=k.useRef(void 0);k.useImperativeHandle(h,()=>p?.map??null,[p]);const g=k.useCallback(n=>{if(null!==n&&!m.current){const r=new I.Map(n,u);m.current=r,null!=i&&null!=c?r.setView(i,c):null!=e&&r.fitBounds(e,t),null!=l&&r.whenReady(l),f(function(e){return Object.freeze({__version:1,map:e})}(r))}},[]);k.useEffect(()=>()=>{p?.map.remove()},[p]);const _=p?/* @__PURE__ */C.createElement(oi,{value:p},n):a??null;/* @__PURE__ */
22
22
  return C.createElement("div",{...d,ref:g},_)}const li=/* @__PURE__ */k.forwardRef(si),ci=k.memo(function({layers:e,position:t="top-right",collapsed:i=!0}){const{t:n}=Pt(),[r,o]=k.useState(i),[a,s]=k.useState("base"),{baseLayerId:l,setBaseLayer:c,availableBaseLayers:u,overlayStates:h,toggleOverlay:d,availableOverlays:p}=e;/* @__PURE__ */
23
23
  return F.jsxs("div",{className:`sep-layer-control sep-layer-control--${t}`,children:[
24
24
  /* @__PURE__ */F.jsx("button",{className:"sep-layer-control__toggle",onClick:()=>o(!r),"aria-label":n("layers.toggle"),"aria-expanded":!r,children:/* @__PURE__ */F.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[
@@ -41,6 +41,6 @@ return F.jsxs("div",{className:"sep-map-view",children:[
41
41
  /* @__PURE__ */F.jsx(mi,{attribution:p.attribution}),
42
42
  /* @__PURE__ */F.jsx(gi,{interactionConfig:a}),
43
43
  /* @__PURE__ */F.jsx(pi,{layers:d}),
44
- /* @__PURE__ */F.jsx(ui,{perimeterService:c.perimeter,addressService:c.address,onPerimeterClick:t,onAddressClick:i,onMapReady:e,enableAddressClick:!0===l.features?.mapClickSelect,enablePerimeterClick:!1!==l.features?.perimeterSelection,paused:u}),s]}),r&&d.layerManager&&/* @__PURE__ */F.jsx(ci,{layers:d,position:h})]})});class yi extends z.Layer{constructor(e){super(e),t(this,"options"),t(this,"_container",null),t(this,"_glMap",null),t(this,"_glMapCanvas",null),t(this,"_throttledUpdate",null),t(this,"_zooming",!1),t(this,"_offset",z.point(0,0)),this.options={updateInterval:32,padding:.1,interactive:!1,pane:"tilePane",...e}}initialize(e){z.setOptions(this,e)}onAdd(e){this._container||this._initContainer(),this._map=e;const t=this.getPaneName();return e.getPane(t)?.appendChild(this._container),this._initGL(),this._offset=this._map.containerPointToLayerPoint([0,0]),this._throttledUpdate=z.Util.throttle(this._update,this.options.updateInterval,this),e.options.zoomAnimation&&z.DomEvent.on(e._proxy,z.DomUtil.TRANSITION_END,this._transitionEnd,this),e.on("move",this._throttledUpdate,this),e.on("zoomanim",this._animateZoom,this),e.on("zoom",this._pinchZoom,this),e.on("zoomstart",this._zoomStart,this),e.on("zoomend",this._zoomEnd,this),e.on("resize",this._resize,this),this}onRemove(e){this._map&&this._map._proxy&&this._map.options.zoomAnimation&&z.DomEvent.off(this._map._proxy,z.DomUtil.TRANSITION_END,this._transitionEnd,this);const t=this.getPaneName(),i=e.getPane(t);return i&&this._container&&i.removeChild(this._container),this._glMap&&(this._glMap.remove(),this._glMap=null),this._throttledUpdate&&e.off("move",this._throttledUpdate,this),e.off("zoomanim",this._animateZoom,this),e.off("zoom",this._pinchZoom,this),e.off("zoomstart",this._zoomStart,this),e.off("zoomend",this._zoomEnd,this),e.off("resize",this._resize,this),this._container=null,this._map=null,this}getEvents(){return{}}getMapboxMap(){return this._glMap}getCanvas(){return this._glMap?this._glMap.getCanvas():null}getSize(){return this._map?this._map.getSize().multiplyBy(1+2*(this.options.padding||0)):z.point(0,0)}getBounds(){if(!this._map)return z.latLngBounds(z.latLng(0,0),z.latLng(0,0));const e=this.getSize().multiplyBy(.5),t=this._map.latLngToContainerPoint(this._map.getCenter());return z.latLngBounds(this._map.containerPointToLatLng(t.subtract(e)),this._map.containerPointToLatLng(t.add(e)))}getAttribution(){return this.options.attribution??null}getContainer(){return this._container}getPaneName(){return this._map&&this._map.getPane(this.options.pane)?this.options.pane:"tilePane"}_initContainer(){const e=this._container=z.DomUtil.create("div","leaflet-gl-layer");if(!this._map)return;const t=this.getSize(),i=this._map.getSize().multiplyBy(this.options.padding||0);e.style.width=t.x+"px",e.style.height=t.y+"px";const n=this._map.containerPointToLayerPoint([0,0]).subtract(i);z.DomUtil.setPosition(e,n)}_initGL(){if(!this._map||!this._container)return;const e=this._map.getCenter(),t={...this.options,container:this._container,center:[e.lng,e.lat],zoom:this._map.getZoom()-1,attributionControl:!1,interactive:this.options.interactive,trackResize:!1,style:this.options.style};this._map.scrollWheelZoom&&(t.scrollZoom=!1),this._glMap?(this._glMap.setCenter(t.center),this._glMap.setZoom(t.zoom),this._glMap.setStyle(t.style)):this._glMap=new Lt.Map(t),this._glMapCanvas=this._glMap.getCanvas(),z.DomUtil.addClass(this._glMapCanvas,"leaflet-image-layer"),z.DomUtil.addClass(this._glMapCanvas,"leaflet-zoom-animated"),this.options.interactive&&z.DomUtil.addClass(this._glMapCanvas,"leaflet-interactive"),this.options.className&&z.DomUtil.addClass(this._glMapCanvas,this.options.className)}_update(){if(!this._map||!this._glMap||!this._container)return;if(this._offset=this._map.containerPointToLayerPoint([0,0]),this._zooming)return;const e=this.getSize(),t=this._map.getSize().multiplyBy(this.options.padding||0),i=this._map.containerPointToLayerPoint([0,0]).subtract(t);z.DomUtil.setPosition(this._container,i),this._transformGL(this._glMap);const n=Math.round(e.x),r=Math.round(e.y);this._glMap.transform.width!==n||this._glMap.transform.height!==r?(this._container.style.width=n+"px",this._container.style.height=r+"px",this._glMap.resize()):this._glMap.triggerRepaint()}_transformGL(e){if(!this._map)return;const t=this._map.getCenter();e.jumpTo({center:[t.lng,t.lat],zoom:this._map.getZoom()-1})}_pinchZoom(){this._map&&this._glMap&&this._glMap.jumpTo({zoom:this._map.getZoom()-1,center:[this._map.getCenter().lng,this._map.getCenter().lat]})}_animateZoom(e){if(!this._map||!this._glMapCanvas||!this._container)return;const t=e,i=this._map.getZoomScale(t.zoom,this._map.getZoom()),n=this._map.getSize().multiplyBy((this.options.padding||0)*i),r=this.getSize().divideBy(2),o=this._map.project(t.center,t.zoom).subtract(r).add(this._map._getMapPanePos()).add(n),a=this._map.getBounds(),s=this._map.project(a.getNorthWest(),t.zoom).subtract(o);z.DomUtil.setTransform(this._glMapCanvas,s.subtract(this._offset||z.point(0,0)),i)}_zoomStart(){this._zooming=!0}_zoomEnd(){if(!this._map||!this._glMapCanvas||!this._container)return;const e=this._map.containerPointToLayerPoint([0,0]).subtract(this._map.getSize().multiplyBy(this.options.padding||0));z.DomUtil.setPosition(this._container,e),z.DomUtil.setTransform(this._glMapCanvas,z.point(0,0),1),this._zooming=!1,this._update()}_transitionEnd(){this._map&&this._glMap&&z.Util.requestAnimFrame(()=>{if(!this._map||!this._glMap)return;const e=this._map.getZoom(),t=this._map.getCenter();this._glMapCanvas&&z.DomUtil.setTransform(this._glMapCanvas,z.point(0,0),1),this._glMap.jumpTo({center:[t.lng,t.lat],zoom:e-1}),this._zooming=!1,this._update()})}_resize(){if(!this._map||!this._glMap||!this._container)return;const e=this.getSize(),t=this._map.getSize().multiplyBy(this.options.padding||0);this._container.style.width=e.x+"px",this._container.style.height=e.y+"px";const i=this._map.containerPointToLayerPoint([0,0]).subtract(t);z.DomUtil.setPosition(this._container,i),this._glMap.resize(),this._update()}}function vi(e){const t=e.trim().split(/\s+/);return[parseFloat(t[0]),parseFloat(t[1])]}function bi(e){const t=[];let i=0,n=0;for(let r=0;r<e.length;r++)"("===e[r]?i++:")"===e[r]?i--:","===e[r]&&0===i&&(t.push(e.substring(n,r).trim()),n=r+1);return t.push(e.substring(n).trim()),t.filter(Boolean)}function xi(e){return bi(e.trim().replace(/^\(/,"").replace(/\)$/,"")).map(e=>{const t=e.replace(/^\(/,"").replace(/\)$/,"");return t.split(",").map(e=>e.trim()).filter(Boolean).map(vi)})}function wi(e){if(!e||"string"!=typeof e)return null;const t=e.trim(),i=t.toUpperCase();if(i.startsWith("POLYGON")){const e=t.indexOf("(");if(-1===e)return null;return{type:"Polygon",coordinates:xi(t.substring(e))}}if(i.startsWith("MULTIPOLYGON")){const e=t.indexOf("(");if(-1===e)return null;return{type:"MultiPolygon",coordinates:bi(t.substring(e+1,t.lastIndexOf(")"))).map(xi)}}if(i.startsWith("GEOMETRYCOLLECTION")){const e=t.indexOf("(");if(-1===e)return null;const i=t.substring(e+1,t.lastIndexOf(")")),n=[];let r=0,o=0;for(let t=0;t<i.length;t++)"("===i[t]?r++:")"===i[t]?r--:","===i[t]&&0===r&&(n.push(i.substring(o,t).trim()),o=t+1);n.push(i.substring(o).trim());return{type:"GeometryCollection",geometries:n.filter(Boolean).map(wi).filter(e=>null!==e)}}return null}function Ti(){const e=ai(),{selectionStore:t,config:i}=Tt(),n=k.useRef(/* @__PURE__ */new Map),r=k.useMemo(()=>{return e=i.ui?.marker,e?.iconUrl?z.icon({iconUrl:e.iconUrl,iconSize:e.iconSize||[25,41],iconAnchor:e.iconAnchor||[12,41],popupAnchor:e.popupAnchor||[1,-34],shadowUrl:e.shadowUrl,shadowSize:e.shadowSize,shadowAnchor:e.shadowAnchor,className:e.className}):new z.Icon.Default;var e},[i.ui?.marker]);return k.useEffect(()=>{const i=z.layerGroup().addTo(e),o=n.current,a=()=>{const e=t.getState().getAll(),n=/* @__PURE__ */new Set;e.forEach(e=>{let t=null;switch(e.type){case"address":t=`addr-${e.data.id}`;break;case"perimeter":t=`perim-${e.data.id}`;break;case"municipality":t=`muni-${e.data.label}`;break;case"custom":t=`custom-${e.data.id}`}if(n.add(t),!o.has(t))if("address"===e.type){const n=z.marker(e.data.coordinates,{icon:r}).addTo(i);o.set(t,n)}else if("perimeter"===e.type);else if("municipality"===e.type){const n=function(e){const t=wi(e);return t?"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(e=>({type:"Feature",properties:{},geometry:e}))}:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:null}(e.data.geometry);if(n){const e=z.geoJSON(n,{style:{color:"#3b82f6",weight:2,fillColor:"#3b82f6",fillOpacity:.15}}).addTo(i);o.set(t,e)}}});for(const[t,r]of o.entries())n.has(t)||(i.removeLayer(r),o.delete(t))};a();const s=t.subscribe(e=>e.items,a);return()=>{s(),i.clearLayers(),o.clear(),i.remove()}},[e,t,r]),null}z.MapboxGL=yi,z.mapboxGL=function(e){return new yi(e)};const Si=k.forwardRef(function(e,t){const{onAddressSelected:i,onPerimeterSelected:n,onMunicipalitySelected:r,onCustomResultSelected:o,onSelectionChanged:a,onReady:s,onError:l,onSearchCleared:c,onVectorFeaturesAtPoint:u}=e,{config:h,services:d,selectionStore:p,layerManager:f,clickEventsPaused:m,setClickEventsPaused:g}=Tt(),{map:_,setMap:y}=St(),v=k.useRef(!1),b=k.useRef(m),x=k.useRef(null),[w,T]=k.useState({}),S=k.useCallback(e=>{T(t=>({...t,...e}))},[]),P=k.useMemo(()=>({...It,...h.map?.interaction,...w}),[h.map?.interaction,w]);k.useEffect(()=>{b.current=m},[m]),k.useImperativeHandle(t,()=>({selectAddress:async e=>{try{const t="number"==typeof e?await d.address.getById(e):e;return t&&(p.getState().add({type:"address",data:t}),_&&_.flyTo(t.coordinates,16,h.map?.flyTo)),t}catch(t){return l?.({type:"selectAddress",message:t.message}),null}},selectPerimeter:async e=>{try{const t="string"==typeof e?await d.perimeter.getById(e):e;return t&&(p.getState().add({type:"perimeter",data:t}),_&&_.flyTo(t.centroid,14,h.map?.flyTo)),t}catch(t){return l?.({type:"selectPerimeter",message:t.message}),null}},getSelection:()=>p.getState().getAll(),clearSelection:()=>p.getState().clear(),addToSelection:e=>{const t="street"in e?{type:"address",data:e}:{type:"perimeter",data:e};return p.getState().add(t)},removeFromSelection:e=>{p.getState().remove(String(e))},flyTo:(e,t,i,n)=>{const r={...h.map?.flyTo,...n};_?.flyTo([e,t],i,r)},fitBounds:e=>{_?.fitBounds(e)},startPolygonDraw:()=>{},cancelPolygonDraw:()=>{},getLeafletMap:()=>_,getVectorFeaturesAtPoint:(e,t)=>f?.getVectorFeaturesAtPoint(e,t)??[],addLayer:e=>{f?.addCustomLayer(e)},addWMSLayer:e=>{const t={id:e.id,name:e.name,type:"wms",category:"overlay",url:e.url,layers:e.layers,format:e.format||"image/png",transparent:e.transparent??!0,visible:e.visible??!0,opacity:e.opacity,minZoom:e.minZoom,maxZoom:e.maxZoom,attribution:e.attribution,params:e.params};f&&f.addCustomLayer(t)},addTileLayer:e=>{const t={id:e.id,name:e.name,type:"raster-tile",category:"overlay",url:e.url,visible:e.visible??!0,maxZoom:e.maxZoom,minZoom:e.minZoom,subdomains:e.subdomains,attribution:e.attribution,opacity:e.opacity};f?.addCustomLayer(t)},addGeoJSONLayer:e=>{const t={id:e.id,name:e.name,type:"geojson",category:"overlay",data:e.data,visible:e.visible??!0,style:e.style,cluster:e.cluster,onClick:e.onClick};f?.addCustomLayer(t)},addVectorTileLayer:e=>{const t={id:e.id,name:e.name,type:"vector-tile",category:"overlay",style:e.style,visible:e.visible??!0,interactive:e.interactive,opacity:e.opacity,minZoom:e.minZoom,maxZoom:e.maxZoom,attribution:e.attribution,themeAdaptive:e.themeAdaptive,lightStyle:e.lightStyle,darkStyle:e.darkStyle};f?.addCustomLayer(t)},removeLayer:e=>{f?.removeCustomLayer(e)},toggleLayer:(e,t)=>{f?.toggleLayer(e,t)},getLayers:()=>f?.getAllLayers()??[],getLayer:e=>f?.getLayerConfig(e),pauseClickEvents:()=>{b.current=!0,g(!0)},resumeClickEvents:()=>{b.current=!1,g(!1)},isClickEventsPaused:()=>b.current,setSearchQuery:(e,t)=>{x.current?.setQuery(e,t)},setInteractionMode:e=>{S(e)},getInteractionMode:()=>P,enableCooperativeGestures:()=>{S({cooperativeScrollZoom:!0,touchMode:"cooperative"})},disableCooperativeGestures:()=>{S({cooperativeScrollZoom:!1,touchMode:"default"})}}),[_,d,p,f,l,h,g,P,S]),k.useEffect(()=>{if(!_||!f||!u)return;const e=e=>{if(b.current)return;const t=f.getVectorFeaturesAtPoint(e.latlng.lat,e.latlng.lng);if(0===t.length)return;const i={};for(const r of t)i[r.layerId]||(i[r.layerId]=[]),i[r.layerId].push(r);const n=_.latLngToContainerPoint(e.latlng);u({lngLat:{lat:e.latlng.lat,lng:e.latlng.lng},point:{x:n.x,y:n.y},hits:t,groupedByLayer:i})};return _.on("click",e),()=>{_.off("click",e)}},[_,f,u]),k.useEffect(()=>{if(!a)return;const e=p.subscribe(e=>{a(e.getAll())});return()=>{e()}},[p,a]);const C=k.useCallback(e=>{p.getState().add({type:"address",data:e}),i?.(e)},[p,i]),E=k.useCallback(e=>{p.getState().add({type:"perimeter",data:e}),n?.(e)},[p,n]),M=k.useCallback(e=>{p.getState().add({type:"municipality",data:e}),r?.(e)},[p,r]),I=k.useCallback((e,t)=>{o?.(e,t)},[o]),z=k.useCallback(e=>{y(e)},[y]);return k.useEffect(()=>{_&&f&&!v.current&&(v.current=!0,s?.(_))},[_,f,s]),/* @__PURE__ */F.jsxs("div",{className:"sep-map-root","data-theme":h.ui?.theme||"light",children:[h.features?.addressSearch&&/* @__PURE__ */F.jsx(ri,{ref:x,onSelect:C,onPerimeterSelect:E,onMunicipalitySelect:M,onCustomResultSelect:I,onSearchClear:c,placement:h.ui?.searchPlacement||"top-left",externalContainer:"external"===h.ui?.searchPlacement?("string"==typeof h.ui?.externalSearchContainer?document.querySelector(h.ui.externalSearchContainer):h.ui?.externalSearchContainer)??null:null,includePerimeters:h.features?.perimeterSelection??!0,autoFocus:!1,className:h.ui?.search?.className,placeholder:h.ui?.search?.placeholder,style:{...h.ui?.search?.style,...h.ui?.search?.width?{"--sep-search-width":h.ui.search.width}:{}}}),
45
- /* @__PURE__ */F.jsx(_i,{onReady:z,onPerimeterClick:E,onAddressClick:C,showLayerControl:h.ui?.showLayerControl,layersConfig:h.map?.layers,interactionConfig:P,children:/* @__PURE__ */F.jsx(Ti,{})})]})});delete z.Icon.Default.prototype._getIconUrl,z.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7F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i{constructor(e){t(this,"root",null),t(this,"mapRef"),t(this,"config"),t(this,"events",/* @__PURE__ */new Map),t(this,"shadowRoot",null),t(this,"containerElement",null),t(this,"injectedStyleNodes",[]),t(this,"appliedThemeVarNames",[]),t(this,"isReady",!1),t(this,"readyPayload",null),t(this,"i18n"),t(this,"services"),this.config=this.normalizeConfig(e),this.mapRef=k.createRef(),this.i18n=new nt(this.config.language);const i=this.config.apiUrl??"https://services.swissenergyplanning.ch",n=this.config.token||"";this.services={address:new at(i,n),perimeter:new lt(i,n),municipality:new ct(i,n),config:new ht,customSearch:new pt(n)},e.container&&this.mount(e.container)}normalizeConfig(e){return{...e,features:{addressSearch:!0,perimeterSelection:!0,...e.features},map:{center:[46.8,8.2],zoom:8,minZoom:7,maxZoom:21,interaction:It,...e.map}}}mount(e){const t="string"==typeof e?document.querySelector(e):e;if(!t)throw new Error(`[SEPMap] Container not found: ${e}`);return this.root||(this.containerElement=t,this.applyTheme(),this.applyThemeVars(),!1!==this.config.useShadowDom&&t.attachShadow?(t.shadowRoot?(this.shadowRoot=t.shadowRoot,this.shadowRoot.innerHTML=""):this.shadowRoot=t.attachShadow({mode:"open"}),function(e){const t=document.createElement("style");t.textContent='\n /* CSS Variables */\n :root{--sep-primary: #0066cc;--sep-primary-hover: #0052a3;--sep-text: #333333;--sep-text-secondary: #666666;--sep-text-muted: #999999;--sep-bg: #ffffff;--sep-bg-secondary: #f5f5f5;--sep-bg-hover: #f0f0f0;--sep-border: #dddddd;--sep-border-focus: rgba(0, 102, 204, .4);--sep-space-xs: 4px;--sep-space-sm: 8px;--sep-space-md: 16px;--sep-space-lg: 24px;--sep-space-xl: 32px;--sep-radius: 4px;--sep-radius-sm: 2px;--sep-radius-lg: 8px;--sep-shadow: 0 1px 3px rgba(0, 0, 0, .1);--sep-shadow-md: 0 4px 6px rgba(0, 0, 0, .1);--sep-shadow-lg: 0 8px 16px rgba(0, 0, 0, .1);--sep-z-map: 1;--sep-z-overlay: 100;--sep-z-controls: 1000;--sep-z-search: 1500;--sep-z-popup: 2000;--sep-z-modal: 3000;--sep-font-size-sm: .875rem;--sep-font-size-md: 1rem;--sep-font-size-lg: 1.125rem;--sep-chip-address-bg: #e6f4dd;--sep-chip-address-text: #5c9429;--sep-chip-address-border: #99d066;--sep-chip-parcel-bg: #e1f0fa;--sep-chip-parcel-text: #0b5a8e;--sep-chip-parcel-border: #0e72b5;--sep-chip-region-bg: #e8f5e9;--sep-chip-region-text: #388e3c;--sep-chip-region-border: #689f38;--sep-chip-egid-bg: #fff3e0;--sep-chip-egid-text: #e65100;--sep-chip-egid-border: #ff9800;--sep-chip-egrid-bg: #f3e5f5;--sep-chip-egrid-text: #7b1fa2;--sep-chip-egrid-border: #9c27b0;--sep-chip-perimeter-bg: #e0f2f1;--sep-chip-perimeter-text: #00695c;--sep-chip-perimeter-border: #4db6ac}[data-theme=dark]{--sep-text: #e9ecef;--sep-text-secondary: #adb5bd;--sep-text-muted: #6c757d;--sep-bg: #1a1a2e;--sep-bg-secondary: #252542;--sep-bg-hover: #333355;--sep-border: #444466;--sep-border-focus: rgba(128, 189, 255, .4);--sep-shadow: 0 1px 3px rgba(0, 0, 0, .3);--sep-shadow-md: 0 4px 6px rgba(0, 0, 0, .3);--sep-shadow-lg: 0 8px 16px rgba(0, 0, 0, .3)}\n\n /* Global Styles */\n :root{--sep-primary: #0066cc;--sep-primary-hover: #0052a3;--sep-secondary: #6c757d;--sep-success: #28a745;--sep-danger: #dc3545;--sep-warning: #ffc107;--sep-bg: #ffffff;--sep-bg-secondary: #f8f9fa;--sep-bg-hover: #e9ecef;--sep-text: #212529;--sep-text-secondary: #6c757d;--sep-text-muted: #adb5bd;--sep-border: #dee2e6;--sep-border-focus: #80bdff;--sep-shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);--sep-shadow: 0 2px 4px rgba(0, 0, 0, .1);--sep-shadow-lg: 0 4px 12px rgba(0, 0, 0, .15);--sep-radius-sm: 4px;--sep-radius: 6px;--sep-radius-lg: 8px;--sep-space-xs: 4px;--sep-space-sm: 8px;--sep-space-md: 16px;--sep-space-lg: 24px;--sep-space-xl: 32px;--sep-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--sep-font-size-sm: .875rem;--sep-font-size: 1rem;--sep-font-size-lg: 1.125rem;--sep-z-map: 1;--sep-z-controls: 100;--sep-z-search: 200;--sep-z-dropdown: 300;--sep-z-modal: 400}[data-theme=dark]{--sep-bg: #1a1a2e;--sep-bg-secondary: #252542;--sep-bg-hover: #333355;--sep-text: #e9ecef;--sep-text-secondary: #adb5bd;--sep-border: #444466}\n\n /* Leaflet Core Styles */\n .leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.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0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}\n\n /* Component Styles */\n .sep-map-view{position:relative;width:100%;height:100%}.sep-map-view__container{width:100%;height:100%}.sep-map-view__container .leaflet-control-attribution{background:var(--sep-bg);padding:1px 2px;font-size:9px;line-height:1.4;color:var(--sep-text-secondary);box-shadow:var(--sep-shadow-sm);border-radius:var(--sep-radius-sm)}.sep-map-view__container .leaflet-control-attribution a{color:var(--sep-primary);text-decoration:none;font-weight:500}.sep-map-view__container .leaflet-control-attribution a:hover{color:var(--sep-primary-hover);text-decoration:underline}.sep-map-view .leaflet-gl-layer{position:relative}.sep-map-view .leaflet-control-zoom{display:none}.sep-map-view__interaction-hint{position:absolute;top:20px;left:50%;transform:translate(-50%);z-index:700;max-width:min(90%,360px);padding:10px 14px;border-radius:var(--sep-radius-md);background:color-mix(in srgb,var(--sep-bg) 90%,black 10%);color:var(--sep-text);box-shadow:var(--sep-shadow-md);font-size:14px;font-weight:500;line-height:1.4;text-align:center;opacity:0;pointer-events:none;transition:opacity .18s ease,transform .18s ease}.sep-map-view__interaction-hint--visible{opacity:1;transform:translate(-50%) translateY(0)}\n .sep-map-root{position:relative;width:100%;height:100%}\n .sep-search{position:relative;width:var(--sep-search-width, 100%);max-width:400px;font-family:var(--sep-font-family);font-size:var(--sep-font-size)}.sep-search--top-left{position:absolute;top:var(--sep-space-md);left:var(--sep-space-md);z-index:var(--sep-z-search)}.sep-search--top-right{position:absolute;top:var(--sep-space-md);right:var(--sep-space-md);z-index:var(--sep-z-search)}.sep-search__input-container{position:relative;display:flex;align-items:center;background:var(--sep-bg);border:1px solid var(--sep-border);border-radius:var(--sep-radius);box-shadow:var(--sep-shadow);transition:border-color .2s,box-shadow .2s}.sep-search__input-container:focus-within{border-color:var(--sep-border-focus);box-shadow:var(--sep-shadow),0 0 0 3px #0066cc26}.sep-search__icon{display:flex;align-items:center;justify-content:center;padding-left:var(--sep-space-sm);color:var(--sep-text-muted);pointer-events:none}.sep-search__input{flex:1;width:100%;padding:var(--sep-space-sm) var(--sep-space-sm);border:none;background:transparent;font-family:inherit;font-size:inherit;color:var(--sep-text);outline:none}.sep-search__input::placeholder{color:var(--sep-text-muted)}.sep-search__spinner{display:flex;align-items:center;justify-content:center;padding-right:var(--sep-space-xs);color:var(--sep-primary)}.sep-search__spinner-icon{animation:sep-spin 1s linear infinite}@keyframes sep-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.sep-search__clear{display:flex;align-items:center;justify-content:center;width:28px;height:28px;margin-right:var(--sep-space-xs);padding:0;border:none;border-radius:var(--sep-radius-sm);background:transparent;color:var(--sep-text-muted);cursor:pointer;transition:background-color .2s,color .2s}.sep-search__clear:hover{background:var(--sep-bg-hover);color:var(--sep-text)}.sep-search__clear:focus{outline:2px solid var(--sep-border-focus);outline-offset:-2px}.sep-search__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;max-height:360px;overflow-y:auto;background:var(--sep-bg);border:1px solid var(--sep-border);border-radius:var(--sep-radius);box-shadow:var(--sep-shadow-lg);z-index:var(--sep-z-dropdown)}.sep-search-results{padding:var(--sep-space-xs) 0}.sep-search-status{display:flex;align-items:center;justify-content:center;gap:var(--sep-space-sm);padding:var(--sep-space-lg) var(--sep-space-md);color:var(--sep-text-secondary);font-size:var(--sep-font-size-sm)}.sep-search-status--loading{color:var(--sep-primary)}.sep-search-status--error{color:var(--sep-danger)}.sep-search-status--empty{font-style:italic}.sep-search-group{padding:var(--sep-space-xs) 0}.sep-search-group+.sep-search-group{border-top:1px solid var(--sep-border)}.sep-search-group__header{padding:var(--sep-space-sm) var(--sep-space-md);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--sep-text-muted);background:var(--sep-bg-secondary);position:sticky;top:0;z-index:1}.sep-search-item{display:flex;align-items:flex-start;gap:var(--sep-space-sm);width:100%;padding:var(--sep-space-sm) var(--sep-space-md);border:none;background:transparent;text-align:left;font-family:inherit;font-size:inherit;color:var(--sep-text);cursor:pointer;transition:background-color .15s}.sep-search-item:hover,.sep-search-item--highlighted{background:var(--sep-bg-hover)}.sep-search-item:focus{outline:none;background:var(--sep-bg-hover)}.sep-search-chip{display:inline-flex;align-items:center;justify-content:center;padding:2px 8px;border-radius:12px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;border:1px solid transparent;flex-shrink:0;min-width:70px}.sep-search-chip--address{background-color:var(--sep-chip-address-bg);color:var(--sep-chip-address-text);border-color:var(--sep-chip-address-border)}.sep-search-chip--parcel{background-color:var(--sep-chip-parcel-bg);color:var(--sep-chip-parcel-text);border-color:var(--sep-chip-parcel-border)}.sep-search-chip--region{background-color:var(--sep-chip-region-bg);color:var(--sep-chip-region-text);border-color:var(--sep-chip-region-border)}.sep-search-chip--egid{background-color:var(--sep-chip-egid-bg);color:var(--sep-chip-egid-text);border-color:var(--sep-chip-egid-border)}.sep-search-chip--egrid{background-color:var(--sep-chip-egrid-bg);color:var(--sep-chip-egrid-text);border-color:var(--sep-chip-egrid-border)}.sep-search-chip--perimeter{background-color:var(--sep-chip-perimeter-bg);color:var(--sep-chip-perimeter-text);border-color:var(--sep-chip-perimeter-border)}.sep-search-item__content{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.sep-search-item__label{font-weight:500;color:var(--sep-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sep-search-item__description{font-size:var(--sep-font-size-sm);color:var(--sep-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[data-theme=dark] .sep-search__input-container,[data-theme=dark] .sep-search__dropdown{background:var(--sep-bg);border-color:var(--sep-border)}[data-theme=dark] .sep-search-group__header{background:var(--sep-bg-secondary)}@media(max-width:480px){.sep-search--top-left,.sep-search--top-right{left:var(--sep-space-sm);right:var(--sep-space-sm);max-width:none}.sep-search__dropdown{max-height:50vh}}\n .sep-layer-control{position:absolute;z-index:var(--sep-z-controls);display:flex;flex-direction:column;align-items:flex-end}.sep-layer-control--top-left{top:var(--sep-space-md);left:var(--sep-space-md);align-items:flex-start}.sep-layer-control--top-right{top:var(--sep-space-md);right:var(--sep-space-md)}.sep-layer-control--bottom-left{bottom:var(--sep-space-xl);left:var(--sep-space-md);align-items:flex-start}.sep-layer-control--bottom-right{bottom:var(--sep-space-xl);right:var(--sep-space-md)}.sep-layer-control__toggle{width:36px;height:36px;padding:0;display:flex;align-items:center;justify-content:center;background:var(--sep-bg);border:1px solid var(--sep-border);border-radius:var(--sep-radius);box-shadow:var(--sep-shadow);cursor:pointer;transition:background-color .2s,border-color .2s,color .2s;color:var(--sep-text)}.sep-layer-control__toggle:hover{background:var(--sep-bg-hover)}.sep-layer-control__toggle:focus{outline:2px solid var(--sep-border-focus);outline-offset:2px}.sep-layer-control__panel{margin-top:var(--sep-space-sm);background:var(--sep-bg);border:1px solid var(--sep-border);border-radius:var(--sep-radius);box-shadow:var(--sep-shadow-lg);min-width:220px;max-width:280px;overflow:hidden}.sep-layer-control__tabs{display:flex;border-bottom:1px solid var(--sep-border)}.sep-layer-control__tab{flex:1;padding:var(--sep-space-sm) var(--sep-space-md);background:transparent;border:none;font-size:var(--sep-font-size-sm);font-weight:500;color:var(--sep-text-secondary);cursor:pointer;transition:background-color .2s,color .2s}.sep-layer-control__tab:hover{background:var(--sep-bg-hover)}.sep-layer-control__tab.active{color:var(--sep-primary);background:var(--sep-bg-secondary)}.sep-layer-control__content{max-height:300px;overflow-y:auto}.sep-layer-control__list{padding:var(--sep-space-xs) 0}.sep-layer-control__item{display:flex;align-items:flex-start;gap:var(--sep-space-sm);padding:var(--sep-space-sm) var(--sep-space-md);cursor:pointer;transition:background-color .15s}.sep-layer-control__item:hover{background:var(--sep-bg-hover)}.sep-layer-control__item.active{background:#0066cc14}.sep-layer-control__item input[type=radio],.sep-layer-control__item input[type=checkbox]{margin-top:2px;cursor:pointer}.sep-layer-control__item-content{display:flex;flex-direction:column;gap:2px;min-width:0}.sep-layer-control__item-name{font-size:var(--sep-font-size-sm);font-weight:500;color:var(--sep-text)}.sep-layer-control__item-desc{font-size:11px;color:var(--sep-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sep-layer-control__empty{padding:var(--sep-space-lg) var(--sep-space-md);text-align:center;color:var(--sep-text-muted);font-size:var(--sep-font-size-sm)}@media(max-width:480px){.sep-layer-control__panel{min-width:180px}}\n ',e.prepend(t)}(this.shadowRoot),this.injectConfiguredCustomStyles(this.shadowRoot),this.root=P.createRoot(this.shadowRoot)):(this.injectConfiguredCustomStyles(document.head),this.root=P.createRoot(t)),this.render()),this}mountSearch(e){const t="string"==typeof e?document.querySelector(e):e;return t&&(this.config={...this.config,ui:{...this.config.ui,externalSearchContainer:t}},this.render()),this}render(){if(!this.root)return;const e=k.createElement(Si,{ref:this.mapRef,onReady:e=>this.emit("ready",{map:e}),onAddressSelected:e=>this.emit("addressSelected",e),onPerimeterSelected:e=>this.emit("perimeterSelected",e),onMunicipalitySelected:e=>this.emit("municipalitySelected",e),onCustomResultSelected:(e,t)=>this.emit("customResultSelected",{endpointId:e,result:t}),onVectorFeaturesAtPoint:e=>this.emit("vectorFeaturesAtPoint",e),onSelectionChanged:e=>this.emit("selectionChanged",e),onPolygonDrawn:e=>this.emit("polygonDrawn",e),onError:e=>this.emit("error",e),onSearchCleared:()=>this.emit("searchCleared",void 0)}),t=k.createElement(xt,{config:this.config,children:e,i18n:this.i18n,services:this.services});this.root.render(t)}on(e,t){if(this.events.has(e)||this.events.set(e,/* @__PURE__ */new Set),this.events.get(e).add(t),"ready"===e&&this.isReady&&this.readyPayload)try{t(this.readyPayload)}catch(i){}return()=>this.off(e,t)}off(e,t){this.events.get(e)?.delete(t)}once(e,t){const i=n=>{this.off(e,i),t(n)};return this.on(e,i)}emit(e,t){"ready"===e&&(this.isReady=!0,this.readyPayload=t),this.events.get(e)?.forEach(e=>{try{e(t)}catch(i){}})}async selectAddress(e){const t="number"==typeof e?await this.services.address.getById(e):e;return t&&this.mapRef.current?.selectAddress(t),t}async selectPerimeter(e){const t="string"==typeof e?await this.services.perimeter.getById(e):e;return t&&this.mapRef.current?.selectPerimeter(t),t}getSelection(){return this.mapRef.current?.getSelection()??[]}clearSelection(){this.mapRef.current?.clearSelection()}addToSelection(e){return this.mapRef.current?.addToSelection(e)??!1}removeFromSelection(e){this.mapRef.current?.removeFromSelection(e)}async getDecisionTree(e){const t=e??this.getSelection();return this.services.config.evaluateDecisionTree(t)}async searchAddress(e){return this.services.address.search(e)}async getAddressesInPolygon(e){return this.services.address.getInPolygon(e)}flyTo(e,t,i,n){this.mapRef.current?.flyTo(e,t,i,n)}fitBounds(e){this.mapRef.current?.fitBounds(e)}setLanguage(e){this.i18n.setLocale(e),this.emit("languageChanged",{locale:e})}getLanguage(){return this.i18n.getLocale()}setTheme(e){this.config={...this.config,ui:{...this.config.ui,theme:e}},this.applyTheme();const t=this.getLeafletMap();if(t){const i=di(t);i&&i.updateTheme(e)}this.render()}getTheme(){return this.config.ui?.theme??"light"}applyTheme(){if(!this.containerElement)return;const e=this.config.ui?.theme??"light";this.containerElement.setAttribute("data-theme",e)}applyThemeVars(){if(!this.containerElement)return;this.clearThemeVars();const e=this.config.ui?.themeVars;e&&Object.entries(e).forEach(([e,t])=>{if(null==t)return;const i=e.startsWith("--")?e:`--${e}`;this.containerElement.style.setProperty(i,String(t)),this.appliedThemeVarNames.push(i)})}clearThemeVars(){this.containerElement&&0!==this.appliedThemeVarNames.length&&(this.appliedThemeVarNames.forEach(e=>{this.containerElement.style.removeProperty(e)}),this.appliedThemeVarNames=[])}injectConfiguredCustomStyles(e){this.clearInjectedStyleNodes();const t=this.config.ui?.customCssRef;t&&this.injectCustomCssFromReference(e,t);const i=this.config.ui?.customCssUrl;i&&this.injectStylesheetLink(e,i);const n=this.config.ui?.customCss;n&&this.injectStyleText(e,n)}injectCustomCssFromReference(e,t){let i=document.getElementById(t);if(!i)try{i=document.querySelector(t)}catch{i=null}i&&(i instanceof HTMLStyleElement?this.injectStyleText(e,i.textContent??""):i instanceof HTMLLinkElement&&i.href&&this.injectStylesheetLink(e,i.href))}injectStyleText(e,t){if(!t.trim())return;const i=document.createElement("style");i.setAttribute("data-sep-custom-css","true"),i.textContent=t,e.appendChild(i),this.injectedStyleNodes.push(i)}injectStylesheetLink(e,t){const i=document.createElement("link");i.setAttribute("data-sep-custom-css","true"),i.rel="stylesheet",i.href=t,e.appendChild(i),this.injectedStyleNodes.push(i)}clearInjectedStyleNodes(){0!==this.injectedStyleNodes.length&&(this.injectedStyleNodes.forEach(e=>e.remove()),this.injectedStyleNodes=[])}setFeature(e,t){this.config={...this.config,features:{...this.config.features,[e]:t}},this.render()}startPolygonDraw(){this.mapRef.current?.startPolygonDraw()}cancelPolygonDraw(){this.mapRef.current?.cancelPolygonDraw()}setSearchQuery(e,t){this.mapRef.current?.setSearchQuery(e,t)}setInteractionMode(e){this.config={...this.config,map:{...this.config.map,interaction:{...It,...this.config.map?.interaction,...e}}},this.mapRef.current?.setInteractionMode(e)}getInteractionMode(){return this.mapRef.current?.getInteractionMode()??{...It,...this.config.map?.interaction}}enableCooperativeGestures(){this.setInteractionMode({cooperativeScrollZoom:!0,touchMode:"cooperative"}),this.mapRef.current?.enableCooperativeGestures()}disableCooperativeGestures(){this.setInteractionMode({cooperativeScrollZoom:!1,touchMode:"default"}),this.mapRef.current?.disableCooperativeGestures()}getLeafletMap(){return this.mapRef.current?.getLeafletMap()}getVectorFeaturesAtPoint(e,t){return this.mapRef.current?.getVectorFeaturesAtPoint(e,t)??[]}addLayer(e){this.mapRef.current?.addLayer(e)}addWMSLayer(e){this.mapRef.current?.addWMSLayer(e)}addTileLayer(e){this.mapRef.current?.addTileLayer(e)}addGeoJSONLayer(e){this.mapRef.current?.addGeoJSONLayer(e)}addVectorTileLayer(e){this.mapRef.current?.addVectorTileLayer(e)}removeLayer(e){this.mapRef.current?.removeLayer(e)}toggleLayer(e,t){this.mapRef.current?.toggleLayer(e,t)}getLayers(){return this.mapRef.current?.getLayers()??[]}getLayer(e){return this.mapRef.current?.getLayer(e)}pauseClickEvents(){this.mapRef.current?.pauseClickEvents()}resumeClickEvents(){this.mapRef.current?.resumeClickEvents()}isClickEventsPaused(){return this.mapRef.current?.isClickEventsPaused()??!1}setBaseLayer(e){const t=this.getLeafletMap();if(!t)return;const i=di(t);i&&i.setBaseLayer(e)}destroy(){this.root?.unmount(),this.root=null,this.clearInjectedStyleNodes(),this.clearThemeVars(),this.containerElement&&this.containerElement.removeAttribute("data-theme"),this.shadowRoot=null,this.containerElement=null,this.events.clear()}}class ki extends HTMLElement{constructor(){super(),t(this,"sdk",null)}static get observedAttributes(){return["language","token","features","api-url","interaction"]}connectedCallback(){const e=document.createElement("div");e.style.width="100%",e.style.height="100%",this.appendChild(e);const t=this.buildConfig();this.sdk=new Pi({...t,container:e,useShadowDom:!1}),this.forwardEvents()}disconnectedCallback(){this.sdk?.destroy(),this.sdk=null}attributeChangedCallback(e,t,i){if(t!==i&&this.sdk)switch(e){case"language":i&&this.sdk.setLanguage(i);break;case"interaction":i&&this.sdk.setInteractionMode(this.parseInteractionConfig(i))}}buildConfig(){const e=this.getAttribute("token");if(!e)throw new Error("[sep-map] token attribute is required");return{token:e,apiUrl:this.getAttribute("api-url")||void 0,language:this.getAttribute("language")||void 0,features:this.parseFeatures(),map:this.parseMapConfig()}}parseFeatures(){const e=this.getAttribute("features");if(!e)return{addressSearch:!0,perimeterSelection:!0};if(e.startsWith("{"))try{return JSON.parse(e)}catch{return{addressSearch:!0,perimeterSelection:!0}}const t=e.split(",").map(e=>e.trim().toLowerCase());return{addressSearch:t.includes("address")||t.includes("address-search"),perimeterSelection:t.includes("perimeter")||t.includes("perimeter-selection"),multiSelect:t.includes("multi")||t.includes("multi-select"),polygonDraw:t.includes("polygon")||t.includes("polygon-draw")}}parseMapConfig(){const e=this.getAttribute("center"),t=this.getAttribute("zoom"),i=this.getAttribute("bounds"),n=this.getAttribute("interaction");return{center:e?JSON.parse(e):void 0,zoom:t?parseInt(t,10):void 0,bounds:i?JSON.parse(i):void 0,interaction:n?this.parseInteractionConfig(n):void 0}}parseInteractionConfig(e){try{return JSON.parse(e)}catch{return{}}}forwardEvents(){if(!this.sdk)return;["ready","addressSelected","perimeterSelected","selectionChanged","polygonDrawn","error","languageChanged"].forEach(e=>{this.sdk.on(e,t=>{this.dispatchEvent(new CustomEvent(`sep:${this.toKebabCase(e)}`,{detail:t,bubbles:!0,composed:!0}))})})}toKebabCase(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}get map(){return this.sdk}selectAddress(e){return this.sdk?.selectAddress(e)}selectPerimeter(e){return this.sdk?.selectPerimeter(e)}getSelection(){return this.sdk?.getSelection()??[]}clearSelection(){this.sdk?.clearSelection()}setLanguage(e){this.sdk?.setLanguage(e)}}"undefined"==typeof window||customElements.get("sep-map")||customElements.define("sep-map",ki),"undefined"!=typeof window&&"undefined"!=typeof SEPMapLib&&(window.SEPMapSDK=SEPMapLib.SEPMapSDK);export{at as AddressService,pt as CustomSearchService,nt as I18nManager,lt as PerimeterService,Pi as SEPMapSDK,Pi as default};
44
+ /* @__PURE__ */F.jsx(ui,{perimeterService:c.perimeter,addressService:c.address,onPerimeterClick:t,onAddressClick:i,onMapReady:e,enableAddressClick:!0===l.features?.mapClickSelect,enablePerimeterClick:!1!==l.features?.perimeterSelection,paused:u}),s]}),r&&d.layerManager&&/* @__PURE__ */F.jsx(ci,{layers:d,position:h})]})});class yi extends z.Layer{constructor(e){super(e),t(this,"options"),t(this,"_container",null),t(this,"_glMap",null),t(this,"_glMapCanvas",null),t(this,"_throttledUpdate",null),t(this,"_zooming",!1),t(this,"_offset",z.point(0,0)),this.options={updateInterval:32,padding:.1,interactive:!1,pane:"tilePane",...e}}initialize(e){z.setOptions(this,e)}onAdd(e){this._container||this._initContainer(),this._map=e;const t=this.getPaneName();return e.getPane(t)?.appendChild(this._container),this._initGL(),this._offset=this._map.containerPointToLayerPoint([0,0]),this._throttledUpdate=z.Util.throttle(this._update,this.options.updateInterval,this),e.options.zoomAnimation&&z.DomEvent.on(e._proxy,z.DomUtil.TRANSITION_END,this._transitionEnd,this),e.on("move",this._throttledUpdate,this),e.on("zoomanim",this._animateZoom,this),e.on("zoom",this._pinchZoom,this),e.on("zoomstart",this._zoomStart,this),e.on("zoomend",this._zoomEnd,this),e.on("resize",this._resize,this),this}onRemove(e){this._map&&this._map._proxy&&this._map.options.zoomAnimation&&z.DomEvent.off(this._map._proxy,z.DomUtil.TRANSITION_END,this._transitionEnd,this);const t=this.getPaneName(),i=e.getPane(t);return i&&this._container&&i.removeChild(this._container),this._glMap&&(this._glMap.remove(),this._glMap=null),this._throttledUpdate&&e.off("move",this._throttledUpdate,this),e.off("zoomanim",this._animateZoom,this),e.off("zoom",this._pinchZoom,this),e.off("zoomstart",this._zoomStart,this),e.off("zoomend",this._zoomEnd,this),e.off("resize",this._resize,this),this._container=null,this._map=null,this}getEvents(){return{}}getMapboxMap(){return this._glMap}getCanvas(){return this._glMap?this._glMap.getCanvas():null}getSize(){return this._map?this._map.getSize().multiplyBy(1+2*(this.options.padding||0)):z.point(0,0)}getBounds(){if(!this._map)return z.latLngBounds(z.latLng(0,0),z.latLng(0,0));const e=this.getSize().multiplyBy(.5),t=this._map.latLngToContainerPoint(this._map.getCenter());return z.latLngBounds(this._map.containerPointToLatLng(t.subtract(e)),this._map.containerPointToLatLng(t.add(e)))}getAttribution(){return this.options.attribution??null}getContainer(){return this._container}getPaneName(){return this._map&&this._map.getPane(this.options.pane)?this.options.pane:"tilePane"}_initContainer(){const e=this._container=z.DomUtil.create("div","leaflet-gl-layer");if(!this._map)return;const t=this.getSize(),i=this._map.getSize().multiplyBy(this.options.padding||0);e.style.width=t.x+"px",e.style.height=t.y+"px";const n=this._map.containerPointToLayerPoint([0,0]).subtract(i);z.DomUtil.setPosition(e,n)}_initGL(){if(!this._map||!this._container)return;const e=this._map.getCenter(),t={...this.options,container:this._container,center:[e.lng,e.lat],zoom:this._map.getZoom()-1,attributionControl:!1,interactive:this.options.interactive,trackResize:!1,style:this.options.style};this._map.scrollWheelZoom&&(t.scrollZoom=!1),this._glMap?(this._glMap.setCenter(t.center),this._glMap.setZoom(t.zoom),this._glMap.setStyle(t.style)):this._glMap=new Lt.Map(t),this._glMapCanvas=this._glMap.getCanvas(),z.DomUtil.addClass(this._glMapCanvas,"leaflet-image-layer"),z.DomUtil.addClass(this._glMapCanvas,"leaflet-zoom-animated"),this.options.interactive&&z.DomUtil.addClass(this._glMapCanvas,"leaflet-interactive"),this.options.className&&z.DomUtil.addClass(this._glMapCanvas,this.options.className)}_update(){if(!this._map||!this._glMap||!this._container)return;if(this._offset=this._map.containerPointToLayerPoint([0,0]),this._zooming)return;const e=this.getSize(),t=this._map.getSize().multiplyBy(this.options.padding||0),i=this._map.containerPointToLayerPoint([0,0]).subtract(t);z.DomUtil.setPosition(this._container,i),this._transformGL(this._glMap);const n=Math.round(e.x),r=Math.round(e.y);this._glMap.transform.width!==n||this._glMap.transform.height!==r?(this._container.style.width=n+"px",this._container.style.height=r+"px",this._glMap.resize()):this._glMap.triggerRepaint()}_transformGL(e){if(!this._map)return;const t=this._map.getCenter();e.jumpTo({center:[t.lng,t.lat],zoom:this._map.getZoom()-1})}_pinchZoom(){this._map&&this._glMap&&this._glMap.jumpTo({zoom:this._map.getZoom()-1,center:[this._map.getCenter().lng,this._map.getCenter().lat]})}_animateZoom(e){if(!this._map||!this._glMapCanvas||!this._container)return;const t=e,i=this._map.getZoomScale(t.zoom,this._map.getZoom()),n=this._map.getSize().multiplyBy((this.options.padding||0)*i),r=this.getSize().divideBy(2),o=this._map.project(t.center,t.zoom).subtract(r).add(this._map._getMapPanePos()).add(n),a=this._map.getBounds(),s=this._map.project(a.getNorthWest(),t.zoom).subtract(o);z.DomUtil.setTransform(this._glMapCanvas,s.subtract(this._offset||z.point(0,0)),i)}_zoomStart(){this._zooming=!0}_zoomEnd(){if(!this._map||!this._glMapCanvas||!this._container)return;const e=this._map.containerPointToLayerPoint([0,0]).subtract(this._map.getSize().multiplyBy(this.options.padding||0));z.DomUtil.setPosition(this._container,e),z.DomUtil.setTransform(this._glMapCanvas,z.point(0,0),1),this._zooming=!1,this._update()}_transitionEnd(){this._map&&this._glMap&&z.Util.requestAnimFrame(()=>{if(!this._map||!this._glMap)return;const e=this._map.getZoom(),t=this._map.getCenter();this._glMapCanvas&&z.DomUtil.setTransform(this._glMapCanvas,z.point(0,0),1),this._glMap.jumpTo({center:[t.lng,t.lat],zoom:e-1}),this._zooming=!1,this._update()})}_resize(){if(!this._map||!this._glMap||!this._container)return;const e=this.getSize(),t=this._map.getSize().multiplyBy(this.options.padding||0);this._container.style.width=e.x+"px",this._container.style.height=e.y+"px";const i=this._map.containerPointToLayerPoint([0,0]).subtract(t);z.DomUtil.setPosition(this._container,i),this._glMap.resize(),this._update()}}function vi(e){const t=e.trim().split(/\s+/);return[parseFloat(t[0]),parseFloat(t[1])]}function bi(e){const t=[];let i=0,n=0;for(let r=0;r<e.length;r++)"("===e[r]?i++:")"===e[r]?i--:","===e[r]&&0===i&&(t.push(e.substring(n,r).trim()),n=r+1);return t.push(e.substring(n).trim()),t.filter(Boolean)}function xi(e){return bi(e.trim().replace(/^\(/,"").replace(/\)$/,"")).map(e=>{const t=e.replace(/^\(/,"").replace(/\)$/,"");return t.split(",").map(e=>e.trim()).filter(Boolean).map(vi)})}function wi(e){if(!e||"string"!=typeof e)return null;const t=e.trim(),i=t.toUpperCase();if(i.startsWith("POLYGON")){const e=t.indexOf("(");if(-1===e)return null;return{type:"Polygon",coordinates:xi(t.substring(e))}}if(i.startsWith("MULTIPOLYGON")){const e=t.indexOf("(");if(-1===e)return null;return{type:"MultiPolygon",coordinates:bi(t.substring(e+1,t.lastIndexOf(")"))).map(xi)}}if(i.startsWith("GEOMETRYCOLLECTION")){const e=t.indexOf("(");if(-1===e)return null;const i=t.substring(e+1,t.lastIndexOf(")")),n=[];let r=0,o=0;for(let t=0;t<i.length;t++)"("===i[t]?r++:")"===i[t]?r--:","===i[t]&&0===r&&(n.push(i.substring(o,t).trim()),o=t+1);n.push(i.substring(o).trim());return{type:"GeometryCollection",geometries:n.filter(Boolean).map(wi).filter(e=>null!==e)}}return null}function Ti(){const e=ai(),{selectionStore:t,config:i}=Tt(),n=k.useRef(/* @__PURE__ */new Map),r=k.useMemo(()=>{return e=i.ui?.marker,e?.iconUrl?z.icon({iconUrl:e.iconUrl,iconSize:e.iconSize||[25,41],iconAnchor:e.iconAnchor||[12,41],popupAnchor:e.popupAnchor||[1,-34],shadowUrl:e.shadowUrl,shadowSize:e.shadowSize,shadowAnchor:e.shadowAnchor,className:e.className}):new z.Icon.Default;var e},[i.ui?.marker]);return k.useEffect(()=>{const i=z.layerGroup().addTo(e),o=n.current,a=()=>{const e=t.getState().getAll(),n=/* @__PURE__ */new Set;e.forEach(e=>{let t=null;switch(e.type){case"address":t=`addr-${e.data.id}`;break;case"perimeter":t=`perim-${e.data.id}`;break;case"municipality":t=`muni-${e.data.label}`;break;case"custom":t=`custom-${e.data.id}`}if(n.add(t),!o.has(t))if("address"===e.type){const n=z.marker(e.data.coordinates,{icon:r}).addTo(i);o.set(t,n)}else if("perimeter"===e.type);else if("municipality"===e.type){const n=function(e){const t=wi(e);return t?"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(e=>({type:"Feature",properties:{},geometry:e}))}:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:null}(e.data.geometry);if(n){const e=z.geoJSON(n,{style:{color:"#3b82f6",weight:2,fillColor:"#3b82f6",fillOpacity:.15}}).addTo(i);o.set(t,e)}}});for(const[t,r]of o.entries())n.has(t)||(i.removeLayer(r),o.delete(t))};a();const s=t.subscribe(e=>e.items,a);return()=>{s(),i.clearLayers(),o.clear(),i.remove()}},[e,t,r]),null}z.MapboxGL=yi,z.mapboxGL=function(e){return new yi(e)};const Si=k.forwardRef(function(e,t){const{onAddressSelected:i,onPerimeterSelected:n,onMunicipalitySelected:r,onCustomResultSelected:o,onSelectionChanged:a,onReady:s,onError:l,onSearchCleared:c,onVectorFeaturesAtPoint:u}=e,{config:h,services:d,selectionStore:p,layerManager:f,clickEventsPaused:m,setClickEventsPaused:g}=Tt(),{map:_,setMap:y}=St(),v=k.useRef(!1),b=k.useRef(m),x=k.useRef(null),[w,T]=k.useState({}),S=k.useCallback(e=>{T(t=>({...t,...e}))},[]),P=k.useMemo(()=>({...It,...h.map?.interaction,...w}),[h.map?.interaction,w]);k.useEffect(()=>{b.current=m},[m]),k.useImperativeHandle(t,()=>({selectAddress:async e=>{try{const t="number"==typeof e?await d.address.getById(e):e;return t&&(p.getState().add({type:"address",data:t}),_&&_.flyTo(t.coordinates,16,h.map?.flyTo)),t}catch(t){return l?.({type:"selectAddress",message:t.message}),null}},selectPerimeter:async e=>{try{const t="string"==typeof e?await d.perimeter.getById(e):e;return t&&(p.getState().add({type:"perimeter",data:t}),_&&_.flyTo(t.centroid,14,h.map?.flyTo)),t}catch(t){return l?.({type:"selectPerimeter",message:t.message}),null}},getSelection:()=>p.getState().getAll(),clearSelection:()=>p.getState().clear(),addToSelection:e=>{const t="street"in e?{type:"address",data:e}:{type:"perimeter",data:e};return p.getState().add(t)},removeFromSelection:e=>{p.getState().remove(String(e))},flyTo:(e,t,i,n)=>{const r={...h.map?.flyTo,...n};_?.flyTo([e,t],i,r)},fitBounds:e=>{_?.fitBounds(e)},startPolygonDraw:()=>{},cancelPolygonDraw:()=>{},getLeafletMap:()=>_,getVectorFeaturesAtPoint:(e,t)=>f?.getVectorFeaturesAtPoint(e,t)??[],addLayer:e=>{f?.addCustomLayer(e)},addWMSLayer:e=>{const t={id:e.id,name:e.name,type:"wms",category:"overlay",url:e.url,layers:e.layers,format:e.format||"image/png",transparent:e.transparent??!0,visible:e.visible??!0,opacity:e.opacity,minZoom:e.minZoom,maxZoom:e.maxZoom,attribution:e.attribution,params:e.params};f&&f.addCustomLayer(t)},addTileLayer:e=>{const t={id:e.id,name:e.name,type:"raster-tile",category:"overlay",url:e.url,visible:e.visible??!0,maxZoom:e.maxZoom,minZoom:e.minZoom,subdomains:e.subdomains,attribution:e.attribution,opacity:e.opacity};f?.addCustomLayer(t)},addGeoJSONLayer:e=>{const t={id:e.id,name:e.name,type:"geojson",category:"overlay",data:e.data,visible:e.visible??!0,style:e.style,cluster:e.cluster,onClick:e.onClick};f?.addCustomLayer(t)},addVectorTileLayer:e=>{const t={id:e.id,name:e.name,type:"vector-tile",category:"overlay",style:e.style,visible:e.visible??!0,interactive:e.interactive,opacity:e.opacity,minZoom:e.minZoom,maxZoom:e.maxZoom,attribution:e.attribution,themeAdaptive:e.themeAdaptive,lightStyle:e.lightStyle,darkStyle:e.darkStyle};f?.addCustomLayer(t)},removeLayer:e=>{f?.removeCustomLayer(e)},toggleLayer:(e,t)=>{f?.toggleLayer(e,t)},getLayers:()=>f?.getAllLayers()??[],getLayer:e=>f?.getLayerConfig(e),pauseClickEvents:()=>{b.current=!0,g(!0)},resumeClickEvents:()=>{b.current=!1,g(!1)},isClickEventsPaused:()=>b.current,setSearchQuery:(e,t)=>{x.current?.setQuery(e,t)},setInteractionMode:e=>{S(e)},getInteractionMode:()=>P,enableCooperativeGestures:()=>{S({cooperativeScrollZoom:!0,touchMode:"cooperative"})},disableCooperativeGestures:()=>{S({cooperativeScrollZoom:!1,touchMode:"default"})}}),[_,d,p,f,l,h,g,P,S]),k.useEffect(()=>{if(!_||!f||!u)return;const e=e=>{if(b.current)return;const t=f.getVectorFeaturesAtPoint(e.latlng.lat,e.latlng.lng);if(0===t.length)return;const i={};for(const r of t)i[r.layerId]||(i[r.layerId]=[]),i[r.layerId].push(r);const n=_.latLngToContainerPoint(e.latlng);u({lngLat:{lat:e.latlng.lat,lng:e.latlng.lng},point:{x:n.x,y:n.y},hits:t,groupedByLayer:i})};return _.on("click",e),()=>{_.off("click",e)}},[_,f,u]),k.useEffect(()=>{if(!a)return;const e=p.subscribe(e=>{a(e.getAll())});return()=>{e()}},[p,a]);const C=k.useCallback(e=>{p.getState().add({type:"address",data:e}),i?.(e)},[p,i]),E=k.useCallback(e=>{p.getState().add({type:"perimeter",data:e}),n?.(e)},[p,n]),M=k.useCallback(e=>{p.getState().add({type:"municipality",data:e}),r?.(e)},[p,r]),I=k.useCallback((e,t)=>{o?.(e,t)},[o]),z=k.useCallback(e=>{y(e)},[y]);return k.useEffect(()=>{_&&f&&!v.current&&(v.current=!0,s?.(_))},[_,f,s]),/* @__PURE__ */F.jsxs("div",{className:"sep-map-root","data-theme":h.ui?.theme||"light",children:[h.features?.addressSearch&&/* @__PURE__ */F.jsx(ri,{ref:x,onSelect:C,onPerimeterSelect:E,onMunicipalitySelect:M,onCustomResultSelect:I,onSearchClear:c,onError:l,placement:h.ui?.searchPlacement||"top-left",externalContainer:"external"===h.ui?.searchPlacement?("string"==typeof h.ui?.externalSearchContainer?document.querySelector(h.ui.externalSearchContainer):h.ui?.externalSearchContainer)??null:null,includePerimeters:h.features?.perimeterSelection??!0,autoFocus:!1,className:h.ui?.search?.className,placeholder:h.ui?.search?.placeholder,style:{...h.ui?.search?.style,...h.ui?.search?.width?{"--sep-search-width":h.ui.search.width}:{}}}),
45
+ /* @__PURE__ */F.jsx(_i,{onReady:z,onPerimeterClick:E,onAddressClick:C,showLayerControl:h.ui?.showLayerControl,layersConfig:h.map?.layers,interactionConfig:P,children:/* @__PURE__ */F.jsx(Ti,{})})]})});delete z.Icon.Default.prototype._getIconUrl,z.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeL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8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class Pi{constructor(e){t(this,"root",null),t(this,"mapRef"),t(this,"config"),t(this,"events",/* @__PURE__ */new Map),t(this,"shadowRoot",null),t(this,"containerElement",null),t(this,"injectedStyleNodes",[]),t(this,"appliedThemeVarNames",[]),t(this,"isReady",!1),t(this,"readyPayload",null),t(this,"i18n"),t(this,"services"),this.config=this.normalizeConfig(e),this.mapRef=k.createRef(),this.i18n=new nt(this.config.language);const i=this.config.apiUrl??"https://services.swissenergyplanning.ch",n=this.config.token||"";this.services={address:new at(i,n),perimeter:new lt(i,n),municipality:new ct(i,n),config:new ht,customSearch:new pt(n)},e.container&&this.mount(e.container)}normalizeConfig(e){return{...e,features:{addressSearch:!0,perimeterSelection:!0,...e.features},map:{center:[46.8,8.2],zoom:8,minZoom:7,maxZoom:21,interaction:It,...e.map}}}mount(e){const t="string"==typeof e?document.querySelector(e):e;if(!t)throw new Error(`[SEPMap] Container not found: ${e}`);return this.root||(this.containerElement=t,this.applyTheme(),this.applyThemeVars(),!1!==this.config.useShadowDom&&t.attachShadow?(t.shadowRoot?(this.shadowRoot=t.shadowRoot,this.shadowRoot.innerHTML=""):this.shadowRoot=t.attachShadow({mode:"open"}),function(e){const t=document.createElement("style");t.textContent='\n /* CSS Variables */\n :root{--sep-primary: #0066cc;--sep-primary-hover: #0052a3;--sep-text: #333333;--sep-text-secondary: #666666;--sep-text-muted: #999999;--sep-bg: #ffffff;--sep-bg-secondary: #f5f5f5;--sep-bg-hover: #f0f0f0;--sep-border: #dddddd;--sep-border-focus: rgba(0, 102, 204, .4);--sep-space-xs: 4px;--sep-space-sm: 8px;--sep-space-md: 16px;--sep-space-lg: 24px;--sep-space-xl: 32px;--sep-radius: 4px;--sep-radius-sm: 2px;--sep-radius-lg: 8px;--sep-shadow: 0 1px 3px rgba(0, 0, 0, .1);--sep-shadow-md: 0 4px 6px rgba(0, 0, 0, .1);--sep-shadow-lg: 0 8px 16px rgba(0, 0, 0, .1);--sep-z-map: 1;--sep-z-overlay: 100;--sep-z-controls: 1000;--sep-z-search: 1500;--sep-z-popup: 2000;--sep-z-modal: 3000;--sep-font-size-sm: .875rem;--sep-font-size-md: 1rem;--sep-font-size-lg: 1.125rem;--sep-chip-address-bg: #e6f4dd;--sep-chip-address-text: #5c9429;--sep-chip-address-border: #99d066;--sep-chip-parcel-bg: #e1f0fa;--sep-chip-parcel-text: #0b5a8e;--sep-chip-parcel-border: #0e72b5;--sep-chip-region-bg: #e8f5e9;--sep-chip-region-text: #388e3c;--sep-chip-region-border: #689f38;--sep-chip-egid-bg: #fff3e0;--sep-chip-egid-text: #e65100;--sep-chip-egid-border: #ff9800;--sep-chip-egrid-bg: #f3e5f5;--sep-chip-egrid-text: #7b1fa2;--sep-chip-egrid-border: #9c27b0;--sep-chip-perimeter-bg: #e0f2f1;--sep-chip-perimeter-text: #00695c;--sep-chip-perimeter-border: #4db6ac}[data-theme=dark]{--sep-text: #e9ecef;--sep-text-secondary: #adb5bd;--sep-text-muted: #6c757d;--sep-bg: #1a1a2e;--sep-bg-secondary: #252542;--sep-bg-hover: #333355;--sep-border: #444466;--sep-border-focus: rgba(128, 189, 255, .4);--sep-shadow: 0 1px 3px rgba(0, 0, 0, .3);--sep-shadow-md: 0 4px 6px rgba(0, 0, 0, .3);--sep-shadow-lg: 0 8px 16px rgba(0, 0, 0, .3)}\n\n /* Global Styles */\n :root{--sep-primary: #0066cc;--sep-primary-hover: #0052a3;--sep-secondary: #6c757d;--sep-success: #28a745;--sep-danger: #dc3545;--sep-warning: #ffc107;--sep-bg: #ffffff;--sep-bg-secondary: #f8f9fa;--sep-bg-hover: #e9ecef;--sep-text: #212529;--sep-text-secondary: #6c757d;--sep-text-muted: #adb5bd;--sep-border: #dee2e6;--sep-border-focus: #80bdff;--sep-shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);--sep-shadow: 0 2px 4px rgba(0, 0, 0, .1);--sep-shadow-lg: 0 4px 12px rgba(0, 0, 0, .15);--sep-radius-sm: 4px;--sep-radius: 6px;--sep-radius-lg: 8px;--sep-space-xs: 4px;--sep-space-sm: 8px;--sep-space-md: 16px;--sep-space-lg: 24px;--sep-space-xl: 32px;--sep-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--sep-font-size-sm: .875rem;--sep-font-size: 1rem;--sep-font-size-lg: 1.125rem;--sep-z-map: 1;--sep-z-controls: 100;--sep-z-search: 200;--sep-z-dropdown: 300;--sep-z-modal: 400}[data-theme=dark]{--sep-bg: #1a1a2e;--sep-bg-secondary: #252542;--sep-bg-hover: #333355;--sep-text: #e9ecef;--sep-text-secondary: #adb5bd;--sep-border: #444466}\n\n /* Leaflet Core Styles */\n .leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}\n\n /* Component Styles */\n .sep-map-view{position:relative;width:100%;height:100%}.sep-map-view__container{width:100%;height:100%}.sep-map-view__container .leaflet-control-attribution{background:var(--sep-bg);padding:1px 2px;font-size:9px;line-height:1.4;color:var(--sep-text-secondary);box-shadow:var(--sep-shadow-sm);border-radius:var(--sep-radius-sm)}.sep-map-view__container .leaflet-control-attribution a{color:var(--sep-primary);text-decoration:none;font-weight:500}.sep-map-view__container .leaflet-control-attribution a:hover{color:var(--sep-primary-hover);text-decoration:underline}.sep-map-view .leaflet-gl-layer{position:relative}.sep-map-view .leaflet-control-zoom{display:none}.sep-map-view__interaction-hint{position:absolute;top:20px;left:50%;transform:translate(-50%);z-index:700;max-width:min(90%,360px);padding:10px 14px;border-radius:var(--sep-radius-md);background:color-mix(in srgb,var(--sep-bg) 90%,black 10%);color:var(--sep-text);box-shadow:var(--sep-shadow-md);font-size:14px;font-weight:500;line-height:1.4;text-align:center;opacity:0;pointer-events:none;transition:opacity .18s ease,transform .18s ease}.sep-map-view__interaction-hint--visible{opacity:1;transform:translate(-50%) translateY(0)}\n .sep-map-root{position:relative;width:100%;height:100%}\n .sep-search{position:relative;width:var(--sep-search-width, 100%);max-width:400px;font-family:var(--sep-font-family);font-size:var(--sep-font-size)}.sep-search--top-left{position:absolute;top:var(--sep-space-md);left:var(--sep-space-md);z-index:var(--sep-z-search)}.sep-search--top-right{position:absolute;top:var(--sep-space-md);right:var(--sep-space-md);z-index:var(--sep-z-search)}.sep-search__input-container{position:relative;display:flex;align-items:center;background:var(--sep-bg);border:1px solid var(--sep-border);border-radius:var(--sep-radius);box-shadow:var(--sep-shadow);transition:border-color .2s,box-shadow .2s}.sep-search__input-container:focus-within{border-color:var(--sep-border-focus);box-shadow:var(--sep-shadow),0 0 0 3px #0066cc26}.sep-search__icon{display:flex;align-items:center;justify-content:center;padding-left:var(--sep-space-sm);color:var(--sep-text-muted);pointer-events:none}.sep-search__input{flex:1;width:100%;padding:var(--sep-space-sm) var(--sep-space-sm);border:none;background:transparent;font-family:inherit;font-size:inherit;color:var(--sep-text);outline:none}.sep-search__input::placeholder{color:var(--sep-text-muted)}.sep-search__spinner{display:flex;align-items:center;justify-content:center;padding-right:var(--sep-space-xs);color:var(--sep-primary)}.sep-search__spinner-icon{animation:sep-spin 1s linear infinite}@keyframes sep-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.sep-search__clear{display:flex;align-items:center;justify-content:center;width:28px;height:28px;margin-right:var(--sep-space-xs);padding:0;border:none;border-radius:var(--sep-radius-sm);background:transparent;color:var(--sep-text-muted);cursor:pointer;transition:background-color .2s,color .2s}.sep-search__clear:hover{background:var(--sep-bg-hover);color:var(--sep-text)}.sep-search__clear:focus{outline:2px solid var(--sep-border-focus);outline-offset:-2px}.sep-search__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;max-height:360px;overflow-y:auto;background:var(--sep-bg);border:1px solid var(--sep-border);border-radius:var(--sep-radius);box-shadow:var(--sep-shadow-lg);z-index:var(--sep-z-dropdown)}.sep-search-results{padding:var(--sep-space-xs) 0}.sep-search-status{display:flex;align-items:center;justify-content:center;gap:var(--sep-space-sm);padding:var(--sep-space-lg) var(--sep-space-md);color:var(--sep-text-secondary);font-size:var(--sep-font-size-sm)}.sep-search-status--loading{color:var(--sep-primary)}.sep-search-status--error{color:var(--sep-danger)}.sep-search-status--empty{font-style:italic}.sep-search-group{padding:var(--sep-space-xs) 0}.sep-search-group+.sep-search-group{border-top:1px solid var(--sep-border)}.sep-search-group__header{padding:var(--sep-space-sm) var(--sep-space-md);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--sep-text-muted);background:var(--sep-bg-secondary);position:sticky;top:0;z-index:1}.sep-search-item{display:flex;align-items:flex-start;gap:var(--sep-space-sm);width:100%;padding:var(--sep-space-sm) var(--sep-space-md);border:none;background:transparent;text-align:left;font-family:inherit;font-size:inherit;color:var(--sep-text);cursor:pointer;transition:background-color .15s}.sep-search-item:hover,.sep-search-item--highlighted{background:var(--sep-bg-hover)}.sep-search-item:focus{outline:none;background:var(--sep-bg-hover)}.sep-search-chip{display:inline-flex;align-items:center;justify-content:center;padding:2px 8px;border-radius:12px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;border:1px solid transparent;flex-shrink:0;min-width:70px}.sep-search-chip--address{background-color:var(--sep-chip-address-bg);color:var(--sep-chip-address-text);border-color:var(--sep-chip-address-border)}.sep-search-chip--parcel{background-color:var(--sep-chip-parcel-bg);color:var(--sep-chip-parcel-text);border-color:var(--sep-chip-parcel-border)}.sep-search-chip--region{background-color:var(--sep-chip-region-bg);color:var(--sep-chip-region-text);border-color:var(--sep-chip-region-border)}.sep-search-chip--egid{background-color:var(--sep-chip-egid-bg);color:var(--sep-chip-egid-text);border-color:var(--sep-chip-egid-border)}.sep-search-chip--egrid{background-color:var(--sep-chip-egrid-bg);color:var(--sep-chip-egrid-text);border-color:var(--sep-chip-egrid-border)}.sep-search-chip--perimeter{background-color:var(--sep-chip-perimeter-bg);color:var(--sep-chip-perimeter-text);border-color:var(--sep-chip-perimeter-border)}.sep-search-item__content{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.sep-search-item__label{font-weight:500;color:var(--sep-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sep-search-item__description{font-size:var(--sep-font-size-sm);color:var(--sep-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[data-theme=dark] .sep-search__input-container,[data-theme=dark] .sep-search__dropdown{background:var(--sep-bg);border-color:var(--sep-border)}[data-theme=dark] .sep-search-group__header{background:var(--sep-bg-secondary)}@media(max-width:480px){.sep-search--top-left,.sep-search--top-right{left:var(--sep-space-sm);right:var(--sep-space-sm);max-width:none}.sep-search__dropdown{max-height:50vh}}\n .sep-layer-control{position:absolute;z-index:var(--sep-z-controls);display:flex;flex-direction:column;align-items:flex-end}.sep-layer-control--top-left{top:var(--sep-space-md);left:var(--sep-space-md);align-items:flex-start}.sep-layer-control--top-right{top:var(--sep-space-md);right:var(--sep-space-md)}.sep-layer-control--bottom-left{bottom:var(--sep-space-xl);left:var(--sep-space-md);align-items:flex-start}.sep-layer-control--bottom-right{bottom:var(--sep-space-xl);right:var(--sep-space-md)}.sep-layer-control__toggle{width:36px;height:36px;padding:0;display:flex;align-items:center;justify-content:center;background:var(--sep-bg);border:1px solid var(--sep-border);border-radius:var(--sep-radius);box-shadow:var(--sep-shadow);cursor:pointer;transition:background-color .2s,border-color .2s,color .2s;color:var(--sep-text)}.sep-layer-control__toggle:hover{background:var(--sep-bg-hover)}.sep-layer-control__toggle:focus{outline:2px solid var(--sep-border-focus);outline-offset:2px}.sep-layer-control__panel{margin-top:var(--sep-space-sm);background:var(--sep-bg);border:1px solid var(--sep-border);border-radius:var(--sep-radius);box-shadow:var(--sep-shadow-lg);min-width:220px;max-width:280px;overflow:hidden}.sep-layer-control__tabs{display:flex;border-bottom:1px solid var(--sep-border)}.sep-layer-control__tab{flex:1;padding:var(--sep-space-sm) var(--sep-space-md);background:transparent;border:none;font-size:var(--sep-font-size-sm);font-weight:500;color:var(--sep-text-secondary);cursor:pointer;transition:background-color .2s,color .2s}.sep-layer-control__tab:hover{background:var(--sep-bg-hover)}.sep-layer-control__tab.active{color:var(--sep-primary);background:var(--sep-bg-secondary)}.sep-layer-control__content{max-height:300px;overflow-y:auto}.sep-layer-control__list{padding:var(--sep-space-xs) 0}.sep-layer-control__item{display:flex;align-items:flex-start;gap:var(--sep-space-sm);padding:var(--sep-space-sm) var(--sep-space-md);cursor:pointer;transition:background-color .15s}.sep-layer-control__item:hover{background:var(--sep-bg-hover)}.sep-layer-control__item.active{background:#0066cc14}.sep-layer-control__item input[type=radio],.sep-layer-control__item input[type=checkbox]{margin-top:2px;cursor:pointer}.sep-layer-control__item-content{display:flex;flex-direction:column;gap:2px;min-width:0}.sep-layer-control__item-name{font-size:var(--sep-font-size-sm);font-weight:500;color:var(--sep-text)}.sep-layer-control__item-desc{font-size:11px;color:var(--sep-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sep-layer-control__empty{padding:var(--sep-space-lg) var(--sep-space-md);text-align:center;color:var(--sep-text-muted);font-size:var(--sep-font-size-sm)}@media(max-width:480px){.sep-layer-control__panel{min-width:180px}}\n ',e.prepend(t)}(this.shadowRoot),this.injectConfiguredCustomStyles(this.shadowRoot),this.root=P.createRoot(this.shadowRoot)):(this.injectConfiguredCustomStyles(document.head),this.root=P.createRoot(t)),this.render()),this}mountSearch(e){const t="string"==typeof e?document.querySelector(e):e;return t&&(this.config={...this.config,ui:{...this.config.ui,externalSearchContainer:t}},this.render()),this}render(){if(!this.root)return;const e=k.createElement(Si,{ref:this.mapRef,onReady:e=>this.emit("ready",{map:e}),onAddressSelected:e=>this.emit("addressSelected",e),onPerimeterSelected:e=>this.emit("perimeterSelected",e),onMunicipalitySelected:e=>this.emit("municipalitySelected",e),onCustomResultSelected:(e,t)=>this.emit("customResultSelected",{endpointId:e,result:t}),onVectorFeaturesAtPoint:e=>this.emit("vectorFeaturesAtPoint",e),onSelectionChanged:e=>this.emit("selectionChanged",e),onPolygonDrawn:e=>this.emit("polygonDrawn",e),onError:e=>{this.emit("error",e),401!==e.status&&403!==e.status||this.emit("unauthorized",{status:e.status,message:e.message})},onSearchCleared:()=>this.emit("searchCleared",void 0)}),t=k.createElement(xt,{config:this.config,children:e,i18n:this.i18n,services:this.services});this.root.render(t)}on(e,t){if(this.events.has(e)||this.events.set(e,/* @__PURE__ */new Set),this.events.get(e).add(t),"ready"===e&&this.isReady&&this.readyPayload)try{t(this.readyPayload)}catch(i){}return()=>this.off(e,t)}off(e,t){this.events.get(e)?.delete(t)}once(e,t){const i=n=>{this.off(e,i),t(n)};return this.on(e,i)}emit(e,t){"ready"===e&&(this.isReady=!0,this.readyPayload=t),this.events.get(e)?.forEach(e=>{try{e(t)}catch(i){}})}async selectAddress(e){const t="number"==typeof e?await this.services.address.getById(e):e;return t&&this.mapRef.current?.selectAddress(t),t}async selectPerimeter(e){const t="string"==typeof e?await this.services.perimeter.getById(e):e;return t&&this.mapRef.current?.selectPerimeter(t),t}getSelection(){return this.mapRef.current?.getSelection()??[]}clearSelection(){this.mapRef.current?.clearSelection()}addToSelection(e){return this.mapRef.current?.addToSelection(e)??!1}removeFromSelection(e){this.mapRef.current?.removeFromSelection(e)}async getDecisionTree(e){const t=e??this.getSelection();return this.services.config.evaluateDecisionTree(t)}async searchAddress(e){return this.services.address.search(e)}async getAddressesInPolygon(e){return this.services.address.getInPolygon(e)}flyTo(e,t,i,n){this.mapRef.current?.flyTo(e,t,i,n)}fitBounds(e){this.mapRef.current?.fitBounds(e)}setLanguage(e){this.i18n.setLocale(e),this.emit("languageChanged",{locale:e})}getLanguage(){return this.i18n.getLocale()}setTheme(e){this.config={...this.config,ui:{...this.config.ui,theme:e}},this.applyTheme();const t=this.getLeafletMap();if(t){const i=di(t);i&&i.updateTheme(e)}this.render()}getTheme(){return this.config.ui?.theme??"light"}applyTheme(){if(!this.containerElement)return;const e=this.config.ui?.theme??"light";this.containerElement.setAttribute("data-theme",e)}applyThemeVars(){if(!this.containerElement)return;this.clearThemeVars();const e=this.config.ui?.themeVars;e&&Object.entries(e).forEach(([e,t])=>{if(null==t)return;const i=e.startsWith("--")?e:`--${e}`;this.containerElement.style.setProperty(i,String(t)),this.appliedThemeVarNames.push(i)})}clearThemeVars(){this.containerElement&&0!==this.appliedThemeVarNames.length&&(this.appliedThemeVarNames.forEach(e=>{this.containerElement.style.removeProperty(e)}),this.appliedThemeVarNames=[])}injectConfiguredCustomStyles(e){this.clearInjectedStyleNodes();const t=this.config.ui?.customCssRef;t&&this.injectCustomCssFromReference(e,t);const i=this.config.ui?.customCssUrl;i&&this.injectStylesheetLink(e,i);const n=this.config.ui?.customCss;n&&this.injectStyleText(e,n)}injectCustomCssFromReference(e,t){let i=document.getElementById(t);if(!i)try{i=document.querySelector(t)}catch{i=null}i&&(i instanceof HTMLStyleElement?this.injectStyleText(e,i.textContent??""):i instanceof HTMLLinkElement&&i.href&&this.injectStylesheetLink(e,i.href))}injectStyleText(e,t){if(!t.trim())return;const i=document.createElement("style");i.setAttribute("data-sep-custom-css","true"),i.textContent=t,e.appendChild(i),this.injectedStyleNodes.push(i)}injectStylesheetLink(e,t){const i=document.createElement("link");i.setAttribute("data-sep-custom-css","true"),i.rel="stylesheet",i.href=t,e.appendChild(i),this.injectedStyleNodes.push(i)}clearInjectedStyleNodes(){0!==this.injectedStyleNodes.length&&(this.injectedStyleNodes.forEach(e=>e.remove()),this.injectedStyleNodes=[])}setFeature(e,t){this.config={...this.config,features:{...this.config.features,[e]:t}},this.render()}startPolygonDraw(){this.mapRef.current?.startPolygonDraw()}cancelPolygonDraw(){this.mapRef.current?.cancelPolygonDraw()}setSearchQuery(e,t){this.mapRef.current?.setSearchQuery(e,t)}setInteractionMode(e){this.config={...this.config,map:{...this.config.map,interaction:{...It,...this.config.map?.interaction,...e}}},this.mapRef.current?.setInteractionMode(e)}getInteractionMode(){return this.mapRef.current?.getInteractionMode()??{...It,...this.config.map?.interaction}}enableCooperativeGestures(){this.setInteractionMode({cooperativeScrollZoom:!0,touchMode:"cooperative"}),this.mapRef.current?.enableCooperativeGestures()}disableCooperativeGestures(){this.setInteractionMode({cooperativeScrollZoom:!1,touchMode:"default"}),this.mapRef.current?.disableCooperativeGestures()}getLeafletMap(){return this.mapRef.current?.getLeafletMap()}getVectorFeaturesAtPoint(e,t){return this.mapRef.current?.getVectorFeaturesAtPoint(e,t)??[]}addLayer(e){this.mapRef.current?.addLayer(e)}addWMSLayer(e){this.mapRef.current?.addWMSLayer(e)}addTileLayer(e){this.mapRef.current?.addTileLayer(e)}addGeoJSONLayer(e){this.mapRef.current?.addGeoJSONLayer(e)}addVectorTileLayer(e){this.mapRef.current?.addVectorTileLayer(e)}removeLayer(e){this.mapRef.current?.removeLayer(e)}toggleLayer(e,t){this.mapRef.current?.toggleLayer(e,t)}getLayers(){return this.mapRef.current?.getLayers()??[]}getLayer(e){return this.mapRef.current?.getLayer(e)}pauseClickEvents(){this.mapRef.current?.pauseClickEvents()}resumeClickEvents(){this.mapRef.current?.resumeClickEvents()}isClickEventsPaused(){return this.mapRef.current?.isClickEventsPaused()??!1}setBaseLayer(e){const t=this.getLeafletMap();if(!t)return;const i=di(t);i&&i.setBaseLayer(e)}destroy(){this.root?.unmount(),this.root=null,this.clearInjectedStyleNodes(),this.clearThemeVars(),this.containerElement&&this.containerElement.removeAttribute("data-theme"),this.shadowRoot=null,this.containerElement=null,this.events.clear()}}class ki extends HTMLElement{constructor(){super(),t(this,"sdk",null)}static get observedAttributes(){return["language","token","features","api-url","interaction"]}connectedCallback(){const e=document.createElement("div");e.style.width="100%",e.style.height="100%",this.appendChild(e);const t=this.buildConfig();this.sdk=new Pi({...t,container:e,useShadowDom:!1}),this.forwardEvents()}disconnectedCallback(){this.sdk?.destroy(),this.sdk=null}attributeChangedCallback(e,t,i){if(t!==i&&this.sdk)switch(e){case"language":i&&this.sdk.setLanguage(i);break;case"interaction":i&&this.sdk.setInteractionMode(this.parseInteractionConfig(i))}}buildConfig(){const e=this.getAttribute("token");if(!e)throw new Error("[sep-map] token attribute is required");return{token:e,apiUrl:this.getAttribute("api-url")||void 0,language:this.getAttribute("language")||void 0,features:this.parseFeatures(),map:this.parseMapConfig()}}parseFeatures(){const e=this.getAttribute("features");if(!e)return{addressSearch:!0,perimeterSelection:!0};if(e.startsWith("{"))try{return JSON.parse(e)}catch{return{addressSearch:!0,perimeterSelection:!0}}const t=e.split(",").map(e=>e.trim().toLowerCase());return{addressSearch:t.includes("address")||t.includes("address-search"),perimeterSelection:t.includes("perimeter")||t.includes("perimeter-selection"),multiSelect:t.includes("multi")||t.includes("multi-select"),polygonDraw:t.includes("polygon")||t.includes("polygon-draw")}}parseMapConfig(){const e=this.getAttribute("center"),t=this.getAttribute("zoom"),i=this.getAttribute("bounds"),n=this.getAttribute("interaction");return{center:e?JSON.parse(e):void 0,zoom:t?parseInt(t,10):void 0,bounds:i?JSON.parse(i):void 0,interaction:n?this.parseInteractionConfig(n):void 0}}parseInteractionConfig(e){try{return JSON.parse(e)}catch{return{}}}forwardEvents(){if(!this.sdk)return;["ready","addressSelected","perimeterSelected","selectionChanged","polygonDrawn","error","unauthorized","languageChanged"].forEach(e=>{this.sdk.on(e,t=>{this.dispatchEvent(new CustomEvent(`sep:${this.toKebabCase(e)}`,{detail:t,bubbles:!0,composed:!0}))})})}toKebabCase(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}get map(){return this.sdk}selectAddress(e){return this.sdk?.selectAddress(e)}selectPerimeter(e){return this.sdk?.selectPerimeter(e)}getSelection(){return this.sdk?.getSelection()??[]}clearSelection(){this.sdk?.clearSelection()}setLanguage(e){this.sdk?.setLanguage(e)}}"undefined"==typeof window||customElements.get("sep-map")||customElements.define("sep-map",ki),"undefined"!=typeof window&&"undefined"!=typeof SEPMapLib&&(window.SEPMapSDK=SEPMapLib.SEPMapSDK);export{at as AddressService,pt as CustomSearchService,nt as I18nManager,lt as PerimeterService,Pi as SEPMapSDK,Pi as default};
46
46
  //# sourceMappingURL=sep-map.esm.js.map