{"version":3,"file":"svelte-component.Lr_is-OP.js","sources":["../../../../../../../../node_modules/svelte/src/internal/client/dom/blocks/svelte-component.js"],"sourcesContent":["/** @import { TemplateNode, Dom, Effect } from '#client' */\nimport { EFFECT_TRANSPARENT } from '../../constants.js';\nimport { block, branch, pause_effect } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\n\n/**\n * @template P\n * @template {(props: P) => void} C\n * @param {TemplateNode} node\n * @param {() => C} get_component\n * @param {(anchor: TemplateNode, component: C) => Dom | void} render_fn\n * @returns {void}\n */\nexport function component(node, get_component, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {C} */\n\tvar component;\n\n\t/** @type {Effect | null} */\n\tvar effect;\n\n\tblock(() => {\n\t\tif (component === (component = get_component())) return;\n\n\t\tif (effect) {\n\t\t\tpause_effect(effect);\n\t\t\teffect = null;\n\t\t}\n\n\t\tif (component) {\n\t\t\teffect = branch(() => render_fn(anchor, component));\n\t\t}\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n"],"names":["component","node","get_component","render_fn","hydrating","hydrate_next","anchor","effect","block","pause_effect","branch","EFFECT_TRANSPARENT","hydrate_node"],"mappings":"sFAaO,SAASA,EAAUC,EAAMC,EAAeC,EAAW,CACrDC,GACHC,EAAc,EAGf,IAAIC,EAASL,EAGTD,EAGAO,EAEJC,EAAM,IAAM,CACPR,KAAeA,EAAYE,EAAa,KAExCK,IACHE,EAAaF,CAAM,EACnBA,EAAS,MAGNP,IACHO,EAASG,EAAO,IAAMP,EAAUG,EAAQN,CAAS,CAAC,GAEnD,EAAEW,CAAkB,EAEjBP,IACHE,EAASM,EAEX","x_google_ignoreList":[0]}