nish-ui 3.0.0 → 3.1.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 +5 -5
- package/dist/chart.d.ts +8 -3
- package/dist/chart.js +2 -417
- package/dist/elements-all.js +71 -70
- package/dist/elements-charts.d.ts +7 -1
- package/dist/elements-charts.js +16 -16
- package/dist/elements-data.d.ts +7 -1
- package/dist/elements-data.js +5 -5
- package/dist/elements-forms.d.ts +7 -1
- package/dist/elements-forms.js +18 -17
- package/dist/elements.d.ts +7 -1
- package/dist/elements.js +4 -4
- package/dist/esm/components/avatar.js +2 -2
- package/dist/esm/components/canvas/legend.js +4 -4
- package/dist/esm/components/canvas/system-canvas.js +24 -1
- package/dist/esm/components/carousel.js +21 -3
- package/dist/esm/components/charts.js +21 -13
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/data-classes.js +5 -4
- package/dist/esm/components/data.js +1 -5
- package/dist/esm/components/date-picker.js +1 -0
- package/dist/esm/components/date-range-picker.js +1 -0
- package/dist/esm/components/display.js +3 -3
- package/dist/esm/components/file-dropzone.js +21 -1
- package/dist/esm/components/filters.js +3 -1
- package/dist/esm/components/flow.js +12 -11
- package/dist/esm/components/forms.js +24 -2
- package/dist/esm/components/hooks.js +20 -17
- package/dist/esm/components/inbox.js +9 -7
- package/dist/esm/components/layout-vars.js +10 -7
- package/dist/esm/components/menu.js +7 -4
- package/dist/esm/components/multi-select.js +7 -4
- package/dist/esm/components/overlay-core.js +31 -10
- package/dist/esm/components/overlay-dialog.js +17 -2
- package/dist/esm/components/pagination.js +4 -1
- package/dist/esm/components/popover.js +15 -9
- package/dist/esm/components/primitives.js +1 -1
- package/dist/esm/components/progress.js +2 -0
- package/dist/esm/components/resource-classes.js +34 -16
- package/dist/esm/components/resource.js +5 -4
- package/dist/esm/components/settings.js +4 -2
- package/dist/esm/components/slider.js +1 -0
- package/dist/esm/components/strings.js +9 -1
- package/dist/esm/components/tag-input.js +15 -7
- package/dist/esm/components/time-field-classes.js +5 -2
- package/dist/esm/components/time-field.js +15 -7
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/url-state.js +1 -0
- package/dist/esm/components/virtual-table.js +8 -2
- package/dist/esm/components/virtual.js +16 -2
- package/dist/esm/format.js +17 -14
- package/dist/esm/runtime.js +1 -1
- package/dist/esm/server/inbox/client.js +1 -1
- package/dist/esm/theme.js +66 -6
- package/dist/format.js +18 -15
- package/dist/inbox-client.js +1 -1
- package/dist/index.d.ts +32 -7
- package/dist/nish-components.css +41 -1
- package/dist/nish-components.min.css +1 -1
- package/dist/node/th-check.js +12 -3
- package/dist/server/hono.d.ts +1 -1
- package/dist/server/hono.js +20 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +19 -5
- package/dist/{spa-BLlMc0eI.d.ts → spa-7myD4xvA.d.ts} +3 -2
- package/dist/system-canvas.d.ts +0 -4
- package/dist/theme.d.ts +20 -2
- package/dist/theme.global.js +67 -7
- package/dist/theme.js +67 -7
- package/package.json +1 -1
package/dist/elements.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var Xt=["emerald","indigo","amber","lime","rose","sky","violet","teal"],Wn=["accent","ok","loss","warn","info",...Xt],G={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},Zt={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},Jt=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],Qt=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],P=t=>Object.fromEntries(t.map((e,n)=>[`chart-${n+1}`,e])),en={dark:{label:"Dark",scheme:"dark",colors:{bg:"#0a0b0f",surface:"#111218",elevated:"#191b23",overlay:"#22252f",line:"#262935","line-strong":"#3a3e4d","line-control":"#666975",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",...P(Jt),...G}},light:{label:"Light",scheme:"light",colors:{bg:"#f7f6f3",surface:"#ffffff",elevated:"#f1f0ec",overlay:"#e6e4de",line:"#e2e0da","line-strong":"#c9c6bd","line-control":"#8a8881",hi:"#17171c",hi2:"#4f515c",hi3:"#626470",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",...P(Qt),...Zt}},slate:{label:"Slate",scheme:"dark",colors:{bg:"#18181b",surface:"#202024",elevated:"#2c2c32",overlay:"#36363d",line:"#3a3a42","line-strong":"#52525b","line-control":"#77777e",hi:"#f4f4f5",hi2:"#b8b8c0",hi3:"#a0a0a8",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",...P(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...G,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","line-control":"#5c6c61",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",...P(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...G}},mocha:{label:"Mocha",scheme:"dark",colors:{bg:"#1c1917",surface:"#292524",elevated:"#393432",overlay:"#44403c",line:"#44403c","line-strong":"#57534e","line-control":"#83807c",hi:"#f5f0eb",hi2:"#c6c0bb",hi3:"#b2ada8",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",...P(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...G,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","line-control":"#507291",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",...P(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...G}},contrast:{label:"High contrast",scheme:"dark",colors:{bg:"#000000",surface:"#080808",elevated:"#141414",overlay:"#222222",line:"#4a4a4a","line-strong":"#8a8a8a","line-control":"#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",...P(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...G}}},tn=t=>{let e=t.colors,n=Object.fromEntries(["ok","loss","warn","info"].flatMap(i=>[[`${i}-fill`,e[`${i}-fill`]??e[i]],[`on-${i}`,e[`on-${i}`]??e["on-accent"]]]));return{...t,colors:{...e,...n,"on-accent2":e["on-accent2"]??e["on-accent"]}}},B=Object.fromEntries(Object.entries(en).map(([t,e])=>[t,tn(e)])),Xe="dark";var nn="3.0.0";var sn=Symbol.for("nish-ui.runtime.v1");function rn(){let t=globalThis;return t[sn]??={versions:new Set,slots:{}}}function on(t){t.versions.add(nn),t.versions.size>1&&!t.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(t.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...t.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var Ze=!1;function ce(t,e){let n=rn();return Ze||(Ze=!0,on(n)),t in n.slots||(n.slots[t]=e()),n.slots[t]}function Je(t){if(t==null)return null;let e=String(t),n=0,i=e.length;for(;n<i&&e.charCodeAt(n)<=32;)n++;for(;i>n&&e.charCodeAt(i-1)<=32;)i--;let s=e.slice(n,i).replace(/[\t\n\r]/g,"");if(s===""||s!==s.trim()||/[\u0000-\u001f\u007f]/.test(s))return null;let r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(s);if(!r)return s;let o=r[1].toLowerCase();return o==="http"||o==="https"||o==="mailto"||o==="tel"?s:null}var Y={theme:"Theme",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(t,e)=>`Theme: ${t}. Switch to ${e}`,themePreset:"Theme preset",themePresetPlaceholder:"Preset\u2026"};var Qe={dismiss:"Dismiss",moreCount:t=>`${t} more`,copy:"Copy",copied:"Copied",legend:"Legend",noData:"No data",noDataNamed:t=>`${t}: no data`};var et="nish-theme",tt="nish.software",an=3600*24*365,F=()=>ce("theme",()=>({extra:{},listeners:new Set,watching:!1,switchId:0})),ln=t=>{globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: ${t}`)};function ue(){if(typeof document>"u")return et;let t=document.documentElement.getAttribute("data-nish-storage-key");return t&&/^[A-Za-z0-9_-]+$/.test(t)?t:et}var K=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function Ce(t){return typeof t=="string"&&(K(B,t)||K(F().extra,t))}function cn(){if(typeof document>"u")return null;try{let t=document.cookie.match(new RegExp(`(?:^|;\\s*)${ue()}=([a-z0-9-]+)`));return t?t[1]:null}catch{return null}}var nt=(t,e)=>e===t||e.endsWith("."+t);function dn(t,e){let n=t.toLowerCase(),i=(e??"").trim().toLowerCase().replace(/^\./,"");return i?nt(i,n)?i:null:nt(tt,n)?tt:null}function hn(){return typeof location>"u"||typeof document>"u"?null:dn(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function z(){let t=null;try{t=cn()??localStorage.getItem(ue())}catch{}return t==="system"||Ce(t)?t:"system"}function un(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":Xe}function pn(){let t=document.documentElement.getAttribute("data-nish-themes");return t?t.split(/\s+/).filter(Ce):null}function at(t=z()){let e=t==="system"?un():t,n=typeof document>"u"?null:pn();return n&&!n.includes(e)&&(e=he(e)),e}function he(t){let{extra:e}=F();return K(B,t)?B[t].scheme:K(e,t)?e[t]:"dark"}function lt(t=z()){let e=at(t),n=document.documentElement,i=n.getAttribute("data-theme");return i&&i!==e&&mn(n),n.setAttribute("data-theme",e),n.setAttribute("data-scheme",he(e)),n.setAttribute("data-theme-choice",t),n.style.colorScheme=he(e),vn(),F().listeners.forEach(s=>s(t,e)),e}function mn(t){let e=F(),n=++e.switchId;t.setAttribute("data-nish-theme-switching","");let i=()=>{e.switchId===n&&t.removeAttribute("data-nish-theme-switching")};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>requestAnimationFrame(i)):setTimeout(i,32)}function fn(t){if(t!=="system"&&!Ce(t))return ln(`unknown theme "${String(t)}" ignored. Register it with registerThemes() first.`),at(z());let e=ue();try{localStorage.setItem(e,t)}catch{}try{let n=hn();if(n){let i=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${t}; Domain=.${n}; Path=/; Max-Age=${an}; SameSite=Lax${i}`}}catch{}return lt(t)}function gn(t){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${t}`).trim()}function vn(){let t=gn("bg");if(!t)return;let e=document.querySelector('meta[name="theme-color"][data-nish]')??document.querySelector('meta[name="theme-color"]:not([media]):not([data-nish-keep])');e||(e=document.createElement("meta"),e.name="theme-color",(document.head||document.documentElement).appendChild(e)),e.setAttribute("data-nish",""),e.content=t}function bn(){let t=F();if(t.watching||typeof window>"u")return;t.watching=!0;let e=()=>{let n=z();(n!==document.documentElement.getAttribute("data-theme-choice")||n==="system")&<(n)};typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").addEventListener("change",e),window.addEventListener("storage",n=>{n.key===ue()&&e()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function Sn(t){bn();let{listeners:e}=F();return e.add(t),()=>{e.delete(t)}}var de=["system","light","dark"];function En(){let t=ct(z());return fn(t),t}var it="http://www.w3.org/2000/svg";function Ne(t,e,n={}){let i=document.createElementNS(it,"svg"),s={width:String(t),height:String(t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false",...n};for(let r of Object.keys(s))i.setAttribute(r,s[r]);for(let[r,o]of e){let d=document.createElementNS(it,r);for(let c of Object.keys(o))d.setAttribute(c,o[c]);i.appendChild(d)}return i}var st={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"}]]},yn=()=>({system:Y.themeSystem,light:Y.themeLight,dark:Y.themeDark}),_n="set on another site";function ct(t){let e=de.indexOf(t);return de[(e+1)%de.length]}function Le(t,e){return t==="system"||t==="light"||t==="dark"?e[t]:K(B,t)?B[t].label:t.charAt(0).toUpperCase()+t.slice(1)}function dt(t,e={}){let n={...yn(),...e.labels},i=e.strings?.themeToggleLabel??Y.themeToggleLabel,s=e.elsewhereLabel??_n;t.tagName==="BUTTON"&&!t.getAttribute("type")&&t.setAttribute("type","button");let r=Object.keys(st).map(l=>Ne(16,st[l],{"data-icon":l}));if(e.showLabel){let l=document.createElement("span");l.setAttribute("data-theme-word",""),l.setAttribute("aria-hidden","true"),r.push(l)}t.replaceChildren(...r);let o=t.querySelector("[data-theme-word]"),d=l=>{let h=l==="system"||l==="light"||l==="dark"?l:he(l);t.setAttribute("data-choice",l),t.querySelectorAll("svg[data-icon]").forEach(g=>{g.getAttribute("data-icon")===h?g.removeAttribute("display"):g.setAttribute("display","none")});let m=de.includes(l)?"":` (${s})`,v=i(`${Le(l,n)}${m}`,Le(ct(l),n));t.setAttribute("aria-label",v),t.setAttribute("title",v),o&&(o.textContent=Le(l,n))},c=()=>{En()};t.addEventListener("click",c);let u=Sn(l=>d(l));return d(z()),()=>{t.removeEventListener("click",c),u()}}var rt=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4M12 17h.01"}]],ot=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4M12 8h.01"}]],Tn={neutral:ot,info:ot,ok:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]],warn:rt,loss:rt},xn=6e3,C=null,q=null;function ht(t,e={}){q?.(),(!C||!C.isConnected)&&(C=document.createElement("div"),C.setAttribute("role","status"),C.setAttribute("aria-live","polite"),C.className="nish-toast-region",document.body.appendChild(C));let n=C,i=document.createElement("div");i.className="nish-toast"+(e.tone&&e.tone!=="neutral"?` nish-toast--${e.tone}`:"");let s=document.createElement("span");s.className="nish-toast-icon",s.setAttribute("aria-hidden","true"),s.append(Ne(15,Tn[e.tone??"neutral"])),i.append(s);let r=document.createElement("p");r.className="nish-toast-body",r.append(typeof t=="string"?document.createTextNode(t):t),i.append(r);let o=null,d=e.duration==="sticky"?1/0:e.duration??xn,c=0,u=0,l=()=>{o!=null&&clearTimeout(o),o=null,i.remove(),q===l&&(q=null)},h=a=>{Number.isFinite(a)&&(c=Date.now(),o=setTimeout(l,a))},m=()=>{u+=1,!(u>1||o==null)&&(clearTimeout(o),o=null,d=Math.max(0,d-(Date.now()-c)))},v=()=>{u!==0&&(u-=1,u===0&&h(Math.max(d,1e3)))},g=e.action,_=g?.href!=null?Je(g.href):null;if(g&&(g.href==null||_!=null)){let a=document.createElement(g.href!=null?"a":"button");a.className="nish-toast-action",a.textContent=g.label,_!=null?a.href=_:a.type="button",a.addEventListener("click",()=>{g.onClick?.(),l()}),i.append(a)}let p=document.createElement("button");return p.type="button",p.className="nish-toast-close",p.setAttribute("aria-label",e.dismissLabel??e.strings?.dismiss??Qe.dismiss),p.append(Ne(14,[["path",{d:"M18 6 6 18M6 6l12 12"}]])),p.addEventListener("click",l),i.append(p),i.addEventListener("pointerenter",a=>a.pointerType==="mouse"&&m()),i.addEventListener("pointerleave",a=>a.pointerType==="mouse"&&v()),i.addEventListener("focusin",a=>!i.contains(a.relatedTarget)&&m()),i.addEventListener("focusout",a=>!i.contains(a.relatedTarget)&&v()),i.addEventListener("keydown",a=>{a.key==="Escape"&&l()}),setTimeout(()=>{q===l&&(n.append(i),h(d))},50),q=l,l}var wn=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function ut(t){if(typeof document>"u")return()=>{};let e=!1,n=!1;if(t.open)return()=>s();let i=document.activeElement instanceof HTMLElement?document.activeElement:null;function s(){if(e||!t.open)return;e=!0;let a,f=()=>{t.removeEventListener("animationend",T),a!==void 0&&clearTimeout(a),t.removeAttribute("data-closing"),t.style.transform="",t.style.transition="",e=!1,t.open&&t.close()},T=Kt=>{Kt.target===t&&f()};if(wn()){f();return}t.style.transform="",t.setAttribute("data-closing",""),t.addEventListener("animationend",T),a=setTimeout(f,260)}let r=a=>{a.preventDefault(),s()},o=a=>{a.key==="Escape"&&a.stopPropagation()},d=a=>{if(a.target===t){let f=t.getBoundingClientRect();a.clientX>=f.left&&a.clientX<=f.right&&a.clientY>=f.top&&a.clientY<=f.bottom||s();return}a.target instanceof Element&&a.target.closest("[data-sheet-close]")&&s()},c=0,u=0,l=0,h=0,m=1,v=a=>{if(a.pointerType==="mouse"||e||!a.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let f=t.getBoundingClientRect();!(a.target instanceof Element&&a.target.closest(".nish-sheet-header")!=null)&&a.clientY-f.top>28||(n=!0,c=u=a.clientY,l=a.timeStamp,h=0,m=f.height||1,t.style.transition="none",t.setPointerCapture?.(a.pointerId))},g=a=>{if(!n)return;let f=a.clientY-c,T=a.timeStamp-l;T>0&&(h=(a.clientY-u)/T),u=a.clientY,l=a.timeStamp,t.style.transform=`translateY(${f>=0?f:f*.3}px)`},_=a=>{if(!n)return;n=!1,t.releasePointerCapture?.(a.pointerId);let f=a.clientY-c;if(a.type!=="pointercancel"&&(f>m*.3||h>.5)){s();return}t.style.transition="transform 180ms var(--nish-ease-out, ease-out)",t.style.transform="",setTimeout(()=>{e||(t.style.transition="")},200)},p=()=>{t.removeEventListener("cancel",r),t.removeEventListener("keydown",o),t.removeEventListener("click",d),t.removeEventListener("pointerdown",v),t.removeEventListener("pointermove",g),t.removeEventListener("pointerup",_),t.removeEventListener("pointercancel",_),t.removeEventListener("close",p),i?.isConnected&&i.focus()};return t.addEventListener("cancel",r),t.addEventListener("keydown",o),t.addEventListener("click",d),t.addEventListener("pointerdown",v),t.addEventListener("pointermove",g),t.addEventListener("pointerup",_),t.addEventListener("pointercancel",_),t.addEventListener("close",p),t.showModal(),s}function pt(t,e){if(typeof document>"u")return()=>{};let n=document.documentElement,i=()=>{let r=t.offsetHeight;r>0?n.style.setProperty(e,`${r}px`):n.style.removeProperty(e)};i();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(i),s.observe(t)):window.addEventListener("resize",i),()=>{s?.disconnect(),window.removeEventListener("resize",i),n.style.removeProperty(e)}}var mt=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 w=function(t,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n},E=function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},W,pe,me,X,Me,Z,fe,I,J,M,ge,ft;var b={__proto__:null};b.enumerable=!0;Object.freeze(b);var $e=(M=class{constructor(e,n={}){if(W.set(this,!1),pe.set(this,!1),me.set(this,!1),X.set(this,!1),Me.set(this,Date.now()),Z.set(this,!1),fe.set(this,void 0),I.set(this,void 0),J.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 n!="object"||!n)throw new Error('The "options" argument must be an object');let{bubbles:i,cancelable:s,composed:r}=n;w(this,W,!!s,"f"),w(this,pe,!!i,"f"),w(this,me,!!r,"f"),w(this,fe,`${e}`,"f"),w(this,I,null,"f"),w(this,J,!1,"f")}initEvent(e,n,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){w(this,X,!0,"f")}get target(){return E(this,I,"f")}get currentTarget(){return E(this,I,"f")}get srcElement(){return E(this,I,"f")}get type(){return E(this,fe,"f")}get cancelable(){return E(this,W,"f")}get defaultPrevented(){return E(this,W,"f")&&E(this,X,"f")}get timeStamp(){return E(this,Me,"f")}composedPath(){return E(this,J,"f")?[E(this,I,"f")]:[]}get returnValue(){return!E(this,W,"f")||!E(this,X,"f")}get bubbles(){return E(this,pe,"f")}get composed(){return E(this,me,"f")}get eventPhase(){return E(this,J,"f")?M.AT_TARGET:M.NONE}get cancelBubble(){return E(this,Z,"f")}set cancelBubble(e){e&&w(this,Z,!0,"f")}stopPropagation(){w(this,Z,!0,"f")}get isTrusted(){return!1}},W=new WeakMap,pe=new WeakMap,me=new WeakMap,X=new WeakMap,Me=new WeakMap,Z=new WeakMap,fe=new WeakMap,I=new WeakMap,J=new WeakMap,M.NONE=0,M.CAPTURING_PHASE=1,M.AT_TARGET=2,M.BUBBLING_PHASE=3,M);Object.defineProperties($e.prototype,{initEvent:b,stopImmediatePropagation:b,preventDefault:b,target:b,currentTarget:b,srcElement:b,type:b,cancelable:b,defaultPrevented:b,timeStamp:b,composedPath:b,returnValue:b,bubbles:b,composed:b,eventPhase:b,cancelBubble:b,stopPropagation:b,isTrusted:b});var gt=(ft=class extends $e{constructor(e,n={}){super(e,n),ge.set(this,void 0),w(this,ge,n?.detail??null,"f")}initCustomEvent(e,n,i,s){throw new Error("Method not implemented.")}get detail(){return E(this,ge,"f")}},ge=new WeakMap,ft);Object.defineProperties(gt.prototype,{detail:b});var A=$e,ke=gt;var y;var oi=(y=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}},y.STYLE_RULE=1,y.CHARSET_RULE=2,y.IMPORT_RULE=3,y.MEDIA_RULE=4,y.FONT_FACE_RULE=5,y.PAGE_RULE=6,y.NAMESPACE_RULE=10,y.KEYFRAMES_RULE=7,y.KEYFRAME_RULE=8,y.SUPPORTS_RULE=12,y.COUNTER_STYLE_RULE=11,y.FONT_FEATURE_VALUES_RULE=14,y.MARGIN_RULE=9,y);globalThis.Event??=A;globalThis.CustomEvent??=ke;var Ie=Symbol(),vt=t=>typeof t=="boolean"?t:t?.capture??!1,R={__proto__:null};R.enumerable=!0;Object.freeze(R);var ve=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,n,i){if(n==null)return;let s=vt(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(n))return;let o=typeof i=="object"&&i?i:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,n,i)),r.set(n,o??{})}removeEventListener(e,n,i){if(n==null)return;let s=vt(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(n),r.size||s.delete(e))}dispatchEvent(e){let n=this.__resolveFullEventPath();!e.composed&&this.__host&&(n=n.slice(0,n.indexOf(this.__host)));let i=!1,s=!1,r=A.NONE,o=null,d=null,c=null,u=e.stopPropagation,l=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??d},...R},srcElement:{get(){return e.target},...R},currentTarget:{get(){return c},...R},eventPhase:{get(){return r},...R},composedPath:{value:()=>n,...R},stopPropagation:{value:()=>{i=!0,u.call(e)},...R},stopImmediatePropagation:{value:()=>{s=!0,l.call(e)},...R}});let h=(p,a,f)=>{typeof p=="function"?p(e):typeof p?.handleEvent=="function"&&p.handleEvent(e),a.once&&f.delete(p)},m=()=>(c=null,r=A.NONE,!e.defaultPrevented),v=n.slice().reverse();o=!this.__host||!e.composed?this:null;let g=p=>{for(d=this;d.__host&&p.includes(d.__host);)d=d.__host};for(let p of v){!o&&(!d||d===p.__host)&&g(v.slice(v.indexOf(p))),c=p,r=p===e.target?A.AT_TARGET:A.CAPTURING_PHASE;let a=p.__captureEventListeners.get(e.type);if(a){for(let[f,T]of a)if(h(f,T,a),s)return m()}if(i)return m()}let _=e.bubbles?n:[this];d=null;for(let p of _){!o&&(!d||p===d.__host)&&g(_.slice(0,_.indexOf(p)+1)),c=p,r=p===e.target?A.AT_TARGET:A.BUBBLING_PHASE;let a=p.__eventListeners.get(e.type);if(a){for(let[f,T]of a)if(h(f,T,a),s)return m()}if(i)return m()}return m()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Et,Ln]}};var bt=new WeakMap,Q=t=>{let e=bt.get(t);return e===void 0&&bt.set(t,e=new Map),e},ee=class extends ve{getRootNode(e){return e?.composed?Pe:this.__host?.__shadowRoot??Pe}};var St=class extends ee{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Et=new St,Pe=Et;var yt=class extends ee{constructor(e){if(super(),e!==Ie)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:be,customElements:He,document:Pe,Document:St,Element:_t,EventTarget:ve,HTMLElement:Tt,Node:ee,ShadowRoot:xt,window:this,Window:yt})}};var _t=class extends ee{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Q(this)).map(([e,n])=>({name:e,value:n}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,n){Q(this).set(e,String(n))}removeAttribute(e){Q(this).delete(e)}toggleAttribute(e,n){if(this.hasAttribute(e)){if(n===void 0||!n)return this.removeAttribute(e),!1}else return n===void 0||n?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return Q(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let n=new xt(Ie,e);return n.__eventTargetParent=this,n.__host=this,this.__shadowRoot=n}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 mt(this);return this.__internals=e,e}getAttribute(e){return Q(this).get(e)??null}};var Tt=class extends _t{},Oe=Tt;var xt=class extends ee{get host(){return this.__host}constructor(e,n){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=n.mode}};globalThis.litServerRoot??=Object.defineProperty(new Oe,"localName",{get(){return"lit-server-root"}});function An(){let t,e;return{promise:new Promise((i,s)=>{t=i,e=s}),resolve:t,reject:e}}var be=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,n){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(n))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(n)}`);n.__localName=e,this.__definitions.set(e,{ctor:n,observedAttributes:n.observedAttributes??[]}),this.__reverseDefinitions.set(n,e),this.__pendingWhenDefineds.get(e)?.resolve(n),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 n=this.__definitions.get(e);if(n)return n.ctor;let i=this.__pendingWhenDefineds.get(e);return i||(i=An(),this.__pendingWhenDefineds.set(e,i)),i.promise}},Rn=
|
|
3
|
-
\f\r]`,
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ot=/'/g,Ht=/"/g,Bt=/^(?:script|style|textarea|title)$/i,Ye=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),Gi=Ye(1),Bi=Ye(2),Fi=Ye(3),U=Symbol.for("lit-noChange"),S=Symbol.for("lit-nothing"),Dt=new WeakMap,H=D.createTreeWalker(D,129);function Ft(t,e){if(!je(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return kt!==void 0?kt.createHTML(e):e}var Un=(t,e)=>{let n=t.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=se;for(let d=0;d<n;d++){let c=t[d],u,l,h=-1,m=0;for(;m<c.length&&(o.lastIndex=m,l=o.exec(c),l!==null);)m=o.lastIndex,o===se?l[1]==="!--"?o=Pt:l[1]!==void 0?o=It:l[2]!==void 0?(Bt.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=O):l[3]!==void 0&&(o=O):o===O?l[0]===">"?(o=s??se,h=-1):l[1]===void 0?h=-2:(h=o.lastIndex-l[2].length,u=l[1],o=l[3]===void 0?O:l[3]==='"'?Ht:Ot):o===Ht||o===Ot?o=O:o===Pt||o===It?o=se:(o=O,s=void 0);let v=o===O&&t[d+1].startsWith("/>")?" ":"";r+=o===se?c+Hn:h>=0?(i.push(u),c.slice(0,h)+Ut+c.slice(h)+$+v):c+$+(h===-2?d:v)}return[Ft(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},ae=class t{constructor({strings:e,_$litType$:n},i){let s;this.parts=[];let r=0,o=0,d=e.length-1,c=this.parts,[u,l]=Un(e,n);if(this.el=t.createElement(u,i),H.currentNode=this.el.content,n===2||n===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=H.nextNode())!==null&&c.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(Ut)){let m=l[o++],v=s.getAttribute(h).split($),g=/([.?@])?(.*)/.exec(m);c.push({type:1,index:r,name:g[2],strings:v,ctor:g[1]==="."?Fe:g[1]==="?"?ze:g[1]==="@"?We:j}),s.removeAttribute(h)}else h.startsWith($)&&(c.push({type:6,index:r}),s.removeAttribute(h));if(Bt.test(s.tagName)){let h=s.textContent.split($),m=h.length-1;if(m>0){s.textContent=ye?ye.emptyScript:"";for(let v=0;v<m;v++)s.append(h[v],re()),H.nextNode(),c.push({type:2,index:++r});s.append(h[m],re())}}}else if(s.nodeType===8)if(s.data===Gt)c.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf($,h+1))!==-1;)c.push({type:7,index:r}),h+=$.length-1}r++}}static createElement(e,n){let i=D.createElement("template");return i.innerHTML=e,i}};function V(t,e,n=t,i){if(e===U)return e;let s=i!==void 0?n._$Co?.[i]:n._$Cl,r=oe(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(t),s._$AT(t,n,i)),i!==void 0?(n._$Co??=[])[i]=s:n._$Cl=s),s!==void 0&&(e=V(t,s._$AS(t,e.values),s,i)),e}var Be=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:n},parts:i}=this._$AD,s=(e?.creationScope??D).importNode(n,!0);H.currentNode=s;let r=H.nextNode(),o=0,d=0,c=i[0];for(;c!==void 0;){if(o===c.index){let u;c.type===2?u=new le(r,r.nextSibling,this,e):c.type===1?u=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(u=new Ve(r,this,e)),this._$AV.push(u),c=i[++d]}o!==c?.index&&(r=H.nextNode(),o++)}return H.currentNode=D,s}p(e){let n=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,n),n+=i.strings.length-2):i._$AI(e[n])),n++}},le=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,i,s){this.type=2,this._$AH=S,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=V(this,e,n),oe(e)?e===S||e==null||e===""?(this._$AH!==S&&this._$AR(),this._$AH=S):e!==this._$AH&&e!==U&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Dn(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!==S&&oe(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.createTextNode(e)),this._$AH=e}$(e){let{values:n,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=ae.createElement(Ft(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(n);else{let r=new Be(s,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Dt.get(e.strings);return n===void 0&&Dt.set(e.strings,n=new ae(e)),n}k(e){je(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,s=0;for(let r of e)s===n.length?n.push(i=new t(this.O(re()),this.O(re()),this,this.options)):i=n[s],i._$AI(r),s++;s<n.length&&(this._$AR(i&&i._$AB.nextSibling,s),n.length=s)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let i=$t(e).nextSibling;$t(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,i,s,r){this.type=1,this._$AH=S,this._$AN=void 0,this.element=e,this.name=n,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=S}_$AI(e,n=this,i,s){let r=this.strings,o=!1;if(r===void 0)e=V(this,e,n,0),o=!oe(e)||e!==this._$AH&&e!==U,o&&(this._$AH=e);else{let d=e,c,u;for(e=r[0],c=0;c<r.length-1;c++)u=V(this,d[i+c],n,c),u===U&&(u=this._$AH[c]),o||=!oe(u)||u!==this._$AH[c],u===S?e=S:e!==S&&(e+=(u??"")+r[c+1]),this._$AH[c]=u}o&&!s&&this.j(e)}j(e){e===S?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Fe=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===S?void 0:e}},ze=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==S)}},We=class extends j{constructor(e,n,i,s,r){super(e,n,i,s,r),this.type=5}_$AI(e,n=this){if((e=V(this,e,n,0)??S)===U)return;let i=this._$AH,s=e===S&&i!==S||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==S&&(i===S||s);s&&this.element.removeEventListener(this.name,this,i),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)}},Ve=class{constructor(e,n,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){V(this,e)}};var Gn=_e.litHtmlPolyfillSupport;Gn?.(ae,le),(_e.litHtmlVersions??=[]).push("3.3.3");var zt=(t,e,n)=>{let i=n?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=n?.renderBefore??null;i._$litPart$=s=new le(e.insertBefore(re(),r),r,void 0,n??{})}return s._$AI(t),s};var qe=globalThis,k=class extends L{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 n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=zt(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return U}};k._$litElement$=!0,k.finalized=!0,qe.litElementHydrateSupport?.({LitElement:k});var Bn=qe.litElementPolyfillSupport;Bn?.({LitElement:k});(qe.litElementVersions??=[]).push("4.2.2");var Wt={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:t=>`${t} result${t===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:t=>`${t} active`,remove:"Remove",removeNamed:t=>`Remove ${t}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:t=>`${t}: no data`,seriesNumber:t=>`Series ${t}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark"};function Ke(){return ce("element-strings",()=>({values:{...Wt},listeners:new Set}))}function Fn(t){let e=Ke(),n={...e.values};for(let[i,s]of Object.entries(t))s!==void 0&&Object.hasOwn(Wt,i)&&(n[i]=s);e.values=n;for(let i of Array.from(e.listeners))i()}function Te(){return Ke().values}function Vt(t){let e=Ke().listeners;return e.add(t),()=>{e.delete(t)}}var x=class extends k{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=Vt(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function jt(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}function N(t,e){customElements.get(t)||customElements.define(t,e)}function Yt(t,e){let n=null,i=()=>Array.from(t.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,d=null,c=-1;for(let u of i()){if(e?.(u),!u.getAttribute("href"))continue;let l;try{l=new URL(u.getAttribute("href"),location.href)}catch{continue}if(l.origin!==location.origin)continue;if(l.hash&&l.pathname===location.pathname){l.hash===location.hash&&(d=u,c=1/0);continue}let h=l.pathname;(h==="/"?o==="/":o===h||o.startsWith(h.endsWith("/")?h:`${h}/`))&&h.length>c&&(d=u,c=h.length)}if(!d){n?.removeAttribute("aria-current"),n=null;return}for(let u of i())u.removeAttribute("aria-current");d.setAttribute("aria-current","page"),n=d},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(t,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(t,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var xe=class extends x{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#t=null;#n=null;constructor(){super(),this.label="",this.lg=!1}connectedCallback(){super.connectedCallback(),jt(()=>this.#s())}#s(){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.#i(),this.#n=Yt(e,n=>n.classList.add("nish-bottom-nav-item")),this.#t=pt(e,"--nish-bottom-nav-h")}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#n?.(),this.#n=null,this.#t?.(),this.#t=null}updated(e){this.#i()}#i(){this.#e&&(this.#e.setAttribute("aria-label",this.label||Te().sections),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}};N("nish-bottom-nav",xe);var qt=0,we=class extends x{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 n=e.target.closest("[data-dialog-open]");n&&n.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 n=e.querySelector(".nish-dialog-title"),i=e.querySelector(".nish-dialog-body");n?(n.id||(n.id=`nish-dialog-title-${++qt}`),e.setAttribute("aria-labelledby",n.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),i?(i.id||(i.id=`nish-dialog-body-${++qt}`),e.setAttribute("aria-describedby",i.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 n=this.dialog;if(n){if(e.target===n){let i=n.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&e.clientY>=i.top&&e.clientY<=i.bottom||this.close();return}if(e.target instanceof Element){let i=e.target.closest("[data-dialog-close]");i&&i.closest("dialog")===n&&this.close(i.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 n=this.opener;this.opener=null,n?.isConnected&&n.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};N("nish-dialog",we);var zn=0,Ae=class extends x{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 n=e.target.closest("[data-sheet-open]");n&&n.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 n=e.querySelector(".nish-sheet-title");n?(n.id||(n.id=`nish-sheet-title-${++zn}`),e.setAttribute("aria-labelledby",n.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=ut(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()}};N("nish-sheet",Ae);var Re=class extends x{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;#t=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#r()}updated(e){this.#e&&this.#n!==this.#i()&&this.#o()}#n="";#s(){let e=Te();return[this.labelSystem||e.themeSystem,this.labelLight||e.themeLight,this.labelDark||e.themeDark]}#i(){return JSON.stringify([this.labelled,this.pill,...this.#s()])}#r(){this.#t?.(),this.#t=null,this.#e?.remove(),this.#e=null}#o(){this.#r(),this.#n=this.#i();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[n,i,s]=this.#s(),r={system:n,light:i,dark:s};this.#t=dt(e,{showLabel:this.labelled,labels:r})}};N("nish-theme-toggle",Re);export{xe as NishBottomNav,we as NishDialog,x as NishElement,Ae as NishSheet,Re as NishThemeToggle,Fn as configureStrings,N as define,ht as toast};
|
|
1
|
+
var Xt=["emerald","indigo","amber","lime","rose","sky","violet","teal"],Wn=["accent","ok","loss","warn","info",...Xt],G={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},Zt={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},Jt=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],Qt=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],P=t=>Object.fromEntries(t.map((e,n)=>[`chart-${n+1}`,e])),en={dark:{label:"Dark",scheme:"dark",colors:{bg:"#0a0b0f",surface:"#111218",elevated:"#191b23",overlay:"#22252f",line:"#262935","line-strong":"#3a3e4d","line-control":"#666975",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",...P(Jt),...G}},light:{label:"Light",scheme:"light",colors:{bg:"#f7f6f3",surface:"#ffffff",elevated:"#f1f0ec",overlay:"#e6e4de",line:"#e2e0da","line-strong":"#c9c6bd","line-control":"#8a8881",hi:"#17171c",hi2:"#4f515c",hi3:"#626470",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",...P(Qt),...Zt}},slate:{label:"Slate",scheme:"dark",colors:{bg:"#18181b",surface:"#202024",elevated:"#2c2c32",overlay:"#36363d",line:"#3a3a42","line-strong":"#52525b","line-control":"#77777e",hi:"#f4f4f5",hi2:"#b8b8c0",hi3:"#a0a0a8",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",...P(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...G,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","line-control":"#5c6c61",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",...P(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...G}},mocha:{label:"Mocha",scheme:"dark",colors:{bg:"#1c1917",surface:"#292524",elevated:"#393432",overlay:"#44403c",line:"#44403c","line-strong":"#57534e","line-control":"#83807c",hi:"#f5f0eb",hi2:"#c6c0bb",hi3:"#b2ada8",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",...P(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...G,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","line-control":"#507291",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",...P(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...G}},contrast:{label:"High contrast",scheme:"dark",colors:{bg:"#000000",surface:"#080808",elevated:"#141414",overlay:"#222222",line:"#4a4a4a","line-strong":"#8a8a8a","line-control":"#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",...P(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...G}}},tn=t=>{let e=t.colors,n=Object.fromEntries(["ok","loss","warn","info"].flatMap(i=>[[`${i}-fill`,e[`${i}-fill`]??e[i]],[`on-${i}`,e[`on-${i}`]??e["on-accent"]]]));return{...t,colors:{...e,...n,"on-accent2":e["on-accent2"]??e["on-accent"]}}},B=Object.fromEntries(Object.entries(en).map(([t,e])=>[t,tn(e)])),Je="dark";var nn="3.1.0";var sn=Symbol.for("nish-ui.runtime.v1");function rn(){let t=globalThis;return t[sn]??={versions:new Set,slots:{}}}function on(t){t.versions.add(nn),t.versions.size>1&&!t.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(t.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...t.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var Qe=!1;function de(t,e){let n=rn();return Qe||(Qe=!0,on(n)),t in n.slots||(n.slots[t]=e()),n.slots[t]}function et(t){if(t==null)return null;let e=String(t),n=0,i=e.length;for(;n<i&&e.charCodeAt(n)<=32;)n++;for(;i>n&&e.charCodeAt(i-1)<=32;)i--;let s=e.slice(n,i).replace(/[\t\n\r]/g,"");if(s===""||s!==s.trim()||/[\u0000-\u001f\u007f]/.test(s))return null;let r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(s);if(!r)return s;let o=r[1].toLowerCase();return o==="http"||o==="https"||o==="mailto"||o==="tel"?s:null}var q={theme:"Theme",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(t,e)=>`Theme: ${t}. Switch to ${e}`,themePreset:"Theme preset",themePresetPlaceholder:"Preset\u2026"};var tt={dismiss:"Dismiss",moreCount:t=>`${t} more`,copy:"Copy",copied:"Copied",legend:"Legend",noData:"No data",noDataNamed:t=>`${t}: no data`};var nt="nish-theme",it="nish.software",an=3600*24*365,F=()=>de("theme",()=>({extra:{},listeners:new Set,watching:!1,switchId:0})),ln=t=>{globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: ${t}`)};function me(){if(typeof document>"u")return nt;let t=document.documentElement.getAttribute("data-nish-storage-key");return t&&/^[A-Za-z0-9_-]+$/.test(t)?t:nt}var X=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function Me(t){return typeof t=="string"&&(X(B,t)||X(F().extra,t))}function cn(){if(typeof document>"u")return null;try{let t=document.cookie.match(new RegExp(`(?:^|;\\s*)${me()}=([a-z0-9-]+)`));return t?t[1]:null}catch{return null}}var st=(t,e)=>e===t||e.endsWith("."+t);function dn(t,e){let n=t.toLowerCase(),i=(e??"").trim().toLowerCase().replace(/^\./,"");return i?st(i,n)?i:null:st(it,n)?it:null}function hn(){return typeof location>"u"||typeof document>"u"?null:dn(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function z(){let t=null;try{t=cn()??localStorage.getItem(me())}catch{}return t==="system"||Me(t)?t:"system"}function un(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":Je}function mn(){let t=document.documentElement.getAttribute("data-nish-themes");return t?t.split(/\s+/).filter(Me):null}function ct(t=z()){let e=t==="system"?un():t,n=typeof document>"u"?null:mn();return n&&!n.includes(e)&&(e=ue(e)),e}function ue(t){let{extra:e}=F();return X(B,t)?B[t].scheme:X(e,t)?e[t]:"dark"}function dt(t=z()){let e=ct(t),n=document.documentElement,i=n.getAttribute("data-theme");return i&&i!==e&&pn(n),n.setAttribute("data-theme",e),n.setAttribute("data-scheme",ue(e)),n.setAttribute("data-theme-choice",t),n.style.colorScheme=ue(e),vn(),F().listeners.forEach(s=>s(t,e)),e}function pn(t){let e=F(),n=++e.switchId;t.setAttribute("data-nish-theme-switching","");let i=()=>{e.switchId===n&&t.removeAttribute("data-nish-theme-switching")};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>requestAnimationFrame(i)):setTimeout(i,32)}function fn(t){if(t!=="system"&&!Me(t))return ln(`unknown theme "${String(t)}" ignored. Register it with registerThemes() first.`),ct(z());let e=me();try{localStorage.setItem(e,t)}catch{}try{let n=hn();if(n){let i=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${t}; Domain=.${n}; Path=/; Max-Age=${an}; SameSite=Lax${i}`}}catch{}return dt(t)}function gn(t){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${t}`).trim()}function vn(){let t=gn("bg");if(!t)return;let e=document.querySelector('meta[name="theme-color"][data-nish]')??document.querySelector('meta[name="theme-color"]:not([media]):not([data-nish-keep])');e||(e=document.createElement("meta"),e.name="theme-color",(document.head||document.documentElement).appendChild(e)),e.setAttribute("data-nish",""),e.content=t}function bn(){let t=F();if(t.watching||typeof window>"u")return;t.watching=!0;let e=()=>{let n=z();(n!==document.documentElement.getAttribute("data-theme-choice")||n==="system")&&dt(n)};typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").addEventListener("change",e),window.addEventListener("storage",n=>{n.key===me()&&e()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function Sn(t){bn();let{listeners:e}=F();return e.add(t),()=>{e.delete(t)}}var he=["system","light","dark"];function En(){let t=ht(z());return fn(t),t}var rt="http://www.w3.org/2000/svg";function Ne(t,e,n={}){let i=document.createElementNS(rt,"svg"),s={width:String(t),height:String(t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false",...n};for(let r of Object.keys(s))i.setAttribute(r,s[r]);for(let[r,o]of e){let d=document.createElementNS(rt,r);for(let c of Object.keys(o))d.setAttribute(c,o[c]);i.appendChild(d)}return i}var ot={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"}]]},yn=()=>({system:q.themeSystem,light:q.themeLight,dark:q.themeDark}),_n="set on another site";function ht(t){let e=he.indexOf(t);return he[(e+1)%he.length]}function Ce(t,e){return t==="system"||t==="light"||t==="dark"?e[t]:X(B,t)?B[t].label:t.charAt(0).toUpperCase()+t.slice(1)}function ut(t,e={}){let n={...yn(),...e.labels},i=e.strings?.themeToggleLabel??q.themeToggleLabel,s=e.elsewhereLabel??_n;t.tagName==="BUTTON"&&!t.getAttribute("type")&&t.setAttribute("type","button");let r=Object.keys(ot).map(l=>Ne(16,ot[l],{"data-icon":l}));if(e.showLabel){let l=document.createElement("span");l.setAttribute("data-theme-word",""),l.setAttribute("aria-hidden","true"),r.push(l)}t.replaceChildren(...r);let o=t.querySelector("[data-theme-word]"),d=l=>{let u=l==="system"||l==="light"||l==="dark"?l:ue(l);t.setAttribute("data-choice",l),t.querySelectorAll("svg[data-icon]").forEach(v=>{v.getAttribute("data-icon")===u?v.removeAttribute("display"):v.setAttribute("display","none")});let m=he.includes(l)?"":` (${s})`,g=i(`${Ce(l,n)}${m}`,Ce(ht(l),n));t.setAttribute("aria-label",g),t.setAttribute("title",g),o&&(o.textContent=Ce(l,n))},c=()=>{En()};t.addEventListener("click",c);let h=Sn(l=>d(l));return d(z()),()=>{t.removeEventListener("click",c),h()}}var at=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4M12 17h.01"}]],lt=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4M12 8h.01"}]],Tn={neutral:lt,info:lt,ok:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]],warn:at,loss:at},wn=6e3,N=null,K=null;function mt(t,e={}){K?.(),(!N||!N.isConnected)&&(N=document.createElement("div"),N.setAttribute("role","status"),N.setAttribute("aria-live","polite"),N.className="nish-toast-region",document.body.appendChild(N));let n=N,i=document.createElement("div");i.className="nish-toast"+(e.tone&&e.tone!=="neutral"?` nish-toast--${e.tone}`:"");let s=document.createElement("span");s.className="nish-toast-icon",s.setAttribute("aria-hidden","true"),s.append(Ne(15,Tn[e.tone??"neutral"])),i.append(s);let r=document.createElement("p");r.className="nish-toast-body",r.append(typeof t=="string"?document.createTextNode(t):t),i.append(r);let o=null,d=e.duration==="sticky"?1/0:e.duration??wn,c=0,h=0,l=()=>{o!=null&&clearTimeout(o),o=null,i.remove(),K===l&&(K=null)},u=a=>{Number.isFinite(a)&&(c=Date.now(),o=setTimeout(l,a))},m=()=>{h+=1,!(h>1||o==null)&&(clearTimeout(o),o=null,d=Math.max(0,d-(Date.now()-c)))},g=()=>{h!==0&&(h-=1,h===0&&u(Math.max(d,1e3)))},v=e.action,_=v?.href!=null?et(v.href):null;if(v&&(v.href==null||_!=null)){let a=document.createElement(v.href!=null?"a":"button");a.className="nish-toast-action",a.textContent=v.label,_!=null?a.href=_:a.type="button",a.addEventListener("click",()=>{v.onClick?.(),l()}),i.append(a)}let p=document.createElement("button");return p.type="button",p.className="nish-toast-close",p.setAttribute("aria-label",e.dismissLabel??e.strings?.dismiss??tt.dismiss),p.append(Ne(14,[["path",{d:"M18 6 6 18M6 6l12 12"}]])),p.addEventListener("click",l),i.append(p),i.addEventListener("pointerenter",a=>a.pointerType==="mouse"&&m()),i.addEventListener("pointerleave",a=>a.pointerType==="mouse"&&g()),i.addEventListener("focusin",a=>!i.contains(a.relatedTarget)&&m()),i.addEventListener("focusout",a=>!i.contains(a.relatedTarget)&&g()),i.addEventListener("keydown",a=>{a.key==="Escape"&&l()}),setTimeout(()=>{K===l&&(n.append(i),u(d))},50),K=l,l}var xn=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function ke(t){if(typeof document>"u")return()=>{};let e=!1,n=!1;if(t.open)return()=>s();let i=document.activeElement instanceof HTMLElement?document.activeElement:null;function s(){if(e||!t.open)return;e=!0;let a,f=()=>{t.removeEventListener("animationend",T),a!==void 0&&clearTimeout(a),t.removeAttribute("data-closing"),t.style.transform="",t.style.transition="",e=!1,t.open&&t.close()},T=Kt=>{Kt.target===t&&f()};if(xn()){f();return}t.style.transform="",t.setAttribute("data-closing",""),t.addEventListener("animationend",T),a=setTimeout(f,260)}let r=a=>{a.preventDefault(),s()},o=a=>{a.key==="Escape"&&a.stopPropagation()},d=a=>{if(a.target===t){let f=t.getBoundingClientRect();a.clientX>=f.left&&a.clientX<=f.right&&a.clientY>=f.top&&a.clientY<=f.bottom||s();return}a.target instanceof Element&&a.target.closest("[data-sheet-close]")&&s()},c=0,h=0,l=0,u=0,m=1,g=a=>{if(a.pointerType==="mouse"||e||!a.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let f=t.getBoundingClientRect();!(a.target instanceof Element&&a.target.closest(".nish-sheet-header")!=null)&&a.clientY-f.top>28||(n=!0,c=h=a.clientY,l=a.timeStamp,u=0,m=f.height||1,t.style.transition="none",t.setPointerCapture?.(a.pointerId))},v=a=>{if(!n)return;let f=a.clientY-c,T=a.timeStamp-l;T>0&&(u=(a.clientY-h)/T),h=a.clientY,l=a.timeStamp,t.style.transform=`translateY(${f>=0?f:f*.3}px)`},_=a=>{if(!n)return;n=!1,t.releasePointerCapture?.(a.pointerId);let f=a.clientY-c;if(a.type!=="pointercancel"&&(f>m*.3||u>.5)){s();return}t.style.transition="transform 180ms var(--nish-ease-out, ease-out)",t.style.transform="",setTimeout(()=>{e||(t.style.transition="")},200)},p=()=>{t.removeEventListener("cancel",r),t.removeEventListener("keydown",o),t.removeEventListener("click",d),t.removeEventListener("pointerdown",g),t.removeEventListener("pointermove",v),t.removeEventListener("pointerup",_),t.removeEventListener("pointercancel",_),t.removeEventListener("close",p),i?.isConnected&&i.focus()};return t.addEventListener("cancel",r),t.addEventListener("keydown",o),t.addEventListener("click",d),t.addEventListener("pointerdown",g),t.addEventListener("pointermove",v),t.addEventListener("pointerup",_),t.addEventListener("pointercancel",_),t.addEventListener("close",p),t.showModal(),s}function pt(t,e){if(typeof document>"u")return()=>{};let n=document.documentElement,i=()=>{let r=t.offsetHeight;r>0?n.style.setProperty(e,`${r}px`):n.style.removeProperty(e)};i();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(i),s.observe(t)):window.addEventListener("resize",i),()=>{s?.disconnect(),window.removeEventListener("resize",i),n.style.removeProperty(e)}}var ft=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(t,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n},E=function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},W,pe,fe,Z,$e,J,ge,O,Q,M,ve,gt;var b={__proto__:null};b.enumerable=!0;Object.freeze(b);var Pe=(M=class{constructor(e,n={}){if(W.set(this,!1),pe.set(this,!1),fe.set(this,!1),Z.set(this,!1),$e.set(this,Date.now()),J.set(this,!1),ge.set(this,void 0),O.set(this,void 0),Q.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 n!="object"||!n)throw new Error('The "options" argument must be an object');let{bubbles:i,cancelable:s,composed:r}=n;x(this,W,!!s,"f"),x(this,pe,!!i,"f"),x(this,fe,!!r,"f"),x(this,ge,`${e}`,"f"),x(this,O,null,"f"),x(this,Q,!1,"f")}initEvent(e,n,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){x(this,Z,!0,"f")}get target(){return E(this,O,"f")}get currentTarget(){return E(this,O,"f")}get srcElement(){return E(this,O,"f")}get type(){return E(this,ge,"f")}get cancelable(){return E(this,W,"f")}get defaultPrevented(){return E(this,W,"f")&&E(this,Z,"f")}get timeStamp(){return E(this,$e,"f")}composedPath(){return E(this,Q,"f")?[E(this,O,"f")]:[]}get returnValue(){return!E(this,W,"f")||!E(this,Z,"f")}get bubbles(){return E(this,pe,"f")}get composed(){return E(this,fe,"f")}get eventPhase(){return E(this,Q,"f")?M.AT_TARGET:M.NONE}get cancelBubble(){return E(this,J,"f")}set cancelBubble(e){e&&x(this,J,!0,"f")}stopPropagation(){x(this,J,!0,"f")}get isTrusted(){return!1}},W=new WeakMap,pe=new WeakMap,fe=new WeakMap,Z=new WeakMap,$e=new WeakMap,J=new WeakMap,ge=new WeakMap,O=new WeakMap,Q=new WeakMap,M.NONE=0,M.CAPTURING_PHASE=1,M.AT_TARGET=2,M.BUBBLING_PHASE=3,M);Object.defineProperties(Pe.prototype,{initEvent:b,stopImmediatePropagation:b,preventDefault:b,target:b,currentTarget:b,srcElement:b,type:b,cancelable:b,defaultPrevented:b,timeStamp:b,composedPath:b,returnValue:b,bubbles:b,composed:b,eventPhase:b,cancelBubble:b,stopPropagation:b,isTrusted:b});var vt=(gt=class extends Pe{constructor(e,n={}){super(e,n),ve.set(this,void 0),x(this,ve,n?.detail??null,"f")}initCustomEvent(e,n,i,s){throw new Error("Method not implemented.")}get detail(){return E(this,ve,"f")}},ve=new WeakMap,gt);Object.defineProperties(vt.prototype,{detail:b});var A=Pe,Oe=vt;var y;var oi=(y=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}},y.STYLE_RULE=1,y.CHARSET_RULE=2,y.IMPORT_RULE=3,y.MEDIA_RULE=4,y.FONT_FACE_RULE=5,y.PAGE_RULE=6,y.NAMESPACE_RULE=10,y.KEYFRAMES_RULE=7,y.KEYFRAME_RULE=8,y.SUPPORTS_RULE=12,y.COUNTER_STYLE_RULE=11,y.FONT_FEATURE_VALUES_RULE=14,y.MARGIN_RULE=9,y);globalThis.Event??=A;globalThis.CustomEvent??=Oe;var He=Symbol(),bt=t=>typeof t=="boolean"?t:t?.capture??!1,R={__proto__:null};R.enumerable=!0;Object.freeze(R);var be=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,n,i){if(n==null)return;let s=bt(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(n))return;let o=typeof i=="object"&&i?i:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,n,i)),r.set(n,o??{})}removeEventListener(e,n,i){if(n==null)return;let s=bt(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(n),r.size||s.delete(e))}dispatchEvent(e){let n=this.__resolveFullEventPath();!e.composed&&this.__host&&(n=n.slice(0,n.indexOf(this.__host)));let i=!1,s=!1,r=A.NONE,o=null,d=null,c=null,h=e.stopPropagation,l=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??d},...R},srcElement:{get(){return e.target},...R},currentTarget:{get(){return c},...R},eventPhase:{get(){return r},...R},composedPath:{value:()=>n,...R},stopPropagation:{value:()=>{i=!0,h.call(e)},...R},stopImmediatePropagation:{value:()=>{s=!0,l.call(e)},...R}});let u=(p,a,f)=>{typeof p=="function"?p(e):typeof p?.handleEvent=="function"&&p.handleEvent(e),a.once&&f.delete(p)},m=()=>(c=null,r=A.NONE,!e.defaultPrevented),g=n.slice().reverse();o=!this.__host||!e.composed?this:null;let v=p=>{for(d=this;d.__host&&p.includes(d.__host);)d=d.__host};for(let p of g){!o&&(!d||d===p.__host)&&v(g.slice(g.indexOf(p))),c=p,r=p===e.target?A.AT_TARGET:A.CAPTURING_PHASE;let a=p.__captureEventListeners.get(e.type);if(a){for(let[f,T]of a)if(u(f,T,a),s)return m()}if(i)return m()}let _=e.bubbles?n:[this];d=null;for(let p of _){!o&&(!d||p===d.__host)&&v(_.slice(0,_.indexOf(p)+1)),c=p,r=p===e.target?A.AT_TARGET:A.BUBBLING_PHASE;let a=p.__eventListeners.get(e.type);if(a){for(let[f,T]of a)if(u(f,T,a),s)return m()}if(i)return m()}return m()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,yt,Ln]}};var St=new WeakMap,ee=t=>{let e=St.get(t);return e===void 0&&St.set(t,e=new Map),e},te=class extends be{getRootNode(e){return e?.composed?Ie:this.__host?.__shadowRoot??Ie}};var Et=class extends te{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var yt=new Et,Ie=yt;var _t=class extends te{constructor(e){if(super(),e!==He)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:Se,customElements:Ue,document:Ie,Document:Et,Element:Tt,EventTarget:be,HTMLElement:wt,Node:te,ShadowRoot:xt,window:this,Window:_t})}};var Tt=class extends te{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(ee(this)).map(([e,n])=>({name:e,value:n}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,n){ee(this).set(e,String(n))}removeAttribute(e){ee(this).delete(e)}toggleAttribute(e,n){if(this.hasAttribute(e)){if(n===void 0||!n)return this.removeAttribute(e),!1}else return n===void 0||n?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return ee(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let n=new xt(He,e);return n.__eventTargetParent=this,n.__host=this,this.__shadowRoot=n}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 ft(this);return this.__internals=e,e}getAttribute(e){return ee(this).get(e)??null}};var wt=class extends Tt{},De=wt;var xt=class extends te{get host(){return this.__host}constructor(e,n){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=n.mode}};globalThis.litServerRoot??=Object.defineProperty(new De,"localName",{get(){return"lit-server-root"}});function An(){let t,e;return{promise:new Promise((i,s)=>{t=i,e=s}),resolve:t,reject:e}}var Se=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,n){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(n))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(n)}`);n.__localName=e,this.__definitions.set(e,{ctor:n,observedAttributes:n.observedAttributes??[]}),this.__reverseDefinitions.set(n,e),this.__pendingWhenDefineds.get(e)?.resolve(n),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 n=this.__definitions.get(e);if(n)return n.ctor;let i=this.__pendingWhenDefineds.get(e);return i||(i=An(),this.__pendingWhenDefineds.set(e,i)),i.promise}},Rn=Se;var Ue=new Rn,Ln=new _t(He);var ne=globalThis,ye=ne.ShadowRoot&&(ne.ShadyCSS===void 0||ne.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rt=Symbol(),At=new WeakMap,Ee=class{constructor(e,n,i){if(this._$cssResult$=!0,i!==Rt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o,n=this.t;if(ye&&e===void 0){let i=n!==void 0&&n.length===1;i&&(e=At.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&At.set(n,e))}return e}toString(){return this.cssText}},Lt=t=>new Ee(typeof t=="string"?t:t+"",void 0,Rt);var Ct=(t,e)=>{if(ye)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of e){let i=document.createElement("style"),s=ne.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=n.cssText,t.appendChild(i)}},Ge=ye||ne.CSSStyleSheet===void 0?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(let i of e.cssRules)n+=i.cssText;return Lt(n)})(t):t;var{is:Cn,defineProperty:Nn,getOwnPropertyDescriptor:Mn,getOwnPropertyNames:kn,getOwnPropertySymbols:$n,getPrototypeOf:Pn}=Object,se=globalThis;se.customElements??=Ue;var Nt=se.trustedTypes,On=Nt?Nt.emptyScript:"",In=se.reactiveElementPolyfillSupport,ie=(t,e)=>t,Be={toAttribute(t,e){switch(e){case Boolean:t=t?On:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},kt=(t,e)=>!Cn(t,e),Mt={attribute:!0,type:String,converter:Be,reflect:!1,useDefault:!1,hasChanged:kt};Symbol.metadata??=Symbol("metadata"),se.litPropertyMetadata??=new WeakMap;var L=class extends(globalThis.HTMLElement??De){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Mt){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(e,i,n);s!==void 0&&Nn(this.prototype,e,s)}}static getPropertyDescriptor(e,n,i){let{get:s,set:r}=Mn(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:s,set(o){let d=s?.call(this);r?.call(this,o),this.requestUpdate(e,d,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Mt}static _$Ei(){if(this.hasOwnProperty(ie("elementProperties")))return;let e=Pn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ie("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ie("properties"))){let n=this.properties,i=[...kn(n),...$n(n)];for(let s of i)this.createProperty(s,n[s])}let e=this[Symbol.metadata];if(e!==null){let n=litPropertyMetadata.get(e);if(n!==void 0)for(let[i,s]of n)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[n,i]of this.elementProperties){let s=this._$Eu(n,i);s!==void 0&&this._$Eh.set(s,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let n=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let s of i)n.unshift(Ge(s))}else e!==void 0&&n.push(Ge(e));return n}static _$Eu(e,n){let i=n.attribute;return i===!1?void 0:typeof i=="string"?i: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,n=this.constructor.elementProperties;for(let i of n.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ct(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,n,i){this._$AK(e,i)}_$ET(e,n){let i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){let r=(i.converter?.toAttribute!==void 0?i.converter:Be).toAttribute(n,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,n){let i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let r=i.getPropertyOptions(s),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Be;this._$Em=s;let d=o.fromAttribute(n,r.type);this[s]=d??this._$Ej?.get(s)??d,this._$Em=null}}requestUpdate(e,n,i,s=!1,r){if(e!==void 0){let o=this.constructor;if(s===!1&&(r=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??kt)(r,n)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(n=void 0),this._$AL.set(e,n)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}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 i=this.constructor.elementProperties;if(i.size>0)for(let[s,r]of i){let{wrapped:o}=r,d=this[s];o!==!0||this._$AL.has(s)||d===void 0||this.C(s,void 0,r,d)}}let e=!1,n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(n)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.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(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[ie("elementProperties")]=new Map,L[ie("finalized")]=new Map,In?.({ReactiveElement:L}),(se.reactiveElementVersions??=[]).push("2.1.2");var Te=globalThis,$t=t=>t,_e=Te.trustedTypes,Pt=_e?_e.createPolicy("lit-html",{createHTML:t=>t}):void 0,Gt="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,Bt="?"+k,Hn=`<${Bt}>`,D=Te.document===void 0?{createTreeWalker:()=>({})}:document,oe=()=>D.createComment(""),ae=t=>t===null||typeof t!="object"&&typeof t!="function",qe=Array.isArray,Dn=t=>qe(t)||typeof t?.[Symbol.iterator]=="function",Fe=`[
|
|
3
|
+
\f\r]`,re=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ot=/-->/g,It=/>/g,I=RegExp(`>|${Fe}(?:([^\\s"'>=/]+)(${Fe}*=${Fe}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ht=/'/g,Dt=/"/g,Ft=/^(?:script|style|textarea|title)$/i,Ke=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),Gi=Ke(1),Bi=Ke(2),Fi=Ke(3),U=Symbol.for("lit-noChange"),S=Symbol.for("lit-nothing"),Ut=new WeakMap,H=D.createTreeWalker(D,129);function zt(t,e){if(!qe(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Pt!==void 0?Pt.createHTML(e):e}var Un=(t,e)=>{let n=t.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=re;for(let d=0;d<n;d++){let c=t[d],h,l,u=-1,m=0;for(;m<c.length&&(o.lastIndex=m,l=o.exec(c),l!==null);)m=o.lastIndex,o===re?l[1]==="!--"?o=Ot:l[1]!==void 0?o=It:l[2]!==void 0?(Ft.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=I):l[3]!==void 0&&(o=I):o===I?l[0]===">"?(o=s??re,u=-1):l[1]===void 0?u=-2:(u=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?I:l[3]==='"'?Dt:Ht):o===Dt||o===Ht?o=I:o===Ot||o===It?o=re:(o=I,s=void 0);let g=o===I&&t[d+1].startsWith("/>")?" ":"";r+=o===re?c+Hn:u>=0?(i.push(h),c.slice(0,u)+Gt+c.slice(u)+k+g):c+k+(u===-2?d:g)}return[zt(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},le=class t{constructor({strings:e,_$litType$:n},i){let s;this.parts=[];let r=0,o=0,d=e.length-1,c=this.parts,[h,l]=Un(e,n);if(this.el=t.createElement(h,i),H.currentNode=this.el.content,n===2||n===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=H.nextNode())!==null&&c.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(Gt)){let m=l[o++],g=s.getAttribute(u).split(k),v=/([.?@])?(.*)/.exec(m);c.push({type:1,index:r,name:v[2],strings:g,ctor:v[1]==="."?We:v[1]==="?"?Ve:v[1]==="@"?je:j}),s.removeAttribute(u)}else u.startsWith(k)&&(c.push({type:6,index:r}),s.removeAttribute(u));if(Ft.test(s.tagName)){let u=s.textContent.split(k),m=u.length-1;if(m>0){s.textContent=_e?_e.emptyScript:"";for(let g=0;g<m;g++)s.append(u[g],oe()),H.nextNode(),c.push({type:2,index:++r});s.append(u[m],oe())}}}else if(s.nodeType===8)if(s.data===Bt)c.push({type:2,index:r});else{let u=-1;for(;(u=s.data.indexOf(k,u+1))!==-1;)c.push({type:7,index:r}),u+=k.length-1}r++}}static createElement(e,n){let i=D.createElement("template");return i.innerHTML=e,i}};function V(t,e,n=t,i){if(e===U)return e;let s=i!==void 0?n._$Co?.[i]:n._$Cl,r=ae(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(t),s._$AT(t,n,i)),i!==void 0?(n._$Co??=[])[i]=s:n._$Cl=s),s!==void 0&&(e=V(t,s._$AS(t,e.values),s,i)),e}var ze=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:n},parts:i}=this._$AD,s=(e?.creationScope??D).importNode(n,!0);H.currentNode=s;let r=H.nextNode(),o=0,d=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new ce(r,r.nextSibling,this,e):c.type===1?h=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(h=new Ye(r,this,e)),this._$AV.push(h),c=i[++d]}o!==c?.index&&(r=H.nextNode(),o++)}return H.currentNode=D,s}p(e){let n=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,n),n+=i.strings.length-2):i._$AI(e[n])),n++}},ce=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,i,s){this.type=2,this._$AH=S,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=V(this,e,n),ae(e)?e===S||e==null||e===""?(this._$AH!==S&&this._$AR(),this._$AH=S):e!==this._$AH&&e!==U&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Dn(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!==S&&ae(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.createTextNode(e)),this._$AH=e}$(e){let{values:n,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=le.createElement(zt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(n);else{let r=new ze(s,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Ut.get(e.strings);return n===void 0&&Ut.set(e.strings,n=new le(e)),n}k(e){qe(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,s=0;for(let r of e)s===n.length?n.push(i=new t(this.O(oe()),this.O(oe()),this,this.options)):i=n[s],i._$AI(r),s++;s<n.length&&(this._$AR(i&&i._$AB.nextSibling,s),n.length=s)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let i=$t(e).nextSibling;$t(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,i,s,r){this.type=1,this._$AH=S,this._$AN=void 0,this.element=e,this.name=n,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=S}_$AI(e,n=this,i,s){let r=this.strings,o=!1;if(r===void 0)e=V(this,e,n,0),o=!ae(e)||e!==this._$AH&&e!==U,o&&(this._$AH=e);else{let d=e,c,h;for(e=r[0],c=0;c<r.length-1;c++)h=V(this,d[i+c],n,c),h===U&&(h=this._$AH[c]),o||=!ae(h)||h!==this._$AH[c],h===S?e=S:e!==S&&(e+=(h??"")+r[c+1]),this._$AH[c]=h}o&&!s&&this.j(e)}j(e){e===S?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},We=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===S?void 0:e}},Ve=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==S)}},je=class extends j{constructor(e,n,i,s,r){super(e,n,i,s,r),this.type=5}_$AI(e,n=this){if((e=V(this,e,n,0)??S)===U)return;let i=this._$AH,s=e===S&&i!==S||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==S&&(i===S||s);s&&this.element.removeEventListener(this.name,this,i),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)}},Ye=class{constructor(e,n,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){V(this,e)}};var Gn=Te.litHtmlPolyfillSupport;Gn?.(le,ce),(Te.litHtmlVersions??=[]).push("3.3.3");var Wt=(t,e,n)=>{let i=n?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=n?.renderBefore??null;i._$litPart$=s=new ce(e.insertBefore(oe(),r),r,void 0,n??{})}return s._$AI(t),s};var Xe=globalThis,$=class extends L{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 n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Wt(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return U}};$._$litElement$=!0,$.finalized=!0,Xe.litElementHydrateSupport?.({LitElement:$});var Bn=Xe.litElementPolyfillSupport;Bn?.({LitElement:$});(Xe.litElementVersions??=[]).push("4.2.2");var we={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:t=>`${t} result${t===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",onThisPage:"On this page",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:t=>`${t} active`,remove:"Remove",removeNamed:t=>`Remove ${t}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:t=>`${t}: no data`,seriesNumber:t=>`Series ${t}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(t,e)=>`Theme: ${t}. Switch to ${e}`,themeElsewhere:"set on another site"};function Ze(){return de("element-strings",()=>({values:{...we},listeners:new Set}))}function Fn(t){let e=Ze(),n={...e.values};for(let[i,s]of Object.entries(t))s!==void 0&&Object.hasOwn(we,i)&&(n[i]=s);e.values=n;for(let i of Array.from(e.listeners))i()}function Y(){let t=Ze(),e=t.values;return Object.keys(we).some(i=>e[i]===void 0)&&(t.values={...we,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))}),t.values}function Vt(t){let e=Ze().listeners;return e.add(t),()=>{e.delete(t)}}var w=class extends ${#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=Vt(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function jt(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}function C(t,e){customElements.get(t)||customElements.define(t,e)}function Yt(t,e){let n=null,i=()=>Array.from(t.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,d=null,c=-1;for(let h of i()){if(e?.(h),!h.getAttribute("href"))continue;let l;try{l=new URL(h.getAttribute("href"),location.href)}catch{continue}if(l.origin!==location.origin)continue;let u=h.getAttribute("href").trim();if(u==="#"||u.startsWith("?")||l.pathname===location.pathname&&!l.hash&&u.startsWith("#"))continue;if(l.hash&&l.pathname===location.pathname){l.hash===location.hash&&(d=h,c=1/0);continue}let m=l.pathname;(m==="/"?o==="/":o===m||o.startsWith(m.endsWith("/")?m:`${m}/`))&&m.length>c&&(d=h,c=m.length)}if(!d){n?.removeAttribute("aria-current"),n=null;return}for(let h of i())h.removeAttribute("aria-current");d.setAttribute("aria-current","page"),n=d},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(t,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(t,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var xe=class extends w{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#t=null;#n=null;constructor(){super(),this.label="",this.lg=!1}connectedCallback(){super.connectedCallback(),jt(()=>this.#s())}#s(){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.#i(),this.#n=Yt(e,n=>n.classList.add("nish-bottom-nav-item")),this.#t=pt(e,"--nish-bottom-nav-h")}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#n?.(),this.#n=null,this.#t?.(),this.#t=null}updated(e){this.#i()}#i(){this.#e&&(this.#e.setAttribute("aria-label",this.label||Y().sections),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}};C("nish-bottom-nav",xe);var qt=0,Ae=class extends w{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 n=e.target.closest("[data-dialog-open]");n&&n.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 n=e.querySelector(".nish-dialog-title"),i=e.querySelector(".nish-dialog-body");n?(n.id||(n.id=`nish-dialog-title-${++qt}`),e.setAttribute("aria-labelledby",n.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),i?(i.id||(i.id=`nish-dialog-body-${++qt}`),e.setAttribute("aria-describedby",i.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 n=this.dialog;if(n){if(e.target===n){let i=n.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&e.clientY>=i.top&&e.clientY<=i.bottom||this.close();return}if(e.target instanceof Element){let i=e.target.closest("[data-dialog-close]");i&&i.closest("dialog")===n&&this.close(i.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 n=this.opener;this.opener=null,n?.isConnected&&n.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};C("nish-dialog",Ae);var zn=0,Re=class extends w{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 n=e.target.closest("[data-sheet-open]");n&&n.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 n=e.querySelector(".nish-sheet-title");n?(n.id||(n.id=`nish-sheet-title-${++zn}`),e.setAttribute("aria-labelledby",n.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=ke(e):this.open&&e.hasAttribute("data-closing")?this.reopen=!0:!this.open&&e.open&&(this.reopen=!1,this.closeSheet?.()))}reopen=!1;onDialogClose=()=>{if(this.closeSheet=null,this.reopen){this.reopen=!1,setTimeout(()=>{this.open&&this.isConnected&&this.dialog&&!this.dialog.open&&(this.closeSheet=ke(this.dialog))},0);return}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()}};C("nish-sheet",Re);var Le=class extends w{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;#t=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#r()}updated(e){this.#e&&this.#n!==this.#i()&&this.#o()}#n="";#s(){let e=Y();return[this.labelSystem||e.themeSystem,this.labelLight||e.themeLight,this.labelDark||e.themeDark]}#i(){let e=Y();return JSON.stringify([this.labelled,this.pill,...this.#s(),e.themeToggleLabel?.("{a}","{b}"),e.themeElsewhere])}#r(){this.#t?.(),this.#t=null,this.#e?.remove(),this.#e=null}#o(){this.#r(),this.#n=this.#i();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[n,i,s]=this.#s(),r={system:n,light:i,dark:s},o=Y();this.#t=ut(e,{showLabel:this.labelled,labels:r,...o.themeToggleLabel?{strings:{themeToggleLabel:o.themeToggleLabel}}:{},...o.themeElsewhere?{elsewhereLabel:o.themeElsewhere}:{}})}};C("nish-theme-toggle",Le);export{xe as NishBottomNav,Ae as NishDialog,w as NishElement,Re as NishSheet,Le as NishThemeToggle,Fn as configureStrings,C as define,mt as toast};
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|
|
@@ -23,7 +23,7 @@ var SIZE = {
|
|
|
23
23
|
};
|
|
24
24
|
var DOT_SIZE = { xs: "xs", sm: "xs", md: "sm", lg: "sm", xl: "md" };
|
|
25
25
|
var GroupContext = /* @__PURE__ */ createContext(null);
|
|
26
|
-
function Avatar({ src, name, alt, size, shape, status, className, ref, ...rest }) {
|
|
26
|
+
function Avatar({ src, name, alt, size, shape, status, statusLabel, className, ref, ...rest }) {
|
|
27
27
|
const group = useContext(GroupContext);
|
|
28
28
|
const strings = useStrings(AVATAR_STRINGS);
|
|
29
29
|
const resolvedSize = size ?? group?.size ?? "md";
|
|
@@ -71,7 +71,7 @@ function Avatar({ src, name, alt, size, shape, status, className, ref, ...rest }
|
|
|
71
71
|
{
|
|
72
72
|
tone: status,
|
|
73
73
|
size: DOT_SIZE[resolvedSize],
|
|
74
|
-
label:
|
|
74
|
+
label: decorative ? void 0 : statusLabel || void 0,
|
|
75
75
|
className: "absolute bottom-0 end-0 ring-2 ring-th-surface forced-colors:border forced-colors:border-[ButtonText]"
|
|
76
76
|
}
|
|
77
77
|
) : null
|
|
@@ -57,7 +57,7 @@ var EdgeLegend = memo(function EdgeLegend2({
|
|
|
57
57
|
"aria-expanded": open,
|
|
58
58
|
"aria-controls": open ? panelId : void 0,
|
|
59
59
|
onClick: () => setOpen((o) => !o),
|
|
60
|
-
className: "inline-flex h-11 items-center gap-2 rounded-xl border border-th-line bg-th-surface px-3 text-sm text-th-hi shadow-pop outline-none hover:bg-th-elevated focus-visible:ring-2 focus-visible:ring-th-accent",
|
|
60
|
+
className: "inline-flex h-11 items-center gap-2 rounded-xl border border-th-line bg-th-surface px-3 text-sm text-th-hi shadow-pop outline-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-solid forced-colors:focus-visible:outline-[Highlight] hover:bg-th-elevated focus-visible:ring-2 focus-visible:ring-th-accent",
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ jsx(Svg, { children: /* @__PURE__ */ jsx("path", { d: "M3 6h18M3 12h18M3 18h18" }) }),
|
|
63
63
|
/* @__PURE__ */ jsx("span", { children: strings.canvasLines }),
|
|
@@ -65,17 +65,17 @@ var EdgeLegend = memo(function EdgeLegend2({
|
|
|
65
65
|
]
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
open ? /* @__PURE__ */ jsx("div", { id: panelId, role: "
|
|
68
|
+
open ? /* @__PURE__ */ jsx("div", { id: panelId, role: "group", "aria-label": strings.canvasLines, className: "overflow-hidden rounded-xl border border-th-line bg-th-surface shadow-pop", style: { width: "min(240px, calc(100vw - 24px))" }, children: kinds.map((k) => {
|
|
69
69
|
const on = !hidden.has(k.id);
|
|
70
70
|
return /* @__PURE__ */ jsxs(
|
|
71
71
|
"button",
|
|
72
72
|
{
|
|
73
73
|
type: "button",
|
|
74
|
-
role: "
|
|
74
|
+
role: "switch",
|
|
75
75
|
"aria-checked": on,
|
|
76
76
|
onClick: () => onToggle(k.id),
|
|
77
77
|
className: cn(
|
|
78
|
-
"flex h-11 w-full items-center gap-3 px-3 text-start text-sm outline-none hover:bg-th-elevated focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-th-accent",
|
|
78
|
+
"flex h-11 w-full items-center gap-3 px-3 text-start text-sm outline-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-solid forced-colors:focus-visible:outline-[Highlight] hover:bg-th-elevated focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-th-accent",
|
|
79
79
|
on ? "text-th-hi" : "text-th-hi3"
|
|
80
80
|
),
|
|
81
81
|
children: [
|
|
@@ -33,6 +33,18 @@ var TOP_INSET_MINIMAP = 150;
|
|
|
33
33
|
var MINIMAP_MIN_W = 600;
|
|
34
34
|
var CORNER_W = 200;
|
|
35
35
|
var initialHidden = (kinds) => new Set(kinds.filter((k) => k.hidden).map((k) => k.id));
|
|
36
|
+
var VISUALLY_HIDDEN = {
|
|
37
|
+
position: "absolute",
|
|
38
|
+
width: 1,
|
|
39
|
+
height: 1,
|
|
40
|
+
margin: -1,
|
|
41
|
+
padding: 0,
|
|
42
|
+
overflow: "hidden",
|
|
43
|
+
clip: "rect(0 0 0 0)",
|
|
44
|
+
whiteSpace: "nowrap",
|
|
45
|
+
border: 0,
|
|
46
|
+
listStyle: "none"
|
|
47
|
+
};
|
|
36
48
|
function SystemCanvas({
|
|
37
49
|
groups,
|
|
38
50
|
edges,
|
|
@@ -569,7 +581,7 @@ function SystemCanvas({
|
|
|
569
581
|
go(centerOn(w, h, v.k, box), true);
|
|
570
582
|
};
|
|
571
583
|
const onKeyDown = (e) => {
|
|
572
|
-
if (e.altKey || e.metaKey) return;
|
|
584
|
+
if (e.altKey || e.metaKey || e.ctrlKey) return;
|
|
573
585
|
if (e.target.closest("[data-canvas-ui]")) return;
|
|
574
586
|
const v = view.current;
|
|
575
587
|
switch (e.key) {
|
|
@@ -807,6 +819,17 @@ function SystemCanvas({
|
|
|
807
819
|
] }, g.id);
|
|
808
820
|
})
|
|
809
821
|
] }),
|
|
822
|
+
edgeViews.length > 0 ? /* @__PURE__ */ jsx("ul", { style: VISUALLY_HIDDEN, children: edgeViews.map(({ edge }) => {
|
|
823
|
+
const name = (id) => lookup.nodes.get(id)?.node.label ?? lookup.grps.get(id)?.title ?? id;
|
|
824
|
+
return /* @__PURE__ */ jsxs("li", { children: [
|
|
825
|
+
name(edge.from),
|
|
826
|
+
" ",
|
|
827
|
+
"\u2192",
|
|
828
|
+
" ",
|
|
829
|
+
name(edge.to),
|
|
830
|
+
edge.label ? ` (${edge.label})` : ""
|
|
831
|
+
] }, edge.id);
|
|
832
|
+
}) }) : null,
|
|
810
833
|
/* @__PURE__ */ jsx(EdgeLegend, { kinds: kindList, hidden: hiddenKinds, onToggle: toggleKind, labels }),
|
|
811
834
|
minimap ? /* @__PURE__ */ jsx(Minimap, { layout, groups, handleRef: miniRef, onJump: jumpTo }) : null,
|
|
812
835
|
/* @__PURE__ */ jsx(FollowCaption, { step, labels }),
|
|
@@ -69,9 +69,10 @@ function Carousel({
|
|
|
69
69
|
const [hovered, setHovered] = useState(false);
|
|
70
70
|
const [focusedIn, setFocusedIn] = useState(false);
|
|
71
71
|
const [hidden, setHidden] = useState(false);
|
|
72
|
+
const [offscreen, setOffscreen] = useState(false);
|
|
72
73
|
const [playState, setPlayState] = useState("auto");
|
|
73
74
|
const playing = playState === "on" || playState === "auto" && !reduced;
|
|
74
|
-
const paused = hovered || focusedIn || hidden;
|
|
75
|
+
const paused = hovered || focusedIn || hidden || offscreen;
|
|
75
76
|
const interval = Math.max(autoPlay ?? 0, CAROUSEL_MIN_INTERVAL);
|
|
76
77
|
const rotating = !!autoPlay && count > 1 && playing && !paused;
|
|
77
78
|
const setCurrent = useCallback((i) => {
|
|
@@ -83,8 +84,15 @@ function Carousel({
|
|
|
83
84
|
const scrollToSlide = useCallback((i, behavior) => {
|
|
84
85
|
viewRef.current = i;
|
|
85
86
|
targetRef.current = { index: i, at: Date.now() };
|
|
86
|
-
const
|
|
87
|
-
el
|
|
87
|
+
const track = trackRef.current;
|
|
88
|
+
const el = track?.children[i];
|
|
89
|
+
if (!track || !el) return;
|
|
90
|
+
const rtl = isRtl(track);
|
|
91
|
+
const a = el.getBoundingClientRect();
|
|
92
|
+
const b = track.getBoundingClientRect();
|
|
93
|
+
const left = rtl ? a.right - b.right : a.left - b.left;
|
|
94
|
+
if (typeof track.scrollBy === "function") track.scrollBy({ left, behavior });
|
|
95
|
+
else track.scrollLeft += left;
|
|
88
96
|
}, []);
|
|
89
97
|
const goTo = useCallback(
|
|
90
98
|
(i) => {
|
|
@@ -164,6 +172,16 @@ function Carousel({
|
|
|
164
172
|
document.addEventListener("visibilitychange", sync);
|
|
165
173
|
return () => document.removeEventListener("visibilitychange", sync);
|
|
166
174
|
}, []);
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
const track = trackRef.current;
|
|
177
|
+
if (!track || typeof IntersectionObserver === "undefined") return;
|
|
178
|
+
const io = new IntersectionObserver((entries) => {
|
|
179
|
+
const last = entries[entries.length - 1];
|
|
180
|
+
if (last) setOffscreen(!last.isIntersecting);
|
|
181
|
+
});
|
|
182
|
+
io.observe(track);
|
|
183
|
+
return () => io.disconnect();
|
|
184
|
+
}, []);
|
|
167
185
|
useEffect(() => {
|
|
168
186
|
if (!rotating) return;
|
|
169
187
|
const id = setTimeout(() => goToRef.current(index === count - 1 ? 0 : index + 1), interval);
|
|
@@ -150,6 +150,7 @@ function LineChart({
|
|
|
150
150
|
const yLabels = scale ? ticksBetween(scale.yMin, scale.yMax, yTicks).map((v) => ({ v, text: yFmt(v) })) : [];
|
|
151
151
|
const padLeft = Math.ceil(Math.max(0, ...yLabels.map((l) => l.text.length)) * 6.6) + 10;
|
|
152
152
|
const plotW = Math.max(0, width - padLeft - PAD_RIGHT);
|
|
153
|
+
const plotX = rtl ? PAD_RIGHT : padLeft;
|
|
153
154
|
const plotH = Math.max(0, height - PAD_TOP - PAD_BOTTOM);
|
|
154
155
|
const paths = useMemo(() => {
|
|
155
156
|
if (!scale) return [];
|
|
@@ -157,11 +158,11 @@ function LineChart({
|
|
|
157
158
|
return runs.map(
|
|
158
159
|
(segs) => segs.map(
|
|
159
160
|
(seg) => decimateMinMax(seg, scale.xMin, scale.xMax, plotW).map(
|
|
160
|
-
(p) => `${xPos(p.x, scale.xMin, scale.xMax,
|
|
161
|
+
(p) => `${xPos(p.x, scale.xMin, scale.xMax, plotX, plotW, rtl).toFixed(1)},${sy2(p.y).toFixed(1)}`
|
|
161
162
|
)
|
|
162
163
|
)
|
|
163
164
|
);
|
|
164
|
-
}, [runs, scale, plotW, plotH,
|
|
165
|
+
}, [runs, scale, plotW, plotH, plotX, rtl]);
|
|
165
166
|
if (loading) return /* @__PURE__ */ jsx(Skeleton, { className: cn("w-full rounded-xl", className), style: { height } });
|
|
166
167
|
if (!scale) {
|
|
167
168
|
return /* @__PURE__ */ jsx(
|
|
@@ -177,13 +178,13 @@ function LineChart({
|
|
|
177
178
|
}
|
|
178
179
|
);
|
|
179
180
|
}
|
|
180
|
-
const sx = (x) => xPos(x, scale.xMin, scale.xMax,
|
|
181
|
+
const sx = (x) => xPos(x, scale.xMin, scale.xMax, plotX, plotW, rtl);
|
|
181
182
|
const sy = (y) => PAD_TOP + (1 - (y - scale.yMin) / (scale.yMax - scale.yMin)) * plotH;
|
|
182
183
|
const bottom = PAD_TOP + plotH;
|
|
183
184
|
const xLabels = ticksBetween(scale.xMin, scale.xMax, Math.min(xTicks, Math.max(2, Math.floor(plotW / 72))));
|
|
184
185
|
const moveTo = (clientX, el) => {
|
|
185
186
|
const rect = el.getBoundingClientRect();
|
|
186
|
-
const f = (clientX - rect.left -
|
|
187
|
+
const f = (clientX - rect.left - plotX) / (plotW || 1);
|
|
187
188
|
const x = scale.xMin + (rtl ? 1 - f : f) * (scale.xMax - scale.xMin);
|
|
188
189
|
let lo = 0;
|
|
189
190
|
let hi = xs.length - 1;
|
|
@@ -220,7 +221,7 @@ function LineChart({
|
|
|
220
221
|
role: "img",
|
|
221
222
|
tabIndex: 0,
|
|
222
223
|
"aria-label": label,
|
|
223
|
-
className: "block rounded-md outline-none focus-visible:ring-2 focus-visible:ring-th-accent",
|
|
224
|
+
className: "block rounded-md outline-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-solid forced-colors:focus-visible:outline-[Highlight] focus-visible:ring-2 focus-visible:ring-th-accent",
|
|
224
225
|
style: { touchAction: "pan-y" },
|
|
225
226
|
onPointerDown: onPointer,
|
|
226
227
|
onPointerMove: onPointer,
|
|
@@ -237,11 +238,11 @@ function LineChart({
|
|
|
237
238
|
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: toneColor(lines[0].tone, 0), stopOpacity: 0 })
|
|
238
239
|
] }) }),
|
|
239
240
|
yLabels.map((l, i) => /* @__PURE__ */ jsxs("g", { children: [
|
|
240
|
-
/* @__PURE__ */ jsx("line", { x1:
|
|
241
|
+
/* @__PURE__ */ jsx("line", { x1: plotX, x2: plotX + plotW, y1: sy(l.v), y2: sy(l.v), stroke: CHART.grid, strokeWidth: 1 }),
|
|
241
242
|
/* @__PURE__ */ jsx(
|
|
242
243
|
"text",
|
|
243
244
|
{
|
|
244
|
-
x: rtl ?
|
|
245
|
+
x: rtl ? plotX + plotW + 6 : plotX - 6,
|
|
245
246
|
y: sy(l.v),
|
|
246
247
|
textAnchor: rtl ? "start" : "end",
|
|
247
248
|
dominantBaseline: "middle",
|
|
@@ -265,7 +266,7 @@ function LineChart({
|
|
|
265
266
|
},
|
|
266
267
|
i
|
|
267
268
|
)),
|
|
268
|
-
baseline != null && Number.isFinite(baseline) && /* @__PURE__ */ jsx("line", { x1:
|
|
269
|
+
baseline != null && Number.isFinite(baseline) && /* @__PURE__ */ jsx("line", { x1: plotX, x2: plotX + plotW, y1: sy(baseline), y2: sy(baseline), stroke: CHART.zero, strokeWidth: 1, strokeDasharray: "4 4" }),
|
|
269
270
|
area && paths[0]?.map((seg, i) => /* @__PURE__ */ jsx("polygon", { points: `${seg[0].split(",")[0]},${bottom} ${seg.join(" ")} ${seg[seg.length - 1].split(",")[0]},${bottom}`, fill: `url(#${gradId})` }, i)),
|
|
270
271
|
paths.map(
|
|
271
272
|
(segs, si) => segs.map(
|
|
@@ -282,8 +283,14 @@ function LineChart({
|
|
|
282
283
|
ax != null && width > 0 && /* @__PURE__ */ jsxs(
|
|
283
284
|
"div",
|
|
284
285
|
{
|
|
285
|
-
|
|
286
|
-
|
|
286
|
+
ref: (el) => {
|
|
287
|
+
if (!el) return;
|
|
288
|
+
const w = el.offsetWidth;
|
|
289
|
+
if (tipRight) el.style.left = `${Math.max(0, Math.min(cx + 10, width - w))}px`;
|
|
290
|
+
else el.style.right = `${Math.max(0, Math.min(width - cx + 10, width - w))}px`;
|
|
291
|
+
},
|
|
292
|
+
className: "pointer-events-none absolute top-1 z-[var(--nish-z-tooltip,10)] overflow-hidden whitespace-nowrap px-2 py-1 tabular-nums",
|
|
293
|
+
style: { ...tooltipStyle, maxWidth: "calc(100% - 8px)", ...tipRight ? { left: cx + 10 } : { right: width - cx + 10 } },
|
|
287
294
|
children: [
|
|
288
295
|
/* @__PURE__ */ jsx("div", { className: "text-th-hi3", children: xFmt(ax) }),
|
|
289
296
|
tipRows.map((r) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
@@ -330,7 +337,8 @@ function BarChart({
|
|
|
330
337
|
const [wrapRef, width, wrapEl] = useWidth();
|
|
331
338
|
const rtl = useChartRtl(wrapEl);
|
|
332
339
|
const coarse = useMediaQuery("(pointer: coarse)");
|
|
333
|
-
const [
|
|
340
|
+
const [pickedBar, setSelected] = useState(null);
|
|
341
|
+
const selected = pickedBar != null && pickedBar < data.length ? pickedBar : null;
|
|
334
342
|
const color = toneColor(tone, 0);
|
|
335
343
|
const pick = useCallback(
|
|
336
344
|
(clientX, el) => {
|
|
@@ -369,7 +377,7 @@ function BarChart({
|
|
|
369
377
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
370
378
|
e.preventDefault();
|
|
371
379
|
const dir = (e.key === "ArrowRight" ? 1 : -1) * (rtl ? -1 : 1);
|
|
372
|
-
setSelected((
|
|
380
|
+
setSelected(() => selected == null ? dir > 0 ? 0 : data.length - 1 : Math.min(data.length - 1, Math.max(0, selected + dir)));
|
|
373
381
|
} else if (e.key === "Escape") setSelected(null);
|
|
374
382
|
};
|
|
375
383
|
return /* @__PURE__ */ jsxs("div", { ...rest, ref: mergeRefs(wrapRef, ref), className: cn("w-full", className), children: [
|
|
@@ -381,7 +389,7 @@ function BarChart({
|
|
|
381
389
|
role: "img",
|
|
382
390
|
tabIndex: 0,
|
|
383
391
|
"aria-label": label,
|
|
384
|
-
className: "block rounded-md outline-none focus-visible:ring-2 focus-visible:ring-th-accent",
|
|
392
|
+
className: "block rounded-md outline-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-solid forced-colors:focus-visible:outline-[Highlight] focus-visible:ring-2 focus-visible:ring-th-accent",
|
|
385
393
|
style: { touchAction: "pan-y" },
|
|
386
394
|
onPointerDown: (e) => pick(e.clientX, e.currentTarget),
|
|
387
395
|
onPointerMove: (e) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/components/data-classes.ts
|
|
2
|
+
import { shared } from "../runtime.js";
|
|
2
3
|
var ALIGN = { left: "text-start", center: "text-center", right: "text-end" };
|
|
3
4
|
var ROW_TONE = {
|
|
4
5
|
ok: "[&>td:first-child]:shadow-[inset_3px_0_0_var(--nish-ok-fill)] [&>th:first-child]:shadow-[inset_3px_0_0_var(--nish-ok-fill)] rtl:[&>td:first-child]:shadow-[inset_-3px_0_0_var(--nish-ok-fill)] rtl:[&>th:first-child]:shadow-[inset_-3px_0_0_var(--nish-ok-fill)] forced-colors:[&>td:first-child]:border-s-[3px] forced-colors:[&>td:first-child]:border-s-[color:Highlight]",
|
|
@@ -15,7 +16,7 @@ var PAD = { normal: "py-2.5", dense: "py-1.5" };
|
|
|
15
16
|
var TR = "border-b border-th-line last:border-b-0";
|
|
16
17
|
var TR_INTERACTIVE = "cursor-pointer transition-colors hover:bg-th-elevated focus-within:bg-th-elevated";
|
|
17
18
|
var NUMERIC = "whitespace-nowrap text-end tabular-nums";
|
|
18
|
-
var STICKY_COL = "[&_thead_tr]:bg-th-surface [&_tbody_tr]:bg-th-surface [&_tr>:first-child]:sticky [&_tr>:first-child]:start-0 [&_tr>:first-child]:z-[calc(var(--nish-z-sticky,1)+9)] [&_tr>:first-child]:bg-inherit [&_tr>:first-child]:after:pointer-events-none [&_tr>:first-child]:after:absolute [&_tr>:first-child]:after:inset-y-0 [&_tr>:first-child]:after:start-full [&_tr>:first-child]:after:w-2.5 [&_tr>:first-child]:after:bg-gradient-to-r rtl:[&_tr>:first-child]:after:bg-gradient-to-l [&_tr>:first-child]:after:from-[color-mix(in_srgb,var(--nish-hi)_14%,transparent)] [&_tr>:first-child]:after:to-transparent [&_tr>:first-child]:after:opacity-0 [&_tr>:first-child]:after:transition-opacity [&[data-at-start=false]_tr>:first-child]:after:opacity-100";
|
|
19
|
+
var STICKY_COL = "[&_thead_tr]:bg-th-surface [&_tbody_tr]:bg-th-surface [&_thead_tr>:first-child]:z-[calc(var(--nish-z-sticky,1)+10)] [&_tr>:first-child]:sticky [&_tr>:first-child]:start-0 [&_tr>:first-child]:z-[calc(var(--nish-z-sticky,1)+9)] [&_tr>:first-child]:bg-inherit [&_tr>:first-child]:after:pointer-events-none [&_tr>:first-child]:after:absolute [&_tr>:first-child]:after:inset-y-0 [&_tr>:first-child]:after:start-full [&_tr>:first-child]:after:w-2.5 [&_tr>:first-child]:after:bg-gradient-to-r rtl:[&_tr>:first-child]:after:bg-gradient-to-l [&_tr>:first-child]:after:from-[color-mix(in_srgb,var(--nish-hi)_14%,transparent)] [&_tr>:first-child]:after:to-transparent [&_tr>:first-child]:after:opacity-0 [&_tr>:first-child]:after:transition-opacity ltr:[&[data-at-start=false]_tr>:first-child]:after:opacity-100 rtl:[&[data-at-end=false]_tr>:first-child]:after:opacity-100";
|
|
19
20
|
var tableClass = {
|
|
20
21
|
/** The scroll box around the table. */
|
|
21
22
|
wrap: WRAP,
|
|
@@ -71,12 +72,12 @@ function sortRows(rows, get, dir) {
|
|
|
71
72
|
return keyed.map((k) => k.row);
|
|
72
73
|
}
|
|
73
74
|
var googleFavicon = (host, size) => `https://www.google.com/s2/favicons?sz=${size * 2 > 32 ? 64 : 32}&domain=${encodeURIComponent(host)}`;
|
|
74
|
-
var
|
|
75
|
+
var favicons = () => shared("favicons", () => ({ resolve: (() => null) }));
|
|
75
76
|
function configureFavicons(options) {
|
|
76
|
-
|
|
77
|
+
favicons().resolve = options.resolve ?? (() => null);
|
|
77
78
|
}
|
|
78
79
|
function getFaviconResolver() {
|
|
79
|
-
return
|
|
80
|
+
return favicons().resolve;
|
|
80
81
|
}
|
|
81
82
|
var FAVICON_HUES = 8;
|
|
82
83
|
function hashString(s) {
|