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EAEA,iCACE,GAEA,MAAM,KAAE,GAAS,GACX,MAAE,GAAU,EAEd,GAAO,MAAK,EAAM,IAAM,EAAsB,EAAM,KAC1D,EAEA,eAAA,CAAgB,GACd,MAAM,KAAE,EAAI,WAAE,GAAe,GACvB,MAAE,GAAU,EAEZ,EAtEZ,SAA0B,GACxB,IAAI,EACJ,KAAQ,EAAQ,EAAc,KAAK,IACjC,GAAI,EAAM,GAAG,OAAS,GAAM,EAE5B,OADA,EAAc,UAAY,EACnB,EAAM,GAEf,OAAO,IACT,CA8D0B,CAAiB,EAAM,KAC3C,IAAK,EAAa,OAGlB,GADoB,EAAW,WACf,6BACd,MAAM,EAAK,oBACT,iCAAiC,sIAIrC,EAAM,IAAM,EAAsB,EAAM,IAC1C,c","file":"/npm/@babel/plugin-transform-unicode-escapes@8.0.1/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/@babel/plugin-transform-unicode-escapes@8.0.1/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t, type NodePath } from \"@babel/core\";\n\nexport default declare(api => {\n  api.assertVersion(REQUIRED_VERSION(\"^7.0.0-0 || ^8.0.0\"));\n\n  const surrogate = /[\\ud800-\\udfff]/g;\n  const unicodeEscape = /(\\\\+)u\\{([0-9a-fA-F]+)\\}/g;\n\n  function escape(code: number) {\n    return \"\\\\u\" + code.toString(16).padStart(4, \"0\");\n  }\n\n  function replacer(match: string, backslashes: string, code: string) {\n    if (backslashes.length % 2 === 0) {\n      return match;\n    }\n\n    const char = String.fromCodePoint(parseInt(code, 16));\n    const escaped = backslashes.slice(0, -1) + escape(char.charCodeAt(0));\n\n    return char.length === 1 ? escaped : escaped + escape(char.charCodeAt(1));\n  }\n\n  function replaceUnicodeEscapes(str: string) {\n    return str.replace(unicodeEscape, replacer);\n  }\n\n  function getUnicodeEscape(str: string) {\n    let match;\n    while ((match = unicodeEscape.exec(str))) {\n      if (match[1].length % 2 === 0) continue;\n      unicodeEscape.lastIndex = 0;\n      return match[0];\n    }\n    return null;\n  }\n\n  return {\n    name: \"transform-unicode-escapes\",\n    manipulateOptions({ generatorOpts }) {\n      // Babel 8 will enable jsesc minimal mode by default, which outputs\n      // unescaped unicode string\n      if (!generatorOpts.jsescOption) {\n        generatorOpts.jsescOption = {};\n      }\n      generatorOpts.jsescOption.minimal ??= false;\n    },\n    visitor: api.traverse.explode({\n      Identifier(path) {\n        const { node, key } = path;\n        const { name } = node;\n        const replaced = name.replace(surrogate, c => {\n          return `_u${c.charCodeAt(0).toString(16)}`;\n        });\n        if (name === replaced) return;\n\n        const str = t.inherits(t.stringLiteral(name), node);\n\n        if (key === \"key\") {\n          path.replaceWith(str);\n          return;\n        }\n\n        const { parentPath, scope } = path;\n        if (\n          parentPath.isMemberExpression({ property: node }) ||\n          parentPath.isOptionalMemberExpression({ property: node })\n        ) {\n          parentPath.node.computed = true;\n          path.replaceWith(str);\n          return;\n        }\n\n        const binding = scope.getBinding(name);\n        if (binding) {\n          scope.rename(name, scope.generateUid(replaced));\n          return;\n        }\n\n        throw path.buildCodeFrameError(\n          `Can't reference '${name}' as a bare identifier`,\n        );\n      },\n\n      \"StringLiteral|DirectiveLiteral\"(\n        path: NodePath<t.StringLiteral | t.DirectiveLiteral>,\n      ) {\n        const { node } = path;\n        const { extra } = node;\n\n        if (extra?.raw) extra.raw = replaceUnicodeEscapes(extra.raw as string);\n      },\n\n      TemplateElement(path) {\n        const { node, parentPath } = path;\n        const { value } = node;\n\n        const firstEscape = getUnicodeEscape(value.raw);\n        if (!firstEscape) return;\n\n        const grandParent = parentPath.parentPath;\n        if (grandParent.isTaggedTemplateExpression()) {\n          throw path.buildCodeFrameError(\n            `Can't replace Unicode escape '${firstEscape}' inside tagged template literals. You can enable '@babel/plugin-transform-template-literals' to compile them to classic strings.`,\n          );\n        }\n\n        value.raw = replaceUnicodeEscapes(value.raw);\n      },\n    }),\n  };\n});\n"]}