{"version":3,"file":"client.CmS3GL6W.js","sources":["../../node_modules/@astrojs/vue/static-html.js","../../node_modules/@astrojs/vue/client.js"],"sourcesContent":["import { defineComponent, h } from 'vue';\n\n/**\n * Astro passes `children` as a string of HTML, so we need\n * a wrapper `div` to render that content as VNodes.\n *\n * This is the Vue + JSX equivalent of using `
`\n */\nconst StaticHtml = defineComponent({\n\tprops: {\n\t\tvalue: String,\n\t\tname: String,\n\t\thydrate: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\tsetup({ name, value, hydrate }) {\n\t\tif (!value) return () => null;\n\t\tlet tagName = hydrate ? 'astro-slot' : 'astro-static-slot';\n\t\treturn () => h(tagName, { name, innerHTML: value });\n\t},\n});\n\n/**\n * Other frameworks have `shouldComponentUpdate` in order to signal\n * that this subtree is entirely static and will not be updated\n *\n * Fortunately, Vue is smart enough to figure that out without any\n * help from us, so this just works out of the box!\n */\n\nexport default StaticHtml;\n","import { setup } from 'virtual:@astrojs/vue/app';\nimport { Suspense, createApp, createSSRApp, h } from 'vue';\nimport StaticHtml from './static-html.js';\n\nexport default (element) =>\n\tasync (Component, props, slotted, { client }) => {\n\t\tif (!element.hasAttribute('ssr')) return;\n\n\t\t// Expose name on host component for Vue devtools\n\t\tconst name = Component.name ? `${Component.name} Host` : undefined;\n\t\tconst slots = {};\n\t\tfor (const [key, value] of Object.entries(slotted)) {\n\t\t\tslots[key] = () => h(StaticHtml, { value, name: key === 'default' ? undefined : key });\n\t\t}\n\n\t\tconst isHydrate = client !== 'only';\n\t\tconst bootstrap = isHydrate ? createSSRApp : createApp;\n\t\tconst app = bootstrap({\n\t\t\tname,\n\t\t\trender() {\n\t\t\t\tlet content = h(Component, props, slots);\n\t\t\t\t// related to https://github.com/withastro/astro/issues/6549\n\t\t\t\t// if the component is async, wrap it in a Suspense component\n\t\t\t\tif (isAsync(Component.setup)) {\n\t\t\t\t\tcontent = h(Suspense, null, content);\n\t\t\t\t}\n\t\t\t\treturn content;\n\t\t\t},\n\t\t});\n\t\tawait setup(app);\n\t\tapp.mount(element, isHydrate);\n\n\t\telement.addEventListener('astro:unmount', () => app.unmount(), { once: true });\n\t};\n\nfunction isAsync(fn) {\n\tconst constructor = fn?.constructor;\n\treturn constructor && constructor.name === 'AsyncFunction';\n}\n"],"names":["StaticHtml","defineComponent","name","value","hydrate","tagName","h","client","element","Component","props","slotted","slots","key","isHydrate","app","createSSRApp","createApp","content","isAsync","Suspense","setup","fn","constructor"],"mappings":"gdAQMA,EAAaC,EAAgB,CAClC,MAAO,CACN,MAAO,OACP,KAAM,OACN,QAAS,CACR,KAAM,QACN,QAAS,EACT,CACD,EACD,MAAM,CAAE,KAAAC,EAAM,MAAAC,EAAO,QAAAC,CAAO,EAAI,CAC/B,GAAI,CAACD,EAAO,MAAO,IAAM,KACzB,IAAIE,EAAUD,EAAU,aAAe,oBACvC,MAAO,IAAME,EAAED,EAAS,CAAE,KAAAH,EAAM,UAAWC,CAAK,CAAE,CAClD,CACF,CAAC,EClBDI,EAAgBC,GACf,MAAOC,EAAWC,EAAOC,EAAS,CAAE,OAAAJ,CAAM,IAAO,CAChD,GAAI,CAACC,EAAQ,aAAa,KAAK,EAAG,OAGlC,MAAMN,EAAOO,EAAU,KAAO,GAAGA,EAAU,IAAI,QAAU,OACnDG,EAAQ,CAAA,EACd,SAAW,CAACC,EAAKV,CAAK,IAAK,OAAO,QAAQQ,CAAO,EAChDC,EAAMC,CAAG,EAAI,IAAMP,EAAEN,EAAY,CAAE,MAAAG,EAAO,KAAMU,IAAQ,UAAY,OAAYA,CAAK,CAAA,EAGtF,MAAMC,EAAYP,IAAW,OAEvBQ,GADYD,EAAYE,EAAeC,GACvB,CACrB,KAAAf,EACA,QAAS,CACR,IAAIgB,EAAUZ,EAAEG,EAAWC,EAAOE,CAAK,EAGvC,OAAIO,EAAQV,EAAU,KAAK,IAC1BS,EAAUZ,EAAEc,EAAU,KAAMF,CAAO,GAE7BA,CACP,CACJ,CAAG,EACD,MAAMG,EAAS,EACfN,EAAI,MAAMP,EAASM,CAAS,EAE5BN,EAAQ,iBAAiB,gBAAiB,IAAMO,EAAI,QAAO,EAAI,CAAE,KAAM,EAAI,CAAE,CAC/E,EAEA,SAASI,EAAQG,EAAI,CACpB,MAAMC,EAAcD,GAAI,YACxB,OAAOC,GAAeA,EAAY,OAAS,eAC5C","x_google_ignoreList":[0,1]}