{"ast":null,"code":"import { useEffect, useRef } from 'react';\nimport { useLeafletContext } from './context.js';\nimport { useEventHandlers } from './events.js';\nimport { useLayerLifecycle } from './layer.js';\nimport { withPane } from './pane.js';\nexport function usePathOptions(element, props) {\n  var optionsRef = useRef();\n  useEffect(function updatePathOptions() {\n    if (props.pathOptions !== optionsRef.current) {\n      var _props$pathOptions;\n      var options = (_props$pathOptions = props.pathOptions) !== null && _props$pathOptions !== void 0 ? _props$pathOptions : {};\n      element.instance.setStyle(options);\n      optionsRef.current = options;\n    }\n  }, [element, props]);\n}\nexport function createPathHook(useElement) {\n  return function usePath(props) {\n    var context = useLeafletContext();\n    var elementRef = useElement(withPane(props, context), context);\n    useEventHandlers(elementRef.current, props.eventHandlers);\n    useLayerLifecycle(elementRef.current, context);\n    usePathOptions(elementRef.current, props);\n    return elementRef;\n  };\n}","map":{"version":3,"names":["useEffect","useRef","useLeafletContext","useEventHandlers","useLayerLifecycle","withPane","usePathOptions","element","props","optionsRef","updatePathOptions","pathOptions","current","_props$pathOptions","options","instance","setStyle","createPathHook","useElement","usePath","context","elementRef","eventHandlers"],"sources":["C:/Users/user/Desktop/projet dashboard/dashboard/node_modules/@react-leaflet/core/lib/path.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useLeafletContext } from './context.js';\nimport { useEventHandlers } from './events.js';\nimport { useLayerLifecycle } from './layer.js';\nimport { withPane } from './pane.js';\nexport function usePathOptions(element, props) {\n    const optionsRef = useRef();\n    useEffect(function updatePathOptions() {\n        if (props.pathOptions !== optionsRef.current) {\n            const options = props.pathOptions ?? {};\n            element.instance.setStyle(options);\n            optionsRef.current = options;\n        }\n    }, [\n        element,\n        props\n    ]);\n}\nexport function createPathHook(useElement) {\n    return function usePath(props) {\n        const context = useLeafletContext();\n        const elementRef = useElement(withPane(props, context), context);\n        useEventHandlers(elementRef.current, props.eventHandlers);\n        useLayerLifecycle(elementRef.current, context);\n        usePathOptions(elementRef.current, props);\n        return elementRef;\n    };\n}\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,QAAQ,QAAQ,WAAW;AACpC,OAAO,SAASC,cAAcA,CAACC,OAAO,EAAEC,KAAK,EAAE;EAC3C,IAAMC,UAAU,GAAGR,MAAM,CAAC,CAAC;EAC3BD,SAAS,CAAC,SAASU,iBAAiBA,CAAA,EAAG;IACnC,IAAIF,KAAK,CAACG,WAAW,KAAKF,UAAU,CAACG,OAAO,EAAE;MAAA,IAAAC,kBAAA;MAC1C,IAAMC,OAAO,IAAAD,kBAAA,GAAGL,KAAK,CAACG,WAAW,cAAAE,kBAAA,cAAAA,kBAAA,GAAI,CAAC,CAAC;MACvCN,OAAO,CAACQ,QAAQ,CAACC,QAAQ,CAACF,OAAO,CAAC;MAClCL,UAAU,CAACG,OAAO,GAAGE,OAAO;IAChC;EACJ,CAAC,EAAE,CACCP,OAAO,EACPC,KAAK,CACR,CAAC;AACN;AACA,OAAO,SAASS,cAAcA,CAACC,UAAU,EAAE;EACvC,OAAO,SAASC,OAAOA,CAACX,KAAK,EAAE;IAC3B,IAAMY,OAAO,GAAGlB,iBAAiB,CAAC,CAAC;IACnC,IAAMmB,UAAU,GAAGH,UAAU,CAACb,QAAQ,CAACG,KAAK,EAAEY,OAAO,CAAC,EAAEA,OAAO,CAAC;IAChEjB,gBAAgB,CAACkB,UAAU,CAACT,OAAO,EAAEJ,KAAK,CAACc,aAAa,CAAC;IACzDlB,iBAAiB,CAACiB,UAAU,CAACT,OAAO,EAAEQ,OAAO,CAAC;IAC9Cd,cAAc,CAACe,UAAU,CAACT,OAAO,EAAEJ,KAAK,CAAC;IACzC,OAAOa,UAAU;EACrB,CAAC;AACL"},"metadata":{},"sourceType":"module","externalDependencies":[]}