@iterms/tinyflow-ai-vue 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/@vue+shared@3.5.18/node_modules/@vue/shared/dist/shared.esm-bundler.js","../../../node_modules/.pnpm/@vue+reactivity@3.5.18/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js","../../../node_modules/.pnpm/@vue+runtime-core@3.5.18/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/version.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/disclose-version.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/flags/index.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/flags/legacy.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/constants.js","../../../node_modules/.pnpm/esm-env@1.2.2/node_modules/esm-env/false.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/shared/utils.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/constants.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/shared/errors.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/errors.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/warnings.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/hydration.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/reactivity/equality.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/context.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/error-handling.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/task.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/blocks/boundary.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/reactivity/deriveds.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/reactivity/async.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/reactivity/batch.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/reactivity/sources.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/proxy.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/operations.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/reactivity/effects.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/runtime.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/misc.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/events.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/reconciler.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/template.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/utils.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/render.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/blocks/snippet.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/index-client.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/blocks/if.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/blocks/each.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/blocks/html.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/blocks/slot.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/blocks/svelte-component.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/blocks/svelte-element.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/css.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/actions.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/attachments.js","../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/shared/attributes.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/class.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/style.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/bindings/select.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/attributes.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/legacy/misc.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/store/utils.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/store/shared/index.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/reactivity/store.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/reactivity/props.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/legacy/legacy-client.js","../../../node_modules/.pnpm/svelte@5.36.13/node_modules/svelte/src/internal/client/dom/elements/custom-element.js","../../../node_modules/.pnpm/classcat@5.0.5/node_modules/classcat/index.js","../../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/sourceEvent.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/pointer.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/noevent.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/nodrag.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/constant.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/event.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/drag.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/zoom.js","../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js","../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js","../../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js","../../../node_modules/.pnpm/@xyflow+system@0.0.59/node_modules/@xyflow/system/dist/esm/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/Handle/Handle.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/nodes/DefaultNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/nodes/InputNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/nodes/OutputNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/nodes/GroupNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/actions/portal/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/EdgeLabelRenderer/EdgeLabelRenderer.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/hooks/useHandleEdgeSelect.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/EdgeLabel/EdgeLabel.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/BaseEdge/BaseEdge.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/edges/BezierEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/edges/SmoothStepEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/edges/StraightEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/edges/StepEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/store/utils.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/store/initial-store.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/store/visible-edges.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/store/visible-nodes.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/store/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/actions/zoom/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/Zoom/Zoom.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/Pane/Pane.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/Viewport/Viewport.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/actions/drag/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/NodeWrapper/utils.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/NodeWrapper/NodeWrapper.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/NodeRenderer/NodeRenderer.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/EdgeWrapper/EdgeWrapper.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/CallOnMount/CallOnMount.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/MarkerDefinition/MarkerDefinition.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/MarkerDefinition/Marker.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/EdgeRenderer.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/Selection/Selection.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/UserSelection/UserSelection.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/NodeSelection/NodeSelection.svelte","../../../node_modules/.pnpm/@svelte-put+shortcut@3.1.1_svelte@5.36.13/node_modules/@svelte-put/shortcut/src/shortcut.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/KeyHandler/KeyHandler.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/ConnectionLine/ConnectionLine.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/Panel/Panel.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/Attribution/Attribution.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/SvelteFlow/utils.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/hooks/useColorModeClass.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/container/SvelteFlow/SvelteFlow.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/components/SvelteFlowProvider/SvelteFlowProvider.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Controls/ControlButton.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Controls/Controls.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Background/types.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Background/DotPattern.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Background/LinePattern.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Background/Background.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/MinimapNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/interactive.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/Minimap.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/utils/index.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/hooks/useSvelteFlow.js","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/plugins/NodeToolbar/NodeToolbar.svelte","../../../node_modules/.pnpm/@xyflow+svelte@0.1.39_svelte@5.36.13/node_modules/@xyflow/svelte/dist/lib/hooks/useNodesData.js","../src/consts.ts","../src/Tinyflow.ts","../src/store/stores.ts","../src/components/base/button.svelte","../src/components/base/checkbox.svelte","../src/components/base/chosen.svelte","../src/components/base/input.svelte","../src/components/base/textarea.svelte","../src/components/base/tabs.svelte","../src/components/base/collapse.svelte","../src/components/base/render.svelte","../src/components/base/select.svelte","../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/.pnpm/@floating-ui+core@1.7.2/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/.pnpm/@floating-ui+dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../src/components/utils/createFloating.ts","../src/components/base/floating-trigger.svelte","../src/components/base/heading.svelte","../src/components/base/menu-button.svelte","../src/components/utils/useDeleteNode.ts","../src/components/utils/IdGen.ts","../src/components/utils/useCopyNode.ts","../src/components/utils/NodeUtils.ts","../src/store/nodeContext.ts","../src/components/core/NodeWrapper.svelte","../src/components/utils/Consts.ts","../src/components/core/DefinedParameterItem.svelte","../src/components/core/DefinedParameterList.svelte","../src/components/utils/useAddParameter.ts","../src/components/nodes/StartNode.svelte","../src/components/utils/useRefOptions.ts","../src/components/core/RefParameterItem.svelte","../src/components/core/RefParameterList.svelte","../src/components/nodes/EndNode.svelte","../src/components/utils/deepClone.ts","../src/components/core/OutputDefItem.svelte","../src/components/core/OutputDefList.svelte","../src/components/nodes/LLMNode.svelte","../src/components/nodes/CodeNode.svelte","../src/components/nodes/TemplateNode.svelte","../src/components/nodes/HttpNode.svelte","../src/components/nodes/KnowledgeNode.svelte","../src/components/nodes/SearchEngineNode.svelte","../src/components/nodes/LoopNode.svelte","../src/components/nodes/index.ts","../src/components/core/DraggableButton.svelte","../src/components/Toolbar.svelte","../src/components/utils/useGetNode.ts","../src/components/utils/useEnsureParentInNodesBefore.ts","../src/components/utils/useGetEdgesByTarget.ts","../src/components/nodes/CustomNode.svelte","../src/components/utils/useUpdateEdgeData.ts","../src/components/utils/useDeleteEdge.ts","../src/components/TinyflowCore.svelte","../src/components/TinyflowComponent.svelte","../src/Tinyflow.vue"],"sourcesContent":["/**\n* @vue/shared v3.5.18\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction makeMap(str) {\n const map = /* @__PURE__ */ Object.create(null);\n for (const key of str.split(\",\")) map[key] = 1;\n return (val) => val in map;\n}\n\nconst EMPTY_OBJ = !!(process.env.NODE_ENV !== \"production\") ? Object.freeze({}) : {};\nconst EMPTY_ARR = !!(process.env.NODE_ENV !== \"production\") ? Object.freeze([]) : [];\nconst NOOP = () => {\n};\nconst NO = () => false;\nconst isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter\n(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);\nconst isModelListener = (key) => key.startsWith(\"onUpdate:\");\nconst extend = Object.assign;\nconst remove = (arr, el) => {\n const i = arr.indexOf(el);\n if (i > -1) {\n arr.splice(i, 1);\n }\n};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst isArray = Array.isArray;\nconst isMap = (val) => toTypeString(val) === \"[object Map]\";\nconst isSet = (val) => toTypeString(val) === \"[object Set]\";\nconst isDate = (val) => toTypeString(val) === \"[object Date]\";\nconst isRegExp = (val) => toTypeString(val) === \"[object RegExp]\";\nconst isFunction = (val) => typeof val === \"function\";\nconst isString = (val) => typeof val === \"string\";\nconst isSymbol = (val) => typeof val === \"symbol\";\nconst isObject = (val) => val !== null && typeof val === \"object\";\nconst isPromise = (val) => {\n return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n};\nconst isPlainObject = (val) => toTypeString(val) === \"[object Object]\";\nconst isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\nconst isReservedProp = /* @__PURE__ */ makeMap(\n // the leading comma is intentional so empty string \"\" is also included\n \",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted\"\n);\nconst isBuiltInDirective = /* @__PURE__ */ makeMap(\n \"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo\"\n);\nconst cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n};\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction(\n (str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n }\n);\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction(\n (str) => str.replace(hyphenateRE, \"-$1\").toLowerCase()\n);\nconst capitalize = cacheStringFunction((str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n});\nconst toHandlerKey = cacheStringFunction(\n (str) => {\n const s = str ? `on${capitalize(str)}` : ``;\n return s;\n }\n);\nconst hasChanged = (value, oldValue) => !Object.is(value, oldValue);\nconst invokeArrayFns = (fns, ...arg) => {\n for (let i = 0; i < fns.length; i++) {\n fns[i](...arg);\n }\n};\nconst def = (obj, key, value, writable = false) => {\n Object.defineProperty(obj, key, {\n configurable: true,\n enumerable: false,\n writable,\n value\n });\n};\nconst looseToNumber = (val) => {\n const n = parseFloat(val);\n return isNaN(n) ? val : n;\n};\nconst toNumber = (val) => {\n const n = isString(val) ? Number(val) : NaN;\n return isNaN(n) ? val : n;\n};\nlet _globalThis;\nconst getGlobalThis = () => {\n return _globalThis || (_globalThis = typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : {});\n};\nconst identRE = /^[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/;\nfunction genPropsAccessExp(name) {\n return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;\n}\nfunction genCacheKey(source, options) {\n return source + JSON.stringify(\n options,\n (_, val) => typeof val === \"function\" ? val.toString() : val\n );\n}\n\nconst PatchFlags = {\n \"TEXT\": 1,\n \"1\": \"TEXT\",\n \"CLASS\": 2,\n \"2\": \"CLASS\",\n \"STYLE\": 4,\n \"4\": \"STYLE\",\n \"PROPS\": 8,\n \"8\": \"PROPS\",\n \"FULL_PROPS\": 16,\n \"16\": \"FULL_PROPS\",\n \"NEED_HYDRATION\": 32,\n \"32\": \"NEED_HYDRATION\",\n \"STABLE_FRAGMENT\": 64,\n \"64\": \"STABLE_FRAGMENT\",\n \"KEYED_FRAGMENT\": 128,\n \"128\": \"KEYED_FRAGMENT\",\n \"UNKEYED_FRAGMENT\": 256,\n \"256\": \"UNKEYED_FRAGMENT\",\n \"NEED_PATCH\": 512,\n \"512\": \"NEED_PATCH\",\n \"DYNAMIC_SLOTS\": 1024,\n \"1024\": \"DYNAMIC_SLOTS\",\n \"DEV_ROOT_FRAGMENT\": 2048,\n \"2048\": \"DEV_ROOT_FRAGMENT\",\n \"CACHED\": -1,\n \"-1\": \"CACHED\",\n \"BAIL\": -2,\n \"-2\": \"BAIL\"\n};\nconst PatchFlagNames = {\n [1]: `TEXT`,\n [2]: `CLASS`,\n [4]: `STYLE`,\n [8]: `PROPS`,\n [16]: `FULL_PROPS`,\n [32]: `NEED_HYDRATION`,\n [64]: `STABLE_FRAGMENT`,\n [128]: `KEYED_FRAGMENT`,\n [256]: `UNKEYED_FRAGMENT`,\n [512]: `NEED_PATCH`,\n [1024]: `DYNAMIC_SLOTS`,\n [2048]: `DEV_ROOT_FRAGMENT`,\n [-1]: `CACHED`,\n [-2]: `BAIL`\n};\n\nconst ShapeFlags = {\n \"ELEMENT\": 1,\n \"1\": \"ELEMENT\",\n \"FUNCTIONAL_COMPONENT\": 2,\n \"2\": \"FUNCTIONAL_COMPONENT\",\n \"STATEFUL_COMPONENT\": 4,\n \"4\": \"STATEFUL_COMPONENT\",\n \"TEXT_CHILDREN\": 8,\n \"8\": \"TEXT_CHILDREN\",\n \"ARRAY_CHILDREN\": 16,\n \"16\": \"ARRAY_CHILDREN\",\n \"SLOTS_CHILDREN\": 32,\n \"32\": \"SLOTS_CHILDREN\",\n \"TELEPORT\": 64,\n \"64\": \"TELEPORT\",\n \"SUSPENSE\": 128,\n \"128\": \"SUSPENSE\",\n \"COMPONENT_SHOULD_KEEP_ALIVE\": 256,\n \"256\": \"COMPONENT_SHOULD_KEEP_ALIVE\",\n \"COMPONENT_KEPT_ALIVE\": 512,\n \"512\": \"COMPONENT_KEPT_ALIVE\",\n \"COMPONENT\": 6,\n \"6\": \"COMPONENT\"\n};\n\nconst SlotFlags = {\n \"STABLE\": 1,\n \"1\": \"STABLE\",\n \"DYNAMIC\": 2,\n \"2\": \"DYNAMIC\",\n \"FORWARDED\": 3,\n \"3\": \"FORWARDED\"\n};\nconst slotFlagsText = {\n [1]: \"STABLE\",\n [2]: \"DYNAMIC\",\n [3]: \"FORWARDED\"\n};\n\nconst GLOBALS_ALLOWED = \"Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol\";\nconst isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);\nconst isGloballyWhitelisted = isGloballyAllowed;\n\nconst range = 2;\nfunction generateCodeFrame(source, start = 0, end = source.length) {\n start = Math.max(0, Math.min(start, source.length));\n end = Math.max(0, Math.min(end, source.length));\n if (start > end) return \"\";\n let lines = source.split(/(\\r?\\n)/);\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n lines = lines.filter((_, idx) => idx % 2 === 0);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);\n if (count >= start) {\n for (let j = i - range; j <= i + range || end > count; j++) {\n if (j < 0 || j >= lines.length) continue;\n const line = j + 1;\n res.push(\n `${line}${\" \".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`\n );\n const lineLength = lines[j].length;\n const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;\n if (j === i) {\n const pad = start - (count - (lineLength + newLineSeqLength));\n const length = Math.max(\n 1,\n end > count ? lineLength - pad : end - start\n );\n res.push(` | ` + \" \".repeat(pad) + \"^\".repeat(length));\n } else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + \"^\".repeat(length));\n }\n count += lineLength + newLineSeqLength;\n }\n }\n break;\n }\n }\n return res.join(\"\\n\");\n}\n\nfunction normalizeStyle(value) {\n if (isArray(value)) {\n const res = {};\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);\n if (normalized) {\n for (const key in normalized) {\n res[key] = normalized[key];\n }\n }\n }\n return res;\n } else if (isString(value) || isObject(value)) {\n return value;\n }\n}\nconst listDelimiterRE = /;(?![^(]*\\))/g;\nconst propertyDelimiterRE = /:([^]+)/;\nconst styleCommentRE = /\\/\\*[^]*?\\*\\//g;\nfunction parseStringStyle(cssText) {\n const ret = {};\n cssText.replace(styleCommentRE, \"\").split(listDelimiterRE).forEach((item) => {\n if (item) {\n const tmp = item.split(propertyDelimiterRE);\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n }\n });\n return ret;\n}\nfunction stringifyStyle(styles) {\n if (!styles) return \"\";\n if (isString(styles)) return styles;\n let ret = \"\";\n for (const key in styles) {\n const value = styles[key];\n if (isString(value) || typeof value === \"number\") {\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\n ret += `${normalizedKey}:${value};`;\n }\n }\n return ret;\n}\nfunction normalizeClass(value) {\n let res = \"\";\n if (isString(value)) {\n res = value;\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const normalized = normalizeClass(value[i]);\n if (normalized) {\n res += normalized + \" \";\n }\n }\n } else if (isObject(value)) {\n for (const name in value) {\n if (value[name]) {\n res += name + \" \";\n }\n }\n }\n return res.trim();\n}\nfunction normalizeProps(props) {\n if (!props) return null;\n let { class: klass, style } = props;\n if (klass && !isString(klass)) {\n props.class = normalizeClass(klass);\n }\n if (style) {\n props.style = normalizeStyle(style);\n }\n return props;\n}\n\nconst HTML_TAGS = \"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot\";\nconst SVG_TAGS = \"svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view\";\nconst MATH_TAGS = \"annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics\";\nconst VOID_TAGS = \"area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr\";\nconst isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);\nconst isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);\nconst isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);\nconst isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);\n\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\nconst isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);\nconst isBooleanAttr = /* @__PURE__ */ makeMap(\n specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`\n);\nfunction includeBooleanAttr(value) {\n return !!value || value === \"\";\n}\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\nconst attrValidationCache = {};\nfunction isSSRSafeAttrName(name) {\n if (attrValidationCache.hasOwnProperty(name)) {\n return attrValidationCache[name];\n }\n const isUnsafe = unsafeAttrCharRE.test(name);\n if (isUnsafe) {\n console.error(`unsafe attribute name: ${name}`);\n }\n return attrValidationCache[name] = !isUnsafe;\n}\nconst propsToAttrMap = {\n acceptCharset: \"accept-charset\",\n className: \"class\",\n htmlFor: \"for\",\n httpEquiv: \"http-equiv\"\n};\nconst isKnownHtmlAttr = /* @__PURE__ */ makeMap(\n `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`\n);\nconst isKnownSvgAttr = /* @__PURE__ */ makeMap(\n `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`\n);\nconst isKnownMathMLAttr = /* @__PURE__ */ makeMap(\n `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`\n);\nfunction isRenderableAttrValue(value) {\n if (value == null) {\n return false;\n }\n const type = typeof value;\n return type === \"string\" || type === \"number\" || type === \"boolean\";\n}\n\nconst escapeRE = /[\"'&<>]/;\nfunction escapeHtml(string) {\n const str = \"\" + string;\n const match = escapeRE.exec(str);\n if (!match) {\n return str;\n }\n let html = \"\";\n let escaped;\n let index;\n let lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n escaped = \"&quot;\";\n break;\n case 38:\n escaped = \"&amp;\";\n break;\n case 39:\n escaped = \"&#39;\";\n break;\n case 60:\n escaped = \"&lt;\";\n break;\n case 62:\n escaped = \"&gt;\";\n break;\n default:\n continue;\n }\n if (lastIndex !== index) {\n html += str.slice(lastIndex, index);\n }\n lastIndex = index + 1;\n html += escaped;\n }\n return lastIndex !== index ? html + str.slice(lastIndex, index) : html;\n}\nconst commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;\nfunction escapeHtmlComment(src) {\n return src.replace(commentStripRE, \"\");\n}\nconst cssVarNameEscapeSymbolsRE = /[ !\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~]/g;\nfunction getEscapedCssVarName(key, doubleEscape) {\n return key.replace(\n cssVarNameEscapeSymbolsRE,\n (s) => doubleEscape ? s === '\"' ? '\\\\\\\\\\\\\"' : `\\\\\\\\${s}` : `\\\\${s}`\n );\n}\n\nfunction looseCompareArrays(a, b) {\n if (a.length !== b.length) return false;\n let equal = true;\n for (let i = 0; equal && i < a.length; i++) {\n equal = looseEqual(a[i], b[i]);\n }\n return equal;\n}\nfunction looseEqual(a, b) {\n if (a === b) return true;\n let aValidType = isDate(a);\n let bValidType = isDate(b);\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.getTime() === b.getTime() : false;\n }\n aValidType = isSymbol(a);\n bValidType = isSymbol(b);\n if (aValidType || bValidType) {\n return a === b;\n }\n aValidType = isArray(a);\n bValidType = isArray(b);\n if (aValidType || bValidType) {\n return aValidType && bValidType ? looseCompareArrays(a, b) : false;\n }\n aValidType = isObject(a);\n bValidType = isObject(b);\n if (aValidType || bValidType) {\n if (!aValidType || !bValidType) {\n return false;\n }\n const aKeysCount = Object.keys(a).length;\n const bKeysCount = Object.keys(b).length;\n if (aKeysCount !== bKeysCount) {\n return false;\n }\n for (const key in a) {\n const aHasKey = a.hasOwnProperty(key);\n const bHasKey = b.hasOwnProperty(key);\n if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n return String(a) === String(b);\n}\nfunction looseIndexOf(arr, val) {\n return arr.findIndex((item) => looseEqual(item, val));\n}\n\nconst isRef = (val) => {\n return !!(val && val[\"__v_isRef\"] === true);\n};\nconst toDisplayString = (val) => {\n return isString(val) ? val : val == null ? \"\" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);\n};\nconst replacer = (_key, val) => {\n if (isRef(val)) {\n return replacer(_key, val.value);\n } else if (isMap(val)) {\n return {\n [`Map(${val.size})`]: [...val.entries()].reduce(\n (entries, [key, val2], i) => {\n entries[stringifySymbol(key, i) + \" =>\"] = val2;\n return entries;\n },\n {}\n )\n };\n } else if (isSet(val)) {\n return {\n [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))\n };\n } else if (isSymbol(val)) {\n return stringifySymbol(val);\n } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n return String(val);\n }\n return val;\n};\nconst stringifySymbol = (v, i = \"\") => {\n var _a;\n return (\n // Symbol.description in es2019+ so we need to cast here to pass\n // the lib: es2016 check\n isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v\n );\n};\n\nfunction normalizeCssVarValue(value) {\n if (value == null) {\n return \"initial\";\n }\n if (typeof value === \"string\") {\n return value === \"\" ? \" \" : value;\n }\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n console.warn(\n \"[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:\",\n value\n );\n }\n }\n return String(value);\n}\n\nexport { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeCssVarValue, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };\n","/**\n* @vue/reactivity v3.5.18\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\nimport { extend, hasChanged, isArray, isIntegerKey, isSymbol, isMap, hasOwn, makeMap, isObject, capitalize, toRawType, def, isFunction, EMPTY_OBJ, isSet, isPlainObject, remove, NOOP } from '@vue/shared';\n\nfunction warn(msg, ...args) {\n console.warn(`[Vue warn] ${msg}`, ...args);\n}\n\nlet activeEffectScope;\nclass EffectScope {\n constructor(detached = false) {\n this.detached = detached;\n /**\n * @internal\n */\n this._active = true;\n /**\n * @internal track `on` calls, allow `on` call multiple times\n */\n this._on = 0;\n /**\n * @internal\n */\n this.effects = [];\n /**\n * @internal\n */\n this.cleanups = [];\n this._isPaused = false;\n this.parent = activeEffectScope;\n if (!detached && activeEffectScope) {\n this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(\n this\n ) - 1;\n }\n }\n get active() {\n return this._active;\n }\n pause() {\n if (this._active) {\n this._isPaused = true;\n let i, l;\n if (this.scopes) {\n for (i = 0, l = this.scopes.length; i < l; i++) {\n this.scopes[i].pause();\n }\n }\n for (i = 0, l = this.effects.length; i < l; i++) {\n this.effects[i].pause();\n }\n }\n }\n /**\n * Resumes the effect scope, including all child scopes and effects.\n */\n resume() {\n if (this._active) {\n if (this._isPaused) {\n this._isPaused = false;\n let i, l;\n if (this.scopes) {\n for (i = 0, l = this.scopes.length; i < l; i++) {\n this.scopes[i].resume();\n }\n }\n for (i = 0, l = this.effects.length; i < l; i++) {\n this.effects[i].resume();\n }\n }\n }\n }\n run(fn) {\n if (this._active) {\n const currentEffectScope = activeEffectScope;\n try {\n activeEffectScope = this;\n return fn();\n } finally {\n activeEffectScope = currentEffectScope;\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(`cannot run an inactive effect scope.`);\n }\n }\n /**\n * This should only be called on non-detached scopes\n * @internal\n */\n on() {\n if (++this._on === 1) {\n this.prevScope = activeEffectScope;\n activeEffectScope = this;\n }\n }\n /**\n * This should only be called on non-detached scopes\n * @internal\n */\n off() {\n if (this._on > 0 && --this._on === 0) {\n activeEffectScope = this.prevScope;\n this.prevScope = void 0;\n }\n }\n stop(fromParent) {\n if (this._active) {\n this._active = false;\n let i, l;\n for (i = 0, l = this.effects.length; i < l; i++) {\n this.effects[i].stop();\n }\n this.effects.length = 0;\n for (i = 0, l = this.cleanups.length; i < l; i++) {\n this.cleanups[i]();\n }\n this.cleanups.length = 0;\n if (this.scopes) {\n for (i = 0, l = this.scopes.length; i < l; i++) {\n this.scopes[i].stop(true);\n }\n this.scopes.length = 0;\n }\n if (!this.detached && this.parent && !fromParent) {\n const last = this.parent.scopes.pop();\n if (last && last !== this) {\n this.parent.scopes[this.index] = last;\n last.index = this.index;\n }\n }\n this.parent = void 0;\n }\n }\n}\nfunction effectScope(detached) {\n return new EffectScope(detached);\n}\nfunction getCurrentScope() {\n return activeEffectScope;\n}\nfunction onScopeDispose(fn, failSilently = false) {\n if (activeEffectScope) {\n activeEffectScope.cleanups.push(fn);\n } else if (!!(process.env.NODE_ENV !== \"production\") && !failSilently) {\n warn(\n `onScopeDispose() is called when there is no active effect scope to be associated with.`\n );\n }\n}\n\nlet activeSub;\nconst EffectFlags = {\n \"ACTIVE\": 1,\n \"1\": \"ACTIVE\",\n \"RUNNING\": 2,\n \"2\": \"RUNNING\",\n \"TRACKING\": 4,\n \"4\": \"TRACKING\",\n \"NOTIFIED\": 8,\n \"8\": \"NOTIFIED\",\n \"DIRTY\": 16,\n \"16\": \"DIRTY\",\n \"ALLOW_RECURSE\": 32,\n \"32\": \"ALLOW_RECURSE\",\n \"PAUSED\": 64,\n \"64\": \"PAUSED\",\n \"EVALUATED\": 128,\n \"128\": \"EVALUATED\"\n};\nconst pausedQueueEffects = /* @__PURE__ */ new WeakSet();\nclass ReactiveEffect {\n constructor(fn) {\n this.fn = fn;\n /**\n * @internal\n */\n this.deps = void 0;\n /**\n * @internal\n */\n this.depsTail = void 0;\n /**\n * @internal\n */\n this.flags = 1 | 4;\n /**\n * @internal\n */\n this.next = void 0;\n /**\n * @internal\n */\n this.cleanup = void 0;\n this.scheduler = void 0;\n if (activeEffectScope && activeEffectScope.active) {\n activeEffectScope.effects.push(this);\n }\n }\n pause() {\n this.flags |= 64;\n }\n resume() {\n if (this.flags & 64) {\n this.flags &= -65;\n if (pausedQueueEffects.has(this)) {\n pausedQueueEffects.delete(this);\n this.trigger();\n }\n }\n }\n /**\n * @internal\n */\n notify() {\n if (this.flags & 2 && !(this.flags & 32)) {\n return;\n }\n if (!(this.flags & 8)) {\n batch(this);\n }\n }\n run() {\n if (!(this.flags & 1)) {\n return this.fn();\n }\n this.flags |= 2;\n cleanupEffect(this);\n prepareDeps(this);\n const prevEffect = activeSub;\n const prevShouldTrack = shouldTrack;\n activeSub = this;\n shouldTrack = true;\n try {\n return this.fn();\n } finally {\n if (!!(process.env.NODE_ENV !== \"production\") && activeSub !== this) {\n warn(\n \"Active effect was not restored correctly - this is likely a Vue internal bug.\"\n );\n }\n cleanupDeps(this);\n activeSub = prevEffect;\n shouldTrack = prevShouldTrack;\n this.flags &= -3;\n }\n }\n stop() {\n if (this.flags & 1) {\n for (let link = this.deps; link; link = link.nextDep) {\n removeSub(link);\n }\n this.deps = this.depsTail = void 0;\n cleanupEffect(this);\n this.onStop && this.onStop();\n this.flags &= -2;\n }\n }\n trigger() {\n if (this.flags & 64) {\n pausedQueueEffects.add(this);\n } else if (this.scheduler) {\n this.scheduler();\n } else {\n this.runIfDirty();\n }\n }\n /**\n * @internal\n */\n runIfDirty() {\n if (isDirty(this)) {\n this.run();\n }\n }\n get dirty() {\n return isDirty(this);\n }\n}\nlet batchDepth = 0;\nlet batchedSub;\nlet batchedComputed;\nfunction batch(sub, isComputed = false) {\n sub.flags |= 8;\n if (isComputed) {\n sub.next = batchedComputed;\n batchedComputed = sub;\n return;\n }\n sub.next = batchedSub;\n batchedSub = sub;\n}\nfunction startBatch() {\n batchDepth++;\n}\nfunction endBatch() {\n if (--batchDepth > 0) {\n return;\n }\n if (batchedComputed) {\n let e = batchedComputed;\n batchedComputed = void 0;\n while (e) {\n const next = e.next;\n e.next = void 0;\n e.flags &= -9;\n e = next;\n }\n }\n let error;\n while (batchedSub) {\n let e = batchedSub;\n batchedSub = void 0;\n while (e) {\n const next = e.next;\n e.next = void 0;\n e.flags &= -9;\n if (e.flags & 1) {\n try {\n ;\n e.trigger();\n } catch (err) {\n if (!error) error = err;\n }\n }\n e = next;\n }\n }\n if (error) throw error;\n}\nfunction prepareDeps(sub) {\n for (let link = sub.deps; link; link = link.nextDep) {\n link.version = -1;\n link.prevActiveLink = link.dep.activeLink;\n link.dep.activeLink = link;\n }\n}\nfunction cleanupDeps(sub) {\n let head;\n let tail = sub.depsTail;\n let link = tail;\n while (link) {\n const prev = link.prevDep;\n if (link.version === -1) {\n if (link === tail) tail = prev;\n removeSub(link);\n removeDep(link);\n } else {\n head = link;\n }\n link.dep.activeLink = link.prevActiveLink;\n link.prevActiveLink = void 0;\n link = prev;\n }\n sub.deps = head;\n sub.depsTail = tail;\n}\nfunction isDirty(sub) {\n for (let link = sub.deps; link; link = link.nextDep) {\n if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {\n return true;\n }\n }\n if (sub._dirty) {\n return true;\n }\n return false;\n}\nfunction refreshComputed(computed) {\n if (computed.flags & 4 && !(computed.flags & 16)) {\n return;\n }\n computed.flags &= -17;\n if (computed.globalVersion === globalVersion) {\n return;\n }\n computed.globalVersion = globalVersion;\n if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {\n return;\n }\n computed.flags |= 2;\n const dep = computed.dep;\n const prevSub = activeSub;\n const prevShouldTrack = shouldTrack;\n activeSub = computed;\n shouldTrack = true;\n try {\n prepareDeps(computed);\n const value = computed.fn(computed._value);\n if (dep.version === 0 || hasChanged(value, computed._value)) {\n computed.flags |= 128;\n computed._value = value;\n dep.version++;\n }\n } catch (err) {\n dep.version++;\n throw err;\n } finally {\n activeSub = prevSub;\n shouldTrack = prevShouldTrack;\n cleanupDeps(computed);\n computed.flags &= -3;\n }\n}\nfunction removeSub(link, soft = false) {\n const { dep, prevSub, nextSub } = link;\n if (prevSub) {\n prevSub.nextSub = nextSub;\n link.prevSub = void 0;\n }\n if (nextSub) {\n nextSub.prevSub = prevSub;\n link.nextSub = void 0;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && dep.subsHead === link) {\n dep.subsHead = nextSub;\n }\n if (dep.subs === link) {\n dep.subs = prevSub;\n if (!prevSub && dep.computed) {\n dep.computed.flags &= -5;\n for (let l = dep.computed.deps; l; l = l.nextDep) {\n removeSub(l, true);\n }\n }\n }\n if (!soft && !--dep.sc && dep.map) {\n dep.map.delete(dep.key);\n }\n}\nfunction removeDep(link) {\n const { prevDep, nextDep } = link;\n if (prevDep) {\n prevDep.nextDep = nextDep;\n link.prevDep = void 0;\n }\n if (nextDep) {\n nextDep.prevDep = prevDep;\n link.nextDep = void 0;\n }\n}\nfunction effect(fn, options) {\n if (fn.effect instanceof ReactiveEffect) {\n fn = fn.effect.fn;\n }\n const e = new ReactiveEffect(fn);\n if (options) {\n extend(e, options);\n }\n try {\n e.run();\n } catch (err) {\n e.stop();\n throw err;\n }\n const runner = e.run.bind(e);\n runner.effect = e;\n return runner;\n}\nfunction stop(runner) {\n runner.effect.stop();\n}\nlet shouldTrack = true;\nconst trackStack = [];\nfunction pauseTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = false;\n}\nfunction enableTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = true;\n}\nfunction resetTracking() {\n const last = trackStack.pop();\n shouldTrack = last === void 0 ? true : last;\n}\nfunction onEffectCleanup(fn, failSilently = false) {\n if (activeSub instanceof ReactiveEffect) {\n activeSub.cleanup = fn;\n } else if (!!(process.env.NODE_ENV !== \"production\") && !failSilently) {\n warn(\n `onEffectCleanup() was called when there was no active effect to associate with.`\n );\n }\n}\nfunction cleanupEffect(e) {\n const { cleanup } = e;\n e.cleanup = void 0;\n if (cleanup) {\n const prevSub = activeSub;\n activeSub = void 0;\n try {\n cleanup();\n } finally {\n activeSub = prevSub;\n }\n }\n}\n\nlet globalVersion = 0;\nclass Link {\n constructor(sub, dep) {\n this.sub = sub;\n this.dep = dep;\n this.version = dep.version;\n this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;\n }\n}\nclass Dep {\n // TODO isolatedDeclarations \"__v_skip\"\n constructor(computed) {\n this.computed = computed;\n this.version = 0;\n /**\n * Link between this dep and the current active effect\n */\n this.activeLink = void 0;\n /**\n * Doubly linked list representing the subscribing effects (tail)\n */\n this.subs = void 0;\n /**\n * For object property deps cleanup\n */\n this.map = void 0;\n this.key = void 0;\n /**\n * Subscriber counter\n */\n this.sc = 0;\n /**\n * @internal\n */\n this.__v_skip = true;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n this.subsHead = void 0;\n }\n }\n track(debugInfo) {\n if (!activeSub || !shouldTrack || activeSub === this.computed) {\n return;\n }\n let link = this.activeLink;\n if (link === void 0 || link.sub !== activeSub) {\n link = this.activeLink = new Link(activeSub, this);\n if (!activeSub.deps) {\n activeSub.deps = activeSub.depsTail = link;\n } else {\n link.prevDep = activeSub.depsTail;\n activeSub.depsTail.nextDep = link;\n activeSub.depsTail = link;\n }\n addSub(link);\n } else if (link.version === -1) {\n link.version = this.version;\n if (link.nextDep) {\n const next = link.nextDep;\n next.prevDep = link.prevDep;\n if (link.prevDep) {\n link.prevDep.nextDep = next;\n }\n link.prevDep = activeSub.depsTail;\n link.nextDep = void 0;\n activeSub.depsTail.nextDep = link;\n activeSub.depsTail = link;\n if (activeSub.deps === link) {\n activeSub.deps = next;\n }\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") && activeSub.onTrack) {\n activeSub.onTrack(\n extend(\n {\n effect: activeSub\n },\n debugInfo\n )\n );\n }\n return link;\n }\n trigger(debugInfo) {\n this.version++;\n globalVersion++;\n this.notify(debugInfo);\n }\n notify(debugInfo) {\n startBatch();\n try {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n for (let head = this.subsHead; head; head = head.nextSub) {\n if (head.sub.onTrigger && !(head.sub.flags & 8)) {\n head.sub.onTrigger(\n extend(\n {\n effect: head.sub\n },\n debugInfo\n )\n );\n }\n }\n }\n for (let link = this.subs; link; link = link.prevSub) {\n if (link.sub.notify()) {\n ;\n link.sub.dep.notify();\n }\n }\n } finally {\n endBatch();\n }\n }\n}\nfunction addSub(link) {\n link.dep.sc++;\n if (link.sub.flags & 4) {\n const computed = link.dep.computed;\n if (computed && !link.dep.subs) {\n computed.flags |= 4 | 16;\n for (let l = computed.deps; l; l = l.nextDep) {\n addSub(l);\n }\n }\n const currentTail = link.dep.subs;\n if (currentTail !== link) {\n link.prevSub = currentTail;\n if (currentTail) currentTail.nextSub = link;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && link.dep.subsHead === void 0) {\n link.dep.subsHead = link;\n }\n link.dep.subs = link;\n }\n}\nconst targetMap = /* @__PURE__ */ new WeakMap();\nconst ITERATE_KEY = Symbol(\n !!(process.env.NODE_ENV !== \"production\") ? \"Object iterate\" : \"\"\n);\nconst MAP_KEY_ITERATE_KEY = Symbol(\n !!(process.env.NODE_ENV !== \"production\") ? \"Map keys iterate\" : \"\"\n);\nconst ARRAY_ITERATE_KEY = Symbol(\n !!(process.env.NODE_ENV !== \"production\") ? \"Array iterate\" : \"\"\n);\nfunction track(target, type, key) {\n if (shouldTrack && activeSub) {\n let depsMap = targetMap.get(target);\n if (!depsMap) {\n targetMap.set(target, depsMap = /* @__PURE__ */ new Map());\n }\n let dep = depsMap.get(key);\n if (!dep) {\n depsMap.set(key, dep = new Dep());\n dep.map = depsMap;\n dep.key = key;\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n dep.track({\n target,\n type,\n key\n });\n } else {\n dep.track();\n }\n }\n}\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\n const depsMap = targetMap.get(target);\n if (!depsMap) {\n globalVersion++;\n return;\n }\n const run = (dep) => {\n if (dep) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n dep.trigger({\n target,\n type,\n key,\n newValue,\n oldValue,\n oldTarget\n });\n } else {\n dep.trigger();\n }\n }\n };\n startBatch();\n if (type === \"clear\") {\n depsMap.forEach(run);\n } else {\n const targetIsArray = isArray(target);\n const isArrayIndex = targetIsArray && isIntegerKey(key);\n if (targetIsArray && key === \"length\") {\n const newLength = Number(newValue);\n depsMap.forEach((dep, key2) => {\n if (key2 === \"length\" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {\n run(dep);\n }\n });\n } else {\n if (key !== void 0 || depsMap.has(void 0)) {\n run(depsMap.get(key));\n }\n if (isArrayIndex) {\n run(depsMap.get(ARRAY_ITERATE_KEY));\n }\n switch (type) {\n case \"add\":\n if (!targetIsArray) {\n run(depsMap.get(ITERATE_KEY));\n if (isMap(target)) {\n run(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n } else if (isArrayIndex) {\n run(depsMap.get(\"length\"));\n }\n break;\n case \"delete\":\n if (!targetIsArray) {\n run(depsMap.get(ITERATE_KEY));\n if (isMap(target)) {\n run(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n }\n break;\n case \"set\":\n if (isMap(target)) {\n run(depsMap.get(ITERATE_KEY));\n }\n break;\n }\n }\n }\n endBatch();\n}\nfunction getDepFromReactive(object, key) {\n const depMap = targetMap.get(object);\n return depMap && depMap.get(key);\n}\n\nfunction reactiveReadArray(array) {\n const raw = toRaw(array);\n if (raw === array) return raw;\n track(raw, \"iterate\", ARRAY_ITERATE_KEY);\n return isShallow(array) ? raw : raw.map(toReactive);\n}\nfunction shallowReadArray(arr) {\n track(arr = toRaw(arr), \"iterate\", ARRAY_ITERATE_KEY);\n return arr;\n}\nconst arrayInstrumentations = {\n __proto__: null,\n [Symbol.iterator]() {\n return iterator(this, Symbol.iterator, toReactive);\n },\n concat(...args) {\n return reactiveReadArray(this).concat(\n ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)\n );\n },\n entries() {\n return iterator(this, \"entries\", (value) => {\n value[1] = toReactive(value[1]);\n return value;\n });\n },\n every(fn, thisArg) {\n return apply(this, \"every\", fn, thisArg, void 0, arguments);\n },\n filter(fn, thisArg) {\n return apply(this, \"filter\", fn, thisArg, (v) => v.map(toReactive), arguments);\n },\n find(fn, thisArg) {\n return apply(this, \"find\", fn, thisArg, toReactive, arguments);\n },\n findIndex(fn, thisArg) {\n return apply(this, \"findIndex\", fn, thisArg, void 0, arguments);\n },\n findLast(fn, thisArg) {\n return apply(this, \"findLast\", fn, thisArg, toReactive, arguments);\n },\n findLastIndex(fn, thisArg) {\n return apply(this, \"findLastIndex\", fn, thisArg, void 0, arguments);\n },\n // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement\n forEach(fn, thisArg) {\n return apply(this, \"forEach\", fn, thisArg, void 0, arguments);\n },\n includes(...args) {\n return searchProxy(this, \"includes\", args);\n },\n indexOf(...args) {\n return searchProxy(this, \"indexOf\", args);\n },\n join(separator) {\n return reactiveReadArray(this).join(separator);\n },\n // keys() iterator only reads `length`, no optimisation required\n lastIndexOf(...args) {\n return searchProxy(this, \"lastIndexOf\", args);\n },\n map(fn, thisArg) {\n return apply(this, \"map\", fn, thisArg, void 0, arguments);\n },\n pop() {\n return noTracking(this, \"pop\");\n },\n push(...args) {\n return noTracking(this, \"push\", args);\n },\n reduce(fn, ...args) {\n return reduce(this, \"reduce\", fn, args);\n },\n reduceRight(fn, ...args) {\n return reduce(this, \"reduceRight\", fn, args);\n },\n shift() {\n return noTracking(this, \"shift\");\n },\n // slice could use ARRAY_ITERATE but also seems to beg for range tracking\n some(fn, thisArg) {\n return apply(this, \"some\", fn, thisArg, void 0, arguments);\n },\n splice(...args) {\n return noTracking(this, \"splice\", args);\n },\n toReversed() {\n return reactiveReadArray(this).toReversed();\n },\n toSorted(comparer) {\n return reactiveReadArray(this).toSorted(comparer);\n },\n toSpliced(...args) {\n return reactiveReadArray(this).toSpliced(...args);\n },\n unshift(...args) {\n return noTracking(this, \"unshift\", args);\n },\n values() {\n return iterator(this, \"values\", toReactive);\n }\n};\nfunction iterator(self, method, wrapValue) {\n const arr = shallowReadArray(self);\n const iter = arr[method]();\n if (arr !== self && !isShallow(self)) {\n iter._next = iter.next;\n iter.next = () => {\n const result = iter._next();\n if (result.value) {\n result.value = wrapValue(result.value);\n }\n return result;\n };\n }\n return iter;\n}\nconst arrayProto = Array.prototype;\nfunction apply(self, method, fn, thisArg, wrappedRetFn, args) {\n const arr = shallowReadArray(self);\n const needsWrap = arr !== self && !isShallow(self);\n const methodFn = arr[method];\n if (methodFn !== arrayProto[method]) {\n const result2 = methodFn.apply(self, args);\n return needsWrap ? toReactive(result2) : result2;\n }\n let wrappedFn = fn;\n if (arr !== self) {\n if (needsWrap) {\n wrappedFn = function(item, index) {\n return fn.call(this, toReactive(item), index, self);\n };\n } else if (fn.length > 2) {\n wrappedFn = function(item, index) {\n return fn.call(this, item, index, self);\n };\n }\n }\n const result = methodFn.call(arr, wrappedFn, thisArg);\n return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;\n}\nfunction reduce(self, method, fn, args) {\n const arr = shallowReadArray(self);\n let wrappedFn = fn;\n if (arr !== self) {\n if (!isShallow(self)) {\n wrappedFn = function(acc, item, index) {\n return fn.call(this, acc, toReactive(item), index, self);\n };\n } else if (fn.length > 3) {\n wrappedFn = function(acc, item, index) {\n return fn.call(this, acc, item, index, self);\n };\n }\n }\n return arr[method](wrappedFn, ...args);\n}\nfunction searchProxy(self, method, args) {\n const arr = toRaw(self);\n track(arr, \"iterate\", ARRAY_ITERATE_KEY);\n const res = arr[method](...args);\n if ((res === -1 || res === false) && isProxy(args[0])) {\n args[0] = toRaw(args[0]);\n return arr[method](...args);\n }\n return res;\n}\nfunction noTracking(self, method, args = []) {\n pauseTracking();\n startBatch();\n const res = toRaw(self)[method].apply(self, args);\n endBatch();\n resetTracking();\n return res;\n}\n\nconst isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);\nconst builtInSymbols = new Set(\n /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== \"arguments\" && key !== \"caller\").map((key) => Symbol[key]).filter(isSymbol)\n);\nfunction hasOwnProperty(key) {\n if (!isSymbol(key)) key = String(key);\n const obj = toRaw(this);\n track(obj, \"has\", key);\n return obj.hasOwnProperty(key);\n}\nclass BaseReactiveHandler {\n constructor(_isReadonly = false, _isShallow = false) {\n this._isReadonly = _isReadonly;\n this._isShallow = _isShallow;\n }\n get(target, key, receiver) {\n if (key === \"__v_skip\") return target[\"__v_skip\"];\n const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_isShallow\") {\n return isShallow2;\n } else if (key === \"__v_raw\") {\n if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype\n // this means the receiver is a user proxy of the reactive proxy\n Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {\n return target;\n }\n return;\n }\n const targetIsArray = isArray(target);\n if (!isReadonly2) {\n let fn;\n if (targetIsArray && (fn = arrayInstrumentations[key])) {\n return fn;\n }\n if (key === \"hasOwnProperty\") {\n return hasOwnProperty;\n }\n }\n const res = Reflect.get(\n target,\n key,\n // if this is a proxy wrapping a ref, return methods using the raw ref\n // as receiver so that we don't have to call `toRaw` on the ref in all\n // its class methods\n isRef(target) ? target : receiver\n );\n if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {\n return res;\n }\n if (!isReadonly2) {\n track(target, \"get\", key);\n }\n if (isShallow2) {\n return res;\n }\n if (isRef(res)) {\n return targetIsArray && isIntegerKey(key) ? res : res.value;\n }\n if (isObject(res)) {\n return isReadonly2 ? readonly(res) : reactive(res);\n }\n return res;\n }\n}\nclass MutableReactiveHandler extends BaseReactiveHandler {\n constructor(isShallow2 = false) {\n super(false, isShallow2);\n }\n set(target, key, value, receiver) {\n let oldValue = target[key];\n if (!this._isShallow) {\n const isOldValueReadonly = isReadonly(oldValue);\n if (!isShallow(value) && !isReadonly(value)) {\n oldValue = toRaw(oldValue);\n value = toRaw(value);\n }\n if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\n if (isOldValueReadonly) {\n return false;\n } else {\n oldValue.value = value;\n return true;\n }\n }\n }\n const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);\n const result = Reflect.set(\n target,\n key,\n value,\n isRef(target) ? target : receiver\n );\n if (target === toRaw(receiver)) {\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n }\n return result;\n }\n deleteProperty(target, key) {\n const hadKey = hasOwn(target, key);\n const oldValue = target[key];\n const result = Reflect.deleteProperty(target, key);\n if (result && hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n }\n has(target, key) {\n const result = Reflect.has(target, key);\n if (!isSymbol(key) || !builtInSymbols.has(key)) {\n track(target, \"has\", key);\n }\n return result;\n }\n ownKeys(target) {\n track(\n target,\n \"iterate\",\n isArray(target) ? \"length\" : ITERATE_KEY\n );\n return Reflect.ownKeys(target);\n }\n}\nclass ReadonlyReactiveHandler extends BaseReactiveHandler {\n constructor(isShallow2 = false) {\n super(true, isShallow2);\n }\n set(target, key) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `Set operation on key \"${String(key)}\" failed: target is readonly.`,\n target\n );\n }\n return true;\n }\n deleteProperty(target, key) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `Delete operation on key \"${String(key)}\" failed: target is readonly.`,\n target\n );\n }\n return true;\n }\n}\nconst mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();\nconst readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();\nconst shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);\nconst shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);\n\nconst toShallow = (value) => value;\nconst getProto = (v) => Reflect.getPrototypeOf(v);\nfunction createIterableMethod(method, isReadonly2, isShallow2) {\n return function(...args) {\n const target = this[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const targetIsMap = isMap(rawTarget);\n const isPair = method === \"entries\" || method === Symbol.iterator && targetIsMap;\n const isKeyOnly = method === \"keys\" && targetIsMap;\n const innerIterator = target[method](...args);\n const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;\n !isReadonly2 && track(\n rawTarget,\n \"iterate\",\n isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY\n );\n return {\n // iterator protocol\n next() {\n const { value, done } = innerIterator.next();\n return done ? { value, done } : {\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n done\n };\n },\n // iterable protocol\n [Symbol.iterator]() {\n return this;\n }\n };\n };\n}\nfunction createReadonlyMethod(type) {\n return function(...args) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const key = args[0] ? `on key \"${args[0]}\" ` : ``;\n warn(\n `${capitalize(type)} operation ${key}failed: target is readonly.`,\n toRaw(this)\n );\n }\n return type === \"delete\" ? false : type === \"clear\" ? void 0 : this;\n };\n}\nfunction createInstrumentations(readonly, shallow) {\n const instrumentations = {\n get(key) {\n const target = this[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const rawKey = toRaw(key);\n if (!readonly) {\n if (hasChanged(key, rawKey)) {\n track(rawTarget, \"get\", key);\n }\n track(rawTarget, \"get\", rawKey);\n }\n const { has } = getProto(rawTarget);\n const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;\n if (has.call(rawTarget, key)) {\n return wrap(target.get(key));\n } else if (has.call(rawTarget, rawKey)) {\n return wrap(target.get(rawKey));\n } else if (target !== rawTarget) {\n target.get(key);\n }\n },\n get size() {\n const target = this[\"__v_raw\"];\n !readonly && track(toRaw(target), \"iterate\", ITERATE_KEY);\n return Reflect.get(target, \"size\", target);\n },\n has(key) {\n const target = this[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const rawKey = toRaw(key);\n if (!readonly) {\n if (hasChanged(key, rawKey)) {\n track(rawTarget, \"has\", key);\n }\n track(rawTarget, \"has\", rawKey);\n }\n return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);\n },\n forEach(callback, thisArg) {\n const observed = this;\n const target = observed[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;\n !readonly && track(rawTarget, \"iterate\", ITERATE_KEY);\n return target.forEach((value, key) => {\n return callback.call(thisArg, wrap(value), wrap(key), observed);\n });\n }\n };\n extend(\n instrumentations,\n readonly ? {\n add: createReadonlyMethod(\"add\"),\n set: createReadonlyMethod(\"set\"),\n delete: createReadonlyMethod(\"delete\"),\n clear: createReadonlyMethod(\"clear\")\n } : {\n add(value) {\n if (!shallow && !isShallow(value) && !isReadonly(value)) {\n value = toRaw(value);\n }\n const target = toRaw(this);\n const proto = getProto(target);\n const hadKey = proto.has.call(target, value);\n if (!hadKey) {\n target.add(value);\n trigger(target, \"add\", value, value);\n }\n return this;\n },\n set(key, value) {\n if (!shallow && !isShallow(value) && !isReadonly(value)) {\n value = toRaw(value);\n }\n const target = toRaw(this);\n const { has, get } = getProto(target);\n let hadKey = has.call(target, key);\n if (!hadKey) {\n key = toRaw(key);\n hadKey = has.call(target, key);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n checkIdentityKeys(target, has, key);\n }\n const oldValue = get.call(target, key);\n target.set(key, value);\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n return this;\n },\n delete(key) {\n const target = toRaw(this);\n const { has, get } = getProto(target);\n let hadKey = has.call(target, key);\n if (!hadKey) {\n key = toRaw(key);\n hadKey = has.call(target, key);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n checkIdentityKeys(target, has, key);\n }\n const oldValue = get ? get.call(target, key) : void 0;\n const result = target.delete(key);\n if (hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n },\n clear() {\n const target = toRaw(this);\n const hadItems = target.size !== 0;\n const oldTarget = !!(process.env.NODE_ENV !== \"production\") ? isMap(target) ? new Map(target) : new Set(target) : void 0;\n const result = target.clear();\n if (hadItems) {\n trigger(\n target,\n \"clear\",\n void 0,\n void 0,\n oldTarget\n );\n }\n return result;\n }\n }\n );\n const iteratorMethods = [\n \"keys\",\n \"values\",\n \"entries\",\n Symbol.iterator\n ];\n iteratorMethods.forEach((method) => {\n instrumentations[method] = createIterableMethod(method, readonly, shallow);\n });\n return instrumentations;\n}\nfunction createInstrumentationGetter(isReadonly2, shallow) {\n const instrumentations = createInstrumentations(isReadonly2, shallow);\n return (target, key, receiver) => {\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_raw\") {\n return target;\n }\n return Reflect.get(\n hasOwn(instrumentations, key) && key in target ? instrumentations : target,\n key,\n receiver\n );\n };\n}\nconst mutableCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, false)\n};\nconst shallowCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, true)\n};\nconst readonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, false)\n};\nconst shallowReadonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, true)\n};\nfunction checkIdentityKeys(target, has, key) {\n const rawKey = toRaw(key);\n if (rawKey !== key && has.call(target, rawKey)) {\n const type = toRawType(target);\n warn(\n `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`\n );\n }\n}\n\nconst reactiveMap = /* @__PURE__ */ new WeakMap();\nconst shallowReactiveMap = /* @__PURE__ */ new WeakMap();\nconst readonlyMap = /* @__PURE__ */ new WeakMap();\nconst shallowReadonlyMap = /* @__PURE__ */ new WeakMap();\nfunction targetTypeMap(rawType) {\n switch (rawType) {\n case \"Object\":\n case \"Array\":\n return 1 /* COMMON */;\n case \"Map\":\n case \"Set\":\n case \"WeakMap\":\n case \"WeakSet\":\n return 2 /* COLLECTION */;\n default:\n return 0 /* INVALID */;\n }\n}\nfunction getTargetType(value) {\n return value[\"__v_skip\"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));\n}\nfunction reactive(target) {\n if (isReadonly(target)) {\n return target;\n }\n return createReactiveObject(\n target,\n false,\n mutableHandlers,\n mutableCollectionHandlers,\n reactiveMap\n );\n}\nfunction shallowReactive(target) {\n return createReactiveObject(\n target,\n false,\n shallowReactiveHandlers,\n shallowCollectionHandlers,\n shallowReactiveMap\n );\n}\nfunction readonly(target) {\n return createReactiveObject(\n target,\n true,\n readonlyHandlers,\n readonlyCollectionHandlers,\n readonlyMap\n );\n}\nfunction shallowReadonly(target) {\n return createReactiveObject(\n target,\n true,\n shallowReadonlyHandlers,\n shallowReadonlyCollectionHandlers,\n shallowReadonlyMap\n );\n}\nfunction createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {\n if (!isObject(target)) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `value cannot be made ${isReadonly2 ? \"readonly\" : \"reactive\"}: ${String(\n target\n )}`\n );\n }\n return target;\n }\n if (target[\"__v_raw\"] && !(isReadonly2 && target[\"__v_isReactive\"])) {\n return target;\n }\n const targetType = getTargetType(target);\n if (targetType === 0 /* INVALID */) {\n return target;\n }\n const existingProxy = proxyMap.get(target);\n if (existingProxy) {\n return existingProxy;\n }\n const proxy = new Proxy(\n target,\n targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers\n );\n proxyMap.set(target, proxy);\n return proxy;\n}\nfunction isReactive(value) {\n if (isReadonly(value)) {\n return isReactive(value[\"__v_raw\"]);\n }\n return !!(value && value[\"__v_isReactive\"]);\n}\nfunction isReadonly(value) {\n return !!(value && value[\"__v_isReadonly\"]);\n}\nfunction isShallow(value) {\n return !!(value && value[\"__v_isShallow\"]);\n}\nfunction isProxy(value) {\n return value ? !!value[\"__v_raw\"] : false;\n}\nfunction toRaw(observed) {\n const raw = observed && observed[\"__v_raw\"];\n return raw ? toRaw(raw) : observed;\n}\nfunction markRaw(value) {\n if (!hasOwn(value, \"__v_skip\") && Object.isExtensible(value)) {\n def(value, \"__v_skip\", true);\n }\n return value;\n}\nconst toReactive = (value) => isObject(value) ? reactive(value) : value;\nconst toReadonly = (value) => isObject(value) ? readonly(value) : value;\n\nfunction isRef(r) {\n return r ? r[\"__v_isRef\"] === true : false;\n}\nfunction ref(value) {\n return createRef(value, false);\n}\nfunction shallowRef(value) {\n return createRef(value, true);\n}\nfunction createRef(rawValue, shallow) {\n if (isRef(rawValue)) {\n return rawValue;\n }\n return new RefImpl(rawValue, shallow);\n}\nclass RefImpl {\n constructor(value, isShallow2) {\n this.dep = new Dep();\n this[\"__v_isRef\"] = true;\n this[\"__v_isShallow\"] = false;\n this._rawValue = isShallow2 ? value : toRaw(value);\n this._value = isShallow2 ? value : toReactive(value);\n this[\"__v_isShallow\"] = isShallow2;\n }\n get value() {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n this.dep.track({\n target: this,\n type: \"get\",\n key: \"value\"\n });\n } else {\n this.dep.track();\n }\n return this._value;\n }\n set value(newValue) {\n const oldValue = this._rawValue;\n const useDirectValue = this[\"__v_isShallow\"] || isShallow(newValue) || isReadonly(newValue);\n newValue = useDirectValue ? newValue : toRaw(newValue);\n if (hasChanged(newValue, oldValue)) {\n this._rawValue = newValue;\n this._value = useDirectValue ? newValue : toReactive(newValue);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n this.dep.trigger({\n target: this,\n type: \"set\",\n key: \"value\",\n newValue,\n oldValue\n });\n } else {\n this.dep.trigger();\n }\n }\n }\n}\nfunction triggerRef(ref2) {\n if (ref2.dep) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n ref2.dep.trigger({\n target: ref2,\n type: \"set\",\n key: \"value\",\n newValue: ref2._value\n });\n } else {\n ref2.dep.trigger();\n }\n }\n}\nfunction unref(ref2) {\n return isRef(ref2) ? ref2.value : ref2;\n}\nfunction toValue(source) {\n return isFunction(source) ? source() : unref(source);\n}\nconst shallowUnwrapHandlers = {\n get: (target, key, receiver) => key === \"__v_raw\" ? target : unref(Reflect.get(target, key, receiver)),\n set: (target, key, value, receiver) => {\n const oldValue = target[key];\n if (isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n return true;\n } else {\n return Reflect.set(target, key, value, receiver);\n }\n }\n};\nfunction proxyRefs(objectWithRefs) {\n return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);\n}\nclass CustomRefImpl {\n constructor(factory) {\n this[\"__v_isRef\"] = true;\n this._value = void 0;\n const dep = this.dep = new Dep();\n const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));\n this._get = get;\n this._set = set;\n }\n get value() {\n return this._value = this._get();\n }\n set value(newVal) {\n this._set(newVal);\n }\n}\nfunction customRef(factory) {\n return new CustomRefImpl(factory);\n}\nfunction toRefs(object) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isProxy(object)) {\n warn(`toRefs() expects a reactive object but received a plain one.`);\n }\n const ret = isArray(object) ? new Array(object.length) : {};\n for (const key in object) {\n ret[key] = propertyToRef(object, key);\n }\n return ret;\n}\nclass ObjectRefImpl {\n constructor(_object, _key, _defaultValue) {\n this._object = _object;\n this._key = _key;\n this._defaultValue = _defaultValue;\n this[\"__v_isRef\"] = true;\n this._value = void 0;\n }\n get value() {\n const val = this._object[this._key];\n return this._value = val === void 0 ? this._defaultValue : val;\n }\n set value(newVal) {\n this._object[this._key] = newVal;\n }\n get dep() {\n return getDepFromReactive(toRaw(this._object), this._key);\n }\n}\nclass GetterRefImpl {\n constructor(_getter) {\n this._getter = _getter;\n this[\"__v_isRef\"] = true;\n this[\"__v_isReadonly\"] = true;\n this._value = void 0;\n }\n get value() {\n return this._value = this._getter();\n }\n}\nfunction toRef(source, key, defaultValue) {\n if (isRef(source)) {\n return source;\n } else if (isFunction(source)) {\n return new GetterRefImpl(source);\n } else if (isObject(source) && arguments.length > 1) {\n return propertyToRef(source, key, defaultValue);\n } else {\n return ref(source);\n }\n}\nfunction propertyToRef(source, key, defaultValue) {\n const val = source[key];\n return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);\n}\n\nclass ComputedRefImpl {\n constructor(fn, setter, isSSR) {\n this.fn = fn;\n this.setter = setter;\n /**\n * @internal\n */\n this._value = void 0;\n /**\n * @internal\n */\n this.dep = new Dep(this);\n /**\n * @internal\n */\n this.__v_isRef = true;\n // TODO isolatedDeclarations \"__v_isReadonly\"\n // A computed is also a subscriber that tracks other deps\n /**\n * @internal\n */\n this.deps = void 0;\n /**\n * @internal\n */\n this.depsTail = void 0;\n /**\n * @internal\n */\n this.flags = 16;\n /**\n * @internal\n */\n this.globalVersion = globalVersion - 1;\n /**\n * @internal\n */\n this.next = void 0;\n // for backwards compat\n this.effect = this;\n this[\"__v_isReadonly\"] = !setter;\n this.isSSR = isSSR;\n }\n /**\n * @internal\n */\n notify() {\n this.flags |= 16;\n if (!(this.flags & 8) && // avoid infinite self recursion\n activeSub !== this) {\n batch(this, true);\n return true;\n } else if (!!(process.env.NODE_ENV !== \"production\")) ;\n }\n get value() {\n const link = !!(process.env.NODE_ENV !== \"production\") ? this.dep.track({\n target: this,\n type: \"get\",\n key: \"value\"\n }) : this.dep.track();\n refreshComputed(this);\n if (link) {\n link.version = this.dep.version;\n }\n return this._value;\n }\n set value(newValue) {\n if (this.setter) {\n this.setter(newValue);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\"Write operation failed: computed value is readonly\");\n }\n }\n}\nfunction computed(getterOrOptions, debugOptions, isSSR = false) {\n let getter;\n let setter;\n if (isFunction(getterOrOptions)) {\n getter = getterOrOptions;\n } else {\n getter = getterOrOptions.get;\n setter = getterOrOptions.set;\n }\n const cRef = new ComputedRefImpl(getter, setter, isSSR);\n if (!!(process.env.NODE_ENV !== \"production\") && debugOptions && !isSSR) {\n cRef.onTrack = debugOptions.onTrack;\n cRef.onTrigger = debugOptions.onTrigger;\n }\n return cRef;\n}\n\nconst TrackOpTypes = {\n \"GET\": \"get\",\n \"HAS\": \"has\",\n \"ITERATE\": \"iterate\"\n};\nconst TriggerOpTypes = {\n \"SET\": \"set\",\n \"ADD\": \"add\",\n \"DELETE\": \"delete\",\n \"CLEAR\": \"clear\"\n};\nconst ReactiveFlags = {\n \"SKIP\": \"__v_skip\",\n \"IS_REACTIVE\": \"__v_isReactive\",\n \"IS_READONLY\": \"__v_isReadonly\",\n \"IS_SHALLOW\": \"__v_isShallow\",\n \"RAW\": \"__v_raw\",\n \"IS_REF\": \"__v_isRef\"\n};\n\nconst WatchErrorCodes = {\n \"WATCH_GETTER\": 2,\n \"2\": \"WATCH_GETTER\",\n \"WATCH_CALLBACK\": 3,\n \"3\": \"WATCH_CALLBACK\",\n \"WATCH_CLEANUP\": 4,\n \"4\": \"WATCH_CLEANUP\"\n};\nconst INITIAL_WATCHER_VALUE = {};\nconst cleanupMap = /* @__PURE__ */ new WeakMap();\nlet activeWatcher = void 0;\nfunction getCurrentWatcher() {\n return activeWatcher;\n}\nfunction onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {\n if (owner) {\n let cleanups = cleanupMap.get(owner);\n if (!cleanups) cleanupMap.set(owner, cleanups = []);\n cleanups.push(cleanupFn);\n } else if (!!(process.env.NODE_ENV !== \"production\") && !failSilently) {\n warn(\n `onWatcherCleanup() was called when there was no active watcher to associate with.`\n );\n }\n}\nfunction watch(source, cb, options = EMPTY_OBJ) {\n const { immediate, deep, once, scheduler, augmentJob, call } = options;\n const warnInvalidSource = (s) => {\n (options.onWarn || warn)(\n `Invalid watch source: `,\n s,\n `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`\n );\n };\n const reactiveGetter = (source2) => {\n if (deep) return source2;\n if (isShallow(source2) || deep === false || deep === 0)\n return traverse(source2, 1);\n return traverse(source2);\n };\n let effect;\n let getter;\n let cleanup;\n let boundCleanup;\n let forceTrigger = false;\n let isMultiSource = false;\n if (isRef(source)) {\n getter = () => source.value;\n forceTrigger = isShallow(source);\n } else if (isReactive(source)) {\n getter = () => reactiveGetter(source);\n forceTrigger = true;\n } else if (isArray(source)) {\n isMultiSource = true;\n forceTrigger = source.some((s) => isReactive(s) || isShallow(s));\n getter = () => source.map((s) => {\n if (isRef(s)) {\n return s.value;\n } else if (isReactive(s)) {\n return reactiveGetter(s);\n } else if (isFunction(s)) {\n return call ? call(s, 2) : s();\n } else {\n !!(process.env.NODE_ENV !== \"production\") && warnInvalidSource(s);\n }\n });\n } else if (isFunction(source)) {\n if (cb) {\n getter = call ? () => call(source, 2) : source;\n } else {\n getter = () => {\n if (cleanup) {\n pauseTracking();\n try {\n cleanup();\n } finally {\n resetTracking();\n }\n }\n const currentEffect = activeWatcher;\n activeWatcher = effect;\n try {\n return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);\n } finally {\n activeWatcher = currentEffect;\n }\n };\n }\n } else {\n getter = NOOP;\n !!(process.env.NODE_ENV !== \"production\") && warnInvalidSource(source);\n }\n if (cb && deep) {\n const baseGetter = getter;\n const depth = deep === true ? Infinity : deep;\n getter = () => traverse(baseGetter(), depth);\n }\n const scope = getCurrentScope();\n const watchHandle = () => {\n effect.stop();\n if (scope && scope.active) {\n remove(scope.effects, effect);\n }\n };\n if (once && cb) {\n const _cb = cb;\n cb = (...args) => {\n _cb(...args);\n watchHandle();\n };\n }\n let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;\n const job = (immediateFirstRun) => {\n if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {\n return;\n }\n if (cb) {\n const newValue = effect.run();\n if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {\n if (cleanup) {\n cleanup();\n }\n const currentWatcher = activeWatcher;\n activeWatcher = effect;\n try {\n const args = [\n newValue,\n // pass undefined as the old value when it's changed for the first time\n oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,\n boundCleanup\n ];\n oldValue = newValue;\n call ? call(cb, 3, args) : (\n // @ts-expect-error\n cb(...args)\n );\n } finally {\n activeWatcher = currentWatcher;\n }\n }\n } else {\n effect.run();\n }\n };\n if (augmentJob) {\n augmentJob(job);\n }\n effect = new ReactiveEffect(getter);\n effect.scheduler = scheduler ? () => scheduler(job, false) : job;\n boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);\n cleanup = effect.onStop = () => {\n const cleanups = cleanupMap.get(effect);\n if (cleanups) {\n if (call) {\n call(cleanups, 4);\n } else {\n for (const cleanup2 of cleanups) cleanup2();\n }\n cleanupMap.delete(effect);\n }\n };\n if (!!(process.env.NODE_ENV !== \"production\")) {\n effect.onTrack = options.onTrack;\n effect.onTrigger = options.onTrigger;\n }\n if (cb) {\n if (immediate) {\n job(true);\n } else {\n oldValue = effect.run();\n }\n } else if (scheduler) {\n scheduler(job.bind(null, true), true);\n } else {\n effect.run();\n }\n watchHandle.pause = effect.pause.bind(effect);\n watchHandle.resume = effect.resume.bind(effect);\n watchHandle.stop = watchHandle;\n return watchHandle;\n}\nfunction traverse(value, depth = Infinity, seen) {\n if (depth <= 0 || !isObject(value) || value[\"__v_skip\"]) {\n return value;\n }\n seen = seen || /* @__PURE__ */ new Set();\n if (seen.has(value)) {\n return value;\n }\n seen.add(value);\n depth--;\n if (isRef(value)) {\n traverse(value.value, depth, seen);\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n traverse(value[i], depth, seen);\n }\n } else if (isSet(value) || isMap(value)) {\n value.forEach((v) => {\n traverse(v, depth, seen);\n });\n } else if (isPlainObject(value)) {\n for (const key in value) {\n traverse(value[key], depth, seen);\n }\n for (const key of Object.getOwnPropertySymbols(value)) {\n if (Object.prototype.propertyIsEnumerable.call(value, key)) {\n traverse(value[key], depth, seen);\n }\n }\n }\n return value;\n}\n\nexport { ARRAY_ITERATE_KEY, EffectFlags, EffectScope, ITERATE_KEY, MAP_KEY_ITERATE_KEY, ReactiveEffect, ReactiveFlags, TrackOpTypes, TriggerOpTypes, WatchErrorCodes, computed, customRef, effect, effectScope, enableTracking, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onEffectCleanup, onScopeDispose, onWatcherCleanup, pauseTracking, proxyRefs, reactive, reactiveReadArray, readonly, ref, resetTracking, shallowReactive, shallowReadArray, shallowReadonly, shallowRef, stop, toRaw, toReactive, toReadonly, toRef, toRefs, toValue, track, traverse, trigger, triggerRef, unref, watch };\n","/**\n* @vue/runtime-core v3.5.18\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\nimport { pauseTracking, resetTracking, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';\nexport { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';\nimport { isString, isFunction, EMPTY_OBJ, isPromise, isArray, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, isGloballyAllowed, NO, EMPTY_ARR, hyphenate, makeMap, toRawType, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';\nexport { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';\n\nconst stack = [];\nfunction pushWarningContext(vnode) {\n stack.push(vnode);\n}\nfunction popWarningContext() {\n stack.pop();\n}\nlet isWarning = false;\nfunction warn$1(msg, ...args) {\n if (isWarning) return;\n isWarning = true;\n pauseTracking();\n const instance = stack.length ? stack[stack.length - 1].component : null;\n const appWarnHandler = instance && instance.appContext.config.warnHandler;\n const trace = getComponentTrace();\n if (appWarnHandler) {\n callWithErrorHandling(\n appWarnHandler,\n instance,\n 11,\n [\n // eslint-disable-next-line no-restricted-syntax\n msg + args.map((a) => {\n var _a, _b;\n return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);\n }).join(\"\"),\n instance && instance.proxy,\n trace.map(\n ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`\n ).join(\"\\n\"),\n trace\n ]\n );\n } else {\n const warnArgs = [`[Vue warn]: ${msg}`, ...args];\n if (trace.length && // avoid spamming console during tests\n true) {\n warnArgs.push(`\n`, ...formatTrace(trace));\n }\n console.warn(...warnArgs);\n }\n resetTracking();\n isWarning = false;\n}\nfunction getComponentTrace() {\n let currentVNode = stack[stack.length - 1];\n if (!currentVNode) {\n return [];\n }\n const normalizedStack = [];\n while (currentVNode) {\n const last = normalizedStack[0];\n if (last && last.vnode === currentVNode) {\n last.recurseCount++;\n } else {\n normalizedStack.push({\n vnode: currentVNode,\n recurseCount: 0\n });\n }\n const parentInstance = currentVNode.component && currentVNode.component.parent;\n currentVNode = parentInstance && parentInstance.vnode;\n }\n return normalizedStack;\n}\nfunction formatTrace(trace) {\n const logs = [];\n trace.forEach((entry, i) => {\n logs.push(...i === 0 ? [] : [`\n`], ...formatTraceEntry(entry));\n });\n return logs;\n}\nfunction formatTraceEntry({ vnode, recurseCount }) {\n const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;\n const isRoot = vnode.component ? vnode.component.parent == null : false;\n const open = ` at <${formatComponentName(\n vnode.component,\n vnode.type,\n isRoot\n )}`;\n const close = `>` + postfix;\n return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];\n}\nfunction formatProps(props) {\n const res = [];\n const keys = Object.keys(props);\n keys.slice(0, 3).forEach((key) => {\n res.push(...formatProp(key, props[key]));\n });\n if (keys.length > 3) {\n res.push(` ...`);\n }\n return res;\n}\nfunction formatProp(key, value, raw) {\n if (isString(value)) {\n value = JSON.stringify(value);\n return raw ? value : [`${key}=${value}`];\n } else if (typeof value === \"number\" || typeof value === \"boolean\" || value == null) {\n return raw ? value : [`${key}=${value}`];\n } else if (isRef(value)) {\n value = formatProp(key, toRaw(value.value), true);\n return raw ? value : [`${key}=Ref<`, value, `>`];\n } else if (isFunction(value)) {\n return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];\n } else {\n value = toRaw(value);\n return raw ? value : [`${key}=`, value];\n }\n}\nfunction assertNumber(val, type) {\n if (!!!(process.env.NODE_ENV !== \"production\")) return;\n if (val === void 0) {\n return;\n } else if (typeof val !== \"number\") {\n warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);\n } else if (isNaN(val)) {\n warn$1(`${type} is NaN - the duration expression might be incorrect.`);\n }\n}\n\nconst ErrorCodes = {\n \"SETUP_FUNCTION\": 0,\n \"0\": \"SETUP_FUNCTION\",\n \"RENDER_FUNCTION\": 1,\n \"1\": \"RENDER_FUNCTION\",\n \"NATIVE_EVENT_HANDLER\": 5,\n \"5\": \"NATIVE_EVENT_HANDLER\",\n \"COMPONENT_EVENT_HANDLER\": 6,\n \"6\": \"COMPONENT_EVENT_HANDLER\",\n \"VNODE_HOOK\": 7,\n \"7\": \"VNODE_HOOK\",\n \"DIRECTIVE_HOOK\": 8,\n \"8\": \"DIRECTIVE_HOOK\",\n \"TRANSITION_HOOK\": 9,\n \"9\": \"TRANSITION_HOOK\",\n \"APP_ERROR_HANDLER\": 10,\n \"10\": \"APP_ERROR_HANDLER\",\n \"APP_WARN_HANDLER\": 11,\n \"11\": \"APP_WARN_HANDLER\",\n \"FUNCTION_REF\": 12,\n \"12\": \"FUNCTION_REF\",\n \"ASYNC_COMPONENT_LOADER\": 13,\n \"13\": \"ASYNC_COMPONENT_LOADER\",\n \"SCHEDULER\": 14,\n \"14\": \"SCHEDULER\",\n \"COMPONENT_UPDATE\": 15,\n \"15\": \"COMPONENT_UPDATE\",\n \"APP_UNMOUNT_CLEANUP\": 16,\n \"16\": \"APP_UNMOUNT_CLEANUP\"\n};\nconst ErrorTypeStrings$1 = {\n [\"sp\"]: \"serverPrefetch hook\",\n [\"bc\"]: \"beforeCreate hook\",\n [\"c\"]: \"created hook\",\n [\"bm\"]: \"beforeMount hook\",\n [\"m\"]: \"mounted hook\",\n [\"bu\"]: \"beforeUpdate hook\",\n [\"u\"]: \"updated\",\n [\"bum\"]: \"beforeUnmount hook\",\n [\"um\"]: \"unmounted hook\",\n [\"a\"]: \"activated hook\",\n [\"da\"]: \"deactivated hook\",\n [\"ec\"]: \"errorCaptured hook\",\n [\"rtc\"]: \"renderTracked hook\",\n [\"rtg\"]: \"renderTriggered hook\",\n [0]: \"setup function\",\n [1]: \"render function\",\n [2]: \"watcher getter\",\n [3]: \"watcher callback\",\n [4]: \"watcher cleanup function\",\n [5]: \"native event handler\",\n [6]: \"component event handler\",\n [7]: \"vnode hook\",\n [8]: \"directive hook\",\n [9]: \"transition hook\",\n [10]: \"app errorHandler\",\n [11]: \"app warnHandler\",\n [12]: \"ref function\",\n [13]: \"async component loader\",\n [14]: \"scheduler flush\",\n [15]: \"component update\",\n [16]: \"app unmount cleanup function\"\n};\nfunction callWithErrorHandling(fn, instance, type, args) {\n try {\n return args ? fn(...args) : fn();\n } catch (err) {\n handleError(err, instance, type);\n }\n}\nfunction callWithAsyncErrorHandling(fn, instance, type, args) {\n if (isFunction(fn)) {\n const res = callWithErrorHandling(fn, instance, type, args);\n if (res && isPromise(res)) {\n res.catch((err) => {\n handleError(err, instance, type);\n });\n }\n return res;\n }\n if (isArray(fn)) {\n const values = [];\n for (let i = 0; i < fn.length; i++) {\n values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));\n }\n return values;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`\n );\n }\n}\nfunction handleError(err, instance, type, throwInDev = true) {\n const contextVNode = instance ? instance.vnode : null;\n const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;\n if (instance) {\n let cur = instance.parent;\n const exposedInstance = instance.proxy;\n const errorInfo = !!(process.env.NODE_ENV !== \"production\") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;\n while (cur) {\n const errorCapturedHooks = cur.ec;\n if (errorCapturedHooks) {\n for (let i = 0; i < errorCapturedHooks.length; i++) {\n if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {\n return;\n }\n }\n }\n cur = cur.parent;\n }\n if (errorHandler) {\n pauseTracking();\n callWithErrorHandling(errorHandler, null, 10, [\n err,\n exposedInstance,\n errorInfo\n ]);\n resetTracking();\n return;\n }\n }\n logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);\n}\nfunction logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const info = ErrorTypeStrings$1[type];\n if (contextVNode) {\n pushWarningContext(contextVNode);\n }\n warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);\n if (contextVNode) {\n popWarningContext();\n }\n if (throwInDev) {\n throw err;\n } else {\n console.error(err);\n }\n } else if (throwInProd) {\n throw err;\n } else {\n console.error(err);\n }\n}\n\nconst queue = [];\nlet flushIndex = -1;\nconst pendingPostFlushCbs = [];\nlet activePostFlushCbs = null;\nlet postFlushIndex = 0;\nconst resolvedPromise = /* @__PURE__ */ Promise.resolve();\nlet currentFlushPromise = null;\nconst RECURSION_LIMIT = 100;\nfunction nextTick(fn) {\n const p = currentFlushPromise || resolvedPromise;\n return fn ? p.then(this ? fn.bind(this) : fn) : p;\n}\nfunction findInsertionIndex(id) {\n let start = flushIndex + 1;\n let end = queue.length;\n while (start < end) {\n const middle = start + end >>> 1;\n const middleJob = queue[middle];\n const middleJobId = getId(middleJob);\n if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {\n start = middle + 1;\n } else {\n end = middle;\n }\n }\n return start;\n}\nfunction queueJob(job) {\n if (!(job.flags & 1)) {\n const jobId = getId(job);\n const lastJob = queue[queue.length - 1];\n if (!lastJob || // fast path when the job id is larger than the tail\n !(job.flags & 2) && jobId >= getId(lastJob)) {\n queue.push(job);\n } else {\n queue.splice(findInsertionIndex(jobId), 0, job);\n }\n job.flags |= 1;\n queueFlush();\n }\n}\nfunction queueFlush() {\n if (!currentFlushPromise) {\n currentFlushPromise = resolvedPromise.then(flushJobs);\n }\n}\nfunction queuePostFlushCb(cb) {\n if (!isArray(cb)) {\n if (activePostFlushCbs && cb.id === -1) {\n activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);\n } else if (!(cb.flags & 1)) {\n pendingPostFlushCbs.push(cb);\n cb.flags |= 1;\n }\n } else {\n pendingPostFlushCbs.push(...cb);\n }\n queueFlush();\n}\nfunction flushPreFlushCbs(instance, seen, i = flushIndex + 1) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n for (; i < queue.length; i++) {\n const cb = queue[i];\n if (cb && cb.flags & 2) {\n if (instance && cb.id !== instance.uid) {\n continue;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && checkRecursiveUpdates(seen, cb)) {\n continue;\n }\n queue.splice(i, 1);\n i--;\n if (cb.flags & 4) {\n cb.flags &= -2;\n }\n cb();\n if (!(cb.flags & 4)) {\n cb.flags &= -2;\n }\n }\n }\n}\nfunction flushPostFlushCbs(seen) {\n if (pendingPostFlushCbs.length) {\n const deduped = [...new Set(pendingPostFlushCbs)].sort(\n (a, b) => getId(a) - getId(b)\n );\n pendingPostFlushCbs.length = 0;\n if (activePostFlushCbs) {\n activePostFlushCbs.push(...deduped);\n return;\n }\n activePostFlushCbs = deduped;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\n const cb = activePostFlushCbs[postFlushIndex];\n if (!!(process.env.NODE_ENV !== \"production\") && checkRecursiveUpdates(seen, cb)) {\n continue;\n }\n if (cb.flags & 4) {\n cb.flags &= -2;\n }\n if (!(cb.flags & 8)) cb();\n cb.flags &= -2;\n }\n activePostFlushCbs = null;\n postFlushIndex = 0;\n }\n}\nconst getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;\nfunction flushJobs(seen) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n const check = !!(process.env.NODE_ENV !== \"production\") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;\n try {\n for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {\n const job = queue[flushIndex];\n if (job && !(job.flags & 8)) {\n if (!!(process.env.NODE_ENV !== \"production\") && check(job)) {\n continue;\n }\n if (job.flags & 4) {\n job.flags &= ~1;\n }\n callWithErrorHandling(\n job,\n job.i,\n job.i ? 15 : 14\n );\n if (!(job.flags & 4)) {\n job.flags &= ~1;\n }\n }\n }\n } finally {\n for (; flushIndex < queue.length; flushIndex++) {\n const job = queue[flushIndex];\n if (job) {\n job.flags &= -2;\n }\n }\n flushIndex = -1;\n queue.length = 0;\n flushPostFlushCbs(seen);\n currentFlushPromise = null;\n if (queue.length || pendingPostFlushCbs.length) {\n flushJobs(seen);\n }\n }\n}\nfunction checkRecursiveUpdates(seen, fn) {\n const count = seen.get(fn) || 0;\n if (count > RECURSION_LIMIT) {\n const instance = fn.i;\n const componentName = instance && getComponentName(instance.type);\n handleError(\n `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,\n null,\n 10\n );\n return true;\n }\n seen.set(fn, count + 1);\n return false;\n}\n\nlet isHmrUpdating = false;\nconst hmrDirtyComponents = /* @__PURE__ */ new Map();\nif (!!(process.env.NODE_ENV !== \"production\")) {\n getGlobalThis().__VUE_HMR_RUNTIME__ = {\n createRecord: tryWrap(createRecord),\n rerender: tryWrap(rerender),\n reload: tryWrap(reload)\n };\n}\nconst map = /* @__PURE__ */ new Map();\nfunction registerHMR(instance) {\n const id = instance.type.__hmrId;\n let record = map.get(id);\n if (!record) {\n createRecord(id, instance.type);\n record = map.get(id);\n }\n record.instances.add(instance);\n}\nfunction unregisterHMR(instance) {\n map.get(instance.type.__hmrId).instances.delete(instance);\n}\nfunction createRecord(id, initialDef) {\n if (map.has(id)) {\n return false;\n }\n map.set(id, {\n initialDef: normalizeClassComponent(initialDef),\n instances: /* @__PURE__ */ new Set()\n });\n return true;\n}\nfunction normalizeClassComponent(component) {\n return isClassComponent(component) ? component.__vccOpts : component;\n}\nfunction rerender(id, newRender) {\n const record = map.get(id);\n if (!record) {\n return;\n }\n record.initialDef.render = newRender;\n [...record.instances].forEach((instance) => {\n if (newRender) {\n instance.render = newRender;\n normalizeClassComponent(instance.type).render = newRender;\n }\n instance.renderCache = [];\n isHmrUpdating = true;\n instance.update();\n isHmrUpdating = false;\n });\n}\nfunction reload(id, newComp) {\n const record = map.get(id);\n if (!record) return;\n newComp = normalizeClassComponent(newComp);\n updateComponentDef(record.initialDef, newComp);\n const instances = [...record.instances];\n for (let i = 0; i < instances.length; i++) {\n const instance = instances[i];\n const oldComp = normalizeClassComponent(instance.type);\n let dirtyInstances = hmrDirtyComponents.get(oldComp);\n if (!dirtyInstances) {\n if (oldComp !== record.initialDef) {\n updateComponentDef(oldComp, newComp);\n }\n hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());\n }\n dirtyInstances.add(instance);\n instance.appContext.propsCache.delete(instance.type);\n instance.appContext.emitsCache.delete(instance.type);\n instance.appContext.optionsCache.delete(instance.type);\n if (instance.ceReload) {\n dirtyInstances.add(instance);\n instance.ceReload(newComp.styles);\n dirtyInstances.delete(instance);\n } else if (instance.parent) {\n queueJob(() => {\n isHmrUpdating = true;\n instance.parent.update();\n isHmrUpdating = false;\n dirtyInstances.delete(instance);\n });\n } else if (instance.appContext.reload) {\n instance.appContext.reload();\n } else if (typeof window !== \"undefined\") {\n window.location.reload();\n } else {\n console.warn(\n \"[HMR] Root or manually mounted instance modified. Full reload required.\"\n );\n }\n if (instance.root.ce && instance !== instance.root) {\n instance.root.ce._removeChildStyle(oldComp);\n }\n }\n queuePostFlushCb(() => {\n hmrDirtyComponents.clear();\n });\n}\nfunction updateComponentDef(oldComp, newComp) {\n extend(oldComp, newComp);\n for (const key in oldComp) {\n if (key !== \"__file\" && !(key in newComp)) {\n delete oldComp[key];\n }\n }\n}\nfunction tryWrap(fn) {\n return (id, arg) => {\n try {\n return fn(id, arg);\n } catch (e) {\n console.error(e);\n console.warn(\n `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`\n );\n }\n };\n}\n\nlet devtools$1;\nlet buffer = [];\nlet devtoolsNotInstalled = false;\nfunction emit$1(event, ...args) {\n if (devtools$1) {\n devtools$1.emit(event, ...args);\n } else if (!devtoolsNotInstalled) {\n buffer.push({ event, args });\n }\n}\nfunction setDevtoolsHook$1(hook, target) {\n var _a, _b;\n devtools$1 = hook;\n if (devtools$1) {\n devtools$1.enabled = true;\n buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));\n buffer = [];\n } else if (\n // handle late devtools injection - only do this if we are in an actual\n // browser environment to avoid the timer handle stalling test runner exit\n // (#4815)\n typeof window !== \"undefined\" && // some envs mock window but not fully\n window.HTMLElement && // also exclude jsdom\n // eslint-disable-next-line no-restricted-syntax\n !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes(\"jsdom\"))\n ) {\n const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];\n replay.push((newHook) => {\n setDevtoolsHook$1(newHook, target);\n });\n setTimeout(() => {\n if (!devtools$1) {\n target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;\n devtoolsNotInstalled = true;\n buffer = [];\n }\n }, 3e3);\n } else {\n devtoolsNotInstalled = true;\n buffer = [];\n }\n}\nfunction devtoolsInitApp(app, version) {\n emit$1(\"app:init\" /* APP_INIT */, app, version, {\n Fragment,\n Text,\n Comment,\n Static\n });\n}\nfunction devtoolsUnmountApp(app) {\n emit$1(\"app:unmount\" /* APP_UNMOUNT */, app);\n}\nconst devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(\"component:added\" /* COMPONENT_ADDED */);\nconst devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(\"component:updated\" /* COMPONENT_UPDATED */);\nconst _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(\n \"component:removed\" /* COMPONENT_REMOVED */\n);\nconst devtoolsComponentRemoved = (component) => {\n if (devtools$1 && typeof devtools$1.cleanupBuffer === \"function\" && // remove the component if it wasn't buffered\n !devtools$1.cleanupBuffer(component)) {\n _devtoolsComponentRemoved(component);\n }\n};\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction createDevtoolsComponentHook(hook) {\n return (component) => {\n emit$1(\n hook,\n component.appContext.app,\n component.uid,\n component.parent ? component.parent.uid : void 0,\n component\n );\n };\n}\nconst devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(\"perf:start\" /* PERFORMANCE_START */);\nconst devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(\"perf:end\" /* PERFORMANCE_END */);\nfunction createDevtoolsPerformanceHook(hook) {\n return (component, type, time) => {\n emit$1(hook, component.appContext.app, component.uid, component, type, time);\n };\n}\nfunction devtoolsComponentEmit(component, event, params) {\n emit$1(\n \"component:emit\" /* COMPONENT_EMIT */,\n component.appContext.app,\n component,\n event,\n params\n );\n}\n\nlet currentRenderingInstance = null;\nlet currentScopeId = null;\nfunction setCurrentRenderingInstance(instance) {\n const prev = currentRenderingInstance;\n currentRenderingInstance = instance;\n currentScopeId = instance && instance.type.__scopeId || null;\n return prev;\n}\nfunction pushScopeId(id) {\n currentScopeId = id;\n}\nfunction popScopeId() {\n currentScopeId = null;\n}\nconst withScopeId = (_id) => withCtx;\nfunction withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {\n if (!ctx) return fn;\n if (fn._n) {\n return fn;\n }\n const renderFnWithContext = (...args) => {\n if (renderFnWithContext._d) {\n setBlockTracking(-1);\n }\n const prevInstance = setCurrentRenderingInstance(ctx);\n let res;\n try {\n res = fn(...args);\n } finally {\n setCurrentRenderingInstance(prevInstance);\n if (renderFnWithContext._d) {\n setBlockTracking(1);\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentUpdated(ctx);\n }\n return res;\n };\n renderFnWithContext._n = true;\n renderFnWithContext._c = true;\n renderFnWithContext._d = true;\n return renderFnWithContext;\n}\n\nfunction validateDirectiveName(name) {\n if (isBuiltInDirective(name)) {\n warn$1(\"Do not use built-in directive ids as custom directive id: \" + name);\n }\n}\nfunction withDirectives(vnode, directives) {\n if (currentRenderingInstance === null) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(`withDirectives can only be used inside render functions.`);\n return vnode;\n }\n const instance = getComponentPublicInstance(currentRenderingInstance);\n const bindings = vnode.dirs || (vnode.dirs = []);\n for (let i = 0; i < directives.length; i++) {\n let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];\n if (dir) {\n if (isFunction(dir)) {\n dir = {\n mounted: dir,\n updated: dir\n };\n }\n if (dir.deep) {\n traverse(value);\n }\n bindings.push({\n dir,\n instance,\n value,\n oldValue: void 0,\n arg,\n modifiers\n });\n }\n }\n return vnode;\n}\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\n const bindings = vnode.dirs;\n const oldBindings = prevVNode && prevVNode.dirs;\n for (let i = 0; i < bindings.length; i++) {\n const binding = bindings[i];\n if (oldBindings) {\n binding.oldValue = oldBindings[i].value;\n }\n let hook = binding.dir[name];\n if (hook) {\n pauseTracking();\n callWithAsyncErrorHandling(hook, instance, 8, [\n vnode.el,\n binding,\n vnode,\n prevVNode\n ]);\n resetTracking();\n }\n }\n}\n\nconst TeleportEndKey = Symbol(\"_vte\");\nconst isTeleport = (type) => type.__isTeleport;\nconst isTeleportDisabled = (props) => props && (props.disabled || props.disabled === \"\");\nconst isTeleportDeferred = (props) => props && (props.defer || props.defer === \"\");\nconst isTargetSVG = (target) => typeof SVGElement !== \"undefined\" && target instanceof SVGElement;\nconst isTargetMathML = (target) => typeof MathMLElement === \"function\" && target instanceof MathMLElement;\nconst resolveTarget = (props, select) => {\n const targetSelector = props && props.to;\n if (isString(targetSelector)) {\n if (!select) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(\n `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`\n );\n return null;\n } else {\n const target = select(targetSelector);\n if (!!(process.env.NODE_ENV !== \"production\") && !target && !isTeleportDisabled(props)) {\n warn$1(\n `Failed to locate Teleport target with selector \"${targetSelector}\". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`\n );\n }\n return target;\n }\n } else {\n if (!!(process.env.NODE_ENV !== \"production\") && !targetSelector && !isTeleportDisabled(props)) {\n warn$1(`Invalid Teleport target: ${targetSelector}`);\n }\n return targetSelector;\n }\n};\nconst TeleportImpl = {\n name: \"Teleport\",\n __isTeleport: true,\n process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {\n const {\n mc: mountChildren,\n pc: patchChildren,\n pbc: patchBlockChildren,\n o: { insert, querySelector, createText, createComment }\n } = internals;\n const disabled = isTeleportDisabled(n2.props);\n let { shapeFlag, children, dynamicChildren } = n2;\n if (!!(process.env.NODE_ENV !== \"production\") && isHmrUpdating) {\n optimized = false;\n dynamicChildren = null;\n }\n if (n1 == null) {\n const placeholder = n2.el = !!(process.env.NODE_ENV !== \"production\") ? createComment(\"teleport start\") : createText(\"\");\n const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== \"production\") ? createComment(\"teleport end\") : createText(\"\");\n insert(placeholder, container, anchor);\n insert(mainAnchor, container, anchor);\n const mount = (container2, anchor2) => {\n if (shapeFlag & 16) {\n if (parentComponent && parentComponent.isCE) {\n parentComponent.ce._teleportTarget = container2;\n }\n mountChildren(\n children,\n container2,\n anchor2,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n }\n };\n const mountToTarget = () => {\n const target = n2.target = resolveTarget(n2.props, querySelector);\n const targetAnchor = prepareAnchor(target, n2, createText, insert);\n if (target) {\n if (namespace !== \"svg\" && isTargetSVG(target)) {\n namespace = \"svg\";\n } else if (namespace !== \"mathml\" && isTargetMathML(target)) {\n namespace = \"mathml\";\n }\n if (!disabled) {\n mount(target, targetAnchor);\n updateCssVars(n2, false);\n }\n } else if (!!(process.env.NODE_ENV !== \"production\") && !disabled) {\n warn$1(\n \"Invalid Teleport target on mount:\",\n target,\n `(${typeof target})`\n );\n }\n };\n if (disabled) {\n mount(container, mainAnchor);\n updateCssVars(n2, true);\n }\n if (isTeleportDeferred(n2.props)) {\n n2.el.__isMounted = false;\n queuePostRenderEffect(() => {\n mountToTarget();\n delete n2.el.__isMounted;\n }, parentSuspense);\n } else {\n mountToTarget();\n }\n } else {\n if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {\n queuePostRenderEffect(() => {\n TeleportImpl.process(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized,\n internals\n );\n }, parentSuspense);\n return;\n }\n n2.el = n1.el;\n n2.targetStart = n1.targetStart;\n const mainAnchor = n2.anchor = n1.anchor;\n const target = n2.target = n1.target;\n const targetAnchor = n2.targetAnchor = n1.targetAnchor;\n const wasDisabled = isTeleportDisabled(n1.props);\n const currentContainer = wasDisabled ? container : target;\n const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;\n if (namespace === \"svg\" || isTargetSVG(target)) {\n namespace = \"svg\";\n } else if (namespace === \"mathml\" || isTargetMathML(target)) {\n namespace = \"mathml\";\n }\n if (dynamicChildren) {\n patchBlockChildren(\n n1.dynamicChildren,\n dynamicChildren,\n currentContainer,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds\n );\n traverseStaticChildren(n1, n2, !!!(process.env.NODE_ENV !== \"production\"));\n } else if (!optimized) {\n patchChildren(\n n1,\n n2,\n currentContainer,\n currentAnchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n false\n );\n }\n if (disabled) {\n if (!wasDisabled) {\n moveTeleport(\n n2,\n container,\n mainAnchor,\n internals,\n 1\n );\n } else {\n if (n2.props && n1.props && n2.props.to !== n1.props.to) {\n n2.props.to = n1.props.to;\n }\n }\n } else {\n if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {\n const nextTarget = n2.target = resolveTarget(\n n2.props,\n querySelector\n );\n if (nextTarget) {\n moveTeleport(\n n2,\n nextTarget,\n null,\n internals,\n 0\n );\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n \"Invalid Teleport target on update:\",\n target,\n `(${typeof target})`\n );\n }\n } else if (wasDisabled) {\n moveTeleport(\n n2,\n target,\n targetAnchor,\n internals,\n 1\n );\n }\n }\n updateCssVars(n2, disabled);\n }\n },\n remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {\n const {\n shapeFlag,\n children,\n anchor,\n targetStart,\n targetAnchor,\n target,\n props\n } = vnode;\n if (target) {\n hostRemove(targetStart);\n hostRemove(targetAnchor);\n }\n doRemove && hostRemove(anchor);\n if (shapeFlag & 16) {\n const shouldRemove = doRemove || !isTeleportDisabled(props);\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n unmount(\n child,\n parentComponent,\n parentSuspense,\n shouldRemove,\n !!child.dynamicChildren\n );\n }\n }\n },\n move: moveTeleport,\n hydrate: hydrateTeleport\n};\nfunction moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {\n if (moveType === 0) {\n insert(vnode.targetAnchor, container, parentAnchor);\n }\n const { el, anchor, shapeFlag, children, props } = vnode;\n const isReorder = moveType === 2;\n if (isReorder) {\n insert(el, container, parentAnchor);\n }\n if (!isReorder || isTeleportDisabled(props)) {\n if (shapeFlag & 16) {\n for (let i = 0; i < children.length; i++) {\n move(\n children[i],\n container,\n parentAnchor,\n 2\n );\n }\n }\n }\n if (isReorder) {\n insert(anchor, container, parentAnchor);\n }\n}\nfunction hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {\n o: { nextSibling, parentNode, querySelector, insert, createText }\n}, hydrateChildren) {\n const target = vnode.target = resolveTarget(\n vnode.props,\n querySelector\n );\n if (target) {\n const disabled = isTeleportDisabled(vnode.props);\n const targetNode = target._lpa || target.firstChild;\n if (vnode.shapeFlag & 16) {\n if (disabled) {\n vnode.anchor = hydrateChildren(\n nextSibling(node),\n vnode,\n parentNode(node),\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n vnode.targetStart = targetNode;\n vnode.targetAnchor = targetNode && nextSibling(targetNode);\n } else {\n vnode.anchor = nextSibling(node);\n let targetAnchor = targetNode;\n while (targetAnchor) {\n if (targetAnchor && targetAnchor.nodeType === 8) {\n if (targetAnchor.data === \"teleport start anchor\") {\n vnode.targetStart = targetAnchor;\n } else if (targetAnchor.data === \"teleport anchor\") {\n vnode.targetAnchor = targetAnchor;\n target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);\n break;\n }\n }\n targetAnchor = nextSibling(targetAnchor);\n }\n if (!vnode.targetAnchor) {\n prepareAnchor(target, vnode, createText, insert);\n }\n hydrateChildren(\n targetNode && nextSibling(targetNode),\n vnode,\n target,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n }\n }\n updateCssVars(vnode, disabled);\n }\n return vnode.anchor && nextSibling(vnode.anchor);\n}\nconst Teleport = TeleportImpl;\nfunction updateCssVars(vnode, isDisabled) {\n const ctx = vnode.ctx;\n if (ctx && ctx.ut) {\n let node, anchor;\n if (isDisabled) {\n node = vnode.el;\n anchor = vnode.anchor;\n } else {\n node = vnode.targetStart;\n anchor = vnode.targetAnchor;\n }\n while (node && node !== anchor) {\n if (node.nodeType === 1) node.setAttribute(\"data-v-owner\", ctx.uid);\n node = node.nextSibling;\n }\n ctx.ut();\n }\n}\nfunction prepareAnchor(target, vnode, createText, insert) {\n const targetStart = vnode.targetStart = createText(\"\");\n const targetAnchor = vnode.targetAnchor = createText(\"\");\n targetStart[TeleportEndKey] = targetAnchor;\n if (target) {\n insert(targetStart, target);\n insert(targetAnchor, target);\n }\n return targetAnchor;\n}\n\nconst leaveCbKey = Symbol(\"_leaveCb\");\nconst enterCbKey = Symbol(\"_enterCb\");\nfunction useTransitionState() {\n const state = {\n isMounted: false,\n isLeaving: false,\n isUnmounting: false,\n leavingVNodes: /* @__PURE__ */ new Map()\n };\n onMounted(() => {\n state.isMounted = true;\n });\n onBeforeUnmount(() => {\n state.isUnmounting = true;\n });\n return state;\n}\nconst TransitionHookValidator = [Function, Array];\nconst BaseTransitionPropsValidators = {\n mode: String,\n appear: Boolean,\n persisted: Boolean,\n // enter\n onBeforeEnter: TransitionHookValidator,\n onEnter: TransitionHookValidator,\n onAfterEnter: TransitionHookValidator,\n onEnterCancelled: TransitionHookValidator,\n // leave\n onBeforeLeave: TransitionHookValidator,\n onLeave: TransitionHookValidator,\n onAfterLeave: TransitionHookValidator,\n onLeaveCancelled: TransitionHookValidator,\n // appear\n onBeforeAppear: TransitionHookValidator,\n onAppear: TransitionHookValidator,\n onAfterAppear: TransitionHookValidator,\n onAppearCancelled: TransitionHookValidator\n};\nconst recursiveGetSubtree = (instance) => {\n const subTree = instance.subTree;\n return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;\n};\nconst BaseTransitionImpl = {\n name: `BaseTransition`,\n props: BaseTransitionPropsValidators,\n setup(props, { slots }) {\n const instance = getCurrentInstance();\n const state = useTransitionState();\n return () => {\n const children = slots.default && getTransitionRawChildren(slots.default(), true);\n if (!children || !children.length) {\n return;\n }\n const child = findNonCommentChild(children);\n const rawProps = toRaw(props);\n const { mode } = rawProps;\n if (!!(process.env.NODE_ENV !== \"production\") && mode && mode !== \"in-out\" && mode !== \"out-in\" && mode !== \"default\") {\n warn$1(`invalid <transition> mode: ${mode}`);\n }\n if (state.isLeaving) {\n return emptyPlaceholder(child);\n }\n const innerChild = getInnerChild$1(child);\n if (!innerChild) {\n return emptyPlaceholder(child);\n }\n let enterHooks = resolveTransitionHooks(\n innerChild,\n rawProps,\n state,\n instance,\n // #11061, ensure enterHooks is fresh after clone\n (hooks) => enterHooks = hooks\n );\n if (innerChild.type !== Comment) {\n setTransitionHooks(innerChild, enterHooks);\n }\n let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);\n if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {\n let leavingHooks = resolveTransitionHooks(\n oldInnerChild,\n rawProps,\n state,\n instance\n );\n setTransitionHooks(oldInnerChild, leavingHooks);\n if (mode === \"out-in\" && innerChild.type !== Comment) {\n state.isLeaving = true;\n leavingHooks.afterLeave = () => {\n state.isLeaving = false;\n if (!(instance.job.flags & 8)) {\n instance.update();\n }\n delete leavingHooks.afterLeave;\n oldInnerChild = void 0;\n };\n return emptyPlaceholder(child);\n } else if (mode === \"in-out\" && innerChild.type !== Comment) {\n leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {\n const leavingVNodesCache = getLeavingNodesForType(\n state,\n oldInnerChild\n );\n leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;\n el[leaveCbKey] = () => {\n earlyRemove();\n el[leaveCbKey] = void 0;\n delete enterHooks.delayedLeave;\n oldInnerChild = void 0;\n };\n enterHooks.delayedLeave = () => {\n delayedLeave();\n delete enterHooks.delayedLeave;\n oldInnerChild = void 0;\n };\n };\n } else {\n oldInnerChild = void 0;\n }\n } else if (oldInnerChild) {\n oldInnerChild = void 0;\n }\n return child;\n };\n }\n};\nfunction findNonCommentChild(children) {\n let child = children[0];\n if (children.length > 1) {\n let hasFound = false;\n for (const c of children) {\n if (c.type !== Comment) {\n if (!!(process.env.NODE_ENV !== \"production\") && hasFound) {\n warn$1(\n \"<transition> can only be used on a single element or component. Use <transition-group> for lists.\"\n );\n break;\n }\n child = c;\n hasFound = true;\n if (!!!(process.env.NODE_ENV !== \"production\")) break;\n }\n }\n }\n return child;\n}\nconst BaseTransition = BaseTransitionImpl;\nfunction getLeavingNodesForType(state, vnode) {\n const { leavingVNodes } = state;\n let leavingVNodesCache = leavingVNodes.get(vnode.type);\n if (!leavingVNodesCache) {\n leavingVNodesCache = /* @__PURE__ */ Object.create(null);\n leavingVNodes.set(vnode.type, leavingVNodesCache);\n }\n return leavingVNodesCache;\n}\nfunction resolveTransitionHooks(vnode, props, state, instance, postClone) {\n const {\n appear,\n mode,\n persisted = false,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n onBeforeAppear,\n onAppear,\n onAfterAppear,\n onAppearCancelled\n } = props;\n const key = String(vnode.key);\n const leavingVNodesCache = getLeavingNodesForType(state, vnode);\n const callHook = (hook, args) => {\n hook && callWithAsyncErrorHandling(\n hook,\n instance,\n 9,\n args\n );\n };\n const callAsyncHook = (hook, args) => {\n const done = args[1];\n callHook(hook, args);\n if (isArray(hook)) {\n if (hook.every((hook2) => hook2.length <= 1)) done();\n } else if (hook.length <= 1) {\n done();\n }\n };\n const hooks = {\n mode,\n persisted,\n beforeEnter(el) {\n let hook = onBeforeEnter;\n if (!state.isMounted) {\n if (appear) {\n hook = onBeforeAppear || onBeforeEnter;\n } else {\n return;\n }\n }\n if (el[leaveCbKey]) {\n el[leaveCbKey](\n true\n /* cancelled */\n );\n }\n const leavingVNode = leavingVNodesCache[key];\n if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {\n leavingVNode.el[leaveCbKey]();\n }\n callHook(hook, [el]);\n },\n enter(el) {\n let hook = onEnter;\n let afterHook = onAfterEnter;\n let cancelHook = onEnterCancelled;\n if (!state.isMounted) {\n if (appear) {\n hook = onAppear || onEnter;\n afterHook = onAfterAppear || onAfterEnter;\n cancelHook = onAppearCancelled || onEnterCancelled;\n } else {\n return;\n }\n }\n let called = false;\n const done = el[enterCbKey] = (cancelled) => {\n if (called) return;\n called = true;\n if (cancelled) {\n callHook(cancelHook, [el]);\n } else {\n callHook(afterHook, [el]);\n }\n if (hooks.delayedLeave) {\n hooks.delayedLeave();\n }\n el[enterCbKey] = void 0;\n };\n if (hook) {\n callAsyncHook(hook, [el, done]);\n } else {\n done();\n }\n },\n leave(el, remove) {\n const key2 = String(vnode.key);\n if (el[enterCbKey]) {\n el[enterCbKey](\n true\n /* cancelled */\n );\n }\n if (state.isUnmounting) {\n return remove();\n }\n callHook(onBeforeLeave, [el]);\n let called = false;\n const done = el[leaveCbKey] = (cancelled) => {\n if (called) return;\n called = true;\n remove();\n if (cancelled) {\n callHook(onLeaveCancelled, [el]);\n } else {\n callHook(onAfterLeave, [el]);\n }\n el[leaveCbKey] = void 0;\n if (leavingVNodesCache[key2] === vnode) {\n delete leavingVNodesCache[key2];\n }\n };\n leavingVNodesCache[key2] = vnode;\n if (onLeave) {\n callAsyncHook(onLeave, [el, done]);\n } else {\n done();\n }\n },\n clone(vnode2) {\n const hooks2 = resolveTransitionHooks(\n vnode2,\n props,\n state,\n instance,\n postClone\n );\n if (postClone) postClone(hooks2);\n return hooks2;\n }\n };\n return hooks;\n}\nfunction emptyPlaceholder(vnode) {\n if (isKeepAlive(vnode)) {\n vnode = cloneVNode(vnode);\n vnode.children = null;\n return vnode;\n }\n}\nfunction getInnerChild$1(vnode) {\n if (!isKeepAlive(vnode)) {\n if (isTeleport(vnode.type) && vnode.children) {\n return findNonCommentChild(vnode.children);\n }\n return vnode;\n }\n if (vnode.component) {\n return vnode.component.subTree;\n }\n const { shapeFlag, children } = vnode;\n if (children) {\n if (shapeFlag & 16) {\n return children[0];\n }\n if (shapeFlag & 32 && isFunction(children.default)) {\n return children.default();\n }\n }\n}\nfunction setTransitionHooks(vnode, hooks) {\n if (vnode.shapeFlag & 6 && vnode.component) {\n vnode.transition = hooks;\n setTransitionHooks(vnode.component.subTree, hooks);\n } else if (vnode.shapeFlag & 128) {\n vnode.ssContent.transition = hooks.clone(vnode.ssContent);\n vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);\n } else {\n vnode.transition = hooks;\n }\n}\nfunction getTransitionRawChildren(children, keepComment = false, parentKey) {\n let ret = [];\n let keyedFragmentCount = 0;\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);\n if (child.type === Fragment) {\n if (child.patchFlag & 128) keyedFragmentCount++;\n ret = ret.concat(\n getTransitionRawChildren(child.children, keepComment, key)\n );\n } else if (keepComment || child.type !== Comment) {\n ret.push(key != null ? cloneVNode(child, { key }) : child);\n }\n }\n if (keyedFragmentCount > 1) {\n for (let i = 0; i < ret.length; i++) {\n ret[i].patchFlag = -2;\n }\n }\n return ret;\n}\n\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction defineComponent(options, extraOptions) {\n return isFunction(options) ? (\n // #8236: extend call and options.name access are considered side-effects\n // by Rollup, so we have to wrap it in a pure-annotated IIFE.\n /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()\n ) : options;\n}\n\nfunction useId() {\n const i = getCurrentInstance();\n if (i) {\n return (i.appContext.config.idPrefix || \"v\") + \"-\" + i.ids[0] + i.ids[1]++;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `useId() is called when there is no active component instance to be associated with.`\n );\n }\n return \"\";\n}\nfunction markAsyncBoundary(instance) {\n instance.ids = [instance.ids[0] + instance.ids[2]++ + \"-\", 0, 0];\n}\n\nconst knownTemplateRefs = /* @__PURE__ */ new WeakSet();\nfunction useTemplateRef(key) {\n const i = getCurrentInstance();\n const r = shallowRef(null);\n if (i) {\n const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;\n let desc;\n if (!!(process.env.NODE_ENV !== \"production\") && (desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {\n warn$1(`useTemplateRef('${key}') already exists.`);\n } else {\n Object.defineProperty(refs, key, {\n enumerable: true,\n get: () => r.value,\n set: (val) => r.value = val\n });\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `useTemplateRef() is called when there is no active component instance to be associated with.`\n );\n }\n const ret = !!(process.env.NODE_ENV !== \"production\") ? readonly(r) : r;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n knownTemplateRefs.add(ret);\n }\n return ret;\n}\n\nfunction setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {\n if (isArray(rawRef)) {\n rawRef.forEach(\n (r, i) => setRef(\n r,\n oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),\n parentSuspense,\n vnode,\n isUnmount\n )\n );\n return;\n }\n if (isAsyncWrapper(vnode) && !isUnmount) {\n if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {\n setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);\n }\n return;\n }\n const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;\n const value = isUnmount ? null : refValue;\n const { i: owner, r: ref } = rawRef;\n if (!!(process.env.NODE_ENV !== \"production\") && !owner) {\n warn$1(\n `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`\n );\n return;\n }\n const oldRef = oldRawRef && oldRawRef.r;\n const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;\n const setupState = owner.setupState;\n const rawSetupState = toRaw(setupState);\n const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {\n warn$1(\n `Template ref \"${key}\" used on a non-ref value. It will not work in the production build.`\n );\n }\n if (knownTemplateRefs.has(rawSetupState[key])) {\n return false;\n }\n }\n return hasOwn(rawSetupState, key);\n };\n if (oldRef != null && oldRef !== ref) {\n if (isString(oldRef)) {\n refs[oldRef] = null;\n if (canSetSetupRef(oldRef)) {\n setupState[oldRef] = null;\n }\n } else if (isRef(oldRef)) {\n oldRef.value = null;\n }\n }\n if (isFunction(ref)) {\n callWithErrorHandling(ref, owner, 12, [value, refs]);\n } else {\n const _isString = isString(ref);\n const _isRef = isRef(ref);\n if (_isString || _isRef) {\n const doSet = () => {\n if (rawRef.f) {\n const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;\n if (isUnmount) {\n isArray(existing) && remove(existing, refValue);\n } else {\n if (!isArray(existing)) {\n if (_isString) {\n refs[ref] = [refValue];\n if (canSetSetupRef(ref)) {\n setupState[ref] = refs[ref];\n }\n } else {\n ref.value = [refValue];\n if (rawRef.k) refs[rawRef.k] = ref.value;\n }\n } else if (!existing.includes(refValue)) {\n existing.push(refValue);\n }\n }\n } else if (_isString) {\n refs[ref] = value;\n if (canSetSetupRef(ref)) {\n setupState[ref] = value;\n }\n } else if (_isRef) {\n ref.value = value;\n if (rawRef.k) refs[rawRef.k] = value;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\"Invalid template ref type:\", ref, `(${typeof ref})`);\n }\n };\n if (value) {\n doSet.id = -1;\n queuePostRenderEffect(doSet, parentSuspense);\n } else {\n doSet();\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\"Invalid template ref type:\", ref, `(${typeof ref})`);\n }\n }\n}\n\nlet hasLoggedMismatchError = false;\nconst logMismatchError = () => {\n if (hasLoggedMismatchError) {\n return;\n }\n console.error(\"Hydration completed but contains mismatches.\");\n hasLoggedMismatchError = true;\n};\nconst isSVGContainer = (container) => container.namespaceURI.includes(\"svg\") && container.tagName !== \"foreignObject\";\nconst isMathMLContainer = (container) => container.namespaceURI.includes(\"MathML\");\nconst getContainerType = (container) => {\n if (container.nodeType !== 1) return void 0;\n if (isSVGContainer(container)) return \"svg\";\n if (isMathMLContainer(container)) return \"mathml\";\n return void 0;\n};\nconst isComment = (node) => node.nodeType === 8;\nfunction createHydrationFunctions(rendererInternals) {\n const {\n mt: mountComponent,\n p: patch,\n o: {\n patchProp,\n createText,\n nextSibling,\n parentNode,\n remove,\n insert,\n createComment\n }\n } = rendererInternals;\n const hydrate = (vnode, container) => {\n if (!container.hasChildNodes()) {\n (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(\n `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`\n );\n patch(null, vnode, container);\n flushPostFlushCbs();\n container._vnode = vnode;\n return;\n }\n hydrateNode(container.firstChild, vnode, null, null, null);\n flushPostFlushCbs();\n container._vnode = vnode;\n };\n const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {\n optimized = optimized || !!vnode.dynamicChildren;\n const isFragmentStart = isComment(node) && node.data === \"[\";\n const onMismatch = () => handleMismatch(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n isFragmentStart\n );\n const { type, ref, shapeFlag, patchFlag } = vnode;\n let domType = node.nodeType;\n vnode.el = node;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n def(node, \"__vnode\", vnode, true);\n def(node, \"__vueParentComponent\", parentComponent, true);\n }\n if (patchFlag === -2) {\n optimized = false;\n vnode.dynamicChildren = null;\n }\n let nextNode = null;\n switch (type) {\n case Text:\n if (domType !== 3) {\n if (vnode.children === \"\") {\n insert(vnode.el = createText(\"\"), parentNode(node), node);\n nextNode = node;\n } else {\n nextNode = onMismatch();\n }\n } else {\n if (node.data !== vnode.children) {\n (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(\n `Hydration text mismatch in`,\n node.parentNode,\n `\n - rendered on server: ${JSON.stringify(\n node.data\n )}\n - expected on client: ${JSON.stringify(vnode.children)}`\n );\n logMismatchError();\n node.data = vnode.children;\n }\n nextNode = nextSibling(node);\n }\n break;\n case Comment:\n if (isTemplateNode(node)) {\n nextNode = nextSibling(node);\n replaceNode(\n vnode.el = node.content.firstChild,\n node,\n parentComponent\n );\n } else if (domType !== 8 || isFragmentStart) {\n nextNode = onMismatch();\n } else {\n nextNode = nextSibling(node);\n }\n break;\n case Static:\n if (isFragmentStart) {\n node = nextSibling(node);\n domType = node.nodeType;\n }\n if (domType === 1 || domType === 3) {\n nextNode = node;\n const needToAdoptContent = !vnode.children.length;\n for (let i = 0; i < vnode.staticCount; i++) {\n if (needToAdoptContent)\n vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;\n if (i === vnode.staticCount - 1) {\n vnode.anchor = nextNode;\n }\n nextNode = nextSibling(nextNode);\n }\n return isFragmentStart ? nextSibling(nextNode) : nextNode;\n } else {\n onMismatch();\n }\n break;\n case Fragment:\n if (!isFragmentStart) {\n nextNode = onMismatch();\n } else {\n nextNode = hydrateFragment(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n }\n break;\n default:\n if (shapeFlag & 1) {\n if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {\n nextNode = onMismatch();\n } else {\n nextNode = hydrateElement(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n }\n } else if (shapeFlag & 6) {\n vnode.slotScopeIds = slotScopeIds;\n const container = parentNode(node);\n if (isFragmentStart) {\n nextNode = locateClosingAnchor(node);\n } else if (isComment(node) && node.data === \"teleport start\") {\n nextNode = locateClosingAnchor(node, node.data, \"teleport end\");\n } else {\n nextNode = nextSibling(node);\n }\n mountComponent(\n vnode,\n container,\n null,\n parentComponent,\n parentSuspense,\n getContainerType(container),\n optimized\n );\n if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {\n let subTree;\n if (isFragmentStart) {\n subTree = createVNode(Fragment);\n subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;\n } else {\n subTree = node.nodeType === 3 ? createTextVNode(\"\") : createVNode(\"div\");\n }\n subTree.el = node;\n vnode.component.subTree = subTree;\n }\n } else if (shapeFlag & 64) {\n if (domType !== 8) {\n nextNode = onMismatch();\n } else {\n nextNode = vnode.type.hydrate(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized,\n rendererInternals,\n hydrateChildren\n );\n }\n } else if (shapeFlag & 128) {\n nextNode = vnode.type.hydrate(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n getContainerType(parentNode(node)),\n slotScopeIds,\n optimized,\n rendererInternals,\n hydrateNode\n );\n } else if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {\n warn$1(\"Invalid HostVNode type:\", type, `(${typeof type})`);\n }\n }\n if (ref != null) {\n setRef(ref, null, parentSuspense, vnode);\n }\n return nextNode;\n };\n const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n optimized = optimized || !!vnode.dynamicChildren;\n const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;\n const forcePatch = type === \"input\" || type === \"option\";\n if (!!(process.env.NODE_ENV !== \"production\") || forcePatch || patchFlag !== -1) {\n if (dirs) {\n invokeDirectiveHook(vnode, null, parentComponent, \"created\");\n }\n let needCallTransitionHooks = false;\n if (isTemplateNode(el)) {\n needCallTransitionHooks = needTransition(\n null,\n // no need check parentSuspense in hydration\n transition\n ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;\n const content = el.content.firstChild;\n if (needCallTransitionHooks) {\n const cls = content.getAttribute(\"class\");\n if (cls) content.$cls = cls;\n transition.beforeEnter(content);\n }\n replaceNode(content, el, parentComponent);\n vnode.el = el = content;\n }\n if (shapeFlag & 16 && // skip if element has innerHTML / textContent\n !(props && (props.innerHTML || props.textContent))) {\n let next = hydrateChildren(\n el.firstChild,\n vnode,\n el,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n let hasWarned = false;\n while (next) {\n if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {\n if ((!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {\n warn$1(\n `Hydration children mismatch on`,\n el,\n `\nServer rendered element contains more child nodes than client vdom.`\n );\n hasWarned = true;\n }\n logMismatchError();\n }\n const cur = next;\n next = next.nextSibling;\n remove(cur);\n }\n } else if (shapeFlag & 8) {\n let clientText = vnode.children;\n if (clientText[0] === \"\\n\" && (el.tagName === \"PRE\" || el.tagName === \"TEXTAREA\")) {\n clientText = clientText.slice(1);\n }\n if (el.textContent !== clientText) {\n if (!isMismatchAllowed(el, 0 /* TEXT */)) {\n (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(\n `Hydration text content mismatch on`,\n el,\n `\n - rendered on server: ${el.textContent}\n - expected on client: ${vnode.children}`\n );\n logMismatchError();\n }\n el.textContent = vnode.children;\n }\n }\n if (props) {\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {\n const isCustomElement = el.tagName.includes(\"-\");\n for (const key in props) {\n if ((!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks\n // as it could have mutated the DOM in any possible way\n !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {\n logMismatchError();\n }\n if (forcePatch && (key.endsWith(\"value\") || key === \"indeterminate\") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers\n key[0] === \".\" || isCustomElement) {\n patchProp(el, key, null, props[key], void 0, parentComponent);\n }\n }\n } else if (props.onClick) {\n patchProp(\n el,\n \"onClick\",\n null,\n props.onClick,\n void 0,\n parentComponent\n );\n } else if (patchFlag & 4 && isReactive(props.style)) {\n for (const key in props.style) props.style[key];\n }\n }\n let vnodeHooks;\n if (vnodeHooks = props && props.onVnodeBeforeMount) {\n invokeVNodeHook(vnodeHooks, parentComponent, vnode);\n }\n if (dirs) {\n invokeDirectiveHook(vnode, null, parentComponent, \"beforeMount\");\n }\n if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {\n queueEffectWithSuspense(() => {\n vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);\n needCallTransitionHooks && transition.enter(el);\n dirs && invokeDirectiveHook(vnode, null, parentComponent, \"mounted\");\n }, parentSuspense);\n }\n }\n return el.nextSibling;\n };\n const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n optimized = optimized || !!parentVNode.dynamicChildren;\n const children = parentVNode.children;\n const l = children.length;\n let hasWarned = false;\n for (let i = 0; i < l; i++) {\n const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);\n const isText = vnode.type === Text;\n if (node) {\n if (isText && !optimized) {\n if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {\n insert(\n createText(\n node.data.slice(vnode.children.length)\n ),\n container,\n nextSibling(node)\n );\n node.data = vnode.children;\n }\n }\n node = hydrateNode(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n } else if (isText && !vnode.children) {\n insert(vnode.el = createText(\"\"), container);\n } else {\n if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {\n if ((!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {\n warn$1(\n `Hydration children mismatch on`,\n container,\n `\nServer rendered element contains fewer child nodes than client vdom.`\n );\n hasWarned = true;\n }\n logMismatchError();\n }\n patch(\n null,\n vnode,\n container,\n null,\n parentComponent,\n parentSuspense,\n getContainerType(container),\n slotScopeIds\n );\n }\n }\n return node;\n };\n const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n const { slotScopeIds: fragmentSlotScopeIds } = vnode;\n if (fragmentSlotScopeIds) {\n slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;\n }\n const container = parentNode(node);\n const next = hydrateChildren(\n nextSibling(node),\n vnode,\n container,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n if (next && isComment(next) && next.data === \"]\") {\n return nextSibling(vnode.anchor = next);\n } else {\n logMismatchError();\n insert(vnode.anchor = createComment(`]`), container, next);\n return next;\n }\n };\n const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {\n if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {\n (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(\n `Hydration node mismatch:\n- rendered on server:`,\n node,\n node.nodeType === 3 ? `(text)` : isComment(node) && node.data === \"[\" ? `(start of fragment)` : ``,\n `\n- expected on client:`,\n vnode.type\n );\n logMismatchError();\n }\n vnode.el = null;\n if (isFragment) {\n const end = locateClosingAnchor(node);\n while (true) {\n const next2 = nextSibling(node);\n if (next2 && next2 !== end) {\n remove(next2);\n } else {\n break;\n }\n }\n }\n const next = nextSibling(node);\n const container = parentNode(node);\n remove(node);\n patch(\n null,\n vnode,\n container,\n next,\n parentComponent,\n parentSuspense,\n getContainerType(container),\n slotScopeIds\n );\n if (parentComponent) {\n parentComponent.vnode.el = vnode.el;\n updateHOCHostEl(parentComponent, vnode.el);\n }\n return next;\n };\n const locateClosingAnchor = (node, open = \"[\", close = \"]\") => {\n let match = 0;\n while (node) {\n node = nextSibling(node);\n if (node && isComment(node)) {\n if (node.data === open) match++;\n if (node.data === close) {\n if (match === 0) {\n return nextSibling(node);\n } else {\n match--;\n }\n }\n }\n }\n return node;\n };\n const replaceNode = (newNode, oldNode, parentComponent) => {\n const parentNode2 = oldNode.parentNode;\n if (parentNode2) {\n parentNode2.replaceChild(newNode, oldNode);\n }\n let parent = parentComponent;\n while (parent) {\n if (parent.vnode.el === oldNode) {\n parent.vnode.el = parent.subTree.el = newNode;\n }\n parent = parent.parent;\n }\n };\n const isTemplateNode = (node) => {\n return node.nodeType === 1 && node.tagName === \"TEMPLATE\";\n };\n return [hydrate, hydrateNode];\n}\nfunction propHasMismatch(el, key, clientValue, vnode, instance) {\n let mismatchType;\n let mismatchKey;\n let actual;\n let expected;\n if (key === \"class\") {\n if (el.$cls) {\n actual = el.$cls;\n delete el.$cls;\n } else {\n actual = el.getAttribute(\"class\");\n }\n expected = normalizeClass(clientValue);\n if (!isSetEqual(toClassSet(actual || \"\"), toClassSet(expected))) {\n mismatchType = 2 /* CLASS */;\n mismatchKey = `class`;\n }\n } else if (key === \"style\") {\n actual = el.getAttribute(\"style\") || \"\";\n expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));\n const actualMap = toStyleMap(actual);\n const expectedMap = toStyleMap(expected);\n if (vnode.dirs) {\n for (const { dir, value } of vnode.dirs) {\n if (dir.name === \"show\" && !value) {\n expectedMap.set(\"display\", \"none\");\n }\n }\n }\n if (instance) {\n resolveCssVars(instance, vnode, expectedMap);\n }\n if (!isMapEqual(actualMap, expectedMap)) {\n mismatchType = 3 /* STYLE */;\n mismatchKey = \"style\";\n }\n } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {\n if (isBooleanAttr(key)) {\n actual = el.hasAttribute(key);\n expected = includeBooleanAttr(clientValue);\n } else if (clientValue == null) {\n actual = el.hasAttribute(key);\n expected = false;\n } else {\n if (el.hasAttribute(key)) {\n actual = el.getAttribute(key);\n } else if (key === \"value\" && el.tagName === \"TEXTAREA\") {\n actual = el.value;\n } else {\n actual = false;\n }\n expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;\n }\n if (actual !== expected) {\n mismatchType = 4 /* ATTRIBUTE */;\n mismatchKey = key;\n }\n }\n if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {\n const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}=\"${v}\"`;\n const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;\n const postSegment = `\n - rendered on server: ${format(actual)}\n - expected on client: ${format(expected)}\n Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.\n You should fix the source of the mismatch.`;\n {\n warn$1(preSegment, el, postSegment);\n }\n return true;\n }\n return false;\n}\nfunction toClassSet(str) {\n return new Set(str.trim().split(/\\s+/));\n}\nfunction isSetEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const s of a) {\n if (!b.has(s)) {\n return false;\n }\n }\n return true;\n}\nfunction toStyleMap(str) {\n const styleMap = /* @__PURE__ */ new Map();\n for (const item of str.split(\";\")) {\n let [key, value] = item.split(\":\");\n key = key.trim();\n value = value && value.trim();\n if (key && value) {\n styleMap.set(key, value);\n }\n }\n return styleMap;\n}\nfunction isMapEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const [key, value] of a) {\n if (value !== b.get(key)) {\n return false;\n }\n }\n return true;\n}\nfunction resolveCssVars(instance, vnode, expectedMap) {\n const root = instance.subTree;\n if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {\n const cssVars = instance.getCssVars();\n for (const key in cssVars) {\n const value = normalizeCssVarValue(cssVars[key]);\n expectedMap.set(`--${getEscapedCssVarName(key, false)}`, value);\n }\n }\n if (vnode === root && instance.parent) {\n resolveCssVars(instance.parent, instance.vnode, expectedMap);\n }\n}\nconst allowMismatchAttr = \"data-allow-mismatch\";\nconst MismatchTypeString = {\n [0 /* TEXT */]: \"text\",\n [1 /* CHILDREN */]: \"children\",\n [2 /* CLASS */]: \"class\",\n [3 /* STYLE */]: \"style\",\n [4 /* ATTRIBUTE */]: \"attribute\"\n};\nfunction isMismatchAllowed(el, allowedType) {\n if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {\n while (el && !el.hasAttribute(allowMismatchAttr)) {\n el = el.parentElement;\n }\n }\n const allowedAttr = el && el.getAttribute(allowMismatchAttr);\n if (allowedAttr == null) {\n return false;\n } else if (allowedAttr === \"\") {\n return true;\n } else {\n const list = allowedAttr.split(\",\");\n if (allowedType === 0 /* TEXT */ && list.includes(\"children\")) {\n return true;\n }\n return list.includes(MismatchTypeString[allowedType]);\n }\n}\n\nconst requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));\nconst cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));\nconst hydrateOnIdle = (timeout = 1e4) => (hydrate) => {\n const id = requestIdleCallback(hydrate, { timeout });\n return () => cancelIdleCallback(id);\n};\nfunction elementIsVisibleInViewport(el) {\n const { top, left, bottom, right } = el.getBoundingClientRect();\n const { innerHeight, innerWidth } = window;\n return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);\n}\nconst hydrateOnVisible = (opts) => (hydrate, forEach) => {\n const ob = new IntersectionObserver((entries) => {\n for (const e of entries) {\n if (!e.isIntersecting) continue;\n ob.disconnect();\n hydrate();\n break;\n }\n }, opts);\n forEach((el) => {\n if (!(el instanceof Element)) return;\n if (elementIsVisibleInViewport(el)) {\n hydrate();\n ob.disconnect();\n return false;\n }\n ob.observe(el);\n });\n return () => ob.disconnect();\n};\nconst hydrateOnMediaQuery = (query) => (hydrate) => {\n if (query) {\n const mql = matchMedia(query);\n if (mql.matches) {\n hydrate();\n } else {\n mql.addEventListener(\"change\", hydrate, { once: true });\n return () => mql.removeEventListener(\"change\", hydrate);\n }\n }\n};\nconst hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {\n if (isString(interactions)) interactions = [interactions];\n let hasHydrated = false;\n const doHydrate = (e) => {\n if (!hasHydrated) {\n hasHydrated = true;\n teardown();\n hydrate();\n e.target.dispatchEvent(new e.constructor(e.type, e));\n }\n };\n const teardown = () => {\n forEach((el) => {\n for (const i of interactions) {\n el.removeEventListener(i, doHydrate);\n }\n });\n };\n forEach((el) => {\n for (const i of interactions) {\n el.addEventListener(i, doHydrate, { once: true });\n }\n });\n return teardown;\n};\nfunction forEachElement(node, cb) {\n if (isComment(node) && node.data === \"[\") {\n let depth = 1;\n let next = node.nextSibling;\n while (next) {\n if (next.nodeType === 1) {\n const result = cb(next);\n if (result === false) {\n break;\n }\n } else if (isComment(next)) {\n if (next.data === \"]\") {\n if (--depth === 0) break;\n } else if (next.data === \"[\") {\n depth++;\n }\n }\n next = next.nextSibling;\n }\n } else {\n cb(node);\n }\n}\n\nconst isAsyncWrapper = (i) => !!i.type.__asyncLoader;\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction defineAsyncComponent(source) {\n if (isFunction(source)) {\n source = { loader: source };\n }\n const {\n loader,\n loadingComponent,\n errorComponent,\n delay = 200,\n hydrate: hydrateStrategy,\n timeout,\n // undefined = never times out\n suspensible = true,\n onError: userOnError\n } = source;\n let pendingRequest = null;\n let resolvedComp;\n let retries = 0;\n const retry = () => {\n retries++;\n pendingRequest = null;\n return load();\n };\n const load = () => {\n let thisRequest;\n return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {\n err = err instanceof Error ? err : new Error(String(err));\n if (userOnError) {\n return new Promise((resolve, reject) => {\n const userRetry = () => resolve(retry());\n const userFail = () => reject(err);\n userOnError(err, userRetry, userFail, retries + 1);\n });\n } else {\n throw err;\n }\n }).then((comp) => {\n if (thisRequest !== pendingRequest && pendingRequest) {\n return pendingRequest;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && !comp) {\n warn$1(\n `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`\n );\n }\n if (comp && (comp.__esModule || comp[Symbol.toStringTag] === \"Module\")) {\n comp = comp.default;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && comp && !isObject(comp) && !isFunction(comp)) {\n throw new Error(`Invalid async component load result: ${comp}`);\n }\n resolvedComp = comp;\n return comp;\n }));\n };\n return defineComponent({\n name: \"AsyncComponentWrapper\",\n __asyncLoader: load,\n __asyncHydrate(el, instance, hydrate) {\n let patched = false;\n (instance.bu || (instance.bu = [])).push(() => patched = true);\n const performHydrate = () => {\n if (patched) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`\n );\n }\n return;\n }\n hydrate();\n };\n const doHydrate = hydrateStrategy ? () => {\n const teardown = hydrateStrategy(\n performHydrate,\n (cb) => forEachElement(el, cb)\n );\n if (teardown) {\n (instance.bum || (instance.bum = [])).push(teardown);\n }\n } : performHydrate;\n if (resolvedComp) {\n doHydrate();\n } else {\n load().then(() => !instance.isUnmounted && doHydrate());\n }\n },\n get __asyncResolved() {\n return resolvedComp;\n },\n setup() {\n const instance = currentInstance;\n markAsyncBoundary(instance);\n if (resolvedComp) {\n return () => createInnerComp(resolvedComp, instance);\n }\n const onError = (err) => {\n pendingRequest = null;\n handleError(\n err,\n instance,\n 13,\n !errorComponent\n );\n };\n if (suspensible && instance.suspense || isInSSRComponentSetup) {\n return load().then((comp) => {\n return () => createInnerComp(comp, instance);\n }).catch((err) => {\n onError(err);\n return () => errorComponent ? createVNode(errorComponent, {\n error: err\n }) : null;\n });\n }\n const loaded = ref(false);\n const error = ref();\n const delayed = ref(!!delay);\n if (delay) {\n setTimeout(() => {\n delayed.value = false;\n }, delay);\n }\n if (timeout != null) {\n setTimeout(() => {\n if (!loaded.value && !error.value) {\n const err = new Error(\n `Async component timed out after ${timeout}ms.`\n );\n onError(err);\n error.value = err;\n }\n }, timeout);\n }\n load().then(() => {\n loaded.value = true;\n if (instance.parent && isKeepAlive(instance.parent.vnode)) {\n instance.parent.update();\n }\n }).catch((err) => {\n onError(err);\n error.value = err;\n });\n return () => {\n if (loaded.value && resolvedComp) {\n return createInnerComp(resolvedComp, instance);\n } else if (error.value && errorComponent) {\n return createVNode(errorComponent, {\n error: error.value\n });\n } else if (loadingComponent && !delayed.value) {\n return createVNode(loadingComponent);\n }\n };\n }\n });\n}\nfunction createInnerComp(comp, parent) {\n const { ref: ref2, props, children, ce } = parent.vnode;\n const vnode = createVNode(comp, props, children);\n vnode.ref = ref2;\n vnode.ce = ce;\n delete parent.vnode.ce;\n return vnode;\n}\n\nconst isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\nconst KeepAliveImpl = {\n name: `KeepAlive`,\n // Marker for special handling inside the renderer. We are not using a ===\n // check directly on KeepAlive in the renderer, because importing it directly\n // would prevent it from being tree-shaken.\n __isKeepAlive: true,\n props: {\n include: [String, RegExp, Array],\n exclude: [String, RegExp, Array],\n max: [String, Number]\n },\n setup(props, { slots }) {\n const instance = getCurrentInstance();\n const sharedContext = instance.ctx;\n if (!sharedContext.renderer) {\n return () => {\n const children = slots.default && slots.default();\n return children && children.length === 1 ? children[0] : children;\n };\n }\n const cache = /* @__PURE__ */ new Map();\n const keys = /* @__PURE__ */ new Set();\n let current = null;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n instance.__v_cache = cache;\n }\n const parentSuspense = instance.suspense;\n const {\n renderer: {\n p: patch,\n m: move,\n um: _unmount,\n o: { createElement }\n }\n } = sharedContext;\n const storageContainer = createElement(\"div\");\n sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {\n const instance2 = vnode.component;\n move(vnode, container, anchor, 0, parentSuspense);\n patch(\n instance2.vnode,\n vnode,\n container,\n anchor,\n instance2,\n parentSuspense,\n namespace,\n vnode.slotScopeIds,\n optimized\n );\n queuePostRenderEffect(() => {\n instance2.isDeactivated = false;\n if (instance2.a) {\n invokeArrayFns(instance2.a);\n }\n const vnodeHook = vnode.props && vnode.props.onVnodeMounted;\n if (vnodeHook) {\n invokeVNodeHook(vnodeHook, instance2.parent, vnode);\n }\n }, parentSuspense);\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentAdded(instance2);\n }\n };\n sharedContext.deactivate = (vnode) => {\n const instance2 = vnode.component;\n invalidateMount(instance2.m);\n invalidateMount(instance2.a);\n move(vnode, storageContainer, null, 1, parentSuspense);\n queuePostRenderEffect(() => {\n if (instance2.da) {\n invokeArrayFns(instance2.da);\n }\n const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;\n if (vnodeHook) {\n invokeVNodeHook(vnodeHook, instance2.parent, vnode);\n }\n instance2.isDeactivated = true;\n }, parentSuspense);\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentAdded(instance2);\n }\n if (!!(process.env.NODE_ENV !== \"production\") && true) {\n instance2.__keepAliveStorageContainer = storageContainer;\n }\n };\n function unmount(vnode) {\n resetShapeFlag(vnode);\n _unmount(vnode, instance, parentSuspense, true);\n }\n function pruneCache(filter) {\n cache.forEach((vnode, key) => {\n const name = getComponentName(vnode.type);\n if (name && !filter(name)) {\n pruneCacheEntry(key);\n }\n });\n }\n function pruneCacheEntry(key) {\n const cached = cache.get(key);\n if (cached && (!current || !isSameVNodeType(cached, current))) {\n unmount(cached);\n } else if (current) {\n resetShapeFlag(current);\n }\n cache.delete(key);\n keys.delete(key);\n }\n watch(\n () => [props.include, props.exclude],\n ([include, exclude]) => {\n include && pruneCache((name) => matches(include, name));\n exclude && pruneCache((name) => !matches(exclude, name));\n },\n // prune post-render after `current` has been updated\n { flush: \"post\", deep: true }\n );\n let pendingCacheKey = null;\n const cacheSubtree = () => {\n if (pendingCacheKey != null) {\n if (isSuspense(instance.subTree.type)) {\n queuePostRenderEffect(() => {\n cache.set(pendingCacheKey, getInnerChild(instance.subTree));\n }, instance.subTree.suspense);\n } else {\n cache.set(pendingCacheKey, getInnerChild(instance.subTree));\n }\n }\n };\n onMounted(cacheSubtree);\n onUpdated(cacheSubtree);\n onBeforeUnmount(() => {\n cache.forEach((cached) => {\n const { subTree, suspense } = instance;\n const vnode = getInnerChild(subTree);\n if (cached.type === vnode.type && cached.key === vnode.key) {\n resetShapeFlag(vnode);\n const da = vnode.component.da;\n da && queuePostRenderEffect(da, suspense);\n return;\n }\n unmount(cached);\n });\n });\n return () => {\n pendingCacheKey = null;\n if (!slots.default) {\n return current = null;\n }\n const children = slots.default();\n const rawVNode = children[0];\n if (children.length > 1) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`KeepAlive should contain exactly one component child.`);\n }\n current = null;\n return children;\n } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {\n current = null;\n return rawVNode;\n }\n let vnode = getInnerChild(rawVNode);\n if (vnode.type === Comment) {\n current = null;\n return vnode;\n }\n const comp = vnode.type;\n const name = getComponentName(\n isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp\n );\n const { include, exclude, max } = props;\n if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {\n vnode.shapeFlag &= -257;\n current = vnode;\n return rawVNode;\n }\n const key = vnode.key == null ? comp : vnode.key;\n const cachedVNode = cache.get(key);\n if (vnode.el) {\n vnode = cloneVNode(vnode);\n if (rawVNode.shapeFlag & 128) {\n rawVNode.ssContent = vnode;\n }\n }\n pendingCacheKey = key;\n if (cachedVNode) {\n vnode.el = cachedVNode.el;\n vnode.component = cachedVNode.component;\n if (vnode.transition) {\n setTransitionHooks(vnode, vnode.transition);\n }\n vnode.shapeFlag |= 512;\n keys.delete(key);\n keys.add(key);\n } else {\n keys.add(key);\n if (max && keys.size > parseInt(max, 10)) {\n pruneCacheEntry(keys.values().next().value);\n }\n }\n vnode.shapeFlag |= 256;\n current = vnode;\n return isSuspense(rawVNode.type) ? rawVNode : vnode;\n };\n }\n};\nconst KeepAlive = KeepAliveImpl;\nfunction matches(pattern, name) {\n if (isArray(pattern)) {\n return pattern.some((p) => matches(p, name));\n } else if (isString(pattern)) {\n return pattern.split(\",\").includes(name);\n } else if (isRegExp(pattern)) {\n pattern.lastIndex = 0;\n return pattern.test(name);\n }\n return false;\n}\nfunction onActivated(hook, target) {\n registerKeepAliveHook(hook, \"a\", target);\n}\nfunction onDeactivated(hook, target) {\n registerKeepAliveHook(hook, \"da\", target);\n}\nfunction registerKeepAliveHook(hook, type, target = currentInstance) {\n const wrappedHook = hook.__wdc || (hook.__wdc = () => {\n let current = target;\n while (current) {\n if (current.isDeactivated) {\n return;\n }\n current = current.parent;\n }\n return hook();\n });\n injectHook(type, wrappedHook, target);\n if (target) {\n let current = target.parent;\n while (current && current.parent) {\n if (isKeepAlive(current.parent.vnode)) {\n injectToKeepAliveRoot(wrappedHook, type, target, current);\n }\n current = current.parent;\n }\n }\n}\nfunction injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {\n const injected = injectHook(\n type,\n hook,\n keepAliveRoot,\n true\n /* prepend */\n );\n onUnmounted(() => {\n remove(keepAliveRoot[type], injected);\n }, target);\n}\nfunction resetShapeFlag(vnode) {\n vnode.shapeFlag &= -257;\n vnode.shapeFlag &= -513;\n}\nfunction getInnerChild(vnode) {\n return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;\n}\n\nfunction injectHook(type, hook, target = currentInstance, prepend = false) {\n if (target) {\n const hooks = target[type] || (target[type] = []);\n const wrappedHook = hook.__weh || (hook.__weh = (...args) => {\n pauseTracking();\n const reset = setCurrentInstance(target);\n const res = callWithAsyncErrorHandling(hook, target, type, args);\n reset();\n resetTracking();\n return res;\n });\n if (prepend) {\n hooks.unshift(wrappedHook);\n } else {\n hooks.push(wrappedHook);\n }\n return wrappedHook;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, \"\"));\n warn$1(\n `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )\n );\n }\n}\nconst createHook = (lifecycle) => (hook, target = currentInstance) => {\n if (!isInSSRComponentSetup || lifecycle === \"sp\") {\n injectHook(lifecycle, (...args) => hook(...args), target);\n }\n};\nconst onBeforeMount = createHook(\"bm\");\nconst onMounted = createHook(\"m\");\nconst onBeforeUpdate = createHook(\n \"bu\"\n);\nconst onUpdated = createHook(\"u\");\nconst onBeforeUnmount = createHook(\n \"bum\"\n);\nconst onUnmounted = createHook(\"um\");\nconst onServerPrefetch = createHook(\n \"sp\"\n);\nconst onRenderTriggered = createHook(\"rtg\");\nconst onRenderTracked = createHook(\"rtc\");\nfunction onErrorCaptured(hook, target = currentInstance) {\n injectHook(\"ec\", hook, target);\n}\n\nconst COMPONENTS = \"components\";\nconst DIRECTIVES = \"directives\";\nfunction resolveComponent(name, maybeSelfReference) {\n return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;\n}\nconst NULL_DYNAMIC_COMPONENT = Symbol.for(\"v-ndc\");\nfunction resolveDynamicComponent(component) {\n if (isString(component)) {\n return resolveAsset(COMPONENTS, component, false) || component;\n } else {\n return component || NULL_DYNAMIC_COMPONENT;\n }\n}\nfunction resolveDirective(name) {\n return resolveAsset(DIRECTIVES, name);\n}\nfunction resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {\n const instance = currentRenderingInstance || currentInstance;\n if (instance) {\n const Component = instance.type;\n if (type === COMPONENTS) {\n const selfName = getComponentName(\n Component,\n false\n );\n if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {\n return Component;\n }\n }\n const res = (\n // local registration\n // check instance[type] first which is resolved for options API\n resolve(instance[type] || Component[type], name) || // global registration\n resolve(instance.appContext[type], name)\n );\n if (!res && maybeSelfReference) {\n return Component;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && warnMissing && !res) {\n const extra = type === COMPONENTS ? `\nIf this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;\n warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);\n }\n return res;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`\n );\n }\n}\nfunction resolve(registry, name) {\n return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);\n}\n\nfunction renderList(source, renderItem, cache, index) {\n let ret;\n const cached = cache && cache[index];\n const sourceIsArray = isArray(source);\n if (sourceIsArray || isString(source)) {\n const sourceIsReactiveArray = sourceIsArray && isReactive(source);\n let needsWrap = false;\n let isReadonlySource = false;\n if (sourceIsReactiveArray) {\n needsWrap = !isShallow(source);\n isReadonlySource = isReadonly(source);\n source = shallowReadArray(source);\n }\n ret = new Array(source.length);\n for (let i = 0, l = source.length; i < l; i++) {\n ret[i] = renderItem(\n needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],\n i,\n void 0,\n cached && cached[i]\n );\n }\n } else if (typeof source === \"number\") {\n if (!!(process.env.NODE_ENV !== \"production\") && !Number.isInteger(source)) {\n warn$1(`The v-for range expect an integer value but got ${source}.`);\n }\n ret = new Array(source);\n for (let i = 0; i < source; i++) {\n ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);\n }\n } else if (isObject(source)) {\n if (source[Symbol.iterator]) {\n ret = Array.from(\n source,\n (item, i) => renderItem(item, i, void 0, cached && cached[i])\n );\n } else {\n const keys = Object.keys(source);\n ret = new Array(keys.length);\n for (let i = 0, l = keys.length; i < l; i++) {\n const key = keys[i];\n ret[i] = renderItem(source[key], key, i, cached && cached[i]);\n }\n }\n } else {\n ret = [];\n }\n if (cache) {\n cache[index] = ret;\n }\n return ret;\n}\n\nfunction createSlots(slots, dynamicSlots) {\n for (let i = 0; i < dynamicSlots.length; i++) {\n const slot = dynamicSlots[i];\n if (isArray(slot)) {\n for (let j = 0; j < slot.length; j++) {\n slots[slot[j].name] = slot[j].fn;\n }\n } else if (slot) {\n slots[slot.name] = slot.key ? (...args) => {\n const res = slot.fn(...args);\n if (res) res.key = slot.key;\n return res;\n } : slot.fn;\n }\n }\n return slots;\n}\n\nfunction renderSlot(slots, name, props = {}, fallback, noSlotted) {\n if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {\n if (name !== \"default\") props.name = name;\n return openBlock(), createBlock(\n Fragment,\n null,\n [createVNode(\"slot\", props, fallback && fallback())],\n 64\n );\n }\n let slot = slots[name];\n if (!!(process.env.NODE_ENV !== \"production\") && slot && slot.length > 1) {\n warn$1(\n `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`\n );\n slot = () => [];\n }\n if (slot && slot._c) {\n slot._d = false;\n }\n openBlock();\n const validSlotContent = slot && ensureValidVNode(slot(props));\n const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch\n // key attached in the `createSlots` helper, respect that\n validSlotContent && validSlotContent.key;\n const rendered = createBlock(\n Fragment,\n {\n key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content\n (!validSlotContent && fallback ? \"_fb\" : \"\")\n },\n validSlotContent || (fallback ? fallback() : []),\n validSlotContent && slots._ === 1 ? 64 : -2\n );\n if (!noSlotted && rendered.scopeId) {\n rendered.slotScopeIds = [rendered.scopeId + \"-s\"];\n }\n if (slot && slot._c) {\n slot._d = true;\n }\n return rendered;\n}\nfunction ensureValidVNode(vnodes) {\n return vnodes.some((child) => {\n if (!isVNode(child)) return true;\n if (child.type === Comment) return false;\n if (child.type === Fragment && !ensureValidVNode(child.children))\n return false;\n return true;\n }) ? vnodes : null;\n}\n\nfunction toHandlers(obj, preserveCaseIfNecessary) {\n const ret = {};\n if (!!(process.env.NODE_ENV !== \"production\") && !isObject(obj)) {\n warn$1(`v-on with no argument expects an object value.`);\n return ret;\n }\n for (const key in obj) {\n ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];\n }\n return ret;\n}\n\nconst getPublicInstance = (i) => {\n if (!i) return null;\n if (isStatefulComponent(i)) return getComponentPublicInstance(i);\n return getPublicInstance(i.parent);\n};\nconst publicPropertiesMap = (\n // Move PURE marker to new line to workaround compiler discarding it\n // due to type annotation\n /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {\n $: (i) => i,\n $el: (i) => i.vnode.el,\n $data: (i) => i.data,\n $props: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.props) : i.props,\n $attrs: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.attrs) : i.attrs,\n $slots: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.slots) : i.slots,\n $refs: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.refs) : i.refs,\n $parent: (i) => getPublicInstance(i.parent),\n $root: (i) => getPublicInstance(i.root),\n $host: (i) => i.ce,\n $emit: (i) => i.emit,\n $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type,\n $forceUpdate: (i) => i.f || (i.f = () => {\n queueJob(i.update);\n }),\n $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),\n $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP\n })\n);\nconst isReservedPrefix = (key) => key === \"_\" || key === \"$\";\nconst hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);\nconst PublicInstanceProxyHandlers = {\n get({ _: instance }, key) {\n if (key === \"__v_skip\") {\n return true;\n }\n const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\n if (!!(process.env.NODE_ENV !== \"production\") && key === \"__isVue\") {\n return true;\n }\n let normalizedProps;\n if (key[0] !== \"$\") {\n const n = accessCache[key];\n if (n !== void 0) {\n switch (n) {\n case 1 /* SETUP */:\n return setupState[key];\n case 2 /* DATA */:\n return data[key];\n case 4 /* CONTEXT */:\n return ctx[key];\n case 3 /* PROPS */:\n return props[key];\n }\n } else if (hasSetupBinding(setupState, key)) {\n accessCache[key] = 1 /* SETUP */;\n return setupState[key];\n } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\n accessCache[key] = 2 /* DATA */;\n return data[key];\n } else if (\n // only cache other properties when instance has declared (thus stable)\n // props\n (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)\n ) {\n accessCache[key] = 3 /* PROPS */;\n return props[key];\n } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n accessCache[key] = 4 /* CONTEXT */;\n return ctx[key];\n } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {\n accessCache[key] = 0 /* OTHER */;\n }\n }\n const publicGetter = publicPropertiesMap[key];\n let cssModule, globalProperties;\n if (publicGetter) {\n if (key === \"$attrs\") {\n track(instance.attrs, \"get\", \"\");\n !!(process.env.NODE_ENV !== \"production\") && markAttrsAccessed();\n } else if (!!(process.env.NODE_ENV !== \"production\") && key === \"$slots\") {\n track(instance, \"get\", key);\n }\n return publicGetter(instance);\n } else if (\n // css module (injected by vue-loader)\n (cssModule = type.__cssModules) && (cssModule = cssModule[key])\n ) {\n return cssModule;\n } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n accessCache[key] = 4 /* CONTEXT */;\n return ctx[key];\n } else if (\n // global properties\n globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)\n ) {\n {\n return globalProperties[key];\n }\n } else if (!!(process.env.NODE_ENV !== \"production\") && currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading\n // to infinite warning loop\n key.indexOf(\"__v\") !== 0)) {\n if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {\n warn$1(\n `Property ${JSON.stringify(\n key\n )} must be accessed via $data because it starts with a reserved character (\"$\" or \"_\") and is not proxied on the render context.`\n );\n } else if (instance === currentRenderingInstance) {\n warn$1(\n `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`\n );\n }\n }\n },\n set({ _: instance }, key, value) {\n const { data, setupState, ctx } = instance;\n if (hasSetupBinding(setupState, key)) {\n setupState[key] = value;\n return true;\n } else if (!!(process.env.NODE_ENV !== \"production\") && setupState.__isScriptSetup && hasOwn(setupState, key)) {\n warn$1(`Cannot mutate <script setup> binding \"${key}\" from Options API.`);\n return false;\n } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\n data[key] = value;\n return true;\n } else if (hasOwn(instance.props, key)) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(`Attempting to mutate prop \"${key}\". Props are readonly.`);\n return false;\n }\n if (key[0] === \"$\" && key.slice(1) in instance) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(\n `Attempting to mutate public property \"${key}\". Properties starting with $ are reserved and readonly.`\n );\n return false;\n } else {\n if (!!(process.env.NODE_ENV !== \"production\") && key in instance.appContext.config.globalProperties) {\n Object.defineProperty(ctx, key, {\n enumerable: true,\n configurable: true,\n value\n });\n } else {\n ctx[key] = value;\n }\n }\n return true;\n },\n has({\n _: { data, setupState, accessCache, ctx, appContext, propsOptions }\n }, key) {\n let normalizedProps;\n return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);\n },\n defineProperty(target, key, descriptor) {\n if (descriptor.get != null) {\n target._.accessCache[key] = 0;\n } else if (hasOwn(descriptor, \"value\")) {\n this.set(target, key, descriptor.value, null);\n }\n return Reflect.defineProperty(target, key, descriptor);\n }\n};\nif (!!(process.env.NODE_ENV !== \"production\") && true) {\n PublicInstanceProxyHandlers.ownKeys = (target) => {\n warn$1(\n `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`\n );\n return Reflect.ownKeys(target);\n };\n}\nconst RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {\n get(target, key) {\n if (key === Symbol.unscopables) {\n return;\n }\n return PublicInstanceProxyHandlers.get(target, key, target);\n },\n has(_, key) {\n const has = key[0] !== \"_\" && !isGloballyAllowed(key);\n if (!!(process.env.NODE_ENV !== \"production\") && !has && PublicInstanceProxyHandlers.has(_, key)) {\n warn$1(\n `Property ${JSON.stringify(\n key\n )} should not start with _ which is a reserved prefix for Vue internals.`\n );\n }\n return has;\n }\n});\nfunction createDevRenderContext(instance) {\n const target = {};\n Object.defineProperty(target, `_`, {\n configurable: true,\n enumerable: false,\n get: () => instance\n });\n Object.keys(publicPropertiesMap).forEach((key) => {\n Object.defineProperty(target, key, {\n configurable: true,\n enumerable: false,\n get: () => publicPropertiesMap[key](instance),\n // intercepted by the proxy so no need for implementation,\n // but needed to prevent set errors\n set: NOOP\n });\n });\n return target;\n}\nfunction exposePropsOnRenderContext(instance) {\n const {\n ctx,\n propsOptions: [propsOptions]\n } = instance;\n if (propsOptions) {\n Object.keys(propsOptions).forEach((key) => {\n Object.defineProperty(ctx, key, {\n enumerable: true,\n configurable: true,\n get: () => instance.props[key],\n set: NOOP\n });\n });\n }\n}\nfunction exposeSetupStateOnRenderContext(instance) {\n const { ctx, setupState } = instance;\n Object.keys(toRaw(setupState)).forEach((key) => {\n if (!setupState.__isScriptSetup) {\n if (isReservedPrefix(key[0])) {\n warn$1(\n `setup() return property ${JSON.stringify(\n key\n )} should not start with \"$\" or \"_\" which are reserved prefixes for Vue internals.`\n );\n return;\n }\n Object.defineProperty(ctx, key, {\n enumerable: true,\n configurable: true,\n get: () => setupState[key],\n set: NOOP\n });\n }\n });\n}\n\nconst warnRuntimeUsage = (method) => warn$1(\n `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`\n);\nfunction defineProps() {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warnRuntimeUsage(`defineProps`);\n }\n return null;\n}\nfunction defineEmits() {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warnRuntimeUsage(`defineEmits`);\n }\n return null;\n}\nfunction defineExpose(exposed) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warnRuntimeUsage(`defineExpose`);\n }\n}\nfunction defineOptions(options) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warnRuntimeUsage(`defineOptions`);\n }\n}\nfunction defineSlots() {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warnRuntimeUsage(`defineSlots`);\n }\n return null;\n}\nfunction defineModel() {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warnRuntimeUsage(\"defineModel\");\n }\n}\nfunction withDefaults(props, defaults) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warnRuntimeUsage(`withDefaults`);\n }\n return null;\n}\nfunction useSlots() {\n return getContext(\"useSlots\").slots;\n}\nfunction useAttrs() {\n return getContext(\"useAttrs\").attrs;\n}\nfunction getContext(calledFunctionName) {\n const i = getCurrentInstance();\n if (!!(process.env.NODE_ENV !== \"production\") && !i) {\n warn$1(`${calledFunctionName}() called without active instance.`);\n }\n return i.setupContext || (i.setupContext = createSetupContext(i));\n}\nfunction normalizePropsOrEmits(props) {\n return isArray(props) ? props.reduce(\n (normalized, p) => (normalized[p] = null, normalized),\n {}\n ) : props;\n}\nfunction mergeDefaults(raw, defaults) {\n const props = normalizePropsOrEmits(raw);\n for (const key in defaults) {\n if (key.startsWith(\"__skip\")) continue;\n let opt = props[key];\n if (opt) {\n if (isArray(opt) || isFunction(opt)) {\n opt = props[key] = { type: opt, default: defaults[key] };\n } else {\n opt.default = defaults[key];\n }\n } else if (opt === null) {\n opt = props[key] = { default: defaults[key] };\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`props default key \"${key}\" has no corresponding declaration.`);\n }\n if (opt && defaults[`__skip_${key}`]) {\n opt.skipFactory = true;\n }\n }\n return props;\n}\nfunction mergeModels(a, b) {\n if (!a || !b) return a || b;\n if (isArray(a) && isArray(b)) return a.concat(b);\n return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));\n}\nfunction createPropsRestProxy(props, excludedKeys) {\n const ret = {};\n for (const key in props) {\n if (!excludedKeys.includes(key)) {\n Object.defineProperty(ret, key, {\n enumerable: true,\n get: () => props[key]\n });\n }\n }\n return ret;\n}\nfunction withAsyncContext(getAwaitable) {\n const ctx = getCurrentInstance();\n if (!!(process.env.NODE_ENV !== \"production\") && !ctx) {\n warn$1(\n `withAsyncContext called without active current instance. This is likely a bug.`\n );\n }\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if (isPromise(awaitable)) {\n awaitable = awaitable.catch((e) => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}\n\nfunction createDuplicateChecker() {\n const cache = /* @__PURE__ */ Object.create(null);\n return (type, key) => {\n if (cache[key]) {\n warn$1(`${type} property \"${key}\" is already defined in ${cache[key]}.`);\n } else {\n cache[key] = type;\n }\n };\n}\nlet shouldCacheAccess = true;\nfunction applyOptions(instance) {\n const options = resolveMergedOptions(instance);\n const publicThis = instance.proxy;\n const ctx = instance.ctx;\n shouldCacheAccess = false;\n if (options.beforeCreate) {\n callHook(options.beforeCreate, instance, \"bc\");\n }\n const {\n // state\n data: dataOptions,\n computed: computedOptions,\n methods,\n watch: watchOptions,\n provide: provideOptions,\n inject: injectOptions,\n // lifecycle\n created,\n beforeMount,\n mounted,\n beforeUpdate,\n updated,\n activated,\n deactivated,\n beforeDestroy,\n beforeUnmount,\n destroyed,\n unmounted,\n render,\n renderTracked,\n renderTriggered,\n errorCaptured,\n serverPrefetch,\n // public API\n expose,\n inheritAttrs,\n // assets\n components,\n directives,\n filters\n } = options;\n const checkDuplicateProperties = !!(process.env.NODE_ENV !== \"production\") ? createDuplicateChecker() : null;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const [propsOptions] = instance.propsOptions;\n if (propsOptions) {\n for (const key in propsOptions) {\n checkDuplicateProperties(\"Props\" /* PROPS */, key);\n }\n }\n }\n if (injectOptions) {\n resolveInjections(injectOptions, ctx, checkDuplicateProperties);\n }\n if (methods) {\n for (const key in methods) {\n const methodHandler = methods[key];\n if (isFunction(methodHandler)) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n Object.defineProperty(ctx, key, {\n value: methodHandler.bind(publicThis),\n configurable: true,\n enumerable: true,\n writable: true\n });\n } else {\n ctx[key] = methodHandler.bind(publicThis);\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n checkDuplicateProperties(\"Methods\" /* METHODS */, key);\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `Method \"${key}\" has type \"${typeof methodHandler}\" in the component definition. Did you reference the function correctly?`\n );\n }\n }\n }\n if (dataOptions) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isFunction(dataOptions)) {\n warn$1(\n `The data option must be a function. Plain object usage is no longer supported.`\n );\n }\n const data = dataOptions.call(publicThis, publicThis);\n if (!!(process.env.NODE_ENV !== \"production\") && isPromise(data)) {\n warn$1(\n `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`\n );\n }\n if (!isObject(data)) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(`data() should return an object.`);\n } else {\n instance.data = reactive(data);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n for (const key in data) {\n checkDuplicateProperties(\"Data\" /* DATA */, key);\n if (!isReservedPrefix(key[0])) {\n Object.defineProperty(ctx, key, {\n configurable: true,\n enumerable: true,\n get: () => data[key],\n set: NOOP\n });\n }\n }\n }\n }\n }\n shouldCacheAccess = true;\n if (computedOptions) {\n for (const key in computedOptions) {\n const opt = computedOptions[key];\n const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;\n if (!!(process.env.NODE_ENV !== \"production\") && get === NOOP) {\n warn$1(`Computed property \"${key}\" has no getter.`);\n }\n const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== \"production\") ? () => {\n warn$1(\n `Write operation failed: computed property \"${key}\" is readonly.`\n );\n } : NOOP;\n const c = computed({\n get,\n set\n });\n Object.defineProperty(ctx, key, {\n enumerable: true,\n configurable: true,\n get: () => c.value,\n set: (v) => c.value = v\n });\n if (!!(process.env.NODE_ENV !== \"production\")) {\n checkDuplicateProperties(\"Computed\" /* COMPUTED */, key);\n }\n }\n }\n if (watchOptions) {\n for (const key in watchOptions) {\n createWatcher(watchOptions[key], ctx, publicThis, key);\n }\n }\n if (provideOptions) {\n const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;\n Reflect.ownKeys(provides).forEach((key) => {\n provide(key, provides[key]);\n });\n }\n if (created) {\n callHook(created, instance, \"c\");\n }\n function registerLifecycleHook(register, hook) {\n if (isArray(hook)) {\n hook.forEach((_hook) => register(_hook.bind(publicThis)));\n } else if (hook) {\n register(hook.bind(publicThis));\n }\n }\n registerLifecycleHook(onBeforeMount, beforeMount);\n registerLifecycleHook(onMounted, mounted);\n registerLifecycleHook(onBeforeUpdate, beforeUpdate);\n registerLifecycleHook(onUpdated, updated);\n registerLifecycleHook(onActivated, activated);\n registerLifecycleHook(onDeactivated, deactivated);\n registerLifecycleHook(onErrorCaptured, errorCaptured);\n registerLifecycleHook(onRenderTracked, renderTracked);\n registerLifecycleHook(onRenderTriggered, renderTriggered);\n registerLifecycleHook(onBeforeUnmount, beforeUnmount);\n registerLifecycleHook(onUnmounted, unmounted);\n registerLifecycleHook(onServerPrefetch, serverPrefetch);\n if (isArray(expose)) {\n if (expose.length) {\n const exposed = instance.exposed || (instance.exposed = {});\n expose.forEach((key) => {\n Object.defineProperty(exposed, key, {\n get: () => publicThis[key],\n set: (val) => publicThis[key] = val,\n enumerable: true\n });\n });\n } else if (!instance.exposed) {\n instance.exposed = {};\n }\n }\n if (render && instance.render === NOOP) {\n instance.render = render;\n }\n if (inheritAttrs != null) {\n instance.inheritAttrs = inheritAttrs;\n }\n if (components) instance.components = components;\n if (directives) instance.directives = directives;\n if (serverPrefetch) {\n markAsyncBoundary(instance);\n }\n}\nfunction resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {\n if (isArray(injectOptions)) {\n injectOptions = normalizeInject(injectOptions);\n }\n for (const key in injectOptions) {\n const opt = injectOptions[key];\n let injected;\n if (isObject(opt)) {\n if (\"default\" in opt) {\n injected = inject(\n opt.from || key,\n opt.default,\n true\n );\n } else {\n injected = inject(opt.from || key);\n }\n } else {\n injected = inject(opt);\n }\n if (isRef(injected)) {\n Object.defineProperty(ctx, key, {\n enumerable: true,\n configurable: true,\n get: () => injected.value,\n set: (v) => injected.value = v\n });\n } else {\n ctx[key] = injected;\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n checkDuplicateProperties(\"Inject\" /* INJECT */, key);\n }\n }\n}\nfunction callHook(hook, instance, type) {\n callWithAsyncErrorHandling(\n isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),\n instance,\n type\n );\n}\nfunction createWatcher(raw, ctx, publicThis, key) {\n let getter = key.includes(\".\") ? createPathGetter(publicThis, key) : () => publicThis[key];\n if (isString(raw)) {\n const handler = ctx[raw];\n if (isFunction(handler)) {\n {\n watch(getter, handler);\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`Invalid watch handler specified by key \"${raw}\"`, handler);\n }\n } else if (isFunction(raw)) {\n {\n watch(getter, raw.bind(publicThis));\n }\n } else if (isObject(raw)) {\n if (isArray(raw)) {\n raw.forEach((r) => createWatcher(r, ctx, publicThis, key));\n } else {\n const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];\n if (isFunction(handler)) {\n watch(getter, handler, raw);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`Invalid watch handler specified by key \"${raw.handler}\"`, handler);\n }\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`Invalid watch option: \"${key}\"`, raw);\n }\n}\nfunction resolveMergedOptions(instance) {\n const base = instance.type;\n const { mixins, extends: extendsOptions } = base;\n const {\n mixins: globalMixins,\n optionsCache: cache,\n config: { optionMergeStrategies }\n } = instance.appContext;\n const cached = cache.get(base);\n let resolved;\n if (cached) {\n resolved = cached;\n } else if (!globalMixins.length && !mixins && !extendsOptions) {\n {\n resolved = base;\n }\n } else {\n resolved = {};\n if (globalMixins.length) {\n globalMixins.forEach(\n (m) => mergeOptions(resolved, m, optionMergeStrategies, true)\n );\n }\n mergeOptions(resolved, base, optionMergeStrategies);\n }\n if (isObject(base)) {\n cache.set(base, resolved);\n }\n return resolved;\n}\nfunction mergeOptions(to, from, strats, asMixin = false) {\n const { mixins, extends: extendsOptions } = from;\n if (extendsOptions) {\n mergeOptions(to, extendsOptions, strats, true);\n }\n if (mixins) {\n mixins.forEach(\n (m) => mergeOptions(to, m, strats, true)\n );\n }\n for (const key in from) {\n if (asMixin && key === \"expose\") {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(\n `\"expose\" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`\n );\n } else {\n const strat = internalOptionMergeStrats[key] || strats && strats[key];\n to[key] = strat ? strat(to[key], from[key]) : from[key];\n }\n }\n return to;\n}\nconst internalOptionMergeStrats = {\n data: mergeDataFn,\n props: mergeEmitsOrPropsOptions,\n emits: mergeEmitsOrPropsOptions,\n // objects\n methods: mergeObjectOptions,\n computed: mergeObjectOptions,\n // lifecycle\n beforeCreate: mergeAsArray,\n created: mergeAsArray,\n beforeMount: mergeAsArray,\n mounted: mergeAsArray,\n beforeUpdate: mergeAsArray,\n updated: mergeAsArray,\n beforeDestroy: mergeAsArray,\n beforeUnmount: mergeAsArray,\n destroyed: mergeAsArray,\n unmounted: mergeAsArray,\n activated: mergeAsArray,\n deactivated: mergeAsArray,\n errorCaptured: mergeAsArray,\n serverPrefetch: mergeAsArray,\n // assets\n components: mergeObjectOptions,\n directives: mergeObjectOptions,\n // watch\n watch: mergeWatchOptions,\n // provide / inject\n provide: mergeDataFn,\n inject: mergeInject\n};\nfunction mergeDataFn(to, from) {\n if (!from) {\n return to;\n }\n if (!to) {\n return from;\n }\n return function mergedDataFn() {\n return (extend)(\n isFunction(to) ? to.call(this, this) : to,\n isFunction(from) ? from.call(this, this) : from\n );\n };\n}\nfunction mergeInject(to, from) {\n return mergeObjectOptions(normalizeInject(to), normalizeInject(from));\n}\nfunction normalizeInject(raw) {\n if (isArray(raw)) {\n const res = {};\n for (let i = 0; i < raw.length; i++) {\n res[raw[i]] = raw[i];\n }\n return res;\n }\n return raw;\n}\nfunction mergeAsArray(to, from) {\n return to ? [...new Set([].concat(to, from))] : from;\n}\nfunction mergeObjectOptions(to, from) {\n return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;\n}\nfunction mergeEmitsOrPropsOptions(to, from) {\n if (to) {\n if (isArray(to) && isArray(from)) {\n return [.../* @__PURE__ */ new Set([...to, ...from])];\n }\n return extend(\n /* @__PURE__ */ Object.create(null),\n normalizePropsOrEmits(to),\n normalizePropsOrEmits(from != null ? from : {})\n );\n } else {\n return from;\n }\n}\nfunction mergeWatchOptions(to, from) {\n if (!to) return from;\n if (!from) return to;\n const merged = extend(/* @__PURE__ */ Object.create(null), to);\n for (const key in from) {\n merged[key] = mergeAsArray(to[key], from[key]);\n }\n return merged;\n}\n\nfunction createAppContext() {\n return {\n app: null,\n config: {\n isNativeTag: NO,\n performance: false,\n globalProperties: {},\n optionMergeStrategies: {},\n errorHandler: void 0,\n warnHandler: void 0,\n compilerOptions: {}\n },\n mixins: [],\n components: {},\n directives: {},\n provides: /* @__PURE__ */ Object.create(null),\n optionsCache: /* @__PURE__ */ new WeakMap(),\n propsCache: /* @__PURE__ */ new WeakMap(),\n emitsCache: /* @__PURE__ */ new WeakMap()\n };\n}\nlet uid$1 = 0;\nfunction createAppAPI(render, hydrate) {\n return function createApp(rootComponent, rootProps = null) {\n if (!isFunction(rootComponent)) {\n rootComponent = extend({}, rootComponent);\n }\n if (rootProps != null && !isObject(rootProps)) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(`root props passed to app.mount() must be an object.`);\n rootProps = null;\n }\n const context = createAppContext();\n const installedPlugins = /* @__PURE__ */ new WeakSet();\n const pluginCleanupFns = [];\n let isMounted = false;\n const app = context.app = {\n _uid: uid$1++,\n _component: rootComponent,\n _props: rootProps,\n _container: null,\n _context: context,\n _instance: null,\n version,\n get config() {\n return context.config;\n },\n set config(v) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `app.config cannot be replaced. Modify individual options instead.`\n );\n }\n },\n use(plugin, ...options) {\n if (installedPlugins.has(plugin)) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(`Plugin has already been applied to target app.`);\n } else if (plugin && isFunction(plugin.install)) {\n installedPlugins.add(plugin);\n plugin.install(app, ...options);\n } else if (isFunction(plugin)) {\n installedPlugins.add(plugin);\n plugin(app, ...options);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `A plugin must either be a function or an object with an \"install\" function.`\n );\n }\n return app;\n },\n mixin(mixin) {\n if (__VUE_OPTIONS_API__) {\n if (!context.mixins.includes(mixin)) {\n context.mixins.push(mixin);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n \"Mixin has already been applied to target app\" + (mixin.name ? `: ${mixin.name}` : \"\")\n );\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\"Mixins are only available in builds supporting Options API\");\n }\n return app;\n },\n component(name, component) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n validateComponentName(name, context.config);\n }\n if (!component) {\n return context.components[name];\n }\n if (!!(process.env.NODE_ENV !== \"production\") && context.components[name]) {\n warn$1(`Component \"${name}\" has already been registered in target app.`);\n }\n context.components[name] = component;\n return app;\n },\n directive(name, directive) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n validateDirectiveName(name);\n }\n if (!directive) {\n return context.directives[name];\n }\n if (!!(process.env.NODE_ENV !== \"production\") && context.directives[name]) {\n warn$1(`Directive \"${name}\" has already been registered in target app.`);\n }\n context.directives[name] = directive;\n return app;\n },\n mount(rootContainer, isHydrate, namespace) {\n if (!isMounted) {\n if (!!(process.env.NODE_ENV !== \"production\") && rootContainer.__vue_app__) {\n warn$1(\n `There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling \\`app.unmount()\\` first.`\n );\n }\n const vnode = app._ceVNode || createVNode(rootComponent, rootProps);\n vnode.appContext = context;\n if (namespace === true) {\n namespace = \"svg\";\n } else if (namespace === false) {\n namespace = void 0;\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n context.reload = () => {\n const cloned = cloneVNode(vnode);\n cloned.el = null;\n render(cloned, rootContainer, namespace);\n };\n }\n if (isHydrate && hydrate) {\n hydrate(vnode, rootContainer);\n } else {\n render(vnode, rootContainer, namespace);\n }\n isMounted = true;\n app._container = rootContainer;\n rootContainer.__vue_app__ = app;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n app._instance = vnode.component;\n devtoolsInitApp(app, version);\n }\n return getComponentPublicInstance(vnode.component);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \\`const createMyApp = () => createApp(App)\\``\n );\n }\n },\n onUnmount(cleanupFn) {\n if (!!(process.env.NODE_ENV !== \"production\") && typeof cleanupFn !== \"function\") {\n warn$1(\n `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`\n );\n }\n pluginCleanupFns.push(cleanupFn);\n },\n unmount() {\n if (isMounted) {\n callWithAsyncErrorHandling(\n pluginCleanupFns,\n app._instance,\n 16\n );\n render(null, app._container);\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n app._instance = null;\n devtoolsUnmountApp(app);\n }\n delete app._container.__vue_app__;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`Cannot unmount an app that is not mounted.`);\n }\n },\n provide(key, value) {\n if (!!(process.env.NODE_ENV !== \"production\") && key in context.provides) {\n if (hasOwn(context.provides, key)) {\n warn$1(\n `App already provides property with key \"${String(key)}\". It will be overwritten with the new value.`\n );\n } else {\n warn$1(\n `App already provides property with key \"${String(key)}\" inherited from its parent element. It will be overwritten with the new value.`\n );\n }\n }\n context.provides[key] = value;\n return app;\n },\n runWithContext(fn) {\n const lastApp = currentApp;\n currentApp = app;\n try {\n return fn();\n } finally {\n currentApp = lastApp;\n }\n }\n };\n return app;\n };\n}\nlet currentApp = null;\n\nfunction provide(key, value) {\n if (!currentInstance) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`provide() can only be used inside setup().`);\n }\n } else {\n let provides = currentInstance.provides;\n const parentProvides = currentInstance.parent && currentInstance.parent.provides;\n if (parentProvides === provides) {\n provides = currentInstance.provides = Object.create(parentProvides);\n }\n provides[key] = value;\n }\n}\nfunction inject(key, defaultValue, treatDefaultAsFactory = false) {\n const instance = getCurrentInstance();\n if (instance || currentApp) {\n let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;\n if (provides && key in provides) {\n return provides[key];\n } else if (arguments.length > 1) {\n return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`injection \"${String(key)}\" not found.`);\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`inject() can only be used inside setup() or functional components.`);\n }\n}\nfunction hasInjectionContext() {\n return !!(getCurrentInstance() || currentApp);\n}\n\nconst internalObjectProto = {};\nconst createInternalObject = () => Object.create(internalObjectProto);\nconst isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;\n\nfunction initProps(instance, rawProps, isStateful, isSSR = false) {\n const props = {};\n const attrs = createInternalObject();\n instance.propsDefaults = /* @__PURE__ */ Object.create(null);\n setFullProps(instance, rawProps, props, attrs);\n for (const key in instance.propsOptions[0]) {\n if (!(key in props)) {\n props[key] = void 0;\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n validateProps(rawProps || {}, props, instance);\n }\n if (isStateful) {\n instance.props = isSSR ? props : shallowReactive(props);\n } else {\n if (!instance.type.props) {\n instance.props = attrs;\n } else {\n instance.props = props;\n }\n }\n instance.attrs = attrs;\n}\nfunction isInHmrContext(instance) {\n while (instance) {\n if (instance.type.__hmrId) return true;\n instance = instance.parent;\n }\n}\nfunction updateProps(instance, rawProps, rawPrevProps, optimized) {\n const {\n props,\n attrs,\n vnode: { patchFlag }\n } = instance;\n const rawCurrentProps = toRaw(props);\n const [options] = instance.propsOptions;\n let hasAttrsChanged = false;\n if (\n // always force full diff in dev\n // - #1942 if hmr is enabled with sfc component\n // - vite#872 non-sfc component used by sfc component\n !(!!(process.env.NODE_ENV !== \"production\") && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16)\n ) {\n if (patchFlag & 8) {\n const propsToUpdate = instance.vnode.dynamicProps;\n for (let i = 0; i < propsToUpdate.length; i++) {\n let key = propsToUpdate[i];\n if (isEmitListener(instance.emitsOptions, key)) {\n continue;\n }\n const value = rawProps[key];\n if (options) {\n if (hasOwn(attrs, key)) {\n if (value !== attrs[key]) {\n attrs[key] = value;\n hasAttrsChanged = true;\n }\n } else {\n const camelizedKey = camelize(key);\n props[camelizedKey] = resolvePropValue(\n options,\n rawCurrentProps,\n camelizedKey,\n value,\n instance,\n false\n );\n }\n } else {\n if (value !== attrs[key]) {\n attrs[key] = value;\n hasAttrsChanged = true;\n }\n }\n }\n }\n } else {\n if (setFullProps(instance, rawProps, props, attrs)) {\n hasAttrsChanged = true;\n }\n let kebabKey;\n for (const key in rawCurrentProps) {\n if (!rawProps || // for camelCase\n !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case\n // and converted to camelCase (#955)\n ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {\n if (options) {\n if (rawPrevProps && // for camelCase\n (rawPrevProps[key] !== void 0 || // for kebab-case\n rawPrevProps[kebabKey] !== void 0)) {\n props[key] = resolvePropValue(\n options,\n rawCurrentProps,\n key,\n void 0,\n instance,\n true\n );\n }\n } else {\n delete props[key];\n }\n }\n }\n if (attrs !== rawCurrentProps) {\n for (const key in attrs) {\n if (!rawProps || !hasOwn(rawProps, key) && true) {\n delete attrs[key];\n hasAttrsChanged = true;\n }\n }\n }\n }\n if (hasAttrsChanged) {\n trigger(instance.attrs, \"set\", \"\");\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n validateProps(rawProps || {}, props, instance);\n }\n}\nfunction setFullProps(instance, rawProps, props, attrs) {\n const [options, needCastKeys] = instance.propsOptions;\n let hasAttrsChanged = false;\n let rawCastValues;\n if (rawProps) {\n for (let key in rawProps) {\n if (isReservedProp(key)) {\n continue;\n }\n const value = rawProps[key];\n let camelKey;\n if (options && hasOwn(options, camelKey = camelize(key))) {\n if (!needCastKeys || !needCastKeys.includes(camelKey)) {\n props[camelKey] = value;\n } else {\n (rawCastValues || (rawCastValues = {}))[camelKey] = value;\n }\n } else if (!isEmitListener(instance.emitsOptions, key)) {\n if (!(key in attrs) || value !== attrs[key]) {\n attrs[key] = value;\n hasAttrsChanged = true;\n }\n }\n }\n }\n if (needCastKeys) {\n const rawCurrentProps = toRaw(props);\n const castValues = rawCastValues || EMPTY_OBJ;\n for (let i = 0; i < needCastKeys.length; i++) {\n const key = needCastKeys[i];\n props[key] = resolvePropValue(\n options,\n rawCurrentProps,\n key,\n castValues[key],\n instance,\n !hasOwn(castValues, key)\n );\n }\n }\n return hasAttrsChanged;\n}\nfunction resolvePropValue(options, props, key, value, instance, isAbsent) {\n const opt = options[key];\n if (opt != null) {\n const hasDefault = hasOwn(opt, \"default\");\n if (hasDefault && value === void 0) {\n const defaultValue = opt.default;\n if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {\n const { propsDefaults } = instance;\n if (key in propsDefaults) {\n value = propsDefaults[key];\n } else {\n const reset = setCurrentInstance(instance);\n value = propsDefaults[key] = defaultValue.call(\n null,\n props\n );\n reset();\n }\n } else {\n value = defaultValue;\n }\n if (instance.ce) {\n instance.ce._setProp(key, value);\n }\n }\n if (opt[0 /* shouldCast */]) {\n if (isAbsent && !hasDefault) {\n value = false;\n } else if (opt[1 /* shouldCastTrue */] && (value === \"\" || value === hyphenate(key))) {\n value = true;\n }\n }\n }\n return value;\n}\nconst mixinPropsCache = /* @__PURE__ */ new WeakMap();\nfunction normalizePropsOptions(comp, appContext, asMixin = false) {\n const cache = __VUE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache;\n const cached = cache.get(comp);\n if (cached) {\n return cached;\n }\n const raw = comp.props;\n const normalized = {};\n const needCastKeys = [];\n let hasExtends = false;\n if (__VUE_OPTIONS_API__ && !isFunction(comp)) {\n const extendProps = (raw2) => {\n hasExtends = true;\n const [props, keys] = normalizePropsOptions(raw2, appContext, true);\n extend(normalized, props);\n if (keys) needCastKeys.push(...keys);\n };\n if (!asMixin && appContext.mixins.length) {\n appContext.mixins.forEach(extendProps);\n }\n if (comp.extends) {\n extendProps(comp.extends);\n }\n if (comp.mixins) {\n comp.mixins.forEach(extendProps);\n }\n }\n if (!raw && !hasExtends) {\n if (isObject(comp)) {\n cache.set(comp, EMPTY_ARR);\n }\n return EMPTY_ARR;\n }\n if (isArray(raw)) {\n for (let i = 0; i < raw.length; i++) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isString(raw[i])) {\n warn$1(`props must be strings when using array syntax.`, raw[i]);\n }\n const normalizedKey = camelize(raw[i]);\n if (validatePropName(normalizedKey)) {\n normalized[normalizedKey] = EMPTY_OBJ;\n }\n }\n } else if (raw) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isObject(raw)) {\n warn$1(`invalid props options`, raw);\n }\n for (const key in raw) {\n const normalizedKey = camelize(key);\n if (validatePropName(normalizedKey)) {\n const opt = raw[key];\n const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);\n const propType = prop.type;\n let shouldCast = false;\n let shouldCastTrue = true;\n if (isArray(propType)) {\n for (let index = 0; index < propType.length; ++index) {\n const type = propType[index];\n const typeName = isFunction(type) && type.name;\n if (typeName === \"Boolean\") {\n shouldCast = true;\n break;\n } else if (typeName === \"String\") {\n shouldCastTrue = false;\n }\n }\n } else {\n shouldCast = isFunction(propType) && propType.name === \"Boolean\";\n }\n prop[0 /* shouldCast */] = shouldCast;\n prop[1 /* shouldCastTrue */] = shouldCastTrue;\n if (shouldCast || hasOwn(prop, \"default\")) {\n needCastKeys.push(normalizedKey);\n }\n }\n }\n }\n const res = [normalized, needCastKeys];\n if (isObject(comp)) {\n cache.set(comp, res);\n }\n return res;\n}\nfunction validatePropName(key) {\n if (key[0] !== \"$\" && !isReservedProp(key)) {\n return true;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`Invalid prop name: \"${key}\" is a reserved property.`);\n }\n return false;\n}\nfunction getType(ctor) {\n if (ctor === null) {\n return \"null\";\n }\n if (typeof ctor === \"function\") {\n return ctor.name || \"\";\n } else if (typeof ctor === \"object\") {\n const name = ctor.constructor && ctor.constructor.name;\n return name || \"\";\n }\n return \"\";\n}\nfunction validateProps(rawProps, props, instance) {\n const resolvedValues = toRaw(props);\n const options = instance.propsOptions[0];\n const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));\n for (const key in options) {\n let opt = options[key];\n if (opt == null) continue;\n validateProp(\n key,\n resolvedValues[key],\n opt,\n !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(resolvedValues) : resolvedValues,\n !camelizePropsKey.includes(key)\n );\n }\n}\nfunction validateProp(name, value, prop, props, isAbsent) {\n const { type, required, validator, skipCheck } = prop;\n if (required && isAbsent) {\n warn$1('Missing required prop: \"' + name + '\"');\n return;\n }\n if (value == null && !required) {\n return;\n }\n if (type != null && type !== true && !skipCheck) {\n let isValid = false;\n const types = isArray(type) ? type : [type];\n const expectedTypes = [];\n for (let i = 0; i < types.length && !isValid; i++) {\n const { valid, expectedType } = assertType(value, types[i]);\n expectedTypes.push(expectedType || \"\");\n isValid = valid;\n }\n if (!isValid) {\n warn$1(getInvalidTypeMessage(name, value, expectedTypes));\n return;\n }\n }\n if (validator && !validator(value, props)) {\n warn$1('Invalid prop: custom validator check failed for prop \"' + name + '\".');\n }\n}\nconst isSimpleType = /* @__PURE__ */ makeMap(\n \"String,Number,Boolean,Function,Symbol,BigInt\"\n);\nfunction assertType(value, type) {\n let valid;\n const expectedType = getType(type);\n if (expectedType === \"null\") {\n valid = value === null;\n } else if (isSimpleType(expectedType)) {\n const t = typeof value;\n valid = t === expectedType.toLowerCase();\n if (!valid && t === \"object\") {\n valid = value instanceof type;\n }\n } else if (expectedType === \"Object\") {\n valid = isObject(value);\n } else if (expectedType === \"Array\") {\n valid = isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid,\n expectedType\n };\n}\nfunction getInvalidTypeMessage(name, value, expectedTypes) {\n if (expectedTypes.length === 0) {\n return `Prop type [] for prop \"${name}\" won't match anything. Did you mean to use type Array instead?`;\n }\n let message = `Invalid prop: type check failed for prop \"${name}\". Expected ${expectedTypes.map(capitalize).join(\" | \")}`;\n const expectedType = expectedTypes[0];\n const receivedType = toRawType(value);\n const expectedValue = styleValue(value, expectedType);\n const receivedValue = styleValue(value, receivedType);\n if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {\n message += ` with value ${expectedValue}`;\n }\n message += `, got ${receivedType} `;\n if (isExplicable(receivedType)) {\n message += `with value ${receivedValue}.`;\n }\n return message;\n}\nfunction styleValue(value, type) {\n if (type === \"String\") {\n return `\"${value}\"`;\n } else if (type === \"Number\") {\n return `${Number(value)}`;\n } else {\n return `${value}`;\n }\n}\nfunction isExplicable(type) {\n const explicitTypes = [\"string\", \"number\", \"boolean\"];\n return explicitTypes.some((elem) => type.toLowerCase() === elem);\n}\nfunction isBoolean(...args) {\n return args.some((elem) => elem.toLowerCase() === \"boolean\");\n}\n\nconst isInternalKey = (key) => key === \"_\" || key === \"__\" || key === \"_ctx\" || key === \"$stable\";\nconst normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];\nconst normalizeSlot = (key, rawSlot, ctx) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n const normalized = withCtx((...args) => {\n if (!!(process.env.NODE_ENV !== \"production\") && currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {\n warn$1(\n `Slot \"${key}\" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`\n );\n }\n return normalizeSlotValue(rawSlot(...args));\n }, ctx);\n normalized._c = false;\n return normalized;\n};\nconst normalizeObjectSlots = (rawSlots, slots, instance) => {\n const ctx = rawSlots._ctx;\n for (const key in rawSlots) {\n if (isInternalKey(key)) continue;\n const value = rawSlots[key];\n if (isFunction(value)) {\n slots[key] = normalizeSlot(key, value, ctx);\n } else if (value != null) {\n if (!!(process.env.NODE_ENV !== \"production\") && true) {\n warn$1(\n `Non-function value encountered for slot \"${key}\". Prefer function slots for better performance.`\n );\n }\n const normalized = normalizeSlotValue(value);\n slots[key] = () => normalized;\n }\n }\n};\nconst normalizeVNodeSlots = (instance, children) => {\n if (!!(process.env.NODE_ENV !== \"production\") && !isKeepAlive(instance.vnode) && true) {\n warn$1(\n `Non-function value encountered for default slot. Prefer function slots for better performance.`\n );\n }\n const normalized = normalizeSlotValue(children);\n instance.slots.default = () => normalized;\n};\nconst assignSlots = (slots, children, optimized) => {\n for (const key in children) {\n if (optimized || !isInternalKey(key)) {\n slots[key] = children[key];\n }\n }\n};\nconst initSlots = (instance, children, optimized) => {\n const slots = instance.slots = createInternalObject();\n if (instance.vnode.shapeFlag & 32) {\n const cacheIndexes = children.__;\n if (cacheIndexes) def(slots, \"__\", cacheIndexes, true);\n const type = children._;\n if (type) {\n assignSlots(slots, children, optimized);\n if (optimized) {\n def(slots, \"_\", type, true);\n }\n } else {\n normalizeObjectSlots(children, slots);\n }\n } else if (children) {\n normalizeVNodeSlots(instance, children);\n }\n};\nconst updateSlots = (instance, children, optimized) => {\n const { vnode, slots } = instance;\n let needDeletionCheck = true;\n let deletionComparisonTarget = EMPTY_OBJ;\n if (vnode.shapeFlag & 32) {\n const type = children._;\n if (type) {\n if (!!(process.env.NODE_ENV !== \"production\") && isHmrUpdating) {\n assignSlots(slots, children, optimized);\n trigger(instance, \"set\", \"$slots\");\n } else if (optimized && type === 1) {\n needDeletionCheck = false;\n } else {\n assignSlots(slots, children, optimized);\n }\n } else {\n needDeletionCheck = !children.$stable;\n normalizeObjectSlots(children, slots);\n }\n deletionComparisonTarget = children;\n } else if (children) {\n normalizeVNodeSlots(instance, children);\n deletionComparisonTarget = { default: 1 };\n }\n if (needDeletionCheck) {\n for (const key in slots) {\n if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {\n delete slots[key];\n }\n }\n }\n};\n\nlet supported;\nlet perf;\nfunction startMeasure(instance, type) {\n if (instance.appContext.config.performance && isSupported()) {\n perf.mark(`vue-${type}-${instance.uid}`);\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());\n }\n}\nfunction endMeasure(instance, type) {\n if (instance.appContext.config.performance && isSupported()) {\n const startTag = `vue-${type}-${instance.uid}`;\n const endTag = startTag + `:end`;\n perf.mark(endTag);\n perf.measure(\n `<${formatComponentName(instance, instance.type)}> ${type}`,\n startTag,\n endTag\n );\n perf.clearMarks(startTag);\n perf.clearMarks(endTag);\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());\n }\n}\nfunction isSupported() {\n if (supported !== void 0) {\n return supported;\n }\n if (typeof window !== \"undefined\" && window.performance) {\n supported = true;\n perf = window.performance;\n } else {\n supported = false;\n }\n return supported;\n}\n\nfunction initFeatureFlags() {\n const needWarn = [];\n if (typeof __VUE_OPTIONS_API__ !== \"boolean\") {\n !!(process.env.NODE_ENV !== \"production\") && needWarn.push(`__VUE_OPTIONS_API__`);\n getGlobalThis().__VUE_OPTIONS_API__ = true;\n }\n if (typeof __VUE_PROD_DEVTOOLS__ !== \"boolean\") {\n !!(process.env.NODE_ENV !== \"production\") && needWarn.push(`__VUE_PROD_DEVTOOLS__`);\n getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;\n }\n if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== \"boolean\") {\n !!(process.env.NODE_ENV !== \"production\") && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`);\n getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && needWarn.length) {\n const multi = needWarn.length > 1;\n console.warn(\n `Feature flag${multi ? `s` : ``} ${needWarn.join(\", \")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.\n\nFor more details, see https://link.vuejs.org/feature-flags.`\n );\n }\n}\n\nconst queuePostRenderEffect = queueEffectWithSuspense ;\nfunction createRenderer(options) {\n return baseCreateRenderer(options);\n}\nfunction createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}\nfunction baseCreateRenderer(options, createHydrationFns) {\n {\n initFeatureFlags();\n }\n const target = getGlobalThis();\n target.__VUE__ = true;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);\n }\n const {\n insert: hostInsert,\n remove: hostRemove,\n patchProp: hostPatchProp,\n createElement: hostCreateElement,\n createText: hostCreateText,\n createComment: hostCreateComment,\n setText: hostSetText,\n setElementText: hostSetElementText,\n parentNode: hostParentNode,\n nextSibling: hostNextSibling,\n setScopeId: hostSetScopeId = NOOP,\n insertStaticContent: hostInsertStaticContent\n } = options;\n const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== \"production\") && isHmrUpdating ? false : !!n2.dynamicChildren) => {\n if (n1 === n2) {\n return;\n }\n if (n1 && !isSameVNodeType(n1, n2)) {\n anchor = getNextHostNode(n1);\n unmount(n1, parentComponent, parentSuspense, true);\n n1 = null;\n }\n if (n2.patchFlag === -2) {\n optimized = false;\n n2.dynamicChildren = null;\n }\n const { type, ref, shapeFlag } = n2;\n switch (type) {\n case Text:\n processText(n1, n2, container, anchor);\n break;\n case Comment:\n processCommentNode(n1, n2, container, anchor);\n break;\n case Static:\n if (n1 == null) {\n mountStaticNode(n2, container, anchor, namespace);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n patchStaticNode(n1, n2, container, namespace);\n }\n break;\n case Fragment:\n processFragment(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n break;\n default:\n if (shapeFlag & 1) {\n processElement(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n } else if (shapeFlag & 6) {\n processComponent(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n } else if (shapeFlag & 64) {\n type.process(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized,\n internals\n );\n } else if (shapeFlag & 128) {\n type.process(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized,\n internals\n );\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\"Invalid VNode type:\", type, `(${typeof type})`);\n }\n }\n if (ref != null && parentComponent) {\n setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);\n } else if (ref == null && n1 && n1.ref != null) {\n setRef(n1.ref, null, parentSuspense, n1, true);\n }\n };\n const processText = (n1, n2, container, anchor) => {\n if (n1 == null) {\n hostInsert(\n n2.el = hostCreateText(n2.children),\n container,\n anchor\n );\n } else {\n const el = n2.el = n1.el;\n if (n2.children !== n1.children) {\n hostSetText(el, n2.children);\n }\n }\n };\n const processCommentNode = (n1, n2, container, anchor) => {\n if (n1 == null) {\n hostInsert(\n n2.el = hostCreateComment(n2.children || \"\"),\n container,\n anchor\n );\n } else {\n n2.el = n1.el;\n }\n };\n const mountStaticNode = (n2, container, anchor, namespace) => {\n [n2.el, n2.anchor] = hostInsertStaticContent(\n n2.children,\n container,\n anchor,\n namespace,\n n2.el,\n n2.anchor\n );\n };\n const patchStaticNode = (n1, n2, container, namespace) => {\n if (n2.children !== n1.children) {\n const anchor = hostNextSibling(n1.anchor);\n removeStaticNode(n1);\n [n2.el, n2.anchor] = hostInsertStaticContent(\n n2.children,\n container,\n anchor,\n namespace\n );\n } else {\n n2.el = n1.el;\n n2.anchor = n1.anchor;\n }\n };\n const moveStaticNode = ({ el, anchor }, container, nextSibling) => {\n let next;\n while (el && el !== anchor) {\n next = hostNextSibling(el);\n hostInsert(el, container, nextSibling);\n el = next;\n }\n hostInsert(anchor, container, nextSibling);\n };\n const removeStaticNode = ({ el, anchor }) => {\n let next;\n while (el && el !== anchor) {\n next = hostNextSibling(el);\n hostRemove(el);\n el = next;\n }\n hostRemove(anchor);\n };\n const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {\n if (n2.type === \"svg\") {\n namespace = \"svg\";\n } else if (n2.type === \"math\") {\n namespace = \"mathml\";\n }\n if (n1 == null) {\n mountElement(\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n } else {\n patchElement(\n n1,\n n2,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n }\n };\n const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {\n let el;\n let vnodeHook;\n const { props, shapeFlag, transition, dirs } = vnode;\n el = vnode.el = hostCreateElement(\n vnode.type,\n namespace,\n props && props.is,\n props\n );\n if (shapeFlag & 8) {\n hostSetElementText(el, vnode.children);\n } else if (shapeFlag & 16) {\n mountChildren(\n vnode.children,\n el,\n null,\n parentComponent,\n parentSuspense,\n resolveChildrenNamespace(vnode, namespace),\n slotScopeIds,\n optimized\n );\n }\n if (dirs) {\n invokeDirectiveHook(vnode, null, parentComponent, \"created\");\n }\n setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);\n if (props) {\n for (const key in props) {\n if (key !== \"value\" && !isReservedProp(key)) {\n hostPatchProp(el, key, null, props[key], namespace, parentComponent);\n }\n }\n if (\"value\" in props) {\n hostPatchProp(el, \"value\", null, props.value, namespace);\n }\n if (vnodeHook = props.onVnodeBeforeMount) {\n invokeVNodeHook(vnodeHook, parentComponent, vnode);\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n def(el, \"__vnode\", vnode, true);\n def(el, \"__vueParentComponent\", parentComponent, true);\n }\n if (dirs) {\n invokeDirectiveHook(vnode, null, parentComponent, \"beforeMount\");\n }\n const needCallTransitionHooks = needTransition(parentSuspense, transition);\n if (needCallTransitionHooks) {\n transition.beforeEnter(el);\n }\n hostInsert(el, container, anchor);\n if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {\n queuePostRenderEffect(() => {\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\n needCallTransitionHooks && transition.enter(el);\n dirs && invokeDirectiveHook(vnode, null, parentComponent, \"mounted\");\n }, parentSuspense);\n }\n };\n const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {\n if (scopeId) {\n hostSetScopeId(el, scopeId);\n }\n if (slotScopeIds) {\n for (let i = 0; i < slotScopeIds.length; i++) {\n hostSetScopeId(el, slotScopeIds[i]);\n }\n }\n if (parentComponent) {\n let subTree = parentComponent.subTree;\n if (!!(process.env.NODE_ENV !== \"production\") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) {\n subTree = filterSingleRoot(subTree.children) || subTree;\n }\n if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {\n const parentVNode = parentComponent.vnode;\n setScopeId(\n el,\n parentVNode,\n parentVNode.scopeId,\n parentVNode.slotScopeIds,\n parentComponent.parent\n );\n }\n }\n };\n const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {\n for (let i = start; i < children.length; i++) {\n const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);\n patch(\n null,\n child,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n }\n };\n const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {\n const el = n2.el = n1.el;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n el.__vnode = n2;\n }\n let { patchFlag, dynamicChildren, dirs } = n2;\n patchFlag |= n1.patchFlag & 16;\n const oldProps = n1.props || EMPTY_OBJ;\n const newProps = n2.props || EMPTY_OBJ;\n let vnodeHook;\n parentComponent && toggleRecurse(parentComponent, false);\n if (vnodeHook = newProps.onVnodeBeforeUpdate) {\n invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\n }\n if (dirs) {\n invokeDirectiveHook(n2, n1, parentComponent, \"beforeUpdate\");\n }\n parentComponent && toggleRecurse(parentComponent, true);\n if (!!(process.env.NODE_ENV !== \"production\") && isHmrUpdating) {\n patchFlag = 0;\n optimized = false;\n dynamicChildren = null;\n }\n if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {\n hostSetElementText(el, \"\");\n }\n if (dynamicChildren) {\n patchBlockChildren(\n n1.dynamicChildren,\n dynamicChildren,\n el,\n parentComponent,\n parentSuspense,\n resolveChildrenNamespace(n2, namespace),\n slotScopeIds\n );\n if (!!(process.env.NODE_ENV !== \"production\")) {\n traverseStaticChildren(n1, n2);\n }\n } else if (!optimized) {\n patchChildren(\n n1,\n n2,\n el,\n null,\n parentComponent,\n parentSuspense,\n resolveChildrenNamespace(n2, namespace),\n slotScopeIds,\n false\n );\n }\n if (patchFlag > 0) {\n if (patchFlag & 16) {\n patchProps(el, oldProps, newProps, parentComponent, namespace);\n } else {\n if (patchFlag & 2) {\n if (oldProps.class !== newProps.class) {\n hostPatchProp(el, \"class\", null, newProps.class, namespace);\n }\n }\n if (patchFlag & 4) {\n hostPatchProp(el, \"style\", oldProps.style, newProps.style, namespace);\n }\n if (patchFlag & 8) {\n const propsToUpdate = n2.dynamicProps;\n for (let i = 0; i < propsToUpdate.length; i++) {\n const key = propsToUpdate[i];\n const prev = oldProps[key];\n const next = newProps[key];\n if (next !== prev || key === \"value\") {\n hostPatchProp(el, key, prev, next, namespace, parentComponent);\n }\n }\n }\n }\n if (patchFlag & 1) {\n if (n1.children !== n2.children) {\n hostSetElementText(el, n2.children);\n }\n }\n } else if (!optimized && dynamicChildren == null) {\n patchProps(el, oldProps, newProps, parentComponent, namespace);\n }\n if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {\n queuePostRenderEffect(() => {\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\n dirs && invokeDirectiveHook(n2, n1, parentComponent, \"updated\");\n }, parentSuspense);\n }\n };\n const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {\n for (let i = 0; i < newChildren.length; i++) {\n const oldVNode = oldChildren[i];\n const newVNode = newChildren[i];\n const container = (\n // oldVNode may be an errored async setup() component inside Suspense\n // which will not have a mounted element\n oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent\n // of the Fragment itself so it can move its children.\n (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement\n // which also requires the correct parent container\n !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.\n oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (\n // In other cases, the parent container is not actually used so we\n // just pass the block element here to avoid a DOM parentNode call.\n fallbackContainer\n )\n );\n patch(\n oldVNode,\n newVNode,\n container,\n null,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n true\n );\n }\n };\n const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {\n if (oldProps !== newProps) {\n if (oldProps !== EMPTY_OBJ) {\n for (const key in oldProps) {\n if (!isReservedProp(key) && !(key in newProps)) {\n hostPatchProp(\n el,\n key,\n oldProps[key],\n null,\n namespace,\n parentComponent\n );\n }\n }\n }\n for (const key in newProps) {\n if (isReservedProp(key)) continue;\n const next = newProps[key];\n const prev = oldProps[key];\n if (next !== prev && key !== \"value\") {\n hostPatchProp(el, key, prev, next, namespace, parentComponent);\n }\n }\n if (\"value\" in newProps) {\n hostPatchProp(el, \"value\", oldProps.value, newProps.value, namespace);\n }\n }\n };\n const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {\n const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(\"\");\n const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(\"\");\n let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;\n if (!!(process.env.NODE_ENV !== \"production\") && // #5523 dev root fragment may inherit directives\n (isHmrUpdating || patchFlag & 2048)) {\n patchFlag = 0;\n optimized = false;\n dynamicChildren = null;\n }\n if (fragmentSlotScopeIds) {\n slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;\n }\n if (n1 == null) {\n hostInsert(fragmentStartAnchor, container, anchor);\n hostInsert(fragmentEndAnchor, container, anchor);\n mountChildren(\n // #10007\n // such fragment like `<></>` will be compiled into\n // a fragment which doesn't have a children.\n // In this case fallback to an empty array\n n2.children || [],\n container,\n fragmentEndAnchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n } else {\n if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result\n // of renderSlot() with no valid children\n n1.dynamicChildren) {\n patchBlockChildren(\n n1.dynamicChildren,\n dynamicChildren,\n container,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds\n );\n if (!!(process.env.NODE_ENV !== \"production\")) {\n traverseStaticChildren(n1, n2);\n } else if (\n // #2080 if the stable fragment has a key, it's a <template v-for> that may\n // get moved around. Make sure all root level vnodes inherit el.\n // #2134 or if it's a component root, it may also get moved around\n // as the component is being moved.\n n2.key != null || parentComponent && n2 === parentComponent.subTree\n ) {\n traverseStaticChildren(\n n1,\n n2,\n true\n /* shallow */\n );\n }\n } else {\n patchChildren(\n n1,\n n2,\n container,\n fragmentEndAnchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n }\n }\n };\n const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {\n n2.slotScopeIds = slotScopeIds;\n if (n1 == null) {\n if (n2.shapeFlag & 512) {\n parentComponent.ctx.activate(\n n2,\n container,\n anchor,\n namespace,\n optimized\n );\n } else {\n mountComponent(\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n optimized\n );\n }\n } else {\n updateComponent(n1, n2, optimized);\n }\n };\n const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {\n const instance = (initialVNode.component = createComponentInstance(\n initialVNode,\n parentComponent,\n parentSuspense\n ));\n if (!!(process.env.NODE_ENV !== \"production\") && instance.type.__hmrId) {\n registerHMR(instance);\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n pushWarningContext(initialVNode);\n startMeasure(instance, `mount`);\n }\n if (isKeepAlive(initialVNode)) {\n instance.ctx.renderer = internals;\n }\n {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n startMeasure(instance, `init`);\n }\n setupComponent(instance, false, optimized);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n endMeasure(instance, `init`);\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") && isHmrUpdating) initialVNode.el = null;\n if (instance.asyncDep) {\n parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);\n if (!initialVNode.el) {\n const placeholder = instance.subTree = createVNode(Comment);\n processCommentNode(null, placeholder, container, anchor);\n initialVNode.placeholder = placeholder.el;\n }\n } else {\n setupRenderEffect(\n instance,\n initialVNode,\n container,\n anchor,\n parentSuspense,\n namespace,\n optimized\n );\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n popWarningContext();\n endMeasure(instance, `mount`);\n }\n };\n const updateComponent = (n1, n2, optimized) => {\n const instance = n2.component = n1.component;\n if (shouldUpdateComponent(n1, n2, optimized)) {\n if (instance.asyncDep && !instance.asyncResolved) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n pushWarningContext(n2);\n }\n updateComponentPreRender(instance, n2, optimized);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n popWarningContext();\n }\n return;\n } else {\n instance.next = n2;\n instance.update();\n }\n } else {\n n2.el = n1.el;\n instance.vnode = n2;\n }\n };\n const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {\n const componentUpdateFn = () => {\n if (!instance.isMounted) {\n let vnodeHook;\n const { el, props } = initialVNode;\n const { bm, m, parent, root, type } = instance;\n const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);\n toggleRecurse(instance, false);\n if (bm) {\n invokeArrayFns(bm);\n }\n if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {\n invokeVNodeHook(vnodeHook, parent, initialVNode);\n }\n toggleRecurse(instance, true);\n if (el && hydrateNode) {\n const hydrateSubTree = () => {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n startMeasure(instance, `render`);\n }\n instance.subTree = renderComponentRoot(instance);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n endMeasure(instance, `render`);\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n startMeasure(instance, `hydrate`);\n }\n hydrateNode(\n el,\n instance.subTree,\n instance,\n parentSuspense,\n null\n );\n if (!!(process.env.NODE_ENV !== \"production\")) {\n endMeasure(instance, `hydrate`);\n }\n };\n if (isAsyncWrapperVNode && type.__asyncHydrate) {\n type.__asyncHydrate(\n el,\n instance,\n hydrateSubTree\n );\n } else {\n hydrateSubTree();\n }\n } else {\n if (root.ce && // @ts-expect-error _def is private\n root.ce._def.shadowRoot !== false) {\n root.ce._injectChildStyle(type);\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n startMeasure(instance, `render`);\n }\n const subTree = instance.subTree = renderComponentRoot(instance);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n endMeasure(instance, `render`);\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n startMeasure(instance, `patch`);\n }\n patch(\n null,\n subTree,\n container,\n anchor,\n instance,\n parentSuspense,\n namespace\n );\n if (!!(process.env.NODE_ENV !== \"production\")) {\n endMeasure(instance, `patch`);\n }\n initialVNode.el = subTree.el;\n }\n if (m) {\n queuePostRenderEffect(m, parentSuspense);\n }\n if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {\n const scopedInitialVNode = initialVNode;\n queuePostRenderEffect(\n () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),\n parentSuspense\n );\n }\n if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {\n instance.a && queuePostRenderEffect(instance.a, parentSuspense);\n }\n instance.isMounted = true;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentAdded(instance);\n }\n initialVNode = container = anchor = null;\n } else {\n let { next, bu, u, parent, vnode } = instance;\n {\n const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);\n if (nonHydratedAsyncRoot) {\n if (next) {\n next.el = vnode.el;\n updateComponentPreRender(instance, next, optimized);\n }\n nonHydratedAsyncRoot.asyncDep.then(() => {\n if (!instance.isUnmounted) {\n componentUpdateFn();\n }\n });\n return;\n }\n }\n let originNext = next;\n let vnodeHook;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n pushWarningContext(next || instance.vnode);\n }\n toggleRecurse(instance, false);\n if (next) {\n next.el = vnode.el;\n updateComponentPreRender(instance, next, optimized);\n } else {\n next = vnode;\n }\n if (bu) {\n invokeArrayFns(bu);\n }\n if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {\n invokeVNodeHook(vnodeHook, parent, next, vnode);\n }\n toggleRecurse(instance, true);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n startMeasure(instance, `render`);\n }\n const nextTree = renderComponentRoot(instance);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n endMeasure(instance, `render`);\n }\n const prevTree = instance.subTree;\n instance.subTree = nextTree;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n startMeasure(instance, `patch`);\n }\n patch(\n prevTree,\n nextTree,\n // parent may have changed if it's in a teleport\n hostParentNode(prevTree.el),\n // anchor may have changed if it's in a fragment\n getNextHostNode(prevTree),\n instance,\n parentSuspense,\n namespace\n );\n if (!!(process.env.NODE_ENV !== \"production\")) {\n endMeasure(instance, `patch`);\n }\n next.el = nextTree.el;\n if (originNext === null) {\n updateHOCHostEl(instance, nextTree.el);\n }\n if (u) {\n queuePostRenderEffect(u, parentSuspense);\n }\n if (vnodeHook = next.props && next.props.onVnodeUpdated) {\n queuePostRenderEffect(\n () => invokeVNodeHook(vnodeHook, parent, next, vnode),\n parentSuspense\n );\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentUpdated(instance);\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n popWarningContext();\n }\n }\n };\n instance.scope.on();\n const effect = instance.effect = new ReactiveEffect(componentUpdateFn);\n instance.scope.off();\n const update = instance.update = effect.run.bind(effect);\n const job = instance.job = effect.runIfDirty.bind(effect);\n job.i = instance;\n job.id = instance.uid;\n effect.scheduler = () => queueJob(job);\n toggleRecurse(instance, true);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;\n effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;\n }\n update();\n };\n const updateComponentPreRender = (instance, nextVNode, optimized) => {\n nextVNode.component = instance;\n const prevProps = instance.vnode.props;\n instance.vnode = nextVNode;\n instance.next = null;\n updateProps(instance, nextVNode.props, prevProps, optimized);\n updateSlots(instance, nextVNode.children, optimized);\n pauseTracking();\n flushPreFlushCbs(instance);\n resetTracking();\n };\n const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {\n const c1 = n1 && n1.children;\n const prevShapeFlag = n1 ? n1.shapeFlag : 0;\n const c2 = n2.children;\n const { patchFlag, shapeFlag } = n2;\n if (patchFlag > 0) {\n if (patchFlag & 128) {\n patchKeyedChildren(\n c1,\n c2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n return;\n } else if (patchFlag & 256) {\n patchUnkeyedChildren(\n c1,\n c2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n return;\n }\n }\n if (shapeFlag & 8) {\n if (prevShapeFlag & 16) {\n unmountChildren(c1, parentComponent, parentSuspense);\n }\n if (c2 !== c1) {\n hostSetElementText(container, c2);\n }\n } else {\n if (prevShapeFlag & 16) {\n if (shapeFlag & 16) {\n patchKeyedChildren(\n c1,\n c2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n } else {\n unmountChildren(c1, parentComponent, parentSuspense, true);\n }\n } else {\n if (prevShapeFlag & 8) {\n hostSetElementText(container, \"\");\n }\n if (shapeFlag & 16) {\n mountChildren(\n c2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n }\n }\n }\n };\n const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {\n c1 = c1 || EMPTY_ARR;\n c2 = c2 || EMPTY_ARR;\n const oldLength = c1.length;\n const newLength = c2.length;\n const commonLength = Math.min(oldLength, newLength);\n let i;\n for (i = 0; i < commonLength; i++) {\n const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);\n patch(\n c1[i],\n nextChild,\n container,\n null,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n }\n if (oldLength > newLength) {\n unmountChildren(\n c1,\n parentComponent,\n parentSuspense,\n true,\n false,\n commonLength\n );\n } else {\n mountChildren(\n c2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized,\n commonLength\n );\n }\n };\n const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {\n let i = 0;\n const l2 = c2.length;\n let e1 = c1.length - 1;\n let e2 = l2 - 1;\n while (i <= e1 && i <= e2) {\n const n1 = c1[i];\n const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);\n if (isSameVNodeType(n1, n2)) {\n patch(\n n1,\n n2,\n container,\n null,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n } else {\n break;\n }\n i++;\n }\n while (i <= e1 && i <= e2) {\n const n1 = c1[e1];\n const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);\n if (isSameVNodeType(n1, n2)) {\n patch(\n n1,\n n2,\n container,\n null,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n } else {\n break;\n }\n e1--;\n e2--;\n }\n if (i > e1) {\n if (i <= e2) {\n const nextPos = e2 + 1;\n const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;\n while (i <= e2) {\n patch(\n null,\n c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n i++;\n }\n }\n } else if (i > e2) {\n while (i <= e1) {\n unmount(c1[i], parentComponent, parentSuspense, true);\n i++;\n }\n } else {\n const s1 = i;\n const s2 = i;\n const keyToNewIndexMap = /* @__PURE__ */ new Map();\n for (i = s2; i <= e2; i++) {\n const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);\n if (nextChild.key != null) {\n if (!!(process.env.NODE_ENV !== \"production\") && keyToNewIndexMap.has(nextChild.key)) {\n warn$1(\n `Duplicate keys found during update:`,\n JSON.stringify(nextChild.key),\n `Make sure keys are unique.`\n );\n }\n keyToNewIndexMap.set(nextChild.key, i);\n }\n }\n let j;\n let patched = 0;\n const toBePatched = e2 - s2 + 1;\n let moved = false;\n let maxNewIndexSoFar = 0;\n const newIndexToOldIndexMap = new Array(toBePatched);\n for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;\n for (i = s1; i <= e1; i++) {\n const prevChild = c1[i];\n if (patched >= toBePatched) {\n unmount(prevChild, parentComponent, parentSuspense, true);\n continue;\n }\n let newIndex;\n if (prevChild.key != null) {\n newIndex = keyToNewIndexMap.get(prevChild.key);\n } else {\n for (j = s2; j <= e2; j++) {\n if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {\n newIndex = j;\n break;\n }\n }\n }\n if (newIndex === void 0) {\n unmount(prevChild, parentComponent, parentSuspense, true);\n } else {\n newIndexToOldIndexMap[newIndex - s2] = i + 1;\n if (newIndex >= maxNewIndexSoFar) {\n maxNewIndexSoFar = newIndex;\n } else {\n moved = true;\n }\n patch(\n prevChild,\n c2[newIndex],\n container,\n null,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n patched++;\n }\n }\n const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;\n j = increasingNewIndexSequence.length - 1;\n for (i = toBePatched - 1; i >= 0; i--) {\n const nextIndex = s2 + i;\n const nextChild = c2[nextIndex];\n const anchorVNode = c2[nextIndex + 1];\n const anchor = nextIndex + 1 < l2 ? (\n // #13559, fallback to el placeholder for unresolved async component\n anchorVNode.el || anchorVNode.placeholder\n ) : parentAnchor;\n if (newIndexToOldIndexMap[i] === 0) {\n patch(\n null,\n nextChild,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n } else if (moved) {\n if (j < 0 || i !== increasingNewIndexSequence[j]) {\n move(nextChild, container, anchor, 2);\n } else {\n j--;\n }\n }\n }\n }\n };\n const move = (vnode, container, anchor, moveType, parentSuspense = null) => {\n const { el, type, transition, children, shapeFlag } = vnode;\n if (shapeFlag & 6) {\n move(vnode.component.subTree, container, anchor, moveType);\n return;\n }\n if (shapeFlag & 128) {\n vnode.suspense.move(container, anchor, moveType);\n return;\n }\n if (shapeFlag & 64) {\n type.move(vnode, container, anchor, internals);\n return;\n }\n if (type === Fragment) {\n hostInsert(el, container, anchor);\n for (let i = 0; i < children.length; i++) {\n move(children[i], container, anchor, moveType);\n }\n hostInsert(vnode.anchor, container, anchor);\n return;\n }\n if (type === Static) {\n moveStaticNode(vnode, container, anchor);\n return;\n }\n const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;\n if (needTransition2) {\n if (moveType === 0) {\n transition.beforeEnter(el);\n hostInsert(el, container, anchor);\n queuePostRenderEffect(() => transition.enter(el), parentSuspense);\n } else {\n const { leave, delayLeave, afterLeave } = transition;\n const remove2 = () => {\n if (vnode.ctx.isUnmounted) {\n hostRemove(el);\n } else {\n hostInsert(el, container, anchor);\n }\n };\n const performLeave = () => {\n leave(el, () => {\n remove2();\n afterLeave && afterLeave();\n });\n };\n if (delayLeave) {\n delayLeave(el, remove2, performLeave);\n } else {\n performLeave();\n }\n }\n } else {\n hostInsert(el, container, anchor);\n }\n };\n const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {\n const {\n type,\n props,\n ref,\n children,\n dynamicChildren,\n shapeFlag,\n patchFlag,\n dirs,\n cacheIndex\n } = vnode;\n if (patchFlag === -2) {\n optimized = false;\n }\n if (ref != null) {\n pauseTracking();\n setRef(ref, null, parentSuspense, vnode, true);\n resetTracking();\n }\n if (cacheIndex != null) {\n parentComponent.renderCache[cacheIndex] = void 0;\n }\n if (shapeFlag & 256) {\n parentComponent.ctx.deactivate(vnode);\n return;\n }\n const shouldInvokeDirs = shapeFlag & 1 && dirs;\n const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);\n let vnodeHook;\n if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {\n invokeVNodeHook(vnodeHook, parentComponent, vnode);\n }\n if (shapeFlag & 6) {\n unmountComponent(vnode.component, parentSuspense, doRemove);\n } else {\n if (shapeFlag & 128) {\n vnode.suspense.unmount(parentSuspense, doRemove);\n return;\n }\n if (shouldInvokeDirs) {\n invokeDirectiveHook(vnode, null, parentComponent, \"beforeUnmount\");\n }\n if (shapeFlag & 64) {\n vnode.type.remove(\n vnode,\n parentComponent,\n parentSuspense,\n internals,\n doRemove\n );\n } else if (dynamicChildren && // #5154\n // when v-once is used inside a block, setBlockTracking(-1) marks the\n // parent block with hasOnce: true\n // so that it doesn't take the fast path during unmount - otherwise\n // components nested in v-once are never unmounted.\n !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments\n (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {\n unmountChildren(\n dynamicChildren,\n parentComponent,\n parentSuspense,\n false,\n true\n );\n } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {\n unmountChildren(children, parentComponent, parentSuspense);\n }\n if (doRemove) {\n remove(vnode);\n }\n }\n if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {\n queuePostRenderEffect(() => {\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\n shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, \"unmounted\");\n }, parentSuspense);\n }\n };\n const remove = (vnode) => {\n const { type, el, anchor, transition } = vnode;\n if (type === Fragment) {\n if (!!(process.env.NODE_ENV !== \"production\") && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {\n vnode.children.forEach((child) => {\n if (child.type === Comment) {\n hostRemove(child.el);\n } else {\n remove(child);\n }\n });\n } else {\n removeFragment(el, anchor);\n }\n return;\n }\n if (type === Static) {\n removeStaticNode(vnode);\n return;\n }\n const performRemove = () => {\n hostRemove(el);\n if (transition && !transition.persisted && transition.afterLeave) {\n transition.afterLeave();\n }\n };\n if (vnode.shapeFlag & 1 && transition && !transition.persisted) {\n const { leave, delayLeave } = transition;\n const performLeave = () => leave(el, performRemove);\n if (delayLeave) {\n delayLeave(vnode.el, performRemove, performLeave);\n } else {\n performLeave();\n }\n } else {\n performRemove();\n }\n };\n const removeFragment = (cur, end) => {\n let next;\n while (cur !== end) {\n next = hostNextSibling(cur);\n hostRemove(cur);\n cur = next;\n }\n hostRemove(end);\n };\n const unmountComponent = (instance, parentSuspense, doRemove) => {\n if (!!(process.env.NODE_ENV !== \"production\") && instance.type.__hmrId) {\n unregisterHMR(instance);\n }\n const {\n bum,\n scope,\n job,\n subTree,\n um,\n m,\n a,\n parent,\n slots: { __: slotCacheKeys }\n } = instance;\n invalidateMount(m);\n invalidateMount(a);\n if (bum) {\n invokeArrayFns(bum);\n }\n if (parent && isArray(slotCacheKeys)) {\n slotCacheKeys.forEach((v) => {\n parent.renderCache[v] = void 0;\n });\n }\n scope.stop();\n if (job) {\n job.flags |= 8;\n unmount(subTree, instance, parentSuspense, doRemove);\n }\n if (um) {\n queuePostRenderEffect(um, parentSuspense);\n }\n queuePostRenderEffect(() => {\n instance.isUnmounted = true;\n }, parentSuspense);\n if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {\n parentSuspense.deps--;\n if (parentSuspense.deps === 0) {\n parentSuspense.resolve();\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentRemoved(instance);\n }\n };\n const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {\n for (let i = start; i < children.length; i++) {\n unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);\n }\n };\n const getNextHostNode = (vnode) => {\n if (vnode.shapeFlag & 6) {\n return getNextHostNode(vnode.component.subTree);\n }\n if (vnode.shapeFlag & 128) {\n return vnode.suspense.next();\n }\n const el = hostNextSibling(vnode.anchor || vnode.el);\n const teleportEnd = el && el[TeleportEndKey];\n return teleportEnd ? hostNextSibling(teleportEnd) : el;\n };\n let isFlushing = false;\n const render = (vnode, container, namespace) => {\n if (vnode == null) {\n if (container._vnode) {\n unmount(container._vnode, null, null, true);\n }\n } else {\n patch(\n container._vnode || null,\n vnode,\n container,\n null,\n null,\n null,\n namespace\n );\n }\n container._vnode = vnode;\n if (!isFlushing) {\n isFlushing = true;\n flushPreFlushCbs();\n flushPostFlushCbs();\n isFlushing = false;\n }\n };\n const internals = {\n p: patch,\n um: unmount,\n m: move,\n r: remove,\n mt: mountComponent,\n mc: mountChildren,\n pc: patchChildren,\n pbc: patchBlockChildren,\n n: getNextHostNode,\n o: options\n };\n let hydrate;\n let hydrateNode;\n if (createHydrationFns) {\n [hydrate, hydrateNode] = createHydrationFns(\n internals\n );\n }\n return {\n render,\n hydrate,\n createApp: createAppAPI(render, hydrate)\n };\n}\nfunction resolveChildrenNamespace({ type, props }, currentNamespace) {\n return currentNamespace === \"svg\" && type === \"foreignObject\" || currentNamespace === \"mathml\" && type === \"annotation-xml\" && props && props.encoding && props.encoding.includes(\"html\") ? void 0 : currentNamespace;\n}\nfunction toggleRecurse({ effect, job }, allowed) {\n if (allowed) {\n effect.flags |= 32;\n job.flags |= 4;\n } else {\n effect.flags &= -33;\n job.flags &= -5;\n }\n}\nfunction needTransition(parentSuspense, transition) {\n return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;\n}\nfunction traverseStaticChildren(n1, n2, shallow = false) {\n const ch1 = n1.children;\n const ch2 = n2.children;\n if (isArray(ch1) && isArray(ch2)) {\n for (let i = 0; i < ch1.length; i++) {\n const c1 = ch1[i];\n let c2 = ch2[i];\n if (c2.shapeFlag & 1 && !c2.dynamicChildren) {\n if (c2.patchFlag <= 0 || c2.patchFlag === 32) {\n c2 = ch2[i] = cloneIfMounted(ch2[i]);\n c2.el = c1.el;\n }\n if (!shallow && c2.patchFlag !== -2)\n traverseStaticChildren(c1, c2);\n }\n if (c2.type === Text) {\n c2.el = c1.el;\n }\n if (c2.type === Comment && !c2.el) {\n c2.el = c1.el;\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n c2.el && (c2.el.__vnode = c2);\n }\n }\n }\n}\nfunction getSequence(arr) {\n const p = arr.slice();\n const result = [0];\n let i, j, u, v, c;\n const len = arr.length;\n for (i = 0; i < len; i++) {\n const arrI = arr[i];\n if (arrI !== 0) {\n j = result[result.length - 1];\n if (arr[j] < arrI) {\n p[i] = j;\n result.push(i);\n continue;\n }\n u = 0;\n v = result.length - 1;\n while (u < v) {\n c = u + v >> 1;\n if (arr[result[c]] < arrI) {\n u = c + 1;\n } else {\n v = c;\n }\n }\n if (arrI < arr[result[u]]) {\n if (u > 0) {\n p[i] = result[u - 1];\n }\n result[u] = i;\n }\n }\n }\n u = result.length;\n v = result[u - 1];\n while (u-- > 0) {\n result[u] = v;\n v = p[v];\n }\n return result;\n}\nfunction locateNonHydratedAsyncRoot(instance) {\n const subComponent = instance.subTree.component;\n if (subComponent) {\n if (subComponent.asyncDep && !subComponent.asyncResolved) {\n return subComponent;\n } else {\n return locateNonHydratedAsyncRoot(subComponent);\n }\n }\n}\nfunction invalidateMount(hooks) {\n if (hooks) {\n for (let i = 0; i < hooks.length; i++)\n hooks[i].flags |= 8;\n }\n}\n\nconst ssrContextKey = Symbol.for(\"v-scx\");\nconst useSSRContext = () => {\n {\n const ctx = inject(ssrContextKey);\n if (!ctx) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(\n `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`\n );\n }\n return ctx;\n }\n};\n\nfunction watchEffect(effect, options) {\n return doWatch(effect, null, options);\n}\nfunction watchPostEffect(effect, options) {\n return doWatch(\n effect,\n null,\n !!(process.env.NODE_ENV !== \"production\") ? extend({}, options, { flush: \"post\" }) : { flush: \"post\" }\n );\n}\nfunction watchSyncEffect(effect, options) {\n return doWatch(\n effect,\n null,\n !!(process.env.NODE_ENV !== \"production\") ? extend({}, options, { flush: \"sync\" }) : { flush: \"sync\" }\n );\n}\nfunction watch(source, cb, options) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isFunction(cb)) {\n warn$1(\n `\\`watch(fn, options?)\\` signature has been moved to a separate API. Use \\`watchEffect(fn, options?)\\` instead. \\`watch\\` now only supports \\`watch(source, cb, options?) signature.`\n );\n }\n return doWatch(source, cb, options);\n}\nfunction doWatch(source, cb, options = EMPTY_OBJ) {\n const { immediate, deep, flush, once } = options;\n if (!!(process.env.NODE_ENV !== \"production\") && !cb) {\n if (immediate !== void 0) {\n warn$1(\n `watch() \"immediate\" option is only respected when using the watch(source, callback, options?) signature.`\n );\n }\n if (deep !== void 0) {\n warn$1(\n `watch() \"deep\" option is only respected when using the watch(source, callback, options?) signature.`\n );\n }\n if (once !== void 0) {\n warn$1(\n `watch() \"once\" option is only respected when using the watch(source, callback, options?) signature.`\n );\n }\n }\n const baseWatchOptions = extend({}, options);\n if (!!(process.env.NODE_ENV !== \"production\")) baseWatchOptions.onWarn = warn$1;\n const runsImmediately = cb && immediate || !cb && flush !== \"post\";\n let ssrCleanup;\n if (isInSSRComponentSetup) {\n if (flush === \"sync\") {\n const ctx = useSSRContext();\n ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);\n } else if (!runsImmediately) {\n const watchStopHandle = () => {\n };\n watchStopHandle.stop = NOOP;\n watchStopHandle.resume = NOOP;\n watchStopHandle.pause = NOOP;\n return watchStopHandle;\n }\n }\n const instance = currentInstance;\n baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);\n let isPre = false;\n if (flush === \"post\") {\n baseWatchOptions.scheduler = (job) => {\n queuePostRenderEffect(job, instance && instance.suspense);\n };\n } else if (flush !== \"sync\") {\n isPre = true;\n baseWatchOptions.scheduler = (job, isFirstRun) => {\n if (isFirstRun) {\n job();\n } else {\n queueJob(job);\n }\n };\n }\n baseWatchOptions.augmentJob = (job) => {\n if (cb) {\n job.flags |= 4;\n }\n if (isPre) {\n job.flags |= 2;\n if (instance) {\n job.id = instance.uid;\n job.i = instance;\n }\n }\n };\n const watchHandle = watch$1(source, cb, baseWatchOptions);\n if (isInSSRComponentSetup) {\n if (ssrCleanup) {\n ssrCleanup.push(watchHandle);\n } else if (runsImmediately) {\n watchHandle();\n }\n }\n return watchHandle;\n}\nfunction instanceWatch(source, value, options) {\n const publicThis = this.proxy;\n const getter = isString(source) ? source.includes(\".\") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);\n let cb;\n if (isFunction(value)) {\n cb = value;\n } else {\n cb = value.handler;\n options = value;\n }\n const reset = setCurrentInstance(this);\n const res = doWatch(getter, cb.bind(publicThis), options);\n reset();\n return res;\n}\nfunction createPathGetter(ctx, path) {\n const segments = path.split(\".\");\n return () => {\n let cur = ctx;\n for (let i = 0; i < segments.length && cur; i++) {\n cur = cur[segments[i]];\n }\n return cur;\n };\n}\n\nfunction useModel(props, name, options = EMPTY_OBJ) {\n const i = getCurrentInstance();\n if (!!(process.env.NODE_ENV !== \"production\") && !i) {\n warn$1(`useModel() called without active instance.`);\n return ref();\n }\n const camelizedName = camelize(name);\n if (!!(process.env.NODE_ENV !== \"production\") && !i.propsOptions[0][camelizedName]) {\n warn$1(`useModel() called with prop \"${name}\" which is not declared.`);\n return ref();\n }\n const hyphenatedName = hyphenate(name);\n const modifiers = getModelModifiers(props, camelizedName);\n const res = customRef((track, trigger) => {\n let localValue;\n let prevSetValue = EMPTY_OBJ;\n let prevEmittedValue;\n watchSyncEffect(() => {\n const propValue = props[camelizedName];\n if (hasChanged(localValue, propValue)) {\n localValue = propValue;\n trigger();\n }\n });\n return {\n get() {\n track();\n return options.get ? options.get(localValue) : localValue;\n },\n set(value) {\n const emittedValue = options.set ? options.set(value) : value;\n if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {\n return;\n }\n const rawProps = i.vnode.props;\n if (!(rawProps && // check if parent has passed v-model\n (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {\n localValue = value;\n trigger();\n }\n i.emit(`update:${name}`, emittedValue);\n if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {\n trigger();\n }\n prevSetValue = value;\n prevEmittedValue = emittedValue;\n }\n };\n });\n res[Symbol.iterator] = () => {\n let i2 = 0;\n return {\n next() {\n if (i2 < 2) {\n return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };\n } else {\n return { done: true };\n }\n }\n };\n };\n return res;\n}\nconst getModelModifiers = (props, modelName) => {\n return modelName === \"modelValue\" || modelName === \"model-value\" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];\n};\n\nfunction emit(instance, event, ...rawArgs) {\n if (instance.isUnmounted) return;\n const props = instance.vnode.props || EMPTY_OBJ;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const {\n emitsOptions,\n propsOptions: [propsOptions]\n } = instance;\n if (emitsOptions) {\n if (!(event in emitsOptions) && true) {\n if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {\n warn$1(\n `Component emitted event \"${event}\" but it is neither declared in the emits option nor as an \"${toHandlerKey(camelize(event))}\" prop.`\n );\n }\n } else {\n const validator = emitsOptions[event];\n if (isFunction(validator)) {\n const isValid = validator(...rawArgs);\n if (!isValid) {\n warn$1(\n `Invalid event arguments: event validation failed for event \"${event}\".`\n );\n }\n }\n }\n }\n }\n let args = rawArgs;\n const isModelListener = event.startsWith(\"update:\");\n const modifiers = isModelListener && getModelModifiers(props, event.slice(7));\n if (modifiers) {\n if (modifiers.trim) {\n args = rawArgs.map((a) => isString(a) ? a.trim() : a);\n }\n if (modifiers.number) {\n args = rawArgs.map(looseToNumber);\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentEmit(instance, event, args);\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const lowerCaseEvent = event.toLowerCase();\n if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {\n warn$1(\n `Event \"${lowerCaseEvent}\" is emitted in component ${formatComponentName(\n instance,\n instance.type\n )} but the handler is registered for \"${event}\". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use \"${hyphenate(\n event\n )}\" instead of \"${event}\".`\n );\n }\n }\n let handlerName;\n let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)\n props[handlerName = toHandlerKey(camelize(event))];\n if (!handler && isModelListener) {\n handler = props[handlerName = toHandlerKey(hyphenate(event))];\n }\n if (handler) {\n callWithAsyncErrorHandling(\n handler,\n instance,\n 6,\n args\n );\n }\n const onceHandler = props[handlerName + `Once`];\n if (onceHandler) {\n if (!instance.emitted) {\n instance.emitted = {};\n } else if (instance.emitted[handlerName]) {\n return;\n }\n instance.emitted[handlerName] = true;\n callWithAsyncErrorHandling(\n onceHandler,\n instance,\n 6,\n args\n );\n }\n}\nfunction normalizeEmitsOptions(comp, appContext, asMixin = false) {\n const cache = appContext.emitsCache;\n const cached = cache.get(comp);\n if (cached !== void 0) {\n return cached;\n }\n const raw = comp.emits;\n let normalized = {};\n let hasExtends = false;\n if (__VUE_OPTIONS_API__ && !isFunction(comp)) {\n const extendEmits = (raw2) => {\n const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);\n if (normalizedFromExtend) {\n hasExtends = true;\n extend(normalized, normalizedFromExtend);\n }\n };\n if (!asMixin && appContext.mixins.length) {\n appContext.mixins.forEach(extendEmits);\n }\n if (comp.extends) {\n extendEmits(comp.extends);\n }\n if (comp.mixins) {\n comp.mixins.forEach(extendEmits);\n }\n }\n if (!raw && !hasExtends) {\n if (isObject(comp)) {\n cache.set(comp, null);\n }\n return null;\n }\n if (isArray(raw)) {\n raw.forEach((key) => normalized[key] = null);\n } else {\n extend(normalized, raw);\n }\n if (isObject(comp)) {\n cache.set(comp, normalized);\n }\n return normalized;\n}\nfunction isEmitListener(options, key) {\n if (!options || !isOn(key)) {\n return false;\n }\n key = key.slice(2).replace(/Once$/, \"\");\n return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);\n}\n\nlet accessedAttrs = false;\nfunction markAttrsAccessed() {\n accessedAttrs = true;\n}\nfunction renderComponentRoot(instance) {\n const {\n type: Component,\n vnode,\n proxy,\n withProxy,\n propsOptions: [propsOptions],\n slots,\n attrs,\n emit,\n render,\n renderCache,\n props,\n data,\n setupState,\n ctx,\n inheritAttrs\n } = instance;\n const prev = setCurrentRenderingInstance(instance);\n let result;\n let fallthroughAttrs;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n accessedAttrs = false;\n }\n try {\n if (vnode.shapeFlag & 4) {\n const proxyToUse = withProxy || proxy;\n const thisProxy = !!(process.env.NODE_ENV !== \"production\") && setupState.__isScriptSetup ? new Proxy(proxyToUse, {\n get(target, key, receiver) {\n warn$1(\n `Property '${String(\n key\n )}' was accessed via 'this'. Avoid using 'this' in templates.`\n );\n return Reflect.get(target, key, receiver);\n }\n }) : proxyToUse;\n result = normalizeVNode(\n render.call(\n thisProxy,\n proxyToUse,\n renderCache,\n !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(props) : props,\n setupState,\n data,\n ctx\n )\n );\n fallthroughAttrs = attrs;\n } else {\n const render2 = Component;\n if (!!(process.env.NODE_ENV !== \"production\") && attrs === props) {\n markAttrsAccessed();\n }\n result = normalizeVNode(\n render2.length > 1 ? render2(\n !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(props) : props,\n !!(process.env.NODE_ENV !== \"production\") ? {\n get attrs() {\n markAttrsAccessed();\n return shallowReadonly(attrs);\n },\n slots,\n emit\n } : { attrs, slots, emit }\n ) : render2(\n !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(props) : props,\n null\n )\n );\n fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);\n }\n } catch (err) {\n blockStack.length = 0;\n handleError(err, instance, 1);\n result = createVNode(Comment);\n }\n let root = result;\n let setRoot = void 0;\n if (!!(process.env.NODE_ENV !== \"production\") && result.patchFlag > 0 && result.patchFlag & 2048) {\n [root, setRoot] = getChildRoot(result);\n }\n if (fallthroughAttrs && inheritAttrs !== false) {\n const keys = Object.keys(fallthroughAttrs);\n const { shapeFlag } = root;\n if (keys.length) {\n if (shapeFlag & (1 | 6)) {\n if (propsOptions && keys.some(isModelListener)) {\n fallthroughAttrs = filterModelListeners(\n fallthroughAttrs,\n propsOptions\n );\n }\n root = cloneVNode(root, fallthroughAttrs, false, true);\n } else if (!!(process.env.NODE_ENV !== \"production\") && !accessedAttrs && root.type !== Comment) {\n const allAttrs = Object.keys(attrs);\n const eventAttrs = [];\n const extraAttrs = [];\n for (let i = 0, l = allAttrs.length; i < l; i++) {\n const key = allAttrs[i];\n if (isOn(key)) {\n if (!isModelListener(key)) {\n eventAttrs.push(key[2].toLowerCase() + key.slice(3));\n }\n } else {\n extraAttrs.push(key);\n }\n }\n if (extraAttrs.length) {\n warn$1(\n `Extraneous non-props attributes (${extraAttrs.join(\", \")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`\n );\n }\n if (eventAttrs.length) {\n warn$1(\n `Extraneous non-emits event listeners (${eventAttrs.join(\", \")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the \"emits\" option.`\n );\n }\n }\n }\n }\n if (vnode.dirs) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isElementRoot(root)) {\n warn$1(\n `Runtime directive used on component with non-element root node. The directives will not function as intended.`\n );\n }\n root = cloneVNode(root, null, false, true);\n root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;\n }\n if (vnode.transition) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isElementRoot(root)) {\n warn$1(\n `Component inside <Transition> renders non-element root node that cannot be animated.`\n );\n }\n setTransitionHooks(root, vnode.transition);\n }\n if (!!(process.env.NODE_ENV !== \"production\") && setRoot) {\n setRoot(root);\n } else {\n result = root;\n }\n setCurrentRenderingInstance(prev);\n return result;\n}\nconst getChildRoot = (vnode) => {\n const rawChildren = vnode.children;\n const dynamicChildren = vnode.dynamicChildren;\n const childRoot = filterSingleRoot(rawChildren, false);\n if (!childRoot) {\n return [vnode, void 0];\n } else if (!!(process.env.NODE_ENV !== \"production\") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {\n return getChildRoot(childRoot);\n }\n const index = rawChildren.indexOf(childRoot);\n const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;\n const setRoot = (updatedRoot) => {\n rawChildren[index] = updatedRoot;\n if (dynamicChildren) {\n if (dynamicIndex > -1) {\n dynamicChildren[dynamicIndex] = updatedRoot;\n } else if (updatedRoot.patchFlag > 0) {\n vnode.dynamicChildren = [...dynamicChildren, updatedRoot];\n }\n }\n };\n return [normalizeVNode(childRoot), setRoot];\n};\nfunction filterSingleRoot(children, recurse = true) {\n let singleRoot;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (isVNode(child)) {\n if (child.type !== Comment || child.children === \"v-if\") {\n if (singleRoot) {\n return;\n } else {\n singleRoot = child;\n if (!!(process.env.NODE_ENV !== \"production\") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {\n return filterSingleRoot(singleRoot.children);\n }\n }\n }\n } else {\n return;\n }\n }\n return singleRoot;\n}\nconst getFunctionalFallthrough = (attrs) => {\n let res;\n for (const key in attrs) {\n if (key === \"class\" || key === \"style\" || isOn(key)) {\n (res || (res = {}))[key] = attrs[key];\n }\n }\n return res;\n};\nconst filterModelListeners = (attrs, props) => {\n const res = {};\n for (const key in attrs) {\n if (!isModelListener(key) || !(key.slice(9) in props)) {\n res[key] = attrs[key];\n }\n }\n return res;\n};\nconst isElementRoot = (vnode) => {\n return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;\n};\nfunction shouldUpdateComponent(prevVNode, nextVNode, optimized) {\n const { props: prevProps, children: prevChildren, component } = prevVNode;\n const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;\n const emits = component.emitsOptions;\n if (!!(process.env.NODE_ENV !== \"production\") && (prevChildren || nextChildren) && isHmrUpdating) {\n return true;\n }\n if (nextVNode.dirs || nextVNode.transition) {\n return true;\n }\n if (optimized && patchFlag >= 0) {\n if (patchFlag & 1024) {\n return true;\n }\n if (patchFlag & 16) {\n if (!prevProps) {\n return !!nextProps;\n }\n return hasPropsChanged(prevProps, nextProps, emits);\n } else if (patchFlag & 8) {\n const dynamicProps = nextVNode.dynamicProps;\n for (let i = 0; i < dynamicProps.length; i++) {\n const key = dynamicProps[i];\n if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {\n return true;\n }\n }\n }\n } else {\n if (prevChildren || nextChildren) {\n if (!nextChildren || !nextChildren.$stable) {\n return true;\n }\n }\n if (prevProps === nextProps) {\n return false;\n }\n if (!prevProps) {\n return !!nextProps;\n }\n if (!nextProps) {\n return true;\n }\n return hasPropsChanged(prevProps, nextProps, emits);\n }\n return false;\n}\nfunction hasPropsChanged(prevProps, nextProps, emitsOptions) {\n const nextKeys = Object.keys(nextProps);\n if (nextKeys.length !== Object.keys(prevProps).length) {\n return true;\n }\n for (let i = 0; i < nextKeys.length; i++) {\n const key = nextKeys[i];\n if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {\n return true;\n }\n }\n return false;\n}\nfunction updateHOCHostEl({ vnode, parent }, el) {\n while (parent) {\n const root = parent.subTree;\n if (root.suspense && root.suspense.activeBranch === vnode) {\n root.el = vnode.el;\n }\n if (root === vnode) {\n (vnode = parent.vnode).el = el;\n parent = parent.parent;\n } else {\n break;\n }\n }\n}\n\nconst isSuspense = (type) => type.__isSuspense;\nlet suspenseId = 0;\nconst SuspenseImpl = {\n name: \"Suspense\",\n // In order to make Suspense tree-shakable, we need to avoid importing it\n // directly in the renderer. The renderer checks for the __isSuspense flag\n // on a vnode's type and calls the `process` method, passing in renderer\n // internals.\n __isSuspense: true,\n process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {\n if (n1 == null) {\n mountSuspense(\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized,\n rendererInternals\n );\n } else {\n if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {\n n2.suspense = n1.suspense;\n n2.suspense.vnode = n2;\n n2.el = n1.el;\n return;\n }\n patchSuspense(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n namespace,\n slotScopeIds,\n optimized,\n rendererInternals\n );\n }\n },\n hydrate: hydrateSuspense,\n normalize: normalizeSuspenseChildren\n};\nconst Suspense = SuspenseImpl ;\nfunction triggerEvent(vnode, name) {\n const eventListener = vnode.props && vnode.props[name];\n if (isFunction(eventListener)) {\n eventListener();\n }\n}\nfunction mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {\n const {\n p: patch,\n o: { createElement }\n } = rendererInternals;\n const hiddenContainer = createElement(\"div\");\n const suspense = vnode.suspense = createSuspenseBoundary(\n vnode,\n parentSuspense,\n parentComponent,\n container,\n hiddenContainer,\n anchor,\n namespace,\n slotScopeIds,\n optimized,\n rendererInternals\n );\n patch(\n null,\n suspense.pendingBranch = vnode.ssContent,\n hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds\n );\n if (suspense.deps > 0) {\n triggerEvent(vnode, \"onPending\");\n triggerEvent(vnode, \"onFallback\");\n patch(\n null,\n vnode.ssFallback,\n container,\n anchor,\n parentComponent,\n null,\n // fallback tree will not have suspense context\n namespace,\n slotScopeIds\n );\n setActiveBranch(suspense, vnode.ssFallback);\n } else {\n suspense.resolve(false, true);\n }\n}\nfunction patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {\n const suspense = n2.suspense = n1.suspense;\n suspense.vnode = n2;\n n2.el = n1.el;\n const newBranch = n2.ssContent;\n const newFallback = n2.ssFallback;\n const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;\n if (pendingBranch) {\n suspense.pendingBranch = newBranch;\n if (isSameVNodeType(newBranch, pendingBranch)) {\n patch(\n pendingBranch,\n newBranch,\n suspense.hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n if (suspense.deps <= 0) {\n suspense.resolve();\n } else if (isInFallback) {\n if (!isHydrating) {\n patch(\n activeBranch,\n newFallback,\n container,\n anchor,\n parentComponent,\n null,\n // fallback tree will not have suspense context\n namespace,\n slotScopeIds,\n optimized\n );\n setActiveBranch(suspense, newFallback);\n }\n }\n } else {\n suspense.pendingId = suspenseId++;\n if (isHydrating) {\n suspense.isHydrating = false;\n suspense.activeBranch = pendingBranch;\n } else {\n unmount(pendingBranch, parentComponent, suspense);\n }\n suspense.deps = 0;\n suspense.effects.length = 0;\n suspense.hiddenContainer = createElement(\"div\");\n if (isInFallback) {\n patch(\n null,\n newBranch,\n suspense.hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n if (suspense.deps <= 0) {\n suspense.resolve();\n } else {\n patch(\n activeBranch,\n newFallback,\n container,\n anchor,\n parentComponent,\n null,\n // fallback tree will not have suspense context\n namespace,\n slotScopeIds,\n optimized\n );\n setActiveBranch(suspense, newFallback);\n }\n } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\n patch(\n activeBranch,\n newBranch,\n container,\n anchor,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n suspense.resolve(true);\n } else {\n patch(\n null,\n newBranch,\n suspense.hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n if (suspense.deps <= 0) {\n suspense.resolve();\n }\n }\n }\n } else {\n if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\n patch(\n activeBranch,\n newBranch,\n container,\n anchor,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n setActiveBranch(suspense, newBranch);\n } else {\n triggerEvent(n2, \"onPending\");\n suspense.pendingBranch = newBranch;\n if (newBranch.shapeFlag & 512) {\n suspense.pendingId = newBranch.component.suspenseId;\n } else {\n suspense.pendingId = suspenseId++;\n }\n patch(\n null,\n newBranch,\n suspense.hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n if (suspense.deps <= 0) {\n suspense.resolve();\n } else {\n const { timeout, pendingId } = suspense;\n if (timeout > 0) {\n setTimeout(() => {\n if (suspense.pendingId === pendingId) {\n suspense.fallback(newFallback);\n }\n }, timeout);\n } else if (timeout === 0) {\n suspense.fallback(newFallback);\n }\n }\n }\n }\n}\nlet hasWarned = false;\nfunction createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {\n if (!!(process.env.NODE_ENV !== \"production\") && true && !hasWarned) {\n hasWarned = true;\n console[console.info ? \"info\" : \"log\"](\n `<Suspense> is an experimental feature and its API will likely change.`\n );\n }\n const {\n p: patch,\n m: move,\n um: unmount,\n n: next,\n o: { parentNode, remove }\n } = rendererInternals;\n let parentSuspenseId;\n const isSuspensible = isVNodeSuspensible(vnode);\n if (isSuspensible) {\n if (parentSuspense && parentSuspense.pendingBranch) {\n parentSuspenseId = parentSuspense.pendingId;\n parentSuspense.deps++;\n }\n }\n const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n assertNumber(timeout, `Suspense timeout`);\n }\n const initialAnchor = anchor;\n const suspense = {\n vnode,\n parent: parentSuspense,\n parentComponent,\n namespace,\n container,\n hiddenContainer,\n deps: 0,\n pendingId: suspenseId++,\n timeout: typeof timeout === \"number\" ? timeout : -1,\n activeBranch: null,\n pendingBranch: null,\n isInFallback: !isHydrating,\n isHydrating,\n isUnmounted: false,\n effects: [],\n resolve(resume = false, sync = false) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n if (!resume && !suspense.pendingBranch) {\n throw new Error(\n `suspense.resolve() is called without a pending branch.`\n );\n }\n if (suspense.isUnmounted) {\n throw new Error(\n `suspense.resolve() is called on an already unmounted suspense boundary.`\n );\n }\n }\n const {\n vnode: vnode2,\n activeBranch,\n pendingBranch,\n pendingId,\n effects,\n parentComponent: parentComponent2,\n container: container2\n } = suspense;\n let delayEnter = false;\n if (suspense.isHydrating) {\n suspense.isHydrating = false;\n } else if (!resume) {\n delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === \"out-in\";\n if (delayEnter) {\n activeBranch.transition.afterLeave = () => {\n if (pendingId === suspense.pendingId) {\n move(\n pendingBranch,\n container2,\n anchor === initialAnchor ? next(activeBranch) : anchor,\n 0\n );\n queuePostFlushCb(effects);\n }\n };\n }\n if (activeBranch) {\n if (parentNode(activeBranch.el) === container2) {\n anchor = next(activeBranch);\n }\n unmount(activeBranch, parentComponent2, suspense, true);\n }\n if (!delayEnter) {\n move(pendingBranch, container2, anchor, 0);\n }\n }\n setActiveBranch(suspense, pendingBranch);\n suspense.pendingBranch = null;\n suspense.isInFallback = false;\n let parent = suspense.parent;\n let hasUnresolvedAncestor = false;\n while (parent) {\n if (parent.pendingBranch) {\n parent.effects.push(...effects);\n hasUnresolvedAncestor = true;\n break;\n }\n parent = parent.parent;\n }\n if (!hasUnresolvedAncestor && !delayEnter) {\n queuePostFlushCb(effects);\n }\n suspense.effects = [];\n if (isSuspensible) {\n if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {\n parentSuspense.deps--;\n if (parentSuspense.deps === 0 && !sync) {\n parentSuspense.resolve();\n }\n }\n }\n triggerEvent(vnode2, \"onResolve\");\n },\n fallback(fallbackVNode) {\n if (!suspense.pendingBranch) {\n return;\n }\n const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;\n triggerEvent(vnode2, \"onFallback\");\n const anchor2 = next(activeBranch);\n const mountFallback = () => {\n if (!suspense.isInFallback) {\n return;\n }\n patch(\n null,\n fallbackVNode,\n container2,\n anchor2,\n parentComponent2,\n null,\n // fallback tree will not have suspense context\n namespace2,\n slotScopeIds,\n optimized\n );\n setActiveBranch(suspense, fallbackVNode);\n };\n const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === \"out-in\";\n if (delayEnter) {\n activeBranch.transition.afterLeave = mountFallback;\n }\n suspense.isInFallback = true;\n unmount(\n activeBranch,\n parentComponent2,\n null,\n // no suspense so unmount hooks fire now\n true\n // shouldRemove\n );\n if (!delayEnter) {\n mountFallback();\n }\n },\n move(container2, anchor2, type) {\n suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);\n suspense.container = container2;\n },\n next() {\n return suspense.activeBranch && next(suspense.activeBranch);\n },\n registerDep(instance, setupRenderEffect, optimized2) {\n const isInPendingSuspense = !!suspense.pendingBranch;\n if (isInPendingSuspense) {\n suspense.deps++;\n }\n const hydratedEl = instance.vnode.el;\n instance.asyncDep.catch((err) => {\n handleError(err, instance, 0);\n }).then((asyncSetupResult) => {\n if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {\n return;\n }\n instance.asyncResolved = true;\n const { vnode: vnode2 } = instance;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n pushWarningContext(vnode2);\n }\n handleSetupResult(instance, asyncSetupResult, false);\n if (hydratedEl) {\n vnode2.el = hydratedEl;\n }\n const placeholder = !hydratedEl && instance.subTree.el;\n setupRenderEffect(\n instance,\n vnode2,\n // component may have been moved before resolve.\n // if this is not a hydration, instance.subTree will be the comment\n // placeholder.\n parentNode(hydratedEl || instance.subTree.el),\n // anchor will not be used if this is hydration, so only need to\n // consider the comment placeholder case.\n hydratedEl ? null : next(instance.subTree),\n suspense,\n namespace,\n optimized2\n );\n if (placeholder) {\n remove(placeholder);\n }\n updateHOCHostEl(instance, vnode2.el);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n popWarningContext();\n }\n if (isInPendingSuspense && --suspense.deps === 0) {\n suspense.resolve();\n }\n });\n },\n unmount(parentSuspense2, doRemove) {\n suspense.isUnmounted = true;\n if (suspense.activeBranch) {\n unmount(\n suspense.activeBranch,\n parentComponent,\n parentSuspense2,\n doRemove\n );\n }\n if (suspense.pendingBranch) {\n unmount(\n suspense.pendingBranch,\n parentComponent,\n parentSuspense2,\n doRemove\n );\n }\n }\n };\n return suspense;\n}\nfunction hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {\n const suspense = vnode.suspense = createSuspenseBoundary(\n vnode,\n parentSuspense,\n parentComponent,\n node.parentNode,\n // eslint-disable-next-line no-restricted-globals\n document.createElement(\"div\"),\n null,\n namespace,\n slotScopeIds,\n optimized,\n rendererInternals,\n true\n );\n const result = hydrateNode(\n node,\n suspense.pendingBranch = vnode.ssContent,\n parentComponent,\n suspense,\n slotScopeIds,\n optimized\n );\n if (suspense.deps === 0) {\n suspense.resolve(false, true);\n }\n return result;\n}\nfunction normalizeSuspenseChildren(vnode) {\n const { shapeFlag, children } = vnode;\n const isSlotChildren = shapeFlag & 32;\n vnode.ssContent = normalizeSuspenseSlot(\n isSlotChildren ? children.default : children\n );\n vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);\n}\nfunction normalizeSuspenseSlot(s) {\n let block;\n if (isFunction(s)) {\n const trackBlock = isBlockTreeEnabled && s._c;\n if (trackBlock) {\n s._d = false;\n openBlock();\n }\n s = s();\n if (trackBlock) {\n s._d = true;\n block = currentBlock;\n closeBlock();\n }\n }\n if (isArray(s)) {\n const singleChild = filterSingleRoot(s);\n if (!!(process.env.NODE_ENV !== \"production\") && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {\n warn$1(`<Suspense> slots expect a single root node.`);\n }\n s = singleChild;\n }\n s = normalizeVNode(s);\n if (block && !s.dynamicChildren) {\n s.dynamicChildren = block.filter((c) => c !== s);\n }\n return s;\n}\nfunction queueEffectWithSuspense(fn, suspense) {\n if (suspense && suspense.pendingBranch) {\n if (isArray(fn)) {\n suspense.effects.push(...fn);\n } else {\n suspense.effects.push(fn);\n }\n } else {\n queuePostFlushCb(fn);\n }\n}\nfunction setActiveBranch(suspense, branch) {\n suspense.activeBranch = branch;\n const { vnode, parentComponent } = suspense;\n let el = branch.el;\n while (!el && branch.component) {\n branch = branch.component.subTree;\n el = branch.el;\n }\n vnode.el = el;\n if (parentComponent && parentComponent.subTree === vnode) {\n parentComponent.vnode.el = el;\n updateHOCHostEl(parentComponent, el);\n }\n}\nfunction isVNodeSuspensible(vnode) {\n const suspensible = vnode.props && vnode.props.suspensible;\n return suspensible != null && suspensible !== false;\n}\n\nconst Fragment = Symbol.for(\"v-fgt\");\nconst Text = Symbol.for(\"v-txt\");\nconst Comment = Symbol.for(\"v-cmt\");\nconst Static = Symbol.for(\"v-stc\");\nconst blockStack = [];\nlet currentBlock = null;\nfunction openBlock(disableTracking = false) {\n blockStack.push(currentBlock = disableTracking ? null : []);\n}\nfunction closeBlock() {\n blockStack.pop();\n currentBlock = blockStack[blockStack.length - 1] || null;\n}\nlet isBlockTreeEnabled = 1;\nfunction setBlockTracking(value, inVOnce = false) {\n isBlockTreeEnabled += value;\n if (value < 0 && currentBlock && inVOnce) {\n currentBlock.hasOnce = true;\n }\n}\nfunction setupBlock(vnode) {\n vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;\n closeBlock();\n if (isBlockTreeEnabled > 0 && currentBlock) {\n currentBlock.push(vnode);\n }\n return vnode;\n}\nfunction createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {\n return setupBlock(\n createBaseVNode(\n type,\n props,\n children,\n patchFlag,\n dynamicProps,\n shapeFlag,\n true\n )\n );\n}\nfunction createBlock(type, props, children, patchFlag, dynamicProps) {\n return setupBlock(\n createVNode(\n type,\n props,\n children,\n patchFlag,\n dynamicProps,\n true\n )\n );\n}\nfunction isVNode(value) {\n return value ? value.__v_isVNode === true : false;\n}\nfunction isSameVNodeType(n1, n2) {\n if (!!(process.env.NODE_ENV !== \"production\") && n2.shapeFlag & 6 && n1.component) {\n const dirtyInstances = hmrDirtyComponents.get(n2.type);\n if (dirtyInstances && dirtyInstances.has(n1.component)) {\n n1.shapeFlag &= -257;\n n2.shapeFlag &= -513;\n return false;\n }\n }\n return n1.type === n2.type && n1.key === n2.key;\n}\nlet vnodeArgsTransformer;\nfunction transformVNodeArgs(transformer) {\n vnodeArgsTransformer = transformer;\n}\nconst createVNodeWithArgsTransform = (...args) => {\n return _createVNode(\n ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args\n );\n};\nconst normalizeKey = ({ key }) => key != null ? key : null;\nconst normalizeRef = ({\n ref,\n ref_key,\n ref_for\n}) => {\n if (typeof ref === \"number\") {\n ref = \"\" + ref;\n }\n return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;\n};\nfunction createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {\n const vnode = {\n __v_isVNode: true,\n __v_skip: true,\n type,\n props,\n key: props && normalizeKey(props),\n ref: props && normalizeRef(props),\n scopeId: currentScopeId,\n slotScopeIds: null,\n children,\n component: null,\n suspense: null,\n ssContent: null,\n ssFallback: null,\n dirs: null,\n transition: null,\n el: null,\n anchor: null,\n target: null,\n targetStart: null,\n targetAnchor: null,\n staticCount: 0,\n shapeFlag,\n patchFlag,\n dynamicProps,\n dynamicChildren: null,\n appContext: null,\n ctx: currentRenderingInstance\n };\n if (needFullChildrenNormalization) {\n normalizeChildren(vnode, children);\n if (shapeFlag & 128) {\n type.normalize(vnode);\n }\n } else if (children) {\n vnode.shapeFlag |= isString(children) ? 8 : 16;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && vnode.key !== vnode.key) {\n warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);\n }\n if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself\n !isBlockNode && // has current parent block\n currentBlock && // presence of a patch flag indicates this node needs patching on updates.\n // component nodes also should always be patched, because even if the\n // component doesn't need to update, it needs to persist the instance on to\n // the next vnode so that it can be properly unmounted later.\n (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the\n // vnode should not be considered dynamic due to handler caching.\n vnode.patchFlag !== 32) {\n currentBlock.push(vnode);\n }\n return vnode;\n}\nconst createVNode = !!(process.env.NODE_ENV !== \"production\") ? createVNodeWithArgsTransform : _createVNode;\nfunction _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {\n if (!type || type === NULL_DYNAMIC_COMPONENT) {\n if (!!(process.env.NODE_ENV !== \"production\") && !type) {\n warn$1(`Invalid vnode type when creating vnode: ${type}.`);\n }\n type = Comment;\n }\n if (isVNode(type)) {\n const cloned = cloneVNode(\n type,\n props,\n true\n /* mergeRef: true */\n );\n if (children) {\n normalizeChildren(cloned, children);\n }\n if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {\n if (cloned.shapeFlag & 6) {\n currentBlock[currentBlock.indexOf(type)] = cloned;\n } else {\n currentBlock.push(cloned);\n }\n }\n cloned.patchFlag = -2;\n return cloned;\n }\n if (isClassComponent(type)) {\n type = type.__vccOpts;\n }\n if (props) {\n props = guardReactiveProps(props);\n let { class: klass, style } = props;\n if (klass && !isString(klass)) {\n props.class = normalizeClass(klass);\n }\n if (isObject(style)) {\n if (isProxy(style) && !isArray(style)) {\n style = extend({}, style);\n }\n props.style = normalizeStyle(style);\n }\n }\n const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;\n if (!!(process.env.NODE_ENV !== \"production\") && shapeFlag & 4 && isProxy(type)) {\n type = toRaw(type);\n warn$1(\n `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \\`markRaw\\` or using \\`shallowRef\\` instead of \\`ref\\`.`,\n `\nComponent that was made reactive: `,\n type\n );\n }\n return createBaseVNode(\n type,\n props,\n children,\n patchFlag,\n dynamicProps,\n shapeFlag,\n isBlockNode,\n true\n );\n}\nfunction guardReactiveProps(props) {\n if (!props) return null;\n return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;\n}\nfunction cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {\n const { props, ref, patchFlag, children, transition } = vnode;\n const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;\n const cloned = {\n __v_isVNode: true,\n __v_skip: true,\n type: vnode.type,\n props: mergedProps,\n key: mergedProps && normalizeKey(mergedProps),\n ref: extraProps && extraProps.ref ? (\n // #2078 in the case of <component :is=\"vnode\" ref=\"extra\"/>\n // if the vnode itself already has a ref, cloneVNode will need to merge\n // the refs so the single vnode can be set on multiple refs\n mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)\n ) : ref,\n scopeId: vnode.scopeId,\n slotScopeIds: vnode.slotScopeIds,\n children: !!(process.env.NODE_ENV !== \"production\") && patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,\n target: vnode.target,\n targetStart: vnode.targetStart,\n targetAnchor: vnode.targetAnchor,\n staticCount: vnode.staticCount,\n shapeFlag: vnode.shapeFlag,\n // if the vnode is cloned with extra props, we can no longer assume its\n // existing patch flag to be reliable and need to add the FULL_PROPS flag.\n // note: preserve flag for fragments since they use the flag for children\n // fast paths only.\n patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,\n dynamicProps: vnode.dynamicProps,\n dynamicChildren: vnode.dynamicChildren,\n appContext: vnode.appContext,\n dirs: vnode.dirs,\n transition,\n // These should technically only be non-null on mounted VNodes. However,\n // they *should* be copied for kept-alive vnodes. So we just always copy\n // them since them being non-null during a mount doesn't affect the logic as\n // they will simply be overwritten.\n component: vnode.component,\n suspense: vnode.suspense,\n ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),\n ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),\n placeholder: vnode.placeholder,\n el: vnode.el,\n anchor: vnode.anchor,\n ctx: vnode.ctx,\n ce: vnode.ce\n };\n if (transition && cloneTransition) {\n setTransitionHooks(\n cloned,\n transition.clone(cloned)\n );\n }\n return cloned;\n}\nfunction deepCloneVNode(vnode) {\n const cloned = cloneVNode(vnode);\n if (isArray(vnode.children)) {\n cloned.children = vnode.children.map(deepCloneVNode);\n }\n return cloned;\n}\nfunction createTextVNode(text = \" \", flag = 0) {\n return createVNode(Text, null, text, flag);\n}\nfunction createStaticVNode(content, numberOfNodes) {\n const vnode = createVNode(Static, null, content);\n vnode.staticCount = numberOfNodes;\n return vnode;\n}\nfunction createCommentVNode(text = \"\", asBlock = false) {\n return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);\n}\nfunction normalizeVNode(child) {\n if (child == null || typeof child === \"boolean\") {\n return createVNode(Comment);\n } else if (isArray(child)) {\n return createVNode(\n Fragment,\n null,\n // #3666, avoid reference pollution when reusing vnode\n child.slice()\n );\n } else if (isVNode(child)) {\n return cloneIfMounted(child);\n } else {\n return createVNode(Text, null, String(child));\n }\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);\n}\nfunction normalizeChildren(vnode, children) {\n let type = 0;\n const { shapeFlag } = vnode;\n if (children == null) {\n children = null;\n } else if (isArray(children)) {\n type = 16;\n } else if (typeof children === \"object\") {\n if (shapeFlag & (1 | 64)) {\n const slot = children.default;\n if (slot) {\n slot._c && (slot._d = false);\n normalizeChildren(vnode, slot());\n slot._c && (slot._d = true);\n }\n return;\n } else {\n type = 32;\n const slotFlag = children._;\n if (!slotFlag && !isInternalObject(children)) {\n children._ctx = currentRenderingInstance;\n } else if (slotFlag === 3 && currentRenderingInstance) {\n if (currentRenderingInstance.slots._ === 1) {\n children._ = 1;\n } else {\n children._ = 2;\n vnode.patchFlag |= 1024;\n }\n }\n }\n } else if (isFunction(children)) {\n children = { default: children, _ctx: currentRenderingInstance };\n type = 32;\n } else {\n children = String(children);\n if (shapeFlag & 64) {\n type = 16;\n children = [createTextVNode(children)];\n } else {\n type = 8;\n }\n }\n vnode.children = children;\n vnode.shapeFlag |= type;\n}\nfunction mergeProps(...args) {\n const ret = {};\n for (let i = 0; i < args.length; i++) {\n const toMerge = args[i];\n for (const key in toMerge) {\n if (key === \"class\") {\n if (ret.class !== toMerge.class) {\n ret.class = normalizeClass([ret.class, toMerge.class]);\n }\n } else if (key === \"style\") {\n ret.style = normalizeStyle([ret.style, toMerge.style]);\n } else if (isOn(key)) {\n const existing = ret[key];\n const incoming = toMerge[key];\n if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {\n ret[key] = existing ? [].concat(existing, incoming) : incoming;\n }\n } else if (key !== \"\") {\n ret[key] = toMerge[key];\n }\n }\n }\n return ret;\n}\nfunction invokeVNodeHook(hook, instance, vnode, prevVNode = null) {\n callWithAsyncErrorHandling(hook, instance, 7, [\n vnode,\n prevVNode\n ]);\n}\n\nconst emptyAppContext = createAppContext();\nlet uid = 0;\nfunction createComponentInstance(vnode, parent, suspense) {\n const type = vnode.type;\n const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;\n const instance = {\n uid: uid++,\n vnode,\n type,\n parent,\n appContext,\n root: null,\n // to be immediately set\n next: null,\n subTree: null,\n // will be set synchronously right after creation\n effect: null,\n update: null,\n // will be set synchronously right after creation\n job: null,\n scope: new EffectScope(\n true\n /* detached */\n ),\n render: null,\n proxy: null,\n exposed: null,\n exposeProxy: null,\n withProxy: null,\n provides: parent ? parent.provides : Object.create(appContext.provides),\n ids: parent ? parent.ids : [\"\", 0, 0],\n accessCache: null,\n renderCache: [],\n // local resolved assets\n components: null,\n directives: null,\n // resolved props and emits options\n propsOptions: normalizePropsOptions(type, appContext),\n emitsOptions: normalizeEmitsOptions(type, appContext),\n // emit\n emit: null,\n // to be set immediately\n emitted: null,\n // props default value\n propsDefaults: EMPTY_OBJ,\n // inheritAttrs\n inheritAttrs: type.inheritAttrs,\n // state\n ctx: EMPTY_OBJ,\n data: EMPTY_OBJ,\n props: EMPTY_OBJ,\n attrs: EMPTY_OBJ,\n slots: EMPTY_OBJ,\n refs: EMPTY_OBJ,\n setupState: EMPTY_OBJ,\n setupContext: null,\n // suspense related\n suspense,\n suspenseId: suspense ? suspense.pendingId : 0,\n asyncDep: null,\n asyncResolved: false,\n // lifecycle hooks\n // not using enums here because it results in computed properties\n isMounted: false,\n isUnmounted: false,\n isDeactivated: false,\n bc: null,\n c: null,\n bm: null,\n m: null,\n bu: null,\n u: null,\n um: null,\n bum: null,\n da: null,\n a: null,\n rtg: null,\n rtc: null,\n ec: null,\n sp: null\n };\n if (!!(process.env.NODE_ENV !== \"production\")) {\n instance.ctx = createDevRenderContext(instance);\n } else {\n instance.ctx = { _: instance };\n }\n instance.root = parent ? parent.root : instance;\n instance.emit = emit.bind(null, instance);\n if (vnode.ce) {\n vnode.ce(instance);\n }\n return instance;\n}\nlet currentInstance = null;\nconst getCurrentInstance = () => currentInstance || currentRenderingInstance;\nlet internalSetCurrentInstance;\nlet setInSSRSetupState;\n{\n const g = getGlobalThis();\n const registerGlobalSetter = (key, setter) => {\n let setters;\n if (!(setters = g[key])) setters = g[key] = [];\n setters.push(setter);\n return (v) => {\n if (setters.length > 1) setters.forEach((set) => set(v));\n else setters[0](v);\n };\n };\n internalSetCurrentInstance = registerGlobalSetter(\n `__VUE_INSTANCE_SETTERS__`,\n (v) => currentInstance = v\n );\n setInSSRSetupState = registerGlobalSetter(\n `__VUE_SSR_SETTERS__`,\n (v) => isInSSRComponentSetup = v\n );\n}\nconst setCurrentInstance = (instance) => {\n const prev = currentInstance;\n internalSetCurrentInstance(instance);\n instance.scope.on();\n return () => {\n instance.scope.off();\n internalSetCurrentInstance(prev);\n };\n};\nconst unsetCurrentInstance = () => {\n currentInstance && currentInstance.scope.off();\n internalSetCurrentInstance(null);\n};\nconst isBuiltInTag = /* @__PURE__ */ makeMap(\"slot,component\");\nfunction validateComponentName(name, { isNativeTag }) {\n if (isBuiltInTag(name) || isNativeTag(name)) {\n warn$1(\n \"Do not use built-in or reserved HTML elements as component id: \" + name\n );\n }\n}\nfunction isStatefulComponent(instance) {\n return instance.vnode.shapeFlag & 4;\n}\nlet isInSSRComponentSetup = false;\nfunction setupComponent(instance, isSSR = false, optimized = false) {\n isSSR && setInSSRSetupState(isSSR);\n const { props, children } = instance.vnode;\n const isStateful = isStatefulComponent(instance);\n initProps(instance, props, isStateful, isSSR);\n initSlots(instance, children, optimized || isSSR);\n const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;\n isSSR && setInSSRSetupState(false);\n return setupResult;\n}\nfunction setupStatefulComponent(instance, isSSR) {\n var _a;\n const Component = instance.type;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n if (Component.name) {\n validateComponentName(Component.name, instance.appContext.config);\n }\n if (Component.components) {\n const names = Object.keys(Component.components);\n for (let i = 0; i < names.length; i++) {\n validateComponentName(names[i], instance.appContext.config);\n }\n }\n if (Component.directives) {\n const names = Object.keys(Component.directives);\n for (let i = 0; i < names.length; i++) {\n validateDirectiveName(names[i]);\n }\n }\n if (Component.compilerOptions && isRuntimeOnly()) {\n warn$1(\n `\"compilerOptions\" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`\n );\n }\n }\n instance.accessCache = /* @__PURE__ */ Object.create(null);\n instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n exposePropsOnRenderContext(instance);\n }\n const { setup } = Component;\n if (setup) {\n pauseTracking();\n const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;\n const reset = setCurrentInstance(instance);\n const setupResult = callWithErrorHandling(\n setup,\n instance,\n 0,\n [\n !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(instance.props) : instance.props,\n setupContext\n ]\n );\n const isAsyncSetup = isPromise(setupResult);\n resetTracking();\n reset();\n if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {\n markAsyncBoundary(instance);\n }\n if (isAsyncSetup) {\n setupResult.then(unsetCurrentInstance, unsetCurrentInstance);\n if (isSSR) {\n return setupResult.then((resolvedResult) => {\n handleSetupResult(instance, resolvedResult, isSSR);\n }).catch((e) => {\n handleError(e, instance, 0);\n });\n } else {\n instance.asyncDep = setupResult;\n if (!!(process.env.NODE_ENV !== \"production\") && !instance.suspense) {\n const name = (_a = Component.name) != null ? _a : \"Anonymous\";\n warn$1(\n `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`\n );\n }\n }\n } else {\n handleSetupResult(instance, setupResult, isSSR);\n }\n } else {\n finishComponentSetup(instance, isSSR);\n }\n}\nfunction handleSetupResult(instance, setupResult, isSSR) {\n if (isFunction(setupResult)) {\n if (instance.type.__ssrInlineRender) {\n instance.ssrRender = setupResult;\n } else {\n instance.render = setupResult;\n }\n } else if (isObject(setupResult)) {\n if (!!(process.env.NODE_ENV !== \"production\") && isVNode(setupResult)) {\n warn$1(\n `setup() should not return VNodes directly - return a render function instead.`\n );\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n instance.devtoolsRawSetupState = setupResult;\n }\n instance.setupState = proxyRefs(setupResult);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n exposeSetupStateOnRenderContext(instance);\n }\n } else if (!!(process.env.NODE_ENV !== \"production\") && setupResult !== void 0) {\n warn$1(\n `setup() should return an object. Received: ${setupResult === null ? \"null\" : typeof setupResult}`\n );\n }\n finishComponentSetup(instance, isSSR);\n}\nlet compile;\nlet installWithProxy;\nfunction registerRuntimeCompiler(_compile) {\n compile = _compile;\n installWithProxy = (i) => {\n if (i.render._rc) {\n i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);\n }\n };\n}\nconst isRuntimeOnly = () => !compile;\nfunction finishComponentSetup(instance, isSSR, skipOptions) {\n const Component = instance.type;\n if (!instance.render) {\n if (!isSSR && compile && !Component.render) {\n const template = Component.template || __VUE_OPTIONS_API__ && resolveMergedOptions(instance).template;\n if (template) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n startMeasure(instance, `compile`);\n }\n const { isCustomElement, compilerOptions } = instance.appContext.config;\n const { delimiters, compilerOptions: componentCompilerOptions } = Component;\n const finalCompilerOptions = extend(\n extend(\n {\n isCustomElement,\n delimiters\n },\n compilerOptions\n ),\n componentCompilerOptions\n );\n Component.render = compile(template, finalCompilerOptions);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n endMeasure(instance, `compile`);\n }\n }\n }\n instance.render = Component.render || NOOP;\n if (installWithProxy) {\n installWithProxy(instance);\n }\n }\n if (__VUE_OPTIONS_API__ && true) {\n const reset = setCurrentInstance(instance);\n pauseTracking();\n try {\n applyOptions(instance);\n } finally {\n resetTracking();\n reset();\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") && !Component.render && instance.render === NOOP && !isSSR) {\n if (!compile && Component.template) {\n warn$1(\n `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias \"vue\" to \"vue/dist/vue.esm-bundler.js\".` )\n );\n } else {\n warn$1(`Component is missing template or render function: `, Component);\n }\n }\n}\nconst attrsProxyHandlers = !!(process.env.NODE_ENV !== \"production\") ? {\n get(target, key) {\n markAttrsAccessed();\n track(target, \"get\", \"\");\n return target[key];\n },\n set() {\n warn$1(`setupContext.attrs is readonly.`);\n return false;\n },\n deleteProperty() {\n warn$1(`setupContext.attrs is readonly.`);\n return false;\n }\n} : {\n get(target, key) {\n track(target, \"get\", \"\");\n return target[key];\n }\n};\nfunction getSlotsProxy(instance) {\n return new Proxy(instance.slots, {\n get(target, key) {\n track(instance, \"get\", \"$slots\");\n return target[key];\n }\n });\n}\nfunction createSetupContext(instance) {\n const expose = (exposed) => {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n if (instance.exposed) {\n warn$1(`expose() should be called only once per setup().`);\n }\n if (exposed != null) {\n let exposedType = typeof exposed;\n if (exposedType === \"object\") {\n if (isArray(exposed)) {\n exposedType = \"array\";\n } else if (isRef(exposed)) {\n exposedType = \"ref\";\n }\n }\n if (exposedType !== \"object\") {\n warn$1(\n `expose() should be passed a plain object, received ${exposedType}.`\n );\n }\n }\n }\n instance.exposed = exposed || {};\n };\n if (!!(process.env.NODE_ENV !== \"production\")) {\n let attrsProxy;\n let slotsProxy;\n return Object.freeze({\n get attrs() {\n return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));\n },\n get slots() {\n return slotsProxy || (slotsProxy = getSlotsProxy(instance));\n },\n get emit() {\n return (event, ...args) => instance.emit(event, ...args);\n },\n expose\n });\n } else {\n return {\n attrs: new Proxy(instance.attrs, attrsProxyHandlers),\n slots: instance.slots,\n emit: instance.emit,\n expose\n };\n }\n}\nfunction getComponentPublicInstance(instance) {\n if (instance.exposed) {\n return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {\n get(target, key) {\n if (key in target) {\n return target[key];\n } else if (key in publicPropertiesMap) {\n return publicPropertiesMap[key](instance);\n }\n },\n has(target, key) {\n return key in target || key in publicPropertiesMap;\n }\n }));\n } else {\n return instance.proxy;\n }\n}\nconst classifyRE = /(?:^|[-_])(\\w)/g;\nconst classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, \"\");\nfunction getComponentName(Component, includeInferred = true) {\n return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;\n}\nfunction formatComponentName(instance, Component, isRoot = false) {\n let name = getComponentName(Component);\n if (!name && Component.__file) {\n const match = Component.__file.match(/([^/\\\\]+)\\.\\w+$/);\n if (match) {\n name = match[1];\n }\n }\n if (!name && instance && instance.parent) {\n const inferFromRegistry = (registry) => {\n for (const key in registry) {\n if (registry[key] === Component) {\n return key;\n }\n }\n };\n name = inferFromRegistry(\n instance.components || instance.parent.type.components\n ) || inferFromRegistry(instance.appContext.components);\n }\n return name ? classify(name) : isRoot ? `App` : `Anonymous`;\n}\nfunction isClassComponent(value) {\n return isFunction(value) && \"__vccOpts\" in value;\n}\n\nconst computed = (getterOrOptions, debugOptions) => {\n const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const i = getCurrentInstance();\n if (i && i.appContext.config.warnRecursiveComputed) {\n c._warnRecursive = true;\n }\n }\n return c;\n};\n\nfunction h(type, propsOrChildren, children) {\n const l = arguments.length;\n if (l === 2) {\n if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {\n if (isVNode(propsOrChildren)) {\n return createVNode(type, null, [propsOrChildren]);\n }\n return createVNode(type, propsOrChildren);\n } else {\n return createVNode(type, null, propsOrChildren);\n }\n } else {\n if (l > 3) {\n children = Array.prototype.slice.call(arguments, 2);\n } else if (l === 3 && isVNode(children)) {\n children = [children];\n }\n return createVNode(type, propsOrChildren, children);\n }\n}\n\nfunction initCustomFormatter() {\n if (!!!(process.env.NODE_ENV !== \"production\") || typeof window === \"undefined\") {\n return;\n }\n const vueStyle = { style: \"color:#3ba776\" };\n const numberStyle = { style: \"color:#1677ff\" };\n const stringStyle = { style: \"color:#f5222d\" };\n const keywordStyle = { style: \"color:#eb2f96\" };\n const formatter = {\n __vue_custom_formatter: true,\n header(obj) {\n if (!isObject(obj)) {\n return null;\n }\n if (obj.__isVue) {\n return [\"div\", vueStyle, `VueInstance`];\n } else if (isRef(obj)) {\n pauseTracking();\n const value = obj.value;\n resetTracking();\n return [\n \"div\",\n {},\n [\"span\", vueStyle, genRefFlag(obj)],\n \"<\",\n formatValue(value),\n `>`\n ];\n } else if (isReactive(obj)) {\n return [\n \"div\",\n {},\n [\"span\", vueStyle, isShallow(obj) ? \"ShallowReactive\" : \"Reactive\"],\n \"<\",\n formatValue(obj),\n `>${isReadonly(obj) ? ` (readonly)` : ``}`\n ];\n } else if (isReadonly(obj)) {\n return [\n \"div\",\n {},\n [\"span\", vueStyle, isShallow(obj) ? \"ShallowReadonly\" : \"Readonly\"],\n \"<\",\n formatValue(obj),\n \">\"\n ];\n }\n return null;\n },\n hasBody(obj) {\n return obj && obj.__isVue;\n },\n body(obj) {\n if (obj && obj.__isVue) {\n return [\n \"div\",\n {},\n ...formatInstance(obj.$)\n ];\n }\n }\n };\n function formatInstance(instance) {\n const blocks = [];\n if (instance.type.props && instance.props) {\n blocks.push(createInstanceBlock(\"props\", toRaw(instance.props)));\n }\n if (instance.setupState !== EMPTY_OBJ) {\n blocks.push(createInstanceBlock(\"setup\", instance.setupState));\n }\n if (instance.data !== EMPTY_OBJ) {\n blocks.push(createInstanceBlock(\"data\", toRaw(instance.data)));\n }\n const computed = extractKeys(instance, \"computed\");\n if (computed) {\n blocks.push(createInstanceBlock(\"computed\", computed));\n }\n const injected = extractKeys(instance, \"inject\");\n if (injected) {\n blocks.push(createInstanceBlock(\"injected\", injected));\n }\n blocks.push([\n \"div\",\n {},\n [\n \"span\",\n {\n style: keywordStyle.style + \";opacity:0.66\"\n },\n \"$ (internal): \"\n ],\n [\"object\", { object: instance }]\n ]);\n return blocks;\n }\n function createInstanceBlock(type, target) {\n target = extend({}, target);\n if (!Object.keys(target).length) {\n return [\"span\", {}];\n }\n return [\n \"div\",\n { style: \"line-height:1.25em;margin-bottom:0.6em\" },\n [\n \"div\",\n {\n style: \"color:#476582\"\n },\n type\n ],\n [\n \"div\",\n {\n style: \"padding-left:1.25em\"\n },\n ...Object.keys(target).map((key) => {\n return [\n \"div\",\n {},\n [\"span\", keywordStyle, key + \": \"],\n formatValue(target[key], false)\n ];\n })\n ]\n ];\n }\n function formatValue(v, asRaw = true) {\n if (typeof v === \"number\") {\n return [\"span\", numberStyle, v];\n } else if (typeof v === \"string\") {\n return [\"span\", stringStyle, JSON.stringify(v)];\n } else if (typeof v === \"boolean\") {\n return [\"span\", keywordStyle, v];\n } else if (isObject(v)) {\n return [\"object\", { object: asRaw ? toRaw(v) : v }];\n } else {\n return [\"span\", stringStyle, String(v)];\n }\n }\n function extractKeys(instance, type) {\n const Comp = instance.type;\n if (isFunction(Comp)) {\n return;\n }\n const extracted = {};\n for (const key in instance.ctx) {\n if (isKeyOfType(Comp, key, type)) {\n extracted[key] = instance.ctx[key];\n }\n }\n return extracted;\n }\n function isKeyOfType(Comp, key, type) {\n const opts = Comp[type];\n if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {\n return true;\n }\n if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {\n return true;\n }\n if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {\n return true;\n }\n }\n function genRefFlag(v) {\n if (isShallow(v)) {\n return `ShallowRef`;\n }\n if (v.effect) {\n return `ComputedRef`;\n }\n return `Ref`;\n }\n if (window.devtoolsFormatters) {\n window.devtoolsFormatters.push(formatter);\n } else {\n window.devtoolsFormatters = [formatter];\n }\n}\n\nfunction withMemo(memo, render, cache, index) {\n const cached = cache[index];\n if (cached && isMemoSame(cached, memo)) {\n return cached;\n }\n const ret = render();\n ret.memo = memo.slice();\n ret.cacheIndex = index;\n return cache[index] = ret;\n}\nfunction isMemoSame(cached, memo) {\n const prev = cached.memo;\n if (prev.length != memo.length) {\n return false;\n }\n for (let i = 0; i < prev.length; i++) {\n if (hasChanged(prev[i], memo[i])) {\n return false;\n }\n }\n if (isBlockTreeEnabled > 0 && currentBlock) {\n currentBlock.push(cached);\n }\n return true;\n}\n\nconst version = \"3.5.18\";\nconst warn = !!(process.env.NODE_ENV !== \"production\") ? warn$1 : NOOP;\nconst ErrorTypeStrings = ErrorTypeStrings$1 ;\nconst devtools = !!(process.env.NODE_ENV !== \"production\") || true ? devtools$1 : void 0;\nconst setDevtoolsHook = !!(process.env.NODE_ENV !== \"production\") || true ? setDevtoolsHook$1 : NOOP;\nconst _ssrUtils = {\n createComponentInstance,\n setupComponent,\n renderComponentRoot,\n setCurrentRenderingInstance,\n isVNode: isVNode,\n normalizeVNode,\n getComponentPublicInstance,\n ensureValidVNode,\n pushWarningContext,\n popWarningContext\n};\nconst ssrUtils = _ssrUtils ;\nconst resolveFilter = null;\nconst compatUtils = null;\nconst DeprecationTypes = null;\n\nexport { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, Static, Suspense, Teleport, Text, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useId, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };\n","// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n * @type {string}\n */\nexport const VERSION = '5.36.13';\nexport const PUBLIC_VERSION = '5';\n","import { PUBLIC_VERSION } from '../version.js';\n\nif (typeof window !== 'undefined') {\n\t// @ts-expect-error\n\t((window.__svelte ??= {}).v ??= new Set()).add(PUBLIC_VERSION);\n}\n","export let async_mode_flag = false;\nexport let legacy_mode_flag = false;\nexport let tracing_mode_flag = false;\n\nexport function enable_async_mode_flag() {\n\tasync_mode_flag = true;\n}\n\n/** ONLY USE THIS DURING TESTING */\nexport function disable_async_mode_flag() {\n\tasync_mode_flag = false;\n}\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n","import { enable_legacy_mode_flag } from './index.js';\n\nenable_legacy_mode_flag();\n","export const EACH_ITEM_REACTIVE = 1;\nexport const EACH_INDEX_REACTIVE = 1 << 1;\n/** See EachBlock interface metadata.is_controlled for an explanation what this is */\nexport const EACH_IS_CONTROLLED = 1 << 2;\nexport const EACH_IS_ANIMATED = 1 << 3;\nexport const EACH_ITEM_IMMUTABLE = 1 << 4;\n\nexport const PROPS_IS_IMMUTABLE = 1;\nexport const PROPS_IS_RUNES = 1 << 1;\nexport const PROPS_IS_UPDATED = 1 << 2;\nexport const PROPS_IS_BINDABLE = 1 << 3;\nexport const PROPS_IS_LAZY_INITIAL = 1 << 4;\n\nexport const TRANSITION_IN = 1;\nexport const TRANSITION_OUT = 1 << 1;\nexport const TRANSITION_GLOBAL = 1 << 2;\n\nexport const TEMPLATE_FRAGMENT = 1;\nexport const TEMPLATE_USE_IMPORT_NODE = 1 << 1;\nexport const TEMPLATE_USE_SVG = 1 << 2;\nexport const TEMPLATE_USE_MATHML = 1 << 3;\n\nexport const HYDRATION_START = '[';\n/** used to indicate that an `{:else}...` block was rendered */\nexport const HYDRATION_START_ELSE = '[!';\nexport const HYDRATION_END = ']';\nexport const HYDRATION_ERROR = {};\n\nexport const ELEMENT_IS_NAMESPACED = 1;\nexport const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;\n\nexport const UNINITIALIZED = Symbol();\n\n// Dev-time component properties\nexport const FILENAME = Symbol('filename');\nexport const HMR = Symbol('hmr');\n\nexport const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';\nexport const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';\nexport const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n// we use a list of ignorable runtime warnings because not every runtime warning\n// can be ignored and we want to keep the validation for svelte-ignore in place\nexport const IGNORABLE_RUNTIME_WARNINGS = /** @type {const} */ ([\n\t'await_waterfall',\n\t'await_reactivity_loss',\n\t'state_snapshot_uncloneable',\n\t'binding_property_non_reactive',\n\t'hydration_attribute_changed',\n\t'hydration_html_changed',\n\t'ownership_invalid_binding',\n\t'ownership_invalid_mutation'\n]);\n\n/**\n * Whitespace inside one of these elements will not result in\n * a whitespace node being created in any circumstances. (This\n * list is almost certainly very incomplete)\n * TODO this is currently unused\n */\nexport const ELEMENTS_WITHOUT_TEXT = ['audio', 'datalist', 'dl', 'optgroup', 'select', 'video'];\n\nexport const ATTACHMENT_KEY = '@attach';\n","export default false;\n","// Store the references to globals in case someone tries to monkey patch these, causing the below\n// to de-opt (this occurs often when using popular extensions).\nexport var is_array = Array.isArray;\nexport var index_of = Array.prototype.indexOf;\nexport var array_from = Array.from;\nexport var object_keys = Object.keys;\nexport var define_property = Object.defineProperty;\nexport var get_descriptor = Object.getOwnPropertyDescriptor;\nexport var get_descriptors = Object.getOwnPropertyDescriptors;\nexport var object_prototype = Object.prototype;\nexport var array_prototype = Array.prototype;\nexport var get_prototype_of = Object.getPrototypeOf;\nexport var is_extensible = Object.isExtensible;\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nexport const noop = () => {};\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n\n/**\n * @template [T=any]\n * @param {any} value\n * @returns {value is PromiseLike<T>}\n */\nexport function is_promise(value) {\n\treturn typeof value?.then === 'function';\n}\n\n/** @param {Function} fn */\nexport function run(fn) {\n\treturn fn();\n}\n\n/** @param {Array<() => void>} arr */\nexport function run_all(arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tarr[i]();\n\t}\n}\n\n/**\n * TODO replace with Promise.withResolvers once supported widely enough\n * @template T\n */\nexport function deferred() {\n\t/** @type {(value: T) => void} */\n\tvar resolve;\n\n\t/** @type {(reason: any) => void} */\n\tvar reject;\n\n\t/** @type {Promise<T>} */\n\tvar promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\n\t// @ts-expect-error\n\treturn { promise, resolve, reject };\n}\n\n/**\n * @template V\n * @param {V} value\n * @param {V | (() => V)} fallback\n * @param {boolean} [lazy]\n * @returns {V}\n */\nexport function fallback(value, fallback, lazy = false) {\n\treturn value === undefined\n\t\t? lazy\n\t\t\t? /** @type {() => V} */ (fallback)()\n\t\t\t: /** @type {V} */ (fallback)\n\t\t: value;\n}\n\n/**\n * When encountering a situation like `let [a, b, c] = $derived(blah())`,\n * we need to stash an intermediate value that `a`, `b`, and `c` derive\n * from, in case it's an iterable\n * @template T\n * @param {ArrayLike<T> | Iterable<T>} value\n * @param {number} [n]\n * @returns {Array<T>}\n */\nexport function to_array(value, n) {\n\t// return arrays unchanged\n\tif (Array.isArray(value)) {\n\t\treturn value;\n\t}\n\n\t// if value is not iterable, or `n` is unspecified (indicates a rest\n\t// element, which means we're not concerned about unbounded iterables)\n\t// convert to an array with `Array.from`\n\tif (n === undefined || !(Symbol.iterator in value)) {\n\t\treturn Array.from(value);\n\t}\n\n\t// otherwise, populate an array with `n` values\n\n\t/** @type {T[]} */\n\tconst array = [];\n\n\tfor (const element of value) {\n\t\tarray.push(element);\n\t\tif (array.length === n) break;\n\t}\n\n\treturn array;\n}\n","export const DERIVED = 1 << 1;\nexport const EFFECT = 1 << 2;\nexport const RENDER_EFFECT = 1 << 3;\nexport const BLOCK_EFFECT = 1 << 4;\nexport const BRANCH_EFFECT = 1 << 5;\nexport const ROOT_EFFECT = 1 << 6;\nexport const BOUNDARY_EFFECT = 1 << 7;\nexport const UNOWNED = 1 << 8;\nexport const DISCONNECTED = 1 << 9;\nexport const CLEAN = 1 << 10;\nexport const DIRTY = 1 << 11;\nexport const MAYBE_DIRTY = 1 << 12;\nexport const INERT = 1 << 13;\nexport const DESTROYED = 1 << 14;\nexport const EFFECT_RAN = 1 << 15;\n/** 'Transparent' effects do not create a transition boundary */\nexport const EFFECT_TRANSPARENT = 1 << 16;\nexport const INSPECT_EFFECT = 1 << 17;\nexport const HEAD_EFFECT = 1 << 18;\nexport const EFFECT_PRESERVED = 1 << 19;\nexport const USER_EFFECT = 1 << 20;\n\n// Flags used for async\nexport const REACTION_IS_UPDATING = 1 << 21;\nexport const ASYNC = 1 << 22;\n\nexport const ERROR_VALUE = 1 << 23;\n\nexport const STATE_SYMBOL = Symbol('$state');\nexport const LEGACY_PROPS = Symbol('legacy props');\nexport const LOADING_ATTR_SYMBOL = Symbol('');\nexport const PROXY_PATH_SYMBOL = Symbol('proxy path');\n\n/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */\nexport const STALE_REACTION = new (class StaleReactionError extends Error {\n\tname = 'StaleReactionError';\n\tmessage = 'The reaction that called `getAbortSignal()` was re-run or destroyed';\n})();\n\nexport const ELEMENT_NODE = 1;\nexport const TEXT_NODE = 3;\nexport const COMMENT_NODE = 8;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Cannot await outside a `<svelte:boundary>` with a `pending` snippet\n * @returns {never}\n */\nexport function await_outside_boundary() {\n\tif (DEV) {\n\t\tconst error = new Error(`await_outside_boundary\\nCannot await outside a \\`<svelte:boundary>\\` with a \\`pending\\` snippet\\nhttps://svelte.dev/e/await_outside_boundary`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/await_outside_boundary`);\n\t}\n}\n\n/**\n * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\n * @returns {never}\n */\nexport function invalid_default_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_default_snippet\\nCannot use \\`{@render children(...)}\\` if the parent component uses \\`let:\\` directives. Consider using a named snippet instead\\nhttps://svelte.dev/e/invalid_default_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_default_snippet`);\n\t}\n}\n\n/**\n * A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`\n * @returns {never}\n */\nexport function invalid_snippet_arguments() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet_arguments\\nA snippet function was passed invalid arguments. Snippets should only be instantiated via \\`{@render ...}\\`\\nhttps://svelte.dev/e/invalid_snippet_arguments`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet_arguments`);\n\t}\n}\n\n/**\n * `%name%(...)` can only be used during component initialisation\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_outside_component(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_outside_component\\n\\`${name}(...)\\` can only be used during component initialisation\\nhttps://svelte.dev/e/lifecycle_outside_component`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_outside_component`);\n\t}\n}\n\n/**\n * Attempted to render a snippet without a `{@render}` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change `{snippet}` to `{@render snippet()}`.\n * @returns {never}\n */\nexport function snippet_without_render_tag() {\n\tif (DEV) {\n\t\tconst error = new Error(`snippet_without_render_tag\\nAttempted to render a snippet without a \\`{@render}\\` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change \\`{snippet}\\` to \\`{@render snippet()}\\`.\\nhttps://svelte.dev/e/snippet_without_render_tag`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/snippet_without_render_tag`);\n\t}\n}\n\n/**\n * `%name%` is not a store with a `subscribe` method\n * @param {string} name\n * @returns {never}\n */\nexport function store_invalid_shape(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`store_invalid_shape\\n\\`${name}\\` is not a store with a \\`subscribe\\` method\\nhttps://svelte.dev/e/store_invalid_shape`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/store_invalid_shape`);\n\t}\n}\n\n/**\n * The `this` prop on `<svelte:element>` must be a string, if defined\n * @returns {never}\n */\nexport function svelte_element_invalid_this_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_element_invalid_this_value\\nThe \\`this\\` prop on \\`<svelte:element>\\` must be a string, if defined\\nhttps://svelte.dev/e/svelte_element_invalid_this_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_element_invalid_this_value`);\n\t}\n}","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nexport * from '../shared/errors.js';\n\n/**\n * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree\n * @returns {never}\n */\nexport function async_derived_orphan() {\n\tif (DEV) {\n\t\tconst error = new Error(`async_derived_orphan\\nCannot create a \\`$derived(...)\\` with an \\`await\\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/async_derived_orphan`);\n\t}\n}\n\n/**\n * Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\n * @returns {never}\n */\nexport function bind_invalid_checkbox_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_checkbox_value\\nUsing \\`bind:value\\` together with a checkbox input is not allowed. Use \\`bind:checked\\` instead\\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_checkbox_value`);\n\t}\n}\n\n/**\n * Component %component% has an export named `%key%` that a consumer component is trying to access using `bind:%key%`, which is disallowed. Instead, use `bind:this` (e.g. `<%name% bind:this={component} />`) and then access the property on the bound component instance (e.g. `component.%key%`)\n * @param {string} component\n * @param {string} key\n * @param {string} name\n * @returns {never}\n */\nexport function bind_invalid_export(component, key, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_export\\nComponent ${component} has an export named \\`${key}\\` that a consumer component is trying to access using \\`bind:${key}\\`, which is disallowed. Instead, use \\`bind:this\\` (e.g. \\`<${name} bind:this={component} />\\`) and then access the property on the bound component instance (e.g. \\`component.${key}\\`)\\nhttps://svelte.dev/e/bind_invalid_export`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_export`);\n\t}\n}\n\n/**\n * A component is attempting to bind to a non-bindable property `%key%` belonging to %component% (i.e. `<%name% bind:%key%={...}>`). To mark a property as bindable: `let { %key% = $bindable() } = $props()`\n * @param {string} key\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function bind_not_bindable(key, component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_not_bindable\\nA component is attempting to bind to a non-bindable property \\`${key}\\` belonging to ${component} (i.e. \\`<${name} bind:${key}={...}>\\`). To mark a property as bindable: \\`let { ${key} = $bindable() } = $props()\\`\\nhttps://svelte.dev/e/bind_not_bindable`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_not_bindable`);\n\t}\n}\n\n/**\n * Calling `%method%` on a component instance (of %component%) is no longer valid in Svelte 5\n * @param {string} method\n * @param {string} component\n * @returns {never}\n */\nexport function component_api_changed(method, component) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_changed\\nCalling \\`${method}\\` on a component instance (of ${component}) is no longer valid in Svelte 5\\nhttps://svelte.dev/e/component_api_changed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_changed`);\n\t}\n}\n\n/**\n * Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working.\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function component_api_invalid_new(component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_invalid_new\\nAttempted to instantiate ${component} with \\`new ${name}\\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \\`compatibility.componentApi\\` compiler option to \\`4\\` to keep it working.\\nhttps://svelte.dev/e/component_api_invalid_new`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_invalid_new`);\n\t}\n}\n\n/**\n * A derived value cannot reference itself recursively\n * @returns {never}\n */\nexport function derived_references_self() {\n\tif (DEV) {\n\t\tconst error = new Error(`derived_references_self\\nA derived value cannot reference itself recursively\\nhttps://svelte.dev/e/derived_references_self`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/derived_references_self`);\n\t}\n}\n\n/**\n * Keyed each block has duplicate key `%value%` at indexes %a% and %b%\n * @param {string} a\n * @param {string} b\n * @param {string | undefined | null} [value]\n * @returns {never}\n */\nexport function each_key_duplicate(a, b, value) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_duplicate\\n${value\n\t\t\t? `Keyed each block has duplicate key \\`${value}\\` at indexes ${a} and ${b}`\n\t\t\t: `Keyed each block has duplicate key at indexes ${a} and ${b}`}\\nhttps://svelte.dev/e/each_key_duplicate`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_duplicate`);\n\t}\n}\n\n/**\n * `%rune%` cannot be used inside an effect cleanup function\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_in_teardown(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_teardown\\n\\`${rune}\\` cannot be used inside an effect cleanup function\\nhttps://svelte.dev/e/effect_in_teardown`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_teardown`);\n\t}\n}\n\n/**\n * Effect cannot be created inside a `$derived` value that was not itself created inside an effect\n * @returns {never}\n */\nexport function effect_in_unowned_derived() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_unowned_derived\\nEffect cannot be created inside a \\`$derived\\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_unowned_derived`);\n\t}\n}\n\n/**\n * `%rune%` can only be used inside an effect (e.g. during component initialisation)\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_orphan(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_orphan\\n\\`${rune}\\` can only be used inside an effect (e.g. during component initialisation)\\nhttps://svelte.dev/e/effect_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_orphan`);\n\t}\n}\n\n/**\n * `$effect.pending()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function effect_pending_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_pending_outside_reaction\\n\\`$effect.pending()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/effect_pending_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_pending_outside_reaction`);\n\t}\n}\n\n/**\n * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\n * @returns {never}\n */\nexport function effect_update_depth_exceeded() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_update_depth_exceeded\\nMaximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\\nhttps://svelte.dev/e/effect_update_depth_exceeded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);\n\t}\n}\n\n/**\n * Cannot use `flushSync` inside an effect\n * @returns {never}\n */\nexport function flush_sync_in_effect() {\n\tif (DEV) {\n\t\tconst error = new Error(`flush_sync_in_effect\\nCannot use \\`flushSync\\` inside an effect\\nhttps://svelte.dev/e/flush_sync_in_effect`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/flush_sync_in_effect`);\n\t}\n}\n\n/**\n * `getAbortSignal()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function get_abort_signal_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`get_abort_signal_outside_reaction\\n\\`getAbortSignal()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/get_abort_signal_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`);\n\t}\n}\n\n/**\n * Failed to hydrate the application\n * @returns {never}\n */\nexport function hydration_failed() {\n\tif (DEV) {\n\t\tconst error = new Error(`hydration_failed\\nFailed to hydrate the application\\nhttps://svelte.dev/e/hydration_failed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydration_failed`);\n\t}\n}\n\n/**\n * Could not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\n * @returns {never}\n */\nexport function invalid_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet\\nCould not \\`{@render}\\` snippet due to the expression being \\`null\\` or \\`undefined\\`. Consider using optional chaining \\`{@render snippet?.()}\\`\\nhttps://svelte.dev/e/invalid_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` cannot be used in runes mode\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_legacy_only(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_legacy_only\\n\\`${name}(...)\\` cannot be used in runes mode\\nhttps://svelte.dev/e/lifecycle_legacy_only`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_legacy_only`);\n\t}\n}\n\n/**\n * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value\n * @param {string} key\n * @returns {never}\n */\nexport function props_invalid_value(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_invalid_value\\nCannot do \\`bind:${key}={undefined}\\` when \\`${key}\\` has a fallback value\\nhttps://svelte.dev/e/props_invalid_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_invalid_value`);\n\t}\n}\n\n/**\n * Rest element properties of `$props()` such as `%property%` are readonly\n * @param {string} property\n * @returns {never}\n */\nexport function props_rest_readonly(property) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_rest_readonly\\nRest element properties of \\`$props()\\` such as \\`${property}\\` are readonly\\nhttps://svelte.dev/e/props_rest_readonly`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_rest_readonly`);\n\t}\n}\n\n/**\n * The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files\n * @param {string} rune\n * @returns {never}\n */\nexport function rune_outside_svelte(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`rune_outside_svelte\\nThe \\`${rune}\\` rune is only available inside \\`.svelte\\` and \\`.svelte.js/ts\\` files\\nhttps://svelte.dev/e/rune_outside_svelte`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/rune_outside_svelte`);\n\t}\n}\n\n/**\n * `setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\n * @returns {never}\n */\nexport function set_context_after_init() {\n\tif (DEV) {\n\t\tconst error = new Error(`set_context_after_init\\n\\`setContext\\` must be called when a component first initializes, not in a subsequent effect or after an \\`await\\` expression\\nhttps://svelte.dev/e/set_context_after_init`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/set_context_after_init`);\n\t}\n}\n\n/**\n * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\n * @returns {never}\n */\nexport function state_descriptors_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_descriptors_fixed\\nProperty descriptors defined on \\`$state\\` objects must contain \\`value\\` and always be \\`enumerable\\`, \\`configurable\\` and \\`writable\\`.\\nhttps://svelte.dev/e/state_descriptors_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_descriptors_fixed`);\n\t}\n}\n\n/**\n * Cannot set prototype of `$state` object\n * @returns {never}\n */\nexport function state_prototype_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_prototype_fixed\\nCannot set prototype of \\`$state\\` object\\nhttps://svelte.dev/e/state_prototype_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_prototype_fixed`);\n\t}\n}\n\n/**\n * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\n * @returns {never}\n */\nexport function state_unsafe_mutation() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_mutation\\nUpdating state inside \\`$derived(...)\\`, \\`$inspect(...)\\` or a template expression is forbidden. If the value should not be reactive, declare it without \\`$state\\`\\nhttps://svelte.dev/e/state_unsafe_mutation`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_mutation`);\n\t}\n}\n\n/**\n * A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\n * @returns {never}\n */\nexport function svelte_boundary_reset_onerror() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_boundary_reset_onerror\\nA \\`<svelte:boundary>\\` \\`reset\\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);\n\t}\n}","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nvar bold = 'font-weight: bold';\nvar normal = 'font-weight: normal';\n\n/**\n * Assignment to `%property%` property (%location%) will evaluate to the right-hand side, not the value of `%property%` following the assignment. This may result in unexpected behaviour.\n * @param {string} property\n * @param {string} location\n */\nexport function assignment_value_stale(property, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] assignment_value_stale\\n%cAssignment to \\`${property}\\` property (${location}) will evaluate to the right-hand side, not the value of \\`${property}\\` following the assignment. This may result in unexpected behaviour.\\nhttps://svelte.dev/e/assignment_value_stale`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/assignment_value_stale`);\n\t}\n}\n\n/**\n * Detected reactivity loss when reading `%name%`. This happens when state is read in an async function after an earlier `await`\n * @param {string} name\n */\nexport function await_reactivity_loss(name) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] await_reactivity_loss\\n%cDetected reactivity loss when reading \\`${name}\\`. This happens when state is read in an async function after an earlier \\`await\\`\\nhttps://svelte.dev/e/await_reactivity_loss`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/await_reactivity_loss`);\n\t}\n}\n\n/**\n * An async derived, `%name%` (%location%) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\n * @param {string} name\n * @param {string} location\n */\nexport function await_waterfall(name, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] await_waterfall\\n%cAn async derived, \\`${name}\\` (${location}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\\nhttps://svelte.dev/e/await_waterfall`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/await_waterfall`);\n\t}\n}\n\n/**\n * `%binding%` (%location%) is binding to a non-reactive property\n * @param {string} binding\n * @param {string | undefined | null} [location]\n */\nexport function binding_property_non_reactive(binding, location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] binding_property_non_reactive\\n%c${location\n\t\t\t\t? `\\`${binding}\\` (${location}) is binding to a non-reactive property`\n\t\t\t\t: `\\`${binding}\\` is binding to a non-reactive property`}\\nhttps://svelte.dev/e/binding_property_non_reactive`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/binding_property_non_reactive`);\n\t}\n}\n\n/**\n * Your `console.%method%` contained `$state` proxies. Consider using `$inspect(...)` or `$state.snapshot(...)` instead\n * @param {string} method\n */\nexport function console_log_state(method) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] console_log_state\\n%cYour \\`console.${method}\\` contained \\`$state\\` proxies. Consider using \\`$inspect(...)\\` or \\`$state.snapshot(...)\\` instead\\nhttps://svelte.dev/e/console_log_state`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/console_log_state`);\n\t}\n}\n\n/**\n * %handler% should be a function. Did you mean to %suggestion%?\n * @param {string} handler\n * @param {string} suggestion\n */\nexport function event_handler_invalid(handler, suggestion) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] event_handler_invalid\\n%c${handler} should be a function. Did you mean to ${suggestion}?\\nhttps://svelte.dev/e/event_handler_invalid`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/event_handler_invalid`);\n\t}\n}\n\n/**\n * The `%attribute%` attribute on `%html%` changed its value between server and client renders. The client value, `%value%`, will be ignored in favour of the server value\n * @param {string} attribute\n * @param {string} html\n * @param {string} value\n */\nexport function hydration_attribute_changed(attribute, html, value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_attribute_changed\\n%cThe \\`${attribute}\\` attribute on \\`${html}\\` changed its value between server and client renders. The client value, \\`${value}\\`, will be ignored in favour of the server value\\nhttps://svelte.dev/e/hydration_attribute_changed`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_attribute_changed`);\n\t}\n}\n\n/**\n * The value of an `{@html ...}` block %location% changed between server and client renders. The client value will be ignored in favour of the server value\n * @param {string | undefined | null} [location]\n */\nexport function hydration_html_changed(location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] hydration_html_changed\\n%c${location\n\t\t\t\t? `The value of an \\`{@html ...}\\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value`\n\t\t\t\t: 'The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value'}\\nhttps://svelte.dev/e/hydration_html_changed`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_html_changed`);\n\t}\n}\n\n/**\n * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%\n * @param {string | undefined | null} [location]\n */\nexport function hydration_mismatch(location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] hydration_mismatch\\n%c${location\n\t\t\t\t? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}`\n\t\t\t\t: 'Hydration failed because the initial UI does not match what was rendered on the server'}\\nhttps://svelte.dev/e/hydration_mismatch`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_mismatch`);\n\t}\n}\n\n/**\n * The `render` function passed to `createRawSnippet` should return HTML for a single element\n */\nexport function invalid_raw_snippet_render() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] invalid_raw_snippet_render\\n%cThe \\`render\\` function passed to \\`createRawSnippet\\` should return HTML for a single element\\nhttps://svelte.dev/e/invalid_raw_snippet_render`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/invalid_raw_snippet_render`);\n\t}\n}\n\n/**\n * Detected a migrated `$:` reactive block in `%filename%` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.\n * @param {string} filename\n */\nexport function legacy_recursive_reactive_block(filename) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] legacy_recursive_reactive_block\\n%cDetected a migrated \\`$:\\` reactive block in \\`${filename}\\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \\`$effect\\`.\\nhttps://svelte.dev/e/legacy_recursive_reactive_block`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/legacy_recursive_reactive_block`);\n\t}\n}\n\n/**\n * Tried to unmount a component that was not mounted\n */\nexport function lifecycle_double_unmount() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] lifecycle_double_unmount\\n%cTried to unmount a component that was not mounted\\nhttps://svelte.dev/e/lifecycle_double_unmount`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/lifecycle_double_unmount`);\n\t}\n}\n\n/**\n * %parent% passed property `%prop%` to %child% with `bind:`, but its parent component %owner% did not declare `%prop%` as a binding. Consider creating a binding between %owner% and %parent% (e.g. `bind:%prop%={...}` instead of `%prop%={...}`)\n * @param {string} parent\n * @param {string} prop\n * @param {string} child\n * @param {string} owner\n */\nexport function ownership_invalid_binding(parent, prop, child, owner) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_binding\\n%c${parent} passed property \\`${prop}\\` to ${child} with \\`bind:\\`, but its parent component ${owner} did not declare \\`${prop}\\` as a binding. Consider creating a binding between ${owner} and ${parent} (e.g. \\`bind:${prop}={...}\\` instead of \\`${prop}={...}\\`)\\nhttps://svelte.dev/e/ownership_invalid_binding`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_binding`);\n\t}\n}\n\n/**\n * Mutating unbound props (`%name%`, at %location%) is strongly discouraged. Consider using `bind:%prop%={...}` in %parent% (or using a callback) instead\n * @param {string} name\n * @param {string} location\n * @param {string} prop\n * @param {string} parent\n */\nexport function ownership_invalid_mutation(name, location, prop, parent) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_mutation\\n%cMutating unbound props (\\`${name}\\`, at ${location}) is strongly discouraged. Consider using \\`bind:${prop}={...}\\` in ${parent} (or using a callback) instead\\nhttps://svelte.dev/e/ownership_invalid_mutation`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_mutation`);\n\t}\n}\n\n/**\n * The `value` property of a `<select multiple>` element should be an array, but it received a non-array value. The selection will be kept as is.\n */\nexport function select_multiple_invalid_value() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] select_multiple_invalid_value\\n%cThe \\`value\\` property of a \\`<select multiple>\\` element should be an array, but it received a non-array value. The selection will be kept as is.\\nhttps://svelte.dev/e/select_multiple_invalid_value`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/select_multiple_invalid_value`);\n\t}\n}\n\n/**\n * Reactive `$state(...)` proxies and the values they proxy have different identities. Because of this, comparisons with `%operator%` will produce unexpected results\n * @param {string} operator\n */\nexport function state_proxy_equality_mismatch(operator) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_proxy_equality_mismatch\\n%cReactive \\`$state(...)\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\`${operator}\\` will produce unexpected results\\nhttps://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);\n\t}\n}\n\n/**\n * A `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\n */\nexport function svelte_boundary_reset_noop() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] svelte_boundary_reset_noop\\n%cA \\`<svelte:boundary>\\` \\`reset\\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);\n\t}\n}\n\n/**\n * The `slide` transition does not work correctly for elements with `display: %value%`\n * @param {string} value\n */\nexport function transition_slide_display(value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] transition_slide_display\\n%cThe \\`slide\\` transition does not work correctly for elements with \\`display: ${value}\\`\\nhttps://svelte.dev/e/transition_slide_display`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/transition_slide_display`);\n\t}\n}","/** @import { TemplateNode } from '#client' */\n\nimport { COMMENT_NODE } from '#client/constants';\nimport {\n\tHYDRATION_END,\n\tHYDRATION_ERROR,\n\tHYDRATION_START,\n\tHYDRATION_START_ELSE\n} from '../../../constants.js';\nimport * as w from '../warnings.js';\nimport { get_next_sibling } from './operations.js';\n\n/**\n * Use this variable to guard everything related to hydration code so it can be treeshaken out\n * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.\n */\nexport let hydrating = false;\n\n/** @param {boolean} value */\nexport function set_hydrating(value) {\n\thydrating = value;\n}\n\n/**\n * The node that is currently being hydrated. This starts out as the first node inside the opening\n * <!--[--> comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.\n * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the\n * time we leave the block it is the closing comment, which serves as the block's anchor.\n * @type {TemplateNode}\n */\nexport let hydrate_node;\n\n/** @param {TemplateNode} node */\nexport function set_hydrate_node(node) {\n\tif (node === null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn (hydrate_node = node);\n}\n\nexport function hydrate_next() {\n\treturn set_hydrate_node(/** @type {TemplateNode} */ (get_next_sibling(hydrate_node)));\n}\n\n/** @param {TemplateNode} node */\nexport function reset(node) {\n\tif (!hydrating) return;\n\n\t// If the node has remaining siblings, something has gone wrong\n\tif (get_next_sibling(hydrate_node) !== null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\thydrate_node = node;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n */\nexport function hydrate_template(template) {\n\tif (hydrating) {\n\t\t// @ts-expect-error TemplateNode doesn't include DocumentFragment, but it's actually fine\n\t\thydrate_node = template.content;\n\t}\n}\n\nexport function next(count = 1) {\n\tif (hydrating) {\n\t\tvar i = count;\n\t\tvar node = hydrate_node;\n\n\t\twhile (i--) {\n\t\t\tnode = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\t}\n\n\t\thydrate_node = node;\n\t}\n}\n\n/**\n * Removes all nodes starting at `hydrate_node` up until the next hydration end comment\n */\nexport function remove_nodes() {\n\tvar depth = 0;\n\tvar node = hydrate_node;\n\n\twhile (true) {\n\t\tif (node.nodeType === COMMENT_NODE) {\n\t\t\tvar data = /** @type {Comment} */ (node).data;\n\n\t\t\tif (data === HYDRATION_END) {\n\t\t\t\tif (depth === 0) return node;\n\t\t\t\tdepth -= 1;\n\t\t\t} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {\n\t\t\t\tdepth += 1;\n\t\t\t}\n\t\t}\n\n\t\tvar next = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n *\n * @param {TemplateNode} node\n */\nexport function read_hydration_instruction(node) {\n\tif (!node || node.nodeType !== COMMENT_NODE) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn /** @type {Comment} */ (node).data;\n}\n","/** @import { Equals } from '#client' */\n\n/** @type {Equals} */\nexport function equals(value) {\n\treturn value === this.v;\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function safe_not_equal(a, b) {\n\treturn a != a\n\t\t? b == b\n\t\t: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function not_equal(a, b) {\n\treturn a !== b;\n}\n\n/** @type {Equals} */\nexport function safe_equals(value) {\n\treturn !safe_not_equal(value, this.v);\n}\n","/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport * as e from './errors.js';\nimport { active_effect, active_reaction } from './runtime.js';\nimport { create_user_effect } from './reactivity/effects.js';\nimport { async_mode_flag, legacy_mode_flag } from '../flags/index.js';\nimport { FILENAME } from '../../constants.js';\nimport { BRANCH_EFFECT, EFFECT_RAN } from './constants.js';\n\n/** @type {ComponentContext | null} */\nexport let component_context = null;\n\n/** @param {ComponentContext | null} context */\nexport function set_component_context(context) {\n\tcomponent_context = context;\n}\n\n/** @type {DevStackEntry | null} */\nexport let dev_stack = null;\n\n/** @param {DevStackEntry | null} stack */\nexport function set_dev_stack(stack) {\n\tdev_stack = stack;\n}\n\n/**\n * Execute a callback with a new dev stack entry\n * @param {() => any} callback - Function to execute\n * @param {DevStackEntry['type']} type - Type of block/component\n * @param {any} component - Component function\n * @param {number} line - Line number\n * @param {number} column - Column number\n * @param {Record<string, any>} [additional] - Any additional properties to add to the dev stack entry\n * @returns {any}\n */\nexport function add_svelte_meta(callback, type, component, line, column, additional) {\n\tconst parent = dev_stack;\n\n\tdev_stack = {\n\t\ttype,\n\t\tfile: component[FILENAME],\n\t\tline,\n\t\tcolumn,\n\t\tparent,\n\t\t...additional\n\t};\n\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tdev_stack = parent;\n\t}\n}\n\n/**\n * The current component function. Different from current component context:\n * ```html\n * <!-- App.svelte -->\n * <Foo>\n * <Bar /> <!-- context == Foo.svelte, function == App.svelte -->\n * </Foo>\n * ```\n * @type {ComponentContext['function']}\n */\nexport let dev_current_component_function = null;\n\n/** @param {ComponentContext['function']} fn */\nexport function set_dev_current_component_function(fn) {\n\tdev_current_component_function = fn;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\tconst context_map = get_or_init_context_map('getContext');\n\tconst result = /** @type {T} */ (context_map.get(key));\n\treturn result;\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tconst context_map = get_or_init_context_map('setContext');\n\n\tif (async_mode_flag) {\n\t\tvar flags = /** @type {Effect} */ (active_effect).f;\n\t\tvar valid = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0;\n\n\t\tif (!valid) {\n\t\t\te.set_context_after_init();\n\t\t}\n\t}\n\n\tcontext_map.set(key, context);\n\treturn context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\tconst context_map = get_or_init_context_map('hasContext');\n\treturn context_map.has(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * @template {Map<any, any>} [T=Map<any, any>]\n * @returns {T}\n */\nexport function getAllContexts() {\n\tconst context_map = get_or_init_context_map('getAllContexts');\n\treturn /** @type {T} */ (context_map);\n}\n\n/**\n * @param {Record<string, unknown>} props\n * @param {any} runes\n * @param {Function} [fn]\n * @returns {void}\n */\nexport function push(props, runes = false, fn) {\n\tcomponent_context = {\n\t\tp: component_context,\n\t\tc: null,\n\t\te: null,\n\t\ts: props,\n\t\tx: null,\n\t\tl: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null\n\t};\n\n\tif (DEV) {\n\t\t// component function\n\t\tcomponent_context.function = fn;\n\t\tdev_current_component_function = fn;\n\t}\n}\n\n/**\n * @template {Record<string, any>} T\n * @param {T} [component]\n * @returns {T}\n */\nexport function pop(component) {\n\tvar context = /** @type {ComponentContext} */ (component_context);\n\tvar effects = context.e;\n\n\tif (effects !== null) {\n\t\tcontext.e = null;\n\n\t\tfor (var fn of effects) {\n\t\t\tcreate_user_effect(fn);\n\t\t}\n\t}\n\n\tif (component !== undefined) {\n\t\tcontext.x = component;\n\t}\n\n\tcomponent_context = context.p;\n\n\tif (DEV) {\n\t\tdev_current_component_function = component_context?.function ?? null;\n\t}\n\n\treturn component ?? /** @type {T} */ ({});\n}\n\n/** @returns {boolean} */\nexport function is_runes() {\n\treturn !legacy_mode_flag || (component_context !== null && component_context.l === null);\n}\n\n/**\n * @param {string} name\n * @returns {Map<unknown, unknown>}\n */\nfunction get_or_init_context_map(name) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component(name);\n\t}\n\n\treturn (component_context.c ??= new Map(get_parent_context(component_context) || undefined));\n}\n\n/**\n * @param {ComponentContext} component_context\n * @returns {Map<unknown, unknown> | null}\n */\nfunction get_parent_context(component_context) {\n\tlet parent = component_context.p;\n\twhile (parent !== null) {\n\t\tconst context_map = parent.c;\n\t\tif (context_map !== null) {\n\t\t\treturn context_map;\n\t\t}\n\t\tparent = parent.p;\n\t}\n\treturn null;\n}\n","/** @import { Derived, Effect } from '#client' */\n/** @import { Boundary } from './dom/blocks/boundary.js' */\nimport { DEV } from 'esm-env';\nimport { FILENAME } from '../../constants.js';\nimport { is_firefox } from './dom/operations.js';\nimport { ERROR_VALUE, BOUNDARY_EFFECT, EFFECT_RAN } from './constants.js';\nimport { define_property, get_descriptor } from '../shared/utils.js';\nimport { active_effect, active_reaction } from './runtime.js';\n\nconst adjustments = new WeakMap();\n\n/**\n * @param {unknown} error\n */\nexport function handle_error(error) {\n\tvar effect = active_effect;\n\n\t// for unowned deriveds, don't throw until we read the value\n\tif (effect === null) {\n\t\t/** @type {Derived} */ (active_reaction).f |= ERROR_VALUE;\n\t\treturn error;\n\t}\n\n\tif (DEV && error instanceof Error && !adjustments.has(error)) {\n\t\tadjustments.set(error, get_adjustments(error, effect));\n\t}\n\n\tif ((effect.f & EFFECT_RAN) === 0) {\n\t\t// if the error occurred while creating this subtree, we let it\n\t\t// bubble up until it hits a boundary that can handle it\n\t\tif ((effect.f & BOUNDARY_EFFECT) === 0) {\n\t\t\tif (!effect.parent && error instanceof Error) {\n\t\t\t\tapply_adjustments(error);\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t} else {\n\t\t// otherwise we bubble up the effect tree ourselves\n\t\tinvoke_error_boundary(error, effect);\n\t}\n}\n\n/**\n * @param {unknown} error\n * @param {Effect | null} effect\n */\nexport function invoke_error_boundary(error, effect) {\n\twhile (effect !== null) {\n\t\tif ((effect.f & BOUNDARY_EFFECT) !== 0) {\n\t\t\ttry {\n\t\t\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\n\t\teffect = effect.parent;\n\t}\n\n\tif (error instanceof Error) {\n\t\tapply_adjustments(error);\n\t}\n\n\tthrow error;\n}\n\n/**\n * Add useful information to the error message/stack in development\n * @param {Error} error\n * @param {Effect} effect\n */\nfunction get_adjustments(error, effect) {\n\tconst message_descriptor = get_descriptor(error, 'message');\n\n\t// if the message was already changed and it's not configurable we can't change it\n\t// or it will throw a different error swallowing the original error\n\tif (message_descriptor && !message_descriptor.configurable) return;\n\n\tvar indent = is_firefox ? ' ' : '\\t';\n\tvar component_stack = `\\n${indent}in ${effect.fn?.name || '<unknown>'}`;\n\tvar context = effect.ctx;\n\n\twhile (context !== null) {\n\t\tcomponent_stack += `\\n${indent}in ${context.function?.[FILENAME].split('/').pop()}`;\n\t\tcontext = context.p;\n\t}\n\n\treturn {\n\t\tmessage: error.message + `\\n${component_stack}\\n`,\n\t\tstack: error.stack\n\t\t\t?.split('\\n')\n\t\t\t.filter((line) => !line.includes('svelte/src/internal'))\n\t\t\t.join('\\n')\n\t};\n}\n\n/**\n * @param {Error} error\n */\nfunction apply_adjustments(error) {\n\tconst adjusted = adjustments.get(error);\n\n\tif (adjusted) {\n\t\tdefine_property(error, 'message', {\n\t\t\tvalue: adjusted.message\n\t\t});\n\n\t\tdefine_property(error, 'stack', {\n\t\t\tvalue: adjusted.stack\n\t\t});\n\t}\n}\n","import { run_all } from '../../shared/utils.js';\n\n// Fallback for when requestIdleCallback is not available\nconst request_idle_callback =\n\ttypeof requestIdleCallback === 'undefined'\n\t\t? (/** @type {() => void} */ cb) => setTimeout(cb, 1)\n\t\t: requestIdleCallback;\n\n/** @type {Array<() => void>} */\nlet micro_tasks = [];\n\n/** @type {Array<() => void>} */\nlet idle_tasks = [];\n\nfunction run_micro_tasks() {\n\tvar tasks = micro_tasks;\n\tmicro_tasks = [];\n\trun_all(tasks);\n}\n\nfunction run_idle_tasks() {\n\tvar tasks = idle_tasks;\n\tidle_tasks = [];\n\trun_all(tasks);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_micro_task(fn) {\n\tif (micro_tasks.length === 0) {\n\t\tqueueMicrotask(run_micro_tasks);\n\t}\n\n\tmicro_tasks.push(fn);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_idle_task(fn) {\n\tif (idle_tasks.length === 0) {\n\t\trequest_idle_callback(run_idle_tasks);\n\t}\n\n\tidle_tasks.push(fn);\n}\n\n/**\n * Synchronously run any queued tasks.\n */\nexport function flush_tasks() {\n\tif (micro_tasks.length > 0) {\n\t\trun_micro_tasks();\n\t}\n\n\tif (idle_tasks.length > 0) {\n\t\trun_idle_tasks();\n\t}\n}\n","/** @import { Effect, Source, TemplateNode, } from '#client' */\nimport {\n\tBOUNDARY_EFFECT,\n\tEFFECT_PRESERVED,\n\tEFFECT_RAN,\n\tEFFECT_TRANSPARENT\n} from '#client/constants';\nimport { component_context, set_component_context } from '../../context.js';\nimport { handle_error, invoke_error_boundary } from '../../error-handling.js';\nimport { block, branch, destroy_effect, pause_effect } 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\tremove_nodes,\n\tset_hydrate_node\n} from '../hydration.js';\nimport { get_next_sibling } from '../operations.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, effect_pending_updates } 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';\n\n/**\n * @typedef {{\n * \t onerror?: (error: unknown, reset: () => void) => void;\n * failed?: (anchor: Node, error: () => unknown, reset: () => () => void) => void;\n * pending?: (anchor: Node) => 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) => void)} children\n * @returns {void}\n */\nexport function boundary(node, props, children) {\n\tnew Boundary(node, props, children);\n}\n\nexport class Boundary {\n\tpending = false;\n\n\t/** @type {Boundary | null} */\n\tparent;\n\n\t/** @type {TemplateNode} */\n\t#anchor;\n\n\t/** @type {TemplateNode} */\n\t#hydrate_open;\n\n\t/** @type {BoundaryProps} */\n\t#props;\n\n\t/** @type {((anchor: Node) => 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#pending_count = 0;\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<number> | null}\n\t */\n\t#effect_pending = null;\n\n\t#effect_pending_update = () => {\n\t\tif (this.#effect_pending) {\n\t\t\tinternal_set(this.#effect_pending, this.#pending_count);\n\t\t}\n\t};\n\n\t#effect_pending_subscriber = createSubscriber(() => {\n\t\tthis.#effect_pending = source(this.#pending_count);\n\n\t\tif (DEV) {\n\t\t\ttag(this.#effect_pending, '$effect.pending()');\n\t\t}\n\n\t\treturn () => {\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) => 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.#hydrate_open = hydrate_node;\n\n\t\tthis.parent = /** @type {Effect} */ (active_effect).b;\n\n\t\tthis.pending = !!this.#props.pending;\n\n\t\tthis.#effect = block(() => {\n\t\t\t/** @type {Effect} */ (active_effect).b = this;\n\n\t\t\tif (hydrating) {\n\t\t\t\thydrate_next();\n\t\t\t}\n\n\t\t\tconst pending = this.#props.pending;\n\n\t\t\tif (hydrating && pending) {\n\t\t\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\n\t\t\t\t// future work: when we have some form of async SSR, we will\n\t\t\t\t// need to use hydration boundary comments to report whether\n\t\t\t\t// the pending or main block was rendered for a given\n\t\t\t\t// boundary, and hydrate accordingly\n\t\t\t\tBatch.enqueue(() => {\n\t\t\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\t\t\tBatch.ensure();\n\t\t\t\t\t\treturn branch(() => this.#children(this.#anchor));\n\t\t\t\t\t});\n\n\t\t\t\t\tif (this.#pending_count > 0) {\n\t\t\t\t\t\tthis.#show_pending_snippet();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpause_effect(/** @type {Effect} */ (this.#pending_effect), () => {\n\t\t\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tthis.pending = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tthis.#main_effect = branch(() => children(this.#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 > 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\t\t}, flags);\n\n\t\tif (hydrating) {\n\t\t\tthis.#anchor = hydrate_node;\n\t\t}\n\t}\n\n\thas_pending_snippet() {\n\t\treturn !!this.#props.pending;\n\t}\n\n\t/**\n\t * @param {() => 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) => void} */ (this.#props.pending);\n\n\t\tif (this.#main_effect !== null) {\n\t\t\tthis.#offscreen_fragment = document.createDocumentFragment();\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(() => pending(this.#anchor));\n\t\t}\n\t}\n\n\t/** @param {1 | -1} d */\n\t#update_pending_count(d) {\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, () => {\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/** @param {1 | -1} d */\n\tupdate_pending_count(d) {\n\t\tif (this.has_pending_snippet()) {\n\t\t\tthis.#update_pending_count(d);\n\t\t} else if (this.parent) {\n\t\t\tthis.parent.#update_pending_count(d);\n\t\t}\n\n\t\teffect_pending_updates.add(this.#effect_pending_update);\n\t}\n\n\tget_effect_pending() {\n\t\tthis.#effect_pending_subscriber();\n\t\treturn get(/** @type {Source<number>} */ (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\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(this.#hydrate_open);\n\t\t\tnext();\n\t\t\tset_hydrate_node(remove_nodes());\n\t\t}\n\n\t\tvar did_reset = false;\n\t\tvar calling_on_error = false;\n\n\t\tconst reset = () => {\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\tthis.#pending_count = 0;\n\n\t\t\tif (this.#failed_effect !== null) {\n\t\t\t\tpause_effect(this.#failed_effect, () => {\n\t\t\t\t\tthis.#failed_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.pending = true;\n\n\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\treturn branch(() => this.#children(this.#anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count > 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\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 && !failed)) {\n\t\t\tthrow error;\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 && 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(() => {\n\t\t\t\tthis.#failed_effect = this.#run(() => {\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(() => {\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() => error,\n\t\t\t\t\t\t\t\t() => 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\n/**\n *\n * @param {Effect} effect\n * @param {DocumentFragment} fragment\n */\nfunction move_effect(effect, fragment) {\n\tvar node = effect.nodes_start;\n\tvar end = effect.nodes_end;\n\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tfragment.append(node);\n\t\tnode = next;\n\t}\n}\n\nexport function get_pending_boundary() {\n\tvar boundary = /** @type {Effect} */ (active_effect).b;\n\n\twhile (boundary !== null && !boundary.has_pending_snippet()) {\n\t\tboundary = boundary.parent;\n\t}\n\n\tif (boundary === null) {\n\t\te.await_outside_boundary();\n\t}\n\n\treturn boundary;\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","/** @import { Derived, Effect, Source } from '#client' */\n/** @import { Batch } from './batch.js'; */\nimport { DEV } from 'esm-env';\nimport {\n\tERROR_VALUE,\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tEFFECT_PRESERVED,\n\tMAYBE_DIRTY,\n\tSTALE_REACTION,\n\tUNOWNED,\n\tASYNC\n} from '#client/constants';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tset_signal_status,\n\tskip_reaction,\n\tupdate_reaction,\n\tincrement_write_version,\n\tset_active_effect,\n\tpush_reaction_value,\n\tis_destroying_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport * as e from '../errors.js';\nimport * as w from '../warnings.js';\nimport { async_effect, destroy_effect } from './effects.js';\nimport { inspect_effects, internal_set, set_inspect_effects, source } from './sources.js';\nimport { get_stack } from '../dev/tracing.js';\nimport { tracing_mode_flag } from '../../flags/index.js';\nimport { Boundary } from '../dom/blocks/boundary.js';\nimport { component_context } from '../context.js';\nimport { UNINITIALIZED } from '../../../constants.js';\nimport { batch_deriveds, current_batch } from './batch.js';\nimport { unset_context } from './async.js';\n\n/** @type {Effect | null} */\nexport let current_async_effect = null;\n\n/** @param {Effect | null} v */\nexport function set_from_async_derived(v) {\n\tcurrent_async_effect = v;\n}\n\nexport const recent_async_deriveds = new Set();\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived(fn) {\n\tvar flags = DERIVED | DIRTY;\n\tvar parent_derived =\n\t\tactive_reaction !== null && (active_reaction.f & DERIVED) !== 0\n\t\t\t? /** @type {Derived} */ (active_reaction)\n\t\t\t: null;\n\n\tif (active_effect === null || (parent_derived !== null && (parent_derived.f & UNOWNED) !== 0)) {\n\t\tflags |= UNOWNED;\n\t} else {\n\t\t// Since deriveds are evaluated lazily, any effects created inside them are\n\t\t// created too late to ensure that the parent effect is added to the tree\n\t\tactive_effect.f |= EFFECT_PRESERVED;\n\t}\n\n\t/** @type {Derived<V>} */\n\tconst signal = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\teffects: null,\n\t\tequals,\n\t\tf: flags,\n\t\tfn,\n\t\treactions: null,\n\t\trv: 0,\n\t\tv: /** @type {V} */ (UNINITIALIZED),\n\t\twv: 0,\n\t\tparent: parent_derived ?? active_effect,\n\t\tac: null\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = get_stack('CreatedAt');\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {() => V | Promise<V>} fn\n * @param {string} [location] If provided, print a warning if the value is not read immediately after update\n * @returns {Promise<Source<V>>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function async_derived(fn, location) {\n\tlet parent = /** @type {Effect | null} */ (active_effect);\n\n\tif (parent === null) {\n\t\te.async_derived_orphan();\n\t}\n\n\tvar boundary = /** @type {Boundary} */ (parent.b);\n\n\tvar promise = /** @type {Promise<V>} */ (/** @type {unknown} */ (undefined));\n\tvar signal = source(/** @type {V} */ (UNINITIALIZED));\n\n\t/** @type {Promise<V> | null} */\n\tvar prev = null;\n\n\t// only suspend in async deriveds created on initialisation\n\tvar should_suspend = !active_reaction;\n\n\tasync_effect(() => {\n\t\tif (DEV) current_async_effect = active_effect;\n\n\t\ttry {\n\t\t\tvar p = fn();\n\t\t} catch (error) {\n\t\t\tp = Promise.reject(error);\n\t\t}\n\n\t\tif (DEV) current_async_effect = null;\n\n\t\tvar r = () => p;\n\t\tpromise = prev?.then(r, r) ?? Promise.resolve(p);\n\n\t\tprev = promise;\n\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar pending = boundary.pending;\n\n\t\tif (should_suspend) {\n\t\t\tboundary.update_pending_count(1);\n\t\t\tif (!pending) batch.increment();\n\t\t}\n\n\t\t/**\n\t\t * @param {any} value\n\t\t * @param {unknown} error\n\t\t */\n\t\tconst handler = (value, error = undefined) => {\n\t\t\tprev = null;\n\n\t\t\tcurrent_async_effect = null;\n\n\t\t\tif (!pending) batch.activate();\n\n\t\t\tif (error) {\n\t\t\t\tif (error !== STALE_REACTION) {\n\t\t\t\t\tsignal.f |= ERROR_VALUE;\n\n\t\t\t\t\t// @ts-expect-error the error is the wrong type, but we don't care\n\t\t\t\t\tinternal_set(signal, error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\t\t\t\tsignal.f ^= ERROR_VALUE;\n\t\t\t\t}\n\n\t\t\t\tinternal_set(signal, value);\n\n\t\t\t\tif (DEV && location !== undefined) {\n\t\t\t\t\trecent_async_deriveds.add(signal);\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (recent_async_deriveds.has(signal)) {\n\t\t\t\t\t\t\tw.await_waterfall(/** @type {string} */ (signal.label), location);\n\t\t\t\t\t\t\trecent_async_deriveds.delete(signal);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (should_suspend) {\n\t\t\t\tboundary.update_pending_count(-1);\n\t\t\t\tif (!pending) batch.decrement();\n\t\t\t}\n\n\t\t\tunset_context();\n\t\t};\n\n\t\tpromise.then(handler, (e) => handler(null, e || 'unknown'));\n\n\t\tif (batch) {\n\t\t\treturn () => {\n\t\t\t\tqueueMicrotask(() => batch.neuter());\n\t\t\t};\n\t\t}\n\t});\n\n\tif (DEV) {\n\t\t// add a flag that lets this be printed as a derived\n\t\t// when using `$inspect.trace()`\n\t\tsignal.f |= ASYNC;\n\t}\n\n\treturn new Promise((fulfil) => {\n\t\t/** @param {Promise<V>} p */\n\t\tfunction next(p) {\n\t\t\tfunction go() {\n\t\t\t\tif (p === promise) {\n\t\t\t\t\tfulfil(signal);\n\t\t\t\t} else {\n\t\t\t\t\t// if the effect re-runs before the initial promise\n\t\t\t\t\t// resolves, delay resolution until we have a value\n\t\t\t\t\tnext(promise);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp.then(go, go);\n\t\t}\n\n\t\tnext(promise);\n\t});\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function user_derived(fn) {\n\tconst d = derived(fn);\n\n\tpush_reaction_value(d);\n\n\treturn d;\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived_safe_equal(fn) {\n\tconst signal = derived(fn);\n\tsignal.equals = safe_equals;\n\treturn signal;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function destroy_derived_effects(derived) {\n\tvar effects = derived.effects;\n\n\tif (effects !== null) {\n\t\tderived.effects = null;\n\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdestroy_effect(/** @type {Effect} */ (effects[i]));\n\t\t}\n\t}\n}\n\n/**\n * The currently updating deriveds, used to detect infinite recursion\n * in dev mode and provide a nicer error than 'too much recursion'\n * @type {Derived[]}\n */\nlet stack = [];\n\n/**\n * @param {Derived} derived\n * @returns {Effect | null}\n */\nfunction get_derived_parent_effect(derived) {\n\tvar parent = derived.parent;\n\twhile (parent !== null) {\n\t\tif ((parent.f & DERIVED) === 0) {\n\t\t\treturn /** @type {Effect} */ (parent);\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\treturn null;\n}\n\n/**\n * @template T\n * @param {Derived} derived\n * @returns {T}\n */\nexport function execute_derived(derived) {\n\tvar value;\n\tvar prev_active_effect = active_effect;\n\n\tset_active_effect(get_derived_parent_effect(derived));\n\n\tif (DEV) {\n\t\tlet prev_inspect_effects = inspect_effects;\n\t\tset_inspect_effects(new Set());\n\t\ttry {\n\t\t\tif (stack.includes(derived)) {\n\t\t\t\te.derived_references_self();\n\t\t\t}\n\n\t\t\tstack.push(derived);\n\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t\tset_inspect_effects(prev_inspect_effects);\n\t\t\tstack.pop();\n\t\t}\n\t} else {\n\t\ttry {\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function update_derived(derived) {\n\tvar value = execute_derived(derived);\n\n\tif (!derived.equals(value)) {\n\t\tderived.v = value;\n\t\tderived.wv = increment_write_version();\n\t}\n\n\t// don't mark derived clean if we're reading it inside a\n\t// cleanup function, or it will cache a stale value\n\tif (is_destroying_effect) {\n\t\treturn;\n\t}\n\n\tif (batch_deriveds !== null) {\n\t\tbatch_deriveds.set(derived, derived.v);\n\t} else {\n\t\tvar status =\n\t\t\t(skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN;\n\n\t\tset_signal_status(derived, status);\n\t}\n}\n","/** @import { Effect, Value } from '#client' */\n\nimport { DESTROYED } from '#client/constants';\nimport { DEV } from 'esm-env';\nimport { component_context, is_runes, set_component_context } from '../context.js';\nimport { get_pending_boundary } from '../dom/blocks/boundary.js';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../runtime.js';\nimport { current_batch } from './batch.js';\nimport {\n\tasync_derived,\n\tcurrent_async_effect,\n\tderived,\n\tderived_safe_equal,\n\tset_from_async_derived\n} from './deriveds.js';\n\n/**\n *\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n * @param {(values: Value[]) => any} fn\n */\nexport function flatten(sync, async, fn) {\n\tconst d = is_runes() ? derived : derived_safe_equal;\n\n\tif (async.length === 0) {\n\t\tfn(sync.map(d));\n\t\treturn;\n\t}\n\n\tvar batch = current_batch;\n\tvar parent = /** @type {Effect} */ (active_effect);\n\n\tvar restore = capture();\n\tvar boundary = get_pending_boundary();\n\n\tPromise.all(async.map((expression) => async_derived(expression)))\n\t\t.then((result) => {\n\t\t\tbatch?.activate();\n\n\t\t\trestore();\n\n\t\t\ttry {\n\t\t\t\tfn([...sync.map(d), ...result]);\n\t\t\t} catch (error) {\n\t\t\t\t// ignore errors in blocks that have already been destroyed\n\t\t\t\tif ((parent.f & DESTROYED) === 0) {\n\t\t\t\t\tinvoke_error_boundary(error, parent);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch?.deactivate();\n\t\t\tunset_context();\n\t\t})\n\t\t.catch((error) => {\n\t\t\tboundary.error(error);\n\t\t});\n}\n\n/**\n * Captures the current effect context so that we can restore it after\n * some asynchronous work has happened (so that e.g. `await a + b`\n * causes `b` to be registered as a dependency).\n */\nfunction capture() {\n\tvar previous_effect = active_effect;\n\tvar previous_reaction = active_reaction;\n\tvar previous_component_context = component_context;\n\n\treturn function restore() {\n\t\tset_active_effect(previous_effect);\n\t\tset_active_reaction(previous_reaction);\n\t\tset_component_context(previous_component_context);\n\n\t\tif (DEV) {\n\t\t\tset_from_async_derived(null);\n\t\t}\n\t};\n}\n\n/**\n * Wraps an `await` expression in such a way that the effect context that was\n * active before the expression evaluated can be reapplied afterwards —\n * `await a + b` becomes `(await $.save(a))() + b`\n * @template T\n * @param {Promise<T>} promise\n * @returns {Promise<() => T>}\n */\nexport async function save(promise) {\n\tvar restore = capture();\n\tvar value = await promise;\n\n\treturn () => {\n\t\trestore();\n\t\treturn value;\n\t};\n}\n\n/**\n * Reset `current_async_effect` after the `promise` resolves, so\n * that we can emit `await_reactivity_loss` warnings\n * @template T\n * @param {Promise<T>} promise\n * @returns {Promise<() => T>}\n */\nexport async function track_reactivity_loss(promise) {\n\tvar previous_async_effect = current_async_effect;\n\tvar value = await promise;\n\n\treturn () => {\n\t\tset_from_async_derived(previous_async_effect);\n\t\treturn value;\n\t};\n}\n\nexport function unset_context() {\n\tset_active_effect(null);\n\tset_active_reaction(null);\n\tset_component_context(null);\n\tif (DEV) set_from_async_derived(null);\n}\n","/** @import { Derived, Effect, Source } from '#client' */\nimport {\n\tBLOCK_EFFECT,\n\tBRANCH_EFFECT,\n\tCLEAN,\n\tDESTROYED,\n\tDIRTY,\n\tEFFECT,\n\tASYNC,\n\tINERT,\n\tRENDER_EFFECT,\n\tROOT_EFFECT,\n\tUSER_EFFECT\n} from '#client/constants';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { deferred, define_property } from '../../shared/utils.js';\nimport { get_pending_boundary } from '../dom/blocks/boundary.js';\nimport {\n\tactive_effect,\n\tis_dirty,\n\tis_updating_effect,\n\tset_is_updating_effect,\n\tset_signal_status,\n\tupdate_effect,\n\twrite_version\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { flush_tasks } from '../dom/task.js';\nimport { DEV } from 'esm-env';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport { old_values } from './sources.js';\nimport { unlink_effect } from './effects.js';\nimport { unset_context } from './async.js';\n\n/** @type {Set<Batch>} */\nconst batches = new Set();\n\n/** @type {Batch | null} */\nexport let current_batch = null;\n\n/**\n * When time travelling, we re-evaluate deriveds based on the temporary\n * values of their dependencies rather than their actual values, and cache\n * the results in this map rather than on the deriveds themselves\n * @type {Map<Derived, any> | null}\n */\nexport let batch_deriveds = null;\n\n/** @type {Set<() => void>} */\nexport let effect_pending_updates = new Set();\n\n/** @type {Array<() => void>} */\nlet tasks = [];\n\nfunction dequeue() {\n\tconst task = /** @type {() => void} */ (tasks.shift());\n\n\tif (tasks.length > 0) {\n\t\tqueueMicrotask(dequeue);\n\t}\n\n\ttask();\n}\n\n/** @type {Effect[]} */\nlet queued_root_effects = [];\n\n/** @type {Effect | null} */\nlet last_scheduled_effect = null;\n\nlet is_flushing = false;\n\nexport class Batch {\n\t/**\n\t * The current values of any sources that are updated in this batch\n\t * They keys of this map are identical to `this.#previous`\n\t * @type {Map<Source, any>}\n\t */\n\t#current = new Map();\n\n\t/**\n\t * The values of any sources that are updated in this batch _before_ those updates took place.\n\t * They keys of this map are identical to `this.#current`\n\t * @type {Map<Source, any>}\n\t */\n\t#previous = new Map();\n\n\t/**\n\t * When the batch is committed (and the DOM is updated), we need to remove old branches\n\t * and append new ones by calling the functions added inside (if/each/key/etc) blocks\n\t * @type {Set<() => void>}\n\t */\n\t#callbacks = new Set();\n\n\t/**\n\t * The number of async effects that are currently in flight\n\t */\n\t#pending = 0;\n\n\t/**\n\t * A deferred that resolves when the batch is committed, used with `settled()`\n\t * TODO replace with Promise.withResolvers once supported widely enough\n\t * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}\n\t */\n\t#deferred = null;\n\n\t/**\n\t * True if an async effect inside this batch resolved and\n\t * its parent branch was already deleted\n\t */\n\t#neutered = false;\n\n\t/**\n\t * Async effects (created inside `async_derived`) encountered during processing.\n\t * These run after the rest of the batch has updated, since they should\n\t * always have the latest values\n\t * @type {Effect[]}\n\t */\n\t#async_effects = [];\n\n\t/**\n\t * The same as `#async_effects`, but for effects inside a newly-created\n\t * `<svelte:boundary>` — these do not prevent the batch from committing\n\t * @type {Effect[]}\n\t */\n\t#boundary_async_effects = [];\n\n\t/**\n\t * Template effects and `$effect.pre` effects, which run when\n\t * a batch is committed\n\t * @type {Effect[]}\n\t */\n\t#render_effects = [];\n\n\t/**\n\t * The same as `#render_effects`, but for `$effect` (which runs after)\n\t * @type {Effect[]}\n\t */\n\t#effects = [];\n\n\t/**\n\t * Block effects, which may need to re-run on subsequent flushes\n\t * in order to update internal sources (e.g. each block items)\n\t * @type {Effect[]}\n\t */\n\t#block_effects = [];\n\n\t/**\n\t * A set of branches that still exist, but will be destroyed when this batch\n\t * is committed — we skip over these during `process`\n\t * @type {Set<Effect>}\n\t */\n\tskipped_effects = new Set();\n\n\t/**\n\t *\n\t * @param {Effect[]} root_effects\n\t */\n\t#process(root_effects) {\n\t\tqueued_root_effects = [];\n\n\t\t/** @type {Map<Source, { v: unknown, wv: number }> | null} */\n\t\tvar current_values = null;\n\n\t\t// if there are multiple batches, we are 'time travelling' —\n\t\t// we need to undo the changes belonging to any batch\n\t\t// other than the current one\n\t\tif (batches.size > 1) {\n\t\t\tcurrent_values = new Map();\n\t\t\tbatch_deriveds = new Map();\n\n\t\t\tfor (const [source, current] of this.#current) {\n\t\t\t\tcurrent_values.set(source, { v: source.v, wv: source.wv });\n\t\t\t\tsource.v = current;\n\t\t\t}\n\n\t\t\tfor (const batch of batches) {\n\t\t\t\tif (batch === this) continue;\n\n\t\t\t\tfor (const [source, previous] of batch.#previous) {\n\t\t\t\t\tif (!current_values.has(source)) {\n\t\t\t\t\t\tcurrent_values.set(source, { v: source.v, wv: source.wv });\n\t\t\t\t\t\tsource.v = previous;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const root of root_effects) {\n\t\t\tthis.#traverse_effect_tree(root);\n\t\t}\n\n\t\t// if we didn't start any new async work, and no async work\n\t\t// is outstanding from a previous flush, commit\n\t\tif (this.#async_effects.length === 0 && this.#pending === 0) {\n\t\t\tvar render_effects = this.#render_effects;\n\t\t\tvar effects = this.#effects;\n\n\t\t\tthis.#render_effects = [];\n\t\t\tthis.#effects = [];\n\t\t\tthis.#block_effects = [];\n\n\t\t\tthis.#commit();\n\n\t\t\tflush_queued_effects(render_effects);\n\t\t\tflush_queued_effects(effects);\n\n\t\t\tthis.#deferred?.resolve();\n\t\t} else {\n\t\t\t// otherwise mark effects clean so they get scheduled on the next run\n\t\t\tfor (const e of this.#render_effects) set_signal_status(e, CLEAN);\n\t\t\tfor (const e of this.#effects) set_signal_status(e, CLEAN);\n\t\t\tfor (const e of this.#block_effects) set_signal_status(e, CLEAN);\n\t\t}\n\n\t\tif (current_values) {\n\t\t\tfor (const [source, { v, wv }] of current_values) {\n\t\t\t\t// reset the source to the current value (unless\n\t\t\t\t// it got a newer value as a result of effects running)\n\t\t\t\tif (source.wv <= wv) {\n\t\t\t\t\tsource.v = v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch_deriveds = null;\n\t\t}\n\n\t\tfor (const effect of this.#async_effects) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\n\t\tfor (const effect of this.#boundary_async_effects) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\n\t\tthis.#async_effects = [];\n\t\tthis.#boundary_async_effects = [];\n\t}\n\n\t/**\n\t * Traverse the effect tree, executing effects or stashing\n\t * them for later execution as appropriate\n\t * @param {Effect} root\n\t */\n\t#traverse_effect_tree(root) {\n\t\troot.f ^= CLEAN;\n\n\t\tvar effect = root.first;\n\n\t\twhile (effect !== null) {\n\t\t\tvar flags = effect.f;\n\t\t\tvar is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;\n\t\t\tvar is_skippable_branch = is_branch && (flags & CLEAN) !== 0;\n\n\t\t\tvar skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);\n\n\t\t\tif (!skip && effect.fn !== null) {\n\t\t\t\tif (is_branch) {\n\t\t\t\t\teffect.f ^= CLEAN;\n\t\t\t\t} else if ((flags & EFFECT) !== 0) {\n\t\t\t\t\tthis.#effects.push(effect);\n\t\t\t\t} else if (async_mode_flag && (flags & RENDER_EFFECT) !== 0) {\n\t\t\t\t\tthis.#render_effects.push(effect);\n\t\t\t\t} else if (is_dirty(effect)) {\n\t\t\t\t\tif ((flags & ASYNC) !== 0) {\n\t\t\t\t\t\tvar effects = effect.b?.pending ? this.#boundary_async_effects : this.#async_effects;\n\t\t\t\t\t\teffects.push(effect);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect);\n\t\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar child = effect.first;\n\n\t\t\t\tif (child !== null) {\n\t\t\t\t\teffect = child;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar parent = effect.parent;\n\t\t\teffect = effect.next;\n\n\t\t\twhile (effect === null && parent !== null) {\n\t\t\t\teffect = parent.next;\n\t\t\t\tparent = parent.parent;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Associate a change to a given source with the current\n\t * batch, noting its previous and current values\n\t * @param {Source} source\n\t * @param {any} value\n\t */\n\tcapture(source, value) {\n\t\tif (!this.#previous.has(source)) {\n\t\t\tthis.#previous.set(source, value);\n\t\t}\n\n\t\tthis.#current.set(source, source.v);\n\t}\n\n\tactivate() {\n\t\tcurrent_batch = this;\n\t}\n\n\tdeactivate() {\n\t\tcurrent_batch = null;\n\n\t\tfor (const update of effect_pending_updates) {\n\t\t\teffect_pending_updates.delete(update);\n\t\t\tupdate();\n\n\t\t\tif (current_batch !== null) {\n\t\t\t\t// only do one at a time\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tneuter() {\n\t\tthis.#neutered = true;\n\t}\n\n\tflush() {\n\t\tif (queued_root_effects.length > 0) {\n\t\t\tthis.flush_effects();\n\t\t} else {\n\t\t\tthis.#commit();\n\t\t}\n\n\t\tif (current_batch !== this) {\n\t\t\t// this can happen if a `flushSync` occurred during `this.flush_effects()`,\n\t\t\t// which is permitted in legacy mode despite being a terrible idea\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.#pending === 0) {\n\t\t\tbatches.delete(this);\n\t\t}\n\n\t\tthis.deactivate();\n\t}\n\n\tflush_effects() {\n\t\tvar was_updating_effect = is_updating_effect;\n\t\tis_flushing = true;\n\n\t\ttry {\n\t\t\tvar flush_count = 0;\n\t\t\tset_is_updating_effect(true);\n\n\t\t\twhile (queued_root_effects.length > 0) {\n\t\t\t\tif (flush_count++ > 1000) {\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\tvar updates = new Map();\n\n\t\t\t\t\t\tfor (const source of this.#current.keys()) {\n\t\t\t\t\t\t\tfor (const [stack, update] of source.updated ?? []) {\n\t\t\t\t\t\t\t\tvar entry = updates.get(stack);\n\n\t\t\t\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\t\t\t\tentry = { error: update.error, count: 0 };\n\t\t\t\t\t\t\t\t\tupdates.set(stack, entry);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tentry.count += update.count;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const update of updates.values()) {\n\t\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\t\tconsole.error(update.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tinfinite_loop_guard();\n\t\t\t\t}\n\n\t\t\t\tthis.#process(queued_root_effects);\n\t\t\t\told_values.clear();\n\t\t\t}\n\t\t} finally {\n\t\t\tis_flushing = false;\n\t\t\tset_is_updating_effect(was_updating_effect);\n\n\t\t\tlast_scheduled_effect = null;\n\t\t}\n\t}\n\n\t/**\n\t * Append and remove branches to/from the DOM\n\t */\n\t#commit() {\n\t\tif (!this.#neutered) {\n\t\t\tfor (const fn of this.#callbacks) {\n\t\t\t\tfn();\n\t\t\t}\n\t\t}\n\n\t\tthis.#callbacks.clear();\n\t}\n\n\tincrement() {\n\t\tthis.#pending += 1;\n\t}\n\n\tdecrement() {\n\t\tthis.#pending -= 1;\n\n\t\tif (this.#pending === 0) {\n\t\t\tfor (const e of this.#render_effects) {\n\t\t\t\tset_signal_status(e, DIRTY);\n\t\t\t\tschedule_effect(e);\n\t\t\t}\n\n\t\t\tfor (const e of this.#effects) {\n\t\t\t\tset_signal_status(e, DIRTY);\n\t\t\t\tschedule_effect(e);\n\t\t\t}\n\n\t\t\tfor (const e of this.#block_effects) {\n\t\t\t\tset_signal_status(e, DIRTY);\n\t\t\t\tschedule_effect(e);\n\t\t\t}\n\n\t\t\tthis.#render_effects = [];\n\t\t\tthis.#effects = [];\n\n\t\t\tthis.flush();\n\t\t} else {\n\t\t\tthis.deactivate();\n\t\t}\n\t}\n\n\t/** @param {() => void} fn */\n\tadd_callback(fn) {\n\t\tthis.#callbacks.add(fn);\n\t}\n\n\tsettled() {\n\t\treturn (this.#deferred ??= deferred()).promise;\n\t}\n\n\tstatic ensure(autoflush = true) {\n\t\tif (current_batch === null) {\n\t\t\tconst batch = (current_batch = new Batch());\n\t\t\tbatches.add(current_batch);\n\n\t\t\tif (autoflush) {\n\t\t\t\tBatch.enqueue(() => {\n\t\t\t\t\tif (current_batch !== batch) {\n\t\t\t\t\t\t// a flushSync happened in the meantime\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbatch.flush();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current_batch;\n\t}\n\n\t/** @param {() => void} task */\n\tstatic enqueue(task) {\n\t\tif (tasks.length === 0) {\n\t\t\tqueueMicrotask(dequeue);\n\t\t}\n\n\t\ttasks.unshift(task);\n\t}\n}\n\n/**\n * Synchronously flush any pending updates.\n * Returns void if no callback is provided, otherwise returns the result of calling the callback.\n * @template [T=void]\n * @param {(() => T) | undefined} [fn]\n * @returns {T}\n */\nexport function flushSync(fn) {\n\tif (async_mode_flag && active_effect !== null) {\n\t\te.flush_sync_in_effect();\n\t}\n\n\tvar result;\n\n\tconst batch = Batch.ensure(false);\n\n\tif (fn) {\n\t\tbatch.flush_effects();\n\n\t\tresult = fn();\n\t}\n\n\twhile (true) {\n\t\tflush_tasks();\n\n\t\tif (queued_root_effects.length === 0) {\n\t\t\tif (batch === current_batch) {\n\t\t\t\tbatch.flush();\n\t\t\t}\n\n\t\t\t// this would be reset in `batch.flush_effects()` but since we are early returning here,\n\t\t\t// we need to reset it here as well in case the first time there's 0 queued root effects\n\t\t\tlast_scheduled_effect = null;\n\n\t\t\treturn /** @type {T} */ (result);\n\t\t}\n\n\t\tbatch.flush_effects();\n\t}\n}\n\nfunction infinite_loop_guard() {\n\ttry {\n\t\te.effect_update_depth_exceeded();\n\t} catch (error) {\n\t\tif (DEV) {\n\t\t\t// stack contains no useful information, replace it\n\t\t\tdefine_property(error, 'stack', { value: '' });\n\t\t}\n\n\t\t// Best effort: invoke the boundary nearest the most recent\n\t\t// effect and hope that it's relevant to the infinite loop\n\t\tinvoke_error_boundary(error, last_scheduled_effect);\n\t}\n}\n\n/**\n * @param {Array<Effect>} effects\n * @returns {void}\n */\nfunction flush_queued_effects(effects) {\n\tvar length = effects.length;\n\tif (length === 0) return;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar effect = effects[i];\n\n\t\tif ((effect.f & (DESTROYED | INERT)) === 0) {\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tvar wv = write_version;\n\n\t\t\t\tupdate_effect(effect);\n\n\t\t\t\t// Effects with no dependencies or teardown do not get added to the effect tree.\n\t\t\t\t// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we\n\t\t\t\t// don't know if we need to keep them until they are executed. Doing the check\n\t\t\t\t// here (rather than in `update_effect`) allows us to skip the work for\n\t\t\t\t// immediate effects.\n\t\t\t\tif (effect.deps === null && effect.first === null && effect.nodes_start === null) {\n\t\t\t\t\t// if there's no teardown or abort controller we completely unlink\n\t\t\t\t\t// the effect from the graph\n\t\t\t\t\tif (effect.teardown === null && effect.ac === null) {\n\t\t\t\t\t\t// remove this effect from the graph\n\t\t\t\t\t\tunlink_effect(effect);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// keep the effect in the graph, but free up some memory\n\t\t\t\t\t\teffect.fn = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if state is written in a user effect, abort and re-schedule, lest we run\n\t\t\t\t// effects that should be removed as a result of the state change\n\t\t\t\tif (write_version > wv && (effect.f & USER_EFFECT) !== 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (; i < length; i += 1) {\n\t\tschedule_effect(effects[i]);\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function schedule_effect(signal) {\n\tvar effect = (last_scheduled_effect = signal);\n\n\twhile (effect.parent !== null) {\n\t\teffect = effect.parent;\n\t\tvar flags = effect.f;\n\n\t\t// if the effect is being scheduled because a parent (each/await/etc) block\n\t\t// updated an internal source, bail out or we'll cause a second flush\n\t\tif (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {\n\t\t\tif ((flags & CLEAN) === 0) return;\n\t\t\teffect.f ^= CLEAN;\n\t\t}\n\t}\n\n\tqueued_root_effects.push(effect);\n}\n\nexport function suspend() {\n\tvar boundary = get_pending_boundary();\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar pending = boundary.pending;\n\n\tboundary.update_pending_count(1);\n\tif (!pending) batch.increment();\n\n\treturn function unsuspend() {\n\t\tboundary.update_pending_count(-1);\n\n\t\tif (!pending) {\n\t\t\tbatch.activate();\n\t\t\tbatch.decrement();\n\t\t}\n\n\t\tunset_context();\n\t};\n}\n\n/**\n * Forcibly remove all current batches, to prevent cross-talk between tests\n */\nexport function clear() {\n\tbatches.clear();\n}\n","/** @import { Derived, Effect, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tuntracked_writes,\n\tget,\n\tset_untracked_writes,\n\tset_signal_status,\n\tuntrack,\n\tincrement_write_version,\n\tupdate_effect,\n\tcurrent_sources,\n\tis_dirty,\n\tuntracking,\n\tis_destroying_effect,\n\tpush_reaction_value\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport {\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tINSPECT_EFFECT,\n\tUNOWNED,\n\tMAYBE_DIRTY,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tASYNC\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { get_stack, tag_proxy } from '../dev/tracing.js';\nimport { component_context, is_runes } from '../context.js';\nimport { Batch, schedule_effect } from './batch.js';\nimport { proxy } from '../proxy.js';\nimport { execute_derived } from './deriveds.js';\n\nexport let inspect_effects = new Set();\n\n/** @type {Map<Source, any>} */\nexport const old_values = new Map();\n\n/**\n * @param {Set<any>} v\n */\nexport function set_inspect_effects(v) {\n\tinspect_effects = v;\n}\n\nlet inspect_effects_deferred = false;\n\nexport function set_inspect_effects_deferred() {\n\tinspect_effects_deferred = true;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n * @returns {Source<V>}\n */\n// TODO rename this to `state` throughout the codebase\nexport function source(v, stack) {\n\t/** @type {Value} */\n\tvar signal = {\n\t\tf: 0, // TODO ideally we could skip this altogether, but it causes type errors\n\t\tv,\n\t\treactions: null,\n\t\tequals,\n\t\trv: 0,\n\t\twv: 0\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = stack ?? get_stack('CreatedAt');\n\t\tsignal.updated = null;\n\t\tsignal.set_during_effect = false;\n\t\tsignal.trace = null;\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function state(v, stack) {\n\tconst s = source(v, stack);\n\n\tpush_reaction_value(s);\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {V} initial_value\n * @param {boolean} [immutable]\n * @returns {Source<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mutable_source(initial_value, immutable = false, trackable = true) {\n\tconst s = source(initial_value);\n\tif (!immutable) {\n\t\ts.equals = safe_equals;\n\t}\n\n\t// bind the signal to the component context, in case we need to\n\t// track updates to trigger beforeUpdate/afterUpdate callbacks\n\tif (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {\n\t\t(component_context.l.s ??= []).push(s);\n\t}\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {Value<V>} source\n * @param {V} value\n */\nexport function mutate(source, value) {\n\tset(\n\t\tsource,\n\t\tuntrack(() => get(source))\n\t);\n\treturn value;\n}\n\n/**\n * @template V\n * @param {Source<V>} source\n * @param {V} value\n * @param {boolean} [should_proxy]\n * @returns {V}\n */\nexport function set(source, value, should_proxy = false) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t// since we are untracking the function inside `$inspect.with` we need to add this check\n\t\t// to ensure we error if state is set inside an inspect effect\n\t\t(!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) &&\n\t\tis_runes() &&\n\t\t(active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | INSPECT_EFFECT)) !== 0 &&\n\t\t!current_sources?.includes(source)\n\t) {\n\t\te.state_unsafe_mutation();\n\t}\n\n\tlet new_value = should_proxy ? proxy(value) : value;\n\n\tif (DEV) {\n\t\ttag_proxy(new_value, /** @type {string} */ (source.label));\n\t}\n\n\treturn internal_set(source, new_value);\n}\n\n/**\n * @template V\n * @param {Source<V>} source\n * @param {V} value\n * @returns {V}\n */\nexport function internal_set(source, value) {\n\tif (!source.equals(value)) {\n\t\tvar old_value = source.v;\n\n\t\tif (is_destroying_effect) {\n\t\t\told_values.set(source, value);\n\t\t} else {\n\t\t\told_values.set(source, old_value);\n\t\t}\n\n\t\tsource.v = value;\n\n\t\tconst batch = Batch.ensure();\n\t\tbatch.capture(source, old_value);\n\n\t\tif (DEV) {\n\t\t\tif (tracing_mode_flag || active_effect !== null) {\n\t\t\t\tconst error = get_stack('UpdatedAt');\n\n\t\t\t\tif (error !== null) {\n\t\t\t\t\tsource.updated ??= new Map();\n\t\t\t\t\tlet entry = source.updated.get(error.stack);\n\n\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\tentry = { error, count: 0 };\n\t\t\t\t\t\tsource.updated.set(error.stack, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tentry.count++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (active_effect !== null) {\n\t\t\t\tsource.set_during_effect = true;\n\t\t\t}\n\t\t}\n\n\t\tif ((source.f & DERIVED) !== 0) {\n\t\t\t// if we are assigning to a dirty derived we set it to clean/maybe dirty but we also eagerly execute it to track the dependencies\n\t\t\tif ((source.f & DIRTY) !== 0) {\n\t\t\t\texecute_derived(/** @type {Derived} */ (source));\n\t\t\t}\n\t\t\tset_signal_status(source, (source.f & UNOWNED) === 0 ? CLEAN : MAYBE_DIRTY);\n\t\t}\n\n\t\tsource.wv = increment_write_version();\n\n\t\tmark_reactions(source, DIRTY);\n\n\t\t// It's possible that the current reaction might not have up-to-date dependencies\n\t\t// whilst it's actively running. So in the case of ensuring it registers the reaction\n\t\t// properly for itself, we need to ensure the current effect actually gets\n\t\t// scheduled. i.e: `$effect(() => x++)`\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tactive_effect !== null &&\n\t\t\t(active_effect.f & CLEAN) !== 0 &&\n\t\t\t(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0\n\t\t) {\n\t\t\tif (untracked_writes === null) {\n\t\t\t\tset_untracked_writes([source]);\n\t\t\t} else {\n\t\t\t\tuntracked_writes.push(source);\n\t\t\t}\n\t\t}\n\n\t\tif (DEV && inspect_effects.size > 0 && !inspect_effects_deferred) {\n\t\t\tflush_inspect_effects();\n\t\t}\n\t}\n\n\treturn value;\n}\n\nexport function flush_inspect_effects() {\n\tinspect_effects_deferred = false;\n\n\tconst inspects = Array.from(inspect_effects);\n\n\tfor (const effect of inspects) {\n\t\t// Mark clean inspect-effects as maybe dirty and then check their dirtiness\n\t\t// instead of just updating the effects - this way we avoid overfiring.\n\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t}\n\n\t\tif (is_dirty(effect)) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\t}\n\n\tinspect_effects.clear();\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source<T>} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update(source, d = 1) {\n\tvar value = get(source);\n\tvar result = d === 1 ? value++ : value--;\n\n\tset(source, value);\n\n\t// @ts-expect-error\n\treturn result;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source<T>} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update_pre(source, d = 1) {\n\tvar value = get(source);\n\n\t// @ts-expect-error\n\treturn set(source, d === 1 ? ++value : --value);\n}\n\n/**\n * Silently (without using `get`) increment a source\n * @param {Source<number>} source\n */\nexport function increment(source) {\n\tset(source, source.v + 1);\n}\n\n/**\n * @param {Value} signal\n * @param {number} status should be DIRTY or MAYBE_DIRTY\n * @returns {void}\n */\nfunction mark_reactions(signal, status) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tvar runes = is_runes();\n\tvar length = reactions.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tvar flags = reaction.f;\n\n\t\t// In legacy mode, skip the current effect to prevent infinite loops\n\t\tif (!runes && reaction === active_effect) continue;\n\n\t\t// Inspect effects need to run immediately, so that the stack trace makes sense\n\t\tif (DEV && (flags & INSPECT_EFFECT) !== 0) {\n\t\t\tinspect_effects.add(reaction);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// don't set a DIRTY reaction to MAYBE_DIRTY\n\t\tif ((flags & DIRTY) === 0) {\n\t\t\tset_signal_status(reaction, status);\n\t\t}\n\n\t\tif ((flags & DERIVED) !== 0) {\n\t\t\tmark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY);\n\t\t} else if ((flags & DIRTY) === 0) {\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tget,\n\tactive_effect,\n\tupdate_version,\n\tactive_reaction,\n\tset_update_version,\n\tset_active_reaction\n} from './runtime.js';\nimport {\n\tarray_prototype,\n\tget_descriptor,\n\tget_prototype_of,\n\tis_array,\n\tobject_prototype\n} from '../shared/utils.js';\nimport {\n\tstate as source,\n\tset,\n\tincrement,\n\tflush_inspect_effects,\n\tset_inspect_effects_deferred\n} from './reactivity/sources.js';\nimport { PROXY_PATH_SYMBOL, STATE_SYMBOL } from '#client/constants';\nimport { UNINITIALIZED } from '../../constants.js';\nimport * as e from './errors.js';\nimport { get_stack, tag } from './dev/tracing.js';\nimport { tracing_mode_flag } from '../flags/index.js';\n\n// TODO move all regexes into shared module?\nconst regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/**\n * @template T\n * @param {T} value\n * @returns {T}\n */\nexport function proxy(value) {\n\t// if non-proxyable, or is already a proxy, return `value`\n\tif (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {\n\t\treturn value;\n\t}\n\n\tconst prototype = get_prototype_of(value);\n\n\tif (prototype !== object_prototype && prototype !== array_prototype) {\n\t\treturn value;\n\t}\n\n\t/** @type {Map<any, Source<any>>} */\n\tvar sources = new Map();\n\tvar is_proxied_array = is_array(value);\n\tvar version = source(0);\n\n\tvar stack = DEV && tracing_mode_flag ? get_stack('CreatedAt') : null;\n\tvar parent_version = update_version;\n\n\t/**\n\t * Executes the proxy in the context of the reaction it was originally created in, if any\n\t * @template T\n\t * @param {() => T} fn\n\t */\n\tvar with_parent = (fn) => {\n\t\tif (update_version === parent_version) {\n\t\t\treturn fn();\n\t\t}\n\n\t\t// child source is being created after the initial proxy —\n\t\t// prevent it from being associated with the current reaction\n\t\tvar reaction = active_reaction;\n\t\tvar version = update_version;\n\n\t\tset_active_reaction(null);\n\t\tset_update_version(parent_version);\n\n\t\tvar result = fn();\n\n\t\tset_active_reaction(reaction);\n\t\tset_update_version(version);\n\n\t\treturn result;\n\t};\n\n\tif (is_proxied_array) {\n\t\t// We need to create the length source eagerly to ensure that\n\t\t// mutations to the array are properly synced with our proxy\n\t\tsources.set('length', source(/** @type {any[]} */ (value).length, stack));\n\t\tif (DEV) {\n\t\t\tvalue = /** @type {any} */ (inspectable_array(/** @type {any[]} */ (value)));\n\t\t}\n\t}\n\n\t/** Used in dev for $inspect.trace() */\n\tvar path = '';\n\n\t/** @param {string} new_path */\n\tfunction update_path(new_path) {\n\t\tpath = new_path;\n\n\t\ttag(version, `${path} version`);\n\n\t\t// rename all child sources and child proxies\n\t\tfor (const [prop, source] of sources) {\n\t\t\ttag(source, get_label(path, prop));\n\t\t}\n\t}\n\n\treturn new Proxy(/** @type {any} */ (value), {\n\t\tdefineProperty(_, prop, descriptor) {\n\t\t\tif (\n\t\t\t\t!('value' in descriptor) ||\n\t\t\t\tdescriptor.configurable === false ||\n\t\t\t\tdescriptor.enumerable === false ||\n\t\t\t\tdescriptor.writable === false\n\t\t\t) {\n\t\t\t\t// we disallow non-basic descriptors, because unless they are applied to the\n\t\t\t\t// target object — which we avoid, so that state can be forked — we will run\n\t\t\t\t// afoul of the various invariants\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor#invariants\n\t\t\t\te.state_descriptors_fixed();\n\t\t\t}\n\t\t\tvar s = sources.get(prop);\n\t\t\tif (s === undefined) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar s = source(descriptor.value, stack);\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tif (DEV && typeof prop === 'string') {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tset(s, descriptor.value, true);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tdeleteProperty(target, prop) {\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tincrement(version);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tset(s, UNINITIALIZED);\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (DEV && prop === PROXY_PATH_SYMBOL) {\n\t\t\t\treturn update_path;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar exists = prop in target;\n\n\t\t\t// create a source, but only if it's an own property and not a prototype property\n\t\t\tif (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar p = proxy(exists ? target[prop] : UNINITIALIZED);\n\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\n\t\t\t\tsources.set(prop, s);\n\t\t\t}\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar v = get(s);\n\t\t\t\treturn v === UNINITIALIZED ? undefined : v;\n\t\t\t}\n\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\tif (descriptor && 'value' in descriptor) {\n\t\t\t\tvar s = sources.get(prop);\n\t\t\t\tif (s) descriptor.value = get(s);\n\t\t\t} else if (descriptor === undefined) {\n\t\t\t\tvar source = sources.get(prop);\n\t\t\t\tvar value = source?.v;\n\n\t\t\t\tif (source !== undefined && value !== UNINITIALIZED) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\twritable: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn descriptor;\n\t\t},\n\n\t\thas(target, prop) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = (s !== undefined && s.v !== UNINITIALIZED) || Reflect.has(target, prop);\n\n\t\t\tif (\n\t\t\t\ts !== undefined ||\n\t\t\t\t(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))\n\t\t\t) {\n\t\t\t\tif (s === undefined) {\n\t\t\t\t\ts = with_parent(() => {\n\t\t\t\t\t\tvar p = has ? proxy(target[prop]) : UNINITIALIZED;\n\t\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t});\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\n\t\t\t\tvar value = get(s);\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn has;\n\t\t},\n\n\t\tset(target, prop, value, receiver) {\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = prop in target;\n\n\t\t\t// variable.length = value -> clear all signals with index >= value\n\t\t\tif (is_proxied_array && prop === 'length') {\n\t\t\t\tfor (var i = value; i < /** @type {Source<number>} */ (s).v; i += 1) {\n\t\t\t\t\tvar other_s = sources.get(i + '');\n\t\t\t\t\tif (other_s !== undefined) {\n\t\t\t\t\t\tset(other_s, UNINITIALIZED);\n\t\t\t\t\t} else if (i in target) {\n\t\t\t\t\t\t// If the item exists in the original, we need to create a uninitialized source,\n\t\t\t\t\t\t// else a later read of the property would result in a source being created with\n\t\t\t\t\t\t// the value of the original item at that index.\n\t\t\t\t\t\tother_s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\t\tsources.set(i + '', other_s);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(other_s, get_label(path, i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we haven't yet created a source for this property, we need to ensure\n\t\t\t// we do so otherwise if we read it later, then the write won't be tracked and\n\t\t\t// the heuristics of effects will be different vs if we had read the proxied\n\t\t\t// object property before writing to that property.\n\t\t\tif (s === undefined) {\n\t\t\t\tif (!has || get_descriptor(target, prop)?.writable) {\n\t\t\t\t\ts = with_parent(() => source(undefined, stack));\n\t\t\t\t\tset(s, proxy(value));\n\n\t\t\t\t\tsources.set(prop, s);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thas = s.v !== UNINITIALIZED;\n\n\t\t\t\tvar p = with_parent(() => proxy(value));\n\t\t\t\tset(s, p);\n\t\t\t}\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\t// Set the new value before updating any signals so that any listeners get the new value\n\t\t\tif (descriptor?.set) {\n\t\t\t\tdescriptor.set.call(receiver, value);\n\t\t\t}\n\n\t\t\tif (!has) {\n\t\t\t\t// If we have mutated an array directly, we might need to\n\t\t\t\t// signal that length has also changed. Do it before updating metadata\n\t\t\t\t// to ensure that iterating over the array as a result of a metadata update\n\t\t\t\t// will not cause the length to be out of sync.\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source<number>} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n >= ls.v) {\n\t\t\t\t\t\tset(ls, n + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\tget(version);\n\n\t\t\tvar own_keys = Reflect.ownKeys(target).filter((key) => {\n\t\t\t\tvar source = sources.get(key);\n\t\t\t\treturn source === undefined || source.v !== UNINITIALIZED;\n\t\t\t});\n\n\t\t\tfor (var [key, source] of sources) {\n\t\t\t\tif (source.v !== UNINITIALIZED && !(key in target)) {\n\t\t\t\t\town_keys.push(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn own_keys;\n\t\t},\n\n\t\tsetPrototypeOf() {\n\t\t\te.state_prototype_fixed();\n\t\t}\n\t});\n}\n\n/**\n * @param {string} path\n * @param {string | symbol} prop\n */\nfunction get_label(path, prop) {\n\tif (typeof prop === 'symbol') return `${path}[Symbol(${prop.description ?? ''})]`;\n\tif (regex_is_valid_identifier.test(prop)) return `${path}.${prop}`;\n\treturn /^\\d+$/.test(prop) ? `${path}[${prop}]` : `${path}['${prop}']`;\n}\n\n/**\n * @param {any} value\n */\nexport function get_proxied_value(value) {\n\ttry {\n\t\tif (value !== null && typeof value === 'object' && STATE_SYMBOL in value) {\n\t\t\treturn value[STATE_SYMBOL];\n\t\t}\n\t} catch {\n\t\t// the above if check can throw an error if the value in question\n\t\t// is the contentWindow of an iframe on another domain, in which\n\t\t// case we want to just return the value (because it's definitely\n\t\t// not a proxied value) so we don't break any JavaScript interacting\n\t\t// with that iframe (such as various payment companies client side\n\t\t// JavaScript libraries interacting with their iframes on the same\n\t\t// domain)\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n */\nexport function is(a, b) {\n\treturn Object.is(get_proxied_value(a), get_proxied_value(b));\n}\n\nconst ARRAY_MUTATING_METHODS = new Set([\n\t'copyWithin',\n\t'fill',\n\t'pop',\n\t'push',\n\t'reverse',\n\t'shift',\n\t'sort',\n\t'splice',\n\t'unshift'\n]);\n\n/**\n * Wrap array mutating methods so $inspect is triggered only once and\n * to prevent logging an array in intermediate state (e.g. with an empty slot)\n * @param {any[]} array\n */\nfunction inspectable_array(array) {\n\treturn new Proxy(array, {\n\t\tget(target, prop, receiver) {\n\t\t\tvar value = Reflect.get(target, prop, receiver);\n\t\t\tif (!ARRAY_MUTATING_METHODS.has(/** @type {string} */ (prop))) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @this {any[]}\n\t\t\t * @param {any[]} args\n\t\t\t */\n\t\t\treturn function (...args) {\n\t\t\t\tset_inspect_effects_deferred();\n\t\t\t\tvar result = value.apply(this, args);\n\t\t\t\tflush_inspect_effects();\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t});\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { DEV } from 'esm-env';\nimport { init_array_prototype_warnings } from '../dev/equality.js';\nimport { get_descriptor, is_extensible } from '../../shared/utils.js';\nimport { active_effect } from '../runtime.js';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { TEXT_NODE, EFFECT_RAN } from '#client/constants';\n\n// export these for reference in the compiled code, making global name deduplication unnecessary\n/** @type {Window} */\nexport var $window;\n\n/** @type {Document} */\nexport var $document;\n\n/** @type {boolean} */\nexport var is_firefox;\n\n/** @type {() => Node | null} */\nvar first_child_getter;\n/** @type {() => Node | null} */\nvar next_sibling_getter;\n\n/**\n * Initialize these lazily to avoid issues when using the runtime in a server context\n * where these globals are not available while avoiding a separate server entry point\n */\nexport function init_operations() {\n\tif ($window !== undefined) {\n\t\treturn;\n\t}\n\n\t$window = window;\n\t$document = document;\n\tis_firefox = /Firefox/.test(navigator.userAgent);\n\n\tvar element_prototype = Element.prototype;\n\tvar node_prototype = Node.prototype;\n\tvar text_prototype = Text.prototype;\n\n\t// @ts-ignore\n\tfirst_child_getter = get_descriptor(node_prototype, 'firstChild').get;\n\t// @ts-ignore\n\tnext_sibling_getter = get_descriptor(node_prototype, 'nextSibling').get;\n\n\tif (is_extensible(element_prototype)) {\n\t\t// the following assignments improve perf of lookups on DOM nodes\n\t\t// @ts-expect-error\n\t\telement_prototype.__click = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__className = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__attributes = null;\n\t\t// @ts-expect-error\n\t\telement_prototype.__style = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__e = undefined;\n\t}\n\n\tif (is_extensible(text_prototype)) {\n\t\t// @ts-expect-error\n\t\ttext_prototype.__t = undefined;\n\t}\n\n\tif (DEV) {\n\t\t// @ts-expect-error\n\t\telement_prototype.__svelte_meta = null;\n\n\t\tinit_array_prototype_warnings();\n\t}\n}\n\n/**\n * @param {string} value\n * @returns {Text}\n */\nexport function create_text(value = '') {\n\treturn document.createTextNode(value);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_first_child(node) {\n\treturn first_child_getter.call(node);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_next_sibling(node) {\n\treturn next_sibling_getter.call(node);\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @template {Node} N\n * @param {N} node\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function child(node, is_text) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar child = /** @type {TemplateNode} */ (get_first_child(hydrate_node));\n\n\t// Child can be null if we have an element with a single child, like `<p>{text}</p>`, where `text` is empty\n\tif (child === null) {\n\t\tchild = hydrate_node.appendChild(create_text());\n\t} else if (is_text && child.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\tchild?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(child);\n\treturn child;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {DocumentFragment | TemplateNode[]} fragment\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function first_child(fragment, is_text) {\n\tif (!hydrating) {\n\t\t// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)\n\t\tvar first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));\n\n\t\t// TODO prevent user comments with the empty string when preserveComments is true\n\t\tif (first instanceof Comment && first.data === '') return get_next_sibling(first);\n\n\t\treturn first;\n\t}\n\n\t// if an {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && hydrate_node?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\n\t\thydrate_node?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\treturn hydrate_node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {number} count\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function sibling(node, count = 1, is_text = false) {\n\tlet next_sibling = hydrating ? hydrate_node : node;\n\tvar last_sibling;\n\n\twhile (count--) {\n\t\tlast_sibling = next_sibling;\n\t\tnext_sibling = /** @type {TemplateNode} */ (get_next_sibling(next_sibling));\n\t}\n\n\tif (!hydrating) {\n\t\treturn next_sibling;\n\t}\n\n\t// if a sibling {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && next_sibling?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\t// If the next sibling is `null` and we're handling text then it's because\n\t\t// the SSR content was empty for the text, so we need to generate a new text\n\t\t// node and insert it after the last sibling\n\t\tif (next_sibling === null) {\n\t\t\tlast_sibling?.after(text);\n\t\t} else {\n\t\t\tnext_sibling.before(text);\n\t\t}\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(next_sibling);\n\treturn /** @type {TemplateNode} */ (next_sibling);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {void}\n */\nexport function clear_text_content(node) {\n\tnode.textContent = '';\n}\n\n/**\n * Returns `true` if we're updating the current block, for example `condition` in\n * an `{#if condition}` block just changed. In this case, the branch should be\n * appended (or removed) at the same time as other updates within the\n * current `<svelte:boundary>`\n */\nexport function should_defer_append() {\n\tif (!async_mode_flag) return false;\n\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\treturn (flags & EFFECT_RAN) !== 0;\n}\n\n/**\n *\n * @param {string} tag\n * @param {string} [namespace]\n * @param {string} [is]\n * @returns\n */\nexport function create_element(tag, namespace, is) {\n\tlet options = is ? { is } : undefined;\n\tif (namespace) {\n\t\treturn document.createElementNS(namespace, tag, options);\n\t}\n\treturn document.createElement(tag, options);\n}\n\nexport function create_fragment() {\n\treturn document.createDocumentFragment();\n}\n\n/**\n * @param {string} data\n * @returns\n */\nexport function create_comment(data = '') {\n\treturn document.createComment(data);\n}\n\n/**\n * @param {Element} element\n * @param {string} key\n * @param {string} value\n * @returns\n */\nexport function set_attribute(element, key, value = '') {\n\tif (key.startsWith('xlink:')) {\n\t\telement.setAttributeNS('http://www.w3.org/1999/xlink', key, value);\n\t\treturn;\n\t}\n\treturn element.setAttribute(key, value);\n}\n","/** @import { ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */\nimport {\n\tis_dirty,\n\tactive_effect,\n\tactive_reaction,\n\tupdate_effect,\n\tget,\n\tis_destroying_effect,\n\tremove_reactions,\n\tset_active_reaction,\n\tset_is_destroying_effect,\n\tset_signal_status,\n\tuntrack,\n\tuntracking\n} from '../runtime.js';\nimport {\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tRENDER_EFFECT,\n\tEFFECT,\n\tDESTROYED,\n\tINERT,\n\tEFFECT_RAN,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tEFFECT_TRANSPARENT,\n\tDERIVED,\n\tUNOWNED,\n\tCLEAN,\n\tINSPECT_EFFECT,\n\tHEAD_EFFECT,\n\tMAYBE_DIRTY,\n\tEFFECT_PRESERVED,\n\tSTALE_REACTION,\n\tUSER_EFFECT,\n\tASYNC\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { DEV } from 'esm-env';\nimport { define_property } from '../../shared/utils.js';\nimport { get_next_sibling } from '../dom/operations.js';\nimport { component_context, dev_current_component_function, dev_stack } from '../context.js';\nimport { Batch, schedule_effect } from './batch.js';\nimport { flatten } from './async.js';\n\n/**\n * @param {'$effect' | '$effect.pre' | '$inspect'} rune\n */\nexport function validate_effect(rune) {\n\tif (active_effect === null && active_reaction === null) {\n\t\te.effect_orphan(rune);\n\t}\n\n\tif (active_reaction !== null && (active_reaction.f & UNOWNED) !== 0 && active_effect === null) {\n\t\te.effect_in_unowned_derived();\n\t}\n\n\tif (is_destroying_effect) {\n\t\te.effect_in_teardown(rune);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect} parent_effect\n */\nfunction push_effect(effect, parent_effect) {\n\tvar parent_last = parent_effect.last;\n\tif (parent_last === null) {\n\t\tparent_effect.last = parent_effect.first = effect;\n\t} else {\n\t\tparent_last.next = effect;\n\t\teffect.prev = parent_last;\n\t\tparent_effect.last = effect;\n\t}\n}\n\n/**\n * @param {number} type\n * @param {null | (() => void | (() => void))} fn\n * @param {boolean} sync\n * @param {boolean} push\n * @returns {Effect}\n */\nfunction create_effect(type, fn, sync, push = true) {\n\tvar parent = active_effect;\n\n\tif (DEV) {\n\t\t// Ensure the parent is never an inspect effect\n\t\twhile (parent !== null && (parent.f & INSPECT_EFFECT) !== 0) {\n\t\t\tparent = parent.parent;\n\t\t}\n\t}\n\n\tif (parent !== null && (parent.f & INERT) !== 0) {\n\t\ttype |= INERT;\n\t}\n\n\t/** @type {Effect} */\n\tvar effect = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\tnodes_start: null,\n\t\tnodes_end: null,\n\t\tf: type | DIRTY,\n\t\tfirst: null,\n\t\tfn,\n\t\tlast: null,\n\t\tnext: null,\n\t\tparent,\n\t\tb: parent && parent.b,\n\t\tprev: null,\n\t\tteardown: null,\n\t\ttransitions: null,\n\t\twv: 0,\n\t\tac: null\n\t};\n\n\tif (DEV) {\n\t\teffect.component_function = dev_current_component_function;\n\t}\n\n\tif (sync) {\n\t\ttry {\n\t\t\tupdate_effect(effect);\n\t\t\teffect.f |= EFFECT_RAN;\n\t\t} catch (e) {\n\t\t\tdestroy_effect(effect);\n\t\t\tthrow e;\n\t\t}\n\t} else if (fn !== null) {\n\t\tschedule_effect(effect);\n\t}\n\n\t// if an effect has no dependencies, no DOM and no teardown function,\n\t// don't bother adding it to the effect tree\n\tvar inert =\n\t\tsync &&\n\t\teffect.deps === null &&\n\t\teffect.first === null &&\n\t\teffect.nodes_start === null &&\n\t\teffect.teardown === null &&\n\t\t(effect.f & EFFECT_PRESERVED) === 0;\n\n\tif (!inert && push) {\n\t\tif (parent !== null) {\n\t\t\tpush_effect(effect, parent);\n\t\t}\n\n\t\t// if we're in a derived, add the effect there too\n\t\tif (active_reaction !== null && (active_reaction.f & DERIVED) !== 0) {\n\t\t\tvar derived = /** @type {Derived} */ (active_reaction);\n\t\t\t(derived.effects ??= []).push(effect);\n\t\t}\n\t}\n\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect.tracking()`\n * @returns {boolean}\n */\nexport function effect_tracking() {\n\treturn active_reaction !== null && !untracking;\n}\n\n/**\n * @param {() => void} fn\n */\nexport function teardown(fn) {\n\tconst effect = create_effect(RENDER_EFFECT, null, false);\n\tset_signal_status(effect, CLEAN);\n\teffect.teardown = fn;\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect(...)`\n * @param {() => void | (() => void)} fn\n */\nexport function user_effect(fn) {\n\tvalidate_effect('$effect');\n\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect'\n\t\t});\n\t}\n\n\t// Non-nested `$effect(...)` in a component should be deferred\n\t// until the component is mounted\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\tvar defer = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0;\n\n\tif (defer) {\n\t\t// Top-level `$effect(...)` in an unmounted component — defer until mount\n\t\tvar context = /** @type {ComponentContext} */ (component_context);\n\t\t(context.e ??= []).push(fn);\n\t} else {\n\t\t// Everything else — create immediately\n\t\treturn create_user_effect(fn);\n\t}\n}\n\n/**\n * @param {() => void | (() => void)} fn\n */\nexport function create_user_effect(fn) {\n\treturn create_effect(EFFECT | USER_EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$effect.pre(...)`\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function user_pre_effect(fn) {\n\tvalidate_effect('$effect.pre');\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect.pre'\n\t\t});\n\t}\n\treturn create_effect(RENDER_EFFECT | USER_EFFECT, fn, true);\n}\n\n/** @param {() => void | (() => void)} fn */\nexport function inspect_effect(fn) {\n\treturn create_effect(INSPECT_EFFECT, fn, true);\n}\n\n/**\n * Internal representation of `$effect.root(...)`\n * @param {() => void | (() => void)} fn\n * @returns {() => void}\n */\nexport function effect_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn () => {\n\t\tdestroy_effect(effect);\n\t};\n}\n\n/**\n * An effect root whose children can transition out\n * @param {() => void} fn\n * @returns {(options?: { outro?: boolean }) => Promise<void>}\n */\nexport function component_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn (options = {}) => {\n\t\treturn new Promise((fulfil) => {\n\t\t\tif (options.outro) {\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t\tfulfil(undefined);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tfulfil(undefined);\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function effect(fn) {\n\treturn create_effect(EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$: ..`\n * @param {() => any} deps\n * @param {() => void | (() => void)} fn\n */\nexport function legacy_pre_effect(deps, fn) {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\t/** @type {{ effect: null | Effect, ran: boolean, deps: () => any }} */\n\tvar token = { effect: null, ran: false, deps };\n\n\tcontext.l.$.push(token);\n\n\ttoken.effect = render_effect(() => {\n\t\tdeps();\n\n\t\t// If this legacy pre effect has already run before the end of the reset, then\n\t\t// bail out to emulate the same behavior.\n\t\tif (token.ran) return;\n\n\t\ttoken.ran = true;\n\t\tuntrack(fn);\n\t});\n}\n\nexport function legacy_pre_effect_reset() {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\trender_effect(() => {\n\t\t// Run dirty `$:` statements\n\t\tfor (var token of context.l.$) {\n\t\t\ttoken.deps();\n\n\t\t\tvar effect = token.effect;\n\n\t\t\t// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through\n\t\t\t// the effects dependencies and correctly ensure each dependency is up-to-date.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\n\t\t\ttoken.ran = false;\n\t\t}\n\t});\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function async_effect(fn) {\n\treturn create_effect(ASYNC | EFFECT_PRESERVED, fn, true);\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function render_effect(fn, flags = 0) {\n\treturn create_effect(RENDER_EFFECT | flags, fn, true);\n}\n\n/**\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n */\nexport function template_effect(fn, sync = [], async = []) {\n\tflatten(sync, async, (values) => {\n\t\tcreate_effect(RENDER_EFFECT, () => fn(...values.map(get)), true);\n\t});\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function block(fn, flags = 0) {\n\tvar effect = create_effect(BLOCK_EFFECT | flags, fn, true);\n\tif (DEV) {\n\t\teffect.dev_stack = dev_stack;\n\t}\n\treturn effect;\n}\n\n/**\n * @param {(() => void)} fn\n * @param {boolean} [push]\n */\nexport function branch(fn, push = true) {\n\treturn create_effect(BRANCH_EFFECT, fn, true, push);\n}\n\n/**\n * @param {Effect} effect\n */\nexport function execute_effect_teardown(effect) {\n\tvar teardown = effect.teardown;\n\tif (teardown !== null) {\n\t\tconst previously_destroying_effect = is_destroying_effect;\n\t\tconst previous_reaction = active_reaction;\n\t\tset_is_destroying_effect(true);\n\t\tset_active_reaction(null);\n\t\ttry {\n\t\t\tteardown.call(null);\n\t\t} finally {\n\t\t\tset_is_destroying_effect(previously_destroying_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @param {boolean} remove_dom\n * @returns {void}\n */\nexport function destroy_effect_children(signal, remove_dom = false) {\n\tvar effect = signal.first;\n\tsignal.first = signal.last = null;\n\n\twhile (effect !== null) {\n\t\teffect.ac?.abort(STALE_REACTION);\n\n\t\tvar next = effect.next;\n\n\t\tif ((effect.f & ROOT_EFFECT) !== 0) {\n\t\t\t// this is now an independent root\n\t\t\teffect.parent = null;\n\t\t} else {\n\t\t\tdestroy_effect(effect, remove_dom);\n\t\t}\n\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function destroy_block_effect_children(signal) {\n\tvar effect = signal.first;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tif ((effect.f & BRANCH_EFFECT) === 0) {\n\t\t\tdestroy_effect(effect);\n\t\t}\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} [remove_dom]\n * @returns {void}\n */\nexport function destroy_effect(effect, remove_dom = true) {\n\tvar removed = false;\n\n\tif (\n\t\t(remove_dom || (effect.f & HEAD_EFFECT) !== 0) &&\n\t\teffect.nodes_start !== null &&\n\t\teffect.nodes_end !== null\n\t) {\n\t\tremove_effect_dom(effect.nodes_start, /** @type {TemplateNode} */ (effect.nodes_end));\n\t\tremoved = true;\n\t}\n\n\tdestroy_effect_children(effect, remove_dom && !removed);\n\tremove_reactions(effect, 0);\n\tset_signal_status(effect, DESTROYED);\n\n\tvar transitions = effect.transitions;\n\n\tif (transitions !== null) {\n\t\tfor (const transition of transitions) {\n\t\t\ttransition.stop();\n\t\t}\n\t}\n\n\texecute_effect_teardown(effect);\n\n\tvar parent = effect.parent;\n\n\t// If the parent doesn't have any children, then skip this work altogether\n\tif (parent !== null && parent.first !== null) {\n\t\tunlink_effect(effect);\n\t}\n\n\tif (DEV) {\n\t\teffect.component_function = null;\n\t}\n\n\t// `first` and `child` are nulled out in destroy_effect_children\n\t// we don't null out `parent` so that error propagation can work correctly\n\teffect.next =\n\t\teffect.prev =\n\t\teffect.teardown =\n\t\teffect.ctx =\n\t\teffect.deps =\n\t\teffect.fn =\n\t\teffect.nodes_start =\n\t\teffect.nodes_end =\n\t\teffect.ac =\n\t\t\tnull;\n}\n\n/**\n *\n * @param {TemplateNode | null} node\n * @param {TemplateNode} end\n */\nexport function remove_effect_dom(node, end) {\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n * Detach an effect from the effect tree, freeing up memory and\n * reducing the amount of work that happens on subsequent traversals\n * @param {Effect} effect\n */\nexport function unlink_effect(effect) {\n\tvar parent = effect.parent;\n\tvar prev = effect.prev;\n\tvar next = effect.next;\n\n\tif (prev !== null) prev.next = next;\n\tif (next !== null) next.prev = prev;\n\n\tif (parent !== null) {\n\t\tif (parent.first === effect) parent.first = next;\n\t\tif (parent.last === effect) parent.last = prev;\n\t}\n}\n\n/**\n * When a block effect is removed, we don't immediately destroy it or yank it\n * out of the DOM, because it might have transitions. Instead, we 'pause' it.\n * It stays around (in memory, and in the DOM) until outro transitions have\n * completed, and if the state change is reversed then we _resume_ it.\n * A paused effect does not update, and the DOM subtree becomes inert.\n * @param {Effect} effect\n * @param {() => void} [callback]\n */\nexport function pause_effect(effect, callback) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\n\tpause_children(effect, transitions, true);\n\n\trun_out_transitions(transitions, () => {\n\t\tdestroy_effect(effect);\n\t\tif (callback) callback();\n\t});\n}\n\n/**\n * @param {TransitionManager[]} transitions\n * @param {() => void} fn\n */\nexport function run_out_transitions(transitions, fn) {\n\tvar remaining = transitions.length;\n\tif (remaining > 0) {\n\t\tvar check = () => --remaining || fn();\n\t\tfor (var transition of transitions) {\n\t\t\ttransition.out(check);\n\t\t}\n\t} else {\n\t\tfn();\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {TransitionManager[]} transitions\n * @param {boolean} local\n */\nexport function pause_children(effect, transitions, local) {\n\tif ((effect.f & INERT) !== 0) return;\n\teffect.f ^= INERT;\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransitions.push(transition);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call pause_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tpause_children(child, transitions, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n}\n\n/**\n * The opposite of `pause_effect`. We call this if (for example)\n * `x` becomes falsy then truthy: `{#if x}...{/if}`\n * @param {Effect} effect\n */\nexport function resume_effect(effect) {\n\tresume_children(effect, true);\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} local\n */\nfunction resume_children(effect, local) {\n\tif ((effect.f & INERT) === 0) return;\n\teffect.f ^= INERT;\n\n\t// If a dependency of this effect changed while it was paused,\n\t// schedule the effect to update. we don't use `is_dirty`\n\t// here because we don't want to eagerly recompute a derived like\n\t// `{#if foo}{foo.bar()}{/if}` if `foo` is now `undefined\n\tif ((effect.f & CLEAN) === 0) {\n\t\tset_signal_status(effect, DIRTY);\n\t\tschedule_effect(effect);\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call resume_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tresume_children(child, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransition.in();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function aborted() {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\treturn (effect.f & DESTROYED) !== 0;\n}\n","/** @import { Derived, Effect, Reaction, Signal, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport { get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';\nimport {\n\tdestroy_block_effect_children,\n\tdestroy_effect_children,\n\texecute_effect_teardown\n} from './reactivity/effects.js';\nimport {\n\tDIRTY,\n\tMAYBE_DIRTY,\n\tCLEAN,\n\tDERIVED,\n\tUNOWNED,\n\tDESTROYED,\n\tBRANCH_EFFECT,\n\tSTATE_SYMBOL,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tDISCONNECTED,\n\tREACTION_IS_UPDATING,\n\tSTALE_REACTION,\n\tERROR_VALUE\n} from './constants.js';\nimport { old_values } from './reactivity/sources.js';\nimport {\n\tdestroy_derived_effects,\n\texecute_derived,\n\tcurrent_async_effect,\n\trecent_async_deriveds,\n\tupdate_derived\n} from './reactivity/deriveds.js';\nimport { async_mode_flag, tracing_mode_flag } from '../flags/index.js';\nimport { tracing_expressions, get_stack } from './dev/tracing.js';\nimport {\n\tcomponent_context,\n\tdev_current_component_function,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function,\n\tset_dev_stack\n} from './context.js';\nimport * as w from './warnings.js';\nimport { Batch, batch_deriveds, flushSync, schedule_effect } from './reactivity/batch.js';\nimport { handle_error } from './error-handling.js';\nimport { UNINITIALIZED } from '../../constants.js';\nimport { captured_signals } from './legacy.js';\n\nexport let is_updating_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_updating_effect(value) {\n\tis_updating_effect = value;\n}\n\nexport let is_destroying_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_destroying_effect(value) {\n\tis_destroying_effect = value;\n}\n\n/** @type {null | Reaction} */\nexport let active_reaction = null;\n\nexport let untracking = false;\n\n/** @param {null | Reaction} reaction */\nexport function set_active_reaction(reaction) {\n\tactive_reaction = reaction;\n}\n\n/** @type {null | Effect} */\nexport let active_effect = null;\n\n/** @param {null | Effect} effect */\nexport function set_active_effect(effect) {\n\tactive_effect = effect;\n}\n\n/**\n * When sources are created within a reaction, reading and writing\n * them within that reaction should not cause a re-run\n * @type {null | Source[]}\n */\nexport let current_sources = null;\n\n/** @param {Value} value */\nexport function push_reaction_value(value) {\n\tif (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {\n\t\tif (current_sources === null) {\n\t\t\tcurrent_sources = [value];\n\t\t} else {\n\t\t\tcurrent_sources.push(value);\n\t\t}\n\t}\n}\n\n/**\n * The dependencies of the reaction that is currently being executed. In many cases,\n * the dependencies are unchanged between runs, and so this will be `null` unless\n * and until a new dependency is accessed — we track this via `skipped_deps`\n * @type {null | Value[]}\n */\nlet new_deps = null;\n\nlet skipped_deps = 0;\n\n/**\n * Tracks writes that the effect it's executed in doesn't listen to yet,\n * so that the dependency can be added to the effect later on if it then reads it\n * @type {null | Source[]}\n */\nexport let untracked_writes = null;\n\n/** @param {null | Source[]} value */\nexport function set_untracked_writes(value) {\n\tuntracked_writes = value;\n}\n\n/**\n * @type {number} Used by sources and deriveds for handling updates.\n * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing\n **/\nexport let write_version = 1;\n\n/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */\nlet read_version = 0;\n\nexport let update_version = read_version;\n\n/** @param {number} value */\nexport function set_update_version(value) {\n\tupdate_version = value;\n}\n\n// If we are working with a get() chain that has no active container,\n// to prevent memory leaks, we skip adding the reaction.\nexport let skip_reaction = false;\n\nexport function increment_write_version() {\n\treturn ++write_version;\n}\n\n/**\n * Determines whether a derived or effect is dirty.\n * If it is MAYBE_DIRTY, will set the status to CLEAN\n * @param {Reaction} reaction\n * @returns {boolean}\n */\nexport function is_dirty(reaction) {\n\tvar flags = reaction.f;\n\n\tif ((flags & DIRTY) !== 0) {\n\t\treturn true;\n\t}\n\n\tif ((flags & MAYBE_DIRTY) !== 0) {\n\t\tvar dependencies = reaction.deps;\n\t\tvar is_unowned = (flags & UNOWNED) !== 0;\n\n\t\tif (dependencies !== null) {\n\t\t\tvar i;\n\t\t\tvar dependency;\n\t\t\tvar is_disconnected = (flags & DISCONNECTED) !== 0;\n\t\t\tvar is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction;\n\t\t\tvar length = dependencies.length;\n\n\t\t\t// If we are working with a disconnected or an unowned signal that is now connected (due to an active effect)\n\t\t\t// then we need to re-connect the reaction to the dependency, unless the effect has already been destroyed\n\t\t\t// (which can happen if the derived is read by an async derived)\n\t\t\tif (\n\t\t\t\t(is_disconnected || is_unowned_connected) &&\n\t\t\t\t(active_effect === null || (active_effect.f & DESTROYED) === 0)\n\t\t\t) {\n\t\t\t\tvar derived = /** @type {Derived} */ (reaction);\n\t\t\t\tvar parent = derived.parent;\n\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\t\t// We always re-add all reactions (even duplicates) if the derived was\n\t\t\t\t\t// previously disconnected, however we don't if it was unowned as we\n\t\t\t\t\t// de-duplicate dependencies in that case\n\t\t\t\t\tif (is_disconnected || !dependency?.reactions?.includes(derived)) {\n\t\t\t\t\t\t(dependency.reactions ??= []).push(derived);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (is_disconnected) {\n\t\t\t\t\tderived.f ^= DISCONNECTED;\n\t\t\t\t}\n\t\t\t\t// If the unowned derived is now fully connected to the graph again (it's unowned and reconnected, has a parent\n\t\t\t\t// and the parent is not unowned), then we can mark it as connected again, removing the need for the unowned\n\t\t\t\t// flag\n\t\t\t\tif (is_unowned_connected && parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t\t\tderived.f ^= UNOWNED;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\tif (is_dirty(/** @type {Derived} */ (dependency))) {\n\t\t\t\t\tupdate_derived(/** @type {Derived} */ (dependency));\n\t\t\t\t}\n\n\t\t\t\tif (dependency.wv > reaction.wv) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Unowned signals should never be marked as clean unless they\n\t\t// are used within an active_effect without skip_reaction\n\t\tif (!is_unowned || (active_effect !== null && !skip_reaction)) {\n\t\t\tset_signal_status(reaction, CLEAN);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {Value} signal\n * @param {Effect} effect\n * @param {boolean} [root]\n */\nfunction schedule_possible_effect_self_invalidation(signal, effect, root = true) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tif (!async_mode_flag && current_sources?.includes(signal)) {\n\t\treturn;\n\t}\n\n\tfor (var i = 0; i < reactions.length; i++) {\n\t\tvar reaction = reactions[i];\n\n\t\tif ((reaction.f & DERIVED) !== 0) {\n\t\t\tschedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);\n\t\t} else if (effect === reaction) {\n\t\t\tif (root) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t} else if ((reaction.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(reaction, MAYBE_DIRTY);\n\t\t\t}\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/** @param {Reaction} reaction */\nexport function update_reaction(reaction) {\n\tvar previous_deps = new_deps;\n\tvar previous_skipped_deps = skipped_deps;\n\tvar previous_untracked_writes = untracked_writes;\n\tvar previous_reaction = active_reaction;\n\tvar previous_skip_reaction = skip_reaction;\n\tvar previous_sources = current_sources;\n\tvar previous_component_context = component_context;\n\tvar previous_untracking = untracking;\n\tvar previous_update_version = update_version;\n\n\tvar flags = reaction.f;\n\n\tnew_deps = /** @type {null | Value[]} */ (null);\n\tskipped_deps = 0;\n\tuntracked_writes = null;\n\tskip_reaction =\n\t\t(flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);\n\tactive_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;\n\n\tcurrent_sources = null;\n\tset_component_context(reaction.ctx);\n\tuntracking = false;\n\tupdate_version = ++read_version;\n\n\tif (reaction.ac !== null) {\n\t\treaction.ac.abort(STALE_REACTION);\n\t\treaction.ac = null;\n\t}\n\n\ttry {\n\t\treaction.f |= REACTION_IS_UPDATING;\n\t\tvar result = /** @type {Function} */ (0, reaction.fn)();\n\t\tvar deps = reaction.deps;\n\n\t\tif (new_deps !== null) {\n\t\t\tvar i;\n\n\t\t\tremove_reactions(reaction, skipped_deps);\n\n\t\t\tif (deps !== null && skipped_deps > 0) {\n\t\t\t\tdeps.length = skipped_deps + new_deps.length;\n\t\t\t\tfor (i = 0; i < new_deps.length; i++) {\n\t\t\t\t\tdeps[skipped_deps + i] = new_deps[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treaction.deps = deps = new_deps;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!skip_reaction ||\n\t\t\t\t// Deriveds that already have reactions can cleanup, so we still add them as reactions\n\t\t\t\t((flags & DERIVED) !== 0 &&\n\t\t\t\t\t/** @type {import('#client').Derived} */ (reaction).reactions !== null)\n\t\t\t) {\n\t\t\t\tfor (i = skipped_deps; i < deps.length; i++) {\n\t\t\t\t\t(deps[i].reactions ??= []).push(reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (deps !== null && skipped_deps < deps.length) {\n\t\t\tremove_reactions(reaction, skipped_deps);\n\t\t\tdeps.length = skipped_deps;\n\t\t}\n\n\t\t// If we're inside an effect and we have untracked writes, then we need to\n\t\t// ensure that if any of those untracked writes result in re-invalidation\n\t\t// of the current effect, then that happens accordingly\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tuntracked_writes !== null &&\n\t\t\t!untracking &&\n\t\t\tdeps !== null &&\n\t\t\t(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0\n\t\t) {\n\t\t\tfor (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {\n\t\t\t\tschedule_possible_effect_self_invalidation(\n\t\t\t\t\tuntracked_writes[i],\n\t\t\t\t\t/** @type {Effect} */ (reaction)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we are returning to an previous reaction then\n\t\t// we need to increment the read version to ensure that\n\t\t// any dependencies in this reaction aren't marked with\n\t\t// the same version\n\t\tif (previous_reaction !== null && previous_reaction !== reaction) {\n\t\t\tread_version++;\n\n\t\t\tif (untracked_writes !== null) {\n\t\t\t\tif (previous_untracked_writes === null) {\n\t\t\t\t\tprevious_untracked_writes = untracked_writes;\n\t\t\t\t} else {\n\t\t\t\t\tprevious_untracked_writes.push(.../** @type {Source[]} */ (untracked_writes));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ((reaction.f & ERROR_VALUE) !== 0) {\n\t\t\treaction.f ^= ERROR_VALUE;\n\t\t}\n\n\t\treturn result;\n\t} catch (error) {\n\t\treturn handle_error(error);\n\t} finally {\n\t\treaction.f ^= REACTION_IS_UPDATING;\n\t\tnew_deps = previous_deps;\n\t\tskipped_deps = previous_skipped_deps;\n\t\tuntracked_writes = previous_untracked_writes;\n\t\tactive_reaction = previous_reaction;\n\t\tskip_reaction = previous_skip_reaction;\n\t\tcurrent_sources = previous_sources;\n\t\tset_component_context(previous_component_context);\n\t\tuntracking = previous_untracking;\n\t\tupdate_version = previous_update_version;\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} signal\n * @param {Value<V>} dependency\n * @returns {void}\n */\nfunction remove_reaction(signal, dependency) {\n\tlet reactions = dependency.reactions;\n\tif (reactions !== null) {\n\t\tvar index = index_of.call(reactions, signal);\n\t\tif (index !== -1) {\n\t\t\tvar new_length = reactions.length - 1;\n\t\t\tif (new_length === 0) {\n\t\t\t\treactions = dependency.reactions = null;\n\t\t\t} else {\n\t\t\t\t// Swap with last element and then remove.\n\t\t\t\treactions[index] = reactions[new_length];\n\t\t\t\treactions.pop();\n\t\t\t}\n\t\t}\n\t}\n\n\t// If the derived has no reactions, then we can disconnect it from the graph,\n\t// allowing it to either reconnect in the future, or be GC'd by the VM.\n\tif (\n\t\treactions === null &&\n\t\t(dependency.f & DERIVED) !== 0 &&\n\t\t// Destroying a child effect while updating a parent effect can cause a dependency to appear\n\t\t// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`\n\t\t// allows us to skip the expensive work of disconnecting and immediately reconnecting it\n\t\t(new_deps === null || !new_deps.includes(dependency))\n\t) {\n\t\tset_signal_status(dependency, MAYBE_DIRTY);\n\t\t// If we are working with a derived that is owned by an effect, then mark it as being\n\t\t// disconnected.\n\t\tif ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) {\n\t\t\tdependency.f ^= DISCONNECTED;\n\t\t}\n\t\t// Disconnect any reactions owned by this reaction\n\t\tdestroy_derived_effects(/** @type {Derived} **/ (dependency));\n\t\tremove_reactions(/** @type {Derived} **/ (dependency), 0);\n\t}\n}\n\n/**\n * @param {Reaction} signal\n * @param {number} start_index\n * @returns {void}\n */\nexport function remove_reactions(signal, start_index) {\n\tvar dependencies = signal.deps;\n\tif (dependencies === null) return;\n\n\tfor (var i = start_index; i < dependencies.length; i++) {\n\t\tremove_reaction(signal, dependencies[i]);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function update_effect(effect) {\n\tvar flags = effect.f;\n\n\tif ((flags & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar previous_effect = active_effect;\n\tvar was_updating_effect = is_updating_effect;\n\n\tactive_effect = effect;\n\tis_updating_effect = true;\n\n\tif (DEV) {\n\t\tvar previous_component_fn = dev_current_component_function;\n\t\tset_dev_current_component_function(effect.component_function);\n\t\tvar previous_stack = /** @type {any} */ (dev_stack);\n\t\t// only block effects have a dev stack, keep the current one otherwise\n\t\tset_dev_stack(effect.dev_stack ?? dev_stack);\n\t}\n\n\ttry {\n\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\tdestroy_block_effect_children(effect);\n\t\t} else {\n\t\t\tdestroy_effect_children(effect);\n\t\t}\n\n\t\texecute_effect_teardown(effect);\n\t\tvar teardown = update_reaction(effect);\n\t\teffect.teardown = typeof teardown === 'function' ? teardown : null;\n\t\teffect.wv = write_version;\n\n\t\t// In DEV, increment versions of any sources that were written to during the effect,\n\t\t// so that they are correctly marked as dirty when the effect re-runs\n\t\tif (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) {\n\t\t\tfor (var dep of effect.deps) {\n\t\t\t\tif (dep.set_during_effect) {\n\t\t\t\t\tdep.wv = increment_write_version();\n\t\t\t\t\tdep.set_during_effect = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_updating_effect = was_updating_effect;\n\t\tactive_effect = previous_effect;\n\n\t\tif (DEV) {\n\t\t\tset_dev_current_component_function(previous_component_fn);\n\t\t\tset_dev_stack(previous_stack);\n\t\t}\n\t}\n}\n\n/**\n * Returns a promise that resolves once any pending state changes have been applied.\n * @returns {Promise<void>}\n */\nexport async function tick() {\n\tif (async_mode_flag) {\n\t\treturn new Promise((f) => requestAnimationFrame(() => f()));\n\t}\n\n\tawait Promise.resolve();\n\n\t// By calling flushSync we guarantee that any pending state changes are applied after one tick.\n\t// TODO look into whether we can make flushing subsequent updates synchronously in the future.\n\tflushSync();\n}\n\n/**\n * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,\n * have resolved and the DOM has been updated\n * @returns {Promise<void>}\n * @since 5.36\n */\nexport function settled() {\n\treturn Batch.ensure().settled();\n}\n\n/**\n * @template V\n * @param {Value<V>} signal\n * @returns {V}\n */\nexport function get(signal) {\n\tvar flags = signal.f;\n\tvar is_derived = (flags & DERIVED) !== 0;\n\n\tcaptured_signals?.add(signal);\n\n\t// Register the dependency on the current reaction signal.\n\tif (active_reaction !== null && !untracking) {\n\t\t// if we're in a derived that is being read inside an _async_ derived,\n\t\t// it's possible that the effect was already destroyed. In this case,\n\t\t// we don't add the dependency, because that would create a memory leak\n\t\tvar destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;\n\n\t\tif (!destroyed && !current_sources?.includes(signal)) {\n\t\t\tvar deps = active_reaction.deps;\n\n\t\t\tif ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {\n\t\t\t\t// we're in the effect init/update cycle\n\t\t\t\tif (signal.rv < read_version) {\n\t\t\t\t\tsignal.rv = read_version;\n\n\t\t\t\t\t// If the signal is accessing the same dependencies in the same\n\t\t\t\t\t// order as it did last time, increment `skipped_deps`\n\t\t\t\t\t// rather than updating `new_deps`, which creates GC cost\n\t\t\t\t\tif (new_deps === null && deps !== null && deps[skipped_deps] === signal) {\n\t\t\t\t\t\tskipped_deps++;\n\t\t\t\t\t} else if (new_deps === null) {\n\t\t\t\t\t\tnew_deps = [signal];\n\t\t\t\t\t} else if (!skip_reaction || !new_deps.includes(signal)) {\n\t\t\t\t\t\t// Normally we can push duplicated dependencies to `new_deps`, but if we're inside\n\t\t\t\t\t\t// an unowned derived because skip_reaction is true, then we need to ensure that\n\t\t\t\t\t\t// we don't have duplicates\n\t\t\t\t\t\tnew_deps.push(signal);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we're adding a dependency outside the init/update cycle\n\t\t\t\t// (i.e. after an `await`)\n\t\t\t\t(active_reaction.deps ??= []).push(signal);\n\n\t\t\t\tvar reactions = signal.reactions;\n\n\t\t\t\tif (reactions === null) {\n\t\t\t\t\tsignal.reactions = [active_reaction];\n\t\t\t\t} else if (!reactions.includes(active_reaction)) {\n\t\t\t\t\treactions.push(active_reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (\n\t\tis_derived &&\n\t\t/** @type {Derived} */ (signal).deps === null &&\n\t\t/** @type {Derived} */ (signal).effects === null\n\t) {\n\t\tvar derived = /** @type {Derived} */ (signal);\n\t\tvar parent = derived.parent;\n\n\t\tif (parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t// If the derived is owned by another derived then mark it as unowned\n\t\t\t// as the derived value might have been referenced in a different context\n\t\t\t// since and thus its parent might not be its true owner anymore\n\t\t\tderived.f ^= UNOWNED;\n\t\t}\n\t}\n\n\tif (DEV) {\n\t\tif (current_async_effect) {\n\t\t\tvar tracking = (current_async_effect.f & REACTION_IS_UPDATING) !== 0;\n\t\t\tvar was_read = current_async_effect.deps?.includes(signal);\n\n\t\t\tif (!tracking && !untracking && !was_read) {\n\t\t\t\tw.await_reactivity_loss(/** @type {string} */ (signal.label));\n\n\t\t\t\tvar trace = get_stack('TracedAt');\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tif (trace) console.warn(trace);\n\t\t\t}\n\t\t}\n\n\t\trecent_async_deriveds.delete(signal);\n\n\t\tif (\n\t\t\ttracing_mode_flag &&\n\t\t\t!untracking &&\n\t\t\ttracing_expressions !== null &&\n\t\t\tactive_reaction !== null &&\n\t\t\ttracing_expressions.reaction === active_reaction\n\t\t) {\n\t\t\t// Used when mapping state between special blocks like `each`\n\t\t\tif (signal.trace) {\n\t\t\t\tsignal.trace();\n\t\t\t} else {\n\t\t\t\ttrace = get_stack('TracedAt');\n\n\t\t\t\tif (trace) {\n\t\t\t\t\tvar entry = tracing_expressions.entries.get(signal);\n\n\t\t\t\t\tif (entry === undefined) {\n\t\t\t\t\t\tentry = { traces: [] };\n\t\t\t\t\t\ttracing_expressions.entries.set(signal, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar last = entry.traces[entry.traces.length - 1];\n\n\t\t\t\t\t// traces can be duplicated, e.g. by `snapshot` invoking both\n\t\t\t\t\t// both `getOwnPropertyDescriptor` and `get` traps at once\n\t\t\t\t\tif (trace.stack !== last?.stack) {\n\t\t\t\t\t\tentry.traces.push(trace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_destroying_effect) {\n\t\tif (old_values.has(signal)) {\n\t\t\treturn old_values.get(signal);\n\t\t}\n\n\t\tif (is_derived) {\n\t\t\tderived = /** @type {Derived} */ (signal);\n\n\t\t\tvar value = derived.v;\n\n\t\t\t// if the derived is dirty and has reactions, or depends on the values that just changed, re-execute\n\t\t\t// (a derived can be maybe_dirty due to the effect destroy removing its last reaction)\n\t\t\tif (\n\t\t\t\t((derived.f & CLEAN) === 0 && derived.reactions !== null) ||\n\t\t\t\tdepends_on_old_values(derived)\n\t\t\t) {\n\t\t\t\tvalue = execute_derived(derived);\n\t\t\t}\n\n\t\t\told_values.set(derived, value);\n\n\t\t\treturn value;\n\t\t}\n\t} else if (is_derived) {\n\t\tderived = /** @type {Derived} */ (signal);\n\n\t\tif (batch_deriveds?.has(derived)) {\n\t\t\treturn batch_deriveds.get(derived);\n\t\t}\n\n\t\tif (is_dirty(derived)) {\n\t\t\tupdate_derived(derived);\n\t\t}\n\t}\n\n\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\tthrow signal.v;\n\t}\n\n\treturn signal.v;\n}\n\n/** @param {Derived} derived */\nfunction depends_on_old_values(derived) {\n\tif (derived.v === UNINITIALIZED) return true; // we don't know, so assume the worst\n\tif (derived.deps === null) return false;\n\n\tfor (const dep of derived.deps) {\n\t\tif (old_values.has(dep)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ((dep.f & DERIVED) !== 0 && depends_on_old_values(/** @type {Derived} */ (dep))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Like `get`, but checks for `undefined`. Used for `var` declarations because they can be accessed before being declared\n * @template V\n * @param {Value<V> | undefined} signal\n * @returns {V | undefined}\n */\nexport function safe_get(signal) {\n\treturn signal && get(signal);\n}\n\n/**\n * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),\n * any state read inside `fn` will not be treated as a dependency.\n *\n * ```ts\n * $effect(() => {\n * // this will run when `data` changes, but not when `time` changes\n * save(data, {\n * timestamp: untrack(() => time)\n * });\n * });\n * ```\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function untrack(fn) {\n\tvar previous_untracking = untracking;\n\ttry {\n\t\tuntracking = true;\n\t\treturn fn();\n\t} finally {\n\t\tuntracking = previous_untracking;\n\t}\n}\n\nconst STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);\n\n/**\n * @param {Signal} signal\n * @param {number} status\n * @returns {void}\n */\nexport function set_signal_status(signal, status) {\n\tsignal.f = (signal.f & STATUS_MASK) | status;\n}\n\n/**\n * @param {Record<string, unknown>} obj\n * @param {string[]} keys\n * @returns {Record<string, unknown>}\n */\nexport function exclude_from_object(obj, keys) {\n\t/** @type {Record<string, unknown>} */\n\tvar result = {};\n\n\tfor (var key in obj) {\n\t\tif (!keys.includes(key)) {\n\t\t\tresult[key] = obj[key];\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Possibly traverse an object and read all its properties so that they're all reactive in case this is `$state`.\n * Does only check first level of an object for performance reasons (heuristic should be good for 99% of all cases).\n * @param {any} value\n * @returns {void}\n */\nexport function deep_read_state(value) {\n\tif (typeof value !== 'object' || !value || value instanceof EventTarget) {\n\t\treturn;\n\t}\n\n\tif (STATE_SYMBOL in value) {\n\t\tdeep_read(value);\n\t} else if (!Array.isArray(value)) {\n\t\tfor (let key in value) {\n\t\t\tconst prop = value[key];\n\t\t\tif (typeof prop === 'object' && prop && STATE_SYMBOL in prop) {\n\t\t\t\tdeep_read(prop);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Deeply traverse an object and read all its properties\n * so that they're all reactive in case this is `$state`\n * @param {any} value\n * @param {Set<any>} visited\n * @returns {void}\n */\nexport function deep_read(value, visited = new Set()) {\n\tif (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t// We don't want to traverse DOM elements\n\t\t!(value instanceof EventTarget) &&\n\t\t!visited.has(value)\n\t) {\n\t\tvisited.add(value);\n\t\t// When working with a possible SvelteDate, this\n\t\t// will ensure we capture changes to it.\n\t\tif (value instanceof Date) {\n\t\t\tvalue.getTime();\n\t\t}\n\t\tfor (let key in value) {\n\t\t\ttry {\n\t\t\t\tdeep_read(value[key], visited);\n\t\t\t} catch (e) {\n\t\t\t\t// continue\n\t\t\t}\n\t\t}\n\t\tconst proto = get_prototype_of(value);\n\t\tif (\n\t\t\tproto !== Object.prototype &&\n\t\t\tproto !== Array.prototype &&\n\t\t\tproto !== Map.prototype &&\n\t\t\tproto !== Set.prototype &&\n\t\t\tproto !== Date.prototype\n\t\t) {\n\t\t\tconst descriptors = get_descriptors(proto);\n\t\t\tfor (let key in descriptors) {\n\t\t\t\tconst get = descriptors[key].get;\n\t\t\t\tif (get) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tget.call(value);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// continue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { hydrating } from '../hydration.js';\nimport { clear_text_content, get_first_child } from '../operations.js';\nimport { queue_micro_task } from '../task.js';\n\n/**\n * @param {HTMLElement} dom\n * @param {boolean} value\n * @returns {void}\n */\nexport function autofocus(dom, value) {\n\tif (value) {\n\t\tconst body = document.body;\n\t\tdom.autofocus = true;\n\n\t\tqueue_micro_task(() => {\n\t\t\tif (document.activeElement === body) {\n\t\t\t\tdom.focus();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * The child of a textarea actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLTextAreaElement} dom\n * @returns {void}\n */\nexport function remove_textarea_child(dom) {\n\tif (hydrating && get_first_child(dom) !== null) {\n\t\tclear_text_content(dom);\n\t}\n}\n\nlet listening_to_form_reset = false;\n\nexport function add_form_reset_listener() {\n\tif (!listening_to_form_reset) {\n\t\tlistening_to_form_reset = true;\n\t\tdocument.addEventListener(\n\t\t\t'reset',\n\t\t\t(evt) => {\n\t\t\t\t// Needs to happen one tick later or else the dom properties of the form\n\t\t\t\t// elements have not updated to their reset values yet\n\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\tif (!evt.defaultPrevented) {\n\t\t\t\t\t\tfor (const e of /**@type {HTMLFormElement} */ (evt.target).elements) {\n\t\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\t\te.__on_r?.();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t// In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)\n\t\t\t{ capture: true }\n\t\t);\n\t}\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../../runtime.js';\nimport { add_form_reset_listener } from '../misc.js';\n\n/**\n * Fires the handler once immediately (unless corresponding arg is set to `false`),\n * then listens to the given events until the render effect context is destroyed\n * @param {EventTarget} target\n * @param {Array<string>} events\n * @param {(event?: Event) => void} handler\n * @param {any} call_handler_immediately\n */\nexport function listen(target, events, handler, call_handler_immediately = true) {\n\tif (call_handler_immediately) {\n\t\thandler();\n\t}\n\n\tfor (var name of events) {\n\t\ttarget.addEventListener(name, handler);\n\t}\n\n\tteardown(() => {\n\t\tfor (var name of events) {\n\t\t\ttarget.removeEventListener(name, handler);\n\t\t}\n\t});\n}\n\n/**\n * @template T\n * @param {() => T} fn\n */\nexport function without_reactive_context(fn) {\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * Listen to the given event, and then instantiate a global form reset listener if not already done,\n * to notify all bindings when the form is reset\n * @param {HTMLElement} element\n * @param {string} event\n * @param {(is_reset?: true) => void} handler\n * @param {(is_reset?: true) => void} [on_reset]\n */\nexport function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {\n\telement.addEventListener(event, () => without_reactive_context(handler));\n\t// @ts-expect-error\n\tconst prev = element.__on_r;\n\tif (prev) {\n\t\t// special case for checkbox that can have multiple binds (group & checked)\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => {\n\t\t\tprev();\n\t\t\ton_reset(true);\n\t\t};\n\t} else {\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => on_reset(true);\n\t}\n\n\tadd_form_reset_listener();\n}\n","import { teardown } from '../../reactivity/effects.js';\nimport { define_property, is_array } from '../../../shared/utils.js';\nimport { hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { FILENAME } from '../../../../constants.js';\nimport * as w from '../../warnings.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { without_reactive_context } from './bindings/shared.js';\n\n/** @type {Set<string>} */\nexport const all_registered_events = new Set();\n\n/** @type {Set<(events: Array<string>) => void>} */\nexport const root_event_handles = new Set();\n\n/**\n * SSR adds onload and onerror attributes to catch those events before the hydration.\n * This function detects those cases, removes the attributes and replays the events.\n * @param {HTMLElement} dom\n */\nexport function replay_events(dom) {\n\tif (!hydrating) return;\n\n\tdom.removeAttribute('onload');\n\tdom.removeAttribute('onerror');\n\t// @ts-expect-error\n\tconst event = dom.__e;\n\tif (event !== undefined) {\n\t\t// @ts-expect-error\n\t\tdom.__e = undefined;\n\t\tqueueMicrotask(() => {\n\t\t\tif (dom.isConnected) {\n\t\t\t\tdom.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {EventTarget} dom\n * @param {EventListener} [handler]\n * @param {AddEventListenerOptions} [options]\n */\nexport function create_event(event_name, dom, handler, options = {}) {\n\t/**\n\t * @this {EventTarget}\n\t */\n\tfunction target_handler(/** @type {Event} */ event) {\n\t\tif (!options.capture) {\n\t\t\t// Only call in the bubble phase, else delegated events would be called before the capturing events\n\t\t\thandle_event_propagation.call(dom, event);\n\t\t}\n\t\tif (!event.cancelBubble) {\n\t\t\treturn without_reactive_context(() => {\n\t\t\t\treturn handler?.call(this, event);\n\t\t\t});\n\t\t}\n\t}\n\n\t// Chrome has a bug where pointer events don't work when attached to a DOM element that has been cloned\n\t// with cloneNode() and the DOM element is disconnected from the document. To ensure the event works, we\n\t// defer the attachment till after it's been appended to the document. TODO: remove this once Chrome fixes\n\t// this bug. The same applies to wheel events and touch events.\n\tif (\n\t\tevent_name.startsWith('pointer') ||\n\t\tevent_name.startsWith('touch') ||\n\t\tevent_name === 'wheel'\n\t) {\n\t\tqueue_micro_task(() => {\n\t\t\tdom.addEventListener(event_name, target_handler, options);\n\t\t});\n\t} else {\n\t\tdom.addEventListener(event_name, target_handler, options);\n\t}\n\n\treturn target_handler;\n}\n\n/**\n * Attaches an event handler to an element and returns a function that removes the handler. Using this\n * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively\n * (with attributes like `onclick`), which use event delegation for performance reasons\n *\n * @param {EventTarget} element\n * @param {string} type\n * @param {EventListener} handler\n * @param {AddEventListenerOptions} [options]\n */\nexport function on(element, type, handler, options = {}) {\n\tvar target_handler = create_event(type, element, handler, options);\n\n\treturn () => {\n\t\telement.removeEventListener(type, target_handler, options);\n\t};\n}\n\n/**\n * @param {string} event_name\n * @param {Element} dom\n * @param {EventListener} [handler]\n * @param {boolean} [capture]\n * @param {boolean} [passive]\n * @returns {void}\n */\nexport function event(event_name, dom, handler, capture, passive) {\n\tvar options = { capture, passive };\n\tvar target_handler = create_event(event_name, dom, handler, options);\n\n\tif (\n\t\tdom === document.body ||\n\t\t// @ts-ignore\n\t\tdom === window ||\n\t\t// @ts-ignore\n\t\tdom === document ||\n\t\t// Firefox has quirky behavior, it can happen that we still get \"canplay\" events when the element is already removed\n\t\tdom instanceof HTMLMediaElement\n\t) {\n\t\tteardown(() => {\n\t\t\tdom.removeEventListener(event_name, target_handler, options);\n\t\t});\n\t}\n}\n\n/**\n * @param {Array<string>} events\n * @returns {void}\n */\nexport function delegate(events) {\n\tfor (var i = 0; i < events.length; i++) {\n\t\tall_registered_events.add(events[i]);\n\t}\n\n\tfor (var fn of root_event_handles) {\n\t\tfn(events);\n\t}\n}\n\n/**\n * @this {EventTarget}\n * @param {Event} event\n * @returns {void}\n */\nexport function handle_event_propagation(event) {\n\tvar handler_element = this;\n\tvar owner_document = /** @type {Node} */ (handler_element).ownerDocument;\n\tvar event_name = event.type;\n\tvar path = event.composedPath?.() || [];\n\tvar current_target = /** @type {null | Element} */ (path[0] || event.target);\n\n\t// composedPath contains list of nodes the event has propagated through.\n\t// We check __root to skip all nodes below it in case this is a\n\t// parent of the __root node, which indicates that there's nested\n\t// mounted apps. In this case we don't want to trigger events multiple times.\n\tvar path_idx = 0;\n\n\t// @ts-expect-error is added below\n\tvar handled_at = event.__root;\n\n\tif (handled_at) {\n\t\tvar at_idx = path.indexOf(handled_at);\n\t\tif (\n\t\t\tat_idx !== -1 &&\n\t\t\t(handler_element === document || handler_element === /** @type {any} */ (window))\n\t\t) {\n\t\t\t// This is the fallback document listener or a window listener, but the event was already handled\n\t\t\t// -> ignore, but set handle_at to document/window so that we're resetting the event\n\t\t\t// chain in case someone manually dispatches the same event object again.\n\t\t\t// @ts-expect-error\n\t\t\tevent.__root = handler_element;\n\t\t\treturn;\n\t\t}\n\n\t\t// We're deliberately not skipping if the index is higher, because\n\t\t// someone could create an event programmatically and emit it multiple times,\n\t\t// in which case we want to handle the whole propagation chain properly each time.\n\t\t// (this will only be a false negative if the event is dispatched multiple times and\n\t\t// the fallback document listener isn't reached in between, but that's super rare)\n\t\tvar handler_idx = path.indexOf(handler_element);\n\t\tif (handler_idx === -1) {\n\t\t\t// handle_idx can theoretically be -1 (happened in some JSDOM testing scenarios with an event listener on the window object)\n\t\t\t// so guard against that, too, and assume that everything was handled at this point.\n\t\t\treturn;\n\t\t}\n\n\t\tif (at_idx <= handler_idx) {\n\t\t\tpath_idx = at_idx;\n\t\t}\n\t}\n\n\tcurrent_target = /** @type {Element} */ (path[path_idx] || event.target);\n\t// there can only be one delegated event per element, and we either already handled the current target,\n\t// or this is the very first target in the chain which has a non-delegated listener, in which case it's safe\n\t// to handle a possible delegated event on it later (through the root delegation listener for example).\n\tif (current_target === handler_element) return;\n\n\t// Proxy currentTarget to correct target\n\tdefine_property(event, 'currentTarget', {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn current_target || owner_document;\n\t\t}\n\t});\n\n\t// This started because of Chromium issue https://chromestatus.com/feature/5128696823545856,\n\t// where removal or moving of of the DOM can cause sync `blur` events to fire, which can cause logic\n\t// to run inside the current `active_reaction`, which isn't what we want at all. However, on reflection,\n\t// it's probably best that all event handled by Svelte have this behaviour, as we don't really want\n\t// an event handler to run in the context of another reaction or effect.\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\t/**\n\t\t * @type {unknown}\n\t\t */\n\t\tvar throw_error;\n\t\t/**\n\t\t * @type {unknown[]}\n\t\t */\n\t\tvar other_errors = [];\n\n\t\twhile (current_target !== null) {\n\t\t\t/** @type {null | Element} */\n\t\t\tvar parent_element =\n\t\t\t\tcurrent_target.assignedSlot ||\n\t\t\t\tcurrent_target.parentNode ||\n\t\t\t\t/** @type {any} */ (current_target).host ||\n\t\t\t\tnull;\n\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tvar delegated = current_target['__' + event_name];\n\n\t\t\t\tif (\n\t\t\t\t\tdelegated != null &&\n\t\t\t\t\t(!(/** @type {any} */ (current_target).disabled) ||\n\t\t\t\t\t\t// DOM could've been updated already by the time this is reached, so we check this as well\n\t\t\t\t\t\t// -> the target could not have been disabled because it emits the event in the first place\n\t\t\t\t\t\tevent.target === current_target)\n\t\t\t\t) {\n\t\t\t\t\tif (is_array(delegated)) {\n\t\t\t\t\t\tvar [fn, ...data] = delegated;\n\t\t\t\t\t\tfn.apply(current_target, [event, ...data]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdelegated.call(current_target, event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (throw_error) {\n\t\t\t\t\tother_errors.push(error);\n\t\t\t\t} else {\n\t\t\t\t\tthrow_error = error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.cancelBubble || parent_element === handler_element || parent_element === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent_target = parent_element;\n\t\t}\n\n\t\tif (throw_error) {\n\t\t\tfor (let error of other_errors) {\n\t\t\t\t// Throw the rest of the errors, one-by-one on a microtask\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow throw_error;\n\t\t}\n\t} finally {\n\t\t// @ts-expect-error is used above\n\t\tevent.__root = handler_element;\n\t\t// @ts-ignore remove proxy on currentTarget\n\t\tdelete event.currentTarget;\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * In dev, warn if an event handler is not a function, as it means the\n * user probably called the handler or forgot to add a `() =>`\n * @param {() => (event: Event, ...args: any) => void} thunk\n * @param {EventTarget} element\n * @param {[Event, ...any]} args\n * @param {any} component\n * @param {[number, number]} [loc]\n * @param {boolean} [remove_parens]\n */\nexport function apply(\n\tthunk,\n\telement,\n\targs,\n\tcomponent,\n\tloc,\n\thas_side_effects = false,\n\tremove_parens = false\n) {\n\tlet handler;\n\tlet error;\n\n\ttry {\n\t\thandler = thunk();\n\t} catch (e) {\n\t\terror = e;\n\t}\n\n\tif (typeof handler !== 'function' && (has_side_effects || handler != null || error)) {\n\t\tconst filename = component?.[FILENAME];\n\t\tconst location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`;\n\t\tconst phase = args[0]?.eventPhase < Event.BUBBLING_PHASE ? 'capture' : '';\n\t\tconst event_name = args[0]?.type + phase;\n\t\tconst description = `\\`${event_name}\\` handler${location}`;\n\t\tconst suggestion = remove_parens ? 'remove the trailing `()`' : 'add a leading `() =>`';\n\n\t\tw.event_handler_invalid(description, suggestion);\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\thandler?.apply(element, args);\n}\n","/** @param {string} html */\nexport function create_fragment_from_html(html) {\n\tvar elem = document.createElement('template');\n\telem.innerHTML = html.replaceAll('<!>', '<!---->'); // XHTML compliance\n\treturn elem.content;\n}\n","/** @import { Effect, TemplateNode } from '#client' */\n/** @import { TemplateStructure } from './types' */\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport {\n\tcreate_text,\n\tget_first_child,\n\tis_firefox,\n\tcreate_element,\n\tcreate_fragment,\n\tcreate_comment,\n\tset_attribute\n} from './operations.js';\nimport { create_fragment_from_html } from './reconciler.js';\nimport { active_effect } from '../runtime.js';\nimport {\n\tNAMESPACE_MATHML,\n\tNAMESPACE_SVG,\n\tTEMPLATE_FRAGMENT,\n\tTEMPLATE_USE_IMPORT_NODE,\n\tTEMPLATE_USE_MATHML,\n\tTEMPLATE_USE_SVG\n} from '../../../constants.js';\nimport { COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, TEXT_NODE } from '#client/constants';\n\n/**\n * @param {TemplateNode} start\n * @param {TemplateNode | null} end\n */\nexport function assign_nodes(start, end) {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tif (effect.nodes_start === null) {\n\t\teffect.nodes_start = start;\n\t\teffect.nodes_end = end;\n\t}\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_html(content, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('<!>');\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tnode = create_fragment_from_html(has_start ? content : '<!>' + content);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @param {'svg' | 'math'} ns\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nfunction from_namespace(content, flags, ns = 'svg') {\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('<!>');\n\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar wrapped = `<${ns}>${has_start ? content : '<!>' + content}</${ns}>`;\n\n\t/** @type {Element | DocumentFragment} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (!node) {\n\t\t\tvar fragment = /** @type {DocumentFragment} */ (create_fragment_from_html(wrapped));\n\t\t\tvar root = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (is_fragment) {\n\t\t\t\tnode = document.createDocumentFragment();\n\t\t\t\twhile (get_first_child(root)) {\n\t\t\t\t\tnode.appendChild(/** @type {Node} */ (get_first_child(root)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(root));\n\t\t\t}\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (node.cloneNode(true));\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_svg(content, flags) {\n\treturn from_namespace(content, flags, 'svg');\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_mathml(content, flags) {\n\treturn from_namespace(content, flags, 'math');\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {NAMESPACE_SVG | NAMESPACE_MATHML | undefined} [ns]\n */\nfunction fragment_from_tree(structure, ns) {\n\tvar fragment = create_fragment();\n\n\tfor (var item of structure) {\n\t\tif (typeof item === 'string') {\n\t\t\tfragment.append(create_text(item));\n\t\t\tcontinue;\n\t\t}\n\n\t\t// if `preserveComments === true`, comments are represented as `['// <data>']`\n\t\tif (item === undefined || item[0][0] === '/') {\n\t\t\tfragment.append(create_comment(item ? item[0].slice(3) : ''));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [name, attributes, ...children] = item;\n\n\t\tconst namespace = name === 'svg' ? NAMESPACE_SVG : name === 'math' ? NAMESPACE_MATHML : ns;\n\n\t\tvar element = create_element(name, namespace, attributes?.is);\n\n\t\tfor (var key in attributes) {\n\t\t\tset_attribute(element, key, attributes[key]);\n\t\t}\n\n\t\tif (children.length > 0) {\n\t\t\tvar target =\n\t\t\t\telement.tagName === 'TEMPLATE'\n\t\t\t\t\t? /** @type {HTMLTemplateElement} */ (element).content\n\t\t\t\t\t: element;\n\n\t\t\ttarget.append(\n\t\t\t\tfragment_from_tree(children, element.tagName === 'foreignObject' ? undefined : namespace)\n\t\t\t);\n\t\t}\n\n\t\tfragment.append(element);\n\t}\n\n\treturn fragment;\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_tree(structure, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tconst ns =\n\t\t\t\t(flags & TEMPLATE_USE_SVG) !== 0\n\t\t\t\t\t? NAMESPACE_SVG\n\t\t\t\t\t: (flags & TEMPLATE_USE_MATHML) !== 0\n\t\t\t\t\t\t? NAMESPACE_MATHML\n\t\t\t\t\t\t: undefined;\n\n\t\t\tnode = fragment_from_tree(structure, ns);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {() => Element | DocumentFragment} fn\n */\nexport function with_script(fn) {\n\treturn () => run_scripts(fn());\n}\n\n/**\n * Creating a document fragment from HTML that contains script tags will not execute\n * the scripts. We need to replace the script tags with new ones so that they are executed.\n * @param {Element | DocumentFragment} node\n * @returns {Node | Node[]}\n */\nfunction run_scripts(node) {\n\t// scripts were SSR'd, in which case they will run\n\tif (hydrating) return node;\n\n\tconst is_fragment = node.nodeType === DOCUMENT_FRAGMENT_NODE;\n\tconst scripts =\n\t\t/** @type {HTMLElement} */ (node).tagName === 'SCRIPT'\n\t\t\t? [/** @type {HTMLScriptElement} */ (node)]\n\t\t\t: node.querySelectorAll('script');\n\tconst effect = /** @type {Effect} */ (active_effect);\n\n\tfor (const script of scripts) {\n\t\tconst clone = document.createElement('script');\n\t\tfor (var attribute of script.attributes) {\n\t\t\tclone.setAttribute(attribute.name, attribute.value);\n\t\t}\n\n\t\tclone.textContent = script.textContent;\n\n\t\t// The script has changed - if it's at the edges, the effect now points at dead nodes\n\t\tif (is_fragment ? node.firstChild === script : node === script) {\n\t\t\teffect.nodes_start = clone;\n\t\t}\n\t\tif (is_fragment ? node.lastChild === script : node === script) {\n\t\t\teffect.nodes_end = clone;\n\t\t}\n\n\t\tscript.replaceWith(clone);\n\t}\n\treturn node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {any} value\n */\nexport function text(value = '') {\n\tif (!hydrating) {\n\t\tvar t = create_text(value + '');\n\t\tassign_nodes(t, t);\n\t\treturn t;\n\t}\n\n\tvar node = hydrate_node;\n\n\tif (node.nodeType !== TEXT_NODE) {\n\t\t// if an {expression} is empty during SSR, we need to insert an empty text node\n\t\tnode.before((node = create_text()));\n\t\tset_hydrate_node(node);\n\t}\n\n\tassign_nodes(node, node);\n\treturn node;\n}\n\nexport function comment() {\n\t// we're not delegating to `template` here for performance reasons\n\tif (hydrating) {\n\t\tassign_nodes(hydrate_node, null);\n\t\treturn hydrate_node;\n\t}\n\n\tvar frag = document.createDocumentFragment();\n\tvar start = document.createComment('');\n\tvar anchor = create_text();\n\tfrag.append(start, anchor);\n\n\tassign_nodes(start, anchor);\n\n\treturn frag;\n}\n\n/**\n * Assign the created (or in hydration mode, traversed) dom elements to the current block\n * and insert the elements into the dom (in client mode).\n * @param {Text | Comment | Element} anchor\n * @param {DocumentFragment | Element} dom\n */\nexport function append(anchor, dom) {\n\tif (hydrating) {\n\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\thydrate_next();\n\t\treturn;\n\t}\n\n\tif (anchor === null) {\n\t\t// edge case — void `<svelte:element>` with content\n\t\treturn;\n\t}\n\n\tanchor.before(/** @type {Node} */ (dom));\n}\n\n/**\n * Create (or hydrate) an unique UID for the component instance.\n */\nexport function props_id() {\n\tif (\n\t\thydrating &&\n\t\thydrate_node &&\n\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\thydrate_node.textContent?.startsWith(`#`)\n\t) {\n\t\tconst id = hydrate_node.textContent.substring(1);\n\t\thydrate_next();\n\t\treturn id;\n\t}\n\n\t// @ts-expect-error This way we ensure the id is unique even across Svelte runtimes\n\t(window.__svelte ??= {}).uid ??= 1;\n\n\t// @ts-expect-error\n\treturn `c${window.__svelte.uid++}`;\n}\n","const regex_return_characters = /\\r/g;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nexport function hash(str) {\n\tstr = str.replace(regex_return_characters, '');\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn (hash >>> 0).toString(36);\n}\n\nconst VOID_ELEMENT_NAMES = [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n];\n\n/**\n * Returns `true` if `name` is of a void element\n * @param {string} name\n */\nexport function is_void(name) {\n\treturn VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === '!doctype';\n}\n\nconst RESERVED_WORDS = [\n\t'arguments',\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n];\n\n/**\n * Returns `true` if `word` is a reserved JavaScript keyword\n * @param {string} word\n */\nexport function is_reserved(word) {\n\treturn RESERVED_WORDS.includes(word);\n}\n\n/**\n * @param {string} name\n */\nexport function is_capture_event(name) {\n\treturn name.endsWith('capture') && name !== 'gotpointercapture' && name !== 'lostpointercapture';\n}\n\n/** List of Element events that will be delegated */\nconst DELEGATED_EVENTS = [\n\t'beforeinput',\n\t'click',\n\t'change',\n\t'dblclick',\n\t'contextmenu',\n\t'focusin',\n\t'focusout',\n\t'input',\n\t'keydown',\n\t'keyup',\n\t'mousedown',\n\t'mousemove',\n\t'mouseout',\n\t'mouseover',\n\t'mouseup',\n\t'pointerdown',\n\t'pointermove',\n\t'pointerout',\n\t'pointerover',\n\t'pointerup',\n\t'touchend',\n\t'touchmove',\n\t'touchstart'\n];\n\n/**\n * Returns `true` if `event_name` is a delegated event\n * @param {string} event_name\n */\nexport function is_delegated(event_name) {\n\treturn DELEGATED_EVENTS.includes(event_name);\n}\n\n/**\n * Attributes that are boolean, i.e. they are present or not present.\n */\nconst DOM_BOOLEAN_ATTRIBUTES = [\n\t'allowfullscreen',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'disabled',\n\t'formnovalidate',\n\t'hidden',\n\t'indeterminate',\n\t'inert',\n\t'ismap',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'seamless',\n\t'selected',\n\t'webkitdirectory',\n\t'defer',\n\t'disablepictureinpicture',\n\t'disableremoteplayback'\n];\n\n/**\n * Returns `true` if `name` is a boolean attribute\n * @param {string} name\n */\nexport function is_boolean_attribute(name) {\n\treturn DOM_BOOLEAN_ATTRIBUTES.includes(name);\n}\n\n/**\n * @type {Record<string, string>}\n * List of attribute names that should be aliased to their property names\n * because they behave differently between setting them as an attribute and\n * setting them as a property.\n */\nconst ATTRIBUTE_ALIASES = {\n\t// no `class: 'className'` because we handle that separately\n\tformnovalidate: 'formNoValidate',\n\tismap: 'isMap',\n\tnomodule: 'noModule',\n\tplaysinline: 'playsInline',\n\treadonly: 'readOnly',\n\tdefaultvalue: 'defaultValue',\n\tdefaultchecked: 'defaultChecked',\n\tsrcobject: 'srcObject',\n\tnovalidate: 'noValidate',\n\tallowfullscreen: 'allowFullscreen',\n\tdisablepictureinpicture: 'disablePictureInPicture',\n\tdisableremoteplayback: 'disableRemotePlayback'\n};\n\n/**\n * @param {string} name\n */\nexport function normalize_attribute(name) {\n\tname = name.toLowerCase();\n\treturn ATTRIBUTE_ALIASES[name] ?? name;\n}\n\nconst DOM_PROPERTIES = [\n\t...DOM_BOOLEAN_ATTRIBUTES,\n\t'formNoValidate',\n\t'isMap',\n\t'noModule',\n\t'playsInline',\n\t'readOnly',\n\t'value',\n\t'volume',\n\t'defaultValue',\n\t'defaultChecked',\n\t'srcObject',\n\t'noValidate',\n\t'allowFullscreen',\n\t'disablePictureInPicture',\n\t'disableRemotePlayback'\n];\n\n/**\n * @param {string} name\n */\nexport function is_dom_property(name) {\n\treturn DOM_PROPERTIES.includes(name);\n}\n\nconst NON_STATIC_PROPERTIES = ['autofocus', 'muted', 'defaultValue', 'defaultChecked'];\n\n/**\n * Returns `true` if the given attribute cannot be set through the template\n * string, i.e. needs some kind of JavaScript handling to work.\n * @param {string} name\n */\nexport function cannot_be_set_statically(name) {\n\treturn NON_STATIC_PROPERTIES.includes(name);\n}\n\n/**\n * Subset of delegated events which should be passive by default.\n * These two are already passive via browser defaults on window, document and body.\n * But since\n * - we're delegating them\n * - they happen often\n * - they apply to mobile which is generally less performant\n * we're marking them as passive by default for other elements, too.\n */\nconst PASSIVE_EVENTS = ['touchstart', 'touchmove'];\n\n/**\n * Returns `true` if `name` is a passive event\n * @param {string} name\n */\nexport function is_passive_event(name) {\n\treturn PASSIVE_EVENTS.includes(name);\n}\n\nconst CONTENT_EDITABLE_BINDINGS = ['textContent', 'innerHTML', 'innerText'];\n\n/** @param {string} name */\nexport function is_content_editable_binding(name) {\n\treturn CONTENT_EDITABLE_BINDINGS.includes(name);\n}\n\nconst LOAD_ERROR_ELEMENTS = [\n\t'body',\n\t'embed',\n\t'iframe',\n\t'img',\n\t'link',\n\t'object',\n\t'script',\n\t'style',\n\t'track'\n];\n\n/**\n * Returns `true` if the element emits `load` and `error` events\n * @param {string} name\n */\nexport function is_load_error_element(name) {\n\treturn LOAD_ERROR_ELEMENTS.includes(name);\n}\n\nconst SVG_ELEMENTS = [\n\t'altGlyph',\n\t'altGlyphDef',\n\t'altGlyphItem',\n\t'animate',\n\t'animateColor',\n\t'animateMotion',\n\t'animateTransform',\n\t'circle',\n\t'clipPath',\n\t'color-profile',\n\t'cursor',\n\t'defs',\n\t'desc',\n\t'discard',\n\t'ellipse',\n\t'feBlend',\n\t'feColorMatrix',\n\t'feComponentTransfer',\n\t'feComposite',\n\t'feConvolveMatrix',\n\t'feDiffuseLighting',\n\t'feDisplacementMap',\n\t'feDistantLight',\n\t'feDropShadow',\n\t'feFlood',\n\t'feFuncA',\n\t'feFuncB',\n\t'feFuncG',\n\t'feFuncR',\n\t'feGaussianBlur',\n\t'feImage',\n\t'feMerge',\n\t'feMergeNode',\n\t'feMorphology',\n\t'feOffset',\n\t'fePointLight',\n\t'feSpecularLighting',\n\t'feSpotLight',\n\t'feTile',\n\t'feTurbulence',\n\t'filter',\n\t'font',\n\t'font-face',\n\t'font-face-format',\n\t'font-face-name',\n\t'font-face-src',\n\t'font-face-uri',\n\t'foreignObject',\n\t'g',\n\t'glyph',\n\t'glyphRef',\n\t'hatch',\n\t'hatchpath',\n\t'hkern',\n\t'image',\n\t'line',\n\t'linearGradient',\n\t'marker',\n\t'mask',\n\t'mesh',\n\t'meshgradient',\n\t'meshpatch',\n\t'meshrow',\n\t'metadata',\n\t'missing-glyph',\n\t'mpath',\n\t'path',\n\t'pattern',\n\t'polygon',\n\t'polyline',\n\t'radialGradient',\n\t'rect',\n\t'set',\n\t'solidcolor',\n\t'stop',\n\t'svg',\n\t'switch',\n\t'symbol',\n\t'text',\n\t'textPath',\n\t'tref',\n\t'tspan',\n\t'unknown',\n\t'use',\n\t'view',\n\t'vkern'\n];\n\n/** @param {string} name */\nexport function is_svg(name) {\n\treturn SVG_ELEMENTS.includes(name);\n}\n\nconst MATHML_ELEMENTS = [\n\t'annotation',\n\t'annotation-xml',\n\t'maction',\n\t'math',\n\t'merror',\n\t'mfrac',\n\t'mi',\n\t'mmultiscripts',\n\t'mn',\n\t'mo',\n\t'mover',\n\t'mpadded',\n\t'mphantom',\n\t'mprescripts',\n\t'mroot',\n\t'mrow',\n\t'ms',\n\t'mspace',\n\t'msqrt',\n\t'mstyle',\n\t'msub',\n\t'msubsup',\n\t'msup',\n\t'mtable',\n\t'mtd',\n\t'mtext',\n\t'mtr',\n\t'munder',\n\t'munderover',\n\t'semantics'\n];\n\n/** @param {string} name */\nexport function is_mathml(name) {\n\treturn MATHML_ELEMENTS.includes(name);\n}\n\nconst STATE_CREATION_RUNES = /** @type {const} */ ([\n\t'$state',\n\t'$state.raw',\n\t'$derived',\n\t'$derived.by'\n]);\n\nconst RUNES = /** @type {const} */ ([\n\t...STATE_CREATION_RUNES,\n\t'$state.snapshot',\n\t'$props',\n\t'$props.id',\n\t'$bindable',\n\t'$effect',\n\t'$effect.pre',\n\t'$effect.tracking',\n\t'$effect.root',\n\t'$effect.pending',\n\t'$inspect',\n\t'$inspect().with',\n\t'$inspect.trace',\n\t'$host'\n]);\n\n/** @typedef {RUNES[number]} RuneName */\n\n/**\n * @param {string} name\n * @returns {name is RuneName}\n */\nexport function is_rune(name) {\n\treturn RUNES.includes(/** @type {RuneName} */ (name));\n}\n\n/** @typedef {STATE_CREATION_RUNES[number]} StateCreationRuneName */\n\n/**\n * @param {string} name\n * @returns {name is StateCreationRuneName}\n */\nexport function is_state_creation_rune(name) {\n\treturn STATE_CREATION_RUNES.includes(/** @type {StateCreationRuneName} */ (name));\n}\n\n/** List of elements that require raw contents and should not have SSR comments put in them */\nconst RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']);\n\n/** @param {string} name */\nexport function is_raw_text_element(name) {\n\treturn RAW_TEXT_ELEMENTS.includes(/** @type {RAW_TEXT_ELEMENTS[number]} */ (name));\n}\n\n/**\n * Prevent devtools trying to make `location` a clickable link by inserting a zero-width space\n * @template {string | undefined} T\n * @param {T} location\n * @returns {T};\n */\nexport function sanitize_location(location) {\n\treturn /** @type {T} */ (location?.replace(/\\//g, '/\\u200b'));\n}\n","/** @import { ComponentContext, Effect, TemplateNode } from '#client' */\n/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tinit_operations\n} from './dom/operations.js';\nimport { HYDRATION_END, HYDRATION_ERROR, HYDRATION_START } from '../../constants.js';\nimport { active_effect } from './runtime.js';\nimport { push, pop, component_context } from './context.js';\nimport { component_root, branch } from './reactivity/effects.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tset_hydrate_node,\n\tset_hydrating\n} from './dom/hydration.js';\nimport { array_from } from '../shared/utils.js';\nimport {\n\tall_registered_events,\n\thandle_event_propagation,\n\troot_event_handles\n} from './dom/elements/events.js';\nimport { reset_head_anchor } from './dom/blocks/svelte-head.js';\nimport * as w from './warnings.js';\nimport * as e from './errors.js';\nimport { assign_nodes } from './dom/template.js';\nimport { is_passive_event } from '../../utils.js';\nimport { COMMENT_NODE } from './constants.js';\n\n/**\n * This is normally true — block effects should run their intro transitions —\n * but is false during hydration (unless `options.intro` is `true`) and\n * when creating the children of a `<svelte:element>` that just changed tag\n */\nexport let should_intro = true;\n\n/** @param {boolean} value */\nexport function set_should_intro(value) {\n\tshould_intro = value;\n}\n\n/**\n * @param {Element} text\n * @param {string} value\n * @returns {void}\n */\nexport function set_text(text, value) {\n\t// For objects, we apply string coercion (which might make things like $state array references in the template reactive) before diffing\n\tvar str = value == null ? '' : typeof value === 'object' ? value + '' : value;\n\t// @ts-expect-error\n\tif (str !== (text.__t ??= text.nodeValue)) {\n\t\t// @ts-expect-error\n\t\ttext.__t = str;\n\t\ttext.nodeValue = str + '';\n\t}\n}\n\n/**\n * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.\n * Transitions will play during the initial render unless the `intro` option is set to `false`.\n *\n * @template {Record<string, any>} Props\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>} component\n * @param {MountOptions<Props>} options\n * @returns {Exports}\n */\nexport function mount(component, options) {\n\treturn _mount(component, options);\n}\n\n/**\n * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component\n *\n * @template {Record<string, any>} Props\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>} component\n * @param {{} extends Props ? {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops?: Props;\n * \t\tevents?: Record<string, (e: any) => any>;\n * \tcontext?: Map<any, any>;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t} : {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops: Props;\n * \t\tevents?: Record<string, (e: any) => any>;\n * \tcontext?: Map<any, any>;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t}} options\n * @returns {Exports}\n */\nexport function hydrate(component, options) {\n\tinit_operations();\n\toptions.intro = options.intro ?? false;\n\tconst target = options.target;\n\tconst was_hydrating = hydrating;\n\tconst previous_hydrate_node = hydrate_node;\n\n\ttry {\n\t\tvar anchor = /** @type {TemplateNode} */ (get_first_child(target));\n\t\twhile (\n\t\t\tanchor &&\n\t\t\t(anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */ (anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\tanchor = /** @type {TemplateNode} */ (get_next_sibling(anchor));\n\t\t}\n\n\t\tif (!anchor) {\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(/** @type {Comment} */ (anchor));\n\t\thydrate_next();\n\n\t\tconst instance = _mount(component, { ...options, anchor });\n\n\t\tif (\n\t\t\thydrate_node === null ||\n\t\t\thydrate_node.nodeType !== COMMENT_NODE ||\n\t\t\t/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END\n\t\t) {\n\t\t\tw.hydration_mismatch();\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(false);\n\n\t\treturn /** @type {Exports} */ (instance);\n\t} catch (error) {\n\t\tif (error === HYDRATION_ERROR) {\n\t\t\tif (options.recover === false) {\n\t\t\t\te.hydration_failed();\n\t\t\t}\n\n\t\t\t// If an error occured above, the operations might not yet have been initialised.\n\t\t\tinit_operations();\n\t\t\tclear_text_content(target);\n\n\t\t\tset_hydrating(false);\n\t\t\treturn mount(component, options);\n\t\t}\n\n\t\tthrow error;\n\t} finally {\n\t\tset_hydrating(was_hydrating);\n\t\tset_hydrate_node(previous_hydrate_node);\n\t\treset_head_anchor();\n\t}\n}\n\n/** @type {Map<string, number>} */\nconst document_listeners = new Map();\n\n/**\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<any>> | Component<any>} Component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nfunction _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {\n\tinit_operations();\n\n\tvar registered_events = new Set();\n\n\t/** @param {Array<string>} events */\n\tvar event_handle = (events) => {\n\t\tfor (var i = 0; i < events.length; i++) {\n\t\t\tvar event_name = events[i];\n\n\t\t\tif (registered_events.has(event_name)) continue;\n\t\t\tregistered_events.add(event_name);\n\n\t\t\tvar passive = is_passive_event(event_name);\n\n\t\t\t// Add the event listener to both the container and the document.\n\t\t\t// The container listener ensures we catch events from within in case\n\t\t\t// the outer content stops propagation of the event.\n\t\t\ttarget.addEventListener(event_name, handle_event_propagation, { passive });\n\n\t\t\tvar n = document_listeners.get(event_name);\n\n\t\t\tif (n === undefined) {\n\t\t\t\t// The document listener ensures we catch events that originate from elements that were\n\t\t\t\t// manually moved outside of the container (e.g. via manual portals).\n\t\t\t\tdocument.addEventListener(event_name, handle_event_propagation, { passive });\n\t\t\t\tdocument_listeners.set(event_name, 1);\n\t\t\t} else {\n\t\t\t\tdocument_listeners.set(event_name, n + 1);\n\t\t\t}\n\t\t}\n\t};\n\n\tevent_handle(array_from(all_registered_events));\n\troot_event_handles.add(event_handle);\n\n\t/** @type {Exports} */\n\t// @ts-expect-error will be defined because the render effect runs synchronously\n\tvar component = undefined;\n\n\tvar unmount = component_root(() => {\n\t\tvar anchor_node = anchor ?? target.appendChild(create_text());\n\n\t\tbranch(() => {\n\t\t\tif (context) {\n\t\t\t\tpush({});\n\t\t\t\tvar ctx = /** @type {ComponentContext} */ (component_context);\n\t\t\t\tctx.c = context;\n\t\t\t}\n\n\t\t\tif (events) {\n\t\t\t\t// We can't spread the object or else we'd lose the state proxy stuff, if it is one\n\t\t\t\t/** @type {any} */ (props).$$events = events;\n\t\t\t}\n\n\t\t\tif (hydrating) {\n\t\t\t\tassign_nodes(/** @type {TemplateNode} */ (anchor_node), null);\n\t\t\t}\n\n\t\t\tshould_intro = intro;\n\t\t\t// @ts-expect-error the public typings are not what the actual function looks like\n\t\t\tcomponent = Component(anchor_node, props) || {};\n\t\t\tshould_intro = true;\n\n\t\t\tif (hydrating) {\n\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\t\t}\n\n\t\t\tif (context) {\n\t\t\t\tpop();\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tfor (var event_name of registered_events) {\n\t\t\t\ttarget.removeEventListener(event_name, handle_event_propagation);\n\n\t\t\t\tvar n = /** @type {number} */ (document_listeners.get(event_name));\n\n\t\t\t\tif (--n === 0) {\n\t\t\t\t\tdocument.removeEventListener(event_name, handle_event_propagation);\n\t\t\t\t\tdocument_listeners.delete(event_name);\n\t\t\t\t} else {\n\t\t\t\t\tdocument_listeners.set(event_name, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\troot_event_handles.delete(event_handle);\n\n\t\t\tif (anchor_node !== anchor) {\n\t\t\t\tanchor_node.parentNode?.removeChild(anchor_node);\n\t\t\t}\n\t\t};\n\t});\n\n\tmounted_components.set(component, unmount);\n\treturn component;\n}\n\n/**\n * References of the components that were mounted or hydrated.\n * Uses a `WeakMap` to avoid memory leaks.\n */\nlet mounted_components = new WeakMap();\n\n/**\n * Unmounts a component that was previously mounted using `mount` or `hydrate`.\n *\n * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.\n *\n * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).\n *\n * ```js\n * import { mount, unmount } from 'svelte';\n * import App from './App.svelte';\n *\n * const app = mount(App, { target: document.body });\n *\n * // later...\n * unmount(app, { outro: true });\n * ```\n * @param {Record<string, any>} component\n * @param {{ outro?: boolean }} [options]\n * @returns {Promise<void>}\n */\nexport function unmount(component, options) {\n\tconst fn = mounted_components.get(component);\n\n\tif (fn) {\n\t\tmounted_components.delete(component);\n\t\treturn fn(options);\n\t}\n\n\tif (DEV) {\n\t\tw.lifecycle_double_unmount();\n\t}\n\n\treturn Promise.resolve();\n}\n","/** @import { Snippet } from 'svelte' */\n/** @import { Effect, TemplateNode } from '#client' */\n/** @import { Getters } from '#shared' */\nimport { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';\nimport { branch, block, destroy_effect, teardown } from '../../reactivity/effects.js';\nimport {\n\tdev_current_component_function,\n\tset_dev_current_component_function\n} from '../../context.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport * as e from '../../errors.js';\nimport { DEV } from 'esm-env';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { noop } from '../../../shared/utils.js';\nimport { prevent_snippet_stringification } from '../../../shared/validate.js';\n\n/**\n * @template {(node: TemplateNode, ...args: any[]) => void} SnippetFn\n * @param {TemplateNode} node\n * @param {() => SnippetFn | null | undefined} get_snippet\n * @param {(() => any)[]} args\n * @returns {void}\n */\nexport function snippet(node, get_snippet, ...args) {\n\tvar anchor = node;\n\n\t/** @type {SnippetFn | null | undefined} */\n\t// @ts-ignore\n\tvar snippet = noop;\n\n\t/** @type {Effect | null} */\n\tvar snippet_effect;\n\n\tblock(() => {\n\t\tif (snippet === (snippet = get_snippet())) return;\n\n\t\tif (snippet_effect) {\n\t\t\tdestroy_effect(snippet_effect);\n\t\t\tsnippet_effect = null;\n\t\t}\n\n\t\tif (DEV && snippet == null) {\n\t\t\te.invalid_snippet();\n\t\t}\n\n\t\tsnippet_effect = branch(() => /** @type {SnippetFn} */ (snippet)(anchor, ...args));\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * In development, wrap the snippet function so that it passes validation, and so that the\n * correct component context is set for ownership checks\n * @param {any} component\n * @param {(node: TemplateNode, ...args: any[]) => void} fn\n */\nexport function wrap_snippet(component, fn) {\n\tconst snippet = (/** @type {TemplateNode} */ node, /** @type {any[]} */ ...args) => {\n\t\tvar previous_component_function = dev_current_component_function;\n\t\tset_dev_current_component_function(component);\n\n\t\ttry {\n\t\t\treturn fn(node, ...args);\n\t\t} finally {\n\t\t\tset_dev_current_component_function(previous_component_function);\n\t\t}\n\t};\n\n\tprevent_snippet_stringification(snippet);\n\n\treturn snippet;\n}\n\n/**\n * Create a snippet programmatically\n * @template {unknown[]} Params\n * @param {(...params: Getters<Params>) => {\n * render: () => string\n * setup?: (element: Element) => void | (() => void)\n * }} fn\n * @returns {Snippet<Params>}\n */\nexport function createRawSnippet(fn) {\n\t// @ts-expect-error the types are a lie\n\treturn (/** @type {TemplateNode} */ anchor, /** @type {Getters<Params>} */ ...params) => {\n\t\tvar snippet = fn(...params);\n\n\t\t/** @type {Element} */\n\t\tvar element;\n\n\t\tif (hydrating) {\n\t\t\telement = /** @type {Element} */ (hydrate_node);\n\t\t\thydrate_next();\n\t\t} else {\n\t\t\tvar html = snippet.render().trim();\n\t\t\tvar fragment = create_fragment_from_html(html);\n\t\t\telement = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (DEV && (get_next_sibling(element) !== null || element.nodeType !== ELEMENT_NODE)) {\n\t\t\t\tw.invalid_raw_snippet_render();\n\t\t\t}\n\n\t\t\tanchor.before(element);\n\t\t}\n\n\t\tconst result = snippet.setup?.(element);\n\t\tassign_nodes(element, element);\n\n\t\tif (typeof result === 'function') {\n\t\t\tteardown(result);\n\t\t}\n\t};\n}\n","/** @import { ComponentContext, ComponentContextLegacy } from '#client' */\n/** @import { EventDispatcher } from './index.js' */\n/** @import { NotFunction } from './internal/types.js' */\nimport { active_reaction, untrack } from './internal/client/runtime.js';\nimport { is_array } from './internal/shared/utils.js';\nimport { user_effect } from './internal/client/index.js';\nimport * as e from './internal/client/errors.js';\nimport { legacy_mode_flag } from './internal/flags/index.js';\nimport { component_context } from './internal/client/context.js';\nimport { DEV } from 'esm-env';\n\nif (DEV) {\n\t/**\n\t * @param {string} rune\n\t */\n\tfunction throw_rune_error(rune) {\n\t\tif (!(rune in globalThis)) {\n\t\t\t// TODO if people start adjusting the \"this can contain runes\" config through v-p-s more, adjust this message\n\t\t\t/** @type {any} */\n\t\t\tlet value; // let's hope noone modifies this global, but belts and braces\n\t\t\tObject.defineProperty(globalThis, rune, {\n\t\t\t\tconfigurable: true,\n\t\t\t\t// eslint-disable-next-line getter-return\n\t\t\t\tget: () => {\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\n\t\t\t\t\te.rune_outside_svelte(rune);\n\t\t\t\t},\n\t\t\t\tset: (v) => {\n\t\t\t\t\tvalue = v;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tthrow_rune_error('$state');\n\tthrow_rune_error('$effect');\n\tthrow_rune_error('$derived');\n\tthrow_rune_error('$inspect');\n\tthrow_rune_error('$props');\n\tthrow_rune_error('$bindable');\n}\n\n/**\n * Returns an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that aborts when the current [derived](https://svelte.dev/docs/svelte/$derived) or [effect](https://svelte.dev/docs/svelte/$effect) re-runs or is destroyed.\n *\n * Must be called while a derived or effect is running.\n *\n * ```svelte\n * <script>\n * \timport { getAbortSignal } from 'svelte';\n *\n * \tlet { id } = $props();\n *\n * \tasync function getData(id) {\n * \t\tconst response = await fetch(`/items/${id}`, {\n * \t\t\tsignal: getAbortSignal()\n * \t\t});\n *\n * \t\treturn await response.json();\n * \t}\n *\n * \tconst data = $derived(await getData(id));\n * </script>\n * ```\n */\nexport function getAbortSignal() {\n\tif (active_reaction === null) {\n\t\te.get_abort_signal_outside_reaction();\n\t}\n\n\treturn (active_reaction.ac ??= new AbortController()).signal;\n}\n\n/**\n * `onMount`, like [`$effect`](https://svelte.dev/docs/svelte/$effect), schedules a function to run as soon as the component has been mounted to the DOM.\n * Unlike `$effect`, the provided function only runs once.\n *\n * It must be called during the component's initialisation (but doesn't need to live _inside_ the component;\n * it can be called from an external module). If a function is returned _synchronously_ from `onMount`,\n * it will be called when the component is unmounted.\n *\n * `onMount` functions do not run during [server-side rendering](https://svelte.dev/docs/svelte/svelte-server#render).\n *\n * @template T\n * @param {() => NotFunction<T> | Promise<NotFunction<T>> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('onMount');\n\t}\n\n\tif (legacy_mode_flag && component_context.l !== null) {\n\t\tinit_update_callbacks(component_context).m.push(fn);\n\t} else {\n\t\tuser_effect(() => {\n\t\t\tconst cleanup = untrack(fn);\n\t\t\tif (typeof cleanup === 'function') return /** @type {() => void} */ (cleanup);\n\t\t});\n\t}\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('onDestroy');\n\t}\n\n\tonMount(() => () => untrack(fn));\n}\n\n/**\n * @template [T=any]\n * @param {string} type\n * @param {T} [detail]\n * @param {any}params_0\n * @returns {CustomEvent<T>}\n */\nfunction create_custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs/svelte/legacy-on#Component-events).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n * loaded: null; // does not take a detail argument\n * change: string; // takes a detail argument of type string, which is required\n * optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * @deprecated Use callback props and/or the `$host()` rune instead — see [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes-Component-events)\n * @template {Record<string, any>} [EventMap = any]\n * @returns {EventDispatcher<EventMap>}\n */\nexport function createEventDispatcher() {\n\tconst active_component_context = component_context;\n\tif (active_component_context === null) {\n\t\te.lifecycle_outside_component('createEventDispatcher');\n\t}\n\n\treturn (type, detail, options) => {\n\t\tconst events = /** @type {Record<string, Function | Function[]>} */ (\n\t\t\tactive_component_context.s.$$events\n\t\t)?.[/** @type {any} */ (type)];\n\n\t\tif (events) {\n\t\t\tconst callbacks = is_array(events) ? events.slice() : [events];\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = create_custom_event(/** @type {string} */ (type), detail, options);\n\t\t\tfor (const fn of callbacks) {\n\t\t\t\tfn.call(active_component_context.x, event);\n\t\t\t}\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\n\t\treturn true;\n\t};\n}\n\n// TODO mark beforeUpdate and afterUpdate as deprecated in Svelte 6\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`.\n *\n * In runes mode use `$effect.pre` instead.\n *\n * @deprecated Use [`$effect.pre`](https://svelte.dev/docs/svelte/$effect#$effect.pre) instead\n * @param {() => void} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('beforeUpdate');\n\t}\n\n\tif (component_context.l === null) {\n\t\te.lifecycle_legacy_only('beforeUpdate');\n\t}\n\n\tinit_update_callbacks(component_context).b.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`.\n *\n * In runes mode use `$effect` instead.\n *\n * @deprecated Use [`$effect`](https://svelte.dev/docs/svelte/$effect) instead\n * @param {() => void} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('afterUpdate');\n\t}\n\n\tif (component_context.l === null) {\n\t\te.lifecycle_legacy_only('afterUpdate');\n\t}\n\n\tinit_update_callbacks(component_context).a.push(fn);\n}\n\n/**\n * Legacy-mode: Init callbacks object for onMount/beforeUpdate/afterUpdate\n * @param {ComponentContext} context\n */\nfunction init_update_callbacks(context) {\n\tvar l = /** @type {ComponentContextLegacy} */ (context).l;\n\treturn (l.u ??= { a: [], b: [], m: [] });\n}\n\nexport { flushSync } from './internal/client/reactivity/batch.js';\nexport { getContext, getAllContexts, hasContext, setContext } from './internal/client/context.js';\nexport { hydrate, mount, unmount } from './internal/client/render.js';\nexport { tick, untrack, settled } from './internal/client/runtime.js';\nexport { createRawSnippet } from './internal/client/dom/blocks/snippet.js';\n","/** @import { Effect, TemplateNode } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';\nimport { HYDRATION_START_ELSE, UNINITIALIZED } from '../../../../constants.js';\nimport { create_text, should_defer_append } from '../operations.js';\nimport { current_batch } from '../../reactivity/batch.js';\n\n// TODO reinstate https://github.com/sveltejs/svelte/pull/15250\n\n/**\n * @param {TemplateNode} node\n * @param {(branch: (fn: (anchor: Node) => void, flag?: boolean) => void) => void} fn\n * @param {boolean} [elseif] True if this is an `{:else if ...}` block rather than an `{#if ...}`, as that affects which transitions are considered 'local'\n * @returns {void}\n */\nexport function if_block(node, fn, elseif = false) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {Effect | null} */\n\tvar consequent_effect = null;\n\n\t/** @type {Effect | null} */\n\tvar alternate_effect = null;\n\n\t/** @type {UNINITIALIZED | boolean | null} */\n\tvar condition = UNINITIALIZED;\n\n\tvar flags = elseif ? EFFECT_TRANSPARENT : 0;\n\n\tvar has_branch = false;\n\n\tconst set_branch = (/** @type {(anchor: Node) => void} */ fn, flag = true) => {\n\t\thas_branch = true;\n\t\tupdate_branch(flag, fn);\n\t};\n\n\t/** @type {DocumentFragment | null} */\n\tvar offscreen_fragment = null;\n\n\tfunction commit() {\n\t\tif (offscreen_fragment !== null) {\n\t\t\t// remove the anchor\n\t\t\t/** @type {Text} */ (offscreen_fragment.lastChild).remove();\n\n\t\t\tanchor.before(offscreen_fragment);\n\t\t\toffscreen_fragment = null;\n\t\t}\n\n\t\tvar active = condition ? consequent_effect : alternate_effect;\n\t\tvar inactive = condition ? alternate_effect : consequent_effect;\n\n\t\tif (active) {\n\t\t\tresume_effect(active);\n\t\t}\n\n\t\tif (inactive) {\n\t\t\tpause_effect(inactive, () => {\n\t\t\t\tif (condition) {\n\t\t\t\t\talternate_effect = null;\n\t\t\t\t} else {\n\t\t\t\t\tconsequent_effect = null;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tconst update_branch = (\n\t\t/** @type {boolean | null} */ new_condition,\n\t\t/** @type {null | ((anchor: Node) => void)} */ fn\n\t) => {\n\t\tif (condition === (condition = new_condition)) return;\n\n\t\t/** Whether or not there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tconst is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (!!condition === is_else) {\n\t\t\t\t// Hydration mismatch: remove everything inside the anchor and start fresh.\n\t\t\t\t// This could happen with `{#if browser}...{/if}`, for example\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\tvar defer = should_defer_append();\n\t\tvar target = anchor;\n\n\t\tif (defer) {\n\t\t\toffscreen_fragment = document.createDocumentFragment();\n\t\t\toffscreen_fragment.append((target = create_text()));\n\t\t}\n\n\t\tif (condition) {\n\t\t\tconsequent_effect ??= fn && branch(() => fn(target));\n\t\t} else {\n\t\t\talternate_effect ??= fn && branch(() => fn(target));\n\t\t}\n\n\t\tif (defer) {\n\t\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\t\tvar active = condition ? consequent_effect : alternate_effect;\n\t\t\tvar inactive = condition ? alternate_effect : consequent_effect;\n\n\t\t\tif (active) batch.skipped_effects.delete(active);\n\t\t\tif (inactive) batch.skipped_effects.add(inactive);\n\n\t\t\tbatch.add_callback(commit);\n\t\t} else {\n\t\t\tcommit();\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\t};\n\n\tblock(() => {\n\t\thas_branch = false;\n\t\tfn(set_branch);\n\t\tif (!has_branch) {\n\t\t\tupdate_branch(null, null);\n\t\t}\n\t}, flags);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { EachItem, EachState, Effect, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport {\n\tEACH_INDEX_REACTIVE,\n\tEACH_IS_ANIMATED,\n\tEACH_IS_CONTROLLED,\n\tEACH_ITEM_IMMUTABLE,\n\tEACH_ITEM_REACTIVE,\n\tHYDRATION_END,\n\tHYDRATION_START_ELSE\n} from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tshould_defer_append\n} from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\trun_out_transitions,\n\tpause_children,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { source, mutable_source, internal_set } from '../../reactivity/sources.js';\nimport { array_from, is_array } from '../../../shared/utils.js';\nimport { COMMENT_NODE, INERT } from '#client/constants';\nimport { queue_micro_task } from '../task.js';\nimport { active_effect, get } from '../../runtime.js';\nimport { DEV } from 'esm-env';\nimport { derived_safe_equal } from '../../reactivity/deriveds.js';\nimport { current_batch } from '../../reactivity/batch.js';\n\n/**\n * The row of a keyed each block that is currently updating. We track this\n * so that `animate:` directives have something to attach themselves to\n * @type {EachItem | null}\n */\nexport let current_each_item = null;\n\n/** @param {EachItem | null} item */\nexport function set_current_each_item(item) {\n\tcurrent_each_item = item;\n}\n\n/**\n * @param {any} _\n * @param {number} i\n */\nexport function index(_, i) {\n\treturn i;\n}\n\n/**\n * Pause multiple effects simultaneously, and coordinate their\n * subsequent destruction. Used in each blocks\n * @param {EachState} state\n * @param {EachItem[]} items\n * @param {null | Node} controlled_anchor\n */\nfunction pause_effects(state, items, controlled_anchor) {\n\tvar items_map = state.items;\n\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\tvar length = items.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tpause_children(items[i].e, transitions, true);\n\t}\n\n\tvar is_controlled = length > 0 && transitions.length === 0 && controlled_anchor !== null;\n\t// If we have a controlled anchor, it means that the each block is inside a single\n\t// DOM element, so we can apply a fast-path for clearing the contents of the element.\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (\n\t\t\t/** @type {Element} */ (controlled_anchor).parentNode\n\t\t);\n\t\tclear_text_content(parent_node);\n\t\tparent_node.append(/** @type {Element} */ (controlled_anchor));\n\t\titems_map.clear();\n\t\tlink(state, items[0].prev, items[length - 1].next);\n\t}\n\n\trun_out_transitions(transitions, () => {\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar item = items[i];\n\t\t\tif (!is_controlled) {\n\t\t\t\titems_map.delete(item.k);\n\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t}\n\t\t\tdestroy_effect(item.e, !is_controlled);\n\t\t}\n\t});\n}\n\n/**\n * @template V\n * @param {Element | Comment} node The next sibling node, or the parent node if this is a 'controlled' block\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {(value: V, index: number) => any} get_key\n * @param {(anchor: Node, item: MaybeSource<V>, index: MaybeSource<number>) => void} render_fn\n * @param {null | ((anchor: Node) => void)} fallback_fn\n * @returns {void}\n */\nexport function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {\n\tvar anchor = node;\n\n\t/** @type {EachState} */\n\tvar state = { flags, items: new Map(), first: null };\n\n\tvar is_controlled = (flags & EACH_IS_CONTROLLED) !== 0;\n\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (node);\n\n\t\tanchor = hydrating\n\t\t\t? set_hydrate_node(/** @type {Comment | Text} */ (get_first_child(parent_node)))\n\t\t\t: parent_node.appendChild(create_text());\n\t}\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\t/** @type {Effect | null} */\n\tvar fallback = null;\n\n\tvar was_empty = false;\n\n\t/** @type {Map<any, EachItem>} */\n\tvar offscreen_items = new Map();\n\n\t// TODO: ideally we could use derived for runes mode but because of the ability\n\t// to use a store which can be mutated, we can't do that here as mutating a store\n\t// will still result in the collection array being the same from the store\n\tvar each_array = derived_safe_equal(() => {\n\t\tvar collection = get_collection();\n\n\t\treturn is_array(collection) ? collection : collection == null ? [] : array_from(collection);\n\t});\n\n\t/** @type {V[]} */\n\tvar array;\n\n\t/** @type {Effect} */\n\tvar each_effect;\n\n\tfunction commit() {\n\t\treconcile(\n\t\t\teach_effect,\n\t\t\tarray,\n\t\t\tstate,\n\t\t\toffscreen_items,\n\t\t\tanchor,\n\t\t\trender_fn,\n\t\t\tflags,\n\t\t\tget_key,\n\t\t\tget_collection\n\t\t);\n\n\t\tif (fallback_fn !== null) {\n\t\t\tif (array.length === 0) {\n\t\t\t\tif (fallback) {\n\t\t\t\t\tresume_effect(fallback);\n\t\t\t\t} else {\n\t\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t\t}\n\t\t\t} else if (fallback !== null) {\n\t\t\t\tpause_effect(fallback, () => {\n\t\t\t\t\tfallback = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tblock(() => {\n\t\t// store a reference to the effect so that we can update the start/end nodes in reconciliation\n\t\teach_effect ??= /** @type {Effect} */ (active_effect);\n\n\t\tarray = get(each_array);\n\t\tvar length = array.length;\n\n\t\tif (was_empty && length === 0) {\n\t\t\t// ignore updates if the array is empty,\n\t\t\t// and it already was empty on previous run\n\t\t\treturn;\n\t\t}\n\t\twas_empty = length === 0;\n\n\t\t/** `true` if there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tvar is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (is_else !== (length === 0)) {\n\t\t\t\t// hydration mismatch — remove the server-rendered DOM and start over\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\t// this is separate to the previous block because `hydrating` might change\n\t\tif (hydrating) {\n\t\t\t/** @type {EachItem | null} */\n\t\t\tvar prev = null;\n\n\t\t\t/** @type {EachItem} */\n\t\t\tvar item;\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tif (\n\t\t\t\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\t\t\t\t/** @type {Comment} */ (hydrate_node).data === HYDRATION_END\n\t\t\t\t) {\n\t\t\t\t\t// The server rendered fewer items than expected,\n\t\t\t\t\t// so break out and continue appending non-hydrated items\n\t\t\t\t\tanchor = /** @type {Comment} */ (hydrate_node);\n\t\t\t\t\tmismatch = true;\n\t\t\t\t\tset_hydrating(false);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvar value = array[i];\n\t\t\t\tvar key = get_key(value, i);\n\t\t\t\titem = create_item(\n\t\t\t\t\thydrate_node,\n\t\t\t\t\tstate,\n\t\t\t\t\tprev,\n\t\t\t\t\tnull,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\t\t\t\tstate.items.set(key, item);\n\n\t\t\t\tprev = item;\n\t\t\t}\n\n\t\t\t// remove excess nodes\n\t\t\tif (length > 0) {\n\t\t\t\tset_hydrate_node(remove_nodes());\n\t\t\t}\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tif (length === 0 && fallback_fn) {\n\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t}\n\t\t} else {\n\t\t\tif (should_defer_append()) {\n\t\t\t\tvar keys = new Set();\n\t\t\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\t\t\tfor (i = 0; i < length; i += 1) {\n\t\t\t\t\tvalue = array[i];\n\t\t\t\t\tkey = get_key(value, i);\n\n\t\t\t\t\tvar existing = state.items.get(key) ?? offscreen_items.get(key);\n\n\t\t\t\t\tif (existing) {\n\t\t\t\t\t\t// update before reconciliation, to trigger any async updates\n\t\t\t\t\t\tif ((flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0) {\n\t\t\t\t\t\t\tupdate_item(existing, value, i, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem = create_item(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\trender_fn,\n\t\t\t\t\t\t\tflags,\n\t\t\t\t\t\t\tget_collection,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\toffscreen_items.set(key, item);\n\t\t\t\t\t}\n\n\t\t\t\t\tkeys.add(key);\n\t\t\t\t}\n\n\t\t\t\tfor (const [key, item] of state.items) {\n\t\t\t\t\tif (!keys.has(key)) {\n\t\t\t\t\t\tbatch.skipped_effects.add(item.e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch.add_callback(commit);\n\t\t\t} else {\n\t\t\t\tcommit();\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\n\t\t// When we mount the each block for the first time, the collection won't be\n\t\t// connected to this effect as the effect hasn't finished running yet and its deps\n\t\t// won't be assigned. However, it's possible that when reconciling the each block\n\t\t// that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the\n\t\t// collection again can provide consistency to the reactive graph again as the deriveds\n\t\t// will now be `CLEAN`.\n\t\tget(each_array);\n\t});\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * Add, remove, or reorder items output by an each block as its input changes\n * @template V\n * @param {Effect} each_effect\n * @param {Array<V>} array\n * @param {EachState} state\n * @param {Map<any, EachItem>} offscreen_items\n * @param {Element | Comment | Text} anchor\n * @param {(anchor: Node, item: MaybeSource<V>, index: number | Source<number>, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {(value: V, index: number) => any} get_key\n * @param {() => V[]} get_collection\n * @returns {void}\n */\nfunction reconcile(\n\teach_effect,\n\tarray,\n\tstate,\n\toffscreen_items,\n\tanchor,\n\trender_fn,\n\tflags,\n\tget_key,\n\tget_collection\n) {\n\tvar is_animated = (flags & EACH_IS_ANIMATED) !== 0;\n\tvar should_update = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0;\n\n\tvar length = array.length;\n\tvar items = state.items;\n\tvar first = state.first;\n\tvar current = first;\n\n\t/** @type {undefined | Set<EachItem>} */\n\tvar seen;\n\n\t/** @type {EachItem | null} */\n\tvar prev = null;\n\n\t/** @type {undefined | Set<EachItem>} */\n\tvar to_animate;\n\n\t/** @type {EachItem[]} */\n\tvar matched = [];\n\n\t/** @type {EachItem[]} */\n\tvar stashed = [];\n\n\t/** @type {V} */\n\tvar value;\n\n\t/** @type {any} */\n\tvar key;\n\n\t/** @type {EachItem | undefined} */\n\tvar item;\n\n\t/** @type {number} */\n\tvar i;\n\n\tif (is_animated) {\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tvalue = array[i];\n\t\t\tkey = get_key(value, i);\n\t\t\titem = items.get(key);\n\n\t\t\tif (item !== undefined) {\n\t\t\t\titem.a?.measure();\n\t\t\t\t(to_animate ??= new Set()).add(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i = 0; i < length; i += 1) {\n\t\tvalue = array[i];\n\t\tkey = get_key(value, i);\n\n\t\titem = items.get(key);\n\n\t\tif (item === undefined) {\n\t\t\tvar pending = offscreen_items.get(key);\n\n\t\t\tif (pending !== undefined) {\n\t\t\t\toffscreen_items.delete(key);\n\t\t\t\titems.set(key, pending);\n\n\t\t\t\tvar next = prev ? prev.next : current;\n\n\t\t\t\tlink(state, prev, pending);\n\t\t\t\tlink(state, pending, next);\n\n\t\t\t\tmove(pending, next, anchor);\n\t\t\t\tprev = pending;\n\t\t\t} else {\n\t\t\t\tvar child_anchor = current ? /** @type {TemplateNode} */ (current.e.nodes_start) : anchor;\n\n\t\t\t\tprev = create_item(\n\t\t\t\t\tchild_anchor,\n\t\t\t\t\tstate,\n\t\t\t\t\tprev,\n\t\t\t\t\tprev === null ? state.first : prev.next,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\t\t\t}\n\n\t\t\titems.set(key, prev);\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\tcurrent = prev.next;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (should_update) {\n\t\t\tupdate_item(item, value, i, flags);\n\t\t}\n\n\t\tif ((item.e.f & INERT) !== 0) {\n\t\t\tresume_effect(item.e);\n\t\t\tif (is_animated) {\n\t\t\t\titem.a?.unfix();\n\t\t\t\t(to_animate ??= new Set()).delete(item);\n\t\t\t}\n\t\t}\n\n\t\tif (item !== current) {\n\t\t\tif (seen !== undefined && seen.has(item)) {\n\t\t\t\tif (matched.length < stashed.length) {\n\t\t\t\t\t// more efficient to move later items to the front\n\t\t\t\t\tvar start = stashed[0];\n\t\t\t\t\tvar j;\n\n\t\t\t\t\tprev = start.prev;\n\n\t\t\t\t\tvar a = matched[0];\n\t\t\t\t\tvar b = matched[matched.length - 1];\n\n\t\t\t\t\tfor (j = 0; j < matched.length; j += 1) {\n\t\t\t\t\t\tmove(matched[j], start, anchor);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (j = 0; j < stashed.length; j += 1) {\n\t\t\t\t\t\tseen.delete(stashed[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\tlink(state, a.prev, b.next);\n\t\t\t\t\tlink(state, prev, a);\n\t\t\t\t\tlink(state, b, start);\n\n\t\t\t\t\tcurrent = start;\n\t\t\t\t\tprev = b;\n\t\t\t\t\ti -= 1;\n\n\t\t\t\t\tmatched = [];\n\t\t\t\t\tstashed = [];\n\t\t\t\t} else {\n\t\t\t\t\t// more efficient to move earlier items to the back\n\t\t\t\t\tseen.delete(item);\n\t\t\t\t\tmove(item, current, anchor);\n\n\t\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t\t\tlink(state, item, prev === null ? state.first : prev.next);\n\t\t\t\t\tlink(state, prev, item);\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\twhile (current !== null && current.k !== key) {\n\t\t\t\t// If the each block isn't inert and an item has an effect that is already inert,\n\t\t\t\t// skip over adding it to our seen Set as the item is already being handled\n\t\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\t\t(seen ??= new Set()).add(current);\n\t\t\t\t}\n\t\t\t\tstashed.push(current);\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titem = current;\n\t\t}\n\n\t\tmatched.push(item);\n\t\tprev = item;\n\t\tcurrent = item.next;\n\t}\n\n\tif (current !== null || seen !== undefined) {\n\t\tvar to_destroy = seen === undefined ? [] : array_from(seen);\n\n\t\twhile (current !== null) {\n\t\t\t// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished\n\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\tto_destroy.push(current);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tvar destroy_length = to_destroy.length;\n\n\t\tif (destroy_length > 0) {\n\t\t\tvar controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;\n\n\t\t\tif (is_animated) {\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.measure();\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.fix();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpause_effects(state, to_destroy, controlled_anchor);\n\t\t}\n\t}\n\n\tif (is_animated) {\n\t\tqueue_micro_task(() => {\n\t\t\tif (to_animate === undefined) return;\n\t\t\tfor (item of to_animate) {\n\t\t\t\titem.a?.apply();\n\t\t\t}\n\t\t});\n\t}\n\n\teach_effect.first = state.first && state.first.e;\n\teach_effect.last = prev && prev.e;\n\n\tfor (var unused of offscreen_items.values()) {\n\t\tdestroy_effect(unused.e);\n\t}\n\n\toffscreen_items.clear();\n}\n\n/**\n * @param {EachItem} item\n * @param {any} value\n * @param {number} index\n * @param {number} type\n * @returns {void}\n */\nfunction update_item(item, value, index, type) {\n\tif ((type & EACH_ITEM_REACTIVE) !== 0) {\n\t\tinternal_set(item.v, value);\n\t}\n\n\tif ((type & EACH_INDEX_REACTIVE) !== 0) {\n\t\tinternal_set(/** @type {Value<number>} */ (item.i), index);\n\t} else {\n\t\titem.i = index;\n\t}\n}\n\n/**\n * @template V\n * @param {Node | null} anchor\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n * @param {V} value\n * @param {unknown} key\n * @param {number} index\n * @param {(anchor: Node, item: V | Source<V>, index: number | Value<number>, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {boolean} [deferred]\n * @returns {EachItem}\n */\nfunction create_item(\n\tanchor,\n\tstate,\n\tprev,\n\tnext,\n\tvalue,\n\tkey,\n\tindex,\n\trender_fn,\n\tflags,\n\tget_collection,\n\tdeferred\n) {\n\tvar previous_each_item = current_each_item;\n\tvar reactive = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;\n\n\tvar v = reactive ? (mutable ? mutable_source(value, false, false) : source(value)) : value;\n\tvar i = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);\n\n\tif (DEV && reactive) {\n\t\t// For tracing purposes, we need to link the source signal we create with the\n\t\t// collection + index so that tracing works as intended\n\t\t/** @type {Value} */ (v).trace = () => {\n\t\t\tvar collection_index = typeof i === 'number' ? index : i.v;\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\tget_collection()[collection_index];\n\t\t};\n\t}\n\n\t/** @type {EachItem} */\n\tvar item = {\n\t\ti,\n\t\tv,\n\t\tk: key,\n\t\ta: null,\n\t\t// @ts-expect-error\n\t\te: null,\n\t\tprev,\n\t\tnext\n\t};\n\n\tcurrent_each_item = item;\n\n\ttry {\n\t\tif (anchor === null) {\n\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\tfragment.append((anchor = create_text()));\n\t\t}\n\n\t\titem.e = branch(() => render_fn(/** @type {Node} */ (anchor), v, i, get_collection), hydrating);\n\n\t\titem.e.prev = prev && prev.e;\n\t\titem.e.next = next && next.e;\n\n\t\tif (prev === null) {\n\t\t\tif (!deferred) {\n\t\t\t\tstate.first = item;\n\t\t\t}\n\t\t} else {\n\t\t\tprev.next = item;\n\t\t\tprev.e.next = item.e;\n\t\t}\n\n\t\tif (next !== null) {\n\t\t\tnext.prev = item;\n\t\t\tnext.e.prev = item.e;\n\t\t}\n\n\t\treturn item;\n\t} finally {\n\t\tcurrent_each_item = previous_each_item;\n\t}\n}\n\n/**\n * @param {EachItem} item\n * @param {EachItem | null} next\n * @param {Text | Element | Comment} anchor\n */\nfunction move(item, next, anchor) {\n\tvar end = item.next ? /** @type {TemplateNode} */ (item.next.e.nodes_start) : anchor;\n\n\tvar dest = next ? /** @type {TemplateNode} */ (next.e.nodes_start) : anchor;\n\tvar node = /** @type {TemplateNode} */ (item.e.nodes_start);\n\n\twhile (node !== null && node !== end) {\n\t\tvar next_node = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tdest.before(node);\n\t\tnode = next_node;\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n */\nfunction link(state, prev, next) {\n\tif (prev === null) {\n\t\tstate.first = next;\n\t} else {\n\t\tprev.next = next;\n\t\tprev.e.next = next && next.e;\n\t}\n\n\tif (next !== null) {\n\t\tnext.prev = prev;\n\t\tnext.e.prev = prev && prev.e;\n\t}\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { FILENAME, HYDRATION_ERROR } from '../../../../constants.js';\nimport { remove_effect_dom, template_effect } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport { hash, sanitize_location } from '../../../../utils.js';\nimport { DEV } from 'esm-env';\nimport { dev_current_component_function } from '../../context.js';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { active_effect } from '../../runtime.js';\nimport { COMMENT_NODE } from '#client/constants';\n\n/**\n * @param {Element} element\n * @param {string | null} server_hash\n * @param {string} value\n */\nfunction check_hash(element, server_hash, value) {\n\tif (!server_hash || server_hash === hash(String(value ?? ''))) return;\n\n\tlet location;\n\n\t// @ts-expect-error\n\tconst loc = element.__svelte_meta?.loc;\n\tif (loc) {\n\t\tlocation = `near ${loc.file}:${loc.line}:${loc.column}`;\n\t} else if (dev_current_component_function?.[FILENAME]) {\n\t\tlocation = `in ${dev_current_component_function[FILENAME]}`;\n\t}\n\n\tw.hydration_html_changed(sanitize_location(location));\n}\n\n/**\n * @param {Element | Text | Comment} node\n * @param {() => string} get_value\n * @param {boolean} [svg]\n * @param {boolean} [mathml]\n * @param {boolean} [skip_warning]\n * @returns {void}\n */\nexport function html(node, get_value, svg = false, mathml = false, skip_warning = false) {\n\tvar anchor = node;\n\n\tvar value = '';\n\n\ttemplate_effect(() => {\n\t\tvar effect = /** @type {Effect} */ (active_effect);\n\n\t\tif (value === (value = get_value() ?? '')) {\n\t\t\tif (hydrating) hydrate_next();\n\t\t\treturn;\n\t\t}\n\n\t\tif (effect.nodes_start !== null) {\n\t\t\tremove_effect_dom(effect.nodes_start, /** @type {TemplateNode} */ (effect.nodes_end));\n\t\t\teffect.nodes_start = effect.nodes_end = null;\n\t\t}\n\n\t\tif (value === '') return;\n\n\t\tif (hydrating) {\n\t\t\t// We're deliberately not trying to repair mismatches between server and client,\n\t\t\t// as it's costly and error-prone (and it's an edge case to have a mismatch anyway)\n\t\t\tvar hash = /** @type {Comment} */ (hydrate_node).data;\n\t\t\tvar next = hydrate_next();\n\t\t\tvar last = next;\n\n\t\t\twhile (\n\t\t\t\tnext !== null &&\n\t\t\t\t(next.nodeType !== COMMENT_NODE || /** @type {Comment} */ (next).data !== '')\n\t\t\t) {\n\t\t\t\tlast = next;\n\t\t\t\tnext = /** @type {TemplateNode} */ (get_next_sibling(next));\n\t\t\t}\n\n\t\t\tif (next === null) {\n\t\t\t\tw.hydration_mismatch();\n\t\t\t\tthrow HYDRATION_ERROR;\n\t\t\t}\n\n\t\t\tif (DEV && !skip_warning) {\n\t\t\t\tcheck_hash(/** @type {Element} */ (next.parentNode), hash, value);\n\t\t\t}\n\n\t\t\tassign_nodes(hydrate_node, last);\n\t\t\tanchor = set_hydrate_node(next);\n\t\t\treturn;\n\t\t}\n\n\t\tvar html = value + '';\n\t\tif (svg) html = `<svg>${html}</svg>`;\n\t\telse if (mathml) html = `<math>${html}</math>`;\n\n\t\t// Don't use create_fragment_with_script_from_html here because that would mean script tags are executed.\n\t\t// @html is basically `.innerHTML = ...` and that doesn't execute scripts either due to security reasons.\n\t\t/** @type {DocumentFragment | Element} */\n\t\tvar node = create_fragment_from_html(html);\n\n\t\tif (svg || mathml) {\n\t\t\tnode = /** @type {Element} */ (get_first_child(node));\n\t\t}\n\n\t\tassign_nodes(\n\t\t\t/** @type {TemplateNode} */ (get_first_child(node)),\n\t\t\t/** @type {TemplateNode} */ (node.lastChild)\n\t\t);\n\n\t\tif (svg || mathml) {\n\t\t\twhile (get_first_child(node)) {\n\t\t\t\tanchor.before(/** @type {Node} */ (get_first_child(node)));\n\t\t\t}\n\t\t} else {\n\t\t\tanchor.before(node);\n\t\t}\n\t});\n}\n","import { hydrate_next, hydrating } from '../hydration.js';\n\n/**\n * @param {Comment} anchor\n * @param {Record<string, any>} $$props\n * @param {string} name\n * @param {Record<string, unknown>} slot_props\n * @param {null | ((anchor: Comment) => void)} fallback_fn\n */\nexport function slot(anchor, $$props, name, slot_props, fallback_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar slot_fn = $$props.$$slots?.[name];\n\t// Interop: Can use snippets to fill slots\n\tvar is_interop = false;\n\tif (slot_fn === true) {\n\t\tslot_fn = $$props[name === 'default' ? 'children' : name];\n\t\tis_interop = true;\n\t}\n\n\tif (slot_fn === undefined) {\n\t\tif (fallback_fn !== null) {\n\t\t\tfallback_fn(anchor);\n\t\t}\n\t} else {\n\t\tslot_fn(anchor, is_interop ? () => slot_props : slot_props);\n\t}\n}\n\n/**\n * @param {Record<string, any>} props\n * @returns {Record<string, boolean>}\n */\nexport function sanitize_slots(props) {\n\t/** @type {Record<string, boolean>} */\n\tconst sanitized = {};\n\tif (props.children) sanitized.default = true;\n\tfor (const key in props.$$slots) {\n\t\tsanitized[key] = true;\n\t}\n\treturn sanitized;\n}\n","/** @import { TemplateNode, Dom, Effect } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport { block, branch, pause_effect } from '../../reactivity/effects.js';\nimport { current_batch } from '../../reactivity/batch.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_text, should_defer_append } from '../operations.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\t/** @type {DocumentFragment | null} */\n\tvar offscreen_fragment = null;\n\n\t/** @type {Effect | null} */\n\tvar pending_effect = null;\n\n\tfunction commit() {\n\t\tif (effect) {\n\t\t\tpause_effect(effect);\n\t\t\teffect = null;\n\t\t}\n\n\t\tif (offscreen_fragment) {\n\t\t\t// remove the anchor\n\t\t\t/** @type {Text} */ (offscreen_fragment.lastChild).remove();\n\n\t\t\tanchor.before(offscreen_fragment);\n\t\t\toffscreen_fragment = null;\n\t\t}\n\n\t\teffect = pending_effect;\n\t\tpending_effect = null;\n\t}\n\n\tblock(() => {\n\t\tif (component === (component = get_component())) return;\n\n\t\tvar defer = should_defer_append();\n\n\t\tif (component) {\n\t\t\tvar target = anchor;\n\n\t\t\tif (defer) {\n\t\t\t\toffscreen_fragment = document.createDocumentFragment();\n\t\t\t\toffscreen_fragment.append((target = create_text()));\n\t\t\t}\n\n\t\t\tpending_effect = branch(() => render_fn(target, component));\n\t\t}\n\n\t\tif (defer) {\n\t\t\t/** @type {Batch} */ (current_batch).add_callback(commit);\n\t\t} else {\n\t\t\tcommit();\n\t\t}\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { FILENAME, NAMESPACE_SVG } from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { create_text, get_first_child } from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { set_should_intro } from '../../render.js';\nimport { current_each_item, set_current_each_item } from './each.js';\nimport { active_effect } from '../../runtime.js';\nimport { component_context, dev_stack } from '../../context.js';\nimport { DEV } from 'esm-env';\nimport { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';\nimport { assign_nodes } from '../template.js';\nimport { is_raw_text_element } from '../../../../utils.js';\n\n/**\n * @param {Comment | Element} node\n * @param {() => string} get_tag\n * @param {boolean} is_svg\n * @param {undefined | ((element: Element, anchor: Node | null) => void)} render_fn,\n * @param {undefined | (() => string)} get_namespace\n * @param {undefined | [number, number]} location\n * @returns {void}\n */\nexport function element(node, get_tag, is_svg, render_fn, get_namespace, location) {\n\tlet was_hydrating = hydrating;\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar filename = DEV && location && component_context?.function[FILENAME];\n\n\t/** @type {string | null} */\n\tvar tag;\n\n\t/** @type {string | null} */\n\tvar current_tag;\n\n\t/** @type {null | Element} */\n\tvar element = null;\n\n\tif (hydrating && hydrate_node.nodeType === ELEMENT_NODE) {\n\t\telement = /** @type {Element} */ (hydrate_node);\n\t\thydrate_next();\n\t}\n\n\tvar anchor = /** @type {TemplateNode} */ (hydrating ? hydrate_node : node);\n\n\t/** @type {Effect | null} */\n\tvar effect;\n\n\t/**\n\t * The keyed `{#each ...}` item block, if any, that this element is inside.\n\t * We track this so we can set it when changing the element, allowing any\n\t * `animate:` directive to bind itself to the correct block\n\t */\n\tvar each_item_block = current_each_item;\n\n\tblock(() => {\n\t\tconst next_tag = get_tag() || null;\n\t\tvar ns = get_namespace ? get_namespace() : is_svg || next_tag === 'svg' ? NAMESPACE_SVG : null;\n\n\t\t// Assumption: Noone changes the namespace but not the tag (what would that even mean?)\n\t\tif (next_tag === tag) return;\n\n\t\t// See explanation of `each_item_block` above\n\t\tvar previous_each_item = current_each_item;\n\t\tset_current_each_item(each_item_block);\n\n\t\tif (effect) {\n\t\t\tif (next_tag === null) {\n\t\t\t\t// start outro\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\teffect = null;\n\t\t\t\t\tcurrent_tag = null;\n\t\t\t\t});\n\t\t\t} else if (next_tag === current_tag) {\n\t\t\t\t// same tag as is currently rendered — abort outro\n\t\t\t\tresume_effect(effect);\n\t\t\t} else {\n\t\t\t\t// tag is changing — destroy immediately, render contents without intro transitions\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tset_should_intro(false);\n\t\t\t}\n\t\t}\n\n\t\tif (next_tag && next_tag !== current_tag) {\n\t\t\teffect = branch(() => {\n\t\t\t\telement = hydrating\n\t\t\t\t\t? /** @type {Element} */ (element)\n\t\t\t\t\t: ns\n\t\t\t\t\t\t? document.createElementNS(ns, next_tag)\n\t\t\t\t\t\t: document.createElement(next_tag);\n\n\t\t\t\tif (DEV && location) {\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\telement.__svelte_meta = {\n\t\t\t\t\t\tparent: dev_stack,\n\t\t\t\t\t\tloc: {\n\t\t\t\t\t\t\tfile: filename,\n\t\t\t\t\t\t\tline: location[0],\n\t\t\t\t\t\t\tcolumn: location[1]\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tassign_nodes(element, element);\n\n\t\t\t\tif (render_fn) {\n\t\t\t\t\tif (hydrating && is_raw_text_element(next_tag)) {\n\t\t\t\t\t\t// prevent hydration glitches\n\t\t\t\t\t\telement.append(document.createComment(''));\n\t\t\t\t\t}\n\n\t\t\t\t\t// If hydrating, use the existing ssr comment as the anchor so that the\n\t\t\t\t\t// inner open and close methods can pick up the existing nodes correctly\n\t\t\t\t\tvar child_anchor = /** @type {TemplateNode} */ (\n\t\t\t\t\t\thydrating ? get_first_child(element) : element.appendChild(create_text())\n\t\t\t\t\t);\n\n\t\t\t\t\tif (hydrating) {\n\t\t\t\t\t\tif (child_anchor === null) {\n\t\t\t\t\t\t\tset_hydrating(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset_hydrate_node(child_anchor);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// `child_anchor` is undefined if this is a void element, but we still\n\t\t\t\t\t// need to call `render_fn` in order to run actions etc. If the element\n\t\t\t\t\t// contains children, it's a user error (which is warned on elsewhere)\n\t\t\t\t\t// and the DOM will be silently discarded\n\t\t\t\t\trender_fn(element, child_anchor);\n\t\t\t\t}\n\n\t\t\t\t// we do this after calling `render_fn` so that child effects don't override `nodes.end`\n\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = element;\n\n\t\t\t\tanchor.before(element);\n\t\t\t});\n\t\t}\n\n\t\ttag = next_tag;\n\t\tif (tag) current_tag = tag;\n\t\tset_should_intro(true);\n\n\t\tset_current_each_item(previous_each_item);\n\t}, EFFECT_TRANSPARENT);\n\n\tif (was_hydrating) {\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(anchor);\n\t}\n}\n","import { DEV } from 'esm-env';\nimport { queue_micro_task } from './task.js';\nimport { register_style } from '../dev/css.js';\n\n/**\n * @param {Node} anchor\n * @param {{ hash: string, code: string }} css\n */\nexport function append_styles(anchor, css) {\n\t// Use `queue_micro_task` to ensure `anchor` is in the DOM, otherwise getRootNode() will yield wrong results\n\tqueue_micro_task(() => {\n\t\tvar root = anchor.getRootNode();\n\n\t\tvar target = /** @type {ShadowRoot} */ (root).host\n\t\t\t? /** @type {ShadowRoot} */ (root)\n\t\t\t: /** @type {Document} */ (root).head ?? /** @type {Document} */ (root.ownerDocument).head;\n\n\t\t// Always querying the DOM is roughly the same perf as additionally checking for presence in a map first assuming\n\t\t// that you'll get cache hits half of the time, so we just always query the dom for simplicity and code savings.\n\t\tif (!target.querySelector('#' + css.hash)) {\n\t\t\tconst style = document.createElement('style');\n\t\t\tstyle.id = css.hash;\n\t\t\tstyle.textContent = css.code;\n\n\t\t\ttarget.appendChild(style);\n\n\t\t\tif (DEV) {\n\t\t\t\tregister_style(css.hash, style);\n\t\t\t}\n\t\t}\n\t});\n}\n","/** @import { ActionPayload } from '#client' */\nimport { effect, render_effect } from '../../reactivity/effects.js';\nimport { safe_not_equal } from '../../reactivity/equality.js';\nimport { deep_read_state, untrack } from '../../runtime.js';\n\n/**\n * @template P\n * @param {Element} dom\n * @param {(dom: Element, value?: P) => ActionPayload<P>} action\n * @param {() => P} [get_value]\n * @returns {void}\n */\nexport function action(dom, action, get_value) {\n\teffect(() => {\n\t\tvar payload = untrack(() => action(dom, get_value?.()) || {});\n\n\t\tif (get_value && payload?.update) {\n\t\t\tvar inited = false;\n\t\t\t/** @type {P} */\n\t\t\tvar prev = /** @type {any} */ ({}); // initialize with something so it's never equal on first run\n\n\t\t\trender_effect(() => {\n\t\t\t\tvar value = get_value();\n\n\t\t\t\t// Action's update method is coarse-grained, i.e. when anything in the passed value changes, update.\n\t\t\t\t// This works in legacy mode because of mutable_source being updated as a whole, but when using $state\n\t\t\t\t// together with actions and mutation, it wouldn't notice the change without a deep read.\n\t\t\t\tdeep_read_state(value);\n\n\t\t\t\tif (inited && safe_not_equal(prev, value)) {\n\t\t\t\t\tprev = value;\n\t\t\t\t\t/** @type {Function} */ (payload.update)(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinited = true;\n\t\t}\n\n\t\tif (payload?.destroy) {\n\t\t\treturn () => /** @type {Function} */ (payload.destroy)();\n\t\t}\n\t});\n}\n","/** @import { Effect } from '#client' */\nimport { block, branch, effect, destroy_effect } from '../../reactivity/effects.js';\n\n// TODO in 6.0 or 7.0, when we remove legacy mode, we can simplify this by\n// getting rid of the block/branch stuff and just letting the effect rip.\n// see https://github.com/sveltejs/svelte/pull/15962\n\n/**\n * @param {Element} node\n * @param {() => (node: Element) => void} get_fn\n */\nexport function attach(node, get_fn) {\n\t/** @type {false | undefined | ((node: Element) => void)} */\n\tvar fn = undefined;\n\n\t/** @type {Effect | null} */\n\tvar e;\n\n\tblock(() => {\n\t\tif (fn !== (fn = get_fn())) {\n\t\t\tif (e) {\n\t\t\t\tdestroy_effect(e);\n\t\t\t\te = null;\n\t\t\t}\n\n\t\t\tif (fn) {\n\t\t\t\te = branch(() => {\n\t\t\t\t\teffect(() => /** @type {(node: Element) => void} */ (fn)(node));\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { escape_html } from '../../escaping.js';\nimport { clsx as _clsx } from 'clsx';\n\n/**\n * `<div translate={false}>` should be rendered as `<div translate=\"no\">` and _not_\n * `<div translate=\"false\">`, which is equivalent to `<div translate=\"yes\">`. There\n * may be other odd cases that need to be added to this list in future\n * @type {Record<string, Map<any, string>>}\n */\nconst replacements = {\n\ttranslate: new Map([\n\t\t[true, 'yes'],\n\t\t[false, 'no']\n\t])\n};\n\n/**\n * @template V\n * @param {string} name\n * @param {V} value\n * @param {boolean} [is_boolean]\n * @returns {string}\n */\nexport function attr(name, value, is_boolean = false) {\n\tif (value == null || (!value && is_boolean)) return '';\n\tconst normalized = (name in replacements && replacements[name].get(value)) || value;\n\tconst assignment = is_boolean ? '' : `=\"${escape_html(normalized, true)}\"`;\n\treturn ` ${name}${assignment}`;\n}\n\n/**\n * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.\n * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)\n * @param {any} value\n */\nexport function clsx(value) {\n\tif (typeof value === 'object') {\n\t\treturn _clsx(value);\n\t} else {\n\t\treturn value ?? '';\n\t}\n}\n\nconst whitespace = [...' \\t\\n\\r\\f\\u00a0\\u000b\\ufeff'];\n\n/**\n * @param {any} value\n * @param {string | null} [hash]\n * @param {Record<string, boolean>} [directives]\n * @returns {string | null}\n */\nexport function to_class(value, hash, directives) {\n\tvar classname = value == null ? '' : '' + value;\n\n\tif (hash) {\n\t\tclassname = classname ? classname + ' ' + hash : hash;\n\t}\n\n\tif (directives) {\n\t\tfor (var key in directives) {\n\t\t\tif (directives[key]) {\n\t\t\t\tclassname = classname ? classname + ' ' + key : key;\n\t\t\t} else if (classname.length) {\n\t\t\t\tvar len = key.length;\n\t\t\t\tvar a = 0;\n\n\t\t\t\twhile ((a = classname.indexOf(key, a)) >= 0) {\n\t\t\t\t\tvar b = a + len;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(a === 0 || whitespace.includes(classname[a - 1])) &&\n\t\t\t\t\t\t(b === classname.length || whitespace.includes(classname[b]))\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassname = (a === 0 ? '' : classname.substring(0, a)) + classname.substring(b + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn classname === '' ? null : classname;\n}\n\n/**\n *\n * @param {Record<string,any>} styles\n * @param {boolean} important\n */\nfunction append_styles(styles, important = false) {\n\tvar separator = important ? ' !important;' : ';';\n\tvar css = '';\n\n\tfor (var key in styles) {\n\t\tvar value = styles[key];\n\t\tif (value != null && value !== '') {\n\t\t\tcss += ' ' + key + ': ' + value + separator;\n\t\t}\n\t}\n\n\treturn css;\n}\n\n/**\n * @param {string} name\n * @returns {string}\n */\nfunction to_css_name(name) {\n\tif (name[0] !== '-' || name[1] !== '-') {\n\t\treturn name.toLowerCase();\n\t}\n\treturn name;\n}\n\n/**\n * @param {any} value\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [styles]\n * @returns {string | null}\n */\nexport function to_style(value, styles) {\n\tif (styles) {\n\t\tvar new_style = '';\n\n\t\t/** @type {Record<string,any> | undefined} */\n\t\tvar normal_styles;\n\n\t\t/** @type {Record<string,any> | undefined} */\n\t\tvar important_styles;\n\n\t\tif (Array.isArray(styles)) {\n\t\t\tnormal_styles = styles[0];\n\t\t\timportant_styles = styles[1];\n\t\t} else {\n\t\t\tnormal_styles = styles;\n\t\t}\n\n\t\tif (value) {\n\t\t\tvalue = String(value)\n\t\t\t\t.replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g, '')\n\t\t\t\t.trim();\n\n\t\t\t/** @type {boolean | '\"' | \"'\"} */\n\t\t\tvar in_str = false;\n\t\t\tvar in_apo = 0;\n\t\t\tvar in_comment = false;\n\n\t\t\tvar reserved_names = [];\n\n\t\t\tif (normal_styles) {\n\t\t\t\treserved_names.push(...Object.keys(normal_styles).map(to_css_name));\n\t\t\t}\n\t\t\tif (important_styles) {\n\t\t\t\treserved_names.push(...Object.keys(important_styles).map(to_css_name));\n\t\t\t}\n\n\t\t\tvar start_index = 0;\n\t\t\tvar name_index = -1;\n\n\t\t\tconst len = value.length;\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tvar c = value[i];\n\n\t\t\t\tif (in_comment) {\n\t\t\t\t\tif (c === '/' && value[i - 1] === '*') {\n\t\t\t\t\t\tin_comment = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (in_str) {\n\t\t\t\t\tif (in_str === c) {\n\t\t\t\t\t\tin_str = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (c === '/' && value[i + 1] === '*') {\n\t\t\t\t\tin_comment = true;\n\t\t\t\t} else if (c === '\"' || c === \"'\") {\n\t\t\t\t\tin_str = c;\n\t\t\t\t} else if (c === '(') {\n\t\t\t\t\tin_apo++;\n\t\t\t\t} else if (c === ')') {\n\t\t\t\t\tin_apo--;\n\t\t\t\t}\n\n\t\t\t\tif (!in_comment && in_str === false && in_apo === 0) {\n\t\t\t\t\tif (c === ':' && name_index === -1) {\n\t\t\t\t\t\tname_index = i;\n\t\t\t\t\t} else if (c === ';' || i === len - 1) {\n\t\t\t\t\t\tif (name_index !== -1) {\n\t\t\t\t\t\t\tvar name = to_css_name(value.substring(start_index, name_index).trim());\n\n\t\t\t\t\t\t\tif (!reserved_names.includes(name)) {\n\t\t\t\t\t\t\t\tif (c !== ';') {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar property = value.substring(start_index, i).trim();\n\t\t\t\t\t\t\t\tnew_style += ' ' + property + ';';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart_index = i + 1;\n\t\t\t\t\t\tname_index = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (normal_styles) {\n\t\t\tnew_style += append_styles(normal_styles);\n\t\t}\n\n\t\tif (important_styles) {\n\t\t\tnew_style += append_styles(important_styles, true);\n\t\t}\n\n\t\tnew_style = new_style.trim();\n\t\treturn new_style === '' ? null : new_style;\n\t}\n\n\treturn value == null ? null : String(value);\n}\n","import { to_class } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element} dom\n * @param {boolean | number} is_html\n * @param {string | null} value\n * @param {string} [hash]\n * @param {Record<string, any>} [prev_classes]\n * @param {Record<string, any>} [next_classes]\n * @returns {Record<string, boolean> | undefined}\n */\nexport function set_class(dom, is_html, value, hash, prev_classes, next_classes) {\n\t// @ts-expect-error need to add __className to patched prototype\n\tvar prev = dom.__className;\n\n\tif (\n\t\thydrating ||\n\t\tprev !== value ||\n\t\tprev === undefined // for edge case of `class={undefined}`\n\t) {\n\t\tvar next_class_name = to_class(value, hash, next_classes);\n\n\t\tif (!hydrating || next_class_name !== dom.getAttribute('class')) {\n\t\t\t// Removing the attribute when the value is only an empty string causes\n\t\t\t// performance issues vs simply making the className an empty string. So\n\t\t\t// we should only remove the class if the value is nullish\n\t\t\t// and there no hash/directives :\n\t\t\tif (next_class_name == null) {\n\t\t\t\tdom.removeAttribute('class');\n\t\t\t} else if (is_html) {\n\t\t\t\tdom.className = next_class_name;\n\t\t\t} else {\n\t\t\t\tdom.setAttribute('class', next_class_name);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error need to add __className to patched prototype\n\t\tdom.__className = value;\n\t} else if (next_classes && prev_classes !== next_classes) {\n\t\tfor (var key in next_classes) {\n\t\t\tvar is_present = !!next_classes[key];\n\n\t\t\tif (prev_classes == null || is_present !== !!prev_classes[key]) {\n\t\t\t\tdom.classList.toggle(key, is_present);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next_classes;\n}\n","import { to_style } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {Record<string, any>} prev\n * @param {Record<string, any>} next\n * @param {string} [priority]\n */\nfunction update_styles(dom, prev = {}, next, priority) {\n\tfor (var key in next) {\n\t\tvar value = next[key];\n\n\t\tif (prev[key] !== value) {\n\t\t\tif (next[key] == null) {\n\t\t\t\tdom.style.removeProperty(key);\n\t\t\t} else {\n\t\t\t\tdom.style.setProperty(key, value, priority);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {string | null} value\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [prev_styles]\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [next_styles]\n */\nexport function set_style(dom, value, prev_styles, next_styles) {\n\t// @ts-expect-error\n\tvar prev = dom.__style;\n\n\tif (hydrating || prev !== value) {\n\t\tvar next_style_attr = to_style(value, next_styles);\n\n\t\tif (!hydrating || next_style_attr !== dom.getAttribute('style')) {\n\t\t\tif (next_style_attr == null) {\n\t\t\t\tdom.removeAttribute('style');\n\t\t\t} else {\n\t\t\t\tdom.style.cssText = next_style_attr;\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error\n\t\tdom.__style = value;\n\t} else if (next_styles) {\n\t\tif (Array.isArray(next_styles)) {\n\t\t\tupdate_styles(dom, prev_styles?.[0], next_styles[0]);\n\t\t\tupdate_styles(dom, prev_styles?.[1], next_styles[1], 'important');\n\t\t} else {\n\t\t\tupdate_styles(dom, prev_styles, next_styles);\n\t\t}\n\t}\n\n\treturn next_styles;\n}\n","import { effect, teardown } from '../../../reactivity/effects.js';\nimport { listen_to_event_and_reset_event } from './shared.js';\nimport { is } from '../../../proxy.js';\nimport { is_array } from '../../../../shared/utils.js';\nimport * as w from '../../../warnings.js';\n\n/**\n * Selects the correct option(s) (depending on whether this is a multiple select)\n * @template V\n * @param {HTMLSelectElement} select\n * @param {V} value\n * @param {boolean} mounting\n */\nexport function select_option(select, value, mounting = false) {\n\tif (select.multiple) {\n\t\t// If value is null or undefined, keep the selection as is\n\t\tif (value == undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If not an array, warn and keep the selection as is\n\t\tif (!is_array(value)) {\n\t\t\treturn w.select_multiple_invalid_value();\n\t\t}\n\n\t\t// Otherwise, update the selection\n\t\tfor (var option of select.options) {\n\t\t\toption.selected = value.includes(get_option_value(option));\n\t\t}\n\n\t\treturn;\n\t}\n\n\tfor (option of select.options) {\n\t\tvar option_value = get_option_value(option);\n\t\tif (is(option_value, value)) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * Selects the correct option(s) if `value` is given,\n * and then sets up a mutation observer to sync the\n * current selection to the dom when it changes. Such\n * changes could for example occur when options are\n * inside an `#each` block.\n * @param {HTMLSelectElement} select\n */\nexport function init_select(select) {\n\tvar observer = new MutationObserver(() => {\n\t\t// @ts-ignore\n\t\tselect_option(select, select.__value);\n\t\t// Deliberately don't update the potential binding value,\n\t\t// the model should be preserved unless explicitly changed\n\t});\n\n\tobserver.observe(select, {\n\t\t// Listen to option element changes\n\t\tchildList: true,\n\t\tsubtree: true, // because of <optgroup>\n\t\t// Listen to option element value attribute changes\n\t\t// (doesn't get notified of select value changes,\n\t\t// because that property is not reflected as an attribute)\n\t\tattributes: true,\n\t\tattributeFilter: ['value']\n\t});\n\n\tteardown(() => {\n\t\tobserver.disconnect();\n\t});\n}\n\n/**\n * @param {HTMLSelectElement} select\n * @param {() => unknown} get\n * @param {(value: unknown) => void} set\n * @returns {void}\n */\nexport function bind_select_value(select, get, set = get) {\n\tvar mounting = true;\n\n\tlisten_to_event_and_reset_event(select, 'change', (is_reset) => {\n\t\tvar query = is_reset ? '[selected]' : ':checked';\n\t\t/** @type {unknown} */\n\t\tvar value;\n\n\t\tif (select.multiple) {\n\t\t\tvalue = [].map.call(select.querySelectorAll(query), get_option_value);\n\t\t} else {\n\t\t\t/** @type {HTMLOptionElement | null} */\n\t\t\tvar selected_option =\n\t\t\t\tselect.querySelector(query) ??\n\t\t\t\t// will fall back to first non-disabled option if no option is selected\n\t\t\t\tselect.querySelector('option:not([disabled])');\n\t\t\tvalue = selected_option && get_option_value(selected_option);\n\t\t}\n\n\t\tset(value);\n\t});\n\n\t// Needs to be an effect, not a render_effect, so that in case of each loops the logic runs after the each block has updated\n\teffect(() => {\n\t\tvar value = get();\n\t\tselect_option(select, value, mounting);\n\n\t\t// Mounting and value undefined -> take selection from dom\n\t\tif (mounting && value === undefined) {\n\t\t\t/** @type {HTMLOptionElement | null} */\n\t\t\tvar selected_option = select.querySelector(':checked');\n\t\t\tif (selected_option !== null) {\n\t\t\t\tvalue = get_option_value(selected_option);\n\t\t\t\tset(value);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-ignore\n\t\tselect.__value = value;\n\t\tmounting = false;\n\t});\n\n\tinit_select(select);\n}\n\n/** @param {HTMLOptionElement} option */\nfunction get_option_value(option) {\n\t// __value only exists if the <option> has a value attribute\n\tif ('__value' in option) {\n\t\treturn option.__value;\n\t} else {\n\t\treturn option.value;\n\t}\n}\n","/** @import { Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport { hydrating, set_hydrating } from '../hydration.js';\nimport { get_descriptors, get_prototype_of } from '../../../shared/utils.js';\nimport { create_event, delegate } from './events.js';\nimport { add_form_reset_listener, autofocus } from './misc.js';\nimport * as w from '../../warnings.js';\nimport { LOADING_ATTR_SYMBOL } from '#client/constants';\nimport { queue_idle_task } from '../task.js';\nimport { is_capture_event, is_delegated, normalize_attribute } from '../../../../utils.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { attach } from './attachments.js';\nimport { clsx } from '../../../shared/attributes.js';\nimport { set_class } from './class.js';\nimport { set_style } from './style.js';\nimport { ATTACHMENT_KEY, NAMESPACE_HTML } from '../../../../constants.js';\nimport { block, branch, destroy_effect, effect } from '../../reactivity/effects.js';\nimport { init_select, select_option } from './bindings/select.js';\nimport { flatten } from '../../reactivity/async.js';\n\nexport const CLASS = Symbol('class');\nexport const STYLE = Symbol('style');\n\nconst IS_CUSTOM_ELEMENT = Symbol('is custom element');\nconst IS_HTML = Symbol('is html');\n\n/**\n * The value/checked attribute in the template actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLInputElement} input\n * @returns {void}\n */\nexport function remove_input_defaults(input) {\n\tif (!hydrating) return;\n\n\tvar already_removed = false;\n\n\t// We try and remove the default attributes later, rather than sync during hydration.\n\t// Doing it sync during hydration has a negative impact on performance, but deferring the\n\t// work in an idle task alleviates this greatly. If a form reset event comes in before\n\t// the idle callback, then we ensure the input defaults are cleared just before.\n\tvar remove_defaults = () => {\n\t\tif (already_removed) return;\n\t\talready_removed = true;\n\n\t\t// Remove the attributes but preserve the values\n\t\tif (input.hasAttribute('value')) {\n\t\t\tvar value = input.value;\n\t\t\tset_attribute(input, 'value', null);\n\t\t\tinput.value = value;\n\t\t}\n\n\t\tif (input.hasAttribute('checked')) {\n\t\t\tvar checked = input.checked;\n\t\t\tset_attribute(input, 'checked', null);\n\t\t\tinput.checked = checked;\n\t\t}\n\t};\n\n\t// @ts-expect-error\n\tinput.__on_r = remove_defaults;\n\tqueue_idle_task(remove_defaults);\n\tadd_form_reset_listener();\n}\n\n/**\n * @param {Element} element\n * @param {any} value\n */\nexport function set_value(element, value) {\n\tvar attributes = get_attributes(element);\n\n\tif (\n\t\tattributes.value ===\n\t\t\t(attributes.value =\n\t\t\t\t// treat null and undefined the same for the initial value\n\t\t\t\tvalue ?? undefined) ||\n\t\t// @ts-expect-error\n\t\t// `progress` elements always need their value set when it's `0`\n\t\t(element.value === value && (value !== 0 || element.nodeName !== 'PROGRESS'))\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.value = value ?? '';\n}\n\n/**\n * @param {Element} element\n * @param {boolean} checked\n */\nexport function set_checked(element, checked) {\n\tvar attributes = get_attributes(element);\n\n\tif (\n\t\tattributes.checked ===\n\t\t(attributes.checked =\n\t\t\t// treat null and undefined the same for the initial value\n\t\t\tchecked ?? undefined)\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.checked = checked;\n}\n\n/**\n * Sets the `selected` attribute on an `option` element.\n * Not set through the property because that doesn't reflect to the DOM,\n * which means it wouldn't be taken into account when a form is reset.\n * @param {HTMLOptionElement} element\n * @param {boolean} selected\n */\nexport function set_selected(element, selected) {\n\tif (selected) {\n\t\t// The selected option could've changed via user selection, and\n\t\t// setting the value without this check would set it back.\n\t\tif (!element.hasAttribute('selected')) {\n\t\t\telement.setAttribute('selected', '');\n\t\t}\n\t} else {\n\t\telement.removeAttribute('selected');\n\t}\n}\n\n/**\n * Applies the default checked property without influencing the current checked property.\n * @param {HTMLInputElement} element\n * @param {boolean} checked\n */\nexport function set_default_checked(element, checked) {\n\tconst existing_value = element.checked;\n\telement.defaultChecked = checked;\n\telement.checked = existing_value;\n}\n\n/**\n * Applies the default value property without influencing the current value property.\n * @param {HTMLInputElement | HTMLTextAreaElement} element\n * @param {string} value\n */\nexport function set_default_value(element, value) {\n\tconst existing_value = element.value;\n\telement.defaultValue = value;\n\telement.value = existing_value;\n}\n\n/**\n * @param {Element} element\n * @param {string} attribute\n * @param {string | null} value\n * @param {boolean} [skip_warning]\n */\nexport function set_attribute(element, attribute, value, skip_warning) {\n\tvar attributes = get_attributes(element);\n\n\tif (hydrating) {\n\t\tattributes[attribute] = element.getAttribute(attribute);\n\n\t\tif (\n\t\t\tattribute === 'src' ||\n\t\t\tattribute === 'srcset' ||\n\t\t\t(attribute === 'href' && element.nodeName === 'LINK')\n\t\t) {\n\t\t\tif (!skip_warning) {\n\t\t\t\tcheck_src_in_dev_hydration(element, attribute, value ?? '');\n\t\t\t}\n\n\t\t\t// If we reset these attributes, they would result in another network request, which we want to avoid.\n\t\t\t// We assume they are the same between client and server as checking if they are equal is expensive\n\t\t\t// (we can't just compare the strings as they can be different between client and server but result in the\n\t\t\t// same url, so we would need to create hidden anchor elements to compare them)\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (attributes[attribute] === (attributes[attribute] = value)) return;\n\n\tif (attribute === 'loading') {\n\t\t// @ts-expect-error\n\t\telement[LOADING_ATTR_SYMBOL] = value;\n\t}\n\n\tif (value == null) {\n\t\telement.removeAttribute(attribute);\n\t} else if (typeof value !== 'string' && get_setters(element).includes(attribute)) {\n\t\t// @ts-ignore\n\t\telement[attribute] = value;\n\t} else {\n\t\telement.setAttribute(attribute, value);\n\t}\n}\n\n/**\n * @param {Element} dom\n * @param {string} attribute\n * @param {string} value\n */\nexport function set_xlink_attribute(dom, attribute, value) {\n\tdom.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @param {string} prop\n * @param {any} value\n */\nexport function set_custom_element_data(node, prop, value) {\n\t// We need to ensure that setting custom element props, which can\n\t// invoke lifecycle methods on other custom elements, does not also\n\t// associate those lifecycle methods with the current active reaction\n\t// or effect\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet was_hydrating = hydrating;\n\tif (hydrating) {\n\t\tset_hydrating(false);\n\t}\n\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\tif (\n\t\t\t// `style` should use `set_attribute` rather than the setter\n\t\t\tprop !== 'style' &&\n\t\t\t// Don't compute setters for custom elements while they aren't registered yet,\n\t\t\t// because during their upgrade/instantiation they might add more setters.\n\t\t\t// Instead, fall back to a simple \"an object, then set as property\" heuristic.\n\t\t\t(setters_cache.has(node.nodeName) ||\n\t\t\t// customElements may not be available in browser extension contexts\n\t\t\t!customElements ||\n\t\t\tcustomElements.get(node.tagName.toLowerCase())\n\t\t\t\t? get_setters(node).includes(prop)\n\t\t\t\t: value && typeof value === 'object')\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tnode[prop] = value;\n\t\t} else {\n\t\t\t// We did getters etc checks already, stringify before passing to set_attribute\n\t\t\t// to ensure it doesn't invoke the same logic again, and potentially populating\n\t\t\t// the setters cache too early.\n\t\t\tset_attribute(node, prop, value == null ? value : String(value));\n\t\t}\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t}\n\t}\n}\n\n/**\n * Spreads attributes onto a DOM element, taking into account the currently set attributes\n * @param {Element & ElementCSSInlineStyle} element\n * @param {Record<string | symbol, any> | undefined} prev\n * @param {Record<string | symbol, any>} next New attributes - this function mutates this object\n * @param {string} [css_hash]\n * @param {boolean} [skip_warning]\n * @returns {Record<string, any>}\n */\nexport function set_attributes(element, prev, next, css_hash, skip_warning = false) {\n\tvar attributes = get_attributes(element);\n\n\tvar is_custom_element = attributes[IS_CUSTOM_ELEMENT];\n\tvar preserve_attribute_case = !attributes[IS_HTML];\n\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet is_hydrating_custom_element = hydrating && is_custom_element;\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(false);\n\t}\n\n\tvar current = prev || {};\n\tvar is_option_element = element.tagName === 'OPTION';\n\n\tfor (var key in prev) {\n\t\tif (!(key in next)) {\n\t\t\tnext[key] = null;\n\t\t}\n\t}\n\n\tif (next.class) {\n\t\tnext.class = clsx(next.class);\n\t} else if (css_hash || next[CLASS]) {\n\t\tnext.class = null; /* force call to set_class() */\n\t}\n\n\tif (next[STYLE]) {\n\t\tnext.style ??= null; /* force call to set_style() */\n\t}\n\n\tvar setters = get_setters(element);\n\n\t// since key is captured we use const\n\tfor (const key in next) {\n\t\t// let instead of var because referenced in a closure\n\t\tlet value = next[key];\n\n\t\t// Up here because we want to do this for the initial value, too, even if it's undefined,\n\t\t// and this wouldn't be reached in case of undefined because of the equality check below\n\t\tif (is_option_element && key === 'value' && value == null) {\n\t\t\t// The <option> element is a special case because removing the value attribute means\n\t\t\t// the value is set to the text content of the option element, and setting the value\n\t\t\t// to null or undefined means the value is set to the string \"null\" or \"undefined\".\n\t\t\t// To align with how we handle this case in non-spread-scenarios, this logic is needed.\n\t\t\t// There's a super-edge-case bug here that is left in in favor of smaller code size:\n\t\t\t// Because of the \"set missing props to null\" logic above, we can't differentiate\n\t\t\t// between a missing value and an explicitly set value of null or undefined. That means\n\t\t\t// that once set, the value attribute of an <option> element can't be removed. This is\n\t\t\t// a very rare edge case, and removing the attribute altogether isn't possible either\n\t\t\t// for the <option value={undefined}> case, so we're not losing any functionality here.\n\t\t\t// @ts-ignore\n\t\t\telement.value = element.__value = '';\n\t\t\tcurrent[key] = value;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (key === 'class') {\n\t\t\tvar is_html = element.namespaceURI === 'http://www.w3.org/1999/xhtml';\n\t\t\tset_class(element, is_html, value, css_hash, prev?.[CLASS], next[CLASS]);\n\t\t\tcurrent[key] = value;\n\t\t\tcurrent[CLASS] = next[CLASS];\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (key === 'style') {\n\t\t\tset_style(element, value, prev?.[STYLE], next[STYLE]);\n\t\t\tcurrent[key] = value;\n\t\t\tcurrent[STYLE] = next[STYLE];\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar prev_value = current[key];\n\n\t\t// Skip if value is unchanged, unless it's `undefined` and the element still has the attribute\n\t\tif (value === prev_value && !(value === undefined && element.hasAttribute(key))) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tcurrent[key] = value;\n\n\t\tvar prefix = key[0] + key[1]; // this is faster than key.slice(0, 2)\n\t\tif (prefix === '$$') continue;\n\n\t\tif (prefix === 'on') {\n\t\t\t/** @type {{ capture?: true }} */\n\t\t\tconst opts = {};\n\t\t\tconst event_handle_key = '$$' + key;\n\t\t\tlet event_name = key.slice(2);\n\t\t\tvar delegated = is_delegated(event_name);\n\n\t\t\tif (is_capture_event(event_name)) {\n\t\t\t\tevent_name = event_name.slice(0, -7);\n\t\t\t\topts.capture = true;\n\t\t\t}\n\n\t\t\tif (!delegated && prev_value) {\n\t\t\t\t// Listening to same event but different handler -> our handle function below takes care of this\n\t\t\t\t// If we were to remove and add listeners in this case, it could happen that the event is \"swallowed\"\n\t\t\t\t// (the browser seems to not know yet that a new one exists now) and doesn't reach the handler\n\t\t\t\t// https://github.com/sveltejs/svelte/issues/11903\n\t\t\t\tif (value != null) continue;\n\n\t\t\t\telement.removeEventListener(event_name, current[event_handle_key], opts);\n\t\t\t\tcurrent[event_handle_key] = null;\n\t\t\t}\n\n\t\t\tif (value != null) {\n\t\t\t\tif (!delegated) {\n\t\t\t\t\t/**\n\t\t\t\t\t * @this {any}\n\t\t\t\t\t * @param {Event} evt\n\t\t\t\t\t */\n\t\t\t\t\tfunction handle(evt) {\n\t\t\t\t\t\tcurrent[key].call(this, evt);\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent[event_handle_key] = create_event(event_name, element, handle, opts);\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\telement[`__${event_name}`] = value;\n\t\t\t\t\tdelegate([event_name]);\n\t\t\t\t}\n\t\t\t} else if (delegated) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[`__${event_name}`] = undefined;\n\t\t\t}\n\t\t} else if (key === 'style') {\n\t\t\t// avoid using the setter\n\t\t\tset_attribute(element, key, value);\n\t\t} else if (key === 'autofocus') {\n\t\t\tautofocus(/** @type {HTMLElement} */ (element), Boolean(value));\n\t\t} else if (!is_custom_element && (key === '__value' || (key === 'value' && value != null))) {\n\t\t\t// @ts-ignore We're not running this for custom elements because __value is actually\n\t\t\t// how Lit stores the current value on the element, and messing with that would break things.\n\t\t\telement.value = element.__value = value;\n\t\t} else if (key === 'selected' && is_option_element) {\n\t\t\tset_selected(/** @type {HTMLOptionElement} */ (element), value);\n\t\t} else {\n\t\t\tvar name = key;\n\t\t\tif (!preserve_attribute_case) {\n\t\t\t\tname = normalize_attribute(name);\n\t\t\t}\n\n\t\t\tvar is_default = name === 'defaultValue' || name === 'defaultChecked';\n\n\t\t\tif (value == null && !is_custom_element && !is_default) {\n\t\t\t\tattributes[key] = null;\n\n\t\t\t\tif (name === 'value' || name === 'checked') {\n\t\t\t\t\t// removing value/checked also removes defaultValue/defaultChecked — preserve\n\t\t\t\t\tlet input = /** @type {HTMLInputElement} */ (element);\n\t\t\t\t\tconst use_default = prev === undefined;\n\t\t\t\t\tif (name === 'value') {\n\t\t\t\t\t\tlet previous = input.defaultValue;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultValue = previous;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tinput.value = input.__value = use_default ? previous : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet previous = input.defaultChecked;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultChecked = previous;\n\t\t\t\t\t\tinput.checked = use_default ? previous : false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\telement.removeAttribute(key);\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tis_default ||\n\t\t\t\t(setters.includes(name) && (is_custom_element || typeof value !== 'string'))\n\t\t\t) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[name] = value;\n\t\t\t} else if (typeof value !== 'function') {\n\t\t\t\tset_attribute(element, name, value, skip_warning);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(true);\n\t}\n\n\treturn current;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} element\n * @param {(...expressions: any) => Record<string | symbol, any>} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n * @param {string} [css_hash]\n * @param {boolean} [skip_warning]\n */\nexport function attribute_effect(\n\telement,\n\tfn,\n\tsync = [],\n\tasync = [],\n\tcss_hash,\n\tskip_warning = false\n) {\n\tflatten(sync, async, (values) => {\n\t\t/** @type {Record<string | symbol, any> | undefined} */\n\t\tvar prev = undefined;\n\n\t\t/** @type {Record<symbol, Effect>} */\n\t\tvar effects = {};\n\n\t\tvar is_select = element.nodeName === 'SELECT';\n\t\tvar inited = false;\n\n\t\tblock(() => {\n\t\t\tvar next = fn(...values.map(get));\n\t\t\t/** @type {Record<string | symbol, any>} */\n\t\t\tvar current = set_attributes(element, prev, next, css_hash, skip_warning);\n\n\t\t\tif (inited && is_select && 'value' in next) {\n\t\t\t\tselect_option(/** @type {HTMLSelectElement} */ (element), next.value);\n\t\t\t}\n\n\t\t\tfor (let symbol of Object.getOwnPropertySymbols(effects)) {\n\t\t\t\tif (!next[symbol]) destroy_effect(effects[symbol]);\n\t\t\t}\n\n\t\t\tfor (let symbol of Object.getOwnPropertySymbols(next)) {\n\t\t\t\tvar n = next[symbol];\n\n\t\t\t\tif (symbol.description === ATTACHMENT_KEY && (!prev || n !== prev[symbol])) {\n\t\t\t\t\tif (effects[symbol]) destroy_effect(effects[symbol]);\n\t\t\t\t\teffects[symbol] = branch(() => attach(element, () => n));\n\t\t\t\t}\n\n\t\t\t\tcurrent[symbol] = n;\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t});\n\n\t\tif (is_select) {\n\t\t\tvar select = /** @type {HTMLSelectElement} */ (element);\n\n\t\t\teffect(() => {\n\t\t\t\tselect_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, true);\n\t\t\t\tinit_select(select);\n\t\t\t});\n\t\t}\n\n\t\tinited = true;\n\t});\n}\n\n/**\n *\n * @param {Element} element\n */\nfunction get_attributes(element) {\n\treturn /** @type {Record<string | symbol, unknown>} **/ (\n\t\t// @ts-expect-error\n\t\telement.__attributes ??= {\n\t\t\t[IS_CUSTOM_ELEMENT]: element.nodeName.includes('-'),\n\t\t\t[IS_HTML]: element.namespaceURI === NAMESPACE_HTML\n\t\t}\n\t);\n}\n\n/** @type {Map<string, string[]>} */\nvar setters_cache = new Map();\n\n/** @param {Element} element */\nfunction get_setters(element) {\n\tvar setters = setters_cache.get(element.nodeName);\n\tif (setters) return setters;\n\tsetters_cache.set(element.nodeName, (setters = []));\n\n\tvar descriptors;\n\tvar proto = element; // In the case of custom elements there might be setters on the instance\n\tvar element_proto = Element.prototype;\n\n\t// Stop at Element, from there on there's only unnecessary setters we're not interested in\n\t// Do not use contructor.name here as that's unreliable in some browser environments\n\twhile (element_proto !== proto) {\n\t\tdescriptors = get_descriptors(proto);\n\n\t\tfor (var key in descriptors) {\n\t\t\tif (descriptors[key].set) {\n\t\t\t\tsetters.push(key);\n\t\t\t}\n\t\t}\n\n\t\tproto = get_prototype_of(proto);\n\t}\n\n\treturn setters;\n}\n\n/**\n * @param {any} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction check_src_in_dev_hydration(element, attribute, value) {\n\tif (!DEV) return;\n\tif (attribute === 'srcset' && srcset_url_equal(element, value)) return;\n\tif (src_url_equal(element.getAttribute(attribute) ?? '', value)) return;\n\n\tw.hydration_attribute_changed(\n\t\tattribute,\n\t\telement.outerHTML.replace(element.innerHTML, element.innerHTML && '...'),\n\t\tString(value)\n\t);\n}\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nfunction src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\treturn new URL(element_src, document.baseURI).href === new URL(url, document.baseURI).href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element\n * @param {string} srcset\n * @returns {boolean}\n */\nfunction srcset_url_equal(element, srcset) {\n\tvar element_urls = split_srcset(element.srcset);\n\tvar urls = split_srcset(srcset);\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n","import { effect, teardown } from '../../../reactivity/effects.js';\nimport { untrack } from '../../../runtime.js';\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nclass ResizeObserverSingleton {\n\t/** */\n\t#listeners = new WeakMap();\n\n\t/** @type {ResizeObserver | undefined} */\n\t#observer;\n\n\t/** @type {ResizeObserverOptions} */\n\t#options;\n\n\t/** @static */\n\tstatic entries = new WeakMap();\n\n\t/** @param {ResizeObserverOptions} options */\n\tconstructor(options) {\n\t\tthis.#options = options;\n\t}\n\n\t/**\n\t * @param {Element} element\n\t * @param {(entry: ResizeObserverEntry) => any} listener\n\t */\n\tobserve(element, listener) {\n\t\tvar listeners = this.#listeners.get(element) || new Set();\n\t\tlisteners.add(listener);\n\n\t\tthis.#listeners.set(element, listeners);\n\t\tthis.#getObserver().observe(element, this.#options);\n\n\t\treturn () => {\n\t\t\tvar listeners = this.#listeners.get(element);\n\t\t\tlisteners.delete(listener);\n\n\t\t\tif (listeners.size === 0) {\n\t\t\t\tthis.#listeners.delete(element);\n\t\t\t\t/** @type {ResizeObserver} */ (this.#observer).unobserve(element);\n\t\t\t}\n\t\t};\n\t}\n\n\t#getObserver() {\n\t\treturn (\n\t\t\tthis.#observer ??\n\t\t\t(this.#observer = new ResizeObserver(\n\t\t\t\t/** @param {any} entries */ (entries) => {\n\t\t\t\t\tfor (var entry of entries) {\n\t\t\t\t\t\tResizeObserverSingleton.entries.set(entry.target, entry);\n\t\t\t\t\t\tfor (var listener of this.#listeners.get(entry.target) || []) {\n\t\t\t\t\t\t\tlistener(entry);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t))\n\t\t);\n\t}\n}\n\nvar resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'content-box'\n});\n\nvar resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'border-box'\n});\n\nvar resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'device-pixel-content-box'\n});\n\n/**\n * @param {Element} element\n * @param {'contentRect' | 'contentBoxSize' | 'borderBoxSize' | 'devicePixelContentBoxSize'} type\n * @param {(entry: keyof ResizeObserverEntry) => void} set\n */\nexport function bind_resize_observer(element, type, set) {\n\tvar observer =\n\t\ttype === 'contentRect' || type === 'contentBoxSize'\n\t\t\t? resize_observer_content_box\n\t\t\t: type === 'borderBoxSize'\n\t\t\t\t? resize_observer_border_box\n\t\t\t\t: resize_observer_device_pixel_content_box;\n\n\tvar unsub = observer.observe(element, /** @param {any} entry */ (entry) => set(entry[type]));\n\tteardown(unsub);\n}\n\n/**\n * @param {HTMLElement} element\n * @param {'clientWidth' | 'clientHeight' | 'offsetWidth' | 'offsetHeight'} type\n * @param {(size: number) => void} set\n */\nexport function bind_element_size(element, type, set) {\n\tvar unsub = resize_observer_border_box.observe(element, () => set(element[type]));\n\n\teffect(() => {\n\t\t// The update could contain reads which should be ignored\n\t\tuntrack(() => set(element[type]));\n\t\treturn unsub;\n\t});\n}\n","import { STATE_SYMBOL } from '#client/constants';\nimport { effect, render_effect } from '../../../reactivity/effects.js';\nimport { untrack } from '../../../runtime.js';\nimport { queue_micro_task } from '../../task.js';\n\n/**\n * @param {any} bound_value\n * @param {Element} element_or_component\n * @returns {boolean}\n */\nfunction is_bound_this(bound_value, element_or_component) {\n\treturn (\n\t\tbound_value === element_or_component || bound_value?.[STATE_SYMBOL] === element_or_component\n\t);\n}\n\n/**\n * @param {any} element_or_component\n * @param {(value: unknown, ...parts: unknown[]) => void} update\n * @param {(...parts: unknown[]) => unknown} get_value\n * @param {() => unknown[]} [get_parts] Set if the this binding is used inside an each block,\n * \t\t\t\t\t\t\t\t\t\treturns all the parts of the each block context that are used in the expression\n * @returns {void}\n */\nexport function bind_this(element_or_component = {}, update, get_value, get_parts) {\n\teffect(() => {\n\t\t/** @type {unknown[]} */\n\t\tvar old_parts;\n\n\t\t/** @type {unknown[]} */\n\t\tvar parts;\n\n\t\trender_effect(() => {\n\t\t\told_parts = parts;\n\t\t\t// We only track changes to the parts, not the value itself to avoid unnecessary reruns.\n\t\t\tparts = get_parts?.() || [];\n\n\t\t\tuntrack(() => {\n\t\t\t\tif (element_or_component !== get_value(...parts)) {\n\t\t\t\t\tupdate(element_or_component, ...parts);\n\t\t\t\t\t// If this is an effect rerun (cause: each block context changes), then nullfiy the binding at\n\t\t\t\t\t// the previous position if it isn't already taken over by a different effect.\n\t\t\t\t\tif (old_parts && is_bound_this(get_value(...old_parts), element_or_component)) {\n\t\t\t\t\t\tupdate(null, ...old_parts);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\treturn () => {\n\t\t\t// We cannot use effects in the teardown phase, we we use a microtask instead.\n\t\t\tqueue_micro_task(() => {\n\t\t\t\tif (parts && is_bound_this(get_value(...parts), element_or_component)) {\n\t\t\t\t\tupdate(null, ...parts);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t});\n\n\treturn element_or_component;\n}\n","/** @import { ComponentContextLegacy } from '#client' */\nimport { run, run_all } from '../../../shared/utils.js';\nimport { component_context } from '../../context.js';\nimport { derived } from '../../reactivity/deriveds.js';\nimport { user_pre_effect, user_effect } from '../../reactivity/effects.js';\nimport { deep_read_state, get, untrack } from '../../runtime.js';\n\n/**\n * Legacy-mode only: Call `onMount` callbacks and set up `beforeUpdate`/`afterUpdate` effects\n * @param {boolean} [immutable]\n */\nexport function init(immutable = false) {\n\tconst context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\tconst callbacks = context.l.u;\n\tif (!callbacks) return;\n\n\tlet props = () => deep_read_state(context.s);\n\n\tif (immutable) {\n\t\tlet version = 0;\n\t\tlet prev = /** @type {Record<string, any>} */ ({});\n\n\t\t// In legacy immutable mode, before/afterUpdate only fire if the object identity of a prop changes\n\t\tconst d = derived(() => {\n\t\t\tlet changed = false;\n\t\t\tconst props = context.s;\n\t\t\tfor (const key in props) {\n\t\t\t\tif (props[key] !== prev[key]) {\n\t\t\t\t\tprev[key] = props[key];\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (changed) version++;\n\t\t\treturn version;\n\t\t});\n\n\t\tprops = () => get(d);\n\t}\n\n\t// beforeUpdate\n\tif (callbacks.b.length) {\n\t\tuser_pre_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.b);\n\t\t});\n\t}\n\n\t// onMount (must run before afterUpdate)\n\tuser_effect(() => {\n\t\tconst fns = untrack(() => callbacks.m.map(run));\n\t\treturn () => {\n\t\t\tfor (const fn of fns) {\n\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\tfn();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\n\t// afterUpdate\n\tif (callbacks.a.length) {\n\t\tuser_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.a);\n\t\t});\n\t}\n}\n\n/**\n * Invoke the getter of all signals associated with a component\n * so they can be registered to the effect this function is called in.\n * @param {ComponentContextLegacy} context\n * @param {(() => void)} props\n */\nfunction observe_all(context, props) {\n\tif (context.l.s) {\n\t\tfor (const signal of context.l.s) get(signal);\n\t}\n\n\tprops();\n}\n","import { set, source } from '../../reactivity/sources.js';\nimport { get } from '../../runtime.js';\nimport { is_array } from '../../../shared/utils.js';\n\n/**\n * Under some circumstances, imports may be reactive in legacy mode. In that case,\n * they should be using `reactive_import` as part of the transformation\n * @param {() => any} fn\n */\nexport function reactive_import(fn) {\n\tvar s = source(0);\n\n\treturn function () {\n\t\tif (arguments.length === 1) {\n\t\t\tset(s, get(s) + 1);\n\t\t\treturn arguments[0];\n\t\t} else {\n\t\t\tget(s);\n\t\t\treturn fn();\n\t\t}\n\t};\n}\n\n/**\n * @this {any}\n * @param {Record<string, unknown>} $$props\n * @param {Event} event\n * @returns {void}\n */\nexport function bubble_event($$props, event) {\n\tvar events = /** @type {Record<string, Function[] | Function>} */ ($$props.$$events)?.[\n\t\tevent.type\n\t];\n\n\tvar callbacks = is_array(events) ? events.slice() : events == null ? [] : [events];\n\n\tfor (var fn of callbacks) {\n\t\t// Preserve \"this\" context\n\t\tfn.call(this, event);\n\t}\n}\n\n/**\n * Used to simulate `$on` on a component instance when `compatibility.componentApi === 4`\n * @param {Record<string, any>} $$props\n * @param {string} event_name\n * @param {Function} event_callback\n */\nexport function add_legacy_event_listener($$props, event_name, event_callback) {\n\t$$props.$$events ||= {};\n\t$$props.$$events[event_name] ||= [];\n\t$$props.$$events[event_name].push(event_callback);\n}\n\n/**\n * Used to simulate `$set` on a component instance when `compatibility.componentApi === 4`.\n * Needs component accessors so that it can call the setter of the prop. Therefore doesn't\n * work for updating props in `$$props` or `$$restProps`.\n * @this {Record<string, any>}\n * @param {Record<string, any>} $$new_props\n */\nexport function update_legacy_props($$new_props) {\n\tfor (var key in $$new_props) {\n\t\tif (key in this) {\n\t\t\tthis[key] = $$new_props[key];\n\t\t}\n\t}\n}\n","/** @import { Readable } from './public' */\nimport { untrack } from '../index-client.js';\nimport { noop } from '../internal/shared/utils.js';\n\n/**\n * @template T\n * @param {Readable<T> | null | undefined} store\n * @param {(value: T) => void} run\n * @param {(value: T) => void} [invalidate]\n * @returns {() => void}\n */\nexport function subscribe_to_store(store, run, invalidate) {\n\tif (store == null) {\n\t\t// @ts-expect-error\n\t\trun(undefined);\n\n\t\t// @ts-expect-error\n\t\tif (invalidate) invalidate(undefined);\n\n\t\treturn noop;\n\t}\n\n\t// Svelte store takes a private second argument\n\t// StartStopNotifier could mutate state, and we want to silence the corresponding validation error\n\tconst unsub = untrack(() =>\n\t\tstore.subscribe(\n\t\t\trun,\n\t\t\t// @ts-expect-error\n\t\t\tinvalidate\n\t\t)\n\t);\n\n\t// Also support RxJS\n\t// @ts-expect-error TODO fix this in the types?\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n","/** @import { Readable, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable } from '../public.js' */\n/** @import { Stores, StoresValues, SubscribeInvalidateTuple } from '../private.js' */\nimport { noop, run_all } from '../../internal/shared/utils.js';\nimport { safe_not_equal } from '../../internal/client/reactivity/equality.js';\nimport { subscribe_to_store } from '../utils.js';\n\n/**\n * @type {Array<SubscribeInvalidateTuple<any> | any>}\n */\nconst subscriber_queue = [];\n\n/**\n * Creates a `Readable` store that allows reading by subscription.\n *\n * @template T\n * @param {T} [value] initial value\n * @param {StartStopNotifier<T>} [start]\n * @returns {Readable<T>}\n */\nexport function readable(value, start) {\n\treturn {\n\t\tsubscribe: writable(value, start).subscribe\n\t};\n}\n\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n *\n * @template T\n * @param {T} [value] initial value\n * @param {StartStopNotifier<T>} [start]\n * @returns {Writable<T>}\n */\nexport function writable(value, start = noop) {\n\t/** @type {Unsubscriber | null} */\n\tlet stop = null;\n\n\t/** @type {Set<SubscribeInvalidateTuple<T>>} */\n\tconst subscribers = new Set();\n\n\t/**\n\t * @param {T} new_value\n\t * @returns {void}\n\t */\n\tfunction set(new_value) {\n\t\tif (safe_not_equal(value, new_value)) {\n\t\t\tvalue = new_value;\n\t\t\tif (stop) {\n\t\t\t\t// store is ready\n\t\t\t\tconst run_queue = !subscriber_queue.length;\n\t\t\t\tfor (const subscriber of subscribers) {\n\t\t\t\t\tsubscriber[1]();\n\t\t\t\t\tsubscriber_queue.push(subscriber, value);\n\t\t\t\t}\n\t\t\t\tif (run_queue) {\n\t\t\t\t\tfor (let i = 0; i < subscriber_queue.length; i += 2) {\n\t\t\t\t\t\tsubscriber_queue[i][0](subscriber_queue[i + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tsubscriber_queue.length = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {Updater<T>} fn\n\t * @returns {void}\n\t */\n\tfunction update(fn) {\n\t\tset(fn(/** @type {T} */ (value)));\n\t}\n\n\t/**\n\t * @param {Subscriber<T>} run\n\t * @param {() => void} [invalidate]\n\t * @returns {Unsubscriber}\n\t */\n\tfunction subscribe(run, invalidate = noop) {\n\t\t/** @type {SubscribeInvalidateTuple<T>} */\n\t\tconst subscriber = [run, invalidate];\n\t\tsubscribers.add(subscriber);\n\t\tif (subscribers.size === 1) {\n\t\t\tstop = start(set, update) || noop;\n\t\t}\n\t\trun(/** @type {T} */ (value));\n\t\treturn () => {\n\t\t\tsubscribers.delete(subscriber);\n\t\t\tif (subscribers.size === 0 && stop) {\n\t\t\t\tstop();\n\t\t\t\tstop = null;\n\t\t\t}\n\t\t};\n\t}\n\treturn { set, update, subscribe };\n}\n\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * @template {Stores} S\n * @template T\n * @overload\n * @param {S} stores\n * @param {(values: StoresValues<S>, set: (value: T) => void, update: (fn: Updater<T>) => void) => Unsubscriber | void} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * @template {Stores} S\n * @template T\n * @overload\n * @param {S} stores\n * @param {(values: StoresValues<S>) => T} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\n/**\n * @template {Stores} S\n * @template T\n * @param {S} stores\n * @param {Function} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\nexport function derived(stores, fn, initial_value) {\n\tconst single = !Array.isArray(stores);\n\t/** @type {Array<Readable<any>>} */\n\tconst stores_array = single ? [stores] : stores;\n\tif (!stores_array.every(Boolean)) {\n\t\tthrow new Error('derived() expects stores as input, got a falsy value');\n\t}\n\tconst auto = fn.length < 2;\n\treturn readable(initial_value, (set, update) => {\n\t\tlet started = false;\n\t\t/** @type {T[]} */\n\t\tconst values = [];\n\t\tlet pending = 0;\n\t\tlet cleanup = noop;\n\t\tconst sync = () => {\n\t\t\tif (pending) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcleanup();\n\t\t\tconst result = fn(single ? values[0] : values, set, update);\n\t\t\tif (auto) {\n\t\t\t\tset(result);\n\t\t\t} else {\n\t\t\t\tcleanup = typeof result === 'function' ? result : noop;\n\t\t\t}\n\t\t};\n\t\tconst unsubscribers = stores_array.map((store, i) =>\n\t\t\tsubscribe_to_store(\n\t\t\t\tstore,\n\t\t\t\t(value) => {\n\t\t\t\t\tvalues[i] = value;\n\t\t\t\t\tpending &= ~(1 << i);\n\t\t\t\t\tif (started) {\n\t\t\t\t\t\tsync();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tpending |= 1 << i;\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t\tstarted = true;\n\t\tsync();\n\t\treturn function stop() {\n\t\t\trun_all(unsubscribers);\n\t\t\tcleanup();\n\t\t\t// We need to set this to false because callbacks can still happen despite having unsubscribed:\n\t\t\t// Callbacks might already be placed in the queue which doesn't know it should no longer\n\t\t\t// invoke this derived store.\n\t\t\tstarted = false;\n\t\t};\n\t});\n}\n\n/**\n * Takes a store and returns a new one derived from the old one that is readable.\n *\n * @template T\n * @param {Readable<T>} store - store to make readonly\n * @returns {Readable<T>}\n */\nexport function readonly(store) {\n\treturn {\n\t\t// @ts-expect-error TODO i suspect the bind is unnecessary\n\t\tsubscribe: store.subscribe.bind(store)\n\t};\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * @template T\n * @param {Readable<T>} store\n * @returns {T}\n */\nexport function get(store) {\n\tlet value;\n\tsubscribe_to_store(store, (_) => (value = _))();\n\t// @ts-expect-error\n\treturn value;\n}\n","/** @import { StoreReferencesContainer } from '#client' */\n/** @import { Store } from '#shared' */\nimport { subscribe_to_store } from '../../../store/utils.js';\nimport { get as get_store } from '../../../store/shared/index.js';\nimport { define_property, noop } from '../../shared/utils.js';\nimport { get } from '../runtime.js';\nimport { teardown } from './effects.js';\nimport { mutable_source, set } from './sources.js';\nimport { DEV } from 'esm-env';\n\n/**\n * Whether or not the prop currently being read is a store binding, as in\n * `<Child bind:x={$y} />`. If it is, we treat the prop as mutable even in\n * runes mode, and skip `binding_property_non_reactive` validation\n */\nlet is_store_binding = false;\n\nlet IS_UNMOUNTED = Symbol();\n\n/**\n * Gets the current value of a store. If the store isn't subscribed to yet, it will create a proxy\n * signal that will be updated when the store is. The store references container is needed to\n * track reassignments to stores and to track the correct component context.\n * @template V\n * @param {Store<V> | null | undefined} store\n * @param {string} store_name\n * @param {StoreReferencesContainer} stores\n * @returns {V}\n */\nexport function store_get(store, store_name, stores) {\n\tconst entry = (stores[store_name] ??= {\n\t\tstore: null,\n\t\tsource: mutable_source(undefined),\n\t\tunsubscribe: noop\n\t});\n\n\tif (DEV) {\n\t\tentry.source.label = store_name;\n\t}\n\n\t// if the component that setup this is already unmounted we don't want to register a subscription\n\tif (entry.store !== store && !(IS_UNMOUNTED in stores)) {\n\t\tentry.unsubscribe();\n\t\tentry.store = store ?? null;\n\n\t\tif (store == null) {\n\t\t\tentry.source.v = undefined; // see synchronous callback comment below\n\t\t\tentry.unsubscribe = noop;\n\t\t} else {\n\t\t\tvar is_synchronous_callback = true;\n\n\t\t\tentry.unsubscribe = subscribe_to_store(store, (v) => {\n\t\t\t\tif (is_synchronous_callback) {\n\t\t\t\t\t// If the first updates to the store value (possibly multiple of them) are synchronously\n\t\t\t\t\t// inside a derived, we will hit the `state_unsafe_mutation` error if we `set` the value\n\t\t\t\t\tentry.source.v = v;\n\t\t\t\t} else {\n\t\t\t\t\tset(entry.source, v);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tis_synchronous_callback = false;\n\t\t}\n\t}\n\n\t// if the component that setup this stores is already unmounted the source will be out of sync\n\t// so we just use the `get` for the stores, less performant but it avoids to create a memory leak\n\t// and it will keep the value consistent\n\tif (store && IS_UNMOUNTED in stores) {\n\t\treturn get_store(store);\n\t}\n\n\treturn get(entry.source);\n}\n\n/**\n * Unsubscribe from a store if it's not the same as the one in the store references container.\n * We need this in addition to `store_get` because someone could unsubscribe from a store but\n * then never subscribe to the new one (if any), causing the subscription to stay open wrongfully.\n * @param {Store<any> | null | undefined} store\n * @param {string} store_name\n * @param {StoreReferencesContainer} stores\n */\nexport function store_unsub(store, store_name, stores) {\n\t/** @type {StoreReferencesContainer[''] | undefined} */\n\tlet entry = stores[store_name];\n\n\tif (entry && entry.store !== store) {\n\t\t// Don't reset store yet, so that store_get above can resubscribe to new store if necessary\n\t\tentry.unsubscribe();\n\t\tentry.unsubscribe = noop;\n\t}\n\n\treturn store;\n}\n\n/**\n * Sets the new value of a store and returns that value.\n * @template V\n * @param {Store<V>} store\n * @param {V} value\n * @returns {V}\n */\nexport function store_set(store, value) {\n\tstore.set(value);\n\treturn value;\n}\n\n/**\n * @param {StoreReferencesContainer} stores\n * @param {string} store_name\n */\nexport function invalidate_store(stores, store_name) {\n\tvar entry = stores[store_name];\n\tif (entry.store !== null) {\n\t\tstore_set(entry.store, entry.source.v);\n\t}\n}\n\n/**\n * Unsubscribes from all auto-subscribed stores on destroy\n * @returns {[StoreReferencesContainer, ()=>void]}\n */\nexport function setup_stores() {\n\t/** @type {StoreReferencesContainer} */\n\tconst stores = {};\n\n\tfunction cleanup() {\n\t\tteardown(() => {\n\t\t\tfor (var store_name in stores) {\n\t\t\t\tconst ref = stores[store_name];\n\t\t\t\tref.unsubscribe();\n\t\t\t}\n\t\t\tdefine_property(stores, IS_UNMOUNTED, {\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: true\n\t\t\t});\n\t\t});\n\t}\n\n\treturn [stores, cleanup];\n}\n\n/**\n * Updates a store with a new value.\n * @param {Store<V>} store the store to update\n * @param {any} expression the expression that mutates the store\n * @param {V} new_value the new store value\n * @template V\n */\nexport function store_mutate(store, expression, new_value) {\n\tstore.set(new_value);\n\treturn expression;\n}\n\n/**\n * @param {Store<number>} store\n * @param {number} store_value\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_store(store, store_value, d = 1) {\n\tstore.set(store_value + d);\n\treturn store_value;\n}\n\n/**\n * @param {Store<number>} store\n * @param {number} store_value\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_pre_store(store, store_value, d = 1) {\n\tconst value = store_value + d;\n\tstore.set(value);\n\treturn value;\n}\n\n/**\n * Called inside prop getters to communicate that the prop is a store binding\n */\nexport function mark_store_binding() {\n\tis_store_binding = true;\n}\n\n/**\n * Returns a tuple that indicates whether `fn()` reads a prop that is a store binding.\n * Used to prevent `binding_property_non_reactive` validation false positives and\n * ensure that these props are treated as mutable even in runes mode\n * @template T\n * @param {() => T} fn\n * @returns {[T, boolean]}\n */\nexport function capture_store_binding(fn) {\n\tvar previous_is_store_binding = is_store_binding;\n\n\ttry {\n\t\tis_store_binding = false;\n\t\treturn [fn(), is_store_binding];\n\t} finally {\n\t\tis_store_binding = previous_is_store_binding;\n\t}\n}\n","/** @import { Effect, Source } from './types.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tPROPS_IS_BINDABLE,\n\tPROPS_IS_IMMUTABLE,\n\tPROPS_IS_LAZY_INITIAL,\n\tPROPS_IS_RUNES,\n\tPROPS_IS_UPDATED\n} from '../../../constants.js';\nimport { get_descriptor, is_function } from '../../shared/utils.js';\nimport { set, source, update } from './sources.js';\nimport { derived, derived_safe_equal } from './deriveds.js';\nimport {\n\tactive_effect,\n\tget,\n\tis_destroying_effect,\n\tset_active_effect,\n\tuntrack\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { DESTROYED, LEGACY_PROPS, STATE_SYMBOL } from '#client/constants';\nimport { proxy } from '../proxy.js';\nimport { capture_store_binding } from './store.js';\nimport { legacy_mode_flag } from '../../flags/index.js';\n\n/**\n * @param {((value?: number) => number)} fn\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_prop(fn, d = 1) {\n\tconst value = fn();\n\tfn(value + d);\n\treturn value;\n}\n\n/**\n * @param {((value?: number) => number)} fn\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_pre_prop(fn, d = 1) {\n\tconst value = fn() + d;\n\tfn(value);\n\treturn value;\n}\n\n/**\n * The proxy handler for rest props (i.e. `const { x, ...rest } = $props()`).\n * Is passed the full `$$props` object and excludes the named props.\n * @type {ProxyHandler<{ props: Record<string | symbol, unknown>, exclude: Array<string | symbol>, name?: string }>}}\n */\nconst rest_props_handler = {\n\tget(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\treturn target.props[key];\n\t},\n\tset(target, key) {\n\t\tif (DEV) {\n\t\t\t// TODO should this happen in prod too?\n\t\t\te.props_rest_readonly(`${target.name}.${String(key)}`);\n\t\t}\n\n\t\treturn false;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tif (key in target.props) {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: target.props[key]\n\t\t\t};\n\t\t}\n\t},\n\thas(target, key) {\n\t\tif (target.exclude.includes(key)) return false;\n\t\treturn key in target.props;\n\t},\n\townKeys(target) {\n\t\treturn Reflect.ownKeys(target.props).filter((key) => !target.exclude.includes(key));\n\t}\n};\n\n/**\n * @param {Record<string, unknown>} props\n * @param {string[]} exclude\n * @param {string} [name]\n * @returns {Record<string, unknown>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function rest_props(props, exclude, name) {\n\treturn new Proxy(\n\t\tDEV ? { props, exclude, name, other: {}, to_proxy: [] } : { props, exclude },\n\t\trest_props_handler\n\t);\n}\n\n/**\n * The proxy handler for legacy $$restProps and $$props\n * @type {ProxyHandler<{ props: Record<string | symbol, unknown>, exclude: Array<string | symbol>, special: Record<string | symbol, (v?: unknown) => unknown>, version: Source<number>, parent_effect: Effect }>}}\n */\nconst legacy_rest_props_handler = {\n\tget(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tget(target.version);\n\t\treturn key in target.special ? target.special[key]() : target.props[key];\n\t},\n\tset(target, key, value) {\n\t\tif (!(key in target.special)) {\n\t\t\tvar previous_effect = active_effect;\n\n\t\t\ttry {\n\t\t\t\tset_active_effect(target.parent_effect);\n\n\t\t\t\t// Handle props that can temporarily get out of sync with the parent\n\t\t\t\t/** @type {Record<string, (v?: unknown) => unknown>} */\n\t\t\t\ttarget.special[key] = prop(\n\t\t\t\t\t{\n\t\t\t\t\t\tget [key]() {\n\t\t\t\t\t\t\treturn target.props[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t/** @type {string} */ (key),\n\t\t\t\t\tPROPS_IS_UPDATED\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tset_active_effect(previous_effect);\n\t\t\t}\n\t\t}\n\n\t\ttarget.special[key](value);\n\t\tupdate(target.version); // $$props is coarse-grained: when $$props.x is updated, usages of $$props.y etc are also rerun\n\t\treturn true;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tif (key in target.props) {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: target.props[key]\n\t\t\t};\n\t\t}\n\t},\n\tdeleteProperty(target, key) {\n\t\t// Svelte 4 allowed for deletions on $$restProps\n\t\tif (target.exclude.includes(key)) return true;\n\t\ttarget.exclude.push(key);\n\t\tupdate(target.version);\n\t\treturn true;\n\t},\n\thas(target, key) {\n\t\tif (target.exclude.includes(key)) return false;\n\t\treturn key in target.props;\n\t},\n\townKeys(target) {\n\t\treturn Reflect.ownKeys(target.props).filter((key) => !target.exclude.includes(key));\n\t}\n};\n\n/**\n * @param {Record<string, unknown>} props\n * @param {string[]} exclude\n * @returns {Record<string, unknown>}\n */\nexport function legacy_rest_props(props, exclude) {\n\treturn new Proxy(\n\t\t{\n\t\t\tprops,\n\t\t\texclude,\n\t\t\tspecial: {},\n\t\t\tversion: source(0),\n\t\t\t// TODO this is only necessary because we need to track component\n\t\t\t// destruction inside `prop`, because of `bind:this`, but it\n\t\t\t// seems likely that we can simplify `bind:this` instead\n\t\t\tparent_effect: /** @type {Effect} */ (active_effect)\n\t\t},\n\t\tlegacy_rest_props_handler\n\t);\n}\n\n/**\n * The proxy handler for spread props. Handles the incoming array of props\n * that looks like `() => { dynamic: props }, { static: prop }, ..` and wraps\n * them so that the whole thing is passed to the component as the `$$props` argument.\n * @template {Record<string | symbol, unknown>} T\n * @type {ProxyHandler<{ props: Array<T | (() => T)> }>}}\n */\nconst spread_props_handler = {\n\tget(target, key) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (typeof p === 'object' && p !== null && key in p) return p[key];\n\t\t}\n\t},\n\tset(target, key, value) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tconst desc = get_descriptor(p, key);\n\t\t\tif (desc && desc.set) {\n\t\t\t\tdesc.set(value);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (typeof p === 'object' && p !== null && key in p) {\n\t\t\t\tconst descriptor = get_descriptor(p, key);\n\t\t\t\tif (descriptor && !descriptor.configurable) {\n\t\t\t\t\t// Prevent a \"Non-configurability Report Error\": The target is an array, it does\n\t\t\t\t\t// not actually contain this property. If it is now described as non-configurable,\n\t\t\t\t\t// the proxy throws a validation error. Setting it to true avoids that.\n\t\t\t\t\tdescriptor.configurable = true;\n\t\t\t\t}\n\t\t\t\treturn descriptor;\n\t\t\t}\n\t\t}\n\t},\n\thas(target, key) {\n\t\t// To prevent a false positive `is_entry_props` in the `prop` function\n\t\tif (key === STATE_SYMBOL || key === LEGACY_PROPS) return false;\n\n\t\tfor (let p of target.props) {\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (p != null && key in p) return true;\n\t\t}\n\n\t\treturn false;\n\t},\n\townKeys(target) {\n\t\t/** @type {Array<string | symbol>} */\n\t\tconst keys = [];\n\n\t\tfor (let p of target.props) {\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (!p) continue;\n\n\t\t\tfor (const key in p) {\n\t\t\t\tif (!keys.includes(key)) keys.push(key);\n\t\t\t}\n\n\t\t\tfor (const key of Object.getOwnPropertySymbols(p)) {\n\t\t\t\tif (!keys.includes(key)) keys.push(key);\n\t\t\t}\n\t\t}\n\n\t\treturn keys;\n\t}\n};\n\n/**\n * @param {Array<Record<string, unknown> | (() => Record<string, unknown>)>} props\n * @returns {any}\n */\nexport function spread_props(...props) {\n\treturn new Proxy({ props }, spread_props_handler);\n}\n\n/**\n * This function is responsible for synchronizing a possibly bound prop with the inner component state.\n * It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.\n * @template V\n * @param {Record<string, unknown>} props\n * @param {string} key\n * @param {number} flags\n * @param {V | (() => V)} [fallback]\n * @returns {(() => V | ((arg: V) => V) | ((arg: V, mutation: boolean) => V))}\n */\nexport function prop(props, key, flags, fallback) {\n\tvar runes = !legacy_mode_flag || (flags & PROPS_IS_RUNES) !== 0;\n\tvar bindable = (flags & PROPS_IS_BINDABLE) !== 0;\n\tvar lazy = (flags & PROPS_IS_LAZY_INITIAL) !== 0;\n\n\tvar fallback_value = /** @type {V} */ (fallback);\n\tvar fallback_dirty = true;\n\n\tvar get_fallback = () => {\n\t\tif (fallback_dirty) {\n\t\t\tfallback_dirty = false;\n\n\t\t\tfallback_value = lazy\n\t\t\t\t? untrack(/** @type {() => V} */ (fallback))\n\t\t\t\t: /** @type {V} */ (fallback);\n\t\t}\n\n\t\treturn fallback_value;\n\t};\n\n\t/** @type {((v: V) => void) | undefined} */\n\tvar setter;\n\n\tif (bindable) {\n\t\t// Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`\n\t\t// or `createClassComponent(Component, props)`\n\t\tvar is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props;\n\n\t\tsetter =\n\t\t\tget_descriptor(props, key)?.set ??\n\t\t\t(is_entry_props && key in props ? (v) => (props[key] = v) : undefined);\n\t}\n\n\tvar initial_value;\n\tvar is_store_sub = false;\n\n\tif (bindable) {\n\t\t[initial_value, is_store_sub] = capture_store_binding(() => /** @type {V} */ (props[key]));\n\t} else {\n\t\tinitial_value = /** @type {V} */ (props[key]);\n\t}\n\n\tif (initial_value === undefined && fallback !== undefined) {\n\t\tinitial_value = get_fallback();\n\n\t\tif (setter) {\n\t\t\tif (runes) e.props_invalid_value(key);\n\t\t\tsetter(initial_value);\n\t\t}\n\t}\n\n\t/** @type {() => V} */\n\tvar getter;\n\n\tif (runes) {\n\t\tgetter = () => {\n\t\t\tvar value = /** @type {V} */ (props[key]);\n\t\t\tif (value === undefined) return get_fallback();\n\t\t\tfallback_dirty = true;\n\t\t\treturn value;\n\t\t};\n\t} else {\n\t\tgetter = () => {\n\t\t\tvar value = /** @type {V} */ (props[key]);\n\n\t\t\tif (value !== undefined) {\n\t\t\t\t// in legacy mode, we don't revert to the fallback value\n\t\t\t\t// if the prop goes from defined to undefined. The easiest\n\t\t\t\t// way to model this is to make the fallback undefined\n\t\t\t\t// as soon as the prop has a value\n\t\t\t\tfallback_value = /** @type {V} */ (undefined);\n\t\t\t}\n\n\t\t\treturn value === undefined ? fallback_value : value;\n\t\t};\n\t}\n\n\t// prop is never written to — we only need a getter\n\tif (runes && (flags & PROPS_IS_UPDATED) === 0) {\n\t\treturn getter;\n\t}\n\n\t// prop is written to, but the parent component had `bind:foo` which\n\t// means we can just call `$$props.foo = value` directly\n\tif (setter) {\n\t\tvar legacy_parent = props.$$legacy;\n\n\t\treturn function (/** @type {any} */ value, /** @type {boolean} */ mutation) {\n\t\t\tif (arguments.length > 0) {\n\t\t\t\t// We don't want to notify if the value was mutated and the parent is in runes mode.\n\t\t\t\t// In that case the state proxy (if it exists) should take care of the notification.\n\t\t\t\t// If the parent is not in runes mode, we need to notify on mutation, too, that the prop\n\t\t\t\t// has changed because the parent will not be able to detect the change otherwise.\n\t\t\t\tif (!runes || !mutation || legacy_parent || is_store_sub) {\n\t\t\t\t\t/** @type {Function} */ (setter)(mutation ? getter() : value);\n\t\t\t\t}\n\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\treturn getter();\n\t\t};\n\t}\n\n\t// Either prop is written to, but there's no binding, which means we\n\t// create a derived that we can write to locally.\n\t// Or we are in legacy mode where we always create a derived to replicate that\n\t// Svelte 4 did not trigger updates when a primitive value was updated to the same value.\n\tvar overridden = false;\n\n\tvar d = ((flags & PROPS_IS_IMMUTABLE) !== 0 ? derived : derived_safe_equal)(() => {\n\t\toverridden = false;\n\t\treturn getter();\n\t});\n\n\tif (DEV) {\n\t\td.label = key;\n\t}\n\n\t// Capture the initial value if it's bindable\n\tif (bindable) get(d);\n\n\tvar parent_effect = /** @type {Effect} */ (active_effect);\n\n\treturn function (/** @type {any} */ value, /** @type {boolean} */ mutation) {\n\t\tif (arguments.length > 0) {\n\t\t\tconst new_value = mutation ? get(d) : runes && bindable ? proxy(value) : value;\n\n\t\t\tset(d, new_value);\n\t\t\toverridden = true;\n\n\t\t\tif (fallback_value !== undefined) {\n\t\t\t\tfallback_value = new_value;\n\t\t\t}\n\n\t\t\treturn value;\n\t\t}\n\n\t\t// special case — avoid recalculating the derived if we're in a\n\t\t// teardown function and the prop was overridden locally, or the\n\t\t// component was already destroyed (this latter part is necessary\n\t\t// because `bind:this` can read props after the component has\n\t\t// been destroyed. TODO simplify `bind:this`\n\t\tif ((is_destroying_effect && overridden) || (parent_effect.f & DESTROYED) !== 0) {\n\t\t\treturn d.v;\n\t\t}\n\n\t\treturn get(d);\n\t};\n}\n","/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */\nimport { DIRTY, LEGACY_PROPS, MAYBE_DIRTY } from '../internal/client/constants.js';\nimport { user_pre_effect } from '../internal/client/reactivity/effects.js';\nimport { mutable_source, set } from '../internal/client/reactivity/sources.js';\nimport { hydrate, mount, unmount } from '../internal/client/render.js';\nimport { active_effect, get, set_signal_status } from '../internal/client/runtime.js';\nimport { flushSync } from '../internal/client/reactivity/batch.js';\nimport { define_property, is_array } from '../internal/shared/utils.js';\nimport * as e from '../internal/client/errors.js';\nimport * as w from '../internal/client/warnings.js';\nimport { DEV } from 'esm-env';\nimport { FILENAME } from '../constants.js';\nimport { component_context, dev_current_component_function } from '../internal/client/context.js';\nimport { async_mode_flag } from '../internal/flags/index.js';\n\n/**\n * Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.\n *\n * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.\n *\n * @template {Record<string, any>} Props\n * @template {Record<string, any>} Exports\n * @template {Record<string, any>} Events\n * @template {Record<string, any>} Slots\n *\n * @param {ComponentConstructorOptions<Props> & {\n * \tcomponent: ComponentType<SvelteComponent<Props, Events, Slots>> | Component<Props>;\n * }} options\n * @returns {SvelteComponent<Props, Events, Slots> & Exports}\n */\nexport function createClassComponent(options) {\n\t// @ts-expect-error $$prop_def etc are not actually defined\n\treturn new Svelte4Component(options);\n}\n\n/**\n * Takes the component function and returns a Svelte 4 compatible component constructor.\n *\n * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.\n *\n * @template {Record<string, any>} Props\n * @template {Record<string, any>} Exports\n * @template {Record<string, any>} Events\n * @template {Record<string, any>} Slots\n *\n * @param {SvelteComponent<Props, Events, Slots> | Component<Props>} component\n * @returns {ComponentType<SvelteComponent<Props, Events, Slots> & Exports>}\n */\nexport function asClassComponent(component) {\n\t// @ts-expect-error $$prop_def etc are not actually defined\n\treturn class extends Svelte4Component {\n\t\t/** @param {any} options */\n\t\tconstructor(options) {\n\t\t\tsuper({\n\t\t\t\tcomponent,\n\t\t\t\t...options\n\t\t\t});\n\t\t}\n\t};\n}\n\n/**\n * Support using the component as both a class and function during the transition period\n * @typedef {{new (o: ComponentConstructorOptions): SvelteComponent;(...args: Parameters<Component<Record<string, any>>>): ReturnType<Component<Record<string, any>, Record<string, any>>>;}} LegacyComponentType\n */\n\nclass Svelte4Component {\n\t/** @type {any} */\n\t#events;\n\n\t/** @type {Record<string, any>} */\n\t#instance;\n\n\t/**\n\t * @param {ComponentConstructorOptions & {\n\t * component: any;\n\t * }} options\n\t */\n\tconstructor(options) {\n\t\tvar sources = new Map();\n\n\t\t/**\n\t\t * @param {string | symbol} key\n\t\t * @param {unknown} value\n\t\t */\n\t\tvar add_source = (key, value) => {\n\t\t\tvar s = mutable_source(value, false, false);\n\t\t\tsources.set(key, s);\n\t\t\treturn s;\n\t\t};\n\n\t\t// Replicate coarse-grained props through a proxy that has a version source for\n\t\t// each property, which is incremented on updates to the property itself. Do not\n\t\t// use our $state proxy because that one has fine-grained reactivity.\n\t\tconst props = new Proxy(\n\t\t\t{ ...(options.props || {}), $$events: {} },\n\t\t\t{\n\t\t\t\tget(target, prop) {\n\t\t\t\t\treturn get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));\n\t\t\t\t},\n\t\t\t\thas(target, prop) {\n\t\t\t\t\t// Necessary to not throw \"invalid binding\" validation errors on the component side\n\t\t\t\t\tif (prop === LEGACY_PROPS) return true;\n\n\t\t\t\t\tget(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));\n\t\t\t\t\treturn Reflect.has(target, prop);\n\t\t\t\t},\n\t\t\t\tset(target, prop, value) {\n\t\t\t\t\tset(sources.get(prop) ?? add_source(prop, value), value);\n\t\t\t\t\treturn Reflect.set(target, prop, value);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.#instance = (options.hydrate ? hydrate : mount)(options.component, {\n\t\t\ttarget: options.target,\n\t\t\tanchor: options.anchor,\n\t\t\tprops,\n\t\t\tcontext: options.context,\n\t\t\tintro: options.intro ?? false,\n\t\t\trecover: options.recover\n\t\t});\n\n\t\t// We don't flushSync for custom element wrappers or if the user doesn't want it,\n\t\t// or if we're in async mode since `flushSync()` will fail\n\t\tif (!async_mode_flag && (!options?.props?.$$host || options.sync === false)) {\n\t\t\tflushSync();\n\t\t}\n\n\t\tthis.#events = props.$$events;\n\n\t\tfor (const key of Object.keys(this.#instance)) {\n\t\t\tif (key === '$set' || key === '$destroy' || key === '$on') continue;\n\t\t\tdefine_property(this, key, {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#instance[key];\n\t\t\t\t},\n\t\t\t\t/** @param {any} value */\n\t\t\t\tset(value) {\n\t\t\t\t\tthis.#instance[key] = value;\n\t\t\t\t},\n\t\t\t\tenumerable: true\n\t\t\t});\n\t\t}\n\n\t\tthis.#instance.$set = /** @param {Record<string, any>} next */ (next) => {\n\t\t\tObject.assign(props, next);\n\t\t};\n\n\t\tthis.#instance.$destroy = () => {\n\t\t\tunmount(this.#instance);\n\t\t};\n\t}\n\n\t/** @param {Record<string, any>} props */\n\t$set(props) {\n\t\tthis.#instance.$set(props);\n\t}\n\n\t/**\n\t * @param {string} event\n\t * @param {(...args: any[]) => any} callback\n\t * @returns {any}\n\t */\n\t$on(event, callback) {\n\t\tthis.#events[event] = this.#events[event] || [];\n\n\t\t/** @param {any[]} args */\n\t\tconst cb = (...args) => callback.call(this, ...args);\n\t\tthis.#events[event].push(cb);\n\t\treturn () => {\n\t\t\tthis.#events[event] = this.#events[event].filter(/** @param {any} fn */ (fn) => fn !== cb);\n\t\t};\n\t}\n\n\t$destroy() {\n\t\tthis.#instance.$destroy();\n\t}\n}\n\n/**\n * Runs the given function once immediately on the server, and works like `$effect.pre` on the client.\n *\n * @deprecated Use this only as a temporary solution to migrate your component code to Svelte 5.\n * @param {() => void | (() => void)} fn\n * @returns {void}\n */\nexport function run(fn) {\n\tuser_pre_effect(() => {\n\t\tfn();\n\t\tvar effect = /** @type {import('#client').Effect} */ (active_effect);\n\t\t// If the effect is immediately made dirty again, mark it as maybe dirty to emulate legacy behaviour\n\t\tif ((effect.f & DIRTY) !== 0) {\n\t\t\tlet filename = \"a file (we can't know which one)\";\n\t\t\tif (DEV) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tfilename = dev_current_component_function?.[FILENAME] ?? filename;\n\t\t\t}\n\t\t\tw.legacy_recursive_reactive_block(filename);\n\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t}\n\t});\n}\n\n/**\n * Function to mimic the multiple listeners available in svelte 4\n * @deprecated\n * @param {EventListener[]} handlers\n * @returns {EventListener}\n */\nexport function handlers(...handlers) {\n\treturn function (event) {\n\t\tconst { stopImmediatePropagation } = event;\n\t\tlet stopped = false;\n\n\t\tevent.stopImmediatePropagation = () => {\n\t\t\tstopped = true;\n\t\t\tstopImmediatePropagation.call(event);\n\t\t};\n\n\t\tconst errors = [];\n\n\t\tfor (const handler of handlers) {\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error `this` is not typed\n\t\t\t\thandler?.call(this, event);\n\t\t\t} catch (e) {\n\t\t\t\terrors.push(e);\n\t\t\t}\n\n\t\t\tif (stopped) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tfor (let error of errors) {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthrow error;\n\t\t\t});\n\t\t}\n\t};\n}\n\n/**\n * Function to create a `bubble` function that mimic the behavior of `on:click` without handler available in svelte 4.\n * @deprecated Use this only as a temporary solution to migrate your automatically delegated events in Svelte 5.\n */\nexport function createBubbler() {\n\tconst active_component_context = component_context;\n\tif (active_component_context === null) {\n\t\te.lifecycle_outside_component('createBubbler');\n\t}\n\n\treturn (/**@type {string}*/ type) => (/**@type {Event}*/ event) => {\n\t\tconst events = /** @type {Record<string, Function | Function[]>} */ (\n\t\t\tactive_component_context.s.$$events\n\t\t)?.[/** @type {any} */ (type)];\n\n\t\tif (events) {\n\t\t\tconst callbacks = is_array(events) ? events.slice() : [events];\n\t\t\tfor (const fn of callbacks) {\n\t\t\t\tfn.call(active_component_context.x, event);\n\t\t\t}\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\t\treturn true;\n\t};\n}\n\nexport {\n\tonce,\n\tpreventDefault,\n\tself,\n\tstopImmediatePropagation,\n\tstopPropagation,\n\ttrusted,\n\tpassive,\n\tnonpassive\n} from '../internal/client/dom/legacy/event-modifiers.js';\n","import { createClassComponent } from '../../../../legacy/legacy-client.js';\nimport { effect_root, render_effect } from '../../reactivity/effects.js';\nimport { append } from '../template.js';\nimport { define_property, get_descriptor, object_keys } from '../../../shared/utils.js';\n\n/**\n * @typedef {Object} CustomElementPropDefinition\n * @property {string} [attribute]\n * @property {boolean} [reflect]\n * @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type]\n */\n\n/** @type {any} */\nlet SvelteElement;\n\nif (typeof HTMLElement === 'function') {\n\tSvelteElement = class extends HTMLElement {\n\t\t/** The Svelte component constructor */\n\t\t$$ctor;\n\t\t/** Slots */\n\t\t$$s;\n\t\t/** @type {any} The Svelte component instance */\n\t\t$$c;\n\t\t/** Whether or not the custom element is connected */\n\t\t$$cn = false;\n\t\t/** @type {Record<string, any>} Component props data */\n\t\t$$d = {};\n\t\t/** `true` if currently in the process of reflecting component props back to attributes */\n\t\t$$r = false;\n\t\t/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */\n\t\t$$p_d = {};\n\t\t/** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */\n\t\t$$l = {};\n\t\t/** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */\n\t\t$$l_u = new Map();\n\t\t/** @type {any} The managed render effect for reflecting attributes */\n\t\t$$me;\n\n\t\t/**\n\t\t * @param {*} $$componentCtor\n\t\t * @param {*} $$slots\n\t\t * @param {*} use_shadow_dom\n\t\t */\n\t\tconstructor($$componentCtor, $$slots, use_shadow_dom) {\n\t\t\tsuper();\n\t\t\tthis.$$ctor = $$componentCtor;\n\t\t\tthis.$$s = $$slots;\n\t\t\tif (use_shadow_dom) {\n\t\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @param {string} type\n\t\t * @param {EventListenerOrEventListenerObject} listener\n\t\t * @param {boolean | AddEventListenerOptions} [options]\n\t\t */\n\t\taddEventListener(type, listener, options) {\n\t\t\t// We can't determine upfront if the event is a custom event or not, so we have to\n\t\t\t// listen to both. If someone uses a custom event with the same name as a regular\n\t\t\t// browser event, this fires twice - we can't avoid that.\n\t\t\tthis.$$l[type] = this.$$l[type] || [];\n\t\t\tthis.$$l[type].push(listener);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t}\n\t\t\tsuper.addEventListener(type, listener, options);\n\t\t}\n\n\t\t/**\n\t\t * @param {string} type\n\t\t * @param {EventListenerOrEventListenerObject} listener\n\t\t * @param {boolean | AddEventListenerOptions} [options]\n\t\t */\n\t\tremoveEventListener(type, listener, options) {\n\t\t\tsuper.removeEventListener(type, listener, options);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$l_u.get(listener);\n\t\t\t\tif (unsub) {\n\t\t\t\t\tunsub();\n\t\t\t\t\tthis.$$l_u.delete(listener);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync connectedCallback() {\n\t\t\tthis.$$cn = true;\n\t\t\tif (!this.$$c) {\n\t\t\t\t// We wait one tick to let possible child slot elements be created/mounted\n\t\t\t\tawait Promise.resolve();\n\t\t\t\tif (!this.$$cn || this.$$c) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t/** @param {string} name */\n\t\t\t\tfunction create_slot(name) {\n\t\t\t\t\t/**\n\t\t\t\t\t * @param {Element} anchor\n\t\t\t\t\t */\n\t\t\t\t\treturn (anchor) => {\n\t\t\t\t\t\tconst slot = document.createElement('slot');\n\t\t\t\t\t\tif (name !== 'default') slot.name = name;\n\n\t\t\t\t\t\tappend(anchor, slot);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t/** @type {Record<string, any>} */\n\t\t\t\tconst $$slots = {};\n\t\t\t\tconst existing_slots = get_custom_elements_slots(this);\n\t\t\t\tfor (const name of this.$$s) {\n\t\t\t\t\tif (name in existing_slots) {\n\t\t\t\t\t\tif (name === 'default' && !this.$$d.children) {\n\t\t\t\t\t\t\tthis.$$d.children = create_slot(name);\n\t\t\t\t\t\t\t$$slots.default = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$$slots[name] = create_slot(name);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const attribute of this.attributes) {\n\t\t\t\t\t// this.$$data takes precedence over this.attributes\n\t\t\t\t\tconst name = this.$$g_p(attribute.name);\n\t\t\t\t\tif (!(name in this.$$d)) {\n\t\t\t\t\t\tthis.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, 'toProp');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Port over props that were set programmatically before ce was initialized\n\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\tif (!(key in this.$$d) && this[key] !== undefined) {\n\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\tthis.$$d[key] = this[key]; // don't transform, these were set through JavaScript\n\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\tdelete this[key]; // remove the property that shadows the getter/setter\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$c = createClassComponent({\n\t\t\t\t\tcomponent: this.$$ctor,\n\t\t\t\t\ttarget: this.shadowRoot || this,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...this.$$d,\n\t\t\t\t\t\t$$slots,\n\t\t\t\t\t\t$$host: this\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Reflect component props as attributes\n\t\t\t\tthis.$$me = effect_root(() => {\n\t\t\t\t\trender_effect(() => {\n\t\t\t\t\t\tthis.$$r = true;\n\t\t\t\t\t\tfor (const key of object_keys(this.$$c)) {\n\t\t\t\t\t\t\tif (!this.$$p_d[key]?.reflect) continue;\n\t\t\t\t\t\t\tthis.$$d[key] = this.$$c[key];\n\t\t\t\t\t\t\tconst attribute_value = get_custom_element_value(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tthis.$$d[key],\n\t\t\t\t\t\t\t\tthis.$$p_d,\n\t\t\t\t\t\t\t\t'toAttribute'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (attribute_value == null) {\n\t\t\t\t\t\t\t\tthis.removeAttribute(this.$$p_d[key].attribute || key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.setAttribute(this.$$p_d[key].attribute || key, attribute_value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.$$r = false;\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tfor (const type in this.$$l) {\n\t\t\t\t\tfor (const listener of this.$$l[type]) {\n\t\t\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$l = {};\n\t\t\t}\n\t\t}\n\n\t\t// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte\n\t\t// and setting attributes through setAttribute etc, this is helpful\n\n\t\t/**\n\t\t * @param {string} attr\n\t\t * @param {string} _oldValue\n\t\t * @param {string} newValue\n\t\t */\n\t\tattributeChangedCallback(attr, _oldValue, newValue) {\n\t\t\tif (this.$$r) return;\n\t\t\tattr = this.$$g_p(attr);\n\t\t\tthis.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, 'toProp');\n\t\t\tthis.$$c?.$set({ [attr]: this.$$d[attr] });\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.$$cn = false;\n\t\t\t// In a microtask, because this could be a move within the DOM\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (!this.$$cn && this.$$c) {\n\t\t\t\t\tthis.$$c.$destroy();\n\t\t\t\t\tthis.$$me();\n\t\t\t\t\tthis.$$c = undefined;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * @param {string} attribute_name\n\t\t */\n\t\t$$g_p(attribute_name) {\n\t\t\treturn (\n\t\t\t\tobject_keys(this.$$p_d).find(\n\t\t\t\t\t(key) =>\n\t\t\t\t\t\tthis.$$p_d[key].attribute === attribute_name ||\n\t\t\t\t\t\t(!this.$$p_d[key].attribute && key.toLowerCase() === attribute_name)\n\t\t\t\t) || attribute_name\n\t\t\t);\n\t\t}\n\t};\n}\n\n/**\n * @param {string} prop\n * @param {any} value\n * @param {Record<string, CustomElementPropDefinition>} props_definition\n * @param {'toAttribute' | 'toProp'} [transform]\n */\nfunction get_custom_element_value(prop, value, props_definition, transform) {\n\tconst type = props_definition[prop]?.type;\n\tvalue = type === 'Boolean' && typeof value !== 'boolean' ? value != null : value;\n\tif (!transform || !props_definition[prop]) {\n\t\treturn value;\n\t} else if (transform === 'toAttribute') {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value == null ? null : JSON.stringify(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value ? '' : null;\n\t\t\tcase 'Number':\n\t\t\t\treturn value == null ? null : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value && JSON.parse(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value; // conversion already handled above\n\t\t\tcase 'Number':\n\t\t\t\treturn value != null ? +value : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t}\n}\n\n/**\n * @param {HTMLElement} element\n */\nfunction get_custom_elements_slots(element) {\n\t/** @type {Record<string, true>} */\n\tconst result = {};\n\telement.childNodes.forEach((node) => {\n\t\tresult[/** @type {Element} node */ (node).slot || 'default'] = true;\n\t});\n\treturn result;\n}\n\n/**\n * @internal\n *\n * Turn a Svelte component into a custom element.\n * @param {any} Component A Svelte component function\n * @param {Record<string, CustomElementPropDefinition>} props_definition The props to observe\n * @param {string[]} slots The slots to create\n * @param {string[]} exports Explicitly exported values, other than props\n * @param {boolean} use_shadow_dom Whether to use shadow DOM\n * @param {(ce: new () => HTMLElement) => new () => HTMLElement} [extend]\n */\nexport function create_custom_element(\n\tComponent,\n\tprops_definition,\n\tslots,\n\texports,\n\tuse_shadow_dom,\n\textend\n) {\n\tlet Class = class extends SvelteElement {\n\t\tconstructor() {\n\t\t\tsuper(Component, slots, use_shadow_dom);\n\t\t\tthis.$$p_d = props_definition;\n\t\t}\n\t\tstatic get observedAttributes() {\n\t\t\treturn object_keys(props_definition).map((key) =>\n\t\t\t\t(props_definition[key].attribute || key).toLowerCase()\n\t\t\t);\n\t\t}\n\t};\n\tobject_keys(props_definition).forEach((prop) => {\n\t\tdefine_property(Class.prototype, prop, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c && prop in this.$$c ? this.$$c[prop] : this.$$d[prop];\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\tvalue = get_custom_element_value(prop, value, props_definition);\n\t\t\t\tthis.$$d[prop] = value;\n\t\t\t\tvar component = this.$$c;\n\n\t\t\t\tif (component) {\n\t\t\t\t\t// // If the instance has an accessor, use that instead\n\t\t\t\t\tvar setter = get_descriptor(component, prop)?.get;\n\n\t\t\t\t\tif (setter) {\n\t\t\t\t\t\tcomponent[prop] = value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcomponent.$set({ [prop]: value });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\texports.forEach((property) => {\n\t\tdefine_property(Class.prototype, property, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c?.[property];\n\t\t\t}\n\t\t});\n\t});\n\tif (extend) {\n\t\t// @ts-expect-error - assigning here is fine\n\t\tClass = extend(Class);\n\t}\n\tComponent.element = /** @type {any} */ Class;\n\treturn Class;\n}\n","export default function cc(names) {\n if (typeof names === \"string\" || typeof names === \"number\") return \"\" + names\n\n let out = \"\"\n\n if (Array.isArray(names)) {\n for (let i = 0, tmp; i < names.length; i++) {\n if ((tmp = cc(names[i])) !== \"\") {\n out += (out && \" \") + tmp\n }\n }\n } else {\n for (let k in names) {\n if (names[k]) out += (out && \" \") + k\n }\n }\n\n return out\n}\n","var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n","import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don’t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n return function() {\n return array(select.apply(this, arguments));\n };\n}\n\nexport default function(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nexport function childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\n","import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nexport default function(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nexport default function(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nexport default function(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn’t worried about “live” collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don’t; we’d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n return typeof data === \"object\" && \"length\" in data\n ? data // Array, TypedArray, NodeList, array-like\n : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n if (typeof onenter === \"function\") {\n enter = onenter(enter);\n if (enter) enter = enter.selection();\n } else {\n enter = enter.append(onenter + \"\");\n }\n if (onupdate != null) {\n update = onupdate(update);\n if (update) update = update.selection();\n }\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(context) {\n var selection = context.selection ? context.selection() : context;\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import creator from \"../creator.js\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","function contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n","import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","export default function*() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n","import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n","import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","export default function(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n","import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\n}\n","// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, nonpassivecapture);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n","export default x => () => x;\n","export default function DragEvent(type, {\n sourceEvent,\n subject,\n target,\n identifier,\n active,\n x, y, dx, dy,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n subject: {value: subject, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n identifier: {value: identifier, enumerable: true, configurable: true},\n active: {value: active, enumerable: true, configurable: true},\n x: {value: x, enumerable: true, configurable: true},\n y: {value: y, enumerable: true, configurable: true},\n dx: {value: dx, enumerable: true, configurable: true},\n dy: {value: dy, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n","import {dispatch} from \"d3-dispatch\";\nimport {select, pointer} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag.js\";\nimport noevent, {nonpassive, nonpassivecapture, nopropagation} from \"./noevent.js\";\nimport constant from \"./constant.js\";\nimport DragEvent from \"./event.js\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(event, d) {\n return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nexport default function() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n touchable = defaultTouchable,\n gestures = {},\n listeners = dispatch(\"start\", \"drag\", \"end\"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on(\"mousedown.drag\", mousedowned)\n .filter(touchable)\n .on(\"touchstart.drag\", touchstarted)\n .on(\"touchmove.drag\", touchmoved, nonpassive)\n .on(\"touchend.drag touchcancel.drag\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n function mousedowned(event, d) {\n if (touchending || !filter.call(this, event, d)) return;\n var gesture = beforestart(this, container.call(this, event, d), event, d, \"mouse\");\n if (!gesture) return;\n select(event.view)\n .on(\"mousemove.drag\", mousemoved, nonpassivecapture)\n .on(\"mouseup.drag\", mouseupped, nonpassivecapture);\n nodrag(event.view);\n nopropagation(event);\n mousemoving = false;\n mousedownx = event.clientX;\n mousedowny = event.clientY;\n gesture(\"start\", event);\n }\n\n function mousemoved(event) {\n noevent(event);\n if (!mousemoving) {\n var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse(\"drag\", event);\n }\n\n function mouseupped(event) {\n select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n yesdrag(event.view, mousemoving);\n noevent(event);\n gestures.mouse(\"end\", event);\n }\n\n function touchstarted(event, d) {\n if (!filter.call(this, event, d)) return;\n var touches = event.changedTouches,\n c = container.call(this, event, d),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) {\n nopropagation(event);\n gesture(\"start\", event, touches[i]);\n }\n }\n }\n\n function touchmoved(event) {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent(event);\n gesture(\"drag\", event, touches[i]);\n }\n }\n }\n\n function touchended(event) {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation(event);\n gesture(\"end\", event, touches[i]);\n }\n }\n }\n\n function beforestart(that, container, event, d, identifier, touch) {\n var dispatch = listeners.copy(),\n p = pointer(touch || event, container), dx, dy,\n s;\n\n if ((s = subject.call(that, new DragEvent(\"beforestart\", {\n sourceEvent: event,\n target: drag,\n identifier,\n active,\n x: p[0],\n y: p[1],\n dx: 0,\n dy: 0,\n dispatch\n }), d)) == null) return;\n\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n\n return function gesture(type, event, touch) {\n var p0 = p, n;\n switch (type) {\n case \"start\": gestures[identifier] = gesture, n = active++; break;\n case \"end\": delete gestures[identifier], --active; // falls through\n case \"drag\": p = pointer(touch || event, container), n = active; break;\n }\n dispatch.call(\n type,\n that,\n new DragEvent(type, {\n sourceEvent: event,\n subject: s,\n target: drag,\n identifier,\n active: n,\n x: p[0] + dx,\n y: p[1] + dy,\n dx: p[0] - p0[0],\n dy: p[1] - p0[1],\n dispatch\n }),\n d\n );\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n };\n\n drag.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nexport default function(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n","function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n","import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n selectChild: selection_prototype.selectChild,\n selectChildren: selection_prototype.selectChildren,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","export default x => () => x;\n","export default function ZoomEvent(type, {\n sourceEvent,\n target,\n transform,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n transform: {value: transform, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n","export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n","export function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolateZoom} from \"d3-interpolate\";\nimport {select, pointer} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport ZoomEvent from \"./event.js\";\nimport {Transform, identity} from \"./transform.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\n// Ignore right-click, since that should open the context menu.\n// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event\nfunction defaultFilter(event) {\n return (!event.ctrlKey || event.type === 'wheel') && !event.button;\n}\n\nfunction defaultExtent() {\n var e = this;\n if (e instanceof SVGElement) {\n e = e.ownerSVGElement || e;\n if (e.hasAttribute(\"viewBox\")) {\n e = e.viewBox.baseVal;\n return [[e.x, e.y], [e.x + e.width, e.y + e.height]];\n }\n return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];\n }\n return [[0, 0], [e.clientWidth, e.clientHeight]];\n}\n\nfunction defaultTransform() {\n return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta(event) {\n return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1);\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n return transform.translate(\n dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n );\n}\n\nexport default function() {\n var filter = defaultFilter,\n extent = defaultExtent,\n constrain = defaultConstrain,\n wheelDelta = defaultWheelDelta,\n touchable = defaultTouchable,\n scaleExtent = [0, Infinity],\n translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n duration = 250,\n interpolate = interpolateZoom,\n listeners = dispatch(\"start\", \"zoom\", \"end\"),\n touchstarting,\n touchfirst,\n touchending,\n touchDelay = 500,\n wheelDelay = 150,\n clickDistance2 = 0,\n tapDistance = 10;\n\n function zoom(selection) {\n selection\n .property(\"__zoom\", defaultTransform)\n .on(\"wheel.zoom\", wheeled, {passive: false})\n .on(\"mousedown.zoom\", mousedowned)\n .on(\"dblclick.zoom\", dblclicked)\n .filter(touchable)\n .on(\"touchstart.zoom\", touchstarted)\n .on(\"touchmove.zoom\", touchmoved)\n .on(\"touchend.zoom touchcancel.zoom\", touchended)\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n zoom.transform = function(collection, transform, point, event) {\n var selection = collection.selection ? collection.selection() : collection;\n selection.property(\"__zoom\", defaultTransform);\n if (collection !== selection) {\n schedule(collection, transform, point, event);\n } else {\n selection.interrupt().each(function() {\n gesture(this, arguments)\n .event(event)\n .start()\n .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n .end();\n });\n }\n };\n\n zoom.scaleBy = function(selection, k, p, event) {\n zoom.scaleTo(selection, function() {\n var k0 = this.__zoom.k,\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return k0 * k1;\n }, p, event);\n };\n\n zoom.scaleTo = function(selection, k, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t0 = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p,\n p1 = t0.invert(p0),\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n }, p, event);\n };\n\n zoom.translateBy = function(selection, x, y, event) {\n zoom.transform(selection, function() {\n return constrain(this.__zoom.translate(\n typeof x === \"function\" ? x.apply(this, arguments) : x,\n typeof y === \"function\" ? y.apply(this, arguments) : y\n ), extent.apply(this, arguments), translateExtent);\n }, null, event);\n };\n\n zoom.translateTo = function(selection, x, y, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p;\n return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(\n typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n typeof y === \"function\" ? -y.apply(this, arguments) : -y\n ), e, translateExtent);\n }, p, event);\n };\n\n function scale(transform, k) {\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n }\n\n function translate(transform, p0, p1) {\n var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n }\n\n function centroid(extent) {\n return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n }\n\n function schedule(transition, transform, point, event) {\n transition\n .on(\"start.zoom\", function() { gesture(this, arguments).event(event).start(); })\n .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).event(event).end(); })\n .tween(\"zoom\", function() {\n var that = this,\n args = arguments,\n g = gesture(that, args).event(event),\n e = extent.apply(that, args),\n p = point == null ? centroid(e) : typeof point === \"function\" ? point.apply(that, args) : point,\n w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n a = that.__zoom,\n b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n return function(t) {\n if (t === 1) t = b; // Avoid rounding error on end.\n else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n g.zoom(null, t);\n };\n });\n }\n\n function gesture(that, args, clean) {\n return (!clean && that.__zooming) || new Gesture(that, args);\n }\n\n function Gesture(that, args) {\n this.that = that;\n this.args = args;\n this.active = 0;\n this.sourceEvent = null;\n this.extent = extent.apply(that, args);\n this.taps = 0;\n }\n\n Gesture.prototype = {\n event: function(event) {\n if (event) this.sourceEvent = event;\n return this;\n },\n start: function() {\n if (++this.active === 1) {\n this.that.__zooming = this;\n this.emit(\"start\");\n }\n return this;\n },\n zoom: function(key, transform) {\n if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n this.that.__zoom = transform;\n this.emit(\"zoom\");\n return this;\n },\n end: function() {\n if (--this.active === 0) {\n delete this.that.__zooming;\n this.emit(\"end\");\n }\n return this;\n },\n emit: function(type) {\n var d = select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new ZoomEvent(type, {\n sourceEvent: this.sourceEvent,\n target: zoom,\n type,\n transform: this.that.__zoom,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function wheeled(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var g = gesture(this, args).event(event),\n t = this.__zoom,\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n p = pointer(event);\n\n // If the mouse is in the same location as before, reuse it.\n // If there were recent wheel events, reset the wheel idle timeout.\n if (g.wheel) {\n if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n g.mouse[1] = t.invert(g.mouse[0] = p);\n }\n clearTimeout(g.wheel);\n }\n\n // If this wheel event won’t trigger a transform change, ignore it.\n else if (t.k === k) return;\n\n // Otherwise, capture the mouse point and location at the start.\n else {\n g.mouse = [p, t.invert(p)];\n interrupt(this);\n g.start();\n }\n\n noevent(event);\n g.wheel = setTimeout(wheelidled, wheelDelay);\n g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n function wheelidled() {\n g.wheel = null;\n g.end();\n }\n }\n\n function mousedowned(event, ...args) {\n if (touchending || !filter.apply(this, arguments)) return;\n var currentTarget = event.currentTarget,\n g = gesture(this, args, true).event(event),\n v = select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n p = pointer(event, currentTarget),\n x0 = event.clientX,\n y0 = event.clientY;\n\n dragDisable(event.view);\n nopropagation(event);\n g.mouse = [p, this.__zoom.invert(p)];\n interrupt(this);\n g.start();\n\n function mousemoved(event) {\n noevent(event);\n if (!g.moved) {\n var dx = event.clientX - x0, dy = event.clientY - y0;\n g.moved = dx * dx + dy * dy > clickDistance2;\n }\n g.event(event)\n .zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));\n }\n\n function mouseupped(event) {\n v.on(\"mousemove.zoom mouseup.zoom\", null);\n dragEnable(event.view, g.moved);\n noevent(event);\n g.event(event).end();\n }\n }\n\n function dblclicked(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var t0 = this.__zoom,\n p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this),\n p1 = t0.invert(p0),\n k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);\n\n noevent(event);\n if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0, event);\n else select(this).call(zoom.transform, t1, p0, event);\n }\n\n function touchstarted(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var touches = event.touches,\n n = touches.length,\n g = gesture(this, args, event.changedTouches.length === n).event(event),\n started, i, t, p;\n\n nopropagation(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n p = [p, this.__zoom.invert(p), t.identifier];\n if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;\n else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;\n }\n\n if (touchstarting) touchstarting = clearTimeout(touchstarting);\n\n if (started) {\n if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n interrupt(this);\n g.start();\n }\n }\n\n function touchmoved(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t, p, l;\n\n noevent(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n }\n t = g.that.__zoom;\n if (g.touch1) {\n var p0 = g.touch0[0], l0 = g.touch0[1],\n p1 = g.touch1[0], l1 = g.touch1[1],\n dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n t = scale(t, Math.sqrt(dp / dl));\n p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n }\n else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n else return;\n\n g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n }\n\n function touchended(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t;\n\n nopropagation(event);\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, touchDelay);\n for (i = 0; i < n; ++i) {\n t = touches[i];\n if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n }\n if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n else {\n g.end();\n // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.\n if (g.taps === 2) {\n t = pointer(t, this);\n if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {\n var p = select(this).on(\"dblclick.zoom\");\n if (p) p.apply(this, arguments);\n }\n }\n }\n }\n\n zoom.wheelDelta = function(_) {\n return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n };\n\n zoom.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n };\n\n zoom.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n };\n\n zoom.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n };\n\n zoom.scaleExtent = function(_) {\n return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n };\n\n zoom.translateExtent = function(_) {\n return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n };\n\n zoom.constrain = function(_) {\n return arguments.length ? (constrain = _, zoom) : constrain;\n };\n\n zoom.duration = function(_) {\n return arguments.length ? (duration = +_, zoom) : duration;\n };\n\n zoom.interpolate = function(_) {\n return arguments.length ? (interpolate = _, zoom) : interpolate;\n };\n\n zoom.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? zoom : value;\n };\n\n zoom.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n };\n\n zoom.tapDistance = function(_) {\n return arguments.length ? (tapDistance = +_, zoom) : tapDistance;\n };\n\n return zoom;\n}\n","import { drag } from 'd3-drag';\nimport { select, pointer } from 'd3-selection';\nimport { zoom, zoomIdentity, zoomTransform } from 'd3-zoom';\n\nconst errorMessages = {\n error001: () => '[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001',\n error002: () => \"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.\",\n error003: (nodeType) => `Node type \"${nodeType}\" not found. Using fallback type \"default\".`,\n error004: () => 'The React Flow parent container needs a width and a height to render the graph.',\n error005: () => 'Only child nodes can use a parent extent.',\n error006: () => \"Can't create edge. An edge needs a source and a target.\",\n error007: (id) => `The old edge with id=${id} does not exist.`,\n error009: (type) => `Marker type \"${type}\" doesn't exist.`,\n error008: (handleType, { id, sourceHandle, targetHandle }) => `Couldn't create edge for ${handleType} handle id: \"${handleType === 'source' ? sourceHandle : targetHandle}\", edge id: ${id}.`,\n error010: () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.',\n error011: (edgeType) => `Edge type \"${edgeType}\" not found. Using fallback type \"default\".`,\n error012: (id) => `Node with id \"${id}\" does not exist, it may have been removed. This can happen when a node is deleted before the \"onNodeClick\" handler is called.`,\n error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`,\n error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.',\n error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.',\n};\nconst infiniteExtent = [\n [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n];\nconst elementSelectionKeys = ['Enter', ' ', 'Escape'];\n\n/**\n * The `ConnectionMode` is used to set the mode of connection between nodes.\n * The `Strict` mode is the default one and only allows source to target edges.\n * `Loose` mode allows source to source and target to target edges as well.\n *\n * @public\n */\nvar ConnectionMode;\n(function (ConnectionMode) {\n ConnectionMode[\"Strict\"] = \"strict\";\n ConnectionMode[\"Loose\"] = \"loose\";\n})(ConnectionMode || (ConnectionMode = {}));\n/**\n * This enum is used to set the different modes of panning the viewport when the\n * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling\n * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict\n * scroll panning to only the vertical or horizontal axis, respectively.\n *\n * @public\n */\nvar PanOnScrollMode;\n(function (PanOnScrollMode) {\n PanOnScrollMode[\"Free\"] = \"free\";\n PanOnScrollMode[\"Vertical\"] = \"vertical\";\n PanOnScrollMode[\"Horizontal\"] = \"horizontal\";\n})(PanOnScrollMode || (PanOnScrollMode = {}));\nvar SelectionMode;\n(function (SelectionMode) {\n SelectionMode[\"Partial\"] = \"partial\";\n SelectionMode[\"Full\"] = \"full\";\n})(SelectionMode || (SelectionMode = {}));\nconst initialConnection = {\n inProgress: false,\n isValid: null,\n from: null,\n fromHandle: null,\n fromPosition: null,\n fromNode: null,\n to: null,\n toHandle: null,\n toPosition: null,\n toNode: null,\n};\n\n/**\n * If you set the `connectionLineType` prop on your [`<ReactFlow />`](/api-reference/react-flow#connection-connectionLineType)\n *component, it will dictate the style of connection line rendered when creating\n *new edges.\n *\n * @public\n *\n * @remarks If you choose to render a custom connection line component, this value will be\n *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props).\n */\nvar ConnectionLineType;\n(function (ConnectionLineType) {\n ConnectionLineType[\"Bezier\"] = \"default\";\n ConnectionLineType[\"Straight\"] = \"straight\";\n ConnectionLineType[\"Step\"] = \"step\";\n ConnectionLineType[\"SmoothStep\"] = \"smoothstep\";\n ConnectionLineType[\"SimpleBezier\"] = \"simplebezier\";\n})(ConnectionLineType || (ConnectionLineType = {}));\n/**\n * Edges may optionally have a marker on either end. The MarkerType type enumerates\n * the options available to you when configuring a given marker.\n *\n * @public\n */\nvar MarkerType;\n(function (MarkerType) {\n MarkerType[\"Arrow\"] = \"arrow\";\n MarkerType[\"ArrowClosed\"] = \"arrowclosed\";\n})(MarkerType || (MarkerType = {}));\n\n/**\n * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a\n * component in the corners of a container, the `Position` enum is less precise and used\n * primarily in relation to edges and handles.\n *\n * @public\n */\nvar Position;\n(function (Position) {\n Position[\"Left\"] = \"left\";\n Position[\"Top\"] = \"top\";\n Position[\"Right\"] = \"right\";\n Position[\"Bottom\"] = \"bottom\";\n})(Position || (Position = {}));\nconst oppositePosition = {\n [Position.Left]: Position.Right,\n [Position.Right]: Position.Left,\n [Position.Top]: Position.Bottom,\n [Position.Bottom]: Position.Top,\n};\n\n/**\n * @internal\n */\nfunction areConnectionMapsEqual(a, b) {\n if (!a && !b) {\n return true;\n }\n if (!a || !b || a.size !== b.size) {\n return false;\n }\n if (!a.size && !b.size) {\n return true;\n }\n for (const key of a.keys()) {\n if (!b.has(key)) {\n return false;\n }\n }\n return true;\n}\n/**\n * We call the callback for all connections in a that are not in b\n *\n * @internal\n */\nfunction handleConnectionChange(a, b, cb) {\n if (!cb) {\n return;\n }\n const diff = [];\n a.forEach((connection, key) => {\n if (!b?.has(key)) {\n diff.push(connection);\n }\n });\n if (diff.length) {\n cb(diff);\n }\n}\nfunction getConnectionStatus(isValid) {\n return isValid === null ? null : isValid ? 'valid' : 'invalid';\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Test whether an object is usable as an Edge\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Edge\n */\nconst isEdgeBase = (element) => 'id' in element && 'source' in element && 'target' in element;\n/**\n * Test whether an object is usable as a Node\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Node\n */\nconst isNodeBase = (element) => 'id' in element && 'position' in element && !('source' in element) && !('target' in element);\nconst isInternalNodeBase = (element) => 'id' in element && 'internals' in element && !('source' in element) && !('target' in element);\n/**\n * This util is used to tell you what nodes, if any, are connected to the given node\n * as the _target_ of an edge.\n * @public\n * @param node - The node to get the connected nodes from.\n * @param nodes - The array of all nodes.\n * @param edges - The array of all edges.\n * @returns An array of nodes that are connected over edges where the source is the given node.\n *\n * @example\n * ```ts\n *import { getOutgoers } from '@xyflow/react';\n *\n *const nodes = [];\n *const edges = [];\n *\n *const outgoers = getOutgoers(\n * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },\n * nodes,\n * edges,\n *);\n *```\n */\nconst getOutgoers = (node, nodes, edges) => {\n if (!node.id) {\n return [];\n }\n const outgoerIds = new Set();\n edges.forEach((edge) => {\n if (edge.source === node.id) {\n outgoerIds.add(edge.target);\n }\n });\n return nodes.filter((n) => outgoerIds.has(n.id));\n};\n/**\n * This util is used to tell you what nodes, if any, are connected to the given node\n * as the _source_ of an edge.\n * @public\n * @param node - The node to get the connected nodes from.\n * @param nodes - The array of all nodes.\n * @param edges - The array of all edges.\n * @returns An array of nodes that are connected over edges where the target is the given node.\n *\n * @example\n * ```ts\n *import { getIncomers } from '@xyflow/react';\n *\n *const nodes = [];\n *const edges = [];\n *\n *const incomers = getIncomers(\n * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },\n * nodes,\n * edges,\n *);\n *```\n */\nconst getIncomers = (node, nodes, edges) => {\n if (!node.id) {\n return [];\n }\n const incomersIds = new Set();\n edges.forEach((edge) => {\n if (edge.target === node.id) {\n incomersIds.add(edge.source);\n }\n });\n return nodes.filter((n) => incomersIds.has(n.id));\n};\nconst getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {\n const { width, height } = getNodeDimensions(node);\n const origin = node.origin ?? nodeOrigin;\n const offsetX = width * origin[0];\n const offsetY = height * origin[1];\n return {\n x: node.position.x - offsetX,\n y: node.position.y - offsetY,\n };\n};\n/**\n * Returns the bounding box that contains all the given nodes in an array. This can\n * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds)\n * to calculate the correct transform to fit the given nodes in a viewport.\n * @public\n * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport.\n * @param nodes - Nodes to calculate the bounds for.\n * @returns Bounding box enclosing all nodes.\n *\n * @remarks This function was previously called `getRectOfNodes`\n *\n * @example\n * ```js\n *import { getNodesBounds } from '@xyflow/react';\n *\n *const nodes = [\n * {\n * id: 'a',\n * position: { x: 0, y: 0 },\n * data: { label: 'a' },\n * width: 50,\n * height: 25,\n * },\n * {\n * id: 'b',\n * position: { x: 100, y: 100 },\n * data: { label: 'b' },\n * width: 50,\n * height: 25,\n * },\n *];\n *\n *const bounds = getNodesBounds(nodes);\n *```\n */\nconst getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => {\n if (process.env.NODE_ENV === 'development' && !params.nodeLookup) {\n console.warn('Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.');\n }\n if (nodes.length === 0) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n const box = nodes.reduce((currBox, nodeOrId) => {\n const isId = typeof nodeOrId === 'string';\n let currentNode = !params.nodeLookup && !isId ? nodeOrId : undefined;\n if (params.nodeLookup) {\n currentNode = isId\n ? params.nodeLookup.get(nodeOrId)\n : !isInternalNodeBase(nodeOrId)\n ? params.nodeLookup.get(nodeOrId.id)\n : nodeOrId;\n }\n const nodeBox = currentNode ? nodeToBox(currentNode, params.nodeOrigin) : { x: 0, y: 0, x2: 0, y2: 0 };\n return getBoundsOfBoxes(currBox, nodeBox);\n }, { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity });\n return boxToRect(box);\n};\n/**\n * Determines a bounding box that contains all given nodes in an array\n * @internal\n */\nconst getInternalNodesBounds = (nodeLookup, params = {}) => {\n if (nodeLookup.size === 0) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n let box = { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity };\n nodeLookup.forEach((node) => {\n if (params.filter === undefined || params.filter(node)) {\n const nodeBox = nodeToBox(node);\n box = getBoundsOfBoxes(box, nodeBox);\n }\n });\n return boxToRect(box);\n};\nconst getNodesInside = (nodes, rect, [tx, ty, tScale] = [0, 0, 1], partially = false, \n// set excludeNonSelectableNodes if you want to pay attention to the nodes \"selectable\" attribute\nexcludeNonSelectableNodes = false) => {\n const paneRect = {\n ...pointToRendererPoint(rect, [tx, ty, tScale]),\n width: rect.width / tScale,\n height: rect.height / tScale,\n };\n const visibleNodes = [];\n for (const node of nodes.values()) {\n const { measured, selectable = true, hidden = false } = node;\n if ((excludeNonSelectableNodes && !selectable) || hidden) {\n continue;\n }\n const width = measured.width ?? node.width ?? node.initialWidth ?? null;\n const height = measured.height ?? node.height ?? node.initialHeight ?? null;\n const overlappingArea = getOverlappingArea(paneRect, nodeToRect(node));\n const area = (width ?? 0) * (height ?? 0);\n const partiallyVisible = partially && overlappingArea > 0;\n const forceInitialRender = !node.internals.handleBounds;\n const isVisible = forceInitialRender || partiallyVisible || overlappingArea >= area;\n if (isVisible || node.dragging) {\n visibleNodes.push(node);\n }\n }\n return visibleNodes;\n};\n/**\n * This utility filters an array of edges, keeping only those where either the source or target\n * node is present in the given array of nodes.\n * @public\n * @param nodes - Nodes you want to get the connected edges for.\n * @param edges - All edges.\n * @returns Array of edges that connect any of the given nodes with each other.\n *\n * @example\n * ```js\n *import { getConnectedEdges } from '@xyflow/react';\n *\n *const nodes = [\n * { id: 'a', position: { x: 0, y: 0 } },\n * { id: 'b', position: { x: 100, y: 0 } },\n *];\n *\n *const edges = [\n * { id: 'a->c', source: 'a', target: 'c' },\n * { id: 'c->d', source: 'c', target: 'd' },\n *];\n *\n *const connectedEdges = getConnectedEdges(nodes, edges);\n * // => [{ id: 'a->c', source: 'a', target: 'c' }]\n *```\n */\nconst getConnectedEdges = (nodes, edges) => {\n const nodeIds = new Set();\n nodes.forEach((node) => {\n nodeIds.add(node.id);\n });\n return edges.filter((edge) => nodeIds.has(edge.source) || nodeIds.has(edge.target));\n};\nfunction getFitViewNodes(nodeLookup, options) {\n const fitViewNodes = new Map();\n const optionNodeIds = options?.nodes ? new Set(options.nodes.map((node) => node.id)) : null;\n nodeLookup.forEach((n) => {\n const isVisible = n.measured.width && n.measured.height && (options?.includeHiddenNodes || !n.hidden);\n if (isVisible && (!optionNodeIds || optionNodeIds.has(n.id))) {\n fitViewNodes.set(n.id, n);\n }\n });\n return fitViewNodes;\n}\nasync function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) {\n if (nodes.size === 0) {\n return Promise.resolve(true);\n }\n const nodesToFit = getFitViewNodes(nodes, options);\n const bounds = getInternalNodesBounds(nodesToFit);\n const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);\n await panZoom.setViewport(viewport, { duration: options?.duration });\n return Promise.resolve(true);\n}\n/**\n * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin.\n *\n * @internal\n * @returns position, positionAbsolute\n */\nfunction calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin = [0, 0], nodeExtent, onError, }) {\n const node = nodeLookup.get(nodeId);\n const parentNode = node.parentId ? nodeLookup.get(node.parentId) : undefined;\n const { x: parentX, y: parentY } = parentNode ? parentNode.internals.positionAbsolute : { x: 0, y: 0 };\n const origin = node.origin ?? nodeOrigin;\n let extent = nodeExtent;\n if (node.extent === 'parent' && !node.expandParent) {\n if (!parentNode) {\n onError?.('005', errorMessages['error005']());\n }\n else {\n const parentWidth = parentNode.measured.width;\n const parentHeight = parentNode.measured.height;\n if (parentWidth && parentHeight) {\n extent = [\n [parentX, parentY],\n [parentX + parentWidth, parentY + parentHeight],\n ];\n }\n }\n }\n else if (parentNode && isCoordinateExtent(node.extent)) {\n extent = [\n [node.extent[0][0] + parentX, node.extent[0][1] + parentY],\n [node.extent[1][0] + parentX, node.extent[1][1] + parentY],\n ];\n }\n const positionAbsolute = isCoordinateExtent(extent)\n ? clampPosition(nextPosition, extent, node.measured)\n : nextPosition;\n if (node.measured.width === undefined || node.measured.height === undefined) {\n onError?.('015', errorMessages['error015']());\n }\n return {\n position: {\n x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0],\n y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1],\n },\n positionAbsolute,\n };\n}\n/**\n * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted\n * @internal\n * @param param.nodesToRemove - The nodes to remove\n * @param param.edgesToRemove - The edges to remove\n * @param param.nodes - All nodes\n * @param param.edges - All edges\n * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted\n * @returns nodes: nodes that can be deleted, edges: edges that can be deleted\n */\nasync function getElementsToRemove({ nodesToRemove = [], edgesToRemove = [], nodes, edges, onBeforeDelete, }) {\n const nodeIds = new Set(nodesToRemove.map((node) => node.id));\n const matchingNodes = [];\n for (const node of nodes) {\n if (node.deletable === false) {\n continue;\n }\n const isIncluded = nodeIds.has(node.id);\n const parentHit = !isIncluded && node.parentId && matchingNodes.find((n) => n.id === node.parentId);\n if (isIncluded || parentHit) {\n matchingNodes.push(node);\n }\n }\n const edgeIds = new Set(edgesToRemove.map((edge) => edge.id));\n const deletableEdges = edges.filter((edge) => edge.deletable !== false);\n const connectedEdges = getConnectedEdges(matchingNodes, deletableEdges);\n const matchingEdges = connectedEdges;\n for (const edge of deletableEdges) {\n const isIncluded = edgeIds.has(edge.id);\n if (isIncluded && !matchingEdges.find((e) => e.id === edge.id)) {\n matchingEdges.push(edge);\n }\n }\n if (!onBeforeDelete) {\n return {\n edges: matchingEdges,\n nodes: matchingNodes,\n };\n }\n const onBeforeDeleteResult = await onBeforeDelete({\n nodes: matchingNodes,\n edges: matchingEdges,\n });\n if (typeof onBeforeDeleteResult === 'boolean') {\n return onBeforeDeleteResult ? { edges: matchingEdges, nodes: matchingNodes } : { edges: [], nodes: [] };\n }\n return onBeforeDeleteResult;\n}\n\nconst clamp = (val, min = 0, max = 1) => Math.min(Math.max(val, min), max);\nconst clampPosition = (position = { x: 0, y: 0 }, extent, dimensions) => ({\n x: clamp(position.x, extent[0][0], extent[1][0] - (dimensions?.width ?? 0)),\n y: clamp(position.y, extent[0][1], extent[1][1] - (dimensions?.height ?? 0)),\n});\nfunction clampPositionToParent(childPosition, childDimensions, parent) {\n const { width: parentWidth, height: parentHeight } = getNodeDimensions(parent);\n const { x: parentX, y: parentY } = parent.internals.positionAbsolute;\n return clampPosition(childPosition, [\n [parentX, parentY],\n [parentX + parentWidth, parentY + parentHeight],\n ], childDimensions);\n}\n/**\n * Calculates the velocity of panning when the mouse is close to the edge of the canvas\n * @internal\n * @param value - One dimensional poition of the mouse (x or y)\n * @param min - Minimal position on canvas before panning starts\n * @param max - Maximal position on canvas before panning starts\n * @returns - A number between 0 and 1 that represents the velocity of panning\n */\nconst calcAutoPanVelocity = (value, min, max) => {\n if (value < min) {\n return clamp(Math.abs(value - min), 1, min) / min;\n }\n else if (value > max) {\n return -clamp(Math.abs(value - max), 1, min) / min;\n }\n return 0;\n};\nconst calcAutoPan = (pos, bounds, speed = 15, distance = 40) => {\n const xMovement = calcAutoPanVelocity(pos.x, distance, bounds.width - distance) * speed;\n const yMovement = calcAutoPanVelocity(pos.y, distance, bounds.height - distance) * speed;\n return [xMovement, yMovement];\n};\nconst getBoundsOfBoxes = (box1, box2) => ({\n x: Math.min(box1.x, box2.x),\n y: Math.min(box1.y, box2.y),\n x2: Math.max(box1.x2, box2.x2),\n y2: Math.max(box1.y2, box2.y2),\n});\nconst rectToBox = ({ x, y, width, height }) => ({\n x,\n y,\n x2: x + width,\n y2: y + height,\n});\nconst boxToRect = ({ x, y, x2, y2 }) => ({\n x,\n y,\n width: x2 - x,\n height: y2 - y,\n});\nconst nodeToRect = (node, nodeOrigin = [0, 0]) => {\n const { x, y } = isInternalNodeBase(node)\n ? node.internals.positionAbsolute\n : getNodePositionWithOrigin(node, nodeOrigin);\n return {\n x,\n y,\n width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,\n height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,\n };\n};\nconst nodeToBox = (node, nodeOrigin = [0, 0]) => {\n const { x, y } = isInternalNodeBase(node)\n ? node.internals.positionAbsolute\n : getNodePositionWithOrigin(node, nodeOrigin);\n return {\n x,\n y,\n x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0),\n y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0),\n };\n};\nconst getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2)));\nconst getOverlappingArea = (rectA, rectB) => {\n const xOverlap = Math.max(0, Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - Math.max(rectA.x, rectB.x));\n const yOverlap = Math.max(0, Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - Math.max(rectA.y, rectB.y));\n return Math.ceil(xOverlap * yOverlap);\n};\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isRectObject = (obj) => isNumeric(obj.width) && isNumeric(obj.height) && isNumeric(obj.x) && isNumeric(obj.y);\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nconst isNumeric = (n) => !isNaN(n) && isFinite(n);\n// used for a11y key board controls for nodes and edges\nconst devWarn = (id, message) => {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`[React Flow]: ${message} Help: https://reactflow.dev/error#${id}`);\n }\n};\nconst snapPosition = (position, snapGrid = [1, 1]) => {\n return {\n x: snapGrid[0] * Math.round(position.x / snapGrid[0]),\n y: snapGrid[1] * Math.round(position.y / snapGrid[1]),\n };\n};\nconst pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = false, snapGrid = [1, 1]) => {\n const position = {\n x: (x - tx) / tScale,\n y: (y - ty) / tScale,\n };\n return snapToGrid ? snapPosition(position, snapGrid) : position;\n};\nconst rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {\n return {\n x: x * tScale + tx,\n y: y * tScale + ty,\n };\n};\n/**\n * Parses a single padding value to a number\n * @internal\n * @param padding - Padding to parse\n * @param viewport - Width or height of the viewport\n * @returns The padding in pixels\n */\nfunction parsePadding(padding, viewport) {\n if (typeof padding === 'number') {\n return Math.floor((viewport - viewport / (1 + padding)) * 0.5);\n }\n if (typeof padding === 'string' && padding.endsWith('px')) {\n const paddingValue = parseFloat(padding);\n if (!Number.isNaN(paddingValue)) {\n return Math.floor(paddingValue);\n }\n }\n if (typeof padding === 'string' && padding.endsWith('%')) {\n const paddingValue = parseFloat(padding);\n if (!Number.isNaN(paddingValue)) {\n return Math.floor(viewport * paddingValue * 0.01);\n }\n }\n console.error(`[React Flow] The padding value \"${padding}\" is invalid. Please provide a number or a string with a valid unit (px or %).`);\n return 0;\n}\n/**\n * Parses the paddings to an object with top, right, bottom, left, x and y paddings\n * @internal\n * @param padding - Padding to parse\n * @param width - Width of the viewport\n * @param height - Height of the viewport\n * @returns An object with the paddings in pixels\n */\nfunction parsePaddings(padding, width, height) {\n if (typeof padding === 'string' || typeof padding === 'number') {\n const paddingY = parsePadding(padding, height);\n const paddingX = parsePadding(padding, width);\n return {\n top: paddingY,\n right: paddingX,\n bottom: paddingY,\n left: paddingX,\n x: paddingX * 2,\n y: paddingY * 2,\n };\n }\n if (typeof padding === 'object') {\n const top = parsePadding(padding.top ?? padding.y ?? 0, height);\n const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);\n const left = parsePadding(padding.left ?? padding.x ?? 0, width);\n const right = parsePadding(padding.right ?? padding.x ?? 0, width);\n return { top, right, bottom, left, x: left + right, y: top + bottom };\n }\n return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };\n}\n/**\n * Calculates the resulting paddings if the new viewport is applied\n * @internal\n * @param bounds - Bounds to fit inside viewport\n * @param x - X position of the viewport\n * @param y - Y position of the viewport\n * @param zoom - Zoom level of the viewport\n * @param width - Width of the viewport\n * @param height - Height of the viewport\n * @returns An object with the minimum padding required to fit the bounds inside the viewport\n */\nfunction calculateAppliedPaddings(bounds, x, y, zoom, width, height) {\n const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]);\n const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]);\n const right = width - boundRight;\n const bottom = height - boundBottom;\n return {\n left: Math.floor(left),\n top: Math.floor(top),\n right: Math.floor(right),\n bottom: Math.floor(bottom),\n };\n}\n/**\n * Returns a viewport that encloses the given bounds with padding.\n * @public\n * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects}\n * @param bounds - Bounds to fit inside viewport.\n * @param width - Width of the viewport.\n * @param height - Height of the viewport.\n * @param minZoom - Minimum zoom level of the resulting viewport.\n * @param maxZoom - Maximum zoom level of the resulting viewport.\n * @param padding - Padding around the bounds.\n * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}.\n * @example\n * const { x, y, zoom } = getViewportForBounds(\n * { x: 0, y: 0, width: 100, height: 100},\n * 1200, 800, 0.5, 2);\n */\nconst getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {\n // First we resolve all the paddings to actual pixel values\n const p = parsePaddings(padding, width, height);\n const xZoom = (width - p.x) / bounds.width;\n const yZoom = (height - p.y) / bounds.height;\n // We calculate the new x, y, zoom for a centered view\n const zoom = Math.min(xZoom, yZoom);\n const clampedZoom = clamp(zoom, minZoom, maxZoom);\n const boundsCenterX = bounds.x + bounds.width / 2;\n const boundsCenterY = bounds.y + bounds.height / 2;\n const x = width / 2 - boundsCenterX * clampedZoom;\n const y = height / 2 - boundsCenterY * clampedZoom;\n // Then we calculate the minimum padding, to respect asymmetric paddings\n const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height);\n // We only want to have an offset if the newPadding is smaller than the required padding\n const offset = {\n left: Math.min(newPadding.left - p.left, 0),\n top: Math.min(newPadding.top - p.top, 0),\n right: Math.min(newPadding.right - p.right, 0),\n bottom: Math.min(newPadding.bottom - p.bottom, 0),\n };\n return {\n x: x - offset.left + offset.right,\n y: y - offset.top + offset.bottom,\n zoom: clampedZoom,\n };\n};\nconst isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;\nfunction isCoordinateExtent(extent) {\n return extent !== undefined && extent !== 'parent';\n}\nfunction getNodeDimensions(node) {\n return {\n width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,\n height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,\n };\n}\nfunction nodeHasDimensions(node) {\n return ((node.measured?.width ?? node.width ?? node.initialWidth) !== undefined &&\n (node.measured?.height ?? node.height ?? node.initialHeight) !== undefined);\n}\n/**\n * Convert child position to aboslute position\n *\n * @internal\n * @param position\n * @param parentId\n * @param nodeLookup\n * @param nodeOrigin\n * @returns an internal node with an absolute position\n */\nfunction evaluateAbsolutePosition(position, dimensions = { width: 0, height: 0 }, parentId, nodeLookup, nodeOrigin) {\n const positionAbsolute = { ...position };\n const parent = nodeLookup.get(parentId);\n if (parent) {\n const origin = parent.origin || nodeOrigin;\n positionAbsolute.x += parent.internals.positionAbsolute.x - (dimensions.width ?? 0) * origin[0];\n positionAbsolute.y += parent.internals.positionAbsolute.y - (dimensions.height ?? 0) * origin[1];\n }\n return positionAbsolute;\n}\nfunction areSetsEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Polyfill for Promise.withResolvers until we can use it in all browsers\n * @internal\n */\nfunction withResolvers() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n}\n\nfunction getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = false, transform, containerBounds }) {\n const { x, y } = getEventPosition(event);\n const pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform);\n const { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;\n // we need the snapped position in order to be able to skip unnecessary drag events\n return {\n xSnapped,\n ySnapped,\n ...pointerPos,\n };\n}\nconst getDimensions = (node) => ({\n width: node.offsetWidth,\n height: node.offsetHeight,\n});\nconst getHostForElement = (element) => element?.getRootNode?.() || window?.document;\nconst inputTags = ['INPUT', 'SELECT', 'TEXTAREA'];\nfunction isInputDOMNode(event) {\n // using composed path for handling shadow dom\n const target = (event.composedPath?.()?.[0] || event.target);\n if (target?.nodeType !== 1 /* Node.ELEMENT_NODE */)\n return false;\n const isInput = inputTags.includes(target.nodeName) || target.hasAttribute('contenteditable');\n // when an input field is focused we don't want to trigger deletion or movement of nodes\n return isInput || !!target.closest('.nokey');\n}\nconst isMouseEvent = (event) => 'clientX' in event;\nconst getEventPosition = (event, bounds) => {\n const isMouse = isMouseEvent(event);\n const evtX = isMouse ? event.clientX : event.touches?.[0].clientX;\n const evtY = isMouse ? event.clientY : event.touches?.[0].clientY;\n return {\n x: evtX - (bounds?.left ?? 0),\n y: evtY - (bounds?.top ?? 0),\n };\n};\n/*\n * The handle bounds are calculated relative to the node element.\n * We store them in the internals object of the node in order to avoid\n * unnecessary recalculations.\n */\nconst getHandleBounds = (type, nodeElement, nodeBounds, zoom, nodeId) => {\n const handles = nodeElement.querySelectorAll(`.${type}`);\n if (!handles || !handles.length) {\n return null;\n }\n return Array.from(handles).map((handle) => {\n const handleBounds = handle.getBoundingClientRect();\n return {\n id: handle.getAttribute('data-handleid'),\n type,\n nodeId,\n position: handle.getAttribute('data-handlepos'),\n x: (handleBounds.left - nodeBounds.left) / zoom,\n y: (handleBounds.top - nodeBounds.top) / zoom,\n ...getDimensions(handle),\n };\n });\n};\n\nfunction getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }) {\n /*\n * cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate\n * https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve\n */\n const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125;\n const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125;\n const offsetX = Math.abs(centerX - sourceX);\n const offsetY = Math.abs(centerY - sourceY);\n return [centerX, centerY, offsetX, offsetY];\n}\nfunction calculateControlOffset(distance, curvature) {\n if (distance >= 0) {\n return 0.5 * distance;\n }\n return curvature * 25 * Math.sqrt(-distance);\n}\nfunction getControlWithCurvature({ pos, x1, y1, x2, y2, c }) {\n switch (pos) {\n case Position.Left:\n return [x1 - calculateControlOffset(x1 - x2, c), y1];\n case Position.Right:\n return [x1 + calculateControlOffset(x2 - x1, c), y1];\n case Position.Top:\n return [x1, y1 - calculateControlOffset(y1 - y2, c)];\n case Position.Bottom:\n return [x1, y1 + calculateControlOffset(y2 - y1, c)];\n }\n}\n/**\n * The `getBezierPath` util returns everything you need to render a bezier edge\n *between two nodes.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n * const source = { x: 0, y: 20 };\n * const target = { x: 150, y: 100 };\n *\n * const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({\n * sourceX: source.x,\n * sourceY: source.y,\n * sourcePosition: Position.Right,\n * targetX: target.x,\n * targetY: target.y,\n * targetPosition: Position.Left,\n *});\n *```\n *\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to\n *work with multiple edge paths at once.\n */\nfunction getBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, curvature = 0.25, }) {\n const [sourceControlX, sourceControlY] = getControlWithCurvature({\n pos: sourcePosition,\n x1: sourceX,\n y1: sourceY,\n x2: targetX,\n y2: targetY,\n c: curvature,\n });\n const [targetControlX, targetControlY] = getControlWithCurvature({\n pos: targetPosition,\n x1: targetX,\n y1: targetY,\n x2: sourceX,\n y2: sourceY,\n c: curvature,\n });\n const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourceControlX,\n sourceControlY,\n targetControlX,\n targetControlY,\n });\n return [\n `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n labelX,\n labelY,\n offsetX,\n offsetY,\n ];\n}\n\n// this is used for straight edges and simple smoothstep edges (LTR, RTL, BTT, TTB)\nfunction getEdgeCenter({ sourceX, sourceY, targetX, targetY, }) {\n const xOffset = Math.abs(targetX - sourceX) / 2;\n const centerX = targetX < sourceX ? targetX + xOffset : targetX - xOffset;\n const yOffset = Math.abs(targetY - sourceY) / 2;\n const centerY = targetY < sourceY ? targetY + yOffset : targetY - yOffset;\n return [centerX, centerY, xOffset, yOffset];\n}\nfunction getElevatedEdgeZIndex({ sourceNode, targetNode, selected = false, zIndex = 0, elevateOnSelect = false, }) {\n if (!elevateOnSelect) {\n return zIndex;\n }\n const edgeOrConnectedNodeSelected = selected || targetNode.selected || sourceNode.selected;\n const selectedZIndex = Math.max(sourceNode.internals.z || 0, targetNode.internals.z || 0, 1000);\n return zIndex + (edgeOrConnectedNodeSelected ? selectedZIndex : 0);\n}\nfunction isEdgeVisible({ sourceNode, targetNode, width, height, transform }) {\n const edgeBox = getBoundsOfBoxes(nodeToBox(sourceNode), nodeToBox(targetNode));\n if (edgeBox.x === edgeBox.x2) {\n edgeBox.x2 += 1;\n }\n if (edgeBox.y === edgeBox.y2) {\n edgeBox.y2 += 1;\n }\n const viewRect = {\n x: -transform[0] / transform[2],\n y: -transform[1] / transform[2],\n width: width / transform[2],\n height: height / transform[2],\n };\n return getOverlappingArea(viewRect, boxToRect(edgeBox)) > 0;\n}\nconst getEdgeId = ({ source, sourceHandle, target, targetHandle }) => `xy-edge__${source}${sourceHandle || ''}-${target}${targetHandle || ''}`;\nconst connectionExists = (edge, edges) => {\n return edges.some((el) => el.source === edge.source &&\n el.target === edge.target &&\n (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle)) &&\n (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle)));\n};\n/**\n * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one.\n * @public\n * @param edgeParams - Either an `Edge` or a `Connection` you want to add.\n * @param edges - The array of all current edges.\n * @returns A new array of edges with the new edge added.\n *\n * @remarks If an edge with the same `target` and `source` already exists (and the same\n *`targetHandle` and `sourceHandle` if those are set), then this util won't add\n *a new edge even if the `id` property is different.\n *\n */\nconst addEdge = (edgeParams, edges) => {\n if (!edgeParams.source || !edgeParams.target) {\n devWarn('006', errorMessages['error006']());\n return edges;\n }\n let edge;\n if (isEdgeBase(edgeParams)) {\n edge = { ...edgeParams };\n }\n else {\n edge = {\n ...edgeParams,\n id: getEdgeId(edgeParams),\n };\n }\n if (connectionExists(edge, edges)) {\n return edges;\n }\n if (edge.sourceHandle === null) {\n delete edge.sourceHandle;\n }\n if (edge.targetHandle === null) {\n delete edge.targetHandle;\n }\n return edges.concat(edge);\n};\n/**\n * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties.\n *This searches your edge array for an edge with a matching `id` and updates its\n *properties with the connection you provide.\n * @public\n * @param oldEdge - The edge you want to update.\n * @param newConnection - The new connection you want to update the edge with.\n * @param edges - The array of all current edges.\n * @returns The updated edges array.\n *\n * @example\n * ```js\n *const onReconnect = useCallback(\n * (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]);\n *```\n */\nconst reconnectEdge = (oldEdge, newConnection, edges, options = { shouldReplaceId: true }) => {\n const { id: oldEdgeId, ...rest } = oldEdge;\n if (!newConnection.source || !newConnection.target) {\n devWarn('006', errorMessages['error006']());\n return edges;\n }\n const foundEdge = edges.find((e) => e.id === oldEdge.id);\n if (!foundEdge) {\n devWarn('007', errorMessages['error007'](oldEdgeId));\n return edges;\n }\n // Remove old edge and create the new edge with parameters of old edge.\n const edge = {\n ...rest,\n id: options.shouldReplaceId ? getEdgeId(newConnection) : oldEdgeId,\n source: newConnection.source,\n target: newConnection.target,\n sourceHandle: newConnection.sourceHandle,\n targetHandle: newConnection.targetHandle,\n };\n return edges.filter((e) => e.id !== oldEdgeId).concat(edge);\n};\n\n/**\n * Calculates the straight line path between two points.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n *\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n * const source = { x: 0, y: 20 };\n * const target = { x: 150, y: 100 };\n *\n * const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({\n * sourceX: source.x,\n * sourceY: source.y,\n * sourcePosition: Position.Right,\n * targetX: target.x,\n * targetY: target.y,\n * targetPosition: Position.Left,\n * });\n * ```\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.\n */\nfunction getStraightPath({ sourceX, sourceY, targetX, targetY, }) {\n const [labelX, labelY, offsetX, offsetY] = getEdgeCenter({\n sourceX,\n sourceY,\n targetX,\n targetY,\n });\n return [`M ${sourceX},${sourceY}L ${targetX},${targetY}`, labelX, labelY, offsetX, offsetY];\n}\n\nconst handleDirections = {\n [Position.Left]: { x: -1, y: 0 },\n [Position.Right]: { x: 1, y: 0 },\n [Position.Top]: { x: 0, y: -1 },\n [Position.Bottom]: { x: 0, y: 1 },\n};\nconst getDirection = ({ source, sourcePosition = Position.Bottom, target, }) => {\n if (sourcePosition === Position.Left || sourcePosition === Position.Right) {\n return source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 };\n }\n return source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 };\n};\nconst distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));\n/*\n * With this function we try to mimic an orthogonal edge routing behaviour\n * It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges\n */\nfunction getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, }) {\n const sourceDir = handleDirections[sourcePosition];\n const targetDir = handleDirections[targetPosition];\n const sourceGapped = { x: source.x + sourceDir.x * offset, y: source.y + sourceDir.y * offset };\n const targetGapped = { x: target.x + targetDir.x * offset, y: target.y + targetDir.y * offset };\n const dir = getDirection({\n source: sourceGapped,\n sourcePosition,\n target: targetGapped,\n });\n const dirAccessor = dir.x !== 0 ? 'x' : 'y';\n const currDir = dir[dirAccessor];\n let points = [];\n let centerX, centerY;\n const sourceGapOffset = { x: 0, y: 0 };\n const targetGapOffset = { x: 0, y: 0 };\n const [defaultCenterX, defaultCenterY, defaultOffsetX, defaultOffsetY] = getEdgeCenter({\n sourceX: source.x,\n sourceY: source.y,\n targetX: target.x,\n targetY: target.y,\n });\n // opposite handle positions, default case\n if (sourceDir[dirAccessor] * targetDir[dirAccessor] === -1) {\n centerX = center.x ?? defaultCenterX;\n centerY = center.y ?? defaultCenterY;\n /*\n * --->\n * |\n * >---\n */\n const verticalSplit = [\n { x: centerX, y: sourceGapped.y },\n { x: centerX, y: targetGapped.y },\n ];\n /*\n * |\n * ---\n * |\n */\n const horizontalSplit = [\n { x: sourceGapped.x, y: centerY },\n { x: targetGapped.x, y: centerY },\n ];\n if (sourceDir[dirAccessor] === currDir) {\n points = dirAccessor === 'x' ? verticalSplit : horizontalSplit;\n }\n else {\n points = dirAccessor === 'x' ? horizontalSplit : verticalSplit;\n }\n }\n else {\n // sourceTarget means we take x from source and y from target, targetSource is the opposite\n const sourceTarget = [{ x: sourceGapped.x, y: targetGapped.y }];\n const targetSource = [{ x: targetGapped.x, y: sourceGapped.y }];\n // this handles edges with same handle positions\n if (dirAccessor === 'x') {\n points = sourceDir.x === currDir ? targetSource : sourceTarget;\n }\n else {\n points = sourceDir.y === currDir ? sourceTarget : targetSource;\n }\n if (sourcePosition === targetPosition) {\n const diff = Math.abs(source[dirAccessor] - target[dirAccessor]);\n // if an edge goes from right to right for example (sourcePosition === targetPosition) and the distance between source.x and target.x is less than the offset, the added point and the gapped source/target will overlap. This leads to a weird edge path. To avoid this we add a gapOffset to the source/target\n if (diff <= offset) {\n const gapOffset = Math.min(offset - 1, offset - diff);\n if (sourceDir[dirAccessor] === currDir) {\n sourceGapOffset[dirAccessor] = (sourceGapped[dirAccessor] > source[dirAccessor] ? -1 : 1) * gapOffset;\n }\n else {\n targetGapOffset[dirAccessor] = (targetGapped[dirAccessor] > target[dirAccessor] ? -1 : 1) * gapOffset;\n }\n }\n }\n // these are conditions for handling mixed handle positions like Right -> Bottom for example\n if (sourcePosition !== targetPosition) {\n const dirAccessorOpposite = dirAccessor === 'x' ? 'y' : 'x';\n const isSameDir = sourceDir[dirAccessor] === targetDir[dirAccessorOpposite];\n const sourceGtTargetOppo = sourceGapped[dirAccessorOpposite] > targetGapped[dirAccessorOpposite];\n const sourceLtTargetOppo = sourceGapped[dirAccessorOpposite] < targetGapped[dirAccessorOpposite];\n const flipSourceTarget = (sourceDir[dirAccessor] === 1 && ((!isSameDir && sourceGtTargetOppo) || (isSameDir && sourceLtTargetOppo))) ||\n (sourceDir[dirAccessor] !== 1 && ((!isSameDir && sourceLtTargetOppo) || (isSameDir && sourceGtTargetOppo)));\n if (flipSourceTarget) {\n points = dirAccessor === 'x' ? sourceTarget : targetSource;\n }\n }\n const sourceGapPoint = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };\n const targetGapPoint = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };\n const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x));\n const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y));\n // we want to place the label on the longest segment of the edge\n if (maxXDistance >= maxYDistance) {\n centerX = (sourceGapPoint.x + targetGapPoint.x) / 2;\n centerY = points[0].y;\n }\n else {\n centerX = points[0].x;\n centerY = (sourceGapPoint.y + targetGapPoint.y) / 2;\n }\n }\n const pathPoints = [\n source,\n { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y },\n ...points,\n { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y },\n target,\n ];\n return [pathPoints, centerX, centerY, defaultOffsetX, defaultOffsetY];\n}\nfunction getBend(a, b, c, size) {\n const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size);\n const { x, y } = b;\n // no bend\n if ((a.x === x && x === c.x) || (a.y === y && y === c.y)) {\n return `L${x} ${y}`;\n }\n // first segment is horizontal\n if (a.y === y) {\n const xDir = a.x < c.x ? -1 : 1;\n const yDir = a.y < c.y ? 1 : -1;\n return `L ${x + bendSize * xDir},${y}Q ${x},${y} ${x},${y + bendSize * yDir}`;\n }\n const xDir = a.x < c.x ? 1 : -1;\n const yDir = a.y < c.y ? -1 : 1;\n return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`;\n}\n/**\n * The `getSmoothStepPath` util returns everything you need to render a stepped path\n * between two nodes. The `borderRadius` property can be used to choose how rounded\n * the corners of those steps are.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n *\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n * const source = { x: 0, y: 20 };\n * const target = { x: 150, y: 100 };\n *\n * const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({\n * sourceX: source.x,\n * sourceY: source.y,\n * sourcePosition: Position.Right,\n * targetX: target.x,\n * targetY: target.y,\n * targetPosition: Position.Left,\n * });\n * ```\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.\n */\nfunction getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius = 5, centerX, centerY, offset = 20, }) {\n const [points, labelX, labelY, offsetX, offsetY] = getPoints({\n source: { x: sourceX, y: sourceY },\n sourcePosition,\n target: { x: targetX, y: targetY },\n targetPosition,\n center: { x: centerX, y: centerY },\n offset,\n });\n const path = points.reduce((res, p, i) => {\n let segment = '';\n if (i > 0 && i < points.length - 1) {\n segment = getBend(points[i - 1], p, points[i + 1], borderRadius);\n }\n else {\n segment = `${i === 0 ? 'M' : 'L'}${p.x} ${p.y}`;\n }\n res += segment;\n return res;\n }, '');\n return [path, labelX, labelY, offsetX, offsetY];\n}\n\nfunction isNodeInitialized(node) {\n return (node &&\n !!(node.internals.handleBounds || node.handles?.length) &&\n !!(node.measured.width || node.width || node.initialWidth));\n}\nfunction getEdgePosition(params) {\n const { sourceNode, targetNode } = params;\n if (!isNodeInitialized(sourceNode) || !isNodeInitialized(targetNode)) {\n return null;\n }\n const sourceHandleBounds = sourceNode.internals.handleBounds || toHandleBounds(sourceNode.handles);\n const targetHandleBounds = targetNode.internals.handleBounds || toHandleBounds(targetNode.handles);\n const sourceHandle = getHandle$1(sourceHandleBounds?.source ?? [], params.sourceHandle);\n const targetHandle = getHandle$1(\n // when connection type is loose we can define all handles as sources and connect source -> source\n params.connectionMode === ConnectionMode.Strict\n ? targetHandleBounds?.target ?? []\n : (targetHandleBounds?.target ?? []).concat(targetHandleBounds?.source ?? []), params.targetHandle);\n if (!sourceHandle || !targetHandle) {\n params.onError?.('008', errorMessages['error008'](!sourceHandle ? 'source' : 'target', {\n id: params.id,\n sourceHandle: params.sourceHandle,\n targetHandle: params.targetHandle,\n }));\n return null;\n }\n const sourcePosition = sourceHandle?.position || Position.Bottom;\n const targetPosition = targetHandle?.position || Position.Top;\n const source = getHandlePosition(sourceNode, sourceHandle, sourcePosition);\n const target = getHandlePosition(targetNode, targetHandle, targetPosition);\n return {\n sourceX: source.x,\n sourceY: source.y,\n targetX: target.x,\n targetY: target.y,\n sourcePosition,\n targetPosition,\n };\n}\nfunction toHandleBounds(handles) {\n if (!handles) {\n return null;\n }\n const source = [];\n const target = [];\n for (const handle of handles) {\n handle.width = handle.width ?? 1;\n handle.height = handle.height ?? 1;\n if (handle.type === 'source') {\n source.push(handle);\n }\n else if (handle.type === 'target') {\n target.push(handle);\n }\n }\n return {\n source,\n target,\n };\n}\nfunction getHandlePosition(node, handle, fallbackPosition = Position.Left, center = false) {\n const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x;\n const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y;\n const { width, height } = handle ?? getNodeDimensions(node);\n if (center) {\n return { x: x + width / 2, y: y + height / 2 };\n }\n const position = handle?.position ?? fallbackPosition;\n switch (position) {\n case Position.Top:\n return { x: x + width / 2, y };\n case Position.Right:\n return { x: x + width, y: y + height / 2 };\n case Position.Bottom:\n return { x: x + width / 2, y: y + height };\n case Position.Left:\n return { x, y: y + height / 2 };\n }\n}\nfunction getHandle$1(bounds, handleId) {\n if (!bounds) {\n return null;\n }\n // if no handleId is given, we use the first handle, otherwise we check for the id\n return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null;\n}\n\nfunction getMarkerId(marker, id) {\n if (!marker) {\n return '';\n }\n if (typeof marker === 'string') {\n return marker;\n }\n const idPrefix = id ? `${id}__` : '';\n return `${idPrefix}${Object.keys(marker)\n .sort()\n .map((key) => `${key}=${marker[key]}`)\n .join('&')}`;\n}\nfunction createMarkerIds(edges, { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }) {\n const ids = new Set();\n return edges\n .reduce((markers, edge) => {\n [edge.markerStart || defaultMarkerStart, edge.markerEnd || defaultMarkerEnd].forEach((marker) => {\n if (marker && typeof marker === 'object') {\n const markerId = getMarkerId(marker, id);\n if (!ids.has(markerId)) {\n markers.push({ id: markerId, color: marker.color || defaultColor, ...marker });\n ids.add(markerId);\n }\n }\n });\n return markers;\n }, [])\n .sort((a, b) => a.id.localeCompare(b.id));\n}\n\nfunction getNodeToolbarTransform(nodeRect, viewport, position, offset, align) {\n let alignmentOffset = 0.5;\n if (align === 'start') {\n alignmentOffset = 0;\n }\n else if (align === 'end') {\n alignmentOffset = 1;\n }\n /*\n * position === Position.Top\n * we set the x any y position of the toolbar based on the nodes position\n */\n let pos = [\n (nodeRect.x + nodeRect.width * alignmentOffset) * viewport.zoom + viewport.x,\n nodeRect.y * viewport.zoom + viewport.y - offset,\n ];\n // and than shift it based on the alignment. The shift values are in %.\n let shift = [-100 * alignmentOffset, -100];\n switch (position) {\n case Position.Right:\n pos = [\n (nodeRect.x + nodeRect.width) * viewport.zoom + viewport.x + offset,\n (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,\n ];\n shift = [0, -100 * alignmentOffset];\n break;\n case Position.Bottom:\n pos[1] = (nodeRect.y + nodeRect.height) * viewport.zoom + viewport.y + offset;\n shift[1] = 0;\n break;\n case Position.Left:\n pos = [\n nodeRect.x * viewport.zoom + viewport.x - offset,\n (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,\n ];\n shift = [-100, -100 * alignmentOffset];\n break;\n }\n return `translate(${pos[0]}px, ${pos[1]}px) translate(${shift[0]}%, ${shift[1]}%)`;\n}\n\nconst defaultOptions = {\n nodeOrigin: [0, 0],\n nodeExtent: infiniteExtent,\n elevateNodesOnSelect: true,\n defaults: {},\n};\nconst adoptUserNodesDefaultOptions = {\n ...defaultOptions,\n checkEquality: true,\n};\nfunction mergeObjects(base, incoming) {\n const result = { ...base };\n for (const key in incoming) {\n if (incoming[key] !== undefined) {\n // typecast is safe here, because we check for undefined\n result[key] = incoming[key];\n }\n }\n return result;\n}\nfunction updateAbsolutePositions(nodeLookup, parentLookup, options) {\n const _options = mergeObjects(defaultOptions, options);\n for (const node of nodeLookup.values()) {\n if (node.parentId) {\n updateChildNode(node, nodeLookup, parentLookup, _options);\n }\n else {\n const positionWithOrigin = getNodePositionWithOrigin(node, _options.nodeOrigin);\n const extent = isCoordinateExtent(node.extent) ? node.extent : _options.nodeExtent;\n const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(node));\n node.internals.positionAbsolute = clampedPosition;\n }\n }\n}\nfunction adoptUserNodes(nodes, nodeLookup, parentLookup, options) {\n const _options = mergeObjects(adoptUserNodesDefaultOptions, options);\n let nodesInitialized = nodes.length > 0;\n const tmpLookup = new Map(nodeLookup);\n const selectedNodeZ = _options?.elevateNodesOnSelect ? 1000 : 0;\n nodeLookup.clear();\n parentLookup.clear();\n for (const userNode of nodes) {\n let internalNode = tmpLookup.get(userNode.id);\n if (_options.checkEquality && userNode === internalNode?.internals.userNode) {\n nodeLookup.set(userNode.id, internalNode);\n }\n else {\n const positionWithOrigin = getNodePositionWithOrigin(userNode, _options.nodeOrigin);\n const extent = isCoordinateExtent(userNode.extent) ? userNode.extent : _options.nodeExtent;\n const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(userNode));\n internalNode = {\n ..._options.defaults,\n ...userNode,\n measured: {\n width: userNode.measured?.width,\n height: userNode.measured?.height,\n },\n internals: {\n positionAbsolute: clampedPosition,\n // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured\n handleBounds: !userNode.measured ? undefined : internalNode?.internals.handleBounds,\n z: calculateZ(userNode, selectedNodeZ),\n userNode,\n },\n };\n nodeLookup.set(userNode.id, internalNode);\n }\n if ((internalNode.measured === undefined ||\n internalNode.measured.width === undefined ||\n internalNode.measured.height === undefined) &&\n !internalNode.hidden) {\n nodesInitialized = false;\n }\n if (userNode.parentId) {\n updateChildNode(internalNode, nodeLookup, parentLookup, options);\n }\n }\n return nodesInitialized;\n}\nfunction updateParentLookup(node, parentLookup) {\n if (!node.parentId) {\n return;\n }\n const childNodes = parentLookup.get(node.parentId);\n if (childNodes) {\n childNodes.set(node.id, node);\n }\n else {\n parentLookup.set(node.parentId, new Map([[node.id, node]]));\n }\n}\n/**\n * Updates positionAbsolute and zIndex of a child node and the parentLookup.\n */\nfunction updateChildNode(node, nodeLookup, parentLookup, options) {\n const { elevateNodesOnSelect, nodeOrigin, nodeExtent } = mergeObjects(defaultOptions, options);\n const parentId = node.parentId;\n const parentNode = nodeLookup.get(parentId);\n if (!parentNode) {\n console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);\n return;\n }\n updateParentLookup(node, parentLookup);\n const selectedNodeZ = elevateNodesOnSelect ? 1000 : 0;\n const { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ);\n const { positionAbsolute } = node.internals;\n const positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y;\n if (positionChanged || z !== node.internals.z) {\n // we create a new object to mark the node as updated\n nodeLookup.set(node.id, {\n ...node,\n internals: {\n ...node.internals,\n positionAbsolute: positionChanged ? { x, y } : positionAbsolute,\n z,\n },\n });\n }\n}\nfunction calculateZ(node, selectedNodeZ) {\n return (isNumeric(node.zIndex) ? node.zIndex : 0) + (node.selected ? selectedNodeZ : 0);\n}\nfunction calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, selectedNodeZ) {\n const { x: parentX, y: parentY } = parentNode.internals.positionAbsolute;\n const childDimensions = getNodeDimensions(childNode);\n const positionWithOrigin = getNodePositionWithOrigin(childNode, nodeOrigin);\n const clampedPosition = isCoordinateExtent(childNode.extent)\n ? clampPosition(positionWithOrigin, childNode.extent, childDimensions)\n : positionWithOrigin;\n let absolutePosition = clampPosition({ x: parentX + clampedPosition.x, y: parentY + clampedPosition.y }, nodeExtent, childDimensions);\n if (childNode.extent === 'parent') {\n absolutePosition = clampPositionToParent(absolutePosition, childDimensions, parentNode);\n }\n const childZ = calculateZ(childNode, selectedNodeZ);\n const parentZ = parentNode.internals.z ?? 0;\n return {\n x: absolutePosition.x,\n y: absolutePosition.y,\n z: parentZ > childZ ? parentZ : childZ,\n };\n}\nfunction handleExpandParent(children, nodeLookup, parentLookup, nodeOrigin = [0, 0]) {\n const changes = [];\n const parentExpansions = new Map();\n // determine the expanded rectangle the child nodes would take for each parent\n for (const child of children) {\n const parent = nodeLookup.get(child.parentId);\n if (!parent) {\n continue;\n }\n const parentRect = parentExpansions.get(child.parentId)?.expandedRect ?? nodeToRect(parent);\n const expandedRect = getBoundsOfRects(parentRect, child.rect);\n parentExpansions.set(child.parentId, { expandedRect, parent });\n }\n if (parentExpansions.size > 0) {\n parentExpansions.forEach(({ expandedRect, parent }, parentId) => {\n // determine the position & dimensions of the parent\n const positionAbsolute = parent.internals.positionAbsolute;\n const dimensions = getNodeDimensions(parent);\n const origin = parent.origin ?? nodeOrigin;\n // determine how much the parent expands in width and position\n const xChange = expandedRect.x < positionAbsolute.x ? Math.round(Math.abs(positionAbsolute.x - expandedRect.x)) : 0;\n const yChange = expandedRect.y < positionAbsolute.y ? Math.round(Math.abs(positionAbsolute.y - expandedRect.y)) : 0;\n const newWidth = Math.max(dimensions.width, Math.round(expandedRect.width));\n const newHeight = Math.max(dimensions.height, Math.round(expandedRect.height));\n const widthChange = (newWidth - dimensions.width) * origin[0];\n const heightChange = (newHeight - dimensions.height) * origin[1];\n // We need to correct the position of the parent node if the origin is not [0,0]\n if (xChange > 0 || yChange > 0 || widthChange || heightChange) {\n changes.push({\n id: parentId,\n type: 'position',\n position: {\n x: parent.position.x - xChange + widthChange,\n y: parent.position.y - yChange + heightChange,\n },\n });\n /*\n * We move all child nodes in the oppsite direction\n * so the x,y changes of the parent do not move the children\n */\n parentLookup.get(parentId)?.forEach((childNode) => {\n if (!children.some((child) => child.id === childNode.id)) {\n changes.push({\n id: childNode.id,\n type: 'position',\n position: {\n x: childNode.position.x + xChange,\n y: childNode.position.y + yChange,\n },\n });\n }\n });\n }\n // We need to correct the dimensions of the parent node if the origin is not [0,0]\n if (dimensions.width < expandedRect.width || dimensions.height < expandedRect.height || xChange || yChange) {\n changes.push({\n id: parentId,\n type: 'dimensions',\n setAttributes: true,\n dimensions: {\n width: newWidth + (xChange ? origin[0] * xChange - widthChange : 0),\n height: newHeight + (yChange ? origin[1] * yChange - heightChange : 0),\n },\n });\n }\n });\n }\n return changes;\n}\nfunction updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent) {\n const viewportNode = domNode?.querySelector('.xyflow__viewport');\n let updatedInternals = false;\n if (!viewportNode) {\n return { changes: [], updatedInternals };\n }\n const changes = [];\n const style = window.getComputedStyle(viewportNode);\n const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);\n // in this array we collect nodes, that might trigger changes (like expanding parent)\n const parentExpandChildren = [];\n for (const update of updates.values()) {\n const node = nodeLookup.get(update.id);\n if (!node) {\n continue;\n }\n if (node.hidden) {\n nodeLookup.set(node.id, {\n ...node,\n internals: {\n ...node.internals,\n handleBounds: undefined,\n },\n });\n updatedInternals = true;\n continue;\n }\n const dimensions = getDimensions(update.nodeElement);\n const dimensionChanged = node.measured.width !== dimensions.width || node.measured.height !== dimensions.height;\n const doUpdate = !!(dimensions.width &&\n dimensions.height &&\n (dimensionChanged || !node.internals.handleBounds || update.force));\n if (doUpdate) {\n const nodeBounds = update.nodeElement.getBoundingClientRect();\n const extent = isCoordinateExtent(node.extent) ? node.extent : nodeExtent;\n let { positionAbsolute } = node.internals;\n if (node.parentId && node.extent === 'parent') {\n positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, nodeLookup.get(node.parentId));\n }\n else if (extent) {\n positionAbsolute = clampPosition(positionAbsolute, extent, dimensions);\n }\n const newNode = {\n ...node,\n measured: dimensions,\n internals: {\n ...node.internals,\n positionAbsolute,\n handleBounds: {\n source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id),\n target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id),\n },\n },\n };\n nodeLookup.set(node.id, newNode);\n if (node.parentId) {\n updateChildNode(newNode, nodeLookup, parentLookup, { nodeOrigin });\n }\n updatedInternals = true;\n if (dimensionChanged) {\n changes.push({\n id: node.id,\n type: 'dimensions',\n dimensions,\n });\n if (node.expandParent && node.parentId) {\n parentExpandChildren.push({\n id: node.id,\n parentId: node.parentId,\n rect: nodeToRect(newNode, nodeOrigin),\n });\n }\n }\n }\n }\n if (parentExpandChildren.length > 0) {\n const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);\n changes.push(...parentExpandChanges);\n }\n return { changes, updatedInternals };\n}\nasync function panBy({ delta, panZoom, transform, translateExtent, width, height, }) {\n if (!panZoom || (!delta.x && !delta.y)) {\n return Promise.resolve(false);\n }\n const nextViewport = await panZoom.setViewportConstrained({\n x: transform[0] + delta.x,\n y: transform[1] + delta.y,\n zoom: transform[2],\n }, [\n [0, 0],\n [width, height],\n ], translateExtent);\n const transformChanged = !!nextViewport &&\n (nextViewport.x !== transform[0] || nextViewport.y !== transform[1] || nextViewport.k !== transform[2]);\n return Promise.resolve(transformChanged);\n}\n/**\n * this function adds the connection to the connectionLookup\n * at the following keys: nodeId-type-handleId, nodeId-type and nodeId\n * @param type type of the connection\n * @param connection connection that should be added to the lookup\n * @param connectionKey at which key the connection should be added\n * @param connectionLookup reference to the connection lookup\n * @param nodeId nodeId of the connection\n * @param handleId handleId of the conneciton\n */\nfunction addConnectionToLookup(type, connection, connectionKey, connectionLookup, nodeId, handleId) {\n /*\n * We add the connection to the connectionLookup at the following keys\n * 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId\n * If the key already exists, we add the connection to the existing map\n */\n let key = nodeId;\n const nodeMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, nodeMap.set(connectionKey, connection));\n key = `${nodeId}-${type}`;\n const typeMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, typeMap.set(connectionKey, connection));\n if (handleId) {\n key = `${nodeId}-${type}-${handleId}`;\n const handleMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, handleMap.set(connectionKey, connection));\n }\n}\nfunction updateConnectionLookup(connectionLookup, edgeLookup, edges) {\n connectionLookup.clear();\n edgeLookup.clear();\n for (const edge of edges) {\n const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge;\n const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle };\n const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`;\n const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`;\n addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle);\n addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle);\n edgeLookup.set(edge.id, edge);\n }\n}\n\nfunction shallowNodeData(a, b) {\n if (a === null || b === null) {\n return false;\n }\n const _a = Array.isArray(a) ? a : [a];\n const _b = Array.isArray(b) ? b : [b];\n if (_a.length !== _b.length) {\n return false;\n }\n for (let i = 0; i < _a.length; i++) {\n if (_a[i].id !== _b[i].id || _a[i].type !== _b[i].type || !Object.is(_a[i].data, _b[i].data)) {\n return false;\n }\n }\n return true;\n}\n\nfunction isParentSelected(node, nodeLookup) {\n if (!node.parentId) {\n return false;\n }\n const parentNode = nodeLookup.get(node.parentId);\n if (!parentNode) {\n return false;\n }\n if (parentNode.selected) {\n return true;\n }\n return isParentSelected(parentNode, nodeLookup);\n}\nfunction hasSelector(target, selector, domNode) {\n let current = target;\n do {\n if (current?.matches?.(selector))\n return true;\n if (current === domNode)\n return false;\n current = current?.parentElement;\n } while (current);\n return false;\n}\n// looks for all selected nodes and created a NodeDragItem for each of them\nfunction getDragItems(nodeLookup, nodesDraggable, mousePos, nodeId) {\n const dragItems = new Map();\n for (const [id, node] of nodeLookup) {\n if ((node.selected || node.id === nodeId) &&\n (!node.parentId || !isParentSelected(node, nodeLookup)) &&\n (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'))) {\n const internalNode = nodeLookup.get(id);\n if (internalNode) {\n dragItems.set(id, {\n id,\n position: internalNode.position || { x: 0, y: 0 },\n distance: {\n x: mousePos.x - internalNode.internals.positionAbsolute.x,\n y: mousePos.y - internalNode.internals.positionAbsolute.y,\n },\n extent: internalNode.extent,\n parentId: internalNode.parentId,\n origin: internalNode.origin,\n expandParent: internalNode.expandParent,\n internals: {\n positionAbsolute: internalNode.internals.positionAbsolute || { x: 0, y: 0 },\n },\n measured: {\n width: internalNode.measured.width ?? 0,\n height: internalNode.measured.height ?? 0,\n },\n });\n }\n }\n }\n return dragItems;\n}\n/*\n * returns two params:\n * 1. the dragged node (or the first of the list, if we are dragging a node selection)\n * 2. array of selected nodes (for multi selections)\n */\nfunction getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true, }) {\n const nodesFromDragItems = [];\n for (const [id, dragItem] of dragItems) {\n const node = nodeLookup.get(id)?.internals.userNode;\n if (node) {\n nodesFromDragItems.push({\n ...node,\n position: dragItem.position,\n dragging,\n });\n }\n }\n if (!nodeId) {\n return [nodesFromDragItems[0], nodesFromDragItems];\n }\n const node = nodeLookup.get(nodeId)?.internals.userNode;\n return [\n !node\n ? nodesFromDragItems[0]\n : {\n ...node,\n position: dragItems.get(nodeId)?.position || node.position,\n dragging,\n },\n nodesFromDragItems,\n ];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) {\n let lastPos = { x: null, y: null };\n let autoPanId = 0;\n let dragItems = new Map();\n let autoPanStarted = false;\n let mousePosition = { x: 0, y: 0 };\n let containerBounds = null;\n let dragStarted = false;\n let d3Selection = null;\n let abortDrag = false; // prevents unintentional dragging on multitouch\n // public functions\n function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {\n d3Selection = select(domNode);\n function updateNodes({ x, y }, dragEvent) {\n const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();\n lastPos = { x, y };\n let hasChange = false;\n let nodesBox = { x: 0, y: 0, x2: 0, y2: 0 };\n if (dragItems.size > 1 && nodeExtent) {\n const rect = getInternalNodesBounds(dragItems);\n nodesBox = rectToBox(rect);\n }\n for (const [id, dragItem] of dragItems) {\n if (!nodeLookup.has(id)) {\n /*\n * if the node is not in the nodeLookup anymore, it was probably deleted while dragging\n * and we don't need to update it anymore\n */\n continue;\n }\n let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };\n if (snapToGrid) {\n nextPosition = snapPosition(nextPosition, snapGrid);\n }\n /*\n * if there is selection with multiple nodes and a node extent is set, we need to adjust the node extent for each node\n * based on its position so that the node stays at it's position relative to the selection.\n */\n let adjustedNodeExtent = [\n [nodeExtent[0][0], nodeExtent[0][1]],\n [nodeExtent[1][0], nodeExtent[1][1]],\n ];\n if (dragItems.size > 1 && nodeExtent && !dragItem.extent) {\n const { positionAbsolute } = dragItem.internals;\n const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0];\n const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0];\n const y1 = positionAbsolute.y - nodesBox.y + nodeExtent[0][1];\n const y2 = positionAbsolute.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1];\n adjustedNodeExtent = [\n [x1, y1],\n [x2, y2],\n ];\n }\n const { position, positionAbsolute } = calculateNodePosition({\n nodeId: id,\n nextPosition,\n nodeLookup,\n nodeExtent: adjustedNodeExtent,\n nodeOrigin,\n onError,\n });\n // we want to make sure that we only fire a change event when there is a change\n hasChange = hasChange || dragItem.position.x !== position.x || dragItem.position.y !== position.y;\n dragItem.position = position;\n dragItem.internals.positionAbsolute = positionAbsolute;\n }\n if (!hasChange) {\n return;\n }\n updateNodePositions(dragItems, true);\n if (dragEvent && (onDrag || onNodeDrag || (!nodeId && onSelectionDrag))) {\n const [currentNode, currentNodes] = getEventHandlerParams({\n nodeId,\n dragItems,\n nodeLookup,\n });\n onDrag?.(dragEvent, dragItems, currentNode, currentNodes);\n onNodeDrag?.(dragEvent, currentNode, currentNodes);\n if (!nodeId) {\n onSelectionDrag?.(dragEvent, currentNodes);\n }\n }\n }\n async function autoPan() {\n if (!containerBounds) {\n return;\n }\n const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems();\n if (!autoPanOnNodeDrag) {\n autoPanStarted = false;\n cancelAnimationFrame(autoPanId);\n return;\n }\n const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);\n if (xMovement !== 0 || yMovement !== 0) {\n lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2];\n lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2];\n if (await panBy({ x: xMovement, y: yMovement })) {\n updateNodes(lastPos, null);\n }\n }\n autoPanId = requestAnimationFrame(autoPan);\n }\n function startDrag(event) {\n const { nodeLookup, multiSelectionActive, nodesDraggable, transform, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges, } = getStoreItems();\n dragStarted = true;\n if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) {\n if (!nodeLookup.get(nodeId)?.selected) {\n // we need to reset selected nodes when selectNodesOnDrag=false\n unselectNodesAndEdges();\n }\n }\n if (isSelectable && selectNodesOnDrag && nodeId) {\n onNodeMouseDown?.(nodeId);\n }\n const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n lastPos = pointerPos;\n dragItems = getDragItems(nodeLookup, nodesDraggable, pointerPos, nodeId);\n if (dragItems.size > 0 && (onDragStart || onNodeDragStart || (!nodeId && onSelectionDragStart))) {\n const [currentNode, currentNodes] = getEventHandlerParams({\n nodeId,\n dragItems,\n nodeLookup,\n });\n onDragStart?.(event.sourceEvent, dragItems, currentNode, currentNodes);\n onNodeDragStart?.(event.sourceEvent, currentNode, currentNodes);\n if (!nodeId) {\n onSelectionDragStart?.(event.sourceEvent, currentNodes);\n }\n }\n }\n const d3DragInstance = drag()\n .clickDistance(nodeClickDistance)\n .on('start', (event) => {\n const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems();\n containerBounds = domNode?.getBoundingClientRect() || null;\n abortDrag = false;\n if (nodeDragThreshold === 0) {\n startDrag(event);\n }\n const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n lastPos = pointerPos;\n mousePosition = getEventPosition(event.sourceEvent, containerBounds);\n })\n .on('drag', (event) => {\n const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems();\n const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) ||\n // if user deletes a node while dragging, we need to abort the drag to prevent errors\n (nodeId && !nodeLookup.has(nodeId))) {\n abortDrag = true;\n }\n if (abortDrag) {\n return;\n }\n if (!autoPanStarted && autoPanOnNodeDrag && dragStarted) {\n autoPanStarted = true;\n autoPan();\n }\n if (!dragStarted) {\n const x = pointerPos.xSnapped - (lastPos.x ?? 0);\n const y = pointerPos.ySnapped - (lastPos.y ?? 0);\n const distance = Math.sqrt(x * x + y * y);\n if (distance > nodeDragThreshold) {\n startDrag(event);\n }\n }\n // skip events without movement\n if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) {\n // dragEvent = event.sourceEvent as MouseEvent;\n mousePosition = getEventPosition(event.sourceEvent, containerBounds);\n updateNodes(pointerPos, event.sourceEvent);\n }\n })\n .on('end', (event) => {\n if (!dragStarted || abortDrag) {\n return;\n }\n autoPanStarted = false;\n dragStarted = false;\n cancelAnimationFrame(autoPanId);\n if (dragItems.size > 0) {\n const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems();\n updateNodePositions(dragItems, false);\n if (onDragStop || onNodeDragStop || (!nodeId && onSelectionDragStop)) {\n const [currentNode, currentNodes] = getEventHandlerParams({\n nodeId,\n dragItems,\n nodeLookup,\n dragging: false,\n });\n onDragStop?.(event.sourceEvent, dragItems, currentNode, currentNodes);\n onNodeDragStop?.(event.sourceEvent, currentNode, currentNodes);\n if (!nodeId) {\n onSelectionDragStop?.(event.sourceEvent, currentNodes);\n }\n }\n }\n })\n .filter((event) => {\n const target = event.target;\n const isDraggable = !event.button &&\n (!noDragClassName || !hasSelector(target, `.${noDragClassName}`, domNode)) &&\n (!handleSelector || hasSelector(target, handleSelector, domNode));\n return isDraggable;\n });\n d3Selection.call(d3DragInstance);\n }\n function destroy() {\n d3Selection?.on('.drag', null);\n }\n return {\n update,\n destroy,\n };\n}\n\nfunction getNodesWithinDistance(position, nodeLookup, distance) {\n const nodes = [];\n const rect = {\n x: position.x - distance,\n y: position.y - distance,\n width: distance * 2,\n height: distance * 2,\n };\n for (const node of nodeLookup.values()) {\n if (getOverlappingArea(rect, nodeToRect(node)) > 0) {\n nodes.push(node);\n }\n }\n return nodes;\n}\n/*\n * this distance is used for the area around the user pointer\n * while doing a connection for finding the closest nodes\n */\nconst ADDITIONAL_DISTANCE = 250;\nfunction getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {\n let closestHandles = [];\n let minDistance = Infinity;\n const closeNodes = getNodesWithinDistance(position, nodeLookup, connectionRadius + ADDITIONAL_DISTANCE);\n for (const node of closeNodes) {\n const allHandles = [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n for (const handle of allHandles) {\n // if the handle is the same as the fromHandle we skip it\n if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id) {\n continue;\n }\n // determine absolute position of the handle\n const { x, y } = getHandlePosition(node, handle, handle.position, true);\n const distance = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2));\n if (distance > connectionRadius) {\n continue;\n }\n if (distance < minDistance) {\n closestHandles = [{ ...handle, x, y }];\n minDistance = distance;\n }\n else if (distance === minDistance) {\n // when multiple handles are on the same distance we collect all of them\n closestHandles.push({ ...handle, x, y });\n }\n }\n }\n if (!closestHandles.length) {\n return null;\n }\n // when multiple handles overlay each other we prefer the opposite handle\n if (closestHandles.length > 1) {\n const oppositeHandleType = fromHandle.type === 'source' ? 'target' : 'source';\n return closestHandles.find((handle) => handle.type === oppositeHandleType) ?? closestHandles[0];\n }\n return closestHandles[0];\n}\nfunction getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode, withAbsolutePosition = false) {\n const node = nodeLookup.get(nodeId);\n if (!node) {\n return null;\n }\n const handles = connectionMode === 'strict'\n ? node.internals.handleBounds?.[handleType]\n : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n const handle = (handleId ? handles?.find((h) => h.id === handleId) : handles?.[0]) ?? null;\n return handle && withAbsolutePosition\n ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) }\n : handle;\n}\nfunction getHandleType(edgeUpdaterType, handleDomNode) {\n if (edgeUpdaterType) {\n return edgeUpdaterType;\n }\n else if (handleDomNode?.classList.contains('target')) {\n return 'target';\n }\n else if (handleDomNode?.classList.contains('source')) {\n return 'source';\n }\n return null;\n}\nfunction isConnectionValid(isInsideConnectionRadius, isHandleValid) {\n let isValid = null;\n if (isHandleValid) {\n isValid = true;\n }\n else if (isInsideConnectionRadius && !isHandleValid) {\n isValid = false;\n }\n return isValid;\n}\n\nconst alwaysValid = () => true;\nfunction onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, }) {\n // when xyflow is used inside a shadow root we can't use document\n const doc = getHostForElement(event.target);\n let autoPanId = 0;\n let closestHandle;\n const { x, y } = getEventPosition(event);\n const clickedHandle = doc?.elementFromPoint(x, y);\n const handleType = getHandleType(edgeUpdaterType, clickedHandle);\n const containerBounds = domNode?.getBoundingClientRect();\n if (!containerBounds || !handleType) {\n return;\n }\n const fromHandleInternal = getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode);\n if (!fromHandleInternal) {\n return;\n }\n let position = getEventPosition(event, containerBounds);\n let autoPanStarted = false;\n let connection = null;\n let isValid = false;\n let handleDomNode = null;\n // when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas\n function autoPan() {\n if (!autoPanOnConnect || !containerBounds) {\n return;\n }\n const [x, y] = calcAutoPan(position, containerBounds, autoPanSpeed);\n panBy({ x, y });\n autoPanId = requestAnimationFrame(autoPan);\n }\n // Stays the same for all consecutive pointermove events\n const fromHandle = {\n ...fromHandleInternal,\n nodeId,\n type: handleType,\n position: fromHandleInternal.position,\n };\n const fromNodeInternal = nodeLookup.get(nodeId);\n const from = getHandlePosition(fromNodeInternal, fromHandle, Position.Left, true);\n const newConnection = {\n inProgress: true,\n isValid: null,\n from,\n fromHandle,\n fromPosition: fromHandle.position,\n fromNode: fromNodeInternal,\n to: position,\n toHandle: null,\n toPosition: oppositePosition[fromHandle.position],\n toNode: null,\n };\n updateConnection(newConnection);\n let previousConnection = newConnection;\n onConnectStart?.(event, { nodeId, handleId, handleType });\n function onPointerMove(event) {\n if (!getFromHandle() || !fromHandle) {\n onPointerUp(event);\n return;\n }\n const transform = getTransform();\n position = getEventPosition(event, containerBounds);\n closestHandle = getClosestHandle(pointToRendererPoint(position, transform, false, [1, 1]), connectionRadius, nodeLookup, fromHandle);\n if (!autoPanStarted) {\n autoPan();\n autoPanStarted = true;\n }\n const result = isValidHandle(event, {\n handle: closestHandle,\n connectionMode,\n fromNodeId: nodeId,\n fromHandleId: handleId,\n fromType: isTarget ? 'target' : 'source',\n isValidConnection,\n doc,\n lib,\n flowId,\n nodeLookup,\n });\n handleDomNode = result.handleDomNode;\n connection = result.connection;\n isValid = isConnectionValid(!!closestHandle, result.isValid);\n const newConnection = {\n // from stays the same\n ...previousConnection,\n isValid,\n to: closestHandle && isValid\n ? rendererPointToPoint({ x: closestHandle.x, y: closestHandle.y }, transform)\n : position,\n toHandle: result.toHandle,\n toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position],\n toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId) : null,\n };\n /*\n * we don't want to trigger an update when the connection\n * is snapped to the same handle as before\n */\n if (isValid &&\n closestHandle &&\n previousConnection.toHandle &&\n newConnection.toHandle &&\n previousConnection.toHandle.type === newConnection.toHandle.type &&\n previousConnection.toHandle.nodeId === newConnection.toHandle.nodeId &&\n previousConnection.toHandle.id === newConnection.toHandle.id &&\n previousConnection.to.x === newConnection.to.x &&\n previousConnection.to.y === newConnection.to.y) {\n return;\n }\n updateConnection(newConnection);\n previousConnection = newConnection;\n }\n function onPointerUp(event) {\n if ((closestHandle || handleDomNode) && connection && isValid) {\n onConnect?.(connection);\n }\n /*\n * it's important to get a fresh reference from the store here\n * in order to get the latest state of onConnectEnd\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { inProgress, ...connectionState } = previousConnection;\n const finalConnectionState = {\n ...connectionState,\n toPosition: previousConnection.toHandle ? previousConnection.toPosition : null,\n };\n onConnectEnd?.(event, finalConnectionState);\n if (edgeUpdaterType) {\n onReconnectEnd?.(event, finalConnectionState);\n }\n cancelConnection();\n cancelAnimationFrame(autoPanId);\n autoPanStarted = false;\n isValid = false;\n connection = null;\n handleDomNode = null;\n doc.removeEventListener('mousemove', onPointerMove);\n doc.removeEventListener('mouseup', onPointerUp);\n doc.removeEventListener('touchmove', onPointerMove);\n doc.removeEventListener('touchend', onPointerUp);\n }\n doc.addEventListener('mousemove', onPointerMove);\n doc.addEventListener('mouseup', onPointerUp);\n doc.addEventListener('touchmove', onPointerMove);\n doc.addEventListener('touchend', onPointerUp);\n}\n// checks if and returns connection in fom of an object { source: 123, target: 312 }\nfunction isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup, }) {\n const isTarget = fromType === 'target';\n const handleDomNode = handle\n ? doc.querySelector(`.${lib}-flow__handle[data-id=\"${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}\"]`)\n : null;\n const { x, y } = getEventPosition(event);\n const handleBelow = doc.elementFromPoint(x, y);\n /*\n * we always want to prioritize the handle below the mouse cursor over the closest distance handle,\n * because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor\n */\n const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode;\n const result = {\n handleDomNode: handleToCheck,\n isValid: false,\n connection: null,\n toHandle: null,\n };\n if (handleToCheck) {\n const handleType = getHandleType(undefined, handleToCheck);\n const handleNodeId = handleToCheck.getAttribute('data-nodeid');\n const handleId = handleToCheck.getAttribute('data-handleid');\n const connectable = handleToCheck.classList.contains('connectable');\n const connectableEnd = handleToCheck.classList.contains('connectableend');\n if (!handleNodeId || !handleType) {\n return result;\n }\n const connection = {\n source: isTarget ? handleNodeId : fromNodeId,\n sourceHandle: isTarget ? handleId : fromHandleId,\n target: isTarget ? fromNodeId : handleNodeId,\n targetHandle: isTarget ? fromHandleId : handleId,\n };\n result.connection = connection;\n const isConnectable = connectable && connectableEnd;\n // in strict mode we don't allow target to target or source to source connections\n const isValid = isConnectable &&\n (connectionMode === ConnectionMode.Strict\n ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')\n : handleNodeId !== fromNodeId || handleId !== fromHandleId);\n result.isValid = isValid && isValidConnection(connection);\n result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, false);\n }\n return result;\n}\nconst XYHandle = {\n onPointerDown,\n isValid: isValidHandle,\n};\n\nfunction XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {\n const selection = select(domNode);\n function update({ translateExtent, width, height, zoomStep = 10, pannable = true, zoomable = true, inversePan = false, }) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const zoomHandler = (event) => {\n const transform = getTransform();\n if (event.sourceEvent.type !== 'wheel' || !panZoom) {\n return;\n }\n const pinchDelta = -event.sourceEvent.deltaY *\n (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) *\n zoomStep;\n const nextZoom = transform[2] * Math.pow(2, pinchDelta);\n panZoom.scaleTo(nextZoom);\n };\n let panStart = [0, 0];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const panStartHandler = (event) => {\n if (event.sourceEvent.type === 'mousedown' || event.sourceEvent.type === 'touchstart') {\n panStart = [\n event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,\n event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,\n ];\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const panHandler = (event) => {\n const transform = getTransform();\n if ((event.sourceEvent.type !== 'mousemove' && event.sourceEvent.type !== 'touchmove') || !panZoom) {\n return;\n }\n const panCurrent = [\n event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,\n event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,\n ];\n const panDelta = [panCurrent[0] - panStart[0], panCurrent[1] - panStart[1]];\n panStart = panCurrent;\n const moveScale = getViewScale() * Math.max(transform[2], Math.log(transform[2])) * (inversePan ? -1 : 1);\n const position = {\n x: transform[0] - panDelta[0] * moveScale,\n y: transform[1] - panDelta[1] * moveScale,\n };\n const extent = [\n [0, 0],\n [width, height],\n ];\n panZoom.setViewportConstrained({\n x: position.x,\n y: position.y,\n zoom: transform[2],\n }, extent, translateExtent);\n };\n const zoomAndPanHandler = zoom()\n .on('start', panStartHandler)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .on('zoom', pannable ? panHandler : null)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .on('zoom.wheel', zoomable ? zoomHandler : null);\n selection.call(zoomAndPanHandler, {});\n }\n function destroy() {\n selection.on('zoom', null);\n }\n return {\n update,\n destroy,\n pointer,\n };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst viewChanged = (prevViewport, eventViewport) => prevViewport.x !== eventViewport.x || prevViewport.y !== eventViewport.y || prevViewport.zoom !== eventViewport.k;\nconst transformToViewport = (transform) => ({\n x: transform.x,\n y: transform.y,\n zoom: transform.k,\n});\nconst viewportToTransform = ({ x, y, zoom }) => zoomIdentity.translate(x, y).scale(zoom);\nconst isWrappedWithClass = (event, className) => event.target.closest(`.${className}`);\nconst isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2);\nconst getD3Transition = (selection, duration = 0, onEnd = () => { }) => {\n const hasDuration = typeof duration === 'number' && duration > 0;\n if (!hasDuration) {\n onEnd();\n }\n return hasDuration ? selection.transition().duration(duration).on('end', onEnd) : selection;\n};\nconst wheelDelta = (event) => {\n const factor = event.ctrlKey && isMacOs() ? 10 : 1;\n return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * factor;\n};\n\nfunction createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }) {\n return (event) => {\n if (isWrappedWithClass(event, noWheelClassName)) {\n return false;\n }\n event.preventDefault();\n event.stopImmediatePropagation();\n const currentZoom = d3Selection.property('__zoom').k || 1;\n // macos sets ctrlKey=true for pinch gesture on a trackpad\n if (event.ctrlKey && zoomOnPinch) {\n const point = pointer(event);\n const pinchDelta = wheelDelta(event);\n const zoom = currentZoom * Math.pow(2, pinchDelta);\n // @ts-ignore\n d3Zoom.scaleTo(d3Selection, zoom, point, event);\n return;\n }\n /*\n * increase scroll speed in firefox\n * firefox: deltaMode === 1; chrome: deltaMode === 0\n */\n const deltaNormalize = event.deltaMode === 1 ? 20 : 1;\n let deltaX = panOnScrollMode === PanOnScrollMode.Vertical ? 0 : event.deltaX * deltaNormalize;\n let deltaY = panOnScrollMode === PanOnScrollMode.Horizontal ? 0 : event.deltaY * deltaNormalize;\n // this enables vertical scrolling with shift + scroll on windows\n if (!isMacOs() && event.shiftKey && panOnScrollMode !== PanOnScrollMode.Vertical) {\n deltaX = event.deltaY * deltaNormalize;\n deltaY = 0;\n }\n d3Zoom.translateBy(d3Selection, -(deltaX / currentZoom) * panOnScrollSpeed, -(deltaY / currentZoom) * panOnScrollSpeed, \n // @ts-ignore\n { internal: true });\n const nextViewport = transformToViewport(d3Selection.property('__zoom'));\n clearTimeout(zoomPanValues.panScrollTimeout);\n /*\n * for pan on scroll we need to handle the event calls on our own\n * we can't use the start, zoom and end events from d3-zoom\n * because start and move gets called on every scroll event and not once at the beginning\n */\n if (!zoomPanValues.isPanScrolling) {\n zoomPanValues.isPanScrolling = true;\n onPanZoomStart?.(event, nextViewport);\n }\n if (zoomPanValues.isPanScrolling) {\n onPanZoom?.(event, nextViewport);\n zoomPanValues.panScrollTimeout = setTimeout(() => {\n onPanZoomEnd?.(event, nextViewport);\n zoomPanValues.isPanScrolling = false;\n }, 150);\n }\n };\n}\nfunction createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {\n return function (event, d) {\n const isWheel = event.type === 'wheel';\n // we still want to enable pinch zooming even if preventScrolling is set to false\n const preventZoom = !preventScrolling && isWheel && !event.ctrlKey;\n const hasNoWheelClass = isWrappedWithClass(event, noWheelClassName);\n // if user is pinch zooming above a nowheel element, we don't want the browser to zoom\n if (event.ctrlKey && isWheel && hasNoWheelClass) {\n event.preventDefault();\n }\n if (preventZoom || hasNoWheelClass) {\n return null;\n }\n event.preventDefault();\n d3ZoomHandler.call(this, event, d);\n };\n}\nfunction createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) {\n return (event) => {\n if (event.sourceEvent?.internal) {\n return;\n }\n const viewport = transformToViewport(event.transform);\n // we need to remember it here, because it's always 0 in the \"zoom\" event\n zoomPanValues.mouseButton = event.sourceEvent?.button || 0;\n zoomPanValues.isZoomingOrPanning = true;\n zoomPanValues.prevViewport = viewport;\n if (event.sourceEvent?.type === 'mousedown') {\n onDraggingChange(true);\n }\n if (onPanZoomStart) {\n onPanZoomStart?.(event.sourceEvent, viewport);\n }\n };\n}\nfunction createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }) {\n return (event) => {\n zoomPanValues.usedRightMouseButton = !!(onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0));\n if (!event.sourceEvent?.sync) {\n onTransformChange([event.transform.x, event.transform.y, event.transform.k]);\n }\n if (onPanZoom && !event.sourceEvent?.internal) {\n onPanZoom?.(event.sourceEvent, transformToViewport(event.transform));\n }\n };\n}\nfunction createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }) {\n return (event) => {\n if (event.sourceEvent?.internal) {\n return;\n }\n zoomPanValues.isZoomingOrPanning = false;\n if (onPaneContextMenu &&\n isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) &&\n !zoomPanValues.usedRightMouseButton &&\n event.sourceEvent) {\n onPaneContextMenu(event.sourceEvent);\n }\n zoomPanValues.usedRightMouseButton = false;\n onDraggingChange(false);\n if (onPanZoomEnd && viewChanged(zoomPanValues.prevViewport, event.transform)) {\n const viewport = transformToViewport(event.transform);\n zoomPanValues.prevViewport = viewport;\n clearTimeout(zoomPanValues.timerId);\n zoomPanValues.timerId = setTimeout(() => {\n onPanZoomEnd?.(event.sourceEvent, viewport);\n }, \n // we need a setTimeout for panOnScroll to supress multiple end events fired during scroll\n panOnScroll ? 150 : 0);\n }\n };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, }) {\n return (event) => {\n const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;\n const pinchZoom = zoomOnPinch && event.ctrlKey;\n if (event.button === 1 &&\n event.type === 'mousedown' &&\n (isWrappedWithClass(event, `${lib}-flow__node`) || isWrappedWithClass(event, `${lib}-flow__edge`))) {\n return true;\n }\n // if all interactions are disabled, we prevent all zoom events\n if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch) {\n return false;\n }\n // during a selection we prevent all other interactions\n if (userSelectionActive) {\n return false;\n }\n // if the target element is inside an element with the nowheel class, we prevent zooming\n if (isWrappedWithClass(event, noWheelClassName) && event.type === 'wheel') {\n return false;\n }\n // if the target element is inside an element with the nopan class, we prevent panning\n if (isWrappedWithClass(event, noPanClassName) &&\n (event.type !== 'wheel' || (panOnScroll && event.type === 'wheel' && !zoomActivationKeyPressed))) {\n return false;\n }\n if (!zoomOnPinch && event.ctrlKey && event.type === 'wheel') {\n return false;\n }\n if (!zoomOnPinch && event.type === 'touchstart' && event.touches?.length > 1) {\n event.preventDefault(); // if you manage to start with 2 touches, we prevent native zoom\n return false;\n }\n // when there is no scroll handling enabled, we prevent all wheel events\n if (!zoomScroll && !panOnScroll && !pinchZoom && event.type === 'wheel') {\n return false;\n }\n // if the pane is not movable, we prevent dragging it with mousestart or touchstart\n if (!panOnDrag && (event.type === 'mousedown' || event.type === 'touchstart')) {\n return false;\n }\n // if the pane is only movable using allowed clicks\n if (Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === 'mousedown') {\n return false;\n }\n // We only allow right clicks if pan on drag is set to right click\n const buttonAllowed = (Array.isArray(panOnDrag) && panOnDrag.includes(event.button)) || !event.button || event.button <= 1;\n // default filter for d3-zoom\n return (!event.ctrlKey || event.type === 'wheel') && buttonAllowed;\n };\n}\n\nfunction XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }) {\n const zoomPanValues = {\n isZoomingOrPanning: false,\n usedRightMouseButton: false,\n prevViewport: { x: 0, y: 0, zoom: 0 },\n mouseButton: 0,\n timerId: undefined,\n panScrollTimeout: undefined,\n isPanScrolling: false,\n };\n const bbox = domNode.getBoundingClientRect();\n const d3ZoomInstance = zoom()\n .clickDistance(!isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance)\n .scaleExtent([minZoom, maxZoom])\n .translateExtent(translateExtent);\n const d3Selection = select(domNode).call(d3ZoomInstance);\n setViewportConstrained({\n x: viewport.x,\n y: viewport.y,\n zoom: clamp(viewport.zoom, minZoom, maxZoom),\n }, [\n [0, 0],\n [bbox.width, bbox.height],\n ], translateExtent);\n const d3ZoomHandler = d3Selection.on('wheel.zoom');\n const d3DblClickZoomHandler = d3Selection.on('dblclick.zoom');\n d3ZoomInstance.wheelDelta(wheelDelta);\n function setTransform(transform, options) {\n if (d3Selection) {\n return new Promise((resolve) => {\n d3ZoomInstance?.transform(getD3Transition(d3Selection, options?.duration, () => resolve(true)), transform);\n });\n }\n return Promise.resolve(false);\n }\n // public functions\n function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib, onTransformChange, }) {\n if (userSelectionActive && !zoomPanValues.isZoomingOrPanning) {\n destroy();\n }\n const isPanOnScroll = panOnScroll && !zoomActivationKeyPressed && !userSelectionActive;\n const wheelHandler = isPanOnScroll\n ? createPanOnScrollHandler({\n zoomPanValues,\n noWheelClassName,\n d3Selection,\n d3Zoom: d3ZoomInstance,\n panOnScrollMode,\n panOnScrollSpeed,\n zoomOnPinch,\n onPanZoomStart,\n onPanZoom,\n onPanZoomEnd,\n })\n : createZoomOnScrollHandler({\n noWheelClassName,\n preventScrolling,\n d3ZoomHandler,\n });\n d3Selection.on('wheel.zoom', wheelHandler, { passive: false });\n if (!userSelectionActive) {\n // pan zoom start\n const startHandler = createPanZoomStartHandler({\n zoomPanValues,\n onDraggingChange,\n onPanZoomStart,\n });\n d3ZoomInstance.on('start', startHandler);\n // pan zoom\n const panZoomHandler = createPanZoomHandler({\n zoomPanValues,\n panOnDrag,\n onPaneContextMenu: !!onPaneContextMenu,\n onPanZoom,\n onTransformChange,\n });\n d3ZoomInstance.on('zoom', panZoomHandler);\n // pan zoom end\n const panZoomEndHandler = createPanZoomEndHandler({\n zoomPanValues,\n panOnDrag,\n panOnScroll,\n onPaneContextMenu,\n onPanZoomEnd,\n onDraggingChange,\n });\n d3ZoomInstance.on('end', panZoomEndHandler);\n }\n const filter = createFilter({\n zoomActivationKeyPressed,\n panOnDrag,\n zoomOnScroll,\n panOnScroll,\n zoomOnDoubleClick,\n zoomOnPinch,\n userSelectionActive,\n noPanClassName,\n noWheelClassName,\n lib,\n });\n d3ZoomInstance.filter(filter);\n /*\n * We cannot add zoomOnDoubleClick to the filter above because\n * double tapping on touch screens circumvents the filter and\n * dblclick.zoom is fired on the selection directly\n */\n if (zoomOnDoubleClick) {\n d3Selection.on('dblclick.zoom', d3DblClickZoomHandler);\n }\n else {\n d3Selection.on('dblclick.zoom', null);\n }\n }\n function destroy() {\n d3ZoomInstance.on('zoom', null);\n }\n async function setViewportConstrained(viewport, extent, translateExtent) {\n const nextTransform = viewportToTransform(viewport);\n const contrainedTransform = d3ZoomInstance?.constrain()(nextTransform, extent, translateExtent);\n if (contrainedTransform) {\n await setTransform(contrainedTransform);\n }\n return new Promise((resolve) => resolve(contrainedTransform));\n }\n async function setViewport(viewport, options) {\n const nextTransform = viewportToTransform(viewport);\n await setTransform(nextTransform, options);\n return new Promise((resolve) => resolve(nextTransform));\n }\n function syncViewport(viewport) {\n if (d3Selection) {\n const nextTransform = viewportToTransform(viewport);\n const currentTransform = d3Selection.property('__zoom');\n if (currentTransform.k !== viewport.zoom ||\n currentTransform.x !== viewport.x ||\n currentTransform.y !== viewport.y) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true });\n }\n }\n }\n function getViewport() {\n const transform = d3Selection ? zoomTransform(d3Selection.node()) : { x: 0, y: 0, k: 1 };\n return { x: transform.x, y: transform.y, zoom: transform.k };\n }\n function scaleTo(zoom, options) {\n if (d3Selection) {\n return new Promise((resolve) => {\n d3ZoomInstance?.scaleTo(getD3Transition(d3Selection, options?.duration, () => resolve(true)), zoom);\n });\n }\n return Promise.resolve(false);\n }\n function scaleBy(factor, options) {\n if (d3Selection) {\n return new Promise((resolve) => {\n d3ZoomInstance?.scaleBy(getD3Transition(d3Selection, options?.duration, () => resolve(true)), factor);\n });\n }\n return Promise.resolve(false);\n }\n function setScaleExtent(scaleExtent) {\n d3ZoomInstance?.scaleExtent(scaleExtent);\n }\n function setTranslateExtent(translateExtent) {\n d3ZoomInstance?.translateExtent(translateExtent);\n }\n function setClickDistance(distance) {\n const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance;\n d3ZoomInstance?.clickDistance(validDistance);\n }\n return {\n update,\n destroy,\n setViewport,\n setViewportConstrained,\n getViewport,\n scaleTo,\n scaleBy,\n setScaleExtent,\n setTranslateExtent,\n syncViewport,\n setClickDistance,\n };\n}\n\n/**\n * Used to determine the variant of the resize control\n *\n * @public\n */\nvar ResizeControlVariant;\n(function (ResizeControlVariant) {\n ResizeControlVariant[\"Line\"] = \"line\";\n ResizeControlVariant[\"Handle\"] = \"handle\";\n})(ResizeControlVariant || (ResizeControlVariant = {}));\nconst XY_RESIZER_HANDLE_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];\nconst XY_RESIZER_LINE_POSITIONS = ['top', 'right', 'bottom', 'left'];\n\n/**\n * Get all connecting edges for a given set of nodes\n * @param width - new width of the node\n * @param prevWidth - previous width of the node\n * @param height - new height of the node\n * @param prevHeight - previous height of the node\n * @param affectsX - whether to invert the resize direction for the x axis\n * @param affectsY - whether to invert the resize direction for the y axis\n * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease\n */\nfunction getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }) {\n const deltaWidth = width - prevWidth;\n const deltaHeight = height - prevHeight;\n const direction = [deltaWidth > 0 ? 1 : deltaWidth < 0 ? -1 : 0, deltaHeight > 0 ? 1 : deltaHeight < 0 ? -1 : 0];\n if (deltaWidth && affectsX) {\n direction[0] = direction[0] * -1;\n }\n if (deltaHeight && affectsY) {\n direction[1] = direction[1] * -1;\n }\n return direction;\n}\n/**\n * Parses the control position that is being dragged to dimensions that are being resized\n * @param controlPosition - position of the control that is being dragged\n * @returns isHorizontal, isVertical, affectsX, affectsY,\n */\nfunction getControlDirection(controlPosition) {\n const isHorizontal = controlPosition.includes('right') || controlPosition.includes('left');\n const isVertical = controlPosition.includes('bottom') || controlPosition.includes('top');\n const affectsX = controlPosition.includes('left');\n const affectsY = controlPosition.includes('top');\n return {\n isHorizontal,\n isVertical,\n affectsX,\n affectsY,\n };\n}\nfunction getLowerExtentClamp(lowerExtent, lowerBound) {\n return Math.max(0, lowerBound - lowerExtent);\n}\nfunction getUpperExtentClamp(upperExtent, upperBound) {\n return Math.max(0, upperExtent - upperBound);\n}\nfunction getSizeClamp(size, minSize, maxSize) {\n return Math.max(0, minSize - size, size - maxSize);\n}\nfunction xor(a, b) {\n return a ? !b : b;\n}\n/**\n * Calculates new width & height and x & y of node after resize based on pointer position\n * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize,\n * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed\n * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes\n * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio!\n * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the\n * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio,\n * the resize amount is always kept in distX & distY amount (the distance in mouse movement)\n * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values.\n * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0],\n * then calculating the restrictions as usual\n * @param startValues - starting values of resize\n * @param controlDirection - dimensions affected by the resize\n * @param pointerPosition - the current pointer position corrected for snapping\n * @param boundaries - minimum and maximum dimensions of the node\n * @param keepAspectRatio - prevent changes of asprect ratio\n * @returns x, y, width and height of the node after resize\n */\nfunction getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, extent, childExtent) {\n let { affectsX, affectsY } = controlDirection;\n const { isHorizontal, isVertical } = controlDirection;\n const isDiagonal = isHorizontal && isVertical;\n const { xSnapped, ySnapped } = pointerPosition;\n const { minWidth, maxWidth, minHeight, maxHeight } = boundaries;\n const { x: startX, y: startY, width: startWidth, height: startHeight, aspectRatio } = startValues;\n let distX = Math.floor(isHorizontal ? xSnapped - startValues.pointerX : 0);\n let distY = Math.floor(isVertical ? ySnapped - startValues.pointerY : 0);\n const newWidth = startWidth + (affectsX ? -distX : distX);\n const newHeight = startHeight + (affectsY ? -distY : distY);\n const originOffsetX = -nodeOrigin[0] * startWidth;\n const originOffsetY = -nodeOrigin[1] * startHeight;\n // Check if maxWidth, minWWidth, maxHeight, minHeight are restricting the resize\n let clampX = getSizeClamp(newWidth, minWidth, maxWidth);\n let clampY = getSizeClamp(newHeight, minHeight, maxHeight);\n // Check if extent is restricting the resize\n if (extent) {\n let xExtentClamp = 0;\n let yExtentClamp = 0;\n if (affectsX && distX < 0) {\n xExtentClamp = getLowerExtentClamp(startX + distX + originOffsetX, extent[0][0]);\n }\n else if (!affectsX && distX > 0) {\n xExtentClamp = getUpperExtentClamp(startX + newWidth + originOffsetX, extent[1][0]);\n }\n if (affectsY && distY < 0) {\n yExtentClamp = getLowerExtentClamp(startY + distY + originOffsetY, extent[0][1]);\n }\n else if (!affectsY && distY > 0) {\n yExtentClamp = getUpperExtentClamp(startY + newHeight + originOffsetY, extent[1][1]);\n }\n clampX = Math.max(clampX, xExtentClamp);\n clampY = Math.max(clampY, yExtentClamp);\n }\n // Check if the child extent is restricting the resize\n if (childExtent) {\n let xExtentClamp = 0;\n let yExtentClamp = 0;\n if (affectsX && distX > 0) {\n xExtentClamp = getUpperExtentClamp(startX + distX, childExtent[0][0]);\n }\n else if (!affectsX && distX < 0) {\n xExtentClamp = getLowerExtentClamp(startX + newWidth, childExtent[1][0]);\n }\n if (affectsY && distY > 0) {\n yExtentClamp = getUpperExtentClamp(startY + distY, childExtent[0][1]);\n }\n else if (!affectsY && distY < 0) {\n yExtentClamp = getLowerExtentClamp(startY + newHeight, childExtent[1][1]);\n }\n clampX = Math.max(clampX, xExtentClamp);\n clampY = Math.max(clampY, yExtentClamp);\n }\n // Check if the aspect ratio resizing of the other side is restricting the resize\n if (keepAspectRatio) {\n if (isHorizontal) {\n // Check if the max dimensions might be restricting the resize\n const aspectHeightClamp = getSizeClamp(newWidth / aspectRatio, minHeight, maxHeight) * aspectRatio;\n clampX = Math.max(clampX, aspectHeightClamp);\n // Check if the extent is restricting the resize\n if (extent) {\n let aspectExtentClamp = 0;\n if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {\n aspectExtentClamp =\n getUpperExtentClamp(startY + originOffsetY + newWidth / aspectRatio, extent[1][1]) * aspectRatio;\n }\n else {\n aspectExtentClamp =\n getLowerExtentClamp(startY + originOffsetY + (affectsX ? distX : -distX) / aspectRatio, extent[0][1]) *\n aspectRatio;\n }\n clampX = Math.max(clampX, aspectExtentClamp);\n }\n // Check if the child extent is restricting the resize\n if (childExtent) {\n let aspectExtentClamp = 0;\n if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {\n aspectExtentClamp = getLowerExtentClamp(startY + newWidth / aspectRatio, childExtent[1][1]) * aspectRatio;\n }\n else {\n aspectExtentClamp =\n getUpperExtentClamp(startY + (affectsX ? distX : -distX) / aspectRatio, childExtent[0][1]) * aspectRatio;\n }\n clampX = Math.max(clampX, aspectExtentClamp);\n }\n }\n // Do the same thing for vertical resizing\n if (isVertical) {\n const aspectWidthClamp = getSizeClamp(newHeight * aspectRatio, minWidth, maxWidth) / aspectRatio;\n clampY = Math.max(clampY, aspectWidthClamp);\n if (extent) {\n let aspectExtentClamp = 0;\n if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {\n aspectExtentClamp =\n getUpperExtentClamp(startX + newHeight * aspectRatio + originOffsetX, extent[1][0]) / aspectRatio;\n }\n else {\n aspectExtentClamp =\n getLowerExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio + originOffsetX, extent[0][0]) /\n aspectRatio;\n }\n clampY = Math.max(clampY, aspectExtentClamp);\n }\n if (childExtent) {\n let aspectExtentClamp = 0;\n if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {\n aspectExtentClamp = getLowerExtentClamp(startX + newHeight * aspectRatio, childExtent[1][0]) / aspectRatio;\n }\n else {\n aspectExtentClamp =\n getUpperExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio, childExtent[0][0]) / aspectRatio;\n }\n clampY = Math.max(clampY, aspectExtentClamp);\n }\n }\n }\n distY = distY + (distY < 0 ? clampY : -clampY);\n distX = distX + (distX < 0 ? clampX : -clampX);\n if (keepAspectRatio) {\n if (isDiagonal) {\n if (newWidth > newHeight * aspectRatio) {\n distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio;\n }\n else {\n distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio;\n }\n }\n else {\n if (isHorizontal) {\n distY = distX / aspectRatio;\n affectsY = affectsX;\n }\n else {\n distX = distY * aspectRatio;\n affectsX = affectsY;\n }\n }\n }\n const x = affectsX ? startX + distX : startX;\n const y = affectsY ? startY + distY : startY;\n return {\n width: startWidth + (affectsX ? -distX : distX),\n height: startHeight + (affectsY ? -distY : distY),\n x: nodeOrigin[0] * distX * (!affectsX ? 1 : -1) + x,\n y: nodeOrigin[1] * distY * (!affectsY ? 1 : -1) + y,\n };\n}\n\nconst initPrevValues = { width: 0, height: 0, x: 0, y: 0 };\nconst initStartValues = {\n ...initPrevValues,\n pointerX: 0,\n pointerY: 0,\n aspectRatio: 1,\n};\nfunction nodeToParentExtent(node) {\n return [\n [0, 0],\n [node.measured.width, node.measured.height],\n ];\n}\nfunction nodeToChildExtent(child, parent, nodeOrigin) {\n const x = parent.position.x + child.position.x;\n const y = parent.position.y + child.position.y;\n const width = child.measured.width ?? 0;\n const height = child.measured.height ?? 0;\n const originOffsetX = nodeOrigin[0] * width;\n const originOffsetY = nodeOrigin[1] * height;\n return [\n [x - originOffsetX, y - originOffsetY],\n [x + width - originOffsetX, y + height - originOffsetY],\n ];\n}\nfunction XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {\n const selection = select(domNode);\n function update({ controlPosition, boundaries, keepAspectRatio, resizeDirection, onResizeStart, onResize, onResizeEnd, shouldResize, }) {\n let prevValues = { ...initPrevValues };\n let startValues = { ...initStartValues };\n const controlDirection = getControlDirection(controlPosition);\n let node = undefined;\n let containerBounds = null;\n let childNodes = [];\n let parentNode = undefined; // Needed to fix expandParent\n let parentExtent = undefined;\n let childExtent = undefined;\n const dragHandler = drag()\n .on('start', (event) => {\n const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, paneDomNode } = getStoreItems();\n node = nodeLookup.get(nodeId);\n if (!node) {\n return;\n }\n containerBounds = paneDomNode?.getBoundingClientRect() ?? null;\n const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, {\n transform,\n snapGrid,\n snapToGrid,\n containerBounds,\n });\n prevValues = {\n width: node.measured.width ?? 0,\n height: node.measured.height ?? 0,\n x: node.position.x ?? 0,\n y: node.position.y ?? 0,\n };\n startValues = {\n ...prevValues,\n pointerX: xSnapped,\n pointerY: ySnapped,\n aspectRatio: prevValues.width / prevValues.height,\n };\n parentNode = undefined;\n if (node.parentId && (node.extent === 'parent' || node.expandParent)) {\n parentNode = nodeLookup.get(node.parentId);\n parentExtent = parentNode && node.extent === 'parent' ? nodeToParentExtent(parentNode) : undefined;\n }\n /*\n * Collect all child nodes to correct their relative positions when top/left changes\n * Determine largest minimal extent the parent node is allowed to resize to\n */\n childNodes = [];\n childExtent = undefined;\n for (const [childId, child] of nodeLookup) {\n if (child.parentId === nodeId) {\n childNodes.push({\n id: childId,\n position: { ...child.position },\n extent: child.extent,\n });\n if (child.extent === 'parent' || child.expandParent) {\n const extent = nodeToChildExtent(child, node, child.origin ?? nodeOrigin);\n if (childExtent) {\n childExtent = [\n [Math.min(extent[0][0], childExtent[0][0]), Math.min(extent[0][1], childExtent[0][1])],\n [Math.max(extent[1][0], childExtent[1][0]), Math.max(extent[1][1], childExtent[1][1])],\n ];\n }\n else {\n childExtent = extent;\n }\n }\n }\n }\n onResizeStart?.(event, { ...prevValues });\n })\n .on('drag', (event) => {\n const { transform, snapGrid, snapToGrid, nodeOrigin: storeNodeOrigin } = getStoreItems();\n const pointerPosition = getPointerPosition(event.sourceEvent, {\n transform,\n snapGrid,\n snapToGrid,\n containerBounds,\n });\n const childChanges = [];\n if (!node) {\n return;\n }\n const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues;\n const change = {};\n const nodeOrigin = node.origin ?? storeNodeOrigin;\n const { width, height, x, y } = getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, parentExtent, childExtent);\n const isWidthChange = width !== prevWidth;\n const isHeightChange = height !== prevHeight;\n const isXPosChange = x !== prevX && isWidthChange;\n const isYPosChange = y !== prevY && isHeightChange;\n if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange) {\n return;\n }\n if (isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) {\n change.x = isXPosChange ? x : prevValues.x;\n change.y = isYPosChange ? y : prevValues.y;\n prevValues.x = change.x;\n prevValues.y = change.y;\n /*\n * when top/left changes, correct the relative positions of child nodes\n * so that they stay in the same position\n */\n if (childNodes.length > 0) {\n const xChange = x - prevX;\n const yChange = y - prevY;\n for (const childNode of childNodes) {\n childNode.position = {\n x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth),\n y: childNode.position.y - yChange + nodeOrigin[1] * (height - prevHeight),\n };\n childChanges.push(childNode);\n }\n }\n }\n if (isWidthChange || isHeightChange) {\n change.width =\n isWidthChange && (!resizeDirection || resizeDirection === 'horizontal') ? width : prevValues.width;\n change.height =\n isHeightChange && (!resizeDirection || resizeDirection === 'vertical') ? height : prevValues.height;\n prevValues.width = change.width;\n prevValues.height = change.height;\n }\n // Fix expandParent when resizing from top/left\n if (parentNode && node.expandParent) {\n const xLimit = nodeOrigin[0] * (change.width ?? 0);\n if (change.x && change.x < xLimit) {\n prevValues.x = xLimit;\n startValues.x = startValues.x - (change.x - xLimit);\n }\n const yLimit = nodeOrigin[1] * (change.height ?? 0);\n if (change.y && change.y < yLimit) {\n prevValues.y = yLimit;\n startValues.y = startValues.y - (change.y - yLimit);\n }\n }\n const direction = getResizeDirection({\n width: prevValues.width,\n prevWidth,\n height: prevValues.height,\n prevHeight,\n affectsX: controlDirection.affectsX,\n affectsY: controlDirection.affectsY,\n });\n const nextValues = { ...prevValues, direction };\n const callResize = shouldResize?.(event, nextValues);\n if (callResize === false) {\n return;\n }\n onResize?.(event, nextValues);\n onChange(change, childChanges);\n })\n .on('end', (event) => {\n onResizeEnd?.(event, { ...prevValues });\n onEnd?.({ ...prevValues });\n });\n selection.call(dragHandler);\n }\n function destroy() {\n selection.on('.drag', null);\n }\n return {\n update,\n destroy,\n };\n}\n\nexport { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgePosition, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getSmoothStepPath, getStraightPath, getViewportForBounds, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isMouseEvent, isNodeBase, isNumeric, isRectObject, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals, withResolvers };\n","<script>import { getContext } from 'svelte';\nimport cc from 'classcat';\nimport { Position, XYHandle, isMouseEvent, areConnectionMapsEqual, handleConnectionChange, ConnectionMode } from '@xyflow/system';\nimport { useStore } from '../../store';\nexport let id = undefined;\nexport let type = 'source';\nexport let position = Position.Top;\nexport let style = undefined;\nexport let isValidConnection = undefined;\nexport let onconnect = undefined;\nexport let ondisconnect = undefined;\n// @todo implement connectablestart, connectableend\n// export let isConnectableStart: $$Props['isConnectableStart'] = undefined;\n// export let isConnectableEnd: $$Props['isConnectableEnd'] = undefined;\nlet isConnectableProp = undefined;\nexport { isConnectableProp as isConnectable };\nlet className = undefined;\nexport { className as class };\n$: isTarget = type === 'target';\nconst nodeId = getContext('svelteflow__node_id');\nconst connectable = getContext('svelteflow__node_connectable');\n$: isConnectable = isConnectableProp !== undefined ? isConnectableProp : $connectable;\n$: handleId = id || null;\nconst store = useStore();\nconst { connectionMode, domNode, nodeLookup, connectionRadius, viewport, isValidConnection: isValidConnectionStore, lib, addEdge, onedgecreate, panBy, cancelConnection, updateConnection, autoPanOnConnect, edges, connectionLookup, onconnect: onConnectAction, onconnectstart: onConnectStartAction, onconnectend: onConnectEndAction, flowId, connection } = store;\nfunction onPointerDown(event) {\n const isMouseTriggered = isMouseEvent(event);\n if ((isMouseTriggered && event.button === 0) || !isMouseTriggered) {\n XYHandle.onPointerDown(event, {\n handleId,\n nodeId,\n isTarget,\n connectionRadius: $connectionRadius,\n domNode: $domNode,\n nodeLookup: $nodeLookup,\n connectionMode: $connectionMode,\n lib: $lib,\n autoPanOnConnect: $autoPanOnConnect,\n flowId: $flowId,\n isValidConnection: isValidConnection ?? $isValidConnectionStore,\n updateConnection,\n cancelConnection,\n panBy,\n onConnect: (connection) => {\n const edge = $onedgecreate ? $onedgecreate(connection) : connection;\n if (!edge) {\n return;\n }\n addEdge(edge);\n $onConnectAction?.(connection);\n },\n onConnectStart: (event, startParams) => {\n $onConnectStartAction?.(event, {\n nodeId: startParams.nodeId,\n handleId: startParams.handleId,\n handleType: startParams.handleType\n });\n },\n onConnectEnd: (event, connectionState) => {\n $onConnectEndAction?.(event, connectionState);\n },\n getTransform: () => [$viewport.x, $viewport.y, $viewport.zoom],\n getFromHandle: () => $connection.fromHandle\n });\n }\n}\nlet prevConnections = null;\nlet connections;\n$: if (onconnect || ondisconnect) {\n // connectionLookup is not reactive, so we use edges to get notified about updates\n $edges;\n connections = $connectionLookup.get(`${nodeId}-${type}${id ? `-${id}` : ''}`);\n}\n$: {\n if (prevConnections && !areConnectionMapsEqual(connections, prevConnections)) {\n const _connections = connections ?? new Map();\n handleConnectionChange(prevConnections, _connections, ondisconnect);\n handleConnectionChange(_connections, prevConnections, onconnect);\n }\n prevConnections = connections ?? new Map();\n}\n$: connectionInProcess = !!$connection.fromHandle;\n$: connectingFrom =\n $connection.fromHandle?.nodeId === nodeId &&\n $connection.fromHandle?.type === type &&\n $connection.fromHandle?.id === handleId;\n$: connectingTo =\n $connection.toHandle?.nodeId === nodeId &&\n $connection.toHandle?.type === type &&\n $connection.toHandle?.id === handleId;\n$: isPossibleEndHandle =\n $connectionMode === ConnectionMode.Strict\n ? $connection.fromHandle?.type !== type\n : nodeId !== $connection.fromHandle?.nodeId || handleId !== $connection.fromHandle?.id;\n$: valid = connectingTo && $connection.isValid;\n</script>\n\n<!--\n@component\nThe Handle component is the part of a node that can be used to connect nodes.\n-->\n<div\n data-handleid={handleId}\n data-nodeid={nodeId}\n data-handlepos={position}\n data-id=\"{$flowId}-{nodeId}-{id || null}-{type}\"\n class={cc([\n 'svelte-flow__handle',\n `svelte-flow__handle-${position}`,\n 'nodrag',\n 'nopan',\n position,\n className\n ])}\n class:valid\n class:connectingto={connectingTo}\n class:connectingfrom={connectingFrom}\n class:source={!isTarget}\n class:target={isTarget}\n class:connectablestart={isConnectable}\n class:connectableend={isConnectable}\n class:connectable={isConnectable}\n class:connectionindicator={isConnectable && (!connectionInProcess || isPossibleEndHandle)}\n on:mousedown={onPointerDown}\n on:touchstart={onPointerDown}\n {style}\n role=\"button\"\n tabindex=\"-1\"\n>\n <slot />\n</div>\n","<script>import { Position } from '@xyflow/system';\nimport { Handle } from '../Handle';\nexport let data = { label: 'Node' };\nexport let targetPosition = undefined;\nexport let sourcePosition = undefined;\n// this is a workaround for suppressing the warning about unused props\n$$restProps;\n</script>\n\n<Handle type=\"target\" position={targetPosition ?? Position.Top} />\n{data?.label}\n<Handle type=\"source\" position={sourcePosition ?? Position.Bottom} />\n","<script>import { Position } from '@xyflow/system';\nimport { Handle } from '../Handle';\nexport let data = { label: 'Node' };\nexport let sourcePosition = undefined;\n// this is a workaround for suppressing the warning about unused props\n$$restProps;\n</script>\n\n{data?.label}\n<Handle type=\"source\" position={sourcePosition ?? Position.Bottom} />\n","<script>import { Position } from '@xyflow/system';\nimport { Handle } from '../Handle';\nexport let data = { label: 'Node' };\nexport let targetPosition = undefined;\n// this is a workaround for suppressing the warning about unused props\n$$restProps;\n</script>\n\n{data?.label}\n<Handle type=\"target\" position={targetPosition ?? Position.Top} />\n","<script>// this is a workaround for suppressing the warning about unused props\n$$restProps;\nexport {};\n</script>\n","function tryToMount(node, domNode, target) {\n if (!domNode) {\n return;\n }\n const targetEl = target ? domNode.querySelector(target) : domNode;\n if (targetEl) {\n targetEl.appendChild(node);\n }\n}\nexport default function (node, { target, domNode }) {\n tryToMount(node, domNode, target);\n return {\n async update({ target, domNode }) {\n tryToMount(node, domNode, target);\n },\n destroy() {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n };\n}\n","<script>import portal from '../../actions/portal';\nimport { useStore } from '../../store';\nconst { domNode } = useStore();\n</script>\n\n<div use:portal={{ target: '.svelte-flow__edgelabel-renderer', domNode: $domNode }}>\n <slot />\n</div>\n","import { get } from 'svelte/store';\nimport { errorMessages } from '@xyflow/system';\nimport { useStore } from '../store';\nexport function useHandleEdgeSelect() {\n const { edgeLookup, selectionRect, selectionRectMode, multiselectionKeyPressed, addSelectedEdges, unselectNodesAndEdges, elementsSelectable } = useStore();\n return (id) => {\n const edge = get(edgeLookup).get(id);\n if (!edge) {\n console.warn('012', errorMessages['error012'](id));\n return;\n }\n const selectable = edge.selectable || (get(elementsSelectable) && typeof edge.selectable === 'undefined');\n if (selectable) {\n selectionRect.set(null);\n selectionRectMode.set(null);\n if (!edge.selected) {\n addSelectedEdges([id]);\n }\n else if (edge.selected && get(multiselectionKeyPressed)) {\n unselectNodesAndEdges({ nodes: [], edges: [edge] });\n }\n }\n };\n}\n","<script>import { getContext } from 'svelte';\nimport { EdgeLabelRenderer } from '../EdgeLabelRenderer';\nimport { useHandleEdgeSelect } from '../../hooks/useHandleEdgeSelect';\nexport let style = undefined;\nexport let x = undefined;\nexport let y = undefined;\nconst handleEdgeSelect = useHandleEdgeSelect();\nconst id = getContext('svelteflow__edge_id');\n</script>\n\n<EdgeLabelRenderer>\n <div\n class=\"svelte-flow__edge-label\"\n style:transform=\"translate(-50%, -50%) translate({x}px,{y}px)\"\n style={'pointer-events: all;' + style}\n role=\"button\"\n tabindex=\"-1\"\n on:keyup={() => {}}\n on:click={() => {\n if (id) handleEdgeSelect(id);\n }}\n >\n <slot />\n </div>\n</EdgeLabelRenderer>\n","<script>import cc from 'classcat';\nimport EdgeLabel from '../EdgeLabel/EdgeLabel.svelte';\nexport let id = undefined;\nexport let path;\nexport let label = undefined;\nexport let labelX = undefined;\nexport let labelY = undefined;\nexport let labelStyle = undefined;\nexport let markerStart = undefined;\nexport let markerEnd = undefined;\nexport let style = undefined;\nexport let interactionWidth = 20;\nlet className = undefined;\nexport { className as class };\nlet interactionWidthValue = interactionWidth === undefined ? 20 : interactionWidth;\n</script>\n\n<path\n {id}\n d={path}\n class={cc(['svelte-flow__edge-path', className])}\n marker-start={markerStart}\n marker-end={markerEnd}\n fill=\"none\"\n {style}\n/>\n\n{#if interactionWidthValue}\n <path\n d={path}\n stroke-opacity={0}\n stroke-width={interactionWidthValue}\n fill=\"none\"\n class=\"svelte-flow__edge-interaction\"\n />\n{/if}\n\n{#if label}\n <EdgeLabel x={labelX} y={labelY} style={labelStyle}>\n {label}\n </EdgeLabel>\n{/if}\n","<script>import { getBezierPath } from '@xyflow/system';\nimport { BaseEdge } from '../BaseEdge';\nexport let label = undefined;\nexport let labelStyle = undefined;\nexport let style = undefined;\nexport let markerStart = undefined;\nexport let markerEnd = undefined;\nexport let interactionWidth = undefined;\nexport let sourceX;\nexport let sourceY;\nexport let sourcePosition;\nexport let targetX;\nexport let targetY;\nexport let targetPosition;\n$: [path, labelX, labelY] = getBezierPath({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition\n});\n// this is a workaround for suppressing the warning about unused props\n$$restProps;\n</script>\n\n<BaseEdge\n {path}\n {labelX}\n {labelY}\n {label}\n {labelStyle}\n {markerStart}\n {markerEnd}\n {interactionWidth}\n {style}\n/>\n","<script>import { getSmoothStepPath } from '@xyflow/system';\nimport { BaseEdge } from '../BaseEdge';\nexport let label = undefined;\nexport let labelStyle = undefined;\nexport let style = undefined;\nexport let markerStart = undefined;\nexport let markerEnd = undefined;\nexport let interactionWidth = undefined;\nexport let sourceX;\nexport let sourceY;\nexport let sourcePosition;\nexport let targetX;\nexport let targetY;\nexport let targetPosition;\n$: [path, labelX, labelY] = getSmoothStepPath({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition\n});\n// this is a workaround for suppressing the warning about unused props\n$$restProps;\n</script>\n\n<BaseEdge\n {path}\n {labelX}\n {labelY}\n {label}\n {labelStyle}\n {markerStart}\n {markerEnd}\n {interactionWidth}\n {style}\n/>\n","<script>import { getStraightPath } from '@xyflow/system';\nimport { BaseEdge } from '../BaseEdge';\nexport let label = undefined;\nexport let labelStyle = undefined;\nexport let style = undefined;\nexport let markerStart = undefined;\nexport let markerEnd = undefined;\nexport let interactionWidth = undefined;\nexport let sourceX;\nexport let sourceY;\nexport let targetX;\nexport let targetY;\n$: [path, labelX, labelY] = getStraightPath({\n sourceX,\n sourceY,\n targetX,\n targetY\n});\n// this is a workaround for suppressing the warning about unused props\n$$restProps;\n</script>\n\n<BaseEdge\n {path}\n {labelX}\n {labelY}\n {label}\n {labelStyle}\n {markerStart}\n {markerEnd}\n {interactionWidth}\n {style}\n/>\n","<script>import { getSmoothStepPath } from '@xyflow/system';\nimport { BaseEdge } from '../BaseEdge';\nexport let label = undefined;\nexport let labelStyle = undefined;\nexport let style = undefined;\nexport let markerStart = undefined;\nexport let markerEnd = undefined;\nexport let interactionWidth = undefined;\nexport let sourceX;\nexport let sourceY;\nexport let sourcePosition;\nexport let targetX;\nexport let targetY;\nexport let targetPosition;\n$: [path, labelX, labelY] = getSmoothStepPath({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition,\n borderRadius: 0\n});\n// this is a workaround for suppressing the warning about unused props\n$$restProps;\n</script>\n\n<BaseEdge\n {path}\n {labelX}\n {labelY}\n {label}\n {labelStyle}\n {markerStart}\n {markerEnd}\n {interactionWidth}\n {style}\n/>\n","import { writable, get } from 'svelte/store';\nimport { adoptUserNodes, updateConnectionLookup, infiniteExtent, fitViewport, withResolvers } from '@xyflow/system';\n// we need to sync the user nodes and the internal nodes so that the user can receive the updates\n// made by Svelte Flow (like dragging or selecting a node).\nexport function syncNodeStores(nodesStore, userNodesStore) {\n const nodesStoreSetter = nodesStore.set;\n const userNodesStoreSetter = userNodesStore.set;\n const currentNodesStore = get(nodesStore);\n const currentUserNodesStore = get(userNodesStore);\n // depending how the user initializes the nodes, we need to decide if we want to use\n // the user nodes or the internal nodes for initialization. A user can use a SvelteFlowProvider\n // without providing any nodes, in that case we want to use the nodes passed by the user.\n // By default we are using the store nodes, because they already have the absolute positions.\n const initWithUserNodes = currentNodesStore.length === 0 && currentUserNodesStore.length > 0;\n let val = initWithUserNodes ? currentUserNodesStore : currentNodesStore;\n nodesStore.set(val);\n const _set = (nds) => {\n const updatedNodes = nodesStoreSetter(nds);\n val = updatedNodes;\n userNodesStoreSetter(val);\n return updatedNodes;\n };\n nodesStore.set = userNodesStore.set = _set;\n nodesStore.update = userNodesStore.update = (fn) => _set(fn(val));\n}\n// same for edges\nexport function syncEdgeStores(edgesStore, userEdgesStore) {\n const nodesStoreSetter = edgesStore.set;\n const userEdgesStoreSetter = userEdgesStore.set;\n let val = get(userEdgesStore);\n edgesStore.set(val);\n const _set = (eds) => {\n nodesStoreSetter(eds);\n userEdgesStoreSetter(eds);\n val = eds;\n };\n edgesStore.set = userEdgesStore.set = _set;\n edgesStore.update = userEdgesStore.update = (fn) => _set(fn(val));\n}\n// it is possible to pass a viewport store to SvelteFlow for having more control\n// if that's the case we need to sync the internal viewport with the user viewport\nexport const syncViewportStores = (panZoomStore, viewportStore, userViewportStore) => {\n if (!userViewportStore) {\n return;\n }\n const panZoom = get(panZoomStore);\n const viewportStoreSetter = viewportStore.set;\n const userViewportStoreSetter = userViewportStore.set;\n let val = userViewportStore ? get(userViewportStore) : { x: 0, y: 0, zoom: 1 };\n viewportStore.set(val);\n viewportStore.set = (vp) => {\n viewportStoreSetter(vp);\n userViewportStoreSetter(vp);\n val = vp;\n return vp;\n };\n userViewportStore.set = (vp) => {\n panZoom?.syncViewport(vp);\n viewportStoreSetter(vp);\n userViewportStoreSetter(vp);\n val = vp;\n return vp;\n };\n viewportStore.update = (fn) => {\n viewportStore.set(fn(val));\n };\n userViewportStore.update = (fn) => {\n userViewportStore.set(fn(val));\n };\n};\n// we are creating a custom store for the internals nodes in order to update the zIndex and positionAbsolute.\n// The user only passes in relative positions, so we need to calculate the absolute positions based on the parent nodes.\nexport const createNodesStore = (nodes, nodeLookup, parentLookup, nodeOrigin = [0, 0], nodeExtent = infiniteExtent, fitViewQueued, fitViewOptions, fitViewResolver, panZoom, width, height, minZoom, maxZoom) => {\n const { subscribe, set, update } = writable([]);\n let value = nodes;\n let defaults = {};\n let elevateNodesOnSelect = true;\n const _set = (nds) => {\n const nodesInitialized = adoptUserNodes(nds, nodeLookup, parentLookup, {\n elevateNodesOnSelect,\n nodeOrigin,\n nodeExtent,\n defaults,\n checkEquality: false\n });\n if (get(fitViewQueued) && nodesInitialized && get(panZoom)) {\n const fitViewPromise = fitViewport({\n nodes: nodeLookup,\n width: get(width),\n height: get(height),\n panZoom: get(panZoom),\n minZoom: get(minZoom),\n maxZoom: get(maxZoom)\n }, get(fitViewOptions));\n fitViewPromise.then((value) => {\n get(fitViewResolver)?.resolve(value);\n fitViewResolver.set(null);\n });\n fitViewQueued.set(false);\n fitViewOptions.set(undefined);\n }\n value = nds;\n set(value);\n return value;\n };\n const _update = (fn) => _set(fn(value));\n const setDefaultOptions = (options) => {\n defaults = options;\n };\n const setOptions = (options) => {\n elevateNodesOnSelect = options.elevateNodesOnSelect ?? elevateNodesOnSelect;\n };\n _set(value);\n return {\n subscribe,\n set: _set,\n update: _update,\n setDefaultOptions,\n setOptions\n };\n};\nexport const createEdgesStore = (edges, connectionLookup, edgeLookup, defaultOptions) => {\n const { subscribe, set, update } = writable([]);\n let value = edges;\n let defaults = defaultOptions || {};\n const _set = (eds) => {\n const nextEdges = defaults ? eds.map((edge) => ({ ...defaults, ...edge })) : eds;\n updateConnectionLookup(connectionLookup, edgeLookup, nextEdges);\n value = nextEdges;\n set(value);\n };\n const _update = (fn) => _set(fn(value));\n const setDefaultOptions = (options) => {\n defaults = options;\n };\n _set(value);\n return {\n subscribe,\n set: _set,\n update: _update,\n setDefaultOptions\n };\n};\n","import { readable, writable } from 'svelte/store';\nimport { infiniteExtent, SelectionMode, ConnectionMode, ConnectionLineType, devWarn, adoptUserNodes, getViewportForBounds, updateConnectionLookup, initialConnection, getInternalNodesBounds, withResolvers } from '@xyflow/system';\nimport DefaultNode from '../components/nodes/DefaultNode.svelte';\nimport InputNode from '../components/nodes/InputNode.svelte';\nimport OutputNode from '../components/nodes/OutputNode.svelte';\nimport GroupNode from '../components/nodes/GroupNode.svelte';\nimport { BezierEdgeInternal, SmoothStepEdgeInternal, StraightEdgeInternal, StepEdgeInternal } from '../components/edges';\nimport { createNodesStore, createEdgesStore } from './utils';\nexport const initialNodeTypes = {\n input: InputNode,\n output: OutputNode,\n default: DefaultNode,\n group: GroupNode\n};\nexport const initialEdgeTypes = {\n straight: StraightEdgeInternal,\n smoothstep: SmoothStepEdgeInternal,\n default: BezierEdgeInternal,\n step: StepEdgeInternal\n};\nexport const getInitialStore = ({ nodes = [], edges = [], width, height, fitView, nodeOrigin, nodeExtent }) => {\n const nodeLookup = new Map();\n const parentLookup = new Map();\n const connectionLookup = new Map();\n const edgeLookup = new Map();\n const storeNodeOrigin = nodeOrigin ?? [0, 0];\n const storeNodeExtent = nodeExtent ?? infiniteExtent;\n adoptUserNodes(nodes, nodeLookup, parentLookup, {\n nodeExtent: storeNodeExtent,\n nodeOrigin: storeNodeOrigin,\n elevateNodesOnSelect: false,\n checkEquality: false\n });\n updateConnectionLookup(connectionLookup, edgeLookup, edges);\n let viewport = { x: 0, y: 0, zoom: 1 };\n if (fitView && width && height) {\n const bounds = getInternalNodesBounds(nodeLookup, {\n filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight))\n });\n viewport = getViewportForBounds(bounds, width, height, 0.5, 2, 0.1);\n }\n const fitViewQueued = writable(false);\n const fitViewOptions = writable(undefined);\n const fitViewResolver = writable(null);\n const panZoom = writable(null);\n const widthStore = writable(500);\n const heightStore = writable(500);\n const minZoom = writable(0.5);\n const maxZoom = writable(2);\n return {\n flowId: writable(null),\n nodes: createNodesStore(nodes, nodeLookup, parentLookup, storeNodeOrigin, storeNodeExtent, fitViewQueued, fitViewOptions, fitViewResolver, panZoom, widthStore, heightStore, minZoom, maxZoom),\n nodeLookup: readable(nodeLookup),\n parentLookup: readable(parentLookup),\n edgeLookup: readable(edgeLookup),\n visibleNodes: readable([]),\n edges: createEdgesStore(edges, connectionLookup, edgeLookup),\n visibleEdges: readable([]),\n connectionLookup: readable(connectionLookup),\n width: widthStore,\n height: heightStore,\n minZoom,\n maxZoom,\n nodeOrigin: writable(storeNodeOrigin),\n nodeDragThreshold: writable(1),\n nodeExtent: writable(storeNodeExtent),\n translateExtent: writable(infiniteExtent),\n autoPanOnNodeDrag: writable(true),\n autoPanOnConnect: writable(true),\n fitViewQueued,\n fitViewOptions,\n fitViewResolver,\n panZoom,\n snapGrid: writable(null),\n dragging: writable(false),\n selectionRect: writable(null),\n selectionKeyPressed: writable(false),\n multiselectionKeyPressed: writable(false),\n deleteKeyPressed: writable(false),\n panActivationKeyPressed: writable(false),\n zoomActivationKeyPressed: writable(false),\n selectionRectMode: writable(null),\n selectionMode: writable(SelectionMode.Partial),\n nodeTypes: writable(initialNodeTypes),\n edgeTypes: writable(initialEdgeTypes),\n viewport: writable(viewport),\n connectionMode: writable(ConnectionMode.Strict),\n domNode: writable(null),\n connection: readable(initialConnection),\n connectionLineType: writable(ConnectionLineType.Bezier),\n connectionRadius: writable(20),\n isValidConnection: writable(() => true),\n nodesDraggable: writable(true),\n nodesConnectable: writable(true),\n elementsSelectable: writable(true),\n selectNodesOnDrag: writable(true),\n markers: readable([]),\n defaultMarkerColor: writable('#b1b1b7'),\n lib: readable('svelte'),\n onlyRenderVisibleElements: writable(false),\n onerror: writable(devWarn),\n ondelete: writable(undefined),\n onedgecreate: writable(undefined),\n onconnect: writable(undefined),\n onconnectstart: writable(undefined),\n onconnectend: writable(undefined),\n onbeforedelete: writable(undefined),\n nodesInitialized: writable(false),\n edgesInitialized: writable(false),\n viewportInitialized: writable(false),\n initialized: readable(false)\n };\n};\n","import { derived } from 'svelte/store';\nimport { isEdgeVisible, getEdgePosition, getElevatedEdgeZIndex } from '@xyflow/system';\nexport function getVisibleEdges(store) {\n const visibleEdges = derived([\n store.edges,\n store.nodes,\n store.nodeLookup,\n store.onlyRenderVisibleElements,\n store.viewport,\n store.width,\n store.height\n ], ([edges, , nodeLookup, onlyRenderVisibleElements, viewport, width, height]) => {\n const visibleEdges = onlyRenderVisibleElements && width && height\n ? edges.filter((edge) => {\n const sourceNode = nodeLookup.get(edge.source);\n const targetNode = nodeLookup.get(edge.target);\n return (sourceNode &&\n targetNode &&\n isEdgeVisible({\n sourceNode,\n targetNode,\n width,\n height,\n transform: [viewport.x, viewport.y, viewport.zoom]\n }));\n })\n : edges;\n return visibleEdges;\n });\n return derived([visibleEdges, store.nodes, store.nodeLookup, store.connectionMode, store.onerror], ([visibleEdges, , nodeLookup, connectionMode, onerror]) => {\n const layoutedEdges = visibleEdges.reduce((res, edge) => {\n const sourceNode = nodeLookup.get(edge.source);\n const targetNode = nodeLookup.get(edge.target);\n if (!sourceNode || !targetNode) {\n return res;\n }\n const edgePosition = getEdgePosition({\n id: edge.id,\n sourceNode,\n targetNode,\n sourceHandle: edge.sourceHandle || null,\n targetHandle: edge.targetHandle || null,\n connectionMode,\n onError: onerror\n });\n if (edgePosition) {\n res.push({\n ...edge,\n zIndex: getElevatedEdgeZIndex({\n selected: edge.selected,\n zIndex: edge.zIndex,\n sourceNode,\n targetNode,\n elevateOnSelect: false\n }),\n ...edgePosition\n });\n }\n return res;\n }, []);\n return layoutedEdges;\n });\n}\n","import { derived } from 'svelte/store';\nimport { getNodesInside } from '@xyflow/system';\nexport function getVisibleNodes(store) {\n return derived([\n store.nodeLookup,\n store.onlyRenderVisibleElements,\n store.width,\n store.height,\n store.viewport,\n store.nodes\n ], ([nodeLookup, onlyRenderVisibleElements, width, height, viewport]) => {\n const transform = [viewport.x, viewport.y, viewport.zoom];\n return onlyRenderVisibleElements\n ? getNodesInside(nodeLookup, { x: 0, y: 0, width, height }, transform, true)\n : Array.from(nodeLookup.values());\n });\n}\n","import { getContext, setContext } from 'svelte';\nimport { derived, get, writable } from 'svelte/store';\nimport { createMarkerIds, getElementsToRemove, panBy as panBySystem, updateNodeInternals as updateNodeInternalsSystem, addEdge as addEdgeUtil, initialConnection, errorMessages, pointToRendererPoint, updateAbsolutePositions, withResolvers } from '@xyflow/system';\nimport { initialEdgeTypes, initialNodeTypes, getInitialStore } from './initial-store';\nimport { syncNodeStores, syncEdgeStores, syncViewportStores } from './utils';\nimport { getVisibleEdges } from './visible-edges';\nimport { getVisibleNodes } from './visible-nodes';\nexport const key = Symbol();\nexport function createStore({ nodes, edges, width, height, fitView: fitViewOnCreate, nodeOrigin, nodeExtent }) {\n const store = getInitialStore({\n nodes,\n edges,\n width,\n height,\n fitView: fitViewOnCreate,\n nodeOrigin,\n nodeExtent\n });\n function setNodeTypes(nodeTypes) {\n store.nodeTypes.set({\n ...initialNodeTypes,\n ...nodeTypes\n });\n }\n function setEdgeTypes(edgeTypes) {\n store.edgeTypes.set({\n ...initialEdgeTypes,\n ...edgeTypes\n });\n }\n function addEdge(edgeParams) {\n const edges = get(store.edges);\n store.edges.set(addEdgeUtil(edgeParams, edges));\n }\n const updateNodePositions = (nodeDragItems, dragging = false) => {\n const nodeLookup = get(store.nodeLookup);\n for (const [id, dragItem] of nodeDragItems) {\n const node = nodeLookup.get(id)?.internals.userNode;\n if (!node) {\n continue;\n }\n node.position = dragItem.position;\n node.dragging = dragging;\n }\n store.nodes.update((nds) => nds);\n };\n function updateNodeInternals(updates) {\n const nodeLookup = get(store.nodeLookup);\n const parentLookup = get(store.parentLookup);\n const { changes, updatedInternals } = updateNodeInternalsSystem(updates, nodeLookup, get(store.parentLookup), get(store.domNode), get(store.nodeOrigin));\n if (!updatedInternals) {\n return;\n }\n updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin, nodeExtent });\n for (const change of changes) {\n const node = nodeLookup.get(change.id)?.internals.userNode;\n if (!node) {\n continue;\n }\n switch (change.type) {\n case 'dimensions': {\n const measured = { ...node.measured, ...change.dimensions };\n if (change.setAttributes) {\n node.width = change.dimensions?.width ?? node.width;\n node.height = change.dimensions?.height ?? node.height;\n }\n node.measured = measured;\n break;\n }\n case 'position':\n node.position = change.position ?? node.position;\n break;\n }\n }\n store.nodes.update((nds) => nds);\n if (!get(store.nodesInitialized)) {\n store.nodesInitialized.set(true);\n }\n }\n function fitView(options) {\n // We either create a new Promise or reuse the existing one\n // Even if fitView is called multiple times in a row, we only end up with a single Promise\n const fitViewResolver = get(store.fitViewResolver) ?? withResolvers();\n // We schedule a fitView by setting fitViewQueued and triggering a setNodes\n store.fitViewQueued.set(true);\n store.fitViewOptions.set(options);\n store.fitViewResolver.set(fitViewResolver);\n store.nodes.set(get(store.nodes));\n return fitViewResolver.promise;\n }\n function zoomBy(factor, options) {\n const panZoom = get(store.panZoom);\n if (!panZoom) {\n return Promise.resolve(false);\n }\n return panZoom.scaleBy(factor, options);\n }\n function zoomIn(options) {\n return zoomBy(1.2, options);\n }\n function zoomOut(options) {\n return zoomBy(1 / 1.2, options);\n }\n function setMinZoom(minZoom) {\n const panZoom = get(store.panZoom);\n if (panZoom) {\n panZoom.setScaleExtent([minZoom, get(store.maxZoom)]);\n store.minZoom.set(minZoom);\n }\n }\n function setMaxZoom(maxZoom) {\n const panZoom = get(store.panZoom);\n if (panZoom) {\n panZoom.setScaleExtent([get(store.minZoom), maxZoom]);\n store.maxZoom.set(maxZoom);\n }\n }\n function setTranslateExtent(extent) {\n const panZoom = get(store.panZoom);\n if (panZoom) {\n panZoom.setTranslateExtent(extent);\n store.translateExtent.set(extent);\n }\n }\n function resetSelectedElements(elements) {\n let elementsChanged = false;\n elements.forEach((element) => {\n if (element.selected) {\n element.selected = false;\n elementsChanged = true;\n }\n });\n return elementsChanged;\n }\n function setPaneClickDistance(distance) {\n get(store.panZoom)?.setClickDistance(distance);\n }\n function unselectNodesAndEdges(params) {\n const resetNodes = resetSelectedElements(params?.nodes || get(store.nodes));\n if (resetNodes)\n store.nodes.set(get(store.nodes));\n const resetEdges = resetSelectedElements(params?.edges || get(store.edges));\n if (resetEdges)\n store.edges.set(get(store.edges));\n }\n store.deleteKeyPressed.subscribe(async (deleteKeyPressed) => {\n if (deleteKeyPressed) {\n const nodes = get(store.nodes);\n const edges = get(store.edges);\n const selectedNodes = nodes.filter((node) => node.selected);\n const selectedEdges = edges.filter((edge) => edge.selected);\n const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({\n nodesToRemove: selectedNodes,\n edgesToRemove: selectedEdges,\n nodes,\n edges,\n onBeforeDelete: get(store.onbeforedelete)\n });\n if (matchingNodes.length || matchingEdges.length) {\n store.nodes.update((nds) => nds.filter((node) => !matchingNodes.some((mN) => mN.id === node.id)));\n store.edges.update((eds) => eds.filter((edge) => !matchingEdges.some((mE) => mE.id === edge.id)));\n get(store.ondelete)?.({\n nodes: matchingNodes,\n edges: matchingEdges\n });\n }\n }\n });\n function addSelectedNodes(ids) {\n const isMultiSelection = get(store.multiselectionKeyPressed);\n store.nodes.update((ns) => ns.map((node) => {\n const nodeWillBeSelected = ids.includes(node.id);\n const selected = isMultiSelection\n ? node.selected || nodeWillBeSelected\n : nodeWillBeSelected;\n // we need to mutate the node here in order to have the correct selected state in the drag handler\n node.selected = selected;\n return node;\n }));\n if (!isMultiSelection) {\n store.edges.update((es) => es.map((edge) => {\n edge.selected = false;\n return edge;\n }));\n }\n }\n function addSelectedEdges(ids) {\n const isMultiSelection = get(store.multiselectionKeyPressed);\n store.edges.update((edges) => edges.map((edge) => {\n const edgeWillBeSelected = ids.includes(edge.id);\n const selected = isMultiSelection\n ? edge.selected || edgeWillBeSelected\n : edgeWillBeSelected;\n edge.selected = selected;\n return edge;\n }));\n if (!isMultiSelection) {\n store.nodes.update((ns) => ns.map((node) => {\n node.selected = false;\n return node;\n }));\n }\n }\n function handleNodeSelection(id) {\n const node = get(store.nodes)?.find((n) => n.id === id);\n if (!node) {\n console.warn('012', errorMessages['error012'](id));\n return;\n }\n store.selectionRect.set(null);\n store.selectionRectMode.set(null);\n if (!node.selected) {\n addSelectedNodes([id]);\n }\n else if (node.selected && get(store.multiselectionKeyPressed)) {\n unselectNodesAndEdges({ nodes: [node], edges: [] });\n }\n }\n function panBy(delta) {\n const viewport = get(store.viewport);\n return panBySystem({\n delta,\n panZoom: get(store.panZoom),\n transform: [viewport.x, viewport.y, viewport.zoom],\n translateExtent: get(store.translateExtent),\n width: get(store.width),\n height: get(store.height)\n });\n }\n const _connection = writable(initialConnection);\n const updateConnection = (newConnection) => {\n _connection.set({ ...newConnection });\n };\n function cancelConnection() {\n _connection.set(initialConnection);\n }\n function reset() {\n store.selectionRect.set(null);\n store.selectionRectMode.set(null);\n store.snapGrid.set(null);\n store.isValidConnection.set(() => true);\n unselectNodesAndEdges();\n cancelConnection();\n }\n return {\n // state\n ...store,\n // derived state\n visibleEdges: getVisibleEdges(store),\n visibleNodes: getVisibleNodes(store),\n connection: derived([_connection, store.viewport], ([connection, viewport]) => {\n return connection.inProgress\n ? {\n ...connection,\n to: pointToRendererPoint(connection.to, [viewport.x, viewport.y, viewport.zoom])\n }\n : { ...connection };\n }),\n markers: derived([store.edges, store.defaultMarkerColor, store.flowId], ([edges, defaultColor, id]) => createMarkerIds(edges, { defaultColor, id })),\n initialized: (() => {\n let initialized = false;\n const initialNodesLength = get(store.nodes).length;\n const initialEdgesLength = get(store.edges).length;\n return derived([store.nodesInitialized, store.edgesInitialized, store.viewportInitialized], ([nodesInitialized, edgesInitialized, viewportInitialized]) => {\n // If it was already initialized, return true from then on\n if (initialized)\n return initialized;\n // if it hasn't been initialised check if it's now\n if (initialNodesLength === 0) {\n initialized = viewportInitialized;\n }\n else if (initialEdgesLength === 0) {\n initialized = viewportInitialized && nodesInitialized;\n }\n else {\n initialized = viewportInitialized && nodesInitialized && edgesInitialized;\n }\n return initialized;\n });\n })(),\n // actions\n syncNodeStores: (nodes) => syncNodeStores(store.nodes, nodes),\n syncEdgeStores: (edges) => syncEdgeStores(store.edges, edges),\n syncViewport: (viewport) => syncViewportStores(store.panZoom, store.viewport, viewport),\n setNodeTypes,\n setEdgeTypes,\n addEdge,\n updateNodePositions,\n updateNodeInternals,\n zoomIn,\n zoomOut,\n fitView: (options) => fitView(options),\n setMinZoom,\n setMaxZoom,\n setTranslateExtent,\n setPaneClickDistance,\n unselectNodesAndEdges,\n addSelectedNodes,\n addSelectedEdges,\n handleNodeSelection,\n panBy,\n updateConnection,\n cancelConnection,\n reset\n };\n}\nexport function useStore() {\n const store = getContext(key);\n if (!store) {\n throw new Error('In order to use useStore you need to wrap your component in a <SvelteFlowProvider />');\n }\n return store.getStore();\n}\nexport function createStoreContext({ nodes, edges, width, height, fitView, nodeOrigin, nodeExtent }) {\n const store = createStore({ nodes, edges, width, height, fitView, nodeOrigin, nodeExtent });\n setContext(key, {\n getStore: () => store\n });\n return store;\n}\n","import { PanOnScrollMode, XYPanZoom } from '@xyflow/system';\nexport default function zoom(domNode, params) {\n const { panZoom, minZoom, maxZoom, initialViewport, viewport, dragging, translateExtent, paneClickDistance } = params;\n const panZoomInstance = XYPanZoom({\n domNode,\n minZoom,\n maxZoom,\n translateExtent,\n viewport: initialViewport,\n paneClickDistance,\n onDraggingChange: dragging.set\n });\n const currentViewport = panZoomInstance.getViewport();\n viewport.set(currentViewport);\n panZoom.set(panZoomInstance);\n panZoomInstance.update(params);\n return {\n update(params) {\n panZoomInstance.update(params);\n }\n };\n}\n","<script>import { onMount } from 'svelte';\nimport { PanOnScrollMode } from '@xyflow/system';\nimport { useStore } from '../../store';\nimport zoom from '../../actions/zoom';\nexport let initialViewport = undefined;\nexport let onMoveStart = undefined;\nexport let onMove = undefined;\nexport let onMoveEnd = undefined;\nexport let panOnScrollMode;\nexport let preventScrolling;\nexport let zoomOnScroll;\nexport let zoomOnDoubleClick;\nexport let zoomOnPinch;\nexport let panOnDrag;\nexport let panOnScroll;\nexport let paneClickDistance;\nconst { viewport, panZoom, selectionRect, minZoom, maxZoom, dragging, translateExtent, lib, panActivationKeyPressed, zoomActivationKeyPressed, viewportInitialized } = useStore();\n$: viewPort = initialViewport || { x: 0, y: 0, zoom: 1 };\n$: _panOnDrag = $panActivationKeyPressed || panOnDrag;\n$: _panOnScroll = $panActivationKeyPressed || panOnScroll;\nconst onTransformChange = (transform) => viewport.set({ x: transform[0], y: transform[1], zoom: transform[2] });\nonMount(() => {\n $viewportInitialized = true;\n});\n</script>\n\n<div\n class=\"svelte-flow__zoom\"\n use:zoom={{\n viewport,\n minZoom: $minZoom,\n maxZoom: $maxZoom,\n initialViewport: viewPort,\n dragging,\n panZoom,\n onPanZoomStart: onMoveStart,\n onPanZoom: onMove,\n onPanZoomEnd: onMoveEnd,\n zoomOnScroll,\n zoomOnDoubleClick,\n zoomOnPinch,\n panOnScroll: _panOnScroll,\n panOnDrag: _panOnDrag,\n panOnScrollSpeed: 0.5,\n panOnScrollMode: panOnScrollMode || PanOnScrollMode.Free,\n zoomActivationKeyPressed: $zoomActivationKeyPressed,\n preventScrolling: typeof preventScrolling === 'boolean' ? preventScrolling : true,\n noPanClassName: 'nopan',\n noWheelClassName: 'nowheel',\n userSelectionActive: !!$selectionRect,\n translateExtent: $translateExtent,\n lib: $lib,\n paneClickDistance,\n onTransformChange\n }}\n>\n <slot />\n</div>\n\n<style>\n .svelte-flow__zoom {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 4;\n }\n</style>\n","<script context=\"module\">export function wrapHandler(handler, container) {\n return (event) => {\n if (event.target !== container) {\n return;\n }\n handler?.(event);\n };\n}\nexport function toggleSelected(ids) {\n return (item) => {\n const isSelected = ids.includes(item.id);\n if (item.selected !== isSelected) {\n item.selected = isSelected;\n }\n return item;\n };\n}\n</script>\n\n<script>import { createEventDispatcher } from 'svelte';\nimport { SelectionMode, getEventPosition, getNodesInside, getConnectedEdges } from '@xyflow/system';\nimport { useStore } from '../../store';\nexport let panOnDrag = undefined;\nexport let selectionOnDrag = undefined;\nconst dispatch = createEventDispatcher();\nconst { nodes, nodeLookup, edges, viewport, dragging, elementsSelectable, selectionRect, selectionRectMode, selectionKeyPressed, selectionMode, panActivationKeyPressed, unselectNodesAndEdges, connection, } = useStore();\nlet container;\nlet containerBounds = null;\nlet selectedNodes = [];\n$: _panOnDrag = $panActivationKeyPressed || panOnDrag;\n$: isSelecting =\n $selectionKeyPressed || $selectionRect || (selectionOnDrag && _panOnDrag !== true);\n$: hasActiveSelection = $elementsSelectable && (isSelecting || $selectionRectMode === 'user');\n// Used to prevent click events when the user lets go of the selectionKey during a selection\nlet selectionInProgress = false;\nfunction onClick(event) {\n // We prevent click events when the user let go of the selectionKey during a selection\n // We also prevent click events when a connection is in progress\n if (selectionInProgress || $connection.inProgress) {\n selectionInProgress = false;\n return;\n }\n dispatch('paneclick', { event });\n unselectNodesAndEdges();\n selectionRectMode.set(null);\n}\nfunction onPointerDown(event) {\n containerBounds = container.getBoundingClientRect();\n if (!elementsSelectable ||\n !isSelecting ||\n event.button !== 0 ||\n event.target !== container ||\n !containerBounds) {\n return;\n }\n event.target?.setPointerCapture?.(event.pointerId);\n const { x, y } = getEventPosition(event, containerBounds);\n unselectNodesAndEdges();\n selectionRect.set({\n width: 0,\n height: 0,\n startX: x,\n startY: y,\n x,\n y\n });\n // onSelectionStart?.(event);\n}\nfunction onPointerMove(event) {\n if (!isSelecting || !containerBounds || !$selectionRect) {\n return;\n }\n selectionInProgress = true;\n const mousePos = getEventPosition(event, containerBounds);\n const startX = $selectionRect.startX ?? 0;\n const startY = $selectionRect.startY ?? 0;\n const nextUserSelectRect = {\n ...$selectionRect,\n x: mousePos.x < startX ? mousePos.x : startX,\n y: mousePos.y < startY ? mousePos.y : startY,\n width: Math.abs(mousePos.x - startX),\n height: Math.abs(mousePos.y - startY)\n };\n const prevSelectedNodeIds = selectedNodes.map((n) => n.id);\n const prevSelectedEdgeIds = getConnectedEdges(selectedNodes, $edges).map((e) => e.id);\n selectedNodes = getNodesInside($nodeLookup, nextUserSelectRect, [$viewport.x, $viewport.y, $viewport.zoom], $selectionMode === SelectionMode.Partial, true);\n const selectedEdgeIds = getConnectedEdges(selectedNodes, $edges).map((e) => e.id);\n const selectedNodeIds = selectedNodes.map((n) => n.id);\n // this prevents unnecessary updates while updating the selection rectangle\n if (prevSelectedNodeIds.length !== selectedNodeIds.length ||\n selectedNodeIds.some((id) => !prevSelectedNodeIds.includes(id))) {\n nodes.update((nodes) => nodes.map(toggleSelected(selectedNodeIds)));\n }\n if (prevSelectedEdgeIds.length !== selectedEdgeIds.length ||\n selectedEdgeIds.some((id) => !prevSelectedEdgeIds.includes(id))) {\n edges.update((edges) => edges.map(toggleSelected(selectedEdgeIds)));\n }\n selectionRectMode.set('user');\n selectionRect.set(nextUserSelectRect);\n}\nfunction onPointerUp(event) {\n if (event.button !== 0) {\n return;\n }\n event.target?.releasePointerCapture?.(event.pointerId);\n // We only want to trigger click functions when in selection mode if\n // the user did not move the mouse.\n if (!isSelecting && $selectionRectMode === 'user' && event.target === container) {\n onClick?.(event);\n }\n selectionRect.set(null);\n if (selectedNodes.length > 0) {\n $selectionRectMode = 'nodes';\n }\n // If the user kept holding the selectionKey during the selection,\n // we need to reset the selectionInProgress, so the next click event is not prevented\n if ($selectionKeyPressed) {\n selectionInProgress = false;\n }\n // onSelectionEnd?.(event);\n}\nconst onContextMenu = (event) => {\n if (Array.isArray(_panOnDrag) && _panOnDrag?.includes(2)) {\n event.preventDefault();\n return;\n }\n dispatch('panecontextmenu', { event });\n};\n</script>\n\n<!-- svelte-ignore a11y-no-static-element-interactions -->\n<!-- svelte-ignore a11y-click-events-have-key-events -->\n<div\n bind:this={container}\n class=\"svelte-flow__pane\"\n class:draggable={panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0))}\n class:dragging={$dragging}\n class:selection={isSelecting}\n on:click={hasActiveSelection ? undefined : wrapHandler(onClick, container)}\n on:pointerdown={hasActiveSelection ? onPointerDown : undefined}\n on:pointermove={hasActiveSelection ? onPointerMove : undefined}\n on:pointerup={hasActiveSelection ? onPointerUp : undefined}\n on:contextmenu={wrapHandler(onContextMenu, container)}\n>\n <slot />\n</div>\n\n<style>\n .svelte-flow__pane {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n</style>\n","<script>import { useStore } from '../../store';\nconst { viewport } = useStore();\n</script>\n\n<div\n class=\"svelte-flow__viewport xyflow__viewport\"\n style=\"transform: translate({$viewport.x}px, {$viewport.y}px) scale({$viewport.zoom})\"\n>\n <slot />\n</div>\n\n<style>\n .svelte-flow__viewport {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n</style>\n","import { get } from 'svelte/store';\nimport { XYDrag } from '@xyflow/system';\nexport default function drag(domNode, params) {\n const { store, onDrag, onDragStart, onDragStop, onNodeMouseDown } = params;\n const dragInstance = XYDrag({\n onDrag,\n onDragStart,\n onDragStop,\n onNodeMouseDown,\n getStoreItems: () => {\n const snapGrid = get(store.snapGrid);\n const vp = get(store.viewport);\n return {\n nodes: get(store.nodes),\n nodeLookup: get(store.nodeLookup),\n edges: get(store.edges),\n nodeExtent: get(store.nodeExtent),\n snapGrid: snapGrid ? snapGrid : [0, 0],\n snapToGrid: !!snapGrid,\n nodeOrigin: get(store.nodeOrigin),\n multiSelectionActive: get(store.multiselectionKeyPressed),\n domNode: get(store.domNode),\n transform: [vp.x, vp.y, vp.zoom],\n autoPanOnNodeDrag: get(store.autoPanOnNodeDrag),\n nodesDraggable: get(store.nodesDraggable),\n selectNodesOnDrag: get(store.selectNodesOnDrag),\n nodeDragThreshold: get(store.nodeDragThreshold),\n unselectNodesAndEdges: store.unselectNodesAndEdges,\n updateNodePositions: store.updateNodePositions,\n panBy: store.panBy\n };\n }\n });\n function updateDrag(domNode, params) {\n if (params.disabled) {\n dragInstance.destroy();\n return;\n }\n dragInstance.update({\n domNode,\n noDragClassName: params.noDragClass,\n handleSelector: params.handleSelector,\n nodeId: params.nodeId,\n isSelectable: params.isSelectable,\n nodeClickDistance: params.nodeClickDistance\n });\n }\n updateDrag(domNode, params);\n return {\n update(params) {\n updateDrag(domNode, params);\n },\n destroy() {\n dragInstance.destroy();\n }\n };\n}\n","export function getNodeInlineStyleDimensions({ width, height, initialWidth, initialHeight, measuredWidth, measuredHeight }) {\n if (measuredWidth === undefined && measuredHeight === undefined) {\n const styleWidth = width ?? initialWidth;\n const styleHeight = height ?? initialHeight;\n return {\n width: styleWidth ? `width:${styleWidth}px;` : '',\n height: styleHeight ? `height:${styleHeight}px;` : ''\n };\n }\n return {\n width: width ? `width:${width}px;` : '',\n height: height ? `height:${height}px;` : ''\n };\n}\n","<svelte:options immutable />\n\n<script>import { setContext, onDestroy, createEventDispatcher } from 'svelte';\nimport { get, writable } from 'svelte/store';\nimport cc from 'classcat';\nimport { errorMessages, Position } from '@xyflow/system';\nimport drag from '../../actions/drag';\nimport { useStore } from '../../store';\nimport DefaultNode from '../nodes/DefaultNode.svelte';\nimport { getNodeInlineStyleDimensions } from './utils';\nexport let node;\nexport let id;\nexport let data = {};\nexport let selected = false;\nexport let draggable = undefined;\nexport let selectable = undefined;\nexport let connectable = true;\nexport let deletable = true;\nexport let hidden = false;\nexport let dragging = false;\nexport let resizeObserver = null;\nexport let style = undefined;\nexport let type = 'default';\nexport let isParent = false;\nexport let positionX;\nexport let positionY;\nexport let sourcePosition = undefined;\nexport let targetPosition = undefined;\nexport let zIndex;\nexport let measuredWidth = undefined;\nexport let measuredHeight = undefined;\nexport let initialWidth = undefined;\nexport let initialHeight = undefined;\nexport let width = undefined;\nexport let height = undefined;\nexport let dragHandle = undefined;\nexport let initialized = false;\nexport let parentId = undefined;\nexport let nodeClickDistance = undefined;\nlet className = '';\nexport { className as class };\nconst store = useStore();\nconst { nodeTypes, nodeDragThreshold, selectNodesOnDrag, handleNodeSelection, updateNodeInternals, elementsSelectable, nodesDraggable } = store;\nlet nodeRef;\nlet prevNodeRef = null;\nconst dispatchNodeEvent = createEventDispatcher();\nconst connectableStore = writable(connectable);\nlet prevType = undefined;\nlet prevSourcePosition = undefined;\nlet prevTargetPosition = undefined;\n$: nodeType = type || 'default';\n$: nodeTypeValid = !!$nodeTypes[nodeType];\n$: nodeComponent = $nodeTypes[nodeType] || DefaultNode;\n$: {\n if (!nodeTypeValid) {\n console.warn('003', errorMessages['error003'](type));\n }\n}\n$: inlineStyleDimensions = getNodeInlineStyleDimensions({\n width,\n height,\n initialWidth,\n initialHeight,\n measuredWidth,\n measuredHeight\n});\n$: {\n connectableStore.set(!!connectable);\n}\n$: {\n // if type, sourcePosition or targetPosition changes,\n // we need to re-calculate the handle positions\n const doUpdate = (prevType && nodeType !== prevType) ||\n (prevSourcePosition && sourcePosition !== prevSourcePosition) ||\n (prevTargetPosition && targetPosition !== prevTargetPosition);\n if (doUpdate) {\n requestAnimationFrame(() => updateNodeInternals(new Map([\n [\n id,\n {\n id,\n nodeElement: nodeRef,\n force: true\n }\n ]\n ])));\n }\n prevType = nodeType;\n prevSourcePosition = sourcePosition;\n prevTargetPosition = targetPosition;\n}\nsetContext('svelteflow__node_id', id);\nsetContext('svelteflow__node_connectable', connectableStore);\n$: {\n if (resizeObserver && (nodeRef !== prevNodeRef || !initialized)) {\n prevNodeRef && resizeObserver.unobserve(prevNodeRef);\n nodeRef && resizeObserver.observe(nodeRef);\n prevNodeRef = nodeRef;\n }\n}\nonDestroy(() => {\n if (prevNodeRef) {\n resizeObserver?.unobserve(prevNodeRef);\n }\n});\nfunction onSelectNodeHandler(event) {\n if (selectable && (!get(selectNodesOnDrag) || !draggable || get(nodeDragThreshold) > 0)) {\n // this handler gets called by XYDrag on drag start when selectNodesOnDrag=true\n // here we only need to call it when selectNodesOnDrag=false\n handleNodeSelection(id);\n }\n dispatchNodeEvent('nodeclick', { node: node.internals.userNode, event });\n}\n</script>\n\n<!-- svelte-ignore a11y-click-events-have-key-events -->\n<!-- svelte-ignore a11y-no-static-element-interactions -->\n{#if !hidden}\n <div\n use:drag={{\n nodeId: id,\n isSelectable: selectable,\n disabled: false,\n handleSelector: dragHandle,\n noDragClass: 'nodrag',\n nodeClickDistance,\n onNodeMouseDown: handleNodeSelection,\n onDrag: (event, _, targetNode, nodes) => {\n dispatchNodeEvent('nodedrag', { event, targetNode, nodes });\n },\n onDragStart: (event, _, targetNode, nodes) => {\n dispatchNodeEvent('nodedragstart', { event, targetNode, nodes });\n },\n onDragStop: (event, _, targetNode, nodes) => {\n dispatchNodeEvent('nodedragstop', { event, targetNode, nodes });\n },\n store\n }}\n bind:this={nodeRef}\n data-id={id}\n class={cc(['svelte-flow__node', `svelte-flow__node-${nodeType}`, className])}\n class:dragging\n class:selected\n class:draggable\n class:connectable\n class:selectable\n class:nopan={draggable}\n class:parent={isParent}\n style:z-index={zIndex}\n style:transform=\"translate({positionX}px, {positionY}px)\"\n style:visibility={initialized ? 'visible' : 'hidden'}\n style=\"{style ?? ''};{inlineStyleDimensions.width}{inlineStyleDimensions.height}\"\n on:click={onSelectNodeHandler}\n on:mouseenter={(event) => dispatchNodeEvent('nodemouseenter', { node, event })}\n on:mouseleave={(event) => dispatchNodeEvent('nodemouseleave', { node, event })}\n on:mousemove={(event) => dispatchNodeEvent('nodemousemove', { node, event })}\n on:contextmenu={(event) => dispatchNodeEvent('nodecontextmenu', { node, event })}\n >\n <svelte:component\n this={nodeComponent}\n {data}\n {id}\n selected={selected ?? false}\n selectable={selectable ?? $elementsSelectable ?? true}\n deletable={deletable ?? true}\n {sourcePosition}\n {targetPosition}\n {zIndex}\n {dragging}\n draggable={draggable ?? $nodesDraggable ?? true}\n {dragHandle}\n {parentId}\n type={nodeType}\n isConnectable={$connectableStore}\n positionAbsoluteX={positionX}\n positionAbsoluteY={positionY}\n {width}\n {height}\n />\n </div>\n{/if}\n","<script>import { onDestroy } from 'svelte';\nimport { nodeHasDimensions } from '@xyflow/system';\nimport { NodeWrapper } from '../../components/NodeWrapper';\nimport { useStore } from '../../store';\nexport let nodeClickDistance = 0;\nconst { visibleNodes, nodesDraggable, nodesConnectable, elementsSelectable, updateNodeInternals, parentLookup } = useStore();\nconst resizeObserver = typeof ResizeObserver === 'undefined'\n ? null\n : new ResizeObserver((entries) => {\n const updates = new Map();\n entries.forEach((entry) => {\n const id = entry.target.getAttribute('data-id');\n updates.set(id, {\n id,\n nodeElement: entry.target,\n force: true\n });\n });\n updateNodeInternals(updates);\n });\nonDestroy(() => {\n resizeObserver?.disconnect();\n});\n</script>\n\n<div class=\"svelte-flow__nodes\">\n {#each $visibleNodes as node (node.id)}\n <NodeWrapper\n {node}\n id={node.id}\n data={node.data}\n selected={!!node.selected}\n hidden={!!node.hidden}\n draggable={!!(node.draggable || ($nodesDraggable && typeof node.draggable === 'undefined'))}\n selectable={!!(\n node.selectable ||\n ($elementsSelectable && typeof node.selectable === 'undefined')\n )}\n connectable={!!(\n node.connectable ||\n ($nodesConnectable && typeof node.connectable === 'undefined')\n )}\n deletable={node.deletable ?? true}\n positionX={node.internals.positionAbsolute.x}\n positionY={node.internals.positionAbsolute.y}\n isParent={$parentLookup.has(node.id)}\n style={node.style}\n class={node.class}\n type={node.type ?? 'default'}\n sourcePosition={node.sourcePosition}\n targetPosition={node.targetPosition}\n dragging={node.dragging}\n zIndex={node.internals.z ?? 0}\n dragHandle={node.dragHandle}\n initialized={nodeHasDimensions(node)}\n width={node.width}\n height={node.height}\n initialWidth={node.initialWidth}\n initialHeight={node.initialHeight}\n measuredWidth={node.measured.width}\n measuredHeight={node.measured.height}\n parentId={node.parentId}\n {resizeObserver}\n {nodeClickDistance}\n on:nodeclick\n on:nodemouseenter\n on:nodemousemove\n on:nodemouseleave\n on:nodedrag\n on:nodedragstart\n on:nodedragstop\n on:nodecontextmenu\n />\n {/each}\n</div>\n\n<style>\n .svelte-flow__nodes {\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n }\n</style>\n","<svelte:options immutable />\n\n<script>import { createEventDispatcher, setContext } from 'svelte';\nimport cc from 'classcat';\nimport { getMarkerId } from '@xyflow/system';\nimport { useStore } from '../../store';\nimport { BezierEdgeInternal } from '../edges';\nimport { useHandleEdgeSelect } from '../../hooks/useHandleEdgeSelect';\nexport let id;\nexport let type = 'default';\nexport let source = '';\nexport let target = '';\nexport let data = {};\nexport let style = undefined;\nexport let zIndex = undefined;\nexport let animated = false;\nexport let selected = false;\nexport let selectable = undefined;\nexport let deletable = undefined;\nexport let hidden = false;\nexport let label = undefined;\nexport let labelStyle = undefined;\nexport let markerStart = undefined;\nexport let markerEnd = undefined;\nexport let sourceHandle = undefined;\nexport let targetHandle = undefined;\nexport let sourceX;\nexport let sourceY;\nexport let targetX;\nexport let targetY;\nexport let sourcePosition;\nexport let targetPosition;\nexport let ariaLabel = undefined;\nexport let interactionWidth = undefined;\n// @ todo: support edge updates\nlet className = '';\nexport { className as class };\nsetContext('svelteflow__edge_id', id);\nconst { edgeLookup, edgeTypes, flowId, elementsSelectable } = useStore();\nconst dispatch = createEventDispatcher();\n$: edgeType = type || 'default';\n$: edgeComponent = $edgeTypes[edgeType] || BezierEdgeInternal;\n$: markerStartUrl = markerStart ? `url('#${getMarkerId(markerStart, $flowId)}')` : undefined;\n$: markerEndUrl = markerEnd ? `url('#${getMarkerId(markerEnd, $flowId)}')` : undefined;\n$: isSelectable = selectable ?? $elementsSelectable;\nconst handleEdgeSelect = useHandleEdgeSelect();\nfunction onClick(event) {\n const edge = $edgeLookup.get(id);\n if (edge) {\n handleEdgeSelect(id);\n dispatch('edgeclick', { event, edge });\n }\n}\nfunction onMouseEvent(event, type) {\n const edge = $edgeLookup.get(id);\n if (edge) {\n dispatch(type, { event, edge });\n }\n}\n</script>\n\n<!-- svelte-ignore a11y-click-events-have-key-events -->\n<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->\n{#if !hidden}\n <svg style:z-index={zIndex}>\n <g\n class={cc(['svelte-flow__edge', className])}\n class:animated\n class:selected\n class:selectable={isSelectable}\n data-id={id}\n on:click={onClick}\n on:contextmenu={(e) => {\n onMouseEvent(e, 'edgecontextmenu');\n }}\n on:mouseenter={(e) => {\n onMouseEvent(e, 'edgemouseenter');\n }}\n on:mouseleave={(e) => {\n onMouseEvent(e, 'edgemouseleave');\n }}\n aria-label={ariaLabel === null\n ? undefined\n : ariaLabel\n ? ariaLabel\n : `Edge from ${source} to ${target}`}\n role=\"img\"\n >\n <svelte:component\n this={edgeComponent}\n {id}\n {source}\n {target}\n {sourceX}\n {sourceY}\n {targetX}\n {targetY}\n {sourcePosition}\n {targetPosition}\n {animated}\n {selected}\n {label}\n {labelStyle}\n {data}\n {style}\n {interactionWidth}\n selectable={isSelectable}\n deletable={deletable ?? true}\n type={edgeType}\n sourceHandleId={sourceHandle}\n targetHandleId={targetHandle}\n markerStart={markerStartUrl}\n markerEnd={markerEndUrl}\n />\n </g>\n </svg>\n{/if}\n","<script>import { onMount } from 'svelte';\nlet _onMount = undefined;\nexport { _onMount as onMount };\nlet _onDestroy = undefined;\nexport { _onDestroy as onDestroy };\nonMount(() => {\n _onMount?.();\n return _onDestroy;\n});\n</script>\n","<script>import { useStore } from '../../../store';\nimport { Marker } from './';\nconst { markers } = useStore();\n</script>\n\n<defs>\n {#each $markers as marker (marker.id)}\n <Marker {...marker} />\n {/each}\n</defs>\n","<script>import { MarkerType } from '@xyflow/system';\nexport let id;\nexport let type;\nexport let width = 12.5;\nexport let height = 12.5;\nexport let markerUnits = 'strokeWidth';\nexport let orient = 'auto-start-reverse';\nexport let color = undefined;\nexport let strokeWidth = undefined;\n</script>\n\n<marker\n class=\"svelte-flow__arrowhead\"\n {id}\n markerWidth={`${width}`}\n markerHeight={`${height}`}\n viewBox=\"-10 -10 20 20\"\n {markerUnits}\n {orient}\n refX=\"0\"\n refY=\"0\"\n>\n {#if type === MarkerType.Arrow}\n <polyline\n stroke={color}\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width={strokeWidth}\n fill=\"none\"\n points=\"-5,-4 0,0 -5,4\"\n />\n {:else if type === MarkerType.ArrowClosed}\n <polyline\n stroke={color}\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width={strokeWidth}\n fill={color}\n points=\"-5,-4 0,0 -5,4 -5,-4\"\n />\n {/if}\n</marker>\n","<script>import { onMount } from 'svelte';\nimport { EdgeWrapper } from '../../components/EdgeWrapper';\nimport { CallOnMount } from '../../components/CallOnMount';\nimport { MarkerDefinition } from './MarkerDefinition';\nimport { useStore } from '../../store';\nexport let defaultEdgeOptions;\nconst { visibleEdges, edgesInitialized, edges: { setDefaultOptions }, elementsSelectable } = useStore();\nonMount(() => {\n if (defaultEdgeOptions)\n setDefaultOptions(defaultEdgeOptions);\n});\n</script>\n\n<div class=\"svelte-flow__edges\">\n <svg class=\"svelte-flow__marker\">\n <MarkerDefinition />\n </svg>\n\n {#each $visibleEdges as edge (edge.id)}\n <EdgeWrapper\n id={edge.id}\n source={edge.source}\n target={edge.target}\n data={edge.data}\n style={edge.style}\n animated={edge.animated}\n selected={edge.selected}\n selectable={edge.selectable ?? $elementsSelectable}\n deletable={edge.deletable}\n hidden={edge.hidden}\n label={edge.label}\n labelStyle={edge.labelStyle}\n markerStart={edge.markerStart}\n markerEnd={edge.markerEnd}\n sourceHandle={edge.sourceHandle}\n targetHandle={edge.targetHandle}\n sourceX={edge.sourceX}\n sourceY={edge.sourceY}\n targetX={edge.targetX}\n targetY={edge.targetY}\n sourcePosition={edge.sourcePosition}\n targetPosition={edge.targetPosition}\n ariaLabel={edge.ariaLabel}\n interactionWidth={edge.interactionWidth}\n class={edge.class}\n type={edge.type || 'default'}\n zIndex={edge.zIndex}\n on:edgeclick\n on:edgecontextmenu\n on:edgemouseenter\n on:edgemouseleave\n />\n {/each}\n\n {#if $visibleEdges.length > 0}\n <CallOnMount\n onMount={() => {\n $edgesInitialized = true;\n }}\n onDestroy={() => {\n $edgesInitialized = false;\n }}\n />\n {/if}\n</div>\n","<script>export let x = 0;\nexport let y = 0;\nexport let width = 0;\nexport let height = 0;\nexport let isVisible = true;\n</script>\n\n{#if isVisible}\n <div\n class=\"svelte-flow__selection\"\n style:width={typeof width === 'string' ? width : `${width}px`}\n style:height={typeof height === 'string' ? height : `${height}px`}\n style:transform={`translate(${x}px, ${y}px)`}\n />\n{/if}\n\n<style>\n .svelte-flow__selection {\n position: absolute;\n top: 0;\n left: 0;\n }\n</style>\n","<script>import { useStore } from '../../store';\nimport { Selection } from '../Selection';\nconst { selectionRect, selectionRectMode } = useStore();\n</script>\n\n<Selection\n isVisible={!!($selectionRect && $selectionRectMode === 'user')}\n width={$selectionRect?.width}\n height={$selectionRect?.height}\n x={$selectionRect?.x}\n y={$selectionRect?.y}\n/>\n","<script>import { createEventDispatcher } from 'svelte';\nimport { getInternalNodesBounds, isNumeric } from '@xyflow/system';\nimport { useStore } from '../../store';\nimport { Selection } from '../Selection';\nimport drag from '../../actions/drag';\nconst store = useStore();\nconst { selectionRectMode, nodes, nodeLookup } = store;\nconst dispatch = createEventDispatcher();\nlet bounds = null;\n$: if ($selectionRectMode === 'nodes') {\n bounds = getInternalNodesBounds($nodeLookup, { filter: (node) => !!node.selected });\n $nodes;\n}\nfunction onContextMenu(event) {\n const selectedNodes = $nodes.filter((n) => n.selected);\n dispatch('selectioncontextmenu', { nodes: selectedNodes, event });\n}\nfunction onClick(event) {\n const selectedNodes = $nodes.filter((n) => n.selected);\n dispatch('selectionclick', { nodes: selectedNodes, event });\n}\n</script>\n\n{#if $selectionRectMode === 'nodes' && bounds && isNumeric(bounds.x) && isNumeric(bounds.y)}\n <div\n class=\"selection-wrapper nopan\"\n style=\"width: {bounds.width}px; height: {bounds.height}px; transform: translate({bounds.x}px, {bounds.y}px)\"\n use:drag={{\n disabled: false,\n store,\n onDrag: (event, _, __, nodes) => {\n dispatch('nodedrag', { event, targetNode: null, nodes });\n },\n onDragStart: (event, _, __, nodes) => {\n dispatch('nodedragstart', { event, targetNode: null, nodes });\n },\n onDragStop: (event, _, __, nodes) => {\n dispatch('nodedragstop', { event, targetNode: null, nodes });\n }\n }}\n on:contextmenu={onContextMenu}\n on:click={onClick}\n role=\"button\"\n tabindex=\"-1\"\n on:keyup={() => {}}\n >\n <Selection width=\"100%\" height=\"100%\" x={0} y={0} />\n </div>\n{/if}\n\n<style>\n .selection-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 7;\n pointer-events: all;\n }\n</style>\n","/**\n * Listen for keyboard event and trigger `shortcut` {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | CustomEvent }\n * @example Typical usage\n *\n * ```svelte\n * <script lang=\"ts\">\n * import { shortcut, type ShortcutEventDetail } from '@svelte-put/shortcut';\n *\n * let commandPalette = false;\n *\n * function onOpenCommandPalette() {\n * commandPalette = true;\n * }\n * function onCloseCommandPalette() {\n * commandPalette = false;\n * }\n *\n * function doSomethingElse(details: ShortcutEventDetail) {\n * console.log('Action was placed on:', details.node);\n * console.log('Trigger:', details.trigger);\n * }\n *\n * function onShortcut(event: CustomEvent<ShortcutEventDetail>) {\n * if (event.detail.trigger.id === 'do-something-else') {\n * console.log('Same as doSomethingElse()');\n * // be careful here doSomethingElse would have been called too\n * }\n * }\n * </script>\n *\n * <svelte:window\n * use:shortcut={{\n * trigger: [\n * {\n * key: 'k',\n *\n * // trigger if either ctrl or meta is pressed\n * modifier: ['ctrl', 'meta'],\n *\n * callback: onOpenCommandPalette,\n * preventDefault: true,\n * },\n * {\n * key: 'Escape',\n *\n * // preferably avoid arrow functions here for better performance\n * // with arrow functions the action has to be updated more frequently\n * callback: onCloseCommandPalette,\n *\n * enabled: commandPalette,\n * preventDefault: true,\n * },\n * {\n * key: 'k',\n *\n * // trigger if both ctrl & shift are pressed\n * modifier: [['ctrl', 'shift']],\n * id: 'do-something-else',\n * callback: doSomethingElse,\n * },\n * ],\n * }}\n * on:shortcut={onShortcut}\n * />\n * ```\n *\n *\n *\n * As with any svelte action, `shortcut` should be use with element and not component.\n *\n * ```html\n * <-- correct usage-->\n * <div use:intersect />\n *\n * <-- incorrect usage-->\n * <Component use:intersect/>\n * ```\n *\n * You can either:\n *\n * - pass multiple callbacks to their associated triggers, or\n *\n * - pass one single handler to the `on:shortcut` event, in which case you should\n * provide an ID to each trigger to be able to distinguish what trigger was activated\n * in the event handler.\n *\n * Either way, only use `callback` or `on:shortcut` and not both to\n * avoid handler duplication.\n * @param {HTMLElement} node - HTMLElement to add event listener to\n * @param {import('./public').ShortcutParameter} param - svelte action parameters\n * @returns {import('./public').ShortcutActionReturn}\n */\nexport function shortcut(node, param) {\n\tlet { enabled = true, trigger, type = 'keydown' } = param;\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tfunction handler(event) {\n\t\tconst normalizedTriggers = Array.isArray(trigger) ? trigger : [trigger];\n\t\t/** @type {Record<import('./public').ShortcutModifier, boolean>} */\n\t\tconst modifiedMap = {\n\t\t\talt: event.altKey,\n\t\t\tctrl: event.ctrlKey,\n\t\t\tshift: event.shiftKey,\n\t\t\tmeta: event.metaKey,\n\t\t};\n\t\tfor (const trigger of normalizedTriggers) {\n\t\t\tconst mergedTrigger = {\n\t\t\t\tmodifier: [],\n\t\t\t\tpreventDefault: false,\n\t\t\t\tenabled: true,\n\t\t\t\t...trigger,\n\t\t\t};\n\t\t\tconst { modifier, key, callback, preventDefault, enabled: triggerEnabled } = mergedTrigger;\n\t\t\tif (triggerEnabled) {\n\t\t\t\tif (modifier.length) {\n\t\t\t\t\tconst modifierDefs = (Array.isArray(modifier) ? modifier : [modifier]).map((def) =>\n\t\t\t\t\t\ttypeof def === 'string' ? [def] : def,\n\t\t\t\t\t);\n\t\t\t\t\tconst modified = modifierDefs.some((def) =>\n\t\t\t\t\t\tdef.every((modifier) => modifiedMap[modifier]),\n\t\t\t\t\t);\n\t\t\t\t\tif (!modified) continue;\n\t\t\t\t}\n\t\t\t\tif (event.key === key) {\n\t\t\t\t\tif (preventDefault) event.preventDefault();\n\t\t\t\t\t/** @type {import('./public').ShortcutEventDetail} */\n\t\t\t\t\tconst detail = {\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\ttrigger: mergedTrigger,\n\t\t\t\t\t\toriginalEvent: event,\n\t\t\t\t\t};\n\t\t\t\t\tnode.dispatchEvent(new CustomEvent('shortcut', { detail }));\n\t\t\t\t\tcallback?.(detail);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (enabled) node.addEventListener(type, handler);\n\n\treturn {\n\t\tupdate: (update) => {\n\t\t\tconst { enabled: newEnabled = true, type: newType = 'keydown' } = update;\n\n\t\t\tif (enabled && (!newEnabled || type !== newType)) {\n\t\t\t\tnode.removeEventListener(type, handler);\n\t\t\t} else if (!enabled && newEnabled) {\n\t\t\t\tnode.addEventListener(newType, handler);\n\t\t\t}\n\n\t\t\tenabled = newEnabled;\n\t\t\ttype = newType;\n\t\t\ttrigger = update.trigger;\n\t\t},\n\t\tdestroy: () => {\n\t\t\tnode.removeEventListener(type, handler);\n\t\t},\n\t};\n}\n","<script>import { shortcut } from '@svelte-put/shortcut';\nimport { isInputDOMNode, isMacOs } from '@xyflow/system';\nimport { useStore } from '../../store';\nexport let selectionKey = 'Shift';\nexport let multiSelectionKey = isMacOs() ? 'Meta' : 'Control';\nexport let deleteKey = 'Backspace';\nexport let panActivationKey = ' ';\nexport let zoomActivationKey = isMacOs() ? 'Meta' : 'Control';\nconst { selectionKeyPressed, multiselectionKeyPressed, deleteKeyPressed, panActivationKeyPressed, zoomActivationKeyPressed, selectionRect } = useStore();\nfunction isKeyObject(key) {\n return key !== null && typeof key === 'object';\n}\nfunction getModifier(key) {\n return isKeyObject(key) ? key.modifier || [] : [];\n}\nfunction getKeyString(key) {\n if (key === null || key === undefined) {\n // this is a workaround to check if a key is set\n // if not we won't call the callback\n return '';\n }\n return isKeyObject(key) ? key.key : key;\n}\nfunction getShortcutTrigger(key, callback) {\n const keys = Array.isArray(key) ? key : [key];\n return keys.map((_key) => {\n const keyString = getKeyString(_key);\n return {\n key: keyString,\n modifier: getModifier(_key),\n enabled: keyString !== null,\n callback\n };\n });\n}\nfunction resetKeysAndSelection() {\n selectionRect.set(null);\n selectionKeyPressed.set(false);\n multiselectionKeyPressed.set(false);\n deleteKeyPressed.set(false);\n panActivationKeyPressed.set(false);\n zoomActivationKeyPressed.set(false);\n}\n</script>\n\n<svelte:window\n on:blur={resetKeysAndSelection}\n on:contextmenu={resetKeysAndSelection}\n use:shortcut={{\n trigger: getShortcutTrigger(selectionKey, () => selectionKeyPressed.set(true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(selectionKey, () => selectionKeyPressed.set(false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(multiSelectionKey, () => multiselectionKeyPressed.set(true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(multiSelectionKey, () => multiselectionKeyPressed.set(false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(deleteKey, (detail) => {\n const isModifierKey =\n detail.originalEvent.ctrlKey ||\n detail.originalEvent.metaKey ||\n detail.originalEvent.shiftKey;\n if (!isModifierKey && !isInputDOMNode(detail.originalEvent)) {\n deleteKeyPressed.set(true);\n }\n }),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(deleteKey, () => deleteKeyPressed.set(false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(panActivationKey, () => panActivationKeyPressed.set(true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(panActivationKey, () => panActivationKeyPressed.set(false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(zoomActivationKey, () => zoomActivationKeyPressed.set(true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(zoomActivationKey, () => zoomActivationKeyPressed.set(false)),\n type: 'keyup'\n }}\n/>\n","<script>import cc from 'classcat';\nimport { useStore } from '../../store';\nimport { ConnectionLineType, getBezierPath, getConnectionStatus, getSmoothStepPath, getStraightPath } from '@xyflow/system';\nexport let containerStyle = '';\nexport let style = '';\nexport let isCustomComponent = false;\nconst { width, height, connection, connectionLineType } = useStore();\nlet path = null;\n$: if ($connection.inProgress && !isCustomComponent) {\n const { from, to, fromPosition, toPosition } = $connection;\n const pathParams = {\n sourceX: from.x,\n sourceY: from.y,\n sourcePosition: fromPosition,\n targetX: to.x,\n targetY: to.y,\n targetPosition: toPosition\n };\n switch ($connectionLineType) {\n case ConnectionLineType.Bezier:\n [path] = getBezierPath(pathParams);\n break;\n case ConnectionLineType.Step:\n [path] = getSmoothStepPath({\n ...pathParams,\n borderRadius: 0\n });\n break;\n case ConnectionLineType.SmoothStep:\n [path] = getSmoothStepPath(pathParams);\n break;\n default:\n [path] = getStraightPath(pathParams);\n }\n}\n</script>\n\n{#if $connection.inProgress}\n <svg width={$width} height={$height} class=\"svelte-flow__connectionline\" style={containerStyle}>\n <g class={cc(['svelte-flow__connection', getConnectionStatus($connection.isValid)])}>\n <slot name=\"connectionLine\" />\n <!-- slot fallbacks do not work if slots are forwarded in parent -->\n {#if !isCustomComponent}\n <path d={path} {style} fill=\"none\" class=\"svelte-flow__connection-path\" />\n {/if}\n </g>\n </svg>\n{/if}\n","<script>import cc from 'classcat';\nimport { useStore } from '../../store';\nexport let position = 'top-right';\nexport let style = undefined;\nlet className = undefined;\nexport { className as class };\nconst { selectionRectMode } = useStore();\n$: positionClasses = `${position}`.split('-');\n</script>\n\n<div\n class={cc(['svelte-flow__panel', className, ...positionClasses])}\n {style}\n style:pointer-events={$selectionRectMode ? 'none' : ''}\n {...$$restProps}\n>\n <slot />\n</div>\n","<script>import { Panel } from '../../container/Panel';\nexport let proOptions = undefined;\nexport let position = 'bottom-right';\n</script>\n\n{#if !proOptions?.hideAttribution}\n <Panel\n {position}\n class=\"svelte-flow__attribution\"\n data-message=\"Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us\"\n >\n <a\n href=\"https://svelteflow.dev\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Svelte Flow attribution\"\n >\n Svelte Flow\n </a>\n </Panel>\n{/if}\n","// this is helper function for updating the store\n// for props where we need to call a specific store action\nexport function updateStore(store, { nodeTypes, edgeTypes, minZoom, maxZoom, translateExtent, paneClickDistance }) {\n if (nodeTypes !== undefined) {\n store.setNodeTypes(nodeTypes);\n }\n if (edgeTypes !== undefined) {\n store.setEdgeTypes(edgeTypes);\n }\n if (minZoom !== undefined) {\n store.setMinZoom(minZoom);\n }\n if (maxZoom !== undefined) {\n store.setMaxZoom(maxZoom);\n }\n if (translateExtent !== undefined) {\n store.setTranslateExtent(translateExtent);\n }\n if (paneClickDistance !== undefined) {\n store.setPaneClickDistance(paneClickDistance);\n }\n}\nconst getKeys = (obj) => Object.keys(obj);\nexport function updateStoreByKeys(store, keys) {\n getKeys(keys).forEach((prop) => {\n const update = keys[prop];\n if (update !== undefined) {\n // @ts-expect-error @todo: how to fix this TS error?\n store[prop].set(update);\n }\n });\n}\n","import { readable } from 'svelte/store';\nfunction getMediaQuery() {\n if (typeof window === 'undefined' || !window.matchMedia) {\n return null;\n }\n return window.matchMedia('(prefers-color-scheme: dark)');\n}\n/**\n * Hook for receiving the current color mode class 'dark' or 'light'.\n *\n * @internal\n * @param colorMode - The color mode to use ('dark', 'light' or 'system')\n */\nexport function useColorModeClass(colorMode = 'light') {\n const colorModeClass = readable('light', (set) => {\n if (colorMode !== 'system') {\n set(colorMode);\n return;\n }\n const mediaQuery = getMediaQuery();\n const updateColorModeClass = () => set(mediaQuery?.matches ? 'dark' : 'light');\n set(mediaQuery?.matches ? 'dark' : 'light');\n mediaQuery?.addEventListener('change', updateColorModeClass);\n return () => {\n mediaQuery?.removeEventListener('change', updateColorModeClass);\n };\n });\n return colorModeClass;\n}\n","<script>import { onMount, hasContext } from 'svelte';\nimport { get } from 'svelte/store';\nimport cc from 'classcat';\nimport { ConnectionMode, PanOnScrollMode } from '@xyflow/system';\nimport { Zoom } from '../Zoom';\nimport { Pane } from '../Pane';\nimport { Viewport as ViewportComponent } from '../Viewport';\nimport { NodeRenderer } from '../NodeRenderer';\nimport { EdgeRenderer } from '../EdgeRenderer';\nimport { UserSelection } from '../../components/UserSelection';\nimport { NodeSelection } from '../../components/NodeSelection';\nimport { KeyHandler } from '../../components/KeyHandler';\nimport { ConnectionLine } from '../../components/ConnectionLine';\nimport { Attribution } from '../../components/Attribution';\nimport { key, useStore, createStoreContext } from '../../store';\nimport { updateStore, updateStoreByKeys } from './utils';\nimport { useColorModeClass } from '../../hooks/useColorModeClass';\nexport let id = '1';\nexport let nodes;\nexport let edges;\nexport let fitView = undefined;\nexport let fitViewOptions = undefined;\nexport let minZoom = undefined;\nexport let maxZoom = undefined;\nexport let initialViewport = undefined;\nexport let viewport = undefined;\nexport let nodeTypes = undefined;\nexport let edgeTypes = undefined;\nexport let selectionKey = undefined;\nexport let selectionMode = undefined;\nexport let panActivationKey = undefined;\nexport let multiSelectionKey = undefined;\nexport let zoomActivationKey = undefined;\nexport let nodesDraggable = undefined;\nexport let nodesConnectable = undefined;\nexport let nodeDragThreshold = undefined;\nexport let elementsSelectable = undefined;\nexport let snapGrid = undefined;\nexport let deleteKey = undefined;\nexport let connectionRadius = undefined;\nexport let connectionLineType = undefined;\nexport let connectionMode = ConnectionMode.Strict;\nexport let connectionLineStyle = '';\nexport let connectionLineContainerStyle = '';\nexport let onMoveStart = undefined;\nexport let onMove = undefined;\nexport let onMoveEnd = undefined;\nexport let isValidConnection = undefined;\nexport let translateExtent = undefined;\nexport let nodeExtent = undefined;\nexport let onlyRenderVisibleElements = undefined;\nexport let panOnScrollMode = PanOnScrollMode.Free;\nexport let preventScrolling = true;\nexport let zoomOnScroll = true;\nexport let zoomOnDoubleClick = true;\nexport let zoomOnPinch = true;\nexport let panOnScroll = false;\nexport let panOnDrag = true;\nexport let selectionOnDrag = undefined;\nexport let autoPanOnConnect = true;\nexport let autoPanOnNodeDrag = true;\nexport let onerror = undefined;\nexport let ondelete = undefined;\nexport let onedgecreate = undefined;\nexport let attributionPosition = undefined;\nexport let proOptions = undefined;\nexport let defaultEdgeOptions = undefined;\nexport let width = undefined;\nexport let height = undefined;\nexport let colorMode = 'light';\nexport let onconnect = undefined;\nexport let onconnectstart = undefined;\nexport let onconnectend = undefined;\nexport let onbeforedelete = undefined;\nexport let oninit = undefined;\nexport let nodeOrigin = undefined;\nexport let paneClickDistance = 0;\nexport let nodeClickDistance = 0;\nexport let defaultMarkerColor = '#b1b1b7';\nexport let style = undefined;\nlet className = undefined;\nexport { className as class };\nlet domNode;\nlet clientWidth;\nlet clientHeight;\nconst initViewport = $viewport || initialViewport;\nconst store = hasContext(key)\n ? useStore()\n : createStoreContext({\n nodes: get(nodes),\n edges: get(edges),\n width,\n height,\n fitView,\n nodeOrigin,\n nodeExtent\n });\nonMount(() => {\n store.width.set(clientWidth);\n store.height.set(clientHeight);\n store.domNode.set(domNode);\n store.syncNodeStores(nodes);\n store.syncEdgeStores(edges);\n store.syncViewport(viewport);\n if (fitView !== undefined) {\n store.fitViewQueued.set(fitView);\n }\n if (fitViewOptions) {\n store.fitViewOptions.set(fitViewOptions);\n }\n updateStore(store, {\n nodeTypes,\n edgeTypes,\n minZoom,\n maxZoom,\n translateExtent,\n paneClickDistance\n });\n return () => {\n store.reset();\n };\n});\n// Update width & height on resize\n$: {\n if (clientWidth !== undefined && clientHeight !== undefined) {\n store.width.set(clientWidth);\n store.height.set(clientHeight);\n }\n}\n// Call oninit once when flow is intialized\nconst { initialized } = store;\nlet onInitCalled = false;\n$: {\n if (!onInitCalled && $initialized) {\n oninit?.();\n onInitCalled = true;\n }\n}\n// this updates the store for simple changes\n// where the prop names equals the store name\n$: {\n const updatableProps = {\n flowId: id,\n connectionLineType,\n connectionRadius,\n selectionMode,\n snapGrid,\n defaultMarkerColor,\n nodesDraggable,\n nodesConnectable,\n elementsSelectable,\n onlyRenderVisibleElements,\n isValidConnection,\n autoPanOnConnect,\n autoPanOnNodeDrag,\n onerror,\n ondelete,\n onedgecreate,\n connectionMode,\n nodeDragThreshold,\n onconnect,\n onconnectstart,\n onconnectend,\n onbeforedelete,\n nodeOrigin\n };\n updateStoreByKeys(store, updatableProps);\n}\n$: updateStore(store, {\n nodeTypes,\n edgeTypes,\n minZoom,\n maxZoom,\n translateExtent,\n paneClickDistance\n});\n$: colorModeClass = useColorModeClass(colorMode);\n</script>\n\n<div\n bind:this={domNode}\n bind:clientWidth\n bind:clientHeight\n {style}\n class={cc(['svelte-flow', className, $colorModeClass])}\n data-testid=\"svelte-flow__wrapper\"\n on:dragover\n on:drop\n {...$$restProps}\n role=\"application\"\n>\n <KeyHandler\n {selectionKey}\n {deleteKey}\n {panActivationKey}\n {multiSelectionKey}\n {zoomActivationKey}\n />\n <Zoom\n initialViewport={initViewport}\n {onMoveStart}\n {onMove}\n {onMoveEnd}\n panOnScrollMode={panOnScrollMode === undefined ? PanOnScrollMode.Free : panOnScrollMode}\n preventScrolling={preventScrolling === undefined ? true : preventScrolling}\n zoomOnScroll={zoomOnScroll === undefined ? true : zoomOnScroll}\n zoomOnDoubleClick={zoomOnDoubleClick === undefined ? true : zoomOnDoubleClick}\n zoomOnPinch={zoomOnPinch === undefined ? true : zoomOnPinch}\n panOnScroll={panOnScroll === undefined ? false : panOnScroll}\n panOnDrag={panOnDrag === undefined ? true : panOnDrag}\n paneClickDistance={paneClickDistance === undefined ? 0 : paneClickDistance}\n >\n <Pane\n on:paneclick\n on:panecontextmenu\n panOnDrag={panOnDrag === undefined ? true : panOnDrag}\n {selectionOnDrag}\n >\n <ViewportComponent>\n <EdgeRenderer\n on:edgeclick\n on:edgecontextmenu\n on:edgemouseenter\n on:edgemouseleave\n {defaultEdgeOptions}\n />\n <ConnectionLine\n containerStyle={connectionLineContainerStyle}\n style={connectionLineStyle}\n isCustomComponent={$$slots.connectionLine}\n >\n <slot name=\"connectionLine\" slot=\"connectionLine\" />\n </ConnectionLine>\n <div class=\"svelte-flow__edgelabel-renderer\" />\n <div class=\"svelte-flow__viewport-portal\" />\n <NodeRenderer\n {nodeClickDistance}\n on:nodeclick\n on:nodemouseenter\n on:nodemousemove\n on:nodemouseleave\n on:nodedragstart\n on:nodedrag\n on:nodedragstop\n on:nodecontextmenu\n />\n <NodeSelection\n on:selectionclick\n on:selectioncontextmenu\n on:nodedragstart\n on:nodedrag\n on:nodedragstop\n />\n </ViewportComponent>\n <UserSelection />\n </Pane>\n </Zoom>\n <Attribution {proOptions} position={attributionPosition} />\n <slot />\n</div>\n\n<style>\n .svelte-flow {\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n z-index: 0;\n\n background-color: var(--background-color, var(--background-color-default));\n }\n\n :root {\n --background-color-default: #fff;\n --background-pattern-color-default: #ddd;\n\n --minimap-mask-color-default: rgba(240, 240, 240, 0.6);\n --minimap-mask-stroke-color-default: none;\n --minimap-mask-stroke-width-default: 1;\n\n --controls-button-background-color-default: #fefefe;\n --controls-button-background-color-hover-default: #f4f4f4;\n --controls-button-color-default: inherit;\n --controls-button-color-hover-default: inherit;\n --controls-button-border-color-default: #eee;\n }\n</style>\n","<script>import { onDestroy, setContext } from 'svelte';\nimport { createStore, key } from '../../store';\nexport let initialNodes = undefined;\nexport let initialEdges = undefined;\nexport let initialWidth = undefined;\nexport let initialHeight = undefined;\nexport let fitView = undefined;\nexport let nodeOrigin = undefined;\nconst store = createStore({\n nodes: initialNodes,\n edges: initialEdges,\n width: initialWidth,\n height: initialHeight,\n nodeOrigin,\n fitView\n});\nsetContext(key, {\n getStore: () => store\n});\nonDestroy(() => {\n store.reset();\n});\n</script>\n\n<slot />\n","<script>import cc from 'classcat';\nexport let className = undefined;\nexport let bgColor = undefined;\nexport let bgColorHover = undefined;\nexport let color = undefined;\nexport let colorHover = undefined;\nexport let borderColor = undefined;\nexport { className as class };\n</script>\n\n<button\n type=\"button\"\n on:click\n class={cc(['svelte-flow__controls-button', className])}\n style:--xy-controls-button-background-color-props={bgColor}\n style:--xy-controls-button-background-color-hover-props={bgColorHover}\n style:--xy-controls-button-color-props={color}\n style:--xy-controls-button-color-hover-props={colorHover}\n style:--xy-controls-button-border-color-props={borderColor}\n {...$$restProps}\n>\n <slot class=\"button-svg\" />\n</button>\n","<script>import cc from 'classcat';\nimport Panel from '../../container/Panel/Panel.svelte';\nimport { useStore } from '../../store';\nimport ControlButton from './ControlButton.svelte';\nimport PlusIcon from './Icons/Plus.svelte';\nimport MinusIcon from './Icons/Minus.svelte';\nimport FitViewIcon from './Icons/Fit.svelte';\nimport LockIcon from './Icons/Lock.svelte';\nimport UnlockIcon from './Icons/Unlock.svelte';\nexport let position = 'bottom-left';\nexport let showZoom = true;\nexport let showFitView = true;\nexport let showLock = true;\nexport let buttonBgColor = undefined;\nexport let buttonBgColorHover = undefined;\nexport let buttonColor = undefined;\nexport let buttonColorHover = undefined;\nexport let buttonBorderColor = undefined;\nexport let ariaLabel = undefined;\nexport let style = undefined;\nexport let orientation = 'vertical';\nexport let fitViewOptions = undefined;\nlet className = '';\nexport { className as class };\nconst { zoomIn, zoomOut, fitView, viewport, minZoom, maxZoom, nodesDraggable, nodesConnectable, elementsSelectable } = useStore();\nconst buttonProps = {\n bgColor: buttonBgColor,\n bgColorHover: buttonBgColorHover,\n color: buttonColor,\n colorHover: buttonColorHover,\n borderColor: buttonBorderColor\n};\n$: isInteractive = $nodesDraggable || $nodesConnectable || $elementsSelectable;\n$: minZoomReached = $viewport.zoom <= $minZoom;\n$: maxZoomReached = $viewport.zoom >= $maxZoom;\nconst onZoomInHandler = () => {\n zoomIn();\n};\nconst onZoomOutHandler = () => {\n zoomOut();\n};\nconst onFitViewHandler = () => {\n fitView(fitViewOptions);\n};\nconst onToggleInteractivity = () => {\n isInteractive = !isInteractive;\n nodesDraggable.set(isInteractive);\n nodesConnectable.set(isInteractive);\n elementsSelectable.set(isInteractive);\n};\n$: orientationClass = orientation === 'horizontal' ? 'horizontal' : 'vertical';\n</script>\n\n<Panel\n class={cc(['svelte-flow__controls', orientationClass, className])}\n {position}\n data-testid=\"svelte-flow__controls\"\n aria-label={ariaLabel ?? 'Svelte Flow controls'}\n {style}\n>\n <slot name=\"before\" />\n {#if showZoom}\n <ControlButton\n on:click={onZoomInHandler}\n class=\"svelte-flow__controls-zoomin\"\n title=\"zoom in\"\n aria-label=\"zoom in\"\n disabled={maxZoomReached}\n {...buttonProps}\n >\n <PlusIcon />\n </ControlButton>\n <ControlButton\n on:click={onZoomOutHandler}\n class=\"svelte-flow__controls-zoomout\"\n title=\"zoom out\"\n aria-label=\"zoom out\"\n disabled={minZoomReached}\n {...buttonProps}\n >\n <MinusIcon />\n </ControlButton>\n {/if}\n {#if showFitView}\n <ControlButton\n class=\"svelte-flow__controls-fitview\"\n on:click={onFitViewHandler}\n title=\"fit view\"\n aria-label=\"fit view\"\n {...buttonProps}\n >\n <FitViewIcon />\n </ControlButton>\n {/if}\n {#if showLock}\n <ControlButton\n class=\"svelte-flow__controls-interactive\"\n on:click={onToggleInteractivity}\n title=\"toggle interactivity\"\n aria-label=\"toggle interactivity\"\n {...buttonProps}\n >\n {#if isInteractive}<UnlockIcon />{:else}<LockIcon />{/if}\n </ControlButton>\n {/if}\n <slot />\n <slot name=\"after\" />\n</Panel>\n","export var BackgroundVariant;\n(function (BackgroundVariant) {\n BackgroundVariant[\"Lines\"] = \"lines\";\n BackgroundVariant[\"Dots\"] = \"dots\";\n BackgroundVariant[\"Cross\"] = \"cross\";\n})(BackgroundVariant || (BackgroundVariant = {}));\n","<script>import cc from 'classcat';\nexport let radius = 5;\nlet className = '';\nexport { className as class };\n</script>\n\n<circle\n cx={radius}\n cy={radius}\n r={radius}\n class={cc(['svelte-flow__background-pattern', 'dots', className])}\n/>\n","<script>import cc from 'classcat';\nexport let lineWidth = 1;\nexport let dimensions;\nexport let variant = undefined;\nlet className = '';\nexport { className as class };\n</script>\n\n<path\n stroke-width={lineWidth}\n d={`M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`}\n class={cc(['svelte-flow__background-pattern', variant, className])}\n/>\n","<script labg=\"ts\" context=\"module\">\n const defaultSize = {\n [BackgroundVariant.Dots]: 1,\n [BackgroundVariant.Lines]: 1,\n [BackgroundVariant.Cross]: 6\n };\n</script>\n\n<script>import cc from 'classcat';\nimport DotPattern from './DotPattern.svelte';\nimport LinePattern from './LinePattern.svelte';\nimport { useStore } from '../../store';\nimport { BackgroundVariant } from './types';\nexport let id = undefined;\nexport let variant = BackgroundVariant.Dots;\nexport let gap = 20;\nexport let size = 1;\nexport let lineWidth = 1;\nexport let bgColor = undefined;\nexport let patternColor = undefined;\nexport let patternClass = undefined;\nlet className = '';\nexport { className as class };\nconst { viewport, flowId } = useStore();\nconst patternSize = size || defaultSize[variant];\nconst isDots = variant === BackgroundVariant.Dots;\nconst isCross = variant === BackgroundVariant.Cross;\nconst gapXY = Array.isArray(gap) ? gap : [gap, gap];\n$: patternId = `background-pattern-${$flowId}-${id ? id : ''}`;\n$: scaledGap = [gapXY[0] * $viewport.zoom || 1, gapXY[1] * $viewport.zoom || 1];\n$: scaledSize = patternSize * $viewport.zoom;\n$: patternDimensions = (isCross ? [scaledSize, scaledSize] : scaledGap);\n$: patternOffset = isDots\n ? [scaledSize / 2, scaledSize / 2]\n : [patternDimensions[0] / 2, patternDimensions[1] / 2];\n</script>\n\n<svg\n class={cc(['svelte-flow__background', className])}\n data-testid=\"svelte-flow__background\"\n style:--xy-background-color-props={bgColor}\n style:--xy-background-pattern-color-props={patternColor}\n>\n <pattern\n id={patternId}\n x={$viewport.x % scaledGap[0]}\n y={$viewport.y % scaledGap[1]}\n width={scaledGap[0]}\n height={scaledGap[1]}\n patternUnits=\"userSpaceOnUse\"\n patternTransform={`translate(-${patternOffset[0]},-${patternOffset[1]})`}\n >\n {#if isDots}\n <DotPattern radius={scaledSize / 2} class={patternClass} />\n {:else}\n <LinePattern dimensions={patternDimensions} {variant} {lineWidth} class={patternClass} />\n {/if}\n </pattern>\n <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill={`url(#${patternId})`} />\n</svg>\n\n<style>\n .svelte-flow__background {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n }\n</style>\n","<script>import cc from 'classcat';\nexport let x;\nexport let y;\nexport let width = 0;\nexport let height = 0;\nexport let borderRadius = 5;\nexport let color = undefined;\nexport let shapeRendering;\nexport let strokeColor = undefined;\nexport let strokeWidth = 2;\nexport let selected = false;\nlet className = '';\nexport { className as class };\n</script>\n\n<rect\n class={cc(['svelte-flow__minimap-node', className])}\n class:selected\n {x}\n {y}\n rx={borderRadius}\n ry={borderRadius}\n {width}\n {height}\n style={`${color ? `fill: ${color};` : ''}${strokeColor ? `stroke: ${strokeColor};` : ''}${\n strokeWidth ? `stroke-width: ${strokeWidth};` : ''\n }`}\n shape-rendering={shapeRendering}\n/>\n","import { get } from 'svelte/store';\nimport { XYMinimap } from '@xyflow/system';\nexport default function interactive(domNode, params) {\n const minimap = XYMinimap({\n domNode,\n panZoom: params.panZoom,\n getTransform: () => {\n const viewport = get(params.viewport);\n return [viewport.x, viewport.y, viewport.zoom];\n },\n getViewScale: params.getViewScale\n });\n function update(params) {\n minimap.update({\n translateExtent: params.translateExtent,\n width: params.width,\n height: params.height,\n inversePan: params.inversePan,\n zoomStep: params.zoomStep,\n pannable: params.pannable,\n zoomable: params.zoomable\n });\n }\n return {\n update,\n destroy() {\n minimap.destroy();\n }\n };\n}\n","<script context=\"module\">\"use strict\";\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst getAttrFunction = (func) => func instanceof Function ? func : () => func;\n</script>\n\n<script>import cc from 'classcat';\nimport { getBoundsOfRects, getInternalNodesBounds, getNodeDimensions, nodeHasDimensions } from '@xyflow/system';\nimport { useStore } from '../../store';\nimport { Panel } from '../../container/Panel';\nimport MinimapNode from './MinimapNode.svelte';\nimport interactive from './interactive';\nexport let position = 'bottom-right';\nexport let ariaLabel = 'Mini map';\nexport let nodeStrokeColor = 'transparent';\nexport let nodeColor = undefined;\nexport let nodeClass = '';\nexport let nodeBorderRadius = 5;\nexport let nodeStrokeWidth = 2;\nexport let bgColor = undefined;\nexport let maskColor = undefined;\nexport let maskStrokeColor = undefined;\nexport let maskStrokeWidth = undefined;\nexport let width = undefined;\nexport let height = undefined;\nexport let pannable = true;\nexport let zoomable = true;\nexport let inversePan = undefined;\nexport let zoomStep = undefined;\nexport let style = '';\nlet className = '';\nexport { className as class };\nconst defaultWidth = 200;\nconst defaultHeight = 150;\nconst { nodes, nodeLookup, viewport, width: containerWidth, height: containerHeight, flowId, panZoom, translateExtent } = useStore();\nconst nodeColorFunc = nodeColor === undefined ? undefined : getAttrFunction(nodeColor);\nconst nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor);\nconst nodeClassFunc = getAttrFunction(nodeClass);\nconst shapeRendering = \n// @ts-expect-error - TS doesn't know about chrome\ntypeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision';\nconst labelledBy = `svelte-flow__minimap-desc-${$flowId}`;\n$: viewBB = {\n x: -$viewport.x / $viewport.zoom,\n y: -$viewport.y / $viewport.zoom,\n width: $containerWidth / $viewport.zoom,\n height: $containerHeight / $viewport.zoom\n};\nlet boundingRect = viewBB;\n$: {\n boundingRect =\n $nodeLookup.size > 0\n ? getBoundsOfRects(getInternalNodesBounds($nodeLookup, { filter: (n) => !n.hidden }), viewBB)\n : viewBB;\n $nodes;\n}\n$: elementWidth = width ?? defaultWidth;\n$: elementHeight = height ?? defaultHeight;\n$: scaledWidth = boundingRect.width / elementWidth;\n$: scaledHeight = boundingRect.height / elementHeight;\n$: viewScale = Math.max(scaledWidth, scaledHeight);\n$: viewWidth = viewScale * elementWidth;\n$: viewHeight = viewScale * elementHeight;\n$: offset = 5 * viewScale;\n$: x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset;\n$: y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;\n$: viewboxWidth = viewWidth + offset * 2;\n$: viewboxHeight = viewHeight + offset * 2;\nconst getViewScale = () => viewScale;\n</script>\n\n<Panel\n {position}\n style={style + (bgColor ? `;--xy-minimap-background-color-props:${bgColor}` : '')}\n class={cc(['svelte-flow__minimap', className])}\n data-testid=\"svelte-flow__minimap\"\n>\n {#if $panZoom}\n <svg\n width={elementWidth}\n height={elementHeight}\n viewBox=\"{x} {y} {viewboxWidth} {viewboxHeight}\"\n class=\"svelte-flow__minimap-svg\"\n role=\"img\"\n aria-labelledby={labelledBy}\n style:--xy-minimap-mask-background-color-props={maskColor}\n style:--xy-minimap-mask-stroke-color-props={maskStrokeColor}\n style:--xy-minimap-mask-stroke-width-props={maskStrokeWidth\n ? maskStrokeWidth * viewScale\n : undefined}\n use:interactive={{\n panZoom: $panZoom,\n viewport,\n getViewScale,\n translateExtent: $translateExtent,\n width: $containerWidth,\n height: $containerHeight,\n inversePan,\n zoomStep,\n pannable,\n zoomable\n }}\n >\n {#if ariaLabel}<title id={labelledBy}>{ariaLabel}</title>{/if}\n\n {#each $nodes as userNode (userNode.id)}\n {@const node = $nodeLookup.get(userNode.id)}\n {#if node && nodeHasDimensions(node)}\n {@const nodeDimesions = getNodeDimensions(node)}\n <MinimapNode\n x={node.internals.positionAbsolute.x}\n y={node.internals.positionAbsolute.y}\n {...nodeDimesions}\n selected={node.selected}\n color={nodeColorFunc?.(node)}\n borderRadius={nodeBorderRadius}\n strokeColor={nodeStrokeColorFunc(node)}\n strokeWidth={nodeStrokeWidth}\n {shapeRendering}\n class={nodeClassFunc(node)}\n />\n {/if}\n {/each}\n <path\n class=\"svelte-flow__minimap-mask\"\n d=\"M{x - offset},{y - offset}h{viewboxWidth + offset * 2}v{viewboxHeight +\n offset * 2}h{-viewboxWidth - offset * 2}z\n M{viewBB.x},{viewBB.y}h{viewBB.width}v{viewBB.height}h{-viewBB.width}z\"\n fill-rule=\"evenodd\"\n pointer-events=\"none\"\n />\n </svg>\n {/if}\n</Panel>\n","import { isNodeBase, isEdgeBase } from '@xyflow/system';\n/**\n * Test whether an object is usable as a Node\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Node\n */\nexport const isNode = (element) => isNodeBase(element);\n/**\n * Test whether an object is usable as an Edge\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Edge\n */\nexport const isEdge = (element) => isEdgeBase(element);\n","import { get } from 'svelte/store';\nimport { getOverlappingArea, isRectObject, nodeToRect, pointToRendererPoint, getViewportForBounds, getElementsToRemove, rendererPointToPoint, evaluateAbsolutePosition, getNodesBounds } from '@xyflow/system';\nimport { useStore } from '../store';\nimport { isNode } from '../utils';\n/**\n * Hook for accessing the ReactFlow instance.\n *\n * @public\n *\n * @returns helper functions\n */\nexport function useSvelteFlow() {\n const { zoomIn, zoomOut, fitView, onbeforedelete, snapGrid, viewport, width, height, minZoom, maxZoom, panZoom, nodes, edges, domNode, nodeLookup, nodeOrigin, edgeLookup, connectionLookup } = useStore();\n const getNodeRect = (node) => {\n const $nodeLookup = get(nodeLookup);\n const nodeToUse = isNode(node) ? node : $nodeLookup.get(node.id);\n const position = nodeToUse.parentId\n ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, $nodeLookup, get(nodeOrigin))\n : nodeToUse.position;\n const nodeWithPosition = {\n ...nodeToUse,\n position,\n width: nodeToUse.measured?.width ?? nodeToUse.width,\n height: nodeToUse.measured?.height ?? nodeToUse.height\n };\n return nodeToRect(nodeWithPosition);\n };\n const updateNode = (id, nodeUpdate, options = { replace: false }) => {\n const node = get(nodeLookup).get(id)?.internals.userNode;\n if (!node) {\n return;\n }\n const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n if (options.replace) {\n nodes.update((nds) => nds.map((node) => {\n if (node.id === id) {\n return isNode(nextNode) ? nextNode : { ...node, ...nextNode };\n }\n return node;\n }));\n }\n else {\n Object.assign(node, nextNode);\n nodes.update((nds) => nds);\n }\n };\n const getInternalNode = (id) => get(nodeLookup).get(id);\n return {\n zoomIn,\n zoomOut,\n getInternalNode,\n getNode: (id) => getInternalNode(id)?.internals.userNode,\n getNodes: (ids) => (ids === undefined ? get(nodes) : getElements(get(nodeLookup), ids)),\n getEdge: (id) => get(edgeLookup).get(id),\n getEdges: (ids) => (ids === undefined ? get(edges) : getElements(get(edgeLookup), ids)),\n setZoom: (zoomLevel, options) => {\n const currentPanZoom = get(panZoom);\n return currentPanZoom\n ? currentPanZoom.scaleTo(zoomLevel, { duration: options?.duration })\n : Promise.resolve(false);\n },\n getZoom: () => get(viewport).zoom,\n setViewport: async (nextViewport, options) => {\n const currentViewport = get(viewport);\n const currentPanZoom = get(panZoom);\n if (!currentPanZoom) {\n return Promise.resolve(false);\n }\n await currentPanZoom.setViewport({\n x: nextViewport.x ?? currentViewport.x,\n y: nextViewport.y ?? currentViewport.y,\n zoom: nextViewport.zoom ?? currentViewport.zoom\n }, { duration: options?.duration });\n return Promise.resolve(true);\n },\n getViewport: () => get(viewport),\n setCenter: async (x, y, options) => {\n const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : get(maxZoom);\n const currentPanZoom = get(panZoom);\n if (!currentPanZoom) {\n return Promise.resolve(false);\n }\n await currentPanZoom.setViewport({\n x: get(width) / 2 - x * nextZoom,\n y: get(height) / 2 - y * nextZoom,\n zoom: nextZoom\n }, { duration: options?.duration });\n return Promise.resolve(true);\n },\n fitView,\n fitBounds: async (bounds, options) => {\n const currentPanZoom = get(panZoom);\n if (!currentPanZoom) {\n return Promise.resolve(false);\n }\n const viewport = getViewportForBounds(bounds, get(width), get(height), get(minZoom), get(maxZoom), options?.padding ?? 0.1);\n await currentPanZoom.setViewport(viewport, { duration: options?.duration });\n return Promise.resolve(true);\n },\n getIntersectingNodes: (nodeOrRect, partially = true, nodesToIntersect) => {\n const isRect = isRectObject(nodeOrRect);\n const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n if (!nodeRect) {\n return [];\n }\n return (nodesToIntersect || get(nodes)).filter((n) => {\n const internalNode = get(nodeLookup).get(n.id);\n if (!internalNode || (!isRect && n.id === nodeOrRect.id)) {\n return false;\n }\n const currNodeRect = nodeToRect(internalNode);\n const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n const partiallyVisible = partially && overlappingArea > 0;\n return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height;\n });\n },\n isNodeIntersecting: (nodeOrRect, area, partially = true) => {\n const isRect = isRectObject(nodeOrRect);\n const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n if (!nodeRect) {\n return false;\n }\n const overlappingArea = getOverlappingArea(nodeRect, area);\n const partiallyVisible = partially && overlappingArea > 0;\n return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height;\n },\n deleteElements: async ({ nodes: nodesToRemove = [], edges: edgesToRemove = [] }) => {\n const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({\n nodesToRemove,\n edgesToRemove,\n nodes: get(nodes),\n edges: get(edges),\n onBeforeDelete: get(onbeforedelete)\n });\n if (matchingNodes) {\n nodes.update((nds) => nds.filter((node) => !matchingNodes.some(({ id }) => id === node.id)));\n }\n if (matchingEdges) {\n edges.update((eds) => eds.filter((edge) => !matchingEdges.some(({ id }) => id === edge.id)));\n }\n return {\n deletedNodes: matchingNodes,\n deletedEdges: matchingEdges\n };\n },\n screenToFlowPosition: (position, options = { snapToGrid: true }) => {\n const _domNode = get(domNode);\n if (!_domNode) {\n return position;\n }\n const _snapGrid = options.snapToGrid ? get(snapGrid) : false;\n const { x, y, zoom } = get(viewport);\n const { x: domX, y: domY } = _domNode.getBoundingClientRect();\n const correctedPosition = {\n x: position.x - domX,\n y: position.y - domY\n };\n return pointToRendererPoint(correctedPosition, [x, y, zoom], _snapGrid !== null, _snapGrid || [1, 1]);\n },\n /**\n *\n * @param position\n * @returns\n */\n flowToScreenPosition: (position) => {\n const _domNode = get(domNode);\n if (!_domNode) {\n return position;\n }\n const { x, y, zoom } = get(viewport);\n const { x: domX, y: domY } = _domNode.getBoundingClientRect();\n const rendererPosition = rendererPointToPoint(position, [x, y, zoom]);\n return {\n x: rendererPosition.x + domX,\n y: rendererPosition.y + domY\n };\n },\n toObject: () => {\n return {\n nodes: get(nodes).map((node) => ({\n ...node,\n // we want to make sure that changes to the nodes object that gets returned by toObject\n // do not affect the nodes object\n position: { ...node.position },\n data: { ...node.data }\n })),\n edges: get(edges).map((edge) => ({ ...edge })),\n viewport: { ...get(viewport) }\n };\n },\n updateNode,\n updateNodeData: (id, dataUpdate, options) => {\n const node = get(nodeLookup).get(id)?.internals.userNode;\n if (!node) {\n return;\n }\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n node.data = options?.replace ? nextData : { ...node.data, ...nextData };\n nodes.update((nds) => nds);\n },\n getNodesBounds: (nodes) => {\n const _nodeLookup = get(nodeLookup);\n const _nodeOrigin = get(nodeOrigin);\n return getNodesBounds(nodes, { nodeLookup: _nodeLookup, nodeOrigin: _nodeOrigin });\n },\n getHandleConnections: ({ type, id, nodeId }) => Array.from(get(connectionLookup)\n .get(`${nodeId}-${type}-${id ?? null}`)\n ?.values() ?? []),\n viewport\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getElements(lookup, ids) {\n const result = [];\n for (const id of ids) {\n const item = lookup.get(id);\n if (item) {\n const element = 'internals' in item ? item.internals?.userNode : item;\n result.push(element);\n }\n }\n return result;\n}\n","<script>import { getContext } from 'svelte';\nimport { Position, getNodeToolbarTransform } from '@xyflow/system';\nimport portal from '../../actions/portal';\nimport { useStore } from '../../store';\nimport { useSvelteFlow } from '../../hooks/useSvelteFlow';\nexport let nodeId = undefined;\nexport let position = undefined;\nexport let align = undefined;\nexport let offset = undefined;\nexport let isVisible = undefined;\nconst { domNode, viewport, nodeLookup, nodes } = useStore();\nconst { getNodesBounds } = useSvelteFlow();\nconst contextNodeId = getContext('svelteflow__node_id');\nlet transform;\nlet toolbarNodes = [];\nlet _offset = offset !== undefined ? offset : 10;\nlet _position = position !== undefined ? position : Position.Top;\nlet _align = align !== undefined ? align : 'center';\n$: {\n // nly needed to trigger updates, $nodeLookup is just a helper that does not trigger any updates\n $nodes;\n const nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId];\n toolbarNodes = nodeIds.reduce((res, nodeId) => {\n const node = $nodeLookup.get(nodeId);\n if (node) {\n res.push(node);\n }\n return res;\n }, []);\n}\n$: {\n const nodeRect = getNodesBounds(toolbarNodes);\n if (nodeRect) {\n transform = getNodeToolbarTransform(nodeRect, $viewport, _position, _offset, _align);\n }\n}\n$: zIndex =\n toolbarNodes.length === 0\n ? 1\n : Math.max(...toolbarNodes.map((node) => (node.internals.z || 5) + 1));\n//FIXME: Possible performance bottleneck\n$: selectedNodesCount = $nodes.filter((node) => node.selected).length;\n// if isVisible is not set, we show the toolbar only if its node is selected and no other node is selected\n$: isActive =\n typeof isVisible === 'boolean'\n ? isVisible\n : toolbarNodes.length === 1 && toolbarNodes[0].selected && selectedNodesCount === 1;\n</script>\n\n{#if $domNode && isActive && toolbarNodes}\n <div\n data-id={toolbarNodes.reduce((acc, node) => `${acc}${node.id} `, '').trim()}\n class=\"svelte-flow__node-toolbar\"\n use:portal={{ domNode: $domNode }}\n style:position=\"absolute\"\n style:transform\n style:z-index={zIndex}\n >\n <slot />\n </div>\n{/if}\n","import { derived } from 'svelte/store';\nimport { shallowNodeData } from '@xyflow/system';\nimport { useStore } from '../store';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useNodesData(nodeIds) {\n const { nodes, nodeLookup } = useStore();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let prevNodesData = [];\n let initialRun = true;\n return derived([nodes, nodeLookup], ([, nodeLookup], set) => {\n const nextNodesData = [];\n const isArrayOfIds = Array.isArray(nodeIds);\n const _nodeIds = isArrayOfIds ? nodeIds : [nodeIds];\n for (const nodeId of _nodeIds) {\n const node = nodeLookup.get(nodeId)?.internals.userNode;\n if (node) {\n nextNodesData.push({\n id: node.id,\n type: node.type,\n data: node.data\n });\n }\n }\n if (!shallowNodeData(nextNodesData, prevNodesData) || initialRun) {\n prevNodesData = nextNodesData;\n set(isArrayOfIds ? nextNodesData : nextNodesData[0] ?? null);\n initialRun = false;\n }\n });\n}\n","export const componentName = 'tinyflow-component';\n","import { type useSvelteFlow } from '@xyflow/svelte';\nimport { componentName } from './consts';\nimport type { TinyflowData, TinyflowOptions } from './types';\n\ntype FlowInstance = ReturnType<typeof useSvelteFlow>;\n\nexport class Tinyflow {\n private options!: TinyflowOptions;\n private rootEl!: Element;\n private svelteFlowInstance!: FlowInstance;\n\n constructor(options: TinyflowOptions) {\n if (typeof options.element !== 'string' && !(options.element instanceof Element)) {\n throw new Error('element must be a string or Element');\n }\n this._setOptions(options);\n this._init();\n }\n\n private _init() {\n if (typeof this.options.element === 'string') {\n this.rootEl = document.querySelector(this.options.element)!;\n if (!this.rootEl) {\n throw new Error(\n `element not found by document.querySelector('${this.options.element}')`\n );\n }\n } else if (this.options.element instanceof Element) {\n this.rootEl = this.options.element;\n } else {\n throw new Error('element must be a string or Element');\n }\n\n const tinyflowEl = document.createElement(componentName) as HTMLElement & {\n options: TinyflowOptions;\n onInit: (svelteFlowInstance: FlowInstance) => void;\n };\n tinyflowEl.style.display = 'block';\n tinyflowEl.style.width = '100%';\n tinyflowEl.style.height = '100%';\n tinyflowEl.classList.add('tf-theme-light');\n\n tinyflowEl.options = this.options;\n tinyflowEl.onInit = (svelteFlowInstance: FlowInstance) => {\n this.svelteFlowInstance = svelteFlowInstance;\n };\n\n this.rootEl.appendChild(tinyflowEl);\n }\n\n private _setOptions(options: TinyflowOptions) {\n this.options = {\n ...options\n };\n }\n\n getOptions() {\n return this.options;\n }\n\n getData() {\n return this.svelteFlowInstance.toObject();\n }\n\n setData(data: TinyflowData) {\n this.options.data = data;\n\n const tinyflowEl = document.createElement(componentName) as HTMLElement & {\n options: TinyflowOptions;\n onInit: (svelteFlowInstance: FlowInstance) => void;\n };\n tinyflowEl.style.display = 'block';\n tinyflowEl.style.width = '100%';\n tinyflowEl.style.height = '100%';\n tinyflowEl.classList.add('tf-theme-light');\n\n tinyflowEl.options = this.options;\n tinyflowEl.onInit = (svelteFlowInstance: FlowInstance) => {\n this.svelteFlowInstance = svelteFlowInstance;\n };\n\n this.destroy();\n this.rootEl.appendChild(tinyflowEl);\n }\n\n destroy() {\n while (this.rootEl.firstChild) {\n this.rootEl.removeChild(this.rootEl.firstChild);\n }\n }\n}\n","import { writable } from 'svelte/store';\nimport { type Edge, type Node, type Viewport } from '@xyflow/svelte';\n\nconst createStore = () => {\n const nodesInternal = writable([] as Node[]);\n const edgesInternal = writable([] as Edge[]);\n const viewport = writable({ x: 250, y: 100, zoom: 1 } as Viewport);\n\n return {\n nodes: nodesInternal,\n edges: edgesInternal,\n viewport,\n init: (nodes: Node[], edges: Edge[]) => {\n nodesInternal.set(nodes);\n edgesInternal.set(edges);\n },\n addNode: (node: Node) => {\n nodesInternal.update((nodes) => [...nodes, node]);\n },\n removeNode: (id: string) => {\n nodesInternal.update((nodes) => nodes.filter((node) => node.id !== id));\n },\n updateNode: (id: string, node: Node) => {\n nodesInternal.update((nodes) => nodes.map((n) => (n.id === id ? node : n)));\n },\n updateNodeData: (id: string, data: Node['data']) => {\n nodesInternal.update((nodes) =>\n nodes.map((n) => (n.id === id ? { ...n, data: { ...n.data, ...data } } : n))\n );\n },\n selectNodeOnly: (id: string) => {\n nodesInternal.update((nodes) =>\n nodes.map((n) =>\n n.id === id ? { ...n, selected: true } : { ...n, selected: false }\n )\n );\n },\n addEdge: (edge: Edge) => {\n edgesInternal.update((edges) => [...edges, edge]);\n },\n removeEdge: (id: string) => {\n edgesInternal.update((edges) => edges.filter((edge) => edge.id !== id));\n },\n updateEdge: (id: string, edge: Edge) => {\n edgesInternal.update((edges) => edges.map((e) => (e.id === id ? edge : e)));\n },\n updateEdgeData: (id: string, data: Edge['data']) => {\n edgesInternal.update((edges) => edges.map((e) => (e.id === id ? { ...e, data } : e)));\n }\n };\n};\n\nexport const store = createStore();\n","<script lang=\"ts\">\n\n import type { MyHTMLButtonAttributes } from './types';\n import type { Snippet } from 'svelte';\n\n const { children, primary, ...rest }: MyHTMLButtonAttributes & {\n children?: Snippet;\n primary?: boolean;\n } = $props();\n</script>\n<button type=\"button\" {...rest} class=\"tf-btn {primary?'tf-btn-primary':''} nopan nodrag {rest.class}\">\n {@render children?.()}\n</button>\n","<script lang=\"ts\">\n import type { MyHTMLInputAttributes } from './types';\n\n const { ...rest }: MyHTMLInputAttributes = $props();\n</script>\n<input type=\"checkbox\" {...rest} class=\"tf-checkbox nopan nodrag {rest.class}\" />\n","<script lang=\"ts\">\n import { Button, Input } from './index';\n import type { MyHTMLAttributes } from './types';\n\n const { placeholder, label, value, buttonText = \"选择...\",onChosen, ...rest }: {\n placeholder?: string;\n label?: any;\n value?: any;\n buttonText?:string\n onChosen?: (value?: any, label?: any, event?: Event) => void,\n } & MyHTMLAttributes = $props();\n\n</script>\n<div {...rest} class=\"tf-chosen nopan nodrag {rest.class}\">\n <input type=\"hidden\" value={value}>\n <Input value={label} {placeholder} style=\"flex-grow: 1;\" disabled/>\n <Button onclick={(e)=>{\n onChosen?.(value, label, e);\n }} style=\"padding: 3px\" >{buttonText}</Button>\n</div>\n\n<style>\n .tf-chosen {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 5px;\n }\n</style>\n","<script lang=\"ts\">\n import type { MyHTMLInputAttributes } from './types';\n\n const { ...rest }: MyHTMLInputAttributes = $props();\n</script>\n<input type=\"text\" spellcheck=\"false\" {...rest} class=\"tf-input nopan nodrag {rest.class}\" />\n","<script lang=\"ts\">\n import type { MyHTMLTextareaAttributes } from './types';\n\n const { value, ...rest }: MyHTMLTextareaAttributes & {\n value?: any;\n } = $props();\n\n</script>\n<textarea spellcheck=\"false\" {...rest} class=\"tf-textarea nodrag nowheel {rest.class}\">{value || \"\"}</textarea>\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n\n interface Item {\n value: number | string;\n label: string | Snippet;\n }\n\n export let items: Item[] = [];\n\n export let onChange: ((item: Item, index: number) => void) = () => {\n };\n\n export let activeIndex: number = 0;\n\n function handlerOnChange(item: Item, index: number) {\n activeIndex = index;\n onChange?.(item, index);\n }\n\n</script>\n<div {...$$restProps} class=\"tf-tabs {$$restProps.class}\">\n {#each items as item, index}\n <div class=\"tf-tabs-item {index === activeIndex ? 'active' : ''}\" role=\"button\" tabindex={index}\n onclick={() => handlerOnChange(item,index)}\n onkeydown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handlerOnChange(item,index);\n }\n }}\n >\n {#if typeof item.label === 'string'}\n {item.label}\n {:else }\n {@render item.label?.()}\n {/if}\n </div>\n {/each}\n</div>\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { Render } from './index';\n\n interface Item {\n key: string;\n icon?: string | Snippet;\n title: string | Snippet;\n description?: string | Snippet;\n content: string | Snippet;\n }\n\n let { items, onChange, activeKeys = $bindable([]), ...rest }: {\n items: Item[],\n onChange?: (item: Item, activeKeys: string[]) => void,\n activeKeys?: string[],\n [key: string]: any\n } = $props();\n\n function handlerOnChange(item: Item) {\n if (activeKeys.includes(item.key)) {\n activeKeys = activeKeys.filter(key => key !== item.key);\n } else {\n activeKeys.push(item.key);\n activeKeys = activeKeys;\n }\n onChange?.(item, activeKeys);\n }\n\n</script>\n<div style={rest.style} class=\"tf-collapse {rest.class}\">\n {#each items as item, index}\n <div class=\"tf-collapse-item\">\n <div class=\"tf-collapse-item-title\" role=\"button\" tabindex={index}\n onclick={() => handlerOnChange(item)}\n onkeydown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handlerOnChange(item);\n }\n }}\n >\n {#if item.icon}\n <span class=\"tf-collapse-item-title-icon\">\n <Render target={item.icon} />\n </span>\n {/if}\n\n <Render target={item.title} />\n\n <span class=\"tf-collapse-item-title-arrow {activeKeys.includes(item.key) ? 'rotate-90' : ''}\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path\n d=\"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z\"></path></svg>\n </span>\n </div>\n {#if item.description}\n <div class=\"tf-collapse-item-description\">\n <Render target={item.description} />\n </div>\n {/if}\n\n {#if activeKeys.includes(item.key)}\n <div class=\"tf-collapse-item-content\">\n <Render target={item.content} />\n </div>\n {/if}\n </div>\n {/each}\n</div>\n\n\n<style>\n /* 定义旋转的 CSS 类 */\n .rotate-90 {\n transform: rotate(90deg);\n transition: transform 0.3s ease;\n }\n</style>\n","<script lang=\"ts\">\n let { target } = $props();\n if (typeof target === 'undefined') target = \"undefined\";\n</script>\n\n\n{#if typeof target === 'function'}\n {@render target?.()}\n{:else }\n {@html target}\n{/if}\n\n","<script lang=\"ts\">\n import { FloatingTrigger, Render } from './index';\n import type { SelectItem } from '../../types';\n\n let {\n items,\n onSelect,\n value = [],\n defaultValue = [],\n expandAll = true,\n multiple = false,\n expandValue = [],\n placeholder,\n ...rest\n }: {\n items: SelectItem[],\n onSelect?: (item: SelectItem) => void,\n value?: (any)[],\n defaultValue?: (number | string | undefined)[],\n expandAll?: boolean,\n expandValue?: (number | string)[],\n multiple?: boolean\n placeholder?: string\n [key: string]: any\n } = $props();\n\n\n let activeItemsState = $derived.by(() => {\n const resultItems: SelectItem[] = [];\n const fillResult = (items: SelectItem[]) => {\n for (let item of items) {\n if (value.length > 0) {\n if (value.includes(item.value)) {\n resultItems.push(item);\n }\n } else {\n if (defaultValue.includes(item.value)) {\n resultItems.push(item);\n }\n }\n\n if (item.children && item.children.length > 0) {\n fillResult(item.children);\n }\n }\n };\n fillResult(items);\n return resultItems;\n });\n\n let triggerObject: any;\n function handlerOnSelect(item: SelectItem) {\n triggerObject?.hide();\n onSelect?.(item);\n }\n</script>\n\n\n{#snippet selectItems(items: SelectItem[])}\n {#each items as item, index (`${index}_${item.value}`)}\n <button class=\"tf-select-content-item\"\n onclick={() => handlerOnSelect(item)}\n >\n <span>\n {#if item.children && item.children.length > 0}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path\n d=\"M12 14L8 10H16L12 14Z\"></path></svg>\n {/if}\n </span>\n <Render target={item.label} />\n </button>\n {#if (item.children && item.children.length > 0 && (expandAll || expandValue.includes(item.value)))}\n <div class=\"tf-select-content-children\">\n {@render selectItems(item.children)}\n </div>\n {/if}\n {/each}\n\n{/snippet}\n\n\n<div {...rest} class=\"tf-select {rest['class']}\">\n <FloatingTrigger bind:this={triggerObject}>\n <button class=\"tf-select-input nopan nodrag\" {...rest}>\n <div class=\"tf-select-input-value\">\n {#each activeItemsState as item, index (`${index}_${item.value}`)}\n {#if !multiple}\n {#if index === 0}\n <Render target={item.label} />\n {/if}\n {:else}\n <Render target={item.label} />\n {#if index < activeItemsState.length - 1}\n ,\n {/if}\n {/if}\n {:else}\n <div class=\"tf-select-input-placeholder\">\n {placeholder}\n </div>\n {/each}\n </div>\n <div class=\"tf-select-input-arrow\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z\"></path>\n </svg>\n </div>\n </button>\n\n {#snippet floating()}\n <div class=\"tf-select-content nopan nodrag\">\n {@render selectItems(items)}\n </div>\n {/snippet}\n </FloatingTrigger>\n</div>\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nconst yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);\nfunction getSideAxis(placement) {\n return yAxisSides.has(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nconst invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);\n}\nconst tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);\nfunction isTableElement(element) {\n return tableElements.has(getNodeName(element));\n}\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(element) {\n return topLayerSelectors.some(selector => {\n try {\n return element.matches(selector);\n } catch (_e) {\n return false;\n }\n });\n}\nconst transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];\nconst willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];\nconst containValues = ['paint', 'layout', 'strict', 'content'];\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nconst lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);\nfunction isLastTraversableNode(node) {\n return lastTraversableNodeNames.has(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n // RTL <body> scrollbar.\n getWindowScrollBarX(documentElement, htmlRect));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nconst absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import {\n computePosition,\n flip,\n shift,\n arrow,\n offset,\n type Placement,\n type OffsetOptions,\n type FlipOptions,\n type ShiftOptions\n} from '@floating-ui/dom';\n\nexport type FloatingOptions = {\n trigger: string | HTMLElement;\n triggerEvent?: string[];\n floatContent: string | HTMLElement;\n placement?: Placement;\n offsetOptions?: OffsetOptions;\n flipOptions?: FlipOptions;\n shiftOptions?: ShiftOptions;\n interactive?: boolean;\n showArrow?: boolean;\n};\n\nexport type FloatingInstance = {\n destroy: () => void;\n hide: () => void;\n isVisible: () => boolean;\n};\n\nexport const createFloating = ({\n trigger,\n triggerEvent,\n floatContent,\n placement = 'bottom',\n offsetOptions,\n flipOptions,\n shiftOptions,\n interactive,\n showArrow\n}: FloatingOptions): FloatingInstance => {\n if (typeof trigger === 'string') {\n const triggerEl = document.querySelector(trigger);\n if (!triggerEl) {\n throw new Error(\"element not found by document.querySelector('\" + trigger + \"')\");\n } else {\n trigger = triggerEl as HTMLElement;\n }\n }\n\n let floating: HTMLElement;\n if (typeof floatContent === 'string') {\n const floatContentEl = document.querySelector(floatContent);\n if (!floatContentEl) {\n throw new Error(\"element not found by document.querySelector('\" + floatContent + \"')\");\n } else {\n floating = floatContentEl as HTMLElement;\n }\n } else {\n floating = floatContent as HTMLElement;\n }\n\n let arrowElement: HTMLElement;\n if (showArrow) {\n arrowElement = document.createElement('div');\n arrowElement.style.position = 'absolute';\n arrowElement.style.backgroundColor = '#222';\n arrowElement.style.width = '8px';\n arrowElement.style.height = '8px';\n arrowElement.style.transform = 'rotate(45deg)';\n arrowElement.style.display = 'none';\n\n floating.firstElementChild!.before(arrowElement);\n }\n\n function updatePosition() {\n computePosition(trigger as Element, floating, {\n placement: placement,\n middleware: [\n offset(offsetOptions), // 手动偏移配置\n flip(flipOptions), //自动翻转\n shift(shiftOptions), //自动偏移(使得浮动元素能够进入视野)\n ...(showArrow ? [arrow({ element: arrowElement })] : [])\n ]\n }).then(({ x, y, placement, middlewareData }) => {\n Object.assign(floating.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n\n if (showArrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow as { x: number; y: number };\n const staticSide = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right'\n }[placement.split('-')[0]] as string;\n\n Object.assign(arrowElement.style, {\n zIndex: -1,\n left: arrowX != null ? `${arrowX}px` : '',\n top: arrowY != null ? `${arrowY}px` : '',\n right: '',\n bottom: '',\n [staticSide]: '2px'\n });\n }\n });\n }\n\n let visible = false;\n\n function showTooltip() {\n floating.style.display = 'block';\n floating.style.visibility = 'block';\n floating.style.position = 'absolute';\n\n if (showArrow) {\n arrowElement.style.display = 'block';\n }\n\n visible = true;\n updatePosition();\n }\n\n function hideTooltip() {\n floating.style.display = 'none';\n if (showArrow) {\n arrowElement.style.display = 'none';\n }\n visible = false;\n }\n\n function onTrigger(event: any) {\n event.stopPropagation();\n if (!visible) {\n showTooltip();\n } else {\n hideTooltip();\n }\n }\n\n function hideTooltipCompute(event: any) {\n if (floating.contains(event.target as Node)) {\n return;\n }\n hideTooltip();\n }\n\n if (!triggerEvent || triggerEvent.length == 0) {\n if (interactive) {\n triggerEvent = ['click'];\n } else {\n triggerEvent = ['mouseenter', 'focus'];\n }\n }\n\n triggerEvent.forEach((event) => {\n (trigger as HTMLElement).addEventListener(event, onTrigger);\n });\n\n if (interactive) {\n document.addEventListener('click', hideTooltipCompute);\n } else {\n ['mouseleave', 'blur'].forEach((event) => {\n trigger.addEventListener(event, hideTooltip);\n });\n }\n\n return {\n destroy() {\n triggerEvent.forEach((event) => {\n (trigger as HTMLElement).removeEventListener(event, onTrigger);\n });\n\n if (interactive) {\n document.removeEventListener('click', hideTooltipCompute);\n } else {\n ['mouseleave', 'blur'].forEach((event) => {\n trigger.removeEventListener(event, hideTooltip);\n });\n }\n },\n hide() {\n hideTooltip();\n },\n\n isVisible() {\n return visible;\n }\n };\n};\n","<script lang=\"ts\">\n import { onMount, type Snippet } from 'svelte';\n import { createFloating } from '../utils/createFloating';\n import type { Placement } from '@floating-ui/dom';\n\n const { children, floating, placement = 'bottom' }:\n {\n children: Snippet,\n floating: Snippet,\n placement?: Placement,\n } = $props();\n\n let triggerEl!: HTMLDivElement, contentEl!: HTMLDivElement;\n let floatingInstance: ReturnType<typeof createFloating>;\n\n onMount(() => {\n floatingInstance = createFloating({\n trigger: triggerEl,\n floatContent: contentEl,\n interactive: true,\n placement\n });\n return () => {\n floatingInstance.destroy();\n };\n });\n\n export function hide() {\n floatingInstance.hide();\n }\n</script>\n<div style=\"position: relative\">\n <div bind:this={triggerEl}>\n {@render children() }\n </div>\n <div style=\"display: none; width: 100%;z-index: 9999\" bind:this={contentEl}>\n {@render floating() }\n </div>\n</div>\n\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n\n const { children, level = 1, mt, mb }: {\n children: Snippet;\n level: 1 | 2 | 3 | 4 | 5 | 6;\n mt?: string;\n mb?: string;\n } = $props();\n\n</script>\n\n<svelte:element this={`h${level}`} class=\"tf-heading\" style=\"margin-top:{mt || '0'};margin-bottom:{mb||'0'}\">\n {@render children?.()}\n</svelte:element>\n","<script lang=\"ts\">\n import Button from './button.svelte';\n import type { MyHTMLButtonAttributes } from './types';\n\n const { ...rest }: MyHTMLButtonAttributes = $props();\n</script>\n\n<Button {...rest} class=\"input-btn-more {rest.class}\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M4.5 10.5C3.675 10.5 3 11.175 3 12C3 12.825 3.675 13.5 4.5 13.5C5.325 13.5 6 12.825 6 12C6 11.175 5.325 10.5 4.5 10.5ZM19.5 10.5C18.675 10.5 18 11.175 18 12C18 12.825 18.675 13.5 19.5 13.5C20.325 13.5 21 12.825 21 12C21 11.175 20.325 10.5 19.5 10.5ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z\"></path>\n </svg>\n</Button>\n\n<style>\n :global(.input-btn-more) {\n border: 1px solid transparent;\n padding: 3px;\n\n &:hover {\n background: #eee;\n border: 1px solid transparent;\n }\n }\n</style>\n","import { useStore } from '@xyflow/svelte';\n\nexport const useDeleteNode = () => {\n const store = useStore();\n const deleteNode = (id: string) => {\n store.nodes.update((nodes) => nodes.filter((node) => node.id !== id));\n store.edges.update((edges) =>\n edges.filter((edge) => edge.source !== id && edge.target !== id)\n );\n };\n return {\n deleteNode\n };\n};\n","export const genShortId = (length = 16) => {\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const array = new Uint8Array(length);\n crypto.getRandomValues(array);\n return Array.from(array, (byte) => chars[byte % chars.length]).join('');\n};\n\nexport const genUuid = () => {\n return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c: any) =>\n (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n );\n};\n","import { useStore } from '@xyflow/svelte';\nimport { get } from 'svelte/store';\nimport { genShortId } from './IdGen';\n\nexport const useCopyNode = () => {\n const { nodes, nodeLookup } = useStore();\n const copyNode = (id: string) => {\n const $nodeLookup = get(nodeLookup);\n const node = $nodeLookup.get(id)?.internals.userNode;\n\n if (node) {\n const newNodeId = genShortId();\n const newNode = {\n ...node,\n id: newNodeId,\n position: {\n x: node.position.x + 50,\n y: node.position.y + 50\n }\n };\n\n //添加新节点\n nodes.update((nodes) => [...nodes, newNode]);\n\n //更新选择状态\n nodes.update((nodes) =>\n nodes.map((n) =>\n n.id === newNodeId ? { ...n, selected: true } : { ...n, selected: false }\n )\n );\n }\n };\n return {\n copyNode\n };\n};\n","import { getContext } from 'svelte';\nimport { useNodesData, useSvelteFlow } from '@xyflow/svelte';\nimport type { TinyflowOptions } from '../../types';\n\nexport const useCurrentNodeId = () => {\n return getContext<string>('svelteflow__node_id');\n};\n\nexport const getOptions = () => {\n return getContext<TinyflowOptions>('tinyflow_options');\n};\n\nexport const useCurrentNodeData = () => {\n const currentNodeId = useCurrentNodeId();\n return useNodesData<any>(currentNodeId);\n};\n\nexport const useUpdateNodeData = () => {\n const { updateNodeData } = useSvelteFlow();\n const currentNodeId = useCurrentNodeId();\n return {\n updateNodeData: (data: any) => {\n updateNodeData(currentNodeId, data);\n }\n };\n};\n","import { getContext } from 'svelte';\nimport { type Node, useStore } from '@xyflow/svelte';\nimport { get } from 'svelte/store';\n\nexport function getCurrentNodeId(): string {\n return getContext<string>('svelteflow__node_id');\n}\n\nexport function getCurrentNode(): Node {\n const { nodeLookup } = useStore();\n return get(nodeLookup).get(getCurrentNodeId())?.internals.userNode as Node;\n}\n\nexport function getCurrentNodeData(): Node['data'] {\n return getCurrentNode()?.['data'];\n}\n","<script lang=\"ts\">\n import { Handle, type NodeProps, NodeToolbar, Position, useSvelteFlow } from '@xyflow/svelte';\n import { Button, Collapse, FloatingTrigger, Input, Textarea } from '../base';\n import { type Snippet } from 'svelte';\n import { useDeleteNode } from '../utils/useDeleteNode';\n import { useCopyNode } from '../utils/useCopyNode';\n import { getOptions } from '../utils/NodeUtils';\n import { getCurrentNodeId } from '../../store/nodeContext';\n\n const {\n data,\n id = '',\n icon,\n handle,\n children,\n allowExecute = true,\n allowCopy = true,\n allowDelete = true,\n allowSetting = true,\n allowSettingOfCondition = true,\n showSourceHandle = true,\n showTargetHandle = true,\n onCollapse\n }: {\n data: NodeProps['data'],\n id?: NodeProps['id'],\n icon?: Snippet,\n handle?: Snippet,\n children: Snippet,\n allowExecute?: boolean,\n allowCopy?: boolean,\n allowDelete?: boolean,\n allowSetting?: boolean,\n allowSettingOfCondition?: boolean,\n showSourceHandle?: boolean,\n showTargetHandle?: boolean,\n onCollapse?: (key: string) => void,\n } = $props();\n\n let activeKeys = data.expand ? ['key'] : [];\n const { updateNodeData, getNode } = useSvelteFlow();\n\n const items = $derived.by(() => {\n return [{\n key: 'key',\n icon,\n title: data.title as string,\n description: data.description as string,\n content: children\n }];\n });\n\n\n const { deleteNode } = useDeleteNode();\n const { copyNode } = useCopyNode();\n\n const options = getOptions();\n\n const executeNode = () => {\n options.onNodeExecute?.(getNode(id)!);\n };\n\n let currentNodeId = getCurrentNodeId();\n\n</script>\n\n\n{#if allowExecute || allowCopy || allowDelete}\n <NodeToolbar position={Position.Top} align=\"end\">\n <div class=\"tf-node-toolbar\">\n {#if allowDelete}\n <Button class=\"tf-node-toolbar-item\" onclick={()=>{ deleteNode(id) }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z\"></path>\n </svg>\n </Button>\n {/if}\n {#if allowCopy}\n <Button class=\"tf-node-toolbar-item\" onclick={()=>{copyNode(id)}}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z\"></path>\n </svg>\n </Button>\n {/if}\n {#if allowExecute}\n <Button class=\"tf-node-toolbar-item\" onclick={executeNode}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M8 18.3915V5.60846L18.2264 12L8 18.3915ZM6 3.80421V20.1957C6 20.9812 6.86395 21.46 7.53 21.0437L20.6432 12.848C21.2699 12.4563 21.2699 11.5436 20.6432 11.152L7.53 2.95621C6.86395 2.53993 6 3.01878 6 3.80421Z\"></path>\n </svg>\n </Button>\n {/if}\n {#if allowSetting}\n <FloatingTrigger placement=\"bottom\">\n <Button class=\"tf-node-toolbar-item\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M3.33946 17.0002C2.90721 16.2515 2.58277 15.4702 2.36133 14.6741C3.3338 14.1779 3.99972 13.1668 3.99972 12.0002C3.99972 10.8345 3.3348 9.824 2.36353 9.32741C2.81025 7.71651 3.65857 6.21627 4.86474 4.99001C5.7807 5.58416 6.98935 5.65534 7.99972 5.072C9.01009 4.48866 9.55277 3.40635 9.4962 2.31604C11.1613 1.8846 12.8847 1.90004 14.5031 2.31862C14.4475 3.40806 14.9901 4.48912 15.9997 5.072C17.0101 5.65532 18.2187 5.58416 19.1346 4.99007C19.7133 5.57986 20.2277 6.25151 20.66 7.00021C21.0922 7.7489 21.4167 8.53025 21.6381 9.32628C20.6656 9.82247 19.9997 10.8336 19.9997 12.0002C19.9997 13.166 20.6646 14.1764 21.6359 14.673C21.1892 16.2839 20.3409 17.7841 19.1347 19.0104C18.2187 18.4163 17.0101 18.3451 15.9997 18.9284C14.9893 19.5117 14.4467 20.5941 14.5032 21.6844C12.8382 22.1158 11.1148 22.1004 9.49633 21.6818C9.55191 20.5923 9.00929 19.5113 7.99972 18.9284C6.98938 18.3451 5.78079 18.4162 4.86484 19.0103C4.28617 18.4205 3.77172 17.7489 3.33946 17.0002ZM8.99972 17.1964C10.0911 17.8265 10.8749 18.8227 11.2503 19.9659C11.7486 20.0133 12.2502 20.014 12.7486 19.9675C13.1238 18.8237 13.9078 17.8268 14.9997 17.1964C16.0916 16.5659 17.347 16.3855 18.5252 16.6324C18.8146 16.224 19.0648 15.7892 19.2729 15.334C18.4706 14.4373 17.9997 13.2604 17.9997 12.0002C17.9997 10.74 18.4706 9.5632 19.2729 8.6665C19.1688 8.4405 19.0538 8.21822 18.9279 8.00021C18.802 7.78219 18.667 7.57148 18.5233 7.36842C17.3457 7.61476 16.0911 7.43414 14.9997 6.80405C13.9083 6.17395 13.1246 5.17768 12.7491 4.03455C12.2509 3.98714 11.7492 3.98646 11.2509 4.03292C10.8756 5.17671 10.0916 6.17364 8.99972 6.80405C7.9078 7.43447 6.65245 7.61494 5.47428 7.36803C5.18485 7.77641 4.93463 8.21117 4.72656 8.66637C5.52881 9.56311 5.99972 10.74 5.99972 12.0002C5.99972 13.2604 5.52883 14.4372 4.72656 15.3339C4.83067 15.5599 4.94564 15.7822 5.07152 16.0002C5.19739 16.2182 5.3324 16.4289 5.47612 16.632C6.65377 16.3857 7.90838 16.5663 8.99972 17.1964ZM11.9997 15.0002C10.3429 15.0002 8.99972 13.6571 8.99972 12.0002C8.99972 10.3434 10.3429 9.00021 11.9997 9.00021C13.6566 9.00021 14.9997 10.3434 14.9997 12.0002C14.9997 13.6571 13.6566 15.0002 11.9997 15.0002ZM11.9997 13.0002C12.552 13.0002 12.9997 12.5525 12.9997 12.0002C12.9997 11.4479 12.552 11.0002 11.9997 11.0002C11.4474 11.0002 10.9997 11.4479 10.9997 12.0002C10.9997 12.5525 11.4474 13.0002 11.9997 13.0002Z\"></path>\n </svg>\n </Button>\n {#snippet floating()}\n <div class=\"settings\">\n\n <div class=\"input-item\">\n 节点名称:\n <Input style=\"width: 100%;\" onchange={(event)=>{\n const value = (event.target as any).value;\n updateNodeData(currentNodeId,{\n title: value\n })\n }} value={data.title} />\n </div>\n\n <div class=\"input-item\">\n 参数描述:\n <Textarea rows={3} style=\"width: 100%;\" onchange={(event)=>{\n const value = (event.target as any).value;\n updateNodeData(currentNodeId,{\n description: value\n })\n }} value={data.description} />\n </div>\n\n {#if allowSettingOfCondition}\n <div class=\"input-item\">\n 执行条件:\n <Textarea rows={2} style=\"width: 100%;\" onchange={(event)=>{\n const value = (event.target as any).value;\n updateNodeData(currentNodeId,{\n condition: value\n })\n }} value={data.condition} />\n </div>\n {/if}\n\n <label class=\"input-item-inline\">\n <span>异步执行:</span>\n <input type=\"checkbox\" checked={!!data.async} onchange={(event)=>{\n const value = (event.target as any).checked;\n updateNodeData(currentNodeId,{\n async: value\n })\n }} />\n </label>\n\n </div>\n {/snippet}\n </FloatingTrigger>\n {/if}\n </div>\n </NodeToolbar>\n{/if}\n\n<div class=\"tf-node-wrapper\">\n <div class=\"tf-node-wrapper-title\">\n iTerms.ai\n </div>\n <div class=\"tf-node-wrapper-body\">\n <Collapse {items} activeKeys={activeKeys} onChange={(_,actionKeys) => {\n updateNodeData(id, {expand: actionKeys?.includes('key')})\n onCollapse?.(actionKeys?.includes('key') ? 'key' : '')\n }} />\n </div>\n</div>\n\n{#if showTargetHandle}\n <Handle type=\"target\" position={Position.Left} style=\" left: -12px;top: 20px\" />\n{/if}\n{#if showSourceHandle}\n <Handle type=\"source\" position={Position.Right} style=\"right: -12px;top: 20px\" />\n{/if}\n{@render handle?.()}\n\n<style lang=\"less\">\n .tf-node-toolbar {\n display: flex;\n gap: 5px;\n padding: 5px;\n border-radius: 5px;\n background: #fff;\n border: 1px solid #eee;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n }\n\n :global(.tf-node-toolbar-item) {\n border: 1px solid transparent;\n }\n\n .settings {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px;\n background: #fff;\n border: 1px solid #ddd;\n border-radius: 5px;\n width: 200px;\n box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);\n\n .input-item {\n display: flex;\n flex-direction: column;\n gap: 3px;\n font-size: 12px;\n color: #666;\n }\n .input-item-inline {\n display: flex;\n align-items: center;\n font-size: 12px;\n color: #666;\n }\n }\n</style>\n\n\n","export const parameterDataTypes = [\n {\n value: 'String',\n label: 'String'\n },\n {\n value: 'Number',\n label: 'Number'\n },\n {\n value: 'Boolean',\n label: 'Boolean'\n },\n {\n value: 'File',\n label: 'File'\n },\n {\n value: 'Object',\n label: 'Object'\n },\n {\n value: 'Array',\n label: 'Array'\n }\n];\n\nexport const parameterRefTypes = [\n {\n value: 'ref',\n label: '引用'\n },\n {\n value: 'fixed',\n label: '固定值'\n },\n // {\n // value: 'input',\n // label: '输入'\n // }\n];\n","<script lang=\"ts\">\n import { Input, Textarea } from '../base';\n import { Button, Checkbox, FloatingTrigger, Select } from '../base/index.js';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useNodesData, useSvelteFlow } from '@xyflow/svelte';\n import { parameterDataTypes } from '../utils/Consts';\n import type { SelectItem, Parameter } from '../../types';\n\n const { parameter, index }: {\n parameter: Parameter,\n index: number\n } = $props();\n\n\n let currentNodeId = getCurrentNodeId();\n let node = $derived(useNodesData(currentNodeId));\n let param = $derived.by(() => {\n return {\n ...parameter,\n ...($node?.data?.parameters as Array<Parameter>)[index]\n };\n });\n\n const { updateNodeData } = useSvelteFlow();\n\n const updateParameter = (key: string, value: any) => {\n updateNodeData(currentNodeId, (node) => {\n let parameters = node.data.parameters as Array<Parameter>;\n (parameters[index] as any)[key] = value;\n return {\n parameters\n };\n });\n };\n\n const updateName = (event: Event) => {\n const newValue = (event.target as any).value;\n updateParameter('name', newValue);\n };\n\n\n const updateRequired = (event: Event) => {\n const checked = (event.target as any).checked;\n updateParameter('required', checked);\n };\n\n\n const updateDataType = (item: SelectItem) => {\n const dataType = item.value as string;\n if (dataType) {\n updateParameter('dataType', dataType);\n }\n };\n\n\n let triggerObject: any;\n const handleDelete = () => {\n updateNodeData(currentNodeId, (node) => {\n let parameters = node.data.parameters as Array<Parameter>;\n parameters.splice(index, 1);\n return {\n parameters: [...parameters]\n };\n });\n triggerObject?.hide();\n };\n\n</script>\n\n\n<div class=\"input-item\">\n <Input style=\"width: 100%;\" value={param.name} placeholder=\"请输入参数名称\"\n oninput={updateName} />\n</div>\n<div class=\"input-item\">\n <Checkbox checked={param.required} onchange={updateRequired} />\n</div>\n<div class=\"input-item\">\n <FloatingTrigger placement=\"bottom\" bind:this={triggerObject}>\n <Button class=\"input-btn-more\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M4.5 10.5C3.675 10.5 3 11.175 3 12C3 12.825 3.675 13.5 4.5 13.5C5.325 13.5 6 12.825 6 12C6 11.175 5.325 10.5 4.5 10.5ZM19.5 10.5C18.675 10.5 18 11.175 18 12C18 12.825 18.675 13.5 19.5 13.5C20.325 13.5 21 12.825 21 12C21 11.175 20.325 10.5 19.5 10.5ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z\"></path>\n </svg>\n </Button>\n {#snippet floating()}\n <div class=\"input-more-setting\">\n <div class=\"input-more-item\">\n 参数类型:\n <Select items={parameterDataTypes} style=\"width: 100%\" onSelect={updateDataType}\n value={param.dataType ?[param.dataType]:['String']} />\n </div>\n <div class=\"input-more-item\">\n 默认值:\n <Textarea rows={1} style=\"width: 100%;\"\n value={param.defaultValue}\n onchange={event => {\n const newValue = (event.target as any).value;\n updateParameter('defaultValue', newValue)\n }}\n />\n </div>\n <div class=\"input-more-item\">\n 参数描述:\n <Textarea rows={3} style=\"width: 100%;\"\n value={param.description}\n onchange={event => {\n const newValue = (event.target as any).value;\n updateParameter('description', newValue)\n }}\n />\n </div>\n\n <div class=\"input-more-item\">\n <Button onclick={handleDelete}>删除</Button>\n </div>\n </div>\n {/snippet}\n </FloatingTrigger>\n</div>\n\n\n<style lang=\"less\">\n .input-item {\n display: flex;\n align-items: center;\n }\n\n .input-more-setting {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px;\n background: #fff;\n border: 1px solid #ddd;\n border-radius: 5px;\n width: 200px;\n box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);\n\n .input-more-item {\n display: flex;\n flex-direction: column;\n gap: 3px;\n font-size: 12px;\n color: #666;\n }\n }\n\n</style>\n\n\n","<script lang=\"ts\">\n import DefinedParameterItem from './DefinedParameterItem.svelte';\n import { useNodesData } from '@xyflow/svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n\n let currentNodeId = getCurrentNodeId();\n let node = $derived(useNodesData(currentNodeId));\n let parameters = $derived.by(() => {\n return [...$node?.data?.parameters as Array<any> || []];\n });\n</script>\n\n\n<div class=\"input-container\">\n {#if (parameters.length !== 0)}\n <div class=\"input-header\">参数名称</div>\n <div class=\"input-header\">必填</div>\n <div class=\"input-header\"></div>\n {/if}\n {#each parameters as param, index (param.id)}\n <DefinedParameterItem parameter={param} index={index} />\n {:else }\n <div class=\"none-params\">无输入参数</div>\n {/each}\n</div>\n\n\n<style lang=\"less\">\n .input-container {\n display: grid;\n grid-template-columns: 80% 10% 10%;\n row-gap: 5px;\n column-gap: 3px;\n\n .none-params {\n font-size: 12px;\n background: #f8f8f8;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 5px;\n width: calc(100% - 5px);\n grid-column: 1 / -1; /* 从第一列开始到最后一列结束 */\n }\n\n .input-header {\n font-size: 12px;\n color: #666;\n }\n }\n\n\n</style>\n\n\n","import { genShortId } from './IdGen';\nimport { useSvelteFlow } from '@xyflow/svelte';\nimport type { Parameter } from '../../types';\n\nexport const fillParameterId = (parameters?: Parameter[]) => {\n if (!parameters || parameters.length == 0) {\n return parameters;\n }\n parameters.forEach((parameter) => {\n if (!parameter.id) {\n parameter.id = genShortId();\n }\n fillParameterId(parameter.children);\n });\n\n return parameters;\n};\n\nexport const useAddParameter = () => {\n const { updateNodeData } = useSvelteFlow();\n return {\n addParameter: (nodeId: string, dataKey: string = 'parameters', parameter?: Parameter) => {\n fillParameterId(parameter?.children);\n const newParameter = {\n name: '',\n dataType: 'String',\n refType: 'ref',\n ...parameter,\n id: genShortId()\n };\n updateNodeData(nodeId, (node) => {\n let parameters = node.data[dataKey] as Array<any>;\n if (parameters) {\n parameters.push(newParameter);\n } else {\n parameters = [newParameter];\n }\n return {\n [dataKey]: [...parameters]\n };\n });\n }\n };\n};\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { Heading } from '../base';\n import { Button } from '../base/index.js';\n import { type NodeProps } from '@xyflow/svelte';\n import DefinedParameterList from '../core/DefinedParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n\n</script>\n\n\n<NodeWrapper {...rest} {data} allowExecute={false} showTargetHandle={false} allowSettingOfCondition={false}>\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12C15 13.6569 13.6569 15 12 15Z\"></path>\n </svg>\n {/snippet}\n <div class=\"heading\">\n <Heading level={3}>输入参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId, \"parameters\", {refType: \"input\"});\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <DefinedParameterList />\n</NodeWrapper>\n\n<style lang=\"less\">\n\n .heading {\n display: flex;\n margin-bottom: 10px;\n }\n\n :global(.input-btn-more) {\n border: 1px solid transparent;\n padding: 3px;\n\n &:hover {\n background: #eee;\n border: 1px solid transparent;\n }\n }\n</style>\n\n\n","import { type Edge, type Node, useNodesData, useStore } from '@xyflow/svelte';\nimport type { Parameter } from '../../types';\nimport { getCurrentNodeId } from '../../store/nodeContext';\nimport { derived } from 'svelte/store';\n\nconst fillRefNodeIds = (refNodeIds: string[], currentNodeId: string, edges: Edge[]) => {\n for (const edge of edges) {\n if (edge.target === currentNodeId && edge.source) {\n refNodeIds.push(edge.source);\n fillRefNodeIds(refNodeIds, edge.source, edges);\n }\n }\n};\n\nconst getChildren = (params: any, parentId: string, nodeIsChildren: boolean) => {\n if (!params || params.length === 0) return [];\n return params.map((param: any) => ({\n label:\n param.name +\n (nodeIsChildren\n ? ` (Array<${param.dataType || 'String'}>)`\n : ` (${param.dataType || 'String'})`),\n value: parentId + '.' + param.name,\n children: getChildren(param.children, parentId + '.' + param.name, nodeIsChildren)\n }));\n};\n\nconst nodeToOptions = (node: Node, nodeIsChildren: boolean, currentNode: Node) => {\n if (node.type === 'startNode') {\n const parameters = node.data.parameters as Array<Parameter>;\n const children = [];\n if (parameters)\n for (const parameter of parameters) {\n children.push({\n label:\n parameter.name +\n (nodeIsChildren\n ? ` (Array<${parameter.dataType || 'String'}>)`\n : ` (${parameter.dataType || 'String'})`),\n value: node.id + '.' + parameter.name\n });\n }\n return {\n label: node.data.title,\n value: node.id,\n children\n };\n } else if (node.type === 'loopNode' && currentNode.parentId) {\n return {\n label: node.data.title,\n value: node.id,\n children: [\n {\n label: 'loopItem',\n value: node.id + '.loopItem'\n },\n {\n label: 'index (Number)',\n value: node.id + '.index'\n }\n ]\n };\n } else {\n const outputDefs = node.data.outputDefs;\n if (outputDefs) {\n return {\n label: node.data.title,\n value: node.id,\n children: getChildren(outputDefs, node.id, nodeIsChildren)\n };\n }\n }\n};\n\nexport const useRefOptions: any = (useChildrenOnly: boolean = false) => {\n const currentNodeId = getCurrentNodeId();\n const currentNode = useNodesData(currentNodeId);\n const { nodes, edges, nodeLookup } = useStore();\n return derived(\n [currentNode, nodes, edges, nodeLookup],\n ([currentNode, nodes, edges, nodeLookup]) => {\n if (!currentNode) {\n return [];\n }\n //通过 nodeLookup.get 才会得到有 parentId 的 node\n const cNode = nodeLookup.get(currentNodeId)!;\n const resultOptions = [];\n if (useChildrenOnly) {\n for (const node of nodes) {\n const nodeIsChildren = node.parentId === currentNode!.id;\n if (nodeIsChildren) {\n const nodeOptions = nodeToOptions(node, nodeIsChildren, cNode);\n nodeOptions && resultOptions.push(nodeOptions);\n }\n }\n } else {\n const refNodeIds: string[] = [];\n fillRefNodeIds(refNodeIds, currentNodeId, edges);\n\n for (const node of nodes) {\n if (refNodeIds.includes(node.id)) {\n const nodeIsChildren = node.parentId === currentNode!.id;\n const nodeOptions = nodeToOptions(node, nodeIsChildren, cNode);\n nodeOptions && resultOptions.push(nodeOptions);\n }\n }\n }\n return resultOptions;\n }\n );\n};\n","<script lang=\"ts\">\n import { Input, MenuButton, Textarea } from '../base';\n import { Button, FloatingTrigger, Select } from '../base/index.js';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useNodesData, useSvelteFlow } from '@xyflow/svelte';\n import { parameterRefTypes } from '../utils/Consts';\n import { useRefOptions } from '../utils/useRefOptions';\n // 添加生命周期函数\n import { onMount } from 'svelte';\n import type { Parameter } from '../../types';\n // 在组件挂载时检查并设置默认值\n onMount(() => {\n if (!param.refType) {\n updateRefType({ value: 'ref' }); // 设置数据来源默认值\n }\n });\n\n const { parameter, index, dataKeyName, useChildrenOnly }: {\n parameter: Parameter,\n index: number,\n dataKeyName: string,\n useChildrenOnly?: boolean,\n } = $props();\n\n\n let currentNodeId = getCurrentNodeId();\n let node = $derived(useNodesData(currentNodeId));\n let param = $derived.by(() => {\n return {\n ...parameter,\n ...($node?.data[dataKeyName] as Array<Parameter>)[index]\n };\n });\n\n const { updateNodeData } = useSvelteFlow();\n\n const updateParam = (key: string, value: any) => {\n updateNodeData(currentNodeId, (node) => {\n let parameters = node.data[dataKeyName] as Array<Parameter>;\n parameters[index] = {\n ...parameters[index],\n [key]: value\n };\n return {\n [dataKeyName]: parameters\n };\n });\n };\n\n\n const updateParamByEvent = (name: string, event: Event) => {\n const newValue = (event.target as any).value;\n updateParam(name, newValue);\n };\n\n\n const updateRef = (item: any) => {\n const newValue = item.value;\n updateParam('ref', newValue);\n };\n\n\n const updateRefType = (item: any) => {\n const newValue = item.value;\n updateParam('refType', newValue);\n };\n\n\n let triggerObject: any;\n const handleDelete = () => {\n updateNodeData(currentNodeId, (node) => {\n let parameters = node.data[dataKeyName] as Array<Parameter>;\n parameters.splice(index, 1);\n return {\n [dataKeyName]: [...parameters]\n };\n });\n triggerObject?.hide();\n };\n const selectItems = useRefOptions(useChildrenOnly);\n</script>\n\n\n<div class=\"input-item\">\n <Input style=\"width: 100%;\" value={param.name} placeholder=\"请输入参数名称\"\n disabled={param.nameDisabled === true}\n oninput={(event)=>updateParamByEvent('name', event)} />\n</div>\n<div class=\"input-item\">\n {#if param.refType === 'fixed'}\n <Input value={param.value} placeholder=\"请输入参数值\" oninput={(event)=>updateParamByEvent('value', event)} />\n {:else if (param.refType !== 'input')}\n <Select items={$selectItems} style=\"width: 100%\" defaultValue={[\"ref\"]} value={[param.ref]}\n expandAll\n onSelect={updateRef} />\n {/if}\n</div>\n<div class=\"input-item\">\n <FloatingTrigger placement=\"bottom\" bind:this={triggerObject}>\n <MenuButton />\n {#snippet floating()}\n <div class=\"input-more-setting\">\n <div class=\"input-more-item\">\n 数据来源:\n <Select items={parameterRefTypes} style=\"width: 100%\" defaultValue={[\"ref\"]}\n value={param.refType ? [param.refType] : []}\n onSelect={updateRefType}\n />\n </div>\n <div class=\"input-more-item\">\n 默认值:\n <Textarea rows={1} style=\"width: 100%;\" onchange={(event)=>{\n updateParamByEvent('defaultValue', event)\n }} value={param.defaultValue} />\n </div>\n <div class=\"input-more-item\">\n 参数描述:\n <Textarea rows={3} style=\"width: 100%;\" onchange={(event)=>{\n updateParamByEvent('description', event)\n }} value={param.description} />\n </div>\n\n <div class=\"input-more-item\">\n <Button onclick={handleDelete}>删除</Button>\n </div>\n </div>\n {/snippet}\n </FloatingTrigger>\n</div>\n\n\n<style lang=\"less\">\n\n .input-item {\n display: flex;\n align-items: center;\n }\n\n .input-more-setting {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px;\n background: #fff;\n border: 1px solid #ddd;\n border-radius: 5px;\n width: 200px;\n box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);\n\n .input-more-item {\n display: flex;\n flex-direction: column;\n gap: 3px;\n font-size: 12px;\n color: #666;\n }\n }\n\n</style>\n\n\n","<script lang=\"ts\">\n import { useNodesData } from '@xyflow/svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import RefParameterItem from './RefParameterItem.svelte';\n\n const {\n noneParameterText = '无输入参数',\n dataKeyName = 'parameters',\n useChildrenOnly,\n }: {\n noneParameterText?: string;\n dataKeyName?: string;\n useChildrenOnly?: boolean,\n } = $props();\n\n let currentNodeId = getCurrentNodeId();\n let node = $derived(useNodesData(currentNodeId));\n\n let parameters = $derived.by(() => {\n return [...$node?.data[dataKeyName] as Array<any> || []];\n });\n</script>\n\n\n<div class=\"input-container\">\n {#if (parameters.length !== 0)}\n <div class=\"input-header\">参数名称</div>\n <div class=\"input-header\">参数值</div>\n <div class=\"input-header\"></div>\n {/if}\n {#each parameters as param, index (param.id)}\n <RefParameterItem parameter={param} index={index} {dataKeyName} {useChildrenOnly}/>\n {:else }\n <div class=\"none-params\">{noneParameterText}</div>\n {/each}\n</div>\n\n\n<style lang=\"less\">\n .input-container {\n display: grid;\n grid-template-columns: 40% 50% 10%;\n row-gap: 5px;\n column-gap: 3px;\n\n .none-params {\n font-size: 12px;\n background: #f8f8f8;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 5px;\n width: calc(100% - 5px);\n grid-column: 1 / -1; /* 从第一列开始到最后一列结束 */\n }\n\n .input-header {\n font-size: 12px;\n color: #666;\n }\n }\n\n</style>\n\n\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { type NodeProps } from '@xyflow/svelte';\n import { Button, Heading } from '../base';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { useAddParameter } from '../utils/useAddParameter';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n\n</script>\n\n\n<NodeWrapper {data} {...rest} allowExecute={false} showSourceHandle={false}>\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M6 5.1438V16.0002H18.3391L6 5.1438ZM4 2.932C4 2.07155 5.01456 1.61285 5.66056 2.18123L21.6501 16.2494C22.3423 16.8584 21.9116 18.0002 20.9896 18.0002H6V22H4V2.932Z\"></path>\n </svg>\n {/snippet}\n <div class=\"heading\">\n <Heading level={3}>输出参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId,'outputDefs')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList noneParameterText=\"无输出参数\" dataKeyName=\"outputDefs\" />\n</NodeWrapper>\n\n\n<style lang=\"less\">\n\n .heading {\n display: flex;\n margin-bottom: 10px;\n }\n\n</style>\n\n\n","export const deepClone = <T>(obj: T): T => {\n return JSON.parse(JSON.stringify(obj));\n};\n","<script lang=\"ts\">\n import { Input, MenuButton, Textarea } from '../base';\n import { Button, FloatingTrigger, Select } from '../base/index.js';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useNodesData, useSvelteFlow } from '@xyflow/svelte';\n import { parameterDataTypes } from '../utils/Consts';\n import { genShortId } from '../utils/IdGen';\n import type { Parameter } from '../../types';\n import { deepClone } from '../utils/deepClone';\n\n const { parameter, position, dataKeyName }: {\n parameter: Parameter,\n position: number[],\n dataKeyName: string,\n } = $props();\n\n\n let currentNodeId = getCurrentNodeId();\n let node = $derived(useNodesData(currentNodeId));\n let currentParameter = $derived.by(() => {\n let parameters = $node?.data[dataKeyName] as Parameter[];\n let param;\n if (parameters && position.length > 0) {\n let params = parameters as Array<Parameter>;\n for (let i = 0; i < position.length; i++) {\n const pos = position[i];\n if (i == position.length - 1) {\n param = params[pos];\n } else {\n params = params[pos].children!;\n }\n }\n }\n\n return {\n ...parameter,\n ...param\n };\n });\n\n const { updateNodeData } = useSvelteFlow();\n\n const updateAttribute = (key: string, value: any) => {\n updateNodeData(currentNodeId, (node) => {\n const parameters = node.data[dataKeyName] as Array<Parameter>;\n if (parameters && position.length > 0) {\n let params = parameters as Parameter[];\n for (let i = 0; i < position.length; i++) {\n const pos = position[i];\n if (i == position.length - 1) {\n params[pos] = {\n ...params[pos],\n [key]: value\n };\n } else {\n params = params[pos].children!;\n }\n }\n }\n return {\n [dataKeyName]: [...deepClone(parameters)]\n };\n });\n };\n\n\n const updateByEvent = (name: string, event: Event) => {\n const newValue = (event.target as any).value;\n updateAttribute(name, newValue);\n };\n\n\n const updateDataType = (item: any) => {\n const newValue = item.value;\n updateAttribute('dataType', newValue);\n };\n\n\n let triggerObject: any;\n const handleDelete = () => {\n updateNodeData(currentNodeId, (node) => {\n let parameters = node.data[dataKeyName] as Array<Parameter>;\n if (parameters && position.length > 0) {\n let params = parameters as Array<Parameter>;\n for (let i = 0; i < position.length; i++) {\n const pos = position[i];\n if (i == position.length - 1) {\n params.splice(pos, 1);\n } else {\n params = params[pos].children!;\n }\n }\n }\n return {\n [dataKeyName]: [...deepClone(parameters)]\n };\n });\n triggerObject?.hide();\n };\n\n\n const handleAddChildParameter = () => {\n updateNodeData(currentNodeId, (node) => {\n let parameters = node.data[dataKeyName] as Array<Parameter>;\n if (parameters && position.length > 0) {\n let params = parameters as Array<Parameter>;\n for (let i = 0; i < position.length; i++) {\n const pos = position[i];\n if (i == position.length - 1) {\n if (params[pos].children) {\n params[pos].children.push({\n id: genShortId(),\n name: 'newParam',\n dataType: 'String'\n });\n } else {\n params[pos].children = [\n {\n id: genShortId(),\n name: 'newParam',\n dataType: 'String'\n }\n ];\n }\n } else {\n params = params[pos].children!;\n }\n }\n }\n\n return {\n [dataKeyName]: [...deepClone(parameters)]\n };\n });\n };\n</script>\n\n\n<div class=\"input-item\">\n {#if (position.length > 1)}\n {#each position as p} &nbsp;{/each}\n {/if}\n <Input style=\"width: 100%;\" value={currentParameter.name} placeholder=\"请输入参数名称\"\n oninput={(e)=>{updateByEvent('name',e)}} disabled={currentParameter.nameDisabled === true} />\n</div>\n<div class=\"input-item\">\n <Select items={parameterDataTypes} style=\"width: 100%\" defaultValue={[\"String\"]}\n value={currentParameter.dataType ? [currentParameter.dataType]:[]}\n disabled={currentParameter.dataTypeDisabled === true}\n onSelect={updateDataType} />\n {#if (currentParameter.dataType === \"Object\" || currentParameter.dataType === \"Array\") && currentParameter.addChildDisabled !== true}\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={handleAddChildParameter}>\n <svg style=\"transform: scaleY(-1)\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"\n fill=\"currentColor\">\n <path\n d=\"M13 8V16C13 17.6569 11.6569 19 10 19H7.82929C7.41746 20.1652 6.30622 21 5 21C3.34315 21 2 19.6569 2 18C2 16.3431 3.34315 15 5 15C6.30622 15 7.41746 15.8348 7.82929 17H10C10.5523 17 11 16.5523 11 16V8C11 6.34315 12.3431 5 14 5H17V2L22 6L17 10V7H14C13.4477 7 13 7.44772 13 8ZM5 19C5.55228 19 6 18.5523 6 18C6 17.4477 5.55228 17 5 17C4.44772 17 4 17.4477 4 18C4 18.5523 4.44772 19 5 19Z\"></path>\n </svg>\n </Button>\n {/if}\n</div>\n<div class=\"input-item\">\n <FloatingTrigger placement=\"bottom\" bind:this={triggerObject}>\n <MenuButton />\n {#snippet floating()}\n <div class=\"input-more-setting\">\n <div class=\"input-more-item\">\n 默认值:\n <Textarea rows={1} style=\"width: 100%;\"\n value={currentParameter.defaultValue||''}\n onchange={(event)=>{\n updateByEvent( 'defaultValue', event)\n }} />\n </div>\n <div class=\"input-more-item\">\n 参数描述:\n <Textarea rows={3} style=\"width: 100%;\"\n value={currentParameter.description||''}\n onchange={(event)=>{\n updateByEvent( 'description', event)\n }} />\n </div>\n\n {#if currentParameter.deleteDisabled !== true}\n <div class=\"input-more-item\">\n <Button onclick={handleDelete}>删除</Button>\n </div>\n {/if}\n </div>\n {/snippet}\n </FloatingTrigger>\n</div>\n\n\n<style lang=\"less\">\n\n .input-item {\n display: flex;\n align-items: center;\n gap: 2px;\n }\n\n .input-more-setting {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px;\n background: #fff;\n border: 1px solid #ddd;\n border-radius: 5px;\n width: 200px;\n box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);\n\n .input-more-item {\n display: flex;\n flex-direction: column;\n gap: 3px;\n font-size: 12px;\n color: #666;\n }\n }\n\n</style>\n\n\n","<script lang=\"ts\">\n import { useNodesData } from '@xyflow/svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import type { Parameter } from '../../types';\n import OutputDefItem from './OutputDefItem.svelte';\n\n const {\n noneParameterText = '无输出参数',\n dataKeyName = 'outputDefs'\n }: {\n noneParameterText?: string;\n dataKeyName?: string;\n } = $props();\n\n let currentNodeId = getCurrentNodeId();\n let node = $derived(useNodesData(currentNodeId));\n\n let parameters = $derived.by(() => {\n return [...$node?.data[dataKeyName] as Array<Parameter> || []];\n });\n</script>\n\n{#snippet parameterList(params: Parameter[], position: number[])}\n {#each params as param, index (`${param.id}_${param.children ? param.children.length : 0}`)}\n <OutputDefItem parameter={param} position={[...position, index]} {dataKeyName} />\n {#if param.children}\n {@render parameterList(param.children, [...position, index])}\n {/if}\n {:else }\n {#if position.length === 0}\n <div class=\"none-params\">{noneParameterText}</div>\n {/if}\n {/each}\n{/snippet}\n\n\n<div class=\"input-container\">\n {#if (parameters.length !== 0)}\n <div class=\"input-header\">参数名称</div>\n <div class=\"input-header\">参数类型</div>\n <div class=\"input-header\"></div>\n {/if}\n {@render parameterList(parameters || [], [])}\n</div>\n\n\n<style lang=\"less\">\n .input-container {\n display: grid;\n grid-template-columns: 40% 50% 10%;\n row-gap: 5px;\n column-gap: 3px;\n\n .none-params {\n font-size: 12px;\n background: #f8f8f8;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 5px;\n width: calc(100% - 5px);\n grid-column: 1 / -1; /* 从第一列开始到最后一列结束 */\n }\n\n .input-header {\n font-size: 12px;\n color: #666;\n }\n }\n\n</style>\n\n\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { type NodeProps, useSvelteFlow } from '@xyflow/svelte';\n import { Button, Heading, Select } from '../base';\n import { MenuButton, Textarea } from '../base/index.js';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n import { getOptions } from '../utils/NodeUtils';\n import { onMount } from 'svelte';\n import OutputDefList from '../core/OutputDefList.svelte';\n import type { SelectItem } from '../../types';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n\n const options = getOptions();\n\n let llmArray = $state<SelectItem[]>([]);\n onMount(async () => {\n const newLLMs = await options.provider?.llm?.();\n llmArray.push(...(newLLMs || []));\n });\n\n const { updateNodeData } = useSvelteFlow();\n const setOutType = (value: string) => {\n updateNodeData(currentNodeId, () => {\n return {\n outType: value\n };\n });\n\n if (value === 'text') {\n updateNodeData(currentNodeId, {\n outputDefs: [{\n name: 'output',\n dataType: 'String',\n dataTypeDisabled: true,\n deleteDisabled: true\n }]\n });\n } else {\n updateNodeData(currentNodeId, {\n outputDefs: []\n });\n }\n };\n\n $effect(() => {\n if (!data.outType) {\n setOutType('text');\n }\n });\n\n\n</script>\n\n\n<NodeWrapper {data} {...rest}>\n\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M20.7134 7.12811L20.4668 7.69379C20.2864 8.10792 19.7136 8.10792 19.5331 7.69379L19.2866 7.12811C18.8471 6.11947 18.0555 5.31641 17.0677 4.87708L16.308 4.53922C15.8973 4.35653 15.8973 3.75881 16.308 3.57612L17.0252 3.25714C18.0384 2.80651 18.8442 1.97373 19.2761 0.930828L19.5293 0.319534C19.7058 -0.106511 20.2942 -0.106511 20.4706 0.319534L20.7238 0.930828C21.1558 1.97373 21.9616 2.80651 22.9748 3.25714L23.6919 3.57612C24.1027 3.75881 24.1027 4.35653 23.6919 4.53922L22.9323 4.87708C21.9445 5.31641 21.1529 6.11947 20.7134 7.12811ZM9 2C13.0675 2 16.426 5.03562 16.9337 8.96494L19.1842 12.5037C19.3324 12.7367 19.3025 13.0847 18.9593 13.2317L17 14.071V17C17 18.1046 16.1046 19 15 19H13.001L13 22H4L4.00025 18.3061C4.00033 17.1252 3.56351 16.0087 2.7555 15.0011C1.65707 13.6313 1 11.8924 1 10C1 5.58172 4.58172 2 9 2ZM9 4C5.68629 4 3 6.68629 3 10C3 11.3849 3.46818 12.6929 4.31578 13.7499C5.40965 15.114 6.00036 16.6672 6.00025 18.3063L6.00013 20H11.0007L11.0017 17H15V12.7519L16.5497 12.0881L15.0072 9.66262L14.9501 9.22118C14.5665 6.25141 12.0243 4 9 4ZM19.4893 16.9929L21.1535 18.1024C22.32 16.3562 23 14.2576 23 12.0001C23 11.317 22.9378 10.6486 22.8186 10L20.8756 10.5C20.9574 10.9878 21 11.489 21 12.0001C21 13.8471 20.4436 15.5642 19.4893 16.9929Z\"></path>\n </svg>\n {/snippet}\n\n <div class=\"heading\">\n <Heading level={3}>输入参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId)\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList />\n\n <Heading level={3} mt=\"10px\">模型设置</Heading>\n <div class=\"setting-title\">模型</div>\n <div class=\"setting-item\">\n <Select items={llmArray} style=\"width: 100%\" placeholder=\"请选择模型\" onSelect={(item)=>{\n const newValue = item.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n llmId: newValue\n }\n })\n }} value={data.llmId ? [data.llmId] : []} />\n <MenuButton />\n </div>\n\n <!-- 在原有采样参数部分添加事件阻止 -->\n <div class=\"setting-title\">采样参数</div>\n\n <div class=\"setting-item\">\n <div class=\"slider-container\">\n <span>Temperature: {data.temperature ?? 0.5}</span>\n <input\n class=\"nodrag\"\n type=\"range\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value={data.temperature ?? 0.5}\n oninput={(e) => updateNodeData(currentNodeId, { temperature: parseFloat(e.target.value) })}\n />\n </div>\n </div>\n\n <div class=\"setting-item\">\n <div class=\"slider-container\">\n <span>Top P: {data.topP ?? 0.9}</span>\n <input\n class=\"nodrag\"\n type=\"range\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value={data.topP ?? 0.9}\n oninput={(e) => updateNodeData(currentNodeId, { topP: parseFloat(e.target.value) })}\n />\n </div>\n </div>\n\n <div class=\"setting-item\">\n <div class=\"slider-container\">\n <span>Top K: {data.topK ?? 50}</span>\n <input\n class=\"nodrag\"\n type=\"range\"\n min=\"0\"\n max=\"100\"\n step=\"1\"\n value={data.topK ?? 50}\n oninput={(e) => updateNodeData(currentNodeId, { topK: parseInt(e.target.value) })}\n />\n </div>\n </div>\n\n <div class=\"setting-title\">系统提示词</div>\n <div class=\"setting-item\">\n <Textarea\n rows={5}\n placeholder=\"请输入系统提示词\"\n style=\"width: 100%\"\n value={data.systemPrompt || ''}\n oninput={(e)=>{\n updateNodeData(currentNodeId, {\n systemPrompt: e.target.value\n });\n }}\n\n />\n </div>\n\n <div class=\"setting-title\">用户提示词</div>\n <div class=\"setting-item\">\n <Textarea\n rows={5}\n placeholder=\"请输入用户提示词\"\n style=\"width: 100%\"\n value={data.userPrompt || ''}\n oninput={(e)=>{\n updateNodeData(currentNodeId, {\n userPrompt: e.target.value\n });\n }}\n />\n </div>\n\n <div class=\"heading\">\n <Heading level={3} mt=\"10px\">输出参数</Heading>\n <Select items={[{\n label: '文本',\n value: 'text'\n }, {\n label: 'JSON',\n value: 'json'\n }]} style=\"width: 100px;margin-left: auto\" defaultValue=\"text\" onSelect={(item)=>{\n setOutType(item.value);\n }} value={data.outType ? [data.outType] : []} />\n\n {#if data.outType === 'json'}\n <Button class=\"input-btn-more\" style=\"margin-left: 10px\" onclick={()=>{\n addParameter(currentNodeId,'outputDefs')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n {/if}\n </div>\n <OutputDefList />\n\n</NodeWrapper>\n\n<style>\n .heading {\n display: flex;\n align-items: center;\n margin-bottom: 10px;\n }\n\n .setting-title {\n font-size: 12px;\n color: #999;\n margin-bottom: 4px;\n margin-top: 10px;\n }\n\n .setting-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 10px;\n gap: 10px;\n }\n\n /* 新增样式 */\n .slider-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .slider-container span {\n font-size: 12px;\n color: #666;\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n input[type=\"range\"] {\n width: 100%;\n height: 4px;\n background: #ddd;\n border-radius: 2px;\n outline: none;\n -webkit-appearance: none;\n }\n\n input[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 14px;\n height: 14px;\n background: #007bff;\n border-radius: 50%;\n cursor: pointer;\n }\n</style>\n\n\n\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { type NodeProps, useSvelteFlow } from '@xyflow/svelte';\n import { Button, Heading, Select } from '../base';\n import { Textarea } from '../base/index.js';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n import OutputDefList from '../core/OutputDefList.svelte';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n // 添加生命周期函数\n import { onMount } from 'svelte';\n // 在组件挂载时检查并设置默认值\n onMount(() => {\n if (!data.engine) {\n updateNodeData(currentNodeId, ()=>{\n return {\n engine: 'qlexpress'\n }\n })\n }\n });\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n\n\n const { updateNodeData } = useSvelteFlow();\n\n const engines = [\n { label: 'QLExpress', value: 'qlexpress' },\n { label: 'Groovy', value: 'groovy' },\n { label: 'JavaScript', value: 'js' }\n ];\n\n\n</script>\n\n\n<NodeWrapper {data} {...rest}>\n\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z\"></path>\n </svg>\n {/snippet}\n\n <div class=\"heading\">\n <Heading level={3}>输入参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId)\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList />\n\n <Heading level={3} mt=\"10px\">代码</Heading>\n <div class=\"setting-title\">执行引擎</div>\n <div class=\"setting-item\">\n <Select items={engines} style=\"width: 100%\" placeholder=\"请选择执行引擎\" onSelect={(item)=>{\n const newValue = item.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n engine: newValue\n }\n })\n }} value={data.engine ? [data.engine] : ['qlexpress']} />\n </div>\n\n <div class=\"setting-title\">执行代码</div>\n <div class=\"setting-item\">\n <Textarea rows={10} placeholder=\"请输入执行代码,注:输出内容需添加到_result中,如:_result.put(key, value)\" style=\"width: 100%\" onchange={(e:any)=>{\n updateNodeData(currentNodeId, ()=>{\n return {\n code: e.target.value\n }\n })\n }} value={data.code as string||\"\"} />\n </div>\n\n\n <div class=\"heading\">\n <Heading level={3} mt=\"10px\">输出参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId,'outputDefs')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <OutputDefList />\n\n</NodeWrapper>\n\n<style>\n .heading {\n display: flex;\n margin-bottom: 10px;\n }\n\n .setting-title {\n font-size: 12px;\n color: #999;\n margin-bottom: 4px;\n margin-top: 10px;\n }\n\n .setting-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 10px;\n gap: 10px;\n }\n\n</style>\n\n\n\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { type NodeProps, useSvelteFlow } from '@xyflow/svelte';\n import { Button, Heading } from '../base';\n import { Textarea } from '../base/index.js';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n import OutputDefList from '../core/OutputDefList.svelte';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n\n\n const { updateNodeData } = useSvelteFlow();\n\n $effect(() => {\n if (!data.outputDefs || data.outputDefs.length === 0) {\n addParameter(currentNodeId, 'outputDefs', {\n name: 'output',\n dataType: 'String',\n dataTypeDisabled: true,\n deleteDisabled: true\n });\n }\n });\n</script>\n\n\n<NodeWrapper {data} {...rest}>\n\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M2 4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4ZM4 5V19H20V5H4ZM7 8H17V11H15V10H13V14H14.5V16H9.5V14H11V10H9V11H7V8Z\"></path>\n </svg>\n {/snippet}\n\n <div class=\"heading\">\n <Heading level={3}>输入参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId)\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList />\n\n <Heading level={3} mt=\"10px\" mb=\"10px\">模板内容</Heading>\n\n <div class=\"setting-item\">\n <Textarea rows={10} placeholder=\"请输入模板内容\" style=\"width: 100%\" onchange={(e:any)=>{\n updateNodeData(currentNodeId, ()=>{\n return {\n template: e.target.value\n }\n })\n }} value={data.template ||\"\"} />\n </div>\n\n\n <div class=\"heading\">\n <Heading level={3} mt=\"10px\">输出参数</Heading>\n </div>\n <OutputDefList />\n\n</NodeWrapper>\n\n<style>\n .heading {\n display: flex;\n margin-bottom: 10px;\n }\n\n .setting-title {\n font-size: 12px;\n color: #999;\n margin-bottom: 4px;\n margin-top: 10px;\n }\n\n .setting-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 10px;\n gap: 10px;\n }\n\n</style>\n\n\n\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { type NodeProps, useSvelteFlow } from '@xyflow/svelte';\n import { Button, Heading, Select } from '../base';\n import { Input, Textarea } from '../base/index.js';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n import OutputDefList from '../core/OutputDefList.svelte';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n // 添加生命周期函数\n import { onMount } from 'svelte';\n // 在组件挂载时检查并设置默认值\n onMount(() => {\n if (!data.method) {\n updateNodeData(currentNodeId, () => {\n return {\n method: 'get'\n };\n });\n }\n });\n const method = [\n { value: 'get', label: 'GET' },\n { value: 'post', label: 'POST' },\n { value: 'put', label: 'PUT' },\n { value: 'delete', label: 'DELETE' },\n { value: 'head', label: 'HEAD' },\n { value: 'patch', label: 'PATCH' }\n ];\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n const { updateNodeData } = useSvelteFlow();\n</script>\n\n\n<NodeWrapper {data} {...rest}>\n\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M6.23509 6.45329C4.85101 7.89148 4 9.84636 4 12C4 16.4183 7.58172 20 12 20C13.0808 20 14.1116 19.7857 15.0521 19.3972C15.1671 18.6467 14.9148 17.9266 14.8116 17.6746C14.582 17.115 13.8241 16.1582 12.5589 14.8308C12.2212 14.4758 12.2429 14.2035 12.3636 13.3943L12.3775 13.3029C12.4595 12.7486 12.5971 12.4209 14.4622 12.1248C15.4097 11.9746 15.6589 12.3533 16.0043 12.8777C16.0425 12.9358 16.0807 12.9928 16.1198 13.0499C16.4479 13.5297 16.691 13.6394 17.0582 13.8064C17.2227 13.881 17.428 13.9751 17.7031 14.1314C18.3551 14.504 18.3551 14.9247 18.3551 15.8472V15.9518C18.3551 16.3434 18.3168 16.6872 18.2566 16.9859C19.3478 15.6185 20 13.8854 20 12C20 8.70089 18.003 5.8682 15.1519 4.64482C14.5987 5.01813 13.8398 5.54726 13.575 5.91C13.4396 6.09538 13.2482 7.04166 12.6257 7.11976C12.4626 7.14023 12.2438 7.12589 12.012 7.11097C11.3905 7.07058 10.5402 7.01606 10.268 7.75495C10.0952 8.2232 10.0648 9.49445 10.6239 10.1543C10.7134 10.2597 10.7307 10.4547 10.6699 10.6735C10.59 10.9608 10.4286 11.1356 10.3783 11.1717C10.2819 11.1163 10.0896 10.8931 9.95938 10.7412C9.64554 10.3765 9.25405 9.92233 8.74797 9.78176C8.56395 9.73083 8.36166 9.68867 8.16548 9.64736C7.6164 9.53227 6.99443 9.40134 6.84992 9.09302C6.74442 8.8672 6.74488 8.55621 6.74529 8.22764C6.74529 7.8112 6.74529 7.34029 6.54129 6.88256C6.46246 6.70541 6.35689 6.56446 6.23509 6.45329ZM12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22Z\"></path>\n </svg>\n {/snippet}\n\n\n <div class=\"heading\">\n <Heading level={3}>输入参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId)\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList />\n\n <Heading level={3} mt=\"10px\">URL 地址</Heading>\n <div style=\"display: flex;gap: 2px;width: 100%;padding: 10px 0\">\n <div>\n <Select items={method} style=\"width: 100%\" placeholder=\"请选择请求方式\" onSelect={(item)=>{\n const newValue = item.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n method: newValue\n }\n })\n }} value={data.method ? [data.method] : ['get']} />\n </div>\n <div style=\"width: 100%\">\n <Input placeholder=\"请输入url\" style=\"width: 100%\" onchange={(e:any)=>{\n updateNodeData(currentNodeId, ()=>{\n return {\n url: e.target.value\n }\n })\n }} value={data.url as string||\"\"} />\n </div>\n </div>\n\n <div class=\"heading\">\n <Heading level={3}>Http 头信息</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId,'headers')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList dataKeyName=\"headers\" />\n\n\n <Heading level={3} mt=\"10px\">Body</Heading>\n\n <div class=\"radio-group\">\n <label><Input type=\"radio\" name=\"bodyType\" value=\"\" checked={!data.bodyType} onchange={(e:any)=>{\n if (e.target?.checked){\n updateNodeData(currentNodeId,{\n bodyType: '',\n })\n }\n }} />none</label>\n <label><Input type=\"radio\" name=\"bodyType\" value=\"form-data\" checked={data.bodyType === 'form-data'} onchange={(e:any)=>{\n if (e.target?.checked){\n updateNodeData(currentNodeId,{\n bodyType: 'form-data',\n })\n }\n }} />form-data</label>\n <label><Input type=\"radio\" name=\"bodyType\" value=\"x-www-form-urlencoded\"\n checked={data.bodyType === 'x-www-form-urlencoded'} onchange={(e:any)=>{\n if (e.target?.checked){\n updateNodeData(currentNodeId,{\n bodyType: 'x-www-form-urlencoded',\n })\n }\n }} />x-www-form-urlencoded</label>\n <label><Input type=\"radio\" name=\"bodyType\" value=\"json\" checked={data.bodyType === 'json'} onchange={(e:any)=>{\n if (e.target?.checked){\n updateNodeData(currentNodeId,{\n bodyType: 'json',\n })\n }\n }} />json</label>\n <label><Input type=\"radio\" name=\"bodyType\" value=\"raw\" checked={data.bodyType === 'raw'} onchange={(e:any)=>{\n if (e.target?.checked){\n updateNodeData(currentNodeId,{\n bodyType: 'raw',\n })\n }\n }} />raw</label>\n </div>\n\n\n {#if data.bodyType === 'form-data'}\n <div class=\"heading\" style=\"padding-top: 10px\">\n <Heading level={3}>参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId,'formData')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList dataKeyName=\"formData\" />\n {/if}\n\n\n {#if data.bodyType === 'x-www-form-urlencoded'}\n <div class=\"heading\" style=\"padding-top: 10px\">\n <Heading level={3}>Body 参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId,'formUrlencoded')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList dataKeyName=\"formUrlencoded\" />\n {/if}\n\n {#if data.bodyType === 'json'}\n <div style=\"width: 100%\">\n <Textarea rows={5} style=\"width: 100%\" placeholder=\"请输入 json 信息\" value={data.bodyJson}\n oninput={(e:any)=>{\n updateNodeData(currentNodeId,{\n bodyJson: e.target.value,\n })\n }} />\n </div>\n {/if}\n\n\n {#if data.bodyType === 'raw'}\n <div style=\"width: 100%\">\n <Textarea rows={5} style=\"width: 100%\" placeholder=\"请输入请求信息\" value={data.bodyRaw}\n oninput={(e:any)=>{\n updateNodeData(currentNodeId,{\n bodyRaw: e.target.value,\n })\n }} />\n </div>\n {/if}\n\n\n <div class=\"heading\">\n <Heading level={3} mt=\"10px\">输出参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId,'outputDefs')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <OutputDefList />\n\n</NodeWrapper>\n\n<style lang=\"less\">\n .heading {\n display: flex;\n margin-bottom: 10px;\n }\n\n .radio-group {\n display: flex;\n margin: 10px 0;\n\n label {\n display: flex;\n font-size: 14px;\n }\n }\n\n</style>\n\n\n\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { type NodeProps, useSvelteFlow } from '@xyflow/svelte';\n import { Button, Heading, Input, Select } from '../base';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n import { getOptions } from '../utils/NodeUtils';\n import { onMount } from 'svelte';\n import OutputDefList from '../core/OutputDefList.svelte';\n import type { SelectItem } from '../../types';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n\n const options = getOptions();\n\n let knowledgeArray = $state<SelectItem[]>([]);\n onMount(async () => {\n const newLLMs = await options.provider?.knowledge?.();\n knowledgeArray.push(...(newLLMs || []));\n });\n\n const { updateNodeData } = useSvelteFlow();\n\n $effect(() => {\n if (!data.outputDefs || data.outputDefs.length === 0) {\n addParameter(currentNodeId, 'outputDefs',\n {\n name: 'documents',\n dataType: 'Array',\n nameDisabled: true,\n dataTypeDisabled: true,\n addChildDisabled: true,\n deleteDisabled: true,\n children: [\n {\n name: 'title',\n dataType: 'String',\n nameDisabled: true,\n dataTypeDisabled: true,\n deleteDisabled: true\n },\n {\n name: 'content',\n dataType: 'String',\n nameDisabled: true,\n dataTypeDisabled: true,\n deleteDisabled: true\n },\n {\n name: 'documentId',\n dataType: 'Number',\n nameDisabled: true,\n dataTypeDisabled: true,\n deleteDisabled: true\n },\n {\n name: 'knowledgeId',\n dataType: 'Number',\n nameDisabled: true,\n dataTypeDisabled: true,\n deleteDisabled: true\n }\n ]\n }\n );\n }\n });\n\n</script>\n\n\n<NodeWrapper {data} {...rest}>\n\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M15.5 5C13.567 5 12 6.567 12 8.5C12 10.433 13.567 12 15.5 12C17.433 12 19 10.433 19 8.5C19 6.567 17.433 5 15.5 5ZM10 8.5C10 5.46243 12.4624 3 15.5 3C18.5376 3 21 5.46243 21 8.5C21 9.6575 20.6424 10.7315 20.0317 11.6175L22.7071 14.2929L21.2929 15.7071L18.6175 13.0317C17.7315 13.6424 16.6575 14 15.5 14C12.4624 14 10 11.5376 10 8.5ZM3 4H8V6H3V4ZM3 11H8V13H3V11ZM21 18V20H3V18H21Z\"></path>\n </svg>\n {/snippet}\n\n <div class=\"heading\">\n <Heading level={3}>输入参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId)\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList />\n\n <Heading level={3} mt=\"10px\">知识库设置</Heading>\n <div class=\"setting-title\">知识库</div>\n <div class=\"setting-item\">\n <Select items={knowledgeArray} style=\"width: 100%\" placeholder=\"请选择知识库\" onSelect={(item)=>{\n const newValue = item.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n knowledgeId: newValue\n }\n })\n }} value={data.knowledgeId ? [data.knowledgeId] : []} />\n </div>\n\n <div class=\"setting-title\">关键字</div>\n <div class=\"setting-item\">\n <Input placeholder=\"请输入关键字\" style=\"width: 100%\"\n value={data.keyword}\n onchange={(e)=>{\n const newValue = e.target.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n keyword: newValue\n }\n })\n }}\n />\n </div>\n\n\n <div class=\"setting-title\">获取数据量</div>\n <div class=\"setting-item\">\n <Input placeholder=\"搜索的数据条数\" style=\"width: 100%\" onchange={(e)=>{\n const newValue = e.target.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n limit: newValue\n }\n })\n }} value={data.limit || ''} />\n </div>\n\n\n <div class=\"heading\">\n <Heading level={3} mt=\"10px\">输出参数</Heading>\n </div>\n <OutputDefList />\n\n</NodeWrapper>\n\n<style>\n .heading {\n display: flex;\n margin-bottom: 10px;\n }\n\n .setting-title {\n font-size: 12px;\n color: #999;\n margin-bottom: 4px;\n margin-top: 10px;\n }\n\n .setting-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 10px;\n gap: 10px;\n }\n\n</style>\n\n\n\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { type NodeProps, useSvelteFlow } from '@xyflow/svelte';\n import { Button, Heading, Input, Select } from '../base';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n import { getOptions } from '../utils/NodeUtils';\n import { onMount } from 'svelte';\n import OutputDefList from '../core/OutputDefList.svelte';\n import type { SelectItem } from '../../types';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n\n const options = getOptions();\n\n let searchEngines = $state<SelectItem[]>([]);\n onMount(async () => {\n const newLLMs = await options.provider?.searchEngine?.();\n searchEngines.push(...(newLLMs || []));\n });\n\n const { updateNodeData } = useSvelteFlow();\n\n $effect(() => {\n if (!data.outputDefs || data.outputDefs.length === 0) {\n addParameter(currentNodeId, 'outputDefs',\n {\n name: 'documents',\n dataType: 'Array',\n nameDisabled: true,\n dataTypeDisabled: true,\n addChildDisabled: true,\n deleteDisabled: true,\n children: [\n {\n name: 'title',\n dataType: 'String',\n nameDisabled: true,\n dataTypeDisabled: true,\n deleteDisabled: true\n },\n {\n name: 'content',\n dataType: 'String',\n nameDisabled: true,\n dataTypeDisabled: true,\n deleteDisabled: true\n }\n ]\n }\n );\n }\n });\n\n</script>\n\n\n<NodeWrapper {data} {...rest}>\n\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z\"></path>\n </svg>\n {/snippet}\n\n <div class=\"heading\">\n <Heading level={3}>输入参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId)\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList />\n\n <Heading level={3} mt=\"10px\">搜索引擎设置</Heading>\n <div class=\"setting-title\">搜索引擎</div>\n <div class=\"setting-item\">\n <Select items={searchEngines} style=\"width: 100%\" placeholder=\"请选择搜索引擎\" onSelect={(item)=>{\n const newValue = item.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n engine: newValue\n }\n })\n }} value={data.engine ? [data.engine] : []} />\n </div>\n\n\n <div class=\"setting-title\">关键字</div>\n <div class=\"setting-item\">\n <Input placeholder=\"请输入关键字\" style=\"width: 100%\"\n value={data.keyword}\n onchange={(e)=>{\n const newValue = e.target.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n keyword: newValue\n }\n })\n }}\n />\n </div>\n\n <div class=\"setting-title\">搜索数据量</div>\n <div class=\"setting-item\">\n <Input placeholder=\"搜索的数据条数\" style=\"width: 100%\" value={data.limit}\n onchange={(e)=>{\n const newValue = e.target.value;\n updateNodeData(currentNodeId, ()=>{\n return {\n limit: newValue\n }\n })\n }} />\n </div>\n\n\n <div class=\"heading\">\n <Heading level={3} mt=\"10px\">输出参数</Heading>\n </div>\n <OutputDefList />\n\n</NodeWrapper>\n\n<style>\n .heading {\n display: flex;\n margin-bottom: 10px;\n }\n\n .setting-title {\n font-size: 12px;\n color: #999;\n margin-bottom: 4px;\n margin-top: 10px;\n }\n\n .setting-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 10px;\n gap: 10px;\n }\n\n</style>\n\n\n\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { Handle, type NodeProps, Position } from '@xyflow/svelte';\n import { Button, Heading } from '../base';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n\n\n $effect(() => {\n if (!data.loopVars || data.loopVars.length === 0) {\n addParameter(currentNodeId, 'loopVars', {\n name: 'loopVar',\n nameDisabled: true,\n deleteDisabled: true\n });\n }\n });\n\n</script>\n\n\n<NodeWrapper {data} {...rest}>\n\n {#snippet icon()}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z\"></path>\n </svg>\n {/snippet}\n\n {#snippet handle()}\n <Handle type=\"source\" position={Position.Bottom} id=\"loop_handle\" style=\"bottom: -12px;width: 100px\"\n class=\"loop_handle_wrapper\" />\n {/snippet}\n\n <div class=\"heading\">\n <Heading level={3}>循环变量</Heading>\n<!-- <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{-->\n<!-- addParameter(currentNodeId)-->\n<!-- }}>-->\n<!-- <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">-->\n<!-- <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>-->\n<!-- </svg>-->\n<!-- </Button>-->\n </div>\n <RefParameterList dataKeyName=\"loopVars\" />\n\n <div class=\"heading\">\n <Heading level={3}>输出参数</Heading>\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId,'outputDefs')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n </div>\n <RefParameterList noneParameterText=\"无输出参数\" dataKeyName=\"outputDefs\" useChildrenOnly={true} />\n\n</NodeWrapper>\n\n<style lang=\"less\">\n .heading {\n display: flex;\n margin: 10px 0;\n align-items: center;\n }\n\n :global(.loop_handle_wrapper ) {\n &::after {\n //display: none;\n content: '循环体';\n width: 100px;\n height: 20px;\n background: #000;\n color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n }\n\n</style>\n\n\n\n","import type { NodeTypes } from '@xyflow/svelte';\nimport StartNode from './StartNode.svelte';\nimport EndNode from './EndNode.svelte';\nimport LLMNode from './LLMNode.svelte';\nimport CodeNode from './CodeNode.svelte';\nimport TemplateNode from './TemplateNode.svelte';\nimport HttpNode from './HttpNode.svelte';\nimport KnowledgeNode from './KnowledgeNode.svelte';\nimport SearchEngineNode from './SearchEngineNode.svelte';\nimport LoopNode from './LoopNode.svelte';\n\n/**\n * @description 节点类型(en: node type)\n */\nexport const nodeTypes = {\n startNode: StartNode,\n codeNode: CodeNode,\n llmNode: LLMNode,\n templateNode: TemplateNode,\n httpNode: HttpNode,\n knowledgeNode: KnowledgeNode,\n searchEngineNode: SearchEngineNode,\n loopNode: LoopNode,\n endNode: EndNode\n} as any as NodeTypes;\n","<script lang=\"ts\">\n import { Button } from '../base/';\n import { type Node } from '@xyflow/svelte';\n\n const { icon, title, type, description, extra }: {\n icon: string,\n title: string,\n type: string,\n description: string,\n extra?: Partial<Node['data']>,\n } = $props();\n\n const onDragStart = (event: DragEvent) => {\n if (!event.dataTransfer) {\n return null;\n }\n const node = {\n type,\n data: {\n title,\n description,\n ...extra\n }\n };\n event.dataTransfer.setData('application/tinyflow', JSON.stringify(node));\n event.dataTransfer.effectAllowed = 'move';\n };\n</script>\n\n<Button draggable ondragstart={onDragStart} data-node-type={type}>{@html icon} {title}</Button>\n","<script lang=\"ts\">\n import { Tabs, Button } from './base/index';\n import DraggableButton from './core/DraggableButton.svelte';\n import { getOptions } from './utils/NodeUtils';\n\n let showType = $state('base');\n let containerShowClass = $state('show');\n\n const baseNodes = [\n {\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12C15 13.6569 13.6569 15 12 15Z\"></path></svg>',\n title: '开始节点',\n type: 'startNode',\n sortNo: 100,\n description: '开始定义输入参数'\n },\n {\n\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z\"></path></svg>',\n title: '循环',\n type: 'loopNode',\n sortNo: 200,\n description: '用于循环执行任务'\n },\n {\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M20.7134 7.12811L20.4668 7.69379C20.2864 8.10792 19.7136 8.10792 19.5331 7.69379L19.2866 7.12811C18.8471 6.11947 18.0555 5.31641 17.0677 4.87708L16.308 4.53922C15.8973 4.35653 15.8973 3.75881 16.308 3.57612L17.0252 3.25714C18.0384 2.80651 18.8442 1.97373 19.2761 0.930828L19.5293 0.319534C19.7058 -0.106511 20.2942 -0.106511 20.4706 0.319534L20.7238 0.930828C21.1558 1.97373 21.9616 2.80651 22.9748 3.25714L23.6919 3.57612C24.1027 3.75881 24.1027 4.35653 23.6919 4.53922L22.9323 4.87708C21.9445 5.31641 21.1529 6.11947 20.7134 7.12811ZM9 2C13.0675 2 16.426 5.03562 16.9337 8.96494L19.1842 12.5037C19.3324 12.7367 19.3025 13.0847 18.9593 13.2317L17 14.071V17C17 18.1046 16.1046 19 15 19H13.001L13 22H4L4.00025 18.3061C4.00033 17.1252 3.56351 16.0087 2.7555 15.0011C1.65707 13.6313 1 11.8924 1 10C1 5.58172 4.58172 2 9 2ZM9 4C5.68629 4 3 6.68629 3 10C3 11.3849 3.46818 12.6929 4.31578 13.7499C5.40965 15.114 6.00036 16.6672 6.00025 18.3063L6.00013 20H11.0007L11.0017 17H15V12.7519L16.5497 12.0881L15.0072 9.66262L14.9501 9.22118C14.5665 6.25141 12.0243 4 9 4ZM19.4893 16.9929L21.1535 18.1024C22.32 16.3562 23 14.2576 23 12.0001C23 11.317 22.9378 10.6486 22.8186 10L20.8756 10.5C20.9574 10.9878 21 11.489 21 12.0001C21 13.8471 20.4436 15.5642 19.4893 16.9929Z\"></path></svg>',\n title: '大模型',\n type: 'llmNode',\n sortNo: 300,\n description: '使用大模型处理问题'\n },\n {\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M15.5 5C13.567 5 12 6.567 12 8.5C12 10.433 13.567 12 15.5 12C17.433 12 19 10.433 19 8.5C19 6.567 17.433 5 15.5 5ZM10 8.5C10 5.46243 12.4624 3 15.5 3C18.5376 3 21 5.46243 21 8.5C21 9.6575 20.6424 10.7315 20.0317 11.6175L22.7071 14.2929L21.2929 15.7071L18.6175 13.0317C17.7315 13.6424 16.6575 14 15.5 14C12.4624 14 10 11.5376 10 8.5ZM3 4H8V6H3V4ZM3 11H8V13H3V11ZM21 18V20H3V18H21Z\"></path></svg>',\n title: '知识库',\n type: 'knowledgeNode',\n sortNo: 400,\n description: '通过知识库获取内容'\n },\n {\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z\"></path></svg>',\n title: '搜索引擎',\n type: 'searchEngineNode',\n sortNo: 500,\n description: '通过搜索引擎搜索内容'\n },\n {\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M6.23509 6.45329C4.85101 7.89148 4 9.84636 4 12C4 16.4183 7.58172 20 12 20C13.0808 20 14.1116 19.7857 15.0521 19.3972C15.1671 18.6467 14.9148 17.9266 14.8116 17.6746C14.582 17.115 13.8241 16.1582 12.5589 14.8308C12.2212 14.4758 12.2429 14.2035 12.3636 13.3943L12.3775 13.3029C12.4595 12.7486 12.5971 12.4209 14.4622 12.1248C15.4097 11.9746 15.6589 12.3533 16.0043 12.8777C16.0425 12.9358 16.0807 12.9928 16.1198 13.0499C16.4479 13.5297 16.691 13.6394 17.0582 13.8064C17.2227 13.881 17.428 13.9751 17.7031 14.1314C18.3551 14.504 18.3551 14.9247 18.3551 15.8472V15.9518C18.3551 16.3434 18.3168 16.6872 18.2566 16.9859C19.3478 15.6185 20 13.8854 20 12C20 8.70089 18.003 5.8682 15.1519 4.64482C14.5987 5.01813 13.8398 5.54726 13.575 5.91C13.4396 6.09538 13.2482 7.04166 12.6257 7.11976C12.4626 7.14023 12.2438 7.12589 12.012 7.11097C11.3905 7.07058 10.5402 7.01606 10.268 7.75495C10.0952 8.2232 10.0648 9.49445 10.6239 10.1543C10.7134 10.2597 10.7307 10.4547 10.6699 10.6735C10.59 10.9608 10.4286 11.1356 10.3783 11.1717C10.2819 11.1163 10.0896 10.8931 9.95938 10.7412C9.64554 10.3765 9.25405 9.92233 8.74797 9.78176C8.56395 9.73083 8.36166 9.68867 8.16548 9.64736C7.6164 9.53227 6.99443 9.40134 6.84992 9.09302C6.74442 8.8672 6.74488 8.55621 6.74529 8.22764C6.74529 7.8112 6.74529 7.34029 6.54129 6.88256C6.46246 6.70541 6.35689 6.56446 6.23509 6.45329ZM12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22Z\"></path></svg>',\n title: 'Http 请求',\n type: 'httpNode',\n sortNo: 600,\n description: '通过 HTTP 请求获取数据'\n },\n {\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z\"></path></svg>',\n title: '动态代码',\n type: 'codeNode',\n sortNo: 700,\n description: '动态执行代码'\n },\n {\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M2 4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4ZM4 5V19H20V5H4ZM7 8H17V11H15V10H13V14H14.5V16H9.5V14H11V10H9V11H7V8Z\"></path></svg>',\n title: '内容模板',\n type: 'templateNode',\n sortNo: 800,\n description: '通过模板引擎生成内容'\n },\n {\n icon: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M6 5.1438V16.0002H18.3391L6 5.1438ZM4 2.932C4 2.07155 5.01456 1.61285 5.66056 2.18123L21.6501 16.2494C22.3423 16.8584 21.9116 18.0002 20.9896 18.0002H6V22H4V2.932Z\"></path></svg>',\n title: '结束节点',\n type: 'endNode',\n sortNo: 900,\n description: '结束定义输出参数'\n }\n ];\n\n const tableItems = [\n {\n label: '基础节点',\n value: 'base'\n },\n {\n label: '业务工具',\n value: 'tools'\n }\n ];\n\n const customNodes = [] as any[];\n const options = getOptions();\n const userCustomNodes = options.customNodes;\n if (userCustomNodes) {\n const keys = Object.keys(userCustomNodes).sort((a, b) => {\n return (userCustomNodes[a].sortNo || 0) - (userCustomNodes[b].sortNo || 0);\n });\n\n for (let key of keys) {\n if (userCustomNodes[key].group === 'base') {\n baseNodes.push({\n type: key,\n ...userCustomNodes[key]\n } as any);\n } else {\n customNodes.push({\n icon: userCustomNodes[key].icon,\n title: userCustomNodes[key].title,\n type: key\n });\n }\n }\n\n baseNodes.sort((a, b) => {\n return (a.sortNo || 0) - (b.sortNo || 0);\n });\n }\n\n if (options.hiddenNodes) {\n const hiddenNodes = typeof options.hiddenNodes === 'function' ? options.hiddenNodes() : options.hiddenNodes;\n if (Array.isArray(hiddenNodes)) {\n for (let hiddenNode of hiddenNodes) {\n for (let i = 0; i < baseNodes.length; i++) {\n if (baseNodes[i].type === hiddenNode) {\n baseNodes.splice(i, 1);\n break;\n }\n }\n }\n }\n }\n\n</script>\n\n<div class=\"tf-toolbar {containerShowClass}\">\n <div class=\"tf-toolbar-container \">\n <div class=\"tf-toolbar-container-header\">\n <Tabs style=\"width: 100%\" items={tableItems} onChange={(item)=>{\n showType = item.value.toString();\n }}\n />\n </div>\n\n <div class=\"tf-toolbar-container-body\">\n <div class=\"tf-toolbar-container-base\" style=\"display: {showType === 'base' ? 'flex' : 'none'}\">\n {#each baseNodes as node}\n <DraggableButton {...node} />\n {/each}\n </div>\n <div class=\"tf-toolbar-container-tools\" style=\"display: {showType !== 'base' ? 'flex' : 'none'}\">\n {#each customNodes as node}\n <DraggableButton {...node} />\n {/each}\n </div>\n </div>\n </div>\n\n <Button onclick={()=>{\n containerShowClass = containerShowClass ? '' :'show';\n }}>\n {#if containerShowClass === 'show'}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z\"></path>\n </svg>\n {:else}\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z\"></path>\n </svg>\n {/if}\n </Button>\n</div>\n","import { useStore } from '@xyflow/svelte';\nimport { get } from 'svelte/store';\n\nexport const useGetNode = () => {\n const { nodeLookup } = useStore();\n const getNode = (id: string) => {\n const $nodeLookup = get(nodeLookup);\n return $nodeLookup.get(id)?.internals.userNode;\n };\n return {\n getNode\n };\n};\n","import { useStore } from '@xyflow/svelte';\n\nexport const useEnsureParentInNodesBefore = () => {\n const { nodes } = useStore();\n\n const ensureParentInNodesBefore = (parentNodeId: string, childNodeId: string) => {\n nodes.update((nodeArray) => {\n let parentIndex = -1;\n for (let i = 0; i < nodeArray.length; i++) {\n if (nodeArray[i].id === parentNodeId) {\n parentIndex = i;\n break;\n }\n }\n\n if (parentIndex <= 0) {\n return nodeArray;\n }\n\n let firstChildIndex = -1;\n for (let i = 0; i < parentIndex; i++) {\n if (nodeArray[i].parentId === parentNodeId || nodeArray[i].id === childNodeId) {\n firstChildIndex = i;\n break;\n }\n }\n\n if (firstChildIndex == -1) {\n return nodeArray;\n }\n\n const parentNode = nodeArray[parentIndex];\n for (let i = parentIndex; i > firstChildIndex; i--) {\n nodeArray[i] = nodeArray[i - 1];\n }\n nodeArray[firstChildIndex] = parentNode;\n\n return nodeArray;\n });\n };\n return {\n ensureParentInNodesBefore\n };\n};\n","import { useStore } from '@xyflow/svelte';\nimport { get } from 'svelte/store';\n\nexport const useGetEdgesByTarget = () => {\n const { edges } = useStore();\n const getEdgesByTarget = (target: string) => {\n const $edges = get(edges);\n return $edges.filter((edge) => edge.target === target);\n };\n return {\n getEdgesByTarget\n };\n};\n","<script lang=\"ts\">\n import NodeWrapper from '../core/NodeWrapper.svelte';\n import { type Node, type NodeProps, useSvelteFlow } from '@xyflow/svelte';\n import { Button, Chosen, Heading, Input, Select, Textarea } from '../base';\n import RefParameterList from '../core/RefParameterList.svelte';\n import { getCurrentNodeId } from '../../store/nodeContext';\n import { useAddParameter } from '../utils/useAddParameter';\n import { getOptions } from '../utils/NodeUtils';\n import OutputDefList from '../core/OutputDefList.svelte';\n import { fillParameterId } from '../utils/useAddParameter.js';\n\n const { data, ...rest }: {\n data: NodeProps['data'],\n [key: string]: any\n } = $props();\n\n const currentNodeId = getCurrentNodeId();\n const { addParameter } = useAddParameter();\n const flowInstance = useSvelteFlow();\n const { updateNodeData: updateNodeDataInner } = flowInstance;\n\n const updateNodeData = (data: Record<string, any>) => {\n updateNodeDataInner(currentNodeId, data);\n };\n\n const updateNodeDataByEvent = (name: string, event: Event) => {\n updateNodeData({\n [name]: (event.target as any)?.value\n });\n };\n\n const node = {\n ...rest,\n id: currentNodeId,\n data\n } as Node;\n\n const externalElement = document.createElement('div') as HTMLElement;\n const options = getOptions();\n const customNode = options.customNodes![rest.type as string];\n customNode.render?.(externalElement, node, flowInstance);\n const forms = customNode.forms;\n\n let container: HTMLElement;\n $effect(() => {\n // 注意:由于 $effect 的 state 自动追踪问题,需要 data.expand 方在 if 里的最前面\n if (data.expand && container) {\n container.append(externalElement);\n }\n });\n\n $effect(() => {\n if (data) {\n customNode.onUpdate?.(externalElement, { ...node, data });\n }\n });\n\n $effect(() => {\n if (!data.parameters && customNode.parameters) {\n updateNodeData({\n parameters: fillParameterId(JSON.parse(JSON.stringify(customNode.parameters)))\n });\n }\n });\n\n $effect(() => {\n if (!data.outputDefs && customNode.outputDefs) {\n updateNodeData({\n outputDefs: fillParameterId(JSON.parse(JSON.stringify(customNode.outputDefs)))\n });\n }\n });\n\n</script>\n\n\n<NodeWrapper data={{...data, description: customNode.description}} {...rest}>\n\n {#snippet icon()}\n {@html customNode.icon}\n {/snippet}\n\n {#if customNode.parametersEnable !== false}\n <div class=\"heading\">\n <Heading level={3}>输入参数</Heading>\n\n {#if customNode.parametersAddEnable !== false}\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId)\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n {/if}\n </div>\n\n <RefParameterList />\n {/if}\n\n\n {#if forms}\n {#each forms as form}\n {#if form.type === 'input'}\n <div class=\"setting-title\">{form.label}</div>\n <div class=\"setting-item\">\n <Input\n placeholder={form.placeholder}\n style=\"width: 100%\"\n value={data[form.name] || form.defaultValue}\n {...form.attrs}\n onchange={(e)=>{\n updateNodeDataByEvent(form.name,e)\n }}\n />\n </div>\n {:else if form.type === 'textarea'}\n <div class=\"setting-title\">{form.label}</div>\n <div class=\"setting-item\">\n <Textarea\n rows={3}\n placeholder={form.placeholder}\n style=\"width: 100%\"\n value={data[form.name] || form.defaultValue}\n {...form.attrs}\n onchange={(e)=>{\n updateNodeDataByEvent(form.name,e)\n }}\n />\n </div>\n {:else if form.type === 'slider'}\n <div class=\"setting-title\">{form.label}</div>\n <div class=\"setting-item\">\n <div class=\"slider-container\">\n <span>{form.description}: {data[form.name] ?? form.defaultValue}</span>\n <input\n class=\"nodrag\"\n type=\"range\"\n {...form.attrs}\n value={data[form.name] ?? form.defaultValue}\n oninput={(e) => updateNodeData({ [form.name]: parseFloat(e.target.value) })}\n />\n </div>\n </div>\n {:else if form.type === 'select'}\n <div class=\"setting-title\">{form.label}</div>\n <div class=\"setting-item\">\n <Select items={form.options||[]} style=\"width: 100%\" placeholder={form.placeholder} onSelect={(item)=>{\n const newValue = item.value;\n updateNodeData({\n [form.name]: newValue\n })\n }} value={data[form.name] ? [data[form.name]] : [form.defaultValue]} />\n </div>\n {:else if form.type === 'chosen'}\n <div class=\"setting-title\">{form.label}</div>\n <div class=\"setting-item\">\n <Chosen style=\"width: 100%\" placeholder={form.placeholder}\n buttonText={form.chosen?.buttonText} onChosen={(value,label,event)=>{\n form.chosen?.onChosen?.(updateNodeData,value,label,event);\n }} value={data[form.chosen?.valueDataKey||\"\"]} label={data[form.chosen?.labelDataKey||\"\"]} />\n </div>\n {:else if form.type === 'heading'}\n <Heading level={3} mt=\"10px\" {...form.attrs}>{form.label}</Heading>\n {/if}\n {/each}\n {/if}\n\n\n <div bind:this={container} style={customNode.rootStyle||\"\"} class={customNode.rootClass}></div>\n\n\n {#if customNode.outputDefsEnable !== false}\n <div class=\"heading\">\n <Heading level={3} mt=\"10px\">输出参数</Heading>\n\n {#if customNode.outputDefsAddEnable !== false}\n <Button class=\"input-btn-more\" style=\"margin-left: auto\" onclick={()=>{\n addParameter(currentNodeId,'outputDefs')\n }}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z\"></path>\n </svg>\n </Button>\n {/if}\n </div>\n <OutputDefList />\n {/if}\n\n</NodeWrapper>\n\n<style>\n .heading {\n display: flex;\n align-items: center;\n margin-bottom: 10px;\n }\n\n .setting-title {\n font-size: 12px;\n color: #999;\n margin-bottom: 4px;\n margin-top: 10px;\n }\n\n .setting-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 10px;\n gap: 10px;\n }\n\n /* 新增样式 */\n .slider-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .slider-container span {\n font-size: 12px;\n color: #666;\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n input[type=\"range\"] {\n width: 100%;\n height: 4px;\n background: #ddd;\n border-radius: 2px;\n outline: none;\n -webkit-appearance: none;\n }\n\n input[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 14px;\n height: 14px;\n background: #007bff;\n border-radius: 50%;\n cursor: pointer;\n }\n</style>\n\n\n\n","import { useStore } from '@xyflow/svelte';\nimport { get } from 'svelte/store';\n\nexport const useUpdateEdgeData = () => {\n const store = useStore();\n const updateEdgeData = (id: string, dataUpdate: any, options?: { replace: boolean }) => {\n const edge = get(store.edgeLookup).get(id);\n if (!edge) {\n return;\n }\n\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate;\n edge.data = options?.replace ? nextData : { ...edge.data, ...nextData };\n store.edges.update((eds) =>\n eds.map((e) => {\n if (e.id === id) {\n return edge;\n }\n return e;\n })\n );\n };\n return {\n updateEdgeData\n };\n};\n","import { useStore } from '@xyflow/svelte';\n\nexport const useDeleteEdge = () => {\n const { edges } = useStore();\n const deleteEdge = (id: string) => {\n edges.update((edges) => edges.filter((edge) => edge.id !== id));\n };\n return {\n deleteEdge\n };\n};\n","<script lang=\"ts\">\n import {\n SvelteFlow,\n Background,\n Controls,\n MiniMap,\n useSvelteFlow,\n type Node, MarkerType, type Handle, Panel, type Edge, type NodeTypes, useStore\n } from '@xyflow/svelte';\n import '@xyflow/svelte/dist/style.css';\n import '../styles/index.ts';\n import { store } from '../store/stores';\n import { nodeTypes } from './nodes';\n import Toolbar from './Toolbar.svelte';\n import { genShortId } from './utils/IdGen';\n import { useGetNode } from './utils/useGetNode';\n import { useEnsureParentInNodesBefore } from './utils/useEnsureParentInNodesBefore';\n import { Textarea } from './base';\n import { useGetEdgesByTarget } from './utils/useGetEdgesByTarget';\n import { getOptions } from './utils/NodeUtils';\n import CustomNode from './nodes/CustomNode.svelte';\n import { useUpdateEdgeData } from './utils/useUpdateEdgeData';\n import { Button } from '#components/base/index';\n import { useDeleteEdge } from '#components/utils/useDeleteEdge';\n\n const { onInit } = $props();\n const svelteFlow = useSvelteFlow();\n\n onInit(svelteFlow);\n\n let showEdgePanel = $state(false);\n let currentEdge = $state();\n\n const { updateEdgeData } = useUpdateEdgeData();\n\n const onDragOver = (event: DragEvent) => {\n event.preventDefault();\n if (event.dataTransfer) {\n event.dataTransfer.dropEffect = 'move';\n }\n };\n\n const onDrop = (event: DragEvent) => {\n event.preventDefault();\n\n const position = svelteFlow.screenToFlowPosition({\n x: event.clientX - 250,\n y: event.clientY - 100\n });\n\n const baseNodeJsonString = event.dataTransfer?.getData('application/tinyflow');\n const baseNode = baseNodeJsonString ? JSON.parse(baseNodeJsonString) : {};\n const newNode = {\n id: `node_${genShortId()}`,\n position,\n data: {},\n ...baseNode\n } satisfies Node;\n\n store.addNode(newNode);\n store.selectNodeOnly(newNode.id);\n };\n\n\n const { getNode } = useGetNode();\n\n\n const isValidConnection = (conn: any) => {\n const sourceNode = getNode(conn.source)!;\n const targetNode = getNode(conn.target)!;\n\n // 阻止循环节点连接到父级节点 或者 父级节点连接到子级节点\n if (conn.sourceHandle === 'loop_handle' || sourceNode.parentId) {\n const edges = svelteFlow.getEdges();\n for (let edge of edges) {\n if (edge.target === conn.target) {\n const edgeSourceNode = getNode(edge.source) as Node;\n if (conn.sourceHandle === 'loop_handle' && edgeSourceNode.parentId !== sourceNode.id) {\n return false;\n }\n if (sourceNode.parentId && edgeSourceNode.parentId !== sourceNode.parentId) {\n return false;\n }\n }\n }\n }\n\n if (!sourceNode.parentId && targetNode.parentId && targetNode.parentId !== sourceNode.id) {\n return false;\n }\n\n // 允许链接\n return true;\n };\n\n\n const { ensureParentInNodesBefore } = useEnsureParentInNodesBefore();\n const onconnectend = (_: any, state: any) => {\n if (!state.isValid) {\n return;\n }\n\n const toNode = state.toNode as Node;\n if (toNode.parentId) {\n return;\n }\n\n const fromNode = state.fromNode as Node;\n const fromHande = state.fromHandle as Handle;\n\n const newNode = {\n position: { ...toNode.position }\n } as Node;\n\n if (fromHande.id === 'loop_handle') {\n newNode.parentId = fromNode.id;\n } else if (fromNode.parentId) {\n newNode.parentId = fromNode.parentId;\n }\n\n if (newNode.parentId) {\n const parentNode = getNode(newNode.parentId) as Node;\n newNode.position = {\n x: toNode.position.x - parentNode.position.x,\n y: toNode.position.y - parentNode.position.y\n };\n ensureParentInNodesBefore(newNode.parentId, toNode.id);\n svelteFlow.updateNode(toNode.id, newNode);\n }\n };\n\n const { getEdgesByTarget } = useGetEdgesByTarget();\n const onDelete = (params: any) => {\n const deleteEdges = params.edges as Edge[];\n deleteEdges.forEach((edge) => {\n if (edge.id === currentEdge?.id) {\n currentEdge = null;\n showEdgePanel = false;\n }\n const targetNode = getNode(edge.target) as Node;\n if (targetNode && targetNode.parentId) {\n const nodeEdges = getEdgesByTarget(edge.target);\n const loopNode = getNode(targetNode.parentId) as Node;\n if (nodeEdges.length === 0) {\n svelteFlow.updateNode(targetNode.id, {\n parentId: undefined,\n position: {\n x: targetNode.position.x + loopNode.position.x,\n y: targetNode.position.y + loopNode.position.y\n }\n });\n } else {\n let hasSameParent = false;\n for (let i = 0; i < nodeEdges.length; i++) {\n const edge = nodeEdges[i];\n const sourceNode = getNode(edge.source) as Node;\n if (sourceNode.parentId || sourceNode.type === 'loopNode') {\n hasSameParent = true;\n break;\n }\n }\n if (!hasSameParent) {\n svelteFlow.updateNode(targetNode.id, {\n parentId: undefined,\n position: {\n x: targetNode.position.x + loopNode.position.x,\n y: targetNode.position.y + loopNode.position.y\n }\n });\n }\n }\n }\n });\n };\n\n const { deleteEdge } = useDeleteEdge();\n\n\n const onconnectstart = (event: any, node: any) => {\n // console.log('onconnectstart: ', event, node);\n };\n\n\n const onconnect = (event: any) => {\n // console.log('onconnect: ', event);\n };\n\n const customNodeTypes = {\n // ...nodeTypes\n } as NodeTypes;\n\n const customNodes = getOptions().customNodes;\n if (customNodes) {\n for (let key of Object.keys(customNodes)) {\n customNodeTypes[key] = CustomNode as any;\n }\n }\n\n const { nodes, edges, viewport } = useStore();\n const onDataChange = getOptions().onDataChange;\n if (onDataChange) {\n nodes.subscribe(() => {\n onDataChange({\n nodes: $nodes,\n edges: $edges,\n viewport: $viewport\n }, { eventType: 'nodesChange' });\n });\n\n edges.subscribe(() => {\n onDataChange({\n nodes: $nodes,\n edges: $edges,\n viewport: $viewport\n }, { eventType: 'edgesChange' });\n });\n\n viewport.subscribe(() => {\n onDataChange({\n nodes: $nodes,\n edges: $edges,\n viewport: $viewport\n }, { eventType: 'viewportChange' });\n });\n }\n\n\n</script>\n\n\n<div style=\"position: relative; height: 100%; width: 100%;overflow: hidden\">\n <SvelteFlow nodeTypes={{ ...nodeTypes, ...customNodeTypes}}\n {...store}\n class=\"tinyflow-logo\"\n on:drop={onDrop}\n on:dragover={onDragOver}\n isValidConnection={isValidConnection}\n onconnectend={onconnectend}\n onconnectstart={onconnectstart}\n onconnect={onconnect}\n connectionRadius={50}\n on:edgeclick={(e) => {\n showEdgePanel = true;\n currentEdge = e.detail.edge;\n // console.log(e)\n }}\n onedgecreate={(edge) => {\n return {\n ...edge,\n id:genShortId(),\n }\n }}\n ondelete={onDelete}\n onclick={(e) => {\n const el = e.target as HTMLElement;\n if (el.classList.contains(\"svelte-flow__edge-interaction\")\n || el.classList.contains('panel-content')\n || el.closest('.panel-content')){\n return\n }\n showEdgePanel = false;\n currentEdge = null;\n }}\n defaultEdgeOptions={{\n // animated: true,\n // label: 'edge label',\n markerEnd: {\n type: MarkerType.ArrowClosed,\n // color: 'red',\n width: 20,\n height: 20\n }\n }}\n >\n <Background />\n <Controls />\n <MiniMap />\n\n {#if showEdgePanel}\n <Panel>\n <div class=\"panel-content\">\n <div>边属性设置</div>\n <div class=\"setting-title\">边条件设置</div>\n <div class=\"setting-item\">\n <Textarea\n rows={3}\n placeholder=\"请输入边条件\"\n style=\"width: 100%\"\n value={currentEdge?.data?.condition}\n onchange={(e)=>{\n if (currentEdge){\n updateEdgeData(currentEdge.id, {\n condition: e.target?.value\n })\n }\n }}\n />\n </div>\n <div class=\"setting-item\" style=\"padding: 8px 0\">\n <Button\n onclick={() => {\n deleteEdge(currentEdge?.id)\n showEdgePanel = false;\n }}\n >\n 删除\n </Button>\n\n <Button\n primary={true}\n onclick={() => {\n showEdgePanel = false;\n }}\n >\n 保存\n </Button>\n </div>\n </div>\n </Panel>\n {/if}\n </SvelteFlow>\n <Toolbar />\n</div>\n\n<style>\n .panel-content {\n padding: 10px;\n background-color: #fff;\n border-radius: 5px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n width: 200px;\n border: 1px solid #efefef;\n }\n\n .setting-title {\n margin: 10px 0;\n font-size: 12px;\n color: #999;\n }\n\n .setting-item {\n display: flex;\n gap: 5px;\n align-items: center;\n justify-content: end;\n }\n</style>\n","<svelte:options customElement={{\n tag: \"tinyflow-component\",\n shadow: \"none\"\n}} />\n\n<script lang=\"ts\">\n import { SvelteFlowProvider, type useSvelteFlow } from '@xyflow/svelte';\n import TinyflowCore from './TinyflowCore.svelte';\n import { store } from '../store/stores.js';\n import type { TinyflowData, TinyflowOptions } from '../Tinyflow';\n import { setContext } from 'svelte';\n\n const { options, onInit }: {\n options: TinyflowOptions,\n onInit: (svelteFlow: ReturnType<typeof useSvelteFlow>) => void,\n } = $props();\n let { data } = options;\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data.trim());\n } catch (e) {\n console.error('Invalid JSON data:', data);\n }\n }\n store.init((data as TinyflowData)?.nodes || [], (data as TinyflowData)?.edges || []);\n setContext('tinyflow_options', options);\n</script>\n\n\n<SvelteFlowProvider fitView>\n <TinyflowCore {onInit} />\n</SvelteFlowProvider>\n","<template>\n <div ref=\"divRef\" :class=\"['tinyflow', className]\" :style=\"style\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { Tinyflow as TinyflowNative } from './uiIndex'\nimport type { TinyflowOptions } from './types'\nimport './styles/index'\nimport { onMounted, onUnmounted, ref } from 'vue'\n\nconst props = defineProps<\n {\n className?: string\n style?: Record<string, string>\n } & Omit<TinyflowOptions, 'element'>\n>()\n\nconst divRef = ref<HTMLDivElement | null>(null)\nlet tinyflow: TinyflowNative | null = null\n\nonMounted(() => {\n if (divRef.value) {\n tinyflow = new TinyflowNative({\n ...props,\n element: divRef.value as Element,\n })\n }\n})\n\nonUnmounted(() => {\n if (tinyflow) {\n tinyflow.destroy()\n tinyflow = null\n }\n})\n\nconst getData = () => {\n if (tinyflow) {\n return tinyflow.getData()\n }\n console.warn('Tinyflow instance is not initialized')\n return null\n}\n\ndefineExpose({\n getData,\n})\n</script>\n"],"names":["makeMap","str","map","key","val","EMPTY_OBJ","EMPTY_ARR","isOn","extend","hasOwnProperty","hasOwn","isArray","isMap","toTypeString","isFunction","isString","isSymbol","isObject","isPromise","objectToString","value","toRawType","isIntegerKey","hasChanged","oldValue","_globalThis","getGlobalThis","normalizeStyle","res","i","item","normalized","parseStringStyle","listDelimiterRE","propertyDelimiterRE","styleCommentRE","cssText","ret","tmp","normalizeClass","name","batchDepth","batchedSub","startBatch","endBatch","error","e","next","err","Dep","computed","debugInfo","link","targetMap","ITERATE_KEY","MAP_KEY_ITERATE_KEY","ARRAY_ITERATE_KEY","trigger","target","type","newValue","oldTarget","depsMap","run","dep","targetIsArray","isArrayIndex","newLength","key2","reactiveReadArray","array","raw","toRaw","isShallow","toReactive","shallowReadArray","arr","arrayInstrumentations","iterator","args","x","fn","thisArg","apply","v","searchProxy","separator","noTracking","reduce","comparer","self","method","wrapValue","iter","result","arrayProto","wrappedRetFn","needsWrap","methodFn","result2","wrappedFn","index","acc","isProxy","isNonTrackableKeys","builtInSymbols","BaseReactiveHandler","_isReadonly","_isShallow","receiver","isReadonly2","isShallow2","shallowReadonlyMap","readonlyMap","shallowReactiveMap","reactiveMap","isRef","readonly","reactive","MutableReactiveHandler","isOldValueReadonly","isReadonly","hadKey","ReadonlyReactiveHandler","mutableHandlers","readonlyHandlers","toShallow","getProto","createIterableMethod","rawTarget","targetIsMap","isPair","innerIterator","wrap","toReadonly","done","createReadonlyMethod","createInstrumentations","shallow","instrumentations","rawKey","has","callback","observed","get","hadItems","createInstrumentationGetter","mutableCollectionHandlers","readonlyCollectionHandlers","targetTypeMap","rawType","getTargetType","createReactiveObject","baseHandlers","collectionHandlers","proxyMap","targetType","existingProxy","proxy","r","ref","createRef","rawValue","RefImpl","useDirectValue","callWithErrorHandling","instance","handleError","callWithAsyncErrorHandling","values","throwInDev","contextVNode","errorHandler","throwUnhandledErrorInProduction","cur","exposedInstance","errorInfo","errorCapturedHooks","logError","throwInProd","currentRenderingInstance","currentScopeId","isTeleport","setTransitionHooks","vnode","hooks","defineComponent","options","extraOptions","injectHook","hook","currentInstance","prepend","wrappedHook","reset","setCurrentInstance","createHook","lifecycle","isInSSRComponentSetup","onMounted","onUnmounted","NULL_DYNAMIC_COMPONENT","internalObjectProto","isInternalObject","obj","isSuspense","Fragment","Text","Comment","blockStack","currentBlock","openBlock","disableTracking","closeBlock","setupBlock","createElementBlock","props","children","patchFlag","dynamicProps","shapeFlag","createBaseVNode","isVNode","normalizeKey","normalizeRef","ref_key","ref_for","isBlockNode","needFullChildrenNormalization","normalizeChildren","createVNode","_createVNode","cloned","cloneVNode","isClassComponent","guardReactiveProps","klass","style","extraProps","mergeRef","cloneTransition","transition","mergedProps","mergeProps","createTextVNode","text","flag","slot","toMerge","existing","incoming","internalSetCurrentInstance","g","registerGlobalSetter","setter","setters","set","prev","PUBLIC_VERSION","_a","legacy_mode_flag","tracing_mode_flag","enable_legacy_mode_flag","EACH_ITEM_REACTIVE","EACH_INDEX_REACTIVE","EACH_IS_CONTROLLED","EACH_IS_ANIMATED","EACH_ITEM_IMMUTABLE","PROPS_IS_IMMUTABLE","PROPS_IS_RUNES","PROPS_IS_UPDATED","PROPS_IS_BINDABLE","PROPS_IS_LAZY_INITIAL","TEMPLATE_FRAGMENT","TEMPLATE_USE_IMPORT_NODE","HYDRATION_START","HYDRATION_START_ELSE","HYDRATION_END","HYDRATION_ERROR","UNINITIALIZED","NAMESPACE_HTML","NAMESPACE_SVG","ATTACHMENT_KEY","DEV","is_array","index_of","array_from","object_keys","define_property","get_descriptor","get_descriptors","object_prototype","array_prototype","get_prototype_of","is_extensible","is_function","thing","noop","run_all","deferred","resolve","reject","promise","rej","to_array","n","element","DERIVED","EFFECT","RENDER_EFFECT","BLOCK_EFFECT","BRANCH_EFFECT","ROOT_EFFECT","BOUNDARY_EFFECT","UNOWNED","DISCONNECTED","CLEAN","DIRTY","MAYBE_DIRTY","INERT","DESTROYED","EFFECT_RAN","EFFECT_TRANSPARENT","INSPECT_EFFECT","HEAD_EFFECT","EFFECT_PRESERVED","USER_EFFECT","REACTION_IS_UPDATING","ASYNC","ERROR_VALUE","STATE_SYMBOL","LEGACY_PROPS","LOADING_ATTR_SYMBOL","STALE_REACTION","__publicField","ELEMENT_NODE","TEXT_NODE","COMMENT_NODE","await_outside_boundary","lifecycle_outside_component","async_derived_orphan","effect_in_teardown","rune","effect_in_unowned_derived","effect_orphan","effect_update_depth_exceeded","hydration_failed","props_invalid_value","state_descriptors_fixed","state_prototype_fixed","state_unsafe_mutation","hydration_mismatch","location","select_multiple_invalid_value","hydrating","set_hydrating","hydrate_node","set_hydrate_node","node","w.hydration_mismatch","hydrate_next","get_next_sibling","count","remove_nodes","depth","data","read_hydration_instruction","equals","safe_not_equal","a","b","safe_equals","component_context","set_component_context","context","getContext","get_or_init_context_map","setContext","hasContext","push","runes","pop","component","effects","create_user_effect","is_runes","e.lifecycle_outside_component","get_parent_context","parent","context_map","adjustments","handle_error","effect","active_effect","active_reaction","apply_adjustments","invoke_error_boundary","adjusted","request_idle_callback","cb","micro_tasks","idle_tasks","run_micro_tasks","tasks","run_idle_tasks","queue_micro_task","queue_idle_task","flush_tasks","get_pending_boundary","boundary","e.await_outside_boundary","derived","flags","parent_derived","async_derived","e.async_derived_orphan","signal","source","should_suspend","async_effect","p","batch","current_batch","pending","handler","internal_set","unset_context","fulfil","go","user_derived","d","push_reaction_value","derived_safe_equal","destroy_derived_effects","destroy_effect","get_derived_parent_effect","execute_derived","prev_active_effect","set_active_effect","update_reaction","update_derived","increment_write_version","is_destroying_effect","batch_deriveds","status","skip_reaction","set_signal_status","flatten","sync","async","restore","capture","expression","previous_effect","previous_reaction","previous_component_context","set_active_reaction","batches","effect_pending_updates","dequeue","task","queued_root_effects","last_scheduled_effect","is_flushing","_current","_previous","_callbacks","_pending","_deferred","_neutered","_async_effects","_boundary_async_effects","_render_effects","_effects","_block_effects","_Batch_instances","process_fn","traverse_effect_tree_fn","commit_fn","_Batch","__privateAdd","__privateGet","update","__privateSet","__privateMethod","was_updating_effect","is_updating_effect","flush_count","set_is_updating_effect","updates","entry","infinite_loop_guard","old_values","schedule_effect","autoflush","root_effects","current_values","current","previous","root","render_effects","flush_queued_effects","wv","update_effect","is_branch","is_skippable_branch","skip","is_dirty","child","Batch","flushSync","e.effect_update_depth_exceeded","length","write_version","unlink_effect","stack","state","s","mutable_source","initial_value","immutable","trackable","should_proxy","untracking","current_sources","e.state_unsafe_mutation","new_value","old_value","mark_reactions","untracked_writes","set_untracked_writes","increment","reactions","reaction","prototype","sources","is_proxied_array","version","parent_version","update_version","with_parent","set_update_version","_","prop","descriptor","e.state_descriptors_fixed","exists","other_s","ls","own_keys","e.state_prototype_fixed","get_proxied_value","is","$window","is_firefox","first_child_getter","next_sibling_getter","init_operations","element_prototype","node_prototype","text_prototype","create_text","get_first_child","is_text","first_child","fragment","first","sibling","next_sibling","last_sibling","clear_text_content","should_defer_append","validate_effect","e.effect_orphan","e.effect_in_unowned_derived","e.effect_in_teardown","push_effect","parent_effect","parent_last","create_effect","inert","teardown","user_effect","defer","user_pre_effect","effect_root","component_root","pause_effect","legacy_pre_effect","deps","token","render_effect","untrack","legacy_pre_effect_reset","template_effect","block","branch","execute_effect_teardown","previously_destroying_effect","set_is_destroying_effect","destroy_effect_children","remove_dom","destroy_block_effect_children","removed","remove_effect_dom","remove_reactions","transitions","end","pause_children","run_out_transitions","remaining","check","local","transparent","resume_effect","resume_children","new_deps","skipped_deps","read_version","dependencies","is_unowned","dependency","is_disconnected","is_unowned_connected","schedule_possible_effect_self_invalidation","previous_deps","previous_skipped_deps","previous_untracked_writes","previous_skip_reaction","previous_sources","previous_untracking","previous_update_version","remove_reaction","new_length","start_index","is_derived","destroyed","depends_on_old_values","STATUS_MASK","deep_read_state","deep_read","visited","proto","descriptors","autofocus","dom","body","remove_textarea_child","listening_to_form_reset","add_form_reset_listener","evt","without_reactive_context","all_registered_events","root_event_handles","create_event","event_name","target_handler","event","handle_event_propagation","passive","delegate","events","handler_element","owner_document","path","current_target","path_idx","handled_at","at_idx","handler_idx","throw_error","other_errors","parent_element","delegated","create_fragment_from_html","html","elem","assign_nodes","start","from_html","content","is_fragment","use_import_node","has_start","clone","from_namespace","ns","wrapped","from_svg","comment","frag","anchor","append","is_capture_event","DELEGATED_EVENTS","is_delegated","ATTRIBUTE_ALIASES","normalize_attribute","PASSIVE_EVENTS","is_passive_event","RAW_TEXT_ELEMENTS","is_raw_text_element","set_text","mount","_mount","hydrate","was_hydrating","previous_hydrate_node","e.hydration_failed","document_listeners","Component","intro","registered_events","event_handle","unmount","anchor_node","ctx","mounted_components","snippet","get_snippet","snippet_effect","onMount","init_update_callbacks","cleanup","onDestroy","create_custom_event","detail","bubbles","cancelable","createEventDispatcher","active_component_context","callbacks","l","if_block","elseif","consequent_effect","alternate_effect","condition","has_branch","set_branch","update_branch","offscreen_fragment","commit","active","inactive","new_condition","mismatch","is_else","pause_effects","items","controlled_anchor","items_map","is_controlled","parent_node","each","get_collection","get_key","render_fn","fallback_fn","fallback","was_empty","offscreen_items","each_array","collection","each_effect","reconcile","create_item","keys","update_item","_b","_c","_d","is_animated","should_update","seen","to_animate","matched","stashed","move","child_anchor","j","to_destroy","destroy_length","unused","mutable","dest","next_node","get_value","svg","mathml","skip_warning","last","$$props","slot_props","slot_fn","is_interop","sanitize_slots","sanitized","get_component","pending_effect","get_tag","is_svg","get_namespace","tag","current_tag","next_tag","append_styles","css","action","payload","inited","attach","get_fn","f","clsx","_clsx","whitespace","to_class","hash","directives","classname","len","styles","important","to_css_name","to_style","new_style","normal_styles","important_styles","in_str","in_apo","in_comment","reserved_names","name_index","c","property","set_class","is_html","prev_classes","next_classes","next_class_name","is_present","update_styles","priority","set_style","prev_styles","next_styles","next_style_attr","select_option","select","mounting","w.select_multiple_invalid_value","option","get_option_value","option_value","init_select","observer","CLASS","STYLE","IS_CUSTOM_ELEMENT","IS_HTML","remove_input_defaults","input","already_removed","remove_defaults","set_attribute","checked","set_value","attributes","get_attributes","set_checked","set_selected","selected","attribute","get_setters","set_attributes","css_hash","is_custom_element","preserve_attribute_case","is_hydrating_custom_element","is_option_element","prev_value","prefix","opts","event_handle_key","handle","is_default","use_default","attribute_effect","is_select","symbol","setters_cache","element_proto","_listeners","_observer","_options","_ResizeObserverSingleton_instances","getObserver_fn","_ResizeObserverSingleton","listener","listeners","entries","ResizeObserverSingleton","resize_observer_border_box","bind_element_size","unsub","is_bound_this","bound_value","element_or_component","bind_this","get_parts","old_parts","parts","init","changed","observe_all","fns","bubble_event","subscribe_to_store","store","invalidate","subscriber_queue","readable","writable","stop","subscribers","run_queue","subscriber","subscribe","stores","single","stores_array","auto","started","unsubscribers","is_store_binding","IS_UNMOUNTED","store_get","store_name","is_synchronous_callback","get_store","store_unsub","store_set","setup_stores","capture_store_binding","previous_is_store_binding","rest_props_handler","rest_props","exclude","legacy_rest_props_handler","legacy_rest_props","spread_props_handler","desc","spread_props","bindable","lazy","fallback_value","fallback_dirty","get_fallback","is_entry_props","is_store_sub","e.props_invalid_value","getter","legacy_parent","mutation","overridden","createClassComponent","Svelte4Component","_events","_instance","add_source","SvelteElement","$$componentCtor","$$slots","use_shadow_dom","create_slot","existing_slots","get_custom_elements_slots","get_custom_element_value","attribute_value","attr","_oldValue","attribute_name","props_definition","transform","create_custom_element","slots","exports","Class","cc","names","out","k","dispatch","t","Dispatch","parseTypenames","typenames","types","typename","T","copy","that","xhtml","namespaces","namespace","creatorInherit","document","uri","creatorFixed","fullname","creator","none","selector","selection_select","groups","m","subgroups","group","subgroup","subnode","Selection","empty","selectorAll","arrayAll","selection_selectAll","parents","matcher","childMatcher","find","childFind","match","childFirst","selection_selectChild","filter","childrenFilter","selection_selectChildren","selection_filter","sparse","selection_enter","EnterNode","datum","constant$3","bindIndex","enter","exit","groupLength","dataLength","bindKey","nodeByKeyValue","keyValues","keyValue","selection_data","bind","constant","arraylike","enterGroup","updateGroup","exitGroup","i0","i1","selection_exit","selection_join","onenter","onupdate","onexit","selection_merge","selection","groups0","groups1","m0","m1","merges","group0","group1","merge","selection_order","selection_sort","compare","ascending","compareNode","sortgroups","sortgroup","selection_call","selection_nodes","selection_node","selection_size","size","selection_empty","selection_each","attrRemove","attrRemoveNS","attrConstant","attrConstantNS","attrFunction","attrFunctionNS","selection_attr","defaultView","styleRemove","styleConstant","styleFunction","selection_style","styleValue","propertyRemove","propertyConstant","propertyFunction","selection_property","classArray","string","classList","ClassList","classedAdd","list","classedRemove","classedTrue","classedFalse","classedFunction","selection_classed","textRemove","textConstant","textFunction","selection_text","htmlRemove","htmlConstant","htmlFunction","selection_html","raise","selection_raise","lower","selection_lower","selection_append","create","constantNull","selection_insert","before","remove","selection_remove","selection_cloneShallow","selection_cloneDeep","selection_clone","deep","selection_datum","contextListener","onRemove","on","o","onAdd","selection_on","dispatchEvent","params","window","dispatchConstant","dispatchFunction","selection_dispatch","selection_iterator","selection_selection","sourceEvent","pointer","point","rect","nonpassive","nonpassivecapture","nopropagation","noevent$1","dragDisable","view","noevent","yesdrag","noclick","constant$2","DragEvent","subject","identifier","y","dx","dy","defaultFilter","defaultContainer","defaultSubject","defaultTouchable","drag$1","container","touchable","gestures","mousedownx","mousedowny","mousemoving","touchending","clickDistance2","drag","mousedowned","touchstarted","touchmoved","touchended","gesture","beforestart","mousemoved","mouseupped","nodrag","touches","touch","p0","define","constructor","factory","definition","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","color","channels","color_formatHex","color_formatHex8","color_formatHsl","color_formatRgb","hslConvert","format","rgbn","Rgb","rgba","hsla","rgbConvert","rgb","opacity","clampi","clampa","rgb_formatHex","rgb_formatHex8","rgb_formatRgb","hex","h","Hsl","min","max","hsl","m2","hsl2rgb","clamph","clampt","constant$1","linear","exponential","gamma","nogamma","interpolateRgb","rgbGamma","colorRgb","interpolateNumber","reA","reB","zero","one","interpolateString","bi","am","bm","bs","q","number","degrees","identity","decompose","scaleX","scaleY","skewX","svgNode","parseCss","parseSvg","interpolateTransform","parse","pxComma","pxParen","degParen","translate","xa","ya","xb","yb","rotate","scale","interpolateTransformCss","interpolateTransformSvg","epsilon2","cosh","sinh","tanh","interpolateZoom","zoomRho","rho","rho2","rho4","zoom","p1","ux0","uy0","w0","ux1","uy1","w1","d2","S","d1","b0","b1","r0","r1","coshr0","u","_1","_2","_4","frame","timeout","interval","pokeDelay","taskHead","taskTail","clockLast","clockNow","clockSkew","clock","setFrame","now","clearNow","Timer","timer","delay","time","sleep","timerFlush","wake","nap","poke","t0","t1","t2","elapsed","emptyOn","emptyTween","CREATED","SCHEDULED","STARTING","STARTED","RUNNING","ENDING","ENDED","schedule","id","timing","schedules","tween","tick","interrupt","selection_interrupt","tweenRemove","tween0","tween1","tweenFunction","transition_tween","tweenValue","interpolate","value1","string00","string1","interpolate0","string0","string10","transition_attr","attrInterpolate","attrInterpolateNS","attrTweenNS","attrTween","transition_attrTween","delayFunction","delayConstant","transition_delay","durationFunction","durationConstant","transition_duration","easeConstant","transition_ease","easeVarying","transition_easeVarying","transition_filter","Transition","transition_merge","onFunction","on0","on1","sit","transition_on","removeFunction","transition_remove","transition_select","transition_selectAll","inherit","transition_selection","styleNull","styleMaybeRemove","listener0","transition_style","styleInterpolate","styleTween","transition_styleTween","transition_text","textInterpolate","textTween","transition_textTween","transition_transition","id0","id1","newId","transition_end","cancel","selection_prototype","cubicInOut","defaultTiming","easeCubicInOut","selection_transition","ZoomEvent","Transform","defaultExtent","defaultTransform","defaultWheelDelta","defaultConstrain","extent","translateExtent","dx0","dx1","dy0","dy1","zoom$1","constrain","wheelDelta","scaleExtent","duration","touchstarting","touchfirst","touchDelay","wheelDelay","tapDistance","wheeled","dblclicked","k0","k1","centroid","w","clean","Gesture","wheelidled","currentTarget","x0","y0","dragEnable","l0","l1","dp","dl","errorMessages","nodeType","handleType","sourceHandle","targetHandle","edgeType","lib","infiniteExtent","ConnectionMode","PanOnScrollMode","SelectionMode","initialConnection","ConnectionLineType","MarkerType","Position","oppositePosition","areConnectionMapsEqual","handleConnectionChange","diff","connection","getConnectionStatus","isValid","isEdgeBase","isNodeBase","isInternalNodeBase","getNodePositionWithOrigin","nodeOrigin","width","height","getNodeDimensions","origin","offsetX","offsetY","getNodesBounds","nodes","box","currBox","nodeOrId","isId","currentNode","nodeBox","nodeToBox","getBoundsOfBoxes","boxToRect","getInternalNodesBounds","nodeLookup","getNodesInside","tx","ty","tScale","partially","excludeNonSelectableNodes","paneRect","pointToRendererPoint","visibleNodes","measured","selectable","hidden","overlappingArea","getOverlappingArea","nodeToRect","area","partiallyVisible","getConnectedEdges","edges","nodeIds","edge","getFitViewNodes","fitViewNodes","optionNodeIds","fitViewport","panZoom","minZoom","maxZoom","nodesToFit","bounds","viewport","getViewportForBounds","calculateNodePosition","nodeId","nextPosition","nodeExtent","onError","parentNode","parentX","parentY","parentWidth","parentHeight","isCoordinateExtent","positionAbsolute","clampPosition","getElementsToRemove","nodesToRemove","edgesToRemove","onBeforeDelete","matchingNodes","isIncluded","parentHit","edgeIds","deletableEdges","matchingEdges","onBeforeDeleteResult","clamp","position","dimensions","clampPositionToParent","childPosition","childDimensions","calcAutoPanVelocity","calcAutoPan","pos","speed","distance","xMovement","yMovement","box1","box2","rectToBox","x2","y2","getBoundsOfRects","rect1","rect2","rectA","rectB","xOverlap","yOverlap","isRectObject","isNumeric","devWarn","message","snapPosition","snapGrid","snapToGrid","rendererPointToPoint","parsePadding","padding","paddingValue","parsePaddings","paddingY","paddingX","top","bottom","left","right","calculateAppliedPaddings","boundRight","boundBottom","xZoom","yZoom","clampedZoom","boundsCenterX","boundsCenterY","newPadding","offset","isMacOs","nodeHasDimensions","evaluateAbsolutePosition","parentId","withResolvers","getPointerPosition","containerBounds","getEventPosition","pointerPos","xSnapped","ySnapped","getDimensions","getHostForElement","inputTags","isInputDOMNode","isMouseEvent","isMouse","evtX","evtY","getHandleBounds","nodeElement","nodeBounds","handles","handleBounds","getBezierEdgeCenter","sourceX","sourceY","targetX","targetY","sourceControlX","sourceControlY","targetControlX","targetControlY","centerX","centerY","calculateControlOffset","curvature","getControlWithCurvature","x1","y1","getBezierPath","sourcePosition","targetPosition","labelX","labelY","getEdgeCenter","xOffset","yOffset","getElevatedEdgeZIndex","sourceNode","targetNode","zIndex","elevateOnSelect","edgeOrConnectedNodeSelected","selectedZIndex","isEdgeVisible","edgeBox","viewRect","getEdgeId","connectionExists","el","addEdge","edgeParams","getStraightPath","handleDirections","getDirection","getPoints","center","sourceDir","targetDir","sourceGapped","targetGapped","dir","dirAccessor","currDir","points","sourceGapOffset","targetGapOffset","defaultCenterX","defaultCenterY","defaultOffsetX","defaultOffsetY","verticalSplit","horizontalSplit","sourceTarget","targetSource","gapOffset","dirAccessorOpposite","isSameDir","sourceGtTargetOppo","sourceLtTargetOppo","sourceGapPoint","targetGapPoint","maxXDistance","maxYDistance","getBend","bendSize","xDir","yDir","getSmoothStepPath","borderRadius","segment","isNodeInitialized","getEdgePosition","sourceHandleBounds","toHandleBounds","targetHandleBounds","getHandle$1","getHandlePosition","fallbackPosition","handleId","getMarkerId","marker","createMarkerIds","defaultColor","defaultMarkerStart","defaultMarkerEnd","ids","markers","markerId","getNodeToolbarTransform","nodeRect","align","alignmentOffset","shift","defaultOptions","adoptUserNodesDefaultOptions","mergeObjects","base","updateAbsolutePositions","parentLookup","updateChildNode","positionWithOrigin","clampedPosition","adoptUserNodes","nodesInitialized","tmpLookup","selectedNodeZ","userNode","internalNode","calculateZ","updateParentLookup","childNodes","elevateNodesOnSelect","z","calculateChildXYZ","positionChanged","childNode","absolutePosition","childZ","parentZ","handleExpandParent","changes","parentExpansions","parentRect","expandedRect","xChange","yChange","newWidth","newHeight","widthChange","heightChange","updateNodeInternals","domNode","viewportNode","updatedInternals","parentExpandChildren","dimensionChanged","newNode","parentExpandChanges","panBy","delta","nextViewport","transformChanged","addConnectionToLookup","connectionKey","connectionLookup","nodeMap","typeMap","handleMap","updateConnectionLookup","edgeLookup","sourceKey","targetKey","shallowNodeData","isParentSelected","hasSelector","getDragItems","nodesDraggable","mousePos","dragItems","getEventHandlerParams","dragging","nodesFromDragItems","dragItem","XYDrag","onNodeMouseDown","getStoreItems","onDragStart","onDrag","onDragStop","lastPos","autoPanId","autoPanStarted","mousePosition","dragStarted","d3Selection","abortDrag","noDragClassName","handleSelector","isSelectable","nodeClickDistance","updateNodes","dragEvent","onNodeDrag","onSelectionDrag","updateNodePositions","hasChange","nodesBox","adjustedNodeExtent","currentNodes","autoPan","autoPanSpeed","autoPanOnNodeDrag","startDrag","multiSelectionActive","selectNodesOnDrag","onNodeDragStart","onSelectionDragStart","unselectNodesAndEdges","d3DragInstance","nodeDragThreshold","onNodeDragStop","onSelectionDragStop","destroy","getNodesWithinDistance","ADDITIONAL_DISTANCE","getClosestHandle","connectionRadius","fromHandle","closestHandles","minDistance","closeNodes","allHandles","oppositeHandleType","getHandle","connectionMode","withAbsolutePosition","getHandleType","edgeUpdaterType","handleDomNode","isConnectionValid","isInsideConnectionRadius","isHandleValid","alwaysValid","onPointerDown","isTarget","autoPanOnConnect","flowId","cancelConnection","onConnectStart","onConnect","onConnectEnd","isValidConnection","onReconnectEnd","updateConnection","getTransform","getFromHandle","doc","closestHandle","clickedHandle","fromHandleInternal","fromNodeInternal","newConnection","previousConnection","onPointerMove","onPointerUp","isValidHandle","inProgress","connectionState","finalConnectionState","fromNodeId","fromHandleId","fromType","handleBelow","handleToCheck","handleNodeId","connectable","connectableEnd","XYHandle","XYMinimap","getViewScale","zoomStep","pannable","zoomable","inversePan","zoomHandler","pinchDelta","nextZoom","panStart","panStartHandler","panHandler","panCurrent","panDelta","moveScale","zoomAndPanHandler","viewChanged","prevViewport","eventViewport","transformToViewport","viewportToTransform","zoomIdentity","isWrappedWithClass","className","isRightClickPan","panOnDrag","usedButton","getD3Transition","onEnd","hasDuration","factor","createPanOnScrollHandler","zoomPanValues","noWheelClassName","d3Zoom","panOnScrollMode","panOnScrollSpeed","zoomOnPinch","onPanZoomStart","onPanZoom","onPanZoomEnd","currentZoom","deltaNormalize","deltaX","deltaY","createZoomOnScrollHandler","preventScrolling","d3ZoomHandler","isWheel","preventZoom","hasNoWheelClass","createPanZoomStartHandler","onDraggingChange","createPanZoomHandler","onPaneContextMenu","onTransformChange","createPanZoomEndHandler","panOnScroll","createFilter","zoomActivationKeyPressed","zoomOnScroll","zoomOnDoubleClick","userSelectionActive","noPanClassName","zoomScroll","pinchZoom","buttonAllowed","XYPanZoom","paneClickDistance","bbox","d3ZoomInstance","setViewportConstrained","d3DblClickZoomHandler","setTransform","wheelHandler","startHandler","panZoomHandler","panZoomEndHandler","nextTransform","contrainedTransform","setViewport","syncViewport","currentTransform","getViewport","zoomTransform","scaleTo","scaleBy","setScaleExtent","setTranslateExtent","setClickDistance","validDistance","ResizeControlVariant","$.prop","onconnect","ondisconnect","isConnectableProp","useStore","isValidConnectionStore","onedgecreate","onConnectAction","onConnectStartAction","onConnectEndAction","isMouseTriggered","$connectionRadius","$domNode","$nodeLookup","$connectionMode","$lib","$autoPanOnConnect","$flowId","$isValidConnectionStore","$onedgecreate","$onConnectAction","startParams","$onConnectStartAction","$onConnectEndAction","$viewport","$connection","prevConnections","connections","$.mutable_source","$.set","isConnectable","$connectable","$edges","$connectionLookup","$.get","_connections","connectionInProcess","connectingFrom","connectingTo","isPossibleEndHandle","valid","$.set_attribute","div","$.untrack","tryToMount","targetEl","portal","useHandleEdgeSelect","selectionRect","selectionRectMode","multiselectionKeyPressed","addSelectedEdges","elementsSelectable","handleEdgeSelect","$.template_effect","$0","$.set_style","$.event","label","labelStyle","markerStart","markerEnd","interactionWidth","interactionWidthValue","$$render","consequent","consequent_1","$$array","syncNodeStores","nodesStore","userNodesStore","nodesStoreSetter","userNodesStoreSetter","currentNodesStore","currentUserNodesStore","_set","nds","updatedNodes","syncEdgeStores","edgesStore","userEdgesStore","userEdgesStoreSetter","eds","syncViewportStores","panZoomStore","viewportStore","userViewportStore","viewportStoreSetter","userViewportStoreSetter","vp","createNodesStore","fitViewQueued","fitViewOptions","fitViewResolver","defaults","_update","setDefaultOptions","setOptions","createEdgesStore","nextEdges","initialNodeTypes","InputNode","OutputNode","DefaultNode","GroupNode","initialEdgeTypes","StraightEdgeInternal","SmoothStepEdgeInternal","BezierEdgeInternal","StepEdgeInternal","getInitialStore","fitView","storeNodeOrigin","storeNodeExtent","widthStore","heightStore","getVisibleEdges","visibleEdges","onlyRenderVisibleElements","onerror","edgePosition","getVisibleNodes","createStore","fitViewOnCreate","setNodeTypes","nodeTypes","setEdgeTypes","edgeTypes","addEdgeUtil","nodeDragItems","updateNodeInternalsSystem","change","zoomBy","zoomIn","zoomOut","setMinZoom","setMaxZoom","resetSelectedElements","elements","elementsChanged","setPaneClickDistance","deleteKeyPressed","selectedNodes","selectedEdges","mN","mE","addSelectedNodes","isMultiSelection","nodeWillBeSelected","es","edgeWillBeSelected","handleNodeSelection","panBySystem","_connection","initialized","initialNodesLength","initialEdgesLength","edgesInitialized","viewportInitialized","createStoreContext","initialViewport","panZoomInstance","currentViewport","onMoveStart","onMove","onMoveEnd","panActivationKeyPressed","viewPort","_panOnDrag","$panActivationKeyPressed","_panOnScroll","$minZoom","$maxZoom","$zoomActivationKeyPressed","$selectionRect","$translateExtent","wrapHandler","toggleSelected","isSelected","selectionOnDrag","selectionKeyPressed","selectionMode","selectionInProgress","onClick","isSelecting","startX","startY","nextUserSelectRect","prevSelectedNodeIds","prevSelectedEdgeIds","$selectionMode","selectedEdgeIds","selectedNodeIds","$selectionRectMode","$selectionKeyPressed","onContextMenu","hasActiveSelection","$elementsSelectable","event_handler","$.derived","$.bind_this","$$value","$dragging","$$args","dragInstance","updateDrag","getNodeInlineStyleDimensions","initialWidth","initialHeight","measuredWidth","measuredHeight","styleWidth","styleHeight","draggable","deletable","resizeObserver","isParent","positionX","positionY","dragHandle","nodeRef","prevNodeRef","dispatchNodeEvent","connectableStore","prevType","prevSourcePosition","prevTargetPosition","onSelectNodeHandler","nodeTypeValid","$nodeTypes","nodeComponent","inlineStyleDimensions","$.derived_safe_equal","$2","$nodesDraggable","$$anchor","$$component","$connectableStore","nodesConnectable","$.each","$visibleNodes","$nodesConnectable","$5","$parentLookup","$7","$8","animated","ariaLabel","$edgeLookup","onMouseEvent","edgeComponent","$edgeTypes","markerStartUrl","markerEndUrl","_onMount","_onDestroy","defs","$markers","markerUnits","orient","strokeWidth","defaultEdgeOptions","node_1","$visibleEdges","$1","isVisible","$3","$4","$nodes","node_2","__","$.effect","shortcut","param","enabled","normalizedTriggers","modifiedMap","mergedTrigger","modifier","preventDefault","triggerEnabled","def","newEnabled","newType","selectionKey","multiSelectionKey","deleteKey","panActivationKey","zoomActivationKey","isKeyObject","getModifier","getKeyString","getShortcutTrigger","_key","keyString","resetKeysAndSelection","containerStyle","isCustomComponent","connectionLineType","from","to","fromPosition","toPosition","pathParams","$connectionLineType","$$array_1","$$array_2","$$array_3","$width","$height","positionClasses","$$restProps","$.STYLE","proOptions","updateStore","getKeys","updateStoreByKeys","getMediaQuery","useColorModeClass","colorMode","mediaQuery","updateColorModeClass","connectionLineStyle","connectionLineContainerStyle","ondelete","attributionPosition","onconnectstart","onconnectend","onbeforedelete","oninit","defaultMarkerColor","clientWidth","clientHeight","initViewport","onInitCalled","$initialized","updatableProps","colorModeClass","$$stores","$colorModeClass","$6","initialNodes","initialEdges","bgColor","bgColorHover","colorHover","borderColor","showZoom","showFitView","showLock","buttonBgColor","buttonBgColorHover","buttonColor","buttonColorHover","buttonBorderColor","orientation","buttonProps","onZoomInHandler","onZoomOutHandler","onFitViewHandler","onToggleInteractivity","isInteractive","minZoomReached","maxZoomReached","orientationClass","consequent_2","alternate","consequent_3","BackgroundVariant","radius","lineWidth","variant","defaultSize","gap","patternColor","patternClass","patternSize","isDots","isCross","gapXY","patternId","scaledGap","scaledSize","patternDimensions","patternOffset","shapeRendering","strokeColor","interactive","minimap","getAttrFunction","func","nodeStrokeColor","nodeColor","nodeClass","nodeBorderRadius","nodeStrokeWidth","maskColor","maskStrokeColor","maskStrokeWidth","defaultWidth","defaultHeight","containerWidth","containerHeight","nodeColorFunc","nodeStrokeColorFunc","nodeClassFunc","labelledBy","boundingRect","viewBB","viewScale","$containerWidth","$containerHeight","elementWidth","elementHeight","scaledWidth","scaledHeight","viewWidth","viewHeight","viewboxWidth","viewboxHeight","node_3","nodeDimesions","$panZoom","isNode","useSvelteFlow","getNodeRect","nodeToUse","nodeWithPosition","updateNode","nodeUpdate","nextNode","getInternalNode","getElements","zoomLevel","currentPanZoom","nodeOrRect","nodesToIntersect","isRect","currNodeRect","_domNode","_snapGrid","domX","domY","correctedPosition","rendererPosition","dataUpdate","nextData","_nodeLookup","_nodeOrigin","lookup","contextNodeId","toolbarNodes","_offset","_position","_align","selectedNodesCount","isActive","$.action","$$node","$$action_arg","useNodesData","prevNodesData","initialRun","nextNodesData","isArrayOfIds","_nodeIds","componentName","Tinyflow","tinyflowEl","svelteFlowInstance","nodesInternal","edgesInternal","primary","rest","$.rest_props","$.noop","placeholder","buttonText","onChosen","onChange","activeIndex","handlerOnChange","div_1","$.set_class","on_click","on_keydown","activeKeys","$.proxy","handlerOnSelect","selectItems","node_4","expandAll","expandValue","onSelect","defaultValue","multiple","activeItemsState","resultItems","fillResult","triggerObject","consequent_4","round","createCoords","oppositeSideMap","oppositeAlignmentMap","evaluate","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","yAxisSides","getSideAxis","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","flipAlignment","direction","expandPaddingObject","getPaddingObject","rectToClientRect","computeCoordsFromPlacement","_ref","reference","floating","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","computePosition","config","strategy","middleware","platform","validMiddleware","statefulPlacement","middlewareData","resetCount","nextX","nextY","detectOverflow","_await$platform$isEle","rootBoundary","elementContext","altBoundary","paddingObject","clippingClientRect","offsetParent","offsetScale","elementClientRect","arrow","arrowDimensions","isYAxis","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","min$1","shouldAddOffset","flip","_middlewareData$arrow","_middlewareData$flip","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","initialSideAxis","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","placements","overflow","overflows","overflowsData","sides","_middlewareData$flip2","_overflowsData$filter","nextIndex","nextPlacement","resetPlacement","_overflowsData$filter2","currentSideAxis","originSides","convertValueToCoords","mainAxisMulti","crossAxisMulti","mainAxis","crossAxis","_middlewareData$offse","diffCoords","limiter","mainAxisCoord","crossAxisCoord","minSide","maxSide","limitedCoords","hasWindow","getNodeName","getWindow","_node$ownerDocument","getDocumentElement","isElement","isHTMLElement","isShadowRoot","invalidOverflowDisplayValues","isOverflowElement","overflowX","overflowY","display","getComputedStyle","tableElements","isTableElement","topLayerSelectors","isTopLayer","transformProperties","willChangeValues","containValues","isContainingBlock","elementOrCss","webkit","isWebKit","getContainingBlock","getParentNode","isLastTraversableNode","lastTraversableNodeNames","getNodeScroll","getNearestOverflowAncestor","getOverflowAncestors","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","getFrameElement","getCssDimensions","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","getWindowScrollBarX","leftScroll","getHTMLOffset","documentElement","scroll","ignoreScrollbarX","htmlRect","convertOffsetParentRelativeRectToViewportRelativeRect","topLayer","offsets","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","getViewportRect","visualViewport","visualViewportBased","absoluteOrFixed","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","hasFixedPositionAncestor","stopNode","getClippingElementAncestors","cache","cachedResult","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingRect","clippingAncestors","firstClippingAncestor","clippingRect","accRect","getRectRelativeToOffsetParent","setLeftRTLScrollbarOffset","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","getDimensionsFn","floatingDimensions","isRTL","offset$1","shift$1","flip$1","arrow$1","mergedOptions","platformWithCache","computePosition$1","createFloating","triggerEvent","floatContent","offsetOptions","flipOptions","shiftOptions","showArrow","triggerEl","floatContentEl","arrowElement","updatePosition","arrowX","arrowY","staticSide","visible","showTooltip","hideTooltip","onTrigger","hideTooltipCompute","contentEl","floatingInstance","hide","div_2","level","mt","mb","$$element","useDeleteNode","genShortId","chars","byte","useCopyNode","newNodeId","getOptions","getCurrentNodeId","on_change","updateNodeData","currentNodeId","icon","allowExecute","allowCopy","allowDelete","allowSetting","allowSettingOfCondition","showSourceHandle","showTargetHandle","onCollapse","getNode","deleteNode","copyNode","executeNode","$.set_checked","consequent_5","actionKeys","consequent_6","consequent_7","parameterDataTypes","parameterRefTypes","parameter","$node","updateParameter","parameters","updateName","updateRequired","updateDataType","dataType","handleDelete","fillParameterId","useAddParameter","dataKey","newParameter","addParameter","fillRefNodeIds","refNodeIds","getChildren","nodeIsChildren","nodeToOptions","outputDefs","useRefOptions","useChildrenOnly","cNode","resultOptions","nodeOptions","updateRefType","dataKeyName","updateParam","updateParamByEvent","updateRef","$selectItems","noneParameterText","deepClone","currentParameter","updateAttribute","updateByEvent","handleAddChildParameter","parameterList","on_input","on_input_1","on_input_2","llmArray","$.state","newLLMs","setOutType","$.user_effect","engines","knowledgeArray","searchEngines","StartNode","CodeNode","LLMNode","TemplateNode","HttpNode","KnowledgeNode","SearchEngineNode","LoopNode","EndNode","title","description","extra","showType","containerShowClass","baseNodes","tableItems","customNodes","userCustomNodes","hiddenNodes","hiddenNode","div_4","div_5","useGetNode","useEnsureParentInNodesBefore","parentNodeId","childNodeId","nodeArray","parentIndex","firstChildIndex","useGetEdgesByTarget","flowInstance","updateNodeDataInner","updateNodeDataByEvent","externalElement","customNode","forms","$.html","node_7","form","$.set_text","text_1","text_2","text_3","text_5","text_6","text_7","alternate_1","alternate_2","alternate_3","alternate_4","consequent_8","div_12","consequent_9","consequent_10","$.clsx","useUpdateEdgeData","useDeleteEdge","onInit","svelteFlow","showEdgePanel","currentEdge","updateEdgeData","onDragOver","onDrop","baseNodeJsonString","baseNode","conn","edgeSourceNode","ensureParentInNodesBefore","toNode","fromNode","fromHande","getEdgesByTarget","onDelete","nodeEdges","loopNode","hasSameParent","deleteEdge","customNodeTypes","CustomNode","onDataChange","__props","divRef","tinyflow","TinyflowNative","__expose","_createElementBlock"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAEA,SAASA,GAAQC,GAAK;AACpB,QAAMC,IAAsB,uBAAO,OAAO,IAAI;AAC9C,aAAWC,KAAOF,EAAI,MAAM,GAAG,EAAG,CAAAC,EAAIC,CAAG,IAAI;AAC7C,SAAO,CAACC,MAAQA,KAAOF;AACzB;AAEA,MAAMG,KAA4E,CAAA,GAC5EC,KAA4E,CAAA,GAI5EC,KAAO,CAACJ,MAAQA,EAAI,WAAW,CAAC,MAAM,OAAOA,EAAI,WAAW,CAAC,MAAM;AAAA,CACxEA,EAAI,WAAW,CAAC,IAAI,OAAOA,EAAI,WAAW,CAAC,IAAI,KAE1CK,KAAS,OAAO,QAOhBC,KAAiB,OAAO,UAAU,gBAClCC,KAAS,CAACN,GAAKD,MAAQM,GAAe,KAAKL,GAAKD,CAAG,GACnDQ,KAAU,MAAM,SAChBC,KAAQ,CAACR,MAAQS,GAAaT,CAAG,MAAM,gBAIvCU,KAAa,CAACV,MAAQ,OAAOA,KAAQ,YACrCW,KAAW,CAACX,MAAQ,OAAOA,KAAQ,UACnCY,KAAW,CAACZ,MAAQ,OAAOA,KAAQ,UACnCa,KA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A,WAAA,CAAA,GAAS2kE,IAAA74B,EAAA9rC,GAAA,UAAA,CAAA;QAIX,MAAA3a,EAAA,IAASlL,EAAA;AACJ,MAAA,OAAAkL,KAAS;AACZ,QAAA;AACA,MAAAA,IAAO,KAAK,MAAMA,EAAK,KAAA,CAAA;AAAA,IAC3B,QAAY;AACR,cAAQ,MAAM,sBAAsBA,CAAI;AAAA,IAC5C;AAEJ,SAAA0iB,GAAM,MAAM1iB,KAAA,gBAAAA,EAAuB,UAAA,CAAA,IAAcA,KAAA,gBAAAA,EAAuB,UAAA,EAAA,GACxEY,GAAW,oBAAoB9L,GAAO;;;;;;;;;;;;;;;;;;;;;;;;AAC1C;;;;;;;;;;;;;;;AChBA,UAAM6B,IAAQmqF,GAORC,IAAS5tF,GAA2B,IAAI;AAC9C,QAAI6tF,IAAkC;AAEtC,WAAAtrF,GAAU,MAAM;AACd,MAAIqrF,EAAO,UACTC,IAAW,IAAIC,GAAe;AAAA,QAC5B,GAAGtqF;AAAA,QACH,SAASoqF,EAAO;AAAA,MAAA,CACjB;AAAA,IAEL,CAAC,GAEDprF,GAAY,MAAM;AAChB,MAAIqrF,MACFA,EAAS,QAAA,GACTA,IAAW;AAAA,IAEf,CAAC,GAUDE,EAAa;AAAA,MACX,SATc,MACVF,IACKA,EAAS,QAAA,KAElB,QAAQ,KAAK,sCAAsC,GAC5C;AAAA,IAIP,CACD,oBA7CCG,GAAoE,OAAA;AAAA,eAA3D;AAAA,MAAJ,KAAIJ;AAAA,MAAU,uBAAoB3+B,EAAAA,SAAS,CAAA;AAAA,MAAI,UAAOpqD,EAAAA,KAAK;AAAA,IAAA;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,233,234,235,236]}