{"version":3,"sources":["jsdelivr-header.js","/npm/babel-plugin-access-undefined@1.9.5/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,8BAAgC,QAAQ,qCAExC,MAAS,IACb,EAAK,SAAU,EACR,GAGH,UAAY,CAAC,EAAG,EAAM,KACtB,EAAE,mBAAmB,IACvB,EAAK,YACH,EAAE,kBACA,KACA,EACA,MAAM,EAAK,OAGjB,EAGI,iBAAmB,CAAC,EAAG,IAAS,CACpC,EAAE,aAAa,EAAK,KAAK,OAAQ,CAAE,KAAM,SACzC,EAAE,aAAa,EAAK,KAAK,OAAQ,CAAE,KAAM,YAGrC,IAAM,IAAK,CACf,cAAA,CAAgB,GACd,GAAI,EAAK,KAAK,QACZ,OAEF,MAAO,EAAc,GAAiB,iBAAiB,EAAG,GACtD,GAAgB,EAClB,EAAK,OAEL,UAAU,EAAG,EAAM,EAAK,KAAK,OAEjC,EACA,gBAAA,CAAkB,GAChB,GAAI,KAAK,gBAAiB,CACxB,GAAI,EAAK,KAAK,QACZ,OAEF,MAAM,EAAS,EAAK,KAAK,OACzB,EAAK,YACH,EAAE,kBACA,KACA,EACA,MAAM,EAAK,OAGjB,CACF,EACA,oBAAA,CAAsB,GACpB,GAAI,KAAK,gBAAiB,CACxB,GAAI,EAAK,KAAK,QACZ,OAEF,MAAM,SAAE,EAAQ,KAAE,EAAI,MAAE,GAAU,EAAK,KACvC,EAAK,YACH,MAAM,EAAE,qBACN,EACA,MAAM,GACN,IAGN,CACF,EACA,cAAA,CAAgB,GACd,GAAI,KAAK,gBAAiB,CACxB,GAAI,EAAK,KAAK,QACZ,OAEF,UAAU,EAAG,EAAM,EAAK,KAAK,OAC/B,CACF,IAGF,OAAO,QAAW,IAChB,MAAM,EAAI,EAAM,MAChB,MAAO,CACL,SAAU,8BACV,QAAS,CACP,cAAA,CAAgB,GACd,GAAI,EAAK,KAAK,QACZ,OAEF,MAAO,EAAc,GAAiB,iBAAiB,EAAG,GACtD,GAAgB,GACd,EACF,EAAK,SAAS,IAAI,GAAI,CAAE,iBAAiB,IAChC,GACT,EAAK,SAAS,IAAI,GAAI,CAAE,iBAAiB,IAE3C,EAAK,YACH,EAAK,KAAK,SAGZ,UAAU,EAAG,EAAM,EAAK,KAAK,OAEjC,GAEJ","file":"/npm/babel-plugin-access-undefined@1.9.5/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/babel-plugin-access-undefined@1.9.5/src/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","const babelPluginSyntaxFunctionBind = require('babel-plugin-syntax-function-bind')\n\nconst clean = (node) => {\n  node.isClean = true\n  return node\n}\n\nconst toLogical = (t, path, callee) => {\n  if (t.isMemberExpression(callee)) {\n    path.replaceWith(\n      t.logicalExpression(\n        '&&',\n        callee,\n        clean(path.node)\n      )\n    )\n  }\n}\n\nconst isSafeUnsafeBind = (t, path) => [\n  t.isIdentifier(path.node.object, { name: 'safe' }),\n  t.isIdentifier(path.node.object, { name: 'unsafe' })\n]\n\nconst ttt = t => ({\n  BindExpression (path) {\n    if (path.node.isClean) {\n      return\n    }\n    const [isMayBeUndef, isWontBeUndef] = isSafeUnsafeBind(t, path)\n    if (isMayBeUndef || isWontBeUndef) {\n      path.skip()\n    } else {\n      toLogical(t, path, path.node.callee)\n    }\n  },\n  MemberExpression (path) {\n    if (this.shouldTranspile) {\n      if (path.node.isClean) {\n        return\n      }\n      const object = path.node.object\n      path.replaceWith(\n        t.logicalExpression(\n          '&&',\n          object,\n          clean(path.node)\n        )\n      )\n    }\n  },\n  AssignmentExpression (path) {\n    if (this.shouldTranspile) {\n      if (path.node.isClean) {\n        return\n      }\n      const { operator, left, right } = path.node\n      path.replaceWith(\n        clean(t.assignmentExpression(\n          operator,\n          clean(left),\n          right\n        ))\n      )\n    }\n  },\n  CallExpression (path) {\n    if (this.shouldTranspile) {\n      if (path.node.isClean) {\n        return\n      }\n      toLogical(t, path, path.node.callee)\n    }\n  }\n})\n\nmodule.exports = (babel) => {\n  const t = babel.types\n  return {\n    inherits: babelPluginSyntaxFunctionBind,\n    visitor: {\n      BindExpression (path) {\n        if (path.node.isClean) {\n          return\n        }\n        const [isMayBeUndef, isWontBeUndef] = isSafeUnsafeBind(t, path)\n        if (isMayBeUndef || isWontBeUndef) {\n          if (isMayBeUndef) {\n            path.traverse(ttt(t), { shouldTranspile: true })\n          } else if (isWontBeUndef) {\n            path.traverse(ttt(t), { shouldTranspile: false })\n          }\n          path.replaceWith(\n            path.node.callee\n          )\n        } else {\n          toLogical(t, path, path.node.callee)\n        }\n      }\n    }\n  }\n}\n"]}