@map-colonies/react-components 4.5.0 → 4.6.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.
- package/dist/@map-colonies/react-components.es.js +1277 -1148
- package/dist/@map-colonies/react-components.umd.js +10 -10
- package/dist/cesium-map/settings/settings.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/ol-map/feature.d.ts +3 -0
- package/dist/ol-map/index.d.ts +6 -0
- package/dist/ol-map/interactions/index.d.ts +1 -0
- package/dist/ol-map/layers/index.d.ts +3 -0
- package/dist/ol-map/layers/vector-tile-layer.d.ts +10 -0
- package/dist/ol-map/source/index.d.ts +6 -0
- package/dist/ol-map/source/mvt.d.ts +11 -0
- package/dist/ol-map/source/wms.d.ts +17 -0
- package/dist/ol-map/source/wmts.d.ts +21 -0
- package/dist/ol-map/source/xyz.d.ts +12 -0
- package/dist/ol-map/style.d.ts +4 -0
- package/package.json +2 -2
|
@@ -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("@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:" "}))):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(`
|
|
1
|
+
(function(d,o){typeof exports=="object"&&typeof module<"u"?o(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("ol/layer/VectorTile"),require("ol/style"),require("ol/tilegrid/WMTS"),require("ol/extent"),require("ol/source/TileWMS"),require("ol/source/XYZ"),require("ol/source/VectorTile"),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","ol/layer/VectorTile","ol/style","ol/tilegrid/WMTS","ol/extent","ol/source/TileWMS","ol/source/XYZ","ol/source/VectorTile","@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"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d.reactComponents={},d.jsxRuntime,d.React,d.dateFns,d.locale,d.pickers,d.DateFnsUtils,d.styles,d.core,d.reactCore,d.useMediaQuery,d.DatePicker,d.datePickerHebrewLocale,d.moment,d.rewind,d.ol,null,d.coordinate,d.control,d.MousePosition,d.proj,d.layer,d.source,d.format,d.interaction,d.Draw,d.VectorTile,d.style,d.WMTSTileGrid,d.extent,d.OlTileWMS,d.OlXYZ,d.VectorTileSource,d.TableHead,d.utils,d.CssBaseline,d.ScopedCssBaseline,d.ReactDOM,d.resium,d.Cesium,d.lodash,d.booleanPointInPolygon,null,d.viewerCesiumNavigationMixin,null,d.turf,d.bbox,d.bboxPolygon,d.getCaretCoordinates,d.getInputSelection,d.chonky,d.chonkyIconFontawesome,d.filesize))})(this,function(d,o,c,he,Ae,we,Qe,ye,Z,z,gn,Re,pn,Se,fn,et,Ur,tt,ze,We,nt,it,$e,Ue,mn,yn,vn,Ie,En,rt,Cn,Tn,wn,Sn,ot,bn,Ln,Mn,fe,S,W,_n,qr,Pn,Kr,An,st,at,In,lt,F,Dn,On){"use strict";var Wr=Object.defineProperty;var $r=(d,o,c)=>o in d?Wr(d,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[o]=c;var ee=(d,o,c)=>($r(d,typeof o!="symbol"?o+"":o,c),c);function qe(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 ct=qe(c),m=qe(S),dt=qe(An);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||{}),De=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(De||{});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:n,...t}=e;return o.jsx(Z.Box,{...t,children:n})},Ke=e=>{const n=e.type==="dark";return c.useMemo(()=>ut(e,n),[n,e])},ut=(e,n=!1)=>ye.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}}}),jr="",kn=2,Nn=.5,xn=ye.makeStyles(e=>ye.createStyles({container:{padding:e.spacing(kn),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Nn)}})),ht=e=>{var X,k,q,N;const n=xn(),t=z.useTheme(),i=Ke(t),[s,r]=c.useState(null),[u,g]=c.useState(null),[f,y]=c.useState(R.DATE_RANGE_PICKER.dateFormat),T=e.controlsLayout??R.DATE_RANGE_PICKER.controlsLayout,_=e.disableFuture??R.DATE_RANGE_PICKER.disableFuture,b=((X=e.local)==null?void 0:X.startPlaceHolderText)??R.DATE_RANGE_PICKER.local.startPlaceHolderText,D=((k=e.local)==null?void 0:k.endPlaceHolderText)??R.DATE_RANGE_PICKER.local.endPlaceHolderText,B=((q=e.local)==null?void 0:q.setText)??R.DATE_RANGE_PICKER.local.setText,J=(((N=e.local)==null?void 0:N.calendarLocale)??R.DATE_RANGE_PICKER.local.calendarLocale)===ue.HE?Ae.he:Ae.enUS;c.useEffect(()=>{r(e.from??null)},[e.from]),c.useEffect(()=>{g(e.to??null)},[e.to]),c.useEffect(()=>{y(e.dateFormat??R.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const V=Boolean(he.isValid(s)&&!u||he.isValid(u)&&!s||s&&u&&he.isValid(s)&&he.isValid(u)&&he.isBefore(s,u)),Y=()=>{e.onChange({from:s&&he.isValid(s)?s:void 0,to:u&&he.isValid(u)?u:void 0})};return o.jsx(Z.ThemeProvider,{theme:i,children:o.jsx(ce,{className:`${n.container} drpContainer`,display:"flex",flexDirection:T,width:T==="column"?e.contentWidth:"unset",children:o.jsxs(we.MuiPickersUtilsProvider,{utils:Qe,locale:J,children:[o.jsx(we.KeyboardDateTimePicker,{variant:"inline",placeholder:b,onChange:K=>r(K),value:s,disableFuture:_,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(we.KeyboardDateTimePicker,{variant:"inline",placeholder:D,className:n.margin,onChange:K=>g(K),value:u,disableFuture:_,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(z.ThemeProvider,{options:t,children:o.jsx(z.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:Y,disabled:!V,children:B})})]})})})},gt=e=>{const{children:n,...t}=e;return o.jsx(Z.Popover,{...t,children:n})},Yr="",Bn=e=>{var k,q;const[n,t]=c.useState(null),[i,s]=c.useState(null),[r,u]=c.useState(R.DATE_RANGE_PICKER.dateFormat),[g,f]=c.useState(null),y=N=>{f(N.currentTarget)},T=N=>{N.currentTarget.tagName==="I"?f(N.currentTarget.previousElementSibling):f(N.currentTarget)},_=()=>{f(null)},b=Boolean(g),D=e.controlsLayout??"column";c.useEffect(()=>{t(e.from??null)},[e.from]),c.useEffect(()=>{s(e.to??null)},[e.to]),c.useEffect(()=>{u(e.dateFormat??R.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const B=((k=e.local)==null?void 0:k.startPlaceHolderText)??R.DATE_RANGE_PICKER.local.startPlaceHolderText,$=((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,V=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(()=>`${n?he.format(n,r):B} - ${i?he.format(i,r):$}`,[n,i,r,B,$]);return o.jsxs(o.Fragment,{children:[J?o.jsx(z.Button,{style:{width:e.width},raised:!0,onClick:y,className:"drpOpener",children:X}):o.jsx(z.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:X,onClick:T,trailingIcon:{icon:"date_range",tabIndex:0,onClick:T}}),o.jsx(gt,{open:b,anchorEl:g,onClose:_,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:o.jsx(ht,{controlsLayout:D,contentWidth:((g==null?void 0:g.clientWidth)??0)-V,dateFormat:r,disableFuture:Y,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:i??void 0,onChange:({from:N,to:K})=>{t(N??null),s(K??null),e.onChange({from:N,to:K}),_()}})})]})},Oe=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,Fn=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:i=()=>{},endTimeInputClassName:s="",endTimeLabel:r="",endTimeWrapperClassName:u="",timeRangeInputsWrapperClassName:g="",startTimeInputClassName:f="",startTimeLabel:y="",startTimeWrapperClassName:T=""})=>o.jsxs("div",{className:`timeRangeWrapper ${g}`,children:[o.jsx("div",{className:`startTimeWrapper ${T}`,children:o.jsx(z.TextField,{label:y,disabled:n===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:Se(n).format("HH:mm"),onChange:_=>{const b=Se(n),D=Se(_.currentTarget.value,"HH:mm"),B=b.set({hours:D.get("hours"),minutes:D.get("minutes")});i(B.toDate())}})}),o.jsx("div",{className:`endTimeWrapper ${u}`,children:o.jsx(z.TextField,{label:r,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Se(e).format("HH:mm"),onChange:_=>{const b=Se(e),D=Se(_.currentTarget.value,"HH:mm"),B=b.set({hours:D.get("hours"),minutes:D.get("minutes")});t(B.toDate())}})})]}),Vn=c.forwardRef(({value:e,onClick:n,onInputClick:t,...i},s)=>o.jsx(z.TextField,{...i,className:"dateRangeCustomInput",readOnly:!0,onClick:r=>{n==null||n(r),t==null||t()},ref:s,value:e})),Gn=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:i,onShortcut:s})=>{const[r,u]=c.useState(),g=c.useMemo(()=>t.map(f=>f instanceof Function?f():f),[t]);return c.useEffect(()=>{for(const f of g){const y=i.startDate&&i.endDate&&he.isSameDay(f.startDate,i.startDate)&&he.isSameDay(f.endDate,i.endDate);r?f.id===r&&(y||u(void 0)):y&&u(f.id)}},[i,r,g]),o.jsx("div",{className:"shortcutsContainer",children:g.map((f,y)=>{const T=()=>{e(f.startDate),n(f.endDate)};return o.jsx(z.Button,{type:"button",className:`shortcut ${r===f.id?"selected":""}`,onClick:_=>{T(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+y)})})},Hn=c.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:i,monthClassName:s,selectsRange:r,onChange:u,inputName:g,showMonthYearDropdown:f,withShortcuts:y,locale:T="en"}=e,[_,b]=c.useState(null),[D,B]=c.useState(null),[$,J]=c.useState(!1),V=r?{startDate:_,endDate:D}:_;c.useEffect(()=>{T==="he"&&Re.registerLocale("he",pn)},[T]),c.useEffect(()=>{var k,q;((k=e.startDate)==null?void 0:k.toString())!==(_==null?void 0:_.toString())&&b(e.startDate),((q=e.endDate)==null?void 0:q.toString())!==(D==null?void 0:D.toString())&&B(e.endDate)},[e.startDate,e.endDate,_,D]);const Y=c.useMemo(()=>{let k="pickerContainer"+(T==="he"?" pickerContainer-rtl":"");return y&&r&&(k+=" pickerContainer-withShortcuts"),k},[T,y,r]),X=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return o.jsx("div",{className:Y,style:{direction:T==="he"?"rtl":"ltr"},children:o.jsx(Re,{...e,ref:n,onClickOutside:()=>J(!1),open:$,startDate:Oe(V)?_:void 0,selected:_,endDate:Oe(V)?D:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:k=>`pickerWeek ${(i==null?void 0:i(k))??""}`,dayClassName:k=>`pickerDay ${(i==null?void 0:i(k))??""}`,monthClassName:k=>`pickerMonth ${(s==null?void 0:s(k))??""}`,onChange:(k,q)=>{if(Array.isArray(k)){const[N,K]=k;b(N),B(K),u==null||u({startDate:N,endDate:K&&he.endOfDay(K)},q)}else b(k),u==null||u(k,q)},customInput:o.jsx(Vn,{name:g,onInputClick:()=>{J(!0)}}),showTimeInput:!!(y&&r),timeInputLabel:"",customTimeInput:y&&Oe(V)&&o.jsx(Gn,{onShortcut:k=>{u==null||u(k),J(!1)},shortcuts:y,setEndDate:B,setStartDate:b,dateRange:V}),showMonthYearDropdown:void 0,...X})})}),Xr="",zn=e=>{const n=z.useTheme(),t=Ke(n),[i,s]=c.useState(e.value),{format:r=R.DATE_PICKER.dateFormat,variant:u=R.DATE_PICKER.variant,disableFuture:g=R.DATE_PICKER.disableFuture,local:f,onChange:y,showTime:T=R.DATE_PICKER.showTime,value:_,...b}=e,{placeHolderText:D=R.DATE_PICKER.local.placeHolderText,calendarLocale:B}=f??{placeHolderText:R.DATE_PICKER.local.placeHolderText,calendarLocale:ue.EN},$=B===ue.HE?Ae.he:Ae.enUS,J=V=>{s(V),y(V)};return o.jsx(Z.ThemeProvider,{theme:t,children:o.jsxs(we.MuiPickersUtilsProvider,{utils:Qe,locale:$,children:[T&&o.jsx(we.KeyboardDateTimePicker,{variant:u,placeholder:D,onChange:J,value:i,disableFuture:g,format:r,...b}),!T&&o.jsx(we.KeyboardDatePicker,{variant:u,placeholder:D,onChange:J,value:i,disableFuture:g,format:r,...b})]})})},Wn=18,$n=ye.makeStyles(e=>ye.createStyles({drawingButton:{width:e.spacing(Wn)},fullWidth:{width:"100%",marginTop:"36px"}})),Un=e=>{const n=$n(),[t,i]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:r,onStartDraw:u,onReset:g}=e,f=T=>{i(T.currentTarget)},y=()=>{i(null)};return s?o.jsx(z.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:o.jsx(z.Button,{className:n.drawingButton,raised:!0,onClick:r,children:"Cancel Draw"})}):o.jsxs(ce,{position:"relative",children:[o.jsx(z.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:o.jsx(z.Button,{className:n.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),o.jsxs(z.Menu,{className:n.fullWidth,open:Boolean(t),onClose:y,children:[o.jsx(z.MenuItem,{onClick:()=>{u(se.POLYGON),y()},children:"Polygon"}),o.jsx(z.MenuItem,{onClick:()=>{u(se.BOX),y()},children:"Box"}),o.jsx(z.MenuItem,{onClick:()=>{g(),y()},children:"Clear"})]})]})},Zr="";var ge=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(ge||{});const ke=5,Ne=2,pt=c.createContext(null),qn=pt.Provider,ft=35,mt=32,Kn=10,jn=e=>e!==void 0&&e!==ge.WGS84?nt.transform([ft,mt],ge.WGS84,e):[ft,mt],Yn=e=>{switch(e){case ge.WEB_MERCATOR:return n=>tt.format(n,"Mercator: {y}m, {x}m",Ne);case ge.WGS84:return n=>tt.format(n,"WGS84: {y}°N {x}°E",ke);default:return n=>""}},be=()=>{const e=c.useContext(pt);if(e===null)throw new Error("map context is null, please check the provider");return e},yt=e=>{const n=c.useRef(null),{allowFullScreen:t,showMousePosition:i,projection:s}=e,[r]=c.useState(new et.Map({view:new et.View({projection:s??ge.WGS84}),controls:ze.defaults()}));c.useEffect(()=>{r.getView().setCenter(e.center??jn(e.projection))},[r,e.center,e.projection]),c.useEffect(()=>{r.getView().setZoom(e.zoom??Kn)},[r,e.zoom,e.projection]);const u=(g,f)=>{f.getControls().forEach(T=>{T instanceof g&&f.removeControl(T)})};return c.useEffect(()=>{r.setTarget(n.current),t!==void 0&&t?r.addControl(new ze.FullScreen):u(ze.FullScreen,r)},[r,t]),c.useEffect(()=>{i!==void 0&&i?(u(We,r),r.addControl(new We({coordinateFormat:Yn(s??ge.WGS84),projection:s??ge.WGS84,undefinedHTML:" "}))):u(We,r)},[r,i,s]),o.jsxs(qn,{value:r,children:[o.jsx("div",{className:"map",ref:n}),e.children]})},vt=c.createContext(null),Xn=vt.Provider,Me=()=>{const e=c.useContext(vt);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Et=({options:e,children:n})=>{const t=be(),[i]=c.useState(new it.Tile(e));return c.useEffect(()=>(t.addLayer(i),()=>{t.removeLayer(i)}),[t,i]),o.jsx(Xn,{value:i,children:n})},Ct=c.createContext(null),Zn=Ct.Provider,Tt=()=>{const e=c.useContext(Ct);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},wt=({children:e})=>{const n=be(),[t]=c.useState(new it.Vector);return c.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),o.jsx(Zn,{value:t,children:e})},St=c.createContext(null),Jn=St.Provider,bt=()=>{const e=c.useContext(St);if(e===null)throw new Error("vector source context is null, please check the provider");return e},Lt=({children:e})=>{const n=Tt(),[t]=c.useState(new $e.Vector);return c.useEffect(()=>{n.setSource(t)},[t,n]),o.jsx(Jn,{value:t,children:e})},Mt=({geometry:e,fitOptions:n,fit:t})=>{const i=bt(),s=be();return c.useLayoutEffect(()=>{const u=new Ue.GeoJSON().readFeature(e);return t&&i.on("addfeature",function(){s.getView().fit(i.getExtent(),n)}),i.addFeature(u),()=>{i.removeFeature(u)}},[e,i,t]),null},_t=e=>{const n=Me();return c.useEffect(()=>{n.setSource(new $e.OSM)},[n]),null},Pt=({drawType:e,onPolygonSelected:n})=>{const t=be();return c.useEffect(()=>{const i={type:"Circle"};switch(e){case se.BOX:i.geometryFunction=yn.createBox();break;case se.POLYGON:i.type="Polygon";break;default:return}const s=new mn.Draw(i);t.addInteraction(s);const r=u=>{const f=new Ue.GeoJSON().writeGeometryObject(u.feature.getGeometry());n==null||n(f)};return s.on("drawend",r),()=>{s.un("drawend",r),t.removeInteraction(s)}},[n,e,t]),null},Jr="",Qn=e=>{const n=t=>{const i=fn(t);e.onPolygonSelection(i)};return o.jsxs(yt,{allowFullScreen:!0,showMousePosition:!0,children:[o.jsx(Et,{children:o.jsx(_t,{})}),e.selectionPolygon&&o.jsx(wt,{children:o.jsx(Lt,{children:o.jsx(Mt,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&o.jsx(Pt,{drawType:e.drawType,onPolygonSelected:n})]})},je=1.5,Rn=80,ei=ye.makeStyles(e=>ye.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(je),top:e.spacing(je)},contentContainer:{marginTop:e.spacing(je),width:e.spacing(Rn)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),ti=e=>{var f;const[n,t]=c.useState(),[i,s]=c.useState(),r=ei(),u=y=>{s(y),t(void 0),e.handlePolygonSelected(y)},g=()=>{s(void 0),e.handlePolygonReset()};return o.jsxs("div",{className:r.map,children:[o.jsxs("div",{className:`${r.absolute}`,children:[o.jsxs(Z.Paper,{className:r.filtersContainer,children:[o.jsx(Un,{onCancelDraw:()=>t(void 0),onReset:g,onStartDraw:t,isSelectionEnabled:n!==void 0}),(f=e.filters)==null?void 0:f.map((y,T)=>o.jsx("div",{className:r.filtersMargin,children:y},T))]}),o.jsx(Z.Paper,{color:"red",className:`${r.contentContainer}`,children:e.children})]}),o.jsx(Qn,{children:e.mapContent,onPolygonSelection:u,drawType:n,selectionPolygon:i})]})},At=new Ie.Fill({color:"rgba(255,255,255,0.4)"}),It=new Ie.Stroke({color:"#3399CC",width:1.25}),Dt=[new Ie.Style({image:new Ie.Circle({fill:At,stroke:It,radius:5}),fill:At,stroke:It})],Ot=c.createContext(null),ni=Ot.Provider,kt=()=>{const e=c.useContext(Ot);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},ii=({children:e,options:n,style:t})=>{const i=be(),[s]=c.useState(new vn({...n,style:t||Dt}));return c.useEffect(()=>(i.addLayer(s),()=>{i.removeLayer(s)}),[i,s]),c.useEffect(()=>{s.setStyle(t||Dt)},[s,t]),o.jsx(ni,{value:s,children:e})},Ye=20,ri=256,oi=2,si=2,ai="REST",li=e=>{const n=nt.get(e.projection),t=n.getExtent(),i=new Array(Ye),s=new Array(Ye),r=rt.getWidth(t)/ri,u=e.heightWidthRatio!==void 0?e.heightWidthRatio:si,g=e.requestEncoding!==void 0?e.requestEncoding:ai;for(let y=0;y<Ye;++y)i[y]=r/Math.pow(oi,y)/u,s[y]=y.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:n,tileGrid:new En({origin:rt.getTopLeft(t),resolutions:i,matrixIds:s}),style:e.style,requestEncoding:g,wrapX:e.wrapX!==void 0?e.wrapX:!0}},ci=e=>{const n=Me(),{options:t}=e;return c.useEffect(()=>{n.setSource(new $e.WMTS(t))},[n,t]),null},di=e=>{const{attributions:n,url:t,params:i,serverType:s,transition:r}=e;return{attributions:n,url:t,params:i,serverType:s,transition:r}},ui=e=>{const n=Me(),{options:t}=e;return c.useEffect(()=>{n.setSource(new Cn(t))},[n,t]),null},hi=e=>{const{attributions:n,url:t}=e;return{attributions:n,url:t}},gi=e=>{const n=Me(),{options:t}=e;return c.useEffect(()=>{n.setSource(new Tn(t))},[n,t]),null},pi=c.createContext(null),fi=()=>{const e=c.useContext(pi);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},mi=e=>{const{url:n}=e;return{url:n,format:new Ue.MVT}},yi=({children:e,options:n})=>{const t=kt();return c.useEffect(()=>{t.setSource(new wn(n))},[n,t]),null};function vi(e){const{headCells:n,order:t,orderBy:i,onRequestSort:s,isCollapseable:r}=e,u=g=>f=>{s(f,g)};return o.jsx(Sn,{children:o.jsxs(Z.TableRow,{children:[r&&o.jsx(Z.TableCell,{}),n.map(g=>o.jsx(Z.TableCell,{align:g.numeric?"right":"left",padding:g.disablePadding?"none":"default",sortDirection:i===g.id?t:!1,children:o.jsx(Z.TableSortLabel,{active:i===g.id,direction:i===g.id?t:"asc",onClick:u(g.id),children:g.label})},g.id))]})})}const Ei=ot.createSvgIcon(ct.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),Ci=ot.createSvgIcon(ct.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function Ti(e){const{cellsMetadata:n,isRowSelected:t,item:i,onRowSelected:s,rowIndex:r,isCollapseable:u,collapsedElement:g}=e,[f,y]=c.useState(!1),T=n.length,_=()=>{s==null||s(r)};return o.jsxs(o.Fragment,{children:[o.jsxs(Z.TableRow,{hover:!0,selected:t,onClick:_,children:[u&&o.jsx(Z.TableCell,{padding:"checkbox",children:o.jsx(Z.IconButton,{"aria-label":"expand row",size:"small",onClick:b=>{b.stopPropagation(),y(!f)},children:f?o.jsx(Ci,{}):o.jsx(Ei,{})})}),n.map(b=>o.jsx(Z.TableCell,{align:b.numeric?"right":"left",padding:b.disablePadding?"none":"default",children:b.transform?b.transform(i[b.id]):i[b.id]},b.id+r.toString()))]}),u&&o.jsx(Z.TableRow,{children:o.jsx(Z.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:T+1,children:o.jsx(Z.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:g==null?void 0:g(i)})})})]})}function wi(e){const[n,t]=c.useState(""),[i,s]=c.useState("asc"),{cellsMetadata:r,items:u,onRequestSort:g,onRowSelected:f,isCollapseable:y,collapsedElement:T,isDense:_,page:b,rowsPerPage:D,count:B,handleChangePage:$,handleChangeRowsPerPage:J}=e,V=(Y,X)=>{const k=n===X&&i==="asc";s(k?"desc":"asc"),t(X),g(X,k?"desc":"asc")};return o.jsxs(Z.TableContainer,{component:Z.Paper,children:[o.jsxs(Z.Table,{size:_?"small":"medium",children:[o.jsx(vi,{headCells:r,onRequestSort:V,order:i,orderBy:n,isCollapseable:y}),o.jsxs(Z.TableBody,{children:[u.map((Y,X)=>o.jsx(Ti,{item:Y,rowIndex:X,isCollapseable:y,cellsMetadata:r,collapsedElement:T,isRowSelected:!1,onRowSelected:f},X)),(u.length===0||D>u.length)&&o.jsx(Z.TableRow,{style:{height:(_?33:53)*(D-u.length)},children:o.jsx(Z.TableCell,{colSpan:y?r.length+1:r.length,children:u.length===0&&o.jsx(Z.Typography,{align:"center",children:"No results :("})})})]})]}),o.jsx(Z.TablePagination,{rowsPerPage:D,rowsPerPageOptions:[5,10],component:"div",count:B,page:b,onPageChange:$,onRowsPerPageChange:J})]})}const Si=e=>{const{children:n,...t}=e;return o.jsx(bn,{...t,children:n})},bi=e=>{const{children:n,...t}=e;return o.jsx(Ln,{...t,children:n})},Nt=e=>e*Math.PI/180,xe=e=>e*(180/Math.PI),Li=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(Nt(85.362/2))/Math.sin(Nt(85.362/2))),Qr="",xt=(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)},Mi=(e,n,t)=>{const i=xt(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[S.Math.toDegrees(i.longitude),S.Math.toDegrees(i.latitude)]}}},Bt=(e,n,t)=>{try{const i=xt(e,n,t);return{longitude:S.Math.toDegrees(i.longitude),latitude:S.Math.toDegrees(i.latitude)}}catch{return}};class _i extends S.PolylineDashMaterialProperty{}class Pi extends S.ConstantProperty{}class Ai extends S.ConstantPositionProperty{}class Ii extends S.Cartesian2{}class Di extends S.Cartesian3{}class Ft extends S.Cartographic{}class Oi extends S.BoundingSphere{}class ki extends S.Ellipsoid{}class Ni extends S.GeographicTilingScheme{}class xi extends S.Rectangle{}class Bi extends S.Resource{}class Fi extends S.EllipsoidTerrainProvider{}class Vi extends S.CesiumTerrainProvider{}const Gi=S.VerticalOrigin,Hi=S.LabelStyle,Vt=e=>{const n=le(),t=c.useRef(null),[i,s]=c.useState({x:0,y:0});return c.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(r=>{if(r!=null&&r.endPosition){const u={...r.endPosition};u.x=Math.ceil(u.x),u.y=Math.ceil(u.y),s(u)}},S.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),c.useEffect(()=>{const r=n.scene.globe.ellipsoid;if(i){const u=Bt(n,i.x,i.y);if(u){const g=new Ft(u.longitude,u.latitude);if(t.current){let f="";switch(e.projection){case ge.WEB_MERCATOR:{const T=new S.WebMercatorProjection(r).project(g);f=`Mercator: ${T.y.toFixed(Ne)}m, ${T.x.toFixed(Ne)}m`,t.current.style.width="220px";break}case ge.WGS84:{const y=g.longitude.toFixed(ke);f=`WGS84: ${g.latitude.toFixed(ke)}°N ${y}°E`,t.current.style.width="200px";break}}t.current.innerHTML=f}}}},[i,t,n,e.projection]),o.jsx("div",{className:"trackerPosition",ref:t})},Rr="",Xe=[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],zi=(e,n,t,i)=>{const s=W.get(i,"METERS_UNIT")??"m",r=W.get(i,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},g=new S.EllipsoidGeodesic,f=new Date().getTime();if(f<u.lastLegendUpdate+250)return;u.lastLegendUpdate=f;const y=e.scene.canvas.clientWidth,T=e.scene.canvas.clientHeight,_=e.scene.camera.getPickRay(new S.Cartesian2(y/2|0,T-1)),b=e.scene.camera.getPickRay(new S.Cartesian2(1+y/2|0,T-1)),D=e.scene.globe,B=D.pick(_,e.scene),$=D.pick(b,e.scene);if(!B||!$)return;const J=D.ellipsoid.cartesianToCartographic(B),V=D.ellipsoid.cartesianToCartographic($);g.setEndPoints(J,V);const Y=g.surfaceDistance,X=100;let k;for(let q=Xe.length-1;!W.isNumber(k)&&q>=0;--q)Xe[q]/Y<X&&(k=Xe[q]);if(W.isNumber(k)){let q="";k>=1e3?q=`${(k/1e3).toString()} ${r}`:q=`${k.toString()} ${s}`,u.barWidth=k/Y|0,u.distanceLabel=q}t(u)},Gt=e=>{const n=le(),[t,i]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const r=f=>{zi(n,t,i,e.locale)},u=new S.EventHelper,g=f=>{n.scene.globe.tilesLoaded&&(r(new MouseEvent("mouse")),u.removeAll())};return u.add(n.scene.globe.tileLoadProgressEvent,g),n.camera.moveEnd.addEventListener(r),()=>{try{W.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(r)}catch(f){console.log('CESIUM camera "moveEnd" remove listener failed',f)}}},[n,e.locale,t]);const s=r=>5+(125-r)/2;return o.jsx("div",{className:"scalePosition",children:W.isNumber(t.barWidth)&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scale-tracker-label",children:o.jsx("bdi",{children:t.distanceLabel})}),o.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},eo="",Ht=(e,n)=>{const i=W.get(n.scene.globe,"_surface.tileProvider"),s=i._quadtree,r=n.canvas.height,u=W.get(n.camera.frustum,"sseDenominator")??1;for(let g=0;g<=19;g++)if(i.getLevelMaximumGeometricError(g)*r/(e*u)<s.maximumScreenSpaceError)return g;return null},Wi=(e,n)=>{e=e||10;const t=[];let i=1e5,s=0;for(let r=1e8;r>i;r=r-i){const u=Ht(r,n);if(u===null)break;if(u!==s){let g=r,f=r+i;for(;f-g>e;)r=g+(f-g)/2,Ht(r,n)===u?g=r:f=r;t.push({level:u,height:Math.round(r)}),s=u,t.length>=2&&(i=(t[t.length-2].height-r)/1e3)}}return t},zt=({locale:e=void 0,valueBy:n="RENDERED_TILES"})=>{const t=le(),[i,s]=c.useState(1),r=Wi(1,t),u=c.useCallback(()=>{const T=t.camera,_=.5;let b=0;switch(t.scene.mode){case ie.SCENE3D:b=t.scene.mapProjection.ellipsoid.cartesianToCartographic(T.positionWC).height;break;case ie.SCENE2D:b=(T.frustum.right-T.frustum.left)*_;break;case ie.COLUMBUS_VIEW:b=T.position.z;break;default:b=0;break}if(r.length>0){const D=r.reduce((B,$)=>Math.abs($.height-b)<Math.abs(B.height-b)?$:B);s(D.level)}},[t,r]),g=c.useCallback(()=>{let T=0;t.scene.globe._surface.forEachRenderedTile(function(_){T=Math.max(T,_.level)}),s(T)},[t]),y=c.useMemo(()=>({CALCULATION:u,RENDERED_TILES:g}),[u,g])[n];return c.useEffect(()=>{const T=t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded&&y()});return t.camera.moveEnd.addEventListener(y),()=>{try{typeof W.get(t,"_cesiumWidget")<"u"&&(t.camera.moveEnd.removeEventListener(y),T())}catch(_){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',_)}}},[t,y]),o.jsxs("div",{className:"zoomLevel",children:[o.jsx("div",{className:"zoomLevelValue",children:i}),o.jsx("div",{className:"zoomLevelLabel",children:W.get(e,"ZOOM_LABEL")??"zoom"})]})},to="",$i=-1,Ui=e=>{const n=le(),[t,i]=c.useState(),{sceneModes:s}=e,r=u=>s.findIndex(g=>g===u)>$i;return c.useEffect(()=>{i(n.scene.mode)},[]),o.jsxs(o.Fragment,{children:[r(ie.SCENE3D)&&o.jsx(z.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.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)}}),r(ie.SCENE2D)&&o.jsx(z.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.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)}}),r(ie.COLUMBUS_VIEW)&&o.jsx(z.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.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)}})]})},no="",qi=ye.makeStyles(e=>ye.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),Ki=e=>{const n=le(),{baseMaps:t}=e,[i,s]=c.useState(" "),[r,u]=c.useState(),g=qi();c.useEffect(()=>{const y=t==null?void 0:t.maps.find(T=>T.isCurrent);y&&(u(y),s(y.title!==void 0?y.title:" "))},[t]);const f=y=>{var T,_;if(t){(T=n.layersManager)==null||T.removeBaseMapLayers();const b=t.maps.find(D=>D.id===y);b&&((_=n.layersManager)==null||_.setBaseMapLayers(b),u(b),t.maps.forEach(D=>{D.isCurrent=b===D}))}};return o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"mapLabel",children:i}),o.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(y=>o.jsx("li",{className:`mapContainer ${g.mapContainer} ${y===r?"mapContainerSelected":""}`,children:o.jsx("img",{alt:"",className:"mapContainerImg",src:y.thumbnail,onMouseOver:()=>{s(y.title)},onMouseOut:()=>{s((r==null?void 0:r.title)!==void 0?r.title:" ")},onClick:()=>{f(y.id)}})},y.id))})]})},io="",Ze="ic_settings_24px",ji=e=>{const[n,t]=c.useState(!1),{sceneModes:i,baseMaps:s,locale:r}=e,u=c.useRef(null),g=W.get(r,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",f=W.get(r,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",y=W.get(r,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const T=_=>{var B;const b=_.target,D=W.get(u,"current");D&&!D.contains(b)&&b.id!==Ze&&((B=b.parentElement)==null?void 0:B.id)!==Ze&&(document.removeEventListener("click",T,!1),t(!1))};return document.addEventListener("click",T,!1),()=>{document.removeEventListener("click",T,!1)}}),o.jsxs(o.Fragment,{children:[o.jsx(z.Icon,{icon:o.jsx("div",{className:"settingsIconContainer",children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:Ze,x:"288",y:"24",children:o.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&&o.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:u,children:o.jsxs(z.Dialog,{open:n,onClosed:()=>{t(!1)},children:[o.jsx(z.DialogTitle,{children:g}),o.jsxs(z.DialogContent,{children:[o.jsx("h4",{className:"sectionLabel",children:f}),o.jsx(ce,{className:"mapScenesContainer",children:o.jsx(Ui,{sceneModes:i})}),o.jsx(ce,{className:"baseMapsContainer",children:s&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"sectionLabel",children:y}),o.jsx(Ki,{baseMaps:s})]})})]})]})})]})},ro="",Yi=o.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:o.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),Xi=({onClick:e})=>o.jsx(ce,{onClick:e,className:"mapLegendToggleContainer",children:o.jsx(z.Icon,{icon:Yi,className:"mapLegendIcon"})}),Zi=({legend:{legendImg:e,legendDoc:n,layer:t},docText:i,imgText:s})=>{const r=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(n,"_blank")},[n]);const u=c.useCallback(()=>{const y=o.jsx(ce,{className:"layerNameContainer",children:o.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?o.jsx(z.Tooltip,{content:t,children:y}):y},[t]),g=c.useCallback(()=>[typeof e=="string"&&o.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof n=="string"&&o.jsx("a",{className:"legendAction",href:n,target:"_blank",rel:"noreferrer",children:i})],[e,s,n,i]);return o.jsxs(ce,{className:"mapLegend",children:[u(),o.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:r}),o.jsx(ce,{className:"legendActionsContainer",children:g()})]})},Ji=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:i})=>{const s=c.useCallback(()=>o.jsx(ce,{className:"noLegendsContainer",children:o.jsx("h2",{className:"noLegendsMsg",children:i})}),[i]),r=c.useCallback(()=>e.length?e.map((u,g)=>o.jsx(Zi,{legend:u,docText:n,imgText:t},`${u.layer}_${g}`)):s(),[e]);return o.jsx(ce,{className:"mapLegendsList",children:r()})},Qi=({isOpen:e,toggleSidebar:n,title:t="Map Legends",noLegendsText:i="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:r=[]})=>e?o.jsxs(z.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[o.jsx(z.DrawerHeader,{className:"sidebarHeaderContainer",children:o.jsx(z.DrawerTitle,{className:"sidebarTitle",children:t})}),o.jsxs(z.DrawerContent,{className:"sidebarContent",children:[o.jsx(z.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),o.jsx(Ji,{noLegendsText:i,legends:r,actionsTexts:s})]})]}):null,me=document.createElement("canvas"),ae=me.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},Ri=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,i)=>{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 r=ae==null?void 0:ae.getImageData(0,0,me.width,me.height),u=Wt(r);u&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(u);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 r=ae==null?void 0:ae.getImageData(0,0,me.width,me.height);Wt(r)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),i(s)}})),Be=(e,n)=>{const{west:t,east:i,north:s,south:r}=e,{west:u,east:g,north:f,south:y}=n;return t>=u&&i<=g&&s<=f&&r>=y},Fe=3,Ve="hasTransparency";function Je(e,n,t,i,s){return setTimeout(()=>{var g;const r=(g=this.layerListInstance.find(f=>{var y,T;return((y=f._imageryProvider._resource)==null?void 0:y._url)===((T=this._resource)==null?void 0:T._url)}))==null?void 0:g.meta,u=W.get(r,Ve)===!0;this.tileTransparencyCheckedCounter<Fe&&!u&&Ri(s==null?void 0:s.url,this).then(f=>{var y;(y=this.mapViewer.layersManager)==null||y.addMetaToLayer({[Ve]:f},T=>T._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,i,s)}class $t extends S.UrlTemplateImageryProvider{constructor(t,i){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",Fe);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Je.call(this,super.requestImage.bind(this),t,i,s,r)}}class Ut extends S.WebMapServiceImageryProvider{constructor(t,i){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",Fe);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Je.call(this,super.requestImage.bind(this),t,i,s,r)}}class qt extends S.WebMapTileServiceImageryProvider{constructor(t,i){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",Fe);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Je.call(this,super.requestImage.bind(this),t,i,s,r)}}const er=1,tr=-1,Kt="TRANSPARENT_BASE_LAYER";class nr{constructor(n,t,i,s){ee(this,"mapViewer");ee(this,"legendsList");ee(this,"layerUpdated");ee(this,"layers");ee(this,"legendsExtractor");ee(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(r=>{const u=Object.keys(r);u.length===1&&u[0]===Ve&&(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 r=this.layers.find(t);r&&(r.meta={...r.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(Kt),this.addTransparentImageryProvider())}addRasterLayer(n,t,i){let s;switch(n.type){case"XYZ_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new $t(r,this.mapViewer):new S.UrlTemplateImageryProvider(r);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new Ut(r,this.mapViewer):new S.WebMapServiceImageryProvider(r);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new qt(r,this.mapViewer):new S.WebMapTileServiceImageryProvider(r);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=>!!W.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!W.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 r=0;r<t;r++)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,r=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(i);if(u-t<=r&&(t=u-r),i)for(let g=0;g<t;g++)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=>!W.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(r=>!W.get(r.meta,"parentBasetMapId"))),i}findLayerByPOI(n,t,i=!0){if(this.layerManagerFootprintMetaFieldPath){const s=Mi(this.mapViewer,n,t);return this.layers.filter(g=>!W.get(g.meta,"parentBasetMapId")).filter(g=>{const f=W.get(g.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?_n(s.geometry,{type:"Feature",properties:{},geometry:f})&&(i?g.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",g.meta),!1)}).sort((g,f)=>{var y,T;return((y=f.meta)==null?void 0:y.zIndex)-((T=g.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:Kt,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!W.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?er:tr,r=t<i?t:i,u=t<i?i:t;this.layers.forEach(g=>{var y;if(!W.get(g.meta,"parentBasetMapId")){const T=(y=g.meta)==null?void 0:y.zIndex;g.meta.zIndex=T>=r&&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 r=this.layers[s],u=!W.isEmpty(i)&&!W.isEmpty(r.rectangle)&&S.Rectangle.intersection(i,r.rectangle);for(let g=this.layers.length-1;g>=s;g--){if(((n=r.meta)==null?void 0:n.skipRelevancyCheck)===!0){r.meta={...r.meta,relevantToExtent:!0};continue}const f=this.layers[g],y=((t=f.meta)==null?void 0:t[Ve])===!0;if(r!==f)if(u instanceof S.Rectangle){if(Be(i,r.rectangle))if(Be(i,f.rectangle)&&!y){r.meta={...r.meta??{},relevantToExtent:!1};break}else r.meta={...r.meta??{},relevantToExtent:!0};if(Be(i,f.rectangle)&&!y){r.meta={...r.meta??{},relevantToExtent:!1};break}if(Be(r.rectangle,f.rectangle)){if(r.meta={...r.meta??{},relevantToExtent:y},!y)break}else r.meta={...r.meta??{},relevantToExtent:!0}}else r.meta={...r.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(r.meta={...r.meta??{},relevantToExtent:u instanceof S.Rectangle})}}}catch(i){console.error(i)}}}const oo="",so="",ir=e=>{const n=le(),{enableCompass:t=!0,enableZoomControls:i=!1,lockCompassNavigation:s=!1,locale:r={DIRECTION:"ltr"}}=e;return c.useEffect(()=>{if(typeof W.get(n,"cesiumNavigation")>"u"){n.extend(Pn,{enableCompass:t,enableZoomControls:i,enableDistanceLegend:!1}),n.cesiumNavigation.setNavigationLocked(s);const u=document.querySelector(".compass");u&&r.DIRECTION&&u.classList.add(r.DIRECTION)}return()=>{var u;(u=n.cesiumNavigation)==null||u.destroy()}},[n,t,i,r.DIRECTION,s]),null},jt=212,Yt=260,rr=0;class or extends S.Viewer{constructor(t,i){super(t,i);ee(this,"layersManager");ee(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const Xt=c.createContext(null),sr=Xt.Provider,le=()=>{const e=c.useContext(Xt);if(e===null)throw new Error("map context is null, please check the provider");return e},ar=e=>{var Q,x,U,te,oe,Ee,pe,de;const n=c.useRef(null),[t,i]=c.useState(),[s,r]=c.useState(),[u,g]=c.useState(),[f,y]=c.useState(),[T,_]=c.useState(),[b,D]=c.useState(),[B,$]=c.useState(),[J,V]=c.useState(!1),[Y,X]=c.useState(),k=c.useRef(),[q,N]=c.useState(),[K,re]=c.useState([]),[a,l]=c.useState(),[C,h]=c.useState(!1),E=c.useRef(),[p,w]=c.useState(void 0),[v,L]=c.useState(!1),[A,P]=c.useState(),M={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,imageryProvider:!1,...e},I=(G,H,ne,Te,Le)=>{const Ce=t.container,Pe=Ce.clientWidth,un=Ce.clientHeight,hn=Te+Le;return{left:`${Pe-G<ne?G-(ne-(Pe-G)):G}px`,top:`${un-H<hn?H-(hn-(un-H)):H}px`}},O=c.useCallback(G=>{if(n.current!==null){const H=n.current.cesiumElement,ne={x:G.offsetX,y:G.offsetY};h(!1),w(ne),P(Bt(H,ne.x,ne.y)),h(!0),E.current=G}},[n]);c.useEffect(()=>{var G;if(n.current!==null){const H=n.current.cesiumElement;e.imageryContextMenu&&(H.scene.canvas.removeEventListener("contextmenu",O),H.scene.canvas.addEventListener("contextmenu",O))}i((G=n.current)==null?void 0:G.cesiumElement)},[n,e.imageryContextMenu]),c.useEffect(()=>{var G;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new nr(t,(G=e.legends)==null?void 0:G.mapLegendsExtractor,()=>{var H;re((H=t.layersManager)==null?void 0:H.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{N(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var H,ne;l(e.baseMaps);const G=(H=e.baseMaps)==null?void 0:H.maps.find(Te=>Te.isCurrent);G&&t&&((ne=t.layersManager)==null||ne.setBaseMapLayers(G))},[e.baseMaps,t]),c.useEffect(()=>{r(e.projection??ge.WGS84)},[e.projection]),c.useEffect(()=>{X(e.locale)},[e.locale]),c.useEffect(()=>{g(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{y(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{_(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{D(e.showCompass??!0)},[e.showCompass]),c.useEffect(()=>{$(e.showLoadingProgress??!0)},[e.showLoadingProgress]),c.useEffect(()=>{const G=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const H=()=>{const ne=t.camera.positionCartographic;return{longitude:xe(ne.longitude),latitude:xe(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),Te=t.scene.camera.getPickRay(ne),Le=t.scene.globe.pick(Te,t.scene);if(!Le)return{longitude:0,latitude:0,height:0};const Ce=t.scene.globe.ellipsoid.cartesianToCartographic(Le);return Ce!==void 0?{longitude:xe(Ce.longitude),latitude:xe(Ce.latitude),height:t.scene.camera.positionCartographic.height}:H()}else return H()};t&&(t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==S.SceneMode.MORPHING){const H=t.camera,ne={position:G(),direction:H.direction.clone(),up:H.up.clone(),right:H.right.clone(),transform:H.transform.clone(),frustum:H.frustum.clone()};k.current=ne}}),B&&t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded===!0?V(!1):V(!0)}))},[t]),c.useEffect(()=>{const G=()=>{if(t&&k.current){const H=k.current;t.camera.flyTo({destination:S.Cartesian3.fromDegrees(H.position.longitude,H.position.latitude,H.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,H=e.center;t&&W.isNumber(G)&&W.isArray(H)&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees(H[0],H[1],Li(G)),duration:0})},[e.zoom,e.center,t]);const j=c.useCallback(()=>t&&Mn.createPortal(o.jsxs(o.Fragment,{children:[B===!0?J&&o.jsx(z.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}):o.jsx(o.Fragment,{}),o.jsxs(ce,{className:"sideToolsContainer",children:[o.jsx(ji,{sceneModes:q,baseMaps:a,locale:Y}),o.jsx(Xi,{onClick:()=>L(!v)})]}),o.jsxs(ce,{className:"toolsContainer",children:[u===!0?o.jsx(Vt,{projection:s}):o.jsx(o.Fragment,{}),f===!0?o.jsx(zt,{locale:Y,valueBy:"RENDERED_TILES"}):o.jsx(o.Fragment,{}),T===!0?o.jsx(Gt,{locale:Y}):o.jsx(o.Fragment,{}),b===!0?o.jsx(ir,{locale:Y}):o.jsx(o.Fragment,{})]})]}),document.querySelector(".cesium-viewer")),[a,Y,t,s,q,u,T,v,J]);return o.jsx(fe.Viewer,{className:"viewer",full:!0,ref:n,...M,children:o.jsxs(sr,{value:t,children:[o.jsx(Qi,{title:(Q=e.legends)==null?void 0:Q.title,isOpen:v,toggleSidebar:()=>L(!v),noLegendsText:(x=e.legends)==null?void 0:x.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&&C&&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:I(p.x,p.y,((Ee=e.imageryContextMenuSize)==null?void 0:Ee.width)??Yt,((pe=e.imageryContextMenuSize)==null?void 0:pe.height)??jt,((de=e.imageryContextMenuSize)==null?void 0:de.dynamicHeightIncrement)??rr),size:e.imageryContextMenuSize??{height:jt,width:Yt},handleClose:()=>{h(!C)},contextEvt:E.current})]})})},lr=0,cr=e=>{const n=le();return o.jsx(fe.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),r=e.heightFromGround??lr;if(r){const u=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),g=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+r),f=S.Cartesian3.subtract(g,u,new S.Cartesian3);t.modelMatrix=S.Matrix4.fromTranslation(f)}}})},Ge=180,Zt=.001,Jt=e=>Math.abs(e)/e,Qt=e=>{Ge-Math.abs(e[0])<Zt&&(e[0]=Jt(e[0])*(Ge-1)),Ge/2-Math.abs(e[1])<Zt&&(e[1]=Jt(e[1])*(Ge/2-1))},Rt=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{Qt(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{Qt(t)})});break}},dr=e=>{const{data:n,...t}=e,i=W.cloneDeep(n);return i&&(typeof i.features<"u"?i.features.forEach(s=>{Rt(s.geometry)}):Rt(i)),o.jsx(fe.GeoJsonDataSource,{data:i,...t})},_e=e=>{const{meta:n,...t}=e,i=le();return c.useLayoutEffect(()=>{var s;(s=i.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,i]),o.jsx(fe.ImageryLayer,{...t})},ur=e=>{const{options:n,...t}=e,i=le(),s=i.shouldOptimizedTileRequests?new Ut(n,i):new S.WebMapServiceImageryProvider(n);return o.jsx(_e,{...t,imageryProvider:s})},hr=e=>{const{options:n,...t}=e,i=le(),s=i.shouldOptimizedTileRequests?new qt(n,i):new S.WebMapTileServiceImageryProvider(n);return o.jsx(_e,{...t,imageryProvider:s})},gr=e=>{const{options:n,...t}=e,i=le(),s=i.shouldOptimizedTileRequests?new $t(n,i):new S.UrlTemplateImageryProvider(n);return o.jsx(_e,{...t,imageryProvider:s})},pr=e=>{const{options:n,...t}=e;return o.jsx(_e,{...t,imageryProvider:new S.OpenStreetMapImageryProvider(n)})},en=e=>o.jsx(fe.Entity,{...e}),fr=e=>o.jsx(fe.EntityDescription,{...e}),tn=e=>o.jsx(fe.EntityDescription,{...e}),nn=e=>o.jsx(fe.PolygonGraphics,{...e}),rn=e=>o.jsx(fe.RectangleGraphics,{...e}),on=e=>o.jsx(fe.CustomDataSource,{...e}),mr=e=>o.jsx(fe.PolylineGraphics,{...e}),ao="";var ve=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),C=new m.Color(1,1,1,1)){this._scene=a.scene,t.uniforms.color=l,n=C,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}i.prototype.initialiseHandlers=function(){var a=this._scene,l=this,C=new m.ScreenSpaceEventHandler(a.canvas);function h(p,w){if(l._handlersMuted!=!0){var v=a.pick(w);v&&v.primitive&&v.primitive[p]&&v.primitive[p](w)}}C.setInputAction(function(p){h("leftClick",p.position)},m.ScreenSpaceEventType.LEFT_CLICK),C.setInputAction(function(p){h("leftDoubleClick",p.position)},m.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var E;C.setInputAction(function(p){if(l._handlersMuted!=!0){var w=a.pick(p.endPosition);E&&(!w||E!=w.primitive)&&(!(E.isDestroyed&&E.isDestroyed())&&E.mouseOut(p.endPosition),E=null),w&&w.primitive&&(w=w.primitive,w.mouseOut&&(E=w),w.mouseMove&&w.mouseMove(p.endPosition))}},m.ScreenSpaceEventType.MOUSE_MOVE),C.setInputAction(function(p){h("leftUp",p.position)},m.ScreenSpaceEventType.LEFT_UP),C.setInputAction(function(p){h("leftDown",p.position)},m.ScreenSpaceEventType.LEFT_DOWN)},i.prototype.setListener=function(a,l,C){a[l]=C},i.prototype.muteHandlers=function(a){this._handlersMuted=a},i.prototype.registerEditableShape=function(a){var l=this;K(a,"mouseMove",function(C){a.setHighlighted(!0),a._editMode||l._tooltip.showAt(C,"Click to edit this shape")}),K(a,"mouseOut",function(C){a.setHighlighted(!1),l._tooltip.setVisible(!1)}),K(a,"leftClick",function(C){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},r=N(s,{appearance:new m.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),u=N(s,{}),g=N(s,{}),f=N(s,{}),y=N(r,{rotation:0}),T=N(s,{width:5,geodesic:!0,granularity:1e4,appearance:new m.PolylineMaterialAppearance({aboveGround:!1}),material:t}),_=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,C){this[l]=C,this._createPrimitive=!0},a.prototype.getAttribute=function(l){return this[l]},a.prototype.update=function(l,C,h){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 E=this.getGeometry();if(!E)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:E,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 p=this._primitive;p.appearance.material=this.material,p.debugShowBoundingVolume=this.debugShowBoundingVolume,p.update(l,C,h),this._outlinePolygon&&this._outlinePolygon.update(l,C,h)}},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,C){(!this.strokeColor||!this.strokeColor.equals(l)||this.strokeWidth!=C)&&(this._createPrimitive=!0,this.strokeColor=l,this.strokeWidth=C)},a}();i.ExtentPrimitive=function(){function a(l){if(!m.defined(l.extent))throw new m.DeveloperError("Extent is required");l=N(l,r),this.initialiseOptions(l),this.setExtent(l.extent)}return a.prototype=new _,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,r),this.initialiseOptions(l),this.isPolygon=!0}return a.prototype=new _,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,r),this.initialiseOptions(l),this.setRadius(l.radius)}return a.prototype=new _,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,y),this.initialiseOptions(l)}return a.prototype=new _,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 _,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 b={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},D={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},B={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};i.prototype.createBillboardGroup=function(a,l,C){var h=new i.BillboardGroup(this,l);return h.addBillboards(a,C),h},i.BillboardGroup=function(a,l){this._drawHelper=a,this._scene=a._scene,this._options=N(l,b);var C=new m.BillboardCollection;this._scene.primitives.add(C),this._billboards=C,this._orderedBillboards=[]},i.BillboardGroup.prototype.createBillboard=function(a,l){var C=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 p=function(v){E.enableRotate=v},w=function(){for(var v=0,L=h._orderedBillboards.length;v<L&&h._orderedBillboards[v]!=C;++v);return v};var h=this,E=this._scene.screenSpaceCameraController;if(l.dragHandlers){var h=this;K(C,"leftDown",function(L){function A(I){C.position=I;for(var O=0,j=h._orderedBillboards.length;O<j&&h._orderedBillboards[O]!=C;++O);l.dragHandlers.onDrag&&l.dragHandlers.onDrag(w(),I)}function P(I){M.destroy(),p(!0),l.dragHandlers.onDragEnd&&l.dragHandlers.onDragEnd(w(),I)}var M=new m.ScreenSpaceEventHandler(h._scene.canvas);M.setInputAction(function(I){var O=h._scene.camera.pickEllipsoid(I.endPosition,e);O?A(O):P(O)},m.ScreenSpaceEventType.MOUSE_MOVE),M.setInputAction(function(I){P(h._scene.camera.pickEllipsoid(I.position,e))},m.ScreenSpaceEventType.LEFT_UP),p(!1),l.dragHandlers.onDragStart&&l.dragHandlers.onDragStart(w(),h._scene.camera.pickEllipsoid(L,e))})}l.onDoubleClick&&K(C,"leftDoubleClick",function(v){l.onDoubleClick(w())}),l.onClick&&K(C,"leftClick",function(v){l.onClick(w())}),l.tooltip&&(K(C,"mouseMove",function(v){h._drawHelper._tooltip.showAt(v,l.tooltip())}),K(C,"mouseOut",function(v){h._drawHelper._tooltip.setVisible(!1)}))}return C},i.BillboardGroup.prototype.insertBillboard=function(a,l,C){this._orderedBillboards.splice(a,0,this.createBillboard(l,C))},i.BillboardGroup.prototype.addBillboard=function(a,l){this._orderedBillboards.push(this.createBillboard(a,l))},i.BillboardGroup.prototype.addBillboards=function(a,l){for(var C=0;C<a.length;C++)this.addBillboard(a[C],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,b);this.startDrawing(function(){p.remove(),w.destroy(),E.setVisible(!1)});var C=this,h=this._scene;h.primitives;var E=this._tooltip,p=new i.BillboardGroup(this,l),w=new m.ScreenSpaceEventHandler(h.canvas);w.setInputAction(function(v){if(v.position!=null){var L=h.camera.pickEllipsoid(v.position,e);L&&(p.addBillboard(L),C.stopDrawing(),l.callback(L))}},m.ScreenSpaceEventType.LEFT_CLICK),w.setInputAction(function(v){var L=v.endPosition;if(L!=null){var A=h.camera.pickEllipsoid(L,e);A?E.showAt(L,"<p>Click to add your marker. Position is: </p>"+X(e.cartesianToCartographic(A))):E.showAt(L,"<p>Click on the globe to add your marker.</p>")}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingPolygon=function(l){var l=N(l,r);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(){E.remove(v),A.remove(),P.destroy(),p.setVisible(!1),V(h)});var C=this,h=this._scene,E=h.primitives,p=this._tooltip,w=a?3:2,v;a?v=new ve.PolygonPrimitive(l):v=new ve.PolylinePrimitive(l),v.asynchronous=!1,E.add(v);var L=[],A=new i.BillboardGroup(this,b),P=new m.ScreenSpaceEventHandler(h.canvas);J(h),P.setInputAction(function(M){if(M.position!=null){var I=h.camera.pickEllipsoid(M.position,e);I&&(L.length==0&&(L.push(I.clone()),A.addBillboard(L[0])),L.length>=w&&(v.positions=L,v._createPrimitive=!0),L.push(I),A.addBillboard(I))}},m.ScreenSpaceEventType.LEFT_CLICK),P.setInputAction(function(M){var I=M.endPosition;if(I!=null)if(L.length==0)p.showAt(I,"<p>Click to add first point</p>");else{var O=h.camera.pickEllipsoid(I,e);O&&(L.pop(),O.y+=1+Math.random(),L.push(O),L.length>=w&&(v.positions=L,v._createPrimitive=!0),A.getBillboard(L.length-1).position=O,p.showAt(I,"<p>Click to add new point ("+L.length+")</p>"+(L.length>w?"<p>Double click to finish drawing</p>":"")))}},m.ScreenSpaceEventType.MOUSE_MOVE),P.setInputAction(function(M){var I=M.position;if(I!=null){if(L.length<w+2)return;var O=h.camera.pickEllipsoid(I,e);O&&(V(h),C.stopDrawing(),typeof l.callback=="function"&&(L.length-1,l.callback(L)))}},m.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function $(a){return e.cartographicArrayToCartesianArray([m.Rectangle.northwest(a),m.Rectangle.northeast(a),m.Rectangle.southeast(a),m.Rectangle.southwest(a)])}function J(a){a&&(a.canvas.style.cursor="crosshair")}function V(a){a&&(a.canvas.style.cursor="")}i.prototype.startDrawingExtent=function(l){var l=N(l,r);this.startDrawing(function(){v!=null&&E.remove(v),L!=null&&L.remove(),A.destroy(),p.setVisible(!1),V(h)});var C=this,h=this._scene,E=this._scene.primitives,p=this._tooltip,w=null,v=null,L=null,A=new m.ScreenSpaceEventHandler(h.canvas);J(h);function P(M){v==null&&(v=new ve.ExtentPrimitive({extent:M,material:l.material}),v.asynchronous=!1,E.add(v)),v.setExtent(M);var I=$(M);L==null?(L=new i.BillboardGroup(C,b),L.addBillboards(I)):L.updateBillboardsPositions(I)}A.setInputAction(function(M){if(M.position!=null){var I=h.camera.pickEllipsoid(M.position,e);if(I)if(v==null){w=e.cartesianToCartographic(I);var O=Y(w,w);P(O)}else C.stopDrawing(),typeof l.callback=="function"&&l.callback(Y(w,e.cartesianToCartographic(I)))}},m.ScreenSpaceEventType.LEFT_DOWN),A.setInputAction(function(M){var I=M.endPosition;if(I!=null)if(v==null)p.showAt(I,"<p>Click to start drawing rectangle</p>");else{var O=h.camera.pickEllipsoid(I,e);if(O){var j=Y(w,e.cartesianToCartographic(O));P(j),p.showAt(I,"<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,r);this.startDrawing(function(){w!=null&&E.remove(w),v.remove(),L.destroy(),p.setVisible(!1)});var C=this,h=this._scene,E=this._scene.primitives,p=this._tooltip,w=null,v=null,L=new m.ScreenSpaceEventHandler(h.canvas);L.setInputAction(function(A){if(A.position!=null){var P=h.camera.pickEllipsoid(A.position,e);P&&(w==null?(w=new i.CirclePrimitive({center:P,radius:0,asynchronous:!1,material:l.material}),E.add(w),v=new i.BillboardGroup(C,b),v.addBillboards([P])):(typeof l.callback=="function"&&l.callback(w.getCenter(),w.getRadius()),C.stopDrawing()))}},m.ScreenSpaceEventType.LEFT_DOWN),L.setInputAction(function(A){var P=A.endPosition;if(P!=null)if(w==null)p.showAt(P,"<p>Click to start drawing the circle</p>");else{var M=h.camera.pickEllipsoid(P,e);M&&(w.setRadius(m.Cartesian3.distance(w.getCenter(),M)),v.updateBillboardsPositions(M),p.showAt(P,"<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 h=this,E=this;function p(w){a._scene.screenSpaceCameraController.enableRotate=w}K(h,"leftDown",function(w){function v(P){h.position=P,E.executeListeners({name:"drag",positions:P})}function L(P){A.destroy(),p(!0),E.executeListeners({name:"dragEnd",positions:P})}var A=new m.ScreenSpaceEventHandler(a._scene.canvas);A.setInputAction(function(P){var M=a._scene.camera.pickEllipsoid(P.endPosition,e);M?v(M):L(M)},m.ScreenSpaceEventType.MOUSE_MOVE),A.setInputAction(function(P){L(a._scene.camera.pickEllipsoid(P.position,e))},m.ScreenSpaceEventType.LEFT_UP),p(!1)}),re(h)};function l(h){a._scene,!(this._highlighted&&this._highlighted==h)&&this._editMode!==!0&&(this._highlighted=h,h?(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 C(h){if(this._editMode!=h)if(a.disableAllHighlights(),h){a.setEdited(this);var E=a._scene,p=this;if(this._markers==null){let O=function(x,U){var te=x-1<0?U.length-1:x-1;te<v.countBillboards()&&(v.getBillboard(te).position=Q(te)),te=x,te<v.countBillboards()&&(v.getBillboard(te).position=Q(te))},j=function(){p.executeListeners({name:"onEdited",positions:p.positions})},Q=function(x){var U=p.positions;return e.cartographicToCartesian(new m.EllipsoidGeodesic(e.cartesianToCartographic(U[x]),e.cartesianToCartographic(U[x<U.length-1?x+1:0])).interpolateUsingFraction(.5))};var w=new i.BillboardGroup(a,D),v=new i.BillboardGroup(a,B),L={dragHandlers:{onDrag:function(x,U){p.positions[x]=U,O(x,p.positions),p._createPrimitive=!0},onDragEnd:function(x,U){p._createPrimitive=!0,j()}},onDoubleClick:function(x){p.positions.length<4||(p.positions.splice(x,1),p._createPrimitive=!0,w.removeBillboard(x),v.removeBillboard(x),O(x,p.positions),j())},tooltip:function(){if(p.positions.length>3)return"Double click to remove this point"}};w.addBillboards(p.positions,L),this._markers=w;for(var A=[],P=0,M=p.positions.length+(this.isPolygon?0:-1);P<M;P++)A.push(Q(P));var I={dragHandlers:{onDragStart:function(x,U){this.index=x+1,p.positions.splice(this.index,0,U),p._createPrimitive=!0},onDrag:function(x,U){p.positions[this.index]=U,p._createPrimitive=!0},onDragEnd:function(x,U){w.insertBillboard(this.index,U,L),v.getBillboard(this.index-1).position=Q(this.index-1),v.insertBillboard(this.index,Q(this.index),I),p._createPrimitive=!0,j()}},tooltip:function(){return"Drag to create a new point"}};v.addBillboards(A,I),this._editMarkers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(x){var U=E.pick(x.position);U&&U.primitive||p.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),w.setOnTop(),v.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 h=this;h.isPolygon=!1,h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=C;var E=this.width;h.setHighlighted=function(p){this._editMode!==!0&&(p?(a.setHighlighted(this),this.setWidth(E*2)):this.setWidth(E))},h.getExtent=function(){return m.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},re(h),h.setEditMode(!1)}},ve.PolygonPrimitive.prototype.setEditable=function(){var h=this;h.asynchronous=!1,a._scene,a.registerEditableShape(h),h.setEditMode=C,h.setHighlighted=l,re(h),h.setEditMode(!1)},ve.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;a.registerEditableShape(h),h.asynchronous=!1,h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){if(a.setEdited(this),this._markers==null){let L=function(){h.executeListeners({name:"onEdited",extent:h.extent})};var w=new i.BillboardGroup(a,D),v={dragHandlers:{onDrag:function(A,P){var M=w.getBillboard((A+2)%4).position;h.setExtent(Y(e.cartesianToCartographic(M),e.cartesianToCartographic(P))),w.updateBillboardsPositions($(h.extent))},onDragEnd:function(A,P){L()}},tooltip:function(){return"Drag to change the corners of this extent"}};w.addBillboards($(h.extent),v),this._markers=w,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(A){var P=E.pick(A.position);P&&!P.isDestroyed()&&P.primitive||h.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),w.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,re(h),h.setEditMode(!1)}},i.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var w=this;if(this._markers==null){let A=function(){return m.EllipseOutlineGeometry(e,h.getCenter(),h.getSemiMajorAxis(),h.getSemiMinorAxis(),h.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},P=function(){h.executeListeners({name:"onEdited",center:h.getCenter(),semiMajorAxis:h.getSemiMajorAxis(),semiMinorAxis:h.getSemiMinorAxis(),rotation:0})};var v=new i.BillboardGroup(a,D),L={dragHandlers:{onDrag:function(M,I){var O=m.Cartesian3.distance(h.getCenter(),I);M%2==0?h.setSemiMajorAxis(O):h.setSemiMinorAxis(O),v.updateBillboardsPositions(A())},onDragEnd:function(M,I){P()}},tooltip:function(){return"Drag to change the excentricity and radius"}};v.addBillboards(A(),L),this._markers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(M){var I=E.pick(M.position);I&&I.primitive||w.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),v.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,re(h),h.setEditMode(!1)}},i.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(h){for(var E=m.CircleOutlineGeometry.createGeometry(new m.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:h})),p=0,w,v=[];p<E.attributes.position.values.length;p+=3)w=E.attributes.position.values,v.push(new m.Cartesian3(w[p],w[p+1],w[p+2]));return v},i.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var w=this;if(this._markers==null){let A=function(){return w.getCircleCartesianCoordinates(m.Math.PI_OVER_TWO)},P=function(){h.executeListeners({name:"onEdited",center:h.getCenter(),radius:h.getRadius()})};var v=new i.BillboardGroup(a,D),L={dragHandlers:{onDrag:function(M,I){h.setRadius(m.Cartesian3.distance(h.getCenter(),I)),v.updateBillboardsPositions(A())},onDragEnd:function(M,I){P()}},tooltip:function(){return"Drag to change the radius"}};v.addBillboards(A(),L),this._markers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(M){var I=E.pick(M.position);I&&I.primitive||w.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),v.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,re(h),h.setEditMode(!1)}}},i.DrawHelperWidget=function(){function a(l,C){if(!m.defined(C.container))throw new m.DeveloperError("Container is required");var h={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:g,circleDrawingOptions:f};q(C,h);var E=this,p=document.createElement("DIV");p.className="toolbar",C.container.appendChild(p);function w(A,P,M,I){var O=document.createElement("DIV");O.className="button",O.title=M,p.appendChild(O),O.onclick=I;var j=document.createElement("SPAN");O.appendChild(j);var Q=document.createElement("IMG");return Q.src=P,j.appendChild(Q),O}var v=l._scene;w("marker",C.markerIcon,"Click to start drawing a 2D marker",function(){l.startDrawingMarker({callback:function(A){E.executeListeners({name:"markerCreated",position:A})}})}),w("polyline",C.polylineIcon,"Click to start drawing a 2D polyline",function(){l.startDrawingPolyline({callback:function(A){E.executeListeners({name:"polylineCreated",positions:A})}})}),w("polygon",C.polygonIcon,"Click to start drawing a 2D polygon",function(){l.startDrawingPolygon({callback:function(A){E.executeListeners({name:"polygonCreated",positions:A})}})}),w("extent",C.extentIcon,"Click to start drawing an Extent",function(){l.startDrawingExtent({callback:function(A){E.executeListeners({name:"extentCreated",extent:A})}})}),w("circle",C.circleIcon,"Click to start drawing a Circle",function(){l.startDrawingCircle({callback:function(A,P){E.executeListeners({name:"circleCreated",center:A,radius:P})}})});var L=document.createElement("DIV");L.className="divider",p.appendChild(L),w("clear",C.clearIcon,"Remove all primitives",function(){v.primitives.removeAll()}),re(this)}return a}(),i.prototype.addToolbar=function(a,l){return l=N(l,{container:a}),new i.DrawHelperWidget(this,l)};function Y(a,l){var C=new m.Rectangle;C.west=Math.min(a.longitude,l.longitude),C.east=Math.max(a.longitude,l.longitude),C.south=Math.min(a.latitude,l.latitude),C.north=Math.max(a.latitude,l.latitude);var h=m.Math.EPSILON7;return C.east-C.west<h&&(C.east+=h*2),C.north-C.south<h&&(C.north+=h*2),C}function X(a,l){return a.longitude.toFixed(l||3)+", "+a.latitude.toFixed(l||3)}function k(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 C in a)l[C]=typeof l[C]>"u"?k(a[C],null):l[C];return l}function q(a,l){a=a||{};var C;for(C in l)a[C]===void 0&&(a[C]=k(l[C]))}function N(a,l){var C=k(a),h;for(h in l)C[h]===void 0&&(C[h]=k(l[h]));return C}function K(a,l,C){a[l]=C}function re(a){a._listeners={},a.addListener=function(l,C){return this._listeners[l]=this._listeners[l]||[],this._listeners[l].push(C),this._listeners[l].length},a.executeListeners=function(l,C){if(this._listeners[l.name]&&this._listeners[l.name].length>0)for(var h=0;h<this._listeners[l.name].length;h++)this._listeners[l.name][h](l);else C&&C(l)}}return i}();const yr=2,vr=(e,n)=>{switch(e){case se.BOX:{if(n.features.length!==yr)throw new Error(`${e} must have 2 points`);const t=W.find(n.features,s=>{var r;return((r=s.properties)==null?void 0:r.type)===De.BOTTOM_LEFT}),i=W.find(n.features,s=>{var r;return((r=s.properties)==null?void 0:r.type)===De.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`)}},sn=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]}}},an=e=>{const n=dt.lineString([[S.Math.toDegrees(e.west),S.Math.toDegrees(e.south)],[S.Math.toDegrees(e.east),S.Math.toDegrees(e.north)]]);return at(st(n))},ln=e=>{const n=dt.lineString([[e.west,e.south],[e.east,e.north]]);return at(st(n)).geometry.coordinates[0].map(i=>S.Cartesian3.fromRadiansArray(i)[0])};class Er extends S.Color{}const Cr=e=>{const{drawState:n,drawingMaterial:t,drawingVertexColor:i,material:s,hollow:r,outlineWidth:u}=e,g=le(),[f,y]=c.useState();c.useEffect(()=>{y(new ve(g,t,i))},[]),c.useEffect(()=>{if(f){const _=f;if(n.drawing)switch(n.type){case se.POLYGON:g.scene.globe.depthTestAgainstTerrain=!1,_.startDrawingPolygon({callback:b=>{n.handler({primitive:b,type:se.POLYGON,geojson:sn(b)})}});break;case se.BOX:g.scene.globe.depthTestAgainstTerrain=!1,_.startDrawingExtent({callback:b=>{n.handler({primitive:b,type:se.BOX,geojson:an(b)})}});break;default:throw new Error(`[CESIUM DRAW]: ${n.type} unrecognized primitive to draw.`)}else _.stopDrawing(),g.scene.globe.depthTestAgainstTerrain=!0}},[n,f]);const T=_=>{try{let b=_.coordinates!==void 0?_.coordinates:vr(_.type,_.geojson);if(r!==!0)switch(_.type){case se.BOX:return o.jsx(rn,{coordinates:b,material:s??t});case se.POLYGON:return o.jsx(nn,{hierarchy:new S.PolygonHierarchy(b),material:s??t});default:return o.jsx(o.Fragment,{})}else{switch(_.type){case se.BOX:b=ln(b);break;case se.POLYGON:b=[...b,b[0]];break;default:return o.jsx(o.Fragment,{})}return o.jsx(mr,{clampToGround:!0,positions:b,width:u??1,material:s??t})}}catch(b){return console.error(b),o.jsx(o.Fragment,{})}};return o.jsx(on,{...e,children:e.drawings.map((_,b)=>o.jsxs(en,{name:_.name,children:[o.jsxs(tn,{children:[o.jsxs("h1",{children:["Drawed Entity ",_.name]}),o.jsx("p",{children:"This is description of drawed entity"})]}),T(_)]},_.id))})},Tr=e=>{const n=le();return c.useEffect(()=>{n.extend(S.viewerCesiumInspectorMixin)},[n]),o.jsx(o.Fragment,{})},wr=-25,cn=2,Sr=e=>{const n=le(),t=(r,u=",")=>r.slice(r.indexOf(`
|
|
2
2
|
`)+1).split(`
|
|
3
|
-
`).map(
|
|
4
|
-
`,
|
|
5
|
-
Long: ${
|
|
6
|
-
Lat: ${
|
|
3
|
+
`).map(y=>{const T=y.split(u);return{cartographic:S.Cartographic.fromDegrees(parseFloat(T[0]),parseFloat(T[1])),cartesian:new S.Cartesian2(parseFloat(T[0]),parseFloat(T[1]))}}),i=r=>{var g;r.preventDefault(),r.persist();const u=new FileReader;u.onload=f=>{var b;const y=(b=f.target)==null?void 0:b.result,T=t(y),_=S.Ellipsoid.WGS84;console.log(`Loaded CSV content:
|
|
4
|
+
`,y),S.sampleTerrainMostDetailed(n.terrainProvider,T.map(D=>D.cartographic)).then(D=>{console.log(D),D=D.slice(0,D.length-1),n.scene.globe.depthTestAgainstTerrain=!0,n.entities.suspendEvents(),n.entities.removeAll(),D.forEach((B,$)=>{n.entities.add({name:($+cn).toString(),position:_.cartographicToCartesian(B),billboard:{verticalOrigin:S.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:($+cn).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,wr)},description:`
|
|
5
|
+
Long: ${T[$].cartesian.x} </br>
|
|
6
|
+
Lat: ${T[$].cartesian.y} </br>
|
|
7
7
|
Height(m): <span style="font-weight: 500">${B.height}</span>
|
|
8
|
-
`})}),
|
|
9
|
-
`};let
|
|
10
|
-
`;
|
|
8
|
+
`})}),n.entities.resumeEvents(),r.target.files!==null&&(s(`terranian_heights_${r.target.files[0].name}`,T),r.target.value=""),console.log("Pinned point count is ",n.entities.values.length)},D=>{console.error("ERROR while sampleTerrainMostDetailed:",D)})},(g=r.target.files)!=null&&g[0]&&u.readAsText(r.target.files[0])},s=(r,u)=>{const g=b=>{let D="";return D+=b.cartesian.x.toString()+",",D+=b.cartesian.y.toString()+",",D+=b.cartographic.height.toString(),D+`
|
|
9
|
+
`};let f=`long,lat,height
|
|
10
|
+
`;u.forEach(b=>{f+=g(b)});const y=new Blob([f],{type:"text/csv;charset=utf-8;"}),T=document.createElement("a"),_=URL.createObjectURL(y);T.setAttribute("href",_),T.setAttribute("download",r),T.style.visibility="hidden",document.body.appendChild(T),T.click(),document.body.removeChild(T)};return o.jsx(o.Fragment,{children:o.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:r=>{i(r)}})})},lo="",br=38,Lr=40,Mr=13,_r=14,Pr=27,Ar=9,Ir=10,Dr=100,Or=e=>{const[n,t]=c.useState(e.defaultValue??""),[i,s]=c.useState(!1),[r,u]=c.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),g=c.useRef(null);c.useEffect(()=>(window.addEventListener("resize",B),()=>{try{window.removeEventListener("resize",B)}catch(E){console.log('WINDOW "resize" remove listener failed',E)}}),[]),c.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),c.useEffect(()=>{const{options:E}=e,{caret:p}=r;Y(n,p,E)},[e]);const f=(E,p,w)=>{const{trigger:v,matchAny:L,regex:A}=e,P=new RegExp(A);let M=v;Array.isArray(M)||(M=new Array(v)),M.sort();const I={};Array.isArray(w)&&M.forEach(Q=>{I[Q]=w});const O=y(M,P);let j={};for(let Q=0;Q<O.length;Q++){const{triggerStr:x,triggerMatch:U,triggerLength:te}=O[Q];for(let oe=p-1;oe>=0;--oe){const pe=E.substring(oe,p).match(P);let de=-1;if(te>0){const G=U?oe:oe-te+1;if(G<0||(T(x,E,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=I[x];if(!Array.isArray(G))continue;const H=E.substring(de,p),ne=G.filter(Ce=>{const Pe=Ce.toLowerCase().indexOf(H.toLowerCase());return Pe!==-1&&(L||Pe===0)}),Te=x,Le=H.length;j={...j,trigger:Te,matchStart:de,matchLength:Le,options:ne}}}}return j},y=(E,p)=>E.map(v=>({triggerStr:v,triggerMatch:v.match(p),triggerLength:v.length})),T=(E,p,w)=>!E||!E.length||p.substr(w,E.length)===E,_=E=>{const{onChange:p,options:w,spaceRemovers:v,spacer:L,value:A}=e,P=n,M=E.target.value,I=lt(b(E.target)).end;if(M.length||V({...r,helperVisible:!1}),t(M),V({...r,caret:I,value:E.target.value}),!M.length||!I)return p(E.target.value);if(i&&v.length&&M.length>2&&L.length){for(let O=0;O<Math.max(P.length,M.length);++O)if(P[O]!==M[O]){if(O>=2&&M[O-1]===L&&v.indexOf(M[O-2])===-1&&v.indexOf(M[O])!==-1&&!W.isEmpty(f(M.substring(0,O-2),I-3,w))){const j=`${M.slice(0,O-1)}${M.slice(O,O+1)}${M.slice(O-1,O)}${M.slice(O+1)}`;return J(O+1),g.current!==null&&(g.current.value=j),A||V({...r,value:j}),p(j)}break}s(!1)}return Y(M,I,w),p(E.target.value)},b=E=>{if(E!==void 0)if(E.children.length>0){const p=E.getElementsByTagName("textarea");if(p.length>0)return p[0];const w=E.getElementsByTagName("input");if(w.length>0)return w[0]}else return E},D=E=>{const{helperVisible:p,options:w,selection:v}=r,{onKeyDown:L,passThroughEnter:A}=e;if(p)switch(E.keyCode){case Pr:E.preventDefault(),X();break;case br:E.preventDefault(),V({...r,selection:(w.length+v-1)%w.length});break;case Lr:E.preventDefault(),V({...r,selection:(v+1)%w.length});break;case _r:case Mr:A||E.preventDefault(),$(v);break;case Ar:$(v);break;default:L(E);break}else L(E)},B=()=>{V({...r,helperVisible:!1})},$=E=>{const{spacer:p,onSelect:w,changeOnSelect:v}=e,{matchStart:L,matchLength:A,options:P,trigger:M}=r,I=P[E],O=n,j=O.substring(0,L-M.length),Q=O.substring(L+A),x={target:g.current},U=v(M,I);x.target!==null&&(x.target.value=`${j}${U}${p}${Q}`),_(x),x.target!==null&&w(x.target.value),X(),J(j.length+U.length+1),s(!0)},J=E=>{V({...r,caret:E});const p=b(g.current);lt.setCaretPosition(p,E)},V=E=>{setTimeout(()=>{u({...E})},0)},Y=(E,p,w)=>{const v=g.current;if(g.current===null)return;const L=b(v);if(L===void 0)return;const A=v.getBoundingClientRect(),P=f(E,p,w);if(Object.keys(P).length>0&&L!==null){const M=In(L,p),I=L.getBoundingClientRect(),{minChars:O,onRequestOptions:j,requestOnlyIfNoOptions:Q,mode:x}=e;let U,te,oe,Ee="unset";x==="assist"?(U=v===L?M.top+L.offsetTop:M.top+A.top,te=Math.min(M.left+L.offsetLeft-Ir,L.offsetLeft+I.width-Dr)):(U=A.top+v.offsetHeight,te=v.offsetLeft,oe=v.offsetLeft-v.offsetWidth,Ee=`${A.width}px`),P.matchLength>=O&&(P.options.length>1||P.options.length===1&&P.options[0].length!==P.matchLength)?V({...r,value:E,helperVisible:!0,top:U,left:te,right:oe,width:Ee,...P}):((!Q||!P.options.length)&&j(E.substr(P.matchStart,P.matchLength)),X())}else X()},X=()=>{setTimeout(()=>{V({...r,helperVisible:!1,selection:0})},100)},k=()=>{const{helperVisible:E,left:p,right:w,matchStart:v,matchLength:L,options:A,selection:P,top:M,value:I,width:O}=r;if(!E)return null;const{maxOptions:j,offsetX:Q,offsetY:x,direction:U}=e;if(A.length===0)return null;if(P>=A.length)return V({...r,selection:0}),null;const te=j===0?A.length:j,oe=A.slice(0,te).map((pe,de)=>{const G=pe.toLowerCase().indexOf(I.substr(v,L).toLowerCase());return o.jsxs("li",{className:de===P?"active":void 0,onClick:()=>{$(de)},onMouseEnter:()=>{V({...r,selection:de})},children:[pe.slice(0,G),o.jsx("strong",{children:pe.substr(G,L)}),pe.slice(G+L)]},pe)}),Ee=U==="ltr"?{left:p+Q}:{right:w+Q};return o.jsx("ul",{className:"react-autocomplete-input",style:{...Ee,top:M+x,width:O},children:oe})},{Component:q,ComponentProps:N,defaultValue:K,disabled:re,onBlur:a,value:l,...C}=e,h=Object.assign({},C);return Object.keys(e).forEach(E=>{delete h[E]}),o.jsxs(o.Fragment,{children:[c.cloneElement(q,{disabled:re,onBlur:a,onChange:_,onKeyDown:D,ref:g,value:n,...h,...N}),k()]})},kr={Component:o.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"},Nr=e=>{let n={...kr,...e};return e.mode==="autocomplete"&&(n={...n,trigger:"",regex:".",spacer:""}),o.jsx(Or,{...n})},He={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=On(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()}`}},xr={locale:ue.EN,formatters:{...He}},Br={locale:ue.RU,formatters:{...He},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`]:"Папки в начале"}},
|
|
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`]:"Папки в начале"}},Fr={locale:ue.HE,formatters:{...He},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`]:"הצגת תיקיות בראש הרשימה"}},
|
|
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`]:"הצגת תיקיות בראש הרשימה"}},Vr={[ue.EN]:xr,[ue.RU]:Br,[ue.HE]:Fr},co="";class Gr extends F.FileHelper{}const Hr=F.ChonkyActions,dn={listView:F.ChonkyActions.EnableListView.id,gridView:F.ChonkyActions.EnableGridView.id};F.setChonkyDefaults({iconComponent:Dn.ChonkyIconFA});const zr=c.memo(c.forwardRef(({theme:e,styles:n={height:"100%",minWidth:"600px"},defaultView:t=dn.listView,readOnlyMode:i=!1,locale:s,files:r,folderChain:u,onFileAction:g,...f},y)=>{const T=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 _=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-${_(a)}`,re[a]=l,re},{}):{},[e]),[D,B]=c.useState(!1),[$,J]=c.useState(),[V,Y]=c.useState(!1),[X,k]=c.useState(),[q,N]=c.useState();return c.useEffect(()=>{e&&B(!0),J(t),i?Y(!0):k([F.ChonkyActions.CreateFolder,F.ChonkyActions.DeleteFiles]),s!==void 0&&N(Vr[s])},[e,t,i,s]),o.jsx(ce,{style:{...n,...b},children:o.jsx(F.FullFileBrowser,{ref:y,files:r??[],folderChain:u,onFileAction:K=>{typeof g=="function"&&g(K)},thumbnailGenerator:T,defaultFileViewActionId:$,disableDragAndDrop:V,fileActions:X,darkMode:D,i18n:q,...f})})}));d.useMediaQuery=gn,Object.defineProperty(d,"CesiumMath",{enumerable:!0,get:()=>S.Math}),Object.defineProperty(d,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>S.sampleTerrainMostDetailed}),d.Autocomplete=Nr,d.BboxCorner=De,d.Box=ce,d.COORDINATES_MERCATOR_FRACTION_DIGITS=Ne,d.COORDINATES_WGS_FRACTION_DIGITS=ke,d.Cesium3DTileset=cr,d.CesiumBoundingSphere=Oi,d.CesiumCartesian2=Ii,d.CesiumCartesian3=Di,d.CesiumCartographic=Ft,d.CesiumCesiumTerrainProvider=Vi,d.CesiumColor=Er,d.CesiumConstantPositionProperty=Ai,d.CesiumConstantProperty=Pi,d.CesiumCustomDataSource=on,d.CesiumDrawingsDataSource=Cr,d.CesiumEllipsoid=ki,d.CesiumEllipsoidTerrainProvider=Fi,d.CesiumEntity=en,d.CesiumEntityDescription=fr,d.CesiumEntityStaticDescription=tn,d.CesiumGeographicTilingScheme=Ni,d.CesiumGeojsonLayer=dr,d.CesiumImageryLayer=_e,d.CesiumLabelStyle=Hi,d.CesiumMap=ar,d.CesiumOSMLayer=pr,d.CesiumPolygonGraphics=nn,d.CesiumPolylineDashMaterialProperty=_i,d.CesiumRectangle=xi,d.CesiumRectangleGraphics=rn,d.CesiumResource=Bi,d.CesiumSceneMode=ie,d.CesiumVerticalOrigin=Gi,d.CesiumViewer=or,d.CesiumWMSLayer=ur,d.CesiumWMTSLayer=hr,d.CesiumXYZLayer=gr,d.CoordinatesTrackerTool=Vt,d.CssBaseline=Si,d.DateRangePicker=Hn,d.DateTimePicker=zn,d.DateTimeRangePicker=ht,d.DateTimeRangePickerFormControl=Bn,d.DrawHelper=ve,d.DrawInteraction=Pt,d.DrawType=se,d.FileHelper=Gr,d.FilePicker=zr,d.FilePickerActions=Hr,d.FilePickerViewObj=dn,d.GeoJSONFeature=Mt,d.InspectorTool=Tr,d.MVTSource=yi,d.Map=yt,d.MapFilterContainer=ti,d.Popover=gt,d.Proj=ge,d.ScaleTrackerTool=Gt,d.ScopedCssBaseline=bi,d.SmartTable=wi,d.SupportedLocales=ue,d.TerrainianHeightTool=Sr,d.TileLayer=Et,d.TileOsm=_t,d.TileWMS=ui,d.TileWMTS=ci,d.TileXYZ=gi,d.TimeRangeInput=Fn,d.VectorLayer=wt,d.VectorSource=Lt,d.VectorTileLayer=ii,d.ZoomLevelTrackerTool=zt,d.defaultFormatters=He,d.getMVTOptions=mi,d.getWMSOptions=di,d.getWMTSOptions=li,d.getXYZOptions=hi,d.isDateRange=Oe,d.mapMcToMuiTheme=ut,d.polygonToGeoJSON=sn,d.rectangleToGeoJSON=an,d.rectangleToPositions=ln,d.useCesiumMap=le,d.useMap=be,d.useMappedMuiTheme=Ke,d.useTileLayer=Me,d.useVectorLayer=Tt,d.useVectorSource=bt,d.useVectorTileLayer=kt,d.useVectorTileSource=fi,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|