@biodiv-platform/naksha-gmaps-draw 4.5.1 → 4.5.3-beta.1
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/esm/index.js +1 -3
- package/dist/index.d.ts +9 -1
- package/dist/index.js +1 -3
- package/package.json +2 -8
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
var go=Object.create;var Rr=Object.defineProperty;var ho=Object.getOwnPropertyDescriptor;var bo=Object.getOwnPropertyNames;var yo=Object.getPrototypeOf,vo=Object.prototype.hasOwnProperty;var So=(e,r)=>()=>(e&&(r=e(e=0)),r);var Cr=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var xo=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of bo(r))!vo.call(e,a)&&a!==t&&Rr(e,a,{get:()=>r[a],enumerable:!(o=ho(r,a))||o.enumerable});return e};var Z=(e,r,t)=>(t=e!=null?go(yo(e)):{},xo(r||!e||!e.__esModule?Rr(t,"default",{value:e,enumerable:!0}):t,e));var d=So(()=>{});var oe=Cr((de,ee)=>{d();var Po=200,Jr="__lodash_hash_undefined__",Mo=800,Fo=16,Xr=9007199254740991,qr="[object Arguments]",Lo="[object Array]",zo="[object AsyncFunction]",jo="[object Boolean]",No="[object Date]",$o="[object Error]",Kr="[object Function]",Do="[object GeneratorFunction]",Wo="[object Map]",Vo="[object Number]",Go="[object Null]",Qr="[object Object]",Ho="[object Proxy]",Uo="[object RegExp]",Yo="[object Set]",Jo="[object String]",Xo="[object Undefined]",qo="[object WeakMap]",Ko="[object ArrayBuffer]",Qo="[object DataView]",Zo="[object Float32Array]",en="[object Float64Array]",rn="[object Int8Array]",tn="[object Int16Array]",on="[object Int32Array]",nn="[object Uint8Array]",an="[object Uint8ClampedArray]",sn="[object Uint16Array]",cn="[object Uint32Array]",ln=/[\\^$.*+?()[\]{}|]/g,dn=/^\[object .+?Constructor\]$/,un=/^(?:0|[1-9]\d*)$/,k={};k[Zo]=k[en]=k[rn]=k[tn]=k[on]=k[nn]=k[an]=k[sn]=k[cn]=!0;k[qr]=k[Lo]=k[Ko]=k[jo]=k[Qo]=k[No]=k[$o]=k[Kr]=k[Wo]=k[Vo]=k[Qr]=k[Uo]=k[Yo]=k[Jo]=k[qo]=!1;var Zr=typeof global=="object"&&global&&global.Object===Object&&global,pn=typeof self=="object"&&self&&self.Object===Object&&self,fe=Zr||pn||Function("return this")(),et=typeof de=="object"&&de&&!de.nodeType&&de,ue=et&&typeof ee=="object"&&ee&&!ee.nodeType&&ee,rt=ue&&ue.exports===et,Je=rt&&Zr.process,Nr=function(){try{var e=ue&&ue.require&&ue.require("util").types;return e||Je&&Je.binding&&Je.binding("util")}catch{}}(),$r=Nr&&Nr.isTypedArray;function fn(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}function mn(e,r){for(var t=-1,o=Array(e);++t<e;)o[t]=r(t);return o}function gn(e){return function(r){return e(r)}}function hn(e,r){return e==null?void 0:e[r]}function bn(e,r){return function(t){return e(r(t))}}var yn=Array.prototype,vn=Function.prototype,we=Object.prototype,Xe=fe["__core-js_shared__"],Re=vn.toString,D=we.hasOwnProperty,Dr=function(){var e=/[^.]+$/.exec(Xe&&Xe.keys&&Xe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),tt=we.toString,Sn=Re.call(Object),xn=RegExp("^"+Re.call(D).replace(ln,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=rt?fe.Buffer:void 0,Wr=fe.Symbol,Vr=fe.Uint8Array,Gr=Te?Te.allocUnsafe:void 0,ot=bn(Object.getPrototypeOf,Object),Hr=Object.create,_n=we.propertyIsEnumerable,kn=yn.splice,X=Wr?Wr.toStringTag:void 0,Ie=function(){try{var e=rr(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Tn=Te?Te.isBuffer:void 0,Ur=Math.max,In=Date.now,nt=rr(fe,"Map"),pe=rr(Object,"create"),wn=function(){function e(){}return function(r){if(!K(r))return{};if(Hr)return Hr(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();function q(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function Rn(){this.__data__=pe?pe(null):{},this.size=0}function Cn(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}function En(e){var r=this.__data__;if(pe){var t=r[e];return t===Jr?void 0:t}return D.call(r,e)?r[e]:void 0}function On(e){var r=this.__data__;return pe?r[e]!==void 0:D.call(r,e)}function An(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=pe&&r===void 0?Jr:r,this}q.prototype.clear=Rn;q.prototype.delete=Cn;q.prototype.get=En;q.prototype.has=On;q.prototype.set=An;function W(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function Bn(){this.__data__=[],this.size=0}function Pn(e){var r=this.__data__,t=Ce(r,e);if(t<0)return!1;var o=r.length-1;return t==o?r.pop():kn.call(r,t,1),--this.size,!0}function Mn(e){var r=this.__data__,t=Ce(r,e);return t<0?void 0:r[t][1]}function Fn(e){return Ce(this.__data__,e)>-1}function Ln(e,r){var t=this.__data__,o=Ce(t,e);return o<0?(++this.size,t.push([e,r])):t[o][1]=r,this}W.prototype.clear=Bn;W.prototype.delete=Pn;W.prototype.get=Mn;W.prototype.has=Fn;W.prototype.set=Ln;function re(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function zn(){this.size=0,this.__data__={hash:new q,map:new(nt||W),string:new q}}function jn(e){var r=Oe(this,e).delete(e);return this.size-=r?1:0,r}function Nn(e){return Oe(this,e).get(e)}function $n(e){return Oe(this,e).has(e)}function Dn(e,r){var t=Oe(this,e),o=t.size;return t.set(e,r),this.size+=t.size==o?0:1,this}re.prototype.clear=zn;re.prototype.delete=jn;re.prototype.get=Nn;re.prototype.has=$n;re.prototype.set=Dn;function te(e){var r=this.__data__=new W(e);this.size=r.size}function Wn(){this.__data__=new W,this.size=0}function Vn(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Gn(e){return this.__data__.get(e)}function Hn(e){return this.__data__.has(e)}function Un(e,r){var t=this.__data__;if(t instanceof W){var o=t.__data__;if(!nt||o.length<Po-1)return o.push([e,r]),this.size=++t.size,this;t=this.__data__=new re(o)}return t.set(e,r),this.size=t.size,this}te.prototype.clear=Wn;te.prototype.delete=Vn;te.prototype.get=Gn;te.prototype.has=Hn;te.prototype.set=Un;function Yn(e,r){var t=Ze(e),o=!t&&Qe(e),a=!t&&!o&&ct(e),i=!t&&!o&&!a&&dt(e),c=t||o||a||i,s=c?mn(e.length,String):[],l=s.length;for(var p in e)(r||D.call(e,p))&&!(c&&(p=="length"||a&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||it(p,l)))&&s.push(p);return s}function qe(e,r,t){(t!==void 0&&!Ae(e[r],t)||t===void 0&&!(r in e))&&er(e,r,t)}function Jn(e,r,t){var o=e[r];(!(D.call(e,r)&&Ae(o,t))||t===void 0&&!(r in e))&&er(e,r,t)}function Ce(e,r){for(var t=e.length;t--;)if(Ae(e[t][0],r))return t;return-1}function er(e,r,t){r=="__proto__"&&Ie?Ie(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var Xn=ca();function Ee(e){return e==null?e===void 0?Xo:Go:X&&X in Object(e)?la(e):ga(e)}function Yr(e){return me(e)&&Ee(e)==qr}function qn(e){if(!K(e)||fa(e))return!1;var r=or(e)?xn:dn;return r.test(va(e))}function Kn(e){return me(e)&<(e.length)&&!!k[Ee(e)]}function Qn(e){if(!K(e))return ma(e);var r=st(e),t=[];for(var o in e)o=="constructor"&&(r||!D.call(e,o))||t.push(o);return t}function at(e,r,t,o,a){e!==r&&Xn(r,function(i,c){if(a||(a=new te),K(i))Zn(e,r,c,t,at,o,a);else{var s=o?o(Ke(e,c),i,c+"",e,r,a):void 0;s===void 0&&(s=i),qe(e,c,s)}},ut)}function Zn(e,r,t,o,a,i,c){var s=Ke(e,t),l=Ke(r,t),p=c.get(l);if(p){qe(e,t,p);return}var u=i?i(s,l,t+"",e,r,c):void 0,S=u===void 0;if(S){var f=Ze(l),m=!f&&ct(l),R=!f&&!m&&dt(l);u=l,f||m||R?Ze(s)?u=s:Sa(s)?u=aa(s):m?(S=!1,u=ta(l,!0)):R?(S=!1,u=na(l,!0)):u=[]:xa(l)||Qe(l)?(u=s,Qe(s)?u=_a(s):(!K(s)||or(s))&&(u=da(l))):S=!1}S&&(c.set(l,u),a(u,l,o,i,c),c.delete(l)),qe(e,t,u)}function ea(e,r){return ba(ha(e,r,pt),e+"")}var ra=Ie?function(e,r){return Ie(e,"toString",{configurable:!0,enumerable:!1,value:Ta(r),writable:!0})}:pt;function ta(e,r){if(r)return e.slice();var t=e.length,o=Gr?Gr(t):new e.constructor(t);return e.copy(o),o}function oa(e){var r=new e.constructor(e.byteLength);return new Vr(r).set(new Vr(e)),r}function na(e,r){var t=r?oa(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function aa(e,r){var t=-1,o=e.length;for(r||(r=Array(o));++t<o;)r[t]=e[t];return r}function ia(e,r,t,o){var a=!t;t||(t={});for(var i=-1,c=r.length;++i<c;){var s=r[i],l=o?o(t[s],e[s],s,t,e):void 0;l===void 0&&(l=e[s]),a?er(t,s,l):Jn(t,s,l)}return t}function sa(e){return ea(function(r,t){var o=-1,a=t.length,i=a>1?t[a-1]:void 0,c=a>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,c&&ua(t[0],t[1],c)&&(i=a<3?void 0:i,a=1),r=Object(r);++o<a;){var s=t[o];s&&e(r,s,o,i)}return r})}function ca(e){return function(r,t,o){for(var a=-1,i=Object(r),c=o(r),s=c.length;s--;){var l=c[e?s:++a];if(t(i[l],l,i)===!1)break}return r}}function Oe(e,r){var t=e.__data__;return pa(r)?t[typeof r=="string"?"string":"hash"]:t.map}function rr(e,r){var t=hn(e,r);return qn(t)?t:void 0}function la(e){var r=D.call(e,X),t=e[X];try{e[X]=void 0;var o=!0}catch{}var a=tt.call(e);return o&&(r?e[X]=t:delete e[X]),a}function da(e){return typeof e.constructor=="function"&&!st(e)?wn(ot(e)):{}}function it(e,r){var t=typeof e;return r=r==null?Xr:r,!!r&&(t=="number"||t!="symbol"&&un.test(e))&&e>-1&&e%1==0&&e<r}function ua(e,r,t){if(!K(t))return!1;var o=typeof r;return(o=="number"?tr(t)&&it(r,t.length):o=="string"&&r in t)?Ae(t[r],e):!1}function pa(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function fa(e){return!!Dr&&Dr in e}function st(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||we;return e===t}function ma(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}function ga(e){return tt.call(e)}function ha(e,r,t){return r=Ur(r===void 0?e.length-1:r,0),function(){for(var o=arguments,a=-1,i=Ur(o.length-r,0),c=Array(i);++a<i;)c[a]=o[r+a];a=-1;for(var s=Array(r+1);++a<r;)s[a]=o[a];return s[r]=t(c),fn(e,this,s)}}function Ke(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}var ba=ya(ra);function ya(e){var r=0,t=0;return function(){var o=In(),a=Fo-(o-t);if(t=o,a>0){if(++r>=Mo)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}function va(e){if(e!=null){try{return Re.call(e)}catch{}try{return e+""}catch{}}return""}function Ae(e,r){return e===r||e!==e&&r!==r}var Qe=Yr(function(){return arguments}())?Yr:function(e){return me(e)&&D.call(e,"callee")&&!_n.call(e,"callee")},Ze=Array.isArray;function tr(e){return e!=null&<(e.length)&&!or(e)}function Sa(e){return me(e)&&tr(e)}var ct=Tn||Ia;function or(e){if(!K(e))return!1;var r=Ee(e);return r==Kr||r==Do||r==zo||r==Ho}function lt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Xr}function K(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function me(e){return e!=null&&typeof e=="object"}function xa(e){if(!me(e)||Ee(e)!=Qr)return!1;var r=ot(e);if(r===null)return!0;var t=D.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Re.call(t)==Sn}var dt=$r?gn($r):Kn;function _a(e){return ia(e,ut(e))}function ut(e){return tr(e)?Yn(e,!0):Qn(e)}var ka=sa(function(e,r,t,o){at(e,r,t,o)});function Ta(e){return function(){return e}}function pt(e){return e}function Ia(){return!1}ee.exports=ka});var Bt=Cr((wc,At)=>{d();var Si=typeof Element<"u",xi=typeof Map=="function",_i=typeof Set=="function",ki=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ne(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var t,o,a;if(Array.isArray(e)){if(t=e.length,t!=r.length)return!1;for(o=t;o--!==0;)if(!Ne(e[o],r[o]))return!1;return!0}var i;if(xi&&e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!r.has(o.value[0]))return!1;for(i=e.entries();!(o=i.next()).done;)if(!Ne(o.value[1],r.get(o.value[0])))return!1;return!0}if(_i&&e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!r.has(o.value[0]))return!1;return!0}if(ki&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(t=e.length,t!=r.length)return!1;for(o=t;o--!==0;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof r.valueOf=="function")return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof r.toString=="function")return e.toString()===r.toString();if(a=Object.keys(e),t=a.length,t!==Object.keys(r).length)return!1;for(o=t;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;if(Si&&e instanceof Element)return!1;for(o=t;o--!==0;)if(!((a[o]==="_owner"||a[o]==="__v"||a[o]==="__o")&&e.$$typeof)&&!Ne(e[a[o]],r[a[o]]))return!1;return!0}return e!==e&&r!==r}At.exports=function(r,t){try{return Ne(r,t)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}}});d();import{GMAPS_LIBRARIES as Qt,mapboxToGmapsViewState as is}from"@biodiv-platform/naksha-commons";import{CloseIcon as ss}from"@chakra-ui/icons";import{Box as Ve,Button as xr,Modal as cs,ModalBody as ls,ModalContent as ds,ModalHeader as us,ModalOverlay as ps,useDisclosure as fs}from"@chakra-ui/react";import{Data as ms,GoogleMap as gs,LoadScriptNext as hs}from"@react-google-maps/api";import bs,{useEffect as _r,useMemo as ys,useReducer as vs,useRef as Zt,useState as eo}from"react";import{Table as Ss,Tbody as xs,Tr as ro,Td as to}from"@chakra-ui/react";d();import{GMAPS_AUTOCOMPLETE_FIELDS as ko}from"@biodiv-platform/naksha-commons";import{Autocomplete as To}from"@react-google-maps/api";import{useState as Io}from"react";d();import _o from"@turf/bbox";d();var C={POINT:"Point",POLYGON:"Polygon",LINESTRING:"LineString",RECTANGLE:"Rectangle",RAW:"Raw",NONE:null},Er={mapTypeControlOptions:{position:10}},Or="Invalid Format. Enter Latitude, Longitude.",Ar="Point added successfully";var Br=e=>({type:C.POINT,properties:{id:new Date().getTime(),name:e.name,formatted_address:e.formatted_address},coordinates:Object.values(e.geometry.location.toJSON()).reverse()}),Pr=e=>{let r=new Date().getTime();switch(e.getType()){case C.POINT:return{type:C.POINT,properties:{id:r},coordinates:Object.values(e.get().toJSON()).reverse()};case C.POLYGON:{let t=[],o=a=>t.push([a.lng(),a.lat()]);return e.forEachLatLng(o),t.push(t[0]),{type:C.POLYGON,properties:{id:r},coordinates:[t]}}case C.RAW:{let t=e.data;return t.push(t[0]),{type:C.POLYGON,properties:{id:r},coordinates:[t]}}case C.LINESTRING:{let t=[],o=a=>t.push([a.lng(),a.lat()]);return e.forEachLatLng(o),{type:C.LINESTRING,properties:{id:r},coordinates:t}}default:return null}},Mr=e=>{let r=(e||[]).filter(o=>o);return r.length===0?!1:{type:"FeatureCollection",features:r.map(o=>{if(Array.isArray(o)&&o.length>0&&o[0].isGeojson){let a=o[0];return{type:"Feature",properties:a.properties||{},geometry:a.geometry||null}}else return{type:"Feature",properties:{},geometry:o}})}},Fr=e=>{let r=_o(e);return{east:r[2],north:r[3],south:r[1],west:r[0]}};import{jsx as wo}from"react/jsx-runtime";function He({InputComponent:e,addFeature:r,gmapRegion:t}){let[o,a]=Io();return wo(To,{onLoad:s=>{a(s)},fields:ko,onPlaceChanged:()=>{let s=Br(o==null?void 0:o.getPlace());r(s)},options:t?{componentRestrictions:{country:t}}:{},children:e})}d();import{jsx as ke}from"react/jsx-runtime";var Ro={background:"white",position:"absolute",top:"5px",left:"106px",padding:"0.4rem",borderRadius:"0.15rem",outline:0,boxShadow:"rgba(0, 0, 0, 0.3) 0px 1px 4px -1px"};function Ue({onClick:e}){return ke("button",{type:"button",title:"Clear",onClick:e,style:Ro,children:ke("svg",{viewBox:"0 0 24 24",width:"12",height:"12",children:ke("g",{fill:"#E53E3E",children:ke("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})})})}d();import{CheckCircleIcon as Li,CloseIcon as zi,DeleteIcon as ji}from"@chakra-ui/icons";import{Box as ne,Icon as $t,List as Ni,ListItem as $i,Text as Q}from"@chakra-ui/react";import Di,{useState as We}from"react";import{useDropzone as Wi}from"react-dropzone";d();d();d();d();d();d();d();d();import{ThemeContext as Co}from"@emotion/react";import{useContext as Eo}from"react";function Lr(){let e=Eo(Co);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}d();d();import{createContext as Oo,useContext as Ao}from"react";var Ye=Oo({});Ye.displayName="ColorModeContext";function le(){let e=Ao(Ye);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function zr(){let e=le(),r=Lr();return{...e,theme:r}}d();d();var jr=(...e)=>e.filter(Boolean).join(" ");function P(e){let r=typeof e;return e!=null&&(r==="object"||r==="function")&&!Array.isArray(e)}function j(e,...r){return Bo(e)?e(...r):e}var Bo=e=>typeof e=="function";var si=Z(oe(),1);var he=Z(oe(),1),kt=Z(oe(),1);var Fe=Z(oe(),1),wa=e=>/!(important)?$/.test(e),ft=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Ra=(e,r)=>t=>{let o=String(r),a=wa(o),i=ft(o),c=e?`${e}.${i}`:i,s=P(t.__cssMap)&&c in t.__cssMap?t.__cssMap[c].varRef:r;return s=ft(s),a?`${s} !important`:s};function dr(e){let{scale:r,transform:t,compose:o}=e;return(i,c)=>{var s;let l=Ra(r,i)(c),p=(s=t==null?void 0:t(l,c))!=null?s:l;return o&&(p=o(p,c)),p}}var Be=(...e)=>r=>e.reduce((t,o)=>o(t),r);function M(e,r){return t=>{let o={property:t,scale:e};return o.transform=dr({scale:e,transform:r}),o}}var Ca=({rtl:e,ltr:r})=>t=>t.direction==="rtl"?e:r;function Ea(e){let{property:r,scale:t,transform:o}=e;return{scale:t,property:Ca(r),transform:t?dr({scale:t,compose:o}):o}}var vt=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Oa(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...vt].join(" ")}function Aa(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...vt].join(" ")}var Ba={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Pa={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Ma(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var Fa={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},ar={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},La=new Set(Object.values(ar)),ir=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),za=e=>e.trim();function ja(e,r){if(e==null||ir.has(e))return e;if(!(sr(e)||ir.has(e)))return`url('${e}')`;let a=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=a==null?void 0:a[1],c=a==null?void 0:a[2];if(!i||!c)return e;let s=i.includes("-gradient")?i:`${i}-gradient`,[l,...p]=c.split(",").map(za).filter(Boolean);if((p==null?void 0:p.length)===0)return e;let u=l in ar?ar[l]:l;p.unshift(u);let S=p.map(f=>{if(La.has(f))return f;let m=f.indexOf(" "),[R,w]=m!==-1?[f.substr(0,m),f.substr(m+1)]:[f],x=sr(w)?w:w&&w.split(" "),y=`colors.${R}`,_=y in r.__cssMap?r.__cssMap[y].varRef:R;return x?[_,...Array.isArray(x)?x:[x]].join(" "):_});return`${s}(${S.join(", ")})`}var sr=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),Na=(e,r)=>ja(e,r!=null?r:{});function $a(e){return/^var\(--.+\)$/.test(e)}var Da=e=>{let r=parseFloat(e.toString()),t=e.toString().replace(String(r),"");return{unitless:!t,value:r,unit:t}},N=e=>r=>`${e}(${r})`,g={filter(e){return e!=="auto"?e:Ba},backdropFilter(e){return e!=="auto"?e:Pa},ring(e){return Ma(g.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Oa():e==="auto-gpu"?Aa():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;let{unitless:r}=Da(e);return r||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,r){let t={left:"right",right:"left"};return r.direction==="rtl"?t[e]:e},degree(e){if($a(e)||e==null)return e;let r=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||r?`${e}deg`:e},gradient:Na,blur:N("blur"),opacity:N("opacity"),brightness:N("brightness"),contrast:N("contrast"),dropShadow:N("drop-shadow"),grayscale:N("grayscale"),hueRotate:e=>N("hue-rotate")(g.degree(e)),invert:N("invert"),saturate:N("saturate"),sepia:N("sepia"),bgImage(e){return e==null||sr(e)||ir.has(e)?e:`url(${e})`},outline(e){let r=String(e)==="0"||String(e)==="none";return e!==null&&r?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var r;let{space:t,divide:o}=(r=Fa[e])!=null?r:{},a={flexDirection:e};return t&&(a[t]=1),o&&(a[o]=1),a}},n={borderWidths:M("borderWidths"),borderStyles:M("borderStyles"),colors:M("colors"),borders:M("borders"),gradients:M("gradients",g.gradient),radii:M("radii",g.px),space:M("space",Be(g.vh,g.px)),spaceT:M("space",Be(g.vh,g.px)),degreeT(e){return{property:e,transform:g.degree}},prop(e,r,t){return{property:e,scale:r,...r&&{transform:dr({scale:r,transform:t})}}},propT(e,r){return{property:e,transform:r}},sizes:M("sizes",Be(g.vh,g.px)),sizesT:M("sizes",Be(g.vh,g.fraction)),shadows:M("shadows"),logical:Ea,blur:M("blur",g.blur)},Pe={background:n.colors("background"),backgroundColor:n.colors("backgroundColor"),backgroundImage:n.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:g.bgClip},bgSize:n.prop("backgroundSize"),bgPosition:n.prop("backgroundPosition"),bg:n.colors("background"),bgColor:n.colors("backgroundColor"),bgPos:n.prop("backgroundPosition"),bgRepeat:n.prop("backgroundRepeat"),bgAttachment:n.prop("backgroundAttachment"),bgGradient:n.gradients("backgroundImage"),bgClip:{transform:g.bgClip}};Object.assign(Pe,{bgImage:Pe.backgroundImage,bgImg:Pe.backgroundImage});var v={border:n.borders("border"),borderWidth:n.borderWidths("borderWidth"),borderStyle:n.borderStyles("borderStyle"),borderColor:n.colors("borderColor"),borderRadius:n.radii("borderRadius"),borderTop:n.borders("borderTop"),borderBlockStart:n.borders("borderBlockStart"),borderTopLeftRadius:n.radii("borderTopLeftRadius"),borderStartStartRadius:n.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:n.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:n.radii("borderTopRightRadius"),borderStartEndRadius:n.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:n.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:n.borders("borderRight"),borderInlineEnd:n.borders("borderInlineEnd"),borderBottom:n.borders("borderBottom"),borderBlockEnd:n.borders("borderBlockEnd"),borderBottomLeftRadius:n.radii("borderBottomLeftRadius"),borderBottomRightRadius:n.radii("borderBottomRightRadius"),borderLeft:n.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:n.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:n.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:n.borders(["borderLeft","borderRight"]),borderInline:n.borders("borderInline"),borderY:n.borders(["borderTop","borderBottom"]),borderBlock:n.borders("borderBlock"),borderTopWidth:n.borderWidths("borderTopWidth"),borderBlockStartWidth:n.borderWidths("borderBlockStartWidth"),borderTopColor:n.colors("borderTopColor"),borderBlockStartColor:n.colors("borderBlockStartColor"),borderTopStyle:n.borderStyles("borderTopStyle"),borderBlockStartStyle:n.borderStyles("borderBlockStartStyle"),borderBottomWidth:n.borderWidths("borderBottomWidth"),borderBlockEndWidth:n.borderWidths("borderBlockEndWidth"),borderBottomColor:n.colors("borderBottomColor"),borderBlockEndColor:n.colors("borderBlockEndColor"),borderBottomStyle:n.borderStyles("borderBottomStyle"),borderBlockEndStyle:n.borderStyles("borderBlockEndStyle"),borderLeftWidth:n.borderWidths("borderLeftWidth"),borderInlineStartWidth:n.borderWidths("borderInlineStartWidth"),borderLeftColor:n.colors("borderLeftColor"),borderInlineStartColor:n.colors("borderInlineStartColor"),borderLeftStyle:n.borderStyles("borderLeftStyle"),borderInlineStartStyle:n.borderStyles("borderInlineStartStyle"),borderRightWidth:n.borderWidths("borderRightWidth"),borderInlineEndWidth:n.borderWidths("borderInlineEndWidth"),borderRightColor:n.colors("borderRightColor"),borderInlineEndColor:n.colors("borderInlineEndColor"),borderRightStyle:n.borderStyles("borderRightStyle"),borderInlineEndStyle:n.borderStyles("borderInlineEndStyle"),borderTopRadius:n.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:n.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:n.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:n.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(v,{rounded:v.borderRadius,roundedTop:v.borderTopRadius,roundedTopLeft:v.borderTopLeftRadius,roundedTopRight:v.borderTopRightRadius,roundedTopStart:v.borderStartStartRadius,roundedTopEnd:v.borderStartEndRadius,roundedBottom:v.borderBottomRadius,roundedBottomLeft:v.borderBottomLeftRadius,roundedBottomRight:v.borderBottomRightRadius,roundedBottomStart:v.borderEndStartRadius,roundedBottomEnd:v.borderEndEndRadius,roundedLeft:v.borderLeftRadius,roundedRight:v.borderRightRadius,roundedStart:v.borderInlineStartRadius,roundedEnd:v.borderInlineEndRadius,borderStart:v.borderInlineStart,borderEnd:v.borderInlineEnd,borderTopStartRadius:v.borderStartStartRadius,borderTopEndRadius:v.borderStartEndRadius,borderBottomStartRadius:v.borderEndStartRadius,borderBottomEndRadius:v.borderEndEndRadius,borderStartRadius:v.borderInlineStartRadius,borderEndRadius:v.borderInlineEndRadius,borderStartWidth:v.borderInlineStartWidth,borderEndWidth:v.borderInlineEndWidth,borderStartColor:v.borderInlineStartColor,borderEndColor:v.borderInlineEndColor,borderStartStyle:v.borderInlineStartStyle,borderEndStyle:v.borderInlineEndStyle});var Wa={color:n.colors("color"),textColor:n.colors("color"),fill:n.colors("fill"),stroke:n.colors("stroke")},cr={boxShadow:n.shadows("boxShadow"),mixBlendMode:!0,blendMode:n.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:n.prop("backgroundBlendMode"),opacity:!0};Object.assign(cr,{shadow:cr.boxShadow});var Va={filter:{transform:g.filter},blur:n.blur("--chakra-blur"),brightness:n.propT("--chakra-brightness",g.brightness),contrast:n.propT("--chakra-contrast",g.contrast),hueRotate:n.propT("--chakra-hue-rotate",g.hueRotate),invert:n.propT("--chakra-invert",g.invert),saturate:n.propT("--chakra-saturate",g.saturate),dropShadow:n.propT("--chakra-drop-shadow",g.dropShadow),backdropFilter:{transform:g.backdropFilter},backdropBlur:n.blur("--chakra-backdrop-blur"),backdropBrightness:n.propT("--chakra-backdrop-brightness",g.brightness),backdropContrast:n.propT("--chakra-backdrop-contrast",g.contrast),backdropHueRotate:n.propT("--chakra-backdrop-hue-rotate",g.hueRotate),backdropInvert:n.propT("--chakra-backdrop-invert",g.invert),backdropSaturate:n.propT("--chakra-backdrop-saturate",g.saturate)},Me={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:g.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:n.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:n.space("gap"),rowGap:n.space("rowGap"),columnGap:n.space("columnGap")};Object.assign(Me,{flexDir:Me.flexDirection});var St={gridGap:n.space("gridGap"),gridColumnGap:n.space("gridColumnGap"),gridRowGap:n.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},Ga={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:g.outline},outlineOffset:!0,outlineColor:n.colors("outlineColor")},F={width:n.sizesT("width"),inlineSize:n.sizesT("inlineSize"),height:n.sizes("height"),blockSize:n.sizes("blockSize"),boxSize:n.sizes(["width","height"]),minWidth:n.sizes("minWidth"),minInlineSize:n.sizes("minInlineSize"),minHeight:n.sizes("minHeight"),minBlockSize:n.sizes("minBlockSize"),maxWidth:n.sizes("maxWidth"),maxInlineSize:n.sizes("maxInlineSize"),maxHeight:n.sizes("maxHeight"),maxBlockSize:n.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,r)=>{var t,o,a;return{[`@media screen and (min-width: ${(a=(o=(t=r.__breakpoints)==null?void 0:t.get(e))==null?void 0:o.minW)!=null?a:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,r)=>{var t,o,a;return{[`@media screen and (max-width: ${(a=(o=(t=r.__breakpoints)==null?void 0:t.get(e))==null?void 0:o._minW)!=null?a:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:n.propT("float",g.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(F,{w:F.width,h:F.height,minW:F.minWidth,maxW:F.maxWidth,minH:F.minHeight,maxH:F.maxHeight,overscroll:F.overscrollBehavior,overscrollX:F.overscrollBehaviorX,overscrollY:F.overscrollBehaviorY});var Ha={listStyleType:!0,listStylePosition:!0,listStylePos:n.prop("listStylePosition"),listStyleImage:!0,listStyleImg:n.prop("listStyleImage")};function Ua(e,r,t,o){let a=typeof r=="string"?r.split("."):[r];for(o=0;o<a.length&&e;o+=1)e=e[a[o]];return e===void 0?t:e}var Ya=e=>{let r=new WeakMap;return(o,a,i,c)=>{if(typeof o>"u")return e(o,a,i);r.has(o)||r.set(o,new Map);let s=r.get(o);if(s.has(a))return s.get(a);let l=e(o,a,i,c);return s.set(a,l),l}},Ja=Ya(Ua),Xa={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},qa={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},nr=(e,r,t)=>{let o={},a=Ja(e,r,{});for(let i in a)i in t&&t[i]!=null||(o[i]=a[i]);return o},Ka={srOnly:{transform(e){return e===!0?Xa:e==="focusable"?qa:{}}},layerStyle:{processResult:!0,transform:(e,r,t)=>nr(r,`layerStyles.${e}`,t)},textStyle:{processResult:!0,transform:(e,r,t)=>nr(r,`textStyles.${e}`,t)},apply:{processResult:!0,transform:(e,r,t)=>nr(r,e,t)}},be={position:!0,pos:n.prop("position"),zIndex:n.prop("zIndex","zIndices"),inset:n.spaceT("inset"),insetX:n.spaceT(["left","right"]),insetInline:n.spaceT("insetInline"),insetY:n.spaceT(["top","bottom"]),insetBlock:n.spaceT("insetBlock"),top:n.spaceT("top"),insetBlockStart:n.spaceT("insetBlockStart"),bottom:n.spaceT("bottom"),insetBlockEnd:n.spaceT("insetBlockEnd"),left:n.spaceT("left"),insetInlineStart:n.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:n.spaceT("right"),insetInlineEnd:n.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(be,{insetStart:be.insetInlineStart,insetEnd:be.insetInlineEnd});var Qa={ring:{transform:g.ring},ringColor:n.colors("--chakra-ring-color"),ringOffset:n.prop("--chakra-ring-offset-width"),ringOffsetColor:n.colors("--chakra-ring-offset-color"),ringInset:n.prop("--chakra-ring-inset")},T={margin:n.spaceT("margin"),marginTop:n.spaceT("marginTop"),marginBlockStart:n.spaceT("marginBlockStart"),marginRight:n.spaceT("marginRight"),marginInlineEnd:n.spaceT("marginInlineEnd"),marginBottom:n.spaceT("marginBottom"),marginBlockEnd:n.spaceT("marginBlockEnd"),marginLeft:n.spaceT("marginLeft"),marginInlineStart:n.spaceT("marginInlineStart"),marginX:n.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:n.spaceT("marginInline"),marginY:n.spaceT(["marginTop","marginBottom"]),marginBlock:n.spaceT("marginBlock"),padding:n.space("padding"),paddingTop:n.space("paddingTop"),paddingBlockStart:n.space("paddingBlockStart"),paddingRight:n.space("paddingRight"),paddingBottom:n.space("paddingBottom"),paddingBlockEnd:n.space("paddingBlockEnd"),paddingLeft:n.space("paddingLeft"),paddingInlineStart:n.space("paddingInlineStart"),paddingInlineEnd:n.space("paddingInlineEnd"),paddingX:n.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:n.space("paddingInline"),paddingY:n.space(["paddingTop","paddingBottom"]),paddingBlock:n.space("paddingBlock")};Object.assign(T,{m:T.margin,mt:T.marginTop,mr:T.marginRight,me:T.marginInlineEnd,marginEnd:T.marginInlineEnd,mb:T.marginBottom,ml:T.marginLeft,ms:T.marginInlineStart,marginStart:T.marginInlineStart,mx:T.marginX,my:T.marginY,p:T.padding,pt:T.paddingTop,py:T.paddingY,px:T.paddingX,pb:T.paddingBottom,pl:T.paddingLeft,ps:T.paddingInlineStart,paddingStart:T.paddingInlineStart,pr:T.paddingRight,pe:T.paddingInlineEnd,paddingEnd:T.paddingInlineEnd});var Za={textDecorationColor:n.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:n.shadows("textShadow")},ei={clipPath:!0,transform:n.propT("transform",g.transform),transformOrigin:!0,translateX:n.spaceT("--chakra-translate-x"),translateY:n.spaceT("--chakra-translate-y"),skewX:n.degreeT("--chakra-skew-x"),skewY:n.degreeT("--chakra-skew-y"),scaleX:n.prop("--chakra-scale-x"),scaleY:n.prop("--chakra-scale-y"),scale:n.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:n.degreeT("--chakra-rotate")},ri={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:n.prop("transitionDuration","transition.duration"),transitionProperty:n.prop("transitionProperty","transition.property"),transitionTimingFunction:n.prop("transitionTimingFunction","transition.easing")},ti={fontFamily:n.prop("fontFamily","fonts"),fontSize:n.prop("fontSize","fontSizes",g.px),fontWeight:n.prop("fontWeight","fontWeights"),lineHeight:n.prop("lineHeight","lineHeights"),letterSpacing:n.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},oi={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:n.spaceT("scrollMargin"),scrollMarginTop:n.spaceT("scrollMarginTop"),scrollMarginBottom:n.spaceT("scrollMarginBottom"),scrollMarginLeft:n.spaceT("scrollMarginLeft"),scrollMarginRight:n.spaceT("scrollMarginRight"),scrollMarginX:n.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:n.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:n.spaceT("scrollPadding"),scrollPaddingTop:n.spaceT("scrollPaddingTop"),scrollPaddingBottom:n.spaceT("scrollPaddingBottom"),scrollPaddingLeft:n.spaceT("scrollPaddingLeft"),scrollPaddingRight:n.spaceT("scrollPaddingRight"),scrollPaddingX:n.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:n.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function xt(e){return P(e)&&e.reference?e.reference:String(e)}var Le=(e,...r)=>r.map(xt).join(` ${e} `).replace(/calc/g,""),mt=(...e)=>`calc(${Le("+",...e)})`,gt=(...e)=>`calc(${Le("-",...e)})`,lr=(...e)=>`calc(${Le("*",...e)})`,ht=(...e)=>`calc(${Le("/",...e)})`,bt=e=>{let r=xt(e);return r!=null&&!Number.isNaN(parseFloat(r))?String(r).startsWith("-")?String(r).slice(1):`-${r}`:lr(r,-1)},ge=Object.assign(e=>({add:(...r)=>ge(mt(e,...r)),subtract:(...r)=>ge(gt(e,...r)),multiply:(...r)=>ge(lr(e,...r)),divide:(...r)=>ge(ht(e,...r)),negate:()=>ge(bt(e)),toString:()=>e.toString()}),{add:mt,subtract:gt,multiply:lr,divide:ht,negate:bt});function ni(e){let r=parseFloat(e.toString()),t=e.toString().replace(String(r),"");return{unitless:!t,value:r,unit:t}}function yt(e){if(e==null)return e;let{unitless:r}=ni(e);return r||typeof e=="number"?`${e}px`:e}function ai(e,r){let t=["@media screen"];return e&&t.push("and",`(min-width: ${yt(e)})`),r&&t.push("and",`(max-width: ${yt(r)})`),t.join(" ")}var E={hover:(e,r)=>`${e}:hover ${r}, ${e}[data-hover] ${r}`,focus:(e,r)=>`${e}:focus ${r}, ${e}[data-focus] ${r}`,focusVisible:(e,r)=>`${e}:focus-visible ${r}`,focusWithin:(e,r)=>`${e}:focus-within ${r}`,active:(e,r)=>`${e}:active ${r}, ${e}[data-active] ${r}`,disabled:(e,r)=>`${e}:disabled ${r}, ${e}[data-disabled] ${r}`,invalid:(e,r)=>`${e}:invalid ${r}, ${e}[data-invalid] ${r}`,checked:(e,r)=>`${e}:checked ${r}, ${e}[data-checked] ${r}`,indeterminate:(e,r)=>`${e}:indeterminate ${r}, ${e}[aria-checked=mixed] ${r}, ${e}[data-indeterminate] ${r}`,readOnly:(e,r)=>`${e}:read-only ${r}, ${e}[readonly] ${r}, ${e}[data-read-only] ${r}`,expanded:(e,r)=>`${e}:read-only ${r}, ${e}[aria-expanded=true] ${r}, ${e}[data-expanded] ${r}`,placeholderShown:(e,r)=>`${e}:placeholder-shown ${r}`},H=e=>_t(r=>e(r,"&"),"[role=group]","[data-group]",".group"),V=e=>_t(r=>e(r,"~ &"),"[data-peer]",".peer"),_t=(e,...r)=>r.map(e).join(", "),ur={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:H(E.hover),_peerHover:V(E.hover),_groupFocus:H(E.focus),_peerFocus:V(E.focus),_groupFocusVisible:H(E.focusVisible),_peerFocusVisible:V(E.focusVisible),_groupActive:H(E.active),_peerActive:V(E.active),_groupDisabled:H(E.disabled),_peerDisabled:V(E.disabled),_groupInvalid:H(E.invalid),_peerInvalid:V(E.invalid),_groupChecked:H(E.checked),_peerChecked:V(E.checked),_groupFocusWithin:H(E.focusWithin),_peerFocusWithin:V(E.focusWithin),_peerPlaceholderShown:V(E.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},ii=Object.keys(ur);var pr=(0,kt.default)({},Pe,v,Wa,Me,F,Va,Qa,Ga,St,Ka,be,cr,T,oi,ti,Za,ei,Ha,ri),ci=Object.assign({},T,F,Me,St,be),Ks=Object.keys(ci),Tt=[...Object.keys(pr),...ii],li={...pr,...ur},It=e=>e in li,di=e=>r=>{if(!r.__breakpoints)return e;let{isResponsive:t,toArrayValue:o,media:a}=r.__breakpoints,i={};for(let c in e){let s=j(e[c],r);if(s==null)continue;if(s=P(s)&&t(s)?o(s):s,!Array.isArray(s)){i[c]=s;continue}let l=s.slice(0,a.length).length;for(let p=0;p<l;p+=1){let u=a==null?void 0:a[p];if(!u){i[c]=s[p];continue}i[u]=i[u]||{},s[p]!=null&&(i[u][c]=s[p])}}return i};function ui(e){let r=[],t="",o=!1;for(let a=0;a<e.length;a++){let i=e[a];i==="("?(o=!0,t+=i):i===")"?(o=!1,t+=i):i===","&&!o?(r.push(t),t=""):t+=i}return t=t.trim(),t&&r.push(t),r}function pi(e){return/^var\(--.+\)$/.test(e)}var fi=(e,r)=>e.startsWith("--")&&typeof r=="string"&&!pi(r),mi=(e,r)=>{var t,o;if(r==null)return r;let a=l=>{var p,u;return(u=(p=e.__cssMap)==null?void 0:p[l])==null?void 0:u.varRef},i=l=>{var p;return(p=a(l))!=null?p:l},[c,s]=ui(r);return r=(o=(t=a(c))!=null?t:i(s))!=null?o:i(r),r};function gi(e){let{configs:r={},pseudos:t={},theme:o}=e,a=(i,c=!1)=>{var s,l,p;let u=j(i,o),S=di(u)(o),f={};for(let m in S){let R=S[m],w=j(R,o);m in t&&(m=t[m]),fi(m,w)&&(w=mi(o,w));let x=r[m];if(x===!0&&(x={property:m}),P(w)){f[m]=(s=f[m])!=null?s:{},f[m]=(0,he.default)({},f[m],a(w,!0));continue}let y=(p=(l=x==null?void 0:x.transform)==null?void 0:l.call(x,w,o,u))!=null?p:w;y=x!=null&&x.processResult?a(y,!0):y;let _=j(x==null?void 0:x.property,o);if(!c&&(x==null?void 0:x.static)){let O=j(x.static,o);f=(0,he.default)({},f,O)}if(_&&Array.isArray(_)){for(let O of _)f[O]=y;continue}if(_){_==="&"&&P(y)?f=(0,he.default)({},f,y):f[_]=y;continue}if(P(y)){f=(0,he.default)({},f,y);continue}f[m]=y}return f};return a}var wt=e=>r=>gi({theme:r,pseudos:ur,configs:pr})(e);function hi(e,r){if(Array.isArray(e))return e;if(P(e))return r(e);if(e!=null)return[e]}function bi(e,r){for(let t=r+1;t<e.length;t++)if(e[t]!=null)return t;return-1}function yi(e){let r=e.__breakpoints;return function(o,a,i,c){var s,l;if(!r)return;let p={},u=hi(i,r.toArrayValue);if(!u)return p;let S=u.length,f=S===1,m=!!o.parts;for(let R=0;R<S;R++){let w=r.details[R],x=r.details[bi(u,R)],y=ai(w.minW,x==null?void 0:x._minW),_=j((s=o[a])==null?void 0:s[u[R]],c);if(!!_){if(m){(l=o.parts)==null||l.forEach(O=>{(0,Fe.default)(p,{[O]:f?_[O]:{[y]:_[O]}})});continue}if(!m){f?(0,Fe.default)(p,_):p[y]=_;continue}p[y]=_}}return p}}function Rt(e){return r=>{var t;let{variant:o,size:a,theme:i}=r,c=yi(i);return(0,Fe.default)({},j((t=e.baseStyle)!=null?t:{},r),c(e,"sizes",a,r),c(e,"variants",o,r))}}d();d();var ze=Z(oe(),1);function fr(e,r){let t={};return Object.keys(e).forEach(o=>{r.includes(o)||(t[o]=e[o])}),t}function Ct(e,r,t,o){let a=typeof r=="string"?r.split("."):[r];for(o=0;o<a.length&&e;o+=1)e=e[a[o]];return e===void 0?t:e}var Et=e=>{let r=new WeakMap;return(o,a,i,c)=>{if(typeof o>"u")return e(o,a,i);r.has(o)||r.set(o,new Map);let s=r.get(o);if(s.has(a))return s.get(a);let l=e(o,a,i,c);return s.set(a,l),l}},mr=Et(Ct);function je(e,r){let t={};return Object.keys(e).forEach(o=>{let a=e[o];r(a,o,e)&&(t[o]=a)}),t}var ye=e=>je(e,r=>r!=null);d();function Ot(e){return typeof e=="function"}var vi=process.env.NODE_ENV!=="production",tc=process.env.NODE_ENV==="test";d();function gr(e,...r){return Ot(e)?e(...r):e}var Pt=Z(Bt(),1);import{useRef as Ti}from"react";function Ii(e,r={}){var t;let{styleConfig:o,...a}=r,{theme:i,colorMode:c}=zr(),s=e?mr(i,`components.${e}`):void 0,l=o||s,p=(0,ze.default)({theme:i,colorMode:c},(t=l==null?void 0:l.defaultProps)!=null?t:{},ye(fr(a,["children"]))),u=Ti({});if(l){let f=Rt(l)(p);(0,Pt.default)(u.current,f)||(u.current=f)}return u.current}function hr(e,r={}){return Ii(e,r)}d();d();d();var wi=new Set([...Tt,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),Ri=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function Mt(e){return Ri.has(e)||!wi.has(e)}d();d();function br(e,...r){if(e==null)throw new TypeError("Cannot convert undefined or null to object");let t={...e};for(let o of r)if(o!=null)for(let a in o)!Object.prototype.hasOwnProperty.call(o,a)||(a in t&&delete t[a],t[a]=o[a]);return t}import Ft from"@emotion/styled";import Lt from"react";var zt,Ci=(zt=Ft.default)!=null?zt:Ft,Ei=({baseStyle:e})=>r=>{let{theme:t,css:o,__css:a,sx:i,...c}=r,s=je(c,(S,f)=>It(f)),l=gr(e,r),p=br({},a,l,ye(s),i),u=wt(p)(r.theme);return o?[u,o]:u};function $e(e,r){let{baseStyle:t,...o}=r!=null?r:{};o.shouldForwardProp||(o.shouldForwardProp=Mt);let a=Ei({baseStyle:t}),i=Ci(e,o)(a);return Lt.forwardRef(function(l,p){let{colorMode:u,forced:S}=le();return Lt.createElement(i,{ref:p,"data-theme":S?u:void 0,...l})})}function Oi(){let e=new Map;return new Proxy($e,{apply(r,t,o){return $e(...o)},get(r,t){return e.has(t)||e.set(t,$e(t)),e.get(t)}})}var De=Oi();d();import{forwardRef as Ai}from"react";function ve(e){return Ai(e)}import{keyframes as rl}from"@emotion/react";import{jsx as Se,jsxs as Bi}from"react/jsx-runtime";var jt={path:Bi("g",{stroke:"currentColor",strokeWidth:"1.5",children:[Se("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),Se("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),Se("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},yr=ve((e,r)=>{let{as:t,viewBox:o,color:a="currentColor",focusable:i=!1,children:c,className:s,__css:l,...p}=e,u=jr("chakra-icon",s),S=hr("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:a,...l,...S},m={ref:r,focusable:i,className:u,__css:f},R=o!=null?o:jt.viewBox;if(t&&typeof t!="string")return Se(De.svg,{as:t,...m,...p});let w=c!=null?c:jt.path;return Se(De.svg,{verticalAlign:"middle",viewBox:R,...m,...p,children:w})});yr.displayName="Icon";import{Children as Pi}from"react";import{jsx as Nt}from"react/jsx-runtime";function xe(e){let{viewBox:r="0 0 24 24",d:t,displayName:o,defaultProps:a={}}=e,i=Pi.toArray(e.path),c=ve((s,l)=>Nt(yr,{ref:l,viewBox:r,...a,...s,children:i.length?i:Nt("path",{fill:"currentColor",d:t})}));return c.displayName=o,c}import{jsx as U,jsxs as Fi}from"react/jsx-runtime";var Mi=xe({displayName:"Calendar",path:Fi("g",{children:[U("path",{fill:"#231F20",d:`M60,0H14c-2.211,0-4,1.789-4,4v27H4c-2.211,0-4,1.789-4,4v23c0,3.313,2.687,6,6,6h52c3.313,0,6-2.687,6-6V4
|
|
2
|
-
C64,1.789,62.211,0,60,0z M2,58V35c0-1.104,0.896-2,2-2h6v25c0,2.209-1.791,4-4,4S2,60.209,2,58z M58,62H10.463
|
|
3
|
-
C11.416,60.938,12,59.539,12,58V4c0-1.104,0.896-2,2-2h46c1.104,0,2,0.896,2,2v54C62,60.209,60.209,62,58,62z`}),U("path",{fill:"#231F20",d:"M53,25H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,25,53,25z"}),U("path",{fill:"#231F20",d:"M53,19H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,19,53,19z"}),U("path",{fill:"#231F20",d:"M53,37H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,37,53,37z"}),U("path",{fill:"#231F20",d:"M53,43H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,43,53,43z"}),U("path",{fill:"#231F20",d:"M53,49H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,49,53,49z"}),U("path",{fill:"#231F20",d:"M53,31H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,31,53,31z"}),U("path",{fill:"#231F20",d:"M21,15h15c0.553,0,1-0.447,1-1s-0.447-1-1-1H21c-0.553,0-1,0.447-1,1S20.447,15,21,15z"})]}),viewBox:"0 0 64 64"}),vr=Mi;import{Fragment as Gi,jsx as A,jsxs as Y}from"react/jsx-runtime";var Vi=({addFeature:e,ButtonComponent:r})=>{let[t,o]=We(!0),[a,i]=We(""),[c,s]=We([]),[l,p]=We([]),u=y=>{s(y)},S=()=>{try{c.forEach(y=>{let _=new FileReader;_.onabort=()=>f("File reading was aborted. Please try again."),_.onerror=()=>f("File reading has failed. Please try again."),_.onload=()=>{let O=_.result;if(O){let L=typeof O=="string"?O:new TextDecoder().decode(O);try{let G=JSON.parse(L);(Array.isArray(G.features)?G.features.map(z=>({...z,isGeojson:!0})):[{...G,isGeojson:!0}]).forEach(z=>{e([z])}),i("Geojson added successfully"),o(!0),p(z=>[...z,{name:y.name}]),s([])}catch(G){console.error(G),f("Upload failed. Invalid GeoJSON format.")}}else f("File reading result is null.")},_.readAsText(y)})}catch(y){console.error(y),f("File upload failed. Please try again.")}finally{setTimeout(()=>{i(""),o(!0)},2e3)}},f=y=>{i(y),o(!1)},m=()=>{s([])},{getRootProps:R,getInputProps:w,isDragActive:x}=Wi({onDrop:u,accept:{"application/geo+json":[".geojson"]}});return Y(ne,{display:"flex",flexDirection:"column",alignItems:"flex-start",marginTop:"10px",children:[A(Q,{marginBottom:"10px",fontWeight:"bold",fontSize:"lg",children:"GeoJSON"}),Y(ne,{display:"flex",flexDirection:"row",alignItems:"center",children:[Y(ne,{border:"2px solid #519895",borderRadius:"4px",display:"flex",flexDirection:"column",alignItems:"center",padding:"10px",cursor:"pointer",marginLeft:"15px",width:"350px",height:"100px",...R(),children:[A("input",{...w()}),c.length>0?A(ne,{display:"flex",alignItems:"center",children:Y(ne,{ml:"10px",display:"flex",alignItems:"center",children:[A($t,{as:vr,boxSize:30,color:"gray.500",style:{marginRight:"5px"}}),A(Q,{marginTop:"10px",overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"200px",children:c[0].name}),A(ji,{boxSize:20,color:"red",onClick:m,ml:"10px",mt:"10px",children:"Remove"})]})}):Y(Gi,{children:[A(Q,{children:"Drag 'n' drop GeoJSON file here, or click to select a file"}),x&&A(Q,{children:"Drop the file here..."})]})]}),Di.cloneElement(r,{type:"button",ml:"30px",style:{paddingLeft:"15px"},onClick:S})]}),a&&Y(Q,{fontWeight:"bold",color:t?"green":"red",height:"20px",children:[t?A(Li,{boxSize:20,mr:2}):A(zi,{boxSize:15,mr:2}),a]}),l.length>0&&Y(ne,{mt:"10px",pl:"15px",children:[A(Q,{fontSize:"sm",children:"Added GeoJSONs:"}),A(Ni,{styleType:"none",padding:"0",children:l.map((y,_)=>Y($i,{display:"flex",alignItems:"center",children:[A($t,{as:vr,boxSize:20,color:"teal",mr:"3px",style:{marginTop:"5px"}}),A(Q,{mt:"10px",overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"300px",children:y.name})]},_))})]})]})},Dt=Vi;d();import{CheckCircleIcon as Ui,CloseIcon as Yi}from"@chakra-ui/icons";import{Box as Vt,Flex as Ji,Heading as Gt,Icon as Xi,List as qi,ListItem as Ki,Text as Qi}from"@chakra-ui/react";import Ht,{useRef as Zi,useState as Ut}from"react";d();var Hi=xe({displayName:"Location",d:"M11.536 3.464a5 5 0 010 7.072L8 14.07l-3.536-3.535a5 5 0 117.072-7.072v.001zm1.06 8.132a6.5 6.5 0 10-9.192 0l3.535 3.536a1.5 1.5 0 002.122 0l3.535-3.536zM8 9a2 2 0 100-4 2 2 0 000 4z",viewBox:"0 0 16 16"}),Wt=Hi;import{jsx as ae,jsxs as _e}from"react/jsx-runtime";var es=({addFeature:e,InputComponent:r,ButtonComponent:t})=>{let o=Zi(null),[a,i]=Ut(void 0),[c,s]=Ut([]),l=()=>{var u,S,f;try{let m=(S=(u=o.current)==null?void 0:u.value)!=null?S:"";if(!m.trim()){i(!1);return}let R=(f=m.split(",").map(Number))==null?void 0:f.reverse();if(!p(R)){i(!1);return}let w={type:C.POINT,properties:{id:new Date().getTime(),name:m,formatted_address:m},coordinates:R};e(w),s(x=>[...x,w]),o.current&&(o.current.value=""),i(!0)}catch{i(!1)}finally{setTimeout(()=>{i(void 0)},3e3)}},p=u=>Array.isArray(u)&&u.length===2&&!isNaN(u[0])&&!isNaN(u[1])&&typeof u[0]=="number"&&typeof u[1]=="number";return _e(Vt,{display:"flex",flexDirection:"column",alignItems:"flex-start",children:[ae(Gt,{mb:"10px",fontWeight:"bold",size:"lg",children:"Points"}),_e(Ji,{alignItems:"center",children:[Ht.cloneElement(r,{ref:o,width:"350px"}),Ht.cloneElement(t,{onClick:l,type:"button",marginLeft:"10px"})]}),a!==void 0&&_e(Qi,{fontWeight:"bold",color:a?"green":"red",mt:"10px",display:"flex",alignItems:"center",children:[a?ae(Ui,{boxSize:20,mr:2}):ae(Yi,{boxSize:15,color:"red.500",mr:2}),a?Ar:Or]}),c.length>0&&_e(Vt,{mt:"10px",pl:"20px",children:[ae(Gt,{size:"sm",children:"Added Points:"}),ae(qi,{styleType:"none",padding:"0",children:c.map(u=>_e(Ki,{display:"flex",alignItems:"center",children:[ae(Xi,{as:Wt,color:"teal",mr:"3px"}),u.properties.name]},u.properties.id))})]})]})},Yt=es;d();var J={ADD:"add",CLEAR:"clear",REPLACE:"replace"};function Jt(e,{action:r,data:t,isMultiple:o}){switch(r){case J.ADD:return o?[...e||[],t]:[t];case J.CLEAR:return[];case J.REPLACE:return t;default:return e}}d();import os,{useEffect as ns,useState as Kt}from"react";d();import{useState as Xt,useEffect as rs}from"react";var ts={enableHighAccuracy:!1,timeout:1/0,maximumAge:0},qt=(e,r=ts)=>{let[t,o]=Xt(),[a,i]=Xt(),c=({coords:l})=>{o([l.longitude,l.latitude])},s=l=>{i(l.message)};return rs(()=>{if(!navigator||!navigator.geolocation){i("Geolocation is not supported");return}let l=null;return e?l=navigator.geolocation.watchPosition(c,s,r):l&&navigator.geolocation.clearWatch(l),()=>l&&navigator.geolocation.clearWatch(l)},[r,e]),{position:t,error:a}};import{jsx as as}from"react/jsx-runtime";function Sr({TraceButtonComponent:e,onFeatureAdded:r}){let[t,o]=Kt([]),[a,i]=Kt(!1),{position:c}=qt(a);ns(()=>{a&&c&&o([...t,c])},[a,c]);let s=()=>{a?(i(!1),r({getType:()=>C.RAW,data:[...t]}),o([])):i(!0)};return as("div",{children:os.cloneElement(e,{onClick:s,isTracking:a})})}import{Fragment as _s,jsx as I,jsxs as ie}from"react/jsx-runtime";var rd=bs.forwardRef(({defaultViewState:e,defaultDrawingMode:r,data:t,onDataChange:o,gmapAccessToken:a,isControlled:i,isReadOnly:c,isMultiple:s,isAutocomplete:l,gmapRegion:p,autoCompleteRegion:u,mapStyle:S,importInputComponent:f,importButtonComponent:m,autocompleteComponent:R,showTrace:w,traceButtonComponent:x,maxZoom:y,options:_},O)=>{let L=Zt(null),G=Zt(null),[se,z]=vs(Jt,t),[kr,oo]=eo(),{isOpen:Ge,onOpen:no,onClose:ao}=fs(),[io,so]=eo("auto"),Tr=ys(()=>is(e),[e]),co=()=>{L.current.state.map.data.forEach(function($){L.current.state.map.data.remove($)});let B=Mr(se);if(B){B&&L.current.state.map.data.addGeoJson(B);let $=Fr(B);$&&L.current.state.map.fitBounds($),y&&google.maps.event.addListenerOnce(L.current.state.map,"idle",function(){let mo=L.current.state.map.getZoom();L.current.state.map.setZoom(Math.min(y,mo))})}};_r(()=>{kr&&(o&&o(se),O&&(O.current={addFeature:ce,replaceFeature:lo}),co())},[kr,se]),_r(()=>{i&&JSON.stringify(se)!==JSON.stringify(t)&&z({action:J.REPLACE,data:t})},[t]);let ce=B=>{z({action:J.ADD,data:B,isMultiple:s})},lo=B=>{z({action:J.REPLACE,data:[B]})},Ir=B=>{let $=Pr(B);ce($)},uo=()=>{z({action:J.CLEAR})},po=()=>oo(!0),fo=()=>{no()},wr=()=>{ao()};return _r(()=>{var B;if(Ge){let $=(B=G.current)==null?void 0:B.offsetHeight;so($?`${$}px`:"auto")}},[Ge]),I(hs,{googleMapsApiKey:a,region:p,libraries:l?Qt.AUTOCOMPLETE:Qt.DEFAULT,children:ie(_s,{children:[ie(Ve,{className:"map-toolbar",display:"flex",children:[l&&I(He,{InputComponent:R||I("input",{}),addFeature:ce,gmapRegion:u!=null?u:p}),I(Ve,{display:"flex",justifyContent:"flex-end",paddingBottom:"15px",children:I(xr,{onClick:fo,padding:"8px 25px",backgroundColor:"#519895",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",children:"Import"})})]}),ie(cs,{blockScrollOnMount:!1,isOpen:Ge,onClose:wr,isCentered:!0,size:"auto",children:[I(ps,{}),ie(ds,{ref:G,maxWidth:"550px",height:io,margin:"auto",borderRadius:"8px",boxShadow:"0 0 10px rgba(0, 0, 0, 0.2)",backgroundColor:"#fff",display:"flex",flexDirection:"column",padding:"30px",backdropFilter:"blur(5px)",marginTop:"90px",children:[I(us,{position:"relative",zIndex:2,padding:"10px 0",children:I(ss,{position:"absolute",top:"-15px",right:"-17px",cursor:"pointer",zIndex:3,onClick:wr})}),I(ls,{display:"flex",flexDirection:"column",children:I(Ss,{variant:"striped",colorScheme:"teal",children:ie(xs,{children:[I(ro,{children:I(to,{children:I(Ve,{borderWidth:"1px",borderRadius:"lg",p:"4",mb:"20",pb:"20",pt:"10",children:I(Yt,{InputComponent:f||I("input",{}),ButtonComponent:m||I(xr,{children:"Import Coordinates"}),addFeature:ce})})})}),I(ro,{children:I(to,{children:I(Ve,{borderWidth:"1px",borderRadius:"lg",p:"4",mb:"4",pb:"20",children:I(Dt,{addFeature:ce,ButtonComponent:m||I(xr,{children:"Add"})})})})})]})})})]})]}),w&&I(Sr,{TraceButtonComponent:x||I("button",{children:"trace"}),onFeatureAdded:Ir}),ie(gs,{id:"naksha-gmaps-draw",mapContainerStyle:S||{height:"100%",width:"100%"},zoom:Tr.zoom,center:Tr.center,options:Er,ref:L,onLoad:po,children:[s&&I(Ue,{onClick:uo}),!c&&I(ms,{options:{controls:[C.POINT,C.POLYGON,C.LINESTRING],drawingMode:r||C.POLYGON,featureFactory:Ir,..._||{}}})]})]})})});export{C as GMAP_FEATURE_TYPES,rd as NakshaGmapsDraw};
|
|
1
|
+
var Oe=Object.defineProperty,Fe=Object.defineProperties;var Ne=Object.getOwnPropertyDescriptors;var re=Object.getOwnPropertySymbols;var Ce=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var ae=(t,o,e)=>o in t?Oe(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,M=(t,o)=>{for(var e in o||(o={}))Ce.call(o,e)&&ae(t,e,o[e]);if(re)for(var e of re(o))be.call(o,e)&&ae(t,e,o[e]);return t},j=(t,o)=>Fe(t,Ne(o));import{GMAPS_LIBRARIES as Ee,mapboxToGmapsViewState as Qe}from"@biodiv-platform/naksha-commons";import{Data as Xe,GoogleMap as $e,LoadScriptNext as et}from"@react-google-maps/api";import Ie,{useEffect as Se,useMemo as tt,useReducer as ot,useRef as nt,useState as rt}from"react";import{GMAPS_AUTOCOMPLETE_FIELDS as we}from"@biodiv-platform/naksha-commons";import{Autocomplete as De}from"@react-google-maps/api";import{useState as Me}from"react";import Ge from"@turf/bbox";var l={POINT:"Point",POLYGON:"Polygon",LINESTRING:"LineString",RECTANGLE:"Rectangle",RAW:"Raw",NONE:null},ie={mapTypeControlOptions:{position:10}};var se=t=>({type:l.POINT,properties:{id:new Date().getTime(),name:t.name,formatted_address:t.formatted_address},coordinates:Object.values(t.geometry.location.toJSON()).reverse()}),le=t=>{let o=new Date().getTime();switch(t.getType()){case l.POINT:return{type:l.POINT,properties:{id:o},coordinates:Object.values(t.get().toJSON()).reverse()};case l.POLYGON:{let e=[],n=r=>e.push([r.lng(),r.lat()]);return t.forEachLatLng(n),e.push(e[0]),{type:l.POLYGON,properties:{id:o},coordinates:[e]}}case l.RAW:{let e=t.data;return e.push(e[0]),{type:l.POLYGON,properties:{id:o},coordinates:[e]}}case l.LINESTRING:{let e=[],n=r=>e.push([r.lng(),r.lat()]);return t.forEachLatLng(n),{type:l.LINESTRING,properties:{id:o},coordinates:e}}default:return null}},pe=t=>{let o=(t||[]).filter(n=>n);return o.length===0?!1:{type:"FeatureCollection",features:o.map(n=>{if(Array.isArray(n)&&n.length>0&&n[0].isGeojson){let r=n[0];return{type:"Feature",properties:r.properties||{},geometry:r.geometry||null}}else return{type:"Feature",properties:{},geometry:n}})}},ce=t=>{let o=Ge(t);return{east:o[2],north:o[3],south:o[1],west:o[0]}};import{jsx as ke}from"react/jsx-runtime";function H({InputComponent:t,addFeature:o,gmapRegion:e}){let[n,r]=Me();return ke(De,{onLoad:i=>{r(i)},fields:we,onPlaceChanged:()=>{let i=se(n==null?void 0:n.getPlace());o(i)},options:e?{componentRestrictions:{country:e}}:{},children:t})}import{jsx as Y}from"react/jsx-runtime";var ze={background:"white",position:"absolute",top:"5px",left:"106px",padding:"0.4rem",borderRadius:"0.15rem",outline:0,boxShadow:"rgba(0, 0, 0, 0.3) 0px 1px 4px -1px"};function Z({onClick:t}){return Y("button",{type:"button",title:"Clear",onClick:t,style:ze,children:Y("svg",{viewBox:"0 0 24 24",width:"12",height:"12",children:Y("g",{fill:"#E53E3E",children:Y("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})})})}var T={ADD:"add",CLEAR:"clear",REPLACE:"replace"};function de(t,{action:o,data:e,isMultiple:n}){switch(o){case T.ADD:return n?[...t||[],e]:[e];case T.CLEAR:return[];case T.REPLACE:return e;default:return t}}import Be,{useEffect as Ue,useState as fe}from"react";import{useState as ue,useEffect as Je}from"react";var _e={enableHighAccuracy:!1,timeout:1/0,maximumAge:0},me=(t,o=_e)=>{let[e,n]=ue(),[r,d]=ue(),p=({coords:a})=>{n([a.longitude,a.latitude])},i=a=>{d(a.message)};return Je(()=>{if(!navigator||!navigator.geolocation){d("Geolocation is not supported");return}let a=null;return t?a=navigator.geolocation.watchPosition(p,i,o):a&&navigator.geolocation.clearWatch(a),()=>a&&navigator.geolocation.clearWatch(a)},[o,t]),{position:e,error:r}};import{jsx as Ye}from"react/jsx-runtime";function K({TraceButtonComponent:t,onFeatureAdded:o}){let[e,n]=fe([]),[r,d]=fe(!1),{position:p}=me(r);Ue(()=>{r&&p&&n([...e,p])},[r,p]);let i=()=>{r?(d(!1),o({getType:()=>l.RAW,data:[...e]}),n([])):d(!0)};return Ye("div",{children:Be.cloneElement(t,{onClick:i,isTracking:r})})}import he,{useState as Ke}from"react";import k,{useRef as We,useState as q}from"react";import{jsx as w,jsxs as z}from"react/jsx-runtime";var Ve=({addFeature:t,InputComponent:o,ButtonComponent:e,LocationIcon:n,SuccessIcon:r,FailureIcon:d})=>{let p=We(null),[i,a]=q(!0),[g,m]=q(""),[u,S]=q([]),A=()=>{var c,F,N;try{let E=(F=(c=p.current)==null?void 0:c.value)!=null?F:"";if(!E.trim()){a(!1),m("Invalid Format. Enter Latitude, Longitude.");return}let C=(N=E.split(",").map(Number))==null?void 0:N.reverse();if(!P(C)){a(!1),m("Invalid Format. Enter Latitude, Longitude.");return}let h={type:l.POINT,properties:{id:new Date().getTime(),name:E,formatted_address:E},coordinates:C};t(h),S(D=>[...D,h]),p.current&&(p.current.value=""),a(!0),m("Point added successfully")}catch(E){a(!1)}finally{setTimeout(()=>{m(""),a(!0)},3e3)}},P=c=>Array.isArray(c)&&c.length===2&&!isNaN(c[0])&&!isNaN(c[1])&&typeof c[0]=="number"&&typeof c[1]=="number";return z("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[w("h1",{style:{marginBottom:"10px",fontWeight:"bold",fontSize:"1.25rem"},children:"Point"}),z("div",{style:{display:"flex",alignItems:"center"},children:[k.cloneElement(o,{ref:p,width:"300px"}),k.cloneElement(e,{onClick:A,type:"button",marginLeft:"10px"})]}),g&&z("div",{style:{fontWeight:"bold",color:i?"green":"red",marginTop:"10px",display:"flex",alignItems:"center"},children:[i?w("span",{style:{marginRight:"5px",fontSize:"1.25rem"},children:k.cloneElement(r,{boxSize:6})}):w("span",{style:{marginRight:"5px",fontSize:"1.25rem",color:"red"},children:k.cloneElement(d,{boxSize:4})}),g]}),u.length>0&&z("div",{style:{marginTop:"10px",paddingLeft:"15px"},children:[w("div",{style:{fontSize:"sm"},children:"Added Points:"}),w("ul",{style:{listStyleType:"none",padding:"0"},children:u.map(c=>z("li",{style:{display:"flex",alignItems:"center",marginBottom:"5px"},children:[k.cloneElement(n,{boxSize:6,marginRight:2,color:"teal"}),w("span",{style:{overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"300px"},children:c.properties.name})]},c.properties.id))})]})]})},ge=Ve;import J,{useState as W,useRef as je}from"react";import{Fragment as Ze,jsx as y,jsxs as O}from"react/jsx-runtime";var He=({addFeature:t,ButtonComponent:o,FileIcon:e,SuccessIcon:n,FailureIcon:r,DeleteIcon:d})=>{let[p,i]=W(!0),[a,g]=W(""),[m,u]=W([]),[S,A]=W([]),P=je(null),c=s=>{s.preventDefault()},F=s=>{s.preventDefault()},N=s=>{s.preventDefault();let x=Array.from(s.dataTransfer.files);u(x)},E=()=>{let s=Array.from(P.current.files);u(s)},C=()=>{try{m.forEach(s=>{let x=new FileReader;x.onabort=()=>h("File reading was aborted. Please try again."),x.onerror=()=>h("File reading has failed. Please try again."),x.onload=()=>{let b=x.result;if(b){let V=typeof b=="string"?b:new TextDecoder().decode(b);try{let L=JSON.parse(V);(Array.isArray(L.features)?L.features.map(R=>j(M({},R),{isGeojson:!0})):[j(M({},L),{isGeojson:!0})]).forEach(R=>{t([R])}),g("Geojson added successfully"),i(!0),A(R=>[...R,{name:s.name}]),u([])}catch(L){console.error(L),h("Upload failed. Invalid GeoJSON format.")}}else h("File reading result is null.")},x.readAsText(s)})}catch(s){console.error(s),h("File upload failed. Please try again.")}finally{setTimeout(()=>{g(""),i(!0)},2e3)}},h=s=>{g(s),i(!1)},D=()=>{u([])};return O("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",marginTop:"10px"},onDragEnter:c,onDragOver:F,onDrop:N,children:[y("h1",{style:{marginBottom:"10px",fontWeight:"bold",fontSize:"1.25rem"},children:"GeoJSON"}),O("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[O("div",{style:{border:"2px solid #519895",borderRadius:"4px",display:"flex",flexDirection:"column",alignItems:"center",padding:"10px",cursor:"pointer",marginLeft:"15px",width:"300px",height:"100px"},onClick:()=>P.current.click(),children:[y("input",{type:"file",ref:P,onChange:E,style:{display:"none"}}),y("div",{style:{display:"flex",alignItems:"center"},children:m.length>0?O("div",{style:{marginLeft:"10px",display:"flex",alignItems:"center"},children:[y("div",{style:{marginTop:"10px",overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"200px"},children:m[0].name}),y("div",{style:{color:"red",marginLeft:"10px",marginTop:"10px",cursor:"pointer"},onClick:D,children:J.cloneElement(d,{boxSize:6})})]}):y(Ze,{children:y("div",{children:"Drag 'n' drop GeoJSON file here, or click to select a file"})})})]}),J.cloneElement(o,{type:"button",marginLeft:"30px",style:{paddingLeft:"15px"},onClick:C})]}),a&&O("div",{style:{fontWeight:"bold",color:p?"green":"red",marginTop:"10px",display:"flex",alignItems:"center"},children:[p?y("span",{style:{marginRight:"5px",fontSize:"1.25rem"},children:J.cloneElement(n,{boxSize:6})}):y("span",{style:{marginRight:"5px",fontSize:"1.25rem",color:"red"},children:J.cloneElement(r,{boxSize:4})}),a]}),S.length>0&&O("div",{style:{marginTop:"10px",paddingLeft:"15px"},children:[y("div",{style:{fontSize:"sm"},children:"Added GeoJSONs:"}),y("ul",{style:{listStyleType:"none",padding:"0"},children:S.map((s,x)=>O("li",{style:{display:"flex",alignItems:"center"},children:[J.cloneElement(e,{boxSize:6,marginRight:2}),y("div",{style:{marginTop:"10px",overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"300px"},children:s.name})]},x))})]})]})},ye=He;import{jsx as xe,jsxs as qe}from"react/jsx-runtime";function Q({ButtonComponent:t,ModalComponent:o,addFeature:e,InputComponent:n,ButtonComponentModal:r,DeleteIcon:d,LocationIcon:p,FileIcon:i,SuccessIcon:a,FailureIcon:g}){let[m,u]=Ke(!1),S=()=>{u(!1)},A=()=>{u(!0)};return qe("div",{style:{display:"flex"},children:[he.cloneElement(o,{isOpen:m,onClose:S,nakshaImport:xe(ge,{addFeature:e,InputComponent:n,ButtonComponent:t,LocationIcon:p,SuccessIcon:a,FailureIcon:g}),geoJSONImport:xe(ye,{addFeature:e,ButtonComponent:t,DeleteIcon:d,FileIcon:i,SuccessIcon:a,FailureIcon:g})}),he.cloneElement(r,{onClick:A,type:"button"})]})}import{Fragment as at,jsx as f,jsxs as X}from"react/jsx-runtime";var $t=Ie.forwardRef(({defaultViewState:t,defaultDrawingMode:o,data:e,onDataChange:n,gmapAccessToken:r,isControlled:d,isReadOnly:p,isMultiple:i,isImport:a,isAutocomplete:g,gmapRegion:m,autoCompleteRegion:u,mapStyle:S,importInputComponent:A,importButtonComponent:P,autocompleteComponent:c,showTrace:F,traceButtonComponent:N,maxZoom:E,options:C,importModalComponent:h,isOpen:D,onClose:s,importButtonComponentModal:x,importDeleteIcon:b,importLocationIcon:V,importFileIcon:L,importSuccessIcon:$,importFailureIcon:R},ee)=>{let v=nt(null),[_,B]=ot(de,e),[te,ve]=rt(),oe=tt(()=>Qe(t),[t]),Te=()=>{v.current.state.map.data.forEach(function(G){v.current.state.map.data.remove(G)});let I=pe(_);if(I){I&&v.current.state.map.data.addGeoJson(I);let G=ce(I);G&&v.current.state.map.fitBounds(G),E&&google.maps.event.addListenerOnce(v.current.state.map,"idle",function(){let Re=v.current.state.map.getZoom();v.current.state.map.setZoom(Math.min(E,Re))})}};Se(()=>{te&&(n&&n(_),ee&&(ee.current={addFeature:U,replaceFeature:Ae}),Te())},[te,_]),Se(()=>{d&&JSON.stringify(_)!==JSON.stringify(e)&&B({action:T.REPLACE,data:e})},[e]);let U=I=>{B({action:T.ADD,data:I,isMultiple:i})},Ae=I=>{B({action:T.REPLACE,data:[I]})},ne=I=>{let G=le(I);U(G)},Pe=()=>{B({action:T.CLEAR})},Le=()=>ve(!0);return f(et,{googleMapsApiKey:r,region:m,libraries:g?Ee.AUTOCOMPLETE:Ee.DEFAULT,children:X(at,{children:[X("div",{style:{display:"flex"},children:[g&&f("div",{style:{width:"500px"},children:f(H,{InputComponent:c||f("input",{}),addFeature:U,gmapRegion:u!=null?u:m})}),f("div",{style:{flex:"1"}})," ",f(Q,{ButtonComponent:P||f("button",{children:"add"}),ModalComponent:h&&Ie.cloneElement(h,{isOpen:D,onClose:s}),InputComponent:A||f("input",{}),addFeature:U,ButtonComponentModal:x||f("button",{children:"add"}),DeleteIcon:b,LocationIcon:V,FileIcon:L,SuccessIcon:$,FailureIcon:R})]}),F&&f(K,{TraceButtonComponent:N||f("button",{children:"trace"}),onFeatureAdded:ne}),X($e,{id:"naksha-gmaps-draw",mapContainerStyle:S||{height:"100%",width:"100%"},zoom:oe.zoom,center:oe.center,options:ie,ref:v,onLoad:Le,children:[i&&f(Z,{onClick:Pe}),!p&&f(Xe,{options:M({controls:[l.POINT,l.POLYGON,l.LINESTRING],drawingMode:o||l.POLYGON,featureFactory:ne},C||{})})]})]})})});export{l as GMAP_FEATURE_TYPES,$t as NakshaGmapsDraw};
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ interface NakshaGmapsDrawProps {
|
|
|
18
18
|
isControlled?: boolean;
|
|
19
19
|
isReadOnly?: boolean;
|
|
20
20
|
isImport?: boolean;
|
|
21
|
-
geojsonImport?: boolean;
|
|
22
21
|
isMultiple?: boolean;
|
|
23
22
|
isAutocomplete?: boolean;
|
|
24
23
|
gmapRegion?: any;
|
|
@@ -31,6 +30,15 @@ interface NakshaGmapsDrawProps {
|
|
|
31
30
|
traceButtonComponent?: any;
|
|
32
31
|
maxZoom?: any;
|
|
33
32
|
options?: any;
|
|
33
|
+
importModalComponent?: any;
|
|
34
|
+
isOpen?: any;
|
|
35
|
+
onClose?: any;
|
|
36
|
+
importButtonComponentModal?: any;
|
|
37
|
+
importDeleteIcon?: any;
|
|
38
|
+
importLocationIcon?: any;
|
|
39
|
+
importFileIcon?: any;
|
|
40
|
+
importSuccessIcon?: any;
|
|
41
|
+
importFailureIcon?: any;
|
|
34
42
|
}
|
|
35
43
|
declare const NakshaGmapsDraw: React.ForwardRefExoticComponent<NakshaGmapsDrawProps & React.RefAttributes<unknown>>;
|
|
36
44
|
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
"use strict";var vo=Object.create;var Ee=Object.defineProperty;var So=Object.getOwnPropertyDescriptor;var xo=Object.getOwnPropertyNames;var ko=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty;var To=(e,r)=>()=>(e&&(r=e(e=0)),r);var Fr=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Io=(e,r)=>{for(var t in r)Ee(e,t,{get:r[t],enumerable:!0})},Lr=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of xo(r))!_o.call(e,a)&&a!==t&&Ee(e,a,{get:()=>r[a],enumerable:!(o=So(r,a))||o.enumerable});return e};var L=(e,r,t)=>(t=e!=null?vo(ko(e)):{},Lr(r||!e||!e.__esModule?Ee(t,"default",{value:e,enumerable:!0}):t,e)),wo=e=>Lr(Ee({},"__esModule",{value:!0}),e);var d=To(()=>{});var de=Fr((he,se)=>{d();var Oo=200,ct="__lodash_hash_undefined__",Ao=800,Bo=16,lt=9007199254740991,dt="[object Arguments]",Po="[object Array]",Mo="[object AsyncFunction]",Fo="[object Boolean]",Lo="[object Date]",zo="[object Error]",ut="[object Function]",jo="[object GeneratorFunction]",No="[object Map]",$o="[object Number]",Do="[object Null]",pt="[object Object]",Wo="[object Proxy]",Vo="[object RegExp]",Go="[object Set]",Ho="[object String]",Uo="[object Undefined]",Yo="[object WeakMap]",Jo="[object ArrayBuffer]",Xo="[object DataView]",qo="[object Float32Array]",Ko="[object Float64Array]",Qo="[object Int8Array]",Zo="[object Int16Array]",en="[object Int32Array]",rn="[object Uint8Array]",tn="[object Uint8ClampedArray]",on="[object Uint16Array]",nn="[object Uint32Array]",an=/[\\^$.*+?()[\]{}|]/g,sn=/^\[object .+?Constructor\]$/,cn=/^(?:0|[1-9]\d*)$/,_={};_[qo]=_[Ko]=_[Qo]=_[Zo]=_[en]=_[rn]=_[tn]=_[on]=_[nn]=!0;_[dt]=_[Po]=_[Jo]=_[Fo]=_[Xo]=_[Lo]=_[zo]=_[ut]=_[No]=_[$o]=_[pt]=_[Vo]=_[Go]=_[Ho]=_[Yo]=!1;var ft=typeof global=="object"&&global&&global.Object===Object&&global,ln=typeof self=="object"&&self&&self.Object===Object&&self,ve=ft||ln||Function("return this")(),mt=typeof he=="object"&&he&&!he.nodeType&&he,be=mt&&typeof se=="object"&&se&&!se.nodeType&&se,gt=be&&be.exports===mt,rr=gt&&ft.process,Zr=function(){try{var e=be&&be.require&&be.require("util").types;return e||rr&&rr.binding&&rr.binding("util")}catch{}}(),et=Zr&&Zr.isTypedArray;function dn(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}function un(e,r){for(var t=-1,o=Array(e);++t<e;)o[t]=r(t);return o}function pn(e){return function(r){return e(r)}}function fn(e,r){return e==null?void 0:e[r]}function mn(e,r){return function(t){return e(r(t))}}var gn=Array.prototype,hn=Function.prototype,Me=Object.prototype,tr=ve["__core-js_shared__"],Fe=hn.toString,J=Me.hasOwnProperty,rt=function(){var e=/[^.]+$/.exec(tr&&tr.keys&&tr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ht=Me.toString,bn=Fe.call(Object),yn=RegExp("^"+Fe.call(J).replace(an,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=gt?ve.Buffer:void 0,tt=ve.Symbol,ot=ve.Uint8Array,nt=Be?Be.allocUnsafe:void 0,bt=mn(Object.getPrototypeOf,Object),at=Object.create,vn=Me.propertyIsEnumerable,Sn=gn.splice,te=tt?tt.toStringTag:void 0,Pe=function(){try{var e=cr(Object,"defineProperty");return e({},"",{}),e}catch{}}(),xn=Be?Be.isBuffer:void 0,it=Math.max,kn=Date.now,yt=cr(ve,"Map"),ye=cr(Object,"create"),_n=function(){function e(){}return function(r){if(!ne(r))return{};if(at)return at(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();function oe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function Tn(){this.__data__=ye?ye(null):{},this.size=0}function In(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}function wn(e){var r=this.__data__;if(ye){var t=r[e];return t===ct?void 0:t}return J.call(r,e)?r[e]:void 0}function Rn(e){var r=this.__data__;return ye?r[e]!==void 0:J.call(r,e)}function Cn(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=ye&&r===void 0?ct:r,this}oe.prototype.clear=Tn;oe.prototype.delete=In;oe.prototype.get=wn;oe.prototype.has=Rn;oe.prototype.set=Cn;function X(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function En(){this.__data__=[],this.size=0}function On(e){var r=this.__data__,t=Le(r,e);if(t<0)return!1;var o=r.length-1;return t==o?r.pop():Sn.call(r,t,1),--this.size,!0}function An(e){var r=this.__data__,t=Le(r,e);return t<0?void 0:r[t][1]}function Bn(e){return Le(this.__data__,e)>-1}function Pn(e,r){var t=this.__data__,o=Le(t,e);return o<0?(++this.size,t.push([e,r])):t[o][1]=r,this}X.prototype.clear=En;X.prototype.delete=On;X.prototype.get=An;X.prototype.has=Bn;X.prototype.set=Pn;function ce(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}function Mn(){this.size=0,this.__data__={hash:new oe,map:new(yt||X),string:new oe}}function Fn(e){var r=je(this,e).delete(e);return this.size-=r?1:0,r}function Ln(e){return je(this,e).get(e)}function zn(e){return je(this,e).has(e)}function jn(e,r){var t=je(this,e),o=t.size;return t.set(e,r),this.size+=t.size==o?0:1,this}ce.prototype.clear=Mn;ce.prototype.delete=Fn;ce.prototype.get=Ln;ce.prototype.has=zn;ce.prototype.set=jn;function le(e){var r=this.__data__=new X(e);this.size=r.size}function Nn(){this.__data__=new X,this.size=0}function $n(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Dn(e){return this.__data__.get(e)}function Wn(e){return this.__data__.has(e)}function Vn(e,r){var t=this.__data__;if(t instanceof X){var o=t.__data__;if(!yt||o.length<Oo-1)return o.push([e,r]),this.size=++t.size,this;t=this.__data__=new ce(o)}return t.set(e,r),this.size=t.size,this}le.prototype.clear=Nn;le.prototype.delete=$n;le.prototype.get=Dn;le.prototype.has=Wn;le.prototype.set=Vn;function Gn(e,r){var t=ir(e),o=!t&&ar(e),a=!t&&!o&&kt(e),i=!t&&!o&&!a&&Tt(e),c=t||o||a||i,s=c?un(e.length,String):[],l=s.length;for(var p in e)(r||J.call(e,p))&&!(c&&(p=="length"||a&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||St(p,l)))&&s.push(p);return s}function or(e,r,t){(t!==void 0&&!Ne(e[r],t)||t===void 0&&!(r in e))&&sr(e,r,t)}function Hn(e,r,t){var o=e[r];(!(J.call(e,r)&&Ne(o,t))||t===void 0&&!(r in e))&&sr(e,r,t)}function Le(e,r){for(var t=e.length;t--;)if(Ne(e[t][0],r))return t;return-1}function sr(e,r,t){r=="__proto__"&&Pe?Pe(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var Un=aa();function ze(e){return e==null?e===void 0?Uo:Do:te&&te in Object(e)?ia(e):pa(e)}function st(e){return Se(e)&&ze(e)==dt}function Yn(e){if(!ne(e)||da(e))return!1;var r=dr(e)?yn:sn;return r.test(ha(e))}function Jn(e){return Se(e)&&_t(e.length)&&!!_[ze(e)]}function Xn(e){if(!ne(e))return ua(e);var r=xt(e),t=[];for(var o in e)o=="constructor"&&(r||!J.call(e,o))||t.push(o);return t}function vt(e,r,t,o,a){e!==r&&Un(r,function(i,c){if(a||(a=new le),ne(i))qn(e,r,c,t,vt,o,a);else{var s=o?o(nr(e,c),i,c+"",e,r,a):void 0;s===void 0&&(s=i),or(e,c,s)}},It)}function qn(e,r,t,o,a,i,c){var s=nr(e,t),l=nr(r,t),p=c.get(l);if(p){or(e,t,p);return}var u=i?i(s,l,t+"",e,r,c):void 0,S=u===void 0;if(S){var f=ir(l),m=!f&&kt(l),R=!f&&!m&&Tt(l);u=l,f||m||R?ir(s)?u=s:ba(s)?u=ta(s):m?(S=!1,u=Zn(l,!0)):R?(S=!1,u=ra(l,!0)):u=[]:ya(l)||ar(l)?(u=s,ar(s)?u=va(s):(!ne(s)||dr(s))&&(u=sa(l))):S=!1}S&&(c.set(l,u),a(u,l,o,i,c),c.delete(l)),or(e,t,u)}function Kn(e,r){return ma(fa(e,r,wt),e+"")}var Qn=Pe?function(e,r){return Pe(e,"toString",{configurable:!0,enumerable:!1,value:xa(r),writable:!0})}:wt;function Zn(e,r){if(r)return e.slice();var t=e.length,o=nt?nt(t):new e.constructor(t);return e.copy(o),o}function ea(e){var r=new e.constructor(e.byteLength);return new ot(r).set(new ot(e)),r}function ra(e,r){var t=r?ea(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function ta(e,r){var t=-1,o=e.length;for(r||(r=Array(o));++t<o;)r[t]=e[t];return r}function oa(e,r,t,o){var a=!t;t||(t={});for(var i=-1,c=r.length;++i<c;){var s=r[i],l=o?o(t[s],e[s],s,t,e):void 0;l===void 0&&(l=e[s]),a?sr(t,s,l):Hn(t,s,l)}return t}function na(e){return Kn(function(r,t){var o=-1,a=t.length,i=a>1?t[a-1]:void 0,c=a>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,c&&ca(t[0],t[1],c)&&(i=a<3?void 0:i,a=1),r=Object(r);++o<a;){var s=t[o];s&&e(r,s,o,i)}return r})}function aa(e){return function(r,t,o){for(var a=-1,i=Object(r),c=o(r),s=c.length;s--;){var l=c[e?s:++a];if(t(i[l],l,i)===!1)break}return r}}function je(e,r){var t=e.__data__;return la(r)?t[typeof r=="string"?"string":"hash"]:t.map}function cr(e,r){var t=fn(e,r);return Yn(t)?t:void 0}function ia(e){var r=J.call(e,te),t=e[te];try{e[te]=void 0;var o=!0}catch{}var a=ht.call(e);return o&&(r?e[te]=t:delete e[te]),a}function sa(e){return typeof e.constructor=="function"&&!xt(e)?_n(bt(e)):{}}function St(e,r){var t=typeof e;return r=r==null?lt:r,!!r&&(t=="number"||t!="symbol"&&cn.test(e))&&e>-1&&e%1==0&&e<r}function ca(e,r,t){if(!ne(t))return!1;var o=typeof r;return(o=="number"?lr(t)&&St(r,t.length):o=="string"&&r in t)?Ne(t[r],e):!1}function la(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function da(e){return!!rt&&rt in e}function xt(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Me;return e===t}function ua(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}function pa(e){return ht.call(e)}function fa(e,r,t){return r=it(r===void 0?e.length-1:r,0),function(){for(var o=arguments,a=-1,i=it(o.length-r,0),c=Array(i);++a<i;)c[a]=o[r+a];a=-1;for(var s=Array(r+1);++a<r;)s[a]=o[a];return s[r]=t(c),dn(e,this,s)}}function nr(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}var ma=ga(Qn);function ga(e){var r=0,t=0;return function(){var o=kn(),a=Bo-(o-t);if(t=o,a>0){if(++r>=Ao)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}function ha(e){if(e!=null){try{return Fe.call(e)}catch{}try{return e+""}catch{}}return""}function Ne(e,r){return e===r||e!==e&&r!==r}var ar=st(function(){return arguments}())?st:function(e){return Se(e)&&J.call(e,"callee")&&!vn.call(e,"callee")},ir=Array.isArray;function lr(e){return e!=null&&_t(e.length)&&!dr(e)}function ba(e){return Se(e)&&lr(e)}var kt=xn||ka;function dr(e){if(!ne(e))return!1;var r=ze(e);return r==ut||r==jo||r==Mo||r==Wo}function _t(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=lt}function ne(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function Se(e){return e!=null&&typeof e=="object"}function ya(e){if(!Se(e)||ze(e)!=pt)return!1;var r=bt(e);if(r===null)return!0;var t=J.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Fe.call(t)==bn}var Tt=et?pn(et):Jn;function va(e){return oa(e,It(e))}function It(e){return lr(e)?Gn(e,!0):Xn(e)}var Sa=na(function(e,r,t,o){vt(e,r,t,o)});function xa(e){return function(){return e}}function wt(e){return e}function ka(){return!1}se.exports=Sa});var Ut=Fr((Bs,Ht)=>{d();var bi=typeof Element<"u",yi=typeof Map=="function",vi=typeof Set=="function",Si=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ye(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var t,o,a;if(Array.isArray(e)){if(t=e.length,t!=r.length)return!1;for(o=t;o--!==0;)if(!Ye(e[o],r[o]))return!1;return!0}var i;if(yi&&e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!r.has(o.value[0]))return!1;for(i=e.entries();!(o=i.next()).done;)if(!Ye(o.value[1],r.get(o.value[0])))return!1;return!0}if(vi&&e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!r.has(o.value[0]))return!1;return!0}if(Si&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(t=e.length,t!=r.length)return!1;for(o=t;o--!==0;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof r.valueOf=="function")return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof r.toString=="function")return e.toString()===r.toString();if(a=Object.keys(e),t=a.length,t!==Object.keys(r).length)return!1;for(o=t;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;if(bi&&e instanceof Element)return!1;for(o=t;o--!==0;)if(!((a[o]==="_owner"||a[o]==="__v"||a[o]==="__o")&&e.$$typeof)&&!Ye(e[a[o]],r[a[o]]))return!1;return!0}return e!==e&&r!==r}Ht.exports=function(r,t){try{return Ye(r,t)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}}});var Fi={};Io(Fi,{GMAP_FEATURE_TYPES:()=>O,NakshaGmapsDraw:()=>Mi});module.exports=wo(Fi);d();var Ce=require("@biodiv-platform/naksha-commons"),io=require("@chakra-ui/icons"),E=require("@chakra-ui/react"),pe=require("@react-google-maps/api"),P=L(require("react")),U=require("@chakra-ui/react");d();var Hr=require("@biodiv-platform/naksha-commons"),Ur=require("@react-google-maps/api"),Yr=require("react");d();var $r=L(require("@turf/bbox"));d();var O={POINT:"Point",POLYGON:"Polygon",LINESTRING:"LineString",RECTANGLE:"Rectangle",RAW:"Raw",NONE:null},zr={mapTypeControlOptions:{position:10}},jr="Invalid Format. Enter Latitude, Longitude.",Nr="Point added successfully";var Dr=e=>({type:O.POINT,properties:{id:new Date().getTime(),name:e.name,formatted_address:e.formatted_address},coordinates:Object.values(e.geometry.location.toJSON()).reverse()}),Wr=e=>{let r=new Date().getTime();switch(e.getType()){case O.POINT:return{type:O.POINT,properties:{id:r},coordinates:Object.values(e.get().toJSON()).reverse()};case O.POLYGON:{let t=[],o=a=>t.push([a.lng(),a.lat()]);return e.forEachLatLng(o),t.push(t[0]),{type:O.POLYGON,properties:{id:r},coordinates:[t]}}case O.RAW:{let t=e.data;return t.push(t[0]),{type:O.POLYGON,properties:{id:r},coordinates:[t]}}case O.LINESTRING:{let t=[],o=a=>t.push([a.lng(),a.lat()]);return e.forEachLatLng(o),{type:O.LINESTRING,properties:{id:r},coordinates:t}}default:return null}},Vr=e=>{let r=(e||[]).filter(o=>o);return r.length===0?!1:{type:"FeatureCollection",features:r.map(o=>{if(Array.isArray(o)&&o.length>0&&o[0].isGeojson){let a=o[0];return{type:"Feature",properties:a.properties||{},geometry:a.geometry||null}}else return{type:"Feature",properties:{},geometry:o}})}},Gr=e=>{let r=(0,$r.default)(e);return{east:r[2],north:r[3],south:r[1],west:r[0]}};var Ro=require("react/jsx-runtime");function Qe({InputComponent:e,addFeature:r,gmapRegion:t}){let[o,a]=(0,Yr.useState)();return(0,Ro.jsx)(Ur.Autocomplete,{onLoad:s=>{a(s)},fields:Hr.GMAPS_AUTOCOMPLETE_FIELDS,onPlaceChanged:()=>{let s=Dr(o==null?void 0:o.getPlace());r(s)},options:t?{componentRestrictions:{country:t}}:{},children:e})}d();var Oe=require("react/jsx-runtime"),Co={background:"white",position:"absolute",top:"5px",left:"106px",padding:"0.4rem",borderRadius:"0.15rem",outline:0,boxShadow:"rgba(0, 0, 0, 0.3) 0px 1px 4px -1px"};function Ze({onClick:e}){return(0,Oe.jsx)("button",{type:"button",title:"Clear",onClick:e,style:Co,children:(0,Oe.jsx)("svg",{viewBox:"0 0 24 24",width:"12",height:"12",children:(0,Oe.jsx)("g",{fill:"#E53E3E",children:(0,Oe.jsx)("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})})})}d();var ue=require("@chakra-ui/icons"),C=require("@chakra-ui/react"),ae=L(require("react")),eo=require("react-dropzone");d();d();d();d();d();d();d();d();var Jr=require("@emotion/react"),Xr=require("react");function qr(){let e=(0,Xr.useContext)(Jr.ThemeContext);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}d();d();var Ae=require("react"),er=(0,Ae.createContext)({});er.displayName="ColorModeContext";function ge(){let e=(0,Ae.useContext)(er);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function Kr(){let e=ge(),r=qr();return{...e,theme:r}}d();d();var Qr=(...e)=>e.filter(Boolean).join(" ");function z(e){let r=typeof e;return e!=null&&(r==="object"||r==="function")&&!Array.isArray(e)}function V(e,...r){return Eo(e)?e(...r):e}var Eo=e=>typeof e=="function";var ni=L(de(),1);var ke=L(de(),1),zt=L(de(),1);var Ve=L(de(),1),_a=e=>/!(important)?$/.test(e),Rt=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Ta=(e,r)=>t=>{let o=String(r),a=_a(o),i=Rt(o),c=e?`${e}.${i}`:i,s=z(t.__cssMap)&&c in t.__cssMap?t.__cssMap[c].varRef:r;return s=Rt(s),a?`${s} !important`:s};function br(e){let{scale:r,transform:t,compose:o}=e;return(i,c)=>{var s;let l=Ta(r,i)(c),p=(s=t==null?void 0:t(l,c))!=null?s:l;return o&&(p=o(p,c)),p}}var $e=(...e)=>r=>e.reduce((t,o)=>o(t),r);function j(e,r){return t=>{let o={property:t,scale:e};return o.transform=br({scale:e,transform:r}),o}}var Ia=({rtl:e,ltr:r})=>t=>t.direction==="rtl"?e:r;function wa(e){let{property:r,scale:t,transform:o}=e;return{scale:t,property:Ia(r),transform:t?br({scale:t,compose:o}):o}}var Pt=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Ra(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Pt].join(" ")}function Ca(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Pt].join(" ")}var Ea={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Oa={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Aa(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var Ba={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},pr={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Pa=new Set(Object.values(pr)),fr=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Ma=e=>e.trim();function Fa(e,r){if(e==null||fr.has(e))return e;if(!(mr(e)||fr.has(e)))return`url('${e}')`;let a=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=a==null?void 0:a[1],c=a==null?void 0:a[2];if(!i||!c)return e;let s=i.includes("-gradient")?i:`${i}-gradient`,[l,...p]=c.split(",").map(Ma).filter(Boolean);if((p==null?void 0:p.length)===0)return e;let u=l in pr?pr[l]:l;p.unshift(u);let S=p.map(f=>{if(Pa.has(f))return f;let m=f.indexOf(" "),[R,w]=m!==-1?[f.substr(0,m),f.substr(m+1)]:[f],x=mr(w)?w:w&&w.split(" "),y=`colors.${R}`,k=y in r.__cssMap?r.__cssMap[y].varRef:R;return x?[k,...Array.isArray(x)?x:[x]].join(" "):k});return`${s}(${S.join(", ")})`}var mr=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),La=(e,r)=>Fa(e,r!=null?r:{});function za(e){return/^var\(--.+\)$/.test(e)}var ja=e=>{let r=parseFloat(e.toString()),t=e.toString().replace(String(r),"");return{unitless:!t,value:r,unit:t}},G=e=>r=>`${e}(${r})`,g={filter(e){return e!=="auto"?e:Ea},backdropFilter(e){return e!=="auto"?e:Oa},ring(e){return Aa(g.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Ra():e==="auto-gpu"?Ca():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;let{unitless:r}=ja(e);return r||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,r){let t={left:"right",right:"left"};return r.direction==="rtl"?t[e]:e},degree(e){if(za(e)||e==null)return e;let r=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||r?`${e}deg`:e},gradient:La,blur:G("blur"),opacity:G("opacity"),brightness:G("brightness"),contrast:G("contrast"),dropShadow:G("drop-shadow"),grayscale:G("grayscale"),hueRotate:e=>G("hue-rotate")(g.degree(e)),invert:G("invert"),saturate:G("saturate"),sepia:G("sepia"),bgImage(e){return e==null||mr(e)||fr.has(e)?e:`url(${e})`},outline(e){let r=String(e)==="0"||String(e)==="none";return e!==null&&r?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var r;let{space:t,divide:o}=(r=Ba[e])!=null?r:{},a={flexDirection:e};return t&&(a[t]=1),o&&(a[o]=1),a}},n={borderWidths:j("borderWidths"),borderStyles:j("borderStyles"),colors:j("colors"),borders:j("borders"),gradients:j("gradients",g.gradient),radii:j("radii",g.px),space:j("space",$e(g.vh,g.px)),spaceT:j("space",$e(g.vh,g.px)),degreeT(e){return{property:e,transform:g.degree}},prop(e,r,t){return{property:e,scale:r,...r&&{transform:br({scale:r,transform:t})}}},propT(e,r){return{property:e,transform:r}},sizes:j("sizes",$e(g.vh,g.px)),sizesT:j("sizes",$e(g.vh,g.fraction)),shadows:j("shadows"),logical:wa,blur:j("blur",g.blur)},De={background:n.colors("background"),backgroundColor:n.colors("backgroundColor"),backgroundImage:n.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:g.bgClip},bgSize:n.prop("backgroundSize"),bgPosition:n.prop("backgroundPosition"),bg:n.colors("background"),bgColor:n.colors("backgroundColor"),bgPos:n.prop("backgroundPosition"),bgRepeat:n.prop("backgroundRepeat"),bgAttachment:n.prop("backgroundAttachment"),bgGradient:n.gradients("backgroundImage"),bgClip:{transform:g.bgClip}};Object.assign(De,{bgImage:De.backgroundImage,bgImg:De.backgroundImage});var v={border:n.borders("border"),borderWidth:n.borderWidths("borderWidth"),borderStyle:n.borderStyles("borderStyle"),borderColor:n.colors("borderColor"),borderRadius:n.radii("borderRadius"),borderTop:n.borders("borderTop"),borderBlockStart:n.borders("borderBlockStart"),borderTopLeftRadius:n.radii("borderTopLeftRadius"),borderStartStartRadius:n.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:n.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:n.radii("borderTopRightRadius"),borderStartEndRadius:n.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:n.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:n.borders("borderRight"),borderInlineEnd:n.borders("borderInlineEnd"),borderBottom:n.borders("borderBottom"),borderBlockEnd:n.borders("borderBlockEnd"),borderBottomLeftRadius:n.radii("borderBottomLeftRadius"),borderBottomRightRadius:n.radii("borderBottomRightRadius"),borderLeft:n.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:n.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:n.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:n.borders(["borderLeft","borderRight"]),borderInline:n.borders("borderInline"),borderY:n.borders(["borderTop","borderBottom"]),borderBlock:n.borders("borderBlock"),borderTopWidth:n.borderWidths("borderTopWidth"),borderBlockStartWidth:n.borderWidths("borderBlockStartWidth"),borderTopColor:n.colors("borderTopColor"),borderBlockStartColor:n.colors("borderBlockStartColor"),borderTopStyle:n.borderStyles("borderTopStyle"),borderBlockStartStyle:n.borderStyles("borderBlockStartStyle"),borderBottomWidth:n.borderWidths("borderBottomWidth"),borderBlockEndWidth:n.borderWidths("borderBlockEndWidth"),borderBottomColor:n.colors("borderBottomColor"),borderBlockEndColor:n.colors("borderBlockEndColor"),borderBottomStyle:n.borderStyles("borderBottomStyle"),borderBlockEndStyle:n.borderStyles("borderBlockEndStyle"),borderLeftWidth:n.borderWidths("borderLeftWidth"),borderInlineStartWidth:n.borderWidths("borderInlineStartWidth"),borderLeftColor:n.colors("borderLeftColor"),borderInlineStartColor:n.colors("borderInlineStartColor"),borderLeftStyle:n.borderStyles("borderLeftStyle"),borderInlineStartStyle:n.borderStyles("borderInlineStartStyle"),borderRightWidth:n.borderWidths("borderRightWidth"),borderInlineEndWidth:n.borderWidths("borderInlineEndWidth"),borderRightColor:n.colors("borderRightColor"),borderInlineEndColor:n.colors("borderInlineEndColor"),borderRightStyle:n.borderStyles("borderRightStyle"),borderInlineEndStyle:n.borderStyles("borderInlineEndStyle"),borderTopRadius:n.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:n.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:n.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:n.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(v,{rounded:v.borderRadius,roundedTop:v.borderTopRadius,roundedTopLeft:v.borderTopLeftRadius,roundedTopRight:v.borderTopRightRadius,roundedTopStart:v.borderStartStartRadius,roundedTopEnd:v.borderStartEndRadius,roundedBottom:v.borderBottomRadius,roundedBottomLeft:v.borderBottomLeftRadius,roundedBottomRight:v.borderBottomRightRadius,roundedBottomStart:v.borderEndStartRadius,roundedBottomEnd:v.borderEndEndRadius,roundedLeft:v.borderLeftRadius,roundedRight:v.borderRightRadius,roundedStart:v.borderInlineStartRadius,roundedEnd:v.borderInlineEndRadius,borderStart:v.borderInlineStart,borderEnd:v.borderInlineEnd,borderTopStartRadius:v.borderStartStartRadius,borderTopEndRadius:v.borderStartEndRadius,borderBottomStartRadius:v.borderEndStartRadius,borderBottomEndRadius:v.borderEndEndRadius,borderStartRadius:v.borderInlineStartRadius,borderEndRadius:v.borderInlineEndRadius,borderStartWidth:v.borderInlineStartWidth,borderEndWidth:v.borderInlineEndWidth,borderStartColor:v.borderInlineStartColor,borderEndColor:v.borderInlineEndColor,borderStartStyle:v.borderInlineStartStyle,borderEndStyle:v.borderInlineEndStyle});var Na={color:n.colors("color"),textColor:n.colors("color"),fill:n.colors("fill"),stroke:n.colors("stroke")},gr={boxShadow:n.shadows("boxShadow"),mixBlendMode:!0,blendMode:n.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:n.prop("backgroundBlendMode"),opacity:!0};Object.assign(gr,{shadow:gr.boxShadow});var $a={filter:{transform:g.filter},blur:n.blur("--chakra-blur"),brightness:n.propT("--chakra-brightness",g.brightness),contrast:n.propT("--chakra-contrast",g.contrast),hueRotate:n.propT("--chakra-hue-rotate",g.hueRotate),invert:n.propT("--chakra-invert",g.invert),saturate:n.propT("--chakra-saturate",g.saturate),dropShadow:n.propT("--chakra-drop-shadow",g.dropShadow),backdropFilter:{transform:g.backdropFilter},backdropBlur:n.blur("--chakra-backdrop-blur"),backdropBrightness:n.propT("--chakra-backdrop-brightness",g.brightness),backdropContrast:n.propT("--chakra-backdrop-contrast",g.contrast),backdropHueRotate:n.propT("--chakra-backdrop-hue-rotate",g.hueRotate),backdropInvert:n.propT("--chakra-backdrop-invert",g.invert),backdropSaturate:n.propT("--chakra-backdrop-saturate",g.saturate)},We={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:g.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:n.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:n.space("gap"),rowGap:n.space("rowGap"),columnGap:n.space("columnGap")};Object.assign(We,{flexDir:We.flexDirection});var Mt={gridGap:n.space("gridGap"),gridColumnGap:n.space("gridColumnGap"),gridRowGap:n.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},Da={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:g.outline},outlineOffset:!0,outlineColor:n.colors("outlineColor")},N={width:n.sizesT("width"),inlineSize:n.sizesT("inlineSize"),height:n.sizes("height"),blockSize:n.sizes("blockSize"),boxSize:n.sizes(["width","height"]),minWidth:n.sizes("minWidth"),minInlineSize:n.sizes("minInlineSize"),minHeight:n.sizes("minHeight"),minBlockSize:n.sizes("minBlockSize"),maxWidth:n.sizes("maxWidth"),maxInlineSize:n.sizes("maxInlineSize"),maxHeight:n.sizes("maxHeight"),maxBlockSize:n.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,r)=>{var t,o,a;return{[`@media screen and (min-width: ${(a=(o=(t=r.__breakpoints)==null?void 0:t.get(e))==null?void 0:o.minW)!=null?a:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,r)=>{var t,o,a;return{[`@media screen and (max-width: ${(a=(o=(t=r.__breakpoints)==null?void 0:t.get(e))==null?void 0:o._minW)!=null?a:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:n.propT("float",g.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(N,{w:N.width,h:N.height,minW:N.minWidth,maxW:N.maxWidth,minH:N.minHeight,maxH:N.maxHeight,overscroll:N.overscrollBehavior,overscrollX:N.overscrollBehaviorX,overscrollY:N.overscrollBehaviorY});var Wa={listStyleType:!0,listStylePosition:!0,listStylePos:n.prop("listStylePosition"),listStyleImage:!0,listStyleImg:n.prop("listStyleImage")};function Va(e,r,t,o){let a=typeof r=="string"?r.split("."):[r];for(o=0;o<a.length&&e;o+=1)e=e[a[o]];return e===void 0?t:e}var Ga=e=>{let r=new WeakMap;return(o,a,i,c)=>{if(typeof o>"u")return e(o,a,i);r.has(o)||r.set(o,new Map);let s=r.get(o);if(s.has(a))return s.get(a);let l=e(o,a,i,c);return s.set(a,l),l}},Ha=Ga(Va),Ua={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Ya={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},ur=(e,r,t)=>{let o={},a=Ha(e,r,{});for(let i in a)i in t&&t[i]!=null||(o[i]=a[i]);return o},Ja={srOnly:{transform(e){return e===!0?Ua:e==="focusable"?Ya:{}}},layerStyle:{processResult:!0,transform:(e,r,t)=>ur(r,`layerStyles.${e}`,t)},textStyle:{processResult:!0,transform:(e,r,t)=>ur(r,`textStyles.${e}`,t)},apply:{processResult:!0,transform:(e,r,t)=>ur(r,e,t)}},_e={position:!0,pos:n.prop("position"),zIndex:n.prop("zIndex","zIndices"),inset:n.spaceT("inset"),insetX:n.spaceT(["left","right"]),insetInline:n.spaceT("insetInline"),insetY:n.spaceT(["top","bottom"]),insetBlock:n.spaceT("insetBlock"),top:n.spaceT("top"),insetBlockStart:n.spaceT("insetBlockStart"),bottom:n.spaceT("bottom"),insetBlockEnd:n.spaceT("insetBlockEnd"),left:n.spaceT("left"),insetInlineStart:n.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:n.spaceT("right"),insetInlineEnd:n.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(_e,{insetStart:_e.insetInlineStart,insetEnd:_e.insetInlineEnd});var Xa={ring:{transform:g.ring},ringColor:n.colors("--chakra-ring-color"),ringOffset:n.prop("--chakra-ring-offset-width"),ringOffsetColor:n.colors("--chakra-ring-offset-color"),ringInset:n.prop("--chakra-ring-inset")},T={margin:n.spaceT("margin"),marginTop:n.spaceT("marginTop"),marginBlockStart:n.spaceT("marginBlockStart"),marginRight:n.spaceT("marginRight"),marginInlineEnd:n.spaceT("marginInlineEnd"),marginBottom:n.spaceT("marginBottom"),marginBlockEnd:n.spaceT("marginBlockEnd"),marginLeft:n.spaceT("marginLeft"),marginInlineStart:n.spaceT("marginInlineStart"),marginX:n.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:n.spaceT("marginInline"),marginY:n.spaceT(["marginTop","marginBottom"]),marginBlock:n.spaceT("marginBlock"),padding:n.space("padding"),paddingTop:n.space("paddingTop"),paddingBlockStart:n.space("paddingBlockStart"),paddingRight:n.space("paddingRight"),paddingBottom:n.space("paddingBottom"),paddingBlockEnd:n.space("paddingBlockEnd"),paddingLeft:n.space("paddingLeft"),paddingInlineStart:n.space("paddingInlineStart"),paddingInlineEnd:n.space("paddingInlineEnd"),paddingX:n.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:n.space("paddingInline"),paddingY:n.space(["paddingTop","paddingBottom"]),paddingBlock:n.space("paddingBlock")};Object.assign(T,{m:T.margin,mt:T.marginTop,mr:T.marginRight,me:T.marginInlineEnd,marginEnd:T.marginInlineEnd,mb:T.marginBottom,ml:T.marginLeft,ms:T.marginInlineStart,marginStart:T.marginInlineStart,mx:T.marginX,my:T.marginY,p:T.padding,pt:T.paddingTop,py:T.paddingY,px:T.paddingX,pb:T.paddingBottom,pl:T.paddingLeft,ps:T.paddingInlineStart,paddingStart:T.paddingInlineStart,pr:T.paddingRight,pe:T.paddingInlineEnd,paddingEnd:T.paddingInlineEnd});var qa={textDecorationColor:n.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:n.shadows("textShadow")},Ka={clipPath:!0,transform:n.propT("transform",g.transform),transformOrigin:!0,translateX:n.spaceT("--chakra-translate-x"),translateY:n.spaceT("--chakra-translate-y"),skewX:n.degreeT("--chakra-skew-x"),skewY:n.degreeT("--chakra-skew-y"),scaleX:n.prop("--chakra-scale-x"),scaleY:n.prop("--chakra-scale-y"),scale:n.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:n.degreeT("--chakra-rotate")},Qa={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:n.prop("transitionDuration","transition.duration"),transitionProperty:n.prop("transitionProperty","transition.property"),transitionTimingFunction:n.prop("transitionTimingFunction","transition.easing")},Za={fontFamily:n.prop("fontFamily","fonts"),fontSize:n.prop("fontSize","fontSizes",g.px),fontWeight:n.prop("fontWeight","fontWeights"),lineHeight:n.prop("lineHeight","lineHeights"),letterSpacing:n.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},ei={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:n.spaceT("scrollMargin"),scrollMarginTop:n.spaceT("scrollMarginTop"),scrollMarginBottom:n.spaceT("scrollMarginBottom"),scrollMarginLeft:n.spaceT("scrollMarginLeft"),scrollMarginRight:n.spaceT("scrollMarginRight"),scrollMarginX:n.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:n.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:n.spaceT("scrollPadding"),scrollPaddingTop:n.spaceT("scrollPaddingTop"),scrollPaddingBottom:n.spaceT("scrollPaddingBottom"),scrollPaddingLeft:n.spaceT("scrollPaddingLeft"),scrollPaddingRight:n.spaceT("scrollPaddingRight"),scrollPaddingX:n.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:n.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function Ft(e){return z(e)&&e.reference?e.reference:String(e)}var Ge=(e,...r)=>r.map(Ft).join(` ${e} `).replace(/calc/g,""),Ct=(...e)=>`calc(${Ge("+",...e)})`,Et=(...e)=>`calc(${Ge("-",...e)})`,hr=(...e)=>`calc(${Ge("*",...e)})`,Ot=(...e)=>`calc(${Ge("/",...e)})`,At=e=>{let r=Ft(e);return r!=null&&!Number.isNaN(parseFloat(r))?String(r).startsWith("-")?String(r).slice(1):`-${r}`:hr(r,-1)},xe=Object.assign(e=>({add:(...r)=>xe(Ct(e,...r)),subtract:(...r)=>xe(Et(e,...r)),multiply:(...r)=>xe(hr(e,...r)),divide:(...r)=>xe(Ot(e,...r)),negate:()=>xe(At(e)),toString:()=>e.toString()}),{add:Ct,subtract:Et,multiply:hr,divide:Ot,negate:At});function ri(e){let r=parseFloat(e.toString()),t=e.toString().replace(String(r),"");return{unitless:!t,value:r,unit:t}}function Bt(e){if(e==null)return e;let{unitless:r}=ri(e);return r||typeof e=="number"?`${e}px`:e}function ti(e,r){let t=["@media screen"];return e&&t.push("and",`(min-width: ${Bt(e)})`),r&&t.push("and",`(max-width: ${Bt(r)})`),t.join(" ")}var A={hover:(e,r)=>`${e}:hover ${r}, ${e}[data-hover] ${r}`,focus:(e,r)=>`${e}:focus ${r}, ${e}[data-focus] ${r}`,focusVisible:(e,r)=>`${e}:focus-visible ${r}`,focusWithin:(e,r)=>`${e}:focus-within ${r}`,active:(e,r)=>`${e}:active ${r}, ${e}[data-active] ${r}`,disabled:(e,r)=>`${e}:disabled ${r}, ${e}[data-disabled] ${r}`,invalid:(e,r)=>`${e}:invalid ${r}, ${e}[data-invalid] ${r}`,checked:(e,r)=>`${e}:checked ${r}, ${e}[data-checked] ${r}`,indeterminate:(e,r)=>`${e}:indeterminate ${r}, ${e}[aria-checked=mixed] ${r}, ${e}[data-indeterminate] ${r}`,readOnly:(e,r)=>`${e}:read-only ${r}, ${e}[readonly] ${r}, ${e}[data-read-only] ${r}`,expanded:(e,r)=>`${e}:read-only ${r}, ${e}[aria-expanded=true] ${r}, ${e}[data-expanded] ${r}`,placeholderShown:(e,r)=>`${e}:placeholder-shown ${r}`},Q=e=>Lt(r=>e(r,"&"),"[role=group]","[data-group]",".group"),q=e=>Lt(r=>e(r,"~ &"),"[data-peer]",".peer"),Lt=(e,...r)=>r.map(e).join(", "),yr={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:Q(A.hover),_peerHover:q(A.hover),_groupFocus:Q(A.focus),_peerFocus:q(A.focus),_groupFocusVisible:Q(A.focusVisible),_peerFocusVisible:q(A.focusVisible),_groupActive:Q(A.active),_peerActive:q(A.active),_groupDisabled:Q(A.disabled),_peerDisabled:q(A.disabled),_groupInvalid:Q(A.invalid),_peerInvalid:q(A.invalid),_groupChecked:Q(A.checked),_peerChecked:q(A.checked),_groupFocusWithin:Q(A.focusWithin),_peerFocusWithin:q(A.focusWithin),_peerPlaceholderShown:q(A.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},oi=Object.keys(yr);var vr=(0,zt.default)({},De,v,Na,We,N,$a,Xa,Da,Mt,Ja,_e,gr,T,ei,Za,qa,Ka,Wa,Qa),ai=Object.assign({},T,N,We,Mt,_e),os=Object.keys(ai),jt=[...Object.keys(vr),...oi],ii={...vr,...yr},Nt=e=>e in ii,si=e=>r=>{if(!r.__breakpoints)return e;let{isResponsive:t,toArrayValue:o,media:a}=r.__breakpoints,i={};for(let c in e){let s=V(e[c],r);if(s==null)continue;if(s=z(s)&&t(s)?o(s):s,!Array.isArray(s)){i[c]=s;continue}let l=s.slice(0,a.length).length;for(let p=0;p<l;p+=1){let u=a==null?void 0:a[p];if(!u){i[c]=s[p];continue}i[u]=i[u]||{},s[p]!=null&&(i[u][c]=s[p])}}return i};function ci(e){let r=[],t="",o=!1;for(let a=0;a<e.length;a++){let i=e[a];i==="("?(o=!0,t+=i):i===")"?(o=!1,t+=i):i===","&&!o?(r.push(t),t=""):t+=i}return t=t.trim(),t&&r.push(t),r}function li(e){return/^var\(--.+\)$/.test(e)}var di=(e,r)=>e.startsWith("--")&&typeof r=="string"&&!li(r),ui=(e,r)=>{var t,o;if(r==null)return r;let a=l=>{var p,u;return(u=(p=e.__cssMap)==null?void 0:p[l])==null?void 0:u.varRef},i=l=>{var p;return(p=a(l))!=null?p:l},[c,s]=ci(r);return r=(o=(t=a(c))!=null?t:i(s))!=null?o:i(r),r};function pi(e){let{configs:r={},pseudos:t={},theme:o}=e,a=(i,c=!1)=>{var s,l,p;let u=V(i,o),S=si(u)(o),f={};for(let m in S){let R=S[m],w=V(R,o);m in t&&(m=t[m]),di(m,w)&&(w=ui(o,w));let x=r[m];if(x===!0&&(x={property:m}),z(w)){f[m]=(s=f[m])!=null?s:{},f[m]=(0,ke.default)({},f[m],a(w,!0));continue}let y=(p=(l=x==null?void 0:x.transform)==null?void 0:l.call(x,w,o,u))!=null?p:w;y=x!=null&&x.processResult?a(y,!0):y;let k=V(x==null?void 0:x.property,o);if(!c&&(x==null?void 0:x.static)){let M=V(x.static,o);f=(0,ke.default)({},f,M)}if(k&&Array.isArray(k)){for(let M of k)f[M]=y;continue}if(k){k==="&"&&z(y)?f=(0,ke.default)({},f,y):f[k]=y;continue}if(z(y)){f=(0,ke.default)({},f,y);continue}f[m]=y}return f};return a}var $t=e=>r=>pi({theme:r,pseudos:yr,configs:vr})(e);function fi(e,r){if(Array.isArray(e))return e;if(z(e))return r(e);if(e!=null)return[e]}function mi(e,r){for(let t=r+1;t<e.length;t++)if(e[t]!=null)return t;return-1}function gi(e){let r=e.__breakpoints;return function(o,a,i,c){var s,l;if(!r)return;let p={},u=fi(i,r.toArrayValue);if(!u)return p;let S=u.length,f=S===1,m=!!o.parts;for(let R=0;R<S;R++){let w=r.details[R],x=r.details[mi(u,R)],y=ti(w.minW,x==null?void 0:x._minW),k=V((s=o[a])==null?void 0:s[u[R]],c);if(!!k){if(m){(l=o.parts)==null||l.forEach(M=>{(0,Ve.default)(p,{[M]:f?k[M]:{[y]:k[M]}})});continue}if(!m){f?(0,Ve.default)(p,k):p[y]=k;continue}p[y]=k}}return p}}function Dt(e){return r=>{var t;let{variant:o,size:a,theme:i}=r,c=gi(i);return(0,Ve.default)({},V((t=e.baseStyle)!=null?t:{},r),c(e,"sizes",a,r),c(e,"variants",o,r))}}d();d();var He=L(de(),1);function Sr(e,r){let t={};return Object.keys(e).forEach(o=>{r.includes(o)||(t[o]=e[o])}),t}function Wt(e,r,t,o){let a=typeof r=="string"?r.split("."):[r];for(o=0;o<a.length&&e;o+=1)e=e[a[o]];return e===void 0?t:e}var Vt=e=>{let r=new WeakMap;return(o,a,i,c)=>{if(typeof o>"u")return e(o,a,i);r.has(o)||r.set(o,new Map);let s=r.get(o);if(s.has(a))return s.get(a);let l=e(o,a,i,c);return s.set(a,l),l}},xr=Vt(Wt);function Ue(e,r){let t={};return Object.keys(e).forEach(o=>{let a=e[o];r(a,o,e)&&(t[o]=a)}),t}var Te=e=>Ue(e,r=>r!=null);d();function Gt(e){return typeof e=="function"}var hi=process.env.NODE_ENV!=="production",cs=process.env.NODE_ENV==="test";d();function kr(e,...r){return Gt(e)?e(...r):e}var Yt=require("react"),Jt=L(Ut(),1);function xi(e,r={}){var t;let{styleConfig:o,...a}=r,{theme:i,colorMode:c}=Kr(),s=e?xr(i,`components.${e}`):void 0,l=o||s,p=(0,He.default)({theme:i,colorMode:c},(t=l==null?void 0:l.defaultProps)!=null?t:{},Te(Sr(a,["children"]))),u=(0,Yt.useRef)({});if(l){let f=Dt(l)(p);(0,Jt.default)(u.current,f)||(u.current=f)}return u.current}function _r(e,r={}){return xi(e,r)}d();d();d();var ki=new Set([...jt,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),_i=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function Xt(e){return _i.has(e)||!ki.has(e)}d();d();function Tr(e,...r){if(e==null)throw new TypeError("Cannot convert undefined or null to object");let t={...e};for(let o of r)if(o!=null)for(let a in o)!Object.prototype.hasOwnProperty.call(o,a)||(a in t&&delete t[a],t[a]=o[a]);return t}var Ir=L(require("@emotion/styled"),1),wr=L(require("react"),1),qt,Ti=(qt=Ir.default.default)!=null?qt:Ir.default,Ii=({baseStyle:e})=>r=>{let{theme:t,css:o,__css:a,sx:i,...c}=r,s=Ue(c,(S,f)=>Nt(f)),l=kr(e,r),p=Tr({},a,l,Te(s),i),u=$t(p)(r.theme);return o?[u,o]:u};function Je(e,r){let{baseStyle:t,...o}=r!=null?r:{};o.shouldForwardProp||(o.shouldForwardProp=Xt);let a=Ii({baseStyle:t}),i=Ti(e,o)(a);return wr.default.forwardRef(function(l,p){let{colorMode:u,forced:S}=ge();return wr.default.createElement(i,{ref:p,"data-theme":S?u:void 0,...l})})}function wi(){let e=new Map;return new Proxy(Je,{apply(r,t,o){return Je(...o)},get(r,t){return e.has(t)||e.set(t,Je(t)),e.get(t)}})}var Xe=wi();d();var Kt=require("react");function Ie(e){return(0,Kt.forwardRef)(e)}var Ri=require("@emotion/react");var Z=require("react/jsx-runtime"),Qt={path:(0,Z.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",children:[(0,Z.jsx)("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),(0,Z.jsx)("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),(0,Z.jsx)("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Rr=Ie((e,r)=>{let{as:t,viewBox:o,color:a="currentColor",focusable:i=!1,children:c,className:s,__css:l,...p}=e,u=Qr("chakra-icon",s),S=_r("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:a,...l,...S},m={ref:r,focusable:i,className:u,__css:f},R=o!=null?o:Qt.viewBox;if(t&&typeof t!="string")return(0,Z.jsx)(Xe.svg,{as:t,...m,...p});let w=c!=null?c:Qt.path;return(0,Z.jsx)(Xe.svg,{verticalAlign:"middle",viewBox:R,...m,...p,children:w})});Rr.displayName="Icon";var Zt=require("react"),Cr=require("react/jsx-runtime");function we(e){let{viewBox:r="0 0 24 24",d:t,displayName:o,defaultProps:a={}}=e,i=Zt.Children.toArray(e.path),c=Ie((s,l)=>(0,Cr.jsx)(Rr,{ref:l,viewBox:r,...a,...s,children:i.length?i:(0,Cr.jsx)("path",{fill:"currentColor",d:t})}));return c.displayName=o,c}var H=require("react/jsx-runtime"),Ci=we({displayName:"Calendar",path:(0,H.jsxs)("g",{children:[(0,H.jsx)("path",{fill:"#231F20",d:`M60,0H14c-2.211,0-4,1.789-4,4v27H4c-2.211,0-4,1.789-4,4v23c0,3.313,2.687,6,6,6h52c3.313,0,6-2.687,6-6V4
|
|
2
|
-
C64,1.789,62.211,0,60,0z M2,58V35c0-1.104,0.896-2,2-2h6v25c0,2.209-1.791,4-4,4S2,60.209,2,58z M58,62H10.463
|
|
3
|
-
C11.416,60.938,12,59.539,12,58V4c0-1.104,0.896-2,2-2h46c1.104,0,2,0.896,2,2v54C62,60.209,60.209,62,58,62z`}),(0,H.jsx)("path",{fill:"#231F20",d:"M53,25H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,25,53,25z"}),(0,H.jsx)("path",{fill:"#231F20",d:"M53,19H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,19,53,19z"}),(0,H.jsx)("path",{fill:"#231F20",d:"M53,37H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,37,53,37z"}),(0,H.jsx)("path",{fill:"#231F20",d:"M53,43H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,43,53,43z"}),(0,H.jsx)("path",{fill:"#231F20",d:"M53,49H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,49,53,49z"}),(0,H.jsx)("path",{fill:"#231F20",d:"M53,31H21c-0.553,0-1,0.447-1,1s0.447,1,1,1h32c0.553,0,1-0.447,1-1S53.553,31,53,31z"}),(0,H.jsx)("path",{fill:"#231F20",d:"M21,15h15c0.553,0,1-0.447,1-1s-0.447-1-1-1H21c-0.553,0-1,0.447-1,1S20.447,15,21,15z"})]}),viewBox:"0 0 64 64"}),Er=Ci;var I=require("react/jsx-runtime"),Ei=({addFeature:e,ButtonComponent:r})=>{let[t,o]=(0,ae.useState)(!0),[a,i]=(0,ae.useState)(""),[c,s]=(0,ae.useState)([]),[l,p]=(0,ae.useState)([]),u=y=>{s(y)},S=()=>{try{c.forEach(y=>{let k=new FileReader;k.onabort=()=>f("File reading was aborted. Please try again."),k.onerror=()=>f("File reading has failed. Please try again."),k.onload=()=>{let M=k.result;if(M){let D=typeof M=="string"?M:new TextDecoder().decode(M);try{let K=JSON.parse(D);(Array.isArray(K.features)?K.features.map(W=>({...W,isGeojson:!0})):[{...K,isGeojson:!0}]).forEach(W=>{e([W])}),i("Geojson added successfully"),o(!0),p(W=>[...W,{name:y.name}]),s([])}catch(K){console.error(K),f("Upload failed. Invalid GeoJSON format.")}}else f("File reading result is null.")},k.readAsText(y)})}catch(y){console.error(y),f("File upload failed. Please try again.")}finally{setTimeout(()=>{i(""),o(!0)},2e3)}},f=y=>{i(y),o(!1)},m=()=>{s([])},{getRootProps:R,getInputProps:w,isDragActive:x}=(0,eo.useDropzone)({onDrop:u,accept:{"application/geo+json":[".geojson"]}});return(0,I.jsxs)(C.Box,{display:"flex",flexDirection:"column",alignItems:"flex-start",marginTop:"10px",children:[(0,I.jsx)(C.Text,{marginBottom:"10px",fontWeight:"bold",fontSize:"lg",children:"GeoJSON"}),(0,I.jsxs)(C.Box,{display:"flex",flexDirection:"row",alignItems:"center",children:[(0,I.jsxs)(C.Box,{border:"2px solid #519895",borderRadius:"4px",display:"flex",flexDirection:"column",alignItems:"center",padding:"10px",cursor:"pointer",marginLeft:"15px",width:"350px",height:"100px",...R(),children:[(0,I.jsx)("input",{...w()}),c.length>0?(0,I.jsx)(C.Box,{display:"flex",alignItems:"center",children:(0,I.jsxs)(C.Box,{ml:"10px",display:"flex",alignItems:"center",children:[(0,I.jsx)(C.Icon,{as:Er,boxSize:30,color:"gray.500",style:{marginRight:"5px"}}),(0,I.jsx)(C.Text,{marginTop:"10px",overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"200px",children:c[0].name}),(0,I.jsx)(ue.DeleteIcon,{boxSize:20,color:"red",onClick:m,ml:"10px",mt:"10px",children:"Remove"})]})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(C.Text,{children:"Drag 'n' drop GeoJSON file here, or click to select a file"}),x&&(0,I.jsx)(C.Text,{children:"Drop the file here..."})]})]}),ae.default.cloneElement(r,{type:"button",ml:"30px",style:{paddingLeft:"15px"},onClick:S})]}),a&&(0,I.jsxs)(C.Text,{fontWeight:"bold",color:t?"green":"red",height:"20px",children:[t?(0,I.jsx)(ue.CheckCircleIcon,{boxSize:20,mr:2}):(0,I.jsx)(ue.CloseIcon,{boxSize:15,mr:2}),a]}),l.length>0&&(0,I.jsxs)(C.Box,{mt:"10px",pl:"15px",children:[(0,I.jsx)(C.Text,{fontSize:"sm",children:"Added GeoJSONs:"}),(0,I.jsx)(C.List,{styleType:"none",padding:"0",children:l.map((y,k)=>(0,I.jsxs)(C.ListItem,{display:"flex",alignItems:"center",children:[(0,I.jsx)(C.Icon,{as:Er,boxSize:20,color:"teal",mr:"3px",style:{marginTop:"5px"}}),(0,I.jsx)(C.Text,{mt:"10px",overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"300px",children:y.name})]},k))})]})]})},ro=Ei;d();var qe=require("@chakra-ui/icons"),B=require("@chakra-ui/react"),ee=L(require("react"));d();var Oi=we({displayName:"Location",d:"M11.536 3.464a5 5 0 010 7.072L8 14.07l-3.536-3.535a5 5 0 117.072-7.072v.001zm1.06 8.132a6.5 6.5 0 10-9.192 0l3.535 3.536a1.5 1.5 0 002.122 0l3.535-3.536zM8 9a2 2 0 100-4 2 2 0 000 4z",viewBox:"0 0 16 16"}),to=Oi;var $=require("react/jsx-runtime"),Ai=({addFeature:e,InputComponent:r,ButtonComponent:t})=>{let o=(0,ee.useRef)(null),[a,i]=(0,ee.useState)(void 0),[c,s]=(0,ee.useState)([]),l=()=>{var u,S,f;try{let m=(S=(u=o.current)==null?void 0:u.value)!=null?S:"";if(!m.trim()){i(!1);return}let R=(f=m.split(",").map(Number))==null?void 0:f.reverse();if(!p(R)){i(!1);return}let w={type:O.POINT,properties:{id:new Date().getTime(),name:m,formatted_address:m},coordinates:R};e(w),s(x=>[...x,w]),o.current&&(o.current.value=""),i(!0)}catch{i(!1)}finally{setTimeout(()=>{i(void 0)},3e3)}},p=u=>Array.isArray(u)&&u.length===2&&!isNaN(u[0])&&!isNaN(u[1])&&typeof u[0]=="number"&&typeof u[1]=="number";return(0,$.jsxs)(B.Box,{display:"flex",flexDirection:"column",alignItems:"flex-start",children:[(0,$.jsx)(B.Heading,{mb:"10px",fontWeight:"bold",size:"lg",children:"Points"}),(0,$.jsxs)(B.Flex,{alignItems:"center",children:[ee.default.cloneElement(r,{ref:o,width:"350px"}),ee.default.cloneElement(t,{onClick:l,type:"button",marginLeft:"10px"})]}),a!==void 0&&(0,$.jsxs)(B.Text,{fontWeight:"bold",color:a?"green":"red",mt:"10px",display:"flex",alignItems:"center",children:[a?(0,$.jsx)(qe.CheckCircleIcon,{boxSize:20,mr:2}):(0,$.jsx)(qe.CloseIcon,{boxSize:15,color:"red.500",mr:2}),a?Nr:jr]}),c.length>0&&(0,$.jsxs)(B.Box,{mt:"10px",pl:"20px",children:[(0,$.jsx)(B.Heading,{size:"sm",children:"Added Points:"}),(0,$.jsx)(B.List,{styleType:"none",padding:"0",children:c.map(u=>(0,$.jsxs)(B.ListItem,{display:"flex",alignItems:"center",children:[(0,$.jsx)(B.Icon,{as:to,color:"teal",mr:"3px"}),u.properties.name]},u.properties.id))})]})]})},oo=Ai;d();var re={ADD:"add",CLEAR:"clear",REPLACE:"replace"};function no(e,{action:r,data:t,isMultiple:o}){switch(r){case re.ADD:return o?[...e||[],t]:[t];case re.CLEAR:return[];case re.REPLACE:return t;default:return e}}d();var ie=L(require("react"));d();var Re=require("react"),Bi={enableHighAccuracy:!1,timeout:1/0,maximumAge:0},ao=(e,r=Bi)=>{let[t,o]=(0,Re.useState)(),[a,i]=(0,Re.useState)(),c=({coords:l})=>{o([l.longitude,l.latitude])},s=l=>{i(l.message)};return(0,Re.useEffect)(()=>{if(!navigator||!navigator.geolocation){i("Geolocation is not supported");return}let l=null;return e?l=navigator.geolocation.watchPosition(c,s,r):l&&navigator.geolocation.clearWatch(l),()=>l&&navigator.geolocation.clearWatch(l)},[r,e]),{position:t,error:a}};var Pi=require("react/jsx-runtime");function Or({TraceButtonComponent:e,onFeatureAdded:r}){let[t,o]=(0,ie.useState)([]),[a,i]=(0,ie.useState)(!1),{position:c}=ao(a);(0,ie.useEffect)(()=>{a&&c&&o([...t,c])},[a,c]);let s=()=>{a?(i(!1),r({getType:()=>O.RAW,data:[...t]}),o([])):i(!0)};return(0,Pi.jsx)("div",{children:ie.default.cloneElement(e,{onClick:s,isTracking:a})})}var b=require("react/jsx-runtime"),Mi=P.default.forwardRef(({defaultViewState:e,defaultDrawingMode:r,data:t,onDataChange:o,gmapAccessToken:a,isControlled:i,isReadOnly:c,isMultiple:s,isAutocomplete:l,gmapRegion:p,autoCompleteRegion:u,mapStyle:S,importInputComponent:f,importButtonComponent:m,autocompleteComponent:R,showTrace:w,traceButtonComponent:x,maxZoom:y,options:k},M)=>{let D=(0,P.useRef)(null),K=(0,P.useRef)(null),[fe,W]=(0,P.useReducer)(no,t),[Ar,so]=(0,P.useState)(),{isOpen:Ke,onOpen:co,onClose:lo}=(0,E.useDisclosure)(),[uo,po]=(0,P.useState)("auto"),Br=(0,P.useMemo)(()=>(0,Ce.mapboxToGmapsViewState)(e),[e]),fo=()=>{D.current.state.map.data.forEach(function(Y){D.current.state.map.data.remove(Y)});let F=Vr(fe);if(F){F&&D.current.state.map.data.addGeoJson(F);let Y=Gr(F);Y&&D.current.state.map.fitBounds(Y),y&&google.maps.event.addListenerOnce(D.current.state.map,"idle",function(){let yo=D.current.state.map.getZoom();D.current.state.map.setZoom(Math.min(y,yo))})}};(0,P.useEffect)(()=>{Ar&&(o&&o(fe),M&&(M.current={addFeature:me,replaceFeature:mo}),fo())},[Ar,fe]),(0,P.useEffect)(()=>{i&&JSON.stringify(fe)!==JSON.stringify(t)&&W({action:re.REPLACE,data:t})},[t]);let me=F=>{W({action:re.ADD,data:F,isMultiple:s})},mo=F=>{W({action:re.REPLACE,data:[F]})},Pr=F=>{let Y=Wr(F);me(Y)},go=()=>{W({action:re.CLEAR})},ho=()=>so(!0),bo=()=>{co()},Mr=()=>{lo()};return(0,P.useEffect)(()=>{var F;if(Ke){let Y=(F=K.current)==null?void 0:F.offsetHeight;po(Y?`${Y}px`:"auto")}},[Ke]),(0,b.jsx)(pe.LoadScriptNext,{googleMapsApiKey:a,region:p,libraries:l?Ce.GMAPS_LIBRARIES.AUTOCOMPLETE:Ce.GMAPS_LIBRARIES.DEFAULT,children:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(E.Box,{className:"map-toolbar",display:"flex",children:[l&&(0,b.jsx)(Qe,{InputComponent:R||(0,b.jsx)("input",{}),addFeature:me,gmapRegion:u!=null?u:p}),(0,b.jsx)(E.Box,{display:"flex",justifyContent:"flex-end",paddingBottom:"15px",children:(0,b.jsx)(E.Button,{onClick:bo,padding:"8px 25px",backgroundColor:"#519895",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",children:"Import"})})]}),(0,b.jsxs)(E.Modal,{blockScrollOnMount:!1,isOpen:Ke,onClose:Mr,isCentered:!0,size:"auto",children:[(0,b.jsx)(E.ModalOverlay,{}),(0,b.jsxs)(E.ModalContent,{ref:K,maxWidth:"550px",height:uo,margin:"auto",borderRadius:"8px",boxShadow:"0 0 10px rgba(0, 0, 0, 0.2)",backgroundColor:"#fff",display:"flex",flexDirection:"column",padding:"30px",backdropFilter:"blur(5px)",marginTop:"90px",children:[(0,b.jsx)(E.ModalHeader,{position:"relative",zIndex:2,padding:"10px 0",children:(0,b.jsx)(io.CloseIcon,{position:"absolute",top:"-15px",right:"-17px",cursor:"pointer",zIndex:3,onClick:Mr})}),(0,b.jsx)(E.ModalBody,{display:"flex",flexDirection:"column",children:(0,b.jsx)(U.Table,{variant:"striped",colorScheme:"teal",children:(0,b.jsxs)(U.Tbody,{children:[(0,b.jsx)(U.Tr,{children:(0,b.jsx)(U.Td,{children:(0,b.jsx)(E.Box,{borderWidth:"1px",borderRadius:"lg",p:"4",mb:"20",pb:"20",pt:"10",children:(0,b.jsx)(oo,{InputComponent:f||(0,b.jsx)("input",{}),ButtonComponent:m||(0,b.jsx)(E.Button,{children:"Import Coordinates"}),addFeature:me})})})}),(0,b.jsx)(U.Tr,{children:(0,b.jsx)(U.Td,{children:(0,b.jsx)(E.Box,{borderWidth:"1px",borderRadius:"lg",p:"4",mb:"4",pb:"20",children:(0,b.jsx)(ro,{addFeature:me,ButtonComponent:m||(0,b.jsx)(E.Button,{children:"Add"})})})})})]})})})]})]}),w&&(0,b.jsx)(Or,{TraceButtonComponent:x||(0,b.jsx)("button",{children:"trace"}),onFeatureAdded:Pr}),(0,b.jsxs)(pe.GoogleMap,{id:"naksha-gmaps-draw",mapContainerStyle:S||{height:"100%",width:"100%"},zoom:Br.zoom,center:Br.center,options:zr,ref:D,onLoad:ho,children:[s&&(0,b.jsx)(Ze,{onClick:go}),!c&&(0,b.jsx)(pe.Data,{options:{controls:[O.POINT,O.POLYGON,O.LINESTRING],drawingMode:r||O.POLYGON,featureFactory:Pr,...k||{}}})]})]})})});0&&(module.exports={GMAP_FEATURE_TYPES,NakshaGmapsDraw});
|
|
1
|
+
"use strict";var Ge=Object.create;var B=Object.defineProperty,we=Object.defineProperties,De=Object.getOwnPropertyDescriptor,Me=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertyNames,le=Object.getOwnPropertySymbols,ze=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable;var pe=(e,o,t)=>o in e?B(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,U=(e,o)=>{for(var t in o||(o={}))ce.call(o,t)&&pe(e,t,o[t]);if(le)for(var t of le(o))Je.call(o,t)&&pe(e,t,o[t]);return e},X=(e,o)=>we(e,Me(o));var _e=(e,o)=>{for(var t in o)B(e,t,{get:o[t],enumerable:!0})},de=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of ke(o))!ce.call(e,r)&&r!==t&&B(e,r,{get:()=>o[r],enumerable:!(n=De(o,r))||n.enumerable});return e};var z=(e,o,t)=>(t=e!=null?Ge(ze(e)):{},de(o||!e||!e.__esModule?B(t,"default",{value:e,enumerable:!0}):t,e)),Be=e=>de(B({},"__esModule",{value:!0}),e);var He={};_e(He,{GMAP_FEATURE_TYPES:()=>s,NakshaGmapsDraw:()=>je});module.exports=Be(He);var H=require("@biodiv-platform/naksha-commons"),J=require("@react-google-maps/api"),g=z(require("react"));var xe=require("@biodiv-platform/naksha-commons"),Ee=require("@react-google-maps/api"),Ie=require("react");var me=z(require("@turf/bbox"));var s={POINT:"Point",POLYGON:"Polygon",LINESTRING:"LineString",RECTANGLE:"Rectangle",RAW:"Raw",NONE:null},ue={mapTypeControlOptions:{position:10}};var fe=e=>({type:s.POINT,properties:{id:new Date().getTime(),name:e.name,formatted_address:e.formatted_address},coordinates:Object.values(e.geometry.location.toJSON()).reverse()}),ge=e=>{let o=new Date().getTime();switch(e.getType()){case s.POINT:return{type:s.POINT,properties:{id:o},coordinates:Object.values(e.get().toJSON()).reverse()};case s.POLYGON:{let t=[],n=r=>t.push([r.lng(),r.lat()]);return e.forEachLatLng(n),t.push(t[0]),{type:s.POLYGON,properties:{id:o},coordinates:[t]}}case s.RAW:{let t=e.data;return t.push(t[0]),{type:s.POLYGON,properties:{id:o},coordinates:[t]}}case s.LINESTRING:{let t=[],n=r=>t.push([r.lng(),r.lat()]);return e.forEachLatLng(n),{type:s.LINESTRING,properties:{id:o},coordinates:t}}default:return null}},ye=e=>{let o=(e||[]).filter(n=>n);return o.length===0?!1:{type:"FeatureCollection",features:o.map(n=>{if(Array.isArray(n)&&n.length>0&&n[0].isGeojson){let r=n[0];return{type:"Feature",properties:r.properties||{},geometry:r.geometry||null}}else return{type:"Feature",properties:{},geometry:n}})}},he=e=>{let o=(0,me.default)(e);return{east:o[2],north:o[3],south:o[1],west:o[0]}};var Se=require("react/jsx-runtime");function $({InputComponent:e,addFeature:o,gmapRegion:t}){let[n,r]=(0,Ie.useState)();return(0,Se.jsx)(Ee.Autocomplete,{onLoad:p=>{r(p)},fields:xe.GMAPS_AUTOCOMPLETE_FIELDS,onPlaceChanged:()=>{let p=fe(n==null?void 0:n.getPlace());o(p)},options:t?{componentRestrictions:{country:t}}:{},children:e})}var Y=require("react/jsx-runtime"),Ue={background:"white",position:"absolute",top:"5px",left:"106px",padding:"0.4rem",borderRadius:"0.15rem",outline:0,boxShadow:"rgba(0, 0, 0, 0.3) 0px 1px 4px -1px"};function ee({onClick:e}){return(0,Y.jsx)("button",{type:"button",title:"Clear",onClick:e,style:Ue,children:(0,Y.jsx)("svg",{viewBox:"0 0 24 24",width:"12",height:"12",children:(0,Y.jsx)("g",{fill:"#E53E3E",children:(0,Y.jsx)("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})})})}var R={ADD:"add",CLEAR:"clear",REPLACE:"replace"};function ve(e,{action:o,data:t,isMultiple:n}){switch(o){case R.ADD:return n?[...e||[],t]:[t];case R.CLEAR:return[];case R.REPLACE:return t;default:return e}}var b=z(require("react"));var W=require("react"),Ye={enableHighAccuracy:!1,timeout:1/0,maximumAge:0},Te=(e,o=Ye)=>{let[t,n]=(0,W.useState)(),[r,m]=(0,W.useState)(),d=({coords:a})=>{n([a.longitude,a.latitude])},p=a=>{m(a.message)};return(0,W.useEffect)(()=>{if(!navigator||!navigator.geolocation){m("Geolocation is not supported");return}let a=null;return e?a=navigator.geolocation.watchPosition(d,p,o):a&&navigator.geolocation.clearWatch(a),()=>a&&navigator.geolocation.clearWatch(a)},[o,e]),{position:t,error:r}};var Ae=require("react/jsx-runtime");function te({TraceButtonComponent:e,onFeatureAdded:o}){let[t,n]=(0,b.useState)([]),[r,m]=(0,b.useState)(!1),{position:d}=Te(r);(0,b.useEffect)(()=>{r&&d&&n([...t,d])},[r,d]);let p=()=>{r?(m(!1),o({getType:()=>s.RAW,data:[...t]}),n([])):m(!0)};return(0,Ae.jsx)("div",{children:b.default.cloneElement(e,{onClick:p,isTracking:r})})}var V=z(require("react"));var I=z(require("react"));var h=require("react/jsx-runtime"),We=({addFeature:e,InputComponent:o,ButtonComponent:t,LocationIcon:n,SuccessIcon:r,FailureIcon:m})=>{let d=(0,I.useRef)(null),[p,a]=(0,I.useState)(!0),[E,y]=(0,I.useState)(""),[f,P]=(0,I.useState)([]),O=()=>{var u,G,w;try{let T=(G=(u=d.current)==null?void 0:u.value)!=null?G:"";if(!T.trim()){a(!1),y("Invalid Format. Enter Latitude, Longitude.");return}let D=(w=T.split(",").map(Number))==null?void 0:w.reverse();if(!F(D)){a(!1),y("Invalid Format. Enter Latitude, Longitude.");return}let S={type:s.POINT,properties:{id:new Date().getTime(),name:T,formatted_address:T},coordinates:D};e(S),P(_=>[..._,S]),d.current&&(d.current.value=""),a(!0),y("Point added successfully")}catch(T){a(!1)}finally{setTimeout(()=>{y(""),a(!0)},3e3)}},F=u=>Array.isArray(u)&&u.length===2&&!isNaN(u[0])&&!isNaN(u[1])&&typeof u[0]=="number"&&typeof u[1]=="number";return(0,h.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,h.jsx)("h1",{style:{marginBottom:"10px",fontWeight:"bold",fontSize:"1.25rem"},children:"Point"}),(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[I.default.cloneElement(o,{ref:d,width:"300px"}),I.default.cloneElement(t,{onClick:O,type:"button",marginLeft:"10px"})]}),E&&(0,h.jsxs)("div",{style:{fontWeight:"bold",color:p?"green":"red",marginTop:"10px",display:"flex",alignItems:"center"},children:[p?(0,h.jsx)("span",{style:{marginRight:"5px",fontSize:"1.25rem"},children:I.default.cloneElement(r,{boxSize:6})}):(0,h.jsx)("span",{style:{marginRight:"5px",fontSize:"1.25rem",color:"red"},children:I.default.cloneElement(m,{boxSize:4})}),E]}),f.length>0&&(0,h.jsxs)("div",{style:{marginTop:"10px",paddingLeft:"15px"},children:[(0,h.jsx)("div",{style:{fontSize:"sm"},children:"Added Points:"}),(0,h.jsx)("ul",{style:{listStyleType:"none",padding:"0"},children:f.map(u=>(0,h.jsxs)("li",{style:{display:"flex",alignItems:"center",marginBottom:"5px"},children:[I.default.cloneElement(n,{boxSize:6,marginRight:2,color:"teal"}),(0,h.jsx)("span",{style:{overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"300px"},children:u.properties.name})]},u.properties.id))})]})]})},Pe=We;var x=z(require("react"));var i=require("react/jsx-runtime"),Ve=({addFeature:e,ButtonComponent:o,FileIcon:t,SuccessIcon:n,FailureIcon:r,DeleteIcon:m})=>{let[d,p]=(0,x.useState)(!0),[a,E]=(0,x.useState)(""),[y,f]=(0,x.useState)([]),[P,O]=(0,x.useState)([]),F=(0,x.useRef)(null),u=c=>{c.preventDefault()},G=c=>{c.preventDefault()},w=c=>{c.preventDefault();let v=Array.from(c.dataTransfer.files);f(v)},T=()=>{let c=Array.from(F.current.files);f(c)},D=()=>{try{y.forEach(c=>{let v=new FileReader;v.onabort=()=>S("File reading was aborted. Please try again."),v.onerror=()=>S("File reading has failed. Please try again."),v.onload=()=>{let M=v.result;if(M){let Q=typeof M=="string"?M:new TextDecoder().decode(M);try{let N=JSON.parse(Q);(Array.isArray(N.features)?N.features.map(C=>X(U({},C),{isGeojson:!0})):[X(U({},N),{isGeojson:!0})]).forEach(C=>{e([C])}),E("Geojson added successfully"),p(!0),O(C=>[...C,{name:c.name}]),f([])}catch(N){console.error(N),S("Upload failed. Invalid GeoJSON format.")}}else S("File reading result is null.")},v.readAsText(c)})}catch(c){console.error(c),S("File upload failed. Please try again.")}finally{setTimeout(()=>{E(""),p(!0)},2e3)}},S=c=>{E(c),p(!1)},_=()=>{f([])};return(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",marginTop:"10px"},onDragEnter:u,onDragOver:G,onDrop:w,children:[(0,i.jsx)("h1",{style:{marginBottom:"10px",fontWeight:"bold",fontSize:"1.25rem"},children:"GeoJSON"}),(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[(0,i.jsxs)("div",{style:{border:"2px solid #519895",borderRadius:"4px",display:"flex",flexDirection:"column",alignItems:"center",padding:"10px",cursor:"pointer",marginLeft:"15px",width:"300px",height:"100px"},onClick:()=>F.current.click(),children:[(0,i.jsx)("input",{type:"file",ref:F,onChange:T,style:{display:"none"}}),(0,i.jsx)("div",{style:{display:"flex",alignItems:"center"},children:y.length>0?(0,i.jsxs)("div",{style:{marginLeft:"10px",display:"flex",alignItems:"center"},children:[(0,i.jsx)("div",{style:{marginTop:"10px",overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"200px"},children:y[0].name}),(0,i.jsx)("div",{style:{color:"red",marginLeft:"10px",marginTop:"10px",cursor:"pointer"},onClick:_,children:x.default.cloneElement(m,{boxSize:6})})]}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{children:"Drag 'n' drop GeoJSON file here, or click to select a file"})})})]}),x.default.cloneElement(o,{type:"button",marginLeft:"30px",style:{paddingLeft:"15px"},onClick:D})]}),a&&(0,i.jsxs)("div",{style:{fontWeight:"bold",color:d?"green":"red",marginTop:"10px",display:"flex",alignItems:"center"},children:[d?(0,i.jsx)("span",{style:{marginRight:"5px",fontSize:"1.25rem"},children:x.default.cloneElement(n,{boxSize:6})}):(0,i.jsx)("span",{style:{marginRight:"5px",fontSize:"1.25rem",color:"red"},children:x.default.cloneElement(r,{boxSize:4})}),a]}),P.length>0&&(0,i.jsxs)("div",{style:{marginTop:"10px",paddingLeft:"15px"},children:[(0,i.jsx)("div",{style:{fontSize:"sm"},children:"Added GeoJSONs:"}),(0,i.jsx)("ul",{style:{listStyleType:"none",padding:"0"},children:P.map((c,v)=>(0,i.jsxs)("li",{style:{display:"flex",alignItems:"center"},children:[x.default.cloneElement(t,{boxSize:6,marginRight:2}),(0,i.jsx)("div",{style:{marginTop:"10px",overflow:"hidden",whiteSpace:"pre-wrap",textOverflow:"ellipsis",maxWidth:"300px"},children:c.name})]},v))})]})]})},Le=Ve;var j=require("react/jsx-runtime");function oe({ButtonComponent:e,ModalComponent:o,addFeature:t,InputComponent:n,ButtonComponentModal:r,DeleteIcon:m,LocationIcon:d,FileIcon:p,SuccessIcon:a,FailureIcon:E}){let[y,f]=(0,V.useState)(!1),P=()=>{f(!1)},O=()=>{f(!0)};return(0,j.jsxs)("div",{style:{display:"flex"},children:[V.default.cloneElement(o,{isOpen:y,onClose:P,nakshaImport:(0,j.jsx)(Pe,{addFeature:t,InputComponent:n,ButtonComponent:e,LocationIcon:d,SuccessIcon:a,FailureIcon:E}),geoJSONImport:(0,j.jsx)(Le,{addFeature:t,ButtonComponent:e,DeleteIcon:m,FileIcon:p,SuccessIcon:a,FailureIcon:E})}),V.default.cloneElement(r,{onClick:O,type:"button"})]})}var l=require("react/jsx-runtime"),je=g.default.forwardRef(({defaultViewState:e,defaultDrawingMode:o,data:t,onDataChange:n,gmapAccessToken:r,isControlled:m,isReadOnly:d,isMultiple:p,isImport:a,isAutocomplete:E,gmapRegion:y,autoCompleteRegion:f,mapStyle:P,importInputComponent:O,importButtonComponent:F,autocompleteComponent:u,showTrace:G,traceButtonComponent:w,maxZoom:T,options:D,importModalComponent:S,isOpen:_,onClose:c,importButtonComponentModal:v,importDeleteIcon:M,importLocationIcon:Q,importFileIcon:N,importSuccessIcon:ne,importFailureIcon:C},re)=>{let L=(0,g.useRef)(null),[Z,K]=(0,g.useReducer)(ve,t),[ae,Re]=(0,g.useState)(),ie=(0,g.useMemo)(()=>(0,H.mapboxToGmapsViewState)(e),[e]),Oe=()=>{L.current.state.map.data.forEach(function(k){L.current.state.map.data.remove(k)});let A=ye(Z);if(A){A&&L.current.state.map.data.addGeoJson(A);let k=he(A);k&&L.current.state.map.fitBounds(k),T&&google.maps.event.addListenerOnce(L.current.state.map,"idle",function(){let be=L.current.state.map.getZoom();L.current.state.map.setZoom(Math.min(T,be))})}};(0,g.useEffect)(()=>{ae&&(n&&n(Z),re&&(re.current={addFeature:q,replaceFeature:Fe}),Oe())},[ae,Z]),(0,g.useEffect)(()=>{m&&JSON.stringify(Z)!==JSON.stringify(t)&&K({action:R.REPLACE,data:t})},[t]);let q=A=>{K({action:R.ADD,data:A,isMultiple:p})},Fe=A=>{K({action:R.REPLACE,data:[A]})},se=A=>{let k=ge(A);q(k)},Ne=()=>{K({action:R.CLEAR})},Ce=()=>Re(!0);return(0,l.jsx)(J.LoadScriptNext,{googleMapsApiKey:r,region:y,libraries:E?H.GMAPS_LIBRARIES.AUTOCOMPLETE:H.GMAPS_LIBRARIES.DEFAULT,children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{display:"flex"},children:[E&&(0,l.jsx)("div",{style:{width:"500px"},children:(0,l.jsx)($,{InputComponent:u||(0,l.jsx)("input",{}),addFeature:q,gmapRegion:f!=null?f:y})}),(0,l.jsx)("div",{style:{flex:"1"}})," ",(0,l.jsx)(oe,{ButtonComponent:F||(0,l.jsx)("button",{children:"add"}),ModalComponent:S&&g.default.cloneElement(S,{isOpen:_,onClose:c}),InputComponent:O||(0,l.jsx)("input",{}),addFeature:q,ButtonComponentModal:v||(0,l.jsx)("button",{children:"add"}),DeleteIcon:M,LocationIcon:Q,FileIcon:N,SuccessIcon:ne,FailureIcon:C})]}),G&&(0,l.jsx)(te,{TraceButtonComponent:w||(0,l.jsx)("button",{children:"trace"}),onFeatureAdded:se}),(0,l.jsxs)(J.GoogleMap,{id:"naksha-gmaps-draw",mapContainerStyle:P||{height:"100%",width:"100%"},zoom:ie.zoom,center:ie.center,options:ue,ref:L,onLoad:Ce,children:[p&&(0,l.jsx)(ee,{onClick:Ne}),!d&&(0,l.jsx)(J.Data,{options:U({controls:[s.POINT,s.POLYGON,s.LINESTRING],drawingMode:o||s.POLYGON,featureFactory:se},D||{})})]})]})})});0&&(module.exports={GMAP_FEATURE_TYPES,NakshaGmapsDraw});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@biodiv-platform/naksha-gmaps-draw",
|
|
3
|
-
"version": "4.5.1",
|
|
3
|
+
"version": "4.5.3-beta.1",
|
|
4
4
|
"author": "harshzalavadiya",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -34,12 +34,6 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@biodiv-platform/naksha-commons": "*",
|
|
37
|
-
"@
|
|
38
|
-
"@chakra-ui/react": "^2.8.2",
|
|
39
|
-
"@emotion/react": "^11.11.1",
|
|
40
|
-
"@emotion/styled": "^11.11.0",
|
|
41
|
-
"@turf/bbox": "^6.5.0",
|
|
42
|
-
"framer-motion": "^10.16.16",
|
|
43
|
-
"react-dropzone": "^14.2.3"
|
|
37
|
+
"@turf/bbox": "^6.5.0"
|
|
44
38
|
}
|
|
45
39
|
}
|