{"ast":null,"code":"import _slicedToArray from \"C:/Users/user/Desktop/projet dashboard/dashboard/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _objectWithoutProperties from \"C:/Users/user/Desktop/projet dashboard/dashboard/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";\nvar _excluded = [\"bounds\", \"boundsOptions\", \"center\", \"children\", \"className\", \"id\", \"placeholder\", \"style\", \"whenReady\", \"zoom\"];\nfunction _extends() {\n  _extends = Object.assign || function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}\nimport { LeafletProvider, createLeafletContext } from '@react-leaflet/core';\nimport { Map as LeafletMap } from 'leaflet';\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';\nfunction MapContainerComponent(_ref, forwardedRef) {\n  var bounds = _ref.bounds,\n    boundsOptions = _ref.boundsOptions,\n    center = _ref.center,\n    children = _ref.children,\n    className = _ref.className,\n    id = _ref.id,\n    placeholder = _ref.placeholder,\n    style = _ref.style,\n    whenReady = _ref.whenReady,\n    zoom = _ref.zoom,\n    options = _objectWithoutProperties(_ref, _excluded);\n  var _useState = useState({\n      className: className,\n      id: id,\n      style: style\n    }),\n    _useState2 = _slicedToArray(_useState, 1),\n    props = _useState2[0];\n  var _useState3 = useState(null),\n    _useState4 = _slicedToArray(_useState3, 2),\n    context = _useState4[0],\n    setContext = _useState4[1];\n  useImperativeHandle(forwardedRef, function () {\n    var _context$map;\n    return (_context$map = context === null || context === void 0 ? void 0 : context.map) !== null && _context$map !== void 0 ? _context$map : null;\n  }, [context]);\n  var mapRef = useCallback(function (node) {\n    if (node !== null && context === null) {\n      var map = new LeafletMap(node, options);\n      if (center != null && zoom != null) {\n        map.setView(center, zoom);\n      } else if (bounds != null) {\n        map.fitBounds(bounds, boundsOptions);\n      }\n      if (whenReady != null) {\n        map.whenReady(whenReady);\n      }\n      setContext(createLeafletContext(map));\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n  useEffect(function () {\n    return function () {\n      context === null || context === void 0 ? void 0 : context.map.remove();\n    };\n  }, [context]);\n  var contents = context ? /*#__PURE__*/React.createElement(LeafletProvider, {\n    value: context\n  }, children) : placeholder !== null && placeholder !== void 0 ? placeholder : null;\n  return /*#__PURE__*/React.createElement(\"div\", _extends({}, props, {\n    ref: mapRef\n  }), contents);\n}\nexport var MapContainer = /*#__PURE__*/forwardRef(MapContainerComponent);","map":{"version":3,"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","LeafletProvider","createLeafletContext","Map","LeafletMap","React","forwardRef","useCallback","useEffect","useImperativeHandle","useState","MapContainerComponent","_ref","forwardedRef","bounds","boundsOptions","center","children","className","id","placeholder","style","whenReady","zoom","options","_objectWithoutProperties","_excluded","_useState","_useState2","_slicedToArray","props","_useState3","_useState4","context","setContext","_context$map","map","mapRef","node","setView","fitBounds","remove","contents","createElement","value","ref","MapContainer"],"sources":["C:/Users/user/Desktop/projet dashboard/dashboard/node_modules/react-leaflet/lib/MapContainer.js"],"sourcesContent":["function _extends() {\n    _extends = Object.assign || function(target) {\n        for(var i = 1; i < arguments.length; i++){\n            var source = arguments[i];\n            for(var key in source){\n                if (Object.prototype.hasOwnProperty.call(source, key)) {\n                    target[key] = source[key];\n                }\n            }\n        }\n        return target;\n    };\n    return _extends.apply(this, arguments);\n}\nimport { LeafletProvider, createLeafletContext } from '@react-leaflet/core';\nimport { Map as LeafletMap } from 'leaflet';\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';\nfunction MapContainerComponent({ bounds , boundsOptions , center , children , className , id , placeholder , style , whenReady , zoom , ...options }, forwardedRef) {\n    const [props] = useState({\n        className,\n        id,\n        style\n    });\n    const [context, setContext] = useState(null);\n    useImperativeHandle(forwardedRef, ()=>context?.map ?? null, [\n        context\n    ]);\n    const mapRef = useCallback((node)=>{\n        if (node !== null && context === null) {\n            const map = new LeafletMap(node, options);\n            if (center != null && zoom != null) {\n                map.setView(center, zoom);\n            } else if (bounds != null) {\n                map.fitBounds(bounds, boundsOptions);\n            }\n            if (whenReady != null) {\n                map.whenReady(whenReady);\n            }\n            setContext(createLeafletContext(map));\n        }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, []);\n    useEffect(()=>{\n        return ()=>{\n            context?.map.remove();\n        };\n    }, [\n        context\n    ]);\n    const contents = context ? /*#__PURE__*/ React.createElement(LeafletProvider, {\n        value: context\n    }, children) : placeholder ?? null;\n    return /*#__PURE__*/ React.createElement(\"div\", _extends({}, props, {\n        ref: mapRef\n    }), contents);\n}\nexport const MapContainer = /*#__PURE__*/ forwardRef(MapContainerComponent);\n"],"mappings":";;;AAAA,SAASA,QAAQA,CAAA,EAAG;EAChBA,QAAQ,GAAGC,MAAM,CAACC,MAAM,IAAI,UAASC,MAAM,EAAE;IACzC,KAAI,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGC,SAAS,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAC;MACrC,IAAIG,MAAM,GAAGF,SAAS,CAACD,CAAC,CAAC;MACzB,KAAI,IAAII,GAAG,IAAID,MAAM,EAAC;QAClB,IAAIN,MAAM,CAACQ,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,MAAM,EAAEC,GAAG,CAAC,EAAE;UACnDL,MAAM,CAACK,GAAG,CAAC,GAAGD,MAAM,CAACC,GAAG,CAAC;QAC7B;MACJ;IACJ;IACA,OAAOL,MAAM;EACjB,CAAC;EACD,OAAOH,QAAQ,CAACY,KAAK,CAAC,IAAI,EAAEP,SAAS,CAAC;AAC1C;AACA,SAASQ,eAAe,EAAEC,oBAAoB,QAAQ,qBAAqB;AAC3E,SAASC,GAAG,IAAIC,UAAU,QAAQ,SAAS;AAC3C,OAAOC,KAAK,IAAIC,UAAU,EA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