wacomm 2.2.9 → 2.2.11
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/images/imageCropper/ImageCropper.d.ts +1 -1
- package/dist/{index-BPyFSgAb.mjs → index-9WOB3wuR.mjs} +5 -5
- package/dist/{index-ZZNW-_Pg.js → index-BQkViuss.js} +2 -2
- package/dist/{mapbox-gl-Cx3MczhM.js → mapbox-gl-BsWEbIh4.js} +1 -1
- package/dist/{mapbox-gl-KZkKTlKI.mjs → mapbox-gl-D8AYr4UX.mjs} +1 -1
- package/dist/{maplibre-gl-CvLLJ_TB.mjs → maplibre-gl-ChdhrNfw.mjs} +1 -1
- package/dist/{maplibre-gl-BtoKKuE9.js → maplibre-gl-DXlLG4kq.js} +1 -1
- package/dist/wacomm.cjs.js +1 -1
- package/dist/wacomm.es.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ interface ImageCropperProps {
|
|
|
2
2
|
imageUrl: string;
|
|
3
3
|
fallbackImageUrl: string;
|
|
4
4
|
onSubmit: (x: number, y: number, size: number) => void;
|
|
5
|
-
onSelect: (file: File) =>
|
|
5
|
+
onSelect: (file: File) => Promise<string>;
|
|
6
6
|
error: string;
|
|
7
7
|
isLoading: boolean;
|
|
8
8
|
isCompleted: boolean;
|
|
@@ -50588,11 +50588,11 @@ function iz(e) {
|
|
|
50588
50588
|
}, [c]), null;
|
|
50589
50589
|
}
|
|
50590
50590
|
const TQ = la(iz);
|
|
50591
|
-
const az = import("./maplibre-gl-
|
|
50591
|
+
const az = import("./maplibre-gl-ChdhrNfw.mjs").then((e) => e.m), Az = Y.forwardRef(function(t, i) {
|
|
50592
50592
|
return L4(t, i, az);
|
|
50593
50593
|
}), lz = N4;
|
|
50594
50594
|
const cz = sz;
|
|
50595
|
-
const uz = import("./mapbox-gl-
|
|
50595
|
+
const uz = import("./mapbox-gl-D8AYr4UX.mjs").then((e) => e.m), PQ = Y.forwardRef(function(t, i) {
|
|
50596
50596
|
return L4(t, i, uz);
|
|
50597
50597
|
}), dz = N4;
|
|
50598
50598
|
function pz({ locations: e }) {
|
|
@@ -59717,11 +59717,11 @@ function xq({
|
|
|
59717
59717
|
m && b(!1);
|
|
59718
59718
|
}, [m]);
|
|
59719
59719
|
const { inputElement: U, trigger: J } = lu({
|
|
59720
|
-
onChange: (ee) => {
|
|
59720
|
+
onChange: async (ee) => {
|
|
59721
59721
|
const te = ee[0];
|
|
59722
59722
|
if (!te) return;
|
|
59723
|
-
const W =
|
|
59724
|
-
P(W),
|
|
59723
|
+
const W = await A(te);
|
|
59724
|
+
P(W), x({ x: 0, y: 0 }), I(1);
|
|
59725
59725
|
}
|
|
59726
59726
|
}), Z = In((ee, te) => {
|
|
59727
59727
|
z(te);
|
|
@@ -415,7 +415,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
415
415
|
* @license MIT
|
|
416
416
|
* This source code is licensed under the MIT license found in the
|
|
417
417
|
* LICENSE file in the root directory of this source tree.
|
|
418
|
-
*/function YN({value:e,setValue:t,disabled:i=!1}){return B.jsx(M0,{dateAdapter:nu,children:B.jsx(ZN,{value:e,disabled:i,onChange:t,slotProps:{textField:{sx:{"& .MuiPickersSectionList-root":{padding:0},"& .MuiPickersInputBase-sectionsContainer":{padding:0},width:"100%",height:30,"& .MuiInputBase-root":{height:30,"& .MuiInputBase-input":{padding:"0px 16px",color:"gray"}}}}}})})}function UN({startDate:e,endDate:t,isDayShown:i=!1,className:A=""}){const c=h=>{const y=Tr.parseDate(h);return i?y.format("dddd, MMM D"):Tr.formatDate(h)},m=Tr.parseDate(e).format("YYYY-MM-DD")===Tr.parseDate(t).format("YYYY-MM-DD")?`${c(e)}, ${Tr.formatTime(e)} - ${Tr.formatTime(t)}`:`${c(e)}, ${Tr.formatTime(e)} - ${c(t)}, ${Tr.formatTime(t)}`;return B.jsx("div",{className:mt("text-gray-600 text-sm",A),children:m})}function k4({date:e}){return!e||e.length<10?null:B.jsx("div",{className:"text-gray-600 text-sm",children:Tr.formatDateTime(e)})}const JN=Y.createContext(null);function XN(e,t){const i=Array.isArray(e)?e[0]:e?e.x:0,A=Array.isArray(e)?e[1]:e?e.y:0,c=Array.isArray(t)?t[0]:t?t.x:0,p=Array.isArray(t)?t[1]:t?t.y:0;return i===c&&A===p}function ks(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!ks(e[i],t[i]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e=="object"&&typeof t=="object"){const i=Object.keys(e),A=Object.keys(t);if(i.length!==A.length)return!1;for(const c of i)if(!t.hasOwnProperty(c)||!ks(e[c],t[c]))return!1;return!0}return!1}function _N(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function Hg(e,t){if(!e.getProjection)return;const i=e.getProjection(),A=t.getProjection();ks(i,A)||t.setProjection(i)}function Zg(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function Qg(e,t){const i=t.viewState||t;let A=!1;if("zoom"in i){const c=e.zoom;e.zoom=i.zoom,A=A||c!==e.zoom}if("bearing"in i){const c=e.bearing;e.bearing=i.bearing,A=A||c!==e.bearing}if("pitch"in i){const c=e.pitch;e.pitch=i.pitch,A=A||c!==e.pitch}if(i.padding&&!e.isPaddingEqual(i.padding)&&(A=!0,e.padding=i.padding),"longitude"in i&&"latitude"in i){const c=e.center;e.center=new c.constructor(i.longitude,i.latitude),A=A||c!==e.center}return A}const KN=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function qg(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const A of e.layers)t[A.id]=A;const i=e.layers.map(A=>{let c=null;"interactive"in A&&(c=Object.assign({},A),delete c.interactive);const p=t[A.ref];if(p){c=c||Object.assign({},A),delete c.ref;for(const m of KN)m in p&&(c[m]=p[m])}return c||A});return{...e,layers:i}}const Yg={version:8,sources:{},layers:[]},Ug={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},nf={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},Jg={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},$N=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],ez=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class tA{constructor(t,i,A){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=c=>{const p=this.props[Jg[c.type]];p?p(c):c.type==="error"&&console.error(c.error)},this._onPointerEvent=c=>{(c.type==="mousemove"||c.type==="mouseout")&&this._updateHover(c);const p=this.props[Ug[c.type]];p&&(this.props.interactiveLayerIds&&c.type!=="mouseover"&&c.type!=="mouseout"&&(c.features=this._hoveredFeatures||this._queryRenderedFeatures(c.point)),p(c),delete c.features)},this._onCameraEvent=c=>{if(!this._internalUpdate){const p=this.props[nf[c.type]];p&&p(c)}c.type in this._deferredEvents&&(this._deferredEvents[c.type]=!1)},this._MapClass=t,this.props=i,this._initialize(A)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const i=this.props;this.props=t;const A=this._updateSettings(t,i);A&&this._createShadowTransform(this._map);const c=this._updateSize(t),p=this._updateViewState(t,!0);this._updateStyle(t,i),this._updateStyleComponents(t,i),this._updateHandlers(t,i),(A||c||p&&!this._map.isMoving())&&this.redraw()}static reuse(t,i){const A=tA.savedMaps.pop();if(!A)return null;const c=A.map,p=c.getContainer();for(i.className=p.className;p.childNodes.length>0;)i.appendChild(p.childNodes[0]);c._container=i;const m=c._resizeObserver;m&&(m.disconnect(),m.observe(i)),A.setProps({...t,styleDiffing:!1}),c.resize();const{initialViewState:h}=t;return h&&(h.bounds?c.fitBounds(h.bounds,{...h.fitBoundsOptions,duration:0}):A._updateViewState(h,!1)),c.isStyleLoaded()?c.fire("load"):c.once("styledata",()=>c.fire("load")),c._update(),A}_initialize(t){const{props:i}=this,{mapStyle:A=Yg}=i,c={...i,...i.initialViewState,accessToken:i.mapboxAccessToken||tz()||null,container:t,style:qg(A)},p=c.initialViewState||c.viewState||c;if(Object.assign(c,{center:[p.longitude||0,p.latitude||0],zoom:p.zoom||0,pitch:p.pitch||0,bearing:p.bearing||0}),i.gl){const w=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=w,i.gl)}const m=new this._MapClass(c);p.padding&&m.setPadding(p.padding),i.cursor&&(m.getCanvas().style.cursor=i.cursor),this._createShadowTransform(m);const h=m._render;m._render=w=>{this._inRender=!0,h.call(m,w),this._inRender=!1};const y=m._renderTaskQueue.run;m._renderTaskQueue.run=w=>{y.call(m._renderTaskQueue,w),this._onBeforeRepaint()},m.on("render",()=>this._onAfterRepaint());const b=m.fire;m.fire=this._fireEvent.bind(this,b),m.on("resize",()=>{this._renderTransform.resize(m.transform.width,m.transform.height)}),m.on("styledata",()=>{this._updateStyleComponents(this.props,{}),Hg(m.transform,this._renderTransform)}),m.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const w in Ug)m.on(w,this._onPointerEvent);for(const w in nf)m.on(w,this._onCameraEvent);for(const w in Jg)m.on(w,this._onEvent);this._map=m}recycle(){const i=this.map.getContainer().querySelector("[mapboxgl-children]");i==null||i.remove(),tA.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const i=_N(t.transform);t.painter.transform=i,this._renderTransform=i}_updateSize(t){const{viewState:i}=t;if(i){const A=this._map;if(i.width!==A.transform.width||i.height!==A.transform.height)return A.resize(),!0}return!1}_updateViewState(t,i){if(this._internalUpdate)return!1;const A=this._map,c=this._renderTransform,{zoom:p,pitch:m,bearing:h}=c,y=A.isMoving();y&&(c.cameraElevationReference="sea");const b=Qg(c,{...Zg(A.transform),...t});if(y&&(c.cameraElevationReference="ground"),b&&i){const w=this._deferredEvents;w.move=!0,w.zoom||(w.zoom=p!==c.zoom),w.rotate||(w.rotate=h!==c.bearing),w.pitch||(w.pitch=m!==c.pitch)}return y||Qg(A.transform,t),b}_updateSettings(t,i){const A=this._map;let c=!1;for(const p of $N)if(p in t&&!ks(t[p],i[p])){c=!0;const m=A[`set${p[0].toUpperCase()}${p.slice(1)}`];m==null||m.call(A,t[p])}return c}_updateStyle(t,i){if(t.cursor!==i.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==i.mapStyle){const{mapStyle:A=Yg,styleDiffing:c=!0}=t,p={diff:c};return"localIdeographFontFamily"in t&&(p.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(qg(A),p),!0}return!1}_updateStyleComponents(t,i){const A=this._map;let c=!1;return A.isStyleLoaded()&&("light"in t&&A.setLight&&!ks(t.light,i.light)&&(c=!0,A.setLight(t.light)),"fog"in t&&A.setFog&&!ks(t.fog,i.fog)&&(c=!0,A.setFog(t.fog)),"terrain"in t&&A.setTerrain&&!ks(t.terrain,i.terrain)&&(!t.terrain||A.getSource(t.terrain.source))&&(c=!0,A.setTerrain(t.terrain))),c}_updateHandlers(t,i){var A,c;const p=this._map;let m=!1;for(const h of ez){const y=(A=t[h])!==null&&A!==void 0?A:!0,b=(c=i[h])!==null&&c!==void 0?c:!0;ks(y,b)||(m=!0,y?p[h].enable(y):p[h].disable())}return m}_queryRenderedFeatures(t){const i=this._map,A=i.transform,{interactiveLayerIds:c=[]}=this.props;try{return i.transform=this._renderTransform,i.queryRenderedFeatures(t,{layers:c.filter(i.getLayer.bind(i))})}catch{return[]}finally{i.transform=A}}_updateHover(t){var i;const{props:A}=this;if(A.interactiveLayerIds&&(A.onMouseMove||A.onMouseEnter||A.onMouseLeave)){const p=t.type,m=((i=this._hoveredFeatures)===null||i===void 0?void 0:i.length)>0,h=this._queryRenderedFeatures(t.point),y=h.length>0;!y&&m&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=h,y&&!m&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=p}else this._hoveredFeatures=null}_fireEvent(t,i,A){const c=this._map,p=c.transform,m=typeof i=="string"?i:i.type;return m==="move"&&this._updateViewState(this.props,!1),m in nf&&(typeof i=="object"&&(i.viewState=Zg(p)),this._map.isMoving())?(c.transform=this._renderTransform,t.call(c,i,A),c.transform=p,c):(t.call(c,i,A),c)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const A in this._deferredEvents)this._deferredEvents[A]&&t.fire(A);this._internalUpdate=!1;const i=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{Hg(this._renderTransform,i),t.transform=i}}}tA.savedMaps=[];function tz(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||process.env.MapboxAccessToken}catch{}try{e=e||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const oz=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function nz(e){if(!e)return null;const t=e.map,i={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:A=>{const c=t.transform;t.transform=e.transform;const p=t.project(A);return t.transform=c,p},unproject:A=>{const c=t.transform;t.transform=e.transform;const p=t.unproject(A);return t.transform=c,p},queryTerrainElevation:(A,c)=>{const p=t.transform;t.transform=e.transform;const m=t.queryTerrainElevation(A,c);return t.transform=p,m},queryRenderedFeatures:(A,c)=>{const p=t.transform;t.transform=e.transform;const m=t.queryRenderedFeatures(A,c);return t.transform=p,m}};for(const A of rz(t))!(A in i)&&!oz.includes(A)&&(i[A]=t[A].bind(t));return i}function rz(e){const t=new Set;let i=e;for(;i;){for(const A of Object.getOwnPropertyNames(i))A[0]!=="_"&&typeof e[A]=="function"&&A!=="fire"&&A!=="setEventedParent"&&t.add(A);i=Object.getPrototypeOf(i)}return Array.from(t)}const sz=typeof document<"u"?ve.useLayoutEffect:ve.useEffect,iz=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function az(e,t){for(const A of iz)A in t&&(e[A]=t[A]);const{RTLTextPlugin:i="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;i&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(i,A=>{A&&console.error(A)},!0)}const ju=Y.createContext(null);function I4(e,t,i){const A=ve.useContext(JN),[c,p]=ve.useState(null),m=ve.useRef(),{current:h}=ve.useRef({mapLib:null,map:null});ve.useEffect(()=>{const w=e.mapLib;let C=!0,S;return Promise.resolve(w||i).then(x=>{if(!C)return;if(!x)throw new Error("Invalid mapLib");const I="Map"in x?x:x.default;if(!I.Map)throw new Error("Invalid mapLib");if(az(I,e),!I.supported||I.supported(e))e.reuseMaps&&(S=tA.reuse(e,m.current)),S||(S=new tA(I.Map,e,m.current)),h.map=nz(S),h.mapLib=I,p(S),A==null||A.onMapMount(h.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(x=>{const{onError:I}=e;I?I({type:"error",target:null,originalEvent:null,error:x}):console.error(x)}),()=>{C=!1,S&&(A==null||A.onMapUnmount(e.id),e.reuseMaps?S.recycle():S.destroy())}},[]),sz(()=>{c&&c.setProps(e)}),ve.useImperativeHandle(t,()=>h.map,[c]);const y=ve.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),b={height:"100%"};return Y.createElement("div",{id:e.id,ref:m,style:y},c&&Y.createElement(ju.Provider,{value:h},Y.createElement("div",{"mapboxgl-children":"",style:b},e.children)))}const Az=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function ua(e,t){if(!e||!t)return;const i=e.style;for(const A in t){const c=t[A];Number.isFinite(c)&&!Az.test(A)?i[A]=`${c}px`:i[A]=c}}function lz(e,t){const{map:i,mapLib:A}=ve.useContext(ju),c=ve.useRef({props:e});c.current.props=e;const p=ve.useMemo(()=>{let k=!1;Y.Children.forEach(e.children,U=>{U&&(k=!0)});const D={...e,element:k?document.createElement("div"):null},z=new A.Marker(D);return z.setLngLat([e.longitude,e.latitude]),z.getElement().addEventListener("click",U=>{var J,Z;(Z=(J=c.current.props).onClick)===null||Z===void 0||Z.call(J,{type:"click",target:z,originalEvent:U})}),z.on("dragstart",U=>{var J,Z;const $=U;$.lngLat=p.getLngLat(),(Z=(J=c.current.props).onDragStart)===null||Z===void 0||Z.call(J,$)}),z.on("drag",U=>{var J,Z;const $=U;$.lngLat=p.getLngLat(),(Z=(J=c.current.props).onDrag)===null||Z===void 0||Z.call(J,$)}),z.on("dragend",U=>{var J,Z;const $=U;$.lngLat=p.getLngLat(),(Z=(J=c.current.props).onDragEnd)===null||Z===void 0||Z.call(J,$)}),z},[]);ve.useEffect(()=>(p.addTo(i.getMap()),()=>{p.remove()}),[]);const{longitude:m,latitude:h,offset:y,style:b,draggable:w=!1,popup:C=null,rotation:S=0,rotationAlignment:x="auto",pitchAlignment:I="auto"}=e;return ve.useEffect(()=>{ua(p.getElement(),b)},[b]),ve.useImperativeHandle(t,()=>p,[]),(p.getLngLat().lng!==m||p.getLngLat().lat!==h)&&p.setLngLat([m,h]),y&&!XN(p.getOffset(),y)&&p.setOffset(y),p.isDraggable()!==w&&p.setDraggable(w),p.getRotation()!==S&&p.setRotation(S),p.getRotationAlignment()!==x&&p.setRotationAlignment(x),p.getPitchAlignment()!==I&&p.setPitchAlignment(I),p.getPopup()!==C&&p.setPopup(C),is.createPortal(e.children,p.getElement())}const M4=ve.memo(ve.forwardRef(lz));function Xg(e){return new Set(e?e.trim().split(/\s+/):[])}function cz(e,t){const{map:i,mapLib:A}=ve.useContext(ju),c=ve.useMemo(()=>document.createElement("div"),[]),p=ve.useRef({props:e});p.current.props=e;const m=ve.useMemo(()=>{const h={...e},y=new A.Popup(h);return y.setLngLat([e.longitude,e.latitude]),y.once("open",b=>{var w,C;(C=(w=p.current.props).onOpen)===null||C===void 0||C.call(w,b)}),y},[]);if(ve.useEffect(()=>{const h=y=>{var b,w;(w=(b=p.current.props).onClose)===null||w===void 0||w.call(b,y)};return m.on("close",h),m.setDOMContent(c).addTo(i.getMap()),()=>{m.off("close",h),m.isOpen()&&m.remove()}},[]),ve.useEffect(()=>{ua(m.getElement(),e.style)},[e.style]),ve.useImperativeHandle(t,()=>m,[]),m.isOpen()&&((m.getLngLat().lng!==e.longitude||m.getLngLat().lat!==e.latitude)&&m.setLngLat([e.longitude,e.latitude]),e.offset&&!ks(m.options.offset,e.offset)&&m.setOffset(e.offset),(m.options.anchor!==e.anchor||m.options.maxWidth!==e.maxWidth)&&(m.options.anchor=e.anchor,m.setMaxWidth(e.maxWidth)),m.options.className!==e.className)){const h=Xg(m.options.className),y=Xg(e.className);for(const b of h)y.has(b)||m.removeClassName(b);for(const b of y)h.has(b)||m.addClassName(b);m.options.className=e.className}return is.createPortal(e.children,c)}const FQ=ve.memo(ve.forwardRef(cz));function z0(e,t,i,A){const c=ve.useContext(ju),p=ve.useMemo(()=>e(c),[]);return ve.useEffect(()=>{const m=A||i||t,h=typeof t=="function"&&typeof i=="function"?t:null,y=typeof i=="function"?i:typeof t=="function"?t:null,{map:b}=c;return b.hasControl(p)||(b.addControl(p,m==null?void 0:m.position),h&&h(c)),()=>{y&&y(c),b.hasControl(p)&&b.removeControl(p)}},[]),p}function uz(e){const t=z0(({mapLib:i})=>new i.AttributionControl(e),{position:e.position});return ve.useEffect(()=>{ua(t._container,e.style)},[e.style]),null}const VQ=ve.memo(uz);function dz(e){const t=z0(({mapLib:i})=>new i.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return ve.useEffect(()=>{ua(t._controlContainer,e.style)},[e.style]),null}const GQ=ve.memo(dz);function pz(e,t){const i=ve.useRef({props:e}),A=z0(({mapLib:c})=>{const p=new c.GeolocateControl(e),m=p._setupUI;return p._setupUI=h=>{p._container.hasChildNodes()||m(h)},p.on("geolocate",h=>{var y,b;(b=(y=i.current.props).onGeolocate)===null||b===void 0||b.call(y,h)}),p.on("error",h=>{var y,b;(b=(y=i.current.props).onError)===null||b===void 0||b.call(y,h)}),p.on("outofmaxbounds",h=>{var y,b;(b=(y=i.current.props).onOutOfMaxBounds)===null||b===void 0||b.call(y,h)}),p.on("trackuserlocationstart",h=>{var y,b;(b=(y=i.current.props).onTrackUserLocationStart)===null||b===void 0||b.call(y,h)}),p.on("trackuserlocationend",h=>{var y,b;(b=(y=i.current.props).onTrackUserLocationEnd)===null||b===void 0||b.call(y,h)}),p},{position:e.position});return i.current.props=e,ve.useImperativeHandle(t,()=>A,[]),ve.useEffect(()=>{ua(A._container,e.style)},[e.style]),null}const WQ=ve.memo(ve.forwardRef(pz));function fz(e){const t=z0(({mapLib:i})=>new i.NavigationControl(e),{position:e.position});return ve.useEffect(()=>{ua(t._container,e.style)},[e.style]),null}const mz=ve.memo(fz);function hz(e){const t=z0(({mapLib:p})=>new p.ScaleControl(e),{position:e.position}),i=ve.useRef(e),A=i.current;i.current=e;const{style:c}=e;return e.maxWidth!==void 0&&e.maxWidth!==A.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==A.unit&&t.setUnit(e.unit),ve.useEffect(()=>{ua(t._container,c)},[c]),null}const HQ=ve.memo(hz);const gz=Promise.resolve().then(()=>require("./maplibre-gl-BtoKKuE9.js")).then(e=>e.maplibreGl),yz=Y.forwardRef(function(t,i){return I4(t,i,gz)}),bz=M4;const vz=mz;const wz=Promise.resolve().then(()=>require("./mapbox-gl-Cx3MczhM.js")).then(e=>e.mapboxGl),ZQ=Y.forwardRef(function(t,i){return I4(t,i,wz)}),Tz=M4;function Cz({locations:e}){if(h6.IsZeroArray(e))return null;const t=({id:i,longitude:A,latitude:c,icon:p})=>B.jsx("li",{children:B.jsx(Tz,{longitude:A,latitude:c,children:p})},i);return B.jsx(cA,{items:e,itemRenderer:t})}const Pz=({lng:e,lat:t,zoom:i=10,setCoordinates:A,locations:c=[],token:p,navigationControl:m})=>{const h=ve.useRef(null),[y,b]=ve.useState({longitude:e,latitude:t,zoom:i});return ve.useEffect(()=>{h.current&&h.current.flyTo({center:[e,t],duration:3e3,essential:!0})},[t,e]),B.jsxs(yz,{ref:h,...y,mapStyle:`https://tiles.locationiq.com/v3/streets/vector.json?key=${p}`,style:{width:"100%",height:"100%"},onMove:w=>b(w.viewState),onClick:w=>{const{lng:C,lat:S}=w.lngLat;A&&A({lat:S,lng:C})},children:[B.jsx(bz,{longitude:e,latitude:t,children:"📌"}),B.jsx(Cz,{locations:c}),B.jsx(vz,{position:m.position})]})};var D4=(e=>(e.TR="top-right",e))(D4||{});const $i=Math.min,qs=Math.max,$s=Math.round,Hs=Math.floor,Xn=e=>({x:e,y:e}),xz={left:"right",right:"left",bottom:"top",top:"bottom"};function u2(e,t,i){return qs(e,$i(t,i))}function F0(e,t){return typeof e=="function"?e(t):e}function ea(e){return e.split("-")[0]}function V0(e){return e.split("-")[1]}function O4(e){return e==="x"?"y":"x"}function U1(e){return e==="y"?"height":"width"}function Zs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function J1(e){return O4(Zs(e))}function Sz(e,t,i){i===void 0&&(i=!1);const A=V0(e),c=J1(e),p=U1(c);let m=c==="x"?A===(i?"end":"start")?"right":"left":A==="start"?"bottom":"top";return t.reference[p]>t.floating[p]&&(m=Yc(m)),[m,Yc(m)]}function kz(e){const t=Yc(e);return[d2(e),t,d2(t)]}function d2(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const _g=["left","right"],Kg=["right","left"],Iz=["top","bottom"],Mz=["bottom","top"];function Dz(e,t,i){switch(e){case"top":case"bottom":return i?t?Kg:_g:t?_g:Kg;case"left":case"right":return t?Iz:Mz;default:return[]}}function Oz(e,t,i,A){const c=V0(e);let p=Dz(ea(e),i==="start",A);return c&&(p=p.map(m=>m+"-"+c),t&&(p=p.concat(p.map(d2)))),p}function Yc(e){const t=ea(e);return xz[t]+e.slice(t.length)}function Ez(e){return{top:0,right:0,bottom:0,left:0,...e}}function E4(e){return typeof e!="number"?Ez(e):{top:e,right:e,bottom:e,left:e}}function w0(e){const{x:t,y:i,width:A,height:c}=e;return{width:A,height:c,top:i,left:t,right:t+A,bottom:i+c,x:t,y:i}}function $g(e,t,i){let{reference:A,floating:c}=e;const p=Zs(t),m=J1(t),h=U1(m),y=ea(t),b=p==="y",w=A.x+A.width/2-c.width/2,C=A.y+A.height/2-c.height/2,S=A[h]/2-c[h]/2;let x;switch(y){case"top":x={x:w,y:A.y-c.height};break;case"bottom":x={x:w,y:A.y+A.height};break;case"right":x={x:A.x+A.width,y:C};break;case"left":x={x:A.x-c.width,y:C};break;default:x={x:A.x,y:A.y}}switch(V0(t)){case"start":x[m]-=S*(i&&b?-1:1);break;case"end":x[m]+=S*(i&&b?-1:1);break}return x}async function Rz(e,t){var i;t===void 0&&(t={});const{x:A,y:c,platform:p,rects:m,elements:h,strategy:y}=e,{boundary:b="clippingAncestors",rootBoundary:w="viewport",elementContext:C="floating",altBoundary:S=!1,padding:x=0}=F0(t,e),I=E4(x),D=h[S?C==="floating"?"reference":"floating":C],z=w0(await p.getClippingRect({element:(i=await(p.isElement==null?void 0:p.isElement(D)))==null||i?D:D.contextElement||await(p.getDocumentElement==null?void 0:p.getDocumentElement(h.floating)),boundary:b,rootBoundary:w,strategy:y})),U=C==="floating"?{x:A,y:c,width:m.floating.width,height:m.floating.height}:m.reference,J=await(p.getOffsetParent==null?void 0:p.getOffsetParent(h.floating)),Z=await(p.isElement==null?void 0:p.isElement(J))?await(p.getScale==null?void 0:p.getScale(J))||{x:1,y:1}:{x:1,y:1},$=w0(p.convertOffsetParentRelativeRectToViewportRelativeRect?await p.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:U,offsetParent:J,strategy:y}):U);return{top:(z.top-$.top+I.top)/Z.y,bottom:($.bottom-z.bottom+I.bottom)/Z.y,left:(z.left-$.left+I.left)/Z.x,right:($.right-z.right+I.right)/Z.x}}const Bz=50,jz=async(e,t,i)=>{const{placement:A="bottom",strategy:c="absolute",middleware:p=[],platform:m}=i,h=m.detectOverflow?m:{...m,detectOverflow:Rz},y=await(m.isRTL==null?void 0:m.isRTL(t));let b=await m.getElementRects({reference:e,floating:t,strategy:c}),{x:w,y:C}=$g(b,A,y),S=A,x=0;const I={};for(let k=0;k<p.length;k++){const D=p[k];if(!D)continue;const{name:z,fn:U}=D,{x:J,y:Z,data:$,reset:q}=await U({x:w,y:C,initialPlacement:A,placement:S,strategy:c,middlewareData:I,rects:b,platform:h,elements:{reference:e,floating:t}});w=J??w,C=Z??C,I[z]={...I[z],...$},q&&x<Bz&&(x++,typeof q=="object"&&(q.placement&&(S=q.placement),q.rects&&(b=q.rects===!0?await m.getElementRects({reference:e,floating:t,strategy:c}):q.rects),{x:w,y:C}=$g(b,S,y)),k=-1)}return{x:w,y:C,placement:S,strategy:c,middlewareData:I}},Lz=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:A,placement:c,rects:p,platform:m,elements:h,middlewareData:y}=t,{element:b,padding:w=0}=F0(e,t)||{};if(b==null)return{};const C=E4(w),S={x:i,y:A},x=J1(c),I=U1(x),k=await m.getDimensions(b),D=x==="y",z=D?"top":"left",U=D?"bottom":"right",J=D?"clientHeight":"clientWidth",Z=p.reference[I]+p.reference[x]-S[x]-p.floating[I],$=S[x]-p.reference[x],q=await(m.getOffsetParent==null?void 0:m.getOffsetParent(b));let Q=q?q[J]:0;(!Q||!await(m.isElement==null?void 0:m.isElement(q)))&&(Q=h.floating[J]||p.floating[I]);const ee=Z/2-$/2,te=Q/2-k[I]/2-1,W=$i(C[z],te),G=$i(C[U],te),E=W,ne=Q-k[I]-G,N=Q/2-k[I]/2+ee,R=u2(E,N,ne),V=!y.arrow&&V0(c)!=null&&N!==R&&p.reference[I]/2-(N<E?W:G)-k[I]/2<0,F=V?N<E?N-E:N-ne:0;return{[x]:S[x]+F,data:{[x]:R,centerOffset:N-R-F,...V&&{alignmentOffset:F}},reset:V}}});const Nz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,A;const{placement:c,middlewareData:p,rects:m,initialPlacement:h,platform:y,elements:b}=t,{mainAxis:w=!0,crossAxis:C=!0,fallbackPlacements:S,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:I="none",flipAlignment:k=!0,...D}=F0(e,t);if((i=p.arrow)!=null&&i.alignmentOffset)return{};const z=ea(c),U=Zs(h),J=ea(h)===h,Z=await(y.isRTL==null?void 0:y.isRTL(b.floating)),$=S||(J||!k?[Yc(h)]:kz(h)),q=I!=="none";!S&&q&&$.push(...Oz(h,k,I,Z));const Q=[h,...$],ee=await y.detectOverflow(t,D),te=[];let W=((A=p.flip)==null?void 0:A.overflows)||[];if(w&&te.push(ee[z]),C){const N=Sz(c,m,Z);te.push(ee[N[0]],ee[N[1]])}if(W=[...W,{placement:c,overflows:te}],!te.every(N=>N<=0)){var G,E;const N=(((G=p.flip)==null?void 0:G.index)||0)+1,R=Q[N];if(R&&(!(C==="alignment"?U!==Zs(R):!1)||W.every(P=>Zs(P.placement)===U?P.overflows[0]>0:!0)))return{data:{index:N,overflows:W},reset:{placement:R}};let V=(E=W.filter(F=>F.overflows[0]<=0).sort((F,P)=>F.overflows[1]-P.overflows[1])[0])==null?void 0:E.placement;if(!V)switch(x){case"bestFit":{var ne;const F=(ne=W.filter(P=>{if(q){const re=Zs(P.placement);return re===U||re==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(re=>re>0).reduce((re,ae)=>re+ae,0)]).sort((P,re)=>P[1]-re[1])[0])==null?void 0:ne[0];F&&(V=F);break}case"initialPlacement":V=h;break}if(c!==V)return{reset:{placement:V}}}return{}}}};const zz=new Set(["left","top"]);async function Fz(e,t){const{placement:i,platform:A,elements:c}=e,p=await(A.isRTL==null?void 0:A.isRTL(c.floating)),m=ea(i),h=V0(i),y=Zs(i)==="y",b=zz.has(m)?-1:1,w=p&&y?-1:1,C=F0(t,e);let{mainAxis:S,crossAxis:x,alignmentAxis:I}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:C.mainAxis||0,crossAxis:C.crossAxis||0,alignmentAxis:C.alignmentAxis};return h&&typeof I=="number"&&(x=h==="end"?I*-1:I),y?{x:x*w,y:S*b}:{x:S*b,y:x*w}}const Vz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,A;const{x:c,y:p,placement:m,middlewareData:h}=t,y=await Fz(t,e);return m===((i=h.offset)==null?void 0:i.placement)&&(A=h.arrow)!=null&&A.alignmentOffset?{}:{x:c+y.x,y:p+y.y,data:{...y,placement:m}}}}},Gz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:A,placement:c,platform:p}=t,{mainAxis:m=!0,crossAxis:h=!1,limiter:y={fn:z=>{let{x:U,y:J}=z;return{x:U,y:J}}},...b}=F0(e,t),w={x:i,y:A},C=await p.detectOverflow(t,b),S=Zs(ea(c)),x=O4(S);let I=w[x],k=w[S];if(m){const z=x==="y"?"top":"left",U=x==="y"?"bottom":"right",J=I+C[z],Z=I-C[U];I=u2(J,I,Z)}if(h){const z=S==="y"?"top":"left",U=S==="y"?"bottom":"right",J=k+C[z],Z=k-C[U];k=u2(J,k,Z)}const D=y.fn({...t,[x]:I,[S]:k});return{...D,data:{x:D.x-i,y:D.y-A,enabled:{[x]:m,[S]:h}}}}}};function Lu(){return typeof window<"u"}function yA(e){return R4(e)?(e.nodeName||"").toLowerCase():"#document"}function Sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jr(e){var t;return(t=(R4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function R4(e){return Lu()?e instanceof Node||e instanceof Sn(e).Node:!1}function Kn(e){return Lu()?e instanceof Element||e instanceof Sn(e).Element:!1}function Xr(e){return Lu()?e instanceof HTMLElement||e instanceof Sn(e).HTMLElement:!1}function ey(e){return!Lu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sn(e).ShadowRoot}function G0(e){const{overflow:t,overflowX:i,overflowY:A,display:c}=mr(e);return/auto|scroll|overlay|hidden|clip/.test(t+A+i)&&c!=="inline"&&c!=="contents"}function Wz(e){return/^(table|td|th)$/.test(yA(e))}function Nu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Hz=/transform|translate|scale|rotate|perspective|filter/,Zz=/paint|layout|strict|content/,Fi=e=>!!e&&e!=="none";let rf;function X1(e){const t=Kn(e)?mr(e):e;return Fi(t.transform)||Fi(t.translate)||Fi(t.scale)||Fi(t.rotate)||Fi(t.perspective)||!zu()&&(Fi(t.backdropFilter)||Fi(t.filter))||Hz.test(t.willChange||"")||Zz.test(t.contain||"")}function Qz(e){let t=ei(e);for(;Xr(t)&&!oA(t);){if(X1(t))return t;if(Nu(t))return null;t=ei(t)}return null}function zu(){return rf==null&&(rf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),rf}function oA(e){return/^(html|body|#document)$/.test(yA(e))}function mr(e){return Sn(e).getComputedStyle(e)}function Fu(e){return Kn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ei(e){if(yA(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ey(e)&&e.host||Jr(e);return ey(t)?t.host:t}function B4(e){const t=ei(e);return oA(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&G0(t)?t:B4(t)}function ta(e,t,i){var A;t===void 0&&(t=[]),i===void 0&&(i=!0);const c=B4(e),p=c===((A=e.ownerDocument)==null?void 0:A.body),m=Sn(c);if(p){const h=T0(m);return t.concat(m,m.visualViewport||[],G0(c)?c:[],h&&i?ta(h):[])}else return t.concat(c,ta(c,[],i))}function T0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j4(e){const t=mr(e);let i=parseFloat(t.width)||0,A=parseFloat(t.height)||0;const c=Xr(e),p=c?e.offsetWidth:i,m=c?e.offsetHeight:A,h=$s(i)!==p||$s(A)!==m;return h&&(i=p,A=m),{width:i,height:A,$:h}}function _1(e){return Kn(e)?e:e.contextElement}function Va(e){const t=_1(e);if(!Xr(t))return Xn(1);const i=t.getBoundingClientRect(),{width:A,height:c,$:p}=j4(t);let m=(p?$s(i.width):i.width)/A,h=(p?$s(i.height):i.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!h||!Number.isFinite(h))&&(h=1),{x:m,y:h}}const qz=Xn(0);function L4(e){const t=Sn(e);return!zu()||!t.visualViewport?qz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yz(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==Sn(e)?!1:t}function oa(e,t,i,A){t===void 0&&(t=!1),i===void 0&&(i=!1);const c=e.getBoundingClientRect(),p=_1(e);let m=Xn(1);t&&(A?Kn(A)&&(m=Va(A)):m=Va(e));const h=Yz(p,i,A)?L4(p):Xn(0);let y=(c.left+h.x)/m.x,b=(c.top+h.y)/m.y,w=c.width/m.x,C=c.height/m.y;if(p){const S=Sn(p),x=A&&Kn(A)?Sn(A):A;let I=S,k=T0(I);for(;k&&A&&x!==I;){const D=Va(k),z=k.getBoundingClientRect(),U=mr(k),J=z.left+(k.clientLeft+parseFloat(U.paddingLeft))*D.x,Z=z.top+(k.clientTop+parseFloat(U.paddingTop))*D.y;y*=D.x,b*=D.y,w*=D.x,C*=D.y,y+=J,b+=Z,I=Sn(k),k=T0(I)}}return w0({width:w,height:C,x:y,y:b})}function Vu(e,t){const i=Fu(e).scrollLeft;return t?t.left+i:oa(Jr(e)).left+i}function N4(e,t){const i=e.getBoundingClientRect(),A=i.left+t.scrollLeft-Vu(e,i),c=i.top+t.scrollTop;return{x:A,y:c}}function Uz(e){let{elements:t,rect:i,offsetParent:A,strategy:c}=e;const p=c==="fixed",m=Jr(A),h=t?Nu(t.floating):!1;if(A===m||h&&p)return i;let y={scrollLeft:0,scrollTop:0},b=Xn(1);const w=Xn(0),C=Xr(A);if((C||!C&&!p)&&((yA(A)!=="body"||G0(m))&&(y=Fu(A)),C)){const x=oa(A);b=Va(A),w.x=x.x+A.clientLeft,w.y=x.y+A.clientTop}const S=m&&!C&&!p?N4(m,y):Xn(0);return{width:i.width*b.x,height:i.height*b.y,x:i.x*b.x-y.scrollLeft*b.x+w.x+S.x,y:i.y*b.y-y.scrollTop*b.y+w.y+S.y}}function Jz(e){return Array.from(e.getClientRects())}function Xz(e){const t=Jr(e),i=Fu(e),A=e.ownerDocument.body,c=qs(t.scrollWidth,t.clientWidth,A.scrollWidth,A.clientWidth),p=qs(t.scrollHeight,t.clientHeight,A.scrollHeight,A.clientHeight);let m=-i.scrollLeft+Vu(e);const h=-i.scrollTop;return mr(A).direction==="rtl"&&(m+=qs(t.clientWidth,A.clientWidth)-c),{width:c,height:p,x:m,y:h}}const ty=25;function _z(e,t){const i=Sn(e),A=Jr(e),c=i.visualViewport;let p=A.clientWidth,m=A.clientHeight,h=0,y=0;if(c){p=c.width,m=c.height;const w=zu();(!w||w&&t==="fixed")&&(h=c.offsetLeft,y=c.offsetTop)}const b=Vu(A);if(b<=0){const w=A.ownerDocument,C=w.body,S=getComputedStyle(C),x=w.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,I=Math.abs(A.clientWidth-C.clientWidth-x);I<=ty&&(p-=I)}else b<=ty&&(p+=b);return{width:p,height:m,x:h,y}}function Kz(e,t){const i=oa(e,!0,t==="fixed"),A=i.top+e.clientTop,c=i.left+e.clientLeft,p=Xr(e)?Va(e):Xn(1),m=e.clientWidth*p.x,h=e.clientHeight*p.y,y=c*p.x,b=A*p.y;return{width:m,height:h,x:y,y:b}}function oy(e,t,i){let A;if(t==="viewport")A=_z(e,i);else if(t==="document")A=Xz(Jr(e));else if(Kn(t))A=Kz(t,i);else{const c=L4(e);A={x:t.x-c.x,y:t.y-c.y,width:t.width,height:t.height}}return w0(A)}function z4(e,t){const i=ei(e);return i===t||!Kn(i)||oA(i)?!1:mr(i).position==="fixed"||z4(i,t)}function $z(e,t){const i=t.get(e);if(i)return i;let A=ta(e,[],!1).filter(h=>Kn(h)&&yA(h)!=="body"),c=null;const p=mr(e).position==="fixed";let m=p?ei(e):e;for(;Kn(m)&&!oA(m);){const h=mr(m),y=X1(m);!y&&h.position==="fixed"&&(c=null),(p?!y&&!c:!y&&h.position==="static"&&!!c&&(c.position==="absolute"||c.position==="fixed")||G0(m)&&!y&&z4(e,m))?A=A.filter(w=>w!==m):c=h,m=ei(m)}return t.set(e,A),A}function eF(e){let{element:t,boundary:i,rootBoundary:A,strategy:c}=e;const m=[...i==="clippingAncestors"?Nu(t)?[]:$z(t,this._c):[].concat(i),A],h=oy(t,m[0],c);let y=h.top,b=h.right,w=h.bottom,C=h.left;for(let S=1;S<m.length;S++){const x=oy(t,m[S],c);y=qs(x.top,y),b=$i(x.right,b),w=$i(x.bottom,w),C=qs(x.left,C)}return{width:b-C,height:w-y,x:C,y}}function tF(e){const{width:t,height:i}=j4(e);return{width:t,height:i}}function oF(e,t,i){const A=Xr(t),c=Jr(t),p=i==="fixed",m=oa(e,!0,p,t);let h={scrollLeft:0,scrollTop:0};const y=Xn(0);function b(){y.x=Vu(c)}if(A||!A&&!p)if((yA(t)!=="body"||G0(c))&&(h=Fu(t)),A){const x=oa(t,!0,p,t);y.x=x.x+t.clientLeft,y.y=x.y+t.clientTop}else c&&b();p&&!A&&c&&b();const w=c&&!A&&!p?N4(c,h):Xn(0),C=m.left+h.scrollLeft-y.x-w.x,S=m.top+h.scrollTop-y.y-w.y;return{x:C,y:S,width:m.width,height:m.height}}function sf(e){return mr(e).position==="static"}function ny(e,t){if(!Xr(e)||mr(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return Jr(e)===i&&(i=i.ownerDocument.body),i}function F4(e,t){const i=Sn(e);if(Nu(e))return i;if(!Xr(e)){let c=ei(e);for(;c&&!oA(c);){if(Kn(c)&&!sf(c))return c;c=ei(c)}return i}let A=ny(e,t);for(;A&&Wz(A)&&sf(A);)A=ny(A,t);return A&&oA(A)&&sf(A)&&!X1(A)?i:A||Qz(e)||i}const nF=async function(e){const t=this.getOffsetParent||F4,i=this.getDimensions,A=await i(e.floating);return{reference:oF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:A.width,height:A.height}}};function rF(e){return mr(e).direction==="rtl"}const sF={convertOffsetParentRelativeRectToViewportRelativeRect:Uz,getDocumentElement:Jr,getClippingRect:eF,getOffsetParent:F4,getElementRects:nF,getClientRects:Jz,getDimensions:tF,getScale:Va,isElement:Kn,isRTL:rF};function V4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iF(e,t){let i=null,A;const c=Jr(e);function p(){var h;clearTimeout(A),(h=i)==null||h.disconnect(),i=null}function m(h,y){h===void 0&&(h=!1),y===void 0&&(y=1),p();const b=e.getBoundingClientRect(),{left:w,top:C,width:S,height:x}=b;if(h||t(),!S||!x)return;const I=Hs(C),k=Hs(c.clientWidth-(w+S)),D=Hs(c.clientHeight-(C+x)),z=Hs(w),J={rootMargin:-I+"px "+-k+"px "+-D+"px "+-z+"px",threshold:qs(0,$i(1,y))||1};let Z=!0;function $(q){const Q=q[0].intersectionRatio;if(Q!==y){if(!Z)return m();Q?m(!1,Q):A=setTimeout(()=>{m(!1,1e-7)},1e3)}Q===1&&!V4(b,e.getBoundingClientRect())&&m(),Z=!1}try{i=new IntersectionObserver($,{...J,root:c.ownerDocument})}catch{i=new IntersectionObserver($,J)}i.observe(e)}return m(!0),p}function aF(e,t,i,A){A===void 0&&(A={});const{ancestorScroll:c=!0,ancestorResize:p=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:y=!1}=A,b=_1(e),w=c||p?[...b?ta(b):[],...t?ta(t):[]]:[];w.forEach(z=>{c&&z.addEventListener("scroll",i,{passive:!0}),p&&z.addEventListener("resize",i)});const C=b&&h?iF(b,i):null;let S=-1,x=null;m&&(x=new ResizeObserver(z=>{let[U]=z;U&&U.target===b&&x&&t&&(x.unobserve(t),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var J;(J=x)==null||J.observe(t)})),i()}),b&&!y&&x.observe(b),t&&x.observe(t));let I,k=y?oa(e):null;y&&D();function D(){const z=oa(e);k&&!V4(k,z)&&i(),k=z,I=requestAnimationFrame(D)}return i(),()=>{var z;w.forEach(U=>{c&&U.removeEventListener("scroll",i),p&&U.removeEventListener("resize",i)}),C==null||C(),(z=x)==null||z.disconnect(),x=null,y&&cancelAnimationFrame(I)}}const AF=Vz;const lF=Gz,cF=Nz;const uF=Lz;const ry=(e,t,i)=>{const A=new Map,c={platform:sF,...i},p={...c.platform,_c:A};return jz(e,t,{...c,platform:p})};var Sc={exports:{}};/*!
|
|
418
|
+
*/function YN({value:e,setValue:t,disabled:i=!1}){return B.jsx(M0,{dateAdapter:nu,children:B.jsx(ZN,{value:e,disabled:i,onChange:t,slotProps:{textField:{sx:{"& .MuiPickersSectionList-root":{padding:0},"& .MuiPickersInputBase-sectionsContainer":{padding:0},width:"100%",height:30,"& .MuiInputBase-root":{height:30,"& .MuiInputBase-input":{padding:"0px 16px",color:"gray"}}}}}})})}function UN({startDate:e,endDate:t,isDayShown:i=!1,className:A=""}){const c=h=>{const y=Tr.parseDate(h);return i?y.format("dddd, MMM D"):Tr.formatDate(h)},m=Tr.parseDate(e).format("YYYY-MM-DD")===Tr.parseDate(t).format("YYYY-MM-DD")?`${c(e)}, ${Tr.formatTime(e)} - ${Tr.formatTime(t)}`:`${c(e)}, ${Tr.formatTime(e)} - ${c(t)}, ${Tr.formatTime(t)}`;return B.jsx("div",{className:mt("text-gray-600 text-sm",A),children:m})}function k4({date:e}){return!e||e.length<10?null:B.jsx("div",{className:"text-gray-600 text-sm",children:Tr.formatDateTime(e)})}const JN=Y.createContext(null);function XN(e,t){const i=Array.isArray(e)?e[0]:e?e.x:0,A=Array.isArray(e)?e[1]:e?e.y:0,c=Array.isArray(t)?t[0]:t?t.x:0,p=Array.isArray(t)?t[1]:t?t.y:0;return i===c&&A===p}function ks(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!ks(e[i],t[i]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e=="object"&&typeof t=="object"){const i=Object.keys(e),A=Object.keys(t);if(i.length!==A.length)return!1;for(const c of i)if(!t.hasOwnProperty(c)||!ks(e[c],t[c]))return!1;return!0}return!1}function _N(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function Hg(e,t){if(!e.getProjection)return;const i=e.getProjection(),A=t.getProjection();ks(i,A)||t.setProjection(i)}function Zg(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function Qg(e,t){const i=t.viewState||t;let A=!1;if("zoom"in i){const c=e.zoom;e.zoom=i.zoom,A=A||c!==e.zoom}if("bearing"in i){const c=e.bearing;e.bearing=i.bearing,A=A||c!==e.bearing}if("pitch"in i){const c=e.pitch;e.pitch=i.pitch,A=A||c!==e.pitch}if(i.padding&&!e.isPaddingEqual(i.padding)&&(A=!0,e.padding=i.padding),"longitude"in i&&"latitude"in i){const c=e.center;e.center=new c.constructor(i.longitude,i.latitude),A=A||c!==e.center}return A}const KN=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function qg(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const A of e.layers)t[A.id]=A;const i=e.layers.map(A=>{let c=null;"interactive"in A&&(c=Object.assign({},A),delete c.interactive);const p=t[A.ref];if(p){c=c||Object.assign({},A),delete c.ref;for(const m of KN)m in p&&(c[m]=p[m])}return c||A});return{...e,layers:i}}const Yg={version:8,sources:{},layers:[]},Ug={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},nf={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},Jg={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},$N=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],ez=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class tA{constructor(t,i,A){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=c=>{const p=this.props[Jg[c.type]];p?p(c):c.type==="error"&&console.error(c.error)},this._onPointerEvent=c=>{(c.type==="mousemove"||c.type==="mouseout")&&this._updateHover(c);const p=this.props[Ug[c.type]];p&&(this.props.interactiveLayerIds&&c.type!=="mouseover"&&c.type!=="mouseout"&&(c.features=this._hoveredFeatures||this._queryRenderedFeatures(c.point)),p(c),delete c.features)},this._onCameraEvent=c=>{if(!this._internalUpdate){const p=this.props[nf[c.type]];p&&p(c)}c.type in this._deferredEvents&&(this._deferredEvents[c.type]=!1)},this._MapClass=t,this.props=i,this._initialize(A)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const i=this.props;this.props=t;const A=this._updateSettings(t,i);A&&this._createShadowTransform(this._map);const c=this._updateSize(t),p=this._updateViewState(t,!0);this._updateStyle(t,i),this._updateStyleComponents(t,i),this._updateHandlers(t,i),(A||c||p&&!this._map.isMoving())&&this.redraw()}static reuse(t,i){const A=tA.savedMaps.pop();if(!A)return null;const c=A.map,p=c.getContainer();for(i.className=p.className;p.childNodes.length>0;)i.appendChild(p.childNodes[0]);c._container=i;const m=c._resizeObserver;m&&(m.disconnect(),m.observe(i)),A.setProps({...t,styleDiffing:!1}),c.resize();const{initialViewState:h}=t;return h&&(h.bounds?c.fitBounds(h.bounds,{...h.fitBoundsOptions,duration:0}):A._updateViewState(h,!1)),c.isStyleLoaded()?c.fire("load"):c.once("styledata",()=>c.fire("load")),c._update(),A}_initialize(t){const{props:i}=this,{mapStyle:A=Yg}=i,c={...i,...i.initialViewState,accessToken:i.mapboxAccessToken||tz()||null,container:t,style:qg(A)},p=c.initialViewState||c.viewState||c;if(Object.assign(c,{center:[p.longitude||0,p.latitude||0],zoom:p.zoom||0,pitch:p.pitch||0,bearing:p.bearing||0}),i.gl){const w=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=w,i.gl)}const m=new this._MapClass(c);p.padding&&m.setPadding(p.padding),i.cursor&&(m.getCanvas().style.cursor=i.cursor),this._createShadowTransform(m);const h=m._render;m._render=w=>{this._inRender=!0,h.call(m,w),this._inRender=!1};const y=m._renderTaskQueue.run;m._renderTaskQueue.run=w=>{y.call(m._renderTaskQueue,w),this._onBeforeRepaint()},m.on("render",()=>this._onAfterRepaint());const b=m.fire;m.fire=this._fireEvent.bind(this,b),m.on("resize",()=>{this._renderTransform.resize(m.transform.width,m.transform.height)}),m.on("styledata",()=>{this._updateStyleComponents(this.props,{}),Hg(m.transform,this._renderTransform)}),m.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const w in Ug)m.on(w,this._onPointerEvent);for(const w in nf)m.on(w,this._onCameraEvent);for(const w in Jg)m.on(w,this._onEvent);this._map=m}recycle(){const i=this.map.getContainer().querySelector("[mapboxgl-children]");i==null||i.remove(),tA.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const i=_N(t.transform);t.painter.transform=i,this._renderTransform=i}_updateSize(t){const{viewState:i}=t;if(i){const A=this._map;if(i.width!==A.transform.width||i.height!==A.transform.height)return A.resize(),!0}return!1}_updateViewState(t,i){if(this._internalUpdate)return!1;const A=this._map,c=this._renderTransform,{zoom:p,pitch:m,bearing:h}=c,y=A.isMoving();y&&(c.cameraElevationReference="sea");const b=Qg(c,{...Zg(A.transform),...t});if(y&&(c.cameraElevationReference="ground"),b&&i){const w=this._deferredEvents;w.move=!0,w.zoom||(w.zoom=p!==c.zoom),w.rotate||(w.rotate=h!==c.bearing),w.pitch||(w.pitch=m!==c.pitch)}return y||Qg(A.transform,t),b}_updateSettings(t,i){const A=this._map;let c=!1;for(const p of $N)if(p in t&&!ks(t[p],i[p])){c=!0;const m=A[`set${p[0].toUpperCase()}${p.slice(1)}`];m==null||m.call(A,t[p])}return c}_updateStyle(t,i){if(t.cursor!==i.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==i.mapStyle){const{mapStyle:A=Yg,styleDiffing:c=!0}=t,p={diff:c};return"localIdeographFontFamily"in t&&(p.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(qg(A),p),!0}return!1}_updateStyleComponents(t,i){const A=this._map;let c=!1;return A.isStyleLoaded()&&("light"in t&&A.setLight&&!ks(t.light,i.light)&&(c=!0,A.setLight(t.light)),"fog"in t&&A.setFog&&!ks(t.fog,i.fog)&&(c=!0,A.setFog(t.fog)),"terrain"in t&&A.setTerrain&&!ks(t.terrain,i.terrain)&&(!t.terrain||A.getSource(t.terrain.source))&&(c=!0,A.setTerrain(t.terrain))),c}_updateHandlers(t,i){var A,c;const p=this._map;let m=!1;for(const h of ez){const y=(A=t[h])!==null&&A!==void 0?A:!0,b=(c=i[h])!==null&&c!==void 0?c:!0;ks(y,b)||(m=!0,y?p[h].enable(y):p[h].disable())}return m}_queryRenderedFeatures(t){const i=this._map,A=i.transform,{interactiveLayerIds:c=[]}=this.props;try{return i.transform=this._renderTransform,i.queryRenderedFeatures(t,{layers:c.filter(i.getLayer.bind(i))})}catch{return[]}finally{i.transform=A}}_updateHover(t){var i;const{props:A}=this;if(A.interactiveLayerIds&&(A.onMouseMove||A.onMouseEnter||A.onMouseLeave)){const p=t.type,m=((i=this._hoveredFeatures)===null||i===void 0?void 0:i.length)>0,h=this._queryRenderedFeatures(t.point),y=h.length>0;!y&&m&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=h,y&&!m&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=p}else this._hoveredFeatures=null}_fireEvent(t,i,A){const c=this._map,p=c.transform,m=typeof i=="string"?i:i.type;return m==="move"&&this._updateViewState(this.props,!1),m in nf&&(typeof i=="object"&&(i.viewState=Zg(p)),this._map.isMoving())?(c.transform=this._renderTransform,t.call(c,i,A),c.transform=p,c):(t.call(c,i,A),c)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const A in this._deferredEvents)this._deferredEvents[A]&&t.fire(A);this._internalUpdate=!1;const i=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{Hg(this._renderTransform,i),t.transform=i}}}tA.savedMaps=[];function tz(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||process.env.MapboxAccessToken}catch{}try{e=e||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const oz=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function nz(e){if(!e)return null;const t=e.map,i={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:A=>{const c=t.transform;t.transform=e.transform;const p=t.project(A);return t.transform=c,p},unproject:A=>{const c=t.transform;t.transform=e.transform;const p=t.unproject(A);return t.transform=c,p},queryTerrainElevation:(A,c)=>{const p=t.transform;t.transform=e.transform;const m=t.queryTerrainElevation(A,c);return t.transform=p,m},queryRenderedFeatures:(A,c)=>{const p=t.transform;t.transform=e.transform;const m=t.queryRenderedFeatures(A,c);return t.transform=p,m}};for(const A of rz(t))!(A in i)&&!oz.includes(A)&&(i[A]=t[A].bind(t));return i}function rz(e){const t=new Set;let i=e;for(;i;){for(const A of Object.getOwnPropertyNames(i))A[0]!=="_"&&typeof e[A]=="function"&&A!=="fire"&&A!=="setEventedParent"&&t.add(A);i=Object.getPrototypeOf(i)}return Array.from(t)}const sz=typeof document<"u"?ve.useLayoutEffect:ve.useEffect,iz=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function az(e,t){for(const A of iz)A in t&&(e[A]=t[A]);const{RTLTextPlugin:i="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;i&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(i,A=>{A&&console.error(A)},!0)}const ju=Y.createContext(null);function I4(e,t,i){const A=ve.useContext(JN),[c,p]=ve.useState(null),m=ve.useRef(),{current:h}=ve.useRef({mapLib:null,map:null});ve.useEffect(()=>{const w=e.mapLib;let C=!0,S;return Promise.resolve(w||i).then(x=>{if(!C)return;if(!x)throw new Error("Invalid mapLib");const I="Map"in x?x:x.default;if(!I.Map)throw new Error("Invalid mapLib");if(az(I,e),!I.supported||I.supported(e))e.reuseMaps&&(S=tA.reuse(e,m.current)),S||(S=new tA(I.Map,e,m.current)),h.map=nz(S),h.mapLib=I,p(S),A==null||A.onMapMount(h.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(x=>{const{onError:I}=e;I?I({type:"error",target:null,originalEvent:null,error:x}):console.error(x)}),()=>{C=!1,S&&(A==null||A.onMapUnmount(e.id),e.reuseMaps?S.recycle():S.destroy())}},[]),sz(()=>{c&&c.setProps(e)}),ve.useImperativeHandle(t,()=>h.map,[c]);const y=ve.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),b={height:"100%"};return Y.createElement("div",{id:e.id,ref:m,style:y},c&&Y.createElement(ju.Provider,{value:h},Y.createElement("div",{"mapboxgl-children":"",style:b},e.children)))}const Az=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function ua(e,t){if(!e||!t)return;const i=e.style;for(const A in t){const c=t[A];Number.isFinite(c)&&!Az.test(A)?i[A]=`${c}px`:i[A]=c}}function lz(e,t){const{map:i,mapLib:A}=ve.useContext(ju),c=ve.useRef({props:e});c.current.props=e;const p=ve.useMemo(()=>{let k=!1;Y.Children.forEach(e.children,U=>{U&&(k=!0)});const D={...e,element:k?document.createElement("div"):null},z=new A.Marker(D);return z.setLngLat([e.longitude,e.latitude]),z.getElement().addEventListener("click",U=>{var J,Z;(Z=(J=c.current.props).onClick)===null||Z===void 0||Z.call(J,{type:"click",target:z,originalEvent:U})}),z.on("dragstart",U=>{var J,Z;const $=U;$.lngLat=p.getLngLat(),(Z=(J=c.current.props).onDragStart)===null||Z===void 0||Z.call(J,$)}),z.on("drag",U=>{var J,Z;const $=U;$.lngLat=p.getLngLat(),(Z=(J=c.current.props).onDrag)===null||Z===void 0||Z.call(J,$)}),z.on("dragend",U=>{var J,Z;const $=U;$.lngLat=p.getLngLat(),(Z=(J=c.current.props).onDragEnd)===null||Z===void 0||Z.call(J,$)}),z},[]);ve.useEffect(()=>(p.addTo(i.getMap()),()=>{p.remove()}),[]);const{longitude:m,latitude:h,offset:y,style:b,draggable:w=!1,popup:C=null,rotation:S=0,rotationAlignment:x="auto",pitchAlignment:I="auto"}=e;return ve.useEffect(()=>{ua(p.getElement(),b)},[b]),ve.useImperativeHandle(t,()=>p,[]),(p.getLngLat().lng!==m||p.getLngLat().lat!==h)&&p.setLngLat([m,h]),y&&!XN(p.getOffset(),y)&&p.setOffset(y),p.isDraggable()!==w&&p.setDraggable(w),p.getRotation()!==S&&p.setRotation(S),p.getRotationAlignment()!==x&&p.setRotationAlignment(x),p.getPitchAlignment()!==I&&p.setPitchAlignment(I),p.getPopup()!==C&&p.setPopup(C),is.createPortal(e.children,p.getElement())}const M4=ve.memo(ve.forwardRef(lz));function Xg(e){return new Set(e?e.trim().split(/\s+/):[])}function cz(e,t){const{map:i,mapLib:A}=ve.useContext(ju),c=ve.useMemo(()=>document.createElement("div"),[]),p=ve.useRef({props:e});p.current.props=e;const m=ve.useMemo(()=>{const h={...e},y=new A.Popup(h);return y.setLngLat([e.longitude,e.latitude]),y.once("open",b=>{var w,C;(C=(w=p.current.props).onOpen)===null||C===void 0||C.call(w,b)}),y},[]);if(ve.useEffect(()=>{const h=y=>{var b,w;(w=(b=p.current.props).onClose)===null||w===void 0||w.call(b,y)};return m.on("close",h),m.setDOMContent(c).addTo(i.getMap()),()=>{m.off("close",h),m.isOpen()&&m.remove()}},[]),ve.useEffect(()=>{ua(m.getElement(),e.style)},[e.style]),ve.useImperativeHandle(t,()=>m,[]),m.isOpen()&&((m.getLngLat().lng!==e.longitude||m.getLngLat().lat!==e.latitude)&&m.setLngLat([e.longitude,e.latitude]),e.offset&&!ks(m.options.offset,e.offset)&&m.setOffset(e.offset),(m.options.anchor!==e.anchor||m.options.maxWidth!==e.maxWidth)&&(m.options.anchor=e.anchor,m.setMaxWidth(e.maxWidth)),m.options.className!==e.className)){const h=Xg(m.options.className),y=Xg(e.className);for(const b of h)y.has(b)||m.removeClassName(b);for(const b of y)h.has(b)||m.addClassName(b);m.options.className=e.className}return is.createPortal(e.children,c)}const FQ=ve.memo(ve.forwardRef(cz));function z0(e,t,i,A){const c=ve.useContext(ju),p=ve.useMemo(()=>e(c),[]);return ve.useEffect(()=>{const m=A||i||t,h=typeof t=="function"&&typeof i=="function"?t:null,y=typeof i=="function"?i:typeof t=="function"?t:null,{map:b}=c;return b.hasControl(p)||(b.addControl(p,m==null?void 0:m.position),h&&h(c)),()=>{y&&y(c),b.hasControl(p)&&b.removeControl(p)}},[]),p}function uz(e){const t=z0(({mapLib:i})=>new i.AttributionControl(e),{position:e.position});return ve.useEffect(()=>{ua(t._container,e.style)},[e.style]),null}const VQ=ve.memo(uz);function dz(e){const t=z0(({mapLib:i})=>new i.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return ve.useEffect(()=>{ua(t._controlContainer,e.style)},[e.style]),null}const GQ=ve.memo(dz);function pz(e,t){const i=ve.useRef({props:e}),A=z0(({mapLib:c})=>{const p=new c.GeolocateControl(e),m=p._setupUI;return p._setupUI=h=>{p._container.hasChildNodes()||m(h)},p.on("geolocate",h=>{var y,b;(b=(y=i.current.props).onGeolocate)===null||b===void 0||b.call(y,h)}),p.on("error",h=>{var y,b;(b=(y=i.current.props).onError)===null||b===void 0||b.call(y,h)}),p.on("outofmaxbounds",h=>{var y,b;(b=(y=i.current.props).onOutOfMaxBounds)===null||b===void 0||b.call(y,h)}),p.on("trackuserlocationstart",h=>{var y,b;(b=(y=i.current.props).onTrackUserLocationStart)===null||b===void 0||b.call(y,h)}),p.on("trackuserlocationend",h=>{var y,b;(b=(y=i.current.props).onTrackUserLocationEnd)===null||b===void 0||b.call(y,h)}),p},{position:e.position});return i.current.props=e,ve.useImperativeHandle(t,()=>A,[]),ve.useEffect(()=>{ua(A._container,e.style)},[e.style]),null}const WQ=ve.memo(ve.forwardRef(pz));function fz(e){const t=z0(({mapLib:i})=>new i.NavigationControl(e),{position:e.position});return ve.useEffect(()=>{ua(t._container,e.style)},[e.style]),null}const mz=ve.memo(fz);function hz(e){const t=z0(({mapLib:p})=>new p.ScaleControl(e),{position:e.position}),i=ve.useRef(e),A=i.current;i.current=e;const{style:c}=e;return e.maxWidth!==void 0&&e.maxWidth!==A.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==A.unit&&t.setUnit(e.unit),ve.useEffect(()=>{ua(t._container,c)},[c]),null}const HQ=ve.memo(hz);const gz=Promise.resolve().then(()=>require("./maplibre-gl-DXlLG4kq.js")).then(e=>e.maplibreGl),yz=Y.forwardRef(function(t,i){return I4(t,i,gz)}),bz=M4;const vz=mz;const wz=Promise.resolve().then(()=>require("./mapbox-gl-BsWEbIh4.js")).then(e=>e.mapboxGl),ZQ=Y.forwardRef(function(t,i){return I4(t,i,wz)}),Tz=M4;function Cz({locations:e}){if(h6.IsZeroArray(e))return null;const t=({id:i,longitude:A,latitude:c,icon:p})=>B.jsx("li",{children:B.jsx(Tz,{longitude:A,latitude:c,children:p})},i);return B.jsx(cA,{items:e,itemRenderer:t})}const Pz=({lng:e,lat:t,zoom:i=10,setCoordinates:A,locations:c=[],token:p,navigationControl:m})=>{const h=ve.useRef(null),[y,b]=ve.useState({longitude:e,latitude:t,zoom:i});return ve.useEffect(()=>{h.current&&h.current.flyTo({center:[e,t],duration:3e3,essential:!0})},[t,e]),B.jsxs(yz,{ref:h,...y,mapStyle:`https://tiles.locationiq.com/v3/streets/vector.json?key=${p}`,style:{width:"100%",height:"100%"},onMove:w=>b(w.viewState),onClick:w=>{const{lng:C,lat:S}=w.lngLat;A&&A({lat:S,lng:C})},children:[B.jsx(bz,{longitude:e,latitude:t,children:"📌"}),B.jsx(Cz,{locations:c}),B.jsx(vz,{position:m.position})]})};var D4=(e=>(e.TR="top-right",e))(D4||{});const $i=Math.min,qs=Math.max,$s=Math.round,Hs=Math.floor,Xn=e=>({x:e,y:e}),xz={left:"right",right:"left",bottom:"top",top:"bottom"};function u2(e,t,i){return qs(e,$i(t,i))}function F0(e,t){return typeof e=="function"?e(t):e}function ea(e){return e.split("-")[0]}function V0(e){return e.split("-")[1]}function O4(e){return e==="x"?"y":"x"}function U1(e){return e==="y"?"height":"width"}function Zs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function J1(e){return O4(Zs(e))}function Sz(e,t,i){i===void 0&&(i=!1);const A=V0(e),c=J1(e),p=U1(c);let m=c==="x"?A===(i?"end":"start")?"right":"left":A==="start"?"bottom":"top";return t.reference[p]>t.floating[p]&&(m=Yc(m)),[m,Yc(m)]}function kz(e){const t=Yc(e);return[d2(e),t,d2(t)]}function d2(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const _g=["left","right"],Kg=["right","left"],Iz=["top","bottom"],Mz=["bottom","top"];function Dz(e,t,i){switch(e){case"top":case"bottom":return i?t?Kg:_g:t?_g:Kg;case"left":case"right":return t?Iz:Mz;default:return[]}}function Oz(e,t,i,A){const c=V0(e);let p=Dz(ea(e),i==="start",A);return c&&(p=p.map(m=>m+"-"+c),t&&(p=p.concat(p.map(d2)))),p}function Yc(e){const t=ea(e);return xz[t]+e.slice(t.length)}function Ez(e){return{top:0,right:0,bottom:0,left:0,...e}}function E4(e){return typeof e!="number"?Ez(e):{top:e,right:e,bottom:e,left:e}}function w0(e){const{x:t,y:i,width:A,height:c}=e;return{width:A,height:c,top:i,left:t,right:t+A,bottom:i+c,x:t,y:i}}function $g(e,t,i){let{reference:A,floating:c}=e;const p=Zs(t),m=J1(t),h=U1(m),y=ea(t),b=p==="y",w=A.x+A.width/2-c.width/2,C=A.y+A.height/2-c.height/2,S=A[h]/2-c[h]/2;let x;switch(y){case"top":x={x:w,y:A.y-c.height};break;case"bottom":x={x:w,y:A.y+A.height};break;case"right":x={x:A.x+A.width,y:C};break;case"left":x={x:A.x-c.width,y:C};break;default:x={x:A.x,y:A.y}}switch(V0(t)){case"start":x[m]-=S*(i&&b?-1:1);break;case"end":x[m]+=S*(i&&b?-1:1);break}return x}async function Rz(e,t){var i;t===void 0&&(t={});const{x:A,y:c,platform:p,rects:m,elements:h,strategy:y}=e,{boundary:b="clippingAncestors",rootBoundary:w="viewport",elementContext:C="floating",altBoundary:S=!1,padding:x=0}=F0(t,e),I=E4(x),D=h[S?C==="floating"?"reference":"floating":C],z=w0(await p.getClippingRect({element:(i=await(p.isElement==null?void 0:p.isElement(D)))==null||i?D:D.contextElement||await(p.getDocumentElement==null?void 0:p.getDocumentElement(h.floating)),boundary:b,rootBoundary:w,strategy:y})),U=C==="floating"?{x:A,y:c,width:m.floating.width,height:m.floating.height}:m.reference,J=await(p.getOffsetParent==null?void 0:p.getOffsetParent(h.floating)),Z=await(p.isElement==null?void 0:p.isElement(J))?await(p.getScale==null?void 0:p.getScale(J))||{x:1,y:1}:{x:1,y:1},$=w0(p.convertOffsetParentRelativeRectToViewportRelativeRect?await p.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:U,offsetParent:J,strategy:y}):U);return{top:(z.top-$.top+I.top)/Z.y,bottom:($.bottom-z.bottom+I.bottom)/Z.y,left:(z.left-$.left+I.left)/Z.x,right:($.right-z.right+I.right)/Z.x}}const Bz=50,jz=async(e,t,i)=>{const{placement:A="bottom",strategy:c="absolute",middleware:p=[],platform:m}=i,h=m.detectOverflow?m:{...m,detectOverflow:Rz},y=await(m.isRTL==null?void 0:m.isRTL(t));let b=await m.getElementRects({reference:e,floating:t,strategy:c}),{x:w,y:C}=$g(b,A,y),S=A,x=0;const I={};for(let k=0;k<p.length;k++){const D=p[k];if(!D)continue;const{name:z,fn:U}=D,{x:J,y:Z,data:$,reset:q}=await U({x:w,y:C,initialPlacement:A,placement:S,strategy:c,middlewareData:I,rects:b,platform:h,elements:{reference:e,floating:t}});w=J??w,C=Z??C,I[z]={...I[z],...$},q&&x<Bz&&(x++,typeof q=="object"&&(q.placement&&(S=q.placement),q.rects&&(b=q.rects===!0?await m.getElementRects({reference:e,floating:t,strategy:c}):q.rects),{x:w,y:C}=$g(b,S,y)),k=-1)}return{x:w,y:C,placement:S,strategy:c,middlewareData:I}},Lz=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:A,placement:c,rects:p,platform:m,elements:h,middlewareData:y}=t,{element:b,padding:w=0}=F0(e,t)||{};if(b==null)return{};const C=E4(w),S={x:i,y:A},x=J1(c),I=U1(x),k=await m.getDimensions(b),D=x==="y",z=D?"top":"left",U=D?"bottom":"right",J=D?"clientHeight":"clientWidth",Z=p.reference[I]+p.reference[x]-S[x]-p.floating[I],$=S[x]-p.reference[x],q=await(m.getOffsetParent==null?void 0:m.getOffsetParent(b));let Q=q?q[J]:0;(!Q||!await(m.isElement==null?void 0:m.isElement(q)))&&(Q=h.floating[J]||p.floating[I]);const ee=Z/2-$/2,te=Q/2-k[I]/2-1,W=$i(C[z],te),G=$i(C[U],te),E=W,ne=Q-k[I]-G,N=Q/2-k[I]/2+ee,R=u2(E,N,ne),V=!y.arrow&&V0(c)!=null&&N!==R&&p.reference[I]/2-(N<E?W:G)-k[I]/2<0,F=V?N<E?N-E:N-ne:0;return{[x]:S[x]+F,data:{[x]:R,centerOffset:N-R-F,...V&&{alignmentOffset:F}},reset:V}}});const Nz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,A;const{placement:c,middlewareData:p,rects:m,initialPlacement:h,platform:y,elements:b}=t,{mainAxis:w=!0,crossAxis:C=!0,fallbackPlacements:S,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:I="none",flipAlignment:k=!0,...D}=F0(e,t);if((i=p.arrow)!=null&&i.alignmentOffset)return{};const z=ea(c),U=Zs(h),J=ea(h)===h,Z=await(y.isRTL==null?void 0:y.isRTL(b.floating)),$=S||(J||!k?[Yc(h)]:kz(h)),q=I!=="none";!S&&q&&$.push(...Oz(h,k,I,Z));const Q=[h,...$],ee=await y.detectOverflow(t,D),te=[];let W=((A=p.flip)==null?void 0:A.overflows)||[];if(w&&te.push(ee[z]),C){const N=Sz(c,m,Z);te.push(ee[N[0]],ee[N[1]])}if(W=[...W,{placement:c,overflows:te}],!te.every(N=>N<=0)){var G,E;const N=(((G=p.flip)==null?void 0:G.index)||0)+1,R=Q[N];if(R&&(!(C==="alignment"?U!==Zs(R):!1)||W.every(P=>Zs(P.placement)===U?P.overflows[0]>0:!0)))return{data:{index:N,overflows:W},reset:{placement:R}};let V=(E=W.filter(F=>F.overflows[0]<=0).sort((F,P)=>F.overflows[1]-P.overflows[1])[0])==null?void 0:E.placement;if(!V)switch(x){case"bestFit":{var ne;const F=(ne=W.filter(P=>{if(q){const re=Zs(P.placement);return re===U||re==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(re=>re>0).reduce((re,ae)=>re+ae,0)]).sort((P,re)=>P[1]-re[1])[0])==null?void 0:ne[0];F&&(V=F);break}case"initialPlacement":V=h;break}if(c!==V)return{reset:{placement:V}}}return{}}}};const zz=new Set(["left","top"]);async function Fz(e,t){const{placement:i,platform:A,elements:c}=e,p=await(A.isRTL==null?void 0:A.isRTL(c.floating)),m=ea(i),h=V0(i),y=Zs(i)==="y",b=zz.has(m)?-1:1,w=p&&y?-1:1,C=F0(t,e);let{mainAxis:S,crossAxis:x,alignmentAxis:I}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:C.mainAxis||0,crossAxis:C.crossAxis||0,alignmentAxis:C.alignmentAxis};return h&&typeof I=="number"&&(x=h==="end"?I*-1:I),y?{x:x*w,y:S*b}:{x:S*b,y:x*w}}const Vz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,A;const{x:c,y:p,placement:m,middlewareData:h}=t,y=await Fz(t,e);return m===((i=h.offset)==null?void 0:i.placement)&&(A=h.arrow)!=null&&A.alignmentOffset?{}:{x:c+y.x,y:p+y.y,data:{...y,placement:m}}}}},Gz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:A,placement:c,platform:p}=t,{mainAxis:m=!0,crossAxis:h=!1,limiter:y={fn:z=>{let{x:U,y:J}=z;return{x:U,y:J}}},...b}=F0(e,t),w={x:i,y:A},C=await p.detectOverflow(t,b),S=Zs(ea(c)),x=O4(S);let I=w[x],k=w[S];if(m){const z=x==="y"?"top":"left",U=x==="y"?"bottom":"right",J=I+C[z],Z=I-C[U];I=u2(J,I,Z)}if(h){const z=S==="y"?"top":"left",U=S==="y"?"bottom":"right",J=k+C[z],Z=k-C[U];k=u2(J,k,Z)}const D=y.fn({...t,[x]:I,[S]:k});return{...D,data:{x:D.x-i,y:D.y-A,enabled:{[x]:m,[S]:h}}}}}};function Lu(){return typeof window<"u"}function yA(e){return R4(e)?(e.nodeName||"").toLowerCase():"#document"}function Sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jr(e){var t;return(t=(R4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function R4(e){return Lu()?e instanceof Node||e instanceof Sn(e).Node:!1}function Kn(e){return Lu()?e instanceof Element||e instanceof Sn(e).Element:!1}function Xr(e){return Lu()?e instanceof HTMLElement||e instanceof Sn(e).HTMLElement:!1}function ey(e){return!Lu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sn(e).ShadowRoot}function G0(e){const{overflow:t,overflowX:i,overflowY:A,display:c}=mr(e);return/auto|scroll|overlay|hidden|clip/.test(t+A+i)&&c!=="inline"&&c!=="contents"}function Wz(e){return/^(table|td|th)$/.test(yA(e))}function Nu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Hz=/transform|translate|scale|rotate|perspective|filter/,Zz=/paint|layout|strict|content/,Fi=e=>!!e&&e!=="none";let rf;function X1(e){const t=Kn(e)?mr(e):e;return Fi(t.transform)||Fi(t.translate)||Fi(t.scale)||Fi(t.rotate)||Fi(t.perspective)||!zu()&&(Fi(t.backdropFilter)||Fi(t.filter))||Hz.test(t.willChange||"")||Zz.test(t.contain||"")}function Qz(e){let t=ei(e);for(;Xr(t)&&!oA(t);){if(X1(t))return t;if(Nu(t))return null;t=ei(t)}return null}function zu(){return rf==null&&(rf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),rf}function oA(e){return/^(html|body|#document)$/.test(yA(e))}function mr(e){return Sn(e).getComputedStyle(e)}function Fu(e){return Kn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ei(e){if(yA(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ey(e)&&e.host||Jr(e);return ey(t)?t.host:t}function B4(e){const t=ei(e);return oA(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&G0(t)?t:B4(t)}function ta(e,t,i){var A;t===void 0&&(t=[]),i===void 0&&(i=!0);const c=B4(e),p=c===((A=e.ownerDocument)==null?void 0:A.body),m=Sn(c);if(p){const h=T0(m);return t.concat(m,m.visualViewport||[],G0(c)?c:[],h&&i?ta(h):[])}else return t.concat(c,ta(c,[],i))}function T0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j4(e){const t=mr(e);let i=parseFloat(t.width)||0,A=parseFloat(t.height)||0;const c=Xr(e),p=c?e.offsetWidth:i,m=c?e.offsetHeight:A,h=$s(i)!==p||$s(A)!==m;return h&&(i=p,A=m),{width:i,height:A,$:h}}function _1(e){return Kn(e)?e:e.contextElement}function Va(e){const t=_1(e);if(!Xr(t))return Xn(1);const i=t.getBoundingClientRect(),{width:A,height:c,$:p}=j4(t);let m=(p?$s(i.width):i.width)/A,h=(p?$s(i.height):i.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!h||!Number.isFinite(h))&&(h=1),{x:m,y:h}}const qz=Xn(0);function L4(e){const t=Sn(e);return!zu()||!t.visualViewport?qz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yz(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==Sn(e)?!1:t}function oa(e,t,i,A){t===void 0&&(t=!1),i===void 0&&(i=!1);const c=e.getBoundingClientRect(),p=_1(e);let m=Xn(1);t&&(A?Kn(A)&&(m=Va(A)):m=Va(e));const h=Yz(p,i,A)?L4(p):Xn(0);let y=(c.left+h.x)/m.x,b=(c.top+h.y)/m.y,w=c.width/m.x,C=c.height/m.y;if(p){const S=Sn(p),x=A&&Kn(A)?Sn(A):A;let I=S,k=T0(I);for(;k&&A&&x!==I;){const D=Va(k),z=k.getBoundingClientRect(),U=mr(k),J=z.left+(k.clientLeft+parseFloat(U.paddingLeft))*D.x,Z=z.top+(k.clientTop+parseFloat(U.paddingTop))*D.y;y*=D.x,b*=D.y,w*=D.x,C*=D.y,y+=J,b+=Z,I=Sn(k),k=T0(I)}}return w0({width:w,height:C,x:y,y:b})}function Vu(e,t){const i=Fu(e).scrollLeft;return t?t.left+i:oa(Jr(e)).left+i}function N4(e,t){const i=e.getBoundingClientRect(),A=i.left+t.scrollLeft-Vu(e,i),c=i.top+t.scrollTop;return{x:A,y:c}}function Uz(e){let{elements:t,rect:i,offsetParent:A,strategy:c}=e;const p=c==="fixed",m=Jr(A),h=t?Nu(t.floating):!1;if(A===m||h&&p)return i;let y={scrollLeft:0,scrollTop:0},b=Xn(1);const w=Xn(0),C=Xr(A);if((C||!C&&!p)&&((yA(A)!=="body"||G0(m))&&(y=Fu(A)),C)){const x=oa(A);b=Va(A),w.x=x.x+A.clientLeft,w.y=x.y+A.clientTop}const S=m&&!C&&!p?N4(m,y):Xn(0);return{width:i.width*b.x,height:i.height*b.y,x:i.x*b.x-y.scrollLeft*b.x+w.x+S.x,y:i.y*b.y-y.scrollTop*b.y+w.y+S.y}}function Jz(e){return Array.from(e.getClientRects())}function Xz(e){const t=Jr(e),i=Fu(e),A=e.ownerDocument.body,c=qs(t.scrollWidth,t.clientWidth,A.scrollWidth,A.clientWidth),p=qs(t.scrollHeight,t.clientHeight,A.scrollHeight,A.clientHeight);let m=-i.scrollLeft+Vu(e);const h=-i.scrollTop;return mr(A).direction==="rtl"&&(m+=qs(t.clientWidth,A.clientWidth)-c),{width:c,height:p,x:m,y:h}}const ty=25;function _z(e,t){const i=Sn(e),A=Jr(e),c=i.visualViewport;let p=A.clientWidth,m=A.clientHeight,h=0,y=0;if(c){p=c.width,m=c.height;const w=zu();(!w||w&&t==="fixed")&&(h=c.offsetLeft,y=c.offsetTop)}const b=Vu(A);if(b<=0){const w=A.ownerDocument,C=w.body,S=getComputedStyle(C),x=w.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,I=Math.abs(A.clientWidth-C.clientWidth-x);I<=ty&&(p-=I)}else b<=ty&&(p+=b);return{width:p,height:m,x:h,y}}function Kz(e,t){const i=oa(e,!0,t==="fixed"),A=i.top+e.clientTop,c=i.left+e.clientLeft,p=Xr(e)?Va(e):Xn(1),m=e.clientWidth*p.x,h=e.clientHeight*p.y,y=c*p.x,b=A*p.y;return{width:m,height:h,x:y,y:b}}function oy(e,t,i){let A;if(t==="viewport")A=_z(e,i);else if(t==="document")A=Xz(Jr(e));else if(Kn(t))A=Kz(t,i);else{const c=L4(e);A={x:t.x-c.x,y:t.y-c.y,width:t.width,height:t.height}}return w0(A)}function z4(e,t){const i=ei(e);return i===t||!Kn(i)||oA(i)?!1:mr(i).position==="fixed"||z4(i,t)}function $z(e,t){const i=t.get(e);if(i)return i;let A=ta(e,[],!1).filter(h=>Kn(h)&&yA(h)!=="body"),c=null;const p=mr(e).position==="fixed";let m=p?ei(e):e;for(;Kn(m)&&!oA(m);){const h=mr(m),y=X1(m);!y&&h.position==="fixed"&&(c=null),(p?!y&&!c:!y&&h.position==="static"&&!!c&&(c.position==="absolute"||c.position==="fixed")||G0(m)&&!y&&z4(e,m))?A=A.filter(w=>w!==m):c=h,m=ei(m)}return t.set(e,A),A}function eF(e){let{element:t,boundary:i,rootBoundary:A,strategy:c}=e;const m=[...i==="clippingAncestors"?Nu(t)?[]:$z(t,this._c):[].concat(i),A],h=oy(t,m[0],c);let y=h.top,b=h.right,w=h.bottom,C=h.left;for(let S=1;S<m.length;S++){const x=oy(t,m[S],c);y=qs(x.top,y),b=$i(x.right,b),w=$i(x.bottom,w),C=qs(x.left,C)}return{width:b-C,height:w-y,x:C,y}}function tF(e){const{width:t,height:i}=j4(e);return{width:t,height:i}}function oF(e,t,i){const A=Xr(t),c=Jr(t),p=i==="fixed",m=oa(e,!0,p,t);let h={scrollLeft:0,scrollTop:0};const y=Xn(0);function b(){y.x=Vu(c)}if(A||!A&&!p)if((yA(t)!=="body"||G0(c))&&(h=Fu(t)),A){const x=oa(t,!0,p,t);y.x=x.x+t.clientLeft,y.y=x.y+t.clientTop}else c&&b();p&&!A&&c&&b();const w=c&&!A&&!p?N4(c,h):Xn(0),C=m.left+h.scrollLeft-y.x-w.x,S=m.top+h.scrollTop-y.y-w.y;return{x:C,y:S,width:m.width,height:m.height}}function sf(e){return mr(e).position==="static"}function ny(e,t){if(!Xr(e)||mr(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return Jr(e)===i&&(i=i.ownerDocument.body),i}function F4(e,t){const i=Sn(e);if(Nu(e))return i;if(!Xr(e)){let c=ei(e);for(;c&&!oA(c);){if(Kn(c)&&!sf(c))return c;c=ei(c)}return i}let A=ny(e,t);for(;A&&Wz(A)&&sf(A);)A=ny(A,t);return A&&oA(A)&&sf(A)&&!X1(A)?i:A||Qz(e)||i}const nF=async function(e){const t=this.getOffsetParent||F4,i=this.getDimensions,A=await i(e.floating);return{reference:oF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:A.width,height:A.height}}};function rF(e){return mr(e).direction==="rtl"}const sF={convertOffsetParentRelativeRectToViewportRelativeRect:Uz,getDocumentElement:Jr,getClippingRect:eF,getOffsetParent:F4,getElementRects:nF,getClientRects:Jz,getDimensions:tF,getScale:Va,isElement:Kn,isRTL:rF};function V4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iF(e,t){let i=null,A;const c=Jr(e);function p(){var h;clearTimeout(A),(h=i)==null||h.disconnect(),i=null}function m(h,y){h===void 0&&(h=!1),y===void 0&&(y=1),p();const b=e.getBoundingClientRect(),{left:w,top:C,width:S,height:x}=b;if(h||t(),!S||!x)return;const I=Hs(C),k=Hs(c.clientWidth-(w+S)),D=Hs(c.clientHeight-(C+x)),z=Hs(w),J={rootMargin:-I+"px "+-k+"px "+-D+"px "+-z+"px",threshold:qs(0,$i(1,y))||1};let Z=!0;function $(q){const Q=q[0].intersectionRatio;if(Q!==y){if(!Z)return m();Q?m(!1,Q):A=setTimeout(()=>{m(!1,1e-7)},1e3)}Q===1&&!V4(b,e.getBoundingClientRect())&&m(),Z=!1}try{i=new IntersectionObserver($,{...J,root:c.ownerDocument})}catch{i=new IntersectionObserver($,J)}i.observe(e)}return m(!0),p}function aF(e,t,i,A){A===void 0&&(A={});const{ancestorScroll:c=!0,ancestorResize:p=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:y=!1}=A,b=_1(e),w=c||p?[...b?ta(b):[],...t?ta(t):[]]:[];w.forEach(z=>{c&&z.addEventListener("scroll",i,{passive:!0}),p&&z.addEventListener("resize",i)});const C=b&&h?iF(b,i):null;let S=-1,x=null;m&&(x=new ResizeObserver(z=>{let[U]=z;U&&U.target===b&&x&&t&&(x.unobserve(t),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var J;(J=x)==null||J.observe(t)})),i()}),b&&!y&&x.observe(b),t&&x.observe(t));let I,k=y?oa(e):null;y&&D();function D(){const z=oa(e);k&&!V4(k,z)&&i(),k=z,I=requestAnimationFrame(D)}return i(),()=>{var z;w.forEach(U=>{c&&U.removeEventListener("scroll",i),p&&U.removeEventListener("resize",i)}),C==null||C(),(z=x)==null||z.disconnect(),x=null,y&&cancelAnimationFrame(I)}}const AF=Vz;const lF=Gz,cF=Nz;const uF=Lz;const ry=(e,t,i)=>{const A=new Map,c={platform:sF,...i},p={...c.platform,_c:A};return jz(e,t,{...c,platform:p})};var Sc={exports:{}};/*!
|
|
419
419
|
Copyright (c) 2018 Jed Watson.
|
|
420
420
|
Licensed under the MIT License (MIT), see
|
|
421
421
|
http://jedwatson.github.io/classnames
|
|
@@ -523,4 +523,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
523
523
|
border-left: 0;
|
|
524
524
|
border-right: 0;
|
|
525
525
|
}
|
|
526
|
-
`,bZ=1,vZ=3,wZ=1,TZ=(function(e){tZ(t,e);function t(){var i=e!==null&&e.apply(this,arguments)||this;return i.cropperRef=Y.createRef(),i.imageRef=Y.createRef(),i.videoRef=Y.createRef(),i.containerPosition={x:0,y:0},i.containerRef=null,i.styleRef=null,i.containerRect=null,i.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},i.dragStartPosition={x:0,y:0},i.dragStartCrop={x:0,y:0},i.gestureZoomStart=0,i.gestureRotationStart=0,i.isTouching=!1,i.lastPinchDistance=0,i.lastPinchRotation=0,i.rafDragTimeout=null,i.rafPinchTimeout=null,i.wheelTimer=null,i.currentDoc=typeof document<"u"?document:null,i.currentWindow=typeof window<"u"?window:null,i.resizeObserver=null,i.previousCropSize=null,i.isInitialized=!1,i.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},i.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!i.containerRef)){var A=!0;i.resizeObserver=new window.ResizeObserver(function(c){if(A){A=!1;return}i.computeSizes()}),i.resizeObserver.observe(i.containerRef)}},i.preventZoomSafari=function(A){return A.preventDefault()},i.cleanEvents=function(){i.currentDoc&&(i.currentDoc.removeEventListener("mousemove",i.onMouseMove),i.currentDoc.removeEventListener("mouseup",i.onDragStopped),i.currentDoc.removeEventListener("touchmove",i.onTouchMove),i.currentDoc.removeEventListener("touchend",i.onDragStopped),i.currentDoc.removeEventListener("gesturechange",i.onGestureChange),i.currentDoc.removeEventListener("gestureend",i.onGestureEnd),i.currentDoc.removeEventListener("scroll",i.onScroll))},i.clearScrollEvent=function(){i.containerRef&&i.containerRef.removeEventListener("wheel",i.onWheel),i.wheelTimer&&clearTimeout(i.wheelTimer)},i.onMediaLoad=function(){var A=i.computeSizes();A&&(i.previousCropSize=A,i.emitCropData(),i.setInitialCrop(A),i.isInitialized=!0),i.props.onMediaLoaded&&i.props.onMediaLoaded(i.mediaSize)},i.setInitialCrop=function(A){if(i.props.initialCroppedAreaPercentages){var c=fZ(i.props.initialCroppedAreaPercentages,i.mediaSize,i.props.rotation,A,i.props.minZoom,i.props.maxZoom),p=c.crop,m=c.zoom;i.props.onCropChange(p),i.props.onZoomChange&&i.props.onZoomChange(m)}else if(i.props.initialCroppedAreaPixels){var h=hZ(i.props.initialCroppedAreaPixels,i.mediaSize,i.props.rotation,A,i.props.minZoom,i.props.maxZoom),p=h.crop,m=h.zoom;i.props.onCropChange(p),i.props.onZoomChange&&i.props.onZoomChange(m)}},i.computeSizes=function(){var A,c,p,m,h,y,b=i.imageRef.current||i.videoRef.current;if(b&&i.containerRef){i.containerRect=i.containerRef.getBoundingClientRect(),i.saveContainerPosition();var w=i.containerRect.width/i.containerRect.height,C=((A=i.imageRef.current)===null||A===void 0?void 0:A.naturalWidth)||((c=i.videoRef.current)===null||c===void 0?void 0:c.videoWidth)||0,S=((p=i.imageRef.current)===null||p===void 0?void 0:p.naturalHeight)||((m=i.videoRef.current)===null||m===void 0?void 0:m.videoHeight)||0,x=b.offsetWidth<C||b.offsetHeight<S,I=C/S,k=void 0;if(x)switch(i.state.mediaObjectFit){default:case"contain":k=w>I?{width:i.containerRect.height*I,height:i.containerRect.height}:{width:i.containerRect.width,height:i.containerRect.width/I};break;case"horizontal-cover":k={width:i.containerRect.width,height:i.containerRect.width/I};break;case"vertical-cover":k={width:i.containerRect.height*I,height:i.containerRect.height};break}else k={width:b.offsetWidth,height:b.offsetHeight};i.mediaSize=Pn(Pn({},k),{naturalWidth:C,naturalHeight:S}),i.props.setMediaSize&&i.props.setMediaSize(i.mediaSize);var D=i.props.cropSize?i.props.cropSize:lZ(i.mediaSize.width,i.mediaSize.height,i.containerRect.width,i.containerRect.height,i.props.aspect,i.props.rotation);return(((h=i.state.cropSize)===null||h===void 0?void 0:h.height)!==D.height||((y=i.state.cropSize)===null||y===void 0?void 0:y.width)!==D.width)&&i.props.onCropSizeChange&&i.props.onCropSizeChange(D),i.setState({cropSize:D},i.recomputeCropPosition),i.props.setCropSize&&i.props.setCropSize(D),D}},i.saveContainerPosition=function(){if(i.containerRef){var A=i.containerRef.getBoundingClientRect();i.containerPosition={x:A.left,y:A.top}}},i.onMouseDown=function(A){i.currentDoc&&(A.preventDefault(),i.currentDoc.addEventListener("mousemove",i.onMouseMove),i.currentDoc.addEventListener("mouseup",i.onDragStopped),i.saveContainerPosition(),i.onDragStart(t.getMousePoint(A)))},i.onMouseMove=function(A){return i.onDrag(t.getMousePoint(A))},i.onScroll=function(A){i.currentDoc&&(A.preventDefault(),i.saveContainerPosition())},i.onTouchStart=function(A){i.currentDoc&&(i.isTouching=!0,!(i.props.onTouchRequest&&!i.props.onTouchRequest(A))&&(i.currentDoc.addEventListener("touchmove",i.onTouchMove,{passive:!1}),i.currentDoc.addEventListener("touchend",i.onDragStopped),i.saveContainerPosition(),A.touches.length===2?i.onPinchStart(A):A.touches.length===1&&i.onDragStart(t.getTouchPoint(A.touches[0]))))},i.onTouchMove=function(A){A.preventDefault(),A.touches.length===2?i.onPinchMove(A):A.touches.length===1&&i.onDrag(t.getTouchPoint(A.touches[0]))},i.onGestureStart=function(A){i.currentDoc&&(A.preventDefault(),i.currentDoc.addEventListener("gesturechange",i.onGestureChange),i.currentDoc.addEventListener("gestureend",i.onGestureEnd),i.gestureZoomStart=i.props.zoom,i.gestureRotationStart=i.props.rotation)},i.onGestureChange=function(A){if(A.preventDefault(),!i.isTouching){var c=t.getMousePoint(A),p=i.gestureZoomStart-1+A.scale;if(i.setNewZoom(p,c,{shouldUpdatePosition:!0}),i.props.onRotationChange){var m=i.gestureRotationStart+A.rotation;i.props.onRotationChange(m)}}},i.onGestureEnd=function(A){i.cleanEvents()},i.onDragStart=function(A){var c,p,m=A.x,h=A.y;i.dragStartPosition={x:m,y:h},i.dragStartCrop=Pn({},i.props.crop),(p=(c=i.props).onInteractionStart)===null||p===void 0||p.call(c)},i.onDrag=function(A){var c=A.x,p=A.y;i.currentWindow&&(i.rafDragTimeout&&i.currentWindow.cancelAnimationFrame(i.rafDragTimeout),i.rafDragTimeout=i.currentWindow.requestAnimationFrame(function(){if(i.state.cropSize&&!(c===void 0||p===void 0)){var m=c-i.dragStartPosition.x,h=p-i.dragStartPosition.y,y={x:i.dragStartCrop.x+m,y:i.dragStartCrop.y+h},b=i.props.restrictPosition?Rl(y,i.mediaSize,i.state.cropSize,i.props.zoom,i.props.rotation):y;i.props.onCropChange(b)}}))},i.onDragStopped=function(){var A,c;i.isTouching=!1,i.cleanEvents(),i.emitCropData(),(c=(A=i.props).onInteractionEnd)===null||c===void 0||c.call(A)},i.onWheel=function(A){if(i.currentWindow&&!(i.props.onWheelRequest&&!i.props.onWheelRequest(A))){A.preventDefault();var c=t.getMousePoint(A),p=AZ(A).pixelY,m=i.props.zoom-p*i.props.zoomSpeed/200;i.setNewZoom(m,c,{shouldUpdatePosition:!0}),i.state.hasWheelJustStarted||i.setState({hasWheelJustStarted:!0},function(){var h,y;return(y=(h=i.props).onInteractionStart)===null||y===void 0?void 0:y.call(h)}),i.wheelTimer&&clearTimeout(i.wheelTimer),i.wheelTimer=i.currentWindow.setTimeout(function(){return i.setState({hasWheelJustStarted:!1},function(){var h,y;return(y=(h=i.props).onInteractionEnd)===null||y===void 0?void 0:y.call(h)})},250)}},i.getPointOnContainer=function(A,c){var p=A.x,m=A.y;if(!i.containerRect)throw new Error("The Cropper is not mounted");return{x:i.containerRect.width/2-(p-c.x),y:i.containerRect.height/2-(m-c.y)}},i.getPointOnMedia=function(A){var c=A.x,p=A.y,m=i.props,h=m.crop,y=m.zoom;return{x:(c+h.x)/y,y:(p+h.y)/y}},i.setNewZoom=function(A,c,p){var m=p===void 0?{}:p,h=m.shouldUpdatePosition,y=h===void 0?!0:h;if(!(!i.state.cropSize||!i.props.onZoomChange)){var b=Hu(A,i.props.minZoom,i.props.maxZoom);if(y){var w=i.getPointOnContainer(c,i.containerPosition),C=i.getPointOnMedia(w),S={x:C.x*b-w.x,y:C.y*b-w.y},x=i.props.restrictPosition?Rl(S,i.mediaSize,i.state.cropSize,b,i.props.rotation):S;i.props.onCropChange(x)}i.props.onZoomChange(b)}},i.getCropData=function(){if(!i.state.cropSize)return null;var A=i.props.restrictPosition?Rl(i.props.crop,i.mediaSize,i.state.cropSize,i.props.zoom,i.props.rotation):i.props.crop;return uZ(A,i.mediaSize,i.state.cropSize,i.getAspect(),i.props.zoom,i.props.rotation,i.props.restrictPosition)},i.emitCropData=function(){var A=i.getCropData();if(A){var c=A.croppedAreaPercentages,p=A.croppedAreaPixels;i.props.onCropComplete&&i.props.onCropComplete(c,p),i.props.onCropAreaChange&&i.props.onCropAreaChange(c,p)}},i.emitCropAreaChange=function(){var A=i.getCropData();if(A){var c=A.croppedAreaPercentages,p=A.croppedAreaPixels;i.props.onCropAreaChange&&i.props.onCropAreaChange(c,p)}},i.recomputeCropPosition=function(){var A,c;if(i.state.cropSize){var p=i.props.crop;if(i.isInitialized&&(!((A=i.previousCropSize)===null||A===void 0)&&A.width)&&(!((c=i.previousCropSize)===null||c===void 0)&&c.height)){var m=Math.abs(i.previousCropSize.width-i.state.cropSize.width)>1e-6||Math.abs(i.previousCropSize.height-i.state.cropSize.height)>1e-6;if(m){var h=i.state.cropSize.width/i.previousCropSize.width,y=i.state.cropSize.height/i.previousCropSize.height;p={x:i.props.crop.x*h,y:i.props.crop.y*y}}}var b=i.props.restrictPosition?Rl(p,i.mediaSize,i.state.cropSize,i.props.zoom,i.props.rotation):p;i.previousCropSize=i.state.cropSize,i.props.onCropChange(b),i.emitCropData()}},i.onKeyDown=function(A){var c,p,m=i.props,h=m.crop,y=m.onCropChange,b=m.keyboardStep,w=m.zoom,C=m.rotation,S=b;if(i.state.cropSize){A.shiftKey&&(S*=.2);var x=Pn({},h);switch(A.key){case"ArrowUp":x.y-=S,A.preventDefault();break;case"ArrowDown":x.y+=S,A.preventDefault();break;case"ArrowLeft":x.x-=S,A.preventDefault();break;case"ArrowRight":x.x+=S,A.preventDefault();break;default:return}i.props.restrictPosition&&(x=Rl(x,i.mediaSize,i.state.cropSize,w,C)),A.repeat||(p=(c=i.props).onInteractionStart)===null||p===void 0||p.call(c),y(x)}},i.onKeyUp=function(A){var c,p;switch(A.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":A.preventDefault();break;default:return}i.emitCropData(),(p=(c=i.props).onInteractionEnd)===null||p===void 0||p.call(c)},i}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=yZ,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var i,A;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(i=this.resizeObserver)===null||i===void 0||i.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((A=this.styleRef.parentNode)===null||A===void 0||A.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(i){var A,c,p,m,h,y,b,w,C;i.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):i.aspect!==this.props.aspect?this.computeSizes():i.objectFit!==this.props.objectFit?this.computeSizes():i.zoom!==this.props.zoom?this.recomputeCropPosition():((A=i.cropSize)===null||A===void 0?void 0:A.height)!==((c=this.props.cropSize)===null||c===void 0?void 0:c.height)||((p=i.cropSize)===null||p===void 0?void 0:p.width)!==((m=this.props.cropSize)===null||m===void 0?void 0:m.width)?this.computeSizes():(((h=i.crop)===null||h===void 0?void 0:h.x)!==((y=this.props.crop)===null||y===void 0?void 0:y.x)||((b=i.crop)===null||b===void 0?void 0:b.y)!==((w=this.props.crop)===null||w===void 0?void 0:w.y))&&this.emitCropAreaChange(),i.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),i.video!==this.props.video&&((C=this.videoRef.current)===null||C===void 0||C.load());var S=this.getObjectFit();S!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:S},this.computeSizes)},t.prototype.getAspect=function(){var i=this.props,A=i.cropSize,c=i.aspect;return A?A.width/A.height:c},t.prototype.getObjectFit=function(){var i,A,c,p;if(this.props.objectFit==="cover"){var m=this.imageRef.current||this.videoRef.current;if(m&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var h=this.containerRect.width/this.containerRect.height,y=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalWidth)||((A=this.videoRef.current)===null||A===void 0?void 0:A.videoWidth)||0,b=((c=this.imageRef.current)===null||c===void 0?void 0:c.naturalHeight)||((p=this.videoRef.current)===null||p===void 0?void 0:p.videoHeight)||0,w=y/b;return w<h?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(i){var A=t.getTouchPoint(i.touches[0]),c=t.getTouchPoint(i.touches[1]);this.lastPinchDistance=ob(A,c),this.lastPinchRotation=nb(A,c),this.onDragStart(rb(A,c))},t.prototype.onPinchMove=function(i){var A=this;if(!(!this.currentDoc||!this.currentWindow)){var c=t.getTouchPoint(i.touches[0]),p=t.getTouchPoint(i.touches[1]),m=rb(c,p);this.onDrag(m),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var h=ob(c,p),y=A.props.zoom*(h/A.lastPinchDistance);A.setNewZoom(y,m,{shouldUpdatePosition:!1}),A.lastPinchDistance=h;var b=nb(c,p),w=A.props.rotation+(b-A.lastPinchRotation);A.props.onRotationChange&&A.props.onRotationChange(w),A.lastPinchRotation=b})}},t.prototype.render=function(){var i=this,A,c=this.props,p=c.image,m=c.video,h=c.mediaProps,y=c.cropperProps,b=c.transform,w=c.crop,C=w.x,S=w.y,x=c.rotation,I=c.zoom,k=c.cropShape,D=c.showGrid,z=c.roundCropAreaPixels,U=c.style,J=U.containerStyle,Z=U.cropAreaStyle,$=U.mediaStyle,q=c.classes,Q=q.containerClassName,ee=q.cropAreaClassName,te=q.mediaClassName,W=(A=this.state.mediaObjectFit)!==null&&A!==void 0?A:this.getObjectFit();return Y.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(E){return i.containerRef=E},"data-testid":"container",style:J,className:dc("reactEasyCrop_Container",Q)},p?Y.createElement("img",Pn({alt:"",className:dc("reactEasyCrop_Image",W==="contain"&&"reactEasyCrop_Contain",W==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",W==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",te)},h,{src:p,ref:this.imageRef,style:Pn(Pn({},$),{transform:b||"translate(".concat(C,"px, ").concat(S,"px) rotate(").concat(x,"deg) scale(").concat(I,")")}),onLoad:this.onMediaLoad})):m&&Y.createElement("video",Pn({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:dc("reactEasyCrop_Video",W==="contain"&&"reactEasyCrop_Contain",W==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",W==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",te)},h,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Pn(Pn({},$),{transform:b||"translate(".concat(C,"px, ").concat(S,"px) rotate(").concat(x,"deg) scale(").concat(I,")")}),controls:!1}),(Array.isArray(m)?m:[{src:m}]).map(function(G){return Y.createElement("source",Pn({key:G.src},G))})),this.state.cropSize&&Y.createElement("div",Pn({ref:this.cropperRef,style:Pn(Pn({},Z),{width:z?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:z?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:dc("reactEasyCrop_CropArea",k==="round"&&"reactEasyCrop_CropAreaRound",D&&"reactEasyCrop_CropAreaGrid",ee)},y)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:vZ,minZoom:bZ,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:wZ},t.getMousePoint=function(i){return{x:Number(i.clientX),y:Number(i.clientY)}},t.getTouchPoint=function(i){return{x:Number(i.clientX),y:Number(i.clientY)}},t})(Y.Component);function CZ({imageUrl:e,fallbackImageUrl:t,onSubmit:i,onSelect:A,error:c,isLoading:p,isCompleted:m,className:h=""}){const[y,b]=ve.useState(!1),[w,C]=ve.useState(e),[S,x]=ve.useState({x:0,y:0}),[I,k]=ve.useState(1),[D,z]=ve.useState(null);ve.useEffect(()=>{m&&b(!1)},[m]);const{inputElement:U,trigger:J}=eu({onChange:ee=>{const te=ee[0];if(!te)return;const W=URL.createObjectURL(te);C(W),A(te),x({x:0,y:0}),k(1)}}),Z=ve.useCallback((ee,te)=>{z(te)},[]),$=()=>{C(t),x({x:0,y:0}),k(1),b(!0)},q=()=>{b(!1)},Q=()=>{if(D){const{x:ee,y:te,width:W}=D;i(ee,te,W)}};return B.jsxs(B.Fragment,{children:[B.jsx("div",{className:`relative w-full aspect-square ${h}`,children:e?B.jsxs("div",{className:"group relative w-full h-full cursor-pointer",onClick:$,children:[B.jsx(Jl,{src:e,fallbackSrc:t,alt:"Uploaded",className:"w-full h-full object-cover rounded"}),B.jsx("div",{className:"absolute inset-0 rounded bg-white/0 group-hover:bg-white/40 transition-colors"}),B.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:B.jsx(tu,{isHighlighted:!0})})]}):B.jsxs(D2,{className:"items-center justify-center w-full h-full bg-white rounded border border-dashed border-gray-300 text-gray-400 text-sm cursor-pointer hover:bg-gray-200",onClick:$,children:[B.jsx("span",{children:"Update"}),B.jsx("span",{children:"avatar"})]})}),B.jsx(Wa,{isOpen:y,onClose:q,title:"Update Avatar",content:B.jsxs("div",{className:"flex flex-col gap-3",children:[w?B.jsx("div",{className:"relative w-full h-64",children:B.jsx(TZ,{image:w,crop:S,zoom:I,aspect:1,onCropChange:x,onZoomChange:k,onCropComplete:Z},w)}):B.jsx("div",{className:"flex items-center justify-center w-full h-64 bg-gray-100 rounded border border-dashed border-gray-300 text-gray-400 text-sm cursor-pointer hover:bg-gray-200",onClick:J,children:"Select image"}),c&&B.jsx(H0,{label:c}),w&&B.jsxs("div",{className:"flex items-center justify-between",children:[B.jsxs(nn,{className:"gap-2",children:[B.jsx(s0,{label:"Select Image",onClick:J,disabled:p}),p&&B.jsx(sa,{className:"w-6"})]}),B.jsx(M2,{saveLabel:"Submit",cancelLabel:"Cancel",onSave:Q,onCancel:q,isSaveDisabled:p||!!c,isCancelDisabled:p||!!c,className:"w-fit"})]}),U]})})]})}exports.A=Fb;exports.ATarget=zb;exports.AddButton=l9;exports.AlertWrap=m9;exports.ArenaTag=JF;exports.Autocomplete=y9;exports.Avatar=nm;exports.AvatarTag=XH;exports.AvatarTimeTag=_H;exports.Button=Us;exports.CacheButton=WT;exports.CalendarTag=BF;exports.Carousel=UH;exports.CategoryTag=ZF;exports.ChatTag=VF;exports.CheckboxGroup=T9;exports.ClickableDiv=fn;exports.CloseIcon=lA;exports.CoachTag=eV;exports.CollectionsTag=XF;exports.Column=D2;exports.CommentEditor=b9;exports.CommentTag=QF;exports.CommentsSection=mV;exports.Container=O2;exports.Coordinates=G9;exports.CopyTag=NF;exports.Copyright=q9;exports.CreatePostTag=sV;exports.CreateTag=jF;exports.DateDisplay=k4;exports.DatePicker=VL;exports.DateRange=UN;exports.DateTimePicker=YN;exports.Deletable=p9;exports.DuelVersus=v9;exports.EditIcon=tu;exports.EditableBlock=d9;exports.EmailInput=OT;exports.ErrorBoundary=y5;exports.ErrorMessage=H0;exports.EventTag=_F;exports.ExpandableContainer=Q9;exports.ExploreTag=OF;exports.Form=u9;exports.GameScore=F9;exports.GameTag=tV;exports.H=$e;exports.H1=ou;exports.HomeTag=MF;exports.ImageCropper=CZ;exports.ImageGrid=$H;exports.ImageGridUpload=eZ;exports.ImageTag=nV;exports.Img=P0;exports.InterestIconTooltip=PF;exports.InterestTag=HF;exports.LazyErrorBoundary=aH;exports.LeaderboardTag=oV;exports.LikeSection=pV;exports.List=cA;exports.LoadingIcon=sa;exports.LoadingIndicator=Gb;exports.LocationTag=cV;exports.LogoutTag=FF;exports.MapTag=LF;exports.MarketTag=KF;exports.MediaUpload=KH;exports.MenuTooltip=CF;exports.MiddleDot=H4;exports.Modal=Wa;exports.ModalButton=A9;exports.ModalItem=a9;exports.MonthPicker=GL;exports.NavArrows=g9;exports.Navbar=SF;exports.NavigationControlPosition=D4;exports.NearbyTag=DF;exports.NewsfeedTag=RF;exports.NotFound=iH;exports.NotificationTag=WF;exports.OrDivider=dV;exports.OrderLabels=g2;exports.OrderPicker=tH;exports.OsmMap=Pz;exports.P=x2;exports.PartnersTag=EF;exports.PasswordInput=BT;exports.Picker=g5;exports.PollTag=rV;exports.PostTag=iV;exports.PrivateTag=zF;exports.ProfileTag=YF;exports.RepliesSection=hV;exports.Row=C0;exports.SaveCancelButtons=M2;exports.SearchBar=f9;exports.SendIcon=Nb;exports.ShowMore=mH;exports.SmartImage=Jl;exports.SocialMediaIcon=W9;exports.Span=Ys;exports.StaticColumn=ia;exports.StaticGameScore=H9;exports.StaticRow=nn;exports.StyledButton=s0;exports.SvgButton=Wb;exports.SvgTooltip=K1;exports.Tabs=h9;exports.Tag=b5;exports.Tags=pH;exports.TeamTag=UF;exports.Text=fH;exports.TextInput=DT;exports.TextUpdater=z9;exports.Textarea=MT;exports.TextareaAutosize=Xb;exports.TimeAgo=_b;exports.TimePicker=fj;exports.ToggleButton=GT;exports.Tooltip=W4;exports.UpArrowTag=GF;exports.UserTag=$F;exports.VerticalLine=uV;exports.VerticalStaticInterestTag=qF;exports.getDefaultExportFromCjs=Dr;
|
|
526
|
+
`,bZ=1,vZ=3,wZ=1,TZ=(function(e){tZ(t,e);function t(){var i=e!==null&&e.apply(this,arguments)||this;return i.cropperRef=Y.createRef(),i.imageRef=Y.createRef(),i.videoRef=Y.createRef(),i.containerPosition={x:0,y:0},i.containerRef=null,i.styleRef=null,i.containerRect=null,i.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},i.dragStartPosition={x:0,y:0},i.dragStartCrop={x:0,y:0},i.gestureZoomStart=0,i.gestureRotationStart=0,i.isTouching=!1,i.lastPinchDistance=0,i.lastPinchRotation=0,i.rafDragTimeout=null,i.rafPinchTimeout=null,i.wheelTimer=null,i.currentDoc=typeof document<"u"?document:null,i.currentWindow=typeof window<"u"?window:null,i.resizeObserver=null,i.previousCropSize=null,i.isInitialized=!1,i.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},i.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!i.containerRef)){var A=!0;i.resizeObserver=new window.ResizeObserver(function(c){if(A){A=!1;return}i.computeSizes()}),i.resizeObserver.observe(i.containerRef)}},i.preventZoomSafari=function(A){return A.preventDefault()},i.cleanEvents=function(){i.currentDoc&&(i.currentDoc.removeEventListener("mousemove",i.onMouseMove),i.currentDoc.removeEventListener("mouseup",i.onDragStopped),i.currentDoc.removeEventListener("touchmove",i.onTouchMove),i.currentDoc.removeEventListener("touchend",i.onDragStopped),i.currentDoc.removeEventListener("gesturechange",i.onGestureChange),i.currentDoc.removeEventListener("gestureend",i.onGestureEnd),i.currentDoc.removeEventListener("scroll",i.onScroll))},i.clearScrollEvent=function(){i.containerRef&&i.containerRef.removeEventListener("wheel",i.onWheel),i.wheelTimer&&clearTimeout(i.wheelTimer)},i.onMediaLoad=function(){var A=i.computeSizes();A&&(i.previousCropSize=A,i.emitCropData(),i.setInitialCrop(A),i.isInitialized=!0),i.props.onMediaLoaded&&i.props.onMediaLoaded(i.mediaSize)},i.setInitialCrop=function(A){if(i.props.initialCroppedAreaPercentages){var c=fZ(i.props.initialCroppedAreaPercentages,i.mediaSize,i.props.rotation,A,i.props.minZoom,i.props.maxZoom),p=c.crop,m=c.zoom;i.props.onCropChange(p),i.props.onZoomChange&&i.props.onZoomChange(m)}else if(i.props.initialCroppedAreaPixels){var h=hZ(i.props.initialCroppedAreaPixels,i.mediaSize,i.props.rotation,A,i.props.minZoom,i.props.maxZoom),p=h.crop,m=h.zoom;i.props.onCropChange(p),i.props.onZoomChange&&i.props.onZoomChange(m)}},i.computeSizes=function(){var A,c,p,m,h,y,b=i.imageRef.current||i.videoRef.current;if(b&&i.containerRef){i.containerRect=i.containerRef.getBoundingClientRect(),i.saveContainerPosition();var w=i.containerRect.width/i.containerRect.height,C=((A=i.imageRef.current)===null||A===void 0?void 0:A.naturalWidth)||((c=i.videoRef.current)===null||c===void 0?void 0:c.videoWidth)||0,S=((p=i.imageRef.current)===null||p===void 0?void 0:p.naturalHeight)||((m=i.videoRef.current)===null||m===void 0?void 0:m.videoHeight)||0,x=b.offsetWidth<C||b.offsetHeight<S,I=C/S,k=void 0;if(x)switch(i.state.mediaObjectFit){default:case"contain":k=w>I?{width:i.containerRect.height*I,height:i.containerRect.height}:{width:i.containerRect.width,height:i.containerRect.width/I};break;case"horizontal-cover":k={width:i.containerRect.width,height:i.containerRect.width/I};break;case"vertical-cover":k={width:i.containerRect.height*I,height:i.containerRect.height};break}else k={width:b.offsetWidth,height:b.offsetHeight};i.mediaSize=Pn(Pn({},k),{naturalWidth:C,naturalHeight:S}),i.props.setMediaSize&&i.props.setMediaSize(i.mediaSize);var D=i.props.cropSize?i.props.cropSize:lZ(i.mediaSize.width,i.mediaSize.height,i.containerRect.width,i.containerRect.height,i.props.aspect,i.props.rotation);return(((h=i.state.cropSize)===null||h===void 0?void 0:h.height)!==D.height||((y=i.state.cropSize)===null||y===void 0?void 0:y.width)!==D.width)&&i.props.onCropSizeChange&&i.props.onCropSizeChange(D),i.setState({cropSize:D},i.recomputeCropPosition),i.props.setCropSize&&i.props.setCropSize(D),D}},i.saveContainerPosition=function(){if(i.containerRef){var A=i.containerRef.getBoundingClientRect();i.containerPosition={x:A.left,y:A.top}}},i.onMouseDown=function(A){i.currentDoc&&(A.preventDefault(),i.currentDoc.addEventListener("mousemove",i.onMouseMove),i.currentDoc.addEventListener("mouseup",i.onDragStopped),i.saveContainerPosition(),i.onDragStart(t.getMousePoint(A)))},i.onMouseMove=function(A){return i.onDrag(t.getMousePoint(A))},i.onScroll=function(A){i.currentDoc&&(A.preventDefault(),i.saveContainerPosition())},i.onTouchStart=function(A){i.currentDoc&&(i.isTouching=!0,!(i.props.onTouchRequest&&!i.props.onTouchRequest(A))&&(i.currentDoc.addEventListener("touchmove",i.onTouchMove,{passive:!1}),i.currentDoc.addEventListener("touchend",i.onDragStopped),i.saveContainerPosition(),A.touches.length===2?i.onPinchStart(A):A.touches.length===1&&i.onDragStart(t.getTouchPoint(A.touches[0]))))},i.onTouchMove=function(A){A.preventDefault(),A.touches.length===2?i.onPinchMove(A):A.touches.length===1&&i.onDrag(t.getTouchPoint(A.touches[0]))},i.onGestureStart=function(A){i.currentDoc&&(A.preventDefault(),i.currentDoc.addEventListener("gesturechange",i.onGestureChange),i.currentDoc.addEventListener("gestureend",i.onGestureEnd),i.gestureZoomStart=i.props.zoom,i.gestureRotationStart=i.props.rotation)},i.onGestureChange=function(A){if(A.preventDefault(),!i.isTouching){var c=t.getMousePoint(A),p=i.gestureZoomStart-1+A.scale;if(i.setNewZoom(p,c,{shouldUpdatePosition:!0}),i.props.onRotationChange){var m=i.gestureRotationStart+A.rotation;i.props.onRotationChange(m)}}},i.onGestureEnd=function(A){i.cleanEvents()},i.onDragStart=function(A){var c,p,m=A.x,h=A.y;i.dragStartPosition={x:m,y:h},i.dragStartCrop=Pn({},i.props.crop),(p=(c=i.props).onInteractionStart)===null||p===void 0||p.call(c)},i.onDrag=function(A){var c=A.x,p=A.y;i.currentWindow&&(i.rafDragTimeout&&i.currentWindow.cancelAnimationFrame(i.rafDragTimeout),i.rafDragTimeout=i.currentWindow.requestAnimationFrame(function(){if(i.state.cropSize&&!(c===void 0||p===void 0)){var m=c-i.dragStartPosition.x,h=p-i.dragStartPosition.y,y={x:i.dragStartCrop.x+m,y:i.dragStartCrop.y+h},b=i.props.restrictPosition?Rl(y,i.mediaSize,i.state.cropSize,i.props.zoom,i.props.rotation):y;i.props.onCropChange(b)}}))},i.onDragStopped=function(){var A,c;i.isTouching=!1,i.cleanEvents(),i.emitCropData(),(c=(A=i.props).onInteractionEnd)===null||c===void 0||c.call(A)},i.onWheel=function(A){if(i.currentWindow&&!(i.props.onWheelRequest&&!i.props.onWheelRequest(A))){A.preventDefault();var c=t.getMousePoint(A),p=AZ(A).pixelY,m=i.props.zoom-p*i.props.zoomSpeed/200;i.setNewZoom(m,c,{shouldUpdatePosition:!0}),i.state.hasWheelJustStarted||i.setState({hasWheelJustStarted:!0},function(){var h,y;return(y=(h=i.props).onInteractionStart)===null||y===void 0?void 0:y.call(h)}),i.wheelTimer&&clearTimeout(i.wheelTimer),i.wheelTimer=i.currentWindow.setTimeout(function(){return i.setState({hasWheelJustStarted:!1},function(){var h,y;return(y=(h=i.props).onInteractionEnd)===null||y===void 0?void 0:y.call(h)})},250)}},i.getPointOnContainer=function(A,c){var p=A.x,m=A.y;if(!i.containerRect)throw new Error("The Cropper is not mounted");return{x:i.containerRect.width/2-(p-c.x),y:i.containerRect.height/2-(m-c.y)}},i.getPointOnMedia=function(A){var c=A.x,p=A.y,m=i.props,h=m.crop,y=m.zoom;return{x:(c+h.x)/y,y:(p+h.y)/y}},i.setNewZoom=function(A,c,p){var m=p===void 0?{}:p,h=m.shouldUpdatePosition,y=h===void 0?!0:h;if(!(!i.state.cropSize||!i.props.onZoomChange)){var b=Hu(A,i.props.minZoom,i.props.maxZoom);if(y){var w=i.getPointOnContainer(c,i.containerPosition),C=i.getPointOnMedia(w),S={x:C.x*b-w.x,y:C.y*b-w.y},x=i.props.restrictPosition?Rl(S,i.mediaSize,i.state.cropSize,b,i.props.rotation):S;i.props.onCropChange(x)}i.props.onZoomChange(b)}},i.getCropData=function(){if(!i.state.cropSize)return null;var A=i.props.restrictPosition?Rl(i.props.crop,i.mediaSize,i.state.cropSize,i.props.zoom,i.props.rotation):i.props.crop;return uZ(A,i.mediaSize,i.state.cropSize,i.getAspect(),i.props.zoom,i.props.rotation,i.props.restrictPosition)},i.emitCropData=function(){var A=i.getCropData();if(A){var c=A.croppedAreaPercentages,p=A.croppedAreaPixels;i.props.onCropComplete&&i.props.onCropComplete(c,p),i.props.onCropAreaChange&&i.props.onCropAreaChange(c,p)}},i.emitCropAreaChange=function(){var A=i.getCropData();if(A){var c=A.croppedAreaPercentages,p=A.croppedAreaPixels;i.props.onCropAreaChange&&i.props.onCropAreaChange(c,p)}},i.recomputeCropPosition=function(){var A,c;if(i.state.cropSize){var p=i.props.crop;if(i.isInitialized&&(!((A=i.previousCropSize)===null||A===void 0)&&A.width)&&(!((c=i.previousCropSize)===null||c===void 0)&&c.height)){var m=Math.abs(i.previousCropSize.width-i.state.cropSize.width)>1e-6||Math.abs(i.previousCropSize.height-i.state.cropSize.height)>1e-6;if(m){var h=i.state.cropSize.width/i.previousCropSize.width,y=i.state.cropSize.height/i.previousCropSize.height;p={x:i.props.crop.x*h,y:i.props.crop.y*y}}}var b=i.props.restrictPosition?Rl(p,i.mediaSize,i.state.cropSize,i.props.zoom,i.props.rotation):p;i.previousCropSize=i.state.cropSize,i.props.onCropChange(b),i.emitCropData()}},i.onKeyDown=function(A){var c,p,m=i.props,h=m.crop,y=m.onCropChange,b=m.keyboardStep,w=m.zoom,C=m.rotation,S=b;if(i.state.cropSize){A.shiftKey&&(S*=.2);var x=Pn({},h);switch(A.key){case"ArrowUp":x.y-=S,A.preventDefault();break;case"ArrowDown":x.y+=S,A.preventDefault();break;case"ArrowLeft":x.x-=S,A.preventDefault();break;case"ArrowRight":x.x+=S,A.preventDefault();break;default:return}i.props.restrictPosition&&(x=Rl(x,i.mediaSize,i.state.cropSize,w,C)),A.repeat||(p=(c=i.props).onInteractionStart)===null||p===void 0||p.call(c),y(x)}},i.onKeyUp=function(A){var c,p;switch(A.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":A.preventDefault();break;default:return}i.emitCropData(),(p=(c=i.props).onInteractionEnd)===null||p===void 0||p.call(c)},i}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=yZ,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var i,A;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(i=this.resizeObserver)===null||i===void 0||i.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((A=this.styleRef.parentNode)===null||A===void 0||A.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(i){var A,c,p,m,h,y,b,w,C;i.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):i.aspect!==this.props.aspect?this.computeSizes():i.objectFit!==this.props.objectFit?this.computeSizes():i.zoom!==this.props.zoom?this.recomputeCropPosition():((A=i.cropSize)===null||A===void 0?void 0:A.height)!==((c=this.props.cropSize)===null||c===void 0?void 0:c.height)||((p=i.cropSize)===null||p===void 0?void 0:p.width)!==((m=this.props.cropSize)===null||m===void 0?void 0:m.width)?this.computeSizes():(((h=i.crop)===null||h===void 0?void 0:h.x)!==((y=this.props.crop)===null||y===void 0?void 0:y.x)||((b=i.crop)===null||b===void 0?void 0:b.y)!==((w=this.props.crop)===null||w===void 0?void 0:w.y))&&this.emitCropAreaChange(),i.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),i.video!==this.props.video&&((C=this.videoRef.current)===null||C===void 0||C.load());var S=this.getObjectFit();S!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:S},this.computeSizes)},t.prototype.getAspect=function(){var i=this.props,A=i.cropSize,c=i.aspect;return A?A.width/A.height:c},t.prototype.getObjectFit=function(){var i,A,c,p;if(this.props.objectFit==="cover"){var m=this.imageRef.current||this.videoRef.current;if(m&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var h=this.containerRect.width/this.containerRect.height,y=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalWidth)||((A=this.videoRef.current)===null||A===void 0?void 0:A.videoWidth)||0,b=((c=this.imageRef.current)===null||c===void 0?void 0:c.naturalHeight)||((p=this.videoRef.current)===null||p===void 0?void 0:p.videoHeight)||0,w=y/b;return w<h?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(i){var A=t.getTouchPoint(i.touches[0]),c=t.getTouchPoint(i.touches[1]);this.lastPinchDistance=ob(A,c),this.lastPinchRotation=nb(A,c),this.onDragStart(rb(A,c))},t.prototype.onPinchMove=function(i){var A=this;if(!(!this.currentDoc||!this.currentWindow)){var c=t.getTouchPoint(i.touches[0]),p=t.getTouchPoint(i.touches[1]),m=rb(c,p);this.onDrag(m),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var h=ob(c,p),y=A.props.zoom*(h/A.lastPinchDistance);A.setNewZoom(y,m,{shouldUpdatePosition:!1}),A.lastPinchDistance=h;var b=nb(c,p),w=A.props.rotation+(b-A.lastPinchRotation);A.props.onRotationChange&&A.props.onRotationChange(w),A.lastPinchRotation=b})}},t.prototype.render=function(){var i=this,A,c=this.props,p=c.image,m=c.video,h=c.mediaProps,y=c.cropperProps,b=c.transform,w=c.crop,C=w.x,S=w.y,x=c.rotation,I=c.zoom,k=c.cropShape,D=c.showGrid,z=c.roundCropAreaPixels,U=c.style,J=U.containerStyle,Z=U.cropAreaStyle,$=U.mediaStyle,q=c.classes,Q=q.containerClassName,ee=q.cropAreaClassName,te=q.mediaClassName,W=(A=this.state.mediaObjectFit)!==null&&A!==void 0?A:this.getObjectFit();return Y.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(E){return i.containerRef=E},"data-testid":"container",style:J,className:dc("reactEasyCrop_Container",Q)},p?Y.createElement("img",Pn({alt:"",className:dc("reactEasyCrop_Image",W==="contain"&&"reactEasyCrop_Contain",W==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",W==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",te)},h,{src:p,ref:this.imageRef,style:Pn(Pn({},$),{transform:b||"translate(".concat(C,"px, ").concat(S,"px) rotate(").concat(x,"deg) scale(").concat(I,")")}),onLoad:this.onMediaLoad})):m&&Y.createElement("video",Pn({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:dc("reactEasyCrop_Video",W==="contain"&&"reactEasyCrop_Contain",W==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",W==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",te)},h,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Pn(Pn({},$),{transform:b||"translate(".concat(C,"px, ").concat(S,"px) rotate(").concat(x,"deg) scale(").concat(I,")")}),controls:!1}),(Array.isArray(m)?m:[{src:m}]).map(function(G){return Y.createElement("source",Pn({key:G.src},G))})),this.state.cropSize&&Y.createElement("div",Pn({ref:this.cropperRef,style:Pn(Pn({},Z),{width:z?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:z?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:dc("reactEasyCrop_CropArea",k==="round"&&"reactEasyCrop_CropAreaRound",D&&"reactEasyCrop_CropAreaGrid",ee)},y)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:vZ,minZoom:bZ,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:wZ},t.getMousePoint=function(i){return{x:Number(i.clientX),y:Number(i.clientY)}},t.getTouchPoint=function(i){return{x:Number(i.clientX),y:Number(i.clientY)}},t})(Y.Component);function CZ({imageUrl:e,fallbackImageUrl:t,onSubmit:i,onSelect:A,error:c,isLoading:p,isCompleted:m,className:h=""}){const[y,b]=ve.useState(!1),[w,C]=ve.useState(e),[S,x]=ve.useState({x:0,y:0}),[I,k]=ve.useState(1),[D,z]=ve.useState(null);ve.useEffect(()=>{m&&b(!1)},[m]);const{inputElement:U,trigger:J}=eu({onChange:async ee=>{const te=ee[0];if(!te)return;const W=await A(te);C(W),x({x:0,y:0}),k(1)}}),Z=ve.useCallback((ee,te)=>{z(te)},[]),$=()=>{C(t),x({x:0,y:0}),k(1),b(!0)},q=()=>{b(!1)},Q=()=>{if(D){const{x:ee,y:te,width:W}=D;i(ee,te,W)}};return B.jsxs(B.Fragment,{children:[B.jsx("div",{className:`relative w-full aspect-square ${h}`,children:e?B.jsxs("div",{className:"group relative w-full h-full cursor-pointer",onClick:$,children:[B.jsx(Jl,{src:e,fallbackSrc:t,alt:"Uploaded",className:"w-full h-full object-cover rounded"}),B.jsx("div",{className:"absolute inset-0 rounded bg-white/0 group-hover:bg-white/40 transition-colors"}),B.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:B.jsx(tu,{isHighlighted:!0})})]}):B.jsxs(D2,{className:"items-center justify-center w-full h-full bg-white rounded border border-dashed border-gray-300 text-gray-400 text-sm cursor-pointer hover:bg-gray-200",onClick:$,children:[B.jsx("span",{children:"Update"}),B.jsx("span",{children:"avatar"})]})}),B.jsx(Wa,{isOpen:y,onClose:q,title:"Update Avatar",content:B.jsxs("div",{className:"flex flex-col gap-3",children:[w?B.jsx("div",{className:"relative w-full h-64",children:B.jsx(TZ,{image:w,crop:S,zoom:I,aspect:1,onCropChange:x,onZoomChange:k,onCropComplete:Z},w)}):B.jsx("div",{className:"flex items-center justify-center w-full h-64 bg-gray-100 rounded border border-dashed border-gray-300 text-gray-400 text-sm cursor-pointer hover:bg-gray-200",onClick:J,children:"Select image"}),c&&B.jsx(H0,{label:c}),w&&B.jsxs("div",{className:"flex items-center justify-between",children:[B.jsxs(nn,{className:"gap-2",children:[B.jsx(s0,{label:"Select Image",onClick:J,disabled:p}),p&&B.jsx(sa,{className:"w-6"})]}),B.jsx(M2,{saveLabel:"Submit",cancelLabel:"Cancel",onSave:Q,onCancel:q,isSaveDisabled:p||!!c,isCancelDisabled:p||!!c,className:"w-fit"})]}),U]})})]})}exports.A=Fb;exports.ATarget=zb;exports.AddButton=l9;exports.AlertWrap=m9;exports.ArenaTag=JF;exports.Autocomplete=y9;exports.Avatar=nm;exports.AvatarTag=XH;exports.AvatarTimeTag=_H;exports.Button=Us;exports.CacheButton=WT;exports.CalendarTag=BF;exports.Carousel=UH;exports.CategoryTag=ZF;exports.ChatTag=VF;exports.CheckboxGroup=T9;exports.ClickableDiv=fn;exports.CloseIcon=lA;exports.CoachTag=eV;exports.CollectionsTag=XF;exports.Column=D2;exports.CommentEditor=b9;exports.CommentTag=QF;exports.CommentsSection=mV;exports.Container=O2;exports.Coordinates=G9;exports.CopyTag=NF;exports.Copyright=q9;exports.CreatePostTag=sV;exports.CreateTag=jF;exports.DateDisplay=k4;exports.DatePicker=VL;exports.DateRange=UN;exports.DateTimePicker=YN;exports.Deletable=p9;exports.DuelVersus=v9;exports.EditIcon=tu;exports.EditableBlock=d9;exports.EmailInput=OT;exports.ErrorBoundary=y5;exports.ErrorMessage=H0;exports.EventTag=_F;exports.ExpandableContainer=Q9;exports.ExploreTag=OF;exports.Form=u9;exports.GameScore=F9;exports.GameTag=tV;exports.H=$e;exports.H1=ou;exports.HomeTag=MF;exports.ImageCropper=CZ;exports.ImageGrid=$H;exports.ImageGridUpload=eZ;exports.ImageTag=nV;exports.Img=P0;exports.InterestIconTooltip=PF;exports.InterestTag=HF;exports.LazyErrorBoundary=aH;exports.LeaderboardTag=oV;exports.LikeSection=pV;exports.List=cA;exports.LoadingIcon=sa;exports.LoadingIndicator=Gb;exports.LocationTag=cV;exports.LogoutTag=FF;exports.MapTag=LF;exports.MarketTag=KF;exports.MediaUpload=KH;exports.MenuTooltip=CF;exports.MiddleDot=H4;exports.Modal=Wa;exports.ModalButton=A9;exports.ModalItem=a9;exports.MonthPicker=GL;exports.NavArrows=g9;exports.Navbar=SF;exports.NavigationControlPosition=D4;exports.NearbyTag=DF;exports.NewsfeedTag=RF;exports.NotFound=iH;exports.NotificationTag=WF;exports.OrDivider=dV;exports.OrderLabels=g2;exports.OrderPicker=tH;exports.OsmMap=Pz;exports.P=x2;exports.PartnersTag=EF;exports.PasswordInput=BT;exports.Picker=g5;exports.PollTag=rV;exports.PostTag=iV;exports.PrivateTag=zF;exports.ProfileTag=YF;exports.RepliesSection=hV;exports.Row=C0;exports.SaveCancelButtons=M2;exports.SearchBar=f9;exports.SendIcon=Nb;exports.ShowMore=mH;exports.SmartImage=Jl;exports.SocialMediaIcon=W9;exports.Span=Ys;exports.StaticColumn=ia;exports.StaticGameScore=H9;exports.StaticRow=nn;exports.StyledButton=s0;exports.SvgButton=Wb;exports.SvgTooltip=K1;exports.Tabs=h9;exports.Tag=b5;exports.Tags=pH;exports.TeamTag=UF;exports.Text=fH;exports.TextInput=DT;exports.TextUpdater=z9;exports.Textarea=MT;exports.TextareaAutosize=Xb;exports.TimeAgo=_b;exports.TimePicker=fj;exports.ToggleButton=GT;exports.Tooltip=W4;exports.UpArrowTag=GF;exports.UserTag=$F;exports.VerticalLine=uV;exports.VerticalStaticInterestTag=qF;exports.getDefaultExportFromCjs=Dr;
|