{"version":3,"sources":["jsdelivr-header.js","/npm/ssr-glue-plugin-server-vue-usehead@1.0.6/src/plugin.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,oECLA,IAAA,MAAA,QAAA,gBAEM,YAAc,cAEb,SAAA,gBACL,IAAI,EAEJ,MAAO,CACL,KAAM,YAEN,OAAA,GACE,KAAK,SAAS,GAAG,4BAA6B,IAC5C,EAAO,MAAA,WAAA,UAAA,GAEP,EAAM,IAAI,IAAI,EAAA,wBAIZ,CAAc,GAClB,IAAK,EACH,OAAO,EAGT,MAAM,SAAE,EAAA,UAAU,EAAA,UAAW,GAAc,MAAA,mBAAmB,UAAA,EAAA,GAE9D,OAAO,EACJ,QAAQ,yBAAoB,GAC5B,QAAQ,SAAU,QAAQ,MAC1B,QAAQ,SAAU,QAAQ,KAAA,G","file":"/npm/ssr-glue-plugin-server-vue-usehead@1.0.6/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ssr-glue-plugin-server-vue-usehead@1.0.6/dist/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 { ServerSidePlugin } from 'ssr-glue'\nimport { renderHeadToString, createHead, HeadClient } from '@vueuse/head'\n\nconst PLUGIN_NAME = 'vue:useHead'\n\nexport function useHeadPlugin(): ServerSidePlugin {\n  let head: HeadClient | undefined\n\n  return {\n    name: PLUGIN_NAME,\n\n    created() {\n      this.eventBus.on('plugin/vueApp/appCreated', (event) => {\n        head = createHead()\n\n        event.app.use(head)\n      })\n    },\n\n    async transformHtml(html: string) {\n      if (!head) {\n        return html\n      }\n\n      const { headTags, htmlAttrs, bodyAttrs } = renderHeadToString(head)\n\n      return html\n        .replace(`<!--head-tags-->`, headTags)\n        .replace(`<html>`, `<html${htmlAttrs}>`)\n        .replace(`<body>`, `<body${bodyAttrs}>`)\n    },\n  }\n}\n"]}