{"version":3,"file":"useDescription-toMjc23B.js","sources":["../../Client/node_modules/@react-aria/utils/dist/useDescription.mjs"],"sourcesContent":["import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from \"./useLayoutEffect.mjs\";\nimport {useState as $hQ5Hp$useState} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\nlet $ef06256079686ba0$var$descriptionId = 0;\nconst $ef06256079686ba0$var$descriptionNodes = new Map();\nfunction $ef06256079686ba0$export$f8aeda7b10753fa1(description) {\n    let [id, setId] = (0, $hQ5Hp$useState)();\n    (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{\n        if (!description) return;\n        let desc = $ef06256079686ba0$var$descriptionNodes.get(description);\n        if (!desc) {\n            let id = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;\n            setId(id);\n            let node = document.createElement('div');\n            node.id = id;\n            node.style.display = 'none';\n            node.textContent = description;\n            document.body.appendChild(node);\n            desc = {\n                refCount: 0,\n                element: node\n            };\n            $ef06256079686ba0$var$descriptionNodes.set(description, desc);\n        } else setId(desc.element.id);\n        desc.refCount++;\n        return ()=>{\n            if (desc && --desc.refCount === 0) {\n                desc.element.remove();\n                $ef06256079686ba0$var$descriptionNodes.delete(description);\n            }\n        };\n    }, [\n        description\n    ]);\n    return {\n        'aria-describedby': description ? id : undefined\n    };\n}\n\n\nexport {$ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription};\n//# sourceMappingURL=useDescription.module.js.map\n"],"names":["$ef06256079686ba0$var$descriptionId","$ef06256079686ba0$var$descriptionNodes","$ef06256079686ba0$export$f8aeda7b10753fa1","description","id","setId","$hQ5Hp$useState","$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c","desc","node"],"mappings":"gFAeA,IAAIA,EAAsC,EAC1C,MAAMC,EAAyC,IAAI,IACnD,SAASC,EAA0CC,EAAa,CAC5D,GAAI,CAACC,EAAIC,CAAK,EAAQC,EAAAA,SAAkB,EACxC,OAAIC,EAA2C,IAAI,CAC/C,GAAI,CAACJ,EAAa,OAClB,IAAIK,EAAOP,EAAuC,IAAIE,CAAW,EACjE,GAAKK,EAaEH,EAAMG,EAAK,QAAQ,EAAE,MAbjB,CACP,IAAIJ,EAAK,0BAA0BJ,GAAqC,GACxEK,EAAMD,CAAE,EACR,IAAIK,EAAO,SAAS,cAAc,KAAK,EACvCA,EAAK,GAAKL,EACVK,EAAK,MAAM,QAAU,OACrBA,EAAK,YAAcN,EACnB,SAAS,KAAK,YAAYM,CAAI,EAC9BD,EAAO,CACH,SAAU,EACV,QAASC,CACZ,EACDR,EAAuC,IAAIE,EAAaK,CAAI,CAC/D,CACD,OAAAA,EAAK,WACE,IAAI,CACHA,GAAQ,EAAEA,EAAK,WAAa,IAC5BA,EAAK,QAAQ,OAAQ,EACrBP,EAAuC,OAAOE,CAAW,EAEhE,CACT,EAAO,CACCA,CACR,CAAK,EACM,CACH,mBAAoBA,EAAcC,EAAK,MAC1C,CACL","x_google_ignoreList":[0]}