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AEA,IAAIqC,EAAoBC,EAExB,GAAI,CACHI,EAAoB,IAAI,EACxBe,EAAmB,GACnBP,IAAUpB,EAAO4B,CAAK,EACtBD,EAAmB,EACpB,OAAS3B,EAAO,CACf6B,EAAsB7B,EAAO,KAAKvB,IAAW,KAAKA,GAAQ,MAAM,CACjE,QAAE,CACDmC,EAAoBL,CAAiB,CACtC,CAEIc,GACHS,EAAiB,IAAM,CACtB,KAAKlD,GAAiB,KAAKuB,GAAK,IAAM,CACrChD,EAAM,OAAO,EACb,KAAK8B,GAAwB,GAE7B,GAAI,CACH,OAAOc,EAAO,IAAM,CACnBsB,EACC,KAAKlD,GACL,IAAM6B,EACN,IAAM4B,CACP,CACD,CAAC,CACF,OAAS5B,EAAO,CACf,OAAA6B,EAAsB7B,EAA8B,KAAKvB,GAAQ,MAAO,EACjE,IACR,QAAE,CACD,KAAKQ,GAAwB,EAC9B,CACD,CAAC,CACF,CAAC,CAEH,CACD,EAEO,SAAS8C,IAAe,CAC9B,OAAuD1C,EAAe,CACvE,CAEO,SAASa,IAAU,CACrBb,IAAkB,MACnB,kCAAgC,EAGnC,IAAIxB,EAAWwB,EAAc,EAE7B,OAAIxB,IAAa,KACT,EAGDA,EAAS,mBAAmB,CACpC","names":["BOUNDARY_EFFECT","COMMENT_NODE","EFFECT_PRESERVED","EFFECT_TRANSPARENT","HYDRATION_START_ELSE","component_context","set_component_context","handle_error","invoke_error_boundary","block","branch","destroy_effect","move_effect","pause_effect","active_effect","active_reaction","get","set_active_effect","set_active_reaction","hydrate_next","hydrate_node","hydrating","next","skip_nodes","set_hydrate_node","queue_micro_task","e","w","o","Batch","internal_set","source","tag","createSubscriber","create_text","flags","EFFECT_TRANSPARENT","EFFECT_PRESERVED","BOUNDARY_EFFECT","boundary","node","props","children","Boundary","#pending","#anchor","#hydrate_open","hydrating","hydrate_node","#props","#children","#effect","#main_effect","#pending_effect","#failed_effect","#offscreen_fragment","#pending_anchor","#local_pending_count","#pending_count","#is_creating_fallback","#effect_pending","#effect_pending_subscriber","o","active_effect","block","comment","hydrate_next","COMMENT_NODE","HYDRATION_START_ELSE","#hydrate_pending_content","#hydrate_resolved_content","anchor","#get_anchor","branch","error","#show_pending_snippet","pending","#run","pause_effect","fn","previous_effect","previous_reaction","active_reaction","previous_ctx","component_context","set_active_effect","set_active_reaction","set_component_context","e","handle_error","move_effect","#update_pending_count","d","get","onerror","failed","destroy_effect","set_hydrate_node","next","skip_nodes","did_reset","calling_on_error","reset","invoke_error_boundary","queue_micro_task","get_boundary"],"sources":["../esm/npm/svelte@5.45.5/node_modules/svelte/src/internal/client/dom/blocks/boundary.js","npm-replacement:esm-env"],"sourcesContent":["/** @import { Effect, Source, TemplateNode, } from '#client' */\nimport {\n\tBOUNDARY_EFFECT,\n\tCOMMENT_NODE,\n\tEFFECT_PRESERVED,\n\tEFFECT_TRANSPARENT\n} from '#client/constants';\nimport { HYDRATION_START_ELSE } from '../../../../constants.js';\nimport { component_context, set_component_context } from '../../context.js';\nimport { handle_error, invoke_error_boundary } from '../../error-handling.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\tmove_effect,\n\tpause_effect\n} from '../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tnext,\n\tskip_nodes,\n\tset_hydrate_node\n} from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport * as e from '../../errors.js';\nimport * as w from '../../warnings.js';\nimport { DEV } from 'esm-env';\nimport { Batch } from '../../reactivity/batch.js';\nimport { internal_set, source } from '../../reactivity/sources.js';\nimport { tag } from '../../dev/tracing.js';\nimport { createSubscriber } from '../../../../reactivity/create-subscriber.js';\nimport { create_text } from '../operations.js';\n\n/**\n * @typedef {{\n * \t onerror?: (error: unknown, reset: () =\u003e void) =\u003e void;\n *   failed?: (anchor: Node, error: () =\u003e unknown, reset: () =\u003e () =\u003e void) =\u003e void;\n *   pending?: (anchor: Node) =\u003e void;\n * }} BoundaryProps\n */\n\nvar flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED | BOUNDARY_EFFECT;\n\n/**\n * @param {TemplateNode} node\n * @param {BoundaryProps} props\n * @param {((anchor: Node) =\u003e void)} children\n * @returns {void}\n */\nexport function boundary(node, props, children) {\n\tnew Boundary(node, props, children);\n}\n\nexport class Boundary {\n\t/** @type {Boundary | null} */\n\tparent;\n\n\t#pending = false;\n\n\t/** @type {TemplateNode} */\n\t#anchor;\n\n\t/** @type {TemplateNode | null} */\n\t#hydrate_open = hydrating ? hydrate_node : null;\n\n\t/** @type {BoundaryProps} */\n\t#props;\n\n\t/** @type {((anchor: Node) =\u003e void)} */\n\t#children;\n\n\t/** @type {Effect} */\n\t#effect;\n\n\t/** @type {Effect | null} */\n\t#main_effect = null;\n\n\t/** @type {Effect | null} */\n\t#pending_effect = null;\n\n\t/** @type {Effect | null} */\n\t#failed_effect = null;\n\n\t/** @type {DocumentFragment | null} */\n\t#offscreen_fragment = null;\n\n\t/** @type {TemplateNode | null} */\n\t#pending_anchor = null;\n\n\t#local_pending_count = 0;\n\t#pending_count = 0;\n\n\t#is_creating_fallback = false;\n\n\t/**\n\t * A source containing the number of pending async deriveds/expressions.\n\t * Only created if `$effect.pending()` is used inside the boundary,\n\t * otherwise updating the source results in needless `Batch.ensure()`\n\t * calls followed by no-op flushes\n\t * @type {Source\u003cnumber\u003e | null}\n\t */\n\t#effect_pending = null;\n\n\t#effect_pending_subscriber = createSubscriber(() =\u003e {\n\t\tthis.#effect_pending = source(this.#local_pending_count);\n\n\t\tif (DEV) {\n\t\t\ttag(this.#effect_pending, '$effect.pending()');\n\t\t}\n\n\t\treturn () =\u003e {\n\t\t\tthis.#effect_pending = null;\n\t\t};\n\t});\n\n\t/**\n\t * @param {TemplateNode} node\n\t * @param {BoundaryProps} props\n\t * @param {((anchor: Node) =\u003e void)} children\n\t */\n\tconstructor(node, props, children) {\n\t\tthis.#anchor = node;\n\t\tthis.#props = props;\n\t\tthis.#children = children;\n\n\t\tthis.parent = /** @type {Effect} */ (active_effect).b;\n\n\t\tthis.#pending = !!this.#props.pending;\n\n\t\tthis.#effect = block(() =\u003e {\n\t\t\t/** @type {Effect} */ (active_effect).b = this;\n\n\t\t\tif (hydrating) {\n\t\t\t\tconst comment = this.#hydrate_open;\n\t\t\t\thydrate_next();\n\n\t\t\t\tconst server_rendered_pending =\n\t\t\t\t\t/** @type {Comment} */ (comment).nodeType === COMMENT_NODE \u0026\u0026\n\t\t\t\t\t/** @type {Comment} */ (comment).data === HYDRATION_START_ELSE;\n\n\t\t\t\tif (server_rendered_pending) {\n\t\t\t\t\tthis.#hydrate_pending_content();\n\t\t\t\t} else {\n\t\t\t\t\tthis.#hydrate_resolved_content();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar anchor = this.#get_anchor();\n\n\t\t\t\ttry {\n\t\t\t\t\tthis.#main_effect = branch(() =\u003e children(anchor));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.error(error);\n\t\t\t\t}\n\n\t\t\t\tif (this.#pending_count \u003e 0) {\n\t\t\t\t\tthis.#show_pending_snippet();\n\t\t\t\t} else {\n\t\t\t\t\tthis.#pending = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () =\u003e {\n\t\t\t\tthis.#pending_anchor?.remove();\n\t\t\t};\n\t\t}, flags);\n\n\t\tif (hydrating) {\n\t\t\tthis.#anchor = hydrate_node;\n\t\t}\n\t}\n\n\t#hydrate_resolved_content() {\n\t\ttry {\n\t\t\tthis.#main_effect = branch(() =\u003e this.#children(this.#anchor));\n\t\t} catch (error) {\n\t\t\tthis.error(error);\n\t\t}\n\n\t\t// Since server rendered resolved content, we never show pending state\n\t\t// Even if client-side async operations are still running, the content is already displayed\n\t\tthis.#pending = false;\n\t}\n\n\t#hydrate_pending_content() {\n\t\tconst pending = this.#props.pending;\n\t\tif (!pending) {\n\t\t\treturn;\n\t\t}\n\t\tthis.#pending_effect = branch(() =\u003e pending(this.#anchor));\n\n\t\tBatch.enqueue(() =\u003e {\n\t\t\tvar anchor = this.#get_anchor();\n\n\t\t\tthis.#main_effect = this.#run(() =\u003e {\n\t\t\t\tBatch.ensure();\n\t\t\t\treturn branch(() =\u003e this.#children(anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count \u003e 0) {\n\t\t\t\tthis.#show_pending_snippet();\n\t\t\t} else {\n\t\t\t\tpause_effect(/** @type {Effect} */ (this.#pending_effect), () =\u003e {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\n\t\t\t\tthis.#pending = false;\n\t\t\t}\n\t\t});\n\t}\n\n\t#get_anchor() {\n\t\tvar anchor = this.#anchor;\n\n\t\tif (this.#pending) {\n\t\t\tthis.#pending_anchor = create_text();\n\t\t\tthis.#anchor.before(this.#pending_anchor);\n\n\t\t\tanchor = this.#pending_anchor;\n\t\t}\n\n\t\treturn anchor;\n\t}\n\n\t/**\n\t * Returns `true` if the effect exists inside a boundary whose pending snippet is shown\n\t * @returns {boolean}\n\t */\n\tis_pending() {\n\t\treturn this.#pending || (!!this.parent \u0026\u0026 this.parent.is_pending());\n\t}\n\n\thas_pending_snippet() {\n\t\treturn !!this.#props.pending;\n\t}\n\n\t/**\n\t * @param {() =\u003e Effect | null} fn\n\t */\n\t#run(fn) {\n\t\tvar previous_effect = active_effect;\n\t\tvar previous_reaction = active_reaction;\n\t\tvar previous_ctx = component_context;\n\n\t\tset_active_effect(this.#effect);\n\t\tset_active_reaction(this.#effect);\n\t\tset_component_context(this.#effect.ctx);\n\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (e) {\n\t\t\thandle_error(e);\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tset_active_effect(previous_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t\tset_component_context(previous_ctx);\n\t\t}\n\t}\n\n\t#show_pending_snippet() {\n\t\tconst pending = /** @type {(anchor: Node) =\u003e void} */ (this.#props.pending);\n\n\t\tif (this.#main_effect !== null) {\n\t\t\tthis.#offscreen_fragment = document.createDocumentFragment();\n\t\t\tthis.#offscreen_fragment.append(/** @type {TemplateNode} */ (this.#pending_anchor));\n\t\t\tmove_effect(this.#main_effect, this.#offscreen_fragment);\n\t\t}\n\n\t\tif (this.#pending_effect === null) {\n\t\t\tthis.#pending_effect = branch(() =\u003e pending(this.#anchor));\n\t\t}\n\t}\n\n\t/**\n\t * Updates the pending count associated with the currently visible pending snippet,\n\t * if any, such that we can replace the snippet with content once work is done\n\t * @param {1 | -1} d\n\t */\n\t#update_pending_count(d) {\n\t\tif (!this.has_pending_snippet()) {\n\t\t\tif (this.parent) {\n\t\t\t\tthis.parent.#update_pending_count(d);\n\t\t\t}\n\n\t\t\t// if there's no parent, we're in a scope with no pending snippet\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#pending_count += d;\n\n\t\tif (this.#pending_count === 0) {\n\t\t\tthis.#pending = false;\n\n\t\t\tif (this.#pending_effect) {\n\t\t\t\tpause_effect(this.#pending_effect, () =\u003e {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.#offscreen_fragment) {\n\t\t\t\tthis.#anchor.before(this.#offscreen_fragment);\n\t\t\t\tthis.#offscreen_fragment = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Update the source that powers `$effect.pending()` inside this boundary,\n\t * and controls when the current `pending` snippet (if any) is removed.\n\t * Do not call from inside the class\n\t * @param {1 | -1} d\n\t */\n\tupdate_pending_count(d) {\n\t\tthis.#update_pending_count(d);\n\n\t\tthis.#local_pending_count += d;\n\n\t\tif (this.#effect_pending) {\n\t\t\tinternal_set(this.#effect_pending, this.#local_pending_count);\n\t\t}\n\t}\n\n\tget_effect_pending() {\n\t\tthis.#effect_pending_subscriber();\n\t\treturn get(/** @type {Source\u003cnumber\u003e} */ (this.#effect_pending));\n\t}\n\n\t/** @param {unknown} error */\n\terror(error) {\n\t\tvar onerror = this.#props.onerror;\n\t\tlet failed = this.#props.failed;\n\n\t\t// If we have nothing to capture the error, or if we hit an error while\n\t\t// rendering the fallback, re-throw for another boundary to handle\n\t\tif (this.#is_creating_fallback || (!onerror \u0026\u0026 !failed)) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this.#main_effect) {\n\t\t\tdestroy_effect(this.#main_effect);\n\t\t\tthis.#main_effect = null;\n\t\t}\n\n\t\tif (this.#pending_effect) {\n\t\t\tdestroy_effect(this.#pending_effect);\n\t\t\tthis.#pending_effect = null;\n\t\t}\n\n\t\tif (this.#failed_effect) {\n\t\t\tdestroy_effect(this.#failed_effect);\n\t\t\tthis.#failed_effect = null;\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tset_hydrate_node(/** @type {TemplateNode} */ (this.#hydrate_open));\n\t\t\tnext();\n\t\t\tset_hydrate_node(skip_nodes());\n\t\t}\n\n\t\tvar did_reset = false;\n\t\tvar calling_on_error = false;\n\n\t\tconst reset = () =\u003e {\n\t\t\tif (did_reset) {\n\t\t\t\tw.svelte_boundary_reset_noop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdid_reset = true;\n\n\t\t\tif (calling_on_error) {\n\t\t\t\te.svelte_boundary_reset_onerror();\n\t\t\t}\n\n\t\t\t// If the failure happened while flushing effects, current_batch can be null\n\t\t\tBatch.ensure();\n\n\t\t\tthis.#local_pending_count = 0;\n\n\t\t\tif (this.#failed_effect !== null) {\n\t\t\t\tpause_effect(this.#failed_effect, () =\u003e {\n\t\t\t\t\tthis.#failed_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// we intentionally do not try to find the nearest pending boundary. If this boundary has one, we'll render it on reset\n\t\t\t// but it would be really weird to show the parent's boundary on a child reset.\n\t\t\tthis.#pending = this.has_pending_snippet();\n\n\t\t\tthis.#main_effect = this.#run(() =\u003e {\n\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\treturn branch(() =\u003e this.#children(this.#anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count \u003e 0) {\n\t\t\t\tthis.#show_pending_snippet();\n\t\t\t} else {\n\t\t\t\tthis.#pending = false;\n\t\t\t}\n\t\t};\n\n\t\tvar previous_reaction = active_reaction;\n\n\t\ttry {\n\t\t\tset_active_reaction(null);\n\t\t\tcalling_on_error = true;\n\t\t\tonerror?.(error, reset);\n\t\t\tcalling_on_error = false;\n\t\t} catch (error) {\n\t\t\tinvoke_error_boundary(error, this.#effect \u0026\u0026 this.#effect.parent);\n\t\t} finally {\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\n\t\tif (failed) {\n\t\t\tqueue_micro_task(() =\u003e {\n\t\t\t\tthis.#failed_effect = this.#run(() =\u003e {\n\t\t\t\t\tBatch.ensure();\n\t\t\t\t\tthis.#is_creating_fallback = true;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn branch(() =\u003e {\n\t\t\t\t\t\t\tfailed(\n\t\t\t\t\t\t\t\tthis.#anchor,\n\t\t\t\t\t\t\t\t() =\u003e error,\n\t\t\t\t\t\t\t\t() =\u003e reset\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tinvoke_error_boundary(error, /** @type {Effect} */ (this.#effect.parent));\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport function get_boundary() {\n\treturn /** @type {Boundary} */ (/** @type {Effect} */ (active_effect).b);\n}\n\nexport function pending() {\n\tif (active_effect === null) {\n\t\te.effect_pending_outside_reaction();\n\t}\n\n\tvar boundary = active_effect.b;\n\n\tif (boundary === null) {\n\t\treturn 0; // TODO eventually we will need this to be global\n\t}\n\n\treturn boundary.get_effect_pending();\n}\n","const e=typeof window\u003c\"u\"\u0026\u0026typeof Deno\u003e\"u\",o=!1,n=!1;export{e as BROWSER,o as DEV,n as NODE};\n"],"version":3}
