@geoimpact/sep-map-sdk 1.0.20 → 1.0.22
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 +10 -2
- package/dist/sep-map.esm.js +5 -6
- package/dist/sep-map.esm.js.map +1 -1
- package/dist/sep-map.js +1 -1
- package/dist/sep-map.js.map +1 -1
- package/dist/sep-map.umd.js +1 -1
- package/dist/sep-map.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4417,6 +4417,10 @@ declare class Map extends Evented {
|
|
|
4417
4417
|
}
|
|
4418
4418
|
|
|
4419
4419
|
type VectorTileLayerOptions = Omit<VectorTileLayerConfig, 'type' | 'category'>;
|
|
4420
|
+
interface SetSearchQueryOptions {
|
|
4421
|
+
/** If true, updates input/query without opening dropdown or fetching suggestions */
|
|
4422
|
+
silent?: boolean;
|
|
4423
|
+
}
|
|
4420
4424
|
/**
|
|
4421
4425
|
* Public API interface for the SEP Map component
|
|
4422
4426
|
* Available when using React ref or SDK instance
|
|
@@ -4446,7 +4450,7 @@ interface SEPMapRef {
|
|
|
4446
4450
|
isClickEventsPaused: () => boolean;
|
|
4447
4451
|
getLeafletMap: () => Map | null;
|
|
4448
4452
|
getVectorFeaturesAtPoint: (lat: number, lng: number) => VectorFeatureHit[];
|
|
4449
|
-
setSearchQuery: (query: string) => void;
|
|
4453
|
+
setSearchQuery: (query: string, options?: SetSearchQueryOptions) => void;
|
|
4450
4454
|
}
|
|
4451
4455
|
|
|
4452
4456
|
type SupportedLocale = 'de' | 'fr' | 'it' | 'en';
|
|
@@ -4724,13 +4728,17 @@ declare class SEPMapSDK {
|
|
|
4724
4728
|
* Set the search query programmatically
|
|
4725
4729
|
*
|
|
4726
4730
|
* @param query - The search query to set
|
|
4731
|
+
* @param options - Optional behavior flags
|
|
4727
4732
|
*
|
|
4728
4733
|
* @example
|
|
4729
4734
|
* ```typescript
|
|
4730
4735
|
* sdk.setSearchQuery('Zürich');
|
|
4736
|
+
* sdk.setSearchQuery('Bahnhofstrasse 1, Zürich', { silent: true });
|
|
4731
4737
|
* ```
|
|
4732
4738
|
*/
|
|
4733
|
-
setSearchQuery(query: string
|
|
4739
|
+
setSearchQuery(query: string, options?: {
|
|
4740
|
+
silent?: boolean;
|
|
4741
|
+
}): void;
|
|
4734
4742
|
/**
|
|
4735
4743
|
* Get the underlying Leaflet map instance for advanced usage.
|
|
4736
4744
|
*
|
package/dist/sep-map.esm.js
CHANGED
|
@@ -9,10 +9,9 @@ return F.jsx("div",{className:"sep-search-results",children:/* @__PURE__ */F.jsx
|
|
|
9
9
|
return F.jsx("div",{className:"sep-search-results",children:/* @__PURE__ */F.jsxs("div",{className:"sep-search-status sep-search-status--error",role:"alert",children:[
|
|
10
10
|
/* @__PURE__ */F.jsx("span",{className:"sep-search-error-icon","aria-hidden":"true",children:"⚠️"}),
|
|
11
11
|
/* @__PURE__ */F.jsx("span",{children:u("search.error")})]})});if(0===e.length)/* @__PURE__ */
|
|
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;/* @__PURE__ */
|
|
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:[
|
|
14
|
-
|
|
15
|
-
return F.jsx("div",{ref:o?p:void 0,children:/* @__PURE__ */F.jsx(ti,{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))})}),ni=k.forwardRef(function({onSelect:e,onPerimeterSelect:t,onMunicipalitySelect:i,onRegionSelect:n,onCustomResultSelect:r,onSearchClear:o,placement:s="top-left",externalContainer:a,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:s}=Tt(),[a,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():[],a={};for(const t of i){const i=r.customSearch.searchLocal(t.id,e);i.length>0&&(a[t.id]=i)}if(n.length>0||Object.keys(a).length>0){const e=Mt([],[],[],n,[],a,kt(o.features?.search),i,s);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 a=o.features?.search,l=kt(a);try{const c=[],h=[],d={signal:t,districts:a?.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=(a?.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,s);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,s]),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=>{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||a.length>=i)&&g(!0)},[c,a,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,s);u(e)}else g(!1),u([])}catch(n){g(!1),u([])}finally{d(!1)}}},[r.perimeter,r.customSearch,o.features?.search,o.features?.perimeterSelection,s]),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:a,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=>{x(e),_.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"!==s?`sep-search--${s}`:"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:[
|
|
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
|
+
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(ti,{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))})}),ni=k.forwardRef(function({onSelect:e,onPerimeterSelect:t,onMunicipalitySelect:i,onRegionSelect:n,onCustomResultSelect:r,onSearchClear:o,placement:s="top-left",externalContainer:a,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:s}=Tt(),[a,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():[],a={};for(const t of i){const i=r.customSearch.searchLocal(t.id,e);i.length>0&&(a[t.id]=i)}if(n.length>0||Object.keys(a).length>0){const e=Mt([],[],[],n,[],a,kt(o.features?.search),i,s);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 a=o.features?.search,l=kt(a);try{const c=[],h=[],d={signal:t,districts:a?.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=(a?.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,s);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,s]),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||a.length>=i)&&g(!0)},[c,a,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,s);u(e)}else g(!1),u([])}catch(n){g(!1),u([])}finally{d(!1)}}},[r.perimeter,r.customSearch,o.features?.search,o.features?.perimeterSelection,s]),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:a,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"!==s?`sep-search--${s}`:"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:[
|
|
16
15
|
/* @__PURE__ */F.jsxs("div",{className:"sep-search__input-container",children:[
|
|
17
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:[
|
|
18
17
|
/* @__PURE__ */F.jsx("circle",{cx:"11",cy:"11",r:"8"}),
|
|
@@ -41,6 +40,6 @@ return F.jsxs("div",{className:"sep-map-view",children:[
|
|
|
41
40
|
/* @__PURE__ */F.jsx(pi,{}),
|
|
42
41
|
/* @__PURE__ */F.jsx(fi,{attribution:d.attribution}),
|
|
43
42
|
/* @__PURE__ */F.jsx(di,{layers:h}),
|
|
44
|
-
/* @__PURE__ */F.jsx(ci,{perimeterService:l.perimeter,addressService:l.address,onPerimeterClick:t,onAddressClick:i,onMapReady:e,enableAddressClick:!0===a.features?.mapClickSelect,enablePerimeterClick:!1!==a.features?.perimeterSelection,paused:c}),s]}),r&&h.layerManager&&/* @__PURE__ */F.jsx(li,{layers:h,position:u})]})});class gi 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)))}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 At.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),s=this._map.getBounds(),a=this._map.project(s.getNorthWest(),t.zoom).subtract(o);z.DomUtil.setTransform(this._glMapCanvas,a.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 _i(e){const t=e.trim().split(/\s+/);return[parseFloat(t[0]),parseFloat(t[1])]}function yi(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 vi(e){return yi(e.trim().replace(/^\(/,"").replace(/\)$/,"")).map(e=>{const t=e.replace(/^\(/,"").replace(/\)$/,"");return t.split(",").map(e=>e.trim()).filter(Boolean).map(_i)})}function bi(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:vi(t.substring(e))}}if(i.startsWith("MULTIPOLYGON")){const e=t.indexOf("(");if(-1===e)return null;return{type:"MultiPolygon",coordinates:yi(t.substring(e+1,t.lastIndexOf(")"))).map(vi)}}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(bi).filter(e=>null!==e)}}return null}function xi(){const e=oi(),{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,s=()=>{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=bi(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))};s();const a=t.subscribe(e=>e.items,s);return()=>{a(),i.clearLayers(),o.clear(),i.remove()}},[e,t,r]),null}z.MapboxGL=gi,z.mapboxGL=function(e){return new gi(e)};const wi=k.forwardRef(function(e,t){const{onAddressSelected:i,onPerimeterSelected:n,onMunicipalitySelected:r,onCustomResultSelected:o,onSelectionChanged:s,onReady:a,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);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=>{x.current?.setQuery(e)}}),[_,d,p,f,l,h,g]),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(!s)return;const e=p.subscribe(e=>{s(e.getAll())});return()=>{e()}},[p,s]);const w=k.useCallback(e=>{p.getState().add({type:"address",data:e}),i?.(e)},[p,i]),T=k.useCallback(e=>{p.getState().add({type:"perimeter",data:e}),n?.(e)},[p,n]),S=k.useCallback(e=>{p.getState().add({type:"municipality",data:e}),r?.(e)},[p,r]),P=k.useCallback((e,t)=>{o?.(e,t)},[o]),C=k.useCallback(e=>{y(e)},[y]);return k.useEffect(()=>{_&&f&&!v.current&&(v.current=!0,a?.(_))},[_,f,a]),/* @__PURE__ */F.jsxs("div",{className:"sep-map-root","data-theme":h.ui?.theme||"light",children:[h.features?.addressSearch&&/* @__PURE__ */F.jsx(ni,{ref:x,onSelect:w,onPerimeterSelect:T,onMunicipalitySelect:S,onCustomResultSelect:P,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(mi,{onReady:C,onPerimeterClick:T,onAddressClick:w,showLayerControl:h.ui?.showLayerControl,layersConfig:h.map?.layers,children:/* @__PURE__ */F.jsx(xi,{})})]})});delete z.Icon.Default.prototype._getIconUrl,z.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRek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fsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class Ti{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 st(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,...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/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1c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9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+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+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rpVq11ysA2Rp7gTfPfktc6zhtXBBC+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}\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(wi,{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=hi(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){this.mapRef.current?.setSearchQuery(e)}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=hi(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 Si extends HTMLElement{constructor(){super(),t(this,"sdk",null)}static get observedAttributes(){return["language","token","features","api-url"]}connectedCallback(){const e=document.createElement("div");e.style.width="100%",e.style.height="100%",this.appendChild(e);const t=this.buildConfig();this.sdk=new Ti({...t,container:e,useShadowDom:!1}),this.forwardEvents()}disconnectedCallback(){this.sdk?.destroy(),this.sdk=null}attributeChangedCallback(e,t,i){if(t!==i&&this.sdk&&"language"===e)i&&this.sdk.setLanguage(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");return{center:e?JSON.parse(e):void 0,zoom:t?parseInt(t,10):void 0,bounds:i?JSON.parse(i):void 0}}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",Si),"undefined"!=typeof window&&"undefined"!=typeof SEPMapLib&&(window.SEPMapSDK=SEPMapLib.SEPMapSDK);export{st as AddressService,pt as CustomSearchService,nt as I18nManager,lt as PerimeterService,Ti as SEPMapSDK,Ti as default};
|
|
43
|
+
/* @__PURE__ */F.jsx(ci,{perimeterService:l.perimeter,addressService:l.address,onPerimeterClick:t,onAddressClick:i,onMapReady:e,enableAddressClick:!0===a.features?.mapClickSelect,enablePerimeterClick:!1!==a.features?.perimeterSelection,paused:c}),s]}),r&&h.layerManager&&/* @__PURE__ */F.jsx(li,{layers:h,position:u})]})});class gi 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)))}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 At.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),s=this._map.getBounds(),a=this._map.project(s.getNorthWest(),t.zoom).subtract(o);z.DomUtil.setTransform(this._glMapCanvas,a.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 _i(e){const t=e.trim().split(/\s+/);return[parseFloat(t[0]),parseFloat(t[1])]}function yi(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 vi(e){return yi(e.trim().replace(/^\(/,"").replace(/\)$/,"")).map(e=>{const t=e.replace(/^\(/,"").replace(/\)$/,"");return t.split(",").map(e=>e.trim()).filter(Boolean).map(_i)})}function bi(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:vi(t.substring(e))}}if(i.startsWith("MULTIPOLYGON")){const e=t.indexOf("(");if(-1===e)return null;return{type:"MultiPolygon",coordinates:yi(t.substring(e+1,t.lastIndexOf(")"))).map(vi)}}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(bi).filter(e=>null!==e)}}return null}function xi(){const e=oi(),{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,s=()=>{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=bi(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))};s();const a=t.subscribe(e=>e.items,s);return()=>{a(),i.clearLayers(),o.clear(),i.remove()}},[e,t,r]),null}z.MapboxGL=gi,z.mapboxGL=function(e){return new gi(e)};const wi=k.forwardRef(function(e,t){const{onAddressSelected:i,onPerimeterSelected:n,onMunicipalitySelected:r,onCustomResultSelected:o,onSelectionChanged:s,onReady:a,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);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)}}),[_,d,p,f,l,h,g]),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(!s)return;const e=p.subscribe(e=>{s(e.getAll())});return()=>{e()}},[p,s]);const w=k.useCallback(e=>{p.getState().add({type:"address",data:e}),i?.(e)},[p,i]),T=k.useCallback(e=>{p.getState().add({type:"perimeter",data:e}),n?.(e)},[p,n]),S=k.useCallback(e=>{p.getState().add({type:"municipality",data:e}),r?.(e)},[p,r]),P=k.useCallback((e,t)=>{o?.(e,t)},[o]),C=k.useCallback(e=>{y(e)},[y]);return k.useEffect(()=>{_&&f&&!v.current&&(v.current=!0,a?.(_))},[_,f,a]),/* @__PURE__ */F.jsxs("div",{className:"sep-map-root","data-theme":h.ui?.theme||"light",children:[h.features?.addressSearch&&/* @__PURE__ */F.jsx(ni,{ref:x,onSelect:w,onPerimeterSelect:T,onMunicipalitySelect:S,onCustomResultSelect:P,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}:{}}}),
|
|
44
|
+
/* @__PURE__ */F.jsx(mi,{onReady:C,onPerimeterClick:T,onAddressClick:w,showLayerControl:h.ui?.showLayerControl,layersConfig:h.map?.layers,children:/* @__PURE__ */F.jsx(xi,{})})]})});delete z.Icon.Default.prototype._getIconUrl,z.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLM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R/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class Ti{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 st(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,...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,iVBORw0KGgoAAAANSUhEUgA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YzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+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}\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(wi,{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=hi(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)}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=hi(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 Si extends HTMLElement{constructor(){super(),t(this,"sdk",null)}static get observedAttributes(){return["language","token","features","api-url"]}connectedCallback(){const e=document.createElement("div");e.style.width="100%",e.style.height="100%",this.appendChild(e);const t=this.buildConfig();this.sdk=new Ti({...t,container:e,useShadowDom:!1}),this.forwardEvents()}disconnectedCallback(){this.sdk?.destroy(),this.sdk=null}attributeChangedCallback(e,t,i){if(t!==i&&this.sdk&&"language"===e)i&&this.sdk.setLanguage(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");return{center:e?JSON.parse(e):void 0,zoom:t?parseInt(t,10):void 0,bounds:i?JSON.parse(i):void 0}}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",Si),"undefined"!=typeof window&&"undefined"!=typeof SEPMapLib&&(window.SEPMapSDK=SEPMapLib.SEPMapSDK);export{st as AddressService,pt as CustomSearchService,nt as I18nManager,lt as PerimeterService,Ti as SEPMapSDK,Ti as default};
|
|
46
45
|
//# sourceMappingURL=sep-map.esm.js.map
|