You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
8.4 KiB
1 lines
8.4 KiB
{"ast":null,"code":"import { LeafletProvider, addClassName, useLeafletContext } from '@react-leaflet/core';\nimport React, { forwardRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nconst DEFAULT_PANES = ['mapPane', 'markerPane', 'overlayPane', 'popupPane', 'shadowPane', 'tilePane', 'tooltipPane'];\n\nfunction omitPane(obj, pane) {\n const {\n [pane]: _p,\n ...others\n } = obj;\n return others;\n}\n\nfunction createPane(name, props, context) {\n if (DEFAULT_PANES.indexOf(name) !== -1) {\n throw new Error(`You must use a unique name for a pane that is not a default Leaflet pane: ${name}`);\n }\n\n if (context.map.getPane(name) != null) {\n throw new Error(`A pane with this name already exists: ${name}`);\n }\n\n const parentPaneName = props.pane ?? context.pane;\n const parentPane = parentPaneName ? context.map.getPane(parentPaneName) : undefined;\n const element = context.map.createPane(name, parentPane);\n\n if (props.className != null) {\n addClassName(element, props.className);\n }\n\n if (props.style != null) {\n Object.keys(props.style).forEach(key => {\n // @ts-ignore\n element.style[key] = props.style[key];\n });\n }\n\n return element;\n}\n\nfunction PaneComponent(props, forwardedRef) {\n const [paneName] = useState(props.name);\n const [paneElement, setPaneElement] = useState(null);\n useImperativeHandle(forwardedRef, () => paneElement, [paneElement]);\n const context = useLeafletContext();\n const newContext = useMemo(() => ({ ...context,\n pane: paneName\n }), [context]);\n useEffect(() => {\n setPaneElement(createPane(paneName, props, context));\n return function removeCreatedPane() {\n const pane = context.map.getPane(paneName);\n pane?.remove?.(); // @ts-ignore map internals\n\n if (context.map._panes != null) {\n // @ts-ignore map internals\n context.map._panes = omitPane(context.map._panes, paneName); // @ts-ignore map internals\n\n context.map._paneRenderers = omitPane( // @ts-ignore map internals\n context.map._paneRenderers, paneName);\n }\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return props.children != null && paneElement != null ? /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(LeafletProvider, {\n value: newContext\n }, props.children), paneElement) : null;\n}\n\nexport const Pane = /*#__PURE__*/forwardRef(PaneComponent);","map":{"version":3,"names":["LeafletProvider","addClassName","useLeafletContext","React","forwardRef","useState","useEffect","useImperativeHandle","useMemo","createPortal","DEFAULT_PANES","omitPane","obj","pane","_p","others","createPane","name","props","context","indexOf","Error","map","getPane","parentPaneName","parentPane","undefined","element","className","style","Object","keys","forEach","key","PaneComponent","forwardedRef","paneName","paneElement","setPaneElement","newContext","removeCreatedPane","remove","_panes","_paneRenderers","children","createElement","value","Pane"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-leaflet/lib/Pane.js"],"sourcesContent":["import { LeafletProvider, addClassName, useLeafletContext } from '@react-leaflet/core';\nimport React, { forwardRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nconst DEFAULT_PANES = [\n 'mapPane',\n 'markerPane',\n 'overlayPane',\n 'popupPane',\n 'shadowPane',\n 'tilePane',\n 'tooltipPane', \n];\nfunction omitPane(obj, pane) {\n const { [pane]: _p , ...others } = obj;\n return others;\n}\nfunction createPane(name, props, context) {\n if (DEFAULT_PANES.indexOf(name) !== -1) {\n throw new Error(`You must use a unique name for a pane that is not a default Leaflet pane: ${name}`);\n }\n if (context.map.getPane(name) != null) {\n throw new Error(`A pane with this name already exists: ${name}`);\n }\n const parentPaneName = props.pane ?? context.pane;\n const parentPane = parentPaneName ? context.map.getPane(parentPaneName) : undefined;\n const element = context.map.createPane(name, parentPane);\n if (props.className != null) {\n addClassName(element, props.className);\n }\n if (props.style != null) {\n Object.keys(props.style).forEach((key)=>{\n // @ts-ignore\n element.style[key] = props.style[key];\n });\n }\n return element;\n}\nfunction PaneComponent(props, forwardedRef) {\n const [paneName] = useState(props.name);\n const [paneElement, setPaneElement] = useState(null);\n useImperativeHandle(forwardedRef, ()=>paneElement, [\n paneElement\n ]);\n const context = useLeafletContext();\n const newContext = useMemo(()=>({\n ...context,\n pane: paneName\n }), [\n context\n ]);\n useEffect(()=>{\n setPaneElement(createPane(paneName, props, context));\n return function removeCreatedPane() {\n const pane = context.map.getPane(paneName);\n pane?.remove?.();\n // @ts-ignore map internals\n if (context.map._panes != null) {\n // @ts-ignore map internals\n context.map._panes = omitPane(context.map._panes, paneName);\n // @ts-ignore map internals\n context.map._paneRenderers = omitPane(// @ts-ignore map internals\n context.map._paneRenderers, paneName);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return props.children != null && paneElement != null ? /*#__PURE__*/ createPortal(/*#__PURE__*/ React.createElement(LeafletProvider, {\n value: newContext\n }, props.children), paneElement) : null;\n}\nexport const Pane = /*#__PURE__*/ forwardRef(PaneComponent);\n"],"mappings":"AAAA,SAASA,eAAT,EAA0BC,YAA1B,EAAwCC,iBAAxC,QAAiE,qBAAjE;AACA,OAAOC,KAAP,IAAgBC,UAAhB,EAA4BC,QAA5B,EAAsCC,SAAtC,EAAiDC,mBAAjD,EAAsEC,OAAtE,QAAqF,OAArF;AACA,SAASC,YAAT,QAA6B,WAA7B;AACA,MAAMC,aAAa,GAAG,CAClB,SADkB,EAElB,YAFkB,EAGlB,aAHkB,EAIlB,WAJkB,EAKlB,YALkB,EAMlB,UANkB,EAOlB,aAPkB,CAAtB;;AASA,SAASC,QAAT,CAAkBC,GAAlB,EAAuBC,IAAvB,EAA6B;EACzB,MAAM;IAAE,CAACA,IAAD,GAAQC,EAAV;IAAe,GAAGC;EAAlB,IAA6BH,GAAnC;EACA,OAAOG,MAAP;AACH;;AACD,SAASC,UAAT,CAAoBC,IAApB,EAA0BC,KAA1B,EAAiCC,OAAjC,EAA0C;EACtC,IAAIT,aAAa,CAACU,OAAd,CAAsBH,IAAtB,MAAgC,CAAC,CAArC,EAAwC;IACpC,MAAM,IAAII,KAAJ,CAAW,6EAA4EJ,IAAK,EAA5F,CAAN;EACH;;EACD,IAAIE,OAAO,CAACG,GAA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