@samyx/preview-stacks-ui 0.22.0 → 0.23.0
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.
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-D06apM-6.js → ActionButton.vue_vue_type_script_setup_true_lang-CeingrPV.js} +2 -2
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-D06apM-6.js.map → ActionButton.vue_vue_type_script_setup_true_lang-CeingrPV.js.map} +1 -1
- package/dist/assets/{AxesTab-CCB3wdSX.js → AxesTab-vIQWJMZm.js} +2 -2
- package/dist/assets/{AxesTab-CCB3wdSX.js.map → AxesTab-vIQWJMZm.js.map} +1 -1
- package/dist/assets/{ConfigTab-Cyqzeq3C.js → ConfigTab-BeAIDTnl.js} +2 -2
- package/dist/assets/{ConfigTab-Cyqzeq3C.js.map → ConfigTab-BeAIDTnl.js.map} +1 -1
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-CtwJE2eJ.js → ConflictNote.vue_vue_type_script_setup_true_lang-fprimIle.js} +2 -2
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-CtwJE2eJ.js.map → ConflictNote.vue_vue_type_script_setup_true_lang-fprimIle.js.map} +1 -1
- package/dist/assets/{DangerTab-Cdr9luUy.js → DangerTab-CcYJAftw.js} +2 -2
- package/dist/assets/{DangerTab-Cdr9luUy.js.map → DangerTab-CcYJAftw.js.map} +1 -1
- package/dist/assets/{DashboardView-S4eiNX8X.js → DashboardView-Cvh03qbj.js} +2 -2
- package/dist/assets/{DashboardView-S4eiNX8X.js.map → DashboardView-Cvh03qbj.js.map} +1 -1
- package/dist/assets/{DeploymentDetailView-CD4RVr06.js → DeploymentDetailView-BzEQBKhd.js} +2 -2
- package/dist/assets/{DeploymentDetailView-CD4RVr06.js.map → DeploymentDetailView-BzEQBKhd.js.map} +1 -1
- package/dist/assets/{DeploymentsView-DIX7IA8g.js → DeploymentsView-f3RgqUkQ.js} +2 -2
- package/dist/assets/{DeploymentsView-DIX7IA8g.js.map → DeploymentsView-f3RgqUkQ.js.map} +1 -1
- package/dist/assets/{EquivalentCommand-NHzDrg5d.js → EquivalentCommand-D0Bfgz63.js} +3 -3
- package/dist/assets/{EquivalentCommand-NHzDrg5d.js.map → EquivalentCommand-D0Bfgz63.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BFuRxw1l.js → ErrorNote.vue_vue_type_script_setup_true_lang-DT5SbSbT.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BFuRxw1l.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-DT5SbSbT.js.map} +1 -1
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-DwwXY7EX.js → HelpModal.vue_vue_type_script_setup_true_lang-2ev6wLk8.js} +2 -2
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-DwwXY7EX.js.map → HelpModal.vue_vue_type_script_setup_true_lang-2ev6wLk8.js.map} +1 -1
- package/dist/assets/JobDetailView-B5OFSqGO.js +2 -0
- package/dist/assets/{JobDetailView-BsCnnkPz.js.map → JobDetailView-B5OFSqGO.js.map} +1 -1
- package/dist/assets/{JobsView-Bd_XHRkd.js → JobsView-B6RvX8WS.js} +2 -2
- package/dist/assets/{JobsView-Bd_XHRkd.js.map → JobsView-B6RvX8WS.js.map} +1 -1
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-7Ggcxz1R.js → LogViewer.vue_vue_type_script_setup_true_lang-B5K26k3c.js} +3 -3
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-7Ggcxz1R.js.map → LogViewer.vue_vue_type_script_setup_true_lang-B5K26k3c.js.map} +1 -1
- package/dist/assets/{LoginView-Bj7uMFvv.js → LoginView-NzylzAuv.js} +2 -2
- package/dist/assets/{LoginView-Bj7uMFvv.js.map → LoginView-NzylzAuv.js.map} +1 -1
- package/dist/assets/{LogsTab-DRp76oC1.js → LogsTab-DxhpYJY3.js} +3 -3
- package/dist/assets/{LogsTab-DRp76oC1.js.map → LogsTab-DxhpYJY3.js.map} +1 -1
- package/dist/assets/{NotFoundView-D-A8YFJw.js → NotFoundView-Cg_jPEQi.js} +2 -2
- package/dist/assets/{NotFoundView-D-A8YFJw.js.map → NotFoundView-Cg_jPEQi.js.map} +1 -1
- package/dist/assets/{NotifiersView-CChDRHSy.js → NotifiersView-B53fERhd.js} +2 -2
- package/dist/assets/{NotifiersView-CChDRHSy.js.map → NotifiersView-B53fERhd.js.map} +1 -1
- package/dist/assets/{OverviewTab-jE_kOZI7.js → OverviewTab-Cy7_mGTt.js} +2 -2
- package/dist/assets/{OverviewTab-jE_kOZI7.js.map → OverviewTab-Cy7_mGTt.js.map} +1 -1
- package/dist/assets/{RegistriesView-D3Nh0dbq.js → RegistriesView-dc-04uci.js} +2 -2
- package/dist/assets/{RegistriesView-D3Nh0dbq.js.map → RegistriesView-dc-04uci.js.map} +1 -1
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-mVrRpkV_.js → RelativeTime.vue_vue_type_script_setup_true_lang-D7n5E9jw.js} +2 -2
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-mVrRpkV_.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-D7n5E9jw.js.map} +1 -1
- package/dist/assets/{RequiresTab-BgGIZ1Tn.js → RequiresTab-DDWsrZig.js} +2 -2
- package/dist/assets/{RequiresTab-BgGIZ1Tn.js.map → RequiresTab-DDWsrZig.js.map} +1 -1
- package/dist/assets/{RoutingView-D2StZawf.js → RoutingView-BheJjs2g.js} +3 -3
- package/dist/assets/{RoutingView-D2StZawf.js.map → RoutingView-BheJjs2g.js.map} +1 -1
- package/dist/assets/RuntimeTab-D4sJaoqc.js +2 -0
- package/dist/assets/RuntimeTab-D4sJaoqc.js.map +1 -0
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-qGkx2MwW.js → SelectMenu.vue_vue_type_script_setup_true_lang-CSQS6ben.js} +2 -2
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-qGkx2MwW.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-CSQS6ben.js.map} +1 -1
- package/dist/assets/SettingsView-CQIMBeQh.js +2 -0
- package/dist/assets/{SettingsView-Cu1Zkufg.js.map → SettingsView-CQIMBeQh.js.map} +1 -1
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-BYHXRCNR.js → SkeletonList.vue_vue_type_script_setup_true_lang-DwoeliUC.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-BYHXRCNR.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-DwoeliUC.js.map} +1 -1
- package/dist/assets/{SpecDetailView-DIi21wo1.js → SpecDetailView-DSlpITFw.js} +2 -2
- package/dist/assets/{SpecDetailView-DIi21wo1.js.map → SpecDetailView-DSlpITFw.js.map} +1 -1
- package/dist/assets/{SpecsView-B49LI4Ut.js → SpecsView-Cq_Ny0u3.js} +2 -2
- package/dist/assets/{SpecsView-B49LI4Ut.js.map → SpecsView-Cq_Ny0u3.js.map} +1 -1
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-DANvveJ6.js → StateBadge.vue_vue_type_script_setup_true_lang-BsDpZsUH.js} +2 -2
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-DANvveJ6.js.map → StateBadge.vue_vue_type_script_setup_true_lang-BsDpZsUH.js.map} +1 -1
- package/dist/assets/{SubmitView-ZYGApCXE.js → SubmitView-DqOEabaL.js} +5 -5
- package/dist/assets/{SubmitView-ZYGApCXE.js.map → SubmitView-DqOEabaL.js.map} +1 -1
- package/dist/assets/{Teleport-d5PoAxFM.js → Teleport-BXE_6A8N.js} +3 -3
- package/dist/assets/{Teleport-d5PoAxFM.js.map → Teleport-BXE_6A8N.js.map} +1 -1
- package/dist/assets/{TerminalTab-DAZpn3jK.js → TerminalTab-lb8FY01Y.js} +2 -2
- package/dist/assets/{TerminalTab-DAZpn3jK.js.map → TerminalTab-lb8FY01Y.js.map} +1 -1
- package/dist/assets/{UsersView-BfQKf8Sf.js → UsersView-mOC1UteJ.js} +2 -2
- package/dist/assets/{UsersView-BfQKf8Sf.js.map → UsersView-mOC1UteJ.js.map} +1 -1
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-D--Rd-Mv.js → VarEditor.vue_vue_type_script_setup_true_lang-ChzmZbEl.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-D--Rd-Mv.js.map → VarEditor.vue_vue_type_script_setup_true_lang-ChzmZbEl.js.map} +1 -1
- package/dist/assets/{VariablesView-Bej9ZZmS.js → VariablesView-NBIFfXQ5.js} +2 -2
- package/dist/assets/{VariablesView-Bej9ZZmS.js.map → VariablesView-NBIFfXQ5.js.map} +1 -1
- package/dist/assets/{index-DVCVnKbf.js → index-wjzRhuU3.js} +4 -4
- package/dist/assets/{index-DVCVnKbf.js.map → index-wjzRhuU3.js.map} +1 -1
- package/dist/assets/{useDeployment-752fTjLE.js → useDeployment-B7kMYmcq.js} +2 -2
- package/dist/assets/{useDeployment-752fTjLE.js.map → useDeployment-B7kMYmcq.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/JobDetailView-BsCnnkPz.js +0 -2
- package/dist/assets/RuntimeTab-B0D_MxFQ.js +0 -2
- package/dist/assets/RuntimeTab-B0D_MxFQ.js.map +0 -1
- package/dist/assets/SettingsView-Cu1Zkufg.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitView-ZYGApCXE.js","sources":["../../src/views/SubmitView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Submit or replace a deployment.\n *\n * The server's 400 is the whole point of this screen. It carries the SpecError verbatim — the key\n * or variable that is wrong, often the corrected form, and the assert-lint warnings about an\n * `assert_gone` that fails open. That text is the tool's main teaching surface, so it is rendered\n * whole, with newlines intact, and never summarised.\n *\n * The spec is parsed BEFORE anything touches disk, so a rejected submission leaves nothing behind\n * and, on a replace, a good record is never destroyed over a typo.\n */\nimport { computed, ref, watch } from 'vue';\nimport { useRoute } from 'vue-router';\nimport { api, problem } from '../api/client';\nimport InfoHint from '../components/InfoHint.vue';\nimport type {\n DeploymentSourceResponse,\n SpecMeta,\n SpecsResponse,\n SubmitResponse,\n VarPair,\n} from '../api/types';\nimport { loadDeployments, rowFor } from '../composables/useControlPlane';\nimport { pairsFromRecord, readVars, recordFromPairs, writeVars } from '../composables/useVars';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport VarEditor from '../components/VarEditor.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst props = defineProps<{ id?: string }>();\n\nconst form = ref({ id: props.id ?? '', spec: '', compose: '' });\nconst vars = ref<VarPair[]>([{ k: '', v: '' }]);\nconst source = ref<'inline' | 'stored'>('inline');\nconst specName = ref('');\n\nconst submitting = ref(false);\nconst error = ref('');\nconst result = ref<{\n id: string;\n stack: string;\n created: boolean;\n /** Other deployments resolving to the same stack — reported by the server on a new deployment. */\n stackSharedWith?: string[];\n} | null>(null);\n\n/**\n * Stored specs, when this server has them. A build without `/api/specs` answers 404, which is not\n * an error here — the picker simply is not offered and inline stays the only shape.\n */\nconst specs = ref<SpecMeta[]>([]);\n\n/** `— choose —` stays first: an empty value is a real state here, not a placeholder. */\nconst specOptions = computed(() => [\n { value: '', label: '— choose —' },\n ...specs.value.map((s) => ({ value: s.name, label: s.name, hint: s.kind })),\n]);\nvoid api.get<SpecsResponse>('/api/specs').then((r) => {\n if (r.ok && Array.isArray(r.body.specs)) specs.value = r.body.specs;\n});\n\nconst chosenSpec = computed(() => specs.value.find((s) => s.name === specName.value));\n\nconst replacing = computed(() => !!props.id);\n\n/**\n * Duplicate mode: `/submit?from=<id>` copies an existing deployment's spec, compose and variables into\n * a NEW submission. Distinct from replacing — the id starts empty so you name the new one, and nothing\n * is written over.\n *\n * The `stack:` line is the thing to watch, which is why the banner says so: copy a spec whose stack is a\n * literal and both deployments drive the same compose project, so `down` on either stops the other's\n * containers. A spec whose stack interpolates a variable (`pr-${PR}`) just needs a different value. The\n * server independently reports a collision at submit time — see `stackSharedWith`.\n */\nconst route = useRoute();\nconst copyFrom = computed(() => {\n const v = route.query.from;\n return typeof v === 'string' && v ? v : null;\n});\n\n/**\n * Replacing now PRE-FILLS from what is stored.\n *\n * It used to start empty, because nothing could hand the source back. Replacing is whole-record, so\n * an operator retyping a spec from memory silently dropped whatever they forgot — and a dropped axis\n * stops being tracked while the resources it created keep running. Being unable to read your own\n * submission is what made that a likely mistake rather than a careless one.\n *\n * The body is still cleared FIRST, on every id change. A leftover body from another deployment is the\n * dangerous case: it is perfectly valid YAML, so the PUT would succeed and overwrite the wrong\n * deployment with nothing able to catch it. Clearing first means a failed or withheld fetch leaves the\n * form empty rather than holding someone else's spec.\n */\nconst sourceState = ref<'idle' | 'loading' | 'loaded' | 'withheld' | 'failed'>('idle');\n/** Set when this deployment tracks a stored spec — editing this copy forks it from the original. */\nconst forkWarning = ref<string | null>(null);\n\nasync function loadSource(id: string): Promise<void> {\n sourceState.value = 'loading';\n forkWarning.value = null;\n const r = await api.getAuthed<DeploymentSourceResponse>(\n `/api/deployments/${encodeURIComponent(id)}/source`,\n );\n // A build of the API without the route answers 404; that is a capability difference, not an error,\n // and it must land on the old empty-form behaviour rather than an alarming banner.\n if (r.status === 404 || !r.ok) {\n sourceState.value = 'failed';\n return;\n }\n if (r.body.sourceWithheld) {\n sourceState.value = 'withheld';\n if (r.body.specName) forkWarning.value = r.body.specName;\n return;\n }\n // Only fill if the user has not started typing — a slow fetch must never overwrite their edit.\n if (!form.value.spec) form.value.spec = r.body.spec ?? '';\n if (!form.value.compose) form.value.compose = r.body.compose ?? '';\n if (r.body.specName) forkWarning.value = r.body.specName;\n sourceState.value = 'loaded';\n}\n\n// Duplicate: same fetch, but the id stays empty and the variables come across too, since a copied\n// spec interpolates the same names.\nwatch(\n copyFrom,\n async (from) => {\n if (!from || props.id) return;\n error.value = '';\n result.value = null;\n form.value.spec = '';\n form.value.compose = '';\n const saved = rowFor(from)?.vars;\n if (saved) vars.value = pairsFromRecord(saved);\n await loadSource(from);\n // A copied record's own id is not a name for the new one; the operator picks that.\n form.value.id = '';\n },\n { immediate: true },\n);\n\nwatch(\n () => props.id,\n (id) => {\n error.value = '';\n result.value = null;\n sourceState.value = 'idle';\n forkWarning.value = null;\n if (!id) return;\n if (id !== form.value.id) {\n form.value.spec = '';\n form.value.compose = '';\n }\n form.value.id = id;\n // Seed the variables from what this deployment already uses: replacing a spec usually needs\n // the same ones that resolved it.\n const stored = rowFor(id)?.vars;\n const saved = stored ? pairsFromRecord(stored) : readVars(id);\n if (saved.some((e) => e.k)) vars.value = saved;\n void loadSource(id);\n },\n { immediate: true },\n);\n\nconst canSubmit = computed(\n () =>\n !!form.value.id &&\n (source.value === 'stored' ? !!specName.value : !!form.value.spec.trim()) &&\n !submitting.value,\n);\n\nasync function submit(): Promise<void> {\n submitting.value = true;\n error.value = '';\n result.value = null;\n\n const id = form.value.id;\n const record = recordFromPairs(vars.value);\n /**\n * `vars` are STORED with the deployment on servers that support it, which makes a later `down`\n * resolve the same stack `up` created with no query parameters at all. `env` validates this\n * submission on every server, new or old. Sending both is what keeps this form working against\n * either build — an older server ignores the key it does not know.\n */\n const body: Record<string, unknown> = { vars: record, env: record };\n if (source.value === 'stored') body.specName = specName.value;\n else {\n body.spec = form.value.spec;\n if (form.value.compose.trim()) body.compose = form.value.compose;\n }\n\n const r = await api.put<SubmitResponse>(`/api/deployments/${encodeURIComponent(id)}`, body);\n submitting.value = false;\n\n if (r.status === 200 || r.status === 201) {\n result.value = {\n id: r.body.id ?? id,\n stack: r.body.stack ?? '?',\n created: r.status === 201,\n stackSharedWith: r.body.stackSharedWith,\n };\n // Persist the variables that just validated this spec. On an older server this is the single\n // thing keeping a later `down` pointed at the stack the `up` created.\n writeVars(id, vars.value);\n void loadDeployments();\n toast('ok', `${r.status === 201 ? 'Created' : 'Replaced'} ${id} → ${result.value.stack}`, {\n to: `/deployments/${encodeURIComponent(id)}`,\n toLabel: 'Open',\n });\n return;\n }\n // 400 (SpecError), 409 (a job in flight over this stack), 401, 404 — all rendered verbatim.\n error.value = problem(r, 'save this deployment');\n}\n\n/**\n * The preview domain, guessed from where this page is served.\n *\n * The UI lives on a host UNDER the preview domain (ui.preview.example.com, pstack.preview…), so\n * previews live beside it: drop this page's own first label and that is the base every generated\n * hostname hangs off. localhost and bare IPs have no domain to offer — those keep an honest\n * placeholder rather than generating `pr-123.192.168.1.5`.\n */\nfunction detectPreviewDomain(): string {\n const h = location.hostname;\n if (h === 'localhost' || h.endsWith('.localhost') || /^[\\d.]+$/.test(h) || h.includes(':')) {\n return 'preview.example.com';\n }\n const labels = h.split('.');\n return labels.length >= 3 ? labels.slice(1).join('.') : h;\n}\n\n/**\n * Kept as a function of the domain so the example is true on the host it is loaded on — a spec\n * copied from here should deploy without edits, not after find-and-replacing example.com.\n *\n * The compose half uses `pstack.routing.port`, NOT hand-written traefik labels: pstack generates\n * the router, TLS and network wiring from that one label. A bare `traefik.enable=true` is the\n * OPT-OUT signal (any traefik.* label means \"leave my service alone\") — which is what an older\n * version of this example taught, producing a service that was never reachable.\n */\nconst exampleSpec = (domain: string): string => `version: 1\nkind: isolated\n\n# The stack identity: the compose project name, and $STACK inside every hook.\n# \\${PR} is interpolated ONCE, at resolve time, from the variables sent with the request.\nstack: pr-\\${PR}\n\nenv:\n # The base every generated hostname hangs off: the app below is served at\n # app-pr-\\${PR}.${domain}\n PREVIEW_DOMAIN: ${domain}\n\ncompose:\n file: compose.yml\n # Every service sits behind a profile so a bare \\`up\\` starts nothing.\n # \\`down\\` always enables ALL of them — otherwise the unselected profiles' network leaks.\n profiles: [app]\n\nrequires:\n - name: traefik-network\n assert: docker network inspect traefik >/dev/null 2>&1\n hint: run \\`pstack init\\` on the host first\n\naxes:\n # Hooks run from the deployment directory, which holds only spec.yml and compose.yml —\n # so use inline shell or absolute paths, never ./hooks/foo.sh.\n - name: scratch\n up: mkdir -p /tmp/$STACK\n assert_live: test -d /tmp/$STACK\n down: rm -rf /tmp/$STACK\n # assert_gone MUST FAIL CLOSED. A bare \\`! <probe>\\` reports \"gone\" whenever the probe fails\n # for any reason — a missing CLI, an expired token — turning \"I could not tell\" into\n # \"it is gone\", a false negative on the one thing this tool exists to catch.\n assert_gone: |\n test -d /tmp || exit 1\n ! test -d /tmp/$STACK\n`;\n\nconst EXAMPLE_COMPOSE = `services:\n app:\n image: nginx:alpine\n profiles: [app]\n labels:\n # The ONE label routing needs: pstack generates the Traefik router, TLS and network wiring\n # from it. Writing any traefik.* label yourself is the opt-out — pstack then leaves the\n # service entirely alone, so only do that when you need something the shorthand cannot say.\n - pstack.routing.port=80\n`;\n\nfunction loadExample(): void {\n source.value = 'inline';\n form.value.spec = exampleSpec(detectPreviewDomain());\n if (!form.value.compose.trim()) form.value.compose = EXAMPLE_COMPOSE;\n if (!form.value.id) form.value.id = 'pr-123';\n if (!vars.value.some((e) => e.k)) vars.value = [{ k: 'PR', v: '123' }];\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>\n {{ replacing ? 'Edit a deployment' : copyFrom ? 'Duplicate a deployment' : 'Submit a deployment' }}\n </h1>\n <div class=\"sub\">\n {{\n replacing\n ? 'Loaded from what is stored; saving replaces the record'\n : copyFrom\n ? `Copied from ${copyFrom} — give it a new id, then edit`\n : 'Stores a spec so it can be deployed'\n }}\n </div>\n </div>\n <span class=\"grow\" />\n <button class=\"ghost\" @click=\"loadExample\">Load example spec</button>\n </div>\n\n <section class=\"panel\">\n <!-- The \"nothing saved until valid\" reassurance lives beside the Submit button below — the\n moment of commitment is where a guarantee about committing belongs, not floating above\n an unrelated id field. -->\n\n <!--\n A `PUT` REPLACES the whole record, and this form cannot pre-fill it: the API has no route\n that returns a stored spec. Say that out loud, because a half-remembered spec pasted here\n is still valid YAML — the server will accept it, and the axes the original declared simply\n stop existing as far as the control plane knows, while whatever they created keeps running.\n -->\n <!--\n The one thing that makes duplicating dangerous, said before the form rather than after the\n submission: two records resolving to one stack drive the same compose project.\n -->\n <div v-if=\"copyFrom && !replacing\" class=\"banner warn\">\n <b>Change the stack, not just the id.</b>\n <p>\n Two deployments that resolve to the same <code>stack</code> drive the same compose project —\n <code>down</code> on either stops the other's containers. If the stack interpolates a variable\n (<code>pr-${PR}</code>) give it a different value below; if it is a literal, edit the\n <code>stack:</code> line.\n <template v-if=\"sourceState === 'withheld'\">\n The spec could not be copied without an access token —\n <RouterLink to=\"/settings\">add yours</RouterLink>.\n </template>\n </p>\n </div>\n\n <div v-if=\"replacing\" class=\"banner\" :class=\"sourceState === 'loaded' ? 'info' : 'warn'\">\n <b>Replacing {{ id }}.</b>\n <p v-if=\"sourceState === 'loading'\">Loading what is stored…</p>\n <p v-else-if=\"sourceState === 'loaded'\">\n Loaded from the stored record — edit it and save. Saving replaces the record outright, so\n anything you delete here stops being tracked while whatever it created keeps running.\n </p>\n <p v-else-if=\"sourceState === 'withheld'\">\n The stored spec was not loaded: reading it needs an access token, because hooks routinely\n carry a credential inline. <RouterLink to=\"/settings\">Add your token</RouterLink> to edit\n in place — otherwise paste the <b>complete</b> spec, since anything you leave out stops\n being tracked.\n </p>\n <p v-else>\n The stored spec could not be loaded, so this form is empty. Paste the <b>complete</b> spec\n you want stored — anything you leave out stops being tracked while whatever it created keeps\n running.\n </p>\n </div>\n\n <!--\n A deployment that references a stored spec keeps its own copy of the source. Editing that copy\n forks it: the stored spec every other deployment shares is untouched, and this one stops\n following it. Silent forks are the kind of thing discovered months later.\n -->\n <div v-if=\"forkWarning\" class=\"banner warn\">\n <b>This deployment tracks the stored spec “{{ forkWarning }}”.</b>\n <p>\n Saving here writes a private copy and stops it following that spec. To change every\n deployment using it, edit\n <RouterLink :to=\"`/specs/${encodeURIComponent(forkWarning)}`\">the spec</RouterLink> instead.\n </p>\n </div>\n\n <div class=\"row\" style=\"margin-bottom: var(--s4)\">\n <div class=\"field\" style=\"max-width: 280px\">\n <label for=\"did\">Deployment id</label>\n <input\n id=\"did\"\n v-model.trim=\"form.id\"\n type=\"text\"\n placeholder=\"pr-123\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <span class=\"mute\" style=\"align-self: end; padding-bottom: 10px\">\n Lower case\n <InfoHint label=\"allowed characters in a deployment id\">\n Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64\n characters — <code>[a-z0-9][a-z0-9._-]{0,63}</code>.\n </InfoHint>\n </span>\n </div>\n\n <!-- Offered only when this server actually has stored specs. -->\n <div v-if=\"specs.length\" class=\"row\" style=\"margin-bottom: var(--s4)\">\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"inline\" /> inline spec\n </label>\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"stored\" /> reference a stored spec\n </label>\n </div>\n\n <template v-if=\"source === 'stored' && specs.length\">\n <div class=\"field\" style=\"max-width: 340px\">\n <label for=\"sn\">Stored spec</label>\n <SelectMenu v-model=\"specName\" id=\"sn\" label=\"Stored spec\" :options=\"specOptions\" />\n </div>\n <p v-if=\"chosenSpec\" class=\"hint\">\n <span v-if=\"chosenSpec.description\">{{ chosenSpec.description }} — </span>\n needs\n <b v-if=\"chosenSpec.requiredVars.length\">{{ chosenSpec.requiredVars.join(', ') }}</b>\n <span v-else>no variables</span>.\n <InfoHint label=\"why variables are required\">\n A missing variable is refused by name. It is never filled in with a blank, which would\n silently give every deployment the same stack name.\n </InfoHint>\n </p>\n </template>\n\n <template v-else>\n <div class=\"field\">\n <label for=\"spec\">Spec.yml</label>\n <textarea\n id=\"spec\"\n v-model=\"form.spec\"\n rows=\"12\"\n spellcheck=\"false\"\n placeholder=\"version: 1 kind: isolated stack: pr-${PR} axes: []\"\n />\n </div>\n\n <div class=\"field\" style=\"margin-top: var(--s3)\">\n <label for=\"compose\">compose.yml <span class=\"mute\">(optional)</span></label>\n <textarea\n id=\"compose\"\n v-model=\"form.compose\"\n rows=\"6\"\n spellcheck=\"false\"\n placeholder=\"Written next to spec.yml, so a compose file named compose.yml resolves\"\n />\n </div>\n <p class=\"hint\">\n Hooks must be inline shell or an absolute path.\n <InfoHint label=\"why a relative script path does not work\">\n A deployment directory only ever holds <code>spec.yml</code> and\n <code>compose.yml</code>, and hooks run from there — so\n <code>up: ./hooks/db.sh</code> has nothing to find.\n </InfoHint>\n </p>\n </template>\n\n <h2 class=\"section\" style=\"margin: var(--s5) 0 var(--s3)\">Variables</h2>\n <VarEditor v-model=\"vars\" />\n <p class=\"hint\">\n Saved with the deployment, so tearing it down later targets the same stack.\n <InfoHint label=\"how variables are remembered\">\n They are stored on the server where it supports that, and in this browser either way — so\n the actions on the deployment page send exactly these values.\n </InfoHint>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s5)\">\n <ActionButton variant=\"primary\" :pending=\"submitting\" :disabled=\"!canSubmit\" @click=\"submit\">\n {{ submitting ? 'Submitting…' : 'Submit' }}\n </ActionButton>\n <span v-if=\"!result\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n Nothing is saved until the spec is valid\n <InfoHint label=\"what happens on a rejected submission\">\n The spec is checked before anything is written, so a rejected submission leaves nothing\n behind — and a replace never destroys a good record over a typo. Whether the deployment\n is shared or isolated comes from the spec, not from this form.\n </InfoHint>\n </span>\n <span v-if=\"result\" class=\"s-ok\">\n {{ result.created ? 'Created' : 'Replaced' }} — stack\n <b>{{ result.stack }}</b>\n <RouterLink :to=\"`/deployments/${encodeURIComponent(result.id)}`\" style=\"margin-left: 8px\">\n open →\n </RouterLink>\n </span>\n </div>\n\n <!--\n The server's rejection text IS the documentation: it names the key, the variable or the\n assert that is wrong, and often prints the corrected form. Rendered whole, newlines and\n indentation intact. Never truncate it, never collapse it, never say \"invalid spec\".\n -->\n <!--\n Reported by the server, which resolved every other deployment to check. Shown after the fact\n because it can only be known once the spec has resolved — and it is a warning, not a rejection:\n it can be deliberate, and refusing over a guess would be worse than saying so.\n -->\n <div v-if=\"result?.stackSharedWith?.length\" class=\"banner warn\">\n <b>Another deployment already resolves to stack “{{ result.stack }}”.</b>\n <p>\n <template v-for=\"(o, i) in result.stackSharedWith\" :key=\"o\">\n <RouterLink :to=\"`/deployments/${encodeURIComponent(o)}`\">{{ o }}</RouterLink\n ><span v-if=\"i < result.stackSharedWith.length - 1\">, </span> </template\n >— both records now drive the same compose project, so <code>down</code> on either stops the\n other's containers and <code>verify</code> on either reports the other's leaks. If that was not\n intended, change this one's <code>stack</code> and save again.\n </p>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"The server rejected this submission.\" />\n </section>\n </div>\n</template>\n"],"names":["EXAMPLE_COMPOSE","props","__props","form","ref","vars","source","specName","submitting","error","result","specs","specOptions","computed","api","r","chosenSpec","replacing","route","useRoute","copyFrom","v","sourceState","forkWarning","loadSource","id","watch","from","saved","_a","rowFor","pairsFromRecord","stored","readVars","e","canSubmit","submit","record","recordFromPairs","body","writeVars","loadDeployments","toast","problem","detectPreviewDomain","h","labels","exampleSpec","domain","loadExample","_createElementBlock","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_openBlock","_hoisted_4","_cache","_Fragment","_createVNode","_component_RouterLink","_normalizeClass","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","$event","_hoisted_12","InfoHint","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","SelectMenu","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_21","_vModelText","_hoisted_22","_hoisted_23","VarEditor","_hoisted_24","_hoisted_25","ActionButton","_hoisted_26","_hoisted_27","_b","_hoisted_28","o","i","_createBlock","ErrorNote"],"mappings":"k8CAyRMA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mDA1PxB,MAAMC,EAAQC,EAERC,EAAOC,EAAI,C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AAO,gBAAgB,OAAM,GAA7C8C,EAAA,EAAAN,EAA4D,UAAT,IAAE,yCACvD,yDAAsD,EAAA,GAAAQ,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAP,EAAiB,YAAX,OAAI,EAAA,mBAAO,+CACjD,EAAA,GAAAO,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAP,EAAmB,YAAb,SAAM,EAAA,mBAAO,qFACd,EAAA,GAAAO,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAP,EAAkB,YAAZ,QAAK,EAAA,mBAAO,oBAChD,EAAA,EAAA,eAGe1C,EAAA,WAAjBoF,EAAqFC,GAAA,OAA5D,KAAMrF,EAAA,MAAO,MAAM,sCAAA"}
|
|
1
|
+
{"version":3,"file":"SubmitView-DqOEabaL.js","sources":["../../src/views/SubmitView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Submit or replace a deployment.\n *\n * The server's 400 is the whole point of this screen. It carries the SpecError verbatim — the key\n * or variable that is wrong, often the corrected form, and the assert-lint warnings about an\n * `assert_gone` that fails open. That text is the tool's main teaching surface, so it is rendered\n * whole, with newlines intact, and never summarised.\n *\n * The spec is parsed BEFORE anything touches disk, so a rejected submission leaves nothing behind\n * and, on a replace, a good record is never destroyed over a typo.\n */\nimport { computed, ref, watch } from 'vue';\nimport { useRoute } from 'vue-router';\nimport { api, problem } from '../api/client';\nimport InfoHint from '../components/InfoHint.vue';\nimport type {\n DeploymentSourceResponse,\n SpecMeta,\n SpecsResponse,\n SubmitResponse,\n VarPair,\n} from '../api/types';\nimport { loadDeployments, rowFor } from '../composables/useControlPlane';\nimport { pairsFromRecord, readVars, recordFromPairs, writeVars } from '../composables/useVars';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport VarEditor from '../components/VarEditor.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst props = defineProps<{ id?: string }>();\n\nconst form = ref({ id: props.id ?? '', spec: '', compose: '' });\nconst vars = ref<VarPair[]>([{ k: '', v: '' }]);\nconst source = ref<'inline' | 'stored'>('inline');\nconst specName = ref('');\n\nconst submitting = ref(false);\nconst error = ref('');\nconst result = ref<{\n id: string;\n stack: string;\n created: boolean;\n /** Other deployments resolving to the same stack — reported by the server on a new deployment. */\n stackSharedWith?: string[];\n} | null>(null);\n\n/**\n * Stored specs, when this server has them. A build without `/api/specs` answers 404, which is not\n * an error here — the picker simply is not offered and inline stays the only shape.\n */\nconst specs = ref<SpecMeta[]>([]);\n\n/** `— choose —` stays first: an empty value is a real state here, not a placeholder. */\nconst specOptions = computed(() => [\n { value: '', label: '— choose —' },\n ...specs.value.map((s) => ({ value: s.name, label: s.name, hint: s.kind })),\n]);\nvoid api.get<SpecsResponse>('/api/specs').then((r) => {\n if (r.ok && Array.isArray(r.body.specs)) specs.value = r.body.specs;\n});\n\nconst chosenSpec = computed(() => specs.value.find((s) => s.name === specName.value));\n\nconst replacing = computed(() => !!props.id);\n\n/**\n * Duplicate mode: `/submit?from=<id>` copies an existing deployment's spec, compose and variables into\n * a NEW submission. Distinct from replacing — the id starts empty so you name the new one, and nothing\n * is written over.\n *\n * The `stack:` line is the thing to watch, which is why the banner says so: copy a spec whose stack is a\n * literal and both deployments drive the same compose project, so `down` on either stops the other's\n * containers. A spec whose stack interpolates a variable (`pr-${PR}`) just needs a different value. The\n * server independently reports a collision at submit time — see `stackSharedWith`.\n */\nconst route = useRoute();\nconst copyFrom = computed(() => {\n const v = route.query.from;\n return typeof v === 'string' && v ? v : null;\n});\n\n/**\n * Replacing now PRE-FILLS from what is stored.\n *\n * It used to start empty, because nothing could hand the source back. Replacing is whole-record, so\n * an operator retyping a spec from memory silently dropped whatever they forgot — and a dropped axis\n * stops being tracked while the resources it created keep running. Being unable to read your own\n * submission is what made that a likely mistake rather than a careless one.\n *\n * The body is still cleared FIRST, on every id change. A leftover body from another deployment is the\n * dangerous case: it is perfectly valid YAML, so the PUT would succeed and overwrite the wrong\n * deployment with nothing able to catch it. Clearing first means a failed or withheld fetch leaves the\n * form empty rather than holding someone else's spec.\n */\nconst sourceState = ref<'idle' | 'loading' | 'loaded' | 'withheld' | 'failed'>('idle');\n/** Set when this deployment tracks a stored spec — editing this copy forks it from the original. */\nconst forkWarning = ref<string | null>(null);\n\nasync function loadSource(id: string): Promise<void> {\n sourceState.value = 'loading';\n forkWarning.value = null;\n const r = await api.getAuthed<DeploymentSourceResponse>(\n `/api/deployments/${encodeURIComponent(id)}/source`,\n );\n // A build of the API without the route answers 404; that is a capability difference, not an error,\n // and it must land on the old empty-form behaviour rather than an alarming banner.\n if (r.status === 404 || !r.ok) {\n sourceState.value = 'failed';\n return;\n }\n if (r.body.sourceWithheld) {\n sourceState.value = 'withheld';\n if (r.body.specName) forkWarning.value = r.body.specName;\n return;\n }\n // Only fill if the user has not started typing — a slow fetch must never overwrite their edit.\n if (!form.value.spec) form.value.spec = r.body.spec ?? '';\n if (!form.value.compose) form.value.compose = r.body.compose ?? '';\n if (r.body.specName) forkWarning.value = r.body.specName;\n sourceState.value = 'loaded';\n}\n\n// Duplicate: same fetch, but the id stays empty and the variables come across too, since a copied\n// spec interpolates the same names.\nwatch(\n copyFrom,\n async (from) => {\n if (!from || props.id) return;\n error.value = '';\n result.value = null;\n form.value.spec = '';\n form.value.compose = '';\n const saved = rowFor(from)?.vars;\n if (saved) vars.value = pairsFromRecord(saved);\n await loadSource(from);\n // A copied record's own id is not a name for the new one; the operator picks that.\n form.value.id = '';\n },\n { immediate: true },\n);\n\nwatch(\n () => props.id,\n (id) => {\n error.value = '';\n result.value = null;\n sourceState.value = 'idle';\n forkWarning.value = null;\n if (!id) return;\n if (id !== form.value.id) {\n form.value.spec = '';\n form.value.compose = '';\n }\n form.value.id = id;\n // Seed the variables from what this deployment already uses: replacing a spec usually needs\n // the same ones that resolved it.\n const stored = rowFor(id)?.vars;\n const saved = stored ? pairsFromRecord(stored) : readVars(id);\n if (saved.some((e) => e.k)) vars.value = saved;\n void loadSource(id);\n },\n { immediate: true },\n);\n\nconst canSubmit = computed(\n () =>\n !!form.value.id &&\n (source.value === 'stored' ? !!specName.value : !!form.value.spec.trim()) &&\n !submitting.value,\n);\n\nasync function submit(): Promise<void> {\n submitting.value = true;\n error.value = '';\n result.value = null;\n\n const id = form.value.id;\n const record = recordFromPairs(vars.value);\n /**\n * `vars` are STORED with the deployment on servers that support it, which makes a later `down`\n * resolve the same stack `up` created with no query parameters at all. `env` validates this\n * submission on every server, new or old. Sending both is what keeps this form working against\n * either build — an older server ignores the key it does not know.\n */\n const body: Record<string, unknown> = { vars: record, env: record };\n if (source.value === 'stored') body.specName = specName.value;\n else {\n body.spec = form.value.spec;\n if (form.value.compose.trim()) body.compose = form.value.compose;\n }\n\n const r = await api.put<SubmitResponse>(`/api/deployments/${encodeURIComponent(id)}`, body);\n submitting.value = false;\n\n if (r.status === 200 || r.status === 201) {\n result.value = {\n id: r.body.id ?? id,\n stack: r.body.stack ?? '?',\n created: r.status === 201,\n stackSharedWith: r.body.stackSharedWith,\n };\n // Persist the variables that just validated this spec. On an older server this is the single\n // thing keeping a later `down` pointed at the stack the `up` created.\n writeVars(id, vars.value);\n void loadDeployments();\n toast('ok', `${r.status === 201 ? 'Created' : 'Replaced'} ${id} → ${result.value.stack}`, {\n to: `/deployments/${encodeURIComponent(id)}`,\n toLabel: 'Open',\n });\n return;\n }\n // 400 (SpecError), 409 (a job in flight over this stack), 401, 404 — all rendered verbatim.\n error.value = problem(r, 'save this deployment');\n}\n\n/**\n * The preview domain, guessed from where this page is served.\n *\n * The UI lives on a host UNDER the preview domain (ui.preview.example.com, pstack.preview…), so\n * previews live beside it: drop this page's own first label and that is the base every generated\n * hostname hangs off. localhost and bare IPs have no domain to offer — those keep an honest\n * placeholder rather than generating `pr-123.192.168.1.5`.\n */\nfunction detectPreviewDomain(): string {\n const h = location.hostname;\n if (h === 'localhost' || h.endsWith('.localhost') || /^[\\d.]+$/.test(h) || h.includes(':')) {\n return 'preview.example.com';\n }\n const labels = h.split('.');\n return labels.length >= 3 ? labels.slice(1).join('.') : h;\n}\n\n/**\n * Kept as a function of the domain so the example is true on the host it is loaded on — a spec\n * copied from here should deploy without edits, not after find-and-replacing example.com.\n *\n * The compose half uses `pstack.routing.port`, NOT hand-written traefik labels: pstack generates\n * the router, TLS and network wiring from that one label. A bare `traefik.enable=true` is the\n * OPT-OUT signal (any traefik.* label means \"leave my service alone\") — which is what an older\n * version of this example taught, producing a service that was never reachable.\n */\nconst exampleSpec = (domain: string): string => `version: 1\nkind: isolated\n\n# The stack identity: the compose project name, and $STACK inside every hook.\n# \\${PR} is interpolated ONCE, at resolve time, from the variables sent with the request.\nstack: pr-\\${PR}\n\nenv:\n # The base every generated hostname hangs off: the app below is served at\n # app-pr-\\${PR}.${domain}\n PREVIEW_DOMAIN: ${domain}\n\ncompose:\n file: compose.yml\n # Every service sits behind a profile so a bare \\`up\\` starts nothing.\n # \\`down\\` always enables ALL of them — otherwise the unselected profiles' network leaks.\n profiles: [app]\n\nrequires:\n - name: traefik-network\n assert: docker network inspect traefik >/dev/null 2>&1\n hint: run \\`pstack init\\` on the host first\n\naxes:\n # Hooks run from the deployment directory, which holds only spec.yml and compose.yml —\n # so use inline shell or absolute paths, never ./hooks/foo.sh.\n - name: scratch\n up: mkdir -p /tmp/$STACK\n assert_live: test -d /tmp/$STACK\n down: rm -rf /tmp/$STACK\n # assert_gone MUST FAIL CLOSED. A bare \\`! <probe>\\` reports \"gone\" whenever the probe fails\n # for any reason — a missing CLI, an expired token — turning \"I could not tell\" into\n # \"it is gone\", a false negative on the one thing this tool exists to catch.\n assert_gone: |\n test -d /tmp || exit 1\n ! test -d /tmp/$STACK\n`;\n\nconst EXAMPLE_COMPOSE = `services:\n app:\n image: nginx:alpine\n profiles: [app]\n labels:\n # The ONE label routing needs: pstack generates the Traefik router, TLS and network wiring\n # from it. Writing any traefik.* label yourself is the opt-out — pstack then leaves the\n # service entirely alone, so only do that when you need something the shorthand cannot say.\n - pstack.routing.port=80\n`;\n\nfunction loadExample(): void {\n source.value = 'inline';\n form.value.spec = exampleSpec(detectPreviewDomain());\n if (!form.value.compose.trim()) form.value.compose = EXAMPLE_COMPOSE;\n if (!form.value.id) form.value.id = 'pr-123';\n if (!vars.value.some((e) => e.k)) vars.value = [{ k: 'PR', v: '123' }];\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>\n {{ replacing ? 'Edit a deployment' : copyFrom ? 'Duplicate a deployment' : 'Submit a deployment' }}\n </h1>\n <div class=\"sub\">\n {{\n replacing\n ? 'Loaded from what is stored; saving replaces the record'\n : copyFrom\n ? `Copied from ${copyFrom} — give it a new id, then edit`\n : 'Stores a spec so it can be deployed'\n }}\n </div>\n </div>\n <span class=\"grow\" />\n <button class=\"ghost\" @click=\"loadExample\">Load example spec</button>\n </div>\n\n <section class=\"panel\">\n <!-- The \"nothing saved until valid\" reassurance lives beside the Submit button below — the\n moment of commitment is where a guarantee about committing belongs, not floating above\n an unrelated id field. -->\n\n <!--\n A `PUT` REPLACES the whole record, and this form cannot pre-fill it: the API has no route\n that returns a stored spec. Say that out loud, because a half-remembered spec pasted here\n is still valid YAML — the server will accept it, and the axes the original declared simply\n stop existing as far as the control plane knows, while whatever they created keeps running.\n -->\n <!--\n The one thing that makes duplicating dangerous, said before the form rather than after the\n submission: two records resolving to one stack drive the same compose project.\n -->\n <div v-if=\"copyFrom && !replacing\" class=\"banner warn\">\n <b>Change the stack, not just the id.</b>\n <p>\n Two deployments that resolve to the same <code>stack</code> drive the same compose project —\n <code>down</code> on either stops the other's containers. If the stack interpolates a variable\n (<code>pr-${PR}</code>) give it a different value below; if it is a literal, edit the\n <code>stack:</code> line.\n <template v-if=\"sourceState === 'withheld'\">\n The spec could not be copied without an access token —\n <RouterLink to=\"/settings\">add yours</RouterLink>.\n </template>\n </p>\n </div>\n\n <div v-if=\"replacing\" class=\"banner\" :class=\"sourceState === 'loaded' ? 'info' : 'warn'\">\n <b>Replacing {{ id }}.</b>\n <p v-if=\"sourceState === 'loading'\">Loading what is stored…</p>\n <p v-else-if=\"sourceState === 'loaded'\">\n Loaded from the stored record — edit it and save. Saving replaces the record outright, so\n anything you delete here stops being tracked while whatever it created keeps running.\n </p>\n <p v-else-if=\"sourceState === 'withheld'\">\n The stored spec was not loaded: reading it needs an access token, because hooks routinely\n carry a credential inline. <RouterLink to=\"/settings\">Add your token</RouterLink> to edit\n in place — otherwise paste the <b>complete</b> spec, since anything you leave out stops\n being tracked.\n </p>\n <p v-else>\n The stored spec could not be loaded, so this form is empty. Paste the <b>complete</b> spec\n you want stored — anything you leave out stops being tracked while whatever it created keeps\n running.\n </p>\n </div>\n\n <!--\n A deployment that references a stored spec keeps its own copy of the source. Editing that copy\n forks it: the stored spec every other deployment shares is untouched, and this one stops\n following it. Silent forks are the kind of thing discovered months later.\n -->\n <div v-if=\"forkWarning\" class=\"banner warn\">\n <b>This deployment tracks the stored spec “{{ forkWarning }}”.</b>\n <p>\n Saving here writes a private copy and stops it following that spec. To change every\n deployment using it, edit\n <RouterLink :to=\"`/specs/${encodeURIComponent(forkWarning)}`\">the spec</RouterLink> instead.\n </p>\n </div>\n\n <div class=\"row\" style=\"margin-bottom: var(--s4)\">\n <div class=\"field\" style=\"max-width: 280px\">\n <label for=\"did\">Deployment id</label>\n <input\n id=\"did\"\n v-model.trim=\"form.id\"\n type=\"text\"\n placeholder=\"pr-123\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <span class=\"mute\" style=\"align-self: end; padding-bottom: 10px\">\n Lower case\n <InfoHint label=\"allowed characters in a deployment id\">\n Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64\n characters — <code>[a-z0-9][a-z0-9._-]{0,63}</code>.\n </InfoHint>\n </span>\n </div>\n\n <!-- Offered only when this server actually has stored specs. -->\n <div v-if=\"specs.length\" class=\"row\" style=\"margin-bottom: var(--s4)\">\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"inline\" /> inline spec\n </label>\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"stored\" /> reference a stored spec\n </label>\n </div>\n\n <template v-if=\"source === 'stored' && specs.length\">\n <div class=\"field\" style=\"max-width: 340px\">\n <label for=\"sn\">Stored spec</label>\n <SelectMenu v-model=\"specName\" id=\"sn\" label=\"Stored spec\" :options=\"specOptions\" />\n </div>\n <p v-if=\"chosenSpec\" class=\"hint\">\n <span v-if=\"chosenSpec.description\">{{ chosenSpec.description }} — </span>\n needs\n <b v-if=\"chosenSpec.requiredVars.length\">{{ chosenSpec.requiredVars.join(', ') }}</b>\n <span v-else>no variables</span>.\n <InfoHint label=\"why variables are required\">\n A missing variable is refused by name. It is never filled in with a blank, which would\n silently give every deployment the same stack name.\n </InfoHint>\n </p>\n </template>\n\n <template v-else>\n <div class=\"field\">\n <label for=\"spec\">Spec.yml</label>\n <textarea\n id=\"spec\"\n v-model=\"form.spec\"\n rows=\"12\"\n spellcheck=\"false\"\n placeholder=\"version: 1 kind: isolated stack: pr-${PR} axes: []\"\n />\n </div>\n\n <div class=\"field\" style=\"margin-top: var(--s3)\">\n <label for=\"compose\">compose.yml <span class=\"mute\">(optional)</span></label>\n <textarea\n id=\"compose\"\n v-model=\"form.compose\"\n rows=\"6\"\n spellcheck=\"false\"\n placeholder=\"Written next to spec.yml, so a compose file named compose.yml resolves\"\n />\n </div>\n <p class=\"hint\">\n Hooks must be inline shell or an absolute path.\n <InfoHint label=\"why a relative script path does not work\">\n A deployment directory only ever holds <code>spec.yml</code> and\n <code>compose.yml</code>, and hooks run from there — so\n <code>up: ./hooks/db.sh</code> has nothing to find.\n </InfoHint>\n </p>\n </template>\n\n <h2 class=\"section\" style=\"margin: var(--s5) 0 var(--s3)\">Variables</h2>\n <VarEditor v-model=\"vars\" />\n <p class=\"hint\">\n Saved with the deployment, so tearing it down later targets the same stack.\n <InfoHint label=\"how variables are remembered\">\n They are stored on the server where it supports that, and in this browser either way — so\n the actions on the deployment page send exactly these values.\n </InfoHint>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s5)\">\n <ActionButton variant=\"primary\" :pending=\"submitting\" :disabled=\"!canSubmit\" @click=\"submit\">\n {{ submitting ? 'Submitting…' : 'Submit' }}\n </ActionButton>\n <span v-if=\"!result\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n Nothing is saved until the spec is valid\n <InfoHint label=\"what happens on a rejected submission\">\n The spec is checked before anything is written, so a rejected submission leaves nothing\n behind — and a replace never destroys a good record over a typo. Whether the deployment\n is shared or isolated comes from the spec, not from this form.\n </InfoHint>\n </span>\n <span v-if=\"result\" class=\"s-ok\">\n {{ result.created ? 'Created' : 'Replaced' }} — stack\n <b>{{ result.stack }}</b>\n <RouterLink :to=\"`/deployments/${encodeURIComponent(result.id)}`\" style=\"margin-left: 8px\">\n open →\n </RouterLink>\n </span>\n </div>\n\n <!--\n The server's rejection text IS the documentation: it names the key, the variable or the\n assert that is wrong, and often prints the corrected form. Rendered whole, newlines and\n indentation intact. Never truncate it, never collapse it, never say \"invalid spec\".\n -->\n <!--\n Reported by the server, which resolved every other deployment to check. Shown after the fact\n because it can only be known once the spec has resolved — and it is a warning, not a rejection:\n it can be deliberate, and refusing over a guess would be worse than saying so.\n -->\n <div v-if=\"result?.stackSharedWith?.length\" class=\"banner warn\">\n <b>Another deployment already resolves to stack “{{ result.stack }}”.</b>\n <p>\n <template v-for=\"(o, i) in result.stackSharedWith\" :key=\"o\">\n <RouterLink :to=\"`/deployments/${encodeURIComponent(o)}`\">{{ o }}</RouterLink\n ><span v-if=\"i < result.stackSharedWith.length - 1\">, </span> </template\n >— both records now drive the same compose project, so <code>down</code> on either stops the\n other's containers and <code>verify</code> on either reports the other's leaks. If that was not\n intended, change this one's <code>stack</code> and save again.\n </p>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"The server rejected this submission.\" />\n </section>\n </div>\n</template>\n"],"names":["EXAMPLE_COMPOSE","props","__props","form","ref","vars","source","specName","submitting","error","result","specs","specOptions","computed","api","r","chosenSpec","replacing","route","useRoute","copyFrom","v","sourceState","forkWarning","loadSource","id","watch","from","saved","_a","rowFor","pairsFromRecord","stored","readVars","e","canSubmit","submit","record","recordFromPairs","body","writeVars","loadDeployments","toast","problem","detectPreviewDomain","h","labels","exampleSpec","domain","loadExample","_createElementBlock","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_openBlock","_hoisted_4","_cache","_Fragment","_createVNode","_component_RouterLink","_normalizeClass","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","$event","_hoisted_12","InfoHint","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","SelectMenu","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_21","_vModelText","_hoisted_22","_hoisted_23","VarEditor","_hoisted_24","_hoisted_25","ActionButton","_hoisted_26","_hoisted_27","_b","_hoisted_28","o","i","_createBlock","ErrorNote"],"mappings":"k8CAyRMA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mDA1PxB,MAAMC,EAAQC,EAERC,EAAOC,EAAI,CAAE,GAAIH,EAAM,IAAM,GAAI,KAAM,GAAI,QAAS,EAAA,CAAI,EACxDI,EAAOD,EAAe,CAAC,CAAE,EAAG,GAAI,EAAG,EAAA,CAAI,CAAC,EACxCE,EAASF,EAAyB,QAAQ,EAC1CG,EAAWH,EAAI,EAAE,EAEjBI,EAAaJ,EAAI,EAAK,EACtBK,EAAQL,EAAI,EAAE,EACdM,EAASN,EAML,IAAI,EAMRO,EAAQP,EAAgB,EAAE,EAG1BQ,EAAcC,EAAS,IAAM,CACjC,CAAE,MAAO,GAAI,MAAO,YAAA,EACpB,GAAGF,EAAM,MAAM,IAAK,IAAO,CAAE,MAAO,EAAE,KAAM,MAAO,EAAE,KAAM,KAAM,EAAE,MAAO,CAAA,CAC3E,EACIG,EAAI,IAAmB,YAAY,EAAE,KAAMC,GAAM,CAChDA,EAAE,IAAM,MAAM,QA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 as F,ap as Se,H as P,M as se,ah as Ae,ai as Pe,r as g,C as w,Y as Ce,u as D,a2 as I,F as De,aq as Te,a9 as _e,ar as Le,as as Ie,a4 as ie,at as Me,d as B,V as Fe,ac as $,au as Ne,X as xe,av as Be,o as G,x as J,w as ae,W as X,D as ke,S as ue,ak as Re,g as je}from"./index-DVCVnKbf.js";function $e(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[u=>{const a=ge(o,u);if(a||a===null)return a;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},u=>(Ee(o,u),u)]}function T(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function le(e,t,n){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(s)}function Ue(e){return e==null}function Tt(e,t){var n;const o=se();return F(()=>{o.value=e()},{...t,flush:(n=t==null?void 0:t.flush)!==null&&n!==void 0?n:"sync"}),Se(o)}function Q(e,t){return Ae()?(Pe(e,t),!0):!1}function We(e){let t=!1,n;const o=re(!0);return((...s)=>(t||(n=o.run(()=>e(...s)),t=!0),n))}const _=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qe=e=>typeof e<"u",Ke=Object.prototype.toString,He=e=>Ke.call(e)==="[object Object]",ee=Ve();function Ve(){var e,t,n;return _&&!!(!((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function q(e){return Array.isArray(e)?e:[e]}function ze(e){return x()}function Ye(e){if(!_)return e;let t=0,n,o;const s=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return((...r)=>(t+=1,o||(o=re(!0),n=o.run(()=>e(...r))),Q(s),n))}function _t(e,t=1e4){return Oe((n,o)=>{let s=E(e),r;const u=()=>setTimeout(()=>{s=E(e),o()},E(t));return Q(()=>{clearTimeout(r)}),{get(){return n(),s},set(a){s=a,o(),clearTimeout(r),r=u()}}})}function Ge(e,t){ze()&&we(e,t)}function Je(e,t,n){return P(e,t,{...n,immediate:!0})}const U=_?window:void 0;function N(e){var t;const n=E(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function ce(...e){const t=(o,s,r,u)=>(o.addEventListener(s,r,u),()=>o.removeEventListener(s,r,u)),n=w(()=>{const o=q(E(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return Je(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>N(r)))!==null&&o!==void 0?o:[U].filter(r=>r!=null),q(E(n.value?e[1]:e[0])),q(D(n.value?e[2]:e[1])),E(n.value?e[3]:e[2])]},([o,s,r,u],a,f)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const v=He(u)?{...u}:u,l=o.flatMap(i=>s.flatMap(c=>r.map(d=>t(i,c,d,v))));f(()=>{l.forEach(i=>i())})},{flush:"post"})}function de(){const e=se(!1),t=x();return t&&Ce(()=>{e.value=!0},t),e}function Xe(e){const t=de();return w(()=>(t.value,!!e()))}function Qe(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ze(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:s=U,eventName:r="keydown",passive:u=!1,dedupe:a=!1}=o,f=Qe(t);return ce(s,r,l=>{l.repeat&&E(a)||f(l)&&n(l)},u)}function et(e){return JSON.parse(JSON.stringify(e))}function Lt(e,t,n={}){const{window:o=U,...s}=n;let r;const u=Xe(()=>o&&"ResizeObserver"in o),a=()=>{r&&(r.disconnect(),r=void 0)},f=P(w(()=>{const l=E(e);return Array.isArray(l)?l.map(i=>N(i)):[N(l)]}),l=>{if(a(),u.value&&o){r=new ResizeObserver(t);for(const i of l)i&&r.observe(i,s)}},{immediate:!0,flush:"post"}),v=()=>{a(),f()};return Q(v),{isSupported:u,stop:v}}function It(e,t,n,o={}){var s,r;const{clone:u=!1,passive:a=!1,eventName:f,deep:v=!1,defaultValue:l,shouldEmit:i}=o,c=x(),d=n||(c==null?void 0:c.emit)||(c==null||(s=c.$emit)===null||s===void 0?void 0:s.bind(c))||(c==null||(r=c.proxy)===null||r===void 0||(r=r.$emit)===null||r===void 0?void 0:r.bind(c==null?void 0:c.proxy));let y=f;t||(t="modelValue"),y=y||`update:${t.toString()}`;const h=p=>u?typeof u=="function"?u(p):et(p):p,b=()=>qe(e[t])?h(e[t]):l,m=p=>{i?i(p)&&d(y,p):d(y,p)};if(a){const p=g(b());let S=!1;return P(()=>e[t],A=>{S||(S=!0,p.value=h(A),I(()=>S=!1))}),P(p,A=>{!S&&(A!==e[t]||v)&&m(A)},{deep:v}),p}else return w({get(){return b()},set(p){m(p)}})}function Z(e){return e?e.flatMap(t=>t.type===De?Z(t.children):[t]):[]}const[fe]=$e("ConfigProvider");function K(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Y(e,t,n=".",o){if(!K(t))return Y(e,{},n,o);const s={...t};for(const r of Object.keys(e)){if(r==="__proto__"||r==="constructor")continue;const u=e[r];u!=null&&(o&&o(s,r,u,n)||(Array.isArray(u)&&Array.isArray(s[r])?s[r]=[...u,...s[r]]:K(u)&&K(s[r])?s[r]=Y(u,s[r],(n?`${n}.`:"")+r.toString(),o):s[r]=u))}return s}function tt(e){return(...t)=>t.reduce((n,o)=>Y(n,o,"",e),{})}const nt=tt(),ot=Ye(()=>{const e=g(new Map),t=g(),n=w(()=>{for(const u of e.value.values())if(u)return!0;return!1}),o=fe({scrollBody:g(!0)});let s=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",ee&&(s==null||s()),t.value=void 0};return P(n,(u,a)=>{var i;if(!_)return;if(!u){a&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const f=window.innerWidth-document.documentElement.clientWidth,v={padding:f,margin:0},l=(i=o.scrollBody)!=null&&i.value?typeof o.scrollBody.value=="object"?nt({padding:o.scrollBody.value.padding===!0?f:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?f:o.scrollBody.value.margin},v):v:{padding:0,margin:0};f>0&&(document.body.style.paddingRight=typeof l.padding=="number"?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin=="number"?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty("--scrollbar-width",`${f}px`),document.body.style.overflow="hidden"),ee&&(s=ce(document,"touchmove",c=>rt(c),{passive:!1})),I(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),e});function Mt(e){const t=Math.random().toString(36).substring(2,7),n=ot();n.value.set(t,e??!1);const o=w({get:()=>n.value.get(t)??!1,set:s=>n.value.set(t,s)});return Ge(()=>{n.value.delete(t)}),o}function ve(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:ve(n)}}function rt(e){const t=e||window.event,n=t.target;return n instanceof Element&&ve(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Ft(e){const t=x(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(s=>{o[Te(_e(s))]=(...r)=>e(s,...r)}),o}function pe(){const e=x(),t=g(),n=w(()=>o());Le(()=>{n.value!==o()&&Ie(t)});function o(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:N(t)}const s=Object.assign({},e.exposed),r={};for(const a in e.props)Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get:()=>e.props[a]});if(Object.keys(s).length>0)for(const a in s)Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get:()=>s[a]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function u(a){if(t.value=a,!!a&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const f=a.$.exposed,v=Object.assign({},r);for(const l in f)Object.defineProperty(v,l,{enumerable:!0,configurable:!0,get:()=>f[l]});e.exposed=v}}return{forwardRef:u,currentRef:t,currentElement:n}}var st=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},M=new WeakMap,k=new WeakMap,R={},H=0,me=function(e){return e&&(e.host||me(e.parentNode))},it=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=me(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},at=function(e,t,n,o){var s=it(t,Array.isArray(e)?e:[e]);R[n]||(R[n]=new WeakMap);var r=R[n],u=[],a=new Set,f=new Set(s),v=function(i){!i||a.has(i)||(a.add(i),v(i.parentNode))};s.forEach(v);var l=function(i){!i||f.has(i)||Array.prototype.forEach.call(i.children,function(c){if(a.has(c))l(c);else try{var d=c.getAttribute(o),y=d!==null&&d!=="false",h=(M.get(c)||0)+1,b=(r.get(c)||0)+1;M.set(c,h),r.set(c,b),u.push(c),h===1&&y&&k.set(c,!0),b===1&&c.setAttribute(n,"true"),y||c.setAttribute(o,"true")}catch(m){console.error("aria-hidden: cannot operate on ",c,m)}})};return l(t),a.clear(),H++,function(){u.forEach(function(i){var c=M.get(i)-1,d=r.get(i)-1;M.set(i,c),r.set(i,d),c||(k.has(i)||i.removeAttribute(o),k.delete(i)),d||i.removeAttribute(n)}),H--,H||(M=new WeakMap,M=new WeakMap,k=new WeakMap,R={})}},ut=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),s=st(e);return s?(o.push.apply(o,Array.from(s.querySelectorAll("[aria-live], script"))),at(o,s,n,"aria-hidden")):function(){return null}};function Nt(e){let t;P(()=>N(e),n=>{let o=!1;try{o=!!(n!=null&&n.closest("[popover]:not(:popover-open)"))}catch{}n&&!o?t=ut(n):t&&t()}),ie(()=>{t&&t()})}function xt(e,t="reka"){var s;let n;const o=fe({useId:void 0});return o.useId?n=o.useId():n=(s=Me)==null?void 0:s(),t?`${t}-${n}`:n}function lt(e,t){const n=g(e);function o(r){return t[n.value][r]??n.value}return{state:n,dispatch:r=>{n.value=o(r)}}}function ct(e,t){var b;const n=g({}),o=g("none"),s=g(e),r=e.value?"mounted":"unmounted";let u;const a=((b=t.value)==null?void 0:b.ownerDocument.defaultView)??U,{state:f,dispatch:v}=lt(r,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),l=m=>{var p;if(_){const S=new CustomEvent(m,{bubbles:!1,cancelable:!1});(p=t.value)==null||p.dispatchEvent(S)}};P(e,async(m,p)=>{var A;const S=p!==m;if(await I(),S){const W=o.value,L=j(t.value);m?(v("MOUNT"),l("enter"),L==="none"&&l("after-enter")):L==="none"||L==="undefined"||((A=n.value)==null?void 0:A.display)==="none"?(v("UNMOUNT"),l("leave"),l("after-leave")):p&&W!==L?(v("ANIMATION_OUT"),l("leave")):(v("UNMOUNT"),l("after-leave"))}},{immediate:!0});const i=m=>{const p=j(t.value),S=p.includes(CSS.escape(m.animationName)),A=f.value==="mounted"?"enter":"leave";if(m.target===t.value&&S&&(l(`after-${A}`),v("ANIMATION_END"),!s.value)){const W=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",u=a==null?void 0:a.setTimeout(()=>{var L;((L=t.value)==null?void 0:L.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=W)})}m.target===t.value&&p==="none"&&v("ANIMATION_END")},c=m=>{m.target===t.value&&(o.value=j(t.value))},d=P(t,(m,p)=>{m?(n.value=getComputedStyle(m),m.addEventListener("animationstart",c),m.addEventListener("animationcancel",i),m.addEventListener("animationend",i)):(v("ANIMATION_END"),u!==void 0&&(a==null||a.clearTimeout(u)),p==null||p.removeEventListener("animationstart",c),p==null||p.removeEventListener("animationcancel",i),p==null||p.removeEventListener("animationend",i))},{immediate:!0}),y=P(f,()=>{const m=j(t.value);o.value=f.value==="mounted"?m:"none"});return ie(()=>{d(),y()}),{isPresent:w(()=>["mounted","unmountSuspended"].includes(f.value))}}function j(e){return e&&getComputedStyle(e).animationName||"none"}var Bt=B({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var v;const{present:o,forceMount:s}=Fe(e),r=g(),{isPresent:u}=ct(o,r);n({present:u});let a=t.default({present:u.value});a=Z(a||[]);const f=x();if(a&&(a==null?void 0:a.length)>1){const l=(v=f==null?void 0:f.parent)!=null&&v.type.name?`<${f.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${l}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(i=>` - ${i}`).join(`
|
|
1
|
+
import{ab as ge,ae as Ee,an as Oe,a7 as E,K as we,ao as re,a8 as x,a6 as M,ap as Se,H as P,N as se,ah as Ae,ai as Pe,r as g,C as w,Y as Ce,u as D,a2 as I,F as De,aq as Te,a9 as _e,ar as Le,as as Ie,a4 as ie,at as Fe,d as B,V as Me,ac as $,au as Ne,X as xe,av as Be,o as G,x as J,w as ae,W as X,D as ke,S as ue,ak as Re,g as je}from"./index-wjzRhuU3.js";function $e(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[u=>{const a=ge(o,u);if(a||a===null)return a;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},u=>(Ee(o,u),u)]}function T(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function le(e,t,n){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(s)}function Ue(e){return e==null}function Tt(e,t){var n;const o=se();return M(()=>{o.value=e()},{...t,flush:(n=t==null?void 0:t.flush)!==null&&n!==void 0?n:"sync"}),Se(o)}function Q(e,t){return Ae()?(Pe(e,t),!0):!1}function We(e){let t=!1,n;const o=re(!0);return((...s)=>(t||(n=o.run(()=>e(...s)),t=!0),n))}const _=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ke=e=>typeof e<"u",qe=Object.prototype.toString,He=e=>qe.call(e)==="[object Object]",ee=Ve();function Ve(){var e,t,n;return _&&!!(!((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function K(e){return Array.isArray(e)?e:[e]}function ze(e){return x()}function Ye(e){if(!_)return e;let t=0,n,o;const s=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return((...r)=>(t+=1,o||(o=re(!0),n=o.run(()=>e(...r))),Q(s),n))}function _t(e,t=1e4){return Oe((n,o)=>{let s=E(e),r;const u=()=>setTimeout(()=>{s=E(e),o()},E(t));return Q(()=>{clearTimeout(r)}),{get(){return n(),s},set(a){s=a,o(),clearTimeout(r),r=u()}}})}function Ge(e,t){ze()&&we(e,t)}function Je(e,t,n){return P(e,t,{...n,immediate:!0})}const U=_?window:void 0;function N(e){var t;const n=E(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function ce(...e){const t=(o,s,r,u)=>(o.addEventListener(s,r,u),()=>o.removeEventListener(s,r,u)),n=w(()=>{const o=K(E(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return Je(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>N(r)))!==null&&o!==void 0?o:[U].filter(r=>r!=null),K(E(n.value?e[1]:e[0])),K(D(n.value?e[2]:e[1])),E(n.value?e[3]:e[2])]},([o,s,r,u],a,f)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const v=He(u)?{...u}:u,l=o.flatMap(i=>s.flatMap(c=>r.map(d=>t(i,c,d,v))));f(()=>{l.forEach(i=>i())})},{flush:"post"})}function de(){const e=se(!1),t=x();return t&&Ce(()=>{e.value=!0},t),e}function Xe(e){const t=de();return w(()=>(t.value,!!e()))}function Qe(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ze(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:s=U,eventName:r="keydown",passive:u=!1,dedupe:a=!1}=o,f=Qe(t);return ce(s,r,l=>{l.repeat&&E(a)||f(l)&&n(l)},u)}function et(e){return JSON.parse(JSON.stringify(e))}function Lt(e,t,n={}){const{window:o=U,...s}=n;let r;const u=Xe(()=>o&&"ResizeObserver"in o),a=()=>{r&&(r.disconnect(),r=void 0)},f=P(w(()=>{const l=E(e);return Array.isArray(l)?l.map(i=>N(i)):[N(l)]}),l=>{if(a(),u.value&&o){r=new ResizeObserver(t);for(const i of l)i&&r.observe(i,s)}},{immediate:!0,flush:"post"}),v=()=>{a(),f()};return Q(v),{isSupported:u,stop:v}}function It(e,t,n,o={}){var s,r;const{clone:u=!1,passive:a=!1,eventName:f,deep:v=!1,defaultValue:l,shouldEmit:i}=o,c=x(),d=n||(c==null?void 0:c.emit)||(c==null||(s=c.$emit)===null||s===void 0?void 0:s.bind(c))||(c==null||(r=c.proxy)===null||r===void 0||(r=r.$emit)===null||r===void 0?void 0:r.bind(c==null?void 0:c.proxy));let y=f;t||(t="modelValue"),y=y||`update:${t.toString()}`;const h=p=>u?typeof u=="function"?u(p):et(p):p,b=()=>Ke(e[t])?h(e[t]):l,m=p=>{i?i(p)&&d(y,p):d(y,p)};if(a){const p=g(b());let S=!1;return P(()=>e[t],A=>{S||(S=!0,p.value=h(A),I(()=>S=!1))}),P(p,A=>{!S&&(A!==e[t]||v)&&m(A)},{deep:v}),p}else return w({get(){return b()},set(p){m(p)}})}function Z(e){return e?e.flatMap(t=>t.type===De?Z(t.children):[t]):[]}const[fe]=$e("ConfigProvider");function q(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Y(e,t,n=".",o){if(!q(t))return Y(e,{},n,o);const s={...t};for(const r of Object.keys(e)){if(r==="__proto__"||r==="constructor")continue;const u=e[r];u!=null&&(o&&o(s,r,u,n)||(Array.isArray(u)&&Array.isArray(s[r])?s[r]=[...u,...s[r]]:q(u)&&q(s[r])?s[r]=Y(u,s[r],(n?`${n}.`:"")+r.toString(),o):s[r]=u))}return s}function tt(e){return(...t)=>t.reduce((n,o)=>Y(n,o,"",e),{})}const nt=tt(),ot=Ye(()=>{const e=g(new Map),t=g(),n=w(()=>{for(const u of e.value.values())if(u)return!0;return!1}),o=fe({scrollBody:g(!0)});let s=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",ee&&(s==null||s()),t.value=void 0};return P(n,(u,a)=>{var i;if(!_)return;if(!u){a&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const f=window.innerWidth-document.documentElement.clientWidth,v={padding:f,margin:0},l=(i=o.scrollBody)!=null&&i.value?typeof o.scrollBody.value=="object"?nt({padding:o.scrollBody.value.padding===!0?f:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?f:o.scrollBody.value.margin},v):v:{padding:0,margin:0};f>0&&(document.body.style.paddingRight=typeof l.padding=="number"?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin=="number"?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty("--scrollbar-width",`${f}px`),document.body.style.overflow="hidden"),ee&&(s=ce(document,"touchmove",c=>rt(c),{passive:!1})),I(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),e});function Ft(e){const t=Math.random().toString(36).substring(2,7),n=ot();n.value.set(t,e??!1);const o=w({get:()=>n.value.get(t)??!1,set:s=>n.value.set(t,s)});return Ge(()=>{n.value.delete(t)}),o}function ve(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:ve(n)}}function rt(e){const t=e||window.event,n=t.target;return n instanceof Element&&ve(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Mt(e){const t=x(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(s=>{o[Te(_e(s))]=(...r)=>e(s,...r)}),o}function pe(){const e=x(),t=g(),n=w(()=>o());Le(()=>{n.value!==o()&&Ie(t)});function o(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:N(t)}const s=Object.assign({},e.exposed),r={};for(const a in e.props)Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get:()=>e.props[a]});if(Object.keys(s).length>0)for(const a in s)Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get:()=>s[a]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function u(a){if(t.value=a,!!a&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const f=a.$.exposed,v=Object.assign({},r);for(const l in f)Object.defineProperty(v,l,{enumerable:!0,configurable:!0,get:()=>f[l]});e.exposed=v}}return{forwardRef:u,currentRef:t,currentElement:n}}var st=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},F=new WeakMap,k=new WeakMap,R={},H=0,me=function(e){return e&&(e.host||me(e.parentNode))},it=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=me(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},at=function(e,t,n,o){var s=it(t,Array.isArray(e)?e:[e]);R[n]||(R[n]=new WeakMap);var r=R[n],u=[],a=new Set,f=new Set(s),v=function(i){!i||a.has(i)||(a.add(i),v(i.parentNode))};s.forEach(v);var l=function(i){!i||f.has(i)||Array.prototype.forEach.call(i.children,function(c){if(a.has(c))l(c);else try{var d=c.getAttribute(o),y=d!==null&&d!=="false",h=(F.get(c)||0)+1,b=(r.get(c)||0)+1;F.set(c,h),r.set(c,b),u.push(c),h===1&&y&&k.set(c,!0),b===1&&c.setAttribute(n,"true"),y||c.setAttribute(o,"true")}catch(m){console.error("aria-hidden: cannot operate on ",c,m)}})};return l(t),a.clear(),H++,function(){u.forEach(function(i){var c=F.get(i)-1,d=r.get(i)-1;F.set(i,c),r.set(i,d),c||(k.has(i)||i.removeAttribute(o),k.delete(i)),d||i.removeAttribute(n)}),H--,H||(F=new WeakMap,F=new WeakMap,k=new WeakMap,R={})}},ut=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),s=st(e);return s?(o.push.apply(o,Array.from(s.querySelectorAll("[aria-live], script"))),at(o,s,n,"aria-hidden")):function(){return null}};function Nt(e){let t;P(()=>N(e),n=>{let o=!1;try{o=!!(n!=null&&n.closest("[popover]:not(:popover-open)"))}catch{}n&&!o?t=ut(n):t&&t()}),ie(()=>{t&&t()})}function xt(e,t="reka"){var s;let n;const o=fe({useId:void 0});return o.useId?n=o.useId():n=(s=Fe)==null?void 0:s(),t?`${t}-${n}`:n}function lt(e,t){const n=g(e);function o(r){return t[n.value][r]??n.value}return{state:n,dispatch:r=>{n.value=o(r)}}}function ct(e,t){var b;const n=g({}),o=g("none"),s=g(e),r=e.value?"mounted":"unmounted";let u;const a=((b=t.value)==null?void 0:b.ownerDocument.defaultView)??U,{state:f,dispatch:v}=lt(r,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),l=m=>{var p;if(_){const S=new CustomEvent(m,{bubbles:!1,cancelable:!1});(p=t.value)==null||p.dispatchEvent(S)}};P(e,async(m,p)=>{var A;const S=p!==m;if(await I(),S){const W=o.value,L=j(t.value);m?(v("MOUNT"),l("enter"),L==="none"&&l("after-enter")):L==="none"||L==="undefined"||((A=n.value)==null?void 0:A.display)==="none"?(v("UNMOUNT"),l("leave"),l("after-leave")):p&&W!==L?(v("ANIMATION_OUT"),l("leave")):(v("UNMOUNT"),l("after-leave"))}},{immediate:!0});const i=m=>{const p=j(t.value),S=p.includes(CSS.escape(m.animationName)),A=f.value==="mounted"?"enter":"leave";if(m.target===t.value&&S&&(l(`after-${A}`),v("ANIMATION_END"),!s.value)){const W=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",u=a==null?void 0:a.setTimeout(()=>{var L;((L=t.value)==null?void 0:L.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=W)})}m.target===t.value&&p==="none"&&v("ANIMATION_END")},c=m=>{m.target===t.value&&(o.value=j(t.value))},d=P(t,(m,p)=>{m?(n.value=getComputedStyle(m),m.addEventListener("animationstart",c),m.addEventListener("animationcancel",i),m.addEventListener("animationend",i)):(v("ANIMATION_END"),u!==void 0&&(a==null||a.clearTimeout(u)),p==null||p.removeEventListener("animationstart",c),p==null||p.removeEventListener("animationcancel",i),p==null||p.removeEventListener("animationend",i))},{immediate:!0}),y=P(f,()=>{const m=j(t.value);o.value=f.value==="mounted"?m:"none"});return ie(()=>{d(),y()}),{isPresent:w(()=>["mounted","unmountSuspended"].includes(f.value))}}function j(e){return e&&getComputedStyle(e).animationName||"none"}var Bt=B({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var v;const{present:o,forceMount:s}=Me(e),r=g(),{isPresent:u}=ct(o,r);n({present:u});let a=t.default({present:u.value});a=Z(a||[]);const f=x();if(a&&(a==null?void 0:a.length)>1){const l=(v=f==null?void 0:f.parent)!=null&&v.type.name?`<${f.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${l}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(i=>` - ${i}`).join(`
|
|
2
2
|
`)].join(`
|
|
3
|
-
`))}return()=>s.value||o.value||u.value?$(t.default({present:u.value})[0],{ref:l=>{const i=N(l);return typeof(i==null?void 0:i.hasAttribute)>"u"||(i!=null&&i.hasAttribute("data-reka-popper-content-wrapper")?r.value=i.firstElementChild:r.value=i),i}}):null}});const dt=B({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var f;if(!n.default)return null;const o=Z(n.default()),s=o.findIndex(v=>v.type!==Ne);if(s===-1)return o;const r=o[s];(f=r.props)==null||delete f.ref;const u=r.props?xe(t,r.props):t,a=Be({...r,props:{}},u);return o.length===1?a:(o[s]=a,o)}}}),ft=["area","img","input"],ye=B({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&ft.includes(o)?()=>$(o,t):o!=="template"?()=>$(e.as,t,{default:n.default}):()=>$(dt,t,{default:n.default})}}),vt="dismissableLayer.pointerDownOutside",pt="dismissableLayer.focusOutside";function he(e,t){if(!(t instanceof Element))return!1;const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),s=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(o===n||s.indexOf(o)<s.indexOf(n)))}function mt(e,t,n=!0){var u;const o=((u=t==null?void 0:t.value)==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),s=g(!1),r=g(()=>{});return
|
|
4
|
-
//# sourceMappingURL=Teleport-
|
|
3
|
+
`))}return()=>s.value||o.value||u.value?$(t.default({present:u.value})[0],{ref:l=>{const i=N(l);return typeof(i==null?void 0:i.hasAttribute)>"u"||(i!=null&&i.hasAttribute("data-reka-popper-content-wrapper")?r.value=i.firstElementChild:r.value=i),i}}):null}});const dt=B({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var f;if(!n.default)return null;const o=Z(n.default()),s=o.findIndex(v=>v.type!==Ne);if(s===-1)return o;const r=o[s];(f=r.props)==null||delete f.ref;const u=r.props?xe(t,r.props):t,a=Be({...r,props:{}},u);return o.length===1?a:(o[s]=a,o)}}}),ft=["area","img","input"],ye=B({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&ft.includes(o)?()=>$(o,t):o!=="template"?()=>$(e.as,t,{default:n.default}):()=>$(dt,t,{default:n.default})}}),vt="dismissableLayer.pointerDownOutside",pt="dismissableLayer.focusOutside";function he(e,t){if(!(t instanceof Element))return!1;const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),s=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(o===n||s.indexOf(o)<s.indexOf(n)))}function mt(e,t,n=!0){var u;const o=((u=t==null?void 0:t.value)==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),s=g(!1),r=g(()=>{});return M(a=>{if(!_||!E(n))return;const f=async l=>{const i=l.target;if(!(!(t!=null&&t.value)||!i)){if(he(t.value,i)){s.value=!1;return}if(l.target&&!s.value){let d=function(){le(vt,e,c)};const c={originalEvent:l};l.pointerType==="touch"?(o.removeEventListener("click",r.value),r.value=d,o.addEventListener("click",r.value,{once:!0})):d()}else o.removeEventListener("click",r.value);s.value=!1}},v=window.setTimeout(()=>{o.addEventListener("pointerdown",f)},0);a(()=>{window.clearTimeout(v),o.removeEventListener("pointerdown",f),o.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>{E(n)&&(s.value=!0)}}}function yt(e,t,n=!0){var r;const o=((r=t==null?void 0:t.value)==null?void 0:r.ownerDocument)??(globalThis==null?void 0:globalThis.document),s=g(!1);return M(u=>{if(!_||!E(n))return;const a=async f=>{if(!(t!=null&&t.value))return;await I(),await I();const v=f.target;!t.value||!v||he(t.value,v)||f.target&&!s.value&&le(pt,e,{originalEvent:f})};o.addEventListener("focusin",a),u(()=>o.removeEventListener("focusin",a))}),{onFocusCapture:()=>{E(n)&&(s.value=!0)},onBlurCapture:()=>{E(n)&&(s.value=!1)}}}const O=ue({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var ht=B({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:s,currentElement:r}=pe(),u=w(()=>{var d;return((d=r.value)==null?void 0:d.ownerDocument)??globalThis.document}),a=w(()=>O.layersRoot),f=w(()=>r.value?Array.from(a.value).indexOf(r.value):-1),v=w(()=>O.layersWithOutsidePointerEventsDisabled.size>0),l=w(()=>{const d=Array.from(a.value),[y]=[...O.layersWithOutsidePointerEventsDisabled].slice(-1),h=d.indexOf(y);return f.value>=h}),i=mt(async d=>{const y=[...O.branches].some(h=>h==null?void 0:h.contains(d.target));!l.value||y||(o("pointerDownOutside",d),o("interactOutside",d),await I(),d.defaultPrevented||o("dismiss"))},r),c=yt(d=>{[...O.branches].some(h=>h==null?void 0:h.contains(d.target))||(o("focusOutside",d),o("interactOutside",d),d.defaultPrevented||o("dismiss"))},r);return Ze("Escape",d=>{f.value===a.value.size-1&&(o("escapeKeyDown",d),d.defaultPrevented||o("dismiss"))}),P([r,()=>n.disableOutsidePointerEvents],([d,y],h,b)=>{d&&(y&&(O.layersWithOutsidePointerEventsDisabled.size===0&&(O.originalBodyPointerEvents=u.value.body.style.pointerEvents,u.value.body.style.pointerEvents="none"),O.layersWithOutsidePointerEventsDisabled.add(d),b(()=>{O.layersWithOutsidePointerEventsDisabled.delete(d),O.layersWithOutsidePointerEventsDisabled.size===0&&!Ue(O.originalBodyPointerEvents)&&(u.value.body.style.pointerEvents=O.originalBodyPointerEvents)})),a.value.add(d))},{immediate:!0}),M(d=>{d(()=>{r.value&&(a.value.delete(r.value),O.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(d,y)=>(G(),J(D(ye),{ref:D(s),"as-child":d.asChild,as:d.as,"data-dismissable-layer":"",style:ke({pointerEvents:v.value?l.value?"auto":"none":void 0}),onFocusCapture:D(c).onFocusCapture,onBlurCapture:D(c).onBlurCapture,onPointerdownCapture:D(i).onPointerDownCapture},{default:ae(()=>[X(d.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),kt=ht;const bt=We(()=>g([]));function gt(){const e=bt();return{add(t){const n=e.value[0];t!==n&&(n==null||n.pause()),e.value=te(e.value,t),e.value.unshift(t)},remove(t){var n;e.value=te(e.value,t),(n=e.value[0])==null||n.resume()}}}function te(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}const V="focusScope.autoFocusOnMount",z="focusScope.autoFocusOnUnmount",ne={bubbles:!1,cancelable:!0};function Et(e,{select:t=!1}={}){const n=T();for(const o of e)if(C(o,{select:t}),T()!==n)return!0}function Ot(e){const t=be(e),n=oe(t,e),o=oe(t.reverse(),e);return[n,o]}function be(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function oe(e,t){for(const n of e)if(!wt(n,{upTo:t}))return n}function wt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function St(e){return e instanceof HTMLInputElement&&"select"in e}function C(e,{select:t=!1}={}){if(e&&e.focus){const n=T();e.focus({preventScroll:!0}),e!==n&&St(e)&&t&&e.select()}}var At=B({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,o=t,{currentRef:s,currentElement:r}=pe(),u=g(null),a=gt(),f=ue({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});M(l=>{if(!_)return;const i=r.value;if(!n.trapped)return;function c(b){if(f.paused||!i)return;const m=b.target;i.contains(m)?u.value=m:C(u.value,{select:!0})}function d(b){if(f.paused||!i)return;const m=b.relatedTarget;m!==null&&(i.contains(m)||C(u.value,{select:!0}))}function y(b){const m=u.value;if(m===null||!b.some(A=>A.removedNodes.length>0))return;i.contains(m)||C(i)}document.addEventListener("focusin",c),document.addEventListener("focusout",d);const h=new MutationObserver(y);i&&h.observe(i,{childList:!0,subtree:!0}),l(()=>{document.removeEventListener("focusin",c),document.removeEventListener("focusout",d),h.disconnect()})}),M(async l=>{const i=r.value;if(await I(),!i)return;a.add(f);const c=T();if(!i.contains(c)){const y=new CustomEvent(V,ne);i.addEventListener(V,h=>o("mountAutoFocus",h)),i.dispatchEvent(y),y.defaultPrevented||(Et(be(i),{select:!0}),T()===c&&C(i))}l(()=>{i.removeEventListener(V,b=>o("mountAutoFocus",b));const y=new CustomEvent(z,ne),h=b=>{o("unmountAutoFocus",b)};i.addEventListener(z,h),i.dispatchEvent(y),i.setAttribute("data-focus-scope-unmounting",""),setTimeout(()=>{y.defaultPrevented||C(c??document.body,{select:!0}),i.removeEventListener(z,h),a.remove(f),i.removeAttribute("data-focus-scope-unmounting")},0)})});function v(l){if(!n.loop&&!n.trapped||f.paused)return;const i=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,c=T();if(i&&c){const d=l.currentTarget,[y,h]=Ot(d);y&&h?!l.shiftKey&&c===h?(l.preventDefault(),n.loop&&C(y,{select:!0})):l.shiftKey&&c===y&&(l.preventDefault(),n.loop&&C(h,{select:!0})):c===d&&l.preventDefault()}}return(l,i)=>(G(),J(D(ye),{ref_key:"currentRef",ref:s,tabindex:"-1","as-child":l.asChild,as:l.as,onKeydown:v},{default:ae(()=>[X(l.$slots,"default")]),_:3},8,["as-child","as"]))}}),Rt=At;function jt(e){return e?"open":"closed"}function $t(e){const t=T();for(const n of e)if(n===t||(n.focus(),T()!==t))return}var Pt=B({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=de();return(n,o)=>D(t)||n.forceMount?(G(),J(Re,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[X(n.$slots,"default")],8,["to","disabled","defer"])):je("v-if",!0)}}),Ut=Pt;export{kt as D,Rt as F,ye as P,dt as S,Ut as T,pe as a,xt as b,$e as c,jt as d,Mt as e,Nt as f,T as g,Bt as h,Ft as i,fe as j,_ as k,N as l,Tt as m,Ue as n,$t as o,Lt as p,le as q,_t as r,It as u};
|
|
4
|
+
//# sourceMappingURL=Teleport-BXE_6A8N.js.map
|