{"version":3,"file":"HeadContent.dev.cjs","names":["MetaProvider","For","createEffect","createMemo","DEV_STYLES_ATTR","Asset","useHydrated","useTags","HeadContentProps","HeadContent","props","tags","assetCrossOrigin","hydrated","document","querySelectorAll","forEach","el","remove","filteredTags","filter","tag","attrs","_$createComponent","children","each"],"sources":["../../src/HeadContent.dev.tsx"],"sourcesContent":["import { MetaProvider } from '@solidjs/meta'\nimport { For, createEffect, createMemo } from 'solid-js'\nimport { DEV_STYLES_ATTR } from '@tanstack/router-core'\nimport { Asset } from './Asset'\nimport { useHydrated } from './ClientOnly'\nimport { useTags } from './headContentUtils'\nimport type { HeadContentProps } from './HeadContent'\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`\n * to ensure it's part of the reactive tree and updates correctly during client-side navigation.\n * The component uses portals internally to render content into the `<head>` element.\n *\n * Development version: filters out dev styles link after hydration and\n * includes a fallback cleanup effect for hydration mismatch cases.\n */\nexport function HeadContent(props: HeadContentProps) {\n  const tags = useTags(props.assetCrossOrigin)\n  const hydrated = useHydrated()\n\n  // Fallback cleanup for hydration mismatch cases\n  // Runs when hydration completes to remove any orphaned dev styles links from DOM\n  createEffect(() => {\n    if (hydrated()) {\n      document\n        .querySelectorAll(`link[${DEV_STYLES_ATTR}]`)\n        .forEach((el) => el.remove())\n    }\n  })\n\n  // Filter out dev styles after hydration\n  const filteredTags = createMemo(() => {\n    if (hydrated()) {\n      return tags().filter(\n        (tag) => tag.tag !== 'link' || tag.attrs?.[DEV_STYLES_ATTR] !== true,\n      )\n    }\n    return tags()\n  })\n\n  return (\n    <MetaProvider>\n      <For each={filteredTags()}>{(tag) => <Asset {...tag} />}</For>\n    </MetaProvider>\n  )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAgBS,YAAYC,OAAyB;CACnD,MAAMC,OAAOJ,yBAAAA,QAAQG,MAAME,gBAAgB;CAC3C,MAAMC,WAAWP,mBAAAA,YAAY;CAI7BJ,CAAAA,GAAAA,SAAAA,oBAAmB;EACjB,IAAIW,SAAS,GACXC,SACGC,iBAAiB,QAAQX,sBAAAA,gBAAe,EAAG,EAC3CY,SAASC,OAAOA,GAAGC,OAAO,CAAC;CAElC,CAAC;CAGD,MAAMC,gBAAAA,GAAAA,SAAAA,kBAAgC;EACpC,IAAIN,SAAS,GACX,OAAOF,KAAK,EAAES,QACXC,QAAQA,IAAIA,QAAQ,UAAUA,IAAIC,QAAQlB,sBAAAA,qBAAqB,IAClE;EAEF,OAAOO,KAAK;CACd,CAAC;CAED,QAAA,GAAA,aAAA,iBACGX,cAAAA,cAAY,EAAA,IAAAwB,WAAA;EAAA,QAAA,GAAA,aAAA,iBACVvB,SAAAA,KAAG;GAAA,IAACwB,OAAI;IAAA,OAAEN,aAAa;GAAC;GAAAK,WAAIH,SAAAA,GAAAA,aAAAA,iBAAShB,cAAAA,OAAUgB,GAAG;EAAI,CAAA;CAAA,EAAA,CAAA;AAG7D"}