nish-ui 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -94,6 +94,26 @@ then:
94
94
  A classic-script build (`theme.global.js`, `window.nishTheme`) covers pages that cannot use
95
95
  modules. See [Static sites](https://design.nish.software/#/static-sites).
96
96
 
97
+ ### Without React
98
+
99
+ `nish-ui/elements` is one self-contained file (about 20 KB gzipped at most) with custom
100
+ elements for pages that have no React: `<nish-theme-toggle>`, `<nish-sheet>`,
101
+ `<nish-dialog>`, `<nish-bottom-nav>` and `toast()`. They work in plain HTML, any framework
102
+ and Claude artifacts. They use the same `nish-*` classes as above, so link the stylesheets too.
103
+
104
+ ```html
105
+ <script src="https://cdn.jsdelivr.net/npm/nish-ui@X.Y.Z/dist/theme-init.js"></script>
106
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nish-ui@X.Y.Z/dist/nish.css">
107
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nish-ui@X.Y.Z/dist/nish-components.css">
108
+ <script type="module" src="https://cdn.jsdelivr.net/npm/nish-ui@X.Y.Z/dist/elements.js"></script>
109
+
110
+ <nish-theme-toggle pill></nish-theme-toggle>
111
+ ```
112
+
113
+ With a bundler: `import 'nish-ui/elements';` and `import { toast } from 'nish-ui/elements';`.
114
+ The button, card, bottom nav, theme toggle, modal, more sheet and toast pages on the docs site have an HTML tab with the markup, running live. More in
115
+ [Static sites](https://design.nish.software/#/static-sites).
116
+
97
117
  ## Theming
98
118
 
99
119
  Seven themes: `dark` (the default), `light`, and the presets `slate`, `terminal`, `mocha`,
@@ -123,7 +143,7 @@ More than 60 components, each with live stories, props and guidelines on the
123
143
  - **Overlays:** Modal, Drawer, ConfirmDialog, Popover, DropdownMenu, Tooltip
124
144
  - **Settings:** SettingsSection, SettingRow, NumberField, ServiceTokensSection (list and revoke
125
145
  service tokens)
126
- - **Layout and navigation:** AppShell, AppHeader, BottomNav, NavRail, MoreSheet, Tabs,
146
+ - **Layout and navigation:** AppShell (bottom bar, rail and a collapsible sidebar), AppHeader, BottomNav, NavRail, MoreSheet, Tabs,
127
147
  PageHeader, Card, Table, FilterBar, SplitStage
128
148
  - **Data and motion:** Stat, Sparkline, MediaRow, ActivityFeed, WorkflowBoard, SystemCanvas,
129
149
  AnimatedList
@@ -0,0 +1,65 @@
1
+ // The published types of nish-ui/elements (copied to dist/elements.d.ts by tsup.config.ts).
2
+ // Hand-written so the package never imports 'lit' (a devDependency) and every element stays an
3
+ // HTMLElement for consumers. Keep it in step with the classes in this folder.
4
+
5
+ /** Base of every nish-ui element (light DOM). */
6
+ export declare class NishElement extends HTMLElement {
7
+ readonly updateComplete: Promise<boolean>;
8
+ requestUpdate(): void;
9
+ }
10
+
11
+ /** Register a custom element unless the tag is already defined. */
12
+ export declare function define(tag: string, ctor: CustomElementConstructor): void;
13
+
14
+ export declare class NishThemeToggle extends NishElement {
15
+ labelled: boolean;
16
+ pill: boolean;
17
+ labelSystem: string | undefined;
18
+ labelLight: string | undefined;
19
+ labelDark: string | undefined;
20
+ }
21
+
22
+ export declare class NishSheet extends NishElement {
23
+ open: boolean;
24
+ label: string | null;
25
+ /** The wrapping <dialog>, once children are moved in. */
26
+ dialog: HTMLDialogElement | null;
27
+ show(): void;
28
+ close(): void;
29
+ }
30
+
31
+ export declare class NishDialog extends NishElement {
32
+ open: boolean;
33
+ label: string | null;
34
+ /** The wrapping <dialog>, once children are moved in. */
35
+ dialog: HTMLDialogElement | null;
36
+ show(): void;
37
+ close(value?: string): void;
38
+ }
39
+
40
+ export declare class NishBottomNav extends NishElement {
41
+ label: string;
42
+ lg: boolean;
43
+ }
44
+
45
+ export type ToastTone = 'neutral' | 'ok' | 'warn' | 'loss' | 'info';
46
+
47
+ export interface ToastOptions {
48
+ tone?: ToastTone;
49
+ /** Milliseconds before it hides itself, or 'sticky'. Default 6000. */
50
+ duration?: number | 'sticky';
51
+ action?: { label: string; href?: string; onClick?: () => void };
52
+ dismissLabel?: string;
53
+ }
54
+
55
+ /** Show a toast. Returns a function that hides it now. Needs nish-components.css. */
56
+ export declare function toast(content: string | Node, opts?: ToastOptions): () => void;
57
+
58
+ declare global {
59
+ interface HTMLElementTagNameMap {
60
+ 'nish-theme-toggle': NishThemeToggle;
61
+ 'nish-sheet': NishSheet;
62
+ 'nish-dialog': NishDialog;
63
+ 'nish-bottom-nav': NishBottomNav;
64
+ }
65
+ }
@@ -0,0 +1,46 @@
1
+ var Ht=["emerald","indigo","amber","lime","rose","sky","violet","teal"],Ei=["accent","ok","loss","warn","info",...Ht],W={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},Ut={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},Dt=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],It=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],O=i=>Object.fromEntries(i.map((e,t)=>[`chart-${t+1}`,e])),w={dark:{label:"Dark",scheme:"dark",colors:{bg:"#0a0b0f",surface:"#111218",elevated:"#191b23",overlay:"#22252f",line:"#262935","line-strong":"#3a3e4d",hi:"#ececf1",hi2:"#a8aab7",hi3:"#8a8d9b",ghost:"#6b6e7c",accent:"#8b93ff",accent2:"#c084fc","on-accent":"#0a0b0f",ok:"#34d399",loss:"#f87171",warn:"#fbbf24",info:"#38bdf8",scrim:"#000000","invert-bg":"#ececf1","invert-text":"#111218",...O(Dt),...W}},light:{label:"Light",scheme:"light",colors:{bg:"#f7f6f3",surface:"#ffffff",elevated:"#f1f0ec",overlay:"#e6e4de",line:"#e2e0da","line-strong":"#c9c6bd",hi:"#17171c",hi2:"#4f515c",hi3:"#666874",ghost:"#8a8c98",accent:"#4338ca",accent2:"#7e22ce","on-accent":"#ffffff","on-accent2":"#ffffff","on-ok":"#0a0a0c","on-loss":"#ffffff","on-warn":"#0a0a0c","on-info":"#0a0a0c",ok:"#065f46","ok-fill":"#059669","loss-fill":"#dc2626","warn-fill":"#c96d06","info-fill":"#0284c7",loss:"#a91b1b",warn:"#92400e",info:"#075985",scrim:"#17171c","invert-bg":"#17171c","invert-text":"#f7f6f3",...O(It),...Ut}},slate:{label:"Slate",scheme:"dark",colors:{bg:"#18181b",surface:"#202024",elevated:"#2c2c32",overlay:"#36363d",line:"#3a3a42","line-strong":"#52525b",hi:"#f4f4f5",hi2:"#a1a1aa",hi3:"#8f8f99",ghost:"#71717a",accent:"#a5b4fc",accent2:"#c084fc","on-accent":"#18181b",ok:"#4ade80",loss:"#fda4af",warn:"#facc15",info:"#38bdf8",scrim:"#000000","invert-bg":"#f4f4f5","invert-text":"#202024",...O(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...W,indigo:"#9aa1ff",rose:"#fc8395",violet:"#c792fc"}},terminal:{label:"Terminal",scheme:"dark",colors:{bg:"#050807",surface:"#0c110e",elevated:"#141c17",overlay:"#1c2820",line:"#233028","line-strong":"#34483b",hi:"#d1fae5",hi2:"#8fc4a8",hi3:"#74a68b",ghost:"#4f7a62",accent:"#34d399",accent2:"#2dd4bf","on-accent":"#050807",ok:"#4ade80",loss:"#f87171",warn:"#fbbf24",info:"#67e8f9",scrim:"#000000","invert-bg":"#d1fae5","invert-text":"#0c110e",...O(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...W}},mocha:{label:"Mocha",scheme:"dark",colors:{bg:"#1c1917",surface:"#292524",elevated:"#393432",overlay:"#44403c",line:"#44403c","line-strong":"#57534e",hi:"#f5f0eb",hi2:"#b3ada8",hi3:"#a39d98",ghost:"#78716c",accent:"#fdba74",accent2:"#f472b6","on-accent":"#1c1917",ok:"#4ade80",loss:"#fca5a5",warn:"#facc15",info:"#7dd3fc",scrim:"#000000","invert-bg":"#f5f0eb","invert-text":"#292524",...O(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...W,indigo:"#a9afff",rose:"#fc99a7",sky:"#3ebff8",violet:"#cfa2fd"}},ocean:{label:"Ocean",scheme:"dark",colors:{bg:"#020c18",surface:"#061528",elevated:"#0a243e",overlay:"#103658",line:"#123050","line-strong":"#1f4a72",hi:"#e0f2fe",hi2:"#9ccde6",hi3:"#6fa9c6",ghost:"#3f7392",accent:"#38bdf8",accent2:"#a78bfa","on-accent":"#020c18",ok:"#34d399",loss:"#fb7185",warn:"#fbbf24",info:"#7dd3fc",scrim:"#000000","invert-bg":"#38bdf8","invert-text":"#020c18",...O(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...W}},contrast:{label:"High contrast",scheme:"dark",colors:{bg:"#000000",surface:"#080808",elevated:"#141414",overlay:"#222222",line:"#4a4a4a","line-strong":"#8a8a8a",hi:"#ffffff",hi2:"#d4d4d4",hi3:"#bdbdbd",ghost:"#8f8f8f",accent:"#ffd60a",accent2:"#7dd3fc","on-accent":"#000000",ok:"#4ade80",loss:"#ff6b6b",warn:"#ffd60a",info:"#7dd3fc",scrim:"#000000","invert-bg":"#ffffff","invert-text":"#000000",...O(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...W}}};for(let i of Object.values(w)){for(let e of["ok","loss","warn","info"])i.colors[`${e}-fill`]??=i.colors[e],i.colors[`on-${e}`]??=i.colors["on-accent"];i.colors["on-accent2"]??=i.colors["on-accent"]}var Fe="dark";var Si=Object.keys(w).map(i=>({id:i,label:w[i].label,scheme:w[i].scheme,colors:w[i].colors})),ae="nish-theme",je="nish.software",Bt=3600*24*365,Ke={};var le=(i,e)=>Object.prototype.hasOwnProperty.call(i,e);function Xe(i){return typeof i=="string"&&(le(w,i)||le(Ke,i))}function Wt(){if(typeof document>"u")return null;let i=document.cookie.match(/(?:^|;\s*)nish-theme=([a-z0-9-]+)/);return i?i[1]:null}var Ge=(i,e)=>e===i||e.endsWith("."+i);function zt(i,e){let t=i.toLowerCase(),n=(e??"").trim().toLowerCase().replace(/^\./,"");return n?Ge(n,t)?n:null:Ge(je,t)?je:null}function Vt(){return typeof location>"u"||typeof document>"u"?null:zt(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function G(){let i=null;try{i=Wt()??localStorage.getItem(ae)}catch{}return i==="system"||Xe(i)?i:"system"}function Ft(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":Fe}function jt(){let i=document.documentElement.getAttribute("data-nish-themes");return i?i.split(/\s+/).filter(Xe):null}function Gt(i=G()){let e=i==="system"?Ft():i,t=typeof document>"u"?null:jt();return t&&!t.includes(e)&&(e=ce(e)),e}function ce(i){return le(w,i)?w[i].scheme:Ke[i]??"dark"}function Je(i=G()){let e=Gt(i),t=document.documentElement;return t.setAttribute("data-theme",e),t.setAttribute("data-scheme",ce(e)),t.setAttribute("data-theme-choice",i),t.style.colorScheme=ce(e),Kt(),Ae.forEach(n=>n(i,e)),e}function qt(i){try{localStorage.setItem(ae,i)}catch{}let e=Vt();if(e){let t=location.protocol==="https:"?"; Secure":"";document.cookie=`${ae}=${i}; Domain=.${e}; Path=/; Max-Age=${Bt}; SameSite=Lax${t}`}return Je(i)}function Yt(i){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${i}`).trim()}function Kt(){let i=Yt("bg");if(!i)return;let e=document.querySelector('meta[name="theme-color"]');e||(e=document.createElement("meta"),e.name="theme-color",document.head.appendChild(e)),e.content=i}var Ae=new Set,qe=!1;function Xt(){if(qe||typeof window>"u")return;qe=!0;let i=()=>{let e=G();(e!==document.documentElement.getAttribute("data-theme-choice")||e==="system")&&Je(e)};matchMedia("(prefers-color-scheme: light)").addEventListener("change",i),window.addEventListener("storage",e=>{e.key===ae&&i()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&i()})}function Jt(i){return Xt(),Ae.add(i),()=>Ae.delete(i)}var oe=["system","light","dark"];function Zt(){let i=Ze(G());return qt(i),i}var Ye={system:'<rect width="20" height="14" x="2" y="3" rx="2"/><path d="M8 21h8M12 17v4"/>',light:'<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2m-7.07-2.93 1.41-1.41M17.66 6.34l1.41-1.41M2 12h2m16 0h2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41"/>',dark:'<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"/>'},Qt={system:"System",light:"Light",dark:"Dark"};function Ze(i){let e=oe.indexOf(i);return oe[(e+1)%oe.length]}function we(i,e){return i==="system"||i==="light"||i==="dark"?e[i]:le(w,i)?w[i].label:i.charAt(0).toUpperCase()+i.slice(1)}function Qe(i,e={}){let t={...Qt,...e.labels};i.tagName==="BUTTON"&&!i.getAttribute("type")&&i.setAttribute("type","button"),i.innerHTML=Object.keys(Ye).map(a=>`<svg data-icon="${a}" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${Ye[a]}</svg>`).join("")+(e.showLabel?'<span data-theme-word aria-hidden="true"></span>':"");let n=i.querySelector("[data-theme-word]"),s=a=>{let l=a==="system"||a==="light"||a==="dark"?a:ce(a);i.setAttribute("data-choice",a),i.querySelectorAll("svg[data-icon]").forEach(h=>{h.getAttribute("data-icon")===l?h.removeAttribute("display"):h.setAttribute("display","none")});let d=oe.includes(a)?"":" (set on another site)",p=`Theme: ${we(a,t)}${d}. Switch to ${we(Ze(a),t)}`;i.setAttribute("aria-label",p),i.setAttribute("title",p),n&&(n.textContent=we(a,t))},r=()=>{Zt()};i.addEventListener("click",r);let o=Jt(a=>s(a));return s(G()),()=>{i.removeEventListener("click",r),o()}}var ei=6e3,M=null,j=null;function et(i,e={}){j?.(),(!M||!M.isConnected)&&(M=document.createElement("div"),M.setAttribute("role","status"),M.setAttribute("aria-live","polite"),M.className="nish-toast-region",document.body.appendChild(M));let t=M,n=document.createElement("div");n.className="nish-toast"+(e.tone&&e.tone!=="neutral"?` nish-toast--${e.tone}`:"");let s=document.createElement("p");s.className="nish-toast-body",s.append(typeof i=="string"?document.createTextNode(i):i),n.append(s);let r=null,o=e.duration==="sticky"?1/0:e.duration??ei,a=0,l=0,d=()=>{r!=null&&clearTimeout(r),r=null,n.remove(),j===d&&(j=null)},p=u=>{Number.isFinite(u)&&(a=Date.now(),r=setTimeout(d,u))},h=()=>{l+=1,!(l>1||r==null)&&(clearTimeout(r),r=null,o=Math.max(0,o-(Date.now()-a)))},g=()=>{l!==0&&(l-=1,l===0&&p(Math.max(o,1e3)))};if(e.action){let u=e.action,_=document.createElement(u.href?"a":"button");_.className="nish-toast-action",_.textContent=u.label,u.href?_.href=u.href:_.type="button",_.addEventListener("click",()=>{u.onClick?.(),d()}),n.append(_)}let f=document.createElement("button");return f.type="button",f.className="nish-toast-close",f.setAttribute("aria-label",e.dismissLabel??"Dismiss"),f.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M18 6 6 18M6 6l12 12"/></svg>',f.addEventListener("click",d),n.append(f),n.addEventListener("pointerenter",u=>u.pointerType==="mouse"&&h()),n.addEventListener("pointerleave",u=>u.pointerType==="mouse"&&g()),n.addEventListener("focusin",u=>!n.contains(u.relatedTarget)&&h()),n.addEventListener("focusout",u=>!n.contains(u.relatedTarget)&&g()),n.addEventListener("keydown",u=>{u.key==="Escape"&&d()}),setTimeout(()=>{j===d&&(t.append(n),p(o))},50),j=d,d}var ti=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function tt(i){if(typeof document>"u")return()=>{};if(i.open)return()=>s();let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=!1,n=!1;function s(){if(t||!i.open)return;t=!0;let c,m=()=>{i.removeEventListener("animationend",T),c!==void 0&&clearTimeout(c),i.removeAttribute("data-closing"),i.style.transform="",i.style.transition="",t=!1,i.open&&i.close()},T=Ot=>{Ot.target===i&&m()};if(ti()){m();return}i.style.transform="",i.setAttribute("data-closing",""),i.addEventListener("animationend",T),c=setTimeout(m,260)}let r=c=>{c.preventDefault(),s()},o=c=>{c.key==="Escape"&&c.stopPropagation()},a=c=>{if(c.target===i){let m=i.getBoundingClientRect();c.clientX>=m.left&&c.clientX<=m.right&&c.clientY>=m.top&&c.clientY<=m.bottom||s();return}c.target instanceof Element&&c.target.closest("[data-sheet-close]")&&s()},l=0,d=0,p=0,h=0,g=1,f=c=>{if(c.pointerType==="mouse"||t||!c.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let m=i.getBoundingClientRect();!(c.target instanceof Element&&c.target.closest(".nish-sheet-header")!=null)&&c.clientY-m.top>28||(n=!0,l=d=c.clientY,p=c.timeStamp,h=0,g=m.height||1,i.style.transition="none",i.setPointerCapture?.(c.pointerId))},u=c=>{if(!n)return;let m=c.clientY-l,T=c.timeStamp-p;T>0&&(h=(c.clientY-d)/T),d=c.clientY,p=c.timeStamp,i.style.transform=`translateY(${m>=0?m:m*.3}px)`},_=c=>{if(!n)return;n=!1,i.releasePointerCapture?.(c.pointerId);let m=c.clientY-l;if(c.type!=="pointercancel"&&(m>g*.3||h>.5)){s();return}i.style.transition="transform 180ms var(--nish-ease-out, ease-out)",i.style.transform="",setTimeout(()=>{t||(i.style.transition="")},200)},b=()=>{i.removeEventListener("cancel",r),i.removeEventListener("keydown",o),i.removeEventListener("click",a),i.removeEventListener("pointerdown",f),i.removeEventListener("pointermove",u),i.removeEventListener("pointerup",_),i.removeEventListener("pointercancel",_),i.removeEventListener("close",b),e?.isConnected&&e.focus()};return i.addEventListener("cancel",r),i.addEventListener("keydown",o),i.addEventListener("click",a),i.addEventListener("pointerdown",f),i.addEventListener("pointermove",u),i.addEventListener("pointerup",_),i.addEventListener("pointercancel",_),i.addEventListener("close",b),i.showModal(),s}function it(i,e){if(typeof document>"u")return()=>{};let t=document.documentElement,n=()=>{let r=i.offsetHeight;r>0?t.style.setProperty(e,`${r}px`):t.style.removeProperty(e)};n();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(n),s.observe(i)):window.addEventListener("resize",n),()=>{s?.disconnect(),window.removeEventListener("resize",n),t.style.removeProperty(e)}}var nt=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var x=function(i,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t},y=function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},z,he,de,q,xe,Y,ue,H,K,k,pe,st;var v={__proto__:null};v.enumerable=!0;Object.freeze(v);var Le=(k=class{constructor(e,t={}){if(z.set(this,!1),he.set(this,!1),de.set(this,!1),q.set(this,!1),xe.set(this,Date.now()),Y.set(this,!1),ue.set(this,void 0),H.set(this,void 0),K.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:n,cancelable:s,composed:r}=t;x(this,z,!!s,"f"),x(this,he,!!n,"f"),x(this,de,!!r,"f"),x(this,ue,`${e}`,"f"),x(this,H,null,"f"),x(this,K,!1,"f")}initEvent(e,t,n){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){x(this,q,!0,"f")}get target(){return y(this,H,"f")}get currentTarget(){return y(this,H,"f")}get srcElement(){return y(this,H,"f")}get type(){return y(this,ue,"f")}get cancelable(){return y(this,z,"f")}get defaultPrevented(){return y(this,z,"f")&&y(this,q,"f")}get timeStamp(){return y(this,xe,"f")}composedPath(){return y(this,K,"f")?[y(this,H,"f")]:[]}get returnValue(){return!y(this,z,"f")||!y(this,q,"f")}get bubbles(){return y(this,he,"f")}get composed(){return y(this,de,"f")}get eventPhase(){return y(this,K,"f")?k.AT_TARGET:k.NONE}get cancelBubble(){return y(this,Y,"f")}set cancelBubble(e){e&&x(this,Y,!0,"f")}stopPropagation(){x(this,Y,!0,"f")}get isTrusted(){return!1}},z=new WeakMap,he=new WeakMap,de=new WeakMap,q=new WeakMap,xe=new WeakMap,Y=new WeakMap,ue=new WeakMap,H=new WeakMap,K=new WeakMap,k.NONE=0,k.CAPTURING_PHASE=1,k.AT_TARGET=2,k.BUBBLING_PHASE=3,k);Object.defineProperties(Le.prototype,{initEvent:v,stopImmediatePropagation:v,preventDefault:v,target:v,currentTarget:v,srcElement:v,type:v,cancelable:v,defaultPrevented:v,timeStamp:v,composedPath:v,returnValue:v,bubbles:v,composed:v,eventPhase:v,cancelBubble:v,stopPropagation:v,isTrusted:v});var rt=(st=class extends Le{constructor(e,t={}){super(e,t),pe.set(this,void 0),x(this,pe,t?.detail??null,"f")}initCustomEvent(e,t,n,s){throw new Error("Method not implemented.")}get detail(){return y(this,pe,"f")}},pe=new WeakMap,st);Object.defineProperties(rt.prototype,{detail:v});var L=Le,Ce=rt;var S;var $i=(S=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},S.STYLE_RULE=1,S.CHARSET_RULE=2,S.IMPORT_RULE=3,S.MEDIA_RULE=4,S.FONT_FACE_RULE=5,S.PAGE_RULE=6,S.NAMESPACE_RULE=10,S.KEYFRAMES_RULE=7,S.KEYFRAME_RULE=8,S.SUPPORTS_RULE=12,S.COUNTER_STYLE_RULE=11,S.FONT_FEATURE_VALUES_RULE=14,S.MARGIN_RULE=9,S);globalThis.Event??=L;globalThis.CustomEvent??=Ce;var Re=Symbol(),ot=i=>typeof i=="boolean"?i:i?.capture??!1,C={__proto__:null};C.enumerable=!0;Object.freeze(C);var me=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,n){if(t==null)return;let s=ot(n)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(t))return;let o=typeof n=="object"&&n?n:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,n)),r.set(t,o??{})}removeEventListener(e,t,n){if(t==null)return;let s=ot(n)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(t),r.size||s.delete(e))}dispatchEvent(e){let t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));let n=!1,s=!1,r=L.NONE,o=null,a=null,l=null,d=e.stopPropagation,p=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??a},...C},srcElement:{get(){return e.target},...C},currentTarget:{get(){return l},...C},eventPhase:{get(){return r},...C},composedPath:{value:()=>t,...C},stopPropagation:{value:()=>{n=!0,d.call(e)},...C},stopImmediatePropagation:{value:()=>{s=!0,p.call(e)},...C}});let h=(b,c,m)=>{typeof b=="function"?b(e):typeof b?.handleEvent=="function"&&b.handleEvent(e),c.once&&m.delete(b)},g=()=>(l=null,r=L.NONE,!e.defaultPrevented),f=t.slice().reverse();o=!this.__host||!e.composed?this:null;let u=b=>{for(a=this;a.__host&&b.includes(a.__host);)a=a.__host};for(let b of f){!o&&(!a||a===b.__host)&&u(f.slice(f.indexOf(b))),l=b,r=b===e.target?L.AT_TARGET:L.CAPTURING_PHASE;let c=b.__captureEventListeners.get(e.type);if(c){for(let[m,T]of c)if(h(m,T,c),s)return g()}if(n)return g()}let _=e.bubbles?t:[this];a=null;for(let b of _){!o&&(!a||b===a.__host)&&u(_.slice(0,_.indexOf(b)+1)),l=b,r=b===e.target?L.AT_TARGET:L.BUBBLING_PHASE;let c=b.__eventListeners.get(e.type);if(c){for(let[m,T]of c)if(h(m,T,c),s)return g()}if(n)return g()}return g()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,ct,si]}};var at=new WeakMap,X=i=>{let e=at.get(i);return e===void 0&&at.set(i,e=new Map),e},J=class extends me{getRootNode(e){return e?.composed?$e:this.__host?.__shadowRoot??$e}};var lt=class extends J{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var ct=new lt,$e=ct;var ht=class extends J{constructor(e){if(super(),e!==Re)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:fe,customElements:ke,document:$e,Document:lt,Element:dt,EventTarget:me,HTMLElement:ut,Node:J,ShadowRoot:pt,window:this,Window:ht})}};var dt=class extends J{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(X(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){X(this).set(e,String(t))}removeAttribute(e){X(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return X(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new pt(Re,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new nt(this);return this.__internals=e,e}getAttribute(e){return X(this).get(e)??null}};var ut=class extends dt{},Me=ut;var pt=class extends J{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new Me,"localName",{get(){return"lit-server-root"}});function ii(){let i,e;return{promise:new Promise((n,s)=>{i=n,e=s}),resolve:i,reject:e}}var fe=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
+ Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]}),this.__reverseDefinitions.set(t,e),this.__pendingWhenDefineds.get(e)?.resolve(t),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let t=this.__definitions.get(e);if(t)return t.ctor;let n=this.__pendingWhenDefineds.get(e);return n||(n=ii(),this.__pendingWhenDefineds.set(e,n)),n.promise}},ni=fe;var ke=new ni,si=new ht(Re);var Z=globalThis,ge=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ft=Symbol(),mt=new WeakMap,be=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ft)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(ge&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=mt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&mt.set(t,e))}return e}toString(){return this.cssText}},bt=i=>new be(typeof i=="string"?i:i+"",void 0,ft);var gt=(i,e)=>{if(ge)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),s=Z.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},Pe=ge||Z.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return bt(t)})(i):i;var{is:ri,defineProperty:oi,getOwnPropertyDescriptor:ai,getOwnPropertyNames:li,getOwnPropertySymbols:ci,getPrototypeOf:hi}=Object,ee=globalThis;ee.customElements??=ke;var vt=ee.trustedTypes,di=vt?vt.emptyScript:"",ui=ee.reactiveElementPolyfillSupport,Q=(i,e)=>i,Ne={toAttribute(i,e){switch(e){case Boolean:i=i?di:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},yt=(i,e)=>!ri(i,e),Et={attribute:!0,type:String,converter:Ne,reflect:!1,useDefault:!1,hasChanged:yt};Symbol.metadata??=Symbol("metadata"),ee.litPropertyMetadata??=new WeakMap;var $=class extends(globalThis.HTMLElement??Me){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Et){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&oi(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){let{get:s,set:r}=ai(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let a=s?.call(this);r?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Et}static _$Ei(){if(this.hasOwnProperty(Q("elementProperties")))return;let e=hi(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Q("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Q("properties"))){let t=this.properties,n=[...li(t),...ci(t)];for(let s of n)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let s of n)t.unshift(Pe(s))}else e!==void 0&&t.push(Pe(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){let r=(n.converter?.toAttribute!==void 0?n.converter:Ne).toAttribute(t,n.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){let n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let r=n.getPropertyOptions(s),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Ne;this._$Em=s;let a=o.fromAttribute(t,r.type);this[s]=a??this._$Ej?.get(s)??a,this._$Em=null}}requestUpdate(e,t,n,s=!1,r){if(e!==void 0){let o=this.constructor;if(s===!1&&(r=this[e]),n??=o.getPropertyOptions(e),!((n.hasChanged??yt)(r,t)||n.useDefault&&n.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:s,wrapped:r},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[s,r]of n){let{wrapped:o}=r,a=this[s];o!==!0||this._$AL.has(s)||a===void 0||this.C(s,void 0,r,a)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[Q("elementProperties")]=new Map,$[Q("finalized")]=new Map,ui?.({ReactiveElement:$}),(ee.reactiveElementVersions??=[]).push("2.1.2");var Ee=globalThis,_t=i=>i,ve=Ee.trustedTypes,St=ve?ve.createPolicy("lit-html",{createHTML:i=>i}):void 0,Ct="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,$t="?"+P,pi=`<${$t}>`,I=Ee.document===void 0?{createTreeWalker:()=>({})}:document,ie=()=>I.createComment(""),ne=i=>i===null||typeof i!="object"&&typeof i!="function",We=Array.isArray,mi=i=>We(i)||typeof i?.[Symbol.iterator]=="function",Oe=`[
3
+ \f\r]`,te=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Tt=/-->/g,wt=/>/g,U=RegExp(`>|${Oe}(?:([^\\s"'>=/]+)(${Oe}*=${Oe}*(?:[^
4
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),At=/'/g,xt=/"/g,Rt=/^(?:script|style|textarea|title)$/i,ze=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),hn=ze(1),dn=ze(2),un=ze(3),B=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),Lt=new WeakMap,D=I.createTreeWalker(I,129);function Mt(i,e){if(!We(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return St!==void 0?St.createHTML(e):e}var fi=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=te;for(let a=0;a<t;a++){let l=i[a],d,p,h=-1,g=0;for(;g<l.length&&(o.lastIndex=g,p=o.exec(l),p!==null);)g=o.lastIndex,o===te?p[1]==="!--"?o=Tt:p[1]!==void 0?o=wt:p[2]!==void 0?(Rt.test(p[2])&&(s=RegExp("</"+p[2],"g")),o=U):p[3]!==void 0&&(o=U):o===U?p[0]===">"?(o=s??te,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,d=p[1],o=p[3]===void 0?U:p[3]==='"'?xt:At):o===xt||o===At?o=U:o===Tt||o===wt?o=te:(o=U,s=void 0);let f=o===U&&i[a+1].startsWith("/>")?" ":"";r+=o===te?l+pi:h>=0?(n.push(d),l.slice(0,h)+Ct+l.slice(h)+P+f):l+P+(h===-2?a:f)}return[Mt(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},se=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,a=e.length-1,l=this.parts,[d,p]=fi(e,t);if(this.el=i.createElement(d,n),D.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=D.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(Ct)){let g=p[o++],f=s.getAttribute(h).split(P),u=/([.?@])?(.*)/.exec(g);l.push({type:1,index:r,name:u[2],strings:f,ctor:u[1]==="."?Ue:u[1]==="?"?De:u[1]==="@"?Ie:F}),s.removeAttribute(h)}else h.startsWith(P)&&(l.push({type:6,index:r}),s.removeAttribute(h));if(Rt.test(s.tagName)){let h=s.textContent.split(P),g=h.length-1;if(g>0){s.textContent=ve?ve.emptyScript:"";for(let f=0;f<g;f++)s.append(h[f],ie()),D.nextNode(),l.push({type:2,index:++r});s.append(h[g],ie())}}}else if(s.nodeType===8)if(s.data===$t)l.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf(P,h+1))!==-1;)l.push({type:7,index:r}),h+=P.length-1}r++}}static createElement(e,t){let n=I.createElement("template");return n.innerHTML=e,n}};function V(i,e,t=i,n){if(e===B)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=ne(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=s:t._$Cl=s),s!==void 0&&(e=V(i,s._$AS(i,e.values),s,n)),e}var He=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??I).importNode(t,!0);D.currentNode=s;let r=D.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new re(r,r.nextSibling,this,e):l.type===1?d=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(d=new Be(r,this,e)),this._$AV.push(d),l=n[++a]}o!==l?.index&&(r=D.nextNode(),o++)}return D.currentNode=I,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},re=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=V(this,e,t),ne(e)?e===E||e==null||e===""?(this._$AH!==E&&this._$AR(),this._$AH=E):e!==this._$AH&&e!==B&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):mi(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==E&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(I.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=se.createElement(Mt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new He(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=Lt.get(e.strings);return t===void 0&&Lt.set(e.strings,t=new se(e)),t}k(e){We(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let r of e)s===t.length?t.push(n=new i(this.O(ie()),this.O(ie()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=_t(e).nextSibling;_t(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},F=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=E,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=E}_$AI(e,t=this,n,s){let r=this.strings,o=!1;if(r===void 0)e=V(this,e,t,0),o=!ne(e)||e!==this._$AH&&e!==B,o&&(this._$AH=e);else{let a=e,l,d;for(e=r[0],l=0;l<r.length-1;l++)d=V(this,a[n+l],t,l),d===B&&(d=this._$AH[l]),o||=!ne(d)||d!==this._$AH[l],d===E?e=E:e!==E&&(e+=(d??"")+r[l+1]),this._$AH[l]=d}o&&!s&&this.j(e)}j(e){e===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ue=class extends F{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===E?void 0:e}},De=class extends F{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==E)}},Ie=class extends F{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=V(this,e,t,0)??E)===B)return;let n=this._$AH,s=e===E&&n!==E||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==E&&(n===E||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Be=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){V(this,e)}};var bi=Ee.litHtmlPolyfillSupport;bi?.(se,re),(Ee.litHtmlVersions??=[]).push("3.3.3");var kt=(i,e,t)=>{let n=t?.renderBefore??e,s=n._$litPart$;if(s===void 0){let r=t?.renderBefore??null;n._$litPart$=s=new re(e.insertBefore(ie(),r),r,void 0,t??{})}return s._$AI(i),s};var Ve=globalThis,N=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=kt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return B}};N._$litElement$=!0,N.finalized=!0,Ve.litElementHydrateSupport?.({LitElement:N});var gi=Ve.litElementPolyfillSupport;gi?.({LitElement:N});(Ve.litElementVersions??=[]).push("4.2.2");var A=class extends N{createRenderRoot(){return this}};function Pt(i){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i()}function R(i,e){customElements.get(i)||customElements.define(i,e)}var ye=class extends A{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#i=null;#n=null;#t=null;#s=()=>this.#o();constructor(){super(),this.label="Sections",this.lg=!1}connectedCallback(){super.connectedCallback(),Pt(()=>this.#r())}#r(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-bottom-nav");if(!e){for(e=document.createElement("nav"),e.className="nish-bottom-nav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#l(),this.#o(),window.addEventListener("popstate",this.#s),this.#t=new MutationObserver(()=>{this.#t?.disconnect(),this.#o(),this.#a()}),this.#a(),this.#n=it(e,"--nish-bottom-nav-h")}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,window.removeEventListener("popstate",this.#s),this.#t?.disconnect(),this.#t=null,this.#n?.(),this.#n=null}updated(e){this.#l()}#a(){this.#e&&this.#t?.observe(this.#e,{childList:!0})}#l(){this.#e&&(this.#e.setAttribute("aria-label",this.label||"Sections"),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}#o(){if(!this.#e)return;let e=location.pathname,t=null,n=-1;for(let s of Array.from(this.#e.querySelectorAll(":scope > a"))){if(s.classList.add("nish-bottom-nav-item"),!s.getAttribute("href"))continue;let r;try{r=new URL(s.getAttribute("href"),location.href)}catch{continue}if(r.origin!==location.origin)continue;let o=r.pathname;(o==="/"?e==="/":e===o||e.startsWith(o.endsWith("/")?o:`${o}/`))&&o.length>n&&(t=s,n=o.length)}if(!t){this.#i?.removeAttribute("aria-current"),this.#i=null;return}for(let s of Array.from(this.#e.querySelectorAll(":scope > a")))s.removeAttribute("aria-current");t.setAttribute("aria-current","page"),this.#i=t}};R("nish-bottom-nav",ye);var Nt=0,_e=class extends A{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;opener=null;value="";waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.value="",this.open=!1,this.dialog.close())}show(){this.open=!0}close(e=""){this.dialog?.open&&(this.value=e),this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-dialog-open]");t&&t.getAttribute("data-dialog-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-dialog",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("click",this.onDialogClick),e.addEventListener("keydown",this.onKey),e.addEventListener("cancel",this.onCancel),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-dialog-title"),n=e.querySelector(".nish-dialog-body");t?(t.id||(t.id=`nish-dialog-title-${++Nt}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),n?(n.id||(n.id=`nish-dialog-body-${++Nt}`),e.setAttribute("aria-describedby",n.id)):e.removeAttribute("aria-describedby")}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?(this.opener=document.activeElement instanceof HTMLElement?document.activeElement:null,e.returnValue="",e.showModal()):!this.open&&e.open&&e.close())}onDialogClick=e=>{let t=this.dialog;if(t){if(e.target===t){let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||this.close();return}if(e.target instanceof Element){let n=e.target.closest("[data-dialog-close]");n&&n.closest("dialog")===t&&this.close(n.getAttribute("value")??"")}}};onKey=e=>{e.key==="Escape"&&e.stopPropagation()};onCancel=e=>{e.preventDefault(),this.close()};onDialogClose=()=>{let e=this.value||this.dialog?.returnValue||"";this.value="",this.open&&(this.open=!1);let t=this.opener;this.opener=null,t?.isConnected&&t.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};R("nish-dialog",_e);var vi=0,Se=class extends A{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;closeSheet=null;waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.open=!1,this.dialog.close())}show(){this.open=!0}close(){this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-sheet-open]");t&&t.getAttribute("data-sheet-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-sheet",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-sheet-title");t?(t.id||(t.id=`nish-sheet-title-${++vi}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"))}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?this.closeSheet=tt(e):!this.open&&e.open&&this.closeSheet?.())}onDialogClose=()=>{this.closeSheet=null,this.open&&(this.open=!1),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};R("nish-sheet",Se);var Te=class extends A{static properties={labelled:{type:Boolean,reflect:!0},pill:{type:Boolean,reflect:!0},labelSystem:{attribute:"label-system"},labelLight:{attribute:"label-light"},labelDark:{attribute:"label-dark"}};#e=null;#i=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#r()}disconnectedCallback(){super.disconnectedCallback(),this.#s()}updated(e){this.#e&&this.#n!==this.#t()&&this.#r()}#n="";#t(){return JSON.stringify([this.labelled,this.pill,this.labelSystem,this.labelLight,this.labelDark])}#s(){this.#i?.(),this.#i=null,this.#e?.remove(),this.#e=null}#r(){this.#s(),this.#n=this.#t();let e=document.createElement("button");e.className="nish-theme-btn",e.classList.toggle("nish-theme-btn--labelled",this.labelled),e.classList.toggle("nish-theme-btn--pill",this.pill),this.prepend(e),this.#e=e;let t={};this.labelSystem&&(t.system=this.labelSystem),this.labelLight&&(t.light=this.labelLight),this.labelDark&&(t.dark=this.labelDark),this.#i=Qe(e,{showLabel:this.labelled,labels:t})}};R("nish-theme-toggle",Te);export{ye as NishBottomNav,_e as NishDialog,A as NishElement,Se as NishSheet,Te as NishThemeToggle,R as define,et as toast};
5
+ /*! Bundled license information:
6
+
7
+ @lit-labs/ssr-dom-shim/lib/element-internals.js:
8
+ @lit-labs/ssr-dom-shim/lib/events.js:
9
+ (**
10
+ * @license
11
+ * Copyright 2023 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ *)
14
+
15
+ @lit-labs/ssr-dom-shim/lib/css.js:
16
+ @lit-labs/ssr-dom-shim/lib/observers.js:
17
+ (**
18
+ * @license
19
+ * Copyright 2024 Google LLC
20
+ * SPDX-License-Identifier: BSD-3-Clause
21
+ *)
22
+
23
+ @lit-labs/ssr-dom-shim/index.js:
24
+ @lit/reactive-element/node/css-tag.js:
25
+ (**
26
+ * @license
27
+ * Copyright 2019 Google LLC
28
+ * SPDX-License-Identifier: BSD-3-Clause
29
+ *)
30
+
31
+ lit-html/node/lit-html.js:
32
+ lit-element/lit-element.js:
33
+ (**
34
+ * @license
35
+ * Copyright 2017 Google LLC
36
+ * SPDX-License-Identifier: BSD-3-Clause
37
+ *)
38
+
39
+ lit-html/node/is-server.js:
40
+ (**
41
+ * @license
42
+ * Copyright 2022 Google LLC
43
+ * SPDX-License-Identifier: BSD-3-Clause
44
+ *)
45
+ */
46
+ //# sourceMappingURL=elements.js.map