@map-colonies/react-components 4.4.2 → 4.5.0

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.
@@ -1,13 +1,13 @@
1
- (function(g,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react"),require("date-fns"),require("date-fns/locale"),require("@material-ui/pickers"),require("@date-io/date-fns"),require("@material-ui/core/styles"),require("@material-ui/core"),require("@map-colonies/react-core"),require("@material-ui/core/useMediaQuery"),require("react-datepicker"),require("date-fns/locale/he"),require("moment"),require("@turf/rewind"),require("ol"),require("ol/ol.css"),require("ol/coordinate"),require("ol/control"),require("ol/control/MousePosition"),require("ol/proj"),require("ol/layer"),require("ol/source"),require("ol/format"),require("ol/interaction"),require("ol/interaction/Draw"),require("@material-ui/core/TableHead"),require("@material-ui/core/utils"),require("@material-ui/core/CssBaseline"),require("@material-ui/core/ScopedCssBaseline"),require("react-dom"),require("resium"),require("cesium"),require("lodash"),require("@turf/boolean-point-in-polygon"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("@turf/helpers"),require("@turf/bbox"),require("@turf/bbox-polygon"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","date-fns","date-fns/locale","@material-ui/pickers","@date-io/date-fns","@material-ui/core/styles","@material-ui/core","@map-colonies/react-core","@material-ui/core/useMediaQuery","react-datepicker","date-fns/locale/he","moment","@turf/rewind","ol","ol/ol.css","ol/coordinate","ol/control","ol/control/MousePosition","ol/proj","ol/layer","ol/source","ol/format","ol/interaction","ol/interaction/Draw","@material-ui/core/TableHead","@material-ui/core/utils","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/boolean-point-in-polygon","@map-colonies/react-core/dist/linear-progress/styles","@turf/helpers","@turf/bbox","@turf/bbox-polygon","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize"],r):(g=typeof globalThis<"u"?globalThis:g||self,r(g.reactComponents={},g.jsxRuntime,g.React,g.dateFns,g.locale,g.pickers,g.DateFnsUtils,g.styles,g.core,g.reactCore,g.useMediaQuery,g.DatePicker,g.datePickerHebrewLocale,g.moment,g.rewind,g.ol,null,g.coordinate,g.control,g.MousePosition,g.proj,g.layer,g.source,g.format,g.interaction,g.Draw,g.TableHead,g.utils,g.CssBaseline,g.ScopedCssBaseline,g.ReactDOM,g.resium,g.Cesium,g.lodash,g.booleanPointInPolygon,null,g.turf,g.bbox,g.bboxPolygon,g.getCaretCoordinates,g.getInputSelection,g.chonky,g.chonkyIconFontawesome,g.filesize))})(this,function(g,r,c,ue,_e,Ce,je,fe,J,z,Wt,Ye,Ut,we,qt,Xe,ur,Ze,He,Ge,Kt,Je,Qe,Re,jt,Yt,Xt,et,Zt,Jt,Qt,ge,S,$,Rt,hr,en,tt,nt,tn,it,F,nn,rn){"use strict";var cr=Object.defineProperty;var dr=(g,r,c)=>r in g?cr(g,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):g[r]=c;var te=(g,r,c)=>(dr(g,typeof r!="symbol"?r+"":r,c),c);function Ve(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const rt=Ve(c),m=Ve(S),ot=Ve(en);var se=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(se||{}),de=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(de||{}),Me=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Me||{});const ee={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:de.EN},disableFuture:!0,showTime:!1,variant:"inline"},DATE_RANGE_PICKER:{dateFormat:"dd/MM/yyyy HH:mm",controlsLayout:"row",local:{setText:"set",startPlaceHolderText:"Start of time",endPlaceHolderText:"End of time",calendarLocale:de.EN},renderAsButton:!0,offset:0,disableFuture:!0}},le=e=>{const{children:n,...t}=e;return r.jsx(J.Box,{...t,children:n})},ze=e=>{const n=e.type==="dark";return c.useMemo(()=>st(e,n),[n,e])},st=(e,n=!1)=>fe.createTheme({palette:{type:n?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:n?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:n?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),gr="",on=2,sn=.5,an=fe.makeStyles(e=>fe.createStyles({container:{padding:e.spacing(on),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(sn)}})),at=e=>{var Y,O,K,N;const n=an(),t=z.useTheme(),i=ze(t),[s,o]=c.useState(null),[u,h]=c.useState(null),[p,w]=c.useState(ee.DATE_RANGE_PICKER.dateFormat),T=e.controlsLayout??ee.DATE_RANGE_PICKER.controlsLayout,P=e.disableFuture??ee.DATE_RANGE_PICKER.disableFuture,_=((Y=e.local)==null?void 0:Y.startPlaceHolderText)??ee.DATE_RANGE_PICKER.local.startPlaceHolderText,I=((O=e.local)==null?void 0:O.endPlaceHolderText)??ee.DATE_RANGE_PICKER.local.endPlaceHolderText,H=((K=e.local)==null?void 0:K.setText)??ee.DATE_RANGE_PICKER.local.setText,Z=(((N=e.local)==null?void 0:N.calendarLocale)??ee.DATE_RANGE_PICKER.local.calendarLocale)===de.HE?_e.he:_e.enUS;c.useEffect(()=>{o(e.from??null)},[e.from]),c.useEffect(()=>{h(e.to??null)},[e.to]),c.useEffect(()=>{w(e.dateFormat??ee.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=Boolean(ue.isValid(s)&&!u||ue.isValid(u)&&!s||s&&u&&ue.isValid(s)&&ue.isValid(u)&&ue.isBefore(s,u)),Q=()=>{e.onChange({from:s&&ue.isValid(s)?s:void 0,to:u&&ue.isValid(u)?u:void 0})};return r.jsx(J.ThemeProvider,{theme:i,children:r.jsx(le,{className:`${n.container} drpContainer`,display:"flex",flexDirection:T,width:T==="column"?e.contentWidth:"unset",children:r.jsxs(Ce.MuiPickersUtilsProvider,{utils:je,locale:Z,children:[r.jsx(Ce.KeyboardDateTimePicker,{variant:"inline",placeholder:_,onChange:W=>o(W),value:s,disableFuture:P,format:p,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(Ce.KeyboardDateTimePicker,{variant:"inline",placeholder:I,className:n.margin,onChange:W=>h(W),value:u,disableFuture:P,format:p,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(z.ThemeProvider,{options:t,children:r.jsx(z.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:Q,disabled:!G,children:H})})]})})})},lt=e=>{const{children:n,...t}=e;return r.jsx(J.Popover,{...t,children:n})},pr="",ln=e=>{var O,K;const[n,t]=c.useState(null),[i,s]=c.useState(null),[o,u]=c.useState(ee.DATE_RANGE_PICKER.dateFormat),[h,p]=c.useState(null),w=N=>{p(N.currentTarget)},T=N=>{N.currentTarget.tagName==="I"?p(N.currentTarget.previousElementSibling):p(N.currentTarget)},P=()=>{p(null)},_=Boolean(h),I=e.controlsLayout??"column";c.useEffect(()=>{t(e.from??null)},[e.from]),c.useEffect(()=>{s(e.to??null)},[e.to]),c.useEffect(()=>{u(e.dateFormat??ee.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const H=((O=e.local)==null?void 0:O.startPlaceHolderText)??ee.DATE_RANGE_PICKER.local.startPlaceHolderText,q=((K=e.local)==null?void 0:K.endPlaceHolderText)??ee.DATE_RANGE_PICKER.local.endPlaceHolderText,Z=e.renderAsButton===void 0?ee.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,G=e.offset===void 0?ee.DATE_RANGE_PICKER.offset:e.offset,Q=e.disableFuture===void 0?ee.DATE_RANGE_PICKER.disableFuture:e.disableFuture,Y=c.useMemo(()=>`${n?ue.format(n,o):H} - ${i?ue.format(i,o):q}`,[n,i,o,H,q]);return r.jsxs(r.Fragment,{children:[Z?r.jsx(z.Button,{style:{width:e.width},raised:!0,onClick:w,className:"drpOpener",children:Y}):r.jsx(z.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:Y,onClick:T,trailingIcon:{icon:"date_range",tabIndex:0,onClick:T}}),r.jsx(lt,{open:_,anchorEl:h,onClose:P,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:r.jsx(at,{controlsLayout:I,contentWidth:((h==null?void 0:h.clientWidth)??0)-G,dateFormat:o,disableFuture:Q,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:i??void 0,onChange:({from:N,to:W})=>{t(N??null),s(W??null),e.onChange({from:N,to:W}),P()}})})]})},Le=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,cn=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:i=()=>{},endTimeInputClassName:s="",endTimeLabel:o="",endTimeWrapperClassName:u="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:p="",startTimeLabel:w="",startTimeWrapperClassName:T=""})=>r.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[r.jsx("div",{className:`startTimeWrapper ${T}`,children:r.jsx(z.TextField,{label:w,disabled:n===null,className:`timeRangeInput ${p}`,name:"start-time",type:"time",value:we(n).format("HH:mm"),onChange:P=>{const _=we(n),I=we(P.currentTarget.value,"HH:mm"),H=_.set({hours:I.get("hours"),minutes:I.get("minutes")});i(H.toDate())}})}),r.jsx("div",{className:`endTimeWrapper ${u}`,children:r.jsx(z.TextField,{label:o,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:we(e).format("HH:mm"),onChange:P=>{const _=we(e),I=we(P.currentTarget.value,"HH:mm"),H=_.set({hours:I.get("hours"),minutes:I.get("minutes")});t(H.toDate())}})})]}),dn=c.forwardRef(({value:e,onClick:n,onInputClick:t,...i},s)=>r.jsx(z.TextField,{...i,className:"dateRangeCustomInput",readOnly:!0,onClick:o=>{n==null||n(o),t==null||t()},ref:s,value:e})),un=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:i,onShortcut:s})=>{const[o,u]=c.useState(),h=c.useMemo(()=>t.map(p=>p instanceof Function?p():p),[t]);return c.useEffect(()=>{for(const p of h){const w=i.startDate&&i.endDate&&ue.isSameDay(p.startDate,i.startDate)&&ue.isSameDay(p.endDate,i.endDate);o?p.id===o&&(w||u(void 0)):w&&u(p.id)}},[i,o,h]),r.jsx("div",{className:"shortcutsContainer",children:h.map((p,w)=>{const T=()=>{e(p.startDate),n(p.endDate)};return r.jsx(z.Button,{type:"button",className:`shortcut ${o===p.id?"selected":""}`,onClick:P=>{T(),s==null||s({startDate:p.startDate,endDate:p.endDate})},outlined:!0,children:p.label},p.id+w)})})},hn=c.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:i,monthClassName:s,selectsRange:o,onChange:u,inputName:h,showMonthYearDropdown:p,withShortcuts:w,locale:T="en"}=e,[P,_]=c.useState(null),[I,H]=c.useState(null),[q,Z]=c.useState(!1),G=o?{startDate:P,endDate:I}:P;c.useEffect(()=>{T==="he"&&Ye.registerLocale("he",Ut)},[T]),c.useEffect(()=>{var O,K;((O=e.startDate)==null?void 0:O.toString())!==(P==null?void 0:P.toString())&&_(e.startDate),((K=e.endDate)==null?void 0:K.toString())!==(I==null?void 0:I.toString())&&H(e.endDate)},[e.startDate,e.endDate,P,I]);const Q=c.useMemo(()=>{let O="pickerContainer"+(T==="he"?" pickerContainer-rtl":"");return w&&o&&(O+=" pickerContainer-withShortcuts"),O},[T,w,o]),Y=p?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return r.jsx("div",{className:Q,style:{direction:T==="he"?"rtl":"ltr"},children:r.jsx(Ye,{...e,ref:n,onClickOutside:()=>Z(!1),open:q,startDate:Le(G)?P:void 0,selected:P,endDate:Le(G)?I:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:O=>`pickerWeek ${(i==null?void 0:i(O))??""}`,dayClassName:O=>`pickerDay ${(i==null?void 0:i(O))??""}`,monthClassName:O=>`pickerMonth ${(s==null?void 0:s(O))??""}`,onChange:(O,K)=>{if(Array.isArray(O)){const[N,W]=O;_(N),H(W),u==null||u({startDate:N,endDate:W&&ue.endOfDay(W)},K)}else _(O),u==null||u(O,K)},customInput:r.jsx(dn,{name:h,onInputClick:()=>{Z(!0)}}),showTimeInput:!!(w&&o),timeInputLabel:"",customTimeInput:w&&Le(G)&&r.jsx(un,{onShortcut:O=>{u==null||u(O),Z(!1)},shortcuts:w,setEndDate:H,setStartDate:_,dateRange:G}),showMonthYearDropdown:void 0,...Y})})}),fr="",gn=e=>{const n=z.useTheme(),t=ze(n),[i,s]=c.useState(e.value),{format:o=ee.DATE_PICKER.dateFormat,variant:u=ee.DATE_PICKER.variant,disableFuture:h=ee.DATE_PICKER.disableFuture,local:p,onChange:w,showTime:T=ee.DATE_PICKER.showTime,value:P,..._}=e,{placeHolderText:I=ee.DATE_PICKER.local.placeHolderText,calendarLocale:H}=p??{placeHolderText:ee.DATE_PICKER.local.placeHolderText,calendarLocale:de.EN},q=H===de.HE?_e.he:_e.enUS,Z=G=>{s(G),w(G)};return r.jsx(J.ThemeProvider,{theme:t,children:r.jsxs(Ce.MuiPickersUtilsProvider,{utils:je,locale:q,children:[T&&r.jsx(Ce.KeyboardDateTimePicker,{variant:u,placeholder:I,onChange:Z,value:i,disableFuture:h,format:o,..._}),!T&&r.jsx(Ce.KeyboardDatePicker,{variant:u,placeholder:I,onChange:Z,value:i,disableFuture:h,format:o,..._})]})})},pn=18,fn=fe.makeStyles(e=>fe.createStyles({drawingButton:{width:e.spacing(pn)},fullWidth:{width:"100%",marginTop:"36px"}})),mn=e=>{const n=fn(),[t,i]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:o,onStartDraw:u,onReset:h}=e,p=T=>{i(T.currentTarget)},w=()=>{i(null)};return s?r.jsx(z.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:r.jsx(z.Button,{className:n.drawingButton,raised:!0,onClick:o,children:"Cancel Draw"})}):r.jsxs(le,{position:"relative",children:[r.jsx(z.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:r.jsx(z.Button,{className:n.drawingButton,raised:!0,onClick:p,children:"Draw AOI"})}),r.jsxs(z.Menu,{className:n.fullWidth,open:Boolean(t),onClose:w,children:[r.jsx(z.MenuItem,{onClick:()=>{u(se.POLYGON),w()},children:"Polygon"}),r.jsx(z.MenuItem,{onClick:()=>{u(se.BOX),w()},children:"Box"}),r.jsx(z.MenuItem,{onClick:()=>{h(),w()},children:"Clear"})]})]})},mr="";var he=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(he||{});const Pe=5,Ae=2,ct=c.createContext(null),yn=ct.Provider,dt=35,ut=32,vn=10,En=e=>e!==void 0&&e!==he.WGS84?Kt.transform([dt,ut],he.WGS84,e):[dt,ut],Cn=e=>{switch(e){case he.WEB_MERCATOR:return n=>Ze.format(n,"Mercator: {y}m, {x}m",Ae);case he.WGS84:return n=>Ze.format(n,"WGS84: {y}°N {x}°E",Pe);default:return n=>""}},$e=()=>{const e=c.useContext(ct);if(e===null)throw new Error("map context is null, please check the provider");return e},wn=e=>{const n=c.useRef(null),{allowFullScreen:t,showMousePosition:i,projection:s}=e,[o]=c.useState(new Xe.Map({view:new Xe.View({projection:s??he.WGS84}),controls:He.defaults()}));c.useEffect(()=>{o.getView().setCenter(e.center??En(e.projection))},[o,e.center,e.projection]),c.useEffect(()=>{o.getView().setZoom(e.zoom??vn)},[o,e.zoom,e.projection]);const u=(h,p)=>{p.getControls().forEach(T=>{T instanceof h&&p.removeControl(T)})};return c.useEffect(()=>{o.setTarget(n.current),t!==void 0&&t?o.addControl(new He.FullScreen):u(He.FullScreen,o)},[o,t]),c.useEffect(()=>{i!==void 0&&i?(u(Ge,o),o.addControl(new Ge({coordinateFormat:Cn(s??he.WGS84),projection:s??he.WGS84,undefinedHTML:"&nbsp;"}))):u(Ge,o)},[o,i,s]),r.jsxs(yn,{value:o,children:[r.jsx("div",{className:"map",ref:n}),e.children]})},ht=c.createContext(null),Tn=ht.Provider,Sn=()=>{const e=c.useContext(ht);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},bn=({options:e,children:n})=>{const t=$e(),[i]=c.useState(new Je.Tile(e));return c.useEffect(()=>(t.addLayer(i),()=>{t.removeLayer(i)}),[t,i]),r.jsx(Tn,{value:i,children:n})},gt=c.createContext(null),_n=gt.Provider,Mn=()=>{const e=c.useContext(gt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},Ln=({children:e})=>{const n=$e(),[t]=c.useState(new Je.Vector);return c.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),r.jsx(_n,{value:t,children:e})},pt=c.createContext(null),Pn=pt.Provider,An=()=>{const e=c.useContext(pt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},Dn=({children:e})=>{const n=Mn(),[t]=c.useState(new Qe.Vector);return c.useEffect(()=>{n.setSource(t)},[t,n]),r.jsx(Pn,{value:t,children:e})},In=({geometry:e})=>{const n=An();return c.useEffect(()=>{const i=new Re.GeoJSON().readFeature(e);return n.addFeature(i),()=>{n.removeFeature(i)}},[e,n]),null},kn=e=>{const n=Sn();return c.useEffect(()=>{n.setSource(new Qe.OSM)},[n]),null},On=({drawType:e,onPolygonSelected:n})=>{const t=$e();return c.useEffect(()=>{const i={type:"Circle"};switch(e){case se.BOX:i.geometryFunction=Yt.createBox();break;case se.POLYGON:i.type="Polygon";break;default:return}const s=new jt.Draw(i);t.addInteraction(s);const o=u=>{const p=new Re.GeoJSON().writeGeometryObject(u.feature.getGeometry());n==null||n(p)};return s.on("drawend",o),()=>{s.un("drawend",o),t.removeInteraction(s)}},[n,e,t]),null},yr="",xn=e=>{const n=t=>{const i=qt(t);e.onPolygonSelection(i)};return r.jsxs(wn,{allowFullScreen:!0,showMousePosition:!0,children:[r.jsx(bn,{children:r.jsx(kn,{})}),e.selectionPolygon&&r.jsx(Ln,{children:r.jsx(Dn,{children:r.jsx(In,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&r.jsx(On,{drawType:e.drawType,onPolygonSelected:n})]})},We=1.5,Nn=80,Bn=fe.makeStyles(e=>fe.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(We),top:e.spacing(We)},contentContainer:{marginTop:e.spacing(We),width:e.spacing(Nn)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),Fn=e=>{var p;const[n,t]=c.useState(),[i,s]=c.useState(),o=Bn(),u=w=>{s(w),t(void 0),e.handlePolygonSelected(w)},h=()=>{s(void 0),e.handlePolygonReset()};return r.jsxs("div",{className:o.map,children:[r.jsxs("div",{className:`${o.absolute}`,children:[r.jsxs(J.Paper,{className:o.filtersContainer,children:[r.jsx(mn,{onCancelDraw:()=>t(void 0),onReset:h,onStartDraw:t,isSelectionEnabled:n!==void 0}),(p=e.filters)==null?void 0:p.map((w,T)=>r.jsx("div",{className:o.filtersMargin,children:w},T))]}),r.jsx(J.Paper,{color:"red",className:`${o.contentContainer}`,children:e.children})]}),r.jsx(xn,{children:e.mapContent,onPolygonSelection:u,drawType:n,selectionPolygon:i})]})};function Hn(e){const{headCells:n,order:t,orderBy:i,onRequestSort:s,isCollapseable:o}=e,u=h=>p=>{s(p,h)};return r.jsx(Xt,{children:r.jsxs(J.TableRow,{children:[o&&r.jsx(J.TableCell,{}),n.map(h=>r.jsx(J.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:i===h.id?t:!1,children:r.jsx(J.TableSortLabel,{active:i===h.id,direction:i===h.id?t:"asc",onClick:u(h.id),children:h.label})},h.id))]})})}const Gn=et.createSvgIcon(rt.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),Vn=et.createSvgIcon(rt.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function zn(e){const{cellsMetadata:n,isRowSelected:t,item:i,onRowSelected:s,rowIndex:o,isCollapseable:u,collapsedElement:h}=e,[p,w]=c.useState(!1),T=n.length,P=()=>{s==null||s(o)};return r.jsxs(r.Fragment,{children:[r.jsxs(J.TableRow,{hover:!0,selected:t,onClick:P,children:[u&&r.jsx(J.TableCell,{padding:"checkbox",children:r.jsx(J.IconButton,{"aria-label":"expand row",size:"small",onClick:_=>{_.stopPropagation(),w(!p)},children:p?r.jsx(Vn,{}):r.jsx(Gn,{})})}),n.map(_=>r.jsx(J.TableCell,{align:_.numeric?"right":"left",padding:_.disablePadding?"none":"default",children:_.transform?_.transform(i[_.id]):i[_.id]},_.id+o.toString()))]}),u&&r.jsx(J.TableRow,{children:r.jsx(J.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:T+1,children:r.jsx(J.Collapse,{in:p,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(i)})})})]})}function $n(e){const[n,t]=c.useState(""),[i,s]=c.useState("asc"),{cellsMetadata:o,items:u,onRequestSort:h,onRowSelected:p,isCollapseable:w,collapsedElement:T,isDense:P,page:_,rowsPerPage:I,count:H,handleChangePage:q,handleChangeRowsPerPage:Z}=e,G=(Q,Y)=>{const O=n===Y&&i==="asc";s(O?"desc":"asc"),t(Y),h(Y,O?"desc":"asc")};return r.jsxs(J.TableContainer,{component:J.Paper,children:[r.jsxs(J.Table,{size:P?"small":"medium",children:[r.jsx(Hn,{headCells:o,onRequestSort:G,order:i,orderBy:n,isCollapseable:w}),r.jsxs(J.TableBody,{children:[u.map((Q,Y)=>r.jsx(zn,{item:Q,rowIndex:Y,isCollapseable:w,cellsMetadata:o,collapsedElement:T,isRowSelected:!1,onRowSelected:p},Y)),(u.length===0||I>u.length)&&r.jsx(J.TableRow,{style:{height:(P?33:53)*(I-u.length)},children:r.jsx(J.TableCell,{colSpan:w?o.length+1:o.length,children:u.length===0&&r.jsx(J.Typography,{align:"center",children:"No results :("})})})]})]}),r.jsx(J.TablePagination,{rowsPerPage:I,rowsPerPageOptions:[5,10],component:"div",count:H,page:_,onPageChange:q,onRowsPerPageChange:Z})]})}const Wn=e=>{const{children:n,...t}=e;return r.jsx(Zt,{...t,children:n})},Un=e=>{const{children:n,...t}=e;return r.jsx(Jt,{...t,children:n})},ft=e=>e*Math.PI/180,De=e=>e*(180/Math.PI),qn=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(ft(85.362/2))/Math.sin(ft(85.362/2))),vr="",mt=e=>{const n=ce(),t=c.useRef(null),[i,s]=c.useState({x:0,y:0});return c.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(o=>{o!=null&&o.endPosition&&s({...o.endPosition})},S.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),c.useEffect(()=>{const o=n.scene.globe.ellipsoid,u=n.camera.pickEllipsoid(new S.Cartesian3(i.x,i.y),o);if(u){const h=o.cartesianToCartographic(u);if(t.current){let p="";switch(e.projection){case he.WEB_MERCATOR:{const T=new S.WebMercatorProjection(o).project(h);p=`Mercator: ${T.y.toFixed(Ae)}m, ${T.x.toFixed(Ae)}m`,t.current.style.width="220px";break}case he.WGS84:{const w=S.Math.toDegrees(h.longitude).toFixed(Pe);p=`WGS84: ${S.Math.toDegrees(h.latitude).toFixed(Pe)}°N ${w}°E`,t.current.style.width="200px";break}}t.current.innerHTML=p}}},[i,t,n,e.projection]),r.jsx("div",{className:"trackerPosition",ref:t})},yt=(e,n,t)=>{let i;if(e.scene.mode!==S.SceneMode.SCENE2D)i=e.scene.pickPosition(new S.Cartesian2(n,t));else{const s=e.scene.globe.ellipsoid;i=e.camera.pickEllipsoid(new S.Cartesian2(n,t),s)}return S.Cartographic.fromCartesian(i)},Kn=(e,n,t)=>{const i=yt(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[S.Math.toDegrees(i.longitude),S.Math.toDegrees(i.latitude)]}}},jn=(e,n,t)=>{try{const i=yt(e,n,t);return{longitude:S.Math.toDegrees(i.longitude),latitude:S.Math.toDegrees(i.latitude)}}catch{return}},Er="",Ue=[1,2,3,5,10,20,30,50,100,200,300,500,1e3,2e3,3e3,5e3,1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5,1e6,2e6,3e6,5e6,1e7,2e7,3e7,5e7],Yn=(e,n,t,i)=>{const s=$.get(i,"METERS_UNIT")??"m",o=$.get(i,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},h=new S.EllipsoidGeodesic,p=new Date().getTime();if(p<u.lastLegendUpdate+250)return;u.lastLegendUpdate=p;const w=e.scene.canvas.clientWidth,T=e.scene.canvas.clientHeight,P=e.scene.camera.getPickRay(new S.Cartesian2(w/2|0,T-1)),_=e.scene.camera.getPickRay(new S.Cartesian2(1+w/2|0,T-1)),I=e.scene.globe,H=I.pick(P,e.scene),q=I.pick(_,e.scene);if(!H||!q)return;const Z=I.ellipsoid.cartesianToCartographic(H),G=I.ellipsoid.cartesianToCartographic(q);h.setEndPoints(Z,G);const Q=h.surfaceDistance,Y=100;let O;for(let K=Ue.length-1;!$.isNumber(O)&&K>=0;--K)Ue[K]/Q<Y&&(O=Ue[K]);if($.isNumber(O)){let K="";O>=1e3?K=`${(O/1e3).toString()} ${o}`:K=`${O.toString()} ${s}`,u.barWidth=O/Q|0,u.distanceLabel=K}t(u)},vt=e=>{const n=ce(),[t,i]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const o=p=>{Yn(n,t,i,e.locale)},u=new S.EventHelper,h=p=>{n.scene.globe.tilesLoaded&&(o(new MouseEvent("mouse")),u.removeAll())};return u.add(n.scene.globe.tileLoadProgressEvent,h),n.camera.moveEnd.addEventListener(o),()=>{try{$.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(o)}catch(p){console.log('CESIUM camera "moveEnd" remove listener failed',p)}}},[n,e.locale,t]);const s=o=>5+(125-o)/2;return r.jsx("div",{className:"scalePosition",children:$.isNumber(t.barWidth)&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"distance-legend-label",children:r.jsx("bdi",{children:t.distanceLabel})}),r.jsx("div",{className:"distance-legend-scale-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${s(t.barWidth).toString()}px`}})]})})},ie={MORPHING:S.SceneMode.MORPHING,COLUMBUS_VIEW:S.SceneMode.COLUMBUS_VIEW,SCENE2D:S.SceneMode.SCENE2D,SCENE3D:S.SceneMode.SCENE3D},Cr="",Et=(e,n)=>{const i=$.get(n.scene.globe,"_surface.tileProvider"),s=i._quadtree,o=n.canvas.height,u=$.get(n.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(i.getLevelMaximumGeometricError(h)*o/(e*u)<s.maximumScreenSpaceError)return h;return null},Xn=(e,n)=>{e=e||10;const t=[];let i=1e5,s=0;for(let o=1e8;o>i;o=o-i){const u=Et(o,n);if(u===null)break;if(u!==s){let h=o,p=o+i;for(;p-h>e;)o=h+(p-h)/2,Et(o,n)===u?h=o:p=o;t.push({level:u,height:Math.round(o)}),s=u,t.length>=2&&(i=(t[t.length-2].height-o)/1e3)}}return t},Ct=e=>{const n=ce(),[t,i]=c.useState(1),s=Xn(1,n);return c.useEffect(()=>{const o=()=>{const u=n.camera,h=.5;let p=0;switch(n.scene.mode){case ie.SCENE3D:p=n.scene.mapProjection.ellipsoid.cartesianToCartographic(u.positionWC).height;break;case ie.SCENE2D:p=(u.frustum.right-u.frustum.left)*h;break;case ie.COLUMBUS_VIEW:p=u.position.z;break;default:p=0;break}if(s.length>0){const w=s.reduce((T,P)=>Math.abs(P.height-p)<Math.abs(T.height-p)?P:T);i(w.level)}};return n.camera.moveEnd.addEventListener(o),()=>{try{$.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(o)}catch(u){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',u)}}},[n,s.length]),r.jsxs("div",{className:"zoomLevel",children:[r.jsx("div",{className:"zoomLevelValue",children:t}),r.jsx("div",{className:"zoomLevelLabel",children:$.get(e.locale,"ZOOM_LABEL")??"zoom"})]})},wr="",Zn=-1,Jn=e=>{const n=ce(),[t,i]=c.useState(),{sceneModes:s}=e,o=u=>s.findIndex(h=>h===u)>Zn;return c.useEffect(()=>{i(n.scene.mode)},[]),r.jsxs(r.Fragment,{children:[o(ie.SCENE3D)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.jsx("path",{d:"m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z"})})}),onClick:()=>{n.scene.morphTo3D(),i(ie.SCENE3D)}}),o(ie.SCENE2D)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.jsx("path",{d:"m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z"})})}),onClick:()=>{n.scene.morphTo2D(),i(ie.SCENE2D)}}),o(ie.COLUMBUS_VIEW)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.jsx("path",{d:"m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z"})})}),onClick:()=>{n.scene.morphToColumbusView(),i(ie.COLUMBUS_VIEW)}})]})},Tr="",Qn=fe.makeStyles(e=>fe.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),Rn=e=>{const n=ce(),{baseMaps:t}=e,[i,s]=c.useState(" "),[o,u]=c.useState(),h=Qn();c.useEffect(()=>{const w=t==null?void 0:t.maps.find(T=>T.isCurrent);w&&(u(w),s(w.title!==void 0?w.title:" "))},[t]);const p=w=>{var T,P;if(t){(T=n.layersManager)==null||T.removeBaseMapLayers();const _=t.maps.find(I=>I.id===w);_&&((P=n.layersManager)==null||P.setBaseMapLayers(_),u(_),t.maps.forEach(I=>{I.isCurrent=_===I}))}};return r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"mapLabel",children:i}),r.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(w=>r.jsx("li",{className:`mapContainer ${h.mapContainer} ${w===o?"mapContainerSelected":""}`,children:r.jsx("img",{alt:"",className:"mapContainerImg",src:w.thumbnail,onMouseOver:()=>{s(w.title)},onMouseOut:()=>{s((o==null?void 0:o.title)!==void 0?o.title:" ")},onClick:()=>{p(w.id)}})},w.id))})]})},Sr="",qe="ic_settings_24px",ei=e=>{const[n,t]=c.useState(!1),{sceneModes:i,baseMaps:s,locale:o}=e,u=c.useRef(null),h=$.get(o,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",p=$.get(o,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",w=$.get(o,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const T=P=>{var H;const _=P.target,I=$.get(u,"current");I&&!I.contains(_)&&_.id!==qe&&((H=_.parentElement)==null?void 0:H.id)!==qe&&(document.removeEventListener("click",T,!1),t(!1))};return document.addEventListener("click",T,!1),()=>{document.removeEventListener("click",T,!1)}}),r.jsxs(r.Fragment,{children:[r.jsx(z.Icon,{icon:r.jsx("div",{className:"settingsIconContainer",children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:qe,x:"288",y:"24",children:r.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"})})}),onClick:()=>{t(!n)}}),n&&r.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:u,children:r.jsxs(z.Dialog,{open:n,onClosed:()=>{t(!1)},children:[r.jsx(z.DialogTitle,{children:h}),r.jsxs(z.DialogContent,{children:[r.jsx("h4",{className:"sectionLabel",children:p}),r.jsx(le,{className:"mapScenesContainer",children:r.jsx(Jn,{sceneModes:i})}),r.jsx(le,{className:"baseMapsContainer",children:s&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{className:"sectionLabel",children:w}),r.jsx(Rn,{baseMaps:s})]})})]})]})})]})},br="",ti=r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24",width:"24",viewBox:"0 0 612 612",children:r.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M322.4,173.9l-129,16.2l-4.6,21.4l25.3,4.7c16.5,3.9,19.8,9.9,16.2,26.4l-41.5,195.3c-10.9,50.5,5.9,74.3,45.5,74.3 c30.7,0,66.3-14.2,82.5-33.6l4.9-23.4c-11.3,9.9-27.7,13.9-38.6,13.9c-15.5,0-21.1-10.9-17.1-30L322.4,173.9z"}),r.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),ni=({onClick:e})=>r.jsx(le,{onClick:e,className:"mapLegendToggleContainer",children:r.jsx(z.Icon,{icon:ti,className:"mapLegendIcon"})}),ii=({legend:{legendImg:e,legendDoc:n,layer:t},docText:i,imgText:s})=>{const o=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(n,"_blank")},[n]);const u=c.useCallback(()=>{const w=r.jsx(le,{className:"layerNameContainer",children:r.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?r.jsx(z.Tooltip,{content:t,children:w}):w},[t]),h=c.useCallback(()=>[typeof e=="string"&&r.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof n=="string"&&r.jsx("a",{className:"legendAction",href:n,target:"_blank",rel:"noreferrer",children:i})],[e,s,n,i]);return r.jsxs(le,{className:"mapLegend",children:[u(),r.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:o}),r.jsx(le,{className:"legendActionsContainer",children:h()})]})},ri=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:i})=>{const s=c.useCallback(()=>r.jsx(le,{className:"noLegendsContainer",children:r.jsx("h2",{className:"noLegendsMsg",children:i})}),[i]),o=c.useCallback(()=>e.length?e.map((u,h)=>r.jsx(ii,{legend:u,docText:n,imgText:t},`${u.layer}_${h}`)):s(),[e]);return r.jsx(le,{className:"mapLegendsList",children:o()})},oi=({isOpen:e,toggleSidebar:n,title:t="Map Legends",noLegendsText:i="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:o=[]})=>e?r.jsxs(z.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[r.jsx(z.DrawerHeader,{className:"sidebarHeaderContainer",children:r.jsx(z.DrawerTitle,{className:"sidebarTitle",children:t})}),r.jsxs(z.DrawerContent,{className:"sidebarContent",children:[r.jsx(z.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),r.jsx(ri,{noLegendsText:i,legends:o,actionsTexts:s})]})]}):null,pe=document.createElement("canvas"),ae=pe.getContext("2d"),wt=e=>{const i=(e==null?void 0:e.data)??[];for(let s=3;s<i.length;s+=4)if(i[s]<255)return!0;return!1},si=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,i)=>{try{ae==null||ae.clearRect(0,0,pe.width,pe.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){pe.width=e.width,pe.height=e.height,ae==null||ae.drawImage(e,0,0);const o=ae==null?void 0:ae.getImageData(0,0,pe.width,pe.height),u=wt(o);u&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(u);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{pe.width=s.width,pe.height=s.height,ae==null||ae.drawImage(s,0,0);const o=ae==null?void 0:ae.getImageData(0,0,pe.width,pe.height);wt(o)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),i(s)}})),Ie=(e,n)=>{const{west:t,east:i,north:s,south:o}=e,{west:u,east:h,north:p,south:w}=n;return t>=u&&i<=h&&s<=p&&o>=w},ke=3,Oe="hasTransparency";function Ke(e,n,t,i,s){return setTimeout(()=>{var h;const o=(h=this.layerListInstance.find(p=>{var w,T;return((w=p._imageryProvider._resource)==null?void 0:w._url)===((T=this._resource)==null?void 0:T._url)}))==null?void 0:h.meta,u=$.get(o,Oe)===!0;this.tileTransparencyCheckedCounter<ke&&!u&&si(s==null?void 0:s.url,this).then(p=>{var w;(w=this.mapViewer.layersManager)==null||w.addMetaToLayer({[Oe]:p},T=>T._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,i,s)}class Tt extends S.UrlTemplateImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",ke);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return Ke.call(this,super.requestImage.bind(this),t,i,s,o)}}class St extends S.WebMapServiceImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",ke);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return Ke.call(this,super.requestImage.bind(this),t,i,s,o)}}class bt extends S.WebMapTileServiceImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",ke);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return Ke.call(this,super.requestImage.bind(this),t,i,s,o)}}const ai=1,li=-1,_t="TRANSPARENT_BASE_LAYER";class ci{constructor(n,t,i,s){te(this,"mapViewer");te(this,"legendsList");te(this,"layerUpdated");te(this,"layers");te(this,"legendsExtractor");te(this,"layerManagerFootprintMetaFieldPath");this.mapViewer=n,this.layers=this.mapViewer.imageryLayers._layers,this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new S.Event,this.layerManagerFootprintMetaFieldPath=s,i&&this.layerUpdated.addEventListener(i,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(o=>{const u=Object.keys(o);u.length===1&&u[0]===Oe&&(this.markRelevantLayersForExtent(),this.hideNonRelevantLayers())}),this.mapViewer.imageryLayers.layerRemoved.addEventListener(()=>{this.setLegends(),this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerMoved.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerAdded.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.camera.moveEnd.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}))}get layerList(){return this.layers}addMetaToLayer(n,t){const i=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(i).then(s=>{const o=this.layers.find(t);o&&(o.meta={...o.meta??{},...n},this.setLegends(),this.layerUpdated.raiseEvent(n))})}setBaseMapLayers(n){n.baseRasteLayers.sort((i,s)=>i.zIndex-s.zIndex).forEach((i,s)=>{this.addRasterLayer(i,s,n.id)}),this.mapViewer.shouldOptimizedTileRequests&&(this.removeLayer(_t),this.addTransparentImageryProvider())}addRasterLayer(n,t,i){let s;switch(n.type){case"XYZ_LAYER":{const o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new Tt(o,this.mapViewer):new S.UrlTemplateImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new St(o,this.mapViewer):new S.WebMapServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new bt(o,this.mapViewer):new S.WebMapTileServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}}s&&(s.alpha=n.opacity,s.meta={parentBasetMapId:i,...n},n.show!==void 0&&(s.show=n.show))}removeLayer(n){const t=this.findLayerById(n);t&&this.mapViewer.imageryLayers.remove(t,!0)}removeBaseMapLayers(){this.layers.filter(t=>!!$.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!$.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}raise(n,t=1){const i=this.findLayerById(n),s=(i==null?void 0:i.meta).zIndex;if(i)for(let o=0;o<t;o++)this.mapViewer.imageryLayers.raise(i);this.updateLayersOrder(n,s,s+t)}lower(n,t=1){const i=this.findLayerById(n),s=(i==null?void 0:i.meta).zIndex,o=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(i);if(u-t<=o&&(t=u-o),i)for(let h=0;h<t;h++)this.mapViewer.imageryLayers.lower(i);this.updateLayersOrder(n,s,s-t)}raiseToTop(n){const t=this.findLayerById(n),i=(t==null?void 0:t.meta).zIndex;t&&this.mapViewer.imageryLayers.raiseToTop(t),this.updateLayersOrder(n,i,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(n){const t=this.findLayerById(n),i=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(t);this.lower(n,s-i)}length(){return this.mapViewer.imageryLayers.length}show(n,t){const i=this.get(n);i!==void 0&&(i.show=t)}showAllNotBase(n){this.layers.filter(i=>!$.get(i.meta,"parentBasetMapId")).forEach(i=>{var s;this.show((s=i.meta)==null?void 0:s.id,n)})}get(n){const t=this.findLayerById(n),i=this.mapViewer.imageryLayers.indexOf(t);return i?this.mapViewer.imageryLayers.get(i):void 0}pickImageryLayers(n){var s;const t=this.mapViewer.camera.getPickRay(n);let i;return t&&(i=(s=this.mapViewer.imageryLayers.pickImageryLayers(t,this.mapViewer.scene))==null?void 0:s.filter(o=>!$.get(o.meta,"parentBasetMapId"))),i}findLayerByPOI(n,t,i=!0){if(this.layerManagerFootprintMetaFieldPath){const s=Kn(this.mapViewer,n,t);return this.layers.filter(h=>!$.get(h.meta,"parentBasetMapId")).filter(h=>{const p=$.get(h.meta,this.layerManagerFootprintMetaFieldPath);return p!==void 0?Rt(s.geometry,{type:"Feature",properties:{},geometry:p})&&(i?h.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",h.meta),!1)}).sort((h,p)=>{var w,T;return((w=p.meta)==null?void 0:w.zIndex)-((T=h.meta)==null?void 0:T.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const n=this.mapViewer.imageryLayers.addImageryProvider(new S.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new S.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);n.meta={id:_t,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!$.get(t.meta,"parentBasetMapId")).length}findLayerById(n){return this.layers.find(t=>t.meta!==void 0?t.meta.id===n:!1)}updateLayersOrder(n,t,i){const s=t>i?ai:li,o=t<i?t:i,u=t<i?i:t;this.layers.forEach(h=>{var w;if(!$.get(h.meta,"parentBasetMapId")){const T=(w=h.meta)==null?void 0:w.zIndex;h.meta.zIndex=T>=o&&T<=u&&T!==t?T+s:T===t?i:T}})}hideNonRelevantLayers(){var n,t;for(const i of this.layers)((n=i.meta)==null?void 0:n.relevantToExtent)!==i.show&&i.imageryProvider.ready&&(i.show=((t=i.meta)==null?void 0:t.relevantToExtent)??!0)}markRelevantLayersForExtent(){var n,t;try{const i=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const o=this.layers[s],u=!$.isEmpty(i)&&!$.isEmpty(o.rectangle)&&S.Rectangle.intersection(i,o.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((n=o.meta)==null?void 0:n.skipRelevancyCheck)===!0){o.meta={...o.meta,relevantToExtent:!0};continue}const p=this.layers[h],w=((t=p.meta)==null?void 0:t[Oe])===!0;if(o!==p)if(u instanceof S.Rectangle){if(Ie(i,o.rectangle))if(Ie(i,p.rectangle)&&!w){o.meta={...o.meta??{},relevantToExtent:!1};break}else o.meta={...o.meta??{},relevantToExtent:!0};if(Ie(i,p.rectangle)&&!w){o.meta={...o.meta??{},relevantToExtent:!1};break}if(Ie(o.rectangle,p.rectangle)){if(o.meta={...o.meta??{},relevantToExtent:w},!w)break}else o.meta={...o.meta??{},relevantToExtent:!0}}else o.meta={...o.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(o.meta={...o.meta??{},relevantToExtent:u instanceof S.Rectangle})}}}catch(i){console.error(i)}}}const _r="",Mt=212,Lt=260,di=0;class ui extends S.Viewer{constructor(t,i){super(t,i);te(this,"layersManager");te(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const Pt=c.createContext(null),hi=Pt.Provider,ce=()=>{const e=c.useContext(Pt);if(e===null)throw new Error("map context is null, please check the provider");return e},gi=e=>{var k,j,R,B,U,ne,oe,ye;const n=c.useRef(null),[t,i]=c.useState(),[s,o]=c.useState(),[u,h]=c.useState(),[p,w]=c.useState(),[T,P]=c.useState(),[_,I]=c.useState(),[H,q]=c.useState(!1),[Z,G]=c.useState(),Q=c.useRef(),[Y,O]=c.useState(),[K,N]=c.useState([]),[W,re]=c.useState(),[a,l]=c.useState(!1),E=c.useRef(),[d,v]=c.useState(void 0),[f,C]=c.useState(!1),[y,b]=c.useState(),A={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,imageryProvider:!1,...e},L=(V,x,X,ve,Te)=>{const Ee=t.container,Be=Ee.clientWidth,Fe=Ee.clientHeight,be=ve+Te;return{left:`${Be-V<X?V-(X-(Be-V)):V}px`,top:`${Fe-x<be?x-(be-(Fe-x)):x}px`}},M=c.useCallback(V=>{if(n.current!==null){const x=n.current.cesiumElement,X={x:V.offsetX,y:V.offsetY};l(!1),v(X),b(jn(x,X.x,X.y)),l(!0),E.current=V}},[n]);c.useEffect(()=>{var V;if(n.current!==null){const x=n.current.cesiumElement;e.imageryContextMenu&&(x.scene.canvas.removeEventListener("contextmenu",M),x.scene.canvas.addEventListener("contextmenu",M))}i((V=n.current)==null?void 0:V.cesiumElement)},[n,e.imageryContextMenu]),c.useEffect(()=>{var V;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new ci(t,(V=e.legends)==null?void 0:V.mapLegendsExtractor,()=>{var x;N((x=t.layersManager)==null?void 0:x.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{O(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var x,X;re(e.baseMaps);const V=(x=e.baseMaps)==null?void 0:x.maps.find(ve=>ve.isCurrent);V&&t&&((X=t.layersManager)==null||X.setBaseMapLayers(V))},[e.baseMaps,t]),c.useEffect(()=>{o(e.projection??he.WGS84)},[e.projection]),c.useEffect(()=>{G(e.locale)},[e.locale]),c.useEffect(()=>{h(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{w(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{P(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{I(e.showLoadingProgress??!0)},[e.showLoadingProgress]),c.useEffect(()=>{const V=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const x=()=>{const X=t.camera.positionCartographic;return{longitude:De(X.longitude),latitude:De(X.latitude),height:X.height}};if(t.scene.mode===S.SceneMode.SCENE3D){const X=new S.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),ve=t.scene.camera.getPickRay(X),Te=t.scene.globe.pick(ve,t.scene);if(!Te)return{longitude:0,latitude:0,height:0};const Ee=t.scene.globe.ellipsoid.cartesianToCartographic(Te);return Ee!==void 0?{longitude:De(Ee.longitude),latitude:De(Ee.latitude),height:t.scene.camera.positionCartographic.height}:x()}else return x()};t&&(t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==S.SceneMode.MORPHING){const x=t.camera,X={position:V(),direction:x.direction.clone(),up:x.up.clone(),right:x.right.clone(),transform:x.transform.clone(),frustum:x.frustum.clone()};Q.current=X}}),_&&t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded===!0?q(!1):q(!0)}))},[t]),c.useEffect(()=>{const V=()=>{if(t&&Q.current){const x=Q.current;t.camera.flyTo({destination:S.Cartesian3.fromDegrees(x.position.longitude,x.position.latitude,x.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(V),()=>{if(t)try{t.scene.morphComplete.removeEventListener(V)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),c.useEffect(()=>{const V=e.zoom,x=e.center;t&&$.isNumber(V)&&$.isArray(x)&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees(x[0],x[1],qn(V)),duration:0})},[e.zoom,e.center,t]);const D=c.useCallback(()=>t&&Qt.createPortal(r.jsxs(r.Fragment,{children:[_===!0?H&&r.jsx(z.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}):r.jsx(r.Fragment,{}),r.jsxs(le,{className:"sideToolsContainer",children:[r.jsx(ei,{sceneModes:Y,baseMaps:W,locale:Z}),r.jsx(ni,{onClick:()=>C(!f)})]}),r.jsxs(le,{className:"toolsContainer",children:[u===!0?r.jsx(mt,{projection:s}):r.jsx(r.Fragment,{}),p===!0?r.jsx(Ct,{locale:Z}):r.jsx(r.Fragment,{}),T===!0?r.jsx(vt,{locale:Z}):r.jsx(r.Fragment,{})]})]}),document.querySelector(".cesium-viewer")),[W,Z,t,s,Y,u,T,f,H]);return r.jsx(ge.Viewer,{className:"viewer",full:!0,ref:n,...A,children:r.jsxs(hi,{value:t,children:[r.jsx(oi,{title:(k=e.legends)==null?void 0:k.title,isOpen:f,toggleSidebar:()=>C(!f),noLegendsText:(j=e.legends)==null?void 0:j.emptyText,legends:((R=e.legends)==null?void 0:R.legendsList)??K,actionsTexts:(B=e.legends)==null?void 0:B.actionsTexts}),e.children,D(),e.imageryContextMenu&&a&&d&&y&&c.cloneElement(e.imageryContextMenu,{data:(U=t==null?void 0:t.layersManager)==null?void 0:U.findLayerByPOI(d.x,d.y,!1),position:{x:d.x,y:d.y},coordinates:y,style:L(d.x,d.y,((ne=e.imageryContextMenuSize)==null?void 0:ne.width)??Lt,((oe=e.imageryContextMenuSize)==null?void 0:oe.height)??Mt,((ye=e.imageryContextMenuSize)==null?void 0:ye.dynamicHeightIncrement)??di),size:e.imageryContextMenuSize??{height:Mt,width:Lt},handleClose:()=>{l(!a)},contextEvt:E.current})]})})},pi=0,fi=e=>{const n=ce();return r.jsx(ge.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&n.zoomTo(t);const i=n.scene;i.globe.depthTestAgainstTerrain=!0;const s=S.Cartographic.fromCartesian(t.boundingSphere.center),o=e.heightFromGround??pi;if(o){const u=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+o),p=S.Cartesian3.subtract(h,u,new S.Cartesian3);t.modelMatrix=S.Matrix4.fromTranslation(p)}}})},xe=180,At=.001,Dt=e=>Math.abs(e)/e,It=e=>{xe-Math.abs(e[0])<At&&(e[0]=Dt(e[0])*(xe-1)),xe/2-Math.abs(e[1])<At&&(e[1]=Dt(e[1])*(xe/2-1))},kt=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{It(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{It(t)})});break}},mi=e=>{const{data:n,...t}=e,i=$.cloneDeep(n);return i&&(typeof i.features<"u"?i.features.forEach(s=>{kt(s.geometry)}):kt(i)),r.jsx(ge.GeoJsonDataSource,{data:i,...t})},Se=e=>{const{meta:n,...t}=e,i=ce();return c.useLayoutEffect(()=>{var s;(s=i.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,i]),r.jsx(ge.ImageryLayer,{...t})},yi=e=>{const{options:n,...t}=e,i=ce(),s=i.shouldOptimizedTileRequests?new St(n,i):new S.WebMapServiceImageryProvider(n);return r.jsx(Se,{...t,imageryProvider:s})},vi=e=>{const{options:n,...t}=e,i=ce(),s=i.shouldOptimizedTileRequests?new bt(n,i):new S.WebMapTileServiceImageryProvider(n);return r.jsx(Se,{...t,imageryProvider:s})},Ei=e=>{const{options:n,...t}=e,i=ce(),s=i.shouldOptimizedTileRequests?new Tt(n,i):new S.UrlTemplateImageryProvider(n);return r.jsx(Se,{...t,imageryProvider:s})},Ci=e=>{const{options:n,...t}=e;return r.jsx(Se,{...t,imageryProvider:new S.OpenStreetMapImageryProvider(n)})},Ot=e=>r.jsx(ge.Entity,{...e}),wi=e=>r.jsx(ge.EntityDescription,{...e}),xt=e=>r.jsx(ge.EntityDescription,{...e}),Nt=e=>r.jsx(ge.PolygonGraphics,{...e}),Bt=e=>r.jsx(ge.RectangleGraphics,{...e}),Ft=e=>r.jsx(ge.CustomDataSource,{...e}),Ti=e=>r.jsx(ge.PolylineGraphics,{...e}),Mr="";var me=function(){var e=m.Ellipsoid.WGS84,n,t=m.Material.fromType(m.Material.ColorType);function i(a,l=new m.Color(1,1,0,.5),E=new m.Color(1,1,1,1)){this._scene=a.scene,t.uniforms.color=l,n=E,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}i.prototype.initialiseHandlers=function(){var a=this._scene,l=this,E=new m.ScreenSpaceEventHandler(a.canvas);function d(f,C){if(l._handlersMuted!=!0){var y=a.pick(C);y&&y.primitive&&y.primitive[f]&&y.primitive[f](C)}}E.setInputAction(function(f){d("leftClick",f.position)},m.ScreenSpaceEventType.LEFT_CLICK),E.setInputAction(function(f){d("leftDoubleClick",f.position)},m.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var v;E.setInputAction(function(f){if(l._handlersMuted!=!0){var C=a.pick(f.endPosition);v&&(!C||v!=C.primitive)&&(!(v.isDestroyed&&v.isDestroyed())&&v.mouseOut(f.endPosition),v=null),C&&C.primitive&&(C=C.primitive,C.mouseOut&&(v=C),C.mouseMove&&C.mouseMove(f.endPosition))}},m.ScreenSpaceEventType.MOUSE_MOVE),E.setInputAction(function(f){d("leftUp",f.position)},m.ScreenSpaceEventType.LEFT_UP),E.setInputAction(function(f){d("leftDown",f.position)},m.ScreenSpaceEventType.LEFT_DOWN)},i.prototype.setListener=function(a,l,E){a[l]=E},i.prototype.muteHandlers=function(a){this._handlersMuted=a},i.prototype.registerEditableShape=function(a){var l=this;W(a,"mouseMove",function(E){a.setHighlighted(!0),a._editMode||l._tooltip.showAt(E,"Click to edit this shape")}),W(a,"mouseOut",function(E){a.setHighlighted(!1),l._tooltip.setVisible(!1)}),W(a,"leftClick",function(E){a.setEditMode(!0)})},i.prototype.startDrawing=function(a){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=a,this.muteHandlers(!0)},i.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},i.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},i.prototype.setHighlighted=function(a){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=a&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=a},i.prototype.disableAllEditMode=function(){this.setEdited(void 0)},i.prototype.setEdited=function(a){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=a};var s={ellipsoid:m.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},o=N(s,{appearance:new m.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),u=N(s,{}),h=N(s,{}),p=N(s,{}),w=N(o,{rotation:0}),T=N(s,{width:5,geodesic:!0,granularity:1e4,appearance:new m.PolylineMaterialAppearance({aboveGround:!1}),material:t}),P=function(){function a(){}return a.prototype.initialiseOptions=function(l){K(this,l),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},a.prototype.setAttribute=function(l,E){this[l]=E,this._createPrimitive=!0},a.prototype.getAttribute=function(l){return this[l]},a.prototype.update=function(l,E,d){if(!m.defined(this.ellipsoid))throw new m.DeveloperError("this.ellipsoid must be defined.");if(!m.defined(this.appearance))throw new m.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new m.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!m.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var v=this.getGeometry();if(!v)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new m.Primitive({geometryInstances:new m.GeometryInstance({geometry:v,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new m.Primitive({geometryInstances:new m.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:m.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new m.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var f=this._primitive;f.appearance.material=this.material,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.update(l,E,d),this._outlinePolygon&&this._outlinePolygon.update(l,E,d)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),m.destroyObject(this)},a.prototype.setStrokeStyle=function(l,E){(!this.strokeColor||!this.strokeColor.equals(l)||this.strokeWidth!=E)&&(this._createPrimitive=!0,this.strokeColor=l,this.strokeWidth=E)},a}();i.ExtentPrimitive=function(){function a(l){if(!m.defined(l.extent))throw new m.DeveloperError("Extent is required");l=N(l,o),this.initialiseOptions(l),this.setExtent(l.extent)}return a.prototype=new P,a.prototype.setExtent=function(l){this.setAttribute("extent",l)},a.prototype.getExtent=function(){return this.getAttribute("extent")},a.prototype.getGeometry=function(){if(m.defined(this.extent))return new m.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.RectangleOutlineGeometry({rectangle:this.extent})},a}(),i.PolygonPrimitive=function(){function a(l){l=N(l,o),this.initialiseOptions(l),this.isPolygon=!0}return a.prototype=new P,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getGeometry=function(){if(!(!m.defined(this.positions)||this.positions.length<3))return m.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return m.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},a}(),i.CirclePrimitive=function(){function a(l){if(!(m.defined(l.center)&&m.defined(l.radius)))throw new m.DeveloperError("Center and radius are required");l=N(l,o),this.initialiseOptions(l),this.setRadius(l.radius)}return a.prototype=new P,a.prototype.setCenter=function(l){this.setAttribute("center",l)},a.prototype.setRadius=function(l){this.setAttribute("radius",Math.max(.1,l))},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getRadius=function(){return this.getAttribute("radius")},a.prototype.getGeometry=function(){if(m.defined(this.center)&&m.defined(this.radius))return new m.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},a}(),i.EllipsePrimitive=function(){function a(l){if(!(m.defined(l.center)&&m.defined(l.semiMajorAxis)&&m.defined(l.semiMinorAxis)))throw new m.DeveloperError("Center and semi major and semi minor axis are required");l=N(l,w),this.initialiseOptions(l)}return a.prototype=new P,a.prototype.setCenter=function(l){this.setAttribute("center",l)},a.prototype.setSemiMajorAxis=function(l){l<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",l)},a.prototype.setSemiMinorAxis=function(l){l>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",l)},a.prototype.setRotation=function(l){return this.setAttribute("rotation",l)},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},a.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},a.prototype.getRotation=function(){return this.getAttribute("rotation")},a.prototype.getGeometry=function(){if(m.defined(this.center)&&m.defined(this.semiMajorAxis)&&m.defined(this.semiMinorAxis))return new m.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},a}(),i.PolylinePrimitive=function(){function a(l){l=N(l,T),this.initialiseOptions(l)}return a.prototype=new P,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.setWidth=function(l){this.setAttribute("width",l)},a.prototype.setGeodesic=function(l){this.setAttribute("geodesic",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getWidth=function(){return this.getAttribute("width")},a.prototype.getGeodesic=function(l){return this.getAttribute("geodesic")},a.prototype.getGeometry=function(){if(!(!m.defined(this.positions)||this.positions.length<2))return new m.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},a}();var _={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},I={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},H={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};i.prototype.createBillboardGroup=function(a,l,E){var d=new i.BillboardGroup(this,l);return d.addBillboards(a,E),d},i.BillboardGroup=function(a,l){this._drawHelper=a,this._scene=a._scene,this._options=N(l,_);var E=new m.BillboardCollection;this._scene.primitives.add(E),this._billboards=E,this._orderedBillboards=[]},i.BillboardGroup.prototype.createBillboard=function(a,l){var E=this._billboards.add({show:!0,position:a,pixelOffset:new m.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new m.Cartesian3(0,0,0),horizontalOrigin:m.HorizontalOrigin.CENTER,verticalOrigin:m.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:n});if(l){let f=function(y){v.enableRotate=y},C=function(){for(var y=0,b=d._orderedBillboards.length;y<b&&d._orderedBillboards[y]!=E;++y);return y};var d=this,v=this._scene.screenSpaceCameraController;if(l.dragHandlers){var d=this;W(E,"leftDown",function(b){function A(D){E.position=D;for(var k=0,j=d._orderedBillboards.length;k<j&&d._orderedBillboards[k]!=E;++k);l.dragHandlers.onDrag&&l.dragHandlers.onDrag(C(),D)}function L(D){M.destroy(),f(!0),l.dragHandlers.onDragEnd&&l.dragHandlers.onDragEnd(C(),D)}var M=new m.ScreenSpaceEventHandler(d._scene.canvas);M.setInputAction(function(D){var k=d._scene.camera.pickEllipsoid(D.endPosition,e);k?A(k):L(k)},m.ScreenSpaceEventType.MOUSE_MOVE),M.setInputAction(function(D){L(d._scene.camera.pickEllipsoid(D.position,e))},m.ScreenSpaceEventType.LEFT_UP),f(!1),l.dragHandlers.onDragStart&&l.dragHandlers.onDragStart(C(),d._scene.camera.pickEllipsoid(b,e))})}l.onDoubleClick&&W(E,"leftDoubleClick",function(y){l.onDoubleClick(C())}),l.onClick&&W(E,"leftClick",function(y){l.onClick(C())}),l.tooltip&&(W(E,"mouseMove",function(y){d._drawHelper._tooltip.showAt(y,l.tooltip())}),W(E,"mouseOut",function(y){d._drawHelper._tooltip.setVisible(!1)}))}return E},i.BillboardGroup.prototype.insertBillboard=function(a,l,E){this._orderedBillboards.splice(a,0,this.createBillboard(l,E))},i.BillboardGroup.prototype.addBillboard=function(a,l){this._orderedBillboards.push(this.createBillboard(a,l))},i.BillboardGroup.prototype.addBillboards=function(a,l){for(var E=0;E<a.length;E++)this.addBillboard(a[E],l)},i.BillboardGroup.prototype.updateBillboardsPositions=function(a){for(var l=0;l<a.length;l++)this.getBillboard(l).position=a[l]},i.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},i.BillboardGroup.prototype.getBillboard=function(a){return this._orderedBillboards[a]},i.BillboardGroup.prototype.removeBillboard=function(a){this._billboards.remove(this.getBillboard(a)),this._orderedBillboards.splice(a,1)},i.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},i.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},i.prototype.startDrawingMarker=function(l){var l=N(l,_);this.startDrawing(function(){f.remove(),C.destroy(),v.setVisible(!1)});var E=this,d=this._scene;d.primitives;var v=this._tooltip,f=new i.BillboardGroup(this,l),C=new m.ScreenSpaceEventHandler(d.canvas);C.setInputAction(function(y){if(y.position!=null){var b=d.camera.pickEllipsoid(y.position,e);b&&(f.addBillboard(b),E.stopDrawing(),l.callback(b))}},m.ScreenSpaceEventType.LEFT_CLICK),C.setInputAction(function(y){var b=y.endPosition;if(b!=null){var A=d.camera.pickEllipsoid(b,e);A?v.showAt(b,"<p>Click to add your marker. Position is: </p>"+Y(e.cartesianToCartographic(A))):v.showAt(b,"<p>Click on the globe to add your marker.</p>")}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingPolygon=function(l){var l=N(l,o);this.startDrawingPolyshape(!0,l)},i.prototype.startDrawingPolyline=function(l){var l=N(l,T);this.startDrawingPolyshape(!1,l)},i.prototype.startDrawingPolyshape=function(a,l){this.startDrawing(function(){v.remove(y),A.remove(),L.destroy(),f.setVisible(!1),G(d)});var E=this,d=this._scene,v=d.primitives,f=this._tooltip,C=a?3:2,y;a?y=new me.PolygonPrimitive(l):y=new me.PolylinePrimitive(l),y.asynchronous=!1,v.add(y);var b=[],A=new i.BillboardGroup(this,_),L=new m.ScreenSpaceEventHandler(d.canvas);Z(d),L.setInputAction(function(M){if(M.position!=null){var D=d.camera.pickEllipsoid(M.position,e);D&&(b.length==0&&(b.push(D.clone()),A.addBillboard(b[0])),b.length>=C&&(y.positions=b,y._createPrimitive=!0),b.push(D),A.addBillboard(D))}},m.ScreenSpaceEventType.LEFT_CLICK),L.setInputAction(function(M){var D=M.endPosition;if(D!=null)if(b.length==0)f.showAt(D,"<p>Click to add first point</p>");else{var k=d.camera.pickEllipsoid(D,e);k&&(b.pop(),k.y+=1+Math.random(),b.push(k),b.length>=C&&(y.positions=b,y._createPrimitive=!0),A.getBillboard(b.length-1).position=k,f.showAt(D,"<p>Click to add new point ("+b.length+")</p>"+(b.length>C?"<p>Double click to finish drawing</p>":"")))}},m.ScreenSpaceEventType.MOUSE_MOVE),L.setInputAction(function(M){var D=M.position;if(D!=null){if(b.length<C+2)return;var k=d.camera.pickEllipsoid(D,e);k&&(G(d),E.stopDrawing(),typeof l.callback=="function"&&(b.length-1,l.callback(b)))}},m.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function q(a){return e.cartographicArrayToCartesianArray([m.Rectangle.northwest(a),m.Rectangle.northeast(a),m.Rectangle.southeast(a),m.Rectangle.southwest(a)])}function Z(a){a&&(a.canvas.style.cursor="crosshair")}function G(a){a&&(a.canvas.style.cursor="")}i.prototype.startDrawingExtent=function(l){var l=N(l,o);this.startDrawing(function(){y!=null&&v.remove(y),b!=null&&b.remove(),A.destroy(),f.setVisible(!1),G(d)});var E=this,d=this._scene,v=this._scene.primitives,f=this._tooltip,C=null,y=null,b=null,A=new m.ScreenSpaceEventHandler(d.canvas);Z(d);function L(M){y==null&&(y=new me.ExtentPrimitive({extent:M,material:l.material}),y.asynchronous=!1,v.add(y)),y.setExtent(M);var D=q(M);b==null?(b=new i.BillboardGroup(E,_),b.addBillboards(D)):b.updateBillboardsPositions(D)}A.setInputAction(function(M){if(M.position!=null){var D=d.camera.pickEllipsoid(M.position,e);if(D)if(y==null){C=e.cartesianToCartographic(D);var k=Q(C,C);L(k)}else E.stopDrawing(),typeof l.callback=="function"&&l.callback(Q(C,e.cartesianToCartographic(D)))}},m.ScreenSpaceEventType.LEFT_DOWN),A.setInputAction(function(M){var D=M.endPosition;if(D!=null)if(y==null)f.showAt(D,"<p>Click to start drawing rectangle</p>");else{var k=d.camera.pickEllipsoid(D,e);if(k){var j=Q(C,e.cartesianToCartographic(k));L(j),f.showAt(D,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingCircle=function(l){var l=N(l,o);this.startDrawing(function(){C!=null&&v.remove(C),y.remove(),b.destroy(),f.setVisible(!1)});var E=this,d=this._scene,v=this._scene.primitives,f=this._tooltip,C=null,y=null,b=new m.ScreenSpaceEventHandler(d.canvas);b.setInputAction(function(A){if(A.position!=null){var L=d.camera.pickEllipsoid(A.position,e);L&&(C==null?(C=new i.CirclePrimitive({center:L,radius:0,asynchronous:!1,material:l.material}),v.add(C),y=new i.BillboardGroup(E,_),y.addBillboards([L])):(typeof l.callback=="function"&&l.callback(C.getCenter(),C.getRadius()),E.stopDrawing()))}},m.ScreenSpaceEventType.LEFT_DOWN),b.setInputAction(function(A){var L=A.endPosition;if(L!=null)if(C==null)f.showAt(L,"<p>Click to start drawing the circle</p>");else{var M=d.camera.pickEllipsoid(L,e);M&&(C.setRadius(m.Cartesian3.distance(C.getCenter(),M)),y.updateBillboardsPositions(M),f.showAt(L,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.enhancePrimitives=function(){var a=this;m.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var d=this,v=this;function f(C){a._scene.screenSpaceCameraController.enableRotate=C}W(d,"leftDown",function(C){function y(L){d.position=L,v.executeListeners({name:"drag",positions:L})}function b(L){A.destroy(),f(!0),v.executeListeners({name:"dragEnd",positions:L})}var A=new m.ScreenSpaceEventHandler(a._scene.canvas);A.setInputAction(function(L){var M=a._scene.camera.pickEllipsoid(L.endPosition,e);M?y(M):b(M)},m.ScreenSpaceEventType.MOUSE_MOVE),A.setInputAction(function(L){b(a._scene.camera.pickEllipsoid(L.position,e))},m.ScreenSpaceEventType.LEFT_UP),f(!1)}),re(d)};function l(d){a._scene,!(this._highlighted&&this._highlighted==d)&&this._editMode!==!0&&(this._highlighted=d,d?(a.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(m.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function E(d){if(this._editMode!=d)if(a.disableAllHighlights(),d){a.setEdited(this);var v=a._scene,f=this;if(this._markers==null){let k=function(B,U){var ne=B-1<0?U.length-1:B-1;ne<y.countBillboards()&&(y.getBillboard(ne).position=R(ne)),ne=B,ne<y.countBillboards()&&(y.getBillboard(ne).position=R(ne))},j=function(){f.executeListeners({name:"onEdited",positions:f.positions})},R=function(B){var U=f.positions;return e.cartographicToCartesian(new m.EllipsoidGeodesic(e.cartesianToCartographic(U[B]),e.cartesianToCartographic(U[B<U.length-1?B+1:0])).interpolateUsingFraction(.5))};var C=new i.BillboardGroup(a,I),y=new i.BillboardGroup(a,H),b={dragHandlers:{onDrag:function(B,U){f.positions[B]=U,k(B,f.positions),f._createPrimitive=!0},onDragEnd:function(B,U){f._createPrimitive=!0,j()}},onDoubleClick:function(B){f.positions.length<4||(f.positions.splice(B,1),f._createPrimitive=!0,C.removeBillboard(B),y.removeBillboard(B),k(B,f.positions),j())},tooltip:function(){if(f.positions.length>3)return"Double click to remove this point"}};C.addBillboards(f.positions,b),this._markers=C;for(var A=[],L=0,M=f.positions.length+(this.isPolygon?0:-1);L<M;L++)A.push(R(L));var D={dragHandlers:{onDragStart:function(B,U){this.index=B+1,f.positions.splice(this.index,0,U),f._createPrimitive=!0},onDrag:function(B,U){f.positions[this.index]=U,f._createPrimitive=!0},onDragEnd:function(B,U){C.insertBillboard(this.index,U,b),y.getBillboard(this.index-1).position=R(this.index-1),y.insertBillboard(this.index,R(this.index),D),f._createPrimitive=!0,j()}},tooltip:function(){return"Drag to create a new point"}};y.addBillboards(A,D),this._editMarkers=y,this._globeClickhandler=new m.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(B){var U=v.pick(B.position);U&&U.primitive||f.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),C.setOnTop(),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._editMarkers.remove(),this._markers=null,this._editMarkers=null,this._globeClickhandler.destroy()),this._editMode=!1}me.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this;d.isPolygon=!1,d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=E;var v=this.width;d.setHighlighted=function(f){this._editMode!==!0&&(f?(a.setHighlighted(this),this.setWidth(v*2)):this.setWidth(v))},d.getExtent=function(){return m.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},re(d),d.setEditMode(!1)}},me.PolygonPrimitive.prototype.setEditable=function(){var d=this;d.asynchronous=!1,a._scene,a.registerEditableShape(d),d.setEditMode=E,d.setHighlighted=l,re(d),d.setEditMode(!1)},me.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;a.registerEditableShape(d),d.asynchronous=!1,d.setEditMode=function(f){if(this._editMode!=f)if(a.disableAllHighlights(),f){if(a.setEdited(this),this._markers==null){let b=function(){d.executeListeners({name:"onEdited",extent:d.extent})};var C=new i.BillboardGroup(a,I),y={dragHandlers:{onDrag:function(A,L){var M=C.getBillboard((A+2)%4).position;d.setExtent(Q(e.cartesianToCartographic(M),e.cartesianToCartographic(L))),C.updateBillboardsPositions(q(d.extent))},onDragEnd:function(A,L){b()}},tooltip:function(){return"Drag to change the corners of this extent"}};C.addBillboards(q(d.extent),y),this._markers=C,this._globeClickhandler=new m.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(A){var L=v.pick(A.position);L&&!L.isDestroyed()&&L.primitive||d.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),C.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,re(d),d.setEditMode(!1)}},i.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=function(f){if(this._editMode!=f)if(a.disableAllHighlights(),f){a.setEdited(this);var C=this;if(this._markers==null){let A=function(){return m.EllipseOutlineGeometry(e,d.getCenter(),d.getSemiMajorAxis(),d.getSemiMinorAxis(),d.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},L=function(){d.executeListeners({name:"onEdited",center:d.getCenter(),semiMajorAxis:d.getSemiMajorAxis(),semiMinorAxis:d.getSemiMinorAxis(),rotation:0})};var y=new i.BillboardGroup(a,I),b={dragHandlers:{onDrag:function(M,D){var k=m.Cartesian3.distance(d.getCenter(),D);M%2==0?d.setSemiMajorAxis(k):d.setSemiMinorAxis(k),y.updateBillboardsPositions(A())},onDragEnd:function(M,D){L()}},tooltip:function(){return"Drag to change the excentricity and radius"}};y.addBillboards(A(),b),this._markers=y,this._globeClickhandler=new m.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(M){var D=v.pick(M.position);D&&D.primitive||C.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,re(d),d.setEditMode(!1)}},i.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(d){for(var v=m.CircleOutlineGeometry.createGeometry(new m.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:d})),f=0,C,y=[];f<v.attributes.position.values.length;f+=3)C=v.attributes.position.values,y.push(new m.Cartesian3(C[f],C[f+1],C[f+2]));return y},i.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=function(f){if(this._editMode!=f)if(a.disableAllHighlights(),f){a.setEdited(this);var C=this;if(this._markers==null){let A=function(){return C.getCircleCartesianCoordinates(m.Math.PI_OVER_TWO)},L=function(){d.executeListeners({name:"onEdited",center:d.getCenter(),radius:d.getRadius()})};var y=new i.BillboardGroup(a,I),b={dragHandlers:{onDrag:function(M,D){d.setRadius(m.Cartesian3.distance(d.getCenter(),D)),y.updateBillboardsPositions(A())},onDragEnd:function(M,D){L()}},tooltip:function(){return"Drag to change the radius"}};y.addBillboards(A(),b),this._markers=y,this._globeClickhandler=new m.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(M){var D=v.pick(M.position);D&&D.primitive||C.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,re(d),d.setEditMode(!1)}}},i.DrawHelperWidget=function(){function a(l,E){if(!m.defined(E.container))throw new m.DeveloperError("Container is required");var d={markerIcon:"./assets/img/glyphicons_242_google_maps.png",polylineIcon:"./assets/img/glyphicons_097_vector_path_line.png",polygonIcon:"./assets/img/glyphicons_096_vector_path_polygon.png",circleIcon:"./assets/img/glyphicons_095_vector_path_circle.png",extentIcon:"./assets/img/glyphicons_094_vector_path_square.png",clearIcon:"./assets/img/glyphicons_067_cleaning.png",polylineDrawingOptions:T,polygonDrawingOptions:u,extentDrawingOptions:h,circleDrawingOptions:p};K(E,d);var v=this,f=document.createElement("DIV");f.className="toolbar",E.container.appendChild(f);function C(A,L,M,D){var k=document.createElement("DIV");k.className="button",k.title=M,f.appendChild(k),k.onclick=D;var j=document.createElement("SPAN");k.appendChild(j);var R=document.createElement("IMG");return R.src=L,j.appendChild(R),k}var y=l._scene;C("marker",E.markerIcon,"Click to start drawing a 2D marker",function(){l.startDrawingMarker({callback:function(A){v.executeListeners({name:"markerCreated",position:A})}})}),C("polyline",E.polylineIcon,"Click to start drawing a 2D polyline",function(){l.startDrawingPolyline({callback:function(A){v.executeListeners({name:"polylineCreated",positions:A})}})}),C("polygon",E.polygonIcon,"Click to start drawing a 2D polygon",function(){l.startDrawingPolygon({callback:function(A){v.executeListeners({name:"polygonCreated",positions:A})}})}),C("extent",E.extentIcon,"Click to start drawing an Extent",function(){l.startDrawingExtent({callback:function(A){v.executeListeners({name:"extentCreated",extent:A})}})}),C("circle",E.circleIcon,"Click to start drawing a Circle",function(){l.startDrawingCircle({callback:function(A,L){v.executeListeners({name:"circleCreated",center:A,radius:L})}})});var b=document.createElement("DIV");b.className="divider",f.appendChild(b),C("clear",E.clearIcon,"Remove all primitives",function(){y.primitives.removeAll()}),re(this)}return a}(),i.prototype.addToolbar=function(a,l){return l=N(l,{container:a}),new i.DrawHelperWidget(this,l)};function Q(a,l){var E=new m.Rectangle;E.west=Math.min(a.longitude,l.longitude),E.east=Math.max(a.longitude,l.longitude),E.south=Math.min(a.latitude,l.latitude),E.north=Math.max(a.latitude,l.latitude);var d=m.Math.EPSILON7;return E.east-E.west<d&&(E.east+=d*2),E.north-E.south<d&&(E.north+=d*2),E}function Y(a,l){return a.longitude.toFixed(l||3)+", "+a.latitude.toFixed(l||3)}function O(a,l){if(a==null||typeof a!="object"||a.constructor!=Object&&a.constructor!=Array)return a;if(a.constructor==Date||a.constructor==RegExp||a.constructor==Function||a.constructor==String||a.constructor==Number||a.constructor==Boolean)return new a.constructor(a);l=l||new a.constructor;for(var E in a)l[E]=typeof l[E]>"u"?O(a[E],null):l[E];return l}function K(a,l){a=a||{};var E;for(E in l)a[E]===void 0&&(a[E]=O(l[E]))}function N(a,l){var E=O(a),d;for(d in l)E[d]===void 0&&(E[d]=O(l[d]));return E}function W(a,l,E){a[l]=E}function re(a){a._listeners={},a.addListener=function(l,E){return this._listeners[l]=this._listeners[l]||[],this._listeners[l].push(E),this._listeners[l].length},a.executeListeners=function(l,E){if(this._listeners[l.name]&&this._listeners[l.name].length>0)for(var d=0;d<this._listeners[l.name].length;d++)this._listeners[l.name][d](l);else E&&E(l)}}return i}();const Si=2,bi=(e,n)=>{switch(e){case se.BOX:{if(n.features.length!==Si)throw new Error(`${e} must have 2 points`);const t=$.find(n.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Me.BOTTOM_LEFT}),i=$.find(n.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Me.TOP_RIGHT});if(i&&t){if(t.geometry.coordinates[0]===i.geometry.coordinates[0]&&t.geometry.coordinates[1]===i.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return S.Rectangle.fromDegrees(t.geometry.coordinates[0],t.geometry.coordinates[1],i.geometry.coordinates[0],i.geometry.coordinates[1])}else throw new Error(`${e} geojson must define BOTTOM_LEFT and TOP_RIGHT points`)}default:throw new Error(`${e} type geoJSON still not supported`)}},Ht=e=>{const n=e.map(t=>{const i=S.Cartographic.fromCartesian(t);return[S.Math.toDegrees(i.longitude),S.Math.toDegrees(i.latitude)]});return n.push(n[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[n]}}},Gt=e=>{const n=ot.lineString([[S.Math.toDegrees(e.west),S.Math.toDegrees(e.south)],[S.Math.toDegrees(e.east),S.Math.toDegrees(e.north)]]);return nt(tt(n))},Vt=e=>{const n=ot.lineString([[e.west,e.south],[e.east,e.north]]);return nt(tt(n)).geometry.coordinates[0].map(i=>S.Cartesian3.fromRadiansArray(i)[0])};class _i extends S.Color{}const Mi=e=>{const{drawState:n,drawingMaterial:t,drawingVertexColor:i,material:s,hollow:o,outlineWidth:u}=e,h=ce(),[p,w]=c.useState();c.useEffect(()=>{w(new me(h,t,i))},[]),c.useEffect(()=>{if(p){const P=p;if(n.drawing)switch(n.type){case se.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,P.startDrawingPolygon({callback:_=>{n.handler({primitive:_,type:se.POLYGON,geojson:Ht(_)})}});break;case se.BOX:h.scene.globe.depthTestAgainstTerrain=!1,P.startDrawingExtent({callback:_=>{n.handler({primitive:_,type:se.BOX,geojson:Gt(_)})}});break;default:throw new Error(`[CESIUM DRAW]: ${n.type} unrecognized primitive to draw.`)}else P.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[n,p]);const T=P=>{try{let _=P.coordinates!==void 0?P.coordinates:bi(P.type,P.geojson);if(o!==!0)switch(P.type){case se.BOX:return r.jsx(Bt,{coordinates:_,material:s??t});case se.POLYGON:return r.jsx(Nt,{hierarchy:new S.PolygonHierarchy(_),material:s??t});default:return r.jsx(r.Fragment,{})}else{switch(P.type){case se.BOX:_=Vt(_);break;case se.POLYGON:_=[..._,_[0]];break;default:return r.jsx(r.Fragment,{})}return r.jsx(Ti,{clampToGround:!0,positions:_,width:u??1,material:s??t})}}catch(_){return console.error(_),r.jsx(r.Fragment,{})}};return r.jsx(Ft,{...e,children:e.drawings.map((P,_)=>r.jsxs(Ot,{name:P.name,children:[r.jsxs(xt,{children:[r.jsxs("h1",{children:["Drawed Entity ",P.name]}),r.jsx("p",{children:"This is description of drawed entity"})]}),T(P)]},P.id))})};class Li extends S.PolylineDashMaterialProperty{}class Pi extends S.ConstantProperty{}class Ai extends S.ConstantPositionProperty{}class Di extends S.Cartesian2{}class Ii extends S.Cartesian3{}class ki extends S.Cartographic{}class Oi extends S.BoundingSphere{}class xi extends S.Ellipsoid{}class Ni extends S.GeographicTilingScheme{}class Bi extends S.Rectangle{}class Fi extends S.Resource{}class Hi extends S.EllipsoidTerrainProvider{}class Gi extends S.CesiumTerrainProvider{}const Vi=S.VerticalOrigin,zi=S.LabelStyle,$i=e=>{const n=ce();return c.useEffect(()=>{n.extend(S.viewerCesiumInspectorMixin)},[n]),r.jsx(r.Fragment,{})},Wi=-25,zt=2,Ui=e=>{const n=ce(),t=(o,u=",")=>o.slice(o.indexOf(`
1
+ (function(g,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react"),require("date-fns"),require("date-fns/locale"),require("@material-ui/pickers"),require("@date-io/date-fns"),require("@material-ui/core/styles"),require("@material-ui/core"),require("@map-colonies/react-core"),require("@material-ui/core/useMediaQuery"),require("react-datepicker"),require("date-fns/locale/he"),require("moment"),require("@turf/rewind"),require("ol"),require("ol/ol.css"),require("ol/coordinate"),require("ol/control"),require("ol/control/MousePosition"),require("ol/proj"),require("ol/layer"),require("ol/source"),require("ol/format"),require("ol/interaction"),require("ol/interaction/Draw"),require("@material-ui/core/TableHead"),require("@material-ui/core/utils"),require("@material-ui/core/CssBaseline"),require("@material-ui/core/ScopedCssBaseline"),require("react-dom"),require("resium"),require("cesium"),require("lodash"),require("@turf/boolean-point-in-polygon"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("@cmcleese/cesium-navigation"),require("@cmcleese/cesium-navigation/dist/index.css"),require("@turf/helpers"),require("@turf/bbox"),require("@turf/bbox-polygon"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","date-fns","date-fns/locale","@material-ui/pickers","@date-io/date-fns","@material-ui/core/styles","@material-ui/core","@map-colonies/react-core","@material-ui/core/useMediaQuery","react-datepicker","date-fns/locale/he","moment","@turf/rewind","ol","ol/ol.css","ol/coordinate","ol/control","ol/control/MousePosition","ol/proj","ol/layer","ol/source","ol/format","ol/interaction","ol/interaction/Draw","@material-ui/core/TableHead","@material-ui/core/utils","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/boolean-point-in-polygon","@map-colonies/react-core/dist/linear-progress/styles","@cmcleese/cesium-navigation","@cmcleese/cesium-navigation/dist/index.css","@turf/helpers","@turf/bbox","@turf/bbox-polygon","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize"],r):(g=typeof globalThis<"u"?globalThis:g||self,r(g.reactComponents={},g.jsxRuntime,g.React,g.dateFns,g.locale,g.pickers,g.DateFnsUtils,g.styles,g.core,g.reactCore,g.useMediaQuery,g.DatePicker,g.datePickerHebrewLocale,g.moment,g.rewind,g.ol,null,g.coordinate,g.control,g.MousePosition,g.proj,g.layer,g.source,g.format,g.interaction,g.Draw,g.TableHead,g.utils,g.CssBaseline,g.ScopedCssBaseline,g.ReactDOM,g.resium,g.Cesium,g.lodash,g.booleanPointInPolygon,null,g.viewerCesiumNavigationMixin,null,g.turf,g.bbox,g.bboxPolygon,g.getCaretCoordinates,g.getInputSelection,g.chonky,g.chonkyIconFontawesome,g.filesize))})(this,function(g,r,c,he,Me,Te,je,ye,Z,z,jt,Ye,Yt,Se,Xt,Xe,fr,Ze,He,Ge,Zt,Je,Qe,Re,Jt,Qt,Rt,et,en,tn,nn,fe,S,$,rn,mr,on,yr,sn,tt,nt,an,it,F,ln,cn){"use strict";var gr=Object.defineProperty;var pr=(g,r,c)=>r in g?gr(g,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):g[r]=c;var ee=(g,r,c)=>(pr(g,typeof r!="symbol"?r+"":r,c),c);function Ve(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const rt=Ve(c),f=Ve(S),ot=Ve(sn);var se=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(se||{}),ue=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(ue||{}),Pe=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Pe||{});const R={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:ue.EN},disableFuture:!0,showTime:!1,variant:"inline"},DATE_RANGE_PICKER:{dateFormat:"dd/MM/yyyy HH:mm",controlsLayout:"row",local:{setText:"set",startPlaceHolderText:"Start of time",endPlaceHolderText:"End of time",calendarLocale:ue.EN},renderAsButton:!0,offset:0,disableFuture:!0}},ce=e=>{const{children:i,...t}=e;return r.jsx(Z.Box,{...t,children:i})},ze=e=>{const i=e.type==="dark";return c.useMemo(()=>st(e,i),[i,e])},st=(e,i=!1)=>ye.createTheme({palette:{type:i?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:i?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:i?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),vr="",dn=2,un=.5,hn=ye.makeStyles(e=>ye.createStyles({container:{padding:e.spacing(dn),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(un)}})),at=e=>{var X,O,q,x;const i=hn(),t=z.useTheme(),n=ze(t),[s,o]=c.useState(null),[d,h]=c.useState(null),[m,C]=c.useState(R.DATE_RANGE_PICKER.dateFormat),w=e.controlsLayout??R.DATE_RANGE_PICKER.controlsLayout,M=e.disableFuture??R.DATE_RANGE_PICKER.disableFuture,b=((X=e.local)==null?void 0:X.startPlaceHolderText)??R.DATE_RANGE_PICKER.local.startPlaceHolderText,I=((O=e.local)==null?void 0:O.endPlaceHolderText)??R.DATE_RANGE_PICKER.local.endPlaceHolderText,B=((q=e.local)==null?void 0:q.setText)??R.DATE_RANGE_PICKER.local.setText,J=(((x=e.local)==null?void 0:x.calendarLocale)??R.DATE_RANGE_PICKER.local.calendarLocale)===ue.HE?Me.he:Me.enUS;c.useEffect(()=>{o(e.from??null)},[e.from]),c.useEffect(()=>{h(e.to??null)},[e.to]),c.useEffect(()=>{C(e.dateFormat??R.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const H=Boolean(he.isValid(s)&&!d||he.isValid(d)&&!s||s&&d&&he.isValid(s)&&he.isValid(d)&&he.isBefore(s,d)),Y=()=>{e.onChange({from:s&&he.isValid(s)?s:void 0,to:d&&he.isValid(d)?d:void 0})};return r.jsx(Z.ThemeProvider,{theme:n,children:r.jsx(ce,{className:`${i.container} drpContainer`,display:"flex",flexDirection:w,width:w==="column"?e.contentWidth:"unset",children:r.jsxs(Te.MuiPickersUtilsProvider,{utils:je,locale:J,children:[r.jsx(Te.KeyboardDateTimePicker,{variant:"inline",placeholder:b,onChange:K=>o(K),value:s,disableFuture:M,format:m,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(Te.KeyboardDateTimePicker,{variant:"inline",placeholder:I,className:i.margin,onChange:K=>h(K),value:d,disableFuture:M,format:m,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(z.ThemeProvider,{options:t,children:r.jsx(z.Button,{className:`${i.setButton} ${i.margin}`,raised:!0,onClick:Y,disabled:!H,children:B})})]})})})},lt=e=>{const{children:i,...t}=e;return r.jsx(Z.Popover,{...t,children:i})},Er="",gn=e=>{var O,q;const[i,t]=c.useState(null),[n,s]=c.useState(null),[o,d]=c.useState(R.DATE_RANGE_PICKER.dateFormat),[h,m]=c.useState(null),C=x=>{m(x.currentTarget)},w=x=>{x.currentTarget.tagName==="I"?m(x.currentTarget.previousElementSibling):m(x.currentTarget)},M=()=>{m(null)},b=Boolean(h),I=e.controlsLayout??"column";c.useEffect(()=>{t(e.from??null)},[e.from]),c.useEffect(()=>{s(e.to??null)},[e.to]),c.useEffect(()=>{d(e.dateFormat??R.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const B=((O=e.local)==null?void 0:O.startPlaceHolderText)??R.DATE_RANGE_PICKER.local.startPlaceHolderText,W=((q=e.local)==null?void 0:q.endPlaceHolderText)??R.DATE_RANGE_PICKER.local.endPlaceHolderText,J=e.renderAsButton===void 0?R.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,H=e.offset===void 0?R.DATE_RANGE_PICKER.offset:e.offset,Y=e.disableFuture===void 0?R.DATE_RANGE_PICKER.disableFuture:e.disableFuture,X=c.useMemo(()=>`${i?he.format(i,o):B} - ${n?he.format(n,o):W}`,[i,n,o,B,W]);return r.jsxs(r.Fragment,{children:[J?r.jsx(z.Button,{style:{width:e.width},raised:!0,onClick:C,className:"drpOpener",children:X}):r.jsx(z.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:X,onClick:w,trailingIcon:{icon:"date_range",tabIndex:0,onClick:w}}),r.jsx(lt,{open:b,anchorEl:h,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:r.jsx(at,{controlsLayout:I,contentWidth:((h==null?void 0:h.clientWidth)??0)-H,dateFormat:o,disableFuture:Y,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:i??void 0,to:n??void 0,onChange:({from:x,to:K})=>{t(x??null),s(K??null),e.onChange({from:x,to:K}),M()}})})]})},Ae=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,pn=({endDate:e,startDate:i,setEndDate:t=()=>{},setStartDate:n=()=>{},endTimeInputClassName:s="",endTimeLabel:o="",endTimeWrapperClassName:d="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:m="",startTimeLabel:C="",startTimeWrapperClassName:w=""})=>r.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[r.jsx("div",{className:`startTimeWrapper ${w}`,children:r.jsx(z.TextField,{label:C,disabled:i===null,className:`timeRangeInput ${m}`,name:"start-time",type:"time",value:Se(i).format("HH:mm"),onChange:M=>{const b=Se(i),I=Se(M.currentTarget.value,"HH:mm"),B=b.set({hours:I.get("hours"),minutes:I.get("minutes")});n(B.toDate())}})}),r.jsx("div",{className:`endTimeWrapper ${d}`,children:r.jsx(z.TextField,{label:o,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Se(e).format("HH:mm"),onChange:M=>{const b=Se(e),I=Se(M.currentTarget.value,"HH:mm"),B=b.set({hours:I.get("hours"),minutes:I.get("minutes")});t(B.toDate())}})})]}),fn=c.forwardRef(({value:e,onClick:i,onInputClick:t,...n},s)=>r.jsx(z.TextField,{...n,className:"dateRangeCustomInput",readOnly:!0,onClick:o=>{i==null||i(o),t==null||t()},ref:s,value:e})),mn=({setStartDate:e=()=>{},setEndDate:i=()=>{},shortcuts:t,dateRange:n,onShortcut:s})=>{const[o,d]=c.useState(),h=c.useMemo(()=>t.map(m=>m instanceof Function?m():m),[t]);return c.useEffect(()=>{for(const m of h){const C=n.startDate&&n.endDate&&he.isSameDay(m.startDate,n.startDate)&&he.isSameDay(m.endDate,n.endDate);o?m.id===o&&(C||d(void 0)):C&&d(m.id)}},[n,o,h]),r.jsx("div",{className:"shortcutsContainer",children:h.map((m,C)=>{const w=()=>{e(m.startDate),i(m.endDate)};return r.jsx(z.Button,{type:"button",className:`shortcut ${o===m.id?"selected":""}`,onClick:M=>{w(),s==null||s({startDate:m.startDate,endDate:m.endDate})},outlined:!0,children:m.label},m.id+C)})})},yn=c.forwardRef((e,i)=>{const{calendarClassName:t,dayClassName:n,monthClassName:s,selectsRange:o,onChange:d,inputName:h,showMonthYearDropdown:m,withShortcuts:C,locale:w="en"}=e,[M,b]=c.useState(null),[I,B]=c.useState(null),[W,J]=c.useState(!1),H=o?{startDate:M,endDate:I}:M;c.useEffect(()=>{w==="he"&&Ye.registerLocale("he",Yt)},[w]),c.useEffect(()=>{var O,q;((O=e.startDate)==null?void 0:O.toString())!==(M==null?void 0:M.toString())&&b(e.startDate),((q=e.endDate)==null?void 0:q.toString())!==(I==null?void 0:I.toString())&&B(e.endDate)},[e.startDate,e.endDate,M,I]);const Y=c.useMemo(()=>{let O="pickerContainer"+(w==="he"?" pickerContainer-rtl":"");return C&&o&&(O+=" pickerContainer-withShortcuts"),O},[w,C,o]),X=m?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return r.jsx("div",{className:Y,style:{direction:w==="he"?"rtl":"ltr"},children:r.jsx(Ye,{...e,ref:i,onClickOutside:()=>J(!1),open:W,startDate:Ae(H)?M:void 0,selected:M,endDate:Ae(H)?I:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:O=>`pickerWeek ${(n==null?void 0:n(O))??""}`,dayClassName:O=>`pickerDay ${(n==null?void 0:n(O))??""}`,monthClassName:O=>`pickerMonth ${(s==null?void 0:s(O))??""}`,onChange:(O,q)=>{if(Array.isArray(O)){const[x,K]=O;b(x),B(K),d==null||d({startDate:x,endDate:K&&he.endOfDay(K)},q)}else b(O),d==null||d(O,q)},customInput:r.jsx(fn,{name:h,onInputClick:()=>{J(!0)}}),showTimeInput:!!(C&&o),timeInputLabel:"",customTimeInput:C&&Ae(H)&&r.jsx(mn,{onShortcut:O=>{d==null||d(O),J(!1)},shortcuts:C,setEndDate:B,setStartDate:b,dateRange:H}),showMonthYearDropdown:void 0,...X})})}),Cr="",vn=e=>{const i=z.useTheme(),t=ze(i),[n,s]=c.useState(e.value),{format:o=R.DATE_PICKER.dateFormat,variant:d=R.DATE_PICKER.variant,disableFuture:h=R.DATE_PICKER.disableFuture,local:m,onChange:C,showTime:w=R.DATE_PICKER.showTime,value:M,...b}=e,{placeHolderText:I=R.DATE_PICKER.local.placeHolderText,calendarLocale:B}=m??{placeHolderText:R.DATE_PICKER.local.placeHolderText,calendarLocale:ue.EN},W=B===ue.HE?Me.he:Me.enUS,J=H=>{s(H),C(H)};return r.jsx(Z.ThemeProvider,{theme:t,children:r.jsxs(Te.MuiPickersUtilsProvider,{utils:je,locale:W,children:[w&&r.jsx(Te.KeyboardDateTimePicker,{variant:d,placeholder:I,onChange:J,value:n,disableFuture:h,format:o,...b}),!w&&r.jsx(Te.KeyboardDatePicker,{variant:d,placeholder:I,onChange:J,value:n,disableFuture:h,format:o,...b})]})})},En=18,Cn=ye.makeStyles(e=>ye.createStyles({drawingButton:{width:e.spacing(En)},fullWidth:{width:"100%",marginTop:"36px"}})),wn=e=>{const i=Cn(),[t,n]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:o,onStartDraw:d,onReset:h}=e,m=w=>{n(w.currentTarget)},C=()=>{n(null)};return s?r.jsx(z.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:r.jsx(z.Button,{className:i.drawingButton,raised:!0,onClick:o,children:"Cancel Draw"})}):r.jsxs(ce,{position:"relative",children:[r.jsx(z.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:r.jsx(z.Button,{className:i.drawingButton,raised:!0,onClick:m,children:"Draw AOI"})}),r.jsxs(z.Menu,{className:i.fullWidth,open:Boolean(t),onClose:C,children:[r.jsx(z.MenuItem,{onClick:()=>{d(se.POLYGON),C()},children:"Polygon"}),r.jsx(z.MenuItem,{onClick:()=>{d(se.BOX),C()},children:"Box"}),r.jsx(z.MenuItem,{onClick:()=>{h(),C()},children:"Clear"})]})]})},wr="";var ge=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(ge||{});const De=5,Ie=2,ct=c.createContext(null),Tn=ct.Provider,dt=35,ut=32,Sn=10,bn=e=>e!==void 0&&e!==ge.WGS84?Zt.transform([dt,ut],ge.WGS84,e):[dt,ut],_n=e=>{switch(e){case ge.WEB_MERCATOR:return i=>Ze.format(i,"Mercator: {y}m, {x}m",Ie);case ge.WGS84:return i=>Ze.format(i,"WGS84: {y}°N {x}°E",De);default:return i=>""}},$e=()=>{const e=c.useContext(ct);if(e===null)throw new Error("map context is null, please check the provider");return e},Ln=e=>{const i=c.useRef(null),{allowFullScreen:t,showMousePosition:n,projection:s}=e,[o]=c.useState(new Xe.Map({view:new Xe.View({projection:s??ge.WGS84}),controls:He.defaults()}));c.useEffect(()=>{o.getView().setCenter(e.center??bn(e.projection))},[o,e.center,e.projection]),c.useEffect(()=>{o.getView().setZoom(e.zoom??Sn)},[o,e.zoom,e.projection]);const d=(h,m)=>{m.getControls().forEach(w=>{w instanceof h&&m.removeControl(w)})};return c.useEffect(()=>{o.setTarget(i.current),t!==void 0&&t?o.addControl(new He.FullScreen):d(He.FullScreen,o)},[o,t]),c.useEffect(()=>{n!==void 0&&n?(d(Ge,o),o.addControl(new Ge({coordinateFormat:_n(s??ge.WGS84),projection:s??ge.WGS84,undefinedHTML:"&nbsp;"}))):d(Ge,o)},[o,n,s]),r.jsxs(Tn,{value:o,children:[r.jsx("div",{className:"map",ref:i}),e.children]})},ht=c.createContext(null),Mn=ht.Provider,Pn=()=>{const e=c.useContext(ht);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},An=({options:e,children:i})=>{const t=$e(),[n]=c.useState(new Je.Tile(e));return c.useEffect(()=>(t.addLayer(n),()=>{t.removeLayer(n)}),[t,n]),r.jsx(Mn,{value:n,children:i})},gt=c.createContext(null),Dn=gt.Provider,In=()=>{const e=c.useContext(gt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},kn=({children:e})=>{const i=$e(),[t]=c.useState(new Je.Vector);return c.useEffect(()=>(i.addLayer(t),()=>{i.removeLayer(t)}),[i,t]),r.jsx(Dn,{value:t,children:e})},pt=c.createContext(null),On=pt.Provider,xn=()=>{const e=c.useContext(pt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},Nn=({children:e})=>{const i=In(),[t]=c.useState(new Qe.Vector);return c.useEffect(()=>{i.setSource(t)},[t,i]),r.jsx(On,{value:t,children:e})},Bn=({geometry:e})=>{const i=xn();return c.useEffect(()=>{const n=new Re.GeoJSON().readFeature(e);return i.addFeature(n),()=>{i.removeFeature(n)}},[e,i]),null},Fn=e=>{const i=Pn();return c.useEffect(()=>{i.setSource(new Qe.OSM)},[i]),null},Hn=({drawType:e,onPolygonSelected:i})=>{const t=$e();return c.useEffect(()=>{const n={type:"Circle"};switch(e){case se.BOX:n.geometryFunction=Qt.createBox();break;case se.POLYGON:n.type="Polygon";break;default:return}const s=new Jt.Draw(n);t.addInteraction(s);const o=d=>{const m=new Re.GeoJSON().writeGeometryObject(d.feature.getGeometry());i==null||i(m)};return s.on("drawend",o),()=>{s.un("drawend",o),t.removeInteraction(s)}},[i,e,t]),null},Tr="",Gn=e=>{const i=t=>{const n=Xt(t);e.onPolygonSelection(n)};return r.jsxs(Ln,{allowFullScreen:!0,showMousePosition:!0,children:[r.jsx(An,{children:r.jsx(Fn,{})}),e.selectionPolygon&&r.jsx(kn,{children:r.jsx(Nn,{children:r.jsx(Bn,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&r.jsx(Hn,{drawType:e.drawType,onPolygonSelected:i})]})},We=1.5,Vn=80,zn=ye.makeStyles(e=>ye.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(We),top:e.spacing(We)},contentContainer:{marginTop:e.spacing(We),width:e.spacing(Vn)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),$n=e=>{var m;const[i,t]=c.useState(),[n,s]=c.useState(),o=zn(),d=C=>{s(C),t(void 0),e.handlePolygonSelected(C)},h=()=>{s(void 0),e.handlePolygonReset()};return r.jsxs("div",{className:o.map,children:[r.jsxs("div",{className:`${o.absolute}`,children:[r.jsxs(Z.Paper,{className:o.filtersContainer,children:[r.jsx(wn,{onCancelDraw:()=>t(void 0),onReset:h,onStartDraw:t,isSelectionEnabled:i!==void 0}),(m=e.filters)==null?void 0:m.map((C,w)=>r.jsx("div",{className:o.filtersMargin,children:C},w))]}),r.jsx(Z.Paper,{color:"red",className:`${o.contentContainer}`,children:e.children})]}),r.jsx(Gn,{children:e.mapContent,onPolygonSelection:d,drawType:i,selectionPolygon:n})]})};function Wn(e){const{headCells:i,order:t,orderBy:n,onRequestSort:s,isCollapseable:o}=e,d=h=>m=>{s(m,h)};return r.jsx(Rt,{children:r.jsxs(Z.TableRow,{children:[o&&r.jsx(Z.TableCell,{}),i.map(h=>r.jsx(Z.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:n===h.id?t:!1,children:r.jsx(Z.TableSortLabel,{active:n===h.id,direction:n===h.id?t:"asc",onClick:d(h.id),children:h.label})},h.id))]})})}const Un=et.createSvgIcon(rt.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),qn=et.createSvgIcon(rt.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function Kn(e){const{cellsMetadata:i,isRowSelected:t,item:n,onRowSelected:s,rowIndex:o,isCollapseable:d,collapsedElement:h}=e,[m,C]=c.useState(!1),w=i.length,M=()=>{s==null||s(o)};return r.jsxs(r.Fragment,{children:[r.jsxs(Z.TableRow,{hover:!0,selected:t,onClick:M,children:[d&&r.jsx(Z.TableCell,{padding:"checkbox",children:r.jsx(Z.IconButton,{"aria-label":"expand row",size:"small",onClick:b=>{b.stopPropagation(),C(!m)},children:m?r.jsx(qn,{}):r.jsx(Un,{})})}),i.map(b=>r.jsx(Z.TableCell,{align:b.numeric?"right":"left",padding:b.disablePadding?"none":"default",children:b.transform?b.transform(n[b.id]):n[b.id]},b.id+o.toString()))]}),d&&r.jsx(Z.TableRow,{children:r.jsx(Z.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:w+1,children:r.jsx(Z.Collapse,{in:m,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(n)})})})]})}function jn(e){const[i,t]=c.useState(""),[n,s]=c.useState("asc"),{cellsMetadata:o,items:d,onRequestSort:h,onRowSelected:m,isCollapseable:C,collapsedElement:w,isDense:M,page:b,rowsPerPage:I,count:B,handleChangePage:W,handleChangeRowsPerPage:J}=e,H=(Y,X)=>{const O=i===X&&n==="asc";s(O?"desc":"asc"),t(X),h(X,O?"desc":"asc")};return r.jsxs(Z.TableContainer,{component:Z.Paper,children:[r.jsxs(Z.Table,{size:M?"small":"medium",children:[r.jsx(Wn,{headCells:o,onRequestSort:H,order:n,orderBy:i,isCollapseable:C}),r.jsxs(Z.TableBody,{children:[d.map((Y,X)=>r.jsx(Kn,{item:Y,rowIndex:X,isCollapseable:C,cellsMetadata:o,collapsedElement:w,isRowSelected:!1,onRowSelected:m},X)),(d.length===0||I>d.length)&&r.jsx(Z.TableRow,{style:{height:(M?33:53)*(I-d.length)},children:r.jsx(Z.TableCell,{colSpan:C?o.length+1:o.length,children:d.length===0&&r.jsx(Z.Typography,{align:"center",children:"No results :("})})})]})]}),r.jsx(Z.TablePagination,{rowsPerPage:I,rowsPerPageOptions:[5,10],component:"div",count:B,page:b,onPageChange:W,onRowsPerPageChange:J})]})}const Yn=e=>{const{children:i,...t}=e;return r.jsx(en,{...t,children:i})},Xn=e=>{const{children:i,...t}=e;return r.jsx(tn,{...t,children:i})},ft=e=>e*Math.PI/180,ke=e=>e*(180/Math.PI),Zn=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(ft(85.362/2))/Math.sin(ft(85.362/2))),Sr="",mt=(e,i,t)=>{let n;if(e.scene.mode!==S.SceneMode.SCENE2D)n=e.scene.pickPosition(new S.Cartesian2(i,t));else{const s=e.scene.globe.ellipsoid;n=e.camera.pickEllipsoid(new S.Cartesian2(i,t),s)}return S.Cartographic.fromCartesian(n)},Jn=(e,i,t)=>{const n=mt(e,i,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[S.Math.toDegrees(n.longitude),S.Math.toDegrees(n.latitude)]}}},yt=(e,i,t)=>{try{const n=mt(e,i,t);return{longitude:S.Math.toDegrees(n.longitude),latitude:S.Math.toDegrees(n.latitude)}}catch{return}};class Qn extends S.PolylineDashMaterialProperty{}class Rn extends S.ConstantProperty{}class ei extends S.ConstantPositionProperty{}class ti extends S.Cartesian2{}class ni extends S.Cartesian3{}class vt extends S.Cartographic{}class ii extends S.BoundingSphere{}class ri extends S.Ellipsoid{}class oi extends S.GeographicTilingScheme{}class si extends S.Rectangle{}class ai extends S.Resource{}class li extends S.EllipsoidTerrainProvider{}class ci extends S.CesiumTerrainProvider{}const di=S.VerticalOrigin,ui=S.LabelStyle,Et=e=>{const i=le(),t=c.useRef(null),[n,s]=c.useState({x:0,y:0});return c.useEffect(()=>{i.screenSpaceEventHandler.setInputAction(o=>{if(o!=null&&o.endPosition){const d={...o.endPosition};d.x=Math.ceil(d.x),d.y=Math.ceil(d.y),s(d)}},S.ScreenSpaceEventType.MOUSE_MOVE)},[t,i]),c.useEffect(()=>{const o=i.scene.globe.ellipsoid;if(n){const d=yt(i,n.x,n.y);if(d){const h=new vt(d.longitude,d.latitude);if(t.current){let m="";switch(e.projection){case ge.WEB_MERCATOR:{const w=new S.WebMercatorProjection(o).project(h);m=`Mercator: ${w.y.toFixed(Ie)}m, ${w.x.toFixed(Ie)}m`,t.current.style.width="220px";break}case ge.WGS84:{const C=h.longitude.toFixed(De);m=`WGS84: ${h.latitude.toFixed(De)}°N ${C}°E`,t.current.style.width="200px";break}}t.current.innerHTML=m}}}},[n,t,i,e.projection]),r.jsx("div",{className:"trackerPosition",ref:t})},br="",Ue=[1,2,3,5,10,20,30,50,100,200,300,500,1e3,2e3,3e3,5e3,1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5,1e6,2e6,3e6,5e6,1e7,2e7,3e7,5e7],hi=(e,i,t,n)=>{const s=$.get(n,"METERS_UNIT")??"m",o=$.get(n,"KILOMETERS_UNIT")??"km",d={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:i.lastLegendUpdate},h=new S.EllipsoidGeodesic,m=new Date().getTime();if(m<d.lastLegendUpdate+250)return;d.lastLegendUpdate=m;const C=e.scene.canvas.clientWidth,w=e.scene.canvas.clientHeight,M=e.scene.camera.getPickRay(new S.Cartesian2(C/2|0,w-1)),b=e.scene.camera.getPickRay(new S.Cartesian2(1+C/2|0,w-1)),I=e.scene.globe,B=I.pick(M,e.scene),W=I.pick(b,e.scene);if(!B||!W)return;const J=I.ellipsoid.cartesianToCartographic(B),H=I.ellipsoid.cartesianToCartographic(W);h.setEndPoints(J,H);const Y=h.surfaceDistance,X=100;let O;for(let q=Ue.length-1;!$.isNumber(O)&&q>=0;--q)Ue[q]/Y<X&&(O=Ue[q]);if($.isNumber(O)){let q="";O>=1e3?q=`${(O/1e3).toString()} ${o}`:q=`${O.toString()} ${s}`,d.barWidth=O/Y|0,d.distanceLabel=q}t(d)},Ct=e=>{const i=le(),[t,n]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const o=m=>{hi(i,t,n,e.locale)},d=new S.EventHelper,h=m=>{i.scene.globe.tilesLoaded&&(o(new MouseEvent("mouse")),d.removeAll())};return d.add(i.scene.globe.tileLoadProgressEvent,h),i.camera.moveEnd.addEventListener(o),()=>{try{$.get(i,"_cesiumWidget")!=null&&i.camera.moveEnd.removeEventListener(o)}catch(m){console.log('CESIUM camera "moveEnd" remove listener failed',m)}}},[i,e.locale,t]);const s=o=>5+(125-o)/2;return r.jsx("div",{className:"scalePosition",children:$.isNumber(t.barWidth)&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"scale-tracker-label",children:r.jsx("bdi",{children:t.distanceLabel})}),r.jsx("div",{className:"scale-tracker-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${s(t.barWidth).toString()}px`}})]})})},ie={MORPHING:S.SceneMode.MORPHING,COLUMBUS_VIEW:S.SceneMode.COLUMBUS_VIEW,SCENE2D:S.SceneMode.SCENE2D,SCENE3D:S.SceneMode.SCENE3D},_r="",wt=(e,i)=>{const n=$.get(i.scene.globe,"_surface.tileProvider"),s=n._quadtree,o=i.canvas.height,d=$.get(i.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(n.getLevelMaximumGeometricError(h)*o/(e*d)<s.maximumScreenSpaceError)return h;return null},gi=(e,i)=>{e=e||10;const t=[];let n=1e5,s=0;for(let o=1e8;o>n;o=o-n){const d=wt(o,i);if(d===null)break;if(d!==s){let h=o,m=o+n;for(;m-h>e;)o=h+(m-h)/2,wt(o,i)===d?h=o:m=o;t.push({level:d,height:Math.round(o)}),s=d,t.length>=2&&(n=(t[t.length-2].height-o)/1e3)}}return t},Tt=({locale:e=void 0,valueBy:i="RENDERED_TILES"})=>{const t=le(),[n,s]=c.useState(1),o=gi(1,t),d=c.useCallback(()=>{const w=t.camera,M=.5;let b=0;switch(t.scene.mode){case ie.SCENE3D:b=t.scene.mapProjection.ellipsoid.cartesianToCartographic(w.positionWC).height;break;case ie.SCENE2D:b=(w.frustum.right-w.frustum.left)*M;break;case ie.COLUMBUS_VIEW:b=w.position.z;break;default:b=0;break}if(o.length>0){const I=o.reduce((B,W)=>Math.abs(W.height-b)<Math.abs(B.height-b)?W:B);s(I.level)}},[t,o]),h=c.useCallback(()=>{let w=0;t.scene.globe._surface.forEachRenderedTile(function(M){w=Math.max(w,M.level)}),s(w)},[t]),C=c.useMemo(()=>({CALCULATION:d,RENDERED_TILES:h}),[d,h])[i];return c.useEffect(()=>{const w=t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded&&C()});return t.camera.moveEnd.addEventListener(C),()=>{try{typeof $.get(t,"_cesiumWidget")<"u"&&(t.camera.moveEnd.removeEventListener(C),w())}catch(M){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',M)}}},[t,C]),r.jsxs("div",{className:"zoomLevel",children:[r.jsx("div",{className:"zoomLevelValue",children:n}),r.jsx("div",{className:"zoomLevelLabel",children:$.get(e,"ZOOM_LABEL")??"zoom"})]})},Lr="",pi=-1,fi=e=>{const i=le(),[t,n]=c.useState(),{sceneModes:s}=e,o=d=>s.findIndex(h=>h===d)>pi;return c.useEffect(()=>{n(i.scene.mode)},[]),r.jsxs(r.Fragment,{children:[o(ie.SCENE3D)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.jsx("path",{d:"m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z"})})}),onClick:()=>{i.scene.morphTo3D(),n(ie.SCENE3D)}}),o(ie.SCENE2D)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.jsx("path",{d:"m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z"})})}),onClick:()=>{i.scene.morphTo2D(),n(ie.SCENE2D)}}),o(ie.COLUMBUS_VIEW)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.jsx("path",{d:"m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z"})})}),onClick:()=>{i.scene.morphToColumbusView(),n(ie.COLUMBUS_VIEW)}})]})},Mr="",mi=ye.makeStyles(e=>ye.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),yi=e=>{const i=le(),{baseMaps:t}=e,[n,s]=c.useState(" "),[o,d]=c.useState(),h=mi();c.useEffect(()=>{const C=t==null?void 0:t.maps.find(w=>w.isCurrent);C&&(d(C),s(C.title!==void 0?C.title:" "))},[t]);const m=C=>{var w,M;if(t){(w=i.layersManager)==null||w.removeBaseMapLayers();const b=t.maps.find(I=>I.id===C);b&&((M=i.layersManager)==null||M.setBaseMapLayers(b),d(b),t.maps.forEach(I=>{I.isCurrent=b===I}))}};return r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"mapLabel",children:n}),r.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(C=>r.jsx("li",{className:`mapContainer ${h.mapContainer} ${C===o?"mapContainerSelected":""}`,children:r.jsx("img",{alt:"",className:"mapContainerImg",src:C.thumbnail,onMouseOver:()=>{s(C.title)},onMouseOut:()=>{s((o==null?void 0:o.title)!==void 0?o.title:" ")},onClick:()=>{m(C.id)}})},C.id))})]})},Pr="",qe="ic_settings_24px",vi=e=>{const[i,t]=c.useState(!1),{sceneModes:n,baseMaps:s,locale:o}=e,d=c.useRef(null),h=$.get(o,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",m=$.get(o,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",C=$.get(o,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const w=M=>{var B;const b=M.target,I=$.get(d,"current");I&&!I.contains(b)&&b.id!==qe&&((B=b.parentElement)==null?void 0:B.id)!==qe&&(document.removeEventListener("click",w,!1),t(!1))};return document.addEventListener("click",w,!1),()=>{document.removeEventListener("click",w,!1)}}),r.jsxs(r.Fragment,{children:[r.jsx(z.Icon,{icon:r.jsx("div",{className:"settingsIconContainer",children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:qe,x:"288",y:"24",children:r.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"})})}),onClick:()=>{t(!i)}}),i&&r.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:d,children:r.jsxs(z.Dialog,{open:i,onClosed:()=>{t(!1)},children:[r.jsx(z.DialogTitle,{children:h}),r.jsxs(z.DialogContent,{children:[r.jsx("h4",{className:"sectionLabel",children:m}),r.jsx(ce,{className:"mapScenesContainer",children:r.jsx(fi,{sceneModes:n})}),r.jsx(ce,{className:"baseMapsContainer",children:s&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{className:"sectionLabel",children:C}),r.jsx(yi,{baseMaps:s})]})})]})]})})]})},Ar="",Ei=r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24",width:"24",viewBox:"0 0 612 612",children:r.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M322.4,173.9l-129,16.2l-4.6,21.4l25.3,4.7c16.5,3.9,19.8,9.9,16.2,26.4l-41.5,195.3c-10.9,50.5,5.9,74.3,45.5,74.3 c30.7,0,66.3-14.2,82.5-33.6l4.9-23.4c-11.3,9.9-27.7,13.9-38.6,13.9c-15.5,0-21.1-10.9-17.1-30L322.4,173.9z"}),r.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),Ci=({onClick:e})=>r.jsx(ce,{onClick:e,className:"mapLegendToggleContainer",children:r.jsx(z.Icon,{icon:Ei,className:"mapLegendIcon"})}),wi=({legend:{legendImg:e,legendDoc:i,layer:t},docText:n,imgText:s})=>{const o=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(i,"_blank")},[i]);const d=c.useCallback(()=>{const C=r.jsx(ce,{className:"layerNameContainer",children:r.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?r.jsx(z.Tooltip,{content:t,children:C}):C},[t]),h=c.useCallback(()=>[typeof e=="string"&&r.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof i=="string"&&r.jsx("a",{className:"legendAction",href:i,target:"_blank",rel:"noreferrer",children:n})],[e,s,i,n]);return r.jsxs(ce,{className:"mapLegend",children:[d(),r.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:o}),r.jsx(ce,{className:"legendActionsContainer",children:h()})]})},Ti=({legends:e,actionsTexts:{docText:i,imgText:t},noLegendsText:n})=>{const s=c.useCallback(()=>r.jsx(ce,{className:"noLegendsContainer",children:r.jsx("h2",{className:"noLegendsMsg",children:n})}),[n]),o=c.useCallback(()=>e.length?e.map((d,h)=>r.jsx(wi,{legend:d,docText:i,imgText:t},`${d.layer}_${h}`)):s(),[e]);return r.jsx(ce,{className:"mapLegendsList",children:o()})},Si=({isOpen:e,toggleSidebar:i,title:t="Map Legends",noLegendsText:n="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:o=[]})=>e?r.jsxs(z.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[r.jsx(z.DrawerHeader,{className:"sidebarHeaderContainer",children:r.jsx(z.DrawerTitle,{className:"sidebarTitle",children:t})}),r.jsxs(z.DrawerContent,{className:"sidebarContent",children:[r.jsx(z.Icon,{onClick:i,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),r.jsx(Ti,{noLegendsText:n,legends:o,actionsTexts:s})]})]}):null,me=document.createElement("canvas"),ae=me.getContext("2d"),St=e=>{const n=(e==null?void 0:e.data)??[];for(let s=3;s<n.length;s+=4)if(n[s]<255)return!0;return!1},bi=async(e,i)=>(i&&i.tileTransparencyCheckedCounter++,new Promise((t,n)=>{try{ae==null||ae.clearRect(0,0,me.width,me.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){me.width=e.width,me.height=e.height,ae==null||ae.drawImage(e,0,0);const o=ae==null?void 0:ae.getImageData(0,0,me.width,me.height),d=St(o);d&&i&&(i.tileTransparencyCheckedCounter=i.maxTilesForTransparencyCheck),t(d);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{me.width=s.width,me.height=s.height,ae==null||ae.drawImage(s,0,0);const o=ae==null?void 0:ae.getImageData(0,0,me.width,me.height);St(o)?(i&&(i.tileTransparencyCheckedCounter=i.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),n(s)}})),Oe=(e,i)=>{const{west:t,east:n,north:s,south:o}=e,{west:d,east:h,north:m,south:C}=i;return t>=d&&n<=h&&s<=m&&o>=C},xe=3,Ne="hasTransparency";function Ke(e,i,t,n,s){return setTimeout(()=>{var h;const o=(h=this.layerListInstance.find(m=>{var C,w;return((C=m._imageryProvider._resource)==null?void 0:C._url)===((w=this._resource)==null?void 0:w._url)}))==null?void 0:h.meta,d=$.get(o,Ne)===!0;this.tileTransparencyCheckedCounter<xe&&!d&&bi(s==null?void 0:s.url,this).then(m=>{var C;(C=this.mapViewer.layersManager)==null||C.addMetaToLayer({[Ne]:m},w=>w._imageryProvider._resource._url===this._resource._url)})},0),e(i,t,n,s)}class bt extends S.UrlTemplateImageryProvider{constructor(t,n){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",xe);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=n.layersManager)==null?void 0:s.layerList,this.mapViewer=n}requestImage(t,n,s,o){return Ke.call(this,super.requestImage.bind(this),t,n,s,o)}}class _t extends S.WebMapServiceImageryProvider{constructor(t,n){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",xe);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=n.layersManager)==null?void 0:s.layerList,this.mapViewer=n}requestImage(t,n,s,o){return Ke.call(this,super.requestImage.bind(this),t,n,s,o)}}class Lt extends S.WebMapTileServiceImageryProvider{constructor(t,n){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",xe);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=n.layersManager)==null?void 0:s.layerList,this.mapViewer=n}requestImage(t,n,s,o){return Ke.call(this,super.requestImage.bind(this),t,n,s,o)}}const _i=1,Li=-1,Mt="TRANSPARENT_BASE_LAYER";class Mi{constructor(i,t,n,s){ee(this,"mapViewer");ee(this,"legendsList");ee(this,"layerUpdated");ee(this,"layers");ee(this,"legendsExtractor");ee(this,"layerManagerFootprintMetaFieldPath");this.mapViewer=i,this.layers=this.mapViewer.imageryLayers._layers,this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new S.Event,this.layerManagerFootprintMetaFieldPath=s,n&&this.layerUpdated.addEventListener(n,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(o=>{const d=Object.keys(o);d.length===1&&d[0]===Ne&&(this.markRelevantLayersForExtent(),this.hideNonRelevantLayers())}),this.mapViewer.imageryLayers.layerRemoved.addEventListener(()=>{this.setLegends(),this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerMoved.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerAdded.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.camera.moveEnd.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}))}get layerList(){return this.layers}addMetaToLayer(i,t){const n=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(n).then(s=>{const o=this.layers.find(t);o&&(o.meta={...o.meta??{},...i},this.setLegends(),this.layerUpdated.raiseEvent(i))})}setBaseMapLayers(i){i.baseRasteLayers.sort((n,s)=>n.zIndex-s.zIndex).forEach((n,s)=>{this.addRasterLayer(n,s,i.id)}),this.mapViewer.shouldOptimizedTileRequests&&(this.removeLayer(Mt),this.addTransparentImageryProvider())}addRasterLayer(i,t,n){let s;switch(i.type){case"XYZ_LAYER":{const o=i.options,d=this.mapViewer.shouldOptimizedTileRequests?new bt(o,this.mapViewer):new S.UrlTemplateImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,t);break}case"WMS_LAYER":{const o=i.options,d=this.mapViewer.shouldOptimizedTileRequests?new _t(o,this.mapViewer):new S.WebMapServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,t);break}case"WMTS_LAYER":{const o=i.options,d=this.mapViewer.shouldOptimizedTileRequests?new Lt(o,this.mapViewer):new S.WebMapTileServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,t);break}}s&&(s.alpha=i.opacity,s.meta={parentBasetMapId:n,...i},i.show!==void 0&&(s.show=i.show))}removeLayer(i){const t=this.findLayerById(i);t&&this.mapViewer.imageryLayers.remove(t,!0)}removeBaseMapLayers(){this.layers.filter(t=>!!$.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!$.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}raise(i,t=1){const n=this.findLayerById(i),s=(n==null?void 0:n.meta).zIndex;if(n)for(let o=0;o<t;o++)this.mapViewer.imageryLayers.raise(n);this.updateLayersOrder(i,s,s+t)}lower(i,t=1){const n=this.findLayerById(i),s=(n==null?void 0:n.meta).zIndex,o=this.getBaseLayersCount(),d=this.mapViewer.imageryLayers.indexOf(n);if(d-t<=o&&(t=d-o),n)for(let h=0;h<t;h++)this.mapViewer.imageryLayers.lower(n);this.updateLayersOrder(i,s,s-t)}raiseToTop(i){const t=this.findLayerById(i),n=(t==null?void 0:t.meta).zIndex;t&&this.mapViewer.imageryLayers.raiseToTop(t),this.updateLayersOrder(i,n,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(i){const t=this.findLayerById(i),n=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(t);this.lower(i,s-n)}length(){return this.mapViewer.imageryLayers.length}show(i,t){const n=this.get(i);n!==void 0&&(n.show=t)}showAllNotBase(i){this.layers.filter(n=>!$.get(n.meta,"parentBasetMapId")).forEach(n=>{var s;this.show((s=n.meta)==null?void 0:s.id,i)})}get(i){const t=this.findLayerById(i),n=this.mapViewer.imageryLayers.indexOf(t);return n?this.mapViewer.imageryLayers.get(n):void 0}pickImageryLayers(i){var s;const t=this.mapViewer.camera.getPickRay(i);let n;return t&&(n=(s=this.mapViewer.imageryLayers.pickImageryLayers(t,this.mapViewer.scene))==null?void 0:s.filter(o=>!$.get(o.meta,"parentBasetMapId"))),n}findLayerByPOI(i,t,n=!0){if(this.layerManagerFootprintMetaFieldPath){const s=Jn(this.mapViewer,i,t);return this.layers.filter(h=>!$.get(h.meta,"parentBasetMapId")).filter(h=>{const m=$.get(h.meta,this.layerManagerFootprintMetaFieldPath);return m!==void 0?rn(s.geometry,{type:"Feature",properties:{},geometry:m})&&(n?h.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",h.meta),!1)}).sort((h,m)=>{var C,w;return((C=m.meta)==null?void 0:C.zIndex)-((w=h.meta)==null?void 0:w.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const i=this.mapViewer.imageryLayers.addImageryProvider(new S.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new S.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);i.meta={id:Mt,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!$.get(t.meta,"parentBasetMapId")).length}findLayerById(i){return this.layers.find(t=>t.meta!==void 0?t.meta.id===i:!1)}updateLayersOrder(i,t,n){const s=t>n?_i:Li,o=t<n?t:n,d=t<n?n:t;this.layers.forEach(h=>{var C;if(!$.get(h.meta,"parentBasetMapId")){const w=(C=h.meta)==null?void 0:C.zIndex;h.meta.zIndex=w>=o&&w<=d&&w!==t?w+s:w===t?n:w}})}hideNonRelevantLayers(){var i,t;for(const n of this.layers)((i=n.meta)==null?void 0:i.relevantToExtent)!==n.show&&n.imageryProvider.ready&&(n.show=((t=n.meta)==null?void 0:t.relevantToExtent)??!0)}markRelevantLayersForExtent(){var i,t;try{const n=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const o=this.layers[s],d=!$.isEmpty(n)&&!$.isEmpty(o.rectangle)&&S.Rectangle.intersection(n,o.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((i=o.meta)==null?void 0:i.skipRelevancyCheck)===!0){o.meta={...o.meta,relevantToExtent:!0};continue}const m=this.layers[h],C=((t=m.meta)==null?void 0:t[Ne])===!0;if(o!==m)if(d instanceof S.Rectangle){if(Oe(n,o.rectangle))if(Oe(n,m.rectangle)&&!C){o.meta={...o.meta??{},relevantToExtent:!1};break}else o.meta={...o.meta??{},relevantToExtent:!0};if(Oe(n,m.rectangle)&&!C){o.meta={...o.meta??{},relevantToExtent:!1};break}if(Oe(o.rectangle,m.rectangle)){if(o.meta={...o.meta??{},relevantToExtent:C},!C)break}else o.meta={...o.meta??{},relevantToExtent:!0}}else o.meta={...o.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(o.meta={...o.meta??{},relevantToExtent:d instanceof S.Rectangle})}}}catch(n){console.error(n)}}}const Dr="",Ir="",Pi=e=>{const i=le(),{enableCompass:t=!0,enableZoomControls:n=!1,lockCompassNavigation:s=!1,locale:o={DIRECTION:"ltr"}}=e;return c.useEffect(()=>{if(typeof $.get(i,"cesiumNavigation")>"u"){i.extend(on,{enableCompass:t,enableZoomControls:n,enableDistanceLegend:!1}),i.cesiumNavigation.setNavigationLocked(s);const d=document.querySelector(".compass");d&&o.DIRECTION&&d.classList.add(o.DIRECTION)}return()=>{var d;(d=i.cesiumNavigation)==null||d.destroy()}},[i,t,n,o.DIRECTION,s]),null},Pt=212,At=260,Ai=0;class Di extends S.Viewer{constructor(t,n){super(t,n);ee(this,"layersManager");ee(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const Dt=c.createContext(null),Ii=Dt.Provider,le=()=>{const e=c.useContext(Dt);if(e===null)throw new Error("map context is null, please check the provider");return e},ki=e=>{var Q,N,U,te,oe,Ee,pe,de;const i=c.useRef(null),[t,n]=c.useState(),[s,o]=c.useState(),[d,h]=c.useState(),[m,C]=c.useState(),[w,M]=c.useState(),[b,I]=c.useState(),[B,W]=c.useState(),[J,H]=c.useState(!1),[Y,X]=c.useState(),O=c.useRef(),[q,x]=c.useState(),[K,re]=c.useState([]),[a,l]=c.useState(),[E,u]=c.useState(!1),v=c.useRef(),[p,T]=c.useState(void 0),[y,_]=c.useState(!1),[A,P]=c.useState(),L={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,imageryProvider:!1,...e},D=(G,V,ne,we,be)=>{const Ce=t.container,Le=Ce.clientWidth,qt=Ce.clientHeight,Kt=we+be;return{left:`${Le-G<ne?G-(ne-(Le-G)):G}px`,top:`${qt-V<Kt?V-(Kt-(qt-V)):V}px`}},k=c.useCallback(G=>{if(i.current!==null){const V=i.current.cesiumElement,ne={x:G.offsetX,y:G.offsetY};u(!1),T(ne),P(yt(V,ne.x,ne.y)),u(!0),v.current=G}},[i]);c.useEffect(()=>{var G;if(i.current!==null){const V=i.current.cesiumElement;e.imageryContextMenu&&(V.scene.canvas.removeEventListener("contextmenu",k),V.scene.canvas.addEventListener("contextmenu",k))}n((G=i.current)==null?void 0:G.cesiumElement)},[i,e.imageryContextMenu]),c.useEffect(()=>{var G;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new Mi(t,(G=e.legends)==null?void 0:G.mapLegendsExtractor,()=>{var V;re((V=t.layersManager)==null?void 0:V.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{x(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var V,ne;l(e.baseMaps);const G=(V=e.baseMaps)==null?void 0:V.maps.find(we=>we.isCurrent);G&&t&&((ne=t.layersManager)==null||ne.setBaseMapLayers(G))},[e.baseMaps,t]),c.useEffect(()=>{o(e.projection??ge.WGS84)},[e.projection]),c.useEffect(()=>{X(e.locale)},[e.locale]),c.useEffect(()=>{h(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{C(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{M(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{I(e.showCompass??!0)},[e.showCompass]),c.useEffect(()=>{W(e.showLoadingProgress??!0)},[e.showLoadingProgress]),c.useEffect(()=>{const G=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const V=()=>{const ne=t.camera.positionCartographic;return{longitude:ke(ne.longitude),latitude:ke(ne.latitude),height:ne.height}};if(t.scene.mode===S.SceneMode.SCENE3D){const ne=new S.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),we=t.scene.camera.getPickRay(ne),be=t.scene.globe.pick(we,t.scene);if(!be)return{longitude:0,latitude:0,height:0};const Ce=t.scene.globe.ellipsoid.cartesianToCartographic(be);return Ce!==void 0?{longitude:ke(Ce.longitude),latitude:ke(Ce.latitude),height:t.scene.camera.positionCartographic.height}:V()}else return V()};t&&(t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==S.SceneMode.MORPHING){const V=t.camera,ne={position:G(),direction:V.direction.clone(),up:V.up.clone(),right:V.right.clone(),transform:V.transform.clone(),frustum:V.frustum.clone()};O.current=ne}}),B&&t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded===!0?H(!1):H(!0)}))},[t]),c.useEffect(()=>{const G=()=>{if(t&&O.current){const V=O.current;t.camera.flyTo({destination:S.Cartesian3.fromDegrees(V.position.longitude,V.position.latitude,V.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(G),()=>{if(t)try{t.scene.morphComplete.removeEventListener(G)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),c.useEffect(()=>{const G=e.zoom,V=e.center;t&&$.isNumber(G)&&$.isArray(V)&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees(V[0],V[1],Zn(G)),duration:0})},[e.zoom,e.center,t]);const j=c.useCallback(()=>t&&nn.createPortal(r.jsxs(r.Fragment,{children:[B===!0?J&&r.jsx(z.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}):r.jsx(r.Fragment,{}),r.jsxs(ce,{className:"sideToolsContainer",children:[r.jsx(vi,{sceneModes:q,baseMaps:a,locale:Y}),r.jsx(Ci,{onClick:()=>_(!y)})]}),r.jsxs(ce,{className:"toolsContainer",children:[d===!0?r.jsx(Et,{projection:s}):r.jsx(r.Fragment,{}),m===!0?r.jsx(Tt,{locale:Y,valueBy:"RENDERED_TILES"}):r.jsx(r.Fragment,{}),w===!0?r.jsx(Ct,{locale:Y}):r.jsx(r.Fragment,{}),b===!0?r.jsx(Pi,{locale:Y}):r.jsx(r.Fragment,{})]})]}),document.querySelector(".cesium-viewer")),[a,Y,t,s,q,d,w,y,J]);return r.jsx(fe.Viewer,{className:"viewer",full:!0,ref:i,...L,children:r.jsxs(Ii,{value:t,children:[r.jsx(Si,{title:(Q=e.legends)==null?void 0:Q.title,isOpen:y,toggleSidebar:()=>_(!y),noLegendsText:(N=e.legends)==null?void 0:N.emptyText,legends:((U=e.legends)==null?void 0:U.legendsList)??K,actionsTexts:(te=e.legends)==null?void 0:te.actionsTexts}),e.children,j(),e.imageryContextMenu&&E&&p&&A&&c.cloneElement(e.imageryContextMenu,{data:(oe=t==null?void 0:t.layersManager)==null?void 0:oe.findLayerByPOI(p.x,p.y,!1),position:{x:p.x,y:p.y},coordinates:A,style:D(p.x,p.y,((Ee=e.imageryContextMenuSize)==null?void 0:Ee.width)??At,((pe=e.imageryContextMenuSize)==null?void 0:pe.height)??Pt,((de=e.imageryContextMenuSize)==null?void 0:de.dynamicHeightIncrement)??Ai),size:e.imageryContextMenuSize??{height:Pt,width:At},handleClose:()=>{u(!E)},contextEvt:v.current})]})})},Oi=0,xi=e=>{const i=le();return r.jsx(fe.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&i.zoomTo(t);const n=i.scene;n.globe.depthTestAgainstTerrain=!0;const s=S.Cartographic.fromCartesian(t.boundingSphere.center),o=e.heightFromGround??Oi;if(o){const d=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+o),m=S.Cartesian3.subtract(h,d,new S.Cartesian3);t.modelMatrix=S.Matrix4.fromTranslation(m)}}})},Be=180,It=.001,kt=e=>Math.abs(e)/e,Ot=e=>{Be-Math.abs(e[0])<It&&(e[0]=kt(e[0])*(Be-1)),Be/2-Math.abs(e[1])<It&&(e[1]=kt(e[1])*(Be/2-1))},xt=e=>{switch(e.type){case"LineString":e.coordinates.forEach(i=>{Ot(i)});break;case"Polygon":e.coordinates.forEach(i=>{i.forEach(t=>{Ot(t)})});break}},Ni=e=>{const{data:i,...t}=e,n=$.cloneDeep(i);return n&&(typeof n.features<"u"?n.features.forEach(s=>{xt(s.geometry)}):xt(n)),r.jsx(fe.GeoJsonDataSource,{data:n,...t})},_e=e=>{const{meta:i,...t}=e,n=le();return c.useLayoutEffect(()=>{var s;(s=n.layersManager)==null||s.addMetaToLayer(i,i.searchLayerPredicate)},[i,n]),r.jsx(fe.ImageryLayer,{...t})},Bi=e=>{const{options:i,...t}=e,n=le(),s=n.shouldOptimizedTileRequests?new _t(i,n):new S.WebMapServiceImageryProvider(i);return r.jsx(_e,{...t,imageryProvider:s})},Fi=e=>{const{options:i,...t}=e,n=le(),s=n.shouldOptimizedTileRequests?new Lt(i,n):new S.WebMapTileServiceImageryProvider(i);return r.jsx(_e,{...t,imageryProvider:s})},Hi=e=>{const{options:i,...t}=e,n=le(),s=n.shouldOptimizedTileRequests?new bt(i,n):new S.UrlTemplateImageryProvider(i);return r.jsx(_e,{...t,imageryProvider:s})},Gi=e=>{const{options:i,...t}=e;return r.jsx(_e,{...t,imageryProvider:new S.OpenStreetMapImageryProvider(i)})},Nt=e=>r.jsx(fe.Entity,{...e}),Vi=e=>r.jsx(fe.EntityDescription,{...e}),Bt=e=>r.jsx(fe.EntityDescription,{...e}),Ft=e=>r.jsx(fe.PolygonGraphics,{...e}),Ht=e=>r.jsx(fe.RectangleGraphics,{...e}),Gt=e=>r.jsx(fe.CustomDataSource,{...e}),zi=e=>r.jsx(fe.PolylineGraphics,{...e}),kr="";var ve=function(){var e=f.Ellipsoid.WGS84,i,t=f.Material.fromType(f.Material.ColorType);function n(a,l=new f.Color(1,1,0,.5),E=new f.Color(1,1,1,1)){this._scene=a.scene,t.uniforms.color=l,i=E,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}n.prototype.initialiseHandlers=function(){var a=this._scene,l=this,E=new f.ScreenSpaceEventHandler(a.canvas);function u(p,T){if(l._handlersMuted!=!0){var y=a.pick(T);y&&y.primitive&&y.primitive[p]&&y.primitive[p](T)}}E.setInputAction(function(p){u("leftClick",p.position)},f.ScreenSpaceEventType.LEFT_CLICK),E.setInputAction(function(p){u("leftDoubleClick",p.position)},f.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var v;E.setInputAction(function(p){if(l._handlersMuted!=!0){var T=a.pick(p.endPosition);v&&(!T||v!=T.primitive)&&(!(v.isDestroyed&&v.isDestroyed())&&v.mouseOut(p.endPosition),v=null),T&&T.primitive&&(T=T.primitive,T.mouseOut&&(v=T),T.mouseMove&&T.mouseMove(p.endPosition))}},f.ScreenSpaceEventType.MOUSE_MOVE),E.setInputAction(function(p){u("leftUp",p.position)},f.ScreenSpaceEventType.LEFT_UP),E.setInputAction(function(p){u("leftDown",p.position)},f.ScreenSpaceEventType.LEFT_DOWN)},n.prototype.setListener=function(a,l,E){a[l]=E},n.prototype.muteHandlers=function(a){this._handlersMuted=a},n.prototype.registerEditableShape=function(a){var l=this;K(a,"mouseMove",function(E){a.setHighlighted(!0),a._editMode||l._tooltip.showAt(E,"Click to edit this shape")}),K(a,"mouseOut",function(E){a.setHighlighted(!1),l._tooltip.setVisible(!1)}),K(a,"leftClick",function(E){a.setEditMode(!0)})},n.prototype.startDrawing=function(a){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=a,this.muteHandlers(!0)},n.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},n.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},n.prototype.setHighlighted=function(a){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=a&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=a},n.prototype.disableAllEditMode=function(){this.setEdited(void 0)},n.prototype.setEdited=function(a){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=a};var s={ellipsoid:f.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},o=x(s,{appearance:new f.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),d=x(s,{}),h=x(s,{}),m=x(s,{}),C=x(o,{rotation:0}),w=x(s,{width:5,geodesic:!0,granularity:1e4,appearance:new f.PolylineMaterialAppearance({aboveGround:!1}),material:t}),M=function(){function a(){}return a.prototype.initialiseOptions=function(l){q(this,l),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},a.prototype.setAttribute=function(l,E){this[l]=E,this._createPrimitive=!0},a.prototype.getAttribute=function(l){return this[l]},a.prototype.update=function(l,E,u){if(!f.defined(this.ellipsoid))throw new f.DeveloperError("this.ellipsoid must be defined.");if(!f.defined(this.appearance))throw new f.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new f.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!f.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var v=this.getGeometry();if(!v)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new f.Primitive({geometryInstances:new f.GeometryInstance({geometry:v,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new f.Primitive({geometryInstances:new f.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:f.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new f.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var p=this._primitive;p.appearance.material=this.material,p.debugShowBoundingVolume=this.debugShowBoundingVolume,p.update(l,E,u),this._outlinePolygon&&this._outlinePolygon.update(l,E,u)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),f.destroyObject(this)},a.prototype.setStrokeStyle=function(l,E){(!this.strokeColor||!this.strokeColor.equals(l)||this.strokeWidth!=E)&&(this._createPrimitive=!0,this.strokeColor=l,this.strokeWidth=E)},a}();n.ExtentPrimitive=function(){function a(l){if(!f.defined(l.extent))throw new f.DeveloperError("Extent is required");l=x(l,o),this.initialiseOptions(l),this.setExtent(l.extent)}return a.prototype=new M,a.prototype.setExtent=function(l){this.setAttribute("extent",l)},a.prototype.getExtent=function(){return this.getAttribute("extent")},a.prototype.getGeometry=function(){if(f.defined(this.extent))return new f.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.RectangleOutlineGeometry({rectangle:this.extent})},a}(),n.PolygonPrimitive=function(){function a(l){l=x(l,o),this.initialiseOptions(l),this.isPolygon=!0}return a.prototype=new M,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getGeometry=function(){if(!(!f.defined(this.positions)||this.positions.length<3))return f.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return f.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},a}(),n.CirclePrimitive=function(){function a(l){if(!(f.defined(l.center)&&f.defined(l.radius)))throw new f.DeveloperError("Center and radius are required");l=x(l,o),this.initialiseOptions(l),this.setRadius(l.radius)}return a.prototype=new M,a.prototype.setCenter=function(l){this.setAttribute("center",l)},a.prototype.setRadius=function(l){this.setAttribute("radius",Math.max(.1,l))},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getRadius=function(){return this.getAttribute("radius")},a.prototype.getGeometry=function(){if(f.defined(this.center)&&f.defined(this.radius))return new f.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},a}(),n.EllipsePrimitive=function(){function a(l){if(!(f.defined(l.center)&&f.defined(l.semiMajorAxis)&&f.defined(l.semiMinorAxis)))throw new f.DeveloperError("Center and semi major and semi minor axis are required");l=x(l,C),this.initialiseOptions(l)}return a.prototype=new M,a.prototype.setCenter=function(l){this.setAttribute("center",l)},a.prototype.setSemiMajorAxis=function(l){l<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",l)},a.prototype.setSemiMinorAxis=function(l){l>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",l)},a.prototype.setRotation=function(l){return this.setAttribute("rotation",l)},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},a.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},a.prototype.getRotation=function(){return this.getAttribute("rotation")},a.prototype.getGeometry=function(){if(f.defined(this.center)&&f.defined(this.semiMajorAxis)&&f.defined(this.semiMinorAxis))return new f.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},a}(),n.PolylinePrimitive=function(){function a(l){l=x(l,w),this.initialiseOptions(l)}return a.prototype=new M,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.setWidth=function(l){this.setAttribute("width",l)},a.prototype.setGeodesic=function(l){this.setAttribute("geodesic",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getWidth=function(){return this.getAttribute("width")},a.prototype.getGeodesic=function(l){return this.getAttribute("geodesic")},a.prototype.getGeometry=function(){if(!(!f.defined(this.positions)||this.positions.length<2))return new f.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},a}();var b={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},I={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},B={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};n.prototype.createBillboardGroup=function(a,l,E){var u=new n.BillboardGroup(this,l);return u.addBillboards(a,E),u},n.BillboardGroup=function(a,l){this._drawHelper=a,this._scene=a._scene,this._options=x(l,b);var E=new f.BillboardCollection;this._scene.primitives.add(E),this._billboards=E,this._orderedBillboards=[]},n.BillboardGroup.prototype.createBillboard=function(a,l){var E=this._billboards.add({show:!0,position:a,pixelOffset:new f.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new f.Cartesian3(0,0,0),horizontalOrigin:f.HorizontalOrigin.CENTER,verticalOrigin:f.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:i});if(l){let p=function(y){v.enableRotate=y},T=function(){for(var y=0,_=u._orderedBillboards.length;y<_&&u._orderedBillboards[y]!=E;++y);return y};var u=this,v=this._scene.screenSpaceCameraController;if(l.dragHandlers){var u=this;K(E,"leftDown",function(_){function A(D){E.position=D;for(var k=0,j=u._orderedBillboards.length;k<j&&u._orderedBillboards[k]!=E;++k);l.dragHandlers.onDrag&&l.dragHandlers.onDrag(T(),D)}function P(D){L.destroy(),p(!0),l.dragHandlers.onDragEnd&&l.dragHandlers.onDragEnd(T(),D)}var L=new f.ScreenSpaceEventHandler(u._scene.canvas);L.setInputAction(function(D){var k=u._scene.camera.pickEllipsoid(D.endPosition,e);k?A(k):P(k)},f.ScreenSpaceEventType.MOUSE_MOVE),L.setInputAction(function(D){P(u._scene.camera.pickEllipsoid(D.position,e))},f.ScreenSpaceEventType.LEFT_UP),p(!1),l.dragHandlers.onDragStart&&l.dragHandlers.onDragStart(T(),u._scene.camera.pickEllipsoid(_,e))})}l.onDoubleClick&&K(E,"leftDoubleClick",function(y){l.onDoubleClick(T())}),l.onClick&&K(E,"leftClick",function(y){l.onClick(T())}),l.tooltip&&(K(E,"mouseMove",function(y){u._drawHelper._tooltip.showAt(y,l.tooltip())}),K(E,"mouseOut",function(y){u._drawHelper._tooltip.setVisible(!1)}))}return E},n.BillboardGroup.prototype.insertBillboard=function(a,l,E){this._orderedBillboards.splice(a,0,this.createBillboard(l,E))},n.BillboardGroup.prototype.addBillboard=function(a,l){this._orderedBillboards.push(this.createBillboard(a,l))},n.BillboardGroup.prototype.addBillboards=function(a,l){for(var E=0;E<a.length;E++)this.addBillboard(a[E],l)},n.BillboardGroup.prototype.updateBillboardsPositions=function(a){for(var l=0;l<a.length;l++)this.getBillboard(l).position=a[l]},n.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},n.BillboardGroup.prototype.getBillboard=function(a){return this._orderedBillboards[a]},n.BillboardGroup.prototype.removeBillboard=function(a){this._billboards.remove(this.getBillboard(a)),this._orderedBillboards.splice(a,1)},n.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},n.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},n.prototype.startDrawingMarker=function(l){var l=x(l,b);this.startDrawing(function(){p.remove(),T.destroy(),v.setVisible(!1)});var E=this,u=this._scene;u.primitives;var v=this._tooltip,p=new n.BillboardGroup(this,l),T=new f.ScreenSpaceEventHandler(u.canvas);T.setInputAction(function(y){if(y.position!=null){var _=u.camera.pickEllipsoid(y.position,e);_&&(p.addBillboard(_),E.stopDrawing(),l.callback(_))}},f.ScreenSpaceEventType.LEFT_CLICK),T.setInputAction(function(y){var _=y.endPosition;if(_!=null){var A=u.camera.pickEllipsoid(_,e);A?v.showAt(_,"<p>Click to add your marker. Position is: </p>"+X(e.cartesianToCartographic(A))):v.showAt(_,"<p>Click on the globe to add your marker.</p>")}},f.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.startDrawingPolygon=function(l){var l=x(l,o);this.startDrawingPolyshape(!0,l)},n.prototype.startDrawingPolyline=function(l){var l=x(l,w);this.startDrawingPolyshape(!1,l)},n.prototype.startDrawingPolyshape=function(a,l){this.startDrawing(function(){v.remove(y),A.remove(),P.destroy(),p.setVisible(!1),H(u)});var E=this,u=this._scene,v=u.primitives,p=this._tooltip,T=a?3:2,y;a?y=new ve.PolygonPrimitive(l):y=new ve.PolylinePrimitive(l),y.asynchronous=!1,v.add(y);var _=[],A=new n.BillboardGroup(this,b),P=new f.ScreenSpaceEventHandler(u.canvas);J(u),P.setInputAction(function(L){if(L.position!=null){var D=u.camera.pickEllipsoid(L.position,e);D&&(_.length==0&&(_.push(D.clone()),A.addBillboard(_[0])),_.length>=T&&(y.positions=_,y._createPrimitive=!0),_.push(D),A.addBillboard(D))}},f.ScreenSpaceEventType.LEFT_CLICK),P.setInputAction(function(L){var D=L.endPosition;if(D!=null)if(_.length==0)p.showAt(D,"<p>Click to add first point</p>");else{var k=u.camera.pickEllipsoid(D,e);k&&(_.pop(),k.y+=1+Math.random(),_.push(k),_.length>=T&&(y.positions=_,y._createPrimitive=!0),A.getBillboard(_.length-1).position=k,p.showAt(D,"<p>Click to add new point ("+_.length+")</p>"+(_.length>T?"<p>Double click to finish drawing</p>":"")))}},f.ScreenSpaceEventType.MOUSE_MOVE),P.setInputAction(function(L){var D=L.position;if(D!=null){if(_.length<T+2)return;var k=u.camera.pickEllipsoid(D,e);k&&(H(u),E.stopDrawing(),typeof l.callback=="function"&&(_.length-1,l.callback(_)))}},f.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function W(a){return e.cartographicArrayToCartesianArray([f.Rectangle.northwest(a),f.Rectangle.northeast(a),f.Rectangle.southeast(a),f.Rectangle.southwest(a)])}function J(a){a&&(a.canvas.style.cursor="crosshair")}function H(a){a&&(a.canvas.style.cursor="")}n.prototype.startDrawingExtent=function(l){var l=x(l,o);this.startDrawing(function(){y!=null&&v.remove(y),_!=null&&_.remove(),A.destroy(),p.setVisible(!1),H(u)});var E=this,u=this._scene,v=this._scene.primitives,p=this._tooltip,T=null,y=null,_=null,A=new f.ScreenSpaceEventHandler(u.canvas);J(u);function P(L){y==null&&(y=new ve.ExtentPrimitive({extent:L,material:l.material}),y.asynchronous=!1,v.add(y)),y.setExtent(L);var D=W(L);_==null?(_=new n.BillboardGroup(E,b),_.addBillboards(D)):_.updateBillboardsPositions(D)}A.setInputAction(function(L){if(L.position!=null){var D=u.camera.pickEllipsoid(L.position,e);if(D)if(y==null){T=e.cartesianToCartographic(D);var k=Y(T,T);P(k)}else E.stopDrawing(),typeof l.callback=="function"&&l.callback(Y(T,e.cartesianToCartographic(D)))}},f.ScreenSpaceEventType.LEFT_DOWN),A.setInputAction(function(L){var D=L.endPosition;if(D!=null)if(y==null)p.showAt(D,"<p>Click to start drawing rectangle</p>");else{var k=u.camera.pickEllipsoid(D,e);if(k){var j=Y(T,e.cartesianToCartographic(k));P(j),p.showAt(D,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},f.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.startDrawingCircle=function(l){var l=x(l,o);this.startDrawing(function(){T!=null&&v.remove(T),y.remove(),_.destroy(),p.setVisible(!1)});var E=this,u=this._scene,v=this._scene.primitives,p=this._tooltip,T=null,y=null,_=new f.ScreenSpaceEventHandler(u.canvas);_.setInputAction(function(A){if(A.position!=null){var P=u.camera.pickEllipsoid(A.position,e);P&&(T==null?(T=new n.CirclePrimitive({center:P,radius:0,asynchronous:!1,material:l.material}),v.add(T),y=new n.BillboardGroup(E,b),y.addBillboards([P])):(typeof l.callback=="function"&&l.callback(T.getCenter(),T.getRadius()),E.stopDrawing()))}},f.ScreenSpaceEventType.LEFT_DOWN),_.setInputAction(function(A){var P=A.endPosition;if(P!=null)if(T==null)p.showAt(P,"<p>Click to start drawing the circle</p>");else{var L=u.camera.pickEllipsoid(P,e);L&&(T.setRadius(f.Cartesian3.distance(T.getCenter(),L)),y.updateBillboardsPositions(L),p.showAt(P,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},f.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.enhancePrimitives=function(){var a=this;f.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var u=this,v=this;function p(T){a._scene.screenSpaceCameraController.enableRotate=T}K(u,"leftDown",function(T){function y(P){u.position=P,v.executeListeners({name:"drag",positions:P})}function _(P){A.destroy(),p(!0),v.executeListeners({name:"dragEnd",positions:P})}var A=new f.ScreenSpaceEventHandler(a._scene.canvas);A.setInputAction(function(P){var L=a._scene.camera.pickEllipsoid(P.endPosition,e);L?y(L):_(L)},f.ScreenSpaceEventType.MOUSE_MOVE),A.setInputAction(function(P){_(a._scene.camera.pickEllipsoid(P.position,e))},f.ScreenSpaceEventType.LEFT_UP),p(!1)}),re(u)};function l(u){a._scene,!(this._highlighted&&this._highlighted==u)&&this._editMode!==!0&&(this._highlighted=u,u?(a.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(f.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function E(u){if(this._editMode!=u)if(a.disableAllHighlights(),u){a.setEdited(this);var v=a._scene,p=this;if(this._markers==null){let k=function(N,U){var te=N-1<0?U.length-1:N-1;te<y.countBillboards()&&(y.getBillboard(te).position=Q(te)),te=N,te<y.countBillboards()&&(y.getBillboard(te).position=Q(te))},j=function(){p.executeListeners({name:"onEdited",positions:p.positions})},Q=function(N){var U=p.positions;return e.cartographicToCartesian(new f.EllipsoidGeodesic(e.cartesianToCartographic(U[N]),e.cartesianToCartographic(U[N<U.length-1?N+1:0])).interpolateUsingFraction(.5))};var T=new n.BillboardGroup(a,I),y=new n.BillboardGroup(a,B),_={dragHandlers:{onDrag:function(N,U){p.positions[N]=U,k(N,p.positions),p._createPrimitive=!0},onDragEnd:function(N,U){p._createPrimitive=!0,j()}},onDoubleClick:function(N){p.positions.length<4||(p.positions.splice(N,1),p._createPrimitive=!0,T.removeBillboard(N),y.removeBillboard(N),k(N,p.positions),j())},tooltip:function(){if(p.positions.length>3)return"Double click to remove this point"}};T.addBillboards(p.positions,_),this._markers=T;for(var A=[],P=0,L=p.positions.length+(this.isPolygon?0:-1);P<L;P++)A.push(Q(P));var D={dragHandlers:{onDragStart:function(N,U){this.index=N+1,p.positions.splice(this.index,0,U),p._createPrimitive=!0},onDrag:function(N,U){p.positions[this.index]=U,p._createPrimitive=!0},onDragEnd:function(N,U){T.insertBillboard(this.index,U,_),y.getBillboard(this.index-1).position=Q(this.index-1),y.insertBillboard(this.index,Q(this.index),D),p._createPrimitive=!0,j()}},tooltip:function(){return"Drag to create a new point"}};y.addBillboards(A,D),this._editMarkers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(N){var U=v.pick(N.position);U&&U.primitive||p.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),T.setOnTop(),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._editMarkers.remove(),this._markers=null,this._editMarkers=null,this._globeClickhandler.destroy()),this._editMode=!1}ve.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var u=this;u.isPolygon=!1,u.asynchronous=!1,a.registerEditableShape(u),u.setEditMode=E;var v=this.width;u.setHighlighted=function(p){this._editMode!==!0&&(p?(a.setHighlighted(this),this.setWidth(v*2)):this.setWidth(v))},u.getExtent=function(){return f.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},re(u),u.setEditMode(!1)}},ve.PolygonPrimitive.prototype.setEditable=function(){var u=this;u.asynchronous=!1,a._scene,a.registerEditableShape(u),u.setEditMode=E,u.setHighlighted=l,re(u),u.setEditMode(!1)},ve.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var u=this,v=a._scene;a.registerEditableShape(u),u.asynchronous=!1,u.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){if(a.setEdited(this),this._markers==null){let _=function(){u.executeListeners({name:"onEdited",extent:u.extent})};var T=new n.BillboardGroup(a,I),y={dragHandlers:{onDrag:function(A,P){var L=T.getBillboard((A+2)%4).position;u.setExtent(Y(e.cartesianToCartographic(L),e.cartesianToCartographic(P))),T.updateBillboardsPositions(W(u.extent))},onDragEnd:function(A,P){_()}},tooltip:function(){return"Drag to change the corners of this extent"}};T.addBillboards(W(u.extent),y),this._markers=T,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(A){var P=v.pick(A.position);P&&!P.isDestroyed()&&P.primitive||u.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),T.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},u.setHighlighted=l,re(u),u.setEditMode(!1)}},n.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var u=this,v=a._scene;u.asynchronous=!1,a.registerEditableShape(u),u.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var T=this;if(this._markers==null){let A=function(){return f.EllipseOutlineGeometry(e,u.getCenter(),u.getSemiMajorAxis(),u.getSemiMinorAxis(),u.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},P=function(){u.executeListeners({name:"onEdited",center:u.getCenter(),semiMajorAxis:u.getSemiMajorAxis(),semiMinorAxis:u.getSemiMinorAxis(),rotation:0})};var y=new n.BillboardGroup(a,I),_={dragHandlers:{onDrag:function(L,D){var k=f.Cartesian3.distance(u.getCenter(),D);L%2==0?u.setSemiMajorAxis(k):u.setSemiMinorAxis(k),y.updateBillboardsPositions(A())},onDragEnd:function(L,D){P()}},tooltip:function(){return"Drag to change the excentricity and radius"}};y.addBillboards(A(),_),this._markers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(L){var D=v.pick(L.position);D&&D.primitive||T.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},u.setHighlighted=l,re(u),u.setEditMode(!1)}},n.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(u){for(var v=f.CircleOutlineGeometry.createGeometry(new f.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:u})),p=0,T,y=[];p<v.attributes.position.values.length;p+=3)T=v.attributes.position.values,y.push(new f.Cartesian3(T[p],T[p+1],T[p+2]));return y},n.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var u=this,v=a._scene;u.asynchronous=!1,a.registerEditableShape(u),u.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var T=this;if(this._markers==null){let A=function(){return T.getCircleCartesianCoordinates(f.Math.PI_OVER_TWO)},P=function(){u.executeListeners({name:"onEdited",center:u.getCenter(),radius:u.getRadius()})};var y=new n.BillboardGroup(a,I),_={dragHandlers:{onDrag:function(L,D){u.setRadius(f.Cartesian3.distance(u.getCenter(),D)),y.updateBillboardsPositions(A())},onDragEnd:function(L,D){P()}},tooltip:function(){return"Drag to change the radius"}};y.addBillboards(A(),_),this._markers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(L){var D=v.pick(L.position);D&&D.primitive||T.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},u.setHighlighted=l,re(u),u.setEditMode(!1)}}},n.DrawHelperWidget=function(){function a(l,E){if(!f.defined(E.container))throw new f.DeveloperError("Container is required");var u={markerIcon:"./assets/img/glyphicons_242_google_maps.png",polylineIcon:"./assets/img/glyphicons_097_vector_path_line.png",polygonIcon:"./assets/img/glyphicons_096_vector_path_polygon.png",circleIcon:"./assets/img/glyphicons_095_vector_path_circle.png",extentIcon:"./assets/img/glyphicons_094_vector_path_square.png",clearIcon:"./assets/img/glyphicons_067_cleaning.png",polylineDrawingOptions:w,polygonDrawingOptions:d,extentDrawingOptions:h,circleDrawingOptions:m};q(E,u);var v=this,p=document.createElement("DIV");p.className="toolbar",E.container.appendChild(p);function T(A,P,L,D){var k=document.createElement("DIV");k.className="button",k.title=L,p.appendChild(k),k.onclick=D;var j=document.createElement("SPAN");k.appendChild(j);var Q=document.createElement("IMG");return Q.src=P,j.appendChild(Q),k}var y=l._scene;T("marker",E.markerIcon,"Click to start drawing a 2D marker",function(){l.startDrawingMarker({callback:function(A){v.executeListeners({name:"markerCreated",position:A})}})}),T("polyline",E.polylineIcon,"Click to start drawing a 2D polyline",function(){l.startDrawingPolyline({callback:function(A){v.executeListeners({name:"polylineCreated",positions:A})}})}),T("polygon",E.polygonIcon,"Click to start drawing a 2D polygon",function(){l.startDrawingPolygon({callback:function(A){v.executeListeners({name:"polygonCreated",positions:A})}})}),T("extent",E.extentIcon,"Click to start drawing an Extent",function(){l.startDrawingExtent({callback:function(A){v.executeListeners({name:"extentCreated",extent:A})}})}),T("circle",E.circleIcon,"Click to start drawing a Circle",function(){l.startDrawingCircle({callback:function(A,P){v.executeListeners({name:"circleCreated",center:A,radius:P})}})});var _=document.createElement("DIV");_.className="divider",p.appendChild(_),T("clear",E.clearIcon,"Remove all primitives",function(){y.primitives.removeAll()}),re(this)}return a}(),n.prototype.addToolbar=function(a,l){return l=x(l,{container:a}),new n.DrawHelperWidget(this,l)};function Y(a,l){var E=new f.Rectangle;E.west=Math.min(a.longitude,l.longitude),E.east=Math.max(a.longitude,l.longitude),E.south=Math.min(a.latitude,l.latitude),E.north=Math.max(a.latitude,l.latitude);var u=f.Math.EPSILON7;return E.east-E.west<u&&(E.east+=u*2),E.north-E.south<u&&(E.north+=u*2),E}function X(a,l){return a.longitude.toFixed(l||3)+", "+a.latitude.toFixed(l||3)}function O(a,l){if(a==null||typeof a!="object"||a.constructor!=Object&&a.constructor!=Array)return a;if(a.constructor==Date||a.constructor==RegExp||a.constructor==Function||a.constructor==String||a.constructor==Number||a.constructor==Boolean)return new a.constructor(a);l=l||new a.constructor;for(var E in a)l[E]=typeof l[E]>"u"?O(a[E],null):l[E];return l}function q(a,l){a=a||{};var E;for(E in l)a[E]===void 0&&(a[E]=O(l[E]))}function x(a,l){var E=O(a),u;for(u in l)E[u]===void 0&&(E[u]=O(l[u]));return E}function K(a,l,E){a[l]=E}function re(a){a._listeners={},a.addListener=function(l,E){return this._listeners[l]=this._listeners[l]||[],this._listeners[l].push(E),this._listeners[l].length},a.executeListeners=function(l,E){if(this._listeners[l.name]&&this._listeners[l.name].length>0)for(var u=0;u<this._listeners[l.name].length;u++)this._listeners[l.name][u](l);else E&&E(l)}}return n}();const $i=2,Wi=(e,i)=>{switch(e){case se.BOX:{if(i.features.length!==$i)throw new Error(`${e} must have 2 points`);const t=$.find(i.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Pe.BOTTOM_LEFT}),n=$.find(i.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Pe.TOP_RIGHT});if(n&&t){if(t.geometry.coordinates[0]===n.geometry.coordinates[0]&&t.geometry.coordinates[1]===n.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return S.Rectangle.fromDegrees(t.geometry.coordinates[0],t.geometry.coordinates[1],n.geometry.coordinates[0],n.geometry.coordinates[1])}else throw new Error(`${e} geojson must define BOTTOM_LEFT and TOP_RIGHT points`)}default:throw new Error(`${e} type geoJSON still not supported`)}},Vt=e=>{const i=e.map(t=>{const n=S.Cartographic.fromCartesian(t);return[S.Math.toDegrees(n.longitude),S.Math.toDegrees(n.latitude)]});return i.push(i[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[i]}}},zt=e=>{const i=ot.lineString([[S.Math.toDegrees(e.west),S.Math.toDegrees(e.south)],[S.Math.toDegrees(e.east),S.Math.toDegrees(e.north)]]);return nt(tt(i))},$t=e=>{const i=ot.lineString([[e.west,e.south],[e.east,e.north]]);return nt(tt(i)).geometry.coordinates[0].map(n=>S.Cartesian3.fromRadiansArray(n)[0])};class Ui extends S.Color{}const qi=e=>{const{drawState:i,drawingMaterial:t,drawingVertexColor:n,material:s,hollow:o,outlineWidth:d}=e,h=le(),[m,C]=c.useState();c.useEffect(()=>{C(new ve(h,t,n))},[]),c.useEffect(()=>{if(m){const M=m;if(i.drawing)switch(i.type){case se.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,M.startDrawingPolygon({callback:b=>{i.handler({primitive:b,type:se.POLYGON,geojson:Vt(b)})}});break;case se.BOX:h.scene.globe.depthTestAgainstTerrain=!1,M.startDrawingExtent({callback:b=>{i.handler({primitive:b,type:se.BOX,geojson:zt(b)})}});break;default:throw new Error(`[CESIUM DRAW]: ${i.type} unrecognized primitive to draw.`)}else M.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[i,m]);const w=M=>{try{let b=M.coordinates!==void 0?M.coordinates:Wi(M.type,M.geojson);if(o!==!0)switch(M.type){case se.BOX:return r.jsx(Ht,{coordinates:b,material:s??t});case se.POLYGON:return r.jsx(Ft,{hierarchy:new S.PolygonHierarchy(b),material:s??t});default:return r.jsx(r.Fragment,{})}else{switch(M.type){case se.BOX:b=$t(b);break;case se.POLYGON:b=[...b,b[0]];break;default:return r.jsx(r.Fragment,{})}return r.jsx(zi,{clampToGround:!0,positions:b,width:d??1,material:s??t})}}catch(b){return console.error(b),r.jsx(r.Fragment,{})}};return r.jsx(Gt,{...e,children:e.drawings.map((M,b)=>r.jsxs(Nt,{name:M.name,children:[r.jsxs(Bt,{children:[r.jsxs("h1",{children:["Drawed Entity ",M.name]}),r.jsx("p",{children:"This is description of drawed entity"})]}),w(M)]},M.id))})},Ki=e=>{const i=le();return c.useEffect(()=>{i.extend(S.viewerCesiumInspectorMixin)},[i]),r.jsx(r.Fragment,{})},ji=-25,Wt=2,Yi=e=>{const i=le(),t=(o,d=",")=>o.slice(o.indexOf(`
2
2
  `)+1).split(`
3
- `).map(w=>{const T=w.split(u);return{cartographic:S.Cartographic.fromDegrees(parseFloat(T[0]),parseFloat(T[1])),cartesian:new S.Cartesian2(parseFloat(T[0]),parseFloat(T[1]))}}),i=o=>{var h;o.preventDefault(),o.persist();const u=new FileReader;u.onload=p=>{var _;const w=(_=p.target)==null?void 0:_.result,T=t(w),P=S.Ellipsoid.WGS84;console.log(`Loaded CSV content:
4
- `,w),S.sampleTerrainMostDetailed(n.terrainProvider,T.map(I=>I.cartographic)).then(I=>{console.log(I),I=I.slice(0,I.length-1),n.scene.globe.depthTestAgainstTerrain=!0,n.entities.suspendEvents(),n.entities.removeAll(),I.forEach((H,q)=>{n.entities.add({name:(q+zt).toString(),position:P.cartographicToCartesian(H),billboard:{verticalOrigin:S.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:(q+zt).toString(),font:"14pt monospace",fillColor:S.Color.BLACK,style:S.LabelStyle.FILL_AND_OUTLINE,outlineWidth:4,outlineColor:S.Color.BLACK,verticalOrigin:S.VerticalOrigin.BOTTOM,pixelOffset:new S.Cartesian2(0,Wi)},description:`
5
- Long: ${T[q].cartesian.x} </br>
6
- Lat: ${T[q].cartesian.y} </br>
7
- Height(m): <span style="font-weight: 500">${H.height}</span>
8
- `})}),n.entities.resumeEvents(),o.target.files!==null&&(s(`terranian_heights_${o.target.files[0].name}`,T),o.target.value=""),console.log("Pinned point count is ",n.entities.values.length)},I=>{console.error("ERROR while sampleTerrainMostDetailed:",I)})},(h=o.target.files)!=null&&h[0]&&u.readAsText(o.target.files[0])},s=(o,u)=>{const h=_=>{let I="";return I+=_.cartesian.x.toString()+",",I+=_.cartesian.y.toString()+",",I+=_.cartographic.height.toString(),I+`
9
- `};let p=`long,lat,height
10
- `;u.forEach(_=>{p+=h(_)});const w=new Blob([p],{type:"text/csv;charset=utf-8;"}),T=document.createElement("a"),P=URL.createObjectURL(w);T.setAttribute("href",P),T.setAttribute("download",o),T.style.visibility="hidden",document.body.appendChild(T),T.click(),document.body.removeChild(T)};return r.jsx(r.Fragment,{children:r.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:o=>{i(o)}})})},Lr="",qi=38,Ki=40,ji=13,Yi=14,Xi=27,Zi=9,Ji=10,Qi=100,Ri=e=>{const[n,t]=c.useState(e.defaultValue??""),[i,s]=c.useState(!1),[o,u]=c.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=c.useRef(null);c.useEffect(()=>(window.addEventListener("resize",H),()=>{try{window.removeEventListener("resize",H)}catch(v){console.log('WINDOW "resize" remove listener failed',v)}}),[]),c.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),c.useEffect(()=>{const{options:v}=e,{caret:f}=o;Q(n,f,v)},[e]);const p=(v,f,C)=>{const{trigger:y,matchAny:b,regex:A}=e,L=new RegExp(A);let M=y;Array.isArray(M)||(M=new Array(y)),M.sort();const D={};Array.isArray(C)&&M.forEach(R=>{D[R]=C});const k=w(M,L);let j={};for(let R=0;R<k.length;R++){const{triggerStr:B,triggerMatch:U,triggerLength:ne}=k[R];for(let oe=f-1;oe>=0;--oe){const V=v.substring(oe,f).match(L);let x=-1;if(ne>0){const X=U?oe:oe-ne+1;if(X<0||(T(B,v,X)&&(x=X+ne),!V&&x<0))break}else{if(V&&oe>0)continue;if(x=oe===0&&V?0:oe+1,f-x===0)break}if(x>=0){const X=D[B];if(!Array.isArray(X))continue;const ve=v.substring(x,f),Te=X.filter(Fe=>{const be=Fe.toLowerCase().indexOf(ve.toLowerCase());return be!==-1&&(b||be===0)}),Ee=B,Be=ve.length;j={...j,trigger:Ee,matchStart:x,matchLength:Be,options:Te}}}}return j},w=(v,f)=>v.map(y=>({triggerStr:y,triggerMatch:y.match(f),triggerLength:y.length})),T=(v,f,C)=>!v||!v.length||f.substr(C,v.length)===v,P=v=>{const{onChange:f,options:C,spaceRemovers:y,spacer:b,value:A}=e,L=n,M=v.target.value,D=it(_(v.target)).end;if(M.length||G({...o,helperVisible:!1}),t(M),G({...o,caret:D,value:v.target.value}),!M.length||!D)return f(v.target.value);if(i&&y.length&&M.length>2&&b.length){for(let k=0;k<Math.max(L.length,M.length);++k)if(L[k]!==M[k]){if(k>=2&&M[k-1]===b&&y.indexOf(M[k-2])===-1&&y.indexOf(M[k])!==-1&&!$.isEmpty(p(M.substring(0,k-2),D-3,C))){const j=`${M.slice(0,k-1)}${M.slice(k,k+1)}${M.slice(k-1,k)}${M.slice(k+1)}`;return Z(k+1),h.current!==null&&(h.current.value=j),A||G({...o,value:j}),f(j)}break}s(!1)}return Q(M,D,C),f(v.target.value)},_=v=>{if(v!==void 0)if(v.children.length>0){const f=v.getElementsByTagName("textarea");if(f.length>0)return f[0];const C=v.getElementsByTagName("input");if(C.length>0)return C[0]}else return v},I=v=>{const{helperVisible:f,options:C,selection:y}=o,{onKeyDown:b,passThroughEnter:A}=e;if(f)switch(v.keyCode){case Xi:v.preventDefault(),Y();break;case qi:v.preventDefault(),G({...o,selection:(C.length+y-1)%C.length});break;case Ki:v.preventDefault(),G({...o,selection:(y+1)%C.length});break;case Yi:case ji:A||v.preventDefault(),q(y);break;case Zi:q(y);break;default:b(v);break}else b(v)},H=()=>{G({...o,helperVisible:!1})},q=v=>{const{spacer:f,onSelect:C,changeOnSelect:y}=e,{matchStart:b,matchLength:A,options:L,trigger:M}=o,D=L[v],k=n,j=k.substring(0,b-M.length),R=k.substring(b+A),B={target:h.current},U=y(M,D);B.target!==null&&(B.target.value=`${j}${U}${f}${R}`),P(B),B.target!==null&&C(B.target.value),Y(),Z(j.length+U.length+1),s(!0)},Z=v=>{G({...o,caret:v});const f=_(h.current);it.setCaretPosition(f,v)},G=v=>{setTimeout(()=>{u({...v})},0)},Q=(v,f,C)=>{const y=h.current;if(h.current===null)return;const b=_(y);if(b===void 0)return;const A=y.getBoundingClientRect(),L=p(v,f,C);if(Object.keys(L).length>0&&b!==null){const M=tn(b,f),D=b.getBoundingClientRect(),{minChars:k,onRequestOptions:j,requestOnlyIfNoOptions:R,mode:B}=e;let U,ne,oe,ye="unset";B==="assist"?(U=y===b?M.top+b.offsetTop:M.top+A.top,ne=Math.min(M.left+b.offsetLeft-Ji,b.offsetLeft+D.width-Qi)):(U=A.top+y.offsetHeight,ne=y.offsetLeft,oe=y.offsetLeft-y.offsetWidth,ye=`${A.width}px`),L.matchLength>=k&&(L.options.length>1||L.options.length===1&&L.options[0].length!==L.matchLength)?G({...o,value:v,helperVisible:!0,top:U,left:ne,right:oe,width:ye,...L}):((!R||!L.options.length)&&j(v.substr(L.matchStart,L.matchLength)),Y())}else Y()},Y=()=>{setTimeout(()=>{G({...o,helperVisible:!1,selection:0})},100)},O=()=>{const{helperVisible:v,left:f,right:C,matchStart:y,matchLength:b,options:A,selection:L,top:M,value:D,width:k}=o;if(!v)return null;const{maxOptions:j,offsetX:R,offsetY:B,direction:U}=e;if(A.length===0)return null;if(L>=A.length)return G({...o,selection:0}),null;const ne=j===0?A.length:j,oe=A.slice(0,ne).map((V,x)=>{const X=V.toLowerCase().indexOf(D.substr(y,b).toLowerCase());return r.jsxs("li",{className:x===L?"active":void 0,onClick:()=>{q(x)},onMouseEnter:()=>{G({...o,selection:x})},children:[V.slice(0,X),r.jsx("strong",{children:V.substr(X,b)}),V.slice(X+b)]},V)}),ye=U==="ltr"?{left:f+R}:{right:C+R};return r.jsx("ul",{className:"react-autocomplete-input",style:{...ye,top:M+B,width:k},children:oe})},{Component:K,ComponentProps:N,defaultValue:W,disabled:re,onBlur:a,value:l,...E}=e,d=Object.assign({},E);return Object.keys(e).forEach(v=>{delete d[v]}),r.jsxs(r.Fragment,{children:[c.cloneElement(K,{disabled:re,onBlur:a,onChange:P,onKeyDown:I,ref:h,value:n,...d,...N}),O()]})},er={Component:r.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,n)=>`${e}${n}`,options:[],regex:"^[A-Za-z0-9\\-_]+$",matchAny:!1,minChars:0,requestOnlyIfNoOptions:!0,spaceRemovers:[",",".","!","?"],spacer:" ",trigger:"@",offsetX:0,offsetY:0,value:void 0,passThroughEnter:!1,mode:"assist",direction:"ltr"},tr=e=>{let n={...er,...e};return e.mode==="autocomplete"&&(n={...n,trigger:"",regex:".",spacer:""}),r.jsx(Ri,{...n})},Ne={formatFileModDate:(e,n)=>{const t=F.FileHelper.getModDate(n);return t?e.formatDate(t,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,n)=>{if(!n||typeof n.size!="number")return null;const t=n.size,i=rn(t,{bits:!1,output:"object"});return i.symbol==="B"?`${Math.round(i.value/10)/100} KB`:i.symbol==="KB"?`${Math.round(i.value)} ${i.symbol}`:`${i.value} ${i.symbol.toUpperCase()}`}},nr={locale:de.EN,formatters:{...Ne}},ir={locale:de.RU,formatters:{...Ne},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
3
+ `).map(C=>{const w=C.split(d);return{cartographic:S.Cartographic.fromDegrees(parseFloat(w[0]),parseFloat(w[1])),cartesian:new S.Cartesian2(parseFloat(w[0]),parseFloat(w[1]))}}),n=o=>{var h;o.preventDefault(),o.persist();const d=new FileReader;d.onload=m=>{var b;const C=(b=m.target)==null?void 0:b.result,w=t(C),M=S.Ellipsoid.WGS84;console.log(`Loaded CSV content:
4
+ `,C),S.sampleTerrainMostDetailed(i.terrainProvider,w.map(I=>I.cartographic)).then(I=>{console.log(I),I=I.slice(0,I.length-1),i.scene.globe.depthTestAgainstTerrain=!0,i.entities.suspendEvents(),i.entities.removeAll(),I.forEach((B,W)=>{i.entities.add({name:(W+Wt).toString(),position:M.cartographicToCartesian(B),billboard:{verticalOrigin:S.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:(W+Wt).toString(),font:"14pt monospace",fillColor:S.Color.BLACK,style:S.LabelStyle.FILL_AND_OUTLINE,outlineWidth:4,outlineColor:S.Color.BLACK,verticalOrigin:S.VerticalOrigin.BOTTOM,pixelOffset:new S.Cartesian2(0,ji)},description:`
5
+ Long: ${w[W].cartesian.x} </br>
6
+ Lat: ${w[W].cartesian.y} </br>
7
+ Height(m): <span style="font-weight: 500">${B.height}</span>
8
+ `})}),i.entities.resumeEvents(),o.target.files!==null&&(s(`terranian_heights_${o.target.files[0].name}`,w),o.target.value=""),console.log("Pinned point count is ",i.entities.values.length)},I=>{console.error("ERROR while sampleTerrainMostDetailed:",I)})},(h=o.target.files)!=null&&h[0]&&d.readAsText(o.target.files[0])},s=(o,d)=>{const h=b=>{let I="";return I+=b.cartesian.x.toString()+",",I+=b.cartesian.y.toString()+",",I+=b.cartographic.height.toString(),I+`
9
+ `};let m=`long,lat,height
10
+ `;d.forEach(b=>{m+=h(b)});const C=new Blob([m],{type:"text/csv;charset=utf-8;"}),w=document.createElement("a"),M=URL.createObjectURL(C);w.setAttribute("href",M),w.setAttribute("download",o),w.style.visibility="hidden",document.body.appendChild(w),w.click(),document.body.removeChild(w)};return r.jsx(r.Fragment,{children:r.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:o=>{n(o)}})})},Or="",Xi=38,Zi=40,Ji=13,Qi=14,Ri=27,er=9,tr=10,nr=100,ir=e=>{const[i,t]=c.useState(e.defaultValue??""),[n,s]=c.useState(!1),[o,d]=c.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=c.useRef(null);c.useEffect(()=>(window.addEventListener("resize",B),()=>{try{window.removeEventListener("resize",B)}catch(v){console.log('WINDOW "resize" remove listener failed',v)}}),[]),c.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),c.useEffect(()=>{const{options:v}=e,{caret:p}=o;Y(i,p,v)},[e]);const m=(v,p,T)=>{const{trigger:y,matchAny:_,regex:A}=e,P=new RegExp(A);let L=y;Array.isArray(L)||(L=new Array(y)),L.sort();const D={};Array.isArray(T)&&L.forEach(Q=>{D[Q]=T});const k=C(L,P);let j={};for(let Q=0;Q<k.length;Q++){const{triggerStr:N,triggerMatch:U,triggerLength:te}=k[Q];for(let oe=p-1;oe>=0;--oe){const pe=v.substring(oe,p).match(P);let de=-1;if(te>0){const G=U?oe:oe-te+1;if(G<0||(w(N,v,G)&&(de=G+te),!pe&&de<0))break}else{if(pe&&oe>0)continue;if(de=oe===0&&pe?0:oe+1,p-de===0)break}if(de>=0){const G=D[N];if(!Array.isArray(G))continue;const V=v.substring(de,p),ne=G.filter(Ce=>{const Le=Ce.toLowerCase().indexOf(V.toLowerCase());return Le!==-1&&(_||Le===0)}),we=N,be=V.length;j={...j,trigger:we,matchStart:de,matchLength:be,options:ne}}}}return j},C=(v,p)=>v.map(y=>({triggerStr:y,triggerMatch:y.match(p),triggerLength:y.length})),w=(v,p,T)=>!v||!v.length||p.substr(T,v.length)===v,M=v=>{const{onChange:p,options:T,spaceRemovers:y,spacer:_,value:A}=e,P=i,L=v.target.value,D=it(b(v.target)).end;if(L.length||H({...o,helperVisible:!1}),t(L),H({...o,caret:D,value:v.target.value}),!L.length||!D)return p(v.target.value);if(n&&y.length&&L.length>2&&_.length){for(let k=0;k<Math.max(P.length,L.length);++k)if(P[k]!==L[k]){if(k>=2&&L[k-1]===_&&y.indexOf(L[k-2])===-1&&y.indexOf(L[k])!==-1&&!$.isEmpty(m(L.substring(0,k-2),D-3,T))){const j=`${L.slice(0,k-1)}${L.slice(k,k+1)}${L.slice(k-1,k)}${L.slice(k+1)}`;return J(k+1),h.current!==null&&(h.current.value=j),A||H({...o,value:j}),p(j)}break}s(!1)}return Y(L,D,T),p(v.target.value)},b=v=>{if(v!==void 0)if(v.children.length>0){const p=v.getElementsByTagName("textarea");if(p.length>0)return p[0];const T=v.getElementsByTagName("input");if(T.length>0)return T[0]}else return v},I=v=>{const{helperVisible:p,options:T,selection:y}=o,{onKeyDown:_,passThroughEnter:A}=e;if(p)switch(v.keyCode){case Ri:v.preventDefault(),X();break;case Xi:v.preventDefault(),H({...o,selection:(T.length+y-1)%T.length});break;case Zi:v.preventDefault(),H({...o,selection:(y+1)%T.length});break;case Qi:case Ji:A||v.preventDefault(),W(y);break;case er:W(y);break;default:_(v);break}else _(v)},B=()=>{H({...o,helperVisible:!1})},W=v=>{const{spacer:p,onSelect:T,changeOnSelect:y}=e,{matchStart:_,matchLength:A,options:P,trigger:L}=o,D=P[v],k=i,j=k.substring(0,_-L.length),Q=k.substring(_+A),N={target:h.current},U=y(L,D);N.target!==null&&(N.target.value=`${j}${U}${p}${Q}`),M(N),N.target!==null&&T(N.target.value),X(),J(j.length+U.length+1),s(!0)},J=v=>{H({...o,caret:v});const p=b(h.current);it.setCaretPosition(p,v)},H=v=>{setTimeout(()=>{d({...v})},0)},Y=(v,p,T)=>{const y=h.current;if(h.current===null)return;const _=b(y);if(_===void 0)return;const A=y.getBoundingClientRect(),P=m(v,p,T);if(Object.keys(P).length>0&&_!==null){const L=an(_,p),D=_.getBoundingClientRect(),{minChars:k,onRequestOptions:j,requestOnlyIfNoOptions:Q,mode:N}=e;let U,te,oe,Ee="unset";N==="assist"?(U=y===_?L.top+_.offsetTop:L.top+A.top,te=Math.min(L.left+_.offsetLeft-tr,_.offsetLeft+D.width-nr)):(U=A.top+y.offsetHeight,te=y.offsetLeft,oe=y.offsetLeft-y.offsetWidth,Ee=`${A.width}px`),P.matchLength>=k&&(P.options.length>1||P.options.length===1&&P.options[0].length!==P.matchLength)?H({...o,value:v,helperVisible:!0,top:U,left:te,right:oe,width:Ee,...P}):((!Q||!P.options.length)&&j(v.substr(P.matchStart,P.matchLength)),X())}else X()},X=()=>{setTimeout(()=>{H({...o,helperVisible:!1,selection:0})},100)},O=()=>{const{helperVisible:v,left:p,right:T,matchStart:y,matchLength:_,options:A,selection:P,top:L,value:D,width:k}=o;if(!v)return null;const{maxOptions:j,offsetX:Q,offsetY:N,direction:U}=e;if(A.length===0)return null;if(P>=A.length)return H({...o,selection:0}),null;const te=j===0?A.length:j,oe=A.slice(0,te).map((pe,de)=>{const G=pe.toLowerCase().indexOf(D.substr(y,_).toLowerCase());return r.jsxs("li",{className:de===P?"active":void 0,onClick:()=>{W(de)},onMouseEnter:()=>{H({...o,selection:de})},children:[pe.slice(0,G),r.jsx("strong",{children:pe.substr(G,_)}),pe.slice(G+_)]},pe)}),Ee=U==="ltr"?{left:p+Q}:{right:T+Q};return r.jsx("ul",{className:"react-autocomplete-input",style:{...Ee,top:L+N,width:k},children:oe})},{Component:q,ComponentProps:x,defaultValue:K,disabled:re,onBlur:a,value:l,...E}=e,u=Object.assign({},E);return Object.keys(e).forEach(v=>{delete u[v]}),r.jsxs(r.Fragment,{children:[c.cloneElement(q,{disabled:re,onBlur:a,onChange:M,onKeyDown:I,ref:h,value:i,...u,...x}),O()]})},rr={Component:r.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,i)=>`${e}${i}`,options:[],regex:"^[A-Za-z0-9\\-_]+$",matchAny:!1,minChars:0,requestOnlyIfNoOptions:!0,spaceRemovers:[",",".","!","?"],spacer:" ",trigger:"@",offsetX:0,offsetY:0,value:void 0,passThroughEnter:!1,mode:"assist",direction:"ltr"},or=e=>{let i={...rr,...e};return e.mode==="autocomplete"&&(i={...i,trigger:"",regex:".",spacer:""}),r.jsx(ir,{...i})},Fe={formatFileModDate:(e,i)=>{const t=F.FileHelper.getModDate(i);return t?e.formatDate(t,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,i)=>{if(!i||typeof i.size!="number")return null;const t=i.size,n=cn(t,{bits:!1,output:"object"});return n.symbol==="B"?`${Math.round(n.value/10)/100} KB`:n.symbol==="KB"?`${Math.round(n.value)} ${n.symbol}`:`${n.value} ${n.symbol.toUpperCase()}`}},sr={locale:ue.EN,formatters:{...Fe}},ar={locale:ue.RU,formatters:{...Fe},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
11
11
  one {# файл}
12
12
  few {# файла}
13
13
  other {# файлов}
@@ -19,7 +19,7 @@
19
19
  =0 {}
20
20
  one {# скрыт}
21
21
  other {# скрыто}
22
- }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${F.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${F.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${F.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${F.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${F.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${F.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${F.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${F.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${F.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${F.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${F.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${F.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},rr={locale:de.HE,formatters:{...Ne},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
22
+ }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${F.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${F.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${F.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${F.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${F.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${F.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${F.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${F.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${F.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${F.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${F.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${F.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},lr={locale:ue.HE,formatters:{...Fe},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
23
23
  one {פריט #}
24
24
  other {# פריטים}
25
25
  }`,"chonky.toolbar.selectedFileCount":`{fileCount, plural,
@@ -30,4 +30,4 @@
30
30
  =0 {}
31
31
  one {# נסתר}
32
32
  other {# נסתרים}
33
- }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${F.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${F.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${F.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${F.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${F.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${F.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${F.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${F.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${F.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${F.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${F.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${F.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},or={[de.EN]:nr,[de.RU]:ir,[de.HE]:rr},Pr="";class sr extends F.FileHelper{}const ar=F.ChonkyActions,$t={listView:F.ChonkyActions.EnableListView.id,gridView:F.ChonkyActions.EnableGridView.id};F.setChonkyDefaults({iconComponent:nn.ChonkyIconFA});const lr=c.memo(c.forwardRef(({theme:e,styles:n={height:"100%",minWidth:"600px"},defaultView:t=$t.listView,readOnlyMode:i=!1,locale:s,files:o,folderChain:u,onFileAction:h,...p},w)=>{const T=c.useCallback(W=>null,[]);fe.makeStyles({"@global":{".chonky-dropdownList":{backgroundColor:`${e==null?void 0:e.surface} !important`},'li[class*="chonky-activeButton"]':{color:`${e==null?void 0:e.primary} !important`}}})();const P=W=>W.replace(/([A-Z])/g,re=>"-"+re.toLowerCase()),_=c.useMemo(()=>e!==void 0?Object.keys(e).reduce((re,a)=>{const l=e[a];return a=a.startsWith("--")?a:`--fp-theme-${P(a)}`,re[a]=l,re},{}):{},[e]),[I,H]=c.useState(!1),[q,Z]=c.useState(),[G,Q]=c.useState(!1),[Y,O]=c.useState(),[K,N]=c.useState();return c.useEffect(()=>{e&&H(!0),Z(t),i?Q(!0):O([F.ChonkyActions.CreateFolder,F.ChonkyActions.DeleteFiles]),s!==void 0&&N(or[s])},[e,t,i,s]),r.jsx(le,{style:{...n,..._},children:r.jsx(F.FullFileBrowser,{ref:w,files:o??[],folderChain:u,onFileAction:W=>{typeof h=="function"&&h(W)},thumbnailGenerator:T,defaultFileViewActionId:q,disableDragAndDrop:G,fileActions:Y,darkMode:I,i18n:K,...p})})}));g.useMediaQuery=Wt,Object.defineProperty(g,"CesiumMath",{enumerable:!0,get:()=>S.Math}),Object.defineProperty(g,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>S.sampleTerrainMostDetailed}),g.Autocomplete=tr,g.BboxCorner=Me,g.Box=le,g.COORDINATES_MERCATOR_FRACTION_DIGITS=Ae,g.COORDINATES_WGS_FRACTION_DIGITS=Pe,g.Cesium3DTileset=fi,g.CesiumBoundingSphere=Oi,g.CesiumCartesian2=Di,g.CesiumCartesian3=Ii,g.CesiumCartographic=ki,g.CesiumCesiumTerrainProvider=Gi,g.CesiumColor=_i,g.CesiumConstantPositionProperty=Ai,g.CesiumConstantProperty=Pi,g.CesiumCustomDataSource=Ft,g.CesiumDrawingsDataSource=Mi,g.CesiumEllipsoid=xi,g.CesiumEllipsoidTerrainProvider=Hi,g.CesiumEntity=Ot,g.CesiumEntityDescription=wi,g.CesiumEntityStaticDescription=xt,g.CesiumGeographicTilingScheme=Ni,g.CesiumGeojsonLayer=mi,g.CesiumImageryLayer=Se,g.CesiumLabelStyle=zi,g.CesiumMap=gi,g.CesiumOSMLayer=Ci,g.CesiumPolygonGraphics=Nt,g.CesiumPolylineDashMaterialProperty=Li,g.CesiumRectangle=Bi,g.CesiumRectangleGraphics=Bt,g.CesiumResource=Fi,g.CesiumSceneMode=ie,g.CesiumVerticalOrigin=Vi,g.CesiumViewer=ui,g.CesiumWMSLayer=yi,g.CesiumWMTSLayer=vi,g.CesiumXYZLayer=Ei,g.CoordinatesTrackerTool=mt,g.CssBaseline=Wn,g.DateRangePicker=hn,g.DateTimePicker=gn,g.DateTimeRangePicker=at,g.DateTimeRangePickerFormControl=ln,g.DrawHelper=me,g.DrawType=se,g.FileHelper=sr,g.FilePicker=lr,g.FilePickerActions=ar,g.FilePickerViewObj=$t,g.InspectorTool=$i,g.MapFilterContainer=Fn,g.Popover=lt,g.Proj=he,g.ScaleTrackerTool=vt,g.ScopedCssBaseline=Un,g.SmartTable=$n,g.SupportedLocales=de,g.TerrainianHeightTool=Ui,g.TimeRangeInput=cn,g.ZoomLevelTrackerTool=Ct,g.defaultFormatters=Ne,g.isDateRange=Le,g.mapMcToMuiTheme=st,g.polygonToGeoJSON=Ht,g.rectangleToGeoJSON=Gt,g.rectangleToPositions=Vt,g.useCesiumMap=ce,g.useMappedMuiTheme=ze,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
33
+ }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${F.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${F.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${F.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${F.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${F.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${F.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${F.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${F.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${F.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${F.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${F.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${F.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},cr={[ue.EN]:sr,[ue.RU]:ar,[ue.HE]:lr},xr="";class dr extends F.FileHelper{}const ur=F.ChonkyActions,Ut={listView:F.ChonkyActions.EnableListView.id,gridView:F.ChonkyActions.EnableGridView.id};F.setChonkyDefaults({iconComponent:ln.ChonkyIconFA});const hr=c.memo(c.forwardRef(({theme:e,styles:i={height:"100%",minWidth:"600px"},defaultView:t=Ut.listView,readOnlyMode:n=!1,locale:s,files:o,folderChain:d,onFileAction:h,...m},C)=>{const w=c.useCallback(K=>null,[]);ye.makeStyles({"@global":{".chonky-dropdownList":{backgroundColor:`${e==null?void 0:e.surface} !important`},'li[class*="chonky-activeButton"]':{color:`${e==null?void 0:e.primary} !important`}}})();const M=K=>K.replace(/([A-Z])/g,re=>"-"+re.toLowerCase()),b=c.useMemo(()=>e!==void 0?Object.keys(e).reduce((re,a)=>{const l=e[a];return a=a.startsWith("--")?a:`--fp-theme-${M(a)}`,re[a]=l,re},{}):{},[e]),[I,B]=c.useState(!1),[W,J]=c.useState(),[H,Y]=c.useState(!1),[X,O]=c.useState(),[q,x]=c.useState();return c.useEffect(()=>{e&&B(!0),J(t),n?Y(!0):O([F.ChonkyActions.CreateFolder,F.ChonkyActions.DeleteFiles]),s!==void 0&&x(cr[s])},[e,t,n,s]),r.jsx(ce,{style:{...i,...b},children:r.jsx(F.FullFileBrowser,{ref:C,files:o??[],folderChain:d,onFileAction:K=>{typeof h=="function"&&h(K)},thumbnailGenerator:w,defaultFileViewActionId:W,disableDragAndDrop:H,fileActions:X,darkMode:I,i18n:q,...m})})}));g.useMediaQuery=jt,Object.defineProperty(g,"CesiumMath",{enumerable:!0,get:()=>S.Math}),Object.defineProperty(g,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>S.sampleTerrainMostDetailed}),g.Autocomplete=or,g.BboxCorner=Pe,g.Box=ce,g.COORDINATES_MERCATOR_FRACTION_DIGITS=Ie,g.COORDINATES_WGS_FRACTION_DIGITS=De,g.Cesium3DTileset=xi,g.CesiumBoundingSphere=ii,g.CesiumCartesian2=ti,g.CesiumCartesian3=ni,g.CesiumCartographic=vt,g.CesiumCesiumTerrainProvider=ci,g.CesiumColor=Ui,g.CesiumConstantPositionProperty=ei,g.CesiumConstantProperty=Rn,g.CesiumCustomDataSource=Gt,g.CesiumDrawingsDataSource=qi,g.CesiumEllipsoid=ri,g.CesiumEllipsoidTerrainProvider=li,g.CesiumEntity=Nt,g.CesiumEntityDescription=Vi,g.CesiumEntityStaticDescription=Bt,g.CesiumGeographicTilingScheme=oi,g.CesiumGeojsonLayer=Ni,g.CesiumImageryLayer=_e,g.CesiumLabelStyle=ui,g.CesiumMap=ki,g.CesiumOSMLayer=Gi,g.CesiumPolygonGraphics=Ft,g.CesiumPolylineDashMaterialProperty=Qn,g.CesiumRectangle=si,g.CesiumRectangleGraphics=Ht,g.CesiumResource=ai,g.CesiumSceneMode=ie,g.CesiumVerticalOrigin=di,g.CesiumViewer=Di,g.CesiumWMSLayer=Bi,g.CesiumWMTSLayer=Fi,g.CesiumXYZLayer=Hi,g.CoordinatesTrackerTool=Et,g.CssBaseline=Yn,g.DateRangePicker=yn,g.DateTimePicker=vn,g.DateTimeRangePicker=at,g.DateTimeRangePickerFormControl=gn,g.DrawHelper=ve,g.DrawType=se,g.FileHelper=dr,g.FilePicker=hr,g.FilePickerActions=ur,g.FilePickerViewObj=Ut,g.InspectorTool=Ki,g.MapFilterContainer=$n,g.Popover=lt,g.Proj=ge,g.ScaleTrackerTool=Ct,g.ScopedCssBaseline=Xn,g.SmartTable=jn,g.SupportedLocales=ue,g.TerrainianHeightTool=Yi,g.TimeRangeInput=pn,g.ZoomLevelTrackerTool=Tt,g.defaultFormatters=Fe,g.isDateRange=Ae,g.mapMcToMuiTheme=st,g.polygonToGeoJSON=Vt,g.rectangleToGeoJSON=zt,g.rectangleToPositions=$t,g.useCesiumMap=le,g.useMappedMuiTheme=ze,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
@@ -48,6 +48,7 @@ export interface CesiumMapProps extends ViewerProps {
48
48
  showZoomLevel?: boolean;
49
49
  showScale?: boolean;
50
50
  showLoadingProgress?: boolean;
51
+ showCompass?: boolean;
51
52
  projection?: Proj;
52
53
  center?: [number, number];
53
54
  zoom?: number;