okno 1.0.0-beta.49 → 1.0.0-beta.50
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/README.md +103 -0
- package/dist/DateInput-DFMuwukN.js +5 -0
- package/dist/Doc-DaOTQ68S.js +1 -0
- package/dist/DocNote-DCnGLaBv.js +1 -0
- package/dist/Files-CAo7CtDV.js +1 -0
- package/dist/Strings-DB4e139g.js +1 -0
- package/dist/UI-Bxucd1jf.js +3 -0
- package/dist/ViewModeToggle-CM5Q9dZC.js +6 -0
- package/dist/Windows-CglPvdAM.js +128 -0
- package/dist/astro/index.js +1 -1
- package/dist/boot.js +75 -59
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/merge.d.ts +8 -0
- package/dist/cli/merge.d.ts.map +1 -0
- package/dist/cli/upgrade.d.ts +6 -0
- package/dist/cli/upgrade.d.ts.map +1 -0
- package/dist/cli.js +19 -9
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/codegen/icon-assets.d.ts +18 -0
- package/dist/codegen/icon-assets.d.ts.map +1 -1
- package/dist/codegen/modules.d.ts.map +1 -1
- package/dist/codegen/validate-content.d.ts.map +1 -1
- package/dist/contracts/bootstrap.d.ts +4 -0
- package/dist/contracts/bootstrap.d.ts.map +1 -1
- package/dist/contracts/fields.d.ts +10 -2
- package/dist/contracts/fields.d.ts.map +1 -1
- package/dist/contracts/routes.d.ts +185 -0
- package/dist/contracts/routes.d.ts.map +1 -0
- package/dist/core/block-key.d.ts +8 -0
- package/dist/core/block-key.d.ts.map +1 -0
- package/dist/core/content-path.d.ts +3 -0
- package/dist/core/content-path.d.ts.map +1 -1
- package/dist/core/content.d.ts.map +1 -1
- package/dist/core/file-model.d.ts +136 -0
- package/dist/core/file-model.d.ts.map +1 -0
- package/dist/core/files-path.d.ts +21 -0
- package/dist/core/files-path.d.ts.map +1 -0
- package/dist/core/format.d.ts +26 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/icon-symbol.d.ts +3 -0
- package/dist/core/icon-symbol.d.ts.map +1 -0
- package/dist/core/index.d.ts +12 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/locale-move.d.ts +20 -0
- package/dist/core/locale-move.d.ts.map +1 -0
- package/dist/core/media-kind.d.ts +21 -0
- package/dist/core/media-kind.d.ts.map +1 -0
- package/dist/core/merge-record.d.ts +22 -0
- package/dist/core/merge-record.d.ts.map +1 -0
- package/dist/core/operation.d.ts +95 -0
- package/dist/core/operation.d.ts.map +1 -0
- package/dist/core/operations.d.ts +118 -0
- package/dist/core/operations.d.ts.map +1 -0
- package/dist/core/schema-mutation.d.ts.map +1 -1
- package/dist/core/schema.d.ts +3 -1
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/scope.d.ts +25 -0
- package/dist/core/scope.d.ts.map +1 -0
- package/dist/core/storage.d.ts +83 -0
- package/dist/core/storage.d.ts.map +1 -0
- package/dist/core/strings.d.ts +34 -0
- package/dist/core/strings.d.ts.map +1 -0
- package/dist/core/svg-icon.d.ts +5 -4
- package/dist/core/svg-icon.d.ts.map +1 -1
- package/dist/core/usage.d.ts.map +1 -1
- package/dist/dispatch-SVt9Qb86.js +1382 -0
- package/dist/editor/index.js +1 -57606
- package/dist/{acorn-oIjaFBVA.js → encode-BHFEUCZ7.js} +273 -196
- package/dist/engine/index.js +128 -3409
- package/dist/format-BciVkjz-.js +118 -0
- package/dist/icon-symbol-D82I2EAb.js +13 -0
- package/dist/index-B1PShnsc.js +1 -132
- package/dist/index-B2WzdTzI.js +30 -14187
- package/dist/index-ButdD9Pf.js +5 -1825
- package/dist/index-CC1_5J9E.js +20 -0
- package/dist/index-DKF0siIz.js +33 -5483
- package/dist/index-q-7MEoHz.js +1 -47
- package/dist/index.js +1 -1
- package/dist/init.js +85 -81
- package/dist/integrations/vite/dev-server.d.ts.map +1 -1
- package/dist/integrations/vite/local-engine.d.ts +1 -1
- package/dist/integrations/vite/plugin.d.ts +3 -1
- package/dist/integrations/vite/plugin.d.ts.map +1 -1
- package/dist/local/disk-keys.d.ts +3 -0
- package/dist/local/disk-keys.d.ts.map +1 -0
- package/dist/local/disk.d.ts +16 -4
- package/dist/local/disk.d.ts.map +1 -1
- package/dist/local/dispatch.d.ts +6 -0
- package/dist/local/dispatch.d.ts.map +1 -1
- package/dist/local/schema-mutation.d.ts +8 -19
- package/dist/local/schema-mutation.d.ts.map +1 -1
- package/dist/local/setup.d.ts +6 -0
- package/dist/local/setup.d.ts.map +1 -1
- package/dist/local/store.d.ts +3 -0
- package/dist/local/store.d.ts.map +1 -0
- package/dist/mcp.js +90 -94
- package/dist/merge-Bk1X-G3W.js +45 -0
- package/dist/merge-record-C2RFnApc.js +36 -0
- package/dist/next/index.js +1 -1
- package/dist/operations-P-kTynGZ.js +1460 -0
- package/dist/plugin-Ba73V2fC.js +559 -0
- package/dist/runtime/boot.d.ts.map +1 -1
- package/dist/runtime/preview-sync.d.ts +10 -0
- package/dist/runtime/preview-sync.d.ts.map +1 -1
- package/dist/runtime/slot-format.d.ts.map +1 -1
- package/dist/runtime/values.d.ts +34 -2
- package/dist/runtime/values.d.ts.map +1 -1
- package/dist/runtime/wrap.d.ts +1 -1
- package/dist/runtime/wrap.d.ts.map +1 -1
- package/dist/runtime/wrap.js +4319 -3979
- package/dist/storage-D9hPzpMn.js +136 -0
- package/dist/store-wlYjWeY4.js +311 -0
- package/dist/upgrade-BVtnTG2H.js +59 -0
- package/dist/usage-CCy0FnoB.js +3558 -0
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
- package/skills/connect-okno/SKILL.md +22 -5
- package/skills/connect-okno/references/content.md +47 -10
- package/src/runtime/boot.ts +54 -8
- package/src/runtime/preview-sync.ts +73 -9
- package/src/runtime/slot-format.ts +3 -1
- package/src/runtime/values.ts +221 -90
- package/src/runtime/wrap.ts +1 -0
- package/dist/dispatch-dWn8cIFI.js +0 -1550
- package/dist/plugin-BAurTuo8.js +0 -538
- package/dist/schema-mutation-DQ7d4rmd.js +0 -675
- package/dist/schema-mutation-DXOYPQHt.js +0 -103
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://okno.build"><img src="https://okno.build/shareimage.jpg" alt="Okno: the best CMS is just your site" width="100%"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# Okno
|
|
6
|
+
|
|
7
|
+
**The best CMS is just your site.** Edit the page your visitors see. Your content stays in your own repository, and your site stays on your own hosting.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx okno
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
No dashboard. No lock-in. Press **E** on your running site and edit it in place.
|
|
14
|
+
|
|
15
|
+
## Start in three steps
|
|
16
|
+
|
|
17
|
+
1. **Install.** `npx okno` adds the plugin to your framework config and scaffolds your content folder. Your framework, repo and hosting stay exactly as they are.
|
|
18
|
+
2. **Open the window.** Run your site and press **E**. Okno signs you in with GitHub and sets up your first schema right there.
|
|
19
|
+
3. **Edit, then publish.** Change anything and hit publish. It commits to your repo and deploys the way it always has.
|
|
20
|
+
|
|
21
|
+
Your project needs a GitHub repository. You and your clients sign in with GitHub, so there are no new passwords.
|
|
22
|
+
|
|
23
|
+
## You write markup. Okno writes the content.
|
|
24
|
+
|
|
25
|
+
Pages, collections, globals, texts and blocks are created in the editor, not in code. Okno stores them as files in your repo's `okno/` folder, and every save is a Git commit. You never write a schema or a content file by hand.
|
|
26
|
+
|
|
27
|
+
Your part is the markup. Import an entry and spread a field onto the element that shows it:
|
|
28
|
+
|
|
29
|
+
```astro
|
|
30
|
+
---
|
|
31
|
+
import { home } from "okno/pages"
|
|
32
|
+
---
|
|
33
|
+
<h1 {...home.title}>{home.title}</h1>
|
|
34
|
+
<img {...home.cover} />
|
|
35
|
+
<a {...home.cta}>{home.cta}</a>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`{home.title}` renders the text. `{...home.title}` makes the element editable on your page. An image spread brings its source, alt text and dimensions; a link spread brings its destination.
|
|
39
|
+
|
|
40
|
+
**Start from markup.** Write the spread with your own text as the child, and Okno detects the field:
|
|
41
|
+
|
|
42
|
+
```astro
|
|
43
|
+
<h1 {...home.title}>Welcome</h1>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Open Detected in Structure, review the fields and create the entry. Your text becomes its first value. Then swap the child for `{home.title}`.
|
|
47
|
+
|
|
48
|
+
**Typed from your schema.** Field values, collections and blocks come with generated types, so a block component simply takes its block:
|
|
49
|
+
|
|
50
|
+
```astro
|
|
51
|
+
---
|
|
52
|
+
import type { articleCard } from "okno/blocks"
|
|
53
|
+
interface Props { card: articleCard }
|
|
54
|
+
const { card } = Astro.props
|
|
55
|
+
---
|
|
56
|
+
<article>
|
|
57
|
+
<h2 {...card.title}>{card.title}</h2>
|
|
58
|
+
</article>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Your framework renders.** Visitors get the pages your framework builds and never load the editor. Routes, rendering and deployment stay yours.
|
|
62
|
+
|
|
63
|
+
**AI agents included.** Connect an AI client over MCP and it reads and edits your content and schema through Okno, the same way the editor does:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
bunx --no-install okno mcp
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Works with
|
|
70
|
+
|
|
71
|
+
Astro, SvelteKit, Nuxt, Vue, React and anything else on **Vite**, plus **Next.js** through its own adapter.
|
|
72
|
+
|
|
73
|
+
## Save and publish
|
|
74
|
+
|
|
75
|
+
- **On your computer,** Save writes straight to your project files. Commit, push and deploy the way you always do.
|
|
76
|
+
- **On your live site,** Save goes to Okno's own working branch, and Publish sends everything saved to your production branch. Your host rebuilds the site as usual.
|
|
77
|
+
|
|
78
|
+
## Pricing
|
|
79
|
+
|
|
80
|
+
- **Local editing: free, forever.** Every feature, on your own machine.
|
|
81
|
+
- **Live editing: €10** for a 24-hour editing window, **never more than €200** per project a year.
|
|
82
|
+
- **No fees per editor or per language.** Browsing is always free.
|
|
83
|
+
|
|
84
|
+
[See pricing](https://okno.build/pricing) · [Compare with other CMSs](https://okno.build/compare)
|
|
85
|
+
|
|
86
|
+
## Docs
|
|
87
|
+
|
|
88
|
+
**The best way to learn Okno is inside Okno.** Interactive docs are built into the editor: press E on your site and open Docs. A step that says "press a button" hands you the actual button.
|
|
89
|
+
|
|
90
|
+
The same docs are on [okno.build/docs](https://okno.build/docs):
|
|
91
|
+
|
|
92
|
+
- [Editing](https://okno.build/docs/editing)
|
|
93
|
+
- [Content](https://okno.build/docs/concepts)
|
|
94
|
+
- [Fields](https://okno.build/docs/fields)
|
|
95
|
+
- [Rendering](https://okno.build/docs/rendering)
|
|
96
|
+
- [Languages](https://okno.build/docs/languages)
|
|
97
|
+
- [Publishing](https://okno.build/docs/publishing)
|
|
98
|
+
- [Team](https://okno.build/docs/team)
|
|
99
|
+
- [AI](https://okno.build/docs/mcp)
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
Free to use for local development. Editing a live site is a paid service under the [Okno terms](https://okno.build/terms).
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import"svelte/internal/disclose-version";import"svelte/internal/flags/async";import*as e from"svelte/internal/client";import{a5 as Br,a6 as Yr,x as Lr,a7 as Ur,F as bn,I as wn,n as Dn,D as Mn,B as Kt,t as xn,y as Wr}from"./index-CC1_5J9E.js";import{tick as $n,untrack as rt,hasContext as Zr,getContext as Qt,setContext as Nr,onMount as jr}from"svelte";import{on as kn}from"svelte/events";import{createSubscriber as Rr}from"svelte/reactivity";import{createAttachmentKey as Hr}from"svelte/attachments";function Me(n){return n!==null&&typeof n=="object"}const zr=["string","number","bigint","boolean"];function xe(n){return n==null||zr.includes(typeof n)?!0:Array.isArray(n)?n.every(t=>xe(t)):typeof n=="object"?Object.getPrototypeOf(n)===Object.prototype:!1}const $e=Symbol("box"),qr=Symbol("is-writable");function b(n,t){const r=e.derived(n);return t?{[$e]:!0,[qr]:!0,get current(){return e.get(r)},set current(s){t(s)}}:{[$e]:!0,get current(){return n()}}}function Jr(n){return Me(n)&&$e in n}function Gr(...n){return function(t){for(const r of n)if(r){if(t.defaultPrevented)return;typeof r=="function"?r.call(this,t):r.current?.call(this,t)}}}var Sn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Kr=/\n/g,Qr=/^\s*/,Xr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ts=/^:\s*/,es=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ns=/^[;\s]*/,rs=/^\s+|\s+$/g,ss=`
|
|
2
|
+
`,An="/",On="*",ht="",is="comment",as="declaration";function os(n,t){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];t=t||{};var r=1,s=1;function i(d){var f=d.match(Kr);f&&(r+=f.length);var x=d.lastIndexOf(ss);s=~x?d.length-x:s+d.length}function a(){var d={line:r,column:s};return function(f){return f.position=new o(d),p(),f}}function o(d){this.start=d,this.end={line:r,column:s},this.source=t.source}o.prototype.content=n;function c(d){var f=new Error(t.source+":"+r+":"+s+": "+d);if(f.reason=d,f.filename=t.source,f.line=r,f.column=s,f.source=n,!t.silent)throw f}function h(d){var f=d.exec(n);if(f){var x=f[0];return i(x),n=n.slice(x.length),f}}function p(){h(Qr)}function g(d){var f;for(d=d||[];f=y();)f!==!1&&d.push(f);return d}function y(){var d=a();if(!(An!=n.charAt(0)||On!=n.charAt(1))){for(var f=2;ht!=n.charAt(f)&&(On!=n.charAt(f)||An!=n.charAt(f+1));)++f;if(f+=2,ht===n.charAt(f-1))return c("End of comment missing");var x=n.slice(2,f-2);return s+=2,i(x),n=n.slice(f),s+=2,d({type:is,comment:x})}}function u(){var d=a(),f=h(Xr);if(f){if(y(),!h(ts))return c("property missing ':'");var x=h(es),v=d({type:as,property:Cn(f[0].replace(Sn,ht)),value:x?Cn(x[0].replace(Sn,ht)):ht});return h(ns),v}}function l(){var d=[];g(d);for(var f;f=u();)f!==!1&&(d.push(f),g(d));return d}return p(),l()}function Cn(n){return n?n.replace(rs,ht):ht}function ls(n,t){let r=null;if(!n||typeof n!="string")return r;const s=os(n),i=typeof t=="function";return s.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:c}=a;i?t(o,c,a):c&&(r=r||{},r[o]=c)}),r}const cs=/\d/,ds=["-","_","/","."];function us(n=""){if(!cs.test(n))return n!==n.toLowerCase()}function hs(n){const t=[];let r="",s,i;for(const a of n){const o=ds.includes(a);if(o===!0){t.push(r),r="",s=void 0;continue}const c=us(a);if(i===!1){if(s===!1&&c===!0){t.push(r),r=a,s=c;continue}if(s===!0&&c===!1&&r.length>1){const h=r.at(-1);t.push(r.slice(0,Math.max(0,r.length-1))),r=h+a,s=c;continue}}r+=a,s=c,i=o}return t.push(r),t}function _n(n){return n?hs(n).map(t=>fs(t)).join(""):""}function ps(n){return ms(_n(n||""))}function fs(n){return n?n[0].toUpperCase()+n.slice(1):""}function ms(n){return n?n[0].toLowerCase()+n.slice(1):""}function Xt(n){if(!n)return{};const t={};function r(s,i){if(s.startsWith("-moz-")||s.startsWith("-webkit-")||s.startsWith("-ms-")||s.startsWith("-o-")){t[_n(s)]=i;return}if(s.startsWith("--")){t[s]=i;return}t[ps(s)]=i}return ls(n,r),t}function gs(...n){return(...t)=>{for(const r of n)typeof r=="function"&&r(...t)}}function In(n){var t,r,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(t=0;t<i;t++)n[t]&&(r=In(n[t]))&&(s&&(s+=" "),s+=r)}else for(r in n)n[r]&&(s&&(s+=" "),s+=r);return s}function ke(){for(var n,t,r=0,s="",i=arguments.length;r<i;r++)(n=arguments[r])&&(t=In(n))&&(s&&(s+=" "),s+=t);return s}function ys(n,t){const r=RegExp(n,"g");return s=>{if(typeof s!="string")throw new TypeError(`expected an argument of type string, but got ${typeof s}`);return s.match(r)?s.replace(r,t):s}}const vs=ys(/[A-Z]/,n=>`-${n.toLowerCase()}`);function bs(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${vs(t)}: ${n[t]};`).join(`
|
|
3
|
+
`)}function Se(n={}){return bs(n).replace(`
|
|
4
|
+
`," ")}const ws=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Ds=new Set(ws);function Ms(n){return Ds.has(n)}function W(...n){const t={...n[0]};for(let r=1;r<n.length;r++){const s=n[r];if(s){for(const i of Object.keys(s)){const a=t[i],o=s[i],c=typeof a=="function",h=typeof o=="function";if(c&&Ms(i)){const p=a,g=o;t[i]=Gr(p,g)}else if(c&&h)t[i]=gs(a,o);else if(i==="class"){const p=xe(a),g=xe(o);p&&g?t[i]=ke(a,o):p?t[i]=ke(a):g&&(t[i]=ke(o))}else if(i==="style"){const p=typeof a=="object",g=typeof o=="object",y=typeof a=="string",u=typeof o=="string";if(p&&g)t[i]={...a,...o};else if(p&&u){const l=Xt(o);t[i]={...a,...l}}else if(y&&g){const l=Xt(a);t[i]={...l,...o}}else if(y&&u){const l=Xt(a),d=Xt(o);t[i]={...l,...d}}else p?t[i]=a:g?t[i]=o:y?t[i]=a:u&&(t[i]=o)}else t[i]=o!==void 0?o:a}for(const i of Object.getOwnPropertySymbols(s)){const a=t[i],o=s[i];t[i]=o!==void 0?o:a}}}return typeof t.style=="object"&&(t.style=Se(t.style).replaceAll(`
|
|
5
|
+
`," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const xs={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},$s=Se(xs);function En(n){$n().then(n)}const ks=9;function Ss(n){return Me(n)&&n.nodeType===ks}function As(n){return Me(n)&&n.constructor?.name==="VisualViewport"}function Tn(n){return Ss(n)?n:As(n)?n.document:n?.ownerDocument??document}function Os(n){let t=n.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}class Cs{element;#t=e.derived(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return e.get(this.#t)}set root(t){e.set(this.#t,t)}constructor(t){typeof t=="function"?this.element=b(t):this.element=t}getDocument=()=>Tn(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Os(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,r)=>this.getWindow().setTimeout(t,r);clearTimeout=t=>this.getWindow().clearTimeout(t)}function Z(n,t){return{[Hr()]:r=>Jr(n)?(n.current=r,rt(()=>t?.(r)),()=>{"isConnected"in r&&r.isConnected||(n.current=null)}):(n(r),rt(()=>t?.(r)),()=>{"isConnected"in r&&r.isConnected||n(null)})}}const _s=typeof window<"u"?window:void 0;function Is(n){let t=n.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}class Es{#t;#e;constructor(t={}){const{window:r=_s,document:s=r?.document}=t;r!==void 0&&(this.#t=s,this.#e=Rr(i=>{const a=kn(r,"focusin",i),o=kn(r,"focusout",i);return()=>{a(),o()}}))}get current(){return this.#e?.(),this.#t?Is(this.#t):null}}new Es;class Ae{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Zr(this.#e)}get(){const t=Qt(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const r=Qt(this.#e);return r===void 0?t:r}set(t){return Nr(this.#e,t)}}function Ts(n,t){switch(n){case"post":e.user_effect(t);break;case"pre":e.user_pre_effect(t);break}}function Vn(n,t,r,s={}){const{lazy:i=!1}=s;let a=!i,o=Array.isArray(n)?[]:void 0;Ts(t,()=>{const c=Array.isArray(n)?n.map(p=>p()):n();if(!a){a=!0,o=c;return}const h=rt(()=>r(c,o));return o=c,h})}function wt(n,t,r){Vn(n,"post",t,r)}function Vs(n,t,r){Vn(n,"pre",t,r)}wt.pre=Vs;function pt(n){return n?"true":"false"}function Ps(n){return n?"true":void 0}function S(n){return n?"":void 0}class Fs{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(r=>[r,this.getAttr(r)]))}getAttr(t,r){return r?`data-${r}-${t}`:`${this.#e}${t}`}selector(t,r){return`[${this.getAttr(t,r)}]`}}function Bs(n){const t=new Fs(n);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Pn="ArrowDown",Fn="ArrowLeft",Bn="ArrowRight",Yn="ArrowUp",Ys="Enter",Ls=" ",Oe=typeof document<"u";function Bt(n){return n instanceof HTMLElement}function Ln(){}function R(n,t){return`bits-${n}`}const Us=new Ae("BitsConfig");function Ws(){const n=new Zs(null,{});return Us.getOr(n).opts}class Zs{opts;constructor(t,r){const s=Ns(t,r);this.opts={defaultPortalTo:s(i=>i.defaultPortalTo),defaultLocale:s(i=>i.defaultLocale)}}}function Ns(n,t){return r=>b(()=>{const s=r(t)?.current;if(s!==void 0)return s;if(n!==null)return r(n.opts)?.current})}function js(n,t){return r=>{const s=Ws();return b(()=>{const i=r();if(i!==void 0)return i;const a=n(s).current;return a!==void 0?a:t})}}const Rs=js(n=>n.defaultLocale,"en");function Hs(n,t){const r=[];for(let s=0;s<n.length;s+=t)r.push(n.slice(s,s+t));return r}function Ce(n,t){return n>=0&&n<t.length}globalThis.bitsIdCounter??={current:0};function Un(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}function _e(n,t){return n-t*Math.floor(n/t)}const Wn=1721426;function te(n,t,r,s){t=Ie(n,t);let i=t-1,a=-2;return r<=2?a=0:ee(t)&&(a=-1),Wn-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*r-362)/12+a+s)}function ee(n){return n%4===0&&(n%100!==0||n%400===0)}function Ie(n,t){return n==="BC"?1-t:t}function zs(n){let t="AD";return n<=0&&(t="BC",n=1-n),[t,n]}const qs={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Dt{fromJulianDay(t){let r=t,s=r-Wn,i=Math.floor(s/146097),a=_e(s,146097),o=Math.floor(a/36524),c=_e(a,36524),h=Math.floor(c/1461),p=_e(c,1461),g=Math.floor(p/365),y=i*400+o*100+h*4+g+(o!==4&&g!==4?1:0),[u,l]=zs(y),d=r-te(u,l,1,1),f=2;r<te(u,l,3,1)?f=0:ee(l)&&(f=1);let x=Math.floor(((d+f)*12+373)/367),v=r-te(u,l,x,1)+1;return new K(u,l,x,v)}toJulianDay(t){return te(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return qs[ee(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ee(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const Js={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function st(n,t){return t=F(t,n.calendar),n.era===t.era&&n.year===t.year&&n.month===t.month&&n.day===t.day}function Ee(n,t){return t=F(t,n.calendar),n=Ve(n),t=Ve(t),n.era===t.era&&n.year===t.year&&n.month===t.month}function Gs(n,t){return n.isEqual?.(t)??t.isEqual?.(n)??n.identifier===t.identifier}function Ks(n,t){return st(n,Nn(t))}function Zn(n,t,r){let s=n.calendar.toJulianDay(n),i=ri(t),a=Math.ceil(s+1-i)%7;return a<0&&(a+=7),a}function Qs(n){return q(Date.now(),n)}function Nn(n){return ai(Qs(n))}function jn(n,t){return n.calendar.toJulianDay(n)-t.calendar.toJulianDay(t)}function Xs(n,t){return Rn(n)-Rn(t)}function Rn(n){return n.hour*36e5+n.minute*6e4+n.second*1e3+n.millisecond}let Te=null,ti=!1;function H(){return Te==null&&(Te=new Intl.DateTimeFormat().resolvedOptions().timeZone),Te}function Hn(){return ti}function Ve(n){return n.subtract({days:n.day-1})}function ei(n){return n.add({days:n.calendar.getDaysInMonth(n)-n.day})}const zn=new Map,Pe=new Map;function ni(n){if(Intl.Locale){let r=zn.get(n);return r||(r=new Intl.Locale(n).maximize().region,r&&zn.set(n,r)),r}let t=n.split("-")[1];return t==="u"?void 0:t}function ri(n){let t=Pe.get(n);if(!t){if(Intl.Locale){let s=new Intl.Locale(n);if("getWeekInfo"in s&&(t=s.getWeekInfo(),t))return Pe.set(n,t),t.firstDay}let r=ni(n);if(n.includes("-fw-")){let s=n.split("-fw-")[1].split("-")[0];s==="mon"?t={firstDay:1}:s==="tue"?t={firstDay:2}:s==="wed"?t={firstDay:3}:s==="thu"?t={firstDay:4}:s==="fri"?t={firstDay:5}:s==="sat"?t={firstDay:6}:t={firstDay:0}}else n.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:r&&Js[r]||0};Pe.set(n,t)}return t.firstDay}function it(n){n=F(n,new Dt);let t=Ie(n.era,n.year);return qn(t,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)}function qn(n,t,r,s,i,a,o){let c=new Date;return c.setUTCHours(s,i,a,o),c.setUTCFullYear(n,t-1,r),c.getTime()}function Yt(n,t){if(t==="UTC")return 0;if(n>0&&t===H()&&!Hn())return new Date(n).getTimezoneOffset()*-6e4;let{year:r,month:s,day:i,hour:a,minute:o,second:c}=Gn(n,t);return qn(r,s,i,a,o,c,0)-Math.floor(n/1e3)*1e3}const Jn=new Map;function Gn(n,t){let r=Jn.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Jn.set(t,r));let s=r.formatToParts(new Date(n)),i={};for(let a of s)a.type!=="literal"&&(i[a.type]=a.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const ne=864e5;function si(n,t){let r=it(n),s=r-Yt(r-ne,t),i=r-Yt(r+ne,t);return Kn(n,t,s,i)}function Kn(n,t,r,s){return(r===s?[r]:[r,s]).filter(i=>ii(n,t,i))}function ii(n,t,r){let s=Gn(r,t);return n.year===s.year&&n.month===s.month&&n.day===s.day&&n.hour===s.hour&&n.minute===s.minute&&n.second===s.second}function z(n,t,r="compatible"){let s=I(n);if(t==="UTC")return it(s);if(t===H()&&r==="compatible"&&!Hn()){s=F(s,new Dt);let h=new Date,p=Ie(s.era,s.year);return h.setFullYear(p,s.month-1,s.day),h.setHours(s.hour,s.minute,s.second,s.millisecond),h.getTime()}let i=it(s),a=Yt(i-ne,t),o=Yt(i+ne,t),c=Kn(s,t,i-a,i-o);if(c.length===1)return c[0];if(c.length>1)switch(r){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(r){case"earlier":return Math.min(i-a,i-o);case"compatible":case"later":return Math.max(i-a,i-o);case"reject":throw new RangeError("No such absolute time found")}}function Qn(n,t,r="compatible"){return new Date(z(n,t,r))}function q(n,t){let r=Yt(n,t),s=new Date(n+r),i=s.getUTCFullYear(),a=s.getUTCMonth()+1,o=s.getUTCDate(),c=s.getUTCHours(),h=s.getUTCMinutes(),p=s.getUTCSeconds(),g=s.getUTCMilliseconds();return new N(i<1?"BC":"AD",i<1?-i+1:i,a,o,t,r,c,h,p,g)}function ai(n){return new K(n.calendar,n.era,n.year,n.month,n.day)}function I(n,t){let r=0,s=0,i=0,a=0;if("timeZone"in n)({hour:r,minute:s,second:i,millisecond:a}=n);else if("hour"in n&&!t)return n;return t&&({hour:r,minute:s,second:i,millisecond:a}=t),new tt(n.calendar,n.era,n.year,n.month,n.day,r,s,i,a)}function F(n,t){if(Gs(n.calendar,t))return n;let r=t.fromJulianDay(n.calendar.toJulianDay(n)),s=n.copy();return s.calendar=t,s.era=r.era,s.year=r.year,s.month=r.month,s.day=r.day,ft(s),s}function oi(n,t,r){if(n instanceof N)return n.timeZone===t?n:Xn(n,t);let s=z(n,t,r);return q(s,t)}function li(n){let t=it(n)-n.offset;return new Date(t)}function Xn(n,t){let r=it(n)-n.offset;return F(q(r,t),n.calendar)}const Lt=36e5;function re(n,t){let r=n.copy(),s="hour"in r?hi(r,t):0;Fe(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,n),r.month+=t.months||0,Be(r),tr(r),r.day+=(t.weeks||0)*7,r.day+=t.days||0,r.day+=s,ci(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let i=r.calendar.getYearsInEra(r);if(r.year>i){let o=r.calendar.isInverseEra?.(r);r.year=i,r.month=o?1:r.calendar.getMonthsInYear(r),r.day=o?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let a=r.calendar.getMonthsInYear(r);return r.month>a&&(r.month=a,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function Fe(n,t){n.calendar.isInverseEra?.(n)&&(t=-t),n.year+=t}function Be(n){for(;n.month<1;)Fe(n,-1),n.month+=n.calendar.getMonthsInYear(n);let t=0;for(;n.month>(t=n.calendar.getMonthsInYear(n));)n.month-=t,Fe(n,1)}function ci(n){for(;n.day<1;)n.month--,Be(n),n.day+=n.calendar.getDaysInMonth(n);for(;n.day>n.calendar.getDaysInMonth(n);)n.day-=n.calendar.getDaysInMonth(n),n.month++,Be(n)}function tr(n){n.month=Math.max(1,Math.min(n.calendar.getMonthsInYear(n),n.month)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day))}function ft(n){n.calendar.constrainDate&&n.calendar.constrainDate(n),n.year=Math.max(1,Math.min(n.calendar.getYearsInEra(n),n.year)),tr(n)}function er(n){let t={};for(let r in n)typeof n[r]=="number"&&(t[r]=-n[r]);return t}function nr(n,t){return re(n,er(t))}function Ye(n,t){let r=n.copy();return t.era!=null&&(r.era=t.era),t.year!=null&&(r.year=t.year),t.month!=null&&(r.month=t.month),t.day!=null&&(r.day=t.day),ft(r),r}function se(n,t){let r=n.copy();return t.hour!=null&&(r.hour=t.hour),t.minute!=null&&(r.minute=t.minute),t.second!=null&&(r.second=t.second),t.millisecond!=null&&(r.millisecond=t.millisecond),ui(r),r}function di(n){n.second+=Math.floor(n.millisecond/1e3),n.millisecond=ie(n.millisecond,1e3),n.minute+=Math.floor(n.second/60),n.second=ie(n.second,60),n.hour+=Math.floor(n.minute/60),n.minute=ie(n.minute,60);let t=Math.floor(n.hour/24);return n.hour=ie(n.hour,24),t}function ui(n){n.millisecond=Math.max(0,Math.min(n.millisecond,1e3)),n.second=Math.max(0,Math.min(n.second,59)),n.minute=Math.max(0,Math.min(n.minute,59)),n.hour=Math.max(0,Math.min(n.hour,23))}function ie(n,t){let r=n%t;return r<0&&(r+=t),r}function hi(n,t){return n.hour+=t.hours||0,n.minute+=t.minutes||0,n.second+=t.seconds||0,n.millisecond+=t.milliseconds||0,di(n)}function Le(n,t,r,s){let i=n.copy();switch(t){case"era":{let a=n.calendar.getEras(),o=a.indexOf(n.era);if(o<0)throw new Error("Invalid era: "+n.era);o=Q(o,r,0,a.length-1,s?.round),i.era=a[o],ft(i);break}case"year":i.calendar.isInverseEra?.(i)&&(r=-r),i.year=Q(n.year,r,-1/0,9999,s?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,n);break;case"month":i.month=Q(n.month,r,1,n.calendar.getMonthsInYear(n),s?.round);break;case"day":i.day=Q(n.day,r,1,n.calendar.getDaysInMonth(n),s?.round);break;default:throw new Error("Unsupported field "+t)}return n.calendar.balanceDate&&n.calendar.balanceDate(i),ft(i),i}function rr(n,t,r,s){let i=n.copy();switch(t){case"hour":{let a=n.hour,o=0,c=23;if(s?.hourCycle===12){let h=a>=12;o=h?12:0,c=h?23:11}i.hour=Q(a,r,o,c,s?.round);break}case"minute":i.minute=Q(n.minute,r,0,59,s?.round);break;case"second":i.second=Q(n.second,r,0,59,s?.round);break;case"millisecond":i.millisecond=Q(n.millisecond,r,0,999,s?.round);break;default:throw new Error("Unsupported field "+t)}return i}function Q(n,t,r,s,i=!1){if(i){n+=Math.sign(t),n<r&&(n=s);let a=Math.abs(t);t>0?n=Math.ceil(n/a)*a:n=Math.floor(n/a)*a,n>s&&(n=r)}else n+=t,n<r?n=s-(r-n-1):n>s&&(n=r+(n-s-1));return n}function sr(n,t){let r;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let i=re(I(n),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});r=z(i,n.timeZone)}else r=it(n)-n.offset;r+=t.milliseconds||0,r+=(t.seconds||0)*1e3,r+=(t.minutes||0)*6e4,r+=(t.hours||0)*36e5;let s=q(r,n.timeZone);return F(s,n.calendar)}function pi(n,t){return sr(n,er(t))}function fi(n,t,r,s){switch(t){case"hour":{let i=0,a=23;if(s?.hourCycle===12){let d=n.hour>=12;i=d?12:0,a=d?23:11}let o=I(n),c=F(se(o,{hour:i}),new Dt),h=[z(c,n.timeZone,"earlier"),z(c,n.timeZone,"later")].filter(d=>q(d,n.timeZone).day===c.day)[0],p=F(se(o,{hour:a}),new Dt),g=[z(p,n.timeZone,"earlier"),z(p,n.timeZone,"later")].filter(d=>q(d,n.timeZone).day===p.day).pop(),y=it(n)-n.offset,u=Math.floor(y/Lt),l=y%Lt;return y=Q(u,r,Math.floor(h/Lt),Math.floor(g/Lt),s?.round)*Lt+l,F(q(y,n.timeZone),n.calendar)}case"minute":case"second":case"millisecond":return rr(n,t,r,s);case"era":case"year":case"month":case"day":{let i=Le(I(n),t,r,s),a=z(i,n.timeZone);return F(q(a,n.timeZone),n.calendar)}default:throw new Error("Unsupported field "+t)}}function mi(n,t,r){let s=I(n),i=se(Ye(s,t),t);if(i.compare(s)===0)return n;let a=z(i,n.timeZone,r);return F(q(a,n.timeZone),n.calendar)}const gi=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,yi=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,vi=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?\[(.*?)\]$/,Ue=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function ae(n){let t=n.match(gi);if(!t)throw Ue.test(n)?new Error(`Invalid ISO 8601 date string: ${n}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+n);let r=new K(M(t[1],0,9999),M(t[2],1,12),1);return r.day=M(t[3],1,r.calendar.getDaysInMonth(r)),r}function ir(n){let t=n.match(yi);if(!t)throw Ue.test(n)?new Error(`Invalid ISO 8601 date time string: ${n}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date time string: "+n);let r=M(t[1],-9999,9999),s=r<1?"BC":"AD",i=new tt(s,r<1?-r+1:r,M(t[2],1,12),1,t[4]?M(t[4],0,23):0,t[5]?M(t[5],0,59):0,t[6]?M(t[6],0,59):0,t[7]?M(t[7],0,1/0)*1e3:0);return i.day=M(t[3],0,i.calendar.getDaysInMonth(i)),i}function ar(n,t){let r=n.match(vi);if(!r)throw new Error("Invalid ISO 8601 date time string: "+n);let s=M(r[1],-9999,9999),i=s<1?"BC":"AD",a=new N(i,s<1?-s+1:s,M(r[2],1,12),1,r[11],0,r[4]?M(r[4],0,23):0,r[5]?M(r[5],0,59):0,r[6]?M(r[6],0,59):0,r[7]?M(r[7],0,1/0)*1e3:0);a.day=M(r[3],0,a.calendar.getDaysInMonth(a));let o=I(a),c;if(r[8]){let h=M(r[8],-23,23);if(a.offset=Math.sign(h)*(Math.abs(h)*36e5+M(r[9]??"0",0,59)*6e4+M(r[10]??"0",0,59)*1e3),c=it(a)-a.offset,!si(o,a.timeZone).includes(c))throw new Error(`Offset ${lr(a.offset)} is invalid for ${We(a)} in ${a.timeZone}`)}else c=z(I(o),a.timeZone,t);return q(c,a.timeZone)}function bi(n,t){let r=n.match(Ue);if(!r)throw new Error("Invalid ISO 8601 date time string: "+n);let s=M(r[1],-9999,9999),i=s<1?"BC":"AD",a=new N(i,s<1?-s+1:s,M(r[2],1,12),1,t,0,r[4]?M(r[4],0,23):0,r[5]?M(r[5],0,59):0,r[6]?M(r[6],0,59):0,r[7]?M(r[7],0,1/0)*1e3:0);return a.day=M(r[3],0,a.calendar.getDaysInMonth(a)),r[8]&&(a.offset=M(r[8],-23,23)*36e5+M(r[9]??"0",0,59)*6e4),Xn(a,t)}function M(n,t,r){let s=Number(n);if(s<t||s>r)throw new RangeError(`Value out of range: ${t} <= ${s} <= ${r}`);return s}function wi(n){return`${String(n.hour).padStart(2,"0")}:${String(n.minute).padStart(2,"0")}:${String(n.second).padStart(2,"0")}${n.millisecond?String(n.millisecond/1e3).slice(1):""}`}function or(n){let t=F(n,new Dt),r;return t.era==="BC"?r=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):r=String(t.year).padStart(4,"0"),`${r}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function We(n){return`${or(n)}T${wi(n)}`}function lr(n){let t=Math.sign(n)<0?"-":"+";n=Math.abs(n);let r=Math.floor(n/36e5),s=Math.floor(n%36e5/6e4),i=Math.floor(n%36e5%6e4/1e3),a=`${t}${String(r).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return i!==0&&(a+=`:${String(i).padStart(2,"0")}`),a}function Di(n){return`${We(n)}${lr(n.offset)}[${n.timeZone}]`}function Ze(n){let t=typeof n[0]=="object"?n.shift():new Dt,r;if(typeof n[0]=="string")r=n.shift();else{let o=t.getEras();r=o[o.length-1]}let s=n.shift(),i=n.shift(),a=n.shift();return[t,r,s,i,a]}class K{#t;constructor(...t){let[r,s,i,a,o]=Ze(t);this.calendar=r,this.era=s,this.year=i,this.month=a,this.day=o,ft(this)}copy(){return this.era?new K(this.calendar,this.era,this.year,this.month,this.day):new K(this.calendar,this.year,this.month,this.day)}add(t){return re(this,t)}subtract(t){return nr(this,t)}set(t){return Ye(this,t)}cycle(t,r,s){return Le(this,t,r,s)}toDate(t){return Qn(this,t)}toString(){return or(this)}compare(t){return jn(this,t)}}class tt{#t;constructor(...t){let[r,s,i,a,o]=Ze(t);this.calendar=r,this.era=s,this.year=i,this.month=a,this.day=o,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ft(this)}copy(){return this.era?new tt(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new tt(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return re(this,t)}subtract(t){return nr(this,t)}set(t){return Ye(se(this,t),t)}cycle(t,r,s){switch(t){case"era":case"year":case"month":case"day":return Le(this,t,r,s);default:return rr(this,t,r,s)}}toDate(t,r){return Qn(this,t,r)}toString(){return We(this)}compare(t){let r=jn(this,t);return r===0?Xs(this,I(t)):r}}class N{#t;constructor(...t){let[r,s,i,a,o]=Ze(t),c=t.shift(),h=t.shift();this.calendar=r,this.era=s,this.year=i,this.month=a,this.day=o,this.timeZone=c,this.offset=h,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ft(this)}copy(){return this.era?new N(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new N(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return sr(this,t)}subtract(t){return pi(this,t)}set(t,r){return mi(this,t,r)}cycle(t,r,s){return fi(this,t,r,s)}toDate(){return li(this)}toString(){return Di(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-oi(t,this.timeZone).toDate().getTime()}}let Ne=new Map;class J{constructor(t,r={}){this.formatter=cr(t,r),this.options=r}format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,r){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,r);if(r<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} \u2013 ${this.formatter.format(r)}`}formatRangeToParts(t,r){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,r);if(r<t)throw new RangeError("End date must be >= start date");let s=this.formatter.formatToParts(t),i=this.formatter.formatToParts(r);return[...s.map(a=>({...a,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...i.map(a=>({...a,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return $i()&&(this.resolvedHourCycle||(this.resolvedHourCycle=ki(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}}const Mi={true:{ja:"h11"},false:{}};function cr(n,t={}){if(typeof t.hour12=="boolean"&&xi()){t={...t};let i=Mi[String(t.hour12)][n.split("-")[0]],a=t.hour12?"h12":"h23";t.hourCycle=i??a,delete t.hour12}let r=n+(t?Object.entries(t).sort((i,a)=>i[0]<a[0]?-1:1).join():"");if(Ne.has(r))return Ne.get(r);let s=new Intl.DateTimeFormat(n,t);return Ne.set(r,s),s}let je=null;function xi(){return je==null&&(je=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),je}let Re=null;function $i(){return Re==null&&(Re=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Re}function ki(n,t){if(!t.timeStyle&&!t.hour)return;n=n.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),n+=(n.includes("-u-")?"":"-u")+"-nu-latn";let r=cr(n,{...t,timeZone:void 0}),s=parseInt(r.formatToParts(new Date(2020,2,3,0)).find(a=>a.type==="hour").value,10),i=parseInt(r.formatToParts(new Date(2020,2,3,23)).find(a=>a.type==="hour").value,10);if(s===0&&i===23)return"h23";if(s===24&&i===23)return"h24";if(s===0&&i===11)return"h11";if(s===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}function Si(n){if(!Oe||!n)return null;let t=n.querySelector("[data-bits-announcer]");const r=s=>{const i=n.createElement("div");return i.role="log",i.ariaLive=s,i.setAttribute("aria-relevant","additions"),i};if(!Bt(t)){const s=n.createElement("div");s.style.cssText=$s,s.setAttribute("data-bits-announcer",""),s.appendChild(r("assertive")),s.appendChild(r("polite")),t=s,n.body.insertBefore(t,n.body.firstChild)}return{getLog:s=>{if(!Bt(t))return null;const i=t.querySelector(`[aria-live="${s}"]`);return Bt(i)?i:null}}}function dr(n){const t=Si(n);function r(s,i="assertive",a=7500){if(!t||!Oe||!n)return;const o=t.getLog(i),c=n.createElement("div");return typeof s=="number"?s=s.toString():s===null?s="Empty":s=s.trim(),c.innerText=s,i==="assertive"?o?.replaceChildren(c):o?.appendChild(c),setTimeout(()=>{c.remove()},a)}return{announce:r}}const Ai={defaultValue:void 0,granularity:"day"};function Oi(n){const t={...Ai,...n},{defaultValue:r,granularity:s,minValue:i,maxValue:a}=t;if(Array.isArray(r)&&r.length)return r[r.length-1];if(r&&!Array.isArray(r))return r;{let o=new Date;i&&o<i.toDate(H())?o=i.toDate(H()):a&&o>a.toDate(H())&&(o=a.toDate(H()));const c=o.getFullYear(),h=o.getMonth()+1,p=o.getDate();return["hour","minute","second"].includes(s??"day")?new tt(c,h,p,0,0,0):new K(c,h,p)}}function ur(n,t){let r;return t instanceof N?r=ar(n):t instanceof tt?r=ir(n):r=ae(n),r.calendar!==t.calendar?F(r,t.calendar):r}function X(n,t=H()){return n instanceof N?n.toDate():n.toDate(t)}function Ci(n){if(n instanceof K)return"date";if(n instanceof tt)return"datetime";if(n instanceof N)return"zoneddatetime";throw new Error("Unknown date type")}function _i(n,t){switch(t){case"date":return ae(n);case"datetime":return ir(n);case"zoneddatetime":return ar(n);default:throw new Error(`Unknown date type: ${t}`)}}function Ii(n){return n instanceof tt}function hr(n){return n instanceof N}function He(n){return Ii(n)||hr(n)}function Ei(n){if(n instanceof Date){const t=n.getFullYear(),r=n.getMonth()+1;return new Date(t,r,0).getDate()}else return n.set({day:100}).day}function Ut(n,t){return n.compare(t)<0}function Ti(n,t){return n.compare(t)>0}function pr(n,t,r){const s=Zn(n,r);return t>s?n.subtract({days:s+7-t}):t===s?n:n.subtract({days:s-t})}function fr(n,t,r){const s=Zn(n,r),i=t===0?6:t-1;return s===i?n:s>i?n.add({days:7-s+i}):n.add({days:i-s})}const Vi={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};function Pi(n){let t=n.initialLocale;function r(l){t=l}function s(){return t}function i(l,d){return new J(t,d).format(l)}function a(l,d=!0){return He(l)&&d?i(X(l),{dateStyle:"long",timeStyle:"long"}):i(X(l),{dateStyle:"long"})}function o(l){if(typeof n.monthFormat.current!="function"&&typeof n.yearFormat.current!="function")return new J(t,{month:n.monthFormat.current,year:n.yearFormat.current}).format(l);const d=typeof n.monthFormat.current=="function"?n.monthFormat.current(l.getMonth()+1):new J(t,{month:n.monthFormat.current}).format(l),f=typeof n.yearFormat.current=="function"?n.yearFormat.current(l.getFullYear()):new J(t,{year:n.yearFormat.current}).format(l);return`${d} ${f}`}function c(l){return new J(t,{month:"long"}).format(l)}function h(l){return new J(t,{year:"numeric"}).format(l)}function p(l,d){return hr(l)?new J(t,{...d,timeZone:l.timeZone}).formatToParts(X(l)):new J(t,d).formatToParts(X(l))}function g(l,d="narrow"){return new J(t,{weekday:d}).format(l)}function y(l,d=void 0){return new J(t,{hour:"numeric",minute:"numeric",hourCycle:d===24?"h23":void 0}).formatToParts(l).find(f=>f.type==="dayPeriod")?.value==="PM"?"PM":"AM"}function u(l,d,f={}){const x={...Vi,...f},v=p(l,x).find(D=>D.type===d);return v?v.value:""}return{setLocale:r,getLocale:s,fullMonth:c,fullYear:h,fullMonthAndYear:o,toParts:p,custom:i,part:u,dayPeriod:y,selectedDate:a,dayOfWeek:g}}function Fi(n){return!(!Bt(n)||!n.hasAttribute("data-bits-day"))}function mr(n,t){const r=[];let s=n.add({days:1});const i=t;for(;s.compare(i)<0;)r.push(s),s=s.add({days:1});return r}function ze(n){const{dateObj:t,weekStartsOn:r,fixedWeeks:s,locale:i}=n,a=Ei(t),o=Array.from({length:a},(x,v)=>t.set({day:v+1})),c=Ve(t),h=ei(t),p=r!==void 0?pr(c,r,"en-US"):pr(c,0,i),g=r!==void 0?fr(h,r,"en-US"):fr(h,0,i),y=mr(p.subtract({days:1}),c),u=mr(h,g.add({days:1})),l=y.length+o.length+u.length;if(s&&l<42){const x=42-l;let v=u[u.length-1];v||(v=t.add({months:1}).set({day:1}));let D=x;u.length===0&&(D=x-1,u.push(v));const O=Array.from({length:D},(et,$)=>{const mt=$+1;return v.add({days:mt})});u.push(...O)}const d=y.concat(o,u),f=Hs(d,7);return{value:t,dates:d,weeks:f}}function Wt(n){const{numberOfMonths:t,dateObj:r,...s}=n,i=[];if(!t||t===1)return i.push(ze({...s,dateObj:r})),i;i.push(ze({...s,dateObj:r}));for(let a=1;a<t;a++){const o=r.add({months:a});i.push(ze({...s,dateObj:o}))}return i}function qe(n){return n?Array.from(n.querySelectorAll("[data-bits-day]:not([data-disabled]):not([data-outside-visible-months])")).filter(t=>Bt(t)):[]}function gr(n,t){const r=n.getAttribute("data-value");r&&(t.current=ur(r,t.current))}function Bi({node:n,add:t,placeholder:r,calendarNode:s,isPrevButtonDisabled:i,isNextButtonDisabled:a,months:o,numberOfMonths:c}){const h=qe(s);if(!h.length)return;const p=h.indexOf(n)+t;if(Ce(p,h)){const g=h[p];return gr(g,r),g.focus()}if(p<0){if(i)return;const g=o[0]?.value;if(!g)return;r.current=g.subtract({months:c}),En(()=>{const y=qe(s);if(!y.length)return;const u=y.length-Math.abs(p);if(Ce(u,y)){const l=y[u];return gr(l,r),l.focus()}})}if(p>=h.length){if(a)return;const g=o[0]?.value;if(!g)return;r.current=g.add({months:c}),En(()=>{const y=qe(s);if(!y.length)return;const u=p-h.length;if(Ce(u,y))return y[u].focus()})}}const yr=[Pn,Yn,Fn,Bn],vr=[Ys,Ls];function Yi({event:n,handleCellClick:t,shiftFocus:r,placeholderValue:s}){const i=n.target;if(!Fi(i)||!yr.includes(n.key)&&!vr.includes(n.key))return;n.preventDefault();const a={[Pn]:7,[Yn]:-7,[Fn]:-1,[Bn]:1};if(yr.includes(n.key)){const o=a[n.key];o!==void 0&&r(i,o)}if(vr.includes(n.key)){const o=i.getAttribute("data-value");if(!o)return;t(n,ur(o,s))}}function Li({months:n,setMonths:t,numberOfMonths:r,pagedNavigation:s,weekStartsOn:i,locale:a,fixedWeeks:o,setPlaceholder:c}){const h=n[0]?.value;if(h)if(s)c(h.add({months:r}));else{const p=h.add({months:1}),g=Wt({dateObj:p,weekStartsOn:i,locale:a,fixedWeeks:o,numberOfMonths:r});c(p),t(g)}}function Ui({months:n,setMonths:t,numberOfMonths:r,pagedNavigation:s,weekStartsOn:i,locale:a,fixedWeeks:o,setPlaceholder:c}){const h=n[0]?.value;if(h)if(s)c(h.subtract({months:r}));else{const p=h.subtract({months:1}),g=Wt({dateObj:p,weekStartsOn:i,locale:a,fixedWeeks:o,numberOfMonths:r});c(p),t(g)}}function Wi({months:n,formatter:t,weekdayFormat:r}){if(!n.length)return[];const s=n[0].weeks[0];return s?s.map(i=>t.dayOfWeek(X(i),r)):[]}function Zi(n){e.user_effect(()=>{const t=n.weekStartsOn.current,r=n.locale.current,s=n.fixedWeeks.current,i=n.numberOfMonths.current;rt(()=>{const a=n.placeholder.current;if(!a)return;const o={weekStartsOn:t,locale:r,fixedWeeks:s,numberOfMonths:i};n.setMonths(Wt({...o,dateObj:a}))})})}function Ni({calendarNode:n,label:t,accessibleHeadingId:r}){const s=Tn(n),i=s.createElement("div");i.style.cssText=Se({border:"0px",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"});const a=s.createElement("div");return a.textContent=t,a.id=r,a.role="heading",a.ariaLevel="2",n.insertBefore(i,n.firstChild),i.appendChild(a),()=>{const o=s.getElementById(r);o&&(i.parentElement?.removeChild(i),o.remove())}}function ji({placeholder:n,getVisibleMonths:t,weekStartsOn:r,locale:s,fixedWeeks:i,numberOfMonths:a,setMonths:o}){e.user_effect(()=>{n.current,rt(()=>{if(t().some(h=>Ee(h,n.current)))return;const c={weekStartsOn:r.current,locale:s.current,fixedWeeks:i.current,numberOfMonths:a.current};o(Wt({...c,dateObj:n.current}))})})}function Ri({maxValue:n,months:t,disabled:r}){if(!n||!t.length)return!1;if(r)return!0;const s=t[t.length-1]?.value;if(!s)return!1;const i=s.add({months:1}).set({day:1});return Ti(i,n)}function Hi({minValue:n,months:t,disabled:r}){if(!n||!t.length)return!1;if(r)return!0;const s=t[0]?.value;if(!s)return!1;const i=s.subtract({months:1}).set({day:35});return Ut(i,n)}function zi({months:n,locale:t,formatter:r}){if(!n.length)return"";if(t!==r.getLocale()&&r.setLocale(t),n.length===1){const p=X(n[0].value);return`${r.fullMonthAndYear(p)}`}const s=X(n[0].value),i=X(n[n.length-1].value),a=r.fullMonth(s),o=r.fullMonth(i),c=r.fullYear(s),h=r.fullYear(i);return c===h?`${a} - ${o} ${h}`:`${a} ${c} - ${o} ${h}`}function qi({fullCalendarLabel:n,id:t,isInvalid:r,disabled:s,readonly:i}){return{id:t,role:"application","aria-label":n,"data-invalid":S(r),"data-disabled":S(s),"data-readonly":S(i)}}function Ji(n){if(!Oe)return;const t=Array.from(n.querySelectorAll("[data-bits-day]:not([aria-disabled=true])"));if(t.length===0)return;const r=t[0],s=r?.getAttribute("data-value"),i=r?.getAttribute("data-type");if(!(!s||!i))return _i(s,i)}function Gi({ref:n,placeholder:t,defaultPlaceholder:r,minValue:s,maxValue:i,isDateDisabled:a}){function o(c){return!!(a.current(c)||s.current&&Ut(c,s.current)||i.current&&Ut(i.current,c))}wt(()=>n.current,()=>{n.current&&t.current&&st(t.current,r)&&o(r)&&(t.current=Ji(n.current)??r)})}function Ki(n,t){return!n||!t?n:He(n)&&He(t)?n.set({hour:t.hour,minute:t.minute,millisecond:t.millisecond,second:t.second}):n}const Qi=Bs({component:"calendar",parts:["root","grid","cell","next-button","prev-button","day","grid-body","grid-head","grid-row","head-cell","header","heading","month-select","year-select"]});function Xi(n){const t=new Date().getFullYear(),r=Math.max(n.placeholderYear,t);let s,i;if(n.minValue)s=n.minValue.year;else{const o=r-100;s=n.placeholderYear<o?n.placeholderYear-10:o}n.maxValue?i=n.maxValue.year:i=r+10,s>i&&(s=i);const a=i-s+1;return Array.from({length:a},(o,c)=>s+c)}const G=new Ae("Calendar.Root | RangeCalender.Root");class Ge{static create(t){return G.set(new Ge(t))}opts;#t=e.derived(()=>this.months.map(t=>t.value));get visibleMonths(){return e.get(this.#t)}set visibleMonths(t){e.set(this.#t,t)}formatter;accessibleHeadingId=Un();domContext;attachment;#e=e.state(e.proxy([]));get months(){return e.get(this.#e)}set months(t){e.set(this.#e,t,!0)}announcer;constructor(t){this.opts=t,this.attachment=Z(this.opts.ref),this.domContext=new Cs(t.ref),this.announcer=dr(null),this.formatter=Pi({initialLocale:this.opts.locale.current,monthFormat:this.opts.monthFormat,yearFormat:this.opts.yearFormat}),this.setMonths=this.setMonths.bind(this),this.nextPage=this.nextPage.bind(this),this.prevPage=this.prevPage.bind(this),this.prevYear=this.prevYear.bind(this),this.nextYear=this.nextYear.bind(this),this.setYear=this.setYear.bind(this),this.setMonth=this.setMonth.bind(this),this.isOutsideVisibleMonths=this.isOutsideVisibleMonths.bind(this),this.isDateDisabled=this.isDateDisabled.bind(this),this.isDateSelected=this.isDateSelected.bind(this),this.shiftFocus=this.shiftFocus.bind(this),this.handleCellClick=this.handleCellClick.bind(this),this.handleMultipleUpdate=this.handleMultipleUpdate.bind(this),this.handleSingleUpdate=this.handleSingleUpdate.bind(this),this.onkeydown=this.onkeydown.bind(this),this.getBitsAttr=this.getBitsAttr.bind(this),jr(()=>{this.announcer=dr(this.domContext.getDocument())}),this.months=Wt({dateObj:this.opts.placeholder.current,weekStartsOn:this.opts.weekStartsOn.current,locale:this.opts.locale.current,fixedWeeks:this.opts.fixedWeeks.current,numberOfMonths:this.opts.numberOfMonths.current}),this.#d(),this.#u(),this.#h(),ji({placeholder:this.opts.placeholder,getVisibleMonths:()=>this.visibleMonths,weekStartsOn:this.opts.weekStartsOn,locale:this.opts.locale,fixedWeeks:this.opts.fixedWeeks,numberOfMonths:this.opts.numberOfMonths,setMonths:r=>this.months=r}),Zi({fixedWeeks:this.opts.fixedWeeks,locale:this.opts.locale,numberOfMonths:this.opts.numberOfMonths,placeholder:this.opts.placeholder,setMonths:this.setMonths,weekStartsOn:this.opts.weekStartsOn}),wt(()=>this.fullCalendarLabel,r=>{const s=this.domContext.getElementById(this.accessibleHeadingId);s&&(s.textContent=r)}),wt(()=>this.opts.value.current,()=>{const r=this.opts.value.current;if(Array.isArray(r)&&r.length){const s=r[r.length-1];s&&this.opts.placeholder.current!==s&&(this.opts.placeholder.current=s)}else!Array.isArray(r)&&r&&this.opts.placeholder.current!==r&&(this.opts.placeholder.current=r)}),Gi({placeholder:t.placeholder,defaultPlaceholder:t.defaultPlaceholder,isDateDisabled:t.isDateDisabled,maxValue:t.maxValue,minValue:t.minValue,ref:t.ref})}setMonths(t){this.months=t}#n=e.derived(()=>Wi({months:this.months,formatter:this.formatter,weekdayFormat:this.opts.weekdayFormat.current}));get weekdays(){return e.get(this.#n)}set weekdays(t){e.set(this.#n,t)}#r=e.derived(()=>rt(()=>this.opts.placeholder.current.year));get initialPlaceholderYear(){return e.get(this.#r)}set initialPlaceholderYear(t){e.set(this.#r,t)}#s=e.derived(()=>Xi({minValue:this.opts.minValue.current,maxValue:this.opts.maxValue.current,placeholderYear:this.initialPlaceholderYear}));get defaultYears(){return e.get(this.#s)}set defaultYears(t){e.set(this.#s,t)}#d(){e.user_effect(()=>{if(rt(()=>this.opts.initialFocus.current)){const t=this.opts.ref.current?.querySelector("[data-focused]");t&&t.focus()}})}#u(){e.user_effect(()=>this.opts.ref.current?Ni({calendarNode:this.opts.ref.current,label:this.fullCalendarLabel,accessibleHeadingId:this.accessibleHeadingId}):void 0)}#h(){e.user_pre_effect(()=>{this.formatter.getLocale()!==this.opts.locale.current&&this.formatter.setLocale(this.opts.locale.current)})}nextPage(){Li({fixedWeeks:this.opts.fixedWeeks.current,locale:this.opts.locale.current,numberOfMonths:this.opts.numberOfMonths.current,pagedNavigation:this.opts.pagedNavigation.current,setMonths:this.setMonths,setPlaceholder:t=>this.opts.placeholder.current=t,weekStartsOn:this.opts.weekStartsOn.current,months:this.months})}prevPage(){Ui({fixedWeeks:this.opts.fixedWeeks.current,locale:this.opts.locale.current,numberOfMonths:this.opts.numberOfMonths.current,pagedNavigation:this.opts.pagedNavigation.current,setMonths:this.setMonths,setPlaceholder:t=>this.opts.placeholder.current=t,weekStartsOn:this.opts.weekStartsOn.current,months:this.months})}nextYear(){this.opts.placeholder.current=this.opts.placeholder.current.add({years:1})}prevYear(){this.opts.placeholder.current=this.opts.placeholder.current.subtract({years:1})}setYear(t){this.opts.placeholder.current=this.opts.placeholder.current.set({year:t})}setMonth(t){this.opts.placeholder.current=this.opts.placeholder.current.set({month:t})}#i=e.derived(()=>Ri({maxValue:this.opts.maxValue.current,months:this.months,disabled:this.opts.disabled.current}));get isNextButtonDisabled(){return e.get(this.#i)}set isNextButtonDisabled(t){e.set(this.#i,t)}#a=e.derived(()=>Hi({minValue:this.opts.minValue.current,months:this.months,disabled:this.opts.disabled.current}));get isPrevButtonDisabled(){return e.get(this.#a)}set isPrevButtonDisabled(t){e.set(this.#a,t)}#o=e.derived(()=>{const t=this.opts.value.current,r=this.opts.isDateDisabled.current,s=this.opts.isDateUnavailable.current;if(Array.isArray(t)){if(!t.length)return!1;for(const i of t)if(r(i)||s(i))return!0}else{if(!t)return!1;if(r(t)||s(t))return!0}return!1});get isInvalid(){return e.get(this.#o)}set isInvalid(t){e.set(this.#o,t)}#l=e.derived(()=>(this.opts.monthFormat.current,this.opts.yearFormat.current,zi({months:this.months,formatter:this.formatter,locale:this.opts.locale.current})));get headingValue(){return e.get(this.#l)}set headingValue(t){e.set(this.#l,t)}#c=e.derived(()=>`${this.opts.calendarLabel.current} ${this.headingValue}`);get fullCalendarLabel(){return e.get(this.#c)}set fullCalendarLabel(t){e.set(this.#c,t)}isOutsideVisibleMonths(t){return!this.visibleMonths.some(r=>Ee(t,r))}isDateDisabled(t){if(this.opts.isDateDisabled.current(t)||this.opts.disabled.current)return!0;const r=this.opts.minValue.current,s=this.opts.maxValue.current;return!!(r&&Ut(t,r)||s&&Ut(s,t))}isDateSelected(t){const r=this.opts.value.current;return Array.isArray(r)?r.some(s=>st(s,t)):r?st(r,t):!1}shiftFocus(t,r){return Bi({node:t,add:r,placeholder:this.opts.placeholder,calendarNode:this.opts.ref.current,isPrevButtonDisabled:this.isPrevButtonDisabled,isNextButtonDisabled:this.isNextButtonDisabled,months:this.months,numberOfMonths:this.opts.numberOfMonths.current})}#p(t){if(this.opts.type.current!=="multiple"||!this.opts.maxDays.current)return!0;const r=t.length;return!(this.opts.maxDays.current&&r>this.opts.maxDays.current)}handleCellClick(t,r){if(this.opts.readonly.current||this.opts.isDateDisabled.current?.(r)||this.opts.isDateUnavailable.current?.(r))return;const s=this.opts.value.current;if(this.opts.type.current==="multiple")(Array.isArray(s)||s===void 0)&&(this.opts.value.current=this.handleMultipleUpdate(s,r));else if(!Array.isArray(s)){const i=this.handleSingleUpdate(s,r);i?this.announcer.announce(`Selected Date: ${this.formatter.selectedDate(i,!1)}`,"polite"):this.announcer.announce("Selected date is now empty.","polite",5e3),this.opts.value.current=Ki(i,s),i!==void 0&&this.opts.onDateSelect?.current?.()}}handleMultipleUpdate(t,r){if(!t){const a=[r];return this.#p(a)?a:[r]}if(!Array.isArray(t))return;const s=t.findIndex(a=>st(a,r)),i=this.opts.preventDeselect.current;if(s===-1){const a=[...t,r];return this.#p(a)?a:[r]}else{if(i)return t;{const a=t.filter(o=>!st(o,r));if(!a.length){this.opts.placeholder.current=r;return}return a}}}handleSingleUpdate(t,r){if(!t)return r;if(!this.opts.preventDeselect.current&&st(t,r)){this.opts.placeholder.current=r;return}return r}onkeydown(t){Yi({event:t,handleCellClick:this.handleCellClick,shiftFocus:this.shiftFocus,placeholderValue:this.opts.placeholder.current})}#f=e.derived(()=>({months:this.months,weekdays:this.weekdays}));get snippetProps(){return e.get(this.#f)}set snippetProps(t){e.set(this.#f,t)}getBitsAttr=t=>Qi.getAttr(t);#m=e.derived(()=>({...qi({fullCalendarLabel:this.fullCalendarLabel,id:this.opts.id.current,isInvalid:this.isInvalid,disabled:this.opts.disabled.current,readonly:this.opts.readonly.current}),[this.getBitsAttr("root")]:"",onkeydown:this.onkeydown,...this.attachment}));get props(){return e.get(this.#m)}set props(t){e.set(this.#m,t)}}class Ke{static create(t){return new Ke(t,G.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Z(this.opts.ref)}#t=e.derived(()=>({id:this.opts.id.current,"aria-hidden":Ps(!0),"data-disabled":S(this.root.opts.disabled.current),"data-readonly":S(this.root.opts.readonly.current),[this.root.getBitsAttr("heading")]:"",...this.attachment}));get props(){return e.get(this.#t)}set props(t){e.set(this.#t,t)}}const br=new Ae("Calendar.Cell | RangeCalendar.Cell");class Qe{static create(t){return br.set(new Qe(t,G.get()))}opts;root;#t=e.derived(()=>X(this.opts.date.current));get cellDate(){return e.get(this.#t)}set cellDate(t){e.set(this.#t,t)}#e=e.derived(()=>this.root.opts.isDateUnavailable.current(this.opts.date.current));get isUnavailable(){return e.get(this.#e)}set isUnavailable(t){e.set(this.#e,t)}#n=e.derived(()=>Ks(this.opts.date.current,H()));get isDateToday(){return e.get(this.#n)}set isDateToday(t){e.set(this.#n,t)}#r=e.derived(()=>!Ee(this.opts.date.current,this.opts.month.current));get isOutsideMonth(){return e.get(this.#r)}set isOutsideMonth(t){e.set(this.#r,t)}#s=e.derived(()=>this.root.isOutsideVisibleMonths(this.opts.date.current));get isOutsideVisibleMonths(){return e.get(this.#s)}set isOutsideVisibleMonths(t){e.set(this.#s,t)}#d=e.derived(()=>this.root.isDateDisabled(this.opts.date.current)||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current);get isDisabled(){return e.get(this.#d)}set isDisabled(t){e.set(this.#d,t)}#u=e.derived(()=>st(this.opts.date.current,this.root.opts.placeholder.current));get isFocusedDate(){return e.get(this.#u)}set isFocusedDate(t){e.set(this.#u,t)}#h=e.derived(()=>this.root.isDateSelected(this.opts.date.current));get isSelectedDate(){return e.get(this.#h)}set isSelectedDate(t){e.set(this.#h,t)}#i=e.derived(()=>this.root.formatter.custom(this.cellDate,{weekday:"long",month:"long",day:"numeric",year:"numeric"}));get labelText(){return e.get(this.#i)}set labelText(t){e.set(this.#i,t)}attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Z(this.opts.ref)}#a=e.derived(()=>({disabled:this.isDisabled,unavailable:this.isUnavailable,selected:this.isSelectedDate,day:`${this.opts.date.current.day}`}));get snippetProps(){return e.get(this.#a)}set snippetProps(t){e.set(this.#a,t)}#o=e.derived(()=>this.isDisabled||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current||this.isUnavailable);get ariaDisabled(){return e.get(this.#o)}set ariaDisabled(t){e.set(this.#o,t)}#l=e.derived(()=>({"data-unavailable":S(this.isUnavailable),"data-today":this.isDateToday?"":void 0,"data-outside-month":this.isOutsideMonth?"":void 0,"data-outside-visible-months":this.isOutsideVisibleMonths?"":void 0,"data-focused":this.isFocusedDate?"":void 0,"data-selected":S(this.isSelectedDate),"data-value":this.opts.date.current.toString(),"data-type":Ci(this.opts.date.current),"data-disabled":S(this.isDisabled||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current)}));get sharedDataAttrs(){return e.get(this.#l)}set sharedDataAttrs(t){e.set(this.#l,t)}#c=e.derived(()=>({id:this.opts.id.current,role:"gridcell","aria-selected":pt(this.isSelectedDate),"aria-disabled":pt(this.ariaDisabled),...this.sharedDataAttrs,[this.root.getBitsAttr("cell")]:"",...this.attachment}));get props(){return e.get(this.#c)}set props(t){e.set(this.#c,t)}}class Xe{static create(t){return new Xe(t,br.get())}opts;cell;attachment;constructor(t,r){this.opts=t,this.cell=r,this.onclick=this.onclick.bind(this),this.attachment=Z(this.opts.ref)}#t=e.derived(()=>this.cell.isOutsideMonth&&this.cell.root.opts.disableDaysOutsideMonth.current||this.cell.isDisabled?void 0:this.cell.isFocusedDate?0:-1);onclick(t){this.cell.isDisabled||this.cell.root.handleCellClick(t,this.cell.opts.date.current)}#e=e.derived(()=>({disabled:this.cell.isDisabled,unavailable:this.cell.isUnavailable,selected:this.cell.isSelectedDate,day:`${this.cell.opts.date.current.day}`}));get snippetProps(){return e.get(this.#e)}set snippetProps(t){e.set(this.#e,t)}#n=e.derived(()=>({id:this.opts.id.current,role:"button","aria-label":this.cell.labelText,"aria-disabled":pt(this.cell.ariaDisabled),...this.cell.sharedDataAttrs,tabindex:e.get(this.#t),[this.cell.root.getBitsAttr("day")]:"","data-bits-day":"",onclick:this.onclick,...this.attachment}));get props(){return e.get(this.#n)}set props(t){e.set(this.#n,t)}}class tn{static create(t){return new tn(t,G.get())}opts;root;#t=e.derived(()=>this.root.isNextButtonDisabled);get isDisabled(){return e.get(this.#t)}set isDisabled(t){e.set(this.#t,t)}attachment;constructor(t,r){this.opts=t,this.root=r,this.onclick=this.onclick.bind(this),this.attachment=Z(this.opts.ref)}onclick(t){this.isDisabled||this.root.nextPage()}#e=e.derived(()=>({id:this.opts.id.current,role:"button",type:"button","aria-label":"Next","aria-disabled":pt(this.isDisabled),"data-disabled":S(this.isDisabled),disabled:this.isDisabled,[this.root.getBitsAttr("next-button")]:"",onclick:this.onclick,...this.attachment}));get props(){return e.get(this.#e)}set props(t){e.set(this.#e,t)}}class en{static create(t){return new en(t,G.get())}opts;root;#t=e.derived(()=>this.root.isPrevButtonDisabled);get isDisabled(){return e.get(this.#t)}set isDisabled(t){e.set(this.#t,t)}attachment;constructor(t,r){this.opts=t,this.root=r,this.onclick=this.onclick.bind(this),this.attachment=Z(this.opts.ref)}onclick(t){this.isDisabled||this.root.prevPage()}#e=e.derived(()=>({id:this.opts.id.current,role:"button",type:"button","aria-label":"Previous","aria-disabled":pt(this.isDisabled),"data-disabled":S(this.isDisabled),disabled:this.isDisabled,[this.root.getBitsAttr("prev-button")]:"",onclick:this.onclick,...this.attachment}));get props(){return e.get(this.#e)}set props(t){e.set(this.#e,t)}}class nn{static create(t){return new nn(t,G.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Z(this.opts.ref)}#t=e.derived(()=>({id:this.opts.id.current,tabindex:-1,role:"grid","aria-readonly":pt(this.root.opts.readonly.current),"aria-disabled":pt(this.root.opts.disabled.current),"data-readonly":S(this.root.opts.readonly.current),"data-disabled":S(this.root.opts.disabled.current),[this.root.getBitsAttr("grid")]:"",...this.attachment}));get props(){return e.get(this.#t)}set props(t){e.set(this.#t,t)}}class rn{static create(t){return new rn(t,G.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Z(this.opts.ref)}#t=e.derived(()=>({id:this.opts.id.current,"data-disabled":S(this.root.opts.disabled.current),"data-readonly":S(this.root.opts.readonly.current),[this.root.getBitsAttr("grid-body")]:"",...this.attachment}));get props(){return e.get(this.#t)}set props(t){e.set(this.#t,t)}}class sn{static create(t){return new sn(t,G.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Z(this.opts.ref)}#t=e.derived(()=>({id:this.opts.id.current,"data-disabled":S(this.root.opts.disabled.current),"data-readonly":S(this.root.opts.readonly.current),[this.root.getBitsAttr("grid-head")]:"",...this.attachment}));get props(){return e.get(this.#t)}set props(t){e.set(this.#t,t)}}class an{static create(t){return new an(t,G.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Z(this.opts.ref)}#t=e.derived(()=>({id:this.opts.id.current,"data-disabled":S(this.root.opts.disabled.current),"data-readonly":S(this.root.opts.readonly.current),[this.root.getBitsAttr("grid-row")]:"",...this.attachment}));get props(){return e.get(this.#t)}set props(t){e.set(this.#t,t)}}class on{static create(t){return new on(t,G.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Z(this.opts.ref)}#t=e.derived(()=>({id:this.opts.id.current,"data-disabled":S(this.root.opts.disabled.current),"data-readonly":S(this.root.opts.readonly.current),[this.root.getBitsAttr("head-cell")]:"",...this.attachment}));get props(){return e.get(this.#t)}set props(t){e.set(this.#t,t)}}var ta=new Set(["$$slots","$$events","$$legacy","child","children","id","ref","value","onValueChange","placeholder","onPlaceholderChange","weekdayFormat","weekStartsOn","pagedNavigation","isDateDisabled","isDateUnavailable","fixedWeeks","numberOfMonths","locale","calendarLabel","disabled","readonly","minValue","maxValue","preventDeselect","type","disableDaysOutsideMonth","initialFocus","maxDays","monthFormat","yearFormat"]),ea=e.from_html("<div><!></div>");function na(n,t){e.push(t,!0);let r=e.prop(t,"id",19,Un),s=e.prop(t,"ref",15,null),i=e.prop(t,"value",15),a=e.prop(t,"onValueChange",3,Ln),o=e.prop(t,"placeholder",15),c=e.prop(t,"onPlaceholderChange",3,Ln),h=e.prop(t,"weekdayFormat",3,"narrow"),p=e.prop(t,"pagedNavigation",3,!1),g=e.prop(t,"isDateDisabled",3,()=>!1),y=e.prop(t,"isDateUnavailable",3,()=>!1),u=e.prop(t,"fixedWeeks",3,!1),l=e.prop(t,"numberOfMonths",3,1),d=e.prop(t,"calendarLabel",3,"Event"),f=e.prop(t,"disabled",3,!1),x=e.prop(t,"readonly",3,!1),v=e.prop(t,"minValue",3,void 0),D=e.prop(t,"maxValue",3,void 0),O=e.prop(t,"preventDeselect",3,!1),et=e.prop(t,"disableDaysOutsideMonth",3,!0),$=e.prop(t,"initialFocus",3,!1),mt=e.prop(t,"monthFormat",3,"long"),Mt=e.prop(t,"yearFormat",3,"numeric"),at=e.rest_props(t,ta);const gt=Oi({defaultValue:i(),minValue:v(),maxValue:D()});function xt(){o()===void 0&&o(gt)}xt(),wt.pre(()=>o(),()=>{xt()});function ot(){i()===void 0&&i(t.type==="single"?void 0:[])}ot(),wt.pre(()=>i(),()=>{ot()});const $t=Ge.create({id:b(()=>r()),ref:b(()=>s(),A=>s(A)),weekdayFormat:b(()=>h()),weekStartsOn:b(()=>t.weekStartsOn),pagedNavigation:b(()=>p()),isDateDisabled:b(()=>g()),isDateUnavailable:b(()=>y()),fixedWeeks:b(()=>u()),numberOfMonths:b(()=>l()),locale:Rs(()=>t.locale),calendarLabel:b(()=>d()),readonly:b(()=>x()),disabled:b(()=>f()),minValue:b(()=>v()),maxValue:b(()=>D()),disableDaysOutsideMonth:b(()=>et()),initialFocus:b(()=>$()),maxDays:b(()=>t.maxDays),placeholder:b(()=>o(),A=>{o(A),c()(A)}),preventDeselect:b(()=>O()),value:b(()=>i(),A=>{i(A),a()(A)}),type:b(()=>t.type),monthFormat:b(()=>mt()),yearFormat:b(()=>Mt()),defaultPlaceholder:gt}),lt=e.derived(()=>W(at,$t.props));var kt=e.comment(),oe=e.first_child(kt);{var ct=A=>{var L=e.comment(),yt=e.first_child(L);{let le=e.derived(()=>({props:e.get(lt),...$t.snippetProps}));e.snippet(yt,()=>t.child,()=>e.get(le))}e.append(A,L)},St=A=>{var L=ea();e.attribute_effect(L,()=>({...e.get(lt)}));var yt=e.child(L);e.snippet(yt,()=>t.children??e.noop,()=>$t.snippetProps),e.reset(L),e.append(A,L)};e.if(oe,A=>{t.child?A(ct):A(St,-1)})}e.append(n,kt),e.pop()}var ra=new Set(["$$slots","$$events","$$legacy","children","child","ref","id"]),sa=e.from_html("<div><!></div>");function ia(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"ref",15,null),i=e.prop(t,"id",19,()=>R(r)),a=e.rest_props(t,ra);const o=Xe.create({id:b(()=>i()),ref:b(()=>s(),u=>s(u))}),c=e.derived(()=>W(a,o.props));var h=e.comment(),p=e.first_child(h);{var g=u=>{var l=e.comment(),d=e.first_child(l);{let f=e.derived(()=>({props:e.get(c),...o.snippetProps}));e.snippet(d,()=>t.child,()=>e.get(f))}e.append(u,l)},y=u=>{var l=sa();e.attribute_effect(l,()=>({...e.get(c)}));var d=e.child(l);{var f=v=>{var D=e.comment(),O=e.first_child(D);e.snippet(O,()=>t.children??e.noop,()=>o.snippetProps),e.append(v,D)},x=v=>{var D=e.text();e.template_effect(()=>e.set_text(D,o.cell.opts.date.current.day)),e.append(v,D)};e.if(d,v=>{t.children?v(f):v(x,-1)})}e.reset(l),e.append(u,l)};e.if(p,u=>{t.child?u(g):u(y,-1)})}e.append(n,h),e.pop()}var aa=new Set(["$$slots","$$events","$$legacy","children","child","ref","id"]),oa=e.from_html("<table><!></table>");function la(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"ref",15,null),i=e.prop(t,"id",19,()=>R(r)),a=e.rest_props(t,aa);const o=nn.create({id:b(()=>i()),ref:b(()=>s(),u=>s(u))}),c=e.derived(()=>W(a,o.props));var h=e.comment(),p=e.first_child(h);{var g=u=>{var l=e.comment(),d=e.first_child(l);e.snippet(d,()=>t.child,()=>({props:e.get(c)})),e.append(u,l)},y=u=>{var l=oa();e.attribute_effect(l,()=>({...e.get(c)}));var d=e.child(l);e.snippet(d,()=>t.children??e.noop),e.reset(l),e.append(u,l)};e.if(p,u=>{t.child?u(g):u(y,-1)})}e.append(n,h),e.pop()}var ca=new Set(["$$slots","$$events","$$legacy","children","child","ref","id"]),da=e.from_html("<tbody><!></tbody>");function ua(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"ref",15,null),i=e.prop(t,"id",19,()=>R(r)),a=e.rest_props(t,ca);const o=rn.create({id:b(()=>i()),ref:b(()=>s(),u=>s(u))}),c=e.derived(()=>W(a,o.props));var h=e.comment(),p=e.first_child(h);{var g=u=>{var l=e.comment(),d=e.first_child(l);e.snippet(d,()=>t.child,()=>({props:e.get(c)})),e.append(u,l)},y=u=>{var l=da();e.attribute_effect(l,()=>({...e.get(c)}));var d=e.child(l);e.snippet(d,()=>t.children??e.noop),e.reset(l),e.append(u,l)};e.if(p,u=>{t.child?u(g):u(y,-1)})}e.append(n,h),e.pop()}var ha=new Set(["$$slots","$$events","$$legacy","children","child","ref","id","date","month"]),pa=e.from_html("<td><!></td>");function fa(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"ref",15,null),i=e.prop(t,"id",19,()=>R(r)),a=e.rest_props(t,ha);const o=Qe.create({id:b(()=>i()),ref:b(()=>s(),u=>s(u)),date:b(()=>t.date),month:b(()=>t.month)}),c=e.derived(()=>W(a,o.props));var h=e.comment(),p=e.first_child(h);{var g=u=>{var l=e.comment(),d=e.first_child(l);{let f=e.derived(()=>({props:e.get(c),...o.snippetProps}));e.snippet(d,()=>t.child,()=>e.get(f))}e.append(u,l)},y=u=>{var l=pa();e.attribute_effect(l,()=>({...e.get(c)}));var d=e.child(l);e.snippet(d,()=>t.children??e.noop,()=>o.snippetProps),e.reset(l),e.append(u,l)};e.if(p,u=>{t.child?u(g):u(y,-1)})}e.append(n,h),e.pop()}var ma=new Set(["$$slots","$$events","$$legacy","children","child","ref","id"]),ga=e.from_html("<thead><!></thead>");function ya(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"ref",15,null),i=e.prop(t,"id",19,()=>R(r)),a=e.rest_props(t,ma);const o=sn.create({id:b(()=>i()),ref:b(()=>s(),u=>s(u))}),c=e.derived(()=>W(a,o.props));var h=e.comment(),p=e.first_child(h);{var g=u=>{var l=e.comment(),d=e.first_child(l);e.snippet(d,()=>t.child,()=>({props:e.get(c)})),e.append(u,l)},y=u=>{var l=ga();e.attribute_effect(l,()=>({...e.get(c)}));var d=e.child(l);e.snippet(d,()=>t.children??e.noop),e.reset(l),e.append(u,l)};e.if(p,u=>{t.child?u(g):u(y,-1)})}e.append(n,h),e.pop()}var va=new Set(["$$slots","$$events","$$legacy","children","child","ref","id"]),ba=e.from_html("<th><!></th>");function wa(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"ref",15,null),i=e.prop(t,"id",19,()=>R(r)),a=e.rest_props(t,va);const o=on.create({id:b(()=>i()),ref:b(()=>s(),u=>s(u))}),c=e.derived(()=>W(a,o.props));var h=e.comment(),p=e.first_child(h);{var g=u=>{var l=e.comment(),d=e.first_child(l);e.snippet(d,()=>t.child,()=>({props:e.get(c)})),e.append(u,l)},y=u=>{var l=ba();e.attribute_effect(l,()=>({...e.get(c)}));var d=e.child(l);e.snippet(d,()=>t.children??e.noop),e.reset(l),e.append(u,l)};e.if(p,u=>{t.child?u(g):u(y,-1)})}e.append(n,h),e.pop()}var Da=new Set(["$$slots","$$events","$$legacy","children","child","ref","id"]),Ma=e.from_html("<tr><!></tr>");function wr(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"ref",15,null),i=e.prop(t,"id",19,()=>R(r)),a=e.rest_props(t,Da);const o=an.create({id:b(()=>i()),ref:b(()=>s(),u=>s(u))}),c=e.derived(()=>W(a,o.props));var h=e.comment(),p=e.first_child(h);{var g=u=>{var l=e.comment(),d=e.first_child(l);e.snippet(d,()=>t.child,()=>({props:e.get(c)})),e.append(u,l)},y=u=>{var l=Ma();e.attribute_effect(l,()=>({...e.get(c)}));var d=e.child(l);e.snippet(d,()=>t.children??e.noop),e.reset(l),e.append(u,l)};e.if(p,u=>{t.child?u(g):u(y,-1)})}e.append(n,h),e.pop()}var xa=new Set(["$$slots","$$events","$$legacy","children","child","ref","id"]),$a=e.from_html("<div><!></div>");function ka(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"ref",15,null),i=e.prop(t,"id",19,()=>R(r)),a=e.rest_props(t,xa);const o=Ke.create({id:b(()=>i()),ref:b(()=>s(),u=>s(u))}),c=e.derived(()=>W(a,o.props));var h=e.comment(),p=e.first_child(h);{var g=u=>{var l=e.comment(),d=e.first_child(l);e.snippet(d,()=>t.child,()=>({props:e.get(c),headingValue:o.root.headingValue})),e.append(u,l)},y=u=>{var l=$a();e.attribute_effect(l,()=>({...e.get(c)}));var d=e.child(l);{var f=v=>{var D=e.comment(),O=e.first_child(D);e.snippet(O,()=>t.children??e.noop,()=>({headingValue:o.root.headingValue})),e.append(v,D)},x=v=>{var D=e.text();e.template_effect(()=>e.set_text(D,o.root.headingValue)),e.append(v,D)};e.if(d,v=>{t.children?v(f):v(x,-1)})}e.reset(l),e.append(u,l)};e.if(p,u=>{t.child?u(g):u(y,-1)})}e.append(n,h),e.pop()}var Sa=new Set(["$$slots","$$events","$$legacy","children","child","id","ref","tabindex"]),Aa=e.from_html("<button><!></button>");function Oa(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"id",19,()=>R(r)),i=e.prop(t,"ref",15,null),a=e.prop(t,"tabindex",3,0),o=e.rest_props(t,Sa);const c=tn.create({id:b(()=>s()),ref:b(()=>i(),l=>i(l))}),h=e.derived(()=>W(o,c.props,{tabindex:a()}));var p=e.comment(),g=e.first_child(p);{var y=l=>{var d=e.comment(),f=e.first_child(d);e.snippet(f,()=>t.child,()=>({props:e.get(h)})),e.append(l,d)},u=l=>{var d=Aa();e.attribute_effect(d,()=>({...e.get(h)}));var f=e.child(d);e.snippet(f,()=>t.children??e.noop),e.reset(d),e.append(l,d)};e.if(g,l=>{t.child?l(y):l(u,-1)})}e.append(n,p),e.pop()}var Ca=new Set(["$$slots","$$events","$$legacy","children","child","id","ref","tabindex"]),_a=e.from_html("<button><!></button>");function Ia(n,t){const r=e.props_id();e.push(t,!0);let s=e.prop(t,"id",19,()=>R(r)),i=e.prop(t,"ref",15,null),a=e.prop(t,"tabindex",3,0),o=e.rest_props(t,Ca);const c=en.create({id:b(()=>s()),ref:b(()=>i(),l=>i(l))}),h=e.derived(()=>W(o,c.props,{tabindex:a()}));var p=e.comment(),g=e.first_child(p);{var y=l=>{var d=e.comment(),f=e.first_child(d);e.snippet(f,()=>t.child,()=>({props:e.get(h)})),e.append(l,d)},u=l=>{var d=_a();e.attribute_effect(d,()=>({...e.get(h)}));var f=e.child(d);e.snippet(f,()=>t.children??e.noop),e.reset(d),e.append(l,d)};e.if(g,l=>{t.child?l(y):l(u,-1)})}e.append(n,p),e.pop()}function Je(n){const t=n.day.trim(),r=n.month.trim(),s=n.year.trim();if(!t&&!r&&!s)return{status:"empty"};if(!t||!r||!s)return{status:"incomplete"};const i={status:"invalid",message:"Enter a valid date"};if(!/^\d{1,2}$/.test(t)||!/^\d{1,2}$/.test(r)||!/^\d{1,4}$/.test(s))return i;const a=Number(t),o=Number(r),c=Number(s);if(a<1||a>31||o<1||o>12||c<1||c>9999)return i;const h=new K(c,o,a);return h.day!==a||h.month!==o||h.year!==c?i:{status:"valid",day:a,month:o,year:c}}var Ea=e.from_html('<span class="truncate"> </span>'),Ta=e.from_html('<div class="mt-8 grid grid-cols-2 gap-6"></div>'),Va=e.from_html('<p class="field-error-text px-0 py-0 mt-8" role="alert"> </p>'),Pa=e.from_html("<span> </span>"),Fa=e.from_html('<div class="flex flex-col gap-2"></div>'),Dr=e.from_html("<!> <!>",1),Ba=e.from_html('<div class="mb-8 flex items-center justify-between gap-2"><!> <!> <div class="flex min-w-0 items-center"><!> <!></div> <!></div> <!>',1),Ya=e.from_html('<figure class="bg-noise" aria-hidden="true"></figure> <div class="p-12"><div class="grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1.4fr)] gap-6"></div> <!> <!></div> <div class="group-divider w-full! translate-x-0!" role="separator"></div> <!>',1);function La(n,t){e.push(t,!0);let r=e.prop(t,"time",3,!1),s=e.prop(t,"locale",19,()=>typeof navigator<"u"?navigator.language:"en-US"),i=e.prop(t,"invalid",3,!1),a=e.prop(t,"label",3,""),o=e.prop(t,"required",3,!1),c=e.prop(t,"muted",3,!1),h=e.state(!1);Br(Qt("app")?.modules?.windowStack,()=>e.set(h,!1));const p=Qt(Yr);let g=e.state(null);const y=m=>(e.set(g,m,!0),()=>{e.get(g)===m&&e.set(g,null)}),u=e.derived(()=>({"aria-haspopup":"dialog","aria-expanded":e.get(h),"data-state":e.get(h)?"open":"closed",onclick:()=>e.set(h,!e.get(h))}));function l(m){$r(m),m&&(e.set(h,!1),e.get(g)?.focus())}const d=H();function f(m){if(m)try{return r()?/^\d{4}-\d{2}-\d{2}$/.test(m)?I(ae(m)):I(bi(m,d)):ae(m.slice(0,10))}catch{return}}function x(m){return r()?I(m).toDate(d,"compatible").toISOString():m.toString()}let v=e.state(e.proxy(f(t.value))),D=e.state(e.proxy(ct(e.get(v)))),O=e.state(e.proxy(St(e.get(v)))),et=!1,$=e.state(e.proxy(e.get(v)??Nn(H()))),mt=t.value,Mt=r(),at,gt=e.state(void 0);const xt=e.derived(()=>Je(e.get(D))),ot=e.derived(()=>e.get(xt).status==="invalid"?e.get(xt).message:""),$t=e.derived(()=>A(e.get(O))),lt=e.derived(()=>r()&&e.get($t).status==="invalid"?"Enter a valid time":""),kt=e.derived(()=>Array.from({length:12},(m,w)=>({value:w+1,label:new Intl.DateTimeFormat(s(),{month:"long"}).format(new Date(2e3,w,1))}))),oe=e.derived(()=>Array.from({length:Math.min(9999,e.get($).year+50)-Math.max(1,e.get($).year-50)+1},(m,w)=>Math.max(1,e.get($).year-50)+w));function ct(m){return m?{day:String(m.day),month:String(m.month),year:String(m.year)}:{day:"",month:"",year:""}}function St(m){return m&&"hour"in m?{hour:String(m.hour).padStart(2,"0"),minute:String(m.minute).padStart(2,"0")}:{hour:"",minute:""}}function A(m){const w=m.hour.trim(),k=m.minute.trim();return!w&&!k?{status:"empty"}:!w||!k?{status:"incomplete"}:!/^\d{1,2}$/.test(w)||!/^\d{1,2}$/.test(k)||Number(w)>23||Number(k)>59?{status:"invalid"}:{status:"valid",hour:Number(w),minute:Number(k)}}e.user_effect(()=>{const m=t.value,w=r();rt(()=>{if(m===mt&&w===Mt)return;const k=m===at&&w===Mt;mt=m,Mt=w,at=void 0,!k&&(e.set(v,f(m),!0),e.set(D,ct(e.get(v)),!0),e.set(O,St(e.get(v)),!0),et=!1,e.get(v)&&e.set($,e.get(v),!0))})}),e.user_effect(()=>{const m=e.get(gt);if(!m)return;let w=!0;return $n().then(()=>{w&&m.querySelector("[data-current-year]")?.scrollIntoView({block:"center"})}),()=>{w=!1}});function L(m){if(e.set(v,m,!0),at=m?x(m):"",!m)e.set(O,{hour:"",minute:""},!0),et=!1;else if(r()){const w=f(at);w.compare(m)!==0&&(e.set(v,w,!0),e.set(D,ct(w),!0),e.set($,w,!0)),e.set(O,St(e.get(v)),!0)}t.onchange(at)}function yt(){const m=Je(e.get(D));if(m.status==="empty"){(e.get(v)||t.value)&&L(void 0);return}if(m.status!=="valid")return;let w=e.get(v)?e.get(v).set({day:m.day,month:m.month,year:m.year}):new K(m.year,m.month,m.day);if(r()){const k=A(e.get(O));if(k.status==="valid")w=I(w).set({hour:k.hour,minute:k.minute});else if(k.status==="empty"&&!et)w=I(w);else return}e.set($,w,!0),L(w)}function le(m,w){e.set(D,{...e.get(D),[m]:w},!0),yt()}function Mr(m,w){et=!0,e.set(O,{...e.get(O),[m]:w},!0),Je(e.get(D)).status==="valid"&&yt()}const xr=e.derived(()=>e.get(v)?new Intl.DateTimeFormat(s(),{day:"numeric",month:"short",year:"numeric",hour:r()?"2-digit":void 0,minute:r()?"2-digit":void 0,hourCycle:r()?"h23":void 0,timeZone:d}).format(e.get(v).toDate(d)):"Select date");function $r(m){if(r()&&m){let w=I(m);const k=A(e.get(O));if(k.status==="valid")w=w.set({hour:k.hour,minute:k.minute});else if(et){e.set(v,w,!0),e.set(D,ct(w),!0),e.set($,w,!0);return}m=w}e.set(D,ct(m),!0),m&&e.set($,m,!0),L(m)}const kr="size-32! touch:size-42! p-0! font-normal data-selected:bg-sky-500! data-selected:text-white! data-selected:hover:bg-sky-500! data-today:border data-today:border-(--hairline) data-outside-month:opacity-40 data-unavailable:line-through";var ln=Dr(),cn=e.first_child(ln);Lr(cn,{children:(m,w)=>{{const k=Zt=>{{let At=e.derived(()=>`Choose ${(a()||"date").toLowerCase()}`),Ot=e.derived(()=>`gap-8 max-w-220 ${c()?"opacity-55 focus:opacity-100":""}`);Kt(Zt,e.spread_props({[e.attachment()]:y},()=>e.get(u),{tone:"idle",ghost:!0,icon:"calendar",get"aria-label"(){return e.get(At)},get"aria-invalid"(){return i()},get class(){return e.get(Ot)},children:(Nt,un)=>{var Ct=Ea(),ce=e.child(Ct,!0);e.reset(Ct),e.template_effect(()=>e.set_text(ce,e.get(xr))),e.append(Nt,Ct)},$$slots:{default:!0}}))}};let dn=e.derived(()=>a()||"Date");Wr(m,{get title(){return e.get(dn)},get required(){return o()},get titleMenu(){return t.menu},get titleEnd(){return t.titleEnd},paddingEnd:"pr-4",end:k,$$slots:{end:!0}})}}});var Sr=e.sibling(cn,2);{let m=e.derived(()=>a()?`${a()} calendar`:"Calendar"),w=e.derived(()=>p?.());Ur(Sr,{get open(){return e.get(h)},get anchor(){return e.get(g)},side:"bottom",align:"end",offset:8,cap:720,ondismiss:k=>{e.set(h,!1),k==="escape"&&e.get(g)?.focus()},role:"dialog",get"aria-label"(){return e.get(m)},get"data-tint"(){return e.get(w)},class:"superellipse surface backdrop-blur-xl z-[calc(var(--infinity,2147480000))] rounded-[28px] w-248 touch:w-318 overflow-clip",children:(k,dn)=>{var Zt=Ya(),At=e.sibling(e.first_child(Zt),2),Ot=e.child(At);e.each(Ot,20,()=>[{part:"day",label:"Day",min:1,max:31},{part:"month",label:"Month",min:1,max:12},{part:"year",label:"Year",min:0,max:9999}],E=>E.part,(E,C)=>{const T=e.derived(()=>C.part);{let j=e.derived(()=>!!e.get(ot));bn(E,{get label(){return C.label},get invalid(){return e.get(j)},class:"min-w-0",children:(vt,_t)=>{{let dt=e.derived(()=>i()||!!e.get(ot));wn(vt,{class:"min-w-0",get value(){return e.get(D)[e.get(T)]},get"aria-label"(){return C.label},type:"number",get min(){return C.min},get max(){return C.max},step:1,stepButtons:!1,get invalid(){return e.get(dt)},oninput:It=>le(e.get(T),It.target.value)})}},$$slots:{default:!0}})}}),e.reset(Ot);var Nt=e.sibling(Ot,2);{var un=E=>{var C=Ta();e.each(C,20,()=>[{part:"hour",label:"Hour",max:23},{part:"minute",label:"Minute",max:59}],T=>T.part,(T,j)=>{const vt=e.derived(()=>j.part);{let _t=e.derived(()=>!!e.get(lt));bn(T,{get label(){return j.label},get invalid(){return e.get(_t)},class:"min-w-0",children:(dt,It)=>{{let jt=e.derived(()=>i()||!!e.get(lt));wn(dt,{class:"min-w-0",get value(){return e.get(O)[e.get(vt)]},get"aria-label"(){return j.label},type:"number",min:0,get max(){return j.max},step:1,stepButtons:!1,get invalid(){return e.get(jt)},oninput:Et=>Mr(e.get(vt),Et.target.value)})}},$$slots:{default:!0}})}}),e.reset(C),e.append(E,C)};e.if(Nt,E=>{r()&&E(un)})}var Ct=e.sibling(Nt,2);{var ce=E=>{var C=Va(),T=e.child(C,!0);e.reset(C),e.template_effect(()=>e.set_text(T,e.get(ot)||e.get(lt))),e.append(E,C)};e.if(Ct,E=>{(e.get(ot)||e.get(lt))&&E(ce)})}e.reset(At);var Ar=e.sibling(At,4);{const E=(C,T)=>{let j=()=>T?.().months,vt=()=>T?.().weekdays;var _t=Ba(),dt=e.first_child(_t),It=e.child(dt);{const U=(_,B)=>{let V=()=>B?.().props;Kt(_,e.spread_props(V,{tone:"idle",iconOnly:!0,children:(P,Y)=>{xn(P,{name:"chevron-left-standard",size:18,strokeWidth:1.5,class:"-translate-x-1"})},$$slots:{default:!0}}))};e.component(It,()=>Ia,(_,B)=>{B(_,{child:U,$$slots:{child:!0}})})}var jt=e.sibling(It,2);e.component(jt,()=>ka,(U,_)=>{_(U,{class:"sr-only"})});var Et=e.sibling(jt,2),hn=e.child(Et);{let U=e.derived(()=>e.get(kt)[e.get($).month-1]?.label);Dn(hn,{get label(){return e.get(U)},"aria-label":"Choose month",ghost:!0,chevron:!1,align:"center",children:(_,B)=>{var V=e.comment(),P=e.first_child(V);e.each(P,17,()=>e.get(kt),Y=>Y.value,(Y,ut)=>{{let Rt=e.derived(()=>e.get($).month===e.get(ut).value);Mn(Y,{get selected(){return e.get(Rt)},onclick:()=>{e.set($,e.get($).set({month:e.get(ut).value}),!0)},children:(Tt,nt)=>{e.next();var bt=e.text();e.template_effect(()=>e.set_text(bt,e.get(ut).label)),e.append(Tt,bt)},$$slots:{default:!0}})}}),e.append(_,V)},$$slots:{default:!0}})}var Or=e.sibling(hn,2);{let U=e.derived(()=>String(e.get($).year));Dn(Or,{get label(){return e.get(U)},"aria-label":"Choose year",ghost:!0,chevron:!1,align:"center",children:(_,B)=>{var V=Fa();e.each(V,20,()=>e.get(oe),P=>P,(P,Y)=>{{let ut=e.derived(()=>e.get($).year===Y);Mn(P,{get selected(){return e.get(ut)},onclick:()=>{e.set($,e.get($).set({year:Y}),!0)},children:(Rt,Tt)=>{var nt=Pa(),bt=e.child(nt,!0);e.reset(nt),e.template_effect(()=>{e.set_attribute(nt,"data-current-year",e.get($).year===Y?"":void 0),e.set_text(bt,Y)}),e.append(Rt,nt)},$$slots:{default:!0}})}}),e.reset(V),e.bind_this(V,P=>e.set(gt,P),()=>e.get(gt)),e.append(_,V)},$$slots:{default:!0}})}e.reset(Et);var Cr=e.sibling(Et,2);{const U=(_,B)=>{let V=()=>B?.().props;Kt(_,e.spread_props(V,{tone:"idle",iconOnly:!0,children:(P,Y)=>{xn(P,{name:"chevron-right-standard",size:18,strokeWidth:1.5,class:"translate-x-1"})},$$slots:{default:!0}}))};e.component(Cr,()=>Oa,(_,B)=>{B(_,{child:U,$$slots:{child:!0}})})}e.reset(dt);var _r=e.sibling(dt,2);e.each(_r,17,j,e.index,(U,_)=>{var B=e.comment(),V=e.first_child(B);e.component(V,()=>la,(P,Y)=>{Y(P,{class:"w-full border-collapse",children:(ut,Rt)=>{var Tt=Dr(),nt=e.first_child(Tt);e.component(nt,()=>ya,(de,ue)=>{ue(de,{children:(he,Ir)=>{var Vt=e.comment(),pe=e.first_child(Vt);e.component(pe,()=>wr,(fe,me)=>{me(fe,{class:"flex",children:(Ht,pn)=>{var zt=e.comment(),ge=e.first_child(zt);e.each(ge,16,vt,Pt=>Pt,(Pt,fn)=>{var Ft=e.comment(),ye=e.first_child(Ft);e.component(ye,()=>wa,(ve,qt)=>{qt(ve,{class:"flex-center size-32 touch:size-42 text-[11px] font-normal text-(--fg-muted)",children:(Jt,mn)=>{e.next();var Gt=e.text();e.template_effect(be=>e.set_text(Gt,be),[()=>fn.slice(0,2)]),e.append(Jt,Gt)},$$slots:{default:!0}})}),e.append(Pt,Ft)}),e.append(Ht,zt)},$$slots:{default:!0}})}),e.append(he,Vt)},$$slots:{default:!0}})});var bt=e.sibling(nt,2);e.component(bt,()=>ua,(de,ue)=>{ue(de,{children:(he,Ir)=>{var Vt=e.comment(),pe=e.first_child(Vt);e.each(pe,17,()=>e.get(_).weeks,e.index,(fe,me)=>{var Ht=e.comment(),pn=e.first_child(Ht);e.component(pn,()=>wr,(zt,ge)=>{ge(zt,{class:"flex",children:(Pt,fn)=>{var Ft=e.comment(),ye=e.first_child(Ft);e.each(ye,17,()=>e.get(me),e.index,(ve,qt)=>{var Jt=e.comment(),mn=e.first_child(Jt);e.component(mn,()=>fa,(Gt,be)=>{be(Gt,{get date(){return e.get(qt)},get month(){return e.get(_).value},class:"p-0",children:(Er,Ua)=>{var gn=e.comment(),Tr=e.first_child(gn);{const Vr=(we,De)=>{let yn=()=>De?.().props;{let Pr=e.derived(()=>yn()["aria-disabled"]==="true");Kt(we,e.spread_props(yn,{get disabled(){return e.get(Pr)},tone:"idle",ghost:!0,class:kr,children:(Fr,Wa)=>{e.next();var vn=e.text();e.template_effect(()=>e.set_text(vn,e.get(qt).day)),e.append(Fr,vn)},$$slots:{default:!0}}))}};e.component(Tr,()=>ia,(we,De)=>{De(we,{child:Vr,$$slots:{child:!0}})})}e.append(Er,gn)},$$slots:{default:!0}})}),e.append(ve,Jt)}),e.append(Pt,Ft)},$$slots:{default:!0}})}),e.append(fe,Ht)}),e.append(he,Vt)},$$slots:{default:!0}})}),e.append(ut,Tt)},$$slots:{default:!0}})}),e.append(U,B)}),e.append(C,_t)};e.component(Ar,()=>na,(C,T)=>{T(C,{type:"single",get value(){return e.get(v)},onValueChange:l,get locale(){return s()},weekdayFormat:"short",fixedWeeks:!0,class:"select-none p-12",get placeholder(){return e.get($)},set placeholder(j){e.set($,j,!0)},children:E,$$slots:{default:!0}})})}e.append(k,Zt)},$$slots:{default:!0}})}e.append(n,ln),e.pop()}export{La as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"svelte/internal/disclose-version";import"svelte/internal/flags/async";import*as t from"svelte/internal/client";var a=t.from_html('<div data-doc=""><!></div>');function l(o,d){var e=a();t.set_class(e,1,t.clsx(["flex flex-col gap-16 px-10 pt-4 pb-10 text-[14px]/[1.6] text-(--fg-muted)","[&>header]:gap-12","[&>section:first-child]:mt-12","doc-row:px-24 doc-row:py-6","[&>section_:is(pre,:has(>pre))+*]:pt-24! [&>section_*:has(+:is(pre,:has(>pre)))]:pb-24!","[&>section_section>:first-child]:pt-26!","doc-text:max-w-none! doc-text:pr-[max(24px,calc(100%-64ch))]","[&_[data-list-header]>header]:mt-0 [&_[data-list-header]>header]:mb-0","[&>header]:px-10","[&_p]:text-balance [&_li]:text-balance [&_h1]:text-balance [&_h2]:text-balance [&_h3]:text-balance","[&_p]:max-w-[64ch] [&_ul]:max-w-[64ch]","[&_h1]:text-[28px]/[1.2] [&_h1]:font-semibold [&_h1]:text-(--fg)","[&_h2]:text-[24px]/[1.25] [&_h2]:font-semibold [&_h2]:text-(--fg)","[&_h3]:text-[20px]/[1.3] [&_h3]:font-medium [&_h3]:text-(--fg)","[&_.h1]:text-[28px]/[1.2] [&_.h1]:font-semibold [&_.h1]:text-(--fg)","[&_.h2]:text-[24px]/[1.25] [&_.h2]:font-semibold [&_.h2]:text-(--fg)","[&_.h3]:text-[20px]/[1.3] [&_.h3]:font-medium [&_.h3]:text-(--fg)","[&_strong]:font-medium [&_strong]:text-(--fg)","[&_em]:text-(--fg) [&_em]:not-italic","[&_a:not([data-button])]:text-primary [&_a:not([data-button])]:underline [&_a:not([data-button])]:underline-offset-2","[&_ul]:flex [&_ul]:list-disc [&_ul]:flex-col [&_ul]:gap-3 [&_ul]:pl-16","[&_:not(pre)>code]:whitespace-nowrap [&_:not(pre)>code]:rounded-[5px] [&_:not(pre)>code]:bg-black/5 [&_:not(pre)>code]:px-5 [&_:not(pre)>code]:py-1 [&_:not(pre)>code]:font-mono [&_:not(pre)>code]:text-[13px] [&_:not(pre)>code]:text-(--fg) dark:[&_:not(pre)>code]:bg-white/8","[&>section]:[corner-shape:superellipse(1.4)] [&>section]:rounded-[24px] site:[&>section]:rounded-[32px] [&>section]:border-[0.5px] [&>section]:border-black/8 dark:[&>section]:border-white/10 [&>section]:gap-0 [&>section]:overflow-clip [&>section]:relative [&>section]:isolate","[&>section_:is(section,[data-doc-body])]:contents","doc-row:bg-black/4 dark:doc-row:bg-white/5","[&>section>:first-child]:pt-24! [&>section>:last-child:not(section,pre,:has(>pre))]:pb-24! [&>section>:is(section,[data-doc-body]):last-child>:last-child:not(pre,:has(>pre))]:pb-24!","[&>section>:is(pre:last-child,:last-child>pre:last-child,:last-child>:last-child>pre:last-child,:last-child>:last-child>:last-child>pre:last-child)]:border-b-0 [&>section>:is(pre:last-child,:last-child>pre:last-child,:last-child>:last-child>pre:last-child,:last-child>:last-child>:last-child>pre:last-child)]:pb-24","[&_[data-list-header]>div]:hidden","[&_kbd]:rounded-[5px] [&_kbd]:border-[0.5px] [&_kbd]:border-(--hairline) [&_kbd]:px-5 [&_kbd]:py-1 [&_kbd]:font-mono [&_kbd]:text-[12px] [&_kbd]:text-(--fg)"]));var i=t.child(e);t.snippet(i,()=>d.children),t.reset(e),t.append(o,e)}export{l as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"svelte/internal/disclose-version";import"svelte/internal/flags/async";import*as s from"svelte/internal/client";import{p as q,q as A,g as B,t as G,B as h}from"./index-CC1_5J9E.js";const t=q(A,"tips"),x={isDismissed(i){return t.current.includes(i)},dismiss(i){t.current.includes(i)||(t.current=[...t.current,i])},get count(){return t.current.length},restore(){t.current=[]}};var I=s.from_html('<div class="flex flex-wrap gap-6"><!> <!></div>'),M=s.from_html('<aside class="superellipse flex w-full items-start gap-6 rounded-[20px] border-[0.5px] border-sky-400/30 bg-sky-400/10 p-10 text-[14px]/[160%] text-sky-950/80 shadow-[0_4px_16px_-4px_rgb(0_0_0/0.35)] dark:text-sky-100/85 [&_code]:text-[13px] [&_code]:text-sky-300"><!> <div class="flex min-w-0 flex-1 flex-col gap-10"><span><!></span> <!></div></aside>');function N(i,e){s.push(e,!0);const{modals:g}=B();var m=s.comment(),k=s.first_child(m);{var _=a=>{var p=M(),f=s.child(p);G(f,{name:"info",size:18,class:"mt-px shrink-0 text-sky-400","aria-hidden":"true"});var u=s.sibling(f,2),d=s.child(u),b=s.child(d);s.snippet(b,()=>e.children),s.reset(d);var w=s.sibling(d,2);{var D=n=>{var l=I(),v=s.child(l);{var $=r=>{h(r,{tone:"sky",onclick:()=>g.open("docs",e.docs),children:(o,j)=>{s.next();var c=s.text("How it works");s.append(o,c)},$$slots:{default:!0}})};s.if(v,r=>{e.docs&&r($)})}var z=s.sibling(v,2);{var H=r=>{h(r,{tone:"idle",ghost:!0,onclick:()=>x.dismiss(e.tip),children:(o,j)=>{s.next();var c=s.text("Dismiss");s.append(o,c)},$$slots:{default:!0}})};s.if(z,r=>{e.tip&&r(H)})}s.reset(l),s.append(n,l)};s.if(w,n=>{(e.docs||e.tip)&&n(D)})}s.reset(u),s.reset(p),s.append(a,p)},y=s.derived(()=>!e.tip||!x.isDismissed(e.tip));s.if(k,a=>{s.get(y)&&a(_)})}s.append(i,m),s.pop()}export{N as D,x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"svelte/internal/disclose-version";import"svelte/internal/flags/async";import*as e from"svelte/internal/client";import{g as Fe,a as Ce,i as Be,P as Oe,C as Ie,D as f,b as U,S as Pe,c as Te,B as Me}from"./index-CC1_5J9E.js";import{F as Re,a as De,V as Ue}from"./ViewModeToggle-CM5Q9dZC.js";import{cubicOut as Ee}from"svelte/easing";import{slide as ce}from"svelte/transition";var T=e.from_html("<!> <!> <!>",1),A=e.from_html("<!> <!>",1),Ne=e.from_svg('<svg xmlns="http://www.w3.org/2000/svg" width="6" height="16" viewBox="0 0 6 16" fill="none" class="shrink-0" aria-hidden="true"><path stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M4.8 1.2 1.2 8l3.6 6.8"></path></svg>'),je=e.from_html('<div class="flex"><!></div>'),qe=e.from_html('<div class="shrink-0 border-t-[0.5px] border-(--hairline)"><div class="flex h-36 w-full items-center px-8"><!></div></div>'),Ve=e.from_html("<!> <!> <!> <!> <!> <!> <!>",1),Ae=e.from_html('<input type="file" multiple="" class="hidden"/> <input type="file" class="hidden"/> <!>',1);function Ge(oe,fe){e.push(fe,!0);const Z=t=>{f(t,{icon:"upload",onclick:()=>n.files.attempt(()=>n.files.restoreSelected()),children:(l,a)=>{e.next();var s=e.text();e.template_effect(()=>e.set_text(s,`Restore ${i.selected.size??""}`)),e.append(l,s)},$$slots:{default:!0}})},ee=t=>{f(t,{icon:"trash-2",variant:"danger",onclick:()=>n.files.attempt(()=>n.files.askDeleteSelectedForever()),children:(l,a)=>{e.next();var s=e.text("Delete forever");e.append(l,s)},$$slots:{default:!0}})},G=t=>{f(t,{icon:"trash-2",variant:"danger",onclick:()=>n.files.attempt(()=>n.files.askEmptyBin()),children:(l,a)=>{e.next();var s=e.text("Empty Trash");e.append(l,s)},$$slots:{default:!0}})},te=t=>{var l=A(),a=e.first_child(l);f(a,{icon:"upload",onclick:()=>e.get(J)?.click(),get disabled(){return u.uploading},children:(c,p)=>{e.next();var $=e.text("Upload");e.append(c,$)},$$slots:{default:!0}});var s=e.sibling(a,2);{var d=c=>{var p=T(),$=e.first_child(p);f($,{icon:"folder-plus",onclick:we,children:(v,m)=>{e.next();var b=e.text("New folder");e.append(v,b)},$$slots:{default:!0}});var P=e.sibling($,2);f(P,{icon:"shape-collection",onclick:ye,children:(v,m)=>{e.next();var b=e.text("New vector set");e.append(v,b)},$$slots:{default:!0}});var B=e.sibling(P,2);{var o=v=>{f(v,{icon:"folder",onclick:()=>H.open("new-disk"),children:(m,b)=>{e.next();var h=e.text("New S3 bucket\u2026");e.append(m,h)},$$slots:{default:!0}})};e.if(B,v=>{pe.editStructure&&!i.cwd&&ve.testingPolicy.localTesting&&v(o)})}e.append(c,p)};e.if(s,c=>{e.get(W)||c(d)})}e.append(t,l)},ie=t=>{var l=e.comment(),a=e.first_child(l);{var s=d=>{var c=T(),p=e.first_child(c);U(p);var $=e.sibling(p,2);f($,{icon:"circle-alert",onclick:()=>i.toggleUnusedOnly(),children:(o,v)=>{e.next();var m=e.text();e.template_effect(()=>e.set_text(m,i.showUnusedOnly?"Show all files":`Show only unused (${e.get(N)})`)),e.append(o,m)},$$slots:{default:!0}});var P=e.sibling($,2);{var B=o=>{f(o,{icon:"trash-2",onclick:()=>n.files.attempt(()=>n.files.askCleanupUnused()),children:(v,m)=>{e.next();var b=e.text();e.template_effect(()=>e.set_text(b,`Clean up unused (${e.get(N)??""})`)),e.append(v,b)},$$slots:{default:!0}})};e.if(P,o=>{e.get(N)>0&&o(B)})}e.append(d,c)};e.if(a,d=>{(e.get(N)>0||i.showUnusedOnly)&&d(s)})}e.append(t,l)},{files:u,modals:H,can:pe,project:ve}=Fe(),i=u.page,n=Ce();let J=e.state(null);const le=e.derived(()=>i.viewingBin||i.cwd!=="");function ge(){i.viewingBin?n.files.enterFolder(""):n.files.enterFolder(u.parentOf(i.cwd))}async function ue(t){const l=t.target,a=Array.from(l.files??[]);l.value="",a.length>0&&await n.files.uploadMany(a,i.viewingBin?"":i.cwd)}const E=e.derived(()=>u.items.filter(t=>i.selected.has(t.path)&&Be(t.filename)).length),R=e.derived(()=>i.selected.size>0),N=e.derived(()=>u.unusedPaths.length),K=e.derived(()=>[...i.selected].filter(t=>!!t&&t!=="bin"&&u.kindOf(t)==="file").length),L=e.derived(()=>{if(i.selected.size!==1)return null;const[t]=i.selected;return t==="bin"||!t?null:u.kindOf(t)==="folder"?t:null}),ne=e.derived(()=>!!u.clipboard&&u.clipboard.ids.length>0);let M=e.state("empty");function he(t){if(u.editingId)return;const l=t.target?.closest('[role="option"]');if(!l){e.set(M,"empty");return}const a=Number(l.dataset.i),s=i.visible[a];if(!s){e.set(M,"empty");return}if(s.kind==="bin"){i.selected.clear(),i.focusIndex=a,e.set(M,"bin");return}const d=s.id;i.selected.has(d)||(i.selected.clear(),i.selected.add(d),i.focusIndex=a),e.set(M,"item")}const ae=e.derived(()=>{if(i.selected.size!==1)return null;const[t]=i.selected;return!t||t==="bin"||u.kindOf(t)!=="file"?null:u.items.find(l=>l.path===t)??null});let Q=e.state(null),j=e.state(null);function me(){e.set(j,e.get(ae),!0),e.get(j)&&e.get(Q)?.click()}async function xe(t){const l=t.target,a=l.files?.[0];l.value="";const s=e.get(j);e.set(j,null),a&&s&&await n.files.attempt(()=>n.files.replaceFile(s,a))}function be(){if(i.selected.size!==1)return;const[t]=i.selected;!t||t==="bin"||n.files.startRename(t)}function $e(){if(i.selected.size!==1)return;const[t]=i.selected;!t||t==="bin"||n.files.openInfo(t)}function _e(t){const l=u.clipboard;if(l)return n.files.attempt(async()=>{await n.files.move(l.ids,t)&&u.clipboard===l&&n.files.clearClipboard()})}function ke(){return n.files.attempt(()=>n.files.paste())}function we(){n.files.attempt(()=>n.files.createFolder())}function ye(){n.files.attempt(()=>n.files.createFolder({set:!0}))}const W=e.derived(()=>u.isVectorSet(i.cwd)),se=e.derived(()=>e.get(W)?".svg,image/svg+xml":"image/*");var re=Ae(),q=e.first_child(re);e.bind_this(q,t=>e.set(J,t),()=>e.get(J));var V=e.sibling(q,2);e.bind_this(V,t=>e.set(Q,t),()=>e.get(Q));var Se=e.sibling(V,2);Oe(Se,{lead:t=>{var l=e.comment(),a=e.first_child(l);{var s=d=>{var c=je(),p=e.child(c);Me(p,{tone:"idle",ghost:!0,iconOnly:!0,"aria-label":"Back",onclick:ge,class:"w-22! touch:w-32!",children:($,P)=>{var B=Ne();e.append($,B)},$$slots:{default:!0}}),e.reset(c),e.transition(3,c,()=>ce,()=>({axis:"x",duration:200,easing:Ee})),e.append(d,c)};e.if(a,d=>{e.get(le)&&d(s)})}e.append(t,l)},actions:t=>{var l=T(),a=e.first_child(l);Pe(a,{placeholder:"Search files",get value(){return i.query},set value(p){i.query=p}});var s=e.sibling(a,2);{var d=p=>{Ue(p,{get view(){return i}})};e.if(s,p=>{e.get(W)||p(d)})}var c=e.sibling(s,2);{let p=e.derived(()=>e.get(R)?"more-horizontal":"plus");Te(c,{get icon(){return e.get(p)},label:"Files actions",children:($,P)=>{var B=e.comment(),o=e.first_child(B);{var v=h=>{var g=e.comment(),x=e.first_child(g);{var k=_=>{var w=T(),O=e.first_child(w);Z(O);var F=e.sibling(O,2);f(F,{icon:"x",onclick:()=>n.files.clearSelection(),children:(y,S)=>{e.next();var C=e.text("Clear selection");e.append(y,C)},$$slots:{default:!0}});var r=e.sibling(F,2);ee(r),e.append(_,w)},z=_=>{G(_)};e.if(x,_=>{e.get(R)?_(k):_(z,-1)})}e.append(h,g)},m=h=>{var g=T(),x=e.first_child(g);{var k=w=>{f(w,{icon:"zap",onclick:()=>H.open("compress-files"),get disabled(){return u.uploading},children:(O,F)=>{e.next();var r=e.text();e.template_effect(()=>e.set_text(r,`Compress ${e.get(E)??""}`)),e.append(O,r)},$$slots:{default:!0}})};e.if(x,w=>{e.get(E)>0&&w(k)})}var z=e.sibling(x,2);f(z,{icon:"x",onclick:()=>n.files.clearSelection(),children:(w,O)=>{e.next();var F=e.text("Clear selection");e.append(w,F)},$$slots:{default:!0}});var _=e.sibling(z,2);f(_,{icon:"trash-2",variant:"danger",onclick:()=>n.files.attempt(()=>n.files.deleteSelected()),children:(w,O)=>{e.next();var F=e.text();e.template_effect(()=>e.set_text(F,`Delete ${i.selected.size??""}`)),e.append(w,F)},$$slots:{default:!0}}),e.append(h,g)},b=h=>{var g=A(),x=e.first_child(g);te(x);var k=e.sibling(x,2);ie(k),e.append(h,g)};e.if(o,h=>{i.viewingBin?h(v):e.get(R)?h(m,1):h(b,-1)})}e.append($,B)},$$slots:{default:!0}})}e.append(t,l)},footer:t=>{var l=e.comment(),a=e.first_child(l);{var s=d=>{var c=qe(),p=e.child(c),$=e.child(p);De($,{get view(){return i}}),e.reset(p),e.reset(c),e.transition(3,c,()=>ce,()=>({duration:200})),e.append(d,c)};e.if(a,d=>{e.get(le)&&d(s)})}e.append(t,l)},children:(t,l)=>{Ie(t,{trigger:(a,s)=>{let d=()=>s?.().props;Re(a,{get view(){return i},mode:"page",multi:!0,get triggerProps(){return d()},oncontextmenu:he})},children:(a,s)=>{var d=e.comment(),c=e.first_child(d);{var p=o=>{var v=e.comment(),m=e.first_child(v);{var b=g=>{var x=T(),k=e.first_child(x);Z(k);var z=e.sibling(k,2);U(z);var _=e.sibling(z,2);ee(_),e.append(g,x)},h=g=>{G(g)};e.if(m,g=>{e.get(M)==="item"&&e.get(R)?g(b):g(h,-1)})}e.append(o,v)},$=o=>{G(o)},P=o=>{var v=Ve(),m=e.first_child(v);{var b=r=>{var y=T(),S=e.first_child(y);f(S,{icon:"pen",onclick:be,children:(I,Y)=>{e.next();var D=e.text("Rename");e.append(I,D)},$$slots:{default:!0}});var C=e.sibling(S,2);{var X=I=>{f(I,{icon:"upload",onclick:me,get disabled(){return u.uploading},children:(Y,D)=>{e.next();var ze=e.text("Replace file");e.append(Y,ze)},$$slots:{default:!0}})};e.if(C,I=>{e.get(ae)&&I(X)})}var de=e.sibling(C,2);f(de,{icon:"info",onclick:$e,children:(I,Y)=>{e.next();var D=e.text();e.template_effect(()=>e.set_text(D,e.get(L)?"Folder Info":"File Info")),e.append(I,D)},$$slots:{default:!0}}),e.append(r,y)};e.if(m,r=>{i.selected.size===1&&r(b)})}var h=e.sibling(m,2);{var g=r=>{f(r,{icon:"download",onclick:()=>n.files.downloadSelected(),children:(y,S)=>{e.next();var C=e.text();e.template_effect(()=>e.set_text(C,`Download ${(e.get(K)>1?e.get(K):"")??""}`)),e.append(y,C)},$$slots:{default:!0}})};e.if(h,r=>{e.get(K)>0&&r(g)})}var x=e.sibling(h,2);f(x,{icon:"scissors",onclick:()=>n.files.cutToClipboard(),children:(r,y)=>{e.next();var S=e.text("Cut");e.append(r,S)},$$slots:{default:!0}});var k=e.sibling(x,2);{var z=r=>{f(r,{icon:"clipboard",onclick:()=>_e(e.get(L)),children:(y,S)=>{e.next();var C=e.text("Paste into folder");e.append(y,C)},$$slots:{default:!0}})};e.if(k,r=>{e.get(L)&&e.get(ne)&&r(z)})}var _=e.sibling(k,2);{var w=r=>{var y=A(),S=e.first_child(y);U(S);var C=e.sibling(S,2);f(C,{icon:"zap",onclick:()=>H.open("compress-files"),get disabled(){return u.uploading},children:(X,de)=>{e.next();var I=e.text();e.template_effect(()=>e.set_text(I,`Compress ${e.get(E)??""}`)),e.append(X,I)},$$slots:{default:!0}}),e.append(r,y)};e.if(_,r=>{e.get(E)>0&&r(w)})}var O=e.sibling(_,2);U(O);var F=e.sibling(O,2);f(F,{icon:"trash-2",variant:"danger",onclick:()=>n.files.attempt(()=>n.files.deleteSelected()),children:(r,y)=>{e.next();var S=e.text();e.template_effect(()=>e.set_text(S,`Move ${i.selected.size>1?`${i.selected.size} items`:""} to Trash`)),e.append(r,S)},$$slots:{default:!0}}),e.append(o,v)},B=o=>{var v=T(),m=e.first_child(v);te(m);var b=e.sibling(m,2);{var h=x=>{var k=A(),z=e.first_child(k);U(z);var _=e.sibling(z,2);f(_,{icon:"clipboard",onclick:ke,children:(w,O)=>{e.next();var F=e.text("Paste");e.append(w,F)},$$slots:{default:!0}}),e.append(x,k)};e.if(b,x=>{e.get(ne)&&x(h)})}var g=e.sibling(b,2);ie(g),e.append(o,v)};e.if(c,o=>{i.viewingBin?o(p):e.get(M)==="bin"?o($,1):e.get(M)==="item"&&e.get(R)?o(P,2):o(B,-1)})}e.append(a,d)},$$slots:{trigger:!0,default:!0}})},$$slots:{lead:!0,actions:!0,footer:!0,default:!0}}),e.template_effect(()=>{e.set_attribute(q,"accept",e.get(se)),e.set_attribute(V,"accept",e.get(se))}),e.delegated("change",q,ue),e.delegated("change",V,xe),e.append(oe,re),e.pop()}e.delegate(["change"]);export{Ge as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"svelte/internal/disclose-version";import"svelte/internal/flags/async";import*as e from"svelte/internal/client";import{g as At,a as Lt,s as Kt,P as Rt,F as xe,R as Pe,d as be,I as U,e as Ge,f as Je,h as ye,j as Ze,k as Ct,B as ee,L as Pt,S as Mt,l as He,m as Me,n as qt,D as It,r as Vt,o as Qe}from"./index-CC1_5J9E.js";import{tick as Dt}from"svelte";import{D as Bt}from"./DocNote-DCnGLaBv.js";function Ue(te){try{return new Intl.PluralRules(te).resolvedOptions().pluralCategories}catch{return["other"]}}function Nt(te,z){let E;try{E=new Intl.PluralRules(te)}catch{return z}const se=200,g=Array.from({length:se+1},(p,$)=>$).filter(p=>E.select(p)===z);if(!g.length)return E.select(1.5)===z?"1.5":z;const x=[];for(const p of g){const $=x.at(-1);$&&p===$[1]+1?$[1]=p:x.push([p,p])}return x.slice(0,2).map(([p,$])=>$===se?`${p}+`:p===$?`${p}`:`${p}\u2013${$}`).join(", ")+(x.length>2?", \u2026":"")}var Wt=e.from_html('<label class="flex min-w-0 items-stretch border-b-[0.5px] border-(--hairline) last:border-b-0"><span class="flex w-72 shrink-0 items-center pl-12 text-xs text-(--fg-muted)"> </span> <!></label>'),Xt=e.from_html('<div class="flex min-w-0 flex-1 flex-col"></div>'),Yt=e.from_html('<span class="flex flex-wrap items-center gap-4"><!> <!></span>'),et=e.from_html("<!> <!>",1),zt=e.from_html('<span class="flex items-center gap-4 text-[13px] text-(--fg)"><code> </code> <!></span>'),Et=e.from_html('<div class="flex flex-wrap items-center gap-6 py-6"><!> <!></div>'),Ft=e.from_html('<p class="field-hint-text px-0">Write <code>{name}</code> in the text to add a slot, <code>{count}</code> for a plural.</p>'),Gt=e.from_html('<div class="flex flex-col gap-8 bg-(--field-bg) px-8 pb-8"><!> <!></div>'),Jt=e.from_html('<div><div><div><code class="truncate text-[13px] text-(--fg)"> </code> <!></div> <div><!></div> <div class="flex shrink-0 items-center gap-2 pl-4 pr-8"><!> <!> <!></div> <div data-li-center="" class="pointer-events-none absolute inset-x-0 bottom-0 h-0.5 bg-(--hairline)"></div></div> <!></div>'),Zt=e.from_html("<!> <!> <!>",1),Ht=e.from_html('<p class="px-2 text-xs/[140%] text-(--fg-muted)"> </p>'),tt=e.from_html("<div></div>"),Qt=e.from_html('<div><div class="group/row overflow-hidden rounded-[20px]"><div><label><!></label> <label><!></label> <!></div></div></div>'),Ut=e.from_html('<div class="flex flex-col gap-16 p-10"><!> <!> <div class="flex flex-col gap-8"><!> <div class="flex justify-end"><!></div></div></div>');function es(te,z){e.push(z,!0);const E=(t,s=e.noop,r=e.noop,i=e.noop,o=e.noop,v)=>{let j=e.derived_safe_equal(()=>e.fallback(v?.(),!1));var O=Xt();e.each(O,20,()=>nt(r()),L=>L,(L,K)=>{var R=Wt(),k=e.child(R),ae=e.child(k,!0);e.reset(k);var le=e.sibling(k,2);{let D=e.derived(()=>[be,"h-38!",e.get(j)&&"opacity-45"].filter(Boolean).join(" ")),l=e.derived(()=>i()(K));U(le,{get class(){return e.get(D)},get value(){return e.get(l)},onchange:d=>o()(K,d.currentTarget.value)})}e.reset(R),e.template_effect(D=>{e.set_attribute(R,"title",K),e.set_text(ae,D)},[()=>Nt(r(),K)]),e.append(L,R)}),e.reset(O),e.append(t,O)},se=(t,s=e.noop)=>{const r=e.derived(()=>qe(s()));var i=Jt(),o=e.child(i),v=e.child(o),j=e.child(v),O=e.child(j,!0);e.reset(j);var L=e.sibling(j,2);{var K=n=>{var a=Yt(),c=e.child(a);e.each(c,17,()=>Object.entries(e.get(r)??{}),([u,y])=>u,(u,y)=>{var _=e.derived(()=>e.to_array(e.get(y),2));let P=()=>e.get(_)[0],Q=()=>e.get(_)[1];{let M=e.derived(()=>Q()==="count"?"Plural count":He(Q()));Me(u,{tone:"neutral",get title(){return e.get(M)},children:(de,N)=>{e.next();var q=e.text();e.template_effect(()=>e.set_text(q,Q()==="count"?"plural":`{${P()}}`)),e.append(de,q)},$$slots:{default:!0}})}});var f=e.sibling(c,2);{var b=u=>{Me(u,{tone:"neutral",title:"The translation's slots differ from the source",children:(y,_)=>{e.next();var P=e.text("Slots differ");e.append(y,P)},$$slots:{default:!0}})},H=e.derived(()=>Xe(s()));e.if(f,u=>{e.get(H)&&u(b)})}e.reset(a),e.append(n,a)},R=e.derived(()=>e.get(r)||Xe(s()));e.if(L,n=>{e.get(R)&&n(K)})}e.reset(v);var k=e.sibling(v,2),ae=e.child(k);{var le=n=>{{let a=e.derived(()=>ke(s()));E(n,s,()=>e.get(A),()=>c=>gt(s(),c),()=>(c,f)=>ht(s(),c,f),()=>e.get(a))}},D=e.derived(()=>Ie(s())),l=n=>{{let a=e.derived(()=>[be,"h-38!",ke(s())&&"opacity-45"].filter(Boolean).join(" ")),c=e.derived(()=>Z(ue(s()))),f=e.derived(()=>ke(s())?Z(J(s())):"");U(n,{get class(){return e.get(a)},get value(){return e.get(c)},get placeholder(){return e.get(f)},onchange:b=>pt(s(),b.currentTarget.value)})}};e.if(ae,n=>{e.get(D)?n(le):n(l,-1)})}e.reset(k);var d=e.sibling(k,2),h=e.child(d);{var m=n=>{var a=et(),c=e.first_child(a);Me(c,{tone:"neutral",title:"The source text changed after this translation was written",children:(b,H)=>{e.next();var u=e.text("Review");e.append(b,u)},$$slots:{default:!0}});var f=e.sibling(c,2);{let b=e.derived(()=>`Mark ${s()} reviewed`);ee(f,{tone:"idle",ghost:!0,icon:"check",iconVariant:"stroke",get"aria-label"(){return e.get(b)},title:"Mark reviewed",onclick:()=>S.content.approveString(s(),e.get(A))})}e.append(n,a)},w=e.derived(()=>Ve(s()));e.if(h,n=>{e.get(w)&&n(m)})}var B=e.sibling(h,2);{let n=e.derived(()=>`Details for ${s()}`),a=e.derived(()=>e.get(V)===s()),c=e.derived(()=>e.get(V)===s()?"":"-rotate-90");ee(B,{tone:"idle",ghost:!0,icon:"arrow-down",iconVariant:"stroke",get"aria-label"(){return e.get(n)},get"aria-expanded"(){return e.get(a)},title:"All languages and definition",get class(){return e.get(c)},onclick:()=>e.set(V,e.get(V)===s()?null:s(),!0)})}var C=e.sibling(B,2);{let n=e.derived(()=>`Delete ${s()}`);Ge(C,{quiet:!0,onremove:()=>ct(s()),get removeLabel(){return e.get(n)}})}e.reset(d),e.next(2),e.reset(o);var ie=e.sibling(o,2);{var oe=n=>{const a=e.derived(()=>pe(s()));var c=Gt(),f=e.child(c);e.each(f,17,()=>x.hasLocales?x.entries:[{id:x.default,name:x.default}],u=>u.id,(u,y)=>{const _=e.derived(()=>Be(s(),e.get(y).id));xe(u,{get label(){return e.get(y).name},children:(P,Q)=>{var M=e.comment(),de=e.first_child(M);{var N=I=>{E(I,s,()=>e.get(y).id,()=>W=>e.get(_)&&typeof e.get(_)=="object"?String(e.get(_)[W]??""):"",()=>(W,T)=>lt(s(),e.get(y).id,W,T))},q=e.derived(()=>Ie(s())),Te=I=>{{let W=e.derived(()=>e.get(_)===void 0?"":Z(e.get(_))),T=e.derived(()=>e.get(_)===void 0?Z(J(s())):"");U(I,{get value(){return e.get(W)},get placeholder(){return e.get(T)},onchange:X=>at(s(),e.get(y).id,X.currentTarget.value)})}};e.if(de,I=>{e.get(q)?I(N):I(Te,-1)})}e.append(P,M)},$$slots:{default:!0}})});var b=e.sibling(f,2);{var H=u=>{const y=e.derived(()=>Se(s()));var _=et(),P=e.first_child(_);xe(P,{label:"Note",children:(M,de)=>{{let N=e.derived(()=>e.get(a).note??"");U(M,{get value(){return e.get(N)},placeholder:"Context for translators",onchange:q=>we(s(),{...e.get(a),note:q.currentTarget.value})})}},$$slots:{default:!0}});var Q=e.sibling(P,2);xe(Q,{label:"Slots",as:"div",children:(M,de)=>{var N=e.comment(),q=e.first_child(N);{var Te=T=>{var X=Et(),Ye=e.child(X);e.each(Ye,17,()=>Object.entries(e.get(y)),([Y,me])=>Y,(Y,me)=>{var Ae=e.derived(()=>e.to_array(e.get(me),2));let ce=()=>e.get(Ae)[0],ze=()=>e.get(Ae)[1];var Le=zt(),Ke=e.child(Le),yt=e.child(Ke,!0);e.reset(Ke);var _t=e.sibling(Ke,2);{let $t=e.derived(()=>Ne(ze())),kt=e.derived(()=>`Type of slot ${ce()}`);qt(_t,{get label(){return e.get($t)},tone:"idle",ghost:!0,align:"start",sideOffset:4,get"aria-label"(){return e.get(kt)},children:(wt,ts)=>{var Ee=e.comment(),St=e.first_child(Ee);e.each(St,16,()=>["text","number","count"],Re=>Re,(Re,Ce)=>{{let jt=e.derived(()=>Ce===ze());It(Re,{get selected(){return e.get(jt)},onclick:()=>ot(s(),ce(),Ce),children:(Ot,ss)=>{e.next();var Fe=e.text();e.template_effect(Tt=>e.set_text(Fe,Tt),[()=>Ne(Ce)]),e.append(Ot,Fe)},$$slots:{default:!0}})}}),e.append(wt,Ee)},$$slots:{default:!0}})}e.reset(Le),e.template_effect(()=>e.set_text(yt,`{${ce()}}`)),e.append(Y,Le)});var xt=e.sibling(Ye,2);{var bt=Y=>{ee(Y,{tone:"sky",ghost:!0,onclick:()=>dt(s()),children:(me,Ae)=>{e.next();var ce=e.text("Use slots");e.append(me,ce)},$$slots:{default:!0}})};e.if(xt,Y=>{e.get(a).slots||Y(bt)})}e.reset(X),e.append(T,X)},I=e.derived(()=>Object.keys(e.get(y)).length),W=T=>{var X=Ft();e.append(T,X)};e.if(q,T=>{e.get(I)?T(Te):T(W,-1)})}e.append(M,N)},$$slots:{default:!0}}),e.append(u,_)};e.if(b,u=>{$.editStructure&&u(H)})}e.reset(c),e.append(n,c)};e.if(ie,n=>{e.get(V)===s()&&n(oe)})}e.reset(i),e.template_effect(n=>{e.set_attribute(i,"data-skey",s()),e.set_class(i,1,e.clsx(["group/row overflow-hidden first:rounded-t-[20px] last:rounded-b-[20px]",e.get(ve)===s()&&"outline-2 -outline-offset-2 outline-sky-500"])),e.set_class(o,1,e.clsx(Je)),e.set_class(v,1,e.clsx([ye,Ze,"max-w-[40%] cursor-default flex-col justify-center gap-4 px-12 py-8"])),e.set_attribute(j,"title",s()),e.set_text(O,n),e.set_class(k,1,e.clsx(ye))},[()=>ut(s())]),e.append(t,i)},{content:g,locale:x,router:p,can:$,modals:st}=At(),S=Lt(),A=e.derived(()=>x.current),F=e.derived(()=>e.get(A)===x.default);let _e=e.state("");const $e=e.derived(()=>e.get(_e).trim().toLowerCase());let re=e.state(!1),G=e.state(""),ne=e.state(""),ge=e.state(null),ve=e.state(null);const J=t=>g.strings[t],fe=t=>e.get(F)?void 0:g.stringsLocale[e.get(A)]?.[t],ue=t=>{const s=fe(t);return s!==void 0?s:J(t)},ke=t=>!e.get(F)&&fe(t)===void 0,qe=t=>g.stringSlots[t],Ie=t=>Object.values(qe(t)??{}).includes("count"),rt=e.derived(()=>new Set(g.stringsReview[e.get(A)]??[])),Ve=t=>!e.get(F)&&e.get(rt).has(t)&&fe(t)!==void 0,De=e.derived(()=>e.get(F)?0:g.stringKeys.filter(Ve).length);let V=e.state(null);const pe=t=>g.schema.strings?.[t]??{},Be=(t,s)=>s===x.default?g.strings[t]:g.stringsLocale[s]?.[t],nt=Ue;function at(t,s,r){S.content.saveString(t,s,r)}function lt(t,s,r,i){const o=Be(t,s)??g.strings[t],v=o&&typeof o=="object"&&!Array.isArray(o)?{...o}:{};v[r]=i,S.content.saveString(t,s,v)}function we(t,s){const r={};s.slots&&Object.keys(s.slots).length&&(r.slots=s.slots),s.note?.trim()&&(r.note=s.note.trim()),S.content.setStringDef(t,Object.keys(r).length?r:null)}const it=t=>t&&typeof t=="object"?Qe(Object.values(t).map(String).join(" ")):Qe(Z(t)),Se=t=>{const s=pe(t).slots??{};return Vt([...new Set([...it(J(t)),...Object.keys(s)])],s)},Ne=t=>t==="count"?"Plural count":He(t);function ot(t,s,r){const i={...Se(t),[s]:r};if(r==="count")for(const v of Object.keys(i))v!==s&&i[v]==="count"&&(i[v]="text");we(t,{...pe(t),slots:i});const o=J(t);r==="count"&&typeof o=="string"&&S.content.saveString(t,x.default,{other:o})}function dt(t){we(t,{...pe(t),slots:Se(t)})}function ct(t){e.get(V)===t&&e.set(V,null),S.content.deleteString(t),$.editStructure&&g.schema.strings?.[t]&&S.content.setStringDef(t,null)}function Z(t){return typeof t=="string"?t:t&&typeof t=="object"&&!Array.isArray(t)?Object.values(t).map(String).join(" / "):t==null?"":String(t)}e.derived(()=>Ue(e.get(A)));const gt=(t,s)=>{const r=ue(t);return r&&typeof r=="object"&&!Array.isArray(r)?String(r[s]??""):""},We=t=>typeof t=="string"?[...t.matchAll(/\{([a-zA-Z0-9_]+)\}/g)].map(s=>s[1]).sort().join(","):"";function Xe(t){if(e.get(F))return!1;const s=fe(t);if(typeof s!="string")return!1;const r=J(t);return typeof r!="string"?!1:We(s)!==We(r)}const vt=e.derived(()=>g.stringKeys.filter(t=>!e.get($e)||t.toLowerCase().includes(e.get($e))||Z(ue(t)).toLowerCase().includes(e.get($e)))),ft=e.derived(()=>{const t=new Map;for(const s of e.get(vt)){const r=s.indexOf("."),i=r>0?s.slice(0,r):"",o=t.get(i);o?o.push(s):t.set(i,[s])}return[...t.entries()].sort((s,r)=>s[0]===""?-1:r[0]===""?1:s[0].localeCompare(r[0]))}),he=e.derived(()=>{if(e.get(F))return null;const t=g.stringKeys.length;if(!t)return null;const s=g.stringKeys.filter(r=>g.stringsLocale[e.get(A)]?.[r]!==void 0).length;return{have:s,total:t,missing:t-s,pct:Math.round(s/t*100)}}),ut=t=>t.includes(".")?t.slice(t.indexOf(".")+1):t;function pt(t,s){S.content.saveString(t,e.get(A),s)}function ht(t,s,r){const i=ue(t),o=i&&typeof i=="object"&&!Array.isArray(i)?{...i}:{};o[s]=r,S.content.saveString(t,e.get(A),o)}async function mt(){e.set(re,!0),await Dt(),e.get(ge)?.querySelector("[data-new-key]")?.focus()}function je(){const t=e.get(G).trim();t&&(S.content.saveString(t,x.default,e.get(ne)),e.set(G,""),e.set(ne,""),e.set(re,!1))}function Oe(){e.set(re,!1),e.set(G,""),e.set(ne,"")}e.user_effect(()=>{const t=p.field;if(!t||p.view!=="strings")return;e.set(ve,t,!0);const s=requestAnimationFrame(()=>{e.get(ge)?.querySelector(`[data-skey="${CSS.escape(t)}"]`)?.scrollIntoView({block:"center",behavior:Kt()})}),r=setTimeout(()=>{e.get(ve)===t&&e.set(ve,null)},2200);return()=>{cancelAnimationFrame(s),clearTimeout(r)}}),Rt(te,{actions:t=>{var s=Zt(),r=e.first_child(s);Pt(r,{});var i=e.sibling(r,2);Mt(i,{placeholder:"Search texts",get value(){return e.get(_e)},set value(v){e.set(_e,v,!0)}});var o=e.sibling(i,2);ee(o,{tone:"idle",icon:"upload",iconVariant:"stroke",title:"Import i18next, Localazy or flat JSON",onclick:()=>st.open("import-strings"),children:(v,j)=>{e.next();var O=e.text("Import");e.append(v,O)},$$slots:{default:!0}}),e.append(t,s)},children:(t,s)=>{var r=Ut(),i=e.child(r);{var o=l=>{Bt(l,{tip:"texts",docs:{topic:"texts"},children:(d,h)=>{e.next();var m=e.text("This is the place for words that repeat across the site, like \u201CRead more\u201D: written once, translated per language.");e.append(d,m)},$$slots:{default:!0}})},v=l=>{var d=Ht(),h=e.child(d);e.reset(d),e.template_effect(()=>e.set_text(h,`${e.get(he).pct??""}% translated${e.get(he).missing>0?` \xB7 ${e.get(he).missing} missing`:""}${e.get(De)>0?` \xB7 ${e.get(De)} to review`:""}`)),e.append(l,d)};e.if(i,l=>{g.stringKeys.length===0?l(o):e.get(he)&&l(v,1)})}var j=e.sibling(i,2);e.each(j,17,()=>e.get(ft),([l,d])=>l,(l,d)=>{var h=e.derived(()=>e.to_array(e.get(d),2));let m=()=>e.get(h)[0],w=()=>e.get(h)[1];var B=e.comment(),C=e.first_child(B);{var ie=n=>{xe(n,{get label(){return m()},as:"div",variant:"bare",children:(a,c)=>{var f=tt();e.each(f,20,w,b=>b,(b,H)=>{se(b,()=>H)}),e.reset(f),e.template_effect(()=>e.set_class(f,1,e.clsx(["mt-6",Pe]))),e.append(a,f)},$$slots:{default:!0}})},oe=n=>{var a=tt();e.each(a,20,w,c=>c,(c,f)=>{se(c,()=>f)}),e.reset(a),e.template_effect(()=>e.set_class(a,1,e.clsx(Pe))),e.append(n,a)};e.if(C,n=>{m()?n(ie):n(oe,-1)})}e.append(l,B)});var O=e.sibling(j,2),L=e.child(O);{var K=l=>{var d=Qt(),h=e.child(d),m=e.child(h),w=e.child(m),B=e.child(w);{let n=e.derived(()=>`${be} h-38! font-mono`);U(B,{"data-new-key":!0,get class(){return e.get(n)},placeholder:"Key, e.g. nav.home",autocomplete:"off",spellcheck:"false",onkeydown:a=>{a.key==="Enter"&&je(),a.key==="Escape"&&Oe()},get value(){return e.get(G)},set value(a){e.set(G,a,!0)}})}e.reset(w);var C=e.sibling(w,2),ie=e.child(C);{let n=e.derived(()=>`${be} h-38!`);U(ie,{get class(){return e.get(n)},placeholder:"Text",onkeydown:a=>{a.key==="Enter"&&je(),a.key==="Escape"&&Oe()},get value(){return e.get(ne)},set value(a){e.set(ne,a,!0)}})}e.reset(C);var oe=e.sibling(C,2);Ge(oe,{onremove:Oe,removeLabel:"Discard new text",class:"pr-8"}),e.reset(m),e.reset(h),e.reset(d),e.template_effect(()=>{e.set_class(d,1,e.clsx(Pe)),e.set_class(m,1,e.clsx(Je)),e.set_class(w,1,e.clsx([ye,Ze,"max-w-[40%]"])),e.set_class(C,1,e.clsx(ye))}),e.append(l,d)},R=l=>{Ct(l,{children:(d,h)=>{e.next();var m=e.text("No texts yet");e.append(d,m)}})};e.if(L,l=>{e.get(re)?l(K):g.stringKeys.length===0&&l(R,1)})}var k=e.sibling(L,2),ae=e.child(k);{var le=l=>{{let d=e.derived(()=>!e.get(G).trim());ee(l,{tone:"green",get disabled(){return e.get(d)},onclick:je,children:(h,m)=>{e.next();var w=e.text("Add");e.append(h,w)},$$slots:{default:!0}})}},D=l=>{ee(l,{tone:"idle",icon:"plus",onclick:mt,children:(d,h)=>{e.next();var m=e.text("Add text");e.append(d,m)},$$slots:{default:!0}})};e.if(ae,l=>{e.get(re)?l(le):l(D,-1)})}e.reset(k),e.reset(O),e.reset(r),e.bind_this(r,l=>e.set(ge,l),()=>e.get(ge)),e.append(t,r)},$$slots:{actions:!0,default:!0}}),e.pop()}export{es as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"svelte/internal/disclose-version";import"svelte/internal/flags/async";import*as e from"svelte/internal/client";import{slide as Te}from"svelte/transition";import{cubicOut as Re}from"svelte/easing";import{u as ye,v as _e,g as kt,P as wt,w as yt,B as t,n as ue,D as Z,b as _t,x as fe,y as be,F as G,I as j,t as je,z as Ze,M as Le,A as ge,E as Je,G as Ye,H as Oe,J as Fe,T as St,K as Ke,N as Ct}from"./index-CC1_5J9E.js";import{D as Pt}from"./Doc-DaOTQ68S.js";var Tt=e.from_html('<button type="button" role="checkbox" class="superellipse group flex h-30 items-center gap-8 rounded-[10px] pl-6 pr-14 cursor-pointer select-none text-left transition-colors hover:bg-(--hover-fill)"><!> <span> </span></button>'),Rt=e.from_html("<div></div>");function Lt(le,N){e.push(N,!0);let ie=e.prop(N,"options",19,()=>[]),I=e.prop(N,"value",31,()=>e.proxy([])),V=e.prop(N,"disabled",3,!1);function O(H){V()||(I(I().includes(H)?I().filter(X=>X!==H):[...I(),H]),N.onchange?.(I()))}var Q=Rt();e.each(Q,20,ie,H=>H,(H,X)=>{const K=e.derived(()=>I().includes(X));var W=Tt(),se=e.child(W);ye(se,{get checked(){return e.get(K)}});var ee=e.sibling(se,2),pe=e.child(ee,!0);e.reset(ee),e.reset(W),e.template_effect(()=>{e.set_attribute(W,"aria-checked",e.get(K)),e.set_class(ee,1,e.clsx(["flex-1 truncate text-left text-[16px]/[110%] transition-colors",e.get(K)?"text-(--fg)":"text-(--fg-muted) group-hover:text-(--fg)"])),e.set_text(pe,X)}),e.delegated("click",W,()=>O(X)),e.append(H,W)}),e.reset(Q),e.template_effect(()=>e.set_class(Q,1,e.clsx(["flex flex-col",V()&&"pointer-events-none opacity-50"]))),e.append(le,Q),e.pop()}e.delegate(["click"]);var Ft=e.from_html('<button type="button" role="radio" class="superellipse group flex h-30 items-center gap-8 rounded-[10px] pl-6 pr-14 cursor-pointer select-none text-left transition-colors hover:bg-(--hover-fill)"><!> <span> </span></button>'),Et=e.from_html("<div></div>");function At(le,N){e.push(N,!0);let ie=e.prop(N,"options",19,()=>[]),I=e.prop(N,"value",15,""),V=e.prop(N,"disabled",3,!1);function O(H){V()||(I(H),N.onchange?.(I()))}var Q=Et();e.each(Q,20,ie,H=>H,(H,X)=>{const K=e.derived(()=>I()===X);var W=Ft(),se=e.child(W);_e(se,{get checked(){return e.get(K)}});var ee=e.sibling(se,2),pe=e.child(ee,!0);e.reset(ee),e.reset(W),e.template_effect(()=>{e.set_attribute(W,"aria-checked",e.get(K)),e.set_class(ee,1,e.clsx(["flex-1 truncate text-left text-[16px]/[110%] transition-colors",e.get(K)?"text-(--fg)":"text-(--fg-muted) group-hover:text-(--fg)"])),e.set_text(pe,X)}),e.delegated("click",W,()=>O(X)),e.append(H,W)}),e.reset(Q),e.template_effect(()=>e.set_class(Q,1,e.clsx(["flex flex-col",V()&&"pointer-events-none opacity-50"]))),e.append(le,Q),e.pop()}e.delegate(["click"]);const ne=(le,N=e.noop,ie=e.noop)=>{var I=Ht(),V=e.child(I);yt(V,{size:"lg",tight:!0,get title(){return N()}});var O=e.sibling(V,2);e.snippet(O,ie),e.reset(I),e.append(le,I)},Y=(le,N=e.noop,ie=e.noop)=>{var I=Mt(),V=e.child(I),O=e.child(V,!0);e.reset(V);var Q=e.sibling(V,2),H=e.child(Q);e.snippet(H,ie),e.reset(Q),e.reset(I),e.template_effect(()=>e.set_text(O,N())),e.append(le,I)};var Ht=e.from_html('<section class="flex flex-col gap-16 py-20 first:pt-4"><!> <!></section>'),Mt=e.from_html('<div class="flex flex-col gap-7 pl-8"><span class="text-[11px]/none text-neutral-400"> </span> <div class="flex flex-wrap items-center gap-10"><!></div></div>'),xe=e.from_html("<!> <!>",1),me=e.from_html("<!> <!> <!> <!> <!>",1),It=e.from_html('<span class="text-center text-[11px]/none font-medium text-neutral-400"> </span>'),Ut=e.from_html('<div class="flex justify-center"><!></div>'),Bt=e.from_html('<span class="text-[11px]/none text-neutral-400"> </span> <!>',1),Dt=e.from_html('<div class="flex flex-col gap-20"><div class="grid grid-cols-[4.5rem_repeat(2,minmax(0,1fr))] items-center gap-x-10 gap-y-12"><span></span> <!> <!></div> <!> <!> <!></div>'),he=e.from_html("<!> <!> <!>",1),Nt=e.from_html('<div class="flex flex-wrap items-center gap-10 pl-8"><!> <!> <!> <!> <!></div>'),zt=e.from_html('<div class="self-center"><!></div>'),qt=e.from_html('<div class="pl-8"><!></div>'),Gt=e.from_html('<div><p class="field-error-text" role="alert">Enter a valid email</p></div>'),Vt=e.from_html('<button type="button"><!></button>'),Qt=e.from_html('<div class="flex flex-col gap-10 pl-8"><!> <!> <div><!> <!></div> <!> <!> <!></div>'),Xt=e.from_html('<p class="field-hint"><span>HTML detected. <button type="button" class="field-note-action">Enable Renders as HTML</button></span></p>'),Wt=e.from_html('<p class="field-error" role="status">1 item over the limit. Remove it or increase Max items.</p>'),jt=e.from_html('<p class="field-hint"><span>Shown under the title.</span></p>'),Zt=e.from_html('<span class="text-[11px]/none text-neutral-400"> </span> <p> </p> <p> </p>',1),Jt=e.from_html('<div><p class="field-error-text" role="alert">Required</p></div>'),Yt=e.from_html('<div><p class="field-error-text" role="alert">A value is outside the allowed range.</p></div>'),Ot=e.from_html('<div class="flex flex-col gap-20 pl-8"><div><!></div> <div class="grid grid-cols-[4.5rem_minmax(0,1fr)_minmax(0,1fr)] items-center gap-x-10 gap-y-12"><span></span> <span class="text-[11px]/none font-medium text-neutral-400">bare</span> <span class="text-[11px]/none font-medium text-neutral-400">wrapped</span> <!></div> <div><!> <p class="field-hint-text"></p></div> <div><!> <p class="field-hint-text"> <button type="button" class="field-note-action"> </button></p></div> <div><!> <p class="field-hint-text">HTML detected. <button type="button" class="field-note-action" disabled="">Enabling\u2026</button></p></div> <div><!> <p class="field-hint-text">Save and refresh the page to update this list\u2019s preview.</p></div> <div><!> <p class="field-hint-text">Universal identifier. Locked after save.</p></div> <div><!> <p class="field-warning-text flex flex-wrap items-center gap-x-4"><!><span class="mr-2">Connect in code</span><!></p></div> <div><!> <!></div> <div><!> <!></div> <!> <!> <!></div>'),Kt=e.from_html('<div class="flex flex-col gap-16"><!> <div class="flex flex-col gap-7 pl-8"><span class="text-[11px]/none text-neutral-400">Toggle field</span> <div class="max-w-340"><!></div></div> <div class="flex flex-col gap-7 pl-8"><span class="text-[11px]/none text-neutral-400">Multi-select field \u2014 label + checkbox dropdown</span> <div class="max-w-340"><!></div></div> <div class="flex flex-col gap-7 pl-8"><span class="text-[11px]/none text-neutral-400">Select field \u2014 single-select dropdown (sky tint when set)</span> <div class="max-w-340"><!></div></div> <div class="flex flex-col gap-7 pl-8"><span class="text-[11px]/none text-neutral-400">Toggle field \u2014 grouped in a List</span> <div class="max-w-340"><!></div></div> <div class="flex flex-col gap-7 pl-8"><span class="text-[11px]/none text-neutral-400">Checkbox</span> <div class="flex items-center gap-10"><!> <!> <!></div> <!></div> <div class="flex flex-col gap-7 pl-8"><span class="text-[11px]/none text-neutral-400">Radio</span> <div class="flex items-center gap-10"><!> <!> <!></div> <!></div></div>'),el=e.from_html('<div class="flex flex-col gap-16"><!> <div class="flex flex-col gap-7 pl-8"><span class="text-[11px]/none text-neutral-400">Skeleton</span> <div class="flex flex-col gap-6"><!> <!></div></div></div>'),tl=e.from_html("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),ll=e.from_html("<!> <!> <!> <!>",1),il=e.from_html("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),al=e.from_html("<!> <!> <!> <!> <!> <!> <!> <!>",1),nl=e.from_html('<div class="flex flex-col gap-16"><!> <!> <!> <!> <!> <!></div>'),sl=e.from_html(`<h1>The type scale</h1> <p>Body copy sets the rhythm \u2014 fifteen pixels, a calm line height, muted ink. Every other
|
|
2
|
+
level is measured against it.</p> <section class="flex flex-col gap-6"><h2>Section heading</h2> <p>Breaks a topic into parts. Weighted, full-strength ink, no caps. Inline <code>code</code> and <a href="#prose">links</a> sit here too.</p></section> <section class="flex flex-col gap-6"><h3>Sub-heading</h3> <p>The quietest level, for the occasional aside.</p></section> <!>`,1),rl=e.from_html('<div class="pl-8"><div class="superellipse max-w-440 rounded-[14px] border-[0.5px] border-(--hairline)"><!></div></div>'),dl=e.from_html('<div class="mx-auto w-full max-w-760 px-14 py-12"><div class="flex flex-col divide-y-[0.5px] divide-(--hairline)"><!> <!> <!> <!> <!> <!> <!> <!> <!></div></div>');function ol(le,N){e.push(N,!0);const ie=["idle","sky","green","danger"],I=[{label:"filled",ghost:!1},{label:"ghost",ghost:!0}];let V=e.state("Hello Okno"),O=e.state(!0),Q=e.state(!1),H=e.state(!0),X=e.state(!1),K=e.state(e.proxy(["Images","Audio"])),W=e.state("Draft"),se=e.state(e.proxy(["image"])),ee=e.state(e.proxy([])),pe=e.state("hero"),Ee=e.state(""),de=e.state(!0),te=e.state(!0),$e=e.state(!1),Ae=e.state(e.proxy(["Press E.<br/>Edit it live.","Build for free.<br/>Pay when it's live."])),He=e.state(e.proxy(["One","Two","Three","Four"])),Me=e.state(e.proxy([{text:"Home",url:"/",external:!1},{text:"GitHub",url:"https://github.com/okno-cms/okno",external:!0}]));const et=[{tone:"hint",bare:"field-hint-text",wrapped:"field-hint",text:"Shown in the browser tab."},{tone:"warning",bare:"field-warning-text",wrapped:"field-warning",text:"Connect in code"},{tone:"error",bare:"field-error-text",wrapped:"field-error",text:"Required"}],{modals:tt,confirms:ke,bus:re}=kt();let Ie=e.state("https://example.com");const $=(ce,ve)=>tt.open(ce,ve);function oe(ce={}){return{role:"editor",becomesOwner:!1,createdBy:"gauel",createdByName:"Gabriel Uhl\xED\u0159",login:null,repo:"gauel/okno-test",...ce}}function lt(){ke.ask({title:"Delete this item?",description:"This can't be undone.",confirmText:"Delete",danger:!0,icon:"trash-2"})}function Ue(ce=!1){let ve=!0;Ct({get isDirty(){return ve},savePromise:null},{save:()=>{ve=!1},discard:()=>{ve=!1}},ke,{title:"Unsaved changes",description:ce?"Save your edits before editing structure?":"Save your edits before leaving?"})}function it(){ke.askChoice({title:"File already exists",description:"Choose how to handle this duplicate file.",choices:[{key:"cancel",label:"Cancel",variant:"secondary"},{key:"skip",label:"Skip",variant:"secondary"},{key:"keep_both",label:"Keep Both",variant:"primary"},{key:"replace",label:"Replace",variant:"danger"}]})}function at(){ke.ask({title:"Rename field?",description:"Update your markup to match:",confirmText:"Rename",icon:"input-text",codeLang:"html",codeBlocks:[{text:"From",code:"<h1 {...home.title}>"},{text:"to",code:"<h1 {...home.heading}>"}]})}wt(le,{children:(ce,ve)=>{var Se=dl(),Be=e.child(Se);{const st=z=>{var f=Dt();{const B=a=>{var l=xe(),n=e.first_child(l);t(n,{children:(i,c)=>{e.next();var o=e.text("Medium");e.append(i,o)},$$slots:{default:!0}});var s=e.sibling(n,2);t(s,{size:"lg",children:(i,c)=>{e.next();var o=e.text("Large");e.append(i,o)},$$slots:{default:!0}}),e.append(a,l)},b=a=>{var l=me(),n=e.first_child(l);t(n,{icon:"upload",children:(v,u)=>{e.next();var p=e.text("Upload");e.append(v,p)},$$slots:{default:!0}});var s=e.sibling(n,2);t(s,{tone:"idle",icon:"images",children:(v,u)=>{e.next();var p=e.text("From Files");e.append(v,p)},$$slots:{default:!0}});var i=e.sibling(s,2);t(i,{tone:"idle",iconRight:"arrow-down",children:(v,u)=>{e.next();var p=e.text("Select");e.append(v,p)},$$slots:{default:!0}});var c=e.sibling(i,2);t(c,{tone:"idle",ghost:!0,icon:"cog","aria-label":"Settings"});var o=e.sibling(c,2);t(o,{icon:"check","aria-label":"Confirm"}),e.append(a,l)},w=a=>{var l=me(),n=e.first_child(l);t(n,{loading:!0,children:(v,u)=>{e.next();var p=e.text("Saving");e.append(v,p)},$$slots:{default:!0}});var s=e.sibling(n,2);t(s,{tone:"idle",loading:!0,icon:"upload",children:(v,u)=>{e.next();var p=e.text("Uploading");e.append(v,p)},$$slots:{default:!0}});var i=e.sibling(s,2);t(i,{loading:!0,"aria-label":"Loading"});var c=e.sibling(i,2);t(c,{disabled:!0,children:(v,u)=>{e.next();var p=e.text("Disabled");e.append(v,p)},$$slots:{default:!0}});var o=e.sibling(c,2);t(o,{tone:"idle",disabled:!0,children:(v,u)=>{e.next();var p=e.text("Disabled");e.append(v,p)},$$slots:{default:!0}}),e.append(a,l)};var P=e.child(f),E=e.sibling(e.child(P),2);e.each(E,17,()=>I,e.index,(a,l)=>{var n=It(),s=e.child(n,!0);e.reset(n),e.template_effect(()=>e.set_text(s,e.get(l).label)),e.append(a,n)});var A=e.sibling(E,2);e.each(A,17,()=>ie,e.index,(a,l)=>{var n=Bt(),s=e.first_child(n),i=e.child(s,!0);e.reset(s);var c=e.sibling(s,2);e.each(c,17,()=>I,e.index,(o,v)=>{var u=Ut(),p=e.child(u);t(p,{get tone(){return e.get(l)},get ghost(){return e.get(v).ghost},children:(h,y)=>{e.next();var F=e.text("Button");e.append(h,F)},$$slots:{default:!0}}),e.reset(u),e.append(o,u)}),e.template_effect(()=>e.set_text(i,e.get(l))),e.append(a,n)}),e.reset(P);var M=e.sibling(P,2);Y(M,()=>"Sizes",()=>B);var L=e.sibling(M,2);Y(L,()=>"Icons & icon-only",()=>b);var C=e.sibling(L,2);Y(C,()=>"States",()=>w),e.reset(f)}e.append(z,f)},rt=z=>{var f=Nt(),P=e.child(f);ue(P,{label:"Options",children:(C,B)=>{var b=me(),w=e.first_child(b);Z(w,{icon:"upload",children:(i,c)=>{e.next();var o=e.text("Replace");e.append(i,o)},$$slots:{default:!0}});var a=e.sibling(w,2);Z(a,{icon:"images",children:(i,c)=>{e.next();var o=e.text("From Files");e.append(i,o)},$$slots:{default:!0}});var l=e.sibling(a,2);Z(l,{icon:"zap",children:(i,c)=>{e.next();var o=e.text("Compress");e.append(i,o)},$$slots:{default:!0}});var n=e.sibling(l,2);_t(n);var s=e.sibling(n,2);Z(s,{icon:"trash-2",variant:"danger",children:(i,c)=>{e.next();var o=e.text("Remove");e.append(i,o)},$$slots:{default:!0}}),e.append(C,b)},$$slots:{default:!0}});var E=e.sibling(P,2);ue(E,{label:"English",icon:"languages",children:(C,B)=>{var b=xe(),w=e.first_child(b);Z(w,{selected:!0,children:(l,n)=>{e.next();var s=e.text("English");e.append(l,s)},$$slots:{default:!0}});var a=e.sibling(w,2);Z(a,{selected:!1,children:(l,n)=>{e.next();var s=e.text("\u010Ce\u0161tina");e.append(l,s)},$$slots:{default:!0}}),e.append(C,b)},$$slots:{default:!0}});var A=e.sibling(E,2);ue(A,{label:"main",icon:"git-branch",tone:"idle",children:(C,B)=>{var b=xe(),w=e.first_child(b);Z(w,{selected:!0,children:(l,n)=>{e.next();var s=e.text("main");e.append(l,s)},$$slots:{default:!0}});var a=e.sibling(w,2);Z(a,{selected:!1,children:(l,n)=>{e.next();var s=e.text("production");e.append(l,s)},$$slots:{default:!0}}),e.append(C,b)},$$slots:{default:!0}});var M=e.sibling(A,2);ue(M,{label:"Media",icon:"images",tone:"idle",children:(C,B)=>{var b=he(),w=e.first_child(b);Z(w,{indicator:"checkbox",selected:!0,children:(n,s)=>{e.next();var i=e.text("Images");e.append(n,i)},$$slots:{default:!0}});var a=e.sibling(w,2);Z(a,{indicator:"checkbox",selected:!1,children:(n,s)=>{e.next();var i=e.text("Videos");e.append(n,i)},$$slots:{default:!0}});var l=e.sibling(a,2);Z(l,{indicator:"checkbox",selected:!0,children:(n,s)=>{e.next();var i=e.text("Audio");e.append(n,i)},$$slots:{default:!0}}),e.append(C,b)},$$slots:{default:!0}});var L=e.sibling(M,2);ue(L,{label:"Publish",tone:"sky",chevron:!1,children:(C,B)=>{Z(C,{icon:"rocket",children:(b,w)=>{e.next();var a=e.text("Publish now");e.append(b,a)},$$slots:{default:!0}})},$$slots:{default:!0}}),e.reset(f),e.append(z,f)},dt=z=>{var f=qt(),P=e.child(f);fe(P,{children:(E,A)=>{var M=me(),L=e.first_child(M);be(L,{icon:"file-text",title:"About",subtitle:"/about \u2014 default sky tile",onclick:()=>{}});var C=e.sibling(L,2);be(C,{icon:"layers",iconBadge:"rounded-full glass bg-linear-to-b from-green-500 to-green-600 text-white",title:"Posts",subtitle:"12 entries \u2014 shade override",chevron:!0});var B=e.sibling(C,2);be(B,{title:"Plain row",subtitle:"No leading slot \u2014 balanced pl-12"});var b=e.sibling(B,2);be(b,{icon:"git-branch",title:"With end slot",subtitle:"Action on the right",end:a=>{var l=zt(),n=e.child(l);t(n,{tone:"idle",ghost:!0,icon:"external-link",children:(s,i)=>{e.next();var c=e.text("Open");e.append(s,c)},$$slots:{default:!0}}),e.reset(l),e.append(a,l)},$$slots:{end:!0}});var w=e.sibling(b,2);be(w,{icon:"trash-2",titleClass:"text-rose-500",title:"Disabled",subtitle:"Not selectable",disabled:!0}),e.append(E,M)}}),e.reset(f),e.append(z,f)},ot=z=>{var f=Qt(),P=e.child(f);G(P,{label:"Text",children:(a,l)=>{j(a,{placeholder:"Type something\u2026",get value(){return e.get(V)},set value(n){e.set(V,n,!0)}})},$$slots:{default:!0}});var E=e.sibling(P,2);G(E,{label:"Required",required:!0,children:(a,l)=>{j(a,{placeholder:"Empty"})},$$slots:{default:!0}});var A=e.sibling(E,2),M=e.child(A);G(M,{label:"With error",children:(a,l)=>{j(a,{value:"not-an-email",get invalid(){return e.get(te)}})},$$slots:{default:!0}});var L=e.sibling(M,2);{var C=a=>{var l=Gt();e.transition(3,l,()=>Te,()=>({duration:180,easing:Re})),e.append(a,l)};e.if(L,a=>{e.get(te)&&a(C)})}e.reset(A);var B=e.sibling(A,2);G(B,{label:"Disabled",disabled:!0,children:(a,l)=>{j(a,{value:"Read only",disabled:!0})},$$slots:{default:!0}});var b=e.sibling(B,2);G(b,{label:"Multiline",children:(a,l)=>{j(a,{multiline:!0,placeholder:"A few lines\u2026"})},$$slots:{default:!0}});var w=e.sibling(b,2);G(w,{label:"Slug",as:"div",action:a=>{var l=Vt(),n=e.child(l);{let s=e.derived(()=>e.get(de)?"lock":"unlock");je(n,{get name(){return e.get(s)},variant:"stroke",class:"size-12 pointer-events-none"})}e.reset(l),e.template_effect(()=>{e.set_attribute(l,"aria-pressed",e.get(de)),e.set_attribute(l,"aria-label",e.get(de)?"Unlock":"Lock"),e.set_class(l,1,e.clsx(["flex-center size-24 cursor-pointer rounded-lg transition-colors",e.get(de)?"bg-sky-500/10 text-sky-500 hover:bg-sky-500/15":"bg-black/5 text-neutral-400 hover:bg-black/8 hover:text-neutral-600 dark:bg-white/10 dark:hover:bg-white/15"]))}),e.delegated("click",l,()=>e.set(de,!e.get(de))),e.append(a,l)},children:(a,l)=>{{let n=e.derived(()=>!e.get(de));j(a,{value:"my-page",placeholder:"slug",get disabled(){return e.get(n)}})}},$$slots:{action:!0,default:!0}}),e.reset(f),e.append(z,f)},ct=z=>{var f=Ot();{const ft=g=>{var S=Xt();e.append(g,S)},bt=g=>{var S=Wt();e.append(g,S)},xt=g=>{var S=jt();e.append(g,S)};var P=e.child(f),E=e.child(P);t(E,{tone:"idle",onclick:()=>e.set(te,!e.get(te)),children:(g,S)=>{e.next();var J=e.text();e.template_effect(()=>e.set_text(J,e.get(te)?"Hide errors":"Show errors")),e.append(g,J)},$$slots:{default:!0}}),e.reset(P);var A=e.sibling(P,2),M=e.sibling(e.child(A),6);e.each(M,17,()=>et,e.index,(g,S)=>{var J=Zt(),ae=e.first_child(J),Ce=e.child(ae,!0);e.reset(ae);var we=e.sibling(ae,2),mt=e.child(we,!0);e.reset(we);var Pe=e.sibling(we,2),$t=e.child(Pe,!0);e.reset(Pe),e.template_effect(()=>{e.set_text(Ce,e.get(S).tone),e.set_class(we,1,e.clsx([e.get(S).bare,"px-0 py-0"])),e.set_text(mt,e.get(S).text),e.set_class(Pe,1,e.clsx([e.get(S).wrapped,"self-start"])),e.set_text($t,e.get(S).text)}),e.append(g,J)}),e.reset(A);var L=e.sibling(A,2),C=e.child(L);G(C,{label:"Help text",children:(g,S)=>{j(g,{placeholder:"Page title"})},$$slots:{default:!0}});var B=e.sibling(C,2);B.textContent=`Shown in the browser tab.
|
|
3
|
+
A second line keeps its break.`,e.reset(L);var b=e.sibling(L,2),w=e.child(b);G(w,{label:"HTML detected",children:(g,S)=>{j(g,{value:"Build for free.<br/>Pay when it's live."})},$$slots:{default:!0}});var a=e.sibling(w,2),l=e.child(a);l.nodeValue="HTML detected. ";var n=e.sibling(l),s=e.child(n,!0);e.reset(n),e.reset(a),e.reset(b);var i=e.sibling(b,2),c=e.child(i);G(c,{label:"Action busy",children:(g,S)=>{j(g,{value:"<b>Bold</b>"})},$$slots:{default:!0}}),e.next(2),e.reset(i);var o=e.sibling(i,2),v=e.child(o);G(v,{label:"Refresh notice",children:(g,S)=>{j(g,{value:"Three items"})},$$slots:{default:!0}}),e.next(2),e.reset(o);var u=e.sibling(o,2),p=e.child(u);G(p,{label:"Slug locked",children:(g,S)=>{j(g,{value:"my-page",disabled:!0})},$$slots:{default:!0}}),e.next(2),e.reset(u);var h=e.sibling(u,2),y=e.child(h);G(y,{label:"Connect in code",children:(g,S)=>{j(g,{value:"Hello"})},$$slots:{default:!0}});var F=e.sibling(y,2),T=e.child(F);je(T,{name:"alert",variant:"solid",size:14,class:"shrink-0"});var q=e.sibling(T,2);Ze(q,{code:"<h1 {...home.title}>",lang:"jsx",copy:!0,inline:!0}),e.reset(F),e.reset(h);var R=e.sibling(h,2),k=e.child(R);G(k,{label:"Required",required:!0,children:(g,S)=>{j(g,{placeholder:"Empty",get invalid(){return e.get(te)}})},$$slots:{default:!0}});var _=e.sibling(k,2);{var x=g=>{var S=Jt();e.transition(3,S,()=>Te,()=>({duration:180,easing:Re})),e.append(g,S)};e.if(_,g=>{e.get(te)&&g(x)})}e.reset(R);var U=e.sibling(R,2),D=e.child(U);G(D,{label:"Out of range",children:(g,S)=>{j(g,{value:"140",get invalid(){return e.get(te)}})},$$slots:{default:!0}});var r=e.sibling(D,2);{var m=g=>{var S=Yt();e.transition(3,S,()=>Te,()=>({duration:180,easing:Re})),e.append(g,S)};e.if(r,g=>{e.get(te)&&g(m)})}e.reset(U);var d=e.sibling(U,2);G(d,{label:"List \xB7 HTML detected",as:"div",children:(g,S)=>{{let J=e.derived(()=>({path:"ui.htmlList",value:e.get(Ae),def:{type:"string",multiple:!0}}));Le(g,{get field(){return e.get(J)},get note(){return ft},onchange:ae=>e.set(Ae,ae,!0)})}},$$slots:{default:!0}});var We=e.sibling(d,2);G(We,{label:"List \xB7 over the limit",as:"div",children:(g,S)=>{{let J=e.derived(()=>({path:"ui.overList",value:e.get(He),def:{type:"string",multiple:!0,maxItems:3}})),ae=e.derived(()=>e.get(te)?bt:xt);Le(g,{get field(){return e.get(J)},get note(){return e.get(ae)},onchange:Ce=>e.set(He,Ce,!0)})}},$$slots:{default:!0}});var ut=e.sibling(We,2);G(ut,{label:"Links \xB7 actions on hover",as:"div",children:(g,S)=>{{let J=e.derived(()=>({path:"ui.linkList",value:e.get(Me),def:{type:"link",multiple:!0}}));Le(g,{get field(){return e.get(J)},onchange:ae=>e.set(Me,ae,!0)})}},$$slots:{default:!0}}),e.reset(f),e.template_effect(()=>{n.disabled=e.get($e),e.set_text(s,e.get($e)?"Enabling\u2026":"Enable Renders as HTML")}),e.delegated("click",n,()=>e.set($e,!e.get($e)))}e.append(z,f)},pt=z=>{var f=Kt();{const k=_=>{var x=he(),U=e.first_child(x);Fe(U,{get checked(){return e.get(O)},set checked(m){e.set(O,m,!0)}});var D=e.sibling(U,2);Fe(D,{get checked(){return e.get(Q)},set checked(m){e.set(Q,m,!0)}});var r=e.sibling(D,2);Fe(r,{checked:!0,disabled:!0}),e.append(_,x)};var P=e.child(f);Y(P,()=>"Switch",()=>k);var E=e.sibling(P,2),A=e.sibling(e.child(E),2),M=e.child(A);fe(M,{children:(_,x)=>{var U=he(),D=e.first_child(U);ge(D,{label:"Required",get checked(){return e.get(H)},set checked(d){e.set(H,d,!0)}});var r=e.sibling(D,2);ge(r,{label:"Multiple",subtitle:"Allow more than one value.",get checked(){return e.get(X)},set checked(d){e.set(X,d,!0)}});var m=e.sibling(r,2);ge(m,{label:"Integer only",onremove:()=>{},get checked(){return e.get(H)},set checked(d){e.set(H,d,!0)}}),e.append(_,U)}}),e.reset(A),e.reset(E);var L=e.sibling(E,2),C=e.sibling(e.child(L),2),B=e.child(C);fe(B,{children:(_,x)=>{var U=xe(),D=e.first_child(U);Je(D,{label:"Allowed types",options:[{value:"image",label:"Images"},{value:"video",label:"Videos"},{value:"audio",label:"Audio"},{value:"document",label:"Files"}],get selected(){return e.get(se)},emptyLabel:"Any file type",onchange:m=>e.set(se,m,!0)});var r=e.sibling(D,2);Je(r,{label:"Formatting",groups:[{options:[{value:"bold",label:"Bold"},{value:"italic",label:"Italic"},{value:"link",label:"Link"}]},{options:[{value:"h1",label:"Heading"},{value:"bulletList",label:"Bullet list"},{value:"blockquote",label:"Quote"}]},{options:[{value:"media",label:"Media"},{value:"table",label:"Table"}]}],get selected(){return e.get(ee)},emptyLabel:"No formatting",onchange:m=>e.set(ee,m,!0)}),e.append(_,U)}}),e.reset(C),e.reset(L);var b=e.sibling(L,2),w=e.sibling(e.child(b),2),a=e.child(w);fe(a,{children:(_,x)=>{var U=xe(),D=e.first_child(U);Ye(D,{label:"Block",placeholder:"Pick block",get value(){return e.get(pe)},options:[{value:"hero",label:"Hero"},{value:"gallery",label:"Gallery"},{value:"pricing",label:"Pricing"}],onchange:m=>e.set(pe,m,!0)});var r=e.sibling(D,2);Ye(r,{label:"Collection",placeholder:"Pick collection",get value(){return e.get(Ee)},options:[{value:"articles",label:"Articles"},{value:"authors",label:"Authors"}],onchange:m=>e.set(Ee,m,!0)}),e.append(_,U)}}),e.reset(w),e.reset(b);var l=e.sibling(b,2),n=e.sibling(e.child(l),2),s=e.child(n);fe(s,{children:(_,x)=>{var U=he(),D=e.first_child(U);ge(D,{label:"Images",get checked(){return e.get(H)},set checked(d){e.set(H,d,!0)}});var r=e.sibling(D,2);ge(r,{label:"Videos",get checked(){return e.get(X)},set checked(d){e.set(X,d,!0)}});var m=e.sibling(r,2);ge(m,{checked:!0,label:"Audio"}),e.append(_,U)}}),e.reset(n),e.reset(l);var i=e.sibling(l,2),c=e.sibling(e.child(i),2),o=e.child(c);ye(o,{checked:!1});var v=e.sibling(o,2);ye(v,{checked:!0});var u=e.sibling(v,2);ye(u,{checked:!0,disabled:!0}),e.reset(c);var p=e.sibling(c,2);Lt(p,{options:["Images","Videos","Audio"],get value(){return e.get(K)},set value(_){e.set(K,_,!0)}}),e.reset(i);var h=e.sibling(i,2),y=e.sibling(e.child(h),2),F=e.child(y);_e(F,{checked:!1});var T=e.sibling(F,2);_e(T,{checked:!0});var q=e.sibling(T,2);_e(q,{checked:!0,disabled:!0}),e.reset(y);var R=e.sibling(y,2);At(R,{options:["Draft","Published","Archived"],get value(){return e.get(W)},set value(_){e.set(W,_,!0)}}),e.reset(h),e.reset(f)}e.append(z,f)},vt=z=>{var f=el();{const C=B=>{var b=he(),w=e.first_child(b);St(w,{content:"A helpful hint",trigger:(n,s)=>{let i=()=>s?.().props;t(n,e.spread_props(i,{tone:"idle",children:(c,o)=>{e.next();var v=e.text("Hover me");e.append(c,v)},$$slots:{default:!0}}))},$$slots:{trigger:!0}});var a=e.sibling(w,2);Ke(a,{class:"size-16"});var l=e.sibling(a,2);Ke(l,{class:"size-24"}),e.append(B,b)};var P=e.child(f);Y(P,()=>"Tooltip & spinner",()=>C);var E=e.sibling(P,2),A=e.sibling(e.child(E),2),M=e.child(A);Oe(M,{class:"h-30 w-full rounded-[10px]"});var L=e.sibling(M,2);Oe(L,{class:"h-30 w-2/3 rounded-[10px] opacity-60"}),e.reset(A),e.reset(E),e.reset(f)}e.append(z,f)},gt=z=>{var f=nl();{const B=s=>{var i=tl(),c=e.first_child(i);t(c,{tone:"idle",onclick:()=>$("trust-domain"),children:(r,m)=>{e.next();var d=e.text("Trust domain");e.append(r,d)},$$slots:{default:!0}});var o=e.sibling(c,2);t(o,{tone:"idle",onclick:()=>$("publish-needs-domain"),children:(r,m)=>{e.next();var d=e.text("Publish needs domain");e.append(r,d)},$$slots:{default:!0}});var v=e.sibling(o,2);t(v,{tone:"idle",onclick:()=>re.emit("publish:problem",{reason:"conflict",message:"GitHub returned 409 \u2014 the branch is out of date."}),children:(r,m)=>{e.next();var d=e.text("Publish problem");e.append(r,d)},$$slots:{default:!0}});var u=e.sibling(v,2);t(u,{tone:"idle",onclick:()=>$("demo-cta"),children:(r,m)=>{e.next();var d=e.text("Demo CTA");e.append(r,d)},$$slots:{default:!0}});var p=e.sibling(u,2);t(p,{tone:"idle",onclick:()=>$("not-authorized"),children:(r,m)=>{e.next();var d=e.text("Not authorized");e.append(r,d)},$$slots:{default:!0}});var h=e.sibling(p,2);t(h,{tone:"idle",onclick:()=>$("invite-accept",{token:"preview",info:oe()}),children:(r,m)=>{e.next();var d=e.text("Invite \xB7 editor");e.append(r,d)},$$slots:{default:!0}});var y=e.sibling(h,2);t(y,{tone:"idle",onclick:()=>$("invite-accept",{token:"preview",info:oe({role:"developer"})}),children:(r,m)=>{e.next();var d=e.text("Invite \xB7 developer");e.append(r,d)},$$slots:{default:!0}});var F=e.sibling(y,2);t(F,{tone:"idle",onclick:()=>$("invite-accept",{token:"preview",info:oe({becomesOwner:!0})}),children:(r,m)=>{e.next();var d=e.text("Invite \xB7 handoff");e.append(r,d)},$$slots:{default:!0}});var T=e.sibling(F,2);t(T,{tone:"idle",onclick:()=>$("invite-accept",{token:"preview",info:oe({login:"octocat"})}),children:(r,m)=>{e.next();var d=e.text("Invite \xB7 scoped");e.append(r,d)},$$slots:{default:!0}});var q=e.sibling(T,2);t(q,{tone:"idle",onclick:()=>$("invite-accept",{token:"preview",info:oe({createdByName:null})}),children:(r,m)=>{e.next();var d=e.text("Invite \xB7 no name");e.append(r,d)},$$slots:{default:!0}});var R=e.sibling(q,2);t(R,{tone:"idle",onclick:()=>$("invite-accept",{token:"preview",error:"This invitation has already been used, or it's expired."}),children:(r,m)=>{e.next();var d=e.text("Invite \xB7 expired");e.append(r,d)},$$slots:{default:!0}});var k=e.sibling(R,2);t(k,{tone:"idle",onclick:()=>$("invite-accept",{token:"preview",info:oe(),stage:"welcome"}),children:(r,m)=>{e.next();var d=e.text("Invite \xB7 welcome");e.append(r,d)},$$slots:{default:!0}});var _=e.sibling(k,2);t(_,{tone:"idle",onclick:()=>$("invite-accept",{token:"preview",info:oe({becomesOwner:!0}),stage:"welcome",becameOwner:!0}),children:(r,m)=>{e.next();var d=e.text("Invite \xB7 welcome (owner)");e.append(r,d)},$$slots:{default:!0}});var x=e.sibling(_,2);t(x,{tone:"idle",onclick:()=>$("billing-consent",{stage:"consent"}),children:(r,m)=>{e.next();var d=e.text("Billing consent");e.append(r,d)},$$slots:{default:!0}});var U=e.sibling(x,2);t(U,{tone:"idle",onclick:()=>$("billing-consent",{stage:"success",plan:"year"}),children:(r,m)=>{e.next();var d=e.text("Billing success");e.append(r,d)},$$slots:{default:!0}});var D=e.sibling(U,2);t(D,{tone:"idle",onclick:()=>$("billing-year-capped",{cycleEnd:"2026-12-31"}),children:(r,m)=>{e.next();var d=e.text("Year capped");e.append(r,d)},$$slots:{default:!0}}),e.append(s,i)},b=s=>{var i=ll(),c=e.first_child(i);t(c,{tone:"idle",onclick:()=>$("setup-preview",{stage:"signin"}),children:(p,h)=>{e.next();var y=e.text("Setup \xB7 sign-in");e.append(p,y)},$$slots:{default:!0}});var o=e.sibling(c,2);t(o,{tone:"idle",onclick:()=>$("setup-preview",{stage:"install"}),children:(p,h)=>{e.next();var y=e.text("Setup \xB7 repository access");e.append(p,y)},$$slots:{default:!0}});var v=e.sibling(o,2);t(v,{tone:"idle",onclick:()=>$("setup-preview",{stage:"scaffold"}),children:(p,h)=>{e.next();var y=e.text("Setup \xB7 progress");e.append(p,y)},$$slots:{default:!0}});var u=e.sibling(v,2);t(u,{tone:"idle",onclick:()=>$("setup-preview",{stage:"error"}),children:(p,h)=>{e.next();var y=e.text("Setup \xB7 error");e.append(p,y)},$$slots:{default:!0}}),e.append(s,i)},w=s=>{var i=il(),c=e.first_child(i);t(c,{tone:"idle",onclick:()=>$("new-page"),children:(k,_)=>{e.next();var x=e.text("New page");e.append(k,x)},$$slots:{default:!0}});var o=e.sibling(c,2);t(o,{tone:"idle",onclick:()=>$("new-collection"),children:(k,_)=>{e.next();var x=e.text("New collection");e.append(k,x)},$$slots:{default:!0}});var v=e.sibling(o,2);t(v,{tone:"idle",onclick:()=>$("new-global"),children:(k,_)=>{e.next();var x=e.text("New global");e.append(k,x)},$$slots:{default:!0}});var u=e.sibling(v,2);t(u,{tone:"idle",onclick:()=>$("new-block"),children:(k,_)=>{e.next();var x=e.text("New block");e.append(k,x)},$$slots:{default:!0}});var p=e.sibling(u,2);t(p,{tone:"idle",onclick:()=>$("new-folder"),children:(k,_)=>{e.next();var x=e.text("New folder");e.append(k,x)},$$slots:{default:!0}});var h=e.sibling(p,2);t(h,{tone:"idle",onclick:()=>$("add-language"),children:(k,_)=>{e.next();var x=e.text("Add language");e.append(k,x)},$$slots:{default:!0}});var y=e.sibling(h,2);t(y,{tone:"idle",onclick:()=>$("invite-editor"),children:(k,_)=>{e.next();var x=e.text("Invite editor");e.append(k,x)},$$slots:{default:!0}});var F=e.sibling(y,2);t(F,{tone:"idle",onclick:()=>$("compress-files"),children:(k,_)=>{e.next();var x=e.text("Compress files");e.append(k,x)},$$slots:{default:!0}});var T=e.sibling(F,2);t(T,{tone:"idle",onclick:()=>$("prepare-icons",{folder:""}),children:(k,_)=>{e.next();var x=e.text("Prepare icons");e.append(k,x)},$$slots:{default:!0}});var q=e.sibling(T,2);t(q,{tone:"idle",onclick:()=>$("rt-url",{value:e.get(Ie),onapply:k=>{e.set(Ie,k,!0)}}),children:(k,_)=>{e.next();var x=e.text("Rich-text URL");e.append(k,x)},$$slots:{default:!0}});var R=e.sibling(q,2);t(R,{tone:"idle",onclick:()=>$("detected-fields",{kind:"pages",name:"home"}),children:(k,_)=>{e.next();var x=e.text("Detected fields");e.append(k,x)},$$slots:{default:!0}}),e.append(s,i)},a=s=>{var i=me(),c=e.first_child(i);t(c,{tone:"idle",onclick:lt,children:(h,y)=>{e.next();var F=e.text("Confirm (danger)");e.append(h,F)},$$slots:{default:!0}});var o=e.sibling(c,2);t(o,{tone:"idle",onclick:()=>Ue(!0),children:(h,y)=>{e.next();var F=e.text("Structure unsaved changes");e.append(h,F)},$$slots:{default:!0}});var v=e.sibling(o,2);t(v,{tone:"idle",onclick:()=>Ue(),children:(h,y)=>{e.next();var F=e.text("Unsaved changes (3-way)");e.append(h,F)},$$slots:{default:!0}});var u=e.sibling(v,2);t(u,{tone:"idle",onclick:it,children:(h,y)=>{e.next();var F=e.text("File conflict (4-way)");e.append(h,F)},$$slots:{default:!0}});var p=e.sibling(u,2);t(p,{tone:"idle",onclick:at,children:(h,y)=>{e.next();var F=e.text("Confirm with code");e.append(h,F)},$$slots:{default:!0}}),e.append(s,i)},l=s=>{var i=al(),c=e.first_child(i);t(c,{tone:"idle",onclick:()=>re.emit("write:problem",{kind:"save",message:"The server couldn't save these edits.",offline:!1}),children:(T,q)=>{e.next();var R=e.text("Save problem");e.append(T,R)},$$slots:{default:!0}});var o=e.sibling(c,2);t(o,{tone:"idle",onclick:()=>re.emit("write:problem",{kind:"delete",message:"The server couldn't delete this item.",offline:!1}),children:(T,q)=>{e.next();var R=e.text("Delete problem");e.append(T,R)},$$slots:{default:!0}});var v=e.sibling(o,2);t(v,{tone:"idle",onclick:()=>re.emit("write:problem",{kind:"save",message:"Connection unavailable.",offline:!0}),children:(T,q)=>{e.next();var R=e.text("Offline problem");e.append(T,R)},$$slots:{default:!0}});var u=e.sibling(v,2);t(u,{tone:"idle",onclick:()=>re.emit("write:problem",{kind:"action",title:"Couldn't create invite",message:"The server refused the invite. Nothing was changed.",offline:!1}),children:(T,q)=>{e.next();var R=e.text("Action problem");e.append(T,R)},$$slots:{default:!0}});var p=e.sibling(u,2);t(p,{tone:"idle",onclick:()=>re.emit("write:problem",{kind:"billing",message:"Subscription inactive. Upgrade to keep editing."}),children:(T,q)=>{e.next();var R=e.text("Subscription inactive");e.append(T,R)},$$slots:{default:!0}});var h=e.sibling(p,2);t(h,{tone:"idle",onclick:()=>re.emit("save:overwrote",{id:0,entry:"pages/home",author:"octocat",fields:[{key:"title",label:"Title",mine:"Hello world",theirs:"Hello"}]}),children:(T,q)=>{e.next();var R=e.text("Save overwrote");e.append(T,R)},$$slots:{default:!0}});var y=e.sibling(h,2);t(y,{tone:"idle",onclick:()=>re.emit("auth:error",{error:"Sign-in was refused for this preview."}),children:(T,q)=>{e.next();var R=e.text("Sign-in problem");e.append(T,R)},$$slots:{default:!0}});var F=e.sibling(y,2);t(F,{tone:"idle",onclick:()=>$("app-missing"),children:(T,q)=>{e.next();var R=e.text("App missing");e.append(T,R)},$$slots:{default:!0}}),e.append(s,i)},n=s=>{var i=he(),c=e.first_child(i);t(c,{tone:"idle",disabled:!0,children:(u,p)=>{e.next();var h=e.text("Edit fields");e.append(u,h)},$$slots:{default:!0}});var o=e.sibling(c,2);t(o,{tone:"idle",disabled:!0,children:(u,p)=>{e.next();var h=e.text("Edit language");e.append(u,h)},$$slots:{default:!0}});var v=e.sibling(o,2);t(v,{tone:"idle",disabled:!0,children:(u,p)=>{e.next();var h=e.text("MCP connect");e.append(u,h)},$$slots:{default:!0}}),e.append(s,i)};var P=e.child(f);Y(P,()=>"Celebration dialogs",()=>B);var E=e.sibling(P,2);Y(E,()=>"Setup",()=>b);var A=e.sibling(E,2);Y(A,()=>"Form windows",()=>w);var M=e.sibling(A,2);Y(M,()=>"Confirms",()=>a);var L=e.sibling(M,2);Y(L,()=>"Error dialogs",()=>l);var C=e.sibling(L,2);Y(C,()=>"Need live context \u2014 open from their real place",()=>n),e.reset(f)}e.append(z,f)},ht=z=>{var f=rl(),P=e.child(f),E=e.child(P);Pt(E,{children:(A,M)=>{var L=sl(),C=e.sibling(e.first_child(L),8);Ze(C,{code:'import { okno } from "okno/vite"'}),e.append(A,L)}}),e.reset(P),e.reset(f),e.append(z,f)};var De=e.child(Be);ne(De,()=>"Buttons",()=>st);var Ne=e.sibling(De,2);ne(Ne,()=>"Dropdown buttons",()=>rt);var ze=e.sibling(Ne,2);ne(ze,()=>"List items",()=>dt);var qe=e.sibling(ze,2);ne(qe,()=>"Inputs",()=>ot);var Ge=e.sibling(qe,2);ne(Ge,()=>"Field notes",()=>ct);var Ve=e.sibling(Ge,2);ne(Ve,()=>"Toggles",()=>pt);var Qe=e.sibling(Ve,2);ne(Qe,()=>"Feedback",()=>vt);var Xe=e.sibling(Qe,2);ne(Xe,()=>"Dialogs",()=>gt);var nt=e.sibling(Xe,2);ne(nt,()=>"Prose",()=>ht),e.reset(Be)}e.reset(Se),e.append(ce,Se)},$$slots:{default:!0}}),e.pop()}e.delegate(["click"]);export{ol as default};
|