nish-ui 1.7.0 → 1.8.0

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