{"version":3,"file":"useServerHeadInsertion.js","names":[],"sources":["esm/useServerHeadInsertion.js"],"sourcesContent":["import { createContext, useContext, useId } from \"react\";\nconst ServerHeadInsertions = {};\nconst getServerHeadInsertions = (id) => {\n  if (ServerHeadInsertions[id]) {\n    return Object.values(ServerHeadInsertions[id]);\n  }\n};\nconst ServerRenderID = createContext(\"\");\nconst useServerHeadInsertion = (callback) => {\n  if (typeof window == \"undefined\") {\n    const insertionID = useId();\n    const id = useContext(ServerRenderID);\n    ServerHeadInsertions[id] ||= {};\n    ServerHeadInsertions[id][insertionID] = callback;\n  }\n};\nexport {\n  ServerRenderID,\n  getServerHeadInsertions,\n  useServerHeadInsertion\n};\n//# sourceMappingURL=useServerHeadInsertion.js.map\n"],"mappings":";;;AACA,MAAM,uBAAuB,CAAC;AAC9B,MAAM,2BAA2B,OAAO;CACtC,IAAI,qBAAqB,KAAK;EAC5B,OAAO,OAAO,OAAO,qBAAqB,GAAG;CAC/C;AACF;AACA,MAAM,iBAAiB,cAAc,EAAE;AACvC,MAAM,0BAA0B,aAAa;CAC3C,IAAI,OAAO,UAAU,aAAa;EAChC,MAAM,cAAc,MAAM;EAC1B,MAAM,KAAK,WAAW,cAAc;EACpC,qBAAqB,QAAQ,CAAC;EAC9B,qBAAqB,GAAG,CAAC,eAAe;CAC1C;AACF"}