nish-ui 2.2.0 → 3.0.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 -1
- package/dist/chart.js +1 -1
- package/dist/elements-all.js +58 -58
- package/dist/elements-charts.js +1 -1
- package/dist/elements-data.js +1 -1
- package/dist/elements-forms.js +1 -1
- package/dist/elements.js +4 -4
- package/dist/esm/components/accordion.js +3 -2
- package/dist/esm/components/app-shell.js +3 -2
- package/dist/esm/components/avatar.js +4 -3
- package/dist/esm/components/breadcrumbs.js +3 -2
- package/dist/esm/components/calendar-base.js +4 -3
- package/dist/esm/components/canvas/legend.js +3 -2
- package/dist/esm/components/canvas/node.js +3 -2
- package/dist/esm/components/canvas/system-canvas.js +3 -2
- package/dist/esm/components/carousel.js +3 -2
- package/dist/esm/components/charts.js +8 -7
- package/dist/esm/components/combobox.js +3 -2
- package/dist/esm/components/command.js +4 -3
- package/dist/esm/components/context-menu.js +3 -2
- package/dist/esm/components/data.js +4 -3
- package/dist/esm/components/date-picker.js +4 -3
- package/dist/esm/components/date-range-picker.js +4 -3
- package/dist/esm/components/display.js +7 -6
- package/dist/esm/components/drawer.js +3 -2
- package/dist/esm/components/error-boundary.js +4 -2
- package/dist/esm/components/feedback.js +7 -6
- package/dist/esm/components/file-dropzone.js +3 -2
- package/dist/esm/components/filters.js +4 -3
- package/dist/esm/components/flow.js +6 -5
- package/dist/esm/components/forms.js +13 -8
- package/dist/esm/components/hooks.js +2 -2
- package/dist/esm/components/hover-card.js +2 -2
- package/dist/esm/components/inbox.js +4 -2
- package/dist/esm/components/layout.js +5 -4
- package/dist/esm/components/media.js +3 -2
- package/dist/esm/components/menu.js +5 -4
- package/dist/esm/components/modal.js +4 -3
- package/dist/esm/components/more-sheet.js +3 -2
- package/dist/esm/components/multi-select.js +3 -2
- package/dist/esm/components/nav-items.js +4 -3
- package/dist/esm/components/nav.js +5 -4
- package/dist/esm/components/overlay-dialog.js +3 -2
- package/dist/esm/components/pagination.js +3 -2
- package/dist/esm/components/popover.js +2 -2
- package/dist/esm/components/portal.js +2 -2
- package/dist/esm/components/progress.js +3 -2
- package/dist/esm/components/provider.js +34 -5
- package/dist/esm/components/range-calendar.js +4 -3
- package/dist/esm/components/service-tokens.js +4 -3
- package/dist/esm/components/settings.js +4 -3
- package/dist/esm/components/slider.js +3 -2
- package/dist/esm/components/split.js +4 -3
- package/dist/esm/components/strings.js +174 -65
- package/dist/esm/components/tag-input.js +3 -2
- package/dist/esm/components/theme-toggle.js +3 -2
- package/dist/esm/components/time-field.js +4 -3
- package/dist/esm/components/toast-card.js +155 -0
- package/dist/esm/components/toast-store.js +136 -0
- package/dist/esm/components/toast.js +38 -241
- package/dist/esm/components/tooltip.js +2 -2
- package/dist/esm/components/virtual-table.js +3 -2
- package/dist/esm/index.js +0 -20
- package/dist/esm/runtime.js +1 -1
- package/dist/esm/system-canvas.js +4 -0
- package/dist/esm/theme.js +7 -7
- package/dist/format.js +1 -1
- package/dist/index.d.ts +11 -14
- package/dist/system-canvas.d.ts +183 -2
- package/dist/theme.d.ts +3 -3
- package/dist/theme.global.js +21 -145
- package/dist/theme.js +21 -145
- package/package.json +1 -1
- package/dist/system-canvas-BLuWd69H.d.ts +0 -183
package/dist/elements-all.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Qn=["emerald","indigo","amber","lime","rose","sky","violet","teal"],Ur=["accent","ok","loss","warn","info",...Qn],ce={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},Zn={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},es=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],ts=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],ie=i=>Object.fromEntries(i.map((e,t)=>[`chart-${t+1}`,e])),is={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",...ie(es),...ce}},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",...ie(ts),...Zn}},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",...ie(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...ce,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",...ie(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...ce}},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",...ie(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...ce,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",...ie(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...ce}},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",...ie(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...ce}}},ns=i=>{let e=i.colors,t=Object.fromEntries(["ok","loss","warn","info"].flatMap(n=>[[`${n}-fill`,e[`${n}-fill`]??e[n]],[`on-${n}`,e[`on-${n}`]??e["on-accent"]]]));return{...i,colors:{...e,...t,"on-accent2":e["on-accent2"]??e["on-accent"]}}},he=Object.fromEntries(Object.entries(is).map(([i,e])=>[i,ns(e)])),ui="dark";var ss="2.2.0";var rs=Symbol.for("nish-ui.runtime.v1");function os(){let i=globalThis;return i[rs]??={versions:new Set,slots:{}}}function as(i){i.versions.add(ss),i.versions.size>1&&!i.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(i.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...i.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var mi=!1;function de(i,e){let t=os();return mi||(mi=!0,as(t)),i in t.slots||(t.slots[i]=e()),t.slots[i]}function Ee(i){if(i==null)return null;let e=String(i),t=0,n=e.length;for(;t<n&&e.charCodeAt(t)<=32;)t++;for(;n>t&&e.charCodeAt(n-1)<=32;)n--;let s=e.slice(t,n).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 ue={close:"Close",cancel:"Cancel",menu:"Menu",back:"Back: ",contextMenu:"Actions",sortAnnounce:(i,e)=>e?`Sorted by ${i}, ${e==="asc"?"ascending":"descending"}`:"Sorting cleared",dismiss:"Dismiss",moreCount:i=>`${i} more`,copy:"Copy",copied:"Copied",hubTitle:"Back to nish.software",hubLabel:"\u2190 nish.software",moreActions:"More actions",more:"More",legend:"Legend",optional:"Optional",search:"Search",clearSearch:"Clear search",remove:"Remove",removeNamed:i=>`Remove ${i}`,noMatches:"No matches",clear:"Clear",searching:"Searching\u2026",invalidDate:"Enter a valid date.",chooseDate:"Choose date",changeDate:i=>`Change date, ${i}`,previousMonth:"Previous month",nextMonth:"Next month",month:"Month",year:"Year",dayToken:"DD",monthToken:"MM",yearToken:"YYYY",chooseDates:"Choose dates",changeDates:i=>`Change dates, ${i}`,dateRange:(i,e)=>`${i} to ${e}`,rangeStarted:i=>`Start date ${i}. Pick the end date.`,invalidDateRange:"Enter a valid date range.",hour:"Hour",minute:"Minute",dayPeriod:"AM/PM",invalidTime:"Enter a valid time.",optionAdded:i=>`Added ${i}`,optionRemoved:i=>`Removed ${i}`,clearAll:"Clear all",maxSelected:i=>`You can pick up to ${i}`,carouselRole:"carousel",slideRole:"slide",slideLabel:(i,e)=>`${i} of ${e}`,previousSlide:"Previous slide",nextSlide:"Next slide",goToSlide:i=>`Go to slide ${i}`,slidePicker:"Choose slide",startRotation:"Start slide rotation",stopRotation:"Stop slide rotation",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",loading:"Loading",failedToLoad:"Failed to load",retry:"Retry",actions:"Actions",offline:"You're offline",nothingHere:"Nothing here yet",loadingNamed:i=>`Loading ${i}`,sortBy:"Sort by",sortDefault:"Default",noData:"No data",noDataNamed:i=>`${i}: no data`,filters:"Filters",clearFilters:"Clear filters",done:"Done",activeCount:i=>`${i} active`,newCount:i=>`${i} new`,sections:"Sections",theme:"Theme",sidebar:"Sidebar",expandSidebar:"Expand sidebar",collapseSidebar:"Collapse sidebar",skipToContent:"Skip to content",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(i,e)=>`Theme: ${i}. Switch to ${e}`,themePreset:"Theme preset",themePresetPlaceholder:"Preset\u2026",errorStaleTitle:"A new version is available",errorStaleBody:"Reload the page to get the latest version.",errorTitle:"Something went wrong",errorBody:"An unexpected error occurred.",errorDetails:"Details",errorTryAgain:"Try again",errorReload:"Reload page",saving:"Saving\u2026",saved:"Saved",saveFailed:"Could not save",enterNumber:"Enter a number",resizeColumns:"Resize columns",resizeRows:"Resize rows",layoutPresets:"Layout presets",live:"Live",offlineBadge:"Offline",progress:"Progress",workflow:"Workflow",activity:"Activity",other:"Other",waiting:"Waiting",noActivity:"No activity yet",systemMap:"System map",zoomOut:"Zoom out",zoomIn:"Zoom in",fitToScreen:"Fit to screen",followActivity:"Follow activity",canvasLines:"Lines",serviceTokens:"Service tokens",serviceTokensIntro:"Machine clients, like the nish MCP server, use these tokens to read this app. Revoking one stops it at once.",loadingServiceTokens:"Loading service tokens",tokenRevoke:"Revoke",tokenRevoked:"Revoked",tokenRevokedAt:i=>`Revoked ${i}`,tokenRevokeNamed:i=>`Revoke ${i}`,tokenRevokeTitle:i=>`Revoke ${i}?`,tokenRevokeFailed:"Could not revoke the token.",inboxMarkHandled:"Mark handled",inboxSnooze:"Snooze",inboxActions:"Actions",inboxViews:"Inbox views",inboxOpen:"Open",inboxSnoozed:"Snoozed",inboxHandled:"Handled",inboxFilterBySource:"Filter by source",inboxHappened:i=>`Happened ${i} times`,previousPage:"Previous page",nextPage:"Next page",pageLabel:i=>`Page ${i}`,paginationLabel:"Pagination",breadcrumbs:"Breadcrumbs",removeTag:i=>`Remove ${i}`,dropzoneLabel:"Drop files here or browse",browseFiles:"Browse files",removeFile:i=>`Remove ${i}`,avatar:"Avatar",avatarMore:i=>`${i} more`,sliderMin:"Minimum",sliderMax:"Maximum",accordion:"Accordion",progressIndeterminate:"Loading"};var pi="nish-theme",fi="nish.software",ls=3600*24*365,me=()=>de("theme",()=>({extra:{},listeners:new Set,watching:!1,switchId:0})),cs=i=>{globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: ${i}`)};function qe(){if(typeof document>"u")return pi;let i=document.documentElement.getAttribute("data-nish-storage-key");return i&&/^[A-Za-z0-9_-]+$/.test(i)?i:pi}var we=(i,e)=>Object.prototype.hasOwnProperty.call(i,e);function Nt(i){return typeof i=="string"&&(we(he,i)||we(me().extra,i))}function hs(){if(typeof document>"u")return null;try{let i=document.cookie.match(new RegExp(`(?:^|;\\s*)${qe()}=([a-z0-9-]+)`));return i?i[1]:null}catch{return null}}var bi=(i,e)=>e===i||e.endsWith("."+i);function ds(i,e){let t=i.toLowerCase(),n=(e??"").trim().toLowerCase().replace(/^\./,"");return n?bi(n,t)?n:null:bi(fi,t)?fi:null}function us(){return typeof location>"u"||typeof document>"u"?null:ds(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function pe(){let i=null;try{i=hs()??localStorage.getItem(qe())}catch{}return i==="system"||Nt(i)?i:"system"}function ms(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":ui}function ps(){let i=document.documentElement.getAttribute("data-nish-themes");return i?i.split(/\s+/).filter(Nt):null}function xi(i=pe()){let e=i==="system"?ms():i,t=typeof document>"u"?null:ps();return t&&!t.includes(e)&&(e=Ve(e)),e}function Ve(i){let{extra:e}=me();return we(he,i)?he[i].scheme:we(e,i)?e[i]:"dark"}function wi(i=pe()){let e=xi(i),t=document.documentElement,n=t.getAttribute("data-theme");return n&&n!==e&&fs(t),t.setAttribute("data-theme",e),t.setAttribute("data-scheme",Ve(e)),t.setAttribute("data-theme-choice",i),t.style.colorScheme=Ve(e),vs(),me().listeners.forEach(s=>s(i,e)),e}function fs(i){let e=me(),t=++e.switchId;i.setAttribute("data-nish-theme-switching","");let n=()=>{e.switchId===t&&i.removeAttribute("data-nish-theme-switching")};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>requestAnimationFrame(n)):setTimeout(n,32)}function bs(i){if(i!=="system"&&!Nt(i))return cs(`unknown theme "${String(i)}" ignored. Register it with registerThemes() first.`),xi(pe());let e=qe();try{localStorage.setItem(e,i)}catch{}try{let t=us();if(t){let n=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${i}; Domain=.${t}; Path=/; Max-Age=${ls}; SameSite=Lax${n}`}}catch{}return wi(i)}function gs(i){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${i}`).trim()}function vs(){let i=gs("bg");if(!i)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=i}function ys(){let i=me();if(i.watching||typeof window>"u")return;i.watching=!0;let e=()=>{let t=pe();(t!==document.documentElement.getAttribute("data-theme-choice")||t==="system")&&wi(t)};typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").addEventListener("change",e),window.addEventListener("storage",t=>{t.key===qe()&&e()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function Es(i){ys();let{listeners:e}=me();return e.add(i),()=>{e.delete(i)}}var Ue=["system","light","dark"];function xs(){let i=Si(pe());return bs(i),i}var gi="http://www.w3.org/2000/svg";function $t(i,e,t={}){let n=document.createElementNS(gi,"svg"),s={width:String(i),height:String(i),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false",...t};for(let r of Object.keys(s))n.setAttribute(r,s[r]);for(let[r,o]of e){let l=document.createElementNS(gi,r);for(let a of Object.keys(o))l.setAttribute(a,o[a]);n.appendChild(l)}return n}var vi={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"}]]},ws=()=>({system:ue.themeSystem,light:ue.themeLight,dark:ue.themeDark}),Ss="set on another site";function Si(i){let e=Ue.indexOf(i);return Ue[(e+1)%Ue.length]}function _t(i,e){return i==="system"||i==="light"||i==="dark"?e[i]:we(he,i)?he[i].label:i.charAt(0).toUpperCase()+i.slice(1)}function Ti(i,e={}){let t={...ws(),...e.labels},n=e.strings?.themeToggleLabel??ue.themeToggleLabel,s=e.elsewhereLabel??Ss;i.tagName==="BUTTON"&&!i.getAttribute("type")&&i.setAttribute("type","button");let r=Object.keys(vi).map(c=>$t(16,vi[c],{"data-icon":c}));if(e.showLabel){let c=document.createElement("span");c.setAttribute("data-theme-word",""),c.setAttribute("aria-hidden","true"),r.push(c)}i.replaceChildren(...r);let o=i.querySelector("[data-theme-word]"),l=c=>{let d=c==="system"||c==="light"||c==="dark"?c:Ve(c);i.setAttribute("data-choice",c),i.querySelectorAll("svg[data-icon]").forEach(m=>{m.getAttribute("data-icon")===d?m.removeAttribute("display"):m.setAttribute("display","none")});let u=Ue.includes(c)?"":` (${s})`,b=n(`${_t(c,t)}${u}`,_t(Si(c),t));i.setAttribute("aria-label",b),i.setAttribute("title",b),o&&(o.textContent=_t(c,t))},a=()=>{xs()};i.addEventListener("click",a);let h=Es(c=>l(c));return l(pe()),()=>{i.removeEventListener("click",a),h()}}var yi=[["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"}]],Ei=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4M12 8h.01"}]],Ts={neutral:Ei,info:Ei,ok:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]],warn:yi,loss:yi},Ls=6e3,K=null,xe=null;function Li(i,e={}){xe?.(),(!K||!K.isConnected)&&(K=document.createElement("div"),K.setAttribute("role","status"),K.setAttribute("aria-live","polite"),K.className="nish-toast-region",document.body.appendChild(K));let t=K,n=document.createElement("div");n.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($t(15,Ts[e.tone??"neutral"])),n.append(s);let r=document.createElement("p");r.className="nish-toast-body",r.append(typeof i=="string"?document.createTextNode(i):i),n.append(r);let o=null,l=e.duration==="sticky"?1/0:e.duration??Ls,a=0,h=0,c=()=>{o!=null&&clearTimeout(o),o=null,n.remove(),xe===c&&(xe=null)},d=p=>{Number.isFinite(p)&&(a=Date.now(),o=setTimeout(c,p))},u=()=>{h+=1,!(h>1||o==null)&&(clearTimeout(o),o=null,l=Math.max(0,l-(Date.now()-a)))},b=()=>{h!==0&&(h-=1,h===0&&d(Math.max(l,1e3)))},m=e.action,w=m?.href!=null?Ee(m.href):null;if(m&&(m.href==null||w!=null)){let p=document.createElement(m.href!=null?"a":"button");p.className="nish-toast-action",p.textContent=m.label,w!=null?p.href=w:p.type="button",p.addEventListener("click",()=>{m.onClick?.(),c()}),n.append(p)}let g=document.createElement("button");return g.type="button",g.className="nish-toast-close",g.setAttribute("aria-label",e.dismissLabel??e.strings?.dismiss??ue.dismiss),g.append($t(14,[["path",{d:"M18 6 6 18M6 6l12 12"}]])),g.addEventListener("click",c),n.append(g),n.addEventListener("pointerenter",p=>p.pointerType==="mouse"&&u()),n.addEventListener("pointerleave",p=>p.pointerType==="mouse"&&b()),n.addEventListener("focusin",p=>!n.contains(p.relatedTarget)&&u()),n.addEventListener("focusout",p=>!n.contains(p.relatedTarget)&&b()),n.addEventListener("keydown",p=>{p.key==="Escape"&&c()}),setTimeout(()=>{xe===c&&(t.append(n),d(l))},50),xe=c,c}var As=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function Ai(i){if(typeof document>"u")return()=>{};let e=!1,t=!1;if(i.open)return()=>s();let n=document.activeElement instanceof HTMLElement?document.activeElement:null;function s(){if(e||!i.open)return;e=!0;let p,S=()=>{i.removeEventListener("animationend",v),p!==void 0&&clearTimeout(p),i.removeAttribute("data-closing"),i.style.transform="",i.style.transition="",e=!1,i.open&&i.close()},v=H=>{H.target===i&&S()};if(As()){S();return}i.style.transform="",i.setAttribute("data-closing",""),i.addEventListener("animationend",v),p=setTimeout(S,260)}let r=p=>{p.preventDefault(),s()},o=p=>{p.key==="Escape"&&p.stopPropagation()},l=p=>{if(p.target===i){let S=i.getBoundingClientRect();p.clientX>=S.left&&p.clientX<=S.right&&p.clientY>=S.top&&p.clientY<=S.bottom||s();return}p.target instanceof Element&&p.target.closest("[data-sheet-close]")&&s()},a=0,h=0,c=0,d=0,u=1,b=p=>{if(p.pointerType==="mouse"||e||!p.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let S=i.getBoundingClientRect();!(p.target instanceof Element&&p.target.closest(".nish-sheet-header")!=null)&&p.clientY-S.top>28||(t=!0,a=h=p.clientY,c=p.timeStamp,d=0,u=S.height||1,i.style.transition="none",i.setPointerCapture?.(p.pointerId))},m=p=>{if(!t)return;let S=p.clientY-a,v=p.timeStamp-c;v>0&&(d=(p.clientY-h)/v),h=p.clientY,c=p.timeStamp,i.style.transform=`translateY(${S>=0?S:S*.3}px)`},w=p=>{if(!t)return;t=!1,i.releasePointerCapture?.(p.pointerId);let S=p.clientY-a;if(p.type!=="pointercancel"&&(S>u*.3||d>.5)){s();return}i.style.transition="transform 180ms var(--nish-ease-out, ease-out)",i.style.transform="",setTimeout(()=>{e||(i.style.transition="")},200)},g=()=>{i.removeEventListener("cancel",r),i.removeEventListener("keydown",o),i.removeEventListener("click",l),i.removeEventListener("pointerdown",b),i.removeEventListener("pointermove",m),i.removeEventListener("pointerup",w),i.removeEventListener("pointercancel",w),i.removeEventListener("close",g),n?.isConnected&&n.focus()};return i.addEventListener("cancel",r),i.addEventListener("keydown",o),i.addEventListener("click",l),i.addEventListener("pointerdown",b),i.addEventListener("pointermove",m),i.addEventListener("pointerup",w),i.addEventListener("pointercancel",w),i.addEventListener("close",g),i.showModal(),s}function Rt(i,e){if(typeof document>"u")return()=>{};let t=document.documentElement,n=()=>{let r=i.offsetHeight;r>0?t.style.setProperty(e,`${r}px`):t.style.removeProperty(e)};n();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(n),s.observe(i)):window.addEventListener("resize",n),()=>{s?.disconnect(),window.removeEventListener("resize",n),t.style.removeProperty(e)}}function Ci(i,e={}){if(typeof document>"u")return()=>{};let t=Array.from(i.querySelectorAll('a[href^="#"]')).filter(m=>m.hash.length>1),n=m=>{try{return document.getElementById(decodeURIComponent(m.hash.slice(1)))}catch{return null}},s=e.height===!1?()=>{}:Rt(i,"--nish-sticky-extra"),r=null,o=()=>{let m=i.scrollWidth-i.clientWidth;i.dataset.atStart=String(i.scrollLeft<=1),i.dataset.atEnd=String(m<=1||i.scrollLeft>=m-1)},l=m=>{let w=m.offsetLeft-i.offsetLeft,g=i.clientWidth;w<i.scrollLeft+24?i.scrollLeft=Math.max(0,w-24):w+m.offsetWidth>i.scrollLeft+g-24&&(i.scrollLeft=w+m.offsetWidth-g+24)},a=m=>{m!==r&&(r?.removeAttribute("aria-current"),r=m,m&&(m.setAttribute("aria-current","true"),l(m)))},h=()=>{let m=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--nish-header-h"))||0,w=e.offset??m+i.offsetHeight+8,g=t[0]??null;for(let S of t){let v=n(S);v&&v.getBoundingClientRect().top<=w+1&&(g=S)}let p=document.documentElement;if(window.innerHeight+window.scrollY>=p.scrollHeight-2)for(let S of t)n(S)&&(g=S);a(g)},c=0,d=()=>{c||(c=requestAnimationFrame(()=>{c=0,h()}))},u=m=>{let w=m.target instanceof Element?m.target.closest('a[href^="#"]'):null;w&&t.includes(w)&&a(w)};o(),h(),window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),i.addEventListener("scroll",o,{passive:!0}),i.addEventListener("click",u);let b;return typeof ResizeObserver<"u"&&(b=new ResizeObserver(()=>{o(),d()}),b.observe(i)),()=>{c&&cancelAnimationFrame(c),window.removeEventListener("scroll",d),window.removeEventListener("resize",d),i.removeEventListener("scroll",o),i.removeEventListener("click",u),b?.disconnect(),s(),r?.removeAttribute("aria-current"),delete i.dataset.atStart,delete i.dataset.atEnd}}var ki=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 z=function(i,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t},R=function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},fe,We,je,Se,Ot,Te,Ge,ne,Le,Y,Ke,Mi;var _={__proto__:null};_.enumerable=!0;Object.freeze(_);var Ht=(Y=class{constructor(e,t={}){if(fe.set(this,!1),We.set(this,!1),je.set(this,!1),Se.set(this,!1),Ot.set(this,Date.now()),Te.set(this,!1),Ge.set(this,void 0),ne.set(this,void 0),Le.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:n,cancelable:s,composed:r}=t;z(this,fe,!!s,"f"),z(this,We,!!n,"f"),z(this,je,!!r,"f"),z(this,Ge,`${e}`,"f"),z(this,ne,null,"f"),z(this,Le,!1,"f")}initEvent(e,t,n){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){z(this,Se,!0,"f")}get target(){return R(this,ne,"f")}get currentTarget(){return R(this,ne,"f")}get srcElement(){return R(this,ne,"f")}get type(){return R(this,Ge,"f")}get cancelable(){return R(this,fe,"f")}get defaultPrevented(){return R(this,fe,"f")&&R(this,Se,"f")}get timeStamp(){return R(this,Ot,"f")}composedPath(){return R(this,Le,"f")?[R(this,ne,"f")]:[]}get returnValue(){return!R(this,fe,"f")||!R(this,Se,"f")}get bubbles(){return R(this,We,"f")}get composed(){return R(this,je,"f")}get eventPhase(){return R(this,Le,"f")?Y.AT_TARGET:Y.NONE}get cancelBubble(){return R(this,Te,"f")}set cancelBubble(e){e&&z(this,Te,!0,"f")}stopPropagation(){z(this,Te,!0,"f")}get isTrusted(){return!1}},fe=new WeakMap,We=new WeakMap,je=new WeakMap,Se=new WeakMap,Ot=new WeakMap,Te=new WeakMap,Ge=new WeakMap,ne=new WeakMap,Le=new WeakMap,Y.NONE=0,Y.CAPTURING_PHASE=1,Y.AT_TARGET=2,Y.BUBBLING_PHASE=3,Y);Object.defineProperties(Ht.prototype,{initEvent:_,stopImmediatePropagation:_,preventDefault:_,target:_,currentTarget:_,srcElement:_,type:_,cancelable:_,defaultPrevented:_,timeStamp:_,composedPath:_,returnValue:_,bubbles:_,composed:_,eventPhase:_,cancelBubble:_,stopPropagation:_,isTrusted:_});var _i=(Mi=class extends Ht{constructor(e,t={}){super(e,t),Ke.set(this,void 0),z(this,Ke,t?.detail??null,"f")}initCustomEvent(e,t,n,s){throw new Error("Method not implemented.")}get detail(){return R(this,Ke,"f")}},Ke=new WeakMap,Mi);Object.defineProperties(_i.prototype,{detail:_});var V=Ht,Pt=_i;var O;var no=(O=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}},O.STYLE_RULE=1,O.CHARSET_RULE=2,O.IMPORT_RULE=3,O.MEDIA_RULE=4,O.FONT_FACE_RULE=5,O.PAGE_RULE=6,O.NAMESPACE_RULE=10,O.KEYFRAMES_RULE=7,O.KEYFRAME_RULE=8,O.SUPPORTS_RULE=12,O.COUNTER_STYLE_RULE=11,O.FONT_FEATURE_VALUES_RULE=14,O.MARGIN_RULE=9,O);globalThis.Event??=V;globalThis.CustomEvent??=Pt;var It=Symbol(),$i=i=>typeof i=="boolean"?i:i?.capture??!1,q={__proto__:null};q.enumerable=!0;Object.freeze(q);var Ye=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,n){if(t==null)return;let s=$i(n)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(t))return;let o=typeof n=="object"&&n?n:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,n)),r.set(t,o??{})}removeEventListener(e,t,n){if(t==null)return;let s=$i(n)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(t),r.size||s.delete(e))}dispatchEvent(e){let t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));let n=!1,s=!1,r=V.NONE,o=null,l=null,a=null,h=e.stopPropagation,c=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??l},...q},srcElement:{get(){return e.target},...q},currentTarget:{get(){return a},...q},eventPhase:{get(){return r},...q},composedPath:{value:()=>t,...q},stopPropagation:{value:()=>{n=!0,h.call(e)},...q},stopImmediatePropagation:{value:()=>{s=!0,c.call(e)},...q}});let d=(g,p,S)=>{typeof g=="function"?g(e):typeof g?.handleEvent=="function"&&g.handleEvent(e),p.once&&S.delete(g)},u=()=>(a=null,r=V.NONE,!e.defaultPrevented),b=t.slice().reverse();o=!this.__host||!e.composed?this:null;let m=g=>{for(l=this;l.__host&&g.includes(l.__host);)l=l.__host};for(let g of b){!o&&(!l||l===g.__host)&&m(b.slice(b.indexOf(g))),a=g,r=g===e.target?V.AT_TARGET:V.CAPTURING_PHASE;let p=g.__captureEventListeners.get(e.type);if(p){for(let[S,v]of p)if(d(S,v,p),s)return u()}if(n)return u()}let w=e.bubbles?t:[this];l=null;for(let g of w){!o&&(!l||g===l.__host)&&m(w.slice(0,w.indexOf(g)+1)),a=g,r=g===e.target?V.AT_TARGET:V.BUBBLING_PHASE;let p=g.__eventListeners.get(e.type);if(p){for(let[S,v]of p)if(d(S,v,p),s)return u()}if(n)return u()}return u()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Oi,Ms]}};var Ni=new WeakMap,Ae=i=>{let e=Ni.get(i);return e===void 0&&Ni.set(i,e=new Map),e},Ce=class extends Ye{getRootNode(e){return e?.composed?Dt:this.__host?.__shadowRoot??Dt}};var Ri=class extends Ce{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Oi=new Ri,Dt=Oi;var Hi=class extends Ce{constructor(e){if(super(),e!==It)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:Xe,customElements:zt,document:Dt,Document:Ri,Element:Pi,EventTarget:Ye,HTMLElement:Di,Node:Ce,ShadowRoot:Ii,window:this,Window:Hi})}};var Pi=class extends Ce{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Ae(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){Ae(this).set(e,String(t))}removeAttribute(e){Ae(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return Ae(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new Ii(It,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new ki(this);return this.__internals=e,e}getAttribute(e){return Ae(this).get(e)??null}};var Di=class extends Pi{},Bt=Di;var Ii=class extends Ce{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new Bt,"localName",{get(){return"lit-server-root"}});function Cs(){let i,e;return{promise:new Promise((n,s)=>{i=n,e=s}),resolve:i,reject:e}}var Xe=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
|
|
2
|
-
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]}),this.__reverseDefinitions.set(t,e),this.__pendingWhenDefineds.get(e)?.resolve(t),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let t=this.__definitions.get(e);if(t)return t.ctor;let
|
|
3
|
-
\f\r]
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xi=/'/g,Ji=/"/g,tn=/^(?:script|style|textarea|title)$/i,Xt=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),C=Xt(1),M=Xt(2),Io=Xt(3),ae=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),Qi=new WeakMap,re=oe.createTreeWalker(oe,129);function nn(i,e){if(!Yt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Gi!==void 0?Gi.createHTML(e):e}var zs=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=$e;for(let l=0;l<t;l++){let a=i[l],h,c,d=-1,u=0;for(;u<a.length&&(o.lastIndex=u,c=o.exec(a),c!==null);)u=o.lastIndex,o===$e?c[1]==="!--"?o=Ki:c[1]!==void 0?o=Yi:c[2]!==void 0?(tn.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=se):c[3]!==void 0&&(o=se):o===se?c[0]===">"?(o=s??$e,d=-1):c[1]===void 0?d=-2:(d=o.lastIndex-c[2].length,h=c[1],o=c[3]===void 0?se:c[3]==='"'?Ji:Xi):o===Ji||o===Xi?o=se:o===Ki||o===Yi?o=$e:(o=se,s=void 0);let b=o===se&&i[l+1].startsWith("/>")?" ":"";r+=o===$e?a+Is:d>=0?(n.push(h),a.slice(0,d)+Zi+a.slice(d)+X+b):a+X+(d===-2?l:b)}return[nn(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Oe=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[h,c]=zs(e,t);if(this.el=i.createElement(h,n),re.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=re.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith(Zi)){let u=c[o++],b=s.getAttribute(d).split(X),m=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:m[2],strings:b,ctor:m[1]==="."?Wt:m[1]==="?"?jt:m[1]==="@"?Gt:ge}),s.removeAttribute(d)}else d.startsWith(X)&&(a.push({type:6,index:r}),s.removeAttribute(d));if(tn.test(s.tagName)){let d=s.textContent.split(X),u=d.length-1;if(u>0){s.textContent=Ze?Ze.emptyScript:"";for(let b=0;b<u;b++)s.append(d[b],Ne()),re.nextNode(),a.push({type:2,index:++r});s.append(d[u],Ne())}}}else if(s.nodeType===8)if(s.data===en)a.push({type:2,index:r});else{let d=-1;for(;(d=s.data.indexOf(X,d+1))!==-1;)a.push({type:7,index:r}),d+=X.length-1}r++}}static createElement(e,t){let n=oe.createElement("template");return n.innerHTML=e,n}};function be(i,e,t=i,n){if(e===ae)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=Re(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=s:t._$Cl=s),s!==void 0&&(e=be(i,s._$AS(i,e.values),s,n)),e}var qt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??oe).importNode(t,!0);re.currentNode=s;let r=re.nextNode(),o=0,l=0,a=n[0];for(;a!==void 0;){if(o===a.index){let h;a.type===2?h=new He(r,r.nextSibling,this,e):a.type===1?h=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(h=new Kt(r,this,e)),this._$AV.push(h),a=n[++l]}o!==a?.index&&(r=re.nextNode(),o++)}return re.currentNode=oe,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},He=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=be(this,e,t),Re(e)?e===y||e==null||e===""?(this._$AH!==y&&this._$AR(),this._$AH=y):e!==this._$AH&&e!==ae&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Bs(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!==y&&Re(this._$AH)?this._$AA.nextSibling.data=e:this.T(oe.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Oe.createElement(nn(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new qt(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=Qi.get(e.strings);return t===void 0&&Qi.set(e.strings,t=new Oe(e)),t}k(e){Yt(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let r of e)s===t.length?t.push(n=new i(this.O(Ne()),this.O(Ne()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=ji(e).nextSibling;ji(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ge=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=y}_$AI(e,t=this,n,s){let r=this.strings,o=!1;if(r===void 0)e=be(this,e,t,0),o=!Re(e)||e!==this._$AH&&e!==ae,o&&(this._$AH=e);else{let l=e,a,h;for(e=r[0],a=0;a<r.length-1;a++)h=be(this,l[n+a],t,a),h===ae&&(h=this._$AH[a]),o||=!Re(h)||h!==this._$AH[a],h===y?e=y:e!==y&&(e+=(h??"")+r[a+1]),this._$AH[a]=h}o&&!s&&this.j(e)}j(e){e===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Wt=class extends ge{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===y?void 0:e}},jt=class extends ge{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==y)}},Gt=class extends ge{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=be(this,e,t,0)??y)===ae)return;let n=this._$AH,s=e===y&&n!==y||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==y&&(n===y||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Kt=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){be(this,e)}};var Fs=et.litHtmlPolyfillSupport;Fs?.(Oe,He),(et.litHtmlVersions??=[]).push("3.3.3");var sn=(i,e,t)=>{let n=t?.renderBefore??e,s=n._$litPart$;if(s===void 0){let r=t?.renderBefore??null;n._$litPart$=s=new He(e.insertBefore(Ne(),r),r,void 0,t??{})}return s._$AI(i),s};var Jt=globalThis,J=class extends W{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=sn(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ae}};J._$litElement$=!0,J.finalized=!0,Jt.litElementHydrateSupport?.({LitElement:J});var Us=Jt.litElementPolyfillSupport;Us?.({LitElement:J});(Jt.litElementVersions??=[]).push("4.2.2");var rn={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:i=>`${i} result${i===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:i=>`${i} active`,remove:"Remove",removeNamed:i=>`Remove ${i}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:i=>`${i}: no data`,seriesNumber:i=>`Series ${i}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark"};function Qt(){return de("element-strings",()=>({values:{...rn},listeners:new Set}))}function Vs(i){let e=Qt(),t={...e.values};for(let[n,s]of Object.entries(i))s!==void 0&&Object.hasOwn(rn,n)&&(t[n]=s);e.values=t;for(let n of Array.from(e.listeners))n()}function T(){return Qt().values}function on(i){let e=Qt().listeners;return e.add(i),()=>{e.delete(i)}}var E=class extends J{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=on(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function k(i){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i()}function x(i,e){customElements.get(i)||customElements.define(i,e)}function Q(i){return!!i&&getComputedStyle(i).direction==="rtl"}function tt(i,e){let t=null,n=()=>Array.from(i.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,l=null,a=-1;for(let h of n()){if(e?.(h),!h.getAttribute("href"))continue;let c;try{c=new URL(h.getAttribute("href"),location.href)}catch{continue}if(c.origin!==location.origin)continue;if(c.hash&&c.pathname===location.pathname){c.hash===location.hash&&(l=h,a=1/0);continue}let d=c.pathname;(d==="/"?o==="/":o===d||o.startsWith(d.endsWith("/")?d:`${d}/`))&&d.length>a&&(l=h,a=d.length)}if(!l){t?.removeAttribute("aria-current"),t=null;return}for(let h of n())h.removeAttribute("aria-current");l.setAttribute("aria-current","page"),t=l},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(i,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(i,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var it=class extends E{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#i=null;#t=null;constructor(){super(),this.label="",this.lg=!1}connectedCallback(){super.connectedCallback(),k(()=>this.#n())}#n(){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.#r(),this.#t=tt(e,t=>t.classList.add("nish-bottom-nav-item")),this.#i=Rt(e,"--nish-bottom-nav-h")}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#t?.(),this.#t=null,this.#i?.(),this.#i=null}updated(e){this.#r()}#r(){this.#e&&(this.#e.setAttribute("aria-label",this.label||T().sections),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}};x("nish-bottom-nav",it);var an=0,nt=class extends E{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;opener=null;value="";waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.value="",this.open=!1,this.dialog.close())}show(){this.open=!0}close(e=""){this.dialog?.open&&(this.value=e),this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-dialog-open]");t&&t.getAttribute("data-dialog-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-dialog",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("click",this.onDialogClick),e.addEventListener("keydown",this.onKey),e.addEventListener("cancel",this.onCancel),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-dialog-title"),n=e.querySelector(".nish-dialog-body");t?(t.id||(t.id=`nish-dialog-title-${++an}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),n?(n.id||(n.id=`nish-dialog-body-${++an}`),e.setAttribute("aria-describedby",n.id)):e.removeAttribute("aria-describedby")}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?(this.opener=document.activeElement instanceof HTMLElement?document.activeElement:null,e.returnValue="",e.showModal()):!this.open&&e.open&&e.close())}onDialogClick=e=>{let t=this.dialog;if(t){if(e.target===t){let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||this.close();return}if(e.target instanceof Element){let n=e.target.closest("[data-dialog-close]");n&&n.closest("dialog")===t&&this.close(n.getAttribute("value")??"")}}};onKey=e=>{e.key==="Escape"&&e.stopPropagation()};onCancel=e=>{e.preventDefault(),this.close()};onDialogClose=()=>{let e=this.value||this.dialog?.returnValue||"";this.value="",this.open&&(this.open=!1);let t=this.opener;this.opener=null,t?.isConnected&&t.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};x("nish-dialog",nt);var qs=0,st=class extends E{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;closeSheet=null;waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.open=!1,this.dialog.close())}show(){this.open=!0}close(){this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-sheet-open]");t&&t.getAttribute("data-sheet-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-sheet",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-sheet-title");t?(t.id||(t.id=`nish-sheet-title-${++qs}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"))}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?this.closeSheet=Ai(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()}};x("nish-sheet",st);var rt=class extends E{static properties={labelled:{type:Boolean,reflect:!0},pill:{type:Boolean,reflect:!0},labelSystem:{attribute:"label-system"},labelLight:{attribute:"label-light"},labelDark:{attribute:"label-dark"}};#e=null;#i=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#c()}disconnectedCallback(){super.disconnectedCallback(),this.#a()}updated(e){this.#e&&this.#t!==this.#r()&&this.#c()}#t="";#n(){let e=T();return[this.labelSystem||e.themeSystem,this.labelLight||e.themeLight,this.labelDark||e.themeDark]}#r(){return JSON.stringify([this.labelled,this.pill,...this.#n()])}#a(){this.#i?.(),this.#i=null,this.#e?.remove(),this.#e=null}#c(){this.#a(),this.#t=this.#r();let e=document.createElement("button");e.className="nish-theme-btn",e.classList.toggle("nish-theme-btn--labelled",this.labelled),e.classList.toggle("nish-theme-btn--pill",this.pill),this.prepend(e),this.#e=e;let[t,n,s]=this.#n(),r={system:t,light:n,dark:s};this.#i=Ti(e,{showLabel:this.labelled,labels:r})}};x("nish-theme-toggle",rt);var ln="http://www.w3.org/2000/svg";function cn(i,e){let t=document.createElementNS(ln,"svg");for(let[n,s]of Object.entries({width:String(i),height:String(i),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))t.setAttribute(n,s);for(let n of e){let s=document.createElementNS(ln,"path");s.setAttribute("d",n),t.appendChild(s)}return t}var ot=i=>cn(i,["M18 6 6 18M6 6l12 12"]),hn=i=>cn(i,["M22 3H2l8 9.46V19l4 2v-8.54L22 3z"]);var at=class extends E{static properties={label:{type:String,reflect:!0},scrollable:{attribute:"scroll",type:Boolean,reflect:!0},single:{type:Boolean,reflect:!0}};#e=null;#i=null;#t=null;#n=e=>this.#u(e);constructor(){super(),this.label="",this.scrollable=!1,this.single=!1}get values(){return this.#e?this.#a().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#s(e)):this.#t??[]}set values(e){if(!this.#e){this.#t=[...e];return}let t=new Set(e),n=!1;for(let s of this.#a()){let r=t.has(this.#s(s))&&!(this.single&&n);r&&(n=!0),s.setAttribute("aria-pressed",String(r))}}connectedCallback(){super.connectedCallback(),k(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#n),this.#e=null}updated(e){this.#o(),this.#r()}#r(){if(!this.#e)return;let e=T();for(let t of this.#a()){let n=t.querySelector(":scope > [data-nish-remove]");if(!n)continue;let s=this.#c(t);n.setAttribute("aria-label",s?e.removeNamed(s):e.remove)}}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button, :scope > .nish-chip")):[]}#c(e){let t="";return e.childNodes.forEach(n=>{(n.nodeType===Node.TEXT_NODE||n instanceof HTMLElement&&!n.hasAttribute("data-nish-remove"))&&(t+=n.textContent??"")}),t.trim()}#s(e){return e.getAttribute("value")??this.#c(e)}#l(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-chips");if(!e){for(e=document.createElement("div"),e.className="nish-chips";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,e.setAttribute("role","group"),e.addEventListener("click",this.#n),this.#o(),this.#d(),this.#t&&(this.values=this.#t,this.#t=null),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#d(),this.#h()}),this.#h()}#h(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#o(){this.#e&&(this.label?this.#e.setAttribute("aria-label",this.label):this.#e.removeAttribute("aria-label"),this.#e.classList.toggle("nish-chips--scroll",this.scrollable))}#d(){for(let e of this.#a())if(e.classList.add("nish-chip"),e instanceof HTMLButtonElement)e.hasAttribute("type")||(e.type="button"),e.hasAttribute("aria-pressed")||e.setAttribute("aria-pressed","false");else if(e.hasAttribute("data-removable")&&!e.querySelector(":scope > [data-nish-remove]")){let t=this.#c(e),n=document.createElement("button");n.type="button",n.className="nish-icon-btn nish-icon-btn--xs",n.setAttribute("data-nish-remove",""),n.setAttribute("aria-label",t?T().removeNamed(t):T().remove),n.appendChild(ot(12)),e.appendChild(n)}}#u(e){let t=e.target;if(!t||!this.#e)return;let n=t.closest("[data-nish-remove]");if(n&&this.#e.contains(n)){let o=n.parentElement,l=this.#s(o);o.remove(),this.dispatchEvent(new CustomEvent("nish-remove",{bubbles:!0,detail:{value:l}}));return}let s=t.closest("button");if(!s||s.parentElement!==this.#e||s.disabled||!s.hasAttribute("aria-pressed"))return;let r=s.getAttribute("aria-pressed")!=="true";if(r&&this.single)for(let o of this.#a())o!==s&&o.hasAttribute("aria-pressed")&&o.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};x("nish-chip-group",at);var dn=(i,e)=>{let t=e.trim().toLowerCase();return t?i.label.toLowerCase().includes(t)||(i.hint?.toLowerCase().includes(t)??!1):!0};var Gs=0,un="http://www.w3.org/2000/svg",Ks="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function mn(i){let e=document.createElementNS(un,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","16"),e.setAttribute("height","16"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");let t=document.createElementNS(un,"path");return t.setAttribute("d",i),e.append(t),e}var lt=class extends E{static properties={value:{type:String,reflect:!0},placeholder:{type:String},label:{type:String},allowCustom:{type:Boolean,attribute:"allow-custom",reflect:!0},emptyText:{type:String,attribute:"empty-text"},size:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},name:{type:String},options:{attribute:!1},filter:{attribute:!1}};#e=++Gs;#i=null;#t=null;#n=null;#r=null;#a=null;#c=null;#s=!1;#l="";#h=!1;#o=-1;#d;#u=!1;constructor(){super(),this.value=null,this.placeholder=null,this.label=null,this.allowCustom=!1,this.emptyText="",this.size=null,this.disabled=!1,this.loading=!1,this.name=null,this.options=[],this.filter=null}get input(){return this.#t}connectedCallback(){if(super.connectedCallback(),this.#i){this.#S();return}this.#u||(this.#u=!0,k(()=>{this.#u=!1,this.isConnected&&this.#m()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#d),this.#f()}#m(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(a=>({value:a.value,label:a.textContent?.trim()??a.value,hint:a.dataset.hint||void 0,disabled:a.disabled||void 0}));for(let a of e)a.remove();this.options.length===0&&t.length>0&&(this.options=t);let n=document.createElement("div");n.className="nish-combobox";let s=document.createElement("input");s.type="text",s.className="nish-input nish-combobox-input",s.setAttribute("role","combobox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#M(s.value)),s.addEventListener("keydown",a=>this.#$(a)),s.addEventListener("focus",()=>this.#w()),s.addEventListener("click",()=>this.#w()),s.addEventListener("blur",()=>{this.#k()||(this.#f(),this.#v(),this.#S())}),s.addEventListener("change",a=>a.stopPropagation());let r=document.createElement("button");r.type="button",r.className="nish-icon-btn nish-combobox-clear",r.tabIndex=-1,r.hidden=!0,r.append(mn("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",a=>a.preventDefault()),r.addEventListener("click",()=>{this.#f(),this.#L(null,null),s.focus()});let o=document.createElement("span");o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.style.cssText=Ks;let l=document.createElement("input");l.type="hidden",n.append(s,r,o),this.append(n,l),this.#i=n,this.#t=s,this.#n=r,this.#r=o,this.#c=l,this.#S()}updated(e){e.has("value")&&e.get("value")!==void 0&&this.#v(),e.has("disabled")&&this.disabled&&this.#f(),(e.has("options")||e.has("filter")||e.has("loading"))&&this.#E(),this.#S()}get#g(){return this.options.find(e=>e.value===this.value)??null}get#b(){return this.value!=null&&this.value!==""}get#x(){return this.#h?this.#l:this.#g?.label??this.value??""}get#p(){let e=this.filter??dn;return(this.#h?this.options.filter(n=>e(n,this.#l)):this.options).slice(0,50)}#E(){this.#o>=this.#p.length&&(this.#o=-1)}#v(){this.#h=!1,this.#l=""}#w(){if(this.#s||this.disabled||!this.#t)return;this.#s=!0;let e=this.#g,t=e?this.#p.findIndex(n=>n.value===e.value):-1;this.#o=t>=0?t:-1,this.#S()}#f(){this.#s=!1,this.#o=-1,this.#a?.remove(),this.#a=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#r&&(this.#r.textContent="")}#y(e,t){let n=this.#p,s=n.length;if(s===0)return-1;let r=e;for(let o=0;o<s;o++)if(r=(r+t+s)%s,!n[r].disabled)return r;return-1}#T(e){return e===1?this.#y(-1,1):this.#y(0,-1)}#L(e,t){this.value=e,this.#v(),this.#S();let n={value:e,option:t};this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:n}))}#A(e){e.disabled||(this.#f(),this.#L(e.value,e))}#k(){return!this.#h||this.#l.trim()!==""||!this.#b?!1:(this.#f(),this.#L(null,null),!0)}#C(){let e=this.#l.trim();if(!this.allowCustom||!this.#h||!e)return!1;let t=this.options.find(n=>!n.disabled&&n.label.toLowerCase()===e.toLowerCase());return this.#f(),t?this.#L(t.value,t):this.#L(e,null),!0}#M(e){this.#l=e,this.#h=!0,this.#s=!0,this.allowCustom||e.trim()===""?this.#o=-1:this.#o=this.#p.findIndex(t=>!t.disabled),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#S()}#$(e){if(this.disabled)return;let t=this.#p;switch(e.key){case"ArrowDown":case"ArrowUp":{e.preventDefault();let n=e.key==="ArrowDown"?1:-1;if(this.#s){this.#_(this.#o<0?this.#T(n):this.#y(this.#o,n));break}else{this.#s=!0;let s=this.#g,r=s?t.findIndex(o=>o.value===s.value):-1;this.#o=r>=0?r:this.#T(n)}this.#S();break}case"Home":case"End":this.#s&&(e.preventDefault(),this.#_(this.#T(e.key==="Home"?1:-1)));break;case"Enter":this.#s&&this.#o>=0&&t[this.#o]?(e.preventDefault(),this.#A(t[this.#o])):(this.#k()||this.#C()||this.#s)&&e.preventDefault();break;case"Escape":this.#s?(e.preventDefault(),e.stopPropagation(),this.#f(),this.#S()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#v(),this.#S());break;case"Tab":this.#f();break}}#S(){let e=this.#t,t=this.#i;if(!e||!t||!this.#n||!this.#c||!this.#r)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let n=this.#x;e.value!==n&&(e.value=n),e.disabled=this.disabled,this.placeholder?e.placeholder=this.placeholder:e.removeAttribute("placeholder"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),this.#n.setAttribute("aria-label",T().clear),this.#n.hidden=!(this.#b&&!this.disabled);let s=this.#c;if(this.name?s.name=this.name:s.removeAttribute("name"),s.value=this.value??"",s.disabled=this.disabled,!this.#s){this.#a&&this.#f();return}this.#N(e,t,this.#r)}#_(e){let t=this.#o;this.#o=e;let n=this.#a,s=this.#t;if(!n||!s||!this.#s){this.#S();return}n.querySelector("[data-active]")?.removeAttribute("data-active");let r=e>=0?n.querySelector(`[data-index="${e}"]`):null;if(!r){t!==e?this.#S():s.removeAttribute("aria-activedescendant");return}r.dataset.active="",s.setAttribute("aria-activedescendant",r.id),r.scrollIntoView?.({block:"nearest"})}#N(e,t,n){let s=T(),r=`nish-cb-list-${this.#e}`,o=this.#p,l=this.#g,a=this.#a;if(!a){a=document.createElement("ul"),a.id=r,a.className="nish-combobox-list",a.setAttribute("role","listbox");let c=d=>{let u=d.target?.closest("li[data-index]");if(!u||!a.contains(u))return null;let b=Number(u.dataset.index),m=this.#p[b];return m?{o:m,i:b}:null};a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("mousemove",d=>{let u=c(d);u&&!u.o.disabled&&this.#o!==u.i&&this.#_(u.i)}),a.addEventListener("click",d=>{let u=c(d);u&&this.#A(u.o)}),this.#a=a,t.append(a)}this.label?(a.setAttribute("aria-label",this.label),a.removeAttribute("aria-labelledby")):(a.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),a.setAttribute("aria-labelledby",e.id));let h=o.map((c,d)=>{let u=document.createElement("li");u.id=`${r}-opt-${d}`,u.className="nish-combobox-option",u.setAttribute("role","option"),u.dataset.index=String(d),u.setAttribute("aria-selected",String(l?.value===c.value)),c.disabled&&u.setAttribute("aria-disabled","true"),d===this.#o&&(u.dataset.active="");let b=document.createElement("span");if(b.className="nish-combobox-label",b.textContent=c.label,u.append(b),c.hint){let m=document.createElement("span");m.className="nish-combobox-hint",m.textContent=c.hint,u.append(m)}return l?.value===c.value&&u.append(mn("M20 6 9 17l-5-5")),u});if(this.loading){let c=document.createElement("li");c.setAttribute("role","presentation"),c.className="nish-combobox-loading";let d=document.createElement("span");d.className="nish-spinner nish-spinner--sm",d.setAttribute("aria-hidden","true"),c.append(d,document.createTextNode(s.searching)),h.push(c)}else if(o.length===0){let c=document.createElement("li");c.setAttribute("role","presentation"),c.className="nish-combobox-empty",c.textContent=this.emptyText||s.noMatches,h.push(c)}a.replaceChildren(...h),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#o>=0&&o[this.#o]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#o}`):e.removeAttribute("aria-activedescendant"),n.textContent=this.loading?s.searching:o.length===0?this.emptyText||s.noMatches:s.resultCount(o.length),this.#R(a,e),a.querySelector(`[data-index="${this.#o}"]`)?.scrollIntoView?.({block:"nearest"})}#R(e,t){e.style.top="",e.style.bottom="",e.style.marginTop="",e.style.marginBottom="",delete e.dataset.above;let n=t.getBoundingClientRect(),s=e.getBoundingClientRect().height,r=window.innerHeight-n.bottom;s>r&&n.top>r&&(e.dataset.above="",e.style.top="auto",e.style.bottom="100%",e.style.marginTop="0",e.style.marginBottom="4px")}};x("nish-combobox",lt);var pn=1500,fn="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",Ys=M`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg>`,Xs=M`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--nish-ok)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"></path></svg>`;async function Js(i){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(i),!0}catch{}let e=document.createElement("textarea");e.value=i,e.setAttribute("readonly",""),e.style.cssText="position:fixed;top:-1000px;opacity:0";let t=document.activeElement;document.body.appendChild(e),e.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return e.remove(),t?.focus?.(),n}var ct=class extends E{static properties={value:{type:String,reflect:!0},for:{type:String,reflect:!0},label:{type:String,reflect:!0},copiedLabel:{attribute:"copied-label",reflect:!0},icon:{type:Boolean,reflect:!0},copied:{state:!0},manual:{state:!0}};#e=null;constructor(){super(),this.value=null,this.for=null,this.label="",this.copiedLabel="",this.icon=!1,this.copied=!1,this.manual=!1}disconnectedCallback(){super.disconnectedCallback(),this.#e&&clearTimeout(this.#e),this.#e=null,this.copied=!1,this.manual=!1}#i(){return this.value!=null?this.value:(this.for?document.getElementById(this.for):null)?.textContent??""}async#t(){let e=this.#i();if(!await Js(e)){await this.#n();return}this.manual=!1,this.copied=!0,this.dispatchEvent(new CustomEvent("nish-copy",{bubbles:!0,detail:{text:e}})),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.copied=!1,this.#e=null},pn)}async#n(){this.copied=!1,this.manual=!0,await this.updateComplete;let e=this.value==null&&this.for?document.getElementById(this.for):null;if(e){let t=document.createRange();t.selectNodeContents(e);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)}else{let t=this.querySelector("textarea[data-copy-source]");t?.focus(),t?.select()}this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{document.activeElement?.matches("textarea[data-copy-source]")&&this.contains(document.activeElement)&&this.querySelector("button")?.focus(),this.manual=!1,this.#e=null},pn)}render(){let e=T(),t=this.copiedLabel||e.copied,n=this.copied?t:this.manual?e.copyManual:this.label||e.copy,s=this.copied?Xs:Ys;return C`${this.icon?C`<button type="button" class="nish-icon-btn nish-icon-btn--sm nish-copy-btn" aria-label=${n} title=${n} ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
1
|
+
var Zn=["emerald","indigo","amber","lime","rose","sky","violet","teal"],Gr=["accent","ok","loss","warn","info",...Zn],ce={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},es={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},ts=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],is=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],ie=n=>Object.fromEntries(n.map((e,t)=>[`chart-${t+1}`,e])),ns={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",...ie(ts),...ce}},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",...ie(is),...es}},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",...ie(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...ce,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",...ie(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...ce}},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",...ie(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...ce,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",...ie(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...ce}},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",...ie(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...ce}}},ss=n=>{let e=n.colors,t=Object.fromEntries(["ok","loss","warn","info"].flatMap(i=>[[`${i}-fill`,e[`${i}-fill`]??e[i]],[`on-${i}`,e[`on-${i}`]??e["on-accent"]]]));return{...n,colors:{...e,...t,"on-accent2":e["on-accent2"]??e["on-accent"]}}},he=Object.fromEntries(Object.entries(ns).map(([n,e])=>[n,ss(e)])),ui="dark";var rs="3.0.0";var os=Symbol.for("nish-ui.runtime.v1");function as(){let n=globalThis;return n[os]??={versions:new Set,slots:{}}}function ls(n){n.versions.add(rs),n.versions.size>1&&!n.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(n.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...n.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var mi=!1;function de(n,e){let t=as();return mi||(mi=!0,ls(t)),n in t.slots||(t.slots[n]=e()),t.slots[n]}function ye(n){if(n==null)return null;let e=String(n),t=0,i=e.length;for(;t<i&&e.charCodeAt(t)<=32;)t++;for(;i>t&&e.charCodeAt(i-1)<=32;)i--;let s=e.slice(t,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 Ee={theme:"Theme",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(n,e)=>`Theme: ${n}. Switch to ${e}`,themePreset:"Theme preset",themePresetPlaceholder:"Preset\u2026"};var pi={dismiss:"Dismiss",moreCount:n=>`${n} more`,copy:"Copy",copied:"Copied",legend:"Legend",noData:"No data",noDataNamed:n=>`${n}: no data`};var fi="nish-theme",bi="nish.software",cs=3600*24*365,ue=()=>de("theme",()=>({extra:{},listeners:new Set,watching:!1,switchId:0})),hs=n=>{globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: ${n}`)};function Ve(){if(typeof document>"u")return fi;let n=document.documentElement.getAttribute("data-nish-storage-key");return n&&/^[A-Za-z0-9_-]+$/.test(n)?n:fi}var xe=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function $t(n){return typeof n=="string"&&(xe(he,n)||xe(ue().extra,n))}function ds(){if(typeof document>"u")return null;try{let n=document.cookie.match(new RegExp(`(?:^|;\\s*)${Ve()}=([a-z0-9-]+)`));return n?n[1]:null}catch{return null}}var gi=(n,e)=>e===n||e.endsWith("."+n);function us(n,e){let t=n.toLowerCase(),i=(e??"").trim().toLowerCase().replace(/^\./,"");return i?gi(i,t)?i:null:gi(bi,t)?bi:null}function ms(){return typeof location>"u"||typeof document>"u"?null:us(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function me(){let n=null;try{n=ds()??localStorage.getItem(Ve())}catch{}return n==="system"||$t(n)?n:"system"}function ps(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":ui}function fs(){let n=document.documentElement.getAttribute("data-nish-themes");return n?n.split(/\s+/).filter($t):null}function xi(n=me()){let e=n==="system"?ps():n,t=typeof document>"u"?null:fs();return t&&!t.includes(e)&&(e=Ge(e)),e}function Ge(n){let{extra:e}=ue();return xe(he,n)?he[n].scheme:xe(e,n)?e[n]:"dark"}function wi(n=me()){let e=xi(n),t=document.documentElement,i=t.getAttribute("data-theme");return i&&i!==e&&bs(t),t.setAttribute("data-theme",e),t.setAttribute("data-scheme",Ge(e)),t.setAttribute("data-theme-choice",n),t.style.colorScheme=Ge(e),ys(),ue().listeners.forEach(s=>s(n,e)),e}function bs(n){let e=ue(),t=++e.switchId;n.setAttribute("data-nish-theme-switching","");let i=()=>{e.switchId===t&&n.removeAttribute("data-nish-theme-switching")};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>requestAnimationFrame(i)):setTimeout(i,32)}function gs(n){if(n!=="system"&&!$t(n))return hs(`unknown theme "${String(n)}" ignored. Register it with registerThemes() first.`),xi(me());let e=Ve();try{localStorage.setItem(e,n)}catch{}try{let t=ms();if(t){let i=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${n}; Domain=.${t}; Path=/; Max-Age=${cs}; SameSite=Lax${i}`}}catch{}return wi(n)}function vs(n){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${n}`).trim()}function ys(){let n=vs("bg");if(!n)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=n}function Es(){let n=ue();if(n.watching||typeof window>"u")return;n.watching=!0;let e=()=>{let t=me();(t!==document.documentElement.getAttribute("data-theme-choice")||t==="system")&&wi(t)};typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").addEventListener("change",e),window.addEventListener("storage",t=>{t.key===Ve()&&e()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function Ss(n){Es();let{listeners:e}=ue();return e.add(n),()=>{e.delete(n)}}var Ue=["system","light","dark"];function xs(){let n=Ti(me());return gs(n),n}var vi="http://www.w3.org/2000/svg";function Nt(n,e,t={}){let i=document.createElementNS(vi,"svg"),s={width:String(n),height:String(n),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false",...t};for(let r of Object.keys(s))i.setAttribute(r,s[r]);for(let[r,o]of e){let l=document.createElementNS(vi,r);for(let a of Object.keys(o))l.setAttribute(a,o[a]);i.appendChild(l)}return i}var yi={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"}]]},ws=()=>({system:Ee.themeSystem,light:Ee.themeLight,dark:Ee.themeDark}),Ts="set on another site";function Ti(n){let e=Ue.indexOf(n);return Ue[(e+1)%Ue.length]}function Mt(n,e){return n==="system"||n==="light"||n==="dark"?e[n]:xe(he,n)?he[n].label:n.charAt(0).toUpperCase()+n.slice(1)}function Li(n,e={}){let t={...ws(),...e.labels},i=e.strings?.themeToggleLabel??Ee.themeToggleLabel,s=e.elsewhereLabel??Ts;n.tagName==="BUTTON"&&!n.getAttribute("type")&&n.setAttribute("type","button");let r=Object.keys(yi).map(c=>Nt(16,yi[c],{"data-icon":c}));if(e.showLabel){let c=document.createElement("span");c.setAttribute("data-theme-word",""),c.setAttribute("aria-hidden","true"),r.push(c)}n.replaceChildren(...r);let o=n.querySelector("[data-theme-word]"),l=c=>{let d=c==="system"||c==="light"||c==="dark"?c:Ge(c);n.setAttribute("data-choice",c),n.querySelectorAll("svg[data-icon]").forEach(m=>{m.getAttribute("data-icon")===d?m.removeAttribute("display"):m.setAttribute("display","none")});let u=Ue.includes(c)?"":` (${s})`,b=i(`${Mt(c,t)}${u}`,Mt(Ti(c),t));n.setAttribute("aria-label",b),n.setAttribute("title",b),o&&(o.textContent=Mt(c,t))},a=()=>{xs()};n.addEventListener("click",a);let h=Ss(c=>l(c));return l(me()),()=>{n.removeEventListener("click",a),h()}}var Ei=[["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"}]],Si=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4M12 8h.01"}]],Ls={neutral:Si,info:Si,ok:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]],warn:Ei,loss:Ei},As=6e3,Y=null,Se=null;function Ai(n,e={}){Se?.(),(!Y||!Y.isConnected)&&(Y=document.createElement("div"),Y.setAttribute("role","status"),Y.setAttribute("aria-live","polite"),Y.className="nish-toast-region",document.body.appendChild(Y));let t=Y,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(Nt(15,Ls[e.tone??"neutral"])),i.append(s);let r=document.createElement("p");r.className="nish-toast-body",r.append(typeof n=="string"?document.createTextNode(n):n),i.append(r);let o=null,l=e.duration==="sticky"?1/0:e.duration??As,a=0,h=0,c=()=>{o!=null&&clearTimeout(o),o=null,i.remove(),Se===c&&(Se=null)},d=p=>{Number.isFinite(p)&&(a=Date.now(),o=setTimeout(c,p))},u=()=>{h+=1,!(h>1||o==null)&&(clearTimeout(o),o=null,l=Math.max(0,l-(Date.now()-a)))},b=()=>{h!==0&&(h-=1,h===0&&d(Math.max(l,1e3)))},m=e.action,x=m?.href!=null?ye(m.href):null;if(m&&(m.href==null||x!=null)){let p=document.createElement(m.href!=null?"a":"button");p.className="nish-toast-action",p.textContent=m.label,x!=null?p.href=x:p.type="button",p.addEventListener("click",()=>{m.onClick?.(),c()}),i.append(p)}let g=document.createElement("button");return g.type="button",g.className="nish-toast-close",g.setAttribute("aria-label",e.dismissLabel??e.strings?.dismiss??pi.dismiss),g.append(Nt(14,[["path",{d:"M18 6 6 18M6 6l12 12"}]])),g.addEventListener("click",c),i.append(g),i.addEventListener("pointerenter",p=>p.pointerType==="mouse"&&u()),i.addEventListener("pointerleave",p=>p.pointerType==="mouse"&&b()),i.addEventListener("focusin",p=>!i.contains(p.relatedTarget)&&u()),i.addEventListener("focusout",p=>!i.contains(p.relatedTarget)&&b()),i.addEventListener("keydown",p=>{p.key==="Escape"&&c()}),setTimeout(()=>{Se===c&&(t.append(i),d(l))},50),Se=c,c}var Cs=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function Ci(n){if(typeof document>"u")return()=>{};let e=!1,t=!1;if(n.open)return()=>s();let i=document.activeElement instanceof HTMLElement?document.activeElement:null;function s(){if(e||!n.open)return;e=!0;let p,w=()=>{n.removeEventListener("animationend",v),p!==void 0&&clearTimeout(p),n.removeAttribute("data-closing"),n.style.transform="",n.style.transition="",e=!1,n.open&&n.close()},v=P=>{P.target===n&&w()};if(Cs()){w();return}n.style.transform="",n.setAttribute("data-closing",""),n.addEventListener("animationend",v),p=setTimeout(w,260)}let r=p=>{p.preventDefault(),s()},o=p=>{p.key==="Escape"&&p.stopPropagation()},l=p=>{if(p.target===n){let w=n.getBoundingClientRect();p.clientX>=w.left&&p.clientX<=w.right&&p.clientY>=w.top&&p.clientY<=w.bottom||s();return}p.target instanceof Element&&p.target.closest("[data-sheet-close]")&&s()},a=0,h=0,c=0,d=0,u=1,b=p=>{if(p.pointerType==="mouse"||e||!p.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let w=n.getBoundingClientRect();!(p.target instanceof Element&&p.target.closest(".nish-sheet-header")!=null)&&p.clientY-w.top>28||(t=!0,a=h=p.clientY,c=p.timeStamp,d=0,u=w.height||1,n.style.transition="none",n.setPointerCapture?.(p.pointerId))},m=p=>{if(!t)return;let w=p.clientY-a,v=p.timeStamp-c;v>0&&(d=(p.clientY-h)/v),h=p.clientY,c=p.timeStamp,n.style.transform=`translateY(${w>=0?w:w*.3}px)`},x=p=>{if(!t)return;t=!1,n.releasePointerCapture?.(p.pointerId);let w=p.clientY-a;if(p.type!=="pointercancel"&&(w>u*.3||d>.5)){s();return}n.style.transition="transform 180ms var(--nish-ease-out, ease-out)",n.style.transform="",setTimeout(()=>{e||(n.style.transition="")},200)},g=()=>{n.removeEventListener("cancel",r),n.removeEventListener("keydown",o),n.removeEventListener("click",l),n.removeEventListener("pointerdown",b),n.removeEventListener("pointermove",m),n.removeEventListener("pointerup",x),n.removeEventListener("pointercancel",x),n.removeEventListener("close",g),i?.isConnected&&i.focus()};return n.addEventListener("cancel",r),n.addEventListener("keydown",o),n.addEventListener("click",l),n.addEventListener("pointerdown",b),n.addEventListener("pointermove",m),n.addEventListener("pointerup",x),n.addEventListener("pointercancel",x),n.addEventListener("close",g),n.showModal(),s}function Rt(n,e){if(typeof document>"u")return()=>{};let t=document.documentElement,i=()=>{let r=n.offsetHeight;r>0?t.style.setProperty(e,`${r}px`):t.style.removeProperty(e)};i();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(i),s.observe(n)):window.addEventListener("resize",i),()=>{s?.disconnect(),window.removeEventListener("resize",i),t.style.removeProperty(e)}}function ki(n,e={}){if(typeof document>"u")return()=>{};let t=Array.from(n.querySelectorAll('a[href^="#"]')).filter(m=>m.hash.length>1),i=m=>{try{return document.getElementById(decodeURIComponent(m.hash.slice(1)))}catch{return null}},s=e.height===!1?()=>{}:Rt(n,"--nish-sticky-extra"),r=null,o=()=>{let m=n.scrollWidth-n.clientWidth;n.dataset.atStart=String(n.scrollLeft<=1),n.dataset.atEnd=String(m<=1||n.scrollLeft>=m-1)},l=m=>{let x=m.offsetLeft-n.offsetLeft,g=n.clientWidth;x<n.scrollLeft+24?n.scrollLeft=Math.max(0,x-24):x+m.offsetWidth>n.scrollLeft+g-24&&(n.scrollLeft=x+m.offsetWidth-g+24)},a=m=>{m!==r&&(r?.removeAttribute("aria-current"),r=m,m&&(m.setAttribute("aria-current","true"),l(m)))},h=()=>{let m=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--nish-header-h"))||0,x=e.offset??m+n.offsetHeight+8,g=t[0]??null;for(let w of t){let v=i(w);v&&v.getBoundingClientRect().top<=x+1&&(g=w)}let p=document.documentElement;if(window.innerHeight+window.scrollY>=p.scrollHeight-2)for(let w of t)i(w)&&(g=w);a(g)},c=0,d=()=>{c||(c=requestAnimationFrame(()=>{c=0,h()}))},u=m=>{let x=m.target instanceof Element?m.target.closest('a[href^="#"]'):null;x&&t.includes(x)&&a(x)};o(),h(),window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),n.addEventListener("scroll",o,{passive:!0}),n.addEventListener("click",u);let b;return typeof ResizeObserver<"u"&&(b=new ResizeObserver(()=>{o(),d()}),b.observe(n)),()=>{c&&cancelAnimationFrame(c),window.removeEventListener("scroll",d),window.removeEventListener("resize",d),n.removeEventListener("scroll",o),n.removeEventListener("click",u),b?.disconnect(),s(),r?.removeAttribute("aria-current"),delete n.dataset.atStart,delete n.dataset.atEnd}}var _i=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 F=function(n,e,t,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"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t},R=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},pe,qe,We,we,Ot,Te,je,ne,Le,K,Ye,Mi;var M={__proto__:null};M.enumerable=!0;Object.freeze(M);var Pt=(K=class{constructor(e,t={}){if(pe.set(this,!1),qe.set(this,!1),We.set(this,!1),we.set(this,!1),Ot.set(this,Date.now()),Te.set(this,!1),je.set(this,void 0),ne.set(this,void 0),Le.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:i,cancelable:s,composed:r}=t;F(this,pe,!!s,"f"),F(this,qe,!!i,"f"),F(this,We,!!r,"f"),F(this,je,`${e}`,"f"),F(this,ne,null,"f"),F(this,Le,!1,"f")}initEvent(e,t,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){F(this,we,!0,"f")}get target(){return R(this,ne,"f")}get currentTarget(){return R(this,ne,"f")}get srcElement(){return R(this,ne,"f")}get type(){return R(this,je,"f")}get cancelable(){return R(this,pe,"f")}get defaultPrevented(){return R(this,pe,"f")&&R(this,we,"f")}get timeStamp(){return R(this,Ot,"f")}composedPath(){return R(this,Le,"f")?[R(this,ne,"f")]:[]}get returnValue(){return!R(this,pe,"f")||!R(this,we,"f")}get bubbles(){return R(this,qe,"f")}get composed(){return R(this,We,"f")}get eventPhase(){return R(this,Le,"f")?K.AT_TARGET:K.NONE}get cancelBubble(){return R(this,Te,"f")}set cancelBubble(e){e&&F(this,Te,!0,"f")}stopPropagation(){F(this,Te,!0,"f")}get isTrusted(){return!1}},pe=new WeakMap,qe=new WeakMap,We=new WeakMap,we=new WeakMap,Ot=new WeakMap,Te=new WeakMap,je=new WeakMap,ne=new WeakMap,Le=new WeakMap,K.NONE=0,K.CAPTURING_PHASE=1,K.AT_TARGET=2,K.BUBBLING_PHASE=3,K);Object.defineProperties(Pt.prototype,{initEvent:M,stopImmediatePropagation:M,preventDefault:M,target:M,currentTarget:M,srcElement:M,type:M,cancelable:M,defaultPrevented:M,timeStamp:M,composedPath:M,returnValue:M,bubbles:M,composed:M,eventPhase:M,cancelBubble:M,stopPropagation:M,isTrusted:M});var Ni=(Mi=class extends Pt{constructor(e,t={}){super(e,t),Ye.set(this,void 0),F(this,Ye,t?.detail??null,"f")}initCustomEvent(e,t,i,s){throw new Error("Method not implemented.")}get detail(){return R(this,Ye,"f")}},Ye=new WeakMap,Mi);Object.defineProperties(Ni.prototype,{detail:M});var G=Pt,It=Ni;var O;var ro=(O=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}},O.STYLE_RULE=1,O.CHARSET_RULE=2,O.IMPORT_RULE=3,O.MEDIA_RULE=4,O.FONT_FACE_RULE=5,O.PAGE_RULE=6,O.NAMESPACE_RULE=10,O.KEYFRAMES_RULE=7,O.KEYFRAME_RULE=8,O.SUPPORTS_RULE=12,O.COUNTER_STYLE_RULE=11,O.FONT_FEATURE_VALUES_RULE=14,O.MARGIN_RULE=9,O);globalThis.Event??=G;globalThis.CustomEvent??=It;var Dt=Symbol(),$i=n=>typeof n=="boolean"?n:n?.capture??!1,V={__proto__:null};V.enumerable=!0;Object.freeze(V);var Ke=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,i){if(t==null)return;let s=$i(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(t))return;let o=typeof i=="object"&&i?i:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,i)),r.set(t,o??{})}removeEventListener(e,t,i){if(t==null)return;let s=$i(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(t),r.size||s.delete(e))}dispatchEvent(e){let t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));let i=!1,s=!1,r=G.NONE,o=null,l=null,a=null,h=e.stopPropagation,c=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??l},...V},srcElement:{get(){return e.target},...V},currentTarget:{get(){return a},...V},eventPhase:{get(){return r},...V},composedPath:{value:()=>t,...V},stopPropagation:{value:()=>{i=!0,h.call(e)},...V},stopImmediatePropagation:{value:()=>{s=!0,c.call(e)},...V}});let d=(g,p,w)=>{typeof g=="function"?g(e):typeof g?.handleEvent=="function"&&g.handleEvent(e),p.once&&w.delete(g)},u=()=>(a=null,r=G.NONE,!e.defaultPrevented),b=t.slice().reverse();o=!this.__host||!e.composed?this:null;let m=g=>{for(l=this;l.__host&&g.includes(l.__host);)l=l.__host};for(let g of b){!o&&(!l||l===g.__host)&&m(b.slice(b.indexOf(g))),a=g,r=g===e.target?G.AT_TARGET:G.CAPTURING_PHASE;let p=g.__captureEventListeners.get(e.type);if(p){for(let[w,v]of p)if(d(w,v,p),s)return u()}if(i)return u()}let x=e.bubbles?t:[this];l=null;for(let g of x){!o&&(!l||g===l.__host)&&m(x.slice(0,x.indexOf(g)+1)),a=g,r=g===e.target?G.AT_TARGET:G.BUBBLING_PHASE;let p=g.__eventListeners.get(e.type);if(p){for(let[w,v]of p)if(d(w,v,p),s)return u()}if(i)return u()}return u()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Pi,Ms]}};var Ri=new WeakMap,Ae=n=>{let e=Ri.get(n);return e===void 0&&Ri.set(n,e=new Map),e},Ce=class extends Ke{getRootNode(e){return e?.composed?Ht:this.__host?.__shadowRoot??Ht}};var Oi=class extends Ce{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Pi=new Oi,Ht=Pi;var Ii=class extends Ce{constructor(e){if(super(),e!==Dt)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:Xe,customElements:Ft,document:Ht,Document:Oi,Element:Hi,EventTarget:Ke,HTMLElement:Di,Node:Ce,ShadowRoot:Bi,window:this,Window:Ii})}};var Hi=class extends Ce{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Ae(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){Ae(this).set(e,String(t))}removeAttribute(e){Ae(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return Ae(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new Bi(Dt,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new _i(this);return this.__internals=e,e}getAttribute(e){return Ae(this).get(e)??null}};var Di=class extends Hi{},Bt=Di;var Bi=class extends Ce{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new Bt,"localName",{get(){return"lit-server-root"}});function ks(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}var Xe=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
|
|
2
|
+
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]}),this.__reverseDefinitions.set(t,e),this.__pendingWhenDefineds.get(e)?.resolve(t),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let t=this.__definitions.get(e);if(t)return t.ctor;let i=this.__pendingWhenDefineds.get(e);return i||(i=ks(),this.__pendingWhenDefineds.set(e,i)),i.promise}},_s=Xe;var Ft=new _s,Ms=new Ii(Dt);var ke=globalThis,Qe=ke.ShadowRoot&&(ke.ShadyCSS===void 0||ke.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,zi=Symbol(),Fi=new WeakMap,Je=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==zi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Qe&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=Fi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Fi.set(t,e))}return e}toString(){return this.cssText}},Ui=n=>new Je(typeof n=="string"?n:n+"",void 0,zi);var Gi=(n,e)=>{if(Qe)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),s=ke.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},zt=Qe||ke.CSSStyleSheet===void 0?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return Ui(t)})(n):n;var{is:Ns,defineProperty:$s,getOwnPropertyDescriptor:Rs,getOwnPropertyNames:Os,getOwnPropertySymbols:Ps,getPrototypeOf:Is}=Object,Me=globalThis;Me.customElements??=Ft;var Vi=Me.trustedTypes,Hs=Vi?Vi.emptyScript:"",Ds=Me.reactiveElementPolyfillSupport,_e=(n,e)=>n,Ut={toAttribute(n,e){switch(e){case Boolean:n=n?Hs:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Wi=(n,e)=>!Ns(n,e),qi={attribute:!0,type:String,converter:Ut,reflect:!1,useDefault:!1,hasChanged:Wi};Symbol.metadata??=Symbol("metadata"),Me.litPropertyMetadata??=new WeakMap;var q=class extends(globalThis.HTMLElement??Bt){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=qi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&$s(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){let{get:s,set:r}=Rs(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let l=s?.call(this);r?.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??qi}static _$Ei(){if(this.hasOwnProperty(_e("elementProperties")))return;let e=Is(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(_e("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_e("properties"))){let t=this.properties,i=[...Os(t),...Ps(t)];for(let s of i)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let s of i)t.unshift(zt(s))}else e!==void 0&&t.push(zt(e));return t}static _$Eu(e,t){let i=t.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,t=this.constructor.elementProperties;for(let i of t.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 Gi(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){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:Ut).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){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:Ut;this._$Em=s;let l=o.fromAttribute(t,r.type);this[s]=l??this._$Ej?.get(s)??l,this._$Em=null}}requestUpdate(e,t,i,s=!1,r){if(e!==void 0){let o=this.constructor;if(s===!1&&(r=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??Wi)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,r]of i){let{wrapped:o}=r,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,r,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};q.elementStyles=[],q.shadowRootOptions={mode:"open"},q[_e("elementProperties")]=new Map,q[_e("finalized")]=new Map,Ds?.({ReactiveElement:q}),(Me.reactiveElementVersions??=[]).push("2.1.2");var et=globalThis,ji=n=>n,Ze=et.trustedTypes,Yi=Ze?Ze.createPolicy("lit-html",{createHTML:n=>n}):void 0,en="$lit$",X=`lit$${Math.random().toFixed(9).slice(2)}$`,tn="?"+X,Bs=`<${tn}>`,oe=et.document===void 0?{createTreeWalker:()=>({})}:document,$e=()=>oe.createComment(""),Re=n=>n===null||typeof n!="object"&&typeof n!="function",Kt=Array.isArray,Fs=n=>Kt(n)||typeof n?.[Symbol.iterator]=="function",Gt=`[
|
|
3
|
+
\f\r]`,Ne=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ki=/-->/g,Xi=/>/g,se=RegExp(`>|${Gt}(?:([^\\s"'>=/]+)(${Gt}*=${Gt}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ji=/'/g,Qi=/"/g,nn=/^(?:script|style|textarea|title)$/i,Xt=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),C=Xt(1),_=Xt(2),Fo=Xt(3),ae=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),Zi=new WeakMap,re=oe.createTreeWalker(oe,129);function sn(n,e){if(!Kt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yi!==void 0?Yi.createHTML(e):e}var zs=(n,e)=>{let t=n.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Ne;for(let l=0;l<t;l++){let a=n[l],h,c,d=-1,u=0;for(;u<a.length&&(o.lastIndex=u,c=o.exec(a),c!==null);)u=o.lastIndex,o===Ne?c[1]==="!--"?o=Ki:c[1]!==void 0?o=Xi:c[2]!==void 0?(nn.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=se):c[3]!==void 0&&(o=se):o===se?c[0]===">"?(o=s??Ne,d=-1):c[1]===void 0?d=-2:(d=o.lastIndex-c[2].length,h=c[1],o=c[3]===void 0?se:c[3]==='"'?Qi:Ji):o===Qi||o===Ji?o=se:o===Ki||o===Xi?o=Ne:(o=se,s=void 0);let b=o===se&&n[l+1].startsWith("/>")?" ":"";r+=o===Ne?a+Bs:d>=0?(i.push(h),a.slice(0,d)+en+a.slice(d)+X+b):a+X+(d===-2?l:b)}return[sn(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Oe=class n{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[h,c]=zs(e,t);if(this.el=n.createElement(h,i),re.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=re.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith(en)){let u=c[o++],b=s.getAttribute(d).split(X),m=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:m[2],strings:b,ctor:m[1]==="."?qt:m[1]==="?"?Wt:m[1]==="@"?jt:be}),s.removeAttribute(d)}else d.startsWith(X)&&(a.push({type:6,index:r}),s.removeAttribute(d));if(nn.test(s.tagName)){let d=s.textContent.split(X),u=d.length-1;if(u>0){s.textContent=Ze?Ze.emptyScript:"";for(let b=0;b<u;b++)s.append(d[b],$e()),re.nextNode(),a.push({type:2,index:++r});s.append(d[u],$e())}}}else if(s.nodeType===8)if(s.data===tn)a.push({type:2,index:r});else{let d=-1;for(;(d=s.data.indexOf(X,d+1))!==-1;)a.push({type:7,index:r}),d+=X.length-1}r++}}static createElement(e,t){let i=oe.createElement("template");return i.innerHTML=e,i}};function fe(n,e,t=n,i){if(e===ae)return e;let s=i!==void 0?t._$Co?.[i]:t._$Cl,r=Re(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=s:t._$Cl=s),s!==void 0&&(e=fe(n,s._$AS(n,e.values),s,i)),e}var Vt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??oe).importNode(t,!0);re.currentNode=s;let r=re.nextNode(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let h;a.type===2?h=new Pe(r,r.nextSibling,this,e):a.type===1?h=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(h=new Yt(r,this,e)),this._$AV.push(h),a=i[++l]}o!==a?.index&&(r=re.nextNode(),o++)}return re.currentNode=oe,s}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Pe=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=fe(this,e,t),Re(e)?e===y||e==null||e===""?(this._$AH!==y&&this._$AR(),this._$AH=y):e!==this._$AH&&e!==ae&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Fs(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!==y&&Re(this._$AH)?this._$AA.nextSibling.data=e:this.T(oe.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Oe.createElement(sn(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Vt(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=Zi.get(e.strings);return t===void 0&&Zi.set(e.strings,t=new Oe(e)),t}k(e){Kt(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,s=0;for(let r of e)s===t.length?t.push(i=new n(this.O($e()),this.O($e()),this,this.options)):i=t[s],i._$AI(r),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let i=ji(e).nextSibling;ji(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},be=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=e,this.name=t,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=y}_$AI(e,t=this,i,s){let r=this.strings,o=!1;if(r===void 0)e=fe(this,e,t,0),o=!Re(e)||e!==this._$AH&&e!==ae,o&&(this._$AH=e);else{let l=e,a,h;for(e=r[0],a=0;a<r.length-1;a++)h=fe(this,l[i+a],t,a),h===ae&&(h=this._$AH[a]),o||=!Re(h)||h!==this._$AH[a],h===y?e=y:e!==y&&(e+=(h??"")+r[a+1]),this._$AH[a]=h}o&&!s&&this.j(e)}j(e){e===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},qt=class extends be{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===y?void 0:e}},Wt=class extends be{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==y)}},jt=class extends be{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=fe(this,e,t,0)??y)===ae)return;let i=this._$AH,s=e===y&&i!==y||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==y&&(i===y||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)}},Yt=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){fe(this,e)}};var Us=et.litHtmlPolyfillSupport;Us?.(Oe,Pe),(et.litHtmlVersions??=[]).push("3.3.3");var rn=(n,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=t?.renderBefore??null;i._$litPart$=s=new Pe(e.insertBefore($e(),r),r,void 0,t??{})}return s._$AI(n),s};var Jt=globalThis,J=class extends q{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=rn(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ae}};J._$litElement$=!0,J.finalized=!0,Jt.litElementHydrateSupport?.({LitElement:J});var Gs=Jt.litElementPolyfillSupport;Gs?.({LitElement:J});(Jt.litElementVersions??=[]).push("4.2.2");var on={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:n=>`${n} result${n===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:n=>`${n} active`,remove:"Remove",removeNamed:n=>`Remove ${n}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:n=>`${n}: no data`,seriesNumber:n=>`Series ${n}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark"};function Qt(){return de("element-strings",()=>({values:{...on},listeners:new Set}))}function Vs(n){let e=Qt(),t={...e.values};for(let[i,s]of Object.entries(n))s!==void 0&&Object.hasOwn(on,i)&&(t[i]=s);e.values=t;for(let i of Array.from(e.listeners))i()}function T(){return Qt().values}function an(n){let e=Qt().listeners;return e.add(n),()=>{e.delete(n)}}var E=class extends J{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=an(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function k(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function S(n,e){customElements.get(n)||customElements.define(n,e)}function Q(n){return!!n&&getComputedStyle(n).direction==="rtl"}function tt(n,e){let t=null,i=()=>Array.from(n.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,l=null,a=-1;for(let h of i()){if(e?.(h),!h.getAttribute("href"))continue;let c;try{c=new URL(h.getAttribute("href"),location.href)}catch{continue}if(c.origin!==location.origin)continue;if(c.hash&&c.pathname===location.pathname){c.hash===location.hash&&(l=h,a=1/0);continue}let d=c.pathname;(d==="/"?o==="/":o===d||o.startsWith(d.endsWith("/")?d:`${d}/`))&&d.length>a&&(l=h,a=d.length)}if(!l){t?.removeAttribute("aria-current"),t=null;return}for(let h of i())h.removeAttribute("aria-current");l.setAttribute("aria-current","page"),t=l},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(n,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(n,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var it=class extends E{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#i=null;#t=null;constructor(){super(),this.label="",this.lg=!1}connectedCallback(){super.connectedCallback(),k(()=>this.#n())}#n(){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.#r(),this.#t=tt(e,t=>t.classList.add("nish-bottom-nav-item")),this.#i=Rt(e,"--nish-bottom-nav-h")}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#t?.(),this.#t=null,this.#i?.(),this.#i=null}updated(e){this.#r()}#r(){this.#e&&(this.#e.setAttribute("aria-label",this.label||T().sections),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}};S("nish-bottom-nav",it);var ln=0,nt=class extends E{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;opener=null;value="";waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.value="",this.open=!1,this.dialog.close())}show(){this.open=!0}close(e=""){this.dialog?.open&&(this.value=e),this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-dialog-open]");t&&t.getAttribute("data-dialog-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-dialog",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("click",this.onDialogClick),e.addEventListener("keydown",this.onKey),e.addEventListener("cancel",this.onCancel),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-dialog-title"),i=e.querySelector(".nish-dialog-body");t?(t.id||(t.id=`nish-dialog-title-${++ln}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),i?(i.id||(i.id=`nish-dialog-body-${++ln}`),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 t=this.dialog;if(t){if(e.target===t){let i=t.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")===t&&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 t=this.opener;this.opener=null,t?.isConnected&&t.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};S("nish-dialog",nt);var qs=0,st=class extends E{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;closeSheet=null;waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.open=!1,this.dialog.close())}show(){this.open=!0}close(){this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let t=e.target.closest("[data-sheet-open]");t&&t.getAttribute("data-sheet-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-sheet",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let t=e.querySelector(".nish-sheet-title");t?(t.id||(t.id=`nish-sheet-title-${++qs}`),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"))}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?this.closeSheet=Ci(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()}};S("nish-sheet",st);var rt=class extends E{static properties={labelled:{type:Boolean,reflect:!0},pill:{type:Boolean,reflect:!0},labelSystem:{attribute:"label-system"},labelLight:{attribute:"label-light"},labelDark:{attribute:"label-dark"}};#e=null;#i=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#c()}disconnectedCallback(){super.disconnectedCallback(),this.#a()}updated(e){this.#e&&this.#t!==this.#r()&&this.#c()}#t="";#n(){let e=T();return[this.labelSystem||e.themeSystem,this.labelLight||e.themeLight,this.labelDark||e.themeDark]}#r(){return JSON.stringify([this.labelled,this.pill,...this.#n()])}#a(){this.#i?.(),this.#i=null,this.#e?.remove(),this.#e=null}#c(){this.#a(),this.#t=this.#r();let e=document.createElement("button");e.className="nish-theme-btn",e.classList.toggle("nish-theme-btn--labelled",this.labelled),e.classList.toggle("nish-theme-btn--pill",this.pill),this.prepend(e),this.#e=e;let[t,i,s]=this.#n(),r={system:t,light:i,dark:s};this.#i=Li(e,{showLabel:this.labelled,labels:r})}};S("nish-theme-toggle",rt);var cn="http://www.w3.org/2000/svg";function hn(n,e){let t=document.createElementNS(cn,"svg");for(let[i,s]of Object.entries({width:String(n),height:String(n),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))t.setAttribute(i,s);for(let i of e){let s=document.createElementNS(cn,"path");s.setAttribute("d",i),t.appendChild(s)}return t}var ot=n=>hn(n,["M18 6 6 18M6 6l12 12"]),dn=n=>hn(n,["M22 3H2l8 9.46V19l4 2v-8.54L22 3z"]);var at=class extends E{static properties={label:{type:String,reflect:!0},scrollable:{attribute:"scroll",type:Boolean,reflect:!0},single:{type:Boolean,reflect:!0}};#e=null;#i=null;#t=null;#n=e=>this.#u(e);constructor(){super(),this.label="",this.scrollable=!1,this.single=!1}get values(){return this.#e?this.#a().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#s(e)):this.#t??[]}set values(e){if(!this.#e){this.#t=[...e];return}let t=new Set(e),i=!1;for(let s of this.#a()){let r=t.has(this.#s(s))&&!(this.single&&i);r&&(i=!0),s.setAttribute("aria-pressed",String(r))}}connectedCallback(){super.connectedCallback(),k(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#n),this.#e=null}updated(e){this.#o(),this.#r()}#r(){if(!this.#e)return;let e=T();for(let t of this.#a()){let i=t.querySelector(":scope > [data-nish-remove]");if(!i)continue;let s=this.#c(t);i.setAttribute("aria-label",s?e.removeNamed(s):e.remove)}}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button, :scope > .nish-chip")):[]}#c(e){let t="";return e.childNodes.forEach(i=>{(i.nodeType===Node.TEXT_NODE||i instanceof HTMLElement&&!i.hasAttribute("data-nish-remove"))&&(t+=i.textContent??"")}),t.trim()}#s(e){return e.getAttribute("value")??this.#c(e)}#l(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-chips");if(!e){for(e=document.createElement("div"),e.className="nish-chips";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,e.setAttribute("role","group"),e.addEventListener("click",this.#n),this.#o(),this.#d(),this.#t&&(this.values=this.#t,this.#t=null),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#d(),this.#h()}),this.#h()}#h(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#o(){this.#e&&(this.label?this.#e.setAttribute("aria-label",this.label):this.#e.removeAttribute("aria-label"),this.#e.classList.toggle("nish-chips--scroll",this.scrollable))}#d(){for(let e of this.#a())if(e.classList.add("nish-chip"),e instanceof HTMLButtonElement)e.hasAttribute("type")||(e.type="button"),e.hasAttribute("aria-pressed")||e.setAttribute("aria-pressed","false");else if(e.hasAttribute("data-removable")&&!e.querySelector(":scope > [data-nish-remove]")){let t=this.#c(e),i=document.createElement("button");i.type="button",i.className="nish-icon-btn nish-icon-btn--xs",i.setAttribute("data-nish-remove",""),i.setAttribute("aria-label",t?T().removeNamed(t):T().remove),i.appendChild(ot(12)),e.appendChild(i)}}#u(e){let t=e.target;if(!t||!this.#e)return;let i=t.closest("[data-nish-remove]");if(i&&this.#e.contains(i)){let o=i.parentElement,l=this.#s(o);o.remove(),this.dispatchEvent(new CustomEvent("nish-remove",{bubbles:!0,detail:{value:l}}));return}let s=t.closest("button");if(!s||s.parentElement!==this.#e||s.disabled||!s.hasAttribute("aria-pressed"))return;let r=s.getAttribute("aria-pressed")!=="true";if(r&&this.single)for(let o of this.#a())o!==s&&o.hasAttribute("aria-pressed")&&o.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};S("nish-chip-group",at);var un=(n,e)=>{let t=e.trim().toLowerCase();return t?n.label.toLowerCase().includes(t)||(n.hint?.toLowerCase().includes(t)??!1):!0};var Ys=0,mn="http://www.w3.org/2000/svg",Ks="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function pn(n){let e=document.createElementNS(mn,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","16"),e.setAttribute("height","16"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");let t=document.createElementNS(mn,"path");return t.setAttribute("d",n),e.append(t),e}var lt=class extends E{static properties={value:{type:String,reflect:!0},placeholder:{type:String},label:{type:String},allowCustom:{type:Boolean,attribute:"allow-custom",reflect:!0},emptyText:{type:String,attribute:"empty-text"},size:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},name:{type:String},options:{attribute:!1},filter:{attribute:!1}};#e=++Ys;#i=null;#t=null;#n=null;#r=null;#a=null;#c=null;#s=!1;#l="";#h=!1;#o=-1;#d;#u=!1;constructor(){super(),this.value=null,this.placeholder=null,this.label=null,this.allowCustom=!1,this.emptyText="",this.size=null,this.disabled=!1,this.loading=!1,this.name=null,this.options=[],this.filter=null}get input(){return this.#t}connectedCallback(){if(super.connectedCallback(),this.#i){this.#w();return}this.#u||(this.#u=!0,k(()=>{this.#u=!1,this.isConnected&&this.#m()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#d),this.#f()}#m(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(a=>({value:a.value,label:a.textContent?.trim()??a.value,hint:a.dataset.hint||void 0,disabled:a.disabled||void 0}));for(let a of e)a.remove();this.options.length===0&&t.length>0&&(this.options=t);let i=document.createElement("div");i.className="nish-combobox";let s=document.createElement("input");s.type="text",s.className="nish-input nish-combobox-input",s.setAttribute("role","combobox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#_(s.value)),s.addEventListener("keydown",a=>this.#N(a)),s.addEventListener("focus",()=>this.#x()),s.addEventListener("click",()=>this.#x()),s.addEventListener("blur",()=>{this.#k()||(this.#f(),this.#v(),this.#w())}),s.addEventListener("change",a=>a.stopPropagation());let r=document.createElement("button");r.type="button",r.className="nish-icon-btn nish-combobox-clear",r.tabIndex=-1,r.hidden=!0,r.append(pn("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",a=>a.preventDefault()),r.addEventListener("click",()=>{this.#f(),this.#L(null,null),s.focus()});let o=document.createElement("span");o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.style.cssText=Ks;let l=document.createElement("input");l.type="hidden",i.append(s,r,o),this.append(i,l),this.#i=i,this.#t=s,this.#n=r,this.#r=o,this.#c=l,this.#w()}updated(e){e.has("value")&&e.get("value")!==void 0&&this.#v(),e.has("disabled")&&this.disabled&&this.#f(),(e.has("options")||e.has("filter")||e.has("loading"))&&this.#E(),this.#w()}get#g(){return this.options.find(e=>e.value===this.value)??null}get#b(){return this.value!=null&&this.value!==""}get#S(){return this.#h?this.#l:this.#g?.label??this.value??""}get#p(){let e=this.filter??un;return(this.#h?this.options.filter(i=>e(i,this.#l)):this.options).slice(0,50)}#E(){this.#o>=this.#p.length&&(this.#o=-1)}#v(){this.#h=!1,this.#l=""}#x(){if(this.#s||this.disabled||!this.#t)return;this.#s=!0;let e=this.#g,t=e?this.#p.findIndex(i=>i.value===e.value):-1;this.#o=t>=0?t:-1,this.#w()}#f(){this.#s=!1,this.#o=-1,this.#a?.remove(),this.#a=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#r&&(this.#r.textContent="")}#y(e,t){let i=this.#p,s=i.length;if(s===0)return-1;let r=e;for(let o=0;o<s;o++)if(r=(r+t+s)%s,!i[r].disabled)return r;return-1}#T(e){return e===1?this.#y(-1,1):this.#y(0,-1)}#L(e,t){this.value=e,this.#v(),this.#w();let i={value:e,option:t};this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:i}))}#A(e){e.disabled||(this.#f(),this.#L(e.value,e))}#k(){return!this.#h||this.#l.trim()!==""||!this.#b?!1:(this.#f(),this.#L(null,null),!0)}#C(){let e=this.#l.trim();if(!this.allowCustom||!this.#h||!e)return!1;let t=this.options.find(i=>!i.disabled&&i.label.toLowerCase()===e.toLowerCase());return this.#f(),t?this.#L(t.value,t):this.#L(e,null),!0}#_(e){this.#l=e,this.#h=!0,this.#s=!0,this.allowCustom||e.trim()===""?this.#o=-1:this.#o=this.#p.findIndex(t=>!t.disabled),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#w()}#N(e){if(this.disabled)return;let t=this.#p;switch(e.key){case"ArrowDown":case"ArrowUp":{e.preventDefault();let i=e.key==="ArrowDown"?1:-1;if(this.#s){this.#M(this.#o<0?this.#T(i):this.#y(this.#o,i));break}else{this.#s=!0;let s=this.#g,r=s?t.findIndex(o=>o.value===s.value):-1;this.#o=r>=0?r:this.#T(i)}this.#w();break}case"Home":case"End":this.#s&&(e.preventDefault(),this.#M(this.#T(e.key==="Home"?1:-1)));break;case"Enter":this.#s&&this.#o>=0&&t[this.#o]?(e.preventDefault(),this.#A(t[this.#o])):(this.#k()||this.#C()||this.#s)&&e.preventDefault();break;case"Escape":this.#s?(e.preventDefault(),e.stopPropagation(),this.#f(),this.#w()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#v(),this.#w());break;case"Tab":this.#f();break}}#w(){let e=this.#t,t=this.#i;if(!e||!t||!this.#n||!this.#c||!this.#r)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let i=this.#S;e.value!==i&&(e.value=i),e.disabled=this.disabled,this.placeholder?e.placeholder=this.placeholder:e.removeAttribute("placeholder"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),this.#n.setAttribute("aria-label",T().clear),this.#n.hidden=!(this.#b&&!this.disabled);let s=this.#c;if(this.name?s.name=this.name:s.removeAttribute("name"),s.value=this.value??"",s.disabled=this.disabled,!this.#s){this.#a&&this.#f();return}this.#$(e,t,this.#r)}#M(e){let t=this.#o;this.#o=e;let i=this.#a,s=this.#t;if(!i||!s||!this.#s){this.#w();return}i.querySelector("[data-active]")?.removeAttribute("data-active");let r=e>=0?i.querySelector(`[data-index="${e}"]`):null;if(!r){t!==e?this.#w():s.removeAttribute("aria-activedescendant");return}r.dataset.active="",s.setAttribute("aria-activedescendant",r.id),r.scrollIntoView?.({block:"nearest"})}#$(e,t,i){let s=T(),r=`nish-cb-list-${this.#e}`,o=this.#p,l=this.#g,a=this.#a;if(!a){a=document.createElement("ul"),a.id=r,a.className="nish-combobox-list",a.setAttribute("role","listbox");let c=d=>{let u=d.target?.closest("li[data-index]");if(!u||!a.contains(u))return null;let b=Number(u.dataset.index),m=this.#p[b];return m?{o:m,i:b}:null};a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("mousemove",d=>{let u=c(d);u&&!u.o.disabled&&this.#o!==u.i&&this.#M(u.i)}),a.addEventListener("click",d=>{let u=c(d);u&&this.#A(u.o)}),this.#a=a,t.append(a)}this.label?(a.setAttribute("aria-label",this.label),a.removeAttribute("aria-labelledby")):(a.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),a.setAttribute("aria-labelledby",e.id));let h=o.map((c,d)=>{let u=document.createElement("li");u.id=`${r}-opt-${d}`,u.className="nish-combobox-option",u.setAttribute("role","option"),u.dataset.index=String(d),u.setAttribute("aria-selected",String(l?.value===c.value)),c.disabled&&u.setAttribute("aria-disabled","true"),d===this.#o&&(u.dataset.active="");let b=document.createElement("span");if(b.className="nish-combobox-label",b.textContent=c.label,u.append(b),c.hint){let m=document.createElement("span");m.className="nish-combobox-hint",m.textContent=c.hint,u.append(m)}return l?.value===c.value&&u.append(pn("M20 6 9 17l-5-5")),u});if(this.loading){let c=document.createElement("li");c.setAttribute("role","presentation"),c.className="nish-combobox-loading";let d=document.createElement("span");d.className="nish-spinner nish-spinner--sm",d.setAttribute("aria-hidden","true"),c.append(d,document.createTextNode(s.searching)),h.push(c)}else if(o.length===0){let c=document.createElement("li");c.setAttribute("role","presentation"),c.className="nish-combobox-empty",c.textContent=this.emptyText||s.noMatches,h.push(c)}a.replaceChildren(...h),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#o>=0&&o[this.#o]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#o}`):e.removeAttribute("aria-activedescendant"),i.textContent=this.loading?s.searching:o.length===0?this.emptyText||s.noMatches:s.resultCount(o.length),this.#R(a,e),a.querySelector(`[data-index="${this.#o}"]`)?.scrollIntoView?.({block:"nearest"})}#R(e,t){e.style.top="",e.style.bottom="",e.style.marginTop="",e.style.marginBottom="",delete e.dataset.above;let i=t.getBoundingClientRect(),s=e.getBoundingClientRect().height,r=window.innerHeight-i.bottom;s>r&&i.top>r&&(e.dataset.above="",e.style.top="auto",e.style.bottom="100%",e.style.marginTop="0",e.style.marginBottom="4px")}};S("nish-combobox",lt);var fn=1500,bn="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",Xs=_`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg>`,Js=_`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--nish-ok)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"></path></svg>`;async function Qs(n){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(n),!0}catch{}let e=document.createElement("textarea");e.value=n,e.setAttribute("readonly",""),e.style.cssText="position:fixed;top:-1000px;opacity:0";let t=document.activeElement;document.body.appendChild(e),e.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return e.remove(),t?.focus?.(),i}var ct=class extends E{static properties={value:{type:String,reflect:!0},for:{type:String,reflect:!0},label:{type:String,reflect:!0},copiedLabel:{attribute:"copied-label",reflect:!0},icon:{type:Boolean,reflect:!0},copied:{state:!0},manual:{state:!0}};#e=null;constructor(){super(),this.value=null,this.for=null,this.label="",this.copiedLabel="",this.icon=!1,this.copied=!1,this.manual=!1}disconnectedCallback(){super.disconnectedCallback(),this.#e&&clearTimeout(this.#e),this.#e=null,this.copied=!1,this.manual=!1}#i(){return this.value!=null?this.value:(this.for?document.getElementById(this.for):null)?.textContent??""}async#t(){let e=this.#i();if(!await Qs(e)){await this.#n();return}this.manual=!1,this.copied=!0,this.dispatchEvent(new CustomEvent("nish-copy",{bubbles:!0,detail:{text:e}})),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.copied=!1,this.#e=null},fn)}async#n(){this.copied=!1,this.manual=!0,await this.updateComplete;let e=this.value==null&&this.for?document.getElementById(this.for):null;if(e){let t=document.createRange();t.selectNodeContents(e);let i=window.getSelection();i?.removeAllRanges(),i?.addRange(t)}else{let t=this.querySelector("textarea[data-copy-source]");t?.focus(),t?.select()}this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{document.activeElement?.matches("textarea[data-copy-source]")&&this.contains(document.activeElement)&&this.querySelector("button")?.focus(),this.manual=!1,this.#e=null},fn)}render(){let e=T(),t=this.copiedLabel||e.copied,i=this.copied?t:this.manual?e.copyManual:this.label||e.copy,s=this.copied?Js:Xs;return C`${this.icon?C`<button type="button" class="nish-icon-btn nish-icon-btn--sm nish-copy-btn" aria-label=${i} title=${i} ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
5
5
|
${s}
|
|
6
6
|
</button>`:C`<button type="button" class="nish-btn nish-btn--sm nish-copy-btn" ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
7
|
-
${s}${
|
|
8
|
-
</button>`}<span role="status" aria-live="polite" style=${
|
|
9
|
-
${
|
|
7
|
+
${s}${i}
|
|
8
|
+
</button>`}<span role="status" aria-live="polite" style=${bn}>${this.copied?t:this.manual?e.copyManual:y}</span>${this.manual&&this.value!=null?C`<textarea data-copy-source readonly tabindex="-1" aria-label=${this.value} style=${bn} .value=${this.value}></textarea>`:y}`}};S("nish-copy-button",ct);var Zs=0,ht=class extends E{static properties={label:{type:String},hint:{type:String},error:{type:String},optional:{type:Boolean,reflect:!0},layout:{type:String,reflect:!0},labelWidth:{attribute:"label-width",reflect:!0}};#e=`nish-field-${++Zs}`;#i=null;#t=null;#n=null;#r=null;#a="";#c=!1;constructor(){super(),this.optional=!1,this.layout="stack"}connectedCallback(){super.connectedCallback(),k(()=>this.#s())}disconnectedCallback(){super.disconnectedCallback(),this.#n?.disconnect(),this.#n=null,this.#r?.disconnect(),this.#r=null,this.#i=null,this.#t=null}updated(e){this.#o()}#s(){if(!this.isConnected||this.#i)return;let e=this.querySelector(":scope > div.nish-field");if(!e){let t=this.firstElementChild;if(!t){this.#r||(this.#r=new MutationObserver(()=>{this.firstElementChild&&(this.#r?.disconnect(),this.#r=null,this.#s())}),this.#r.observe(this,{childList:!0}));return}e=document.createElement("div"),e.appendChild(t),this.appendChild(e)}e.classList.add("nish-field"),this.#i=e,this.#t=Array.from(e.children).find(t=>!t.matches("label.nish-field-label, small.nish-hint, small.nish-error")),this.#a=(this.#l()?.getAttribute("aria-describedby")??"").split(/\s+/).filter(t=>t&&t!==`${this.#e}-hint`&&t!==`${this.#e}-error`).join(" "),this.#o(),this.#t&&this.#t.localName.startsWith("nish-")&&(this.#n=new MutationObserver(()=>{this.#l()&&!this.#h()&&this.#o()}),this.#n.observe(this.#t,{childList:!0,subtree:!0}))}#l(){let e=this.#t;return e?e.localName==="nish-combobox"||e.localName==="nish-search"?e.querySelector("input"):e:null}#h(){let e=this.#l();return!!e&&!!e.id&&this.#i?.querySelector("label.nish-field-label")?.getAttribute("for")===e.id}#o(){let e=this.#i;if(!e)return;let t=this.layout==="inline";e.classList.toggle("nish-field--inline",t),t&&this.labelWidth?(e.style.setProperty("--nish-field-label-w",this.labelWidth),e.style.setProperty("--nish-field-label-width",this.labelWidth)):(e.style.removeProperty("--nish-field-label-w"),e.style.removeProperty("--nish-field-label-width"));let i=this.#l();i&&!i.id&&(i.id=`${this.#e}-control`);let s=i?.id??"",r=!!this.error,o=!!this.hint&&!r,l=e.querySelector(":scope > label.nish-field-label");if(this.label){if(l||(l=document.createElement("label"),l.className="nish-field-label",e.prepend(l)),s&&(l.htmlFor=s),l.textContent=this.label,this.optional){let c=document.createElement("span");c.className="nish-optional",c.textContent=T().optional,l.appendChild(c)}}else l?.remove();let a=`${this.#e}-hint`,h=`${this.#e}-error`;if(this.#d(e,"hint",o?this.hint:"",a),this.#d(e,"error",r?this.error:"",h),i){let c=[this.#a,r?h:o?a:""].filter(Boolean).join(" ");c?i.setAttribute("aria-describedby",c):i.removeAttribute("aria-describedby"),r?(i.setAttribute("aria-invalid","true"),this.#c=!0):this.#c&&(i.removeAttribute("aria-invalid"),this.#c=!1)}}#d(e,t,i,s){let r=e.querySelector(`:scope > small.nish-${t}`);if(!i){r?.remove();return}r||(r=document.createElement("small"),r.className=`nish-${t}`,t==="error"&&r.setAttribute("role","alert"),e.appendChild(r)),r.id=s,r.textContent!==i&&(r.textContent=i)}};S("nish-field",ht);var er=n=>_`<svg width=${n} height=${n} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.3-4.3"></path></svg>`,tr=_`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M18 6 6 18M6 6l12 12"></path></svg>`,dt=class extends E{static properties={value:{type:String},placeholder:{type:String},label:{type:String},size:{type:String,reflect:!0},variant:{type:String,reflect:!0},name:{type:String},disabled:{type:Boolean,reflect:!0}};constructor(){super(),this.value="",this.label="",this.size="md",this.variant="field",this.disabled=!1}get input(){return this.querySelector("input.nish-input")}focus(e){this.input?.focus(e)}#e(){this.dispatchEvent(new CustomEvent("nish-input",{bubbles:!0,detail:{value:this.value}}))}#i(e){this.value=e.target.value,this.#e()}#t(){this.value="";let e=this.input;e&&(e.value=""),this.#e(),this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0})),e?.focus()}#n(e){e.key==="Escape"&&this.value&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.#t())}render(){let e=T(),t=["nish-search"];return(this.size==="xs"||this.size==="sm")&&t.push(`nish-search--${this.size}`),this.variant==="bare"&&t.push("nish-search--bare"),C`<label class=${t.join(" ")}>
|
|
9
|
+
${er(this.size==="md"||!this.size?16:14)}
|
|
10
10
|
<input
|
|
11
11
|
class="nish-input"
|
|
12
12
|
type="search"
|
|
@@ -17,25 +17,25 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
17
17
|
name=${this.name??y}
|
|
18
18
|
?disabled=${this.disabled}
|
|
19
19
|
.value=${this.value??""}
|
|
20
|
-
@input=${
|
|
21
|
-
@keydown=${
|
|
20
|
+
@input=${i=>this.#i(i)}
|
|
21
|
+
@keydown=${i=>this.#n(i)}
|
|
22
22
|
/>
|
|
23
|
-
${this.value&&!this.disabled?C`<button type="button" class="nish-icon-btn nish-icon-btn--xs" aria-label=${e.clear} @click=${()=>this.#t()}>${
|
|
24
|
-
</label>`}};
|
|
23
|
+
${this.value&&!this.disabled?C`<button type="button" class="nish-icon-btn nish-icon-btn--xs" aria-label=${e.clear} @click=${()=>this.#t()}>${tr}</button>`:y}
|
|
24
|
+
</label>`}};S("nish-search",dt);function Zt(n){let e=()=>{let r=n.scrollWidth-n.clientWidth;n.dataset.atStart=String(n.scrollLeft<=1),n.dataset.atEnd=String(r<=1||n.scrollLeft>=r-1)};e(),n.addEventListener("scroll",e,{passive:!0});let t,i=()=>{if(t)for(let r of Array.from(n.children))t.observe(r)};typeof ResizeObserver<"u"&&(t=new ResizeObserver(e),t.observe(n),i());let s;return typeof MutationObserver<"u"&&(s=new MutationObserver(()=>{e(),i()}),s.observe(n,{childList:!0})),()=>{n.removeEventListener("scroll",e),t?.disconnect(),s?.disconnect()}}function ei(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=8;i.left<t.left+s?n.scrollLeft+=i.left-t.left-s:i.right>t.right-s&&(n.scrollLeft+=i.right-t.right+s)}var ir=0,gn=n=>n.replace(/[^\w-]+/g,"-"),ut=class extends E{static properties={label:{type:String,reflect:!0},value:{type:String,reflect:!0},variant:{type:String,reflect:!0},size:{type:String,reflect:!0},block:{type:Boolean,reflect:!0}};#e=null;#i="";#t=null;#n=null;#r=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#u(t)};#a=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(a=>a===document.activeElement),s=i>=0?i:Math.max(0,t.findIndex(a=>a.getAttribute("aria-selected")==="true")),r,o=Q(this.#e)?"ArrowLeft":"ArrowRight",l=Q(this.#e)?"ArrowRight":"ArrowLeft";if(e.key===o)r=t[(s+1)%t.length];else if(e.key===l)r=t[(s-1+t.length)%t.length];else if(e.key==="Home")r=t[0];else if(e.key==="End")r=t[t.length-1];else return;e.preventDefault(),this.#u(r),r.focus()};constructor(){super(),this.label="",this.value="",this.variant="",this.size="",this.block=!1}connectedCallback(){super.connectedCallback(),k(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#r),this.#e?.removeEventListener("keydown",this.#a),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#m()}#c(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-tabs");if(!e){e=document.createElement("div");for(let t of Array.from(this.children))t instanceof HTMLButtonElement&&e.appendChild(t);this.insertBefore(e,this.firstChild)}this.#e=e,this.#i=this.id||`nish-tabs-${++ir}`,e.setAttribute("role","tablist"),e.style.overflowX="auto",e.classList.add("nish-tabs","nish-no-scrollbar","nish-scroll-fade"),e.addEventListener("click",this.#r),e.addEventListener("keydown",this.#a),this.#t=Zt(e),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#m(),this.#s()}),this.#s(),this.#m()}#s(){this.#e&&this.#n?.observe(this.#e,{childList:!0})}#l(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button")):[]}#h(){return this.#l().filter(e=>!e.disabled)}#o(e){return e.getAttribute("value")??(e.textContent??"").trim()}#d(){let e=this.id?document:this,t=Array.from(e.querySelectorAll("[data-tab-panel]"));return this.id?t.filter(i=>i.getAttribute("data-tabs")===this.id):t}#u(e){if(e.disabled)return;let t=this.#o(e),i=t!==this.value;this.value=t,this.#g(),i&&this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0}))}#m(){let e=this.#e;if(!e)return;e.setAttribute("aria-label",this.label),e.classList.toggle("nish-tabs--pill",this.variant==="pill"),e.classList.toggle("nish-tabs--sm",this.size==="sm"),e.classList.toggle("nish-tabs--xs",this.size==="xs"),e.classList.toggle("nish-tabs--block",this.block);let t=this.#l();if(!t.some(i=>this.#o(i)===this.value&&!i.disabled)){let i=t.find(s=>!s.disabled);i&&(this.value=this.#o(i))}this.#g()}#g(){let e=this.#e;if(!e)return;let t=this.#l(),i=this.#d(),s=null;for(let o of t){let l=this.#o(o),a=l===this.value&&!o.disabled;a&&(s=o),o.id||(o.id=`${this.#i}-tab-${gn(l)}`),o.type="button",o.classList.add("nish-tab"),o.setAttribute("role","tab"),o.setAttribute("aria-selected",String(a));let h=i.find(c=>c.getAttribute("data-tab-panel")===l);h?(h.id||(h.id=`${this.#i}-panel-${gn(l)}`),o.setAttribute("aria-controls",h.id),h.setAttribute("role","tabpanel"),h.setAttribute("aria-labelledby",o.id),h.hidden=!a):o.removeAttribute("aria-controls")}let r=s??t.find(o=>!o.disabled)??null;for(let o of t)o.tabIndex=o===r?0:-1;s&&ei(e,s)}};S("nish-tabs",ut);var mt=class extends E{static properties={label:{type:String,reflect:!0},value:{type:String,reflect:!0},size:{type:String,reflect:!0},block:{type:Boolean,reflect:!0},overflow:{type:String,reflect:!0},name:{type:String,reflect:!0}};#e=null;#i=null;#t=null;#n=null;#r=e=>{let t=e.target?.closest("button");t&&this.#e?.contains(t)&&this.#d(t)};#a=e=>{let t=this.#h();if(!t.length)return;let i=t.findIndex(c=>c===document.activeElement),s=t.findIndex(c=>c.getAttribute("aria-checked")==="true"),r=i>=0?i:s,o,l=Q(this.#e),a=l?"ArrowLeft":"ArrowRight",h=l?"ArrowRight":"ArrowLeft";if(e.key===a||e.key==="ArrowDown")o=r<0?t[0]:t[(r+1)%t.length];else if(e.key===h||e.key==="ArrowUp")o=r<0?t[t.length-1]:t[(r-1+t.length)%t.length];else if(e.key==="Home")o=t[0];else if(e.key==="End")o=t[t.length-1];else return;e.preventDefault(),this.#d(o),o.focus()};constructor(){super(),this.label="",this.value="",this.size="",this.block=!1,this.overflow="scroll",this.name=""}connectedCallback(){super.connectedCallback(),k(()=>this.#c())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("click",this.#r),this.#e?.removeEventListener("keydown",this.#a),this.#e=null,this.#t?.(),this.#t=null,this.#n?.disconnect(),this.#n=null}updated(e){this.#u()}#c(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-seg");if(!e){e=document.createElement("div");for(let t of Array.from(this.children))t instanceof HTMLButtonElement&&e.appendChild(t);this.insertBefore(e,this.firstChild)}this.#e=e,e.classList.add("nish-seg"),e.setAttribute("role","radiogroup"),e.addEventListener("click",this.#r),e.addEventListener("keydown",this.#a),this.#n=new MutationObserver(()=>{this.#n?.disconnect(),this.#u(),this.#s()}),this.#s(),this.#u()}#s(){this.#e&&this.#n?.observe(this.#e,{childList:!0})}#l(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button")):[]}#h(){return this.#l().filter(e=>!e.disabled)}#o(e){return e.getAttribute("value")??(e.textContent??"").trim()}#d(e){if(e.disabled)return;let t=this.#o(e),i=t!==this.value;this.value=t,this.#m(),i&&(this.dispatchEvent(new CustomEvent("nish-change",{detail:{value:t},bubbles:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}#u(){let e=this.#e;if(!e)return;let t=this.overflow!=="wrap";e.setAttribute("aria-label",this.label),e.classList.toggle("nish-seg--xs",this.size==="xs"),e.classList.toggle("nish-seg--md",this.size==="md"),e.classList.toggle("nish-seg--block",this.block),e.classList.toggle("nish-no-scrollbar",t),e.classList.toggle("nish-scroll-fade",t),e.style.overflowX=t?"auto":"",t&&!this.#t?this.#t=Zt(e):!t&&this.#t&&(this.#t(),this.#t=null,delete e.dataset.atStart,delete e.dataset.atEnd),this.name?(this.#i||(this.#i=document.createElement("input"),this.#i.type="hidden",this.appendChild(this.#i)),this.#i.name=this.name):this.#i&&(this.#i.remove(),this.#i=null),this.#m()}#m(){let e=this.#e;if(!e)return;let t=this.#l(),i=null;for(let r of t){let o=this.#o(r)===this.value&&!r.disabled;o&&(i=r),r.type="button",r.setAttribute("role","radio"),r.setAttribute("aria-checked",String(o))}let s=i??t.find(r=>!r.disabled)??null;for(let r of t)r.tabIndex=r===s?0:-1;this.#i&&(this.#i.value=i?this.value:""),i&&this.overflow!=="wrap"&&ei(e,i)}};S("nish-segmented",mt);function nr(n,e,t,i){let s=t-e||1,r=[],o=-1,l=n[0],a=n[0],h=()=>{l===a?r.push(l):l.x<=a.x?r.push(l,a):r.push(a,l)};for(let c of n){let d=Math.min(i-1,Math.max(0,Math.floor((c.x-e)/s*i)));d!==o?(o>=0&&h(),o=d,l=c,a=c):(c.y<l.y&&(l=c),c.y>a.y&&(a=c))}return h(),r}function vn(n,e,t,i,s){let r=n.filter(v=>v!=null&&Number.isFinite(v)),o=r.length===0,l=1/0,a=-1/0;for(let v of r)v<l&&(l=v),v>a&&(a=v);let h=i??(o?0:l),c=s??(o?1:a),d=2,u=v=>n.length<=1?e/2:v/(n.length-1)*e,b=v=>c===h?t/2:d+(1-(v-h)/(c-h))*(t-2*d),m=[],x=[];n.forEach((v,P)=>{v==null||!Number.isFinite(v)?(x.length&&m.push(x),x=[]):x.push({x:u(P),y:b(v)})}),x.length&&m.push(x);let g=Math.max(1,Math.floor(e));for(let v=0;v<m.length;v++)m[v].length>g*2&&(m[v]=nr(m[v],0,e,g));let p=v=>v.length===1?`M${v[0].x},${v[0].y}h0`:v.map((P,H)=>`${H?"L":"M"}${P.x},${P.y}`).join(""),w=v=>v.length<2?"":`${p(v)}L${v[v.length-1].x},${t}L${v[0].x},${t}Z`;return{empty:o,lines:m.map(p),areas:m.map(w),baseline:`M0,${t/2}H${e}`}}var yn={"chart-1":"var(--nish-chart-1)","chart-2":"var(--nish-chart-2)","chart-3":"var(--nish-chart-3)","chart-4":"var(--nish-chart-4)","chart-5":"var(--nish-chart-5)","chart-6":"var(--nish-chart-6)","chart-7":"var(--nish-chart-7)","chart-8":"var(--nish-chart-8)",accent:"var(--nish-accent)",ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)"};function sr(n){if(n==null)return[];let e=n.trim();return e?e.split(",").map(t=>{let i=t.trim();if(i==="")return null;let s=Number(i);return Number.isFinite(s)?s:null}):[]}var pt=class extends E{static properties={values:{attribute:"values",reflect:!0,converter:{fromAttribute:e=>sr(e),toAttribute:e=>e.map(t=>t==null?"":String(t)).join(",")}},tone:{type:String,reflect:!0},label:{type:String,reflect:!0},width:{type:Number,reflect:!0},height:{type:Number,reflect:!0},fill:{type:Boolean,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0}};constructor(){super(),this.values=[],this.tone="chart-1",this.label="",this.width=120,this.height=28,this.fill=!1}render(){let e=Array.isArray(this.values)?this.values:[];if(e.length<2)return y;let t=this.width>0?this.width:120,i=this.height>0?this.height:28,{empty:s,lines:r,areas:o,baseline:l}=vn(e,t,i,this.min??void 0,this.max??void 0),a=s?"var(--nish-line-strong)":Object.hasOwn(yn,this.tone)?yn[this.tone]:"var(--nish-chart-1)",h=T(),c=this.label||h.trend;return C`<svg
|
|
25
25
|
class="nish-sparkline"
|
|
26
26
|
role="img"
|
|
27
27
|
aria-label=${s?h.noDataNamed(c):c}
|
|
28
28
|
width=${t}
|
|
29
|
-
height=${
|
|
30
|
-
viewBox="0 0 ${t} ${
|
|
29
|
+
height=${i}
|
|
30
|
+
viewBox="0 0 ${t} ${i}"
|
|
31
31
|
preserveAspectRatio="none"
|
|
32
32
|
style="color:${a}"
|
|
33
33
|
>
|
|
34
|
-
${s?
|
|
35
|
-
</svg>`}};
|
|
34
|
+
${s?_`<path d=${l} stroke="currentColor" stroke-width="1.5" stroke-dasharray="3 3" vector-effect="non-scaling-stroke"></path>`:_`${this.fill?o.map(d=>_`<path d=${d} fill="currentColor" fill-opacity="0.15"></path>`):y}${r.map(d=>_`<path d=${d} fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path>`)}`}
|
|
35
|
+
</svg>`}};S("nish-sparkline",pt);var rr=0,ft=class extends E{static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},label:{type:String},description:{type:String},size:{type:String,reflect:!0},labelSide:{attribute:"label-side",reflect:!0},name:{type:String}};#e=`nish-switch-${++rr}`;constructor(){super(),this.checked=!1,this.disabled=!1,this.size="md",this.labelSide="end"}get button(){return this.querySelector("button.nish-switch")}focus(e){this.button?.focus(e)}#i(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{checked:this.checked}})))}updated(e){e.has("checked")&&this.button?.setAttribute("aria-checked",String(this.checked))}render(){let e=!!this.label,t=e?C`<span style="min-width:0">
|
|
36
36
|
<span id=${`${this.#e}-label`} style="display:block;line-height:1.375">${this.label}</span>
|
|
37
37
|
${this.description?C`<span id=${`${this.#e}-desc`} style="display:block;margin-top:2px;font-size:var(--nish-text-xs);color:var(--nish-hi3)">${this.description}</span>`:y}
|
|
38
|
-
</span>`:y,
|
|
38
|
+
</span>`:y,i=this.labelSide==="start",s=C`<button
|
|
39
39
|
type="button"
|
|
40
40
|
class=${this.size==="sm"?"nish-switch nish-switch--sm":"nish-switch"}
|
|
41
41
|
role="switch"
|
|
@@ -44,44 +44,44 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
44
44
|
aria-describedby=${e&&this.description?`${this.#e}-desc`:y}
|
|
45
45
|
?disabled=${this.disabled}
|
|
46
46
|
@click=${()=>this.#i()}
|
|
47
|
-
></button>`;return C`<label class="nish-check-row" style=${
|
|
48
|
-
${
|
|
47
|
+
></button>`;return C`<label class="nish-check-row" style=${i?"justify-content:space-between":y}>
|
|
48
|
+
${i?t:y}${s}${i?y:t}
|
|
49
49
|
${this.name?C`<input type="hidden" name=${this.name} value="on" ?disabled=${!this.checked||this.disabled} />`:y}
|
|
50
|
-
</label>`}};
|
|
51
|
-
`).toLowerCase();return t.every(s=>n.includes(s))}function yn(i,e){let t=[],n=new Map;for(let s of i){if(!rr(s,e))continue;let r=s.group??null,o=n.get(r);o||(o=[],n.set(r,o),t.push(r)),o.push(s)}return t.sort((s,r)=>s===null?-1:r===null?1:0),t.flatMap(s=>n.get(s)).slice(0,50)}var ar=0,Pe="http://www.w3.org/2000/svg",lr="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function cr(){let i=document.createElementNS(Pe,"svg");for(let[t,n]of Object.entries({viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(t,n);let e=document.createElementNS(Pe,"path");return e.setAttribute("d","M18 6 6 18M6 6l12 12"),i.append(e),i}function hr(){let i=document.createElementNS(Pe,"svg");for(let[n,s]of Object.entries({viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(n,s);let e=document.createElementNS(Pe,"circle");e.setAttribute("cx","11"),e.setAttribute("cy","11"),e.setAttribute("r","8");let t=document.createElementNS(Pe,"path");return t.setAttribute("d","m21 21-4.3-4.3"),i.append(e,t),i}function En(i){globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: <nish-command-palette> did not follow an unsafe href (${JSON.stringify(i.slice(0,40))}). Only relative, #, http(s), mailto and tel URLs are followed.`)}function dr(i){if(!(i instanceof HTMLElement))return!1;let e=i.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||i.isContentEditable}var bt=class extends E{static properties={open:{type:Boolean,reflect:!0},hotkey:{type:Boolean,reflect:!0},placeholder:{type:String},emptyText:{type:String,attribute:"empty-text"},items:{attribute:!1}};#e=++ar;#i=null;#t=null;#n=null;#r=null;#a=null;#c="";#s=0;#l=[];#h=new Map;#o=null;#d;#u=!1;#m=!1;constructor(){super(),this.open=!1,this.hotkey=!1,this.placeholder="",this.emptyText="",this.items=[]}connectedCallback(){if(super.connectedCallback(),this.#b(),this.#i){this.#v();return}this.#u||(this.#u=!0,k(()=>{this.#u=!1,this.isConnected&&this.#p()}))}disconnectedCallback(){super.disconnectedCallback(),this.#g(!1),window.clearTimeout(this.#d),this.#i?.open&&(this.open=!1,this.#i.close())}show(){this.open=!0}close(){this.open=!1}#g(e){e!==this.#m&&(this.#m=e,e?document.addEventListener("keydown",this.#x):document.removeEventListener("keydown",this.#x))}#b(){this.#g(this.hotkey&&this.isConnected)}#x=e=>{e.defaultPrevented||e.isComposing||!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.key.toLowerCase()!=="k"||dr(e.target)||(e.preventDefault(),this.open=!0)};#p(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > button"));if(this.items.length===0&&e.length>0){let h=new Set,c=[];for(let d of e){let u=d.dataset.id||d.getAttribute("href")||`item-${c.length+1}`;for(;h.has(u);)u=`${u}-${c.length+1}`;h.add(u);let b=(d.dataset.keywords??"").split(/[,\s]+/).map(m=>m.trim()).filter(Boolean);c.push({id:u,label:d.textContent?.trim()??u,group:d.dataset.group||void 0,hint:d.dataset.hint||void 0,keywords:b.length?b:void 0,href:d.getAttribute("href")??void 0}),this.#h.set(u,d)}this.items=c}for(let h of e)h.hidden=!0;let t=document.createElement("dialog");t.className="nish-command";let n=`nish-command-list-${this.#e}`,s=document.createElement("input");s.type="text",s.setAttribute("role","combobox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",n),s.setAttribute("aria-autocomplete","list"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.setAttribute("autocorrect","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#T(s.value)),s.addEventListener("keydown",h=>this.#L(h)),s.addEventListener("change",h=>h.stopPropagation());let r=document.createElement("div");r.className="nish-command-input";let o=document.createElement("button");o.type="button",o.className="nish-icon-btn",o.append(cr()),o.addEventListener("click",()=>{this.open=!1}),r.append(hr(),s,o);let l=document.createElement("div");l.className="nish-command-list",l.id=n,l.setAttribute("role","listbox"),l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("mousemove",h=>{let c=h.target?.closest("[data-index]");if(!c)return;let d=Number(c.dataset.index);d!==this.#s&&this.#y(d,!1)}),l.addEventListener("click",h=>{let c=h.target?.closest("[data-index]"),d=c?this.#l[Number(c.dataset.index)]:void 0;d&&this.#A(d)});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=lr,t.append(r,l,a),t.addEventListener("click",this.#k),t.addEventListener("cancel",this.#C),t.addEventListener("close",this.#M),t.addEventListener("keydown",h=>{h.key==="Escape"&&h.stopPropagation()}),this.append(t),this.#i=t,this.#t=s,this.#n=l,this.#r=a,this.#a=o,this.#E(),this.#v()}updated(e){e.has("hotkey")&&this.#b(),(e.has("placeholder")||e.has("emptyText"))&&this.#E(),e.has("items")&&this.#i?.open&&this.#f(),e.has("open")&&this.#v()}stringsChanged(){this.#E(),this.#i?.open&&this.#f(),super.stringsChanged()}#E(){let e=this.#t;if(!e)return;let t=T(),n=this.placeholder||t.searchPlaceholder;e.placeholder=n,e.setAttribute("aria-label",n.replace(/…$/,"")||t.search),this.#i?.setAttribute("aria-label",t.search),this.#a?.setAttribute("aria-label",t.close),this.#n?.setAttribute("aria-label",t.results)}#v(){let e=this.#i;!e||!this.isConnected||(this.open&&!e.open?(this.#o=document.activeElement instanceof HTMLElement?document.activeElement:null,this.#c="",this.#s=0,this.#t&&(this.#t.value=""),e.showModal(),this.#f(),this.#t?.focus()):!this.open&&e.open&&e.close())}#w(e){return`nish-command-${this.#e}-opt-${e}`}#f(){let e=this.#n,t=this.#t;if(!e||!t)return;let n=T();this.#l=yn(this.items,this.#c),this.#s>=this.#l.length&&(this.#s=0),e.textContent="";let s=0,r,o=e;for(let l of this.#l){let a=l.group??null;if(a!==r)if(r=a,a===null)o=e;else{let d=document.createElement("div");d.className="nish-command-group",d.setAttribute("role","group");let u=document.createElement("div");u.id=`nish-command-${this.#e}-group-${s}`,u.textContent=a,d.setAttribute("aria-labelledby",u.id),d.append(u),e.append(d),o=d}let h=document.createElement("div");h.className="nish-command-item",h.id=this.#w(s),h.dataset.index=String(s),h.setAttribute("role","option"),h.setAttribute("aria-selected",s===this.#s?"true":"false");let c=document.createElement("span");if(c.textContent=l.label,h.append(c),l.hint){let d=document.createElement("span");d.className="nish-command-item-hint",d.textContent=l.hint,h.append(d)}o.append(h),s++}if(this.#l.length===0){let l=document.createElement("div");l.className="nish-command-empty",l.textContent=this.emptyText||n.noResults,e.append(l)}this.#l.length?t.setAttribute("aria-activedescendant",this.#w(this.#s)):t.removeAttribute("aria-activedescendant"),this.#r&&(this.#r.textContent=this.#l.length?n.resultCount(this.#l.length):this.emptyText||n.noResults)}#y(e,t=!0){let n=this.#l.length;if(n===0)return;this.#s=(e%n+n)%n;let s=this.#n;if(s){for(let r of Array.from(s.querySelectorAll("[data-index]"))){let o=Number(r.dataset.index)===this.#s;r.setAttribute("aria-selected",o?"true":"false"),o&&t&&r.scrollIntoView?.({block:"nearest"})}this.#t?.setAttribute("aria-activedescendant",this.#w(this.#s))}}#T(e){this.#c=e,this.#s=0,this.#f(),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200)}#L(e){if(e.isComposing)return;let t=this.#l.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.#y(this.#s+1);break;case"ArrowUp":e.preventDefault(),this.#y(this.#s-1);break;case"Home":t&&!this.#c&&(e.preventDefault(),this.#y(0));break;case"End":t&&!this.#c&&(e.preventDefault(),this.#y(t-1));break;case"Enter":{e.preventDefault();let n=this.#l[this.#s];n&&this.#A(n);break}}}#A(e){let t=this.#h.get(e.id);if(this.open=!1,this.#i?.close(),this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:e.id}})),t){let n=t.getAttribute("href");n!==null&&Ee(n)===null?En(n):t.click()}else if(e.href){let n=Ee(e.href);n===null?En(e.href):window.location.assign(n)}}#k=e=>{let t=this.#i;if(!t||e.target!==t)return;let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||(this.open=!1)};#C=e=>{e.preventDefault(),this.open=!1};#M=()=>{window.clearTimeout(this.#d),this.open&&(this.open=!1);let e=this.#o;this.#o=null,e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))}};x("nish-command-palette",bt);var ur={md:"(max-width: 767.98px)",lg:"(max-width: 1023.98px)"},mr=0;function gt(i){let e=document.createElement("div");return e.className=i,e}var vt=class extends E{static properties={activeCount:{attribute:"active-count",type:Number,reflect:!0},sheetTitle:{attribute:"sheet-title",type:String,reflect:!0},sheetBelow:{attribute:"sheet-below",type:String,reflect:!0},sticky:{type:Boolean,reflect:!0}};#e=null;#i=gt("nish-filter-bar-search");#t=gt("nish-filter-bar-chips");#n=gt("nish-filter-bar-trailing");#r=gt("nish-filter-bar-summary");#a=null;#c=null;#s=null;#l=null;#h=null;#o=null;#d=null;#u=null;#m=null;#g=null;#b=[];#x=null;#p=null;#E="";#v=null;#w=()=>this.#C();constructor(){super(),this.activeCount=0,this.sheetTitle="",this.sheetBelow="md",this.sticky=!1}connectedCallback(){super.connectedCallback(),k(()=>this.#f())}disconnectedCallback(){if(super.disconnectedCallback(),this.#p?.removeEventListener("change",this.#w),this.#p=null,this.#E="",this.#v?.disconnect(),this.#v=null,this.#e){this.#h?.close();for(let e of this.#b)this.appendChild(e);for(let e of[this.#i,this.#n,this.#r])for(;e.firstChild;)this.appendChild(e.firstChild);this.#e.remove(),this.#h?.remove(),this.#e=null,this.#a=null,this.#c=null,this.#d=null,this.#u=null,this.#m=null,this.#l=null,this.#h=null,this.#o=null,this.#b=[],this.#x=null}}updated(e){this.#e&&(this.#k(),this.#C())}#f(){if(!this.isConnected||this.#e)return;let e=document.createElement("div");e.className="nish-filter-bar",this.#r.setAttribute("aria-live","polite"),e.append(this.#i,this.#t,this.#n,this.#r),this.#e=e;for(let t of Array.from(this.childNodes))this.#T(t);this.appendChild(e),this.#L(),this.#k(),this.#C(),this.#v=new MutationObserver(t=>{for(let n of t)n.addedNodes.forEach(s=>{s!==e&&s.parentNode===this&&this.#T(s)});this.#C()}),this.#v.observe(this,{childList:!0}),this.#v.observe(this.#t,{childList:!0}),this.#o&&this.#v.observe(this.#o,{childList:!0})}#y(){this.#b=this.#b.filter(e=>e.parentNode===this.#t||e.parentNode===this.#o)}#T(e){if(e===this.#e||e instanceof Comment)return;if(!(e instanceof HTMLElement)){e.parentNode?.removeChild(e);return}let t=e.getAttribute("data-slot");t==="trailing"?this.#n.appendChild(e):t==="summary"?this.#r.appendChild(e):e.localName==="nish-search"&&!this.#i.firstChild?this.#i.appendChild(e):(this.#y(),this.#b.includes(e)||this.#b.push(e),(this.#x==="compact"?this.#o??this.#t:this.#t).appendChild(e))}#L(){let e=++mr,t=document.createElement("button");t.type="button",t.className="nish-btn nish-btn--secondary nish-filter-btn",t.setAttribute("aria-haspopup","dialog"),this.#c=document.createTextNode(""),t.append(hn(16),this.#c);let n=document.createElement("span");n.className="nish-badge nish-badge--accent",t.appendChild(n),t.addEventListener("click",()=>this.#h?.show()),this.#a=t,this.#s=n;let s=document.createElement("button");s.type="button",s.className="nish-btn nish-btn--ghost nish-filter-bar-clear",s.addEventListener("click",()=>this.#A()),this.#l=s;let r=document.createElement("nish-sheet"),o=document.createElement("header");o.className="nish-sheet-header";let l=document.createElement("h2");l.className="nish-sheet-title",l.id=`nish-filter-sheet-title-${e}`,o.appendChild(l);let a=document.createElement("button");a.type="button",a.className="nish-icon-btn",a.setAttribute("data-sheet-close",""),this.#u=a,a.appendChild(ot(16)),o.appendChild(a);let h=document.createElement("div");h.className="nish-sheet-body nish-filter-sheet-body";let c=document.createElement("footer");c.className="nish-sheet-footer";let d=document.createElement("button");d.type="button",d.className="nish-btn nish-btn--ghost",d.addEventListener("click",()=>this.#A());let u=document.createElement("button");u.type="button",u.className="nish-btn nish-btn--primary",u.style.marginInlineStart="auto",this.#m=u,u.addEventListener("click",()=>this.#h?.close()),c.append(d,u),r.append(o,h,c),this.#h=r,this.#o=h,this.#d=d,this.#g=l}#A(){this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0}))}#k(){let e=ur[this.sheetBelow==="lg"?"lg":"md"];e!==this.#E&&(this.#p?.removeEventListener("change",this.#w),this.#E=e,this.#p=typeof matchMedia>"u"?null:matchMedia(e),this.#p?.addEventListener("change",this.#w))}#C(){let e=this.#e,t=this.#h,n=this.#o,s=this.#a,r=this.#l;if(!e||!t||!n||!s||!r)return;this.#y();let o=this.#p?.matches?"compact":"wide";o!==this.#x&&(o==="compact"?(this.#t.remove(),r.remove(),this.#i.after(s),n.append(...this.#b),e.appendChild(t)):(t.close(),s.remove(),this.#t.append(...this.#b,r),this.#i.after(this.#t),t.remove()),this.#x=o,e.setAttribute("data-compact",String(o==="compact")));let l=Math.max(0,Number.isFinite(this.activeCount)?Math.floor(this.activeCount):0);e.classList.toggle("nish-filter-bar--sticky",this.sticky),s.hidden=this.#b.length===0,r.hidden=l===0,this.#s&&(this.#s.textContent=String(l),this.#s.hidden=l===0,this.#s.setAttribute("aria-label",T().activeCount(l))),this.#d&&(this.#d.disabled=l===0);let a=T();this.#g&&(this.#g.textContent=this.sheetTitle||a.filters),this.#c&&(this.#c.data=a.filters),r.textContent=a.clearFilters,this.#d&&(this.#d.textContent=a.clear),this.#m&&(this.#m.textContent=a.showResults),this.#u?.setAttribute("aria-label",a.close)}};x("nish-filter-bar",vt);var yt=class extends E{static properties={label:{type:String,reflect:!0}};#e=null;#i=null;#t=null;constructor(){super(),this.label=""}connectedCallback(){super.connectedCallback(),k(()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.disconnect(),this.#t=null,this.#e=null,this.#i?.(),this.#i=null}updated(e){this.#a()}#n(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-nav-rail");if(!e){for(e=document.createElement("nav"),e.className="nish-nav-rail";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#r(e),this.#a(),this.#i=tt(e,t=>t.classList.add("nish-nav-rail-item")),this.#t=new MutationObserver(t=>{let n=this.#e;if(!n)return;let s=!1;for(let r of t)r.target===this&&r.addedNodes.forEach(o=>{o!==n&&o.nodeType===1&&o.parentNode===this&&(n.appendChild(o),s=!0)});(s||t.some(r=>r.target!==this))&&this.#r(n)}),this.#t.observe(this,{childList:!0}),this.#t.observe(e,{childList:!0,subtree:!0})}#r(e){let t=e.querySelector(':scope > [data-slot="tools"]'),n=e.querySelector(':scope > [data-slot="footer"]');t?.classList.add("nish-nav-rail-tools"),n?.classList.add("nish-nav-rail-footer");let s=[t,n].filter(a=>!!a),r=Array.from(e.children),o=s.length;if(!s.every((a,h)=>r[r.length-o+h]===a))for(let a of s)e.appendChild(a);for(let a of Array.from(e.querySelectorAll(":scope > .nish-nav-rail-tools a, :scope > .nish-nav-rail-footer a")))a.classList.add("nish-nav-rail-item")}#a(){this.#e&&this.#e.setAttribute("aria-label",this.label||T().sections)}};x("nish-nav-rail",yt);var pr='[aria-pressed="true"],[aria-selected="true"],[aria-current]:not([aria-current="false"]),[aria-checked="true"]',Et=class extends E{static properties={label:{type:String,reflect:!0},bleed:{type:Boolean,reflect:!0},snap:{type:Boolean,reflect:!0},fade:{reflect:!0,converter:{fromAttribute:e=>e!=="false",toAttribute:e=>e?null:"false"}}};#e=null;#i=null;#t=null;#n=()=>this.#c();constructor(){super(),this.label="",this.bleed=!1,this.snap=!1,this.fade=!0}connectedCallback(){super.connectedCallback(),k(()=>this.#r())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("scroll",this.#n),this.#i?.disconnect(),this.#i=null,this.#t?.disconnect(),this.#t=null,this.#e=null}updated(e){this.#s()}#r(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-scroll-row");if(!e){for(e=document.createElement("div"),e.className="nish-scroll-row";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#t?.disconnect(),this.#t=new MutationObserver(()=>{let n=this.#e;if(n)for(let s of Array.from(this.childNodes))s!==n&&s.nodeType===1&&n.appendChild(s)}),this.#t.observe(this,{childList:!0}),this.#s(),e.addEventListener("scroll",this.#n,{passive:!0}),typeof ResizeObserver<"u"&&(this.#i=new ResizeObserver(()=>this.#c()),this.#i.observe(e));let t=e.querySelector(pr);t&&this.#a(e,t),this.#c()}#a(e,t){let n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),r=8;s.left<n.left+r?e.scrollLeft+=s.left-n.left-r:s.right>n.right-r&&(e.scrollLeft+=s.right-n.right+r)}#c(){let e=this.#e;if(!e)return;let t=e.scrollWidth-e.clientWidth;e.dataset.atStart=String(e.scrollLeft<=1),e.dataset.atEnd=String(t<=1||e.scrollLeft>=t-1)}#s(){let e=this.#e;e&&(this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),e.classList.toggle("nish-scroll-row--bleed",this.bleed),e.classList.toggle("nish-scroll-row--snap",this.snap),e.classList.toggle("nish-scroll-row--no-fade",!this.fade))}};x("nish-scroll-row",Et);var xn={fromAttribute:i=>i!=="false",toAttribute:i=>i?null:"false"},xt=class extends E{static properties={label:{type:String,reflect:!0},sticky:{reflect:!0,converter:xn},updateHash:{attribute:"update-hash",reflect:!0,converter:xn}};#e=null;#i=null;#t=null;#n=null;#r=e=>this.#h(e);constructor(){super(),this.label="",this.sticky=!0,this.updateHash=!0}connectedCallback(){super.connectedCallback(),k(()=>this.#a())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.(),this.#i=null,this.#s=null,this.#t?.disconnect(),this.#t=null,this.#n?.disconnect(),this.#n=null,this.#e?.removeEventListener("click",this.#r),this.#e=null}updated(e){this.#c()}#a(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-subnav");if(!e){for(e=document.createElement("nav"),e.className="nish-subnav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#c(),e.addEventListener("click",this.#r),this.#l(e),this.#t=new MutationObserver(()=>{this.#i?.(),this.#l(e)}),this.#t.observe(e,{childList:!0}),this.#n=new MutationObserver(()=>{let t=this.#e;if(t)for(let n of Array.from(this.childNodes))n!==t&&n.nodeType===1&&t.appendChild(n)}),this.#n.observe(this,{childList:!0})}#c(){let e=this.#e;e&&(e.setAttribute("aria-label",this.label||T().sections),e.style.position=this.sticky?"":"static",this.#s!==null&&this.#s!==this.sticky&&this.#l(e))}#s=null;#l(e){this.#i?.(),this.#i=Ci(e,{height:this.sticky}),this.#s=this.sticky}#h(e){let t=e.target instanceof Element?e.target.closest('a[href^="#"]'):null;if(!t||!this.#e?.contains(t)||t.hash.length<2||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n;try{n=decodeURIComponent(t.hash.slice(1))}catch{return}let s=document.getElementById(n);if(!s)return;e.preventDefault();let r=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(s.scrollIntoView({behavior:r?"auto":"smooth",block:"start"}),this.updateHash)try{history.replaceState(history.state,"",`#${t.hash.slice(1)}`)}catch{}this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:n}}))}};x("nish-section-nav",xt);var wn=5,fr="(max-width: 639.98px) and (pointer: coarse)";function ti(i,e){let t=()=>Array.from({length:e},()=>100/e);if(e===0)return[];if(!i||i.length!==e||!i.every(s=>Number.isFinite(s)&&s>0))return t();let n=i.reduce((s,r)=>s+r,0);return i.map(s=>s/n*100)}var br={fromAttribute(i){if(i==null||i.trim()==="")return null;let e=i.split(",").map(t=>Number(t.trim()));return e.every(t=>Number.isFinite(t))?e:null},toAttribute(i){return i&&i.length?i.map(e=>Math.round(e*100)/100).join(","):null}},wt=class extends E{static properties={orientation:{type:String,reflect:!0},sizes:{converter:br,reflect:!0},min:{type:Number},storageKey:{type:String,attribute:"storage-key"}};#e=[];#i=[];#t=null;#n=null;#r=!1;#a=null;#c=!1;#s=!1;#l=!1;constructor(){super(),this.orientation="row",this.sizes=null,this.min=120,this.storageKey=null}connectedCallback(){if(super.connectedCallback(),typeof window.matchMedia=="function"&&(this.#n=window.matchMedia(fr),this.#r=this.#n.matches,this.#n.addEventListener("change",this.#g)),this.#s){this.#h(),this.#o();return}this.#c||(this.#c=!0,k(()=>{this.#c=!1,this.isConnected&&(this.#s=!0,this.#h(),this.#o())}))}disconnectedCallback(){super.disconnectedCallback(),this.#n?.removeEventListener("change",this.#g),this.#n=null,this.#t?.disconnect(),this.#t=null,this.#y()}updated(e){this.#s&&(e.size===0||e.has("orientation")||e.has("sizes")||e.has("min"))&&this.#m()}#h(){typeof MutationObserver>"u"||(this.#t??=new MutationObserver(()=>this.#o()),this.#t.observe(this,{childList:!0}))}#o(){if(!this.isConnected)return;this.#t?.disconnect();let e=[];for(let t of Array.from(this.childNodes)){if(!(t instanceof HTMLElement))continue;if(t.classList.contains("nish-split-divider")){t.remove();continue}if(t.classList.contains("nish-split-pane")){e.push(t);continue}let n=document.createElement("div");n.className="nish-split-pane",this.insertBefore(n,t),n.append(t),e.push(n)}this.#e=e,this.#i=[];for(let t=0;t<e.length-1;t++){let n=document.createElement("div");n.className="nish-split-divider",n.setAttribute("role","separator"),n.tabIndex=0,n.style.touchAction="none",n.addEventListener("pointerdown",s=>this.#v(s,t)),n.addEventListener("pointermove",s=>this.#w(s)),n.addEventListener("pointerup",s=>this.#f(s)),n.addEventListener("pointercancel",s=>this.#f(s)),n.addEventListener("keydown",s=>this.#L(s,t)),n.addEventListener("dblclick",()=>this.#T()),this.insertBefore(n,e[t+1]),this.#i.push(n)}this.#d(),this.#m(),this.#t?.observe(this,{childList:!0})}#d(){if(!(this.#l||!this.storageKey||this.#e.length===0)){this.#l=!0;try{let e=window.localStorage.getItem(this.storageKey);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&t.length===this.#e.length&&t.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>0)&&(this.sizes=ti(t,this.#e.length))}catch{}}}get#u(){return ti(this.sizes,this.#e.length)}#m(){let e=this.orientation!=="column",t=this.#u,n=T();this.style.display="flex",this.style.flexDirection=this.#r?"column":e?"row":"column",this.style.minWidth="0",this.style.minHeight="0",this.#e.forEach((s,r)=>{s.style.minWidth="0",this.#r?(s.style.minHeight="var(--nish-split-stack-h, 16rem)",s.style.flex="none"):(s.style.minHeight="0",s.style.flex=`${t[r]} 1 0%`);let o=s.children.length===1?s.firstElementChild:null;o?.localName==="nish-split"&&(s.style.display="flex",o.style.flex="1 1 auto")}),this.#i.forEach((s,r)=>{s.hidden=this.#r,s.classList.toggle("nish-split-divider--v",e),s.classList.toggle("nish-split-divider--h",!e),s.setAttribute("aria-orientation",e?"vertical":"horizontal"),s.setAttribute("aria-label",e?n.resizeColumns:n.resizeRows),s.setAttribute("aria-valuenow",String(Math.round(t[r]))),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100")})}#g=e=>{this.#r=e.matches,this.#m()};#b(e){let t=e.getBoundingClientRect();return this.orientation==="column"?t.height:t.width}#x(e,t,n,s){let r=e[t]+e[t+1],o=Math.min(s,r/2),l=Math.min(Math.max(e[t]+n,o),r-o),a=e.slice();return a[t]=l,a[t+1]=r-l,a}#p(e){if(this.storageKey)try{window.localStorage.setItem(this.storageKey,JSON.stringify(e))}catch{}}#E(e){this.sizes=e,this.dispatchEvent(new CustomEvent("nish-resize",{bubbles:!0,detail:{sizes:e}}))}#v(e,t){if(e.button!==0||this.#r)return;let n=this.#i[t];if(!n)return;e.preventDefault(),n.setPointerCapture?.(e.pointerId);let s=[];for(let o of Array.from(this.querySelectorAll("iframe")))s.push([o,o.style.pointerEvents]),o.style.pointerEvents="none";let r=this.#e.reduce((o,l)=>o+this.#b(l),0);this.#a={pointerId:e.pointerId,start:this.orientation==="column"?e.clientY:e.clientX,index:t,sizes:this.#u,total:r,restore:s},this.setAttribute("data-dragging","")}#w(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId||t.total<=0)return;let n=this.orientation==="column"?e.clientY:e.clientX,s=this.orientation!=="column"&&Q(this)?-1:1,r=(n-t.start)*s/t.total*100;r!==0&&this.#E(this.#x(t.sizes,t.index,r,this.min/t.total*100))}#f(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId)return;let n=this.#i[t.index];n?.hasPointerCapture?.(e.pointerId)&&n.releasePointerCapture(e.pointerId),this.#y()}#y(){let e=this.#a;if(e){this.#a=null,this.sizes&&this.#p(this.sizes);for(let[t,n]of e.restore)t.style.pointerEvents=n;this.removeAttribute("data-dragging")}}#T(){if(this.#r||this.#e.length<2)return;let e=ti(null,this.#e.length);this.#E(e),this.#p(e)}#L(e,t){if(e.key==="Enter"){e.preventDefault(),this.#T();return}let n=this.orientation!=="column",s=n&&Q(this),r=n?s?"ArrowRight":"ArrowLeft":"ArrowUp",o=n?s?"ArrowLeft":"ArrowRight":"ArrowDown";if(e.key!==r&&e.key!==o)return;e.preventDefault();let l=this.#e.reduce((d,u)=>d+this.#b(u),0),a=l>0?this.min/l*100:0,h=this.#u,c=this.#x(h,t,e.key===o?wn:-wn,a);c[t]!==h[t]&&(this.#E(c),this.#p(c))}};x("nish-split",wt);var ii="http://www.w3.org/2000/svg";function gr(){let i=document.createElementNS(ii,"svg");i.setAttribute("width","10"),i.setAttribute("height","10"),i.setAttribute("viewBox","0 0 10 10"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let e of["M2 4 5 1l3 3","M2 6l3 3 3-3"]){let t=document.createElementNS(ii,"path");t.setAttribute("d",e),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.5"),t.setAttribute("opacity","0.35"),i.appendChild(t)}return i}function vr(i){return(i.target instanceof Element?i.target:i.target.parentElement)?.closest("thead")?!0:Array.from(i.addedNodes).some(t=>t instanceof Element&&(t.localName==="thead"||t.localName==="table"||t.localName==="tr"||t.localName==="th"||t.querySelector("thead")!==null))}function yr(i){let e=i.replace(/[\s,$€£%]/g,"");if(e===""||e==="-"||e==="+")return null;let t=Number(e);return Number.isFinite(t)?t:null}var St=class extends E{static properties={manual:{type:Boolean,reflect:!0}};#e=null;#i=e=>this.#l(e);constructor(){super(),this.manual=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#i),k(()=>this.#t())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#i),this.#e?.disconnect(),this.#e=null}#t(){!this.isConnected||this.#e||(this.#a(),this.#e=new MutationObserver(e=>{e.some(vr)&&(this.#e?.disconnect(),this.#a(),this.#n())}),this.#n())}#n(){this.#e?.observe(this,{childList:!0,subtree:!0})}#r(){return Array.from(this.querySelectorAll("thead th[data-sort]"))}#a(){for(let e of this.#r()){if(e.hasAttribute("scope")||e.setAttribute("scope","col"),e.hasAttribute("aria-sort")||e.setAttribute("aria-sort","none"),e.querySelector(":scope > .nish-th-sort"))continue;let t=document.createElement("button");for(t.type="button",t.className="nish-th-sort";e.firstChild;)t.appendChild(e.firstChild);t.appendChild(gr()),e.appendChild(t),this.#c(e)}}#c(e){let t=e.querySelectorAll(".nish-th-sort svg path"),n=e.getAttribute("aria-sort");t[0]?.setAttribute("opacity",n==="ascending"?"1":"0.35"),t[1]?.setAttribute("opacity",n==="descending"?"1":"0.35")}#s(e){let t=e.getAttribute("data-sort");if(t)return t;let n=e.querySelector(".nish-th-sort"),s="";return(n??e).childNodes.forEach(r=>{(r.nodeType===Node.TEXT_NODE||r instanceof HTMLElement&&r.namespaceURI!==ii)&&(s+=r.textContent??"")}),s.trim()}#l(e){let n=e.target?.closest(".nish-th-sort"),s=n?.closest("th[data-sort]");if(!n||!s||!this.contains(s))return;let r=s.getAttribute("aria-sort")==="ascending"?"descending":"ascending";for(let o of this.#r())o.setAttribute("aria-sort",o===s?r:"none"),this.#c(o);this.manual||this.#h(s,r),this.dispatchEvent(new CustomEvent("nish-sort",{bubbles:!0,detail:{column:this.#s(s),direction:r==="ascending"?"asc":"desc"}}))}#h(e,t){let n=e.cellIndex,s=t==="ascending"?1:-1,r=e.closest("table");if(!r)return;let o=new Intl.Collator(void 0,{sensitivity:"base"});for(let l of Array.from(r.tBodies)){let a=Array.from(l.rows).map((b,m)=>{let w=b.cells[n],g=w?(w.getAttribute("data-value")??w.textContent??"").trim():"";return{row:b,key:g,num:yr(g),order:m}}),h=a.filter(b=>b.key!==""),c=a.filter(b=>b.key===""),d=e.classList.contains("nish-th--num")||h.length>0&&h.every(b=>b.num!==null);h.sort((b,m)=>(d?(b.num??0)-(m.num??0):o.compare(b.key,m.key))*s||b.order-m.order);let u=document.createDocumentFragment();for(let b of[...h,...c])u.appendChild(b.row);l.appendChild(u)}}};x("nish-table-sort",St);var De="\u2013",ri="\u2212",si="en-US",Er=de("format",()=>({locale:si})),Sn=new Map;function xr(i){let e=Sn.get(i);if(e===void 0){try{e=Intl.getCanonicalLocales(i)[0]??si}catch{e=si}Sn.set(i,e)}return e}function Ie(i){return i?.locale?xr(i.locale):Er.locale}function An(i){return i==="en"||i==="en-US"}var Tn=new Map;function Cn(i,e){let t=Tn.get(i);return t===void 0&&(t=e(),Tn.set(i,t)),t}function wr(i,e,t){return Cn(`n|${i}|${e}|${t}`,()=>new Intl.NumberFormat(i,{minimumFractionDigits:e,maximumFractionDigits:t}))}function le(i,e,t,n){return Cn(`d|${i}|${e}|${n??""}`,()=>new Intl.DateTimeFormat(i,n?{...t,timeZone:n}:t))}function oi(i){return typeof i=="number"&&Number.isFinite(i)}function Z(i,e,t,n){return wr(n,e,t).format(i)}var ni=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"k"]];function kn(i,e,t){for(let n=0;n<ni.length;n++){let[s,r]=ni[n];if(!(i<s)){if(n>0&&Number((i/s).toFixed(e))>=1e3){let[o,l]=ni[n-1];return Z(i/o,0,e,t)+l}return Z(i/s,0,e,t)+r}}return Z(i,0,e,t)}function Mn(i,e){return Number(Math.abs(i).toFixed(e))===0}var Ln=new Map;function Sr(i,e){let t=`${e}|${i}`,n=Ln.get(t);if(n===void 0){try{n=new Intl.NumberFormat(e,{style:"currency",currency:i,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(r=>r.type==="currency")?.value??i}catch{n=i+" "}Ln.set(t,n)}return n}function Tr(i,e,t){let n=Sr(e.currency??"USD",t);if(e.compact&&i>=1e3)return n+kn(i,1,t);let s=e.cents??"auto",r=Math.round(i*100)%100!==0,o=s==="always"||s==="auto"&&(i<1e3||r);return n+(o?Z(i,2,2,t):Z(i,0,0,t))}function _n(i,e={}){if(!oi(i))return De;let t=Tr(Math.abs(i),e,Ie(e));return i<0&&Math.round(Math.abs(i)*100)>0?ri+t:t}function $n(i,e={}){if(!oi(i))return De;let t=e.digits??1,n=e.fromRatio??!0?i*100:i,s=Z(Math.abs(n),t,t,Ie(e))+"%";return Mn(n,t)?s:n<0?ri+s:e.signed?"+"+s:s}function Nn(i,e={}){if(!oi(i))return De;let t=Ie(e),n=i<0&&!Mn(i,e.digits??2)?ri:"",s=Math.abs(i);return e.compact&&s>=1e3?n+kn(s,e.digits??1,t):n+(e.digits===void 0?Z(s,0,2,t):Z(s,e.digits,e.digits,t))}var Lr=/^(\d{4})-(\d{2})-(\d{2})$/;function Rn(i){if(i==null)return null;let e,t=!1;if(i instanceof Date)e=i;else if(typeof i=="number")e=new Date(i);else{let n=Lr.exec(i.trim());t=!!n,e=n?new Date(Number(n[1]),Number(n[2])-1,Number(n[3])):new Date(i)}return Number.isNaN(e.getTime())?null:{d:e,dayOnly:t}}function On(i,e){return i.dayOnly?void 0:e.timeZone}function Tt(i){return i.replace(/[\u202f\u00a0]/g," ")}var Ql=[[60,"minute","m"],[3600,"hour","h"],[86400,"day","d"],[86400*30,"month","mo"],[86400*365,"year","y"]];var Ar={month:"short",day:"numeric",year:"numeric"},Cr={weekday:"long",month:"long",day:"numeric",year:"numeric"},kr={month:"short",day:"numeric"},Mr={weekday:"short"},_r={month:"numeric",day:"numeric"},$r={hour:"numeric",minute:"2-digit"},Nr={hour:"numeric",minute:"2-digit",hour12:!0},Rr={year:"numeric",month:"numeric",day:"numeric"};function Or(i,e){if(!e)return{year:i.getFullYear(),month:i.getMonth()+1,day:i.getDate()};let t={year:0,month:0,day:0};for(let n of le("en-US","ymd",Rr,e).formatToParts(i))(n.type==="year"||n.type==="month"||n.type==="day")&&(t[n.type]=Number(n.value));return t}function Hr(i,e,t,n){let s=On(i,t);switch(e){case"medium":return Tt(le(n,"medium",Ar,s).format(i.d));case"long":return Tt(le(n,"long",Cr,s).format(i.d));case"weekday":{let r=le(n,"weekday",Mr,s).format(i.d);if(!An(n))return`${r} ${le(n,"md",_r,s).format(i.d)}`;let o=Or(i.d,s);return`${r} ${o.month}/${o.day}`}default:return Tt(le(n,"short",kr,s).format(i.d))}}function Hn(i,e="short",t={}){let n=Rn(i);return n?Hr(n,e,t,Ie(t)):De}function Pr(i,e,t){let n=An(t);return Tt(le(t,n?"time12":"time",n?Nr:$r,On(i,e)).format(i.d))}function Pn(i,e={}){let t=Rn(i);return t?Pr(t,e,Ie(e)):De}var Dn={ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)",accent:"var(--nish-accent)"};function j(i,e){return i&&Object.hasOwn(Dn,i)?Dn[i]:i&&/^chart-[1-8]$/.test(i)?`var(--nish-${i})`:`var(--nish-chart-${(Math.trunc(e)%8+8)%8+1})`}var F={grid:"var(--nish-line)",axis:"var(--nish-line-strong)",zero:"var(--nish-hi3)",text:"var(--nish-hi3)"},In,Dr=i=>Math.abs(i)<1e3?String(Math.round(i*100)/100):(In??=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),In.format(i));function ve(i,e=Dr){let t=(i??"").trim();if(!t)return e;let n=t.indexOf(":"),s=(n<0?t:t.slice(0,n)).toLowerCase(),r=n<0?"":t.slice(n+1).trim();switch(s){case"number":return o=>Nn(o);case"percent":{let o=r!==""&&Number.isInteger(Number(r))&&Number(r)>=0&&Number(r)<=10?Number(r):1;return l=>$n(l,{digits:o})}case"currency":return o=>_n(o,{currency:r||"USD"});case"date":{let o=r==="medium"||r==="long"||r==="weekday"?r:"short";return l=>Hn(l,o)}case"time":return o=>Pn(o);default:return e}}function ai(i,e,t){let n=Math.max(2,Math.floor(t));return Array.from({length:n},(s,r)=>i+(e-i)*r/(n-1))}function zn(i,e){if(i===e){let n=Math.abs(i)*.05||1;return[i-n,e+n]}let t=(e-i)*.06;return[i-t,e+t]}function Fn(i,e){let t=0,n=i.length-1;for(;n-t>1;){let s=t+n>>1;i[s]<e?t=s:n=s}return Math.abs(i[t]-e)<=Math.abs(i[n]-e)?t:n}function ee(i){if(i==null||i==="")return null;let e=typeof i=="number"?i:Number(i);return Number.isFinite(e)?e:null}function li(i){if(!Array.isArray(i))return[];let e=[];return i.forEach((t,n)=>{if(Array.isArray(t)){let s=ee(t[0]);s!==null&&e.push({x:s,y:ee(t[1])})}else if(t&&typeof t=="object"){let s=t,r=ee(s.x);r!==null&&e.push({x:r,y:ee(s.y)})}else e.push({x:n,y:ee(t)})}),e}function Un(i){return Array.isArray(i)?i.map((e,t)=>{let n=e&&typeof e=="object"?e:{};return{label:typeof n.label=="string"&&n.label?n.label:T().seriesNumber(t+1),tone:typeof n.tone=="string"?n.tone:void 0,points:li(n.points??n.data)}}):[]}function Vn(i){return Array.isArray(i)?i.map((e,t)=>{if(Array.isArray(e))return{label:String(e[0]??""),value:ee(e[1])??0};if(e&&typeof e=="object"){let n=e;return{label:n.label==null?String(t+1):String(n.label),value:ee(n.value)??0}}return{label:String(t+1),value:ee(e)??0}}):[]}var Be={fromAttribute(i){if(!i)return[];try{let e=JSON.parse(i);return Array.isArray(e)?e:[]}catch{return[]}},toAttribute(i){try{return JSON.stringify(i)}catch{return""}}},te=class extends E{static properties={label:{type:String,reflect:!0},height:{type:Number,reflect:!0},tone:{type:String,reflect:!0},empty:{type:String,reflect:!0},yFormat:{type:String,attribute:"y-format",reflect:!0},xFormat:{type:String,attribute:"x-format",reflect:!0},width:{state:!0}};ro=null;themeObserver=null;constructor(){super(),this.label="",this.tone="",this.empty="",this.yFormat="",this.xFormat="",this.width=0}connectedCallback(){super.connectedCallback(),getComputedStyle(this).display==="inline"&&(this.style.display="block"),this.width=this.clientWidth,typeof ResizeObserver<"u"&&(this.ro=new ResizeObserver(()=>{this.clientWidth!==this.width&&(this.width=this.clientWidth)}),this.ro.observe(this)),this.themeObserver=new MutationObserver(()=>this.requestUpdate()),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})}disconnectedCallback(){super.disconnectedCallback(),this.ro?.disconnect(),this.ro=null,this.themeObserver?.disconnect(),this.themeObserver=null}get plotHeight(){return this.height>0?this.height:200}},Bn=0;function qn(){return Bn+=1,`nish-chart-${Bn}`}var Lt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";var Wn=18,Ir=22,At=class extends te{static properties={...te.properties,data:{converter:Be},xTicks:{type:String,attribute:"x-ticks",reflect:!0},showValues:{type:Boolean,attribute:"show-values",reflect:!0},selected:{state:!0},coarse:{state:!0}};mq=null;onCoarse=()=>{this.coarse=!!this.mq?.matches};constructor(){super(),this.data=[],this.height=140,this.xTicks="ends",this.showValues=!1,this.selected=null,this.coarse=!1}connectedCallback(){super.connectedCallback(),typeof window<"u"&&window.matchMedia&&(this.mq=window.matchMedia("(pointer: coarse)"),this.coarse=this.mq.matches,this.mq.addEventListener("change",this.onCoarse))}disconnectedCallback(){super.disconnectedCallback(),this.mq?.removeEventListener("change",this.onCoarse),this.mq=null}render(){let e=T(),t=this.label,n=this.height>0?this.height:140,s=Vn(this.data),r=ve(this.yFormat),o=ve(this.xFormat,L=>String(L)),l=L=>this.xFormat&&L.trim()!==""&&Number.isFinite(Number(L))?o(Number(L)):L;if(!s.length)return C`<div class="nish-chart">
|
|
52
|
-
<div class="nish-empty" role="img" aria-label=${e.noDataNamed(t)} style="height:${
|
|
53
|
-
</div>`;let a=this.width,h=
|
|
50
|
+
</label>`}};S("nish-switch",ft);function or(n,e){let t=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(t.length===0)return!0;let i=[n.label,n.hint??"",...n.keywords??[]].join(`
|
|
51
|
+
`).toLowerCase();return t.every(s=>i.includes(s))}function En(n,e){let t=[],i=new Map;for(let s of n){if(!or(s,e))continue;let r=s.group??null,o=i.get(r);o||(o=[],i.set(r,o),t.push(r)),o.push(s)}return t.sort((s,r)=>s===null?-1:r===null?1:0),t.flatMap(s=>i.get(s)).slice(0,50)}var lr=0,Ie="http://www.w3.org/2000/svg",cr="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function hr(){let n=document.createElementNS(Ie,"svg");for(let[t,i]of Object.entries({viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))n.setAttribute(t,i);let e=document.createElementNS(Ie,"path");return e.setAttribute("d","M18 6 6 18M6 6l12 12"),n.append(e),n}function dr(){let n=document.createElementNS(Ie,"svg");for(let[i,s]of Object.entries({viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))n.setAttribute(i,s);let e=document.createElementNS(Ie,"circle");e.setAttribute("cx","11"),e.setAttribute("cy","11"),e.setAttribute("r","8");let t=document.createElementNS(Ie,"path");return t.setAttribute("d","m21 21-4.3-4.3"),n.append(e,t),n}function Sn(n){globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: <nish-command-palette> did not follow an unsafe href (${JSON.stringify(n.slice(0,40))}). Only relative, #, http(s), mailto and tel URLs are followed.`)}function ur(n){if(!(n instanceof HTMLElement))return!1;let e=n.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||n.isContentEditable}var bt=class extends E{static properties={open:{type:Boolean,reflect:!0},hotkey:{type:Boolean,reflect:!0},placeholder:{type:String},emptyText:{type:String,attribute:"empty-text"},items:{attribute:!1}};#e=++lr;#i=null;#t=null;#n=null;#r=null;#a=null;#c="";#s=0;#l=[];#h=new Map;#o=null;#d;#u=!1;#m=!1;constructor(){super(),this.open=!1,this.hotkey=!1,this.placeholder="",this.emptyText="",this.items=[]}connectedCallback(){if(super.connectedCallback(),this.#b(),this.#i){this.#v();return}this.#u||(this.#u=!0,k(()=>{this.#u=!1,this.isConnected&&this.#p()}))}disconnectedCallback(){super.disconnectedCallback(),this.#g(!1),window.clearTimeout(this.#d),this.#i?.open&&(this.open=!1,this.#i.close())}show(){this.open=!0}close(){this.open=!1}#g(e){e!==this.#m&&(this.#m=e,e?document.addEventListener("keydown",this.#S):document.removeEventListener("keydown",this.#S))}#b(){this.#g(this.hotkey&&this.isConnected)}#S=e=>{e.defaultPrevented||e.isComposing||!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.key.toLowerCase()!=="k"||ur(e.target)||(e.preventDefault(),this.open=!0)};#p(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > button"));if(this.items.length===0&&e.length>0){let h=new Set,c=[];for(let d of e){let u=d.dataset.id||d.getAttribute("href")||`item-${c.length+1}`;for(;h.has(u);)u=`${u}-${c.length+1}`;h.add(u);let b=(d.dataset.keywords??"").split(/[,\s]+/).map(m=>m.trim()).filter(Boolean);c.push({id:u,label:d.textContent?.trim()??u,group:d.dataset.group||void 0,hint:d.dataset.hint||void 0,keywords:b.length?b:void 0,href:d.getAttribute("href")??void 0}),this.#h.set(u,d)}this.items=c}for(let h of e)h.hidden=!0;let t=document.createElement("dialog");t.className="nish-command";let i=`nish-command-list-${this.#e}`,s=document.createElement("input");s.type="text",s.setAttribute("role","combobox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",i),s.setAttribute("aria-autocomplete","list"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.setAttribute("autocorrect","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#T(s.value)),s.addEventListener("keydown",h=>this.#L(h)),s.addEventListener("change",h=>h.stopPropagation());let r=document.createElement("div");r.className="nish-command-input";let o=document.createElement("button");o.type="button",o.className="nish-icon-btn",o.append(hr()),o.addEventListener("click",()=>{this.open=!1}),r.append(dr(),s,o);let l=document.createElement("div");l.className="nish-command-list",l.id=i,l.setAttribute("role","listbox"),l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("mousemove",h=>{let c=h.target?.closest("[data-index]");if(!c)return;let d=Number(c.dataset.index);d!==this.#s&&this.#y(d,!1)}),l.addEventListener("click",h=>{let c=h.target?.closest("[data-index]"),d=c?this.#l[Number(c.dataset.index)]:void 0;d&&this.#A(d)});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=cr,t.append(r,l,a),t.addEventListener("click",this.#k),t.addEventListener("cancel",this.#C),t.addEventListener("close",this.#_),t.addEventListener("keydown",h=>{h.key==="Escape"&&h.stopPropagation()}),this.append(t),this.#i=t,this.#t=s,this.#n=l,this.#r=a,this.#a=o,this.#E(),this.#v()}updated(e){e.has("hotkey")&&this.#b(),(e.has("placeholder")||e.has("emptyText"))&&this.#E(),e.has("items")&&this.#i?.open&&this.#f(),e.has("open")&&this.#v()}stringsChanged(){this.#E(),this.#i?.open&&this.#f(),super.stringsChanged()}#E(){let e=this.#t;if(!e)return;let t=T(),i=this.placeholder||t.searchPlaceholder;e.placeholder=i,e.setAttribute("aria-label",i.replace(/…$/,"")||t.search),this.#i?.setAttribute("aria-label",t.search),this.#a?.setAttribute("aria-label",t.close),this.#n?.setAttribute("aria-label",t.results)}#v(){let e=this.#i;!e||!this.isConnected||(this.open&&!e.open?(this.#o=document.activeElement instanceof HTMLElement?document.activeElement:null,this.#c="",this.#s=0,this.#t&&(this.#t.value=""),e.showModal(),this.#f(),this.#t?.focus()):!this.open&&e.open&&e.close())}#x(e){return`nish-command-${this.#e}-opt-${e}`}#f(){let e=this.#n,t=this.#t;if(!e||!t)return;let i=T();this.#l=En(this.items,this.#c),this.#s>=this.#l.length&&(this.#s=0),e.textContent="";let s=0,r,o=e;for(let l of this.#l){let a=l.group??null;if(a!==r)if(r=a,a===null)o=e;else{let d=document.createElement("div");d.className="nish-command-group",d.setAttribute("role","group");let u=document.createElement("div");u.id=`nish-command-${this.#e}-group-${s}`,u.textContent=a,d.setAttribute("aria-labelledby",u.id),d.append(u),e.append(d),o=d}let h=document.createElement("div");h.className="nish-command-item",h.id=this.#x(s),h.dataset.index=String(s),h.setAttribute("role","option"),h.setAttribute("aria-selected",s===this.#s?"true":"false");let c=document.createElement("span");if(c.textContent=l.label,h.append(c),l.hint){let d=document.createElement("span");d.className="nish-command-item-hint",d.textContent=l.hint,h.append(d)}o.append(h),s++}if(this.#l.length===0){let l=document.createElement("div");l.className="nish-command-empty",l.textContent=this.emptyText||i.noResults,e.append(l)}this.#l.length?t.setAttribute("aria-activedescendant",this.#x(this.#s)):t.removeAttribute("aria-activedescendant"),this.#r&&(this.#r.textContent=this.#l.length?i.resultCount(this.#l.length):this.emptyText||i.noResults)}#y(e,t=!0){let i=this.#l.length;if(i===0)return;this.#s=(e%i+i)%i;let s=this.#n;if(s){for(let r of Array.from(s.querySelectorAll("[data-index]"))){let o=Number(r.dataset.index)===this.#s;r.setAttribute("aria-selected",o?"true":"false"),o&&t&&r.scrollIntoView?.({block:"nearest"})}this.#t?.setAttribute("aria-activedescendant",this.#x(this.#s))}}#T(e){this.#c=e,this.#s=0,this.#f(),window.clearTimeout(this.#d),this.#d=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200)}#L(e){if(e.isComposing)return;let t=this.#l.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.#y(this.#s+1);break;case"ArrowUp":e.preventDefault(),this.#y(this.#s-1);break;case"Home":t&&!this.#c&&(e.preventDefault(),this.#y(0));break;case"End":t&&!this.#c&&(e.preventDefault(),this.#y(t-1));break;case"Enter":{e.preventDefault();let i=this.#l[this.#s];i&&this.#A(i);break}}}#A(e){let t=this.#h.get(e.id);if(this.open=!1,this.#i?.close(),this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:e.id}})),t){let i=t.getAttribute("href");i!==null&&ye(i)===null?Sn(i):t.click()}else if(e.href){let i=ye(e.href);i===null?Sn(e.href):window.location.assign(i)}}#k=e=>{let t=this.#i;if(!t||e.target!==t)return;let i=t.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&e.clientY>=i.top&&e.clientY<=i.bottom||(this.open=!1)};#C=e=>{e.preventDefault(),this.open=!1};#_=()=>{window.clearTimeout(this.#d),this.open&&(this.open=!1);let e=this.#o;this.#o=null,e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))}};S("nish-command-palette",bt);var mr={md:"(max-width: 767.98px)",lg:"(max-width: 1023.98px)"},pr=0;function gt(n){let e=document.createElement("div");return e.className=n,e}var vt=class extends E{static properties={activeCount:{attribute:"active-count",type:Number,reflect:!0},sheetTitle:{attribute:"sheet-title",type:String,reflect:!0},sheetBelow:{attribute:"sheet-below",type:String,reflect:!0},sticky:{type:Boolean,reflect:!0}};#e=null;#i=gt("nish-filter-bar-search");#t=gt("nish-filter-bar-chips");#n=gt("nish-filter-bar-trailing");#r=gt("nish-filter-bar-summary");#a=null;#c=null;#s=null;#l=null;#h=null;#o=null;#d=null;#u=null;#m=null;#g=null;#b=[];#S=null;#p=null;#E="";#v=null;#x=()=>this.#C();constructor(){super(),this.activeCount=0,this.sheetTitle="",this.sheetBelow="md",this.sticky=!1}connectedCallback(){super.connectedCallback(),k(()=>this.#f())}disconnectedCallback(){if(super.disconnectedCallback(),this.#p?.removeEventListener("change",this.#x),this.#p=null,this.#E="",this.#v?.disconnect(),this.#v=null,this.#e){this.#h?.close();for(let e of this.#b)this.appendChild(e);for(let e of[this.#i,this.#n,this.#r])for(;e.firstChild;)this.appendChild(e.firstChild);this.#e.remove(),this.#h?.remove(),this.#e=null,this.#a=null,this.#c=null,this.#d=null,this.#u=null,this.#m=null,this.#l=null,this.#h=null,this.#o=null,this.#b=[],this.#S=null}}updated(e){this.#e&&(this.#k(),this.#C())}#f(){if(!this.isConnected||this.#e)return;let e=document.createElement("div");e.className="nish-filter-bar",this.#r.setAttribute("aria-live","polite"),e.append(this.#i,this.#t,this.#n,this.#r),this.#e=e;for(let t of Array.from(this.childNodes))this.#T(t);this.appendChild(e),this.#L(),this.#k(),this.#C(),this.#v=new MutationObserver(t=>{for(let i of t)i.addedNodes.forEach(s=>{s!==e&&s.parentNode===this&&this.#T(s)});this.#C()}),this.#v.observe(this,{childList:!0}),this.#v.observe(this.#t,{childList:!0}),this.#o&&this.#v.observe(this.#o,{childList:!0})}#y(){this.#b=this.#b.filter(e=>e.parentNode===this.#t||e.parentNode===this.#o)}#T(e){if(e===this.#e||e instanceof Comment)return;if(!(e instanceof HTMLElement)){e.parentNode?.removeChild(e);return}let t=e.getAttribute("data-slot");t==="trailing"?this.#n.appendChild(e):t==="summary"?this.#r.appendChild(e):e.localName==="nish-search"&&!this.#i.firstChild?this.#i.appendChild(e):(this.#y(),this.#b.includes(e)||this.#b.push(e),(this.#S==="compact"?this.#o??this.#t:this.#t).appendChild(e))}#L(){let e=++pr,t=document.createElement("button");t.type="button",t.className="nish-btn nish-btn--secondary nish-filter-btn",t.setAttribute("aria-haspopup","dialog"),this.#c=document.createTextNode(""),t.append(dn(16),this.#c);let i=document.createElement("span");i.className="nish-badge nish-badge--accent",t.appendChild(i),t.addEventListener("click",()=>this.#h?.show()),this.#a=t,this.#s=i;let s=document.createElement("button");s.type="button",s.className="nish-btn nish-btn--ghost nish-filter-bar-clear",s.addEventListener("click",()=>this.#A()),this.#l=s;let r=document.createElement("nish-sheet"),o=document.createElement("header");o.className="nish-sheet-header";let l=document.createElement("h2");l.className="nish-sheet-title",l.id=`nish-filter-sheet-title-${e}`,o.appendChild(l);let a=document.createElement("button");a.type="button",a.className="nish-icon-btn",a.setAttribute("data-sheet-close",""),this.#u=a,a.appendChild(ot(16)),o.appendChild(a);let h=document.createElement("div");h.className="nish-sheet-body nish-filter-sheet-body";let c=document.createElement("footer");c.className="nish-sheet-footer";let d=document.createElement("button");d.type="button",d.className="nish-btn nish-btn--ghost",d.addEventListener("click",()=>this.#A());let u=document.createElement("button");u.type="button",u.className="nish-btn nish-btn--primary",u.style.marginInlineStart="auto",this.#m=u,u.addEventListener("click",()=>this.#h?.close()),c.append(d,u),r.append(o,h,c),this.#h=r,this.#o=h,this.#d=d,this.#g=l}#A(){this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0}))}#k(){let e=mr[this.sheetBelow==="lg"?"lg":"md"];e!==this.#E&&(this.#p?.removeEventListener("change",this.#x),this.#E=e,this.#p=typeof matchMedia>"u"?null:matchMedia(e),this.#p?.addEventListener("change",this.#x))}#C(){let e=this.#e,t=this.#h,i=this.#o,s=this.#a,r=this.#l;if(!e||!t||!i||!s||!r)return;this.#y();let o=this.#p?.matches?"compact":"wide";o!==this.#S&&(o==="compact"?(this.#t.remove(),r.remove(),this.#i.after(s),i.append(...this.#b),e.appendChild(t)):(t.close(),s.remove(),this.#t.append(...this.#b,r),this.#i.after(this.#t),t.remove()),this.#S=o,e.setAttribute("data-compact",String(o==="compact")));let l=Math.max(0,Number.isFinite(this.activeCount)?Math.floor(this.activeCount):0);e.classList.toggle("nish-filter-bar--sticky",this.sticky),s.hidden=this.#b.length===0,r.hidden=l===0,this.#s&&(this.#s.textContent=String(l),this.#s.hidden=l===0,this.#s.setAttribute("aria-label",T().activeCount(l))),this.#d&&(this.#d.disabled=l===0);let a=T();this.#g&&(this.#g.textContent=this.sheetTitle||a.filters),this.#c&&(this.#c.data=a.filters),r.textContent=a.clearFilters,this.#d&&(this.#d.textContent=a.clear),this.#m&&(this.#m.textContent=a.showResults),this.#u?.setAttribute("aria-label",a.close)}};S("nish-filter-bar",vt);var yt=class extends E{static properties={label:{type:String,reflect:!0}};#e=null;#i=null;#t=null;constructor(){super(),this.label=""}connectedCallback(){super.connectedCallback(),k(()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.disconnect(),this.#t=null,this.#e=null,this.#i?.(),this.#i=null}updated(e){this.#a()}#n(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-nav-rail");if(!e){for(e=document.createElement("nav"),e.className="nish-nav-rail";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#r(e),this.#a(),this.#i=tt(e,t=>t.classList.add("nish-nav-rail-item")),this.#t=new MutationObserver(t=>{let i=this.#e;if(!i)return;let s=!1;for(let r of t)r.target===this&&r.addedNodes.forEach(o=>{o!==i&&o.nodeType===1&&o.parentNode===this&&(i.appendChild(o),s=!0)});(s||t.some(r=>r.target!==this))&&this.#r(i)}),this.#t.observe(this,{childList:!0}),this.#t.observe(e,{childList:!0,subtree:!0})}#r(e){let t=e.querySelector(':scope > [data-slot="tools"]'),i=e.querySelector(':scope > [data-slot="footer"]');t?.classList.add("nish-nav-rail-tools"),i?.classList.add("nish-nav-rail-footer");let s=[t,i].filter(a=>!!a),r=Array.from(e.children),o=s.length;if(!s.every((a,h)=>r[r.length-o+h]===a))for(let a of s)e.appendChild(a);for(let a of Array.from(e.querySelectorAll(":scope > .nish-nav-rail-tools a, :scope > .nish-nav-rail-footer a")))a.classList.add("nish-nav-rail-item")}#a(){this.#e&&this.#e.setAttribute("aria-label",this.label||T().sections)}};S("nish-nav-rail",yt);var fr='[aria-pressed="true"],[aria-selected="true"],[aria-current]:not([aria-current="false"]),[aria-checked="true"]',Et=class extends E{static properties={label:{type:String,reflect:!0},bleed:{type:Boolean,reflect:!0},snap:{type:Boolean,reflect:!0},fade:{reflect:!0,converter:{fromAttribute:e=>e!=="false",toAttribute:e=>e?null:"false"}}};#e=null;#i=null;#t=null;#n=()=>this.#c();constructor(){super(),this.label="",this.bleed=!1,this.snap=!1,this.fade=!0}connectedCallback(){super.connectedCallback(),k(()=>this.#r())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("scroll",this.#n),this.#i?.disconnect(),this.#i=null,this.#t?.disconnect(),this.#t=null,this.#e=null}updated(e){this.#s()}#r(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-scroll-row");if(!e){for(e=document.createElement("div"),e.className="nish-scroll-row";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#t?.disconnect(),this.#t=new MutationObserver(()=>{let i=this.#e;if(i)for(let s of Array.from(this.childNodes))s!==i&&s.nodeType===1&&i.appendChild(s)}),this.#t.observe(this,{childList:!0}),this.#s(),e.addEventListener("scroll",this.#n,{passive:!0}),typeof ResizeObserver<"u"&&(this.#i=new ResizeObserver(()=>this.#c()),this.#i.observe(e));let t=e.querySelector(fr);t&&this.#a(e,t),this.#c()}#a(e,t){let i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),r=8;s.left<i.left+r?e.scrollLeft+=s.left-i.left-r:s.right>i.right-r&&(e.scrollLeft+=s.right-i.right+r)}#c(){let e=this.#e;if(!e)return;let t=e.scrollWidth-e.clientWidth;e.dataset.atStart=String(e.scrollLeft<=1),e.dataset.atEnd=String(t<=1||e.scrollLeft>=t-1)}#s(){let e=this.#e;e&&(this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),e.classList.toggle("nish-scroll-row--bleed",this.bleed),e.classList.toggle("nish-scroll-row--snap",this.snap),e.classList.toggle("nish-scroll-row--no-fade",!this.fade))}};S("nish-scroll-row",Et);var xn={fromAttribute:n=>n!=="false",toAttribute:n=>n?null:"false"},St=class extends E{static properties={label:{type:String,reflect:!0},sticky:{reflect:!0,converter:xn},updateHash:{attribute:"update-hash",reflect:!0,converter:xn}};#e=null;#i=null;#t=null;#n=null;#r=e=>this.#h(e);constructor(){super(),this.label="",this.sticky=!0,this.updateHash=!0}connectedCallback(){super.connectedCallback(),k(()=>this.#a())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.(),this.#i=null,this.#s=null,this.#t?.disconnect(),this.#t=null,this.#n?.disconnect(),this.#n=null,this.#e?.removeEventListener("click",this.#r),this.#e=null}updated(e){this.#c()}#a(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-subnav");if(!e){for(e=document.createElement("nav"),e.className="nish-subnav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#c(),e.addEventListener("click",this.#r),this.#l(e),this.#t=new MutationObserver(()=>{this.#i?.(),this.#l(e)}),this.#t.observe(e,{childList:!0}),this.#n=new MutationObserver(()=>{let t=this.#e;if(t)for(let i of Array.from(this.childNodes))i!==t&&i.nodeType===1&&t.appendChild(i)}),this.#n.observe(this,{childList:!0})}#c(){let e=this.#e;e&&(e.setAttribute("aria-label",this.label||T().sections),e.style.position=this.sticky?"":"static",this.#s!==null&&this.#s!==this.sticky&&this.#l(e))}#s=null;#l(e){this.#i?.(),this.#i=ki(e,{height:this.sticky}),this.#s=this.sticky}#h(e){let t=e.target instanceof Element?e.target.closest('a[href^="#"]'):null;if(!t||!this.#e?.contains(t)||t.hash.length<2||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let i;try{i=decodeURIComponent(t.hash.slice(1))}catch{return}let s=document.getElementById(i);if(!s)return;e.preventDefault();let r=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(s.scrollIntoView({behavior:r?"auto":"smooth",block:"start"}),this.updateHash)try{history.replaceState(history.state,"",`#${t.hash.slice(1)}`)}catch{}this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:i}}))}};S("nish-section-nav",St);var wn=5,br="(max-width: 639.98px) and (pointer: coarse)";function ti(n,e){let t=()=>Array.from({length:e},()=>100/e);if(e===0)return[];if(!n||n.length!==e||!n.every(s=>Number.isFinite(s)&&s>0))return t();let i=n.reduce((s,r)=>s+r,0);return n.map(s=>s/i*100)}var gr={fromAttribute(n){if(n==null||n.trim()==="")return null;let e=n.split(",").map(t=>Number(t.trim()));return e.every(t=>Number.isFinite(t))?e:null},toAttribute(n){return n&&n.length?n.map(e=>Math.round(e*100)/100).join(","):null}},xt=class extends E{static properties={orientation:{type:String,reflect:!0},sizes:{converter:gr,reflect:!0},min:{type:Number},storageKey:{type:String,attribute:"storage-key"}};#e=[];#i=[];#t=null;#n=null;#r=!1;#a=null;#c=!1;#s=!1;#l=!1;constructor(){super(),this.orientation="row",this.sizes=null,this.min=120,this.storageKey=null}connectedCallback(){if(super.connectedCallback(),typeof window.matchMedia=="function"&&(this.#n=window.matchMedia(br),this.#r=this.#n.matches,this.#n.addEventListener("change",this.#g)),this.#s){this.#h(),this.#o();return}this.#c||(this.#c=!0,k(()=>{this.#c=!1,this.isConnected&&(this.#s=!0,this.#h(),this.#o())}))}disconnectedCallback(){super.disconnectedCallback(),this.#n?.removeEventListener("change",this.#g),this.#n=null,this.#t?.disconnect(),this.#t=null,this.#y()}updated(e){this.#s&&(e.size===0||e.has("orientation")||e.has("sizes")||e.has("min"))&&this.#m()}#h(){typeof MutationObserver>"u"||(this.#t??=new MutationObserver(()=>this.#o()),this.#t.observe(this,{childList:!0}))}#o(){if(!this.isConnected)return;this.#t?.disconnect();let e=[];for(let t of Array.from(this.childNodes)){if(!(t instanceof HTMLElement))continue;if(t.classList.contains("nish-split-divider")){t.remove();continue}if(t.classList.contains("nish-split-pane")){e.push(t);continue}let i=document.createElement("div");i.className="nish-split-pane",this.insertBefore(i,t),i.append(t),e.push(i)}this.#e=e,this.#i=[];for(let t=0;t<e.length-1;t++){let i=document.createElement("div");i.className="nish-split-divider",i.setAttribute("role","separator"),i.tabIndex=0,i.style.touchAction="none",i.addEventListener("pointerdown",s=>this.#v(s,t)),i.addEventListener("pointermove",s=>this.#x(s)),i.addEventListener("pointerup",s=>this.#f(s)),i.addEventListener("pointercancel",s=>this.#f(s)),i.addEventListener("keydown",s=>this.#L(s,t)),i.addEventListener("dblclick",()=>this.#T()),this.insertBefore(i,e[t+1]),this.#i.push(i)}this.#d(),this.#m(),this.#t?.observe(this,{childList:!0})}#d(){if(!(this.#l||!this.storageKey||this.#e.length===0)){this.#l=!0;try{let e=window.localStorage.getItem(this.storageKey);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&t.length===this.#e.length&&t.every(i=>typeof i=="number"&&Number.isFinite(i)&&i>0)&&(this.sizes=ti(t,this.#e.length))}catch{}}}get#u(){return ti(this.sizes,this.#e.length)}#m(){let e=this.orientation!=="column",t=this.#u,i=T();this.style.display="flex",this.style.flexDirection=this.#r?"column":e?"row":"column",this.style.minWidth="0",this.style.minHeight="0",this.#e.forEach((s,r)=>{s.style.minWidth="0",this.#r?(s.style.minHeight="var(--nish-split-stack-h, 16rem)",s.style.flex="none"):(s.style.minHeight="0",s.style.flex=`${t[r]} 1 0%`);let o=s.children.length===1?s.firstElementChild:null;o?.localName==="nish-split"&&(s.style.display="flex",o.style.flex="1 1 auto")}),this.#i.forEach((s,r)=>{s.hidden=this.#r,s.classList.toggle("nish-split-divider--v",e),s.classList.toggle("nish-split-divider--h",!e),s.setAttribute("aria-orientation",e?"vertical":"horizontal"),s.setAttribute("aria-label",e?i.resizeColumns:i.resizeRows),s.setAttribute("aria-valuenow",String(Math.round(t[r]))),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100")})}#g=e=>{this.#r=e.matches,this.#m()};#b(e){let t=e.getBoundingClientRect();return this.orientation==="column"?t.height:t.width}#S(e,t,i,s){let r=e[t]+e[t+1],o=Math.min(s,r/2),l=Math.min(Math.max(e[t]+i,o),r-o),a=e.slice();return a[t]=l,a[t+1]=r-l,a}#p(e){if(this.storageKey)try{window.localStorage.setItem(this.storageKey,JSON.stringify(e))}catch{}}#E(e){this.sizes=e,this.dispatchEvent(new CustomEvent("nish-resize",{bubbles:!0,detail:{sizes:e}}))}#v(e,t){if(e.button!==0||this.#r)return;let i=this.#i[t];if(!i)return;e.preventDefault(),i.setPointerCapture?.(e.pointerId);let s=[];for(let o of Array.from(this.querySelectorAll("iframe")))s.push([o,o.style.pointerEvents]),o.style.pointerEvents="none";let r=this.#e.reduce((o,l)=>o+this.#b(l),0);this.#a={pointerId:e.pointerId,start:this.orientation==="column"?e.clientY:e.clientX,index:t,sizes:this.#u,total:r,restore:s},this.setAttribute("data-dragging","")}#x(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId||t.total<=0)return;let i=this.orientation==="column"?e.clientY:e.clientX,s=this.orientation!=="column"&&Q(this)?-1:1,r=(i-t.start)*s/t.total*100;r!==0&&this.#E(this.#S(t.sizes,t.index,r,this.min/t.total*100))}#f(e){let t=this.#a;if(!t||t.pointerId!==e.pointerId)return;let i=this.#i[t.index];i?.hasPointerCapture?.(e.pointerId)&&i.releasePointerCapture(e.pointerId),this.#y()}#y(){let e=this.#a;if(e){this.#a=null,this.sizes&&this.#p(this.sizes);for(let[t,i]of e.restore)t.style.pointerEvents=i;this.removeAttribute("data-dragging")}}#T(){if(this.#r||this.#e.length<2)return;let e=ti(null,this.#e.length);this.#E(e),this.#p(e)}#L(e,t){if(e.key==="Enter"){e.preventDefault(),this.#T();return}let i=this.orientation!=="column",s=i&&Q(this),r=i?s?"ArrowRight":"ArrowLeft":"ArrowUp",o=i?s?"ArrowLeft":"ArrowRight":"ArrowDown";if(e.key!==r&&e.key!==o)return;e.preventDefault();let l=this.#e.reduce((d,u)=>d+this.#b(u),0),a=l>0?this.min/l*100:0,h=this.#u,c=this.#S(h,t,e.key===o?wn:-wn,a);c[t]!==h[t]&&(this.#E(c),this.#p(c))}};S("nish-split",xt);var ii="http://www.w3.org/2000/svg";function vr(){let n=document.createElementNS(ii,"svg");n.setAttribute("width","10"),n.setAttribute("height","10"),n.setAttribute("viewBox","0 0 10 10"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false");for(let e of["M2 4 5 1l3 3","M2 6l3 3 3-3"]){let t=document.createElementNS(ii,"path");t.setAttribute("d",e),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.5"),t.setAttribute("opacity","0.35"),n.appendChild(t)}return n}function yr(n){return(n.target instanceof Element?n.target:n.target.parentElement)?.closest("thead")?!0:Array.from(n.addedNodes).some(t=>t instanceof Element&&(t.localName==="thead"||t.localName==="table"||t.localName==="tr"||t.localName==="th"||t.querySelector("thead")!==null))}function Er(n){let e=n.replace(/[\s,$€£%]/g,"");if(e===""||e==="-"||e==="+")return null;let t=Number(e);return Number.isFinite(t)?t:null}var wt=class extends E{static properties={manual:{type:Boolean,reflect:!0}};#e=null;#i=e=>this.#l(e);constructor(){super(),this.manual=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#i),k(()=>this.#t())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#i),this.#e?.disconnect(),this.#e=null}#t(){!this.isConnected||this.#e||(this.#a(),this.#e=new MutationObserver(e=>{e.some(yr)&&(this.#e?.disconnect(),this.#a(),this.#n())}),this.#n())}#n(){this.#e?.observe(this,{childList:!0,subtree:!0})}#r(){return Array.from(this.querySelectorAll("thead th[data-sort]"))}#a(){for(let e of this.#r()){if(e.hasAttribute("scope")||e.setAttribute("scope","col"),e.hasAttribute("aria-sort")||e.setAttribute("aria-sort","none"),e.querySelector(":scope > .nish-th-sort"))continue;let t=document.createElement("button");for(t.type="button",t.className="nish-th-sort";e.firstChild;)t.appendChild(e.firstChild);t.appendChild(vr()),e.appendChild(t),this.#c(e)}}#c(e){let t=e.querySelectorAll(".nish-th-sort svg path"),i=e.getAttribute("aria-sort");t[0]?.setAttribute("opacity",i==="ascending"?"1":"0.35"),t[1]?.setAttribute("opacity",i==="descending"?"1":"0.35")}#s(e){let t=e.getAttribute("data-sort");if(t)return t;let i=e.querySelector(".nish-th-sort"),s="";return(i??e).childNodes.forEach(r=>{(r.nodeType===Node.TEXT_NODE||r instanceof HTMLElement&&r.namespaceURI!==ii)&&(s+=r.textContent??"")}),s.trim()}#l(e){let i=e.target?.closest(".nish-th-sort"),s=i?.closest("th[data-sort]");if(!i||!s||!this.contains(s))return;let r=s.getAttribute("aria-sort")==="ascending"?"descending":"ascending";for(let o of this.#r())o.setAttribute("aria-sort",o===s?r:"none"),this.#c(o);this.manual||this.#h(s,r),this.dispatchEvent(new CustomEvent("nish-sort",{bubbles:!0,detail:{column:this.#s(s),direction:r==="ascending"?"asc":"desc"}}))}#h(e,t){let i=e.cellIndex,s=t==="ascending"?1:-1,r=e.closest("table");if(!r)return;let o=new Intl.Collator(void 0,{sensitivity:"base"});for(let l of Array.from(r.tBodies)){let a=Array.from(l.rows).map((b,m)=>{let x=b.cells[i],g=x?(x.getAttribute("data-value")??x.textContent??"").trim():"";return{row:b,key:g,num:Er(g),order:m}}),h=a.filter(b=>b.key!==""),c=a.filter(b=>b.key===""),d=e.classList.contains("nish-th--num")||h.length>0&&h.every(b=>b.num!==null);h.sort((b,m)=>(d?(b.num??0)-(m.num??0):o.compare(b.key,m.key))*s||b.order-m.order);let u=document.createDocumentFragment();for(let b of[...h,...c])u.appendChild(b.row);l.appendChild(u)}}};S("nish-table-sort",wt);var He="\u2013",ri="\u2212",si="en-US",Sr=de("format",()=>({locale:si})),Tn=new Map;function xr(n){let e=Tn.get(n);if(e===void 0){try{e=Intl.getCanonicalLocales(n)[0]??si}catch{e=si}Tn.set(n,e)}return e}function De(n){return n?.locale?xr(n.locale):Sr.locale}function Cn(n){return n==="en"||n==="en-US"}var Ln=new Map;function kn(n,e){let t=Ln.get(n);return t===void 0&&(t=e(),Ln.set(n,t)),t}function wr(n,e,t){return kn(`n|${n}|${e}|${t}`,()=>new Intl.NumberFormat(n,{minimumFractionDigits:e,maximumFractionDigits:t}))}function le(n,e,t,i){return kn(`d|${n}|${e}|${i??""}`,()=>new Intl.DateTimeFormat(n,i?{...t,timeZone:i}:t))}function oi(n){return typeof n=="number"&&Number.isFinite(n)}function Z(n,e,t,i){return wr(i,e,t).format(n)}var ni=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"k"]];function _n(n,e,t){for(let i=0;i<ni.length;i++){let[s,r]=ni[i];if(!(n<s)){if(i>0&&Number((n/s).toFixed(e))>=1e3){let[o,l]=ni[i-1];return Z(n/o,0,e,t)+l}return Z(n/s,0,e,t)+r}}return Z(n,0,e,t)}function Mn(n,e){return Number(Math.abs(n).toFixed(e))===0}var An=new Map;function Tr(n,e){let t=`${e}|${n}`,i=An.get(t);if(i===void 0){try{i=new Intl.NumberFormat(e,{style:"currency",currency:n,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(r=>r.type==="currency")?.value??n}catch{i=n+" "}An.set(t,i)}return i}function Lr(n,e,t){let i=Tr(e.currency??"USD",t);if(e.compact&&n>=1e3)return i+_n(n,1,t);let s=e.cents??"auto",r=Math.round(n*100)%100!==0,o=s==="always"||s==="auto"&&(n<1e3||r);return i+(o?Z(n,2,2,t):Z(n,0,0,t))}function Nn(n,e={}){if(!oi(n))return He;let t=Lr(Math.abs(n),e,De(e));return n<0&&Math.round(Math.abs(n)*100)>0?ri+t:t}function $n(n,e={}){if(!oi(n))return He;let t=e.digits??1,i=e.fromRatio??!0?n*100:n,s=Z(Math.abs(i),t,t,De(e))+"%";return Mn(i,t)?s:i<0?ri+s:e.signed?"+"+s:s}function Rn(n,e={}){if(!oi(n))return He;let t=De(e),i=n<0&&!Mn(n,e.digits??2)?ri:"",s=Math.abs(n);return e.compact&&s>=1e3?i+_n(s,e.digits??1,t):i+(e.digits===void 0?Z(s,0,2,t):Z(s,e.digits,e.digits,t))}var Ar=/^(\d{4})-(\d{2})-(\d{2})$/;function On(n){if(n==null)return null;let e,t=!1;if(n instanceof Date)e=n;else if(typeof n=="number")e=new Date(n);else{let i=Ar.exec(n.trim());t=!!i,e=i?new Date(Number(i[1]),Number(i[2])-1,Number(i[3])):new Date(n)}return Number.isNaN(e.getTime())?null:{d:e,dayOnly:t}}function Pn(n,e){return n.dayOnly?void 0:e.timeZone}function Tt(n){return n.replace(/[\u202f\u00a0]/g," ")}var ec=[[60,"minute","m"],[3600,"hour","h"],[86400,"day","d"],[86400*30,"month","mo"],[86400*365,"year","y"]];var Cr={month:"short",day:"numeric",year:"numeric"},kr={weekday:"long",month:"long",day:"numeric",year:"numeric"},_r={month:"short",day:"numeric"},Mr={weekday:"short"},Nr={month:"numeric",day:"numeric"},$r={hour:"numeric",minute:"2-digit"},Rr={hour:"numeric",minute:"2-digit",hour12:!0},Or={year:"numeric",month:"numeric",day:"numeric"};function Pr(n,e){if(!e)return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()};let t={year:0,month:0,day:0};for(let i of le("en-US","ymd",Or,e).formatToParts(n))(i.type==="year"||i.type==="month"||i.type==="day")&&(t[i.type]=Number(i.value));return t}function Ir(n,e,t,i){let s=Pn(n,t);switch(e){case"medium":return Tt(le(i,"medium",Cr,s).format(n.d));case"long":return Tt(le(i,"long",kr,s).format(n.d));case"weekday":{let r=le(i,"weekday",Mr,s).format(n.d);if(!Cn(i))return`${r} ${le(i,"md",Nr,s).format(n.d)}`;let o=Pr(n.d,s);return`${r} ${o.month}/${o.day}`}default:return Tt(le(i,"short",_r,s).format(n.d))}}function In(n,e="short",t={}){let i=On(n);return i?Ir(i,e,t,De(t)):He}function Hr(n,e,t){let i=Cn(t);return Tt(le(t,i?"time12":"time",i?Rr:$r,Pn(n,e)).format(n.d))}function Hn(n,e={}){let t=On(n);return t?Hr(t,e,De(e)):He}var Dn={ok:"var(--nish-ok-fill)",warn:"var(--nish-warn-fill)",loss:"var(--nish-loss-fill)",info:"var(--nish-info-fill)",accent:"var(--nish-accent)"};function W(n,e){return n&&Object.hasOwn(Dn,n)?Dn[n]:n&&/^chart-[1-8]$/.test(n)?`var(--nish-${n})`:`var(--nish-chart-${(Math.trunc(e)%8+8)%8+1})`}var z={grid:"var(--nish-line)",axis:"var(--nish-line-strong)",zero:"var(--nish-hi3)",text:"var(--nish-hi3)"},Bn,Dr=n=>Math.abs(n)<1e3?String(Math.round(n*100)/100):(Bn??=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),Bn.format(n));function ge(n,e=Dr){let t=(n??"").trim();if(!t)return e;let i=t.indexOf(":"),s=(i<0?t:t.slice(0,i)).toLowerCase(),r=i<0?"":t.slice(i+1).trim();switch(s){case"number":return o=>Rn(o);case"percent":{let o=r!==""&&Number.isInteger(Number(r))&&Number(r)>=0&&Number(r)<=10?Number(r):1;return l=>$n(l,{digits:o})}case"currency":return o=>Nn(o,{currency:r||"USD"});case"date":{let o=r==="medium"||r==="long"||r==="weekday"?r:"short";return l=>In(l,o)}case"time":return o=>Hn(o);default:return e}}function ai(n,e,t){let i=Math.max(2,Math.floor(t));return Array.from({length:i},(s,r)=>n+(e-n)*r/(i-1))}function zn(n,e){if(n===e){let i=Math.abs(n)*.05||1;return[n-i,e+i]}let t=(e-n)*.06;return[n-t,e+t]}function Un(n,e){let t=0,i=n.length-1;for(;i-t>1;){let s=t+i>>1;n[s]<e?t=s:i=s}return Math.abs(n[t]-e)<=Math.abs(n[i]-e)?t:i}function ee(n){if(n==null||n==="")return null;let e=typeof n=="number"?n:Number(n);return Number.isFinite(e)?e:null}function li(n){if(!Array.isArray(n))return[];let e=[];return n.forEach((t,i)=>{if(Array.isArray(t)){let s=ee(t[0]);s!==null&&e.push({x:s,y:ee(t[1])})}else if(t&&typeof t=="object"){let s=t,r=ee(s.x);r!==null&&e.push({x:r,y:ee(s.y)})}else e.push({x:i,y:ee(t)})}),e}function Gn(n){return Array.isArray(n)?n.map((e,t)=>{let i=e&&typeof e=="object"?e:{};return{label:typeof i.label=="string"&&i.label?i.label:T().seriesNumber(t+1),tone:typeof i.tone=="string"?i.tone:void 0,points:li(i.points??i.data)}}):[]}function Vn(n){return Array.isArray(n)?n.map((e,t)=>{if(Array.isArray(e))return{label:String(e[0]??""),value:ee(e[1])??0};if(e&&typeof e=="object"){let i=e;return{label:i.label==null?String(t+1):String(i.label),value:ee(i.value)??0}}return{label:String(t+1),value:ee(e)??0}}):[]}var Be={fromAttribute(n){if(!n)return[];try{let e=JSON.parse(n);return Array.isArray(e)?e:[]}catch{return[]}},toAttribute(n){try{return JSON.stringify(n)}catch{return""}}},te=class extends E{static properties={label:{type:String,reflect:!0},height:{type:Number,reflect:!0},tone:{type:String,reflect:!0},empty:{type:String,reflect:!0},yFormat:{type:String,attribute:"y-format",reflect:!0},xFormat:{type:String,attribute:"x-format",reflect:!0},width:{state:!0}};ro=null;themeObserver=null;constructor(){super(),this.label="",this.tone="",this.empty="",this.yFormat="",this.xFormat="",this.width=0}connectedCallback(){super.connectedCallback(),getComputedStyle(this).display==="inline"&&(this.style.display="block"),this.width=this.clientWidth,typeof ResizeObserver<"u"&&(this.ro=new ResizeObserver(()=>{this.clientWidth!==this.width&&(this.width=this.clientWidth)}),this.ro.observe(this)),this.themeObserver=new MutationObserver(()=>this.requestUpdate()),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})}disconnectedCallback(){super.disconnectedCallback(),this.ro?.disconnect(),this.ro=null,this.themeObserver?.disconnect(),this.themeObserver=null}get plotHeight(){return this.height>0?this.height:200}},Fn=0;function qn(){return Fn+=1,`nish-chart-${Fn}`}var Lt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";var Wn=18,Br=22,At=class extends te{static properties={...te.properties,data:{converter:Be},xTicks:{type:String,attribute:"x-ticks",reflect:!0},showValues:{type:Boolean,attribute:"show-values",reflect:!0},selected:{state:!0},coarse:{state:!0}};mq=null;onCoarse=()=>{this.coarse=!!this.mq?.matches};constructor(){super(),this.data=[],this.height=140,this.xTicks="ends",this.showValues=!1,this.selected=null,this.coarse=!1}connectedCallback(){super.connectedCallback(),typeof window<"u"&&window.matchMedia&&(this.mq=window.matchMedia("(pointer: coarse)"),this.coarse=this.mq.matches,this.mq.addEventListener("change",this.onCoarse))}disconnectedCallback(){super.disconnectedCallback(),this.mq?.removeEventListener("change",this.onCoarse),this.mq=null}render(){let e=T(),t=this.label,i=this.height>0?this.height:140,s=Vn(this.data),r=ge(this.yFormat),o=ge(this.xFormat,L=>String(L)),l=L=>this.xFormat&&L.trim()!==""&&Number.isFinite(Number(L))?o(Number(L)):L;if(!s.length)return C`<div class="nish-chart">
|
|
52
|
+
<div class="nish-empty" role="img" aria-label=${e.noDataNamed(t)} style="height:${i}px;box-sizing:border-box">${this.empty||e.noDataYet}</div>
|
|
53
|
+
</div>`;let a=this.width,h=W(this.tone,0),c=s.map(L=>Number.isFinite(L.value)?L.value:0),d=Math.max(0,...c),u=Math.min(0,...c),b=d-u||1,m=Math.max(0,i-Wn-Br),x=Wn+d/b*m,g=a/s.length,p=Math.max(1,g*.72),w=this.showValues,v=w||this.coarse,P=this.xTicks==="all",H=this.selected!=null&&this.selected<s.length?this.selected:null,D=L=>{let N=L.currentTarget.getBoundingClientRect(),I=Math.floor((L.clientX-N.left)/(N.width||1)*s.length);this.selected=Math.min(s.length-1,Math.max(0,I))},ve=L=>{if(L.key==="ArrowLeft"||L.key==="ArrowRight"){L.preventDefault();let N=L.key==="ArrowRight"?1:-1,I=this.selected;this.selected=I==null?N>0?0:s.length-1:Math.min(s.length-1,Math.max(0,I+N))}else L.key==="Escape"&&(this.selected=null)},Fe=a>0?C`<svg
|
|
54
54
|
width=${a}
|
|
55
|
-
height=${
|
|
55
|
+
height=${i}
|
|
56
56
|
role="img"
|
|
57
57
|
tabindex="0"
|
|
58
58
|
aria-label=${t}
|
|
59
59
|
style="display:block;touch-action:pan-y"
|
|
60
|
-
@pointerdown=${
|
|
61
|
-
@pointermove=${L=>{(L.pointerType==="mouse"||L.buttons)&&
|
|
60
|
+
@pointerdown=${D}
|
|
61
|
+
@pointermove=${L=>{(L.pointerType==="mouse"||L.buttons)&&D(L)}}
|
|
62
62
|
@pointerleave=${L=>{L.pointerType==="mouse"&&(this.selected=null)}}
|
|
63
|
-
@keydown=${
|
|
63
|
+
@keydown=${ve}
|
|
64
64
|
>
|
|
65
|
-
<line class="nish-chart-grid" x1="0" x2=${a} y1=${
|
|
66
|
-
${c.map((L
|
|
67
|
-
<rect x=${B} y=${
|
|
68
|
-
${
|
|
65
|
+
<line class="nish-chart-grid" x1="0" x2=${a} y1=${x} y2=${x} stroke=${z.grid} stroke-width="1"></line>
|
|
66
|
+
${c.map((L,N)=>{let I=Math.max(2,Math.abs(L)/b*m),j=L<0?x:x-I,B=N*g+(g-p)/2,U=H===N,ze=U||v&&(w||g>=26);return _`<g>
|
|
67
|
+
<rect x=${B} y=${j} width=${p} height=${I} rx="2" fill=${h} opacity=${H==null||U?1:.55}></rect>
|
|
68
|
+
${ze?_`<text class="nish-chart-axis" x=${B+p/2} y=${L<0?j+I+11:Math.max(11,j-4)} text-anchor="middle" font-size="11" fill=${z.text} style="font-variant-numeric:tabular-nums">${r(L)}</text>`:y}
|
|
69
69
|
</g>`})}
|
|
70
|
-
${s.map((L
|
|
70
|
+
${s.map((L,N)=>{if(!(P||N===0||N===s.length-1))return y;let I=P?"middle":N===0?"start":"end",j=P?N*g+g/2:N===0?0:a;return _`<text class="nish-chart-axis" x=${j} y=${i-6} text-anchor=${I} font-size="11" fill=${z.text}>${l(L.label)}</text>`})}
|
|
71
71
|
</svg>`:y;return C`<div class="nish-chart" style="position:relative;width:100%">
|
|
72
|
-
${
|
|
73
|
-
<div aria-live="polite" style="margin-top:4px;min-height:20px;font-size:14px;font-variant-numeric:tabular-nums;color:var(--nish-hi2)">${
|
|
72
|
+
${Fe}
|
|
73
|
+
<div aria-live="polite" style="margin-top:4px;min-height:20px;font-size:14px;font-variant-numeric:tabular-nums;color:var(--nish-hi2)">${H!=null?`${l(s[H].label)}: ${r(c[H])}`:""}</div>
|
|
74
74
|
<table style=${Lt}>
|
|
75
75
|
<caption>${t}</caption>
|
|
76
76
|
<tbody>
|
|
77
|
-
${s.map((L
|
|
77
|
+
${s.map((L,N)=>C`<tr><th scope="row">${l(L.label)}</th><td>${r(c[N])}</td></tr>`)}
|
|
78
78
|
</tbody>
|
|
79
79
|
</table>
|
|
80
|
-
</div>`}};
|
|
81
|
-
<div class="nish-empty" role="img" aria-label=${e.noDataNamed(t)} style="height:${
|
|
82
|
-
</div>`;let c=s.map(f=>new Map(f.points.filter(l).map(A=>[A.x,A.y]))),d=1/0,u=-1/0;for(let f of s)for(let A of f.points)l(A)&&(d=Math.min(d,A.y),u=Math.max(u,A.y));let b=this.baseline!=null&&Number.isFinite(this.baseline)?this.baseline:void 0;b!==void 0&&(d=Math.min(d,b),u=Math.max(u,b)),[d,u]=zn(d,u);let m=h[0],
|
|
80
|
+
</div>`}};S("nish-bar-chart",At);var Ct=10,Fr=24,zr=12,Ur="position:absolute;top:4px;z-index:10;pointer-events:none;white-space:nowrap;padding:4px 8px;font-variant-numeric:tabular-nums;background:var(--nish-elevated);border:1px solid var(--nish-line-strong);border-radius:var(--nish-radius-sm);box-shadow:var(--nish-shadow-pop);color:var(--nish-hi);font-size:12px",kt=class extends te{static properties={...te.properties,data:{converter:Be},series:{converter:Be},area:{type:Boolean,reflect:!0},baseline:{type:Number,reflect:!0},yTicks:{type:Number,attribute:"y-ticks",reflect:!0},xTicks:{type:Number,attribute:"x-ticks",reflect:!0},active:{state:!0}};fromKey=!1;listening=!1;gradId=qn();constructor(){super(),this.data=[],this.series=[],this.area=!1,this.height=200,this.yTicks=4,this.xTicks=4,this.active=null}onDocPointerDown=e=>{this.contains(e.target)||(this.active=null)};disconnectedCallback(){super.disconnectedCallback(),this.stopListening()}stopListening(){this.listening&&(document.removeEventListener("pointerdown",this.onDocPointerDown),this.listening=!1)}updated(){this.active!=null&&!this.listening?(document.addEventListener("pointerdown",this.onDocPointerDown),this.listening=!0):this.active==null&&this.stopListening()}lines(){let e=Gn(this.series);if(e.length)return e;let t=li(this.data);return t.length?[{label:this.label,tone:this.tone||void 0,points:t}]:[]}moveTo(e,t,i,s,r,o,l){let a=t.getBoundingClientRect(),h=o+(e-a.left-s)/(r||1)*(l-o);this.active=Un(i,h)}render(){let e=T(),t=this.label,i=this.plotHeight,s=this.lines(),r=ge(this.yFormat),o=ge(this.xFormat),l=f=>f.y!=null&&Number.isFinite(f.y)&&Number.isFinite(f.x),a=new Set;for(let f of s)for(let A of f.points)l(A)&&a.add(A.x);let h=[...a].sort((f,A)=>f-A);if(!h.length)return C`<div class="nish-chart">
|
|
81
|
+
<div class="nish-empty" role="img" aria-label=${e.noDataNamed(t)} style="height:${i}px;box-sizing:border-box">${this.empty||e.noDataYet}</div>
|
|
82
|
+
</div>`;let c=s.map(f=>new Map(f.points.filter(l).map(A=>[A.x,A.y]))),d=1/0,u=-1/0;for(let f of s)for(let A of f.points)l(A)&&(d=Math.min(d,A.y),u=Math.max(u,A.y));let b=this.baseline!=null&&Number.isFinite(this.baseline)?this.baseline:void 0;b!==void 0&&(d=Math.min(d,b),u=Math.max(u,b)),[d,u]=zn(d,u);let m=h[0],x=h[h.length-1]===m?m+1:h[h.length-1],g=this.width,p=ai(d,u,this.yTicks||4).map(f=>({v:f,text:r(f)})),w=Math.ceil(Math.max(...p.map(f=>f.text.length))*6.6)+10,v=Math.max(0,g-w-zr),P=Math.max(0,i-Ct-Fr),H=f=>w+(f-m)/(x-m)*v,D=f=>Ct+(1-(f-d)/(u-d))*P,ve=Ct+P,Fe=s.map(f=>{let A=[],$=[];for(let _t of[...f.points].sort((Jn,Qn)=>Jn.x-Qn.x))l(_t)?$.push([Number(H(_t.x).toFixed(1)),Number(D(_t.y).toFixed(1))]):($.length&&A.push($),$=[]);return $.length&&A.push($),A}),L=f=>f.map(A=>`${A[0]},${A[1]}`).join(" "),N=Math.min(this.xTicks||4,Math.max(2,Math.floor(v/72))),I=ai(m,x,N),j=this.active!=null&&this.active<h.length?this.active:null,B=j!=null?h[j]:null,U=B!=null?H(B):0,ze=B!=null?s.map((f,A)=>({s:f,i:A,y:c[A].get(B)})).filter(f=>f.y!=null):[],jn=U<g/2,ci=f=>{this.fromKey=!1,this.moveTo(f.clientX,f.currentTarget,h,w,v,m,x)},Yn=f=>{if(f.key==="ArrowLeft"||f.key==="ArrowRight"){f.preventDefault(),this.fromKey=!0;let A=f.key==="ArrowRight"?1:-1,$=this.active;this.active=$==null?A>0?0:h.length-1:Math.min(h.length-1,Math.max(0,$+A))}else f.key==="Escape"&&(this.active=null)},hi=s[0],di=W(hi?.tone,0),Kn=g>0?C`<svg
|
|
83
83
|
width=${g}
|
|
84
|
-
height=${
|
|
84
|
+
height=${i}
|
|
85
85
|
role="img"
|
|
86
86
|
tabindex="0"
|
|
87
87
|
aria-label=${t}
|
|
@@ -89,32 +89,32 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
89
89
|
@pointerdown=${ci}
|
|
90
90
|
@pointermove=${ci}
|
|
91
91
|
@pointerleave=${f=>{f.pointerType==="mouse"&&(this.active=null)}}
|
|
92
|
-
@keydown=${
|
|
92
|
+
@keydown=${Yn}
|
|
93
93
|
@blur=${()=>{this.fromKey&&(this.active=null)}}
|
|
94
94
|
>
|
|
95
|
-
${this.area&&hi?
|
|
96
|
-
${p.map(f=>
|
|
97
|
-
<line class="nish-chart-grid" x1=${
|
|
98
|
-
<text class="nish-chart-axis" x=${
|
|
95
|
+
${this.area&&hi?_`<defs><linearGradient id=${this.gradId} x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color=${di} stop-opacity="0.2"></stop><stop offset="100%" stop-color=${di} stop-opacity="0"></stop></linearGradient></defs>`:y}
|
|
96
|
+
${p.map(f=>_`<g>
|
|
97
|
+
<line class="nish-chart-grid" x1=${w} x2=${w+v} y1=${D(f.v)} y2=${D(f.v)} stroke=${z.grid} stroke-width="1"></line>
|
|
98
|
+
<text class="nish-chart-axis" x=${w-6} y=${D(f.v)} text-anchor="end" dominant-baseline="middle" font-size="11" fill=${z.text} style="font-variant-numeric:tabular-nums">${f.text}</text>
|
|
99
99
|
</g>`)}
|
|
100
|
-
${
|
|
101
|
-
${b!==void 0?
|
|
102
|
-
${this.area?(
|
|
103
|
-
${
|
|
104
|
-
${B!=null?
|
|
105
|
-
<line x1=${U} x2=${U} y1=${Ct} y2=${
|
|
106
|
-
${
|
|
100
|
+
${I.map((f,A)=>_`<text class="nish-chart-axis" x=${H(f)} y=${i-6} text-anchor=${A===0?"start":A===I.length-1?"end":"middle"} font-size="11" fill=${z.text} style="font-variant-numeric:tabular-nums">${o(f)}</text>`)}
|
|
101
|
+
${b!==void 0?_`<line x1=${w} x2=${w+v} y1=${D(b)} y2=${D(b)} stroke=${z.zero} stroke-width="1" stroke-dasharray="4 4"></line>`:y}
|
|
102
|
+
${this.area?(Fe[0]??[]).map(f=>_`<polygon points="${f[0][0]},${ve} ${L(f)} ${f[f.length-1][0]},${ve}" fill="url(#${this.gradId})"></polygon>`):y}
|
|
103
|
+
${Fe.map((f,A)=>f.map($=>$.length===1?_`<circle cx=${$[0][0]} cy=${$[0][1]} r="2" fill=${W(s[A].tone,A)}></circle>`:_`<polyline points=${L($)} fill="none" stroke=${W(s[A].tone,A)} stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></polyline>`))}
|
|
104
|
+
${B!=null?_`<g pointer-events="none">
|
|
105
|
+
<line x1=${U} x2=${U} y1=${Ct} y2=${ve} stroke=${z.axis} stroke-width="1"></line>
|
|
106
|
+
${ze.map(f=>_`<circle cx=${U} cy=${D(f.y)} r="4" fill=${W(f.s.tone,f.i)} stroke="var(--nish-surface)" stroke-width="2"></circle>`)}
|
|
107
107
|
</g>`:y}
|
|
108
|
-
</svg>`:y,
|
|
108
|
+
</svg>`:y,Xn=B!=null&&g>0?C`<div class="nish-chart-tooltip" style="${Ur};${jn?`left:${U+10}px`:`right:${g-U+10}px`}">
|
|
109
109
|
<div style="color:var(--nish-hi3)">${o(B)}</div>
|
|
110
|
-
${
|
|
111
|
-
<span aria-hidden="true" style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${
|
|
110
|
+
${ze.map(f=>C`<div style="display:flex;align-items:center;gap:6px">
|
|
111
|
+
<span aria-hidden="true" style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${W(f.s.tone,f.i)}"></span>
|
|
112
112
|
${s.length>1?C`<span style="color:var(--nish-hi3)">${f.s.label}</span>`:y}
|
|
113
113
|
<span style="font-weight:500">${r(f.y)}</span>
|
|
114
114
|
</div>`)}
|
|
115
115
|
</div>`:y;return C`<div class="nish-chart" style="position:relative;width:100%;user-select:none">
|
|
116
|
-
<div style="position:relative;height:${
|
|
117
|
-
${Kn}${
|
|
116
|
+
<div style="position:relative;height:${i}px">
|
|
117
|
+
${Kn}${Xn}
|
|
118
118
|
<table style=${Lt}>
|
|
119
119
|
<caption>${t}</caption>
|
|
120
120
|
<thead>
|
|
@@ -126,15 +126,15 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
126
126
|
<tbody>
|
|
127
127
|
${h.slice(0,200).map(f=>C`<tr>
|
|
128
128
|
<th scope="row">${o(f)}</th>
|
|
129
|
-
${s.map((A
|
|
129
|
+
${s.map((A,$)=>C`<td>${c[$].has(f)?r(c[$].get(f)):""}</td>`)}
|
|
130
130
|
</tr>`)}
|
|
131
131
|
</tbody>
|
|
132
132
|
</table>
|
|
133
133
|
</div>
|
|
134
134
|
${s.length>1?C`<ul class="nish-legend" aria-label=${e.legend}>
|
|
135
|
-
${s.map((f,A)=>C`<li class="nish-legend-item" style="--c: ${
|
|
135
|
+
${s.map((f,A)=>C`<li class="nish-legend-item" style="--c: ${W(f.tone,A)}"><i class="nish-legend-swatch" aria-hidden="true"></i>${f.label}</li>`)}
|
|
136
136
|
</ul>`:y}
|
|
137
|
-
</div>`}};
|
|
137
|
+
</div>`}};S("nish-line-chart",kt);export{At as NishBarChart,it as NishBottomNav,at as NishChipGroup,lt as NishCombobox,bt as NishCommandPalette,ct as NishCopyButton,nt as NishDialog,E as NishElement,ht as NishField,vt as NishFilterBar,kt as NishLineChart,yt as NishNavRail,Et as NishScrollRow,dt as NishSearch,St as NishSectionNav,mt as NishSegmented,st as NishSheet,pt as NishSparkline,xt as NishSplit,ft as NishSwitch,wt as NishTableSort,ut as NishTabs,rt as NishThemeToggle,Vs as configureStrings,S as define,Ai as toast};
|
|
138
138
|
/*! Bundled license information:
|
|
139
139
|
|
|
140
140
|
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|