nish-ui 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/base-tailwind.css +3 -1
- package/dist/base.css +3 -1
- package/dist/chart.js +1 -1
- package/dist/elements-all.js +1 -1
- package/dist/elements-charts.js +1 -1
- package/dist/elements-data.js +1 -1
- package/dist/elements-forms.js +1 -1
- package/dist/elements.js +3 -3
- package/dist/esm/components/calendar-base.js +291 -0
- package/dist/esm/components/calendar-classes.js +78 -0
- package/dist/esm/components/calendar.js +22 -254
- package/dist/esm/components/date-range-picker.js +213 -0
- package/dist/esm/components/forms.js +1 -0
- package/dist/esm/components/layout.js +8 -1
- package/dist/esm/components/range-calendar.js +122 -0
- package/dist/esm/components/strings.js +9 -0
- package/dist/esm/components/time-field-classes.js +110 -0
- package/dist/esm/components/time-field.js +308 -0
- package/dist/esm/components/tree-view.js +40 -46
- package/dist/esm/index.js +6 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/format.js +1 -1
- package/dist/index.d.ts +161 -10
- package/dist/nish.css +3 -1
- package/dist/theme.d.ts +18 -0
- package/dist/theme.global.js +10 -1
- package/dist/theme.js +10 -1
- package/package.json +1 -1
package/dist/elements-data.js
CHANGED
|
@@ -2,7 +2,7 @@ function Pt(i,e){let t=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(t.
|
|
|
2
2
|
`).toLowerCase();return t.every(s=>n.includes(s))}function Fe(i,e){let t=[],n=new Map;for(let s of i){if(!Pt(s,e))continue;let r=s.group??null,o=n.get(r);o||(o=[],n.set(r,o),t.push(r)),o.push(s)}return t.sort((s,r)=>s===null?-1:r===null?1:0),t.flatMap(s=>n.get(s)).slice(0,50)}function Se(i){if(i==null)return null;let e=String(i),t=0,n=e.length;for(;t<n&&e.charCodeAt(t)<=32;)t++;for(;n>t&&e.charCodeAt(n-1)<=32;)n--;let s=e.slice(t,n).replace(/[\t\n\r]/g,"");if(s===""||s!==s.trim()||/[\u0000-\u001f\u007f]/.test(s))return null;let r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(s);if(!r)return s;let o=r[1].toLowerCase();return o==="http"||o==="https"||o==="mailto"||o==="tel"?s:null}var Ge=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 C=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},E=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)},B,se,ie,W,_e,F,re,P,G,R,oe,qe;var g={__proto__:null};g.enumerable=!0;Object.freeze(g);var we=(R=class{constructor(e,t={}){if(B.set(this,!1),se.set(this,!1),ie.set(this,!1),W.set(this,!1),_e.set(this,Date.now()),F.set(this,!1),re.set(this,void 0),P.set(this,void 0),G.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;C(this,B,!!s,"f"),C(this,se,!!n,"f"),C(this,ie,!!r,"f"),C(this,re,`${e}`,"f"),C(this,P,null,"f"),C(this,G,!1,"f")}initEvent(e,t,n){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){C(this,W,!0,"f")}get target(){return E(this,P,"f")}get currentTarget(){return E(this,P,"f")}get srcElement(){return E(this,P,"f")}get type(){return E(this,re,"f")}get cancelable(){return E(this,B,"f")}get defaultPrevented(){return E(this,B,"f")&&E(this,W,"f")}get timeStamp(){return E(this,_e,"f")}composedPath(){return E(this,G,"f")?[E(this,P,"f")]:[]}get returnValue(){return!E(this,B,"f")||!E(this,W,"f")}get bubbles(){return E(this,se,"f")}get composed(){return E(this,ie,"f")}get eventPhase(){return E(this,G,"f")?R.AT_TARGET:R.NONE}get cancelBubble(){return E(this,F,"f")}set cancelBubble(e){e&&C(this,F,!0,"f")}stopPropagation(){C(this,F,!0,"f")}get isTrusted(){return!1}},B=new WeakMap,se=new WeakMap,ie=new WeakMap,W=new WeakMap,_e=new WeakMap,F=new WeakMap,re=new WeakMap,P=new WeakMap,G=new WeakMap,R.NONE=0,R.CAPTURING_PHASE=1,R.AT_TARGET=2,R.BUBBLING_PHASE=3,R);Object.defineProperties(we.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 je=(qe=class extends we{constructor(e,t={}){super(e,t),oe.set(this,void 0),C(this,oe,t?.detail??null,"f")}initCustomEvent(e,t,n,s){throw new Error("Method not implemented.")}get detail(){return E(this,oe,"f")}},oe=new WeakMap,qe);Object.defineProperties(je.prototype,{detail:g});var M=we,Ae=je;var S;var Tn=(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??=M;globalThis.CustomEvent??=Ae;var Le=Symbol(),Ye=i=>typeof i=="boolean"?i:i?.capture??!1,x={__proto__:null};x.enumerable=!0;Object.freeze(x);var ae=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,n){if(t==null)return;let s=Ye(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=Ye(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=M.NONE,o=null,l=null,a=null,h=e.stopPropagation,d=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??l},...x},srcElement:{get(){return e.target},...x},currentTarget:{get(){return a},...x},eventPhase:{get(){return r},...x},composedPath:{value:()=>t,...x},stopPropagation:{value:()=>{n=!0,h.call(e)},...x},stopImmediatePropagation:{value:()=>{s=!0,d.call(e)},...x}});let c=(f,T,L)=>{typeof f=="function"?f(e):typeof f?.handleEvent=="function"&&f.handleEvent(e),T.once&&L.delete(f)},u=()=>(a=null,r=M.NONE,!e.defaultPrevented),p=t.slice().reverse();o=!this.__host||!e.composed?this:null;let m=f=>{for(l=this;l.__host&&f.includes(l.__host);)l=l.__host};for(let f of p){!o&&(!l||l===f.__host)&&m(p.slice(p.indexOf(f))),a=f,r=f===e.target?M.AT_TARGET:M.CAPTURING_PHASE;let T=f.__captureEventListeners.get(e.type);if(T){for(let[L,U]of T)if(c(L,U,T),s)return u()}if(n)return u()}let v=e.bubbles?t:[this];l=null;for(let f of v){!o&&(!l||f===l.__host)&&m(v.slice(0,v.indexOf(f)+1)),a=f,r=f===e.target?M.AT_TARGET:M.BUBBLING_PHASE;let T=f.__eventListeners.get(e.type);if(T){for(let[L,U]of T)if(c(L,U,T),s)return u()}if(n)return u()}return u()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Qe,It]}};var Ke=new WeakMap,q=i=>{let e=Ke.get(i);return e===void 0&&Ke.set(i,e=new Map),e},j=class extends ae{getRootNode(e){return e?.composed?Te:this.__host?.__shadowRoot??Te}};var Xe=class extends j{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Qe=new Xe,Te=Qe;var Je=class extends j{constructor(e){if(super(),e!==Le)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:le,customElements:Me,document:Te,Document:Xe,Element:Ze,EventTarget:ae,HTMLElement:et,Node:j,ShadowRoot:tt,window:this,Window:Je})}};var Ze=class extends j{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(q(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){q(this).set(e,String(t))}removeAttribute(e){q(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 q(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new tt(Le,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 Ge(this);return this.__internals=e,e}getAttribute(e){return q(this).get(e)??null}};var et=class extends Ze{},Ce=et;var tt=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 Ce,"localName",{get(){return"lit-server-root"}});function Ht(){let i,e;return{promise:new Promise((n,s)=>{i=n,e=s}),resolve:i,reject:e}}var le=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.
|
|
3
3
|
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=Ht(),this.__pendingWhenDefineds.set(e,n)),n.promise}},Ot=le;var Me=new Ot,It=new Je(Le);var Y=globalThis,he=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,st=Symbol(),nt=new WeakMap,ce=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==st)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(he&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=nt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&nt.set(t,e))}return e}toString(){return this.cssText}},it=i=>new ce(typeof i=="string"?i:i+"",void 0,st);var rt=(i,e)=>{if(he)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),s=Y.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},xe=he||Y.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return it(t)})(i):i;var{is:Dt,defineProperty:Ut,getOwnPropertyDescriptor:Bt,getOwnPropertyNames:zt,getOwnPropertySymbols:Vt,getPrototypeOf:Wt}=Object,X=globalThis;X.customElements??=Me;var ot=X.trustedTypes,Ft=ot?ot.emptyScript:"",Gt=X.reactiveElementPolyfillSupport,K=(i,e)=>i,Ne={toAttribute(i,e){switch(e){case Boolean:i=i?Ft: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}},lt=(i,e)=>!Dt(i,e),at={attribute:!0,type:String,converter:Ne,reflect:!1,useDefault:!1,hasChanged:lt};Symbol.metadata??=Symbol("metadata"),X.litPropertyMetadata??=new WeakMap;var N=class extends(globalThis.HTMLElement??Ce){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=at){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&&Ut(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){let{get:s,set:r}=Bt(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let l=s?.call(this);r?.call(this,o),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??at}static _$Ei(){if(this.hasOwnProperty(K("elementProperties")))return;let e=Wt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(K("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(K("properties"))){let t=this.properties,n=[...zt(t),...Vt(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(xe(s))}else e!==void 0&&t.push(xe(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 rt(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 l=o.fromAttribute(t,r.type);this[s]=l??this._$Ej?.get(s)??l,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??lt)(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,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,r,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(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){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[K("elementProperties")]=new Map,N[K("finalized")]=new Map,Gt?.({ReactiveElement:N}),(X.reactiveElementVersions??=[]).push("2.1.2");var ue=globalThis,ct=i=>i,de=ue.trustedTypes,ht=de?de.createPolicy("lit-html",{createHTML:i=>i}):void 0,gt="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,vt="?"+k,qt=`<${vt}>`,I=ue.document===void 0?{createTreeWalker:()=>({})}:document,J=()=>I.createComment(""),Z=i=>i===null||typeof i!="object"&&typeof i!="function",Ie=Array.isArray,jt=i=>Ie(i)||typeof i?.[Symbol.iterator]=="function",Re=`[
|
|
4
4
|
\f\r]`,Q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dt=/-->/g,ut=/>/g,H=RegExp(`>|${Re}(?:([^\\s"'>=/]+)(${Re}*=${Re}*(?:[^
|
|
5
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),mt=/'/g,pt=/"/g,bt=/^(?:script|style|textarea|title)$/i,De=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),rs=De(1),os=De(2),as=De(3),D=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),ft=new WeakMap,O=I.createTreeWalker(I,129);function Et(i,e){if(!Ie(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ht!==void 0?ht.createHTML(e):e}var Yt=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Q;for(let l=0;l<t;l++){let a=i[l],h,d,c=-1,u=0;for(;u<a.length&&(o.lastIndex=u,d=o.exec(a),d!==null);)u=o.lastIndex,o===Q?d[1]==="!--"?o=dt:d[1]!==void 0?o=ut:d[2]!==void 0?(bt.test(d[2])&&(s=RegExp("</"+d[2],"g")),o=H):d[3]!==void 0&&(o=H):o===H?d[0]===">"?(o=s??Q,c=-1):d[1]===void 0?c=-2:(c=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?H:d[3]==='"'?pt:mt):o===pt||o===mt?o=H:o===dt||o===ut?o=Q:(o=H,s=void 0);let p=o===H&&i[l+1].startsWith("/>")?" ":"";r+=o===Q?a+qt:c>=0?(n.push(h),a.slice(0,c)+gt+a.slice(c)+k+p):a+k+(c===-2?l:p)}return[Et(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},ee=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[h,d]=Yt(e,t);if(this.el=i.createElement(h,n),O.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=O.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(gt)){let u=d[o++],p=s.getAttribute(c).split(k),m=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:m[2],strings:p,ctor:m[1]==="."?$e:m[1]==="?"?Pe:m[1]==="@"?He:V}),s.removeAttribute(c)}else c.startsWith(k)&&(a.push({type:6,index:r}),s.removeAttribute(c));if(bt.test(s.tagName)){let c=s.textContent.split(k),u=c.length-1;if(u>0){s.textContent=de?de.emptyScript:"";for(let p=0;p<u;p++)s.append(c[p],J()),O.nextNode(),a.push({type:2,index:++r});s.append(c[u],J())}}}else if(s.nodeType===8)if(s.data===vt)a.push({type:2,index:r});else{let c=-1;for(;(c=s.data.indexOf(k,c+1))!==-1;)a.push({type:7,index:r}),c+=k.length-1}r++}}static createElement(e,t){let n=I.createElement("template");return n.innerHTML=e,n}};function z(i,e,t=i,n){if(e===D)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=Z(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=z(i,s._$AS(i,e.values),s,n)),e}var ke=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);O.currentNode=s;let r=O.nextNode(),o=0,l=0,a=n[0];for(;a!==void 0;){if(o===a.index){let h;a.type===2?h=new te(r,r.nextSibling,this,e):a.type===1?h=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(h=new Oe(r,this,e)),this._$AV.push(h),a=n[++l]}o!==a?.index&&(r=O.nextNode(),o++)}return O.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++}},te=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=b,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=z(this,e,t),Z(e)?e===b||e==null||e===""?(this._$AH!==b&&this._$AR(),this._$AH=b):e!==this._$AH&&e!==D&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):jt(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!==b&&Z(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=ee.createElement(Et(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new ke(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=ft.get(e.strings);return t===void 0&&ft.set(e.strings,t=new ee(e)),t}k(e){Ie(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(J()),this.O(J()),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=ct(e).nextSibling;ct(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},V=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=b,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=b}_$AI(e,t=this,n,s){let r=this.strings,o=!1;if(r===void 0)e=z(this,e,t,0),o=!Z(e)||e!==this._$AH&&e!==D,o&&(this._$AH=e);else{let l=e,a,h;for(e=r[0],a=0;a<r.length-1;a++)h=z(this,l[n+a],t,a),h===D&&(h=this._$AH[a]),o||=!Z(h)||h!==this._$AH[a],h===b?e=b:e!==b&&(e+=(h??"")+r[a+1]),this._$AH[a]=h}o&&!s&&this.j(e)}j(e){e===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},$e=class extends V{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===b?void 0:e}},Pe=class extends V{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==b)}},He=class extends V{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=z(this,e,t,0)??b)===D)return;let n=this._$AH,s=e===b&&n!==b||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==b&&(n===b||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)}},Oe=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){z(this,e)}};var Kt=ue.litHtmlPolyfillSupport;Kt?.(ee,te),(ue.litHtmlVersions??=[]).push("3.3.3");var yt=(i,e,t)=>{let n=t?.renderBefore??e,s=n._$litPart$;if(s===void 0){let r=t?.renderBefore??null;n._$litPart$=s=new te(e.insertBefore(J(),r),r,void 0,t??{})}return s._$AI(i),s};var Ue=globalThis,$=class extends N{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=yt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return D}};$._$litElement$=!0,$.finalized=!0,Ue.litElementHydrateSupport?.({LitElement:$});var Xt=Ue.litElementPolyfillSupport;Xt?.({LitElement:$});(Ue.litElementVersions??=[]).push("4.2.2");var Qt="2.1.2";var Jt=Symbol.for("nish-ui.runtime.v1");function Zt(){let i=globalThis;return i[Jt]??={versions:new Set,slots:{}}}function en(i){i.versions.add(Qt),i.versions.size>1&&!i.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(i.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...i.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var St=!1;function _t(i,e){let t=Zt();return St||(St=!0,en(t)),i in t.slots||(t.slots[i]=e()),t.slots[i]}var wt={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:i=>`${i} result${i===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:i=>`${i} active`,remove:"Remove",removeNamed:i=>`Remove ${i}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:i=>`${i}: no data`,seriesNumber:i=>`Series ${i}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark"};function Be(){return _t("element-strings",()=>({values:{...wt},listeners:new Set}))}function tn(i){let e=Be(),t={...e.values};for(let[n,s]of Object.entries(i))s!==void 0&&Object.hasOwn(wt,n)&&(t[n]=s);e.values=t;for(let n of Array.from(e.listeners))n()}function A(){return Be().values}function At(i){let e=Be().listeners;return e.add(i),()=>{e.delete(i)}}var y=class extends ${#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=At(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function w(i){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i()}function _(i,e){customElements.get(i)||customElements.define(i,e)}function ze(i){return!!i&&getComputedStyle(i).direction==="rtl"}var sn=0,ne="http://www.w3.org/2000/svg",rn="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function on(){let i=document.createElementNS(ne,"svg");for(let[t,n]of Object.entries({viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(t,n);let e=document.createElementNS(ne,"path");return e.setAttribute("d","M18 6 6 18M6 6l12 12"),i.append(e),i}function an(){let i=document.createElementNS(ne,"svg");for(let[n,s]of Object.entries({viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(n,s);let e=document.createElementNS(ne,"circle");e.setAttribute("cx","11"),e.setAttribute("cy","11"),e.setAttribute("r","8");let t=document.createElementNS(ne,"path");return t.setAttribute("d","m21 21-4.3-4.3"),i.append(e,t),i}function Tt(i){globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: <nish-command-palette> did not follow an unsafe href (${JSON.stringify(i.slice(0,40))}). Only relative, #, http(s), mailto and tel URLs are followed.`)}function ln(i){if(!(i instanceof HTMLElement))return!1;let e=i.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||i.isContentEditable}var me=class extends y{static properties={open:{type:Boolean,reflect:!0},hotkey:{type:Boolean,reflect:!0},placeholder:{type:String},emptyText:{type:String,attribute:"empty-text"},items:{attribute:!1}};#e=++sn;#t=null;#n=null;#i=null;#r=null;#l=null;#o="";#s=0;#a=[];#c=new Map;#h=null;#u;#f=!1;#g=!1;constructor(){super(),this.open=!1,this.hotkey=!1,this.placeholder="",this.emptyText="",this.items=[]}connectedCallback(){if(super.connectedCallback(),this.#d(),this.#t){this.#p();return}this.#f||(this.#f=!0,w(()=>{this.#f=!1,this.isConnected&&this.#m()}))}disconnectedCallback(){super.disconnectedCallback(),this.#y(!1),window.clearTimeout(this.#u),this.#t?.open&&(this.open=!1,this.#t.close())}show(){this.open=!0}close(){this.open=!1}#y(e){e!==this.#g&&(this.#g=e,e?document.addEventListener("keydown",this.#E):document.removeEventListener("keydown",this.#E))}#d(){this.#y(this.hotkey&&this.isConnected)}#E=e=>{e.defaultPrevented||e.isComposing||!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.key.toLowerCase()!=="k"||ln(e.target)||(e.preventDefault(),this.open=!0)};#m(){if(this.#t)return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > button"));if(this.items.length===0&&e.length>0){let h=new Set,d=[];for(let c of e){let u=c.dataset.id||c.getAttribute("href")||`item-${d.length+1}`;for(;h.has(u);)u=`${u}-${d.length+1}`;h.add(u);let p=(c.dataset.keywords??"").split(/[,\s]+/).map(m=>m.trim()).filter(Boolean);d.push({id:u,label:c.textContent?.trim()??u,group:c.dataset.group||void 0,hint:c.dataset.hint||void 0,keywords:p.length?p:void 0,href:c.getAttribute("href")??void 0}),this.#c.set(u,c)}this.items=d}for(let h of e)h.hidden=!0;let t=document.createElement("dialog");t.className="nish-command";let n=`nish-command-list-${this.#e}`,s=document.createElement("input");s.type="text",s.setAttribute("role","combobox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",n),s.setAttribute("aria-autocomplete","list"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.setAttribute("autocorrect","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#w(s.value)),s.addEventListener("keydown",h=>this.#T(h)),s.addEventListener("change",h=>h.stopPropagation());let r=document.createElement("div");r.className="nish-command-input";let o=document.createElement("button");o.type="button",o.className="nish-icon-btn",o.append(on()),o.addEventListener("click",()=>{this.open=!1}),r.append(an(),s,o);let l=document.createElement("div");l.className="nish-command-list",l.id=n,l.setAttribute("role","listbox"),l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("mousemove",h=>{let d=h.target?.closest("[data-index]");if(!d)return;let c=Number(d.dataset.index);c!==this.#s&&this.#b(c,!1)}),l.addEventListener("click",h=>{let d=h.target?.closest("[data-index]"),c=d?this.#a[Number(d.dataset.index)]:void 0;c&&this.#L(c)});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=rn,t.append(r,l,a),t.addEventListener("click",this.#C),t.addEventListener("cancel",this.#A),t.addEventListener("close",this.#M),t.addEventListener("keydown",h=>{h.key==="Escape"&&h.stopPropagation()}),this.append(t),this.#t=t,this.#n=s,this.#i=l,this.#r=a,this.#l=o,this.#v(),this.#p()}updated(e){e.has("hotkey")&&this.#d(),(e.has("placeholder")||e.has("emptyText"))&&this.#v(),e.has("items")&&this.#t?.open&&this.#_(),e.has("open")&&this.#p()}stringsChanged(){this.#v(),this.#t?.open&&this.#_(),super.stringsChanged()}#v(){let e=this.#n;if(!e)return;let t=A(),n=this.placeholder||t.searchPlaceholder;e.placeholder=n,e.setAttribute("aria-label",n.replace(/…$/,"")||t.search),this.#t?.setAttribute("aria-label",t.search),this.#l?.setAttribute("aria-label",t.close),this.#i?.setAttribute("aria-label",t.results)}#p(){let e=this.#t;!e||!this.isConnected||(this.open&&!e.open?(this.#h=document.activeElement instanceof HTMLElement?document.activeElement:null,this.#o="",this.#s=0,this.#n&&(this.#n.value=""),e.showModal(),this.#_(),this.#n?.focus()):!this.open&&e.open&&e.close())}#S(e){return`nish-command-${this.#e}-opt-${e}`}#_(){let e=this.#i,t=this.#n;if(!e||!t)return;let n=A();this.#a=Fe(this.items,this.#o),this.#s>=this.#a.length&&(this.#s=0),e.textContent="";let s=0,r,o=e;for(let l of this.#a){let a=l.group??null;if(a!==r)if(r=a,a===null)o=e;else{let c=document.createElement("div");c.className="nish-command-group",c.setAttribute("role","group");let u=document.createElement("div");u.id=`nish-command-${this.#e}-group-${s}`,u.textContent=a,c.setAttribute("aria-labelledby",u.id),c.append(u),e.append(c),o=c}let h=document.createElement("div");h.className="nish-command-item",h.id=this.#S(s),h.dataset.index=String(s),h.setAttribute("role","option"),h.setAttribute("aria-selected",s===this.#s?"true":"false");let d=document.createElement("span");if(d.textContent=l.label,h.append(d),l.hint){let c=document.createElement("span");c.className="nish-command-item-hint",c.textContent=l.hint,h.append(c)}o.append(h),s++}if(this.#a.length===0){let l=document.createElement("div");l.className="nish-command-empty",l.textContent=this.emptyText||n.noResults,e.append(l)}this.#a.length?t.setAttribute("aria-activedescendant",this.#S(this.#s)):t.removeAttribute("aria-activedescendant"),this.#r&&(this.#r.textContent=this.#a.length?n.resultCount(this.#a.length):this.emptyText||n.noResults)}#b(e,t=!0){let n=this.#a.length;if(n===0)return;this.#s=(e%n+n)%n;let s=this.#i;if(s){for(let r of Array.from(s.querySelectorAll("[data-index]"))){let o=Number(r.dataset.index)===this.#s;r.setAttribute("aria-selected",o?"true":"false"),o&&t&&r.scrollIntoView?.({block:"nearest"})}this.#n?.setAttribute("aria-activedescendant",this.#S(this.#s))}}#w(e){this.#o=e,this.#s=0,this.#_(),window.clearTimeout(this.#u),this.#u=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200)}#T(e){if(e.isComposing)return;let t=this.#a.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.#b(this.#s+1);break;case"ArrowUp":e.preventDefault(),this.#b(this.#s-1);break;case"Home":t&&!this.#o&&(e.preventDefault(),this.#b(0));break;case"End":t&&!this.#o&&(e.preventDefault(),this.#b(t-1));break;case"Enter":{e.preventDefault();let n=this.#a[this.#s];n&&this.#L(n);break}}}#L(e){let t=this.#c.get(e.id);if(this.open=!1,this.#t?.close(),this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:e.id}})),t){let n=t.getAttribute("href");n!==null&&Se(n)===null?Tt(n):t.click()}else if(e.href){let n=Se(e.href);n===null?Tt(e.href):window.location.assign(n)}}#C=e=>{let t=this.#t;if(!t||e.target!==t)return;let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||(this.open=!1)};#A=e=>{e.preventDefault(),this.open=!1};#M=()=>{window.clearTimeout(this.#u),this.open&&(this.open=!1);let e=this.#h;this.#h=null,e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))}};_("nish-command-palette",me);var Lt="http://www.w3.org/2000/svg";function Ct(i,e){let t=document.createElementNS(Lt,"svg");for(let[n,s]of Object.entries({width:String(i),height:String(i),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))t.setAttribute(n,s);for(let n of e){let s=document.createElementNS(Lt,"path");s.setAttribute("d",n),t.appendChild(s)}return t}var Mt=i=>Ct(i,["M18 6 6 18M6 6l12 12"]),xt=i=>Ct(i,["M22 3H2l8 9.46V19l4 2v-8.54L22 3z"]);var ks=3600*24*365;function cn(i,e){if(typeof document>"u")return()=>{};let t=document.documentElement,n=()=>{let r=i.offsetHeight;r>0?t.style.setProperty(e,`${r}px`):t.style.removeProperty(e)};n();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(n),s.observe(i)):window.addEventListener("resize",n),()=>{s?.disconnect(),window.removeEventListener("resize",n),t.style.removeProperty(e)}}function Nt(i,e={}){if(typeof document>"u")return()=>{};let t=Array.from(i.querySelectorAll('a[href^="#"]')).filter(m=>m.hash.length>1),n=m=>{try{return document.getElementById(decodeURIComponent(m.hash.slice(1)))}catch{return null}},s=e.height===!1?()=>{}:cn(i,"--nish-sticky-extra"),r=null,o=()=>{let m=i.scrollWidth-i.clientWidth;i.dataset.atStart=String(i.scrollLeft<=1),i.dataset.atEnd=String(m<=1||i.scrollLeft>=m-1)},l=m=>{let v=m.offsetLeft-i.offsetLeft,f=i.clientWidth;v<i.scrollLeft+24?i.scrollLeft=Math.max(0,v-24):v+m.offsetWidth>i.scrollLeft+f-24&&(i.scrollLeft=v+m.offsetWidth-f+24)},a=m=>{m!==r&&(r?.removeAttribute("aria-current"),r=m,m&&(m.setAttribute("aria-current","true"),l(m)))},h=()=>{let m=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--nish-header-h"))||0,v=e.offset??m+i.offsetHeight+8,f=t[0]??null;for(let L of t){let U=n(L);U&&U.getBoundingClientRect().top<=v+1&&(f=L)}let T=document.documentElement;if(window.innerHeight+window.scrollY>=T.scrollHeight-2)for(let L of t)n(L)&&(f=L);a(f)},d=0,c=()=>{d||(d=requestAnimationFrame(()=>{d=0,h()}))},u=m=>{let v=m.target instanceof Element?m.target.closest('a[href^="#"]'):null;v&&t.includes(v)&&a(v)};o(),h(),window.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),i.addEventListener("scroll",o,{passive:!0}),i.addEventListener("click",u);let p;return typeof ResizeObserver<"u"&&(p=new ResizeObserver(()=>{o(),c()}),p.observe(i)),()=>{d&&cancelAnimationFrame(d),window.removeEventListener("scroll",c),window.removeEventListener("resize",c),i.removeEventListener("scroll",o),i.removeEventListener("click",u),p?.disconnect(),s(),r?.removeAttribute("aria-current"),delete i.dataset.atStart,delete i.dataset.atEnd}}var hn={md:"(max-width: 767.98px)",lg:"(max-width: 1023.98px)"},dn=0;function pe(i){let e=document.createElement("div");return e.className=i,e}var fe=class extends y{static properties={activeCount:{attribute:"active-count",type:Number,reflect:!0},sheetTitle:{attribute:"sheet-title",type:String,reflect:!0},sheetBelow:{attribute:"sheet-below",type:String,reflect:!0},sticky:{type:Boolean,reflect:!0}};#e=null;#t=pe("nish-filter-bar-search");#n=pe("nish-filter-bar-chips");#i=pe("nish-filter-bar-trailing");#r=pe("nish-filter-bar-summary");#l=null;#o=null;#s=null;#a=null;#c=null;#h=null;#u=null;#f=null;#g=null;#y=null;#d=[];#E=null;#m=null;#v="";#p=null;#S=()=>this.#A();constructor(){super(),this.activeCount=0,this.sheetTitle="",this.sheetBelow="md",this.sticky=!1}connectedCallback(){super.connectedCallback(),w(()=>this.#_())}disconnectedCallback(){if(super.disconnectedCallback(),this.#m?.removeEventListener("change",this.#S),this.#m=null,this.#v="",this.#p?.disconnect(),this.#p=null,this.#e){this.#c?.close();for(let e of this.#d)this.appendChild(e);for(let e of[this.#t,this.#i,this.#r])for(;e.firstChild;)this.appendChild(e.firstChild);this.#e.remove(),this.#c?.remove(),this.#e=null,this.#l=null,this.#o=null,this.#u=null,this.#f=null,this.#g=null,this.#a=null,this.#c=null,this.#h=null,this.#d=[],this.#E=null}}updated(e){this.#e&&(this.#C(),this.#A())}#_(){if(!this.isConnected||this.#e)return;let e=document.createElement("div");e.className="nish-filter-bar",this.#r.setAttribute("aria-live","polite"),e.append(this.#t,this.#n,this.#i,this.#r),this.#e=e;for(let t of Array.from(this.childNodes))this.#w(t);this.appendChild(e),this.#T(),this.#C(),this.#A(),this.#p=new MutationObserver(t=>{for(let n of t)n.addedNodes.forEach(s=>{s!==e&&s.parentNode===this&&this.#w(s)});this.#A()}),this.#p.observe(this,{childList:!0}),this.#p.observe(this.#n,{childList:!0}),this.#h&&this.#p.observe(this.#h,{childList:!0})}#b(){this.#d=this.#d.filter(e=>e.parentNode===this.#n||e.parentNode===this.#h)}#w(e){if(e===this.#e||e instanceof Comment)return;if(!(e instanceof HTMLElement)){e.parentNode?.removeChild(e);return}let t=e.getAttribute("data-slot");t==="trailing"?this.#i.appendChild(e):t==="summary"?this.#r.appendChild(e):e.localName==="nish-search"&&!this.#t.firstChild?this.#t.appendChild(e):(this.#b(),this.#d.includes(e)||this.#d.push(e),(this.#E==="compact"?this.#h??this.#n:this.#n).appendChild(e))}#T(){let e=++dn,t=document.createElement("button");t.type="button",t.className="nish-btn nish-btn--secondary nish-filter-btn",t.setAttribute("aria-haspopup","dialog"),this.#o=document.createTextNode(""),t.append(xt(16),this.#o);let n=document.createElement("span");n.className="nish-badge nish-badge--accent",t.appendChild(n),t.addEventListener("click",()=>this.#c?.show()),this.#l=t,this.#s=n;let s=document.createElement("button");s.type="button",s.className="nish-btn nish-btn--ghost nish-filter-bar-clear",s.addEventListener("click",()=>this.#L()),this.#a=s;let r=document.createElement("nish-sheet"),o=document.createElement("header");o.className="nish-sheet-header";let l=document.createElement("h2");l.className="nish-sheet-title",l.id=`nish-filter-sheet-title-${e}`,o.appendChild(l);let a=document.createElement("button");a.type="button",a.className="nish-icon-btn",a.setAttribute("data-sheet-close",""),this.#f=a,a.appendChild(Mt(16)),o.appendChild(a);let h=document.createElement("div");h.className="nish-sheet-body nish-filter-sheet-body";let d=document.createElement("footer");d.className="nish-sheet-footer";let c=document.createElement("button");c.type="button",c.className="nish-btn nish-btn--ghost",c.addEventListener("click",()=>this.#L());let u=document.createElement("button");u.type="button",u.className="nish-btn nish-btn--primary",u.style.marginInlineStart="auto",this.#g=u,u.addEventListener("click",()=>this.#c?.close()),d.append(c,u),r.append(o,h,d),this.#c=r,this.#h=h,this.#u=c,this.#y=l}#L(){this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0}))}#C(){let e=hn[this.sheetBelow==="lg"?"lg":"md"];e!==this.#v&&(this.#m?.removeEventListener("change",this.#S),this.#v=e,this.#m=typeof matchMedia>"u"?null:matchMedia(e),this.#m?.addEventListener("change",this.#S))}#A(){let e=this.#e,t=this.#c,n=this.#h,s=this.#l,r=this.#a;if(!e||!t||!n||!s||!r)return;this.#b();let o=this.#m?.matches?"compact":"wide";o!==this.#E&&(o==="compact"?(this.#n.remove(),r.remove(),this.#t.after(s),n.append(...this.#d),e.appendChild(t)):(t.close(),s.remove(),this.#n.append(...this.#d,r),this.#t.after(this.#n),t.remove()),this.#E=o,e.setAttribute("data-compact",String(o==="compact")));let l=Math.max(0,Number.isFinite(this.activeCount)?Math.floor(this.activeCount):0);e.classList.toggle("nish-filter-bar--sticky",this.sticky),s.hidden=this.#d.length===0,r.hidden=l===0,this.#s&&(this.#s.textContent=String(l),this.#s.hidden=l===0,this.#s.setAttribute("aria-label",A().activeCount(l))),this.#u&&(this.#u.disabled=l===0);let a=A();this.#y&&(this.#y.textContent=this.sheetTitle||a.filters),this.#o&&(this.#o.data=a.filters),r.textContent=a.clearFilters,this.#u&&(this.#u.textContent=a.clear),this.#g&&(this.#g.textContent=a.showResults),this.#f?.setAttribute("aria-label",a.close)}};_("nish-filter-bar",fe);function Rt(i,e){let t=null,n=()=>Array.from(i.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,l=null,a=-1;for(let h of n()){if(e?.(h),!h.getAttribute("href"))continue;let d;try{d=new URL(h.getAttribute("href"),location.href)}catch{continue}if(d.origin!==location.origin)continue;if(d.hash&&d.pathname===location.pathname){d.hash===location.hash&&(l=h,a=1/0);continue}let c=d.pathname;(c==="/"?o==="/":o===c||o.startsWith(c.endsWith("/")?c:`${c}/`))&&c.length>a&&(l=h,a=c.length)}if(!l){t?.removeAttribute("aria-current"),t=null;return}for(let h of n())h.removeAttribute("aria-current");l.setAttribute("aria-current","page"),t=l},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(i,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(i,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var ge=class extends y{static properties={label:{type:String,reflect:!0}};#e=null;#t=null;#n=null;constructor(){super(),this.label=""}connectedCallback(){super.connectedCallback(),w(()=>this.#i())}disconnectedCallback(){super.disconnectedCallback(),this.#n?.disconnect(),this.#n=null,this.#e=null,this.#t?.(),this.#t=null}updated(e){this.#l()}#i(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-nav-rail");if(!e){for(e=document.createElement("nav"),e.className="nish-nav-rail";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#r(e),this.#l(),this.#t=Rt(e,t=>t.classList.add("nish-nav-rail-item")),this.#n=new MutationObserver(t=>{let n=this.#e;if(!n)return;let s=!1;for(let r of t)r.target===this&&r.addedNodes.forEach(o=>{o!==n&&o.nodeType===1&&o.parentNode===this&&(n.appendChild(o),s=!0)});(s||t.some(r=>r.target!==this))&&this.#r(n)}),this.#n.observe(this,{childList:!0}),this.#n.observe(e,{childList:!0,subtree:!0})}#r(e){let t=e.querySelector(':scope > [data-slot="tools"]'),n=e.querySelector(':scope > [data-slot="footer"]');t?.classList.add("nish-nav-rail-tools"),n?.classList.add("nish-nav-rail-footer");let s=[t,n].filter(a=>!!a),r=Array.from(e.children),o=s.length;if(!s.every((a,h)=>r[r.length-o+h]===a))for(let a of s)e.appendChild(a);for(let a of Array.from(e.querySelectorAll(":scope > .nish-nav-rail-tools a, :scope > .nish-nav-rail-footer a")))a.classList.add("nish-nav-rail-item")}#l(){this.#e&&this.#e.setAttribute("aria-label",this.label||A().sections)}};_("nish-nav-rail",ge);var un='[aria-pressed="true"],[aria-selected="true"],[aria-current]:not([aria-current="false"]),[aria-checked="true"]',ve=class extends y{static properties={label:{type:String,reflect:!0},bleed:{type:Boolean,reflect:!0},snap:{type:Boolean,reflect:!0},fade:{reflect:!0,converter:{fromAttribute:e=>e!=="false",toAttribute:e=>e?null:"false"}}};#e=null;#t=null;#n=null;#i=()=>this.#o();constructor(){super(),this.label="",this.bleed=!1,this.snap=!1,this.fade=!0}connectedCallback(){super.connectedCallback(),w(()=>this.#r())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("scroll",this.#i),this.#t?.disconnect(),this.#t=null,this.#n?.disconnect(),this.#n=null,this.#e=null}updated(e){this.#s()}#r(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-scroll-row");if(!e){for(e=document.createElement("div"),e.className="nish-scroll-row";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#n?.disconnect(),this.#n=new MutationObserver(()=>{let n=this.#e;if(n)for(let s of Array.from(this.childNodes))s!==n&&s.nodeType===1&&n.appendChild(s)}),this.#n.observe(this,{childList:!0}),this.#s(),e.addEventListener("scroll",this.#i,{passive:!0}),typeof ResizeObserver<"u"&&(this.#t=new ResizeObserver(()=>this.#o()),this.#t.observe(e));let t=e.querySelector(un);t&&this.#l(e,t),this.#o()}#l(e,t){let n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),r=8;s.left<n.left+r?e.scrollLeft+=s.left-n.left-r:s.right>n.right-r&&(e.scrollLeft+=s.right-n.right+r)}#o(){let e=this.#e;if(!e)return;let t=e.scrollWidth-e.clientWidth;e.dataset.atStart=String(e.scrollLeft<=1),e.dataset.atEnd=String(t<=1||e.scrollLeft>=t-1)}#s(){let e=this.#e;e&&(this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),e.classList.toggle("nish-scroll-row--bleed",this.bleed),e.classList.toggle("nish-scroll-row--snap",this.snap),e.classList.toggle("nish-scroll-row--no-fade",!this.fade))}};_("nish-scroll-row",ve);var kt={fromAttribute:i=>i!=="false",toAttribute:i=>i?null:"false"},be=class extends y{static properties={label:{type:String,reflect:!0},sticky:{reflect:!0,converter:kt},updateHash:{attribute:"update-hash",reflect:!0,converter:kt}};#e=null;#t=null;#n=null;#i=null;#r=e=>this.#c(e);constructor(){super(),this.label="",this.sticky=!0,this.updateHash=!0}connectedCallback(){super.connectedCallback(),w(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.(),this.#t=null,this.#s=null,this.#n?.disconnect(),this.#n=null,this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#r),this.#e=null}updated(e){this.#o()}#l(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-subnav");if(!e){for(e=document.createElement("nav"),e.className="nish-subnav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#o(),e.addEventListener("click",this.#r),this.#a(e),this.#n=new MutationObserver(()=>{this.#t?.(),this.#a(e)}),this.#n.observe(e,{childList:!0}),this.#i=new MutationObserver(()=>{let t=this.#e;if(t)for(let n of Array.from(this.childNodes))n!==t&&n.nodeType===1&&t.appendChild(n)}),this.#i.observe(this,{childList:!0})}#o(){let e=this.#e;e&&(e.setAttribute("aria-label",this.label||A().sections),e.style.position=this.sticky?"":"static",this.#s!==null&&this.#s!==this.sticky&&this.#a(e))}#s=null;#a(e){this.#t?.(),this.#t=Nt(e,{height:this.sticky}),this.#s=this.sticky}#c(e){let t=e.target instanceof Element?e.target.closest('a[href^="#"]'):null;if(!t||!this.#e?.contains(t)||t.hash.length<2||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n;try{n=decodeURIComponent(t.hash.slice(1))}catch{return}let s=document.getElementById(n);if(!s)return;e.preventDefault();let r=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(s.scrollIntoView({behavior:r?"auto":"smooth",block:"start"}),this.updateHash)try{history.replaceState(history.state,"",`#${t.hash.slice(1)}`)}catch{}this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:n}}))}};_("nish-section-nav",be);var $t=5,mn="(max-width: 639.98px) and (pointer: coarse)";function Ve(i,e){let t=()=>Array.from({length:e},()=>100/e);if(e===0)return[];if(!i||i.length!==e||!i.every(s=>Number.isFinite(s)&&s>0))return t();let n=i.reduce((s,r)=>s+r,0);return i.map(s=>s/n*100)}var pn={fromAttribute(i){if(i==null||i.trim()==="")return null;let e=i.split(",").map(t=>Number(t.trim()));return e.every(t=>Number.isFinite(t))?e:null},toAttribute(i){return i&&i.length?i.map(e=>Math.round(e*100)/100).join(","):null}},Ee=class extends y{static properties={orientation:{type:String,reflect:!0},sizes:{converter:pn,reflect:!0},min:{type:Number},storageKey:{type:String,attribute:"storage-key"}};#e=[];#t=[];#n=null;#i=null;#r=!1;#l=null;#o=!1;#s=!1;#a=!1;constructor(){super(),this.orientation="row",this.sizes=null,this.min=120,this.storageKey=null}connectedCallback(){if(super.connectedCallback(),typeof window.matchMedia=="function"&&(this.#i=window.matchMedia(mn),this.#r=this.#i.matches,this.#i.addEventListener("change",this.#y)),this.#s){this.#c(),this.#h();return}this.#o||(this.#o=!0,w(()=>{this.#o=!1,this.isConnected&&(this.#s=!0,this.#c(),this.#h())}))}disconnectedCallback(){super.disconnectedCallback(),this.#i?.removeEventListener("change",this.#y),this.#i=null,this.#n?.disconnect(),this.#n=null,this.#b()}updated(e){this.#s&&(e.size===0||e.has("orientation")||e.has("sizes")||e.has("min"))&&this.#g()}#c(){typeof MutationObserver>"u"||(this.#n??=new MutationObserver(()=>this.#h()),this.#n.observe(this,{childList:!0}))}#h(){if(!this.isConnected)return;this.#n?.disconnect();let e=[];for(let t of Array.from(this.childNodes)){if(!(t instanceof HTMLElement))continue;if(t.classList.contains("nish-split-divider")){t.remove();continue}if(t.classList.contains("nish-split-pane")){e.push(t);continue}let n=document.createElement("div");n.className="nish-split-pane",this.insertBefore(n,t),n.append(t),e.push(n)}this.#e=e,this.#t=[];for(let t=0;t<e.length-1;t++){let n=document.createElement("div");n.className="nish-split-divider",n.setAttribute("role","separator"),n.tabIndex=0,n.style.touchAction="none",n.addEventListener("pointerdown",s=>this.#p(s,t)),n.addEventListener("pointermove",s=>this.#S(s)),n.addEventListener("pointerup",s=>this.#_(s)),n.addEventListener("pointercancel",s=>this.#_(s)),n.addEventListener("keydown",s=>this.#T(s,t)),n.addEventListener("dblclick",()=>this.#w()),this.insertBefore(n,e[t+1]),this.#t.push(n)}this.#u(),this.#g(),this.#n?.observe(this,{childList:!0})}#u(){if(!(this.#a||!this.storageKey||this.#e.length===0)){this.#a=!0;try{let e=window.localStorage.getItem(this.storageKey);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&t.length===this.#e.length&&t.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>0)&&(this.sizes=Ve(t,this.#e.length))}catch{}}}get#f(){return Ve(this.sizes,this.#e.length)}#g(){let e=this.orientation!=="column",t=this.#f,n=A();this.style.display="flex",this.style.flexDirection=this.#r?"column":e?"row":"column",this.style.minWidth="0",this.style.minHeight="0",this.#e.forEach((s,r)=>{s.style.minWidth="0",this.#r?(s.style.minHeight="var(--nish-split-stack-h, 16rem)",s.style.flex="none"):(s.style.minHeight="0",s.style.flex=`${t[r]} 1 0%`);let o=s.children.length===1?s.firstElementChild:null;o?.localName==="nish-split"&&(s.style.display="flex",o.style.flex="1 1 auto")}),this.#t.forEach((s,r)=>{s.hidden=this.#r,s.classList.toggle("nish-split-divider--v",e),s.classList.toggle("nish-split-divider--h",!e),s.setAttribute("aria-orientation",e?"vertical":"horizontal"),s.setAttribute("aria-label",e?n.resizeColumns:n.resizeRows),s.setAttribute("aria-valuenow",String(Math.round(t[r]))),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100")})}#y=e=>{this.#r=e.matches,this.#g()};#d(e){let t=e.getBoundingClientRect();return this.orientation==="column"?t.height:t.width}#E(e,t,n,s){let r=e[t]+e[t+1],o=Math.min(s,r/2),l=Math.min(Math.max(e[t]+n,o),r-o),a=e.slice();return a[t]=l,a[t+1]=r-l,a}#m(e){if(this.storageKey)try{window.localStorage.setItem(this.storageKey,JSON.stringify(e))}catch{}}#v(e){this.sizes=e,this.dispatchEvent(new CustomEvent("nish-resize",{bubbles:!0,detail:{sizes:e}}))}#p(e,t){if(e.button!==0||this.#r)return;let n=this.#t[t];if(!n)return;e.preventDefault(),n.setPointerCapture?.(e.pointerId);let s=[];for(let o of Array.from(this.querySelectorAll("iframe")))s.push([o,o.style.pointerEvents]),o.style.pointerEvents="none";let r=this.#e.reduce((o,l)=>o+this.#d(l),0);this.#l={pointerId:e.pointerId,start:this.orientation==="column"?e.clientY:e.clientX,index:t,sizes:this.#f,total:r,restore:s},this.setAttribute("data-dragging","")}#S(e){let t=this.#l;if(!t||t.pointerId!==e.pointerId||t.total<=0)return;let n=this.orientation==="column"?e.clientY:e.clientX,s=this.orientation!=="column"&&ze(this)?-1:1,r=(n-t.start)*s/t.total*100;r!==0&&this.#v(this.#E(t.sizes,t.index,r,this.min/t.total*100))}#_(e){let t=this.#l;if(!t||t.pointerId!==e.pointerId)return;let n=this.#t[t.index];n?.hasPointerCapture?.(e.pointerId)&&n.releasePointerCapture(e.pointerId),this.#b()}#b(){let e=this.#l;if(e){this.#l=null,this.sizes&&this.#m(this.sizes);for(let[t,n]of e.restore)t.style.pointerEvents=n;this.removeAttribute("data-dragging")}}#w(){if(this.#r||this.#e.length<2)return;let e=Ve(null,this.#e.length);this.#v(e),this.#m(e)}#T(e,t){if(e.key==="Enter"){e.preventDefault(),this.#w();return}let n=this.orientation!=="column",s=n&&ze(this),r=n?s?"ArrowRight":"ArrowLeft":"ArrowUp",o=n?s?"ArrowLeft":"ArrowRight":"ArrowDown";if(e.key!==r&&e.key!==o)return;e.preventDefault();let l=this.#e.reduce((c,u)=>c+this.#d(u),0),a=l>0?this.min/l*100:0,h=this.#f,d=this.#E(h,t,e.key===o?$t:-$t,a);d[t]!==h[t]&&(this.#v(d),this.#m(d))}};_("nish-split",Ee);var We="http://www.w3.org/2000/svg";function fn(){let i=document.createElementNS(We,"svg");i.setAttribute("width","10"),i.setAttribute("height","10"),i.setAttribute("viewBox","0 0 10 10"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let e of["M2 4 5 1l3 3","M2 6l3 3 3-3"]){let t=document.createElementNS(We,"path");t.setAttribute("d",e),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.5"),t.setAttribute("opacity","0.35"),i.appendChild(t)}return i}function gn(i){return(i.target instanceof Element?i.target:i.target.parentElement)?.closest("thead")?!0:Array.from(i.addedNodes).some(t=>t instanceof Element&&(t.localName==="thead"||t.localName==="table"||t.localName==="tr"||t.localName==="th"||t.querySelector("thead")!==null))}function vn(i){let e=i.replace(/[\s,$€£%]/g,"");if(e===""||e==="-"||e==="+")return null;let t=Number(e);return Number.isFinite(t)?t:null}var ye=class extends y{static properties={manual:{type:Boolean,reflect:!0}};#e=null;#t=e=>this.#a(e);constructor(){super(),this.manual=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#t),w(()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#t),this.#e?.disconnect(),this.#e=null}#n(){!this.isConnected||this.#e||(this.#l(),this.#e=new MutationObserver(e=>{e.some(gn)&&(this.#e?.disconnect(),this.#l(),this.#i())}),this.#i())}#i(){this.#e?.observe(this,{childList:!0,subtree:!0})}#r(){return Array.from(this.querySelectorAll("thead th[data-sort]"))}#l(){for(let e of this.#r()){if(e.hasAttribute("scope")||e.setAttribute("scope","col"),e.hasAttribute("aria-sort")||e.setAttribute("aria-sort","none"),e.querySelector(":scope > .nish-th-sort"))continue;let t=document.createElement("button");for(t.type="button",t.className="nish-th-sort";e.firstChild;)t.appendChild(e.firstChild);t.appendChild(fn()),e.appendChild(t),this.#o(e)}}#o(e){let t=e.querySelectorAll(".nish-th-sort svg path"),n=e.getAttribute("aria-sort");t[0]?.setAttribute("opacity",n==="ascending"?"1":"0.35"),t[1]?.setAttribute("opacity",n==="descending"?"1":"0.35")}#s(e){let t=e.getAttribute("data-sort");if(t)return t;let n=e.querySelector(".nish-th-sort"),s="";return(n??e).childNodes.forEach(r=>{(r.nodeType===Node.TEXT_NODE||r instanceof HTMLElement&&r.namespaceURI!==We)&&(s+=r.textContent??"")}),s.trim()}#a(e){let n=e.target?.closest(".nish-th-sort"),s=n?.closest("th[data-sort]");if(!n||!s||!this.contains(s))return;let r=s.getAttribute("aria-sort")==="ascending"?"descending":"ascending";for(let o of this.#r())o.setAttribute("aria-sort",o===s?r:"none"),this.#o(o);this.manual||this.#c(s,r),this.dispatchEvent(new CustomEvent("nish-sort",{bubbles:!0,detail:{column:this.#s(s),direction:r==="ascending"?"asc":"desc"}}))}#c(e,t){let n=e.cellIndex,s=t==="ascending"?1:-1,r=e.closest("table");if(!r)return;let o=new Intl.Collator(void 0,{sensitivity:"base"});for(let l of Array.from(r.tBodies)){let a=Array.from(l.rows).map((p,m)=>{let v=p.cells[n],f=v?(v.getAttribute("data-value")??v.textContent??"").trim():"";return{row:p,key:f,num:vn(f),order:m}}),h=a.filter(p=>p.key!==""),d=a.filter(p=>p.key===""),c=e.classList.contains("nish-th--num")||h.length>0&&h.every(p=>p.num!==null);h.sort((p,m)=>(c?(p.num??0)-(m.num??0):o.compare(p.key,m.key))*s||p.order-m.order);let u=document.createDocumentFragment();for(let p of[...h,...d])u.appendChild(p.row);l.appendChild(u)}}};_("nish-table-sort",ye);export{me as NishCommandPalette,y as NishElement,fe as NishFilterBar,ge as NishNavRail,ve as NishScrollRow,be as NishSectionNav,Ee as NishSplit,ye as NishTableSort,tn as configureStrings,_ as define};
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),mt=/'/g,pt=/"/g,bt=/^(?:script|style|textarea|title)$/i,De=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),rs=De(1),os=De(2),as=De(3),D=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),ft=new WeakMap,O=I.createTreeWalker(I,129);function Et(i,e){if(!Ie(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ht!==void 0?ht.createHTML(e):e}var Yt=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Q;for(let l=0;l<t;l++){let a=i[l],h,d,c=-1,u=0;for(;u<a.length&&(o.lastIndex=u,d=o.exec(a),d!==null);)u=o.lastIndex,o===Q?d[1]==="!--"?o=dt:d[1]!==void 0?o=ut:d[2]!==void 0?(bt.test(d[2])&&(s=RegExp("</"+d[2],"g")),o=H):d[3]!==void 0&&(o=H):o===H?d[0]===">"?(o=s??Q,c=-1):d[1]===void 0?c=-2:(c=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?H:d[3]==='"'?pt:mt):o===pt||o===mt?o=H:o===dt||o===ut?o=Q:(o=H,s=void 0);let p=o===H&&i[l+1].startsWith("/>")?" ":"";r+=o===Q?a+qt:c>=0?(n.push(h),a.slice(0,c)+gt+a.slice(c)+k+p):a+k+(c===-2?l:p)}return[Et(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},ee=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[h,d]=Yt(e,t);if(this.el=i.createElement(h,n),O.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=O.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(gt)){let u=d[o++],p=s.getAttribute(c).split(k),m=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:m[2],strings:p,ctor:m[1]==="."?$e:m[1]==="?"?Pe:m[1]==="@"?He:V}),s.removeAttribute(c)}else c.startsWith(k)&&(a.push({type:6,index:r}),s.removeAttribute(c));if(bt.test(s.tagName)){let c=s.textContent.split(k),u=c.length-1;if(u>0){s.textContent=de?de.emptyScript:"";for(let p=0;p<u;p++)s.append(c[p],J()),O.nextNode(),a.push({type:2,index:++r});s.append(c[u],J())}}}else if(s.nodeType===8)if(s.data===vt)a.push({type:2,index:r});else{let c=-1;for(;(c=s.data.indexOf(k,c+1))!==-1;)a.push({type:7,index:r}),c+=k.length-1}r++}}static createElement(e,t){let n=I.createElement("template");return n.innerHTML=e,n}};function z(i,e,t=i,n){if(e===D)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=Z(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=z(i,s._$AS(i,e.values),s,n)),e}var ke=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);O.currentNode=s;let r=O.nextNode(),o=0,l=0,a=n[0];for(;a!==void 0;){if(o===a.index){let h;a.type===2?h=new te(r,r.nextSibling,this,e):a.type===1?h=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(h=new Oe(r,this,e)),this._$AV.push(h),a=n[++l]}o!==a?.index&&(r=O.nextNode(),o++)}return O.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++}},te=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=b,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=z(this,e,t),Z(e)?e===b||e==null||e===""?(this._$AH!==b&&this._$AR(),this._$AH=b):e!==this._$AH&&e!==D&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):jt(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!==b&&Z(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=ee.createElement(Et(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new ke(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=ft.get(e.strings);return t===void 0&&ft.set(e.strings,t=new ee(e)),t}k(e){Ie(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(J()),this.O(J()),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=ct(e).nextSibling;ct(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},V=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=b,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=b}_$AI(e,t=this,n,s){let r=this.strings,o=!1;if(r===void 0)e=z(this,e,t,0),o=!Z(e)||e!==this._$AH&&e!==D,o&&(this._$AH=e);else{let l=e,a,h;for(e=r[0],a=0;a<r.length-1;a++)h=z(this,l[n+a],t,a),h===D&&(h=this._$AH[a]),o||=!Z(h)||h!==this._$AH[a],h===b?e=b:e!==b&&(e+=(h??"")+r[a+1]),this._$AH[a]=h}o&&!s&&this.j(e)}j(e){e===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},$e=class extends V{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===b?void 0:e}},Pe=class extends V{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==b)}},He=class extends V{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=z(this,e,t,0)??b)===D)return;let n=this._$AH,s=e===b&&n!==b||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==b&&(n===b||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)}},Oe=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){z(this,e)}};var Kt=ue.litHtmlPolyfillSupport;Kt?.(ee,te),(ue.litHtmlVersions??=[]).push("3.3.3");var yt=(i,e,t)=>{let n=t?.renderBefore??e,s=n._$litPart$;if(s===void 0){let r=t?.renderBefore??null;n._$litPart$=s=new te(e.insertBefore(J(),r),r,void 0,t??{})}return s._$AI(i),s};var Ue=globalThis,$=class extends N{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=yt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return D}};$._$litElement$=!0,$.finalized=!0,Ue.litElementHydrateSupport?.({LitElement:$});var Xt=Ue.litElementPolyfillSupport;Xt?.({LitElement:$});(Ue.litElementVersions??=[]).push("4.2.2");var Qt="2.2.0";var Jt=Symbol.for("nish-ui.runtime.v1");function Zt(){let i=globalThis;return i[Jt]??={versions:new Set,slots:{}}}function en(i){i.versions.add(Qt),i.versions.size>1&&!i.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(i.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...i.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var St=!1;function _t(i,e){let t=Zt();return St||(St=!0,en(t)),i in t.slots||(t.slots[i]=e()),t.slots[i]}var wt={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:i=>`${i} result${i===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:i=>`${i} active`,remove:"Remove",removeNamed:i=>`Remove ${i}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:i=>`${i}: no data`,seriesNumber:i=>`Series ${i}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark"};function Be(){return _t("element-strings",()=>({values:{...wt},listeners:new Set}))}function tn(i){let e=Be(),t={...e.values};for(let[n,s]of Object.entries(i))s!==void 0&&Object.hasOwn(wt,n)&&(t[n]=s);e.values=t;for(let n of Array.from(e.listeners))n()}function A(){return Be().values}function At(i){let e=Be().listeners;return e.add(i),()=>{e.delete(i)}}var y=class extends ${#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=At(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function w(i){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i()}function _(i,e){customElements.get(i)||customElements.define(i,e)}function ze(i){return!!i&&getComputedStyle(i).direction==="rtl"}var sn=0,ne="http://www.w3.org/2000/svg",rn="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function on(){let i=document.createElementNS(ne,"svg");for(let[t,n]of Object.entries({viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(t,n);let e=document.createElementNS(ne,"path");return e.setAttribute("d","M18 6 6 18M6 6l12 12"),i.append(e),i}function an(){let i=document.createElementNS(ne,"svg");for(let[n,s]of Object.entries({viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(n,s);let e=document.createElementNS(ne,"circle");e.setAttribute("cx","11"),e.setAttribute("cy","11"),e.setAttribute("r","8");let t=document.createElementNS(ne,"path");return t.setAttribute("d","m21 21-4.3-4.3"),i.append(e,t),i}function Tt(i){globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: <nish-command-palette> did not follow an unsafe href (${JSON.stringify(i.slice(0,40))}). Only relative, #, http(s), mailto and tel URLs are followed.`)}function ln(i){if(!(i instanceof HTMLElement))return!1;let e=i.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||i.isContentEditable}var me=class extends y{static properties={open:{type:Boolean,reflect:!0},hotkey:{type:Boolean,reflect:!0},placeholder:{type:String},emptyText:{type:String,attribute:"empty-text"},items:{attribute:!1}};#e=++sn;#t=null;#n=null;#i=null;#r=null;#l=null;#o="";#s=0;#a=[];#c=new Map;#h=null;#u;#f=!1;#g=!1;constructor(){super(),this.open=!1,this.hotkey=!1,this.placeholder="",this.emptyText="",this.items=[]}connectedCallback(){if(super.connectedCallback(),this.#d(),this.#t){this.#p();return}this.#f||(this.#f=!0,w(()=>{this.#f=!1,this.isConnected&&this.#m()}))}disconnectedCallback(){super.disconnectedCallback(),this.#y(!1),window.clearTimeout(this.#u),this.#t?.open&&(this.open=!1,this.#t.close())}show(){this.open=!0}close(){this.open=!1}#y(e){e!==this.#g&&(this.#g=e,e?document.addEventListener("keydown",this.#E):document.removeEventListener("keydown",this.#E))}#d(){this.#y(this.hotkey&&this.isConnected)}#E=e=>{e.defaultPrevented||e.isComposing||!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.key.toLowerCase()!=="k"||ln(e.target)||(e.preventDefault(),this.open=!0)};#m(){if(this.#t)return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > button"));if(this.items.length===0&&e.length>0){let h=new Set,d=[];for(let c of e){let u=c.dataset.id||c.getAttribute("href")||`item-${d.length+1}`;for(;h.has(u);)u=`${u}-${d.length+1}`;h.add(u);let p=(c.dataset.keywords??"").split(/[,\s]+/).map(m=>m.trim()).filter(Boolean);d.push({id:u,label:c.textContent?.trim()??u,group:c.dataset.group||void 0,hint:c.dataset.hint||void 0,keywords:p.length?p:void 0,href:c.getAttribute("href")??void 0}),this.#c.set(u,c)}this.items=d}for(let h of e)h.hidden=!0;let t=document.createElement("dialog");t.className="nish-command";let n=`nish-command-list-${this.#e}`,s=document.createElement("input");s.type="text",s.setAttribute("role","combobox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",n),s.setAttribute("aria-autocomplete","list"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.setAttribute("autocorrect","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#w(s.value)),s.addEventListener("keydown",h=>this.#T(h)),s.addEventListener("change",h=>h.stopPropagation());let r=document.createElement("div");r.className="nish-command-input";let o=document.createElement("button");o.type="button",o.className="nish-icon-btn",o.append(on()),o.addEventListener("click",()=>{this.open=!1}),r.append(an(),s,o);let l=document.createElement("div");l.className="nish-command-list",l.id=n,l.setAttribute("role","listbox"),l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("mousemove",h=>{let d=h.target?.closest("[data-index]");if(!d)return;let c=Number(d.dataset.index);c!==this.#s&&this.#b(c,!1)}),l.addEventListener("click",h=>{let d=h.target?.closest("[data-index]"),c=d?this.#a[Number(d.dataset.index)]:void 0;c&&this.#L(c)});let a=document.createElement("span");a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.style.cssText=rn,t.append(r,l,a),t.addEventListener("click",this.#C),t.addEventListener("cancel",this.#A),t.addEventListener("close",this.#M),t.addEventListener("keydown",h=>{h.key==="Escape"&&h.stopPropagation()}),this.append(t),this.#t=t,this.#n=s,this.#i=l,this.#r=a,this.#l=o,this.#v(),this.#p()}updated(e){e.has("hotkey")&&this.#d(),(e.has("placeholder")||e.has("emptyText"))&&this.#v(),e.has("items")&&this.#t?.open&&this.#_(),e.has("open")&&this.#p()}stringsChanged(){this.#v(),this.#t?.open&&this.#_(),super.stringsChanged()}#v(){let e=this.#n;if(!e)return;let t=A(),n=this.placeholder||t.searchPlaceholder;e.placeholder=n,e.setAttribute("aria-label",n.replace(/…$/,"")||t.search),this.#t?.setAttribute("aria-label",t.search),this.#l?.setAttribute("aria-label",t.close),this.#i?.setAttribute("aria-label",t.results)}#p(){let e=this.#t;!e||!this.isConnected||(this.open&&!e.open?(this.#h=document.activeElement instanceof HTMLElement?document.activeElement:null,this.#o="",this.#s=0,this.#n&&(this.#n.value=""),e.showModal(),this.#_(),this.#n?.focus()):!this.open&&e.open&&e.close())}#S(e){return`nish-command-${this.#e}-opt-${e}`}#_(){let e=this.#i,t=this.#n;if(!e||!t)return;let n=A();this.#a=Fe(this.items,this.#o),this.#s>=this.#a.length&&(this.#s=0),e.textContent="";let s=0,r,o=e;for(let l of this.#a){let a=l.group??null;if(a!==r)if(r=a,a===null)o=e;else{let c=document.createElement("div");c.className="nish-command-group",c.setAttribute("role","group");let u=document.createElement("div");u.id=`nish-command-${this.#e}-group-${s}`,u.textContent=a,c.setAttribute("aria-labelledby",u.id),c.append(u),e.append(c),o=c}let h=document.createElement("div");h.className="nish-command-item",h.id=this.#S(s),h.dataset.index=String(s),h.setAttribute("role","option"),h.setAttribute("aria-selected",s===this.#s?"true":"false");let d=document.createElement("span");if(d.textContent=l.label,h.append(d),l.hint){let c=document.createElement("span");c.className="nish-command-item-hint",c.textContent=l.hint,h.append(c)}o.append(h),s++}if(this.#a.length===0){let l=document.createElement("div");l.className="nish-command-empty",l.textContent=this.emptyText||n.noResults,e.append(l)}this.#a.length?t.setAttribute("aria-activedescendant",this.#S(this.#s)):t.removeAttribute("aria-activedescendant"),this.#r&&(this.#r.textContent=this.#a.length?n.resultCount(this.#a.length):this.emptyText||n.noResults)}#b(e,t=!0){let n=this.#a.length;if(n===0)return;this.#s=(e%n+n)%n;let s=this.#i;if(s){for(let r of Array.from(s.querySelectorAll("[data-index]"))){let o=Number(r.dataset.index)===this.#s;r.setAttribute("aria-selected",o?"true":"false"),o&&t&&r.scrollIntoView?.({block:"nearest"})}this.#n?.setAttribute("aria-activedescendant",this.#S(this.#s))}}#w(e){this.#o=e,this.#s=0,this.#_(),window.clearTimeout(this.#u),this.#u=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200)}#T(e){if(e.isComposing)return;let t=this.#a.length;switch(e.key){case"ArrowDown":e.preventDefault(),this.#b(this.#s+1);break;case"ArrowUp":e.preventDefault(),this.#b(this.#s-1);break;case"Home":t&&!this.#o&&(e.preventDefault(),this.#b(0));break;case"End":t&&!this.#o&&(e.preventDefault(),this.#b(t-1));break;case"Enter":{e.preventDefault();let n=this.#a[this.#s];n&&this.#L(n);break}}}#L(e){let t=this.#c.get(e.id);if(this.open=!1,this.#t?.close(),this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:e.id}})),t){let n=t.getAttribute("href");n!==null&&Se(n)===null?Tt(n):t.click()}else if(e.href){let n=Se(e.href);n===null?Tt(e.href):window.location.assign(n)}}#C=e=>{let t=this.#t;if(!t||e.target!==t)return;let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||(this.open=!1)};#A=e=>{e.preventDefault(),this.open=!1};#M=()=>{window.clearTimeout(this.#u),this.open&&(this.open=!1);let e=this.#h;this.#h=null,e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))}};_("nish-command-palette",me);var Lt="http://www.w3.org/2000/svg";function Ct(i,e){let t=document.createElementNS(Lt,"svg");for(let[n,s]of Object.entries({width:String(i),height:String(i),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))t.setAttribute(n,s);for(let n of e){let s=document.createElementNS(Lt,"path");s.setAttribute("d",n),t.appendChild(s)}return t}var Mt=i=>Ct(i,["M18 6 6 18M6 6l12 12"]),xt=i=>Ct(i,["M22 3H2l8 9.46V19l4 2v-8.54L22 3z"]);var ks=3600*24*365;function cn(i,e){if(typeof document>"u")return()=>{};let t=document.documentElement,n=()=>{let r=i.offsetHeight;r>0?t.style.setProperty(e,`${r}px`):t.style.removeProperty(e)};n();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(n),s.observe(i)):window.addEventListener("resize",n),()=>{s?.disconnect(),window.removeEventListener("resize",n),t.style.removeProperty(e)}}function Nt(i,e={}){if(typeof document>"u")return()=>{};let t=Array.from(i.querySelectorAll('a[href^="#"]')).filter(m=>m.hash.length>1),n=m=>{try{return document.getElementById(decodeURIComponent(m.hash.slice(1)))}catch{return null}},s=e.height===!1?()=>{}:cn(i,"--nish-sticky-extra"),r=null,o=()=>{let m=i.scrollWidth-i.clientWidth;i.dataset.atStart=String(i.scrollLeft<=1),i.dataset.atEnd=String(m<=1||i.scrollLeft>=m-1)},l=m=>{let v=m.offsetLeft-i.offsetLeft,f=i.clientWidth;v<i.scrollLeft+24?i.scrollLeft=Math.max(0,v-24):v+m.offsetWidth>i.scrollLeft+f-24&&(i.scrollLeft=v+m.offsetWidth-f+24)},a=m=>{m!==r&&(r?.removeAttribute("aria-current"),r=m,m&&(m.setAttribute("aria-current","true"),l(m)))},h=()=>{let m=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--nish-header-h"))||0,v=e.offset??m+i.offsetHeight+8,f=t[0]??null;for(let L of t){let U=n(L);U&&U.getBoundingClientRect().top<=v+1&&(f=L)}let T=document.documentElement;if(window.innerHeight+window.scrollY>=T.scrollHeight-2)for(let L of t)n(L)&&(f=L);a(f)},d=0,c=()=>{d||(d=requestAnimationFrame(()=>{d=0,h()}))},u=m=>{let v=m.target instanceof Element?m.target.closest('a[href^="#"]'):null;v&&t.includes(v)&&a(v)};o(),h(),window.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),i.addEventListener("scroll",o,{passive:!0}),i.addEventListener("click",u);let p;return typeof ResizeObserver<"u"&&(p=new ResizeObserver(()=>{o(),c()}),p.observe(i)),()=>{d&&cancelAnimationFrame(d),window.removeEventListener("scroll",c),window.removeEventListener("resize",c),i.removeEventListener("scroll",o),i.removeEventListener("click",u),p?.disconnect(),s(),r?.removeAttribute("aria-current"),delete i.dataset.atStart,delete i.dataset.atEnd}}var hn={md:"(max-width: 767.98px)",lg:"(max-width: 1023.98px)"},dn=0;function pe(i){let e=document.createElement("div");return e.className=i,e}var fe=class extends y{static properties={activeCount:{attribute:"active-count",type:Number,reflect:!0},sheetTitle:{attribute:"sheet-title",type:String,reflect:!0},sheetBelow:{attribute:"sheet-below",type:String,reflect:!0},sticky:{type:Boolean,reflect:!0}};#e=null;#t=pe("nish-filter-bar-search");#n=pe("nish-filter-bar-chips");#i=pe("nish-filter-bar-trailing");#r=pe("nish-filter-bar-summary");#l=null;#o=null;#s=null;#a=null;#c=null;#h=null;#u=null;#f=null;#g=null;#y=null;#d=[];#E=null;#m=null;#v="";#p=null;#S=()=>this.#A();constructor(){super(),this.activeCount=0,this.sheetTitle="",this.sheetBelow="md",this.sticky=!1}connectedCallback(){super.connectedCallback(),w(()=>this.#_())}disconnectedCallback(){if(super.disconnectedCallback(),this.#m?.removeEventListener("change",this.#S),this.#m=null,this.#v="",this.#p?.disconnect(),this.#p=null,this.#e){this.#c?.close();for(let e of this.#d)this.appendChild(e);for(let e of[this.#t,this.#i,this.#r])for(;e.firstChild;)this.appendChild(e.firstChild);this.#e.remove(),this.#c?.remove(),this.#e=null,this.#l=null,this.#o=null,this.#u=null,this.#f=null,this.#g=null,this.#a=null,this.#c=null,this.#h=null,this.#d=[],this.#E=null}}updated(e){this.#e&&(this.#C(),this.#A())}#_(){if(!this.isConnected||this.#e)return;let e=document.createElement("div");e.className="nish-filter-bar",this.#r.setAttribute("aria-live","polite"),e.append(this.#t,this.#n,this.#i,this.#r),this.#e=e;for(let t of Array.from(this.childNodes))this.#w(t);this.appendChild(e),this.#T(),this.#C(),this.#A(),this.#p=new MutationObserver(t=>{for(let n of t)n.addedNodes.forEach(s=>{s!==e&&s.parentNode===this&&this.#w(s)});this.#A()}),this.#p.observe(this,{childList:!0}),this.#p.observe(this.#n,{childList:!0}),this.#h&&this.#p.observe(this.#h,{childList:!0})}#b(){this.#d=this.#d.filter(e=>e.parentNode===this.#n||e.parentNode===this.#h)}#w(e){if(e===this.#e||e instanceof Comment)return;if(!(e instanceof HTMLElement)){e.parentNode?.removeChild(e);return}let t=e.getAttribute("data-slot");t==="trailing"?this.#i.appendChild(e):t==="summary"?this.#r.appendChild(e):e.localName==="nish-search"&&!this.#t.firstChild?this.#t.appendChild(e):(this.#b(),this.#d.includes(e)||this.#d.push(e),(this.#E==="compact"?this.#h??this.#n:this.#n).appendChild(e))}#T(){let e=++dn,t=document.createElement("button");t.type="button",t.className="nish-btn nish-btn--secondary nish-filter-btn",t.setAttribute("aria-haspopup","dialog"),this.#o=document.createTextNode(""),t.append(xt(16),this.#o);let n=document.createElement("span");n.className="nish-badge nish-badge--accent",t.appendChild(n),t.addEventListener("click",()=>this.#c?.show()),this.#l=t,this.#s=n;let s=document.createElement("button");s.type="button",s.className="nish-btn nish-btn--ghost nish-filter-bar-clear",s.addEventListener("click",()=>this.#L()),this.#a=s;let r=document.createElement("nish-sheet"),o=document.createElement("header");o.className="nish-sheet-header";let l=document.createElement("h2");l.className="nish-sheet-title",l.id=`nish-filter-sheet-title-${e}`,o.appendChild(l);let a=document.createElement("button");a.type="button",a.className="nish-icon-btn",a.setAttribute("data-sheet-close",""),this.#f=a,a.appendChild(Mt(16)),o.appendChild(a);let h=document.createElement("div");h.className="nish-sheet-body nish-filter-sheet-body";let d=document.createElement("footer");d.className="nish-sheet-footer";let c=document.createElement("button");c.type="button",c.className="nish-btn nish-btn--ghost",c.addEventListener("click",()=>this.#L());let u=document.createElement("button");u.type="button",u.className="nish-btn nish-btn--primary",u.style.marginInlineStart="auto",this.#g=u,u.addEventListener("click",()=>this.#c?.close()),d.append(c,u),r.append(o,h,d),this.#c=r,this.#h=h,this.#u=c,this.#y=l}#L(){this.dispatchEvent(new CustomEvent("nish-clear",{bubbles:!0}))}#C(){let e=hn[this.sheetBelow==="lg"?"lg":"md"];e!==this.#v&&(this.#m?.removeEventListener("change",this.#S),this.#v=e,this.#m=typeof matchMedia>"u"?null:matchMedia(e),this.#m?.addEventListener("change",this.#S))}#A(){let e=this.#e,t=this.#c,n=this.#h,s=this.#l,r=this.#a;if(!e||!t||!n||!s||!r)return;this.#b();let o=this.#m?.matches?"compact":"wide";o!==this.#E&&(o==="compact"?(this.#n.remove(),r.remove(),this.#t.after(s),n.append(...this.#d),e.appendChild(t)):(t.close(),s.remove(),this.#n.append(...this.#d,r),this.#t.after(this.#n),t.remove()),this.#E=o,e.setAttribute("data-compact",String(o==="compact")));let l=Math.max(0,Number.isFinite(this.activeCount)?Math.floor(this.activeCount):0);e.classList.toggle("nish-filter-bar--sticky",this.sticky),s.hidden=this.#d.length===0,r.hidden=l===0,this.#s&&(this.#s.textContent=String(l),this.#s.hidden=l===0,this.#s.setAttribute("aria-label",A().activeCount(l))),this.#u&&(this.#u.disabled=l===0);let a=A();this.#y&&(this.#y.textContent=this.sheetTitle||a.filters),this.#o&&(this.#o.data=a.filters),r.textContent=a.clearFilters,this.#u&&(this.#u.textContent=a.clear),this.#g&&(this.#g.textContent=a.showResults),this.#f?.setAttribute("aria-label",a.close)}};_("nish-filter-bar",fe);function Rt(i,e){let t=null,n=()=>Array.from(i.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,l=null,a=-1;for(let h of n()){if(e?.(h),!h.getAttribute("href"))continue;let d;try{d=new URL(h.getAttribute("href"),location.href)}catch{continue}if(d.origin!==location.origin)continue;if(d.hash&&d.pathname===location.pathname){d.hash===location.hash&&(l=h,a=1/0);continue}let c=d.pathname;(c==="/"?o==="/":o===c||o.startsWith(c.endsWith("/")?c:`${c}/`))&&c.length>a&&(l=h,a=c.length)}if(!l){t?.removeAttribute("aria-current"),t=null;return}for(let h of n())h.removeAttribute("aria-current");l.setAttribute("aria-current","page"),t=l},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(i,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(i,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var ge=class extends y{static properties={label:{type:String,reflect:!0}};#e=null;#t=null;#n=null;constructor(){super(),this.label=""}connectedCallback(){super.connectedCallback(),w(()=>this.#i())}disconnectedCallback(){super.disconnectedCallback(),this.#n?.disconnect(),this.#n=null,this.#e=null,this.#t?.(),this.#t=null}updated(e){this.#l()}#i(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-nav-rail");if(!e){for(e=document.createElement("nav"),e.className="nish-nav-rail";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#r(e),this.#l(),this.#t=Rt(e,t=>t.classList.add("nish-nav-rail-item")),this.#n=new MutationObserver(t=>{let n=this.#e;if(!n)return;let s=!1;for(let r of t)r.target===this&&r.addedNodes.forEach(o=>{o!==n&&o.nodeType===1&&o.parentNode===this&&(n.appendChild(o),s=!0)});(s||t.some(r=>r.target!==this))&&this.#r(n)}),this.#n.observe(this,{childList:!0}),this.#n.observe(e,{childList:!0,subtree:!0})}#r(e){let t=e.querySelector(':scope > [data-slot="tools"]'),n=e.querySelector(':scope > [data-slot="footer"]');t?.classList.add("nish-nav-rail-tools"),n?.classList.add("nish-nav-rail-footer");let s=[t,n].filter(a=>!!a),r=Array.from(e.children),o=s.length;if(!s.every((a,h)=>r[r.length-o+h]===a))for(let a of s)e.appendChild(a);for(let a of Array.from(e.querySelectorAll(":scope > .nish-nav-rail-tools a, :scope > .nish-nav-rail-footer a")))a.classList.add("nish-nav-rail-item")}#l(){this.#e&&this.#e.setAttribute("aria-label",this.label||A().sections)}};_("nish-nav-rail",ge);var un='[aria-pressed="true"],[aria-selected="true"],[aria-current]:not([aria-current="false"]),[aria-checked="true"]',ve=class extends y{static properties={label:{type:String,reflect:!0},bleed:{type:Boolean,reflect:!0},snap:{type:Boolean,reflect:!0},fade:{reflect:!0,converter:{fromAttribute:e=>e!=="false",toAttribute:e=>e?null:"false"}}};#e=null;#t=null;#n=null;#i=()=>this.#o();constructor(){super(),this.label="",this.bleed=!1,this.snap=!1,this.fade=!0}connectedCallback(){super.connectedCallback(),w(()=>this.#r())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.removeEventListener("scroll",this.#i),this.#t?.disconnect(),this.#t=null,this.#n?.disconnect(),this.#n=null,this.#e=null}updated(e){this.#s()}#r(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-scroll-row");if(!e){for(e=document.createElement("div"),e.className="nish-scroll-row";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#n?.disconnect(),this.#n=new MutationObserver(()=>{let n=this.#e;if(n)for(let s of Array.from(this.childNodes))s!==n&&s.nodeType===1&&n.appendChild(s)}),this.#n.observe(this,{childList:!0}),this.#s(),e.addEventListener("scroll",this.#i,{passive:!0}),typeof ResizeObserver<"u"&&(this.#t=new ResizeObserver(()=>this.#o()),this.#t.observe(e));let t=e.querySelector(un);t&&this.#l(e,t),this.#o()}#l(e,t){let n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),r=8;s.left<n.left+r?e.scrollLeft+=s.left-n.left-r:s.right>n.right-r&&(e.scrollLeft+=s.right-n.right+r)}#o(){let e=this.#e;if(!e)return;let t=e.scrollWidth-e.clientWidth;e.dataset.atStart=String(e.scrollLeft<=1),e.dataset.atEnd=String(t<=1||e.scrollLeft>=t-1)}#s(){let e=this.#e;e&&(this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),e.classList.toggle("nish-scroll-row--bleed",this.bleed),e.classList.toggle("nish-scroll-row--snap",this.snap),e.classList.toggle("nish-scroll-row--no-fade",!this.fade))}};_("nish-scroll-row",ve);var kt={fromAttribute:i=>i!=="false",toAttribute:i=>i?null:"false"},be=class extends y{static properties={label:{type:String,reflect:!0},sticky:{reflect:!0,converter:kt},updateHash:{attribute:"update-hash",reflect:!0,converter:kt}};#e=null;#t=null;#n=null;#i=null;#r=e=>this.#c(e);constructor(){super(),this.label="",this.sticky=!0,this.updateHash=!0}connectedCallback(){super.connectedCallback(),w(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#t?.(),this.#t=null,this.#s=null,this.#n?.disconnect(),this.#n=null,this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#r),this.#e=null}updated(e){this.#o()}#l(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-subnav");if(!e){for(e=document.createElement("nav"),e.className="nish-subnav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#o(),e.addEventListener("click",this.#r),this.#a(e),this.#n=new MutationObserver(()=>{this.#t?.(),this.#a(e)}),this.#n.observe(e,{childList:!0}),this.#i=new MutationObserver(()=>{let t=this.#e;if(t)for(let n of Array.from(this.childNodes))n!==t&&n.nodeType===1&&t.appendChild(n)}),this.#i.observe(this,{childList:!0})}#o(){let e=this.#e;e&&(e.setAttribute("aria-label",this.label||A().sections),e.style.position=this.sticky?"":"static",this.#s!==null&&this.#s!==this.sticky&&this.#a(e))}#s=null;#a(e){this.#t?.(),this.#t=Nt(e,{height:this.sticky}),this.#s=this.sticky}#c(e){let t=e.target instanceof Element?e.target.closest('a[href^="#"]'):null;if(!t||!this.#e?.contains(t)||t.hash.length<2||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n;try{n=decodeURIComponent(t.hash.slice(1))}catch{return}let s=document.getElementById(n);if(!s)return;e.preventDefault();let r=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(s.scrollIntoView({behavior:r?"auto":"smooth",block:"start"}),this.updateHash)try{history.replaceState(history.state,"",`#${t.hash.slice(1)}`)}catch{}this.dispatchEvent(new CustomEvent("nish-select",{bubbles:!0,detail:{id:n}}))}};_("nish-section-nav",be);var $t=5,mn="(max-width: 639.98px) and (pointer: coarse)";function Ve(i,e){let t=()=>Array.from({length:e},()=>100/e);if(e===0)return[];if(!i||i.length!==e||!i.every(s=>Number.isFinite(s)&&s>0))return t();let n=i.reduce((s,r)=>s+r,0);return i.map(s=>s/n*100)}var pn={fromAttribute(i){if(i==null||i.trim()==="")return null;let e=i.split(",").map(t=>Number(t.trim()));return e.every(t=>Number.isFinite(t))?e:null},toAttribute(i){return i&&i.length?i.map(e=>Math.round(e*100)/100).join(","):null}},Ee=class extends y{static properties={orientation:{type:String,reflect:!0},sizes:{converter:pn,reflect:!0},min:{type:Number},storageKey:{type:String,attribute:"storage-key"}};#e=[];#t=[];#n=null;#i=null;#r=!1;#l=null;#o=!1;#s=!1;#a=!1;constructor(){super(),this.orientation="row",this.sizes=null,this.min=120,this.storageKey=null}connectedCallback(){if(super.connectedCallback(),typeof window.matchMedia=="function"&&(this.#i=window.matchMedia(mn),this.#r=this.#i.matches,this.#i.addEventListener("change",this.#y)),this.#s){this.#c(),this.#h();return}this.#o||(this.#o=!0,w(()=>{this.#o=!1,this.isConnected&&(this.#s=!0,this.#c(),this.#h())}))}disconnectedCallback(){super.disconnectedCallback(),this.#i?.removeEventListener("change",this.#y),this.#i=null,this.#n?.disconnect(),this.#n=null,this.#b()}updated(e){this.#s&&(e.size===0||e.has("orientation")||e.has("sizes")||e.has("min"))&&this.#g()}#c(){typeof MutationObserver>"u"||(this.#n??=new MutationObserver(()=>this.#h()),this.#n.observe(this,{childList:!0}))}#h(){if(!this.isConnected)return;this.#n?.disconnect();let e=[];for(let t of Array.from(this.childNodes)){if(!(t instanceof HTMLElement))continue;if(t.classList.contains("nish-split-divider")){t.remove();continue}if(t.classList.contains("nish-split-pane")){e.push(t);continue}let n=document.createElement("div");n.className="nish-split-pane",this.insertBefore(n,t),n.append(t),e.push(n)}this.#e=e,this.#t=[];for(let t=0;t<e.length-1;t++){let n=document.createElement("div");n.className="nish-split-divider",n.setAttribute("role","separator"),n.tabIndex=0,n.style.touchAction="none",n.addEventListener("pointerdown",s=>this.#p(s,t)),n.addEventListener("pointermove",s=>this.#S(s)),n.addEventListener("pointerup",s=>this.#_(s)),n.addEventListener("pointercancel",s=>this.#_(s)),n.addEventListener("keydown",s=>this.#T(s,t)),n.addEventListener("dblclick",()=>this.#w()),this.insertBefore(n,e[t+1]),this.#t.push(n)}this.#u(),this.#g(),this.#n?.observe(this,{childList:!0})}#u(){if(!(this.#a||!this.storageKey||this.#e.length===0)){this.#a=!0;try{let e=window.localStorage.getItem(this.storageKey);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&t.length===this.#e.length&&t.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>0)&&(this.sizes=Ve(t,this.#e.length))}catch{}}}get#f(){return Ve(this.sizes,this.#e.length)}#g(){let e=this.orientation!=="column",t=this.#f,n=A();this.style.display="flex",this.style.flexDirection=this.#r?"column":e?"row":"column",this.style.minWidth="0",this.style.minHeight="0",this.#e.forEach((s,r)=>{s.style.minWidth="0",this.#r?(s.style.minHeight="var(--nish-split-stack-h, 16rem)",s.style.flex="none"):(s.style.minHeight="0",s.style.flex=`${t[r]} 1 0%`);let o=s.children.length===1?s.firstElementChild:null;o?.localName==="nish-split"&&(s.style.display="flex",o.style.flex="1 1 auto")}),this.#t.forEach((s,r)=>{s.hidden=this.#r,s.classList.toggle("nish-split-divider--v",e),s.classList.toggle("nish-split-divider--h",!e),s.setAttribute("aria-orientation",e?"vertical":"horizontal"),s.setAttribute("aria-label",e?n.resizeColumns:n.resizeRows),s.setAttribute("aria-valuenow",String(Math.round(t[r]))),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100")})}#y=e=>{this.#r=e.matches,this.#g()};#d(e){let t=e.getBoundingClientRect();return this.orientation==="column"?t.height:t.width}#E(e,t,n,s){let r=e[t]+e[t+1],o=Math.min(s,r/2),l=Math.min(Math.max(e[t]+n,o),r-o),a=e.slice();return a[t]=l,a[t+1]=r-l,a}#m(e){if(this.storageKey)try{window.localStorage.setItem(this.storageKey,JSON.stringify(e))}catch{}}#v(e){this.sizes=e,this.dispatchEvent(new CustomEvent("nish-resize",{bubbles:!0,detail:{sizes:e}}))}#p(e,t){if(e.button!==0||this.#r)return;let n=this.#t[t];if(!n)return;e.preventDefault(),n.setPointerCapture?.(e.pointerId);let s=[];for(let o of Array.from(this.querySelectorAll("iframe")))s.push([o,o.style.pointerEvents]),o.style.pointerEvents="none";let r=this.#e.reduce((o,l)=>o+this.#d(l),0);this.#l={pointerId:e.pointerId,start:this.orientation==="column"?e.clientY:e.clientX,index:t,sizes:this.#f,total:r,restore:s},this.setAttribute("data-dragging","")}#S(e){let t=this.#l;if(!t||t.pointerId!==e.pointerId||t.total<=0)return;let n=this.orientation==="column"?e.clientY:e.clientX,s=this.orientation!=="column"&&ze(this)?-1:1,r=(n-t.start)*s/t.total*100;r!==0&&this.#v(this.#E(t.sizes,t.index,r,this.min/t.total*100))}#_(e){let t=this.#l;if(!t||t.pointerId!==e.pointerId)return;let n=this.#t[t.index];n?.hasPointerCapture?.(e.pointerId)&&n.releasePointerCapture(e.pointerId),this.#b()}#b(){let e=this.#l;if(e){this.#l=null,this.sizes&&this.#m(this.sizes);for(let[t,n]of e.restore)t.style.pointerEvents=n;this.removeAttribute("data-dragging")}}#w(){if(this.#r||this.#e.length<2)return;let e=Ve(null,this.#e.length);this.#v(e),this.#m(e)}#T(e,t){if(e.key==="Enter"){e.preventDefault(),this.#w();return}let n=this.orientation!=="column",s=n&&ze(this),r=n?s?"ArrowRight":"ArrowLeft":"ArrowUp",o=n?s?"ArrowLeft":"ArrowRight":"ArrowDown";if(e.key!==r&&e.key!==o)return;e.preventDefault();let l=this.#e.reduce((c,u)=>c+this.#d(u),0),a=l>0?this.min/l*100:0,h=this.#f,d=this.#E(h,t,e.key===o?$t:-$t,a);d[t]!==h[t]&&(this.#v(d),this.#m(d))}};_("nish-split",Ee);var We="http://www.w3.org/2000/svg";function fn(){let i=document.createElementNS(We,"svg");i.setAttribute("width","10"),i.setAttribute("height","10"),i.setAttribute("viewBox","0 0 10 10"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let e of["M2 4 5 1l3 3","M2 6l3 3 3-3"]){let t=document.createElementNS(We,"path");t.setAttribute("d",e),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.5"),t.setAttribute("opacity","0.35"),i.appendChild(t)}return i}function gn(i){return(i.target instanceof Element?i.target:i.target.parentElement)?.closest("thead")?!0:Array.from(i.addedNodes).some(t=>t instanceof Element&&(t.localName==="thead"||t.localName==="table"||t.localName==="tr"||t.localName==="th"||t.querySelector("thead")!==null))}function vn(i){let e=i.replace(/[\s,$€£%]/g,"");if(e===""||e==="-"||e==="+")return null;let t=Number(e);return Number.isFinite(t)?t:null}var ye=class extends y{static properties={manual:{type:Boolean,reflect:!0}};#e=null;#t=e=>this.#a(e);constructor(){super(),this.manual=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#t),w(()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#t),this.#e?.disconnect(),this.#e=null}#n(){!this.isConnected||this.#e||(this.#l(),this.#e=new MutationObserver(e=>{e.some(gn)&&(this.#e?.disconnect(),this.#l(),this.#i())}),this.#i())}#i(){this.#e?.observe(this,{childList:!0,subtree:!0})}#r(){return Array.from(this.querySelectorAll("thead th[data-sort]"))}#l(){for(let e of this.#r()){if(e.hasAttribute("scope")||e.setAttribute("scope","col"),e.hasAttribute("aria-sort")||e.setAttribute("aria-sort","none"),e.querySelector(":scope > .nish-th-sort"))continue;let t=document.createElement("button");for(t.type="button",t.className="nish-th-sort";e.firstChild;)t.appendChild(e.firstChild);t.appendChild(fn()),e.appendChild(t),this.#o(e)}}#o(e){let t=e.querySelectorAll(".nish-th-sort svg path"),n=e.getAttribute("aria-sort");t[0]?.setAttribute("opacity",n==="ascending"?"1":"0.35"),t[1]?.setAttribute("opacity",n==="descending"?"1":"0.35")}#s(e){let t=e.getAttribute("data-sort");if(t)return t;let n=e.querySelector(".nish-th-sort"),s="";return(n??e).childNodes.forEach(r=>{(r.nodeType===Node.TEXT_NODE||r instanceof HTMLElement&&r.namespaceURI!==We)&&(s+=r.textContent??"")}),s.trim()}#a(e){let n=e.target?.closest(".nish-th-sort"),s=n?.closest("th[data-sort]");if(!n||!s||!this.contains(s))return;let r=s.getAttribute("aria-sort")==="ascending"?"descending":"ascending";for(let o of this.#r())o.setAttribute("aria-sort",o===s?r:"none"),this.#o(o);this.manual||this.#c(s,r),this.dispatchEvent(new CustomEvent("nish-sort",{bubbles:!0,detail:{column:this.#s(s),direction:r==="ascending"?"asc":"desc"}}))}#c(e,t){let n=e.cellIndex,s=t==="ascending"?1:-1,r=e.closest("table");if(!r)return;let o=new Intl.Collator(void 0,{sensitivity:"base"});for(let l of Array.from(r.tBodies)){let a=Array.from(l.rows).map((p,m)=>{let v=p.cells[n],f=v?(v.getAttribute("data-value")??v.textContent??"").trim():"";return{row:p,key:f,num:vn(f),order:m}}),h=a.filter(p=>p.key!==""),d=a.filter(p=>p.key===""),c=e.classList.contains("nish-th--num")||h.length>0&&h.every(p=>p.num!==null);h.sort((p,m)=>(c?(p.num??0)-(m.num??0):o.compare(p.key,m.key))*s||p.order-m.order);let u=document.createDocumentFragment();for(let p of[...h,...d])u.appendChild(p.row);l.appendChild(u)}}};_("nish-table-sort",ye);export{me as NishCommandPalette,y as NishElement,fe as NishFilterBar,ge as NishNavRail,ve as NishScrollRow,be as NishSectionNav,Ee as NishSplit,ye as NishTableSort,tn as configureStrings,_ as define};
|
|
6
6
|
/*! Bundled license information:
|
|
7
7
|
|
|
8
8
|
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|
package/dist/elements-forms.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ge=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 T=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)},V,oe,ae,F,xe,G,le,I,q,k,he,qe;var g={__proto__:null};g.enumerable=!0;Object.freeze(g);var $e=(k=class{constructor(e,t={}){if(V.set(this,!1),oe.set(this,!1),ae.set(this,!1),F.set(this,!1),xe.set(this,Date.now()),G.set(this,!1),le.set(this,void 0),I.set(this,void 0),q.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:i,cancelable:s,composed:r}=t;T(this,V,!!s,"f"),T(this,oe,!!i,"f"),T(this,ae,!!r,"f"),T(this,le,`${e}`,"f"),T(this,I,null,"f"),T(this,q,!1,"f")}initEvent(e,t,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){T(this,F,!0,"f")}get target(){return _(this,I,"f")}get currentTarget(){return _(this,I,"f")}get srcElement(){return _(this,I,"f")}get type(){return _(this,le,"f")}get cancelable(){return _(this,V,"f")}get defaultPrevented(){return _(this,V,"f")&&_(this,F,"f")}get timeStamp(){return _(this,xe,"f")}composedPath(){return _(this,q,"f")?[_(this,I,"f")]:[]}get returnValue(){return!_(this,V,"f")||!_(this,F,"f")}get bubbles(){return _(this,oe,"f")}get composed(){return _(this,ae,"f")}get eventPhase(){return _(this,q,"f")?k.AT_TARGET:k.NONE}get cancelBubble(){return _(this,G,"f")}set cancelBubble(e){e&&T(this,G,!0,"f")}stopPropagation(){T(this,G,!0,"f")}get isTrusted(){return!1}},V=new WeakMap,oe=new WeakMap,ae=new WeakMap,F=new WeakMap,xe=new WeakMap,G=new WeakMap,le=new WeakMap,I=new WeakMap,q=new WeakMap,k.NONE=0,k.CAPTURING_PHASE=1,k.AT_TARGET=2,k.BUBBLING_PHASE=3,k);Object.defineProperties($e.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 Ke=(qe=class extends $e{constructor(e,t={}){super(e,t),he.set(this,void 0),T(this,he,t?.detail??null,"f")}initCustomEvent(e,t,i,s){throw new Error("Method not implemented.")}get detail(){return _(this,he,"f")}},he=new WeakMap,qe);Object.defineProperties(Ke.prototype,{detail:g});var M=$e,Ce=Ke;var w;var Ai=(w=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}},w.STYLE_RULE=1,w.CHARSET_RULE=2,w.IMPORT_RULE=3,w.MEDIA_RULE=4,w.FONT_FACE_RULE=5,w.PAGE_RULE=6,w.NAMESPACE_RULE=10,w.KEYFRAMES_RULE=7,w.KEYFRAME_RULE=8,w.SUPPORTS_RULE=12,w.COUNTER_STYLE_RULE=11,w.FONT_FEATURE_VALUES_RULE=14,w.MARGIN_RULE=9,w);globalThis.Event??=M;globalThis.CustomEvent??=Ce;var Le=Symbol(),Ye=n=>typeof n=="boolean"?n:n?.capture??!1,R={__proto__:null};R.enumerable=!0;Object.freeze(R);var ce=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,i){if(t==null)return;let s=Ye(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=Ye(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=M.NONE,o=null,l=null,a=null,u=e.stopPropagation,h=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??l},...R},srcElement:{get(){return e.target},...R},currentTarget:{get(){return a},...R},eventPhase:{get(){return r},...R},composedPath:{value:()=>t,...R},stopPropagation:{value:()=>{i=!0,u.call(e)},...R},stopImmediatePropagation:{value:()=>{s=!0,h.call(e)},...R}});let c=(b,x,H)=>{typeof b=="function"?b(e):typeof b?.handleEvent=="function"&&b.handleEvent(e),x.once&&H.delete(b)},d=()=>(a=null,r=M.NONE,!e.defaultPrevented),v=t.slice().reverse();o=!this.__host||!e.composed?this:null;let f=b=>{for(l=this;l.__host&&b.includes(l.__host);)l=l.__host};for(let b of v){!o&&(!l||l===b.__host)&&f(v.slice(v.indexOf(b))),a=b,r=b===e.target?M.AT_TARGET:M.CAPTURING_PHASE;let x=b.__captureEventListeners.get(e.type);if(x){for(let[H,m]of x)if(c(H,m,x),s)return d()}if(i)return d()}let C=e.bubbles?t:[this];l=null;for(let b of C){!o&&(!l||b===l.__host)&&f(C.slice(0,C.indexOf(b)+1)),a=b,r=b===e.target?M.AT_TARGET:M.BUBBLING_PHASE;let x=b.__eventListeners.get(e.type);if(x){for(let[H,m]of x)if(c(H,m,x),s)return d()}if(i)return d()}return d()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,Je,Ut]}};var Xe=new WeakMap,K=n=>{let e=Xe.get(n);return e===void 0&&Xe.set(n,e=new Map),e},Y=class extends ce{getRootNode(e){return e?.composed?Te:this.__host?.__shadowRoot??Te}};var Ze=class extends Y{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var Je=new Ze,Te=Je;var Qe=class extends Y{constructor(e){if(super(),e!==Le)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:ue,customElements:Re,document:Te,Document:Ze,Element:et,EventTarget:ce,HTMLElement:tt,Node:Y,ShadowRoot:it,window:this,Window:Qe})}};var et=class extends Y{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(K(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){K(this).set(e,String(t))}removeAttribute(e){K(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 K(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new it(Le,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 Ge(this);return this.__internals=e,e}getAttribute(e){return K(this).get(e)??null}};var tt=class extends et{},Me=tt;var it=class extends Y{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 It(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}var ue=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
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=It(),this.__pendingWhenDefineds.set(e,i)),i.promise}},Bt=ue;var Re=new Bt,Ut=new Qe(Le);var X=globalThis,pe=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,nt=Symbol(),st=new WeakMap,de=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==nt)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(pe&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=st.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&st.set(t,e))}return e}toString(){return this.cssText}},rt=n=>new de(typeof n=="string"?n:n+"",void 0,nt);var ot=(n,e)=>{if(pe)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),s=X.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},Ne=pe||X.CSSStyleSheet===void 0?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return rt(t)})(n):n;var{is:Dt,defineProperty:zt,getOwnPropertyDescriptor:Vt,getOwnPropertyNames:Wt,getOwnPropertySymbols:jt,getPrototypeOf:Ft}=Object,J=globalThis;J.customElements??=Re;var at=J.trustedTypes,Gt=at?at.emptyScript:"",qt=J.reactiveElementPolyfillSupport,Z=(n,e)=>n,ke={toAttribute(n,e){switch(e){case Boolean:n=n?Gt: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}},ht=(n,e)=>!Dt(n,e),lt={attribute:!0,type:String,converter:ke,reflect:!1,useDefault:!1,hasChanged:ht};Symbol.metadata??=Symbol("metadata"),J.litPropertyMetadata??=new WeakMap;var N=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=lt){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&&zt(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){let{get:s,set:r}=Vt(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let l=s?.call(this);r?.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??lt}static _$Ei(){if(this.hasOwnProperty(Z("elementProperties")))return;let e=Ft(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Z("properties"))){let t=this.properties,i=[...Wt(t),...jt(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(Ne(s))}else e!==void 0&&t.push(Ne(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 ot(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:ke).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:ke;this._$Em=s;let l=o.fromAttribute(t,r.type);this[s]=l??this._$Ej?.get(s)??l,this._$Em=null}}requestUpdate(e,t,i,s=!1,r){if(e!==void 0){let o=this.constructor;if(s===!1&&(r=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??ht)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,r]of i){let{wrapped:o}=r,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,r,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[Z("elementProperties")]=new Map,N[Z("finalized")]=new Map,qt?.({ReactiveElement:N}),(J.reactiveElementVersions??=[]).push("2.1.2");var fe=globalThis,ct=n=>n,me=fe.trustedTypes,ut=me?me.createPolicy("lit-html",{createHTML:n=>n}):void 0,vt="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,gt="?"+P,Kt=`<${gt}>`,D=fe.document===void 0?{createTreeWalker:()=>({})}:document,ee=()=>D.createComment(""),te=n=>n===null||typeof n!="object"&&typeof n!="function",De=Array.isArray,Yt=n=>De(n)||typeof n?.[Symbol.iterator]=="function",Pe=`[
|
|
3
3
|
\f\r]`,Q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dt=/-->/g,pt=/>/g,B=RegExp(`>|${Pe}(?:([^\\s"'>=/]+)(${Pe}*=${Pe}*(?:[^
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),mt=/'/g,ft=/"/g,Et=/^(?:script|style|textarea|title)$/i,ze=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),S=ze(1),$=ze(2),ns=ze(3),z=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),bt=new WeakMap,U=D.createTreeWalker(D,129);function yt(n,e){if(!De(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ut!==void 0?ut.createHTML(e):e}var Xt=(n,e)=>{let t=n.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Q;for(let l=0;l<t;l++){let a=n[l],u,h,c=-1,d=0;for(;d<a.length&&(o.lastIndex=d,h=o.exec(a),h!==null);)d=o.lastIndex,o===Q?h[1]==="!--"?o=dt:h[1]!==void 0?o=pt:h[2]!==void 0?(Et.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=B):h[3]!==void 0&&(o=B):o===B?h[0]===">"?(o=s??Q,c=-1):h[1]===void 0?c=-2:(c=o.lastIndex-h[2].length,u=h[1],o=h[3]===void 0?B:h[3]==='"'?ft:mt):o===ft||o===mt?o=B:o===dt||o===pt?o=Q:(o=B,s=void 0);let v=o===B&&n[l+1].startsWith("/>")?" ":"";r+=o===Q?a+Kt:c>=0?(i.push(u),a.slice(0,c)+vt+a.slice(c)+P+v):a+P+(c===-2?l:v)}return[yt(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},ie=class n{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[u,h]=Xt(e,t);if(this.el=n.createElement(u,i),U.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=U.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(vt)){let d=h[o++],v=s.getAttribute(c).split(P),f=/([.?@])?(.*)/.exec(d);a.push({type:1,index:r,name:f[2],strings:v,ctor:f[1]==="."?He:f[1]==="?"?Ie:f[1]==="@"?Be:j}),s.removeAttribute(c)}else c.startsWith(P)&&(a.push({type:6,index:r}),s.removeAttribute(c));if(Et.test(s.tagName)){let c=s.textContent.split(P),d=c.length-1;if(d>0){s.textContent=me?me.emptyScript:"";for(let v=0;v<d;v++)s.append(c[v],ee()),U.nextNode(),a.push({type:2,index:++r});s.append(c[d],ee())}}}else if(s.nodeType===8)if(s.data===gt)a.push({type:2,index:r});else{let c=-1;for(;(c=s.data.indexOf(P,c+1))!==-1;)a.push({type:7,index:r}),c+=P.length-1}r++}}static createElement(e,t){let i=D.createElement("template");return i.innerHTML=e,i}};function W(n,e,t=n,i){if(e===z)return e;let s=i!==void 0?t._$Co?.[i]:t._$Cl,r=te(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=W(n,s._$AS(n,e.values),s,i)),e}var Oe=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??D).importNode(t,!0);U.currentNode=s;let r=U.nextNode(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let u;a.type===2?u=new se(r,r.nextSibling,this,e):a.type===1?u=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(u=new Ue(r,this,e)),this._$AV.push(u),a=i[++l]}o!==a?.index&&(r=U.nextNode(),o++)}return U.currentNode=D,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++}},se=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=p,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=W(this,e,t),te(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Yt(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!==p&&te(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.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=ie.createElement(yt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Oe(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=bt.get(e.strings);return t===void 0&&bt.set(e.strings,t=new ie(e)),t}k(e){De(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(ee()),this.O(ee()),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=ct(e).nextSibling;ct(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=p,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=p}_$AI(e,t=this,i,s){let r=this.strings,o=!1;if(r===void 0)e=W(this,e,t,0),o=!te(e)||e!==this._$AH&&e!==z,o&&(this._$AH=e);else{let l=e,a,u;for(e=r[0],a=0;a<r.length-1;a++)u=W(this,l[i+a],t,a),u===z&&(u=this._$AH[a]),o||=!te(u)||u!==this._$AH[a],u===p?e=p:e!==p&&(e+=(u??"")+r[a+1]),this._$AH[a]=u}o&&!s&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},He=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}},Ie=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==p)}},Be=class extends j{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=W(this,e,t,0)??p)===z)return;let i=this._$AH,s=e===p&&i!==p||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==p&&(i===p||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)}},Ue=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){W(this,e)}};var Zt=fe.litHtmlPolyfillSupport;Zt?.(ie,se),(fe.litHtmlVersions??=[]).push("3.3.3");var _t=(n,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=t?.renderBefore??null;i._$litPart$=s=new se(e.insertBefore(ee(),r),r,void 0,t??{})}return s._$AI(n),s};var Ve=globalThis,O=class extends N{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=_t(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};O._$litElement$=!0,O.finalized=!0,Ve.litElementHydrateSupport?.({LitElement:O});var Jt=Ve.litElementPolyfillSupport;Jt?.({LitElement:O});(Ve.litElementVersions??=[]).push("4.2.2");var Qt="2.1.2";var ei=Symbol.for("nish-ui.runtime.v1");function ti(){let n=globalThis;return n[ei]??={versions:new Set,slots:{}}}function ii(n){n.versions.add(Qt),n.versions.size>1&&!n.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(n.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...n.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var St=!1;function wt(n,e){let t=ti();return St||(St=!0,ii(t)),n in t.slots||(t.slots[n]=e()),t.slots[n]}var At={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:n=>`${n} result${n===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:n=>`${n} active`,remove:"Remove",removeNamed:n=>`Remove ${n}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:n=>`${n}: no data`,seriesNumber:n=>`Series ${n}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark"};function We(){return wt("element-strings",()=>({values:{...At},listeners:new Set}))}function si(n){let e=We(),t={...e.values};for(let[i,s]of Object.entries(n))s!==void 0&&Object.hasOwn(At,i)&&(t[i]=s);e.values=t;for(let i of Array.from(e.listeners))i()}function A(){return We().values}function xt(n){let e=We().listeners;return e.add(n),()=>{e.delete(n)}}var E=class extends O{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=xt(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function L(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function y(n,e){customElements.get(n)||customElements.define(n,e)}function ne(n){return!!n&&getComputedStyle(n).direction==="rtl"}var $t="http://www.w3.org/2000/svg";function ni(n,e){let t=document.createElementNS($t,"svg");for(let[i,s]of Object.entries({width:String(n),height:String(n),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))t.setAttribute(i,s);for(let i of e){let s=document.createElementNS($t,"path");s.setAttribute("d",i),t.appendChild(s)}return t}var Ct=n=>ni(n,["M18 6 6 18M6 6l12 12"]);var be=class extends E{static properties={label:{type:String,reflect:!0},scrollable:{attribute:"scroll",type:Boolean,reflect:!0},single:{type:Boolean,reflect:!0}};#e=null;#i=null;#t=null;#n=e=>this.#d(e);constructor(){super(),this.label="",this.scrollable=!1,this.single=!1}get values(){return this.#e?this.#a().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#r(e)):this.#t??[]}set values(e){if(!this.#e){this.#t=[...e];return}let t=new Set(e),i=!1;for(let s of this.#a()){let r=t.has(this.#r(s))&&!(this.single&&i);r&&(i=!0),s.setAttribute("aria-pressed",String(r))}}connectedCallback(){super.connectedCallback(),L(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#n),this.#e=null}updated(e){this.#s(),this.#o()}#o(){if(!this.#e)return;let e=A();for(let t of this.#a()){let i=t.querySelector(":scope > [data-nish-remove]");if(!i)continue;let s=this.#c(t);i.setAttribute("aria-label",s?e.removeNamed(s):e.remove)}}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button, :scope > .nish-chip")):[]}#c(e){let t="";return e.childNodes.forEach(i=>{(i.nodeType===Node.TEXT_NODE||i instanceof HTMLElement&&!i.hasAttribute("data-nish-remove"))&&(t+=i.textContent??"")}),t.trim()}#r(e){return e.getAttribute("value")??this.#c(e)}#l(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-chips");if(!e){for(e=document.createElement("div"),e.className="nish-chips";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,e.setAttribute("role","group"),e.addEventListener("click",this.#n),this.#s(),this.#u(),this.#t&&(this.values=this.#t,this.#t=null),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#u(),this.#h()}),this.#h()}#h(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#s(){this.#e&&(this.label?this.#e.setAttribute("aria-label",this.label):this.#e.removeAttribute("aria-label"),this.#e.classList.toggle("nish-chips--scroll",this.scrollable))}#u(){for(let e of this.#a())if(e.classList.add("nish-chip"),e instanceof HTMLButtonElement)e.hasAttribute("type")||(e.type="button"),e.hasAttribute("aria-pressed")||e.setAttribute("aria-pressed","false");else if(e.hasAttribute("data-removable")&&!e.querySelector(":scope > [data-nish-remove]")){let t=this.#c(e),i=document.createElement("button");i.type="button",i.className="nish-icon-btn nish-icon-btn--xs",i.setAttribute("data-nish-remove",""),i.setAttribute("aria-label",t?A().removeNamed(t):A().remove),i.appendChild(Ct(12)),e.appendChild(i)}}#d(e){let t=e.target;if(!t||!this.#e)return;let i=t.closest("[data-nish-remove]");if(i&&this.#e.contains(i)){let o=i.parentElement,l=this.#r(o);o.remove(),this.dispatchEvent(new CustomEvent("nish-remove",{bubbles:!0,detail:{value:l}}));return}let s=t.closest("button");if(!s||s.parentElement!==this.#e||s.disabled||!s.hasAttribute("aria-pressed"))return;let r=s.getAttribute("aria-pressed")!=="true";if(r&&this.single)for(let o of this.#a())o!==s&&o.hasAttribute("aria-pressed")&&o.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};y("nish-chip-group",be);var Tt=(n,e)=>{let t=e.trim().toLowerCase();return t?n.label.toLowerCase().includes(t)||(n.hint?.toLowerCase().includes(t)??!1):!0};var ai=0,Lt="http://www.w3.org/2000/svg",li="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function Mt(n){let e=document.createElementNS(Lt,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","16"),e.setAttribute("height","16"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");let t=document.createElementNS(Lt,"path");return t.setAttribute("d",n),e.append(t),e}var ve=class extends E{static properties={value:{type:String,reflect:!0},placeholder:{type:String},label:{type:String},allowCustom:{type:Boolean,attribute:"allow-custom",reflect:!0},emptyText:{type:String,attribute:"empty-text"},size:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},name:{type:String},options:{attribute:!1},filter:{attribute:!1}};#e=++ai;#i=null;#t=null;#n=null;#o=null;#a=null;#c=null;#r=!1;#l="";#h=!1;#s=-1;#u;#d=!1;constructor(){super(),this.value=null,this.placeholder=null,this.label=null,this.allowCustom=!1,this.emptyText="",this.size=null,this.disabled=!1,this.loading=!1,this.name=null,this.options=[],this.filter=null}get input(){return this.#t}connectedCallback(){if(super.connectedCallback(),this.#i){this.#p();return}this.#d||(this.#d=!0,L(()=>{this.#d=!1,this.isConnected&&this.#f()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#u),this.#m()}#f(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(a=>({value:a.value,label:a.textContent?.trim()??a.value,hint:a.dataset.hint||void 0,disabled:a.disabled||void 0}));for(let a of e)a.remove();this.options.length===0&&t.length>0&&(this.options=t);let i=document.createElement("div");i.className="nish-combobox";let s=document.createElement("input");s.type="text",s.className="nish-input nish-combobox-input",s.setAttribute("role","combobox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#M(s.value)),s.addEventListener("keydown",a=>this.#R(a)),s.addEventListener("focus",()=>this.#A()),s.addEventListener("click",()=>this.#A()),s.addEventListener("blur",()=>{this.#$()||(this.#m(),this.#E(),this.#p())}),s.addEventListener("change",a=>a.stopPropagation());let r=document.createElement("button");r.type="button",r.className="nish-icon-btn nish-combobox-clear",r.tabIndex=-1,r.hidden=!0,r.append(Mt("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",a=>a.preventDefault()),r.addEventListener("click",()=>{this.#m(),this.#g(null,null),s.focus()});let o=document.createElement("span");o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.style.cssText=li;let l=document.createElement("input");l.type="hidden",i.append(s,r,o),this.append(i,l),this.#i=i,this.#t=s,this.#n=r,this.#o=o,this.#c=l,this.#p()}updated(e){e.has("value")&&e.get("value")!==void 0&&this.#E(),e.has("disabled")&&this.disabled&&this.#m(),(e.has("options")||e.has("filter")||e.has("loading"))&&this.#T(),this.#p()}get#b(){return this.options.find(e=>e.value===this.value)??null}get#w(){return this.value!=null&&this.value!==""}get#C(){return this.#h?this.#l:this.#b?.label??this.value??""}get#v(){let e=this.filter??Tt;return(this.#h?this.options.filter(i=>e(i,this.#l)):this.options).slice(0,50)}#T(){this.#s>=this.#v.length&&(this.#s=-1)}#E(){this.#h=!1,this.#l=""}#A(){if(this.#r||this.disabled||!this.#t)return;this.#r=!0;let e=this.#b,t=e?this.#v.findIndex(i=>i.value===e.value):-1;this.#s=t>=0?t:-1,this.#p()}#m(){this.#r=!1,this.#s=-1,this.#a?.remove(),this.#a=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#o&&(this.#o.textContent="")}#y(e,t){let i=this.#v,s=i.length;if(s===0)return-1;let r=e;for(let o=0;o<s;o++)if(r=(r+t+s)%s,!i[r].disabled)return r;return-1}#_(e){return e===1?this.#y(-1,1):this.#y(0,-1)}#g(e,t){this.value=e,this.#E(),this.#p();let i={value:e,option:t};this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:i}))}#x(e){e.disabled||(this.#m(),this.#g(e.value,e))}#$(){return!this.#h||this.#l.trim()!==""||!this.#w?!1:(this.#m(),this.#g(null,null),!0)}#L(){let e=this.#l.trim();if(!this.allowCustom||!this.#h||!e)return!1;let t=this.options.find(i=>!i.disabled&&i.label.toLowerCase()===e.toLowerCase());return this.#m(),t?this.#g(t.value,t):this.#g(e,null),!0}#M(e){this.#l=e,this.#h=!0,this.#r=!0,this.allowCustom||e.trim()===""?this.#s=-1:this.#s=this.#v.findIndex(t=>!t.disabled),window.clearTimeout(this.#u),this.#u=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#p()}#R(e){if(this.disabled)return;let t=this.#v;switch(e.key){case"ArrowDown":case"ArrowUp":{e.preventDefault();let i=e.key==="ArrowDown"?1:-1;if(this.#r){this.#S(this.#s<0?this.#_(i):this.#y(this.#s,i));break}else{this.#r=!0;let s=this.#b,r=s?t.findIndex(o=>o.value===s.value):-1;this.#s=r>=0?r:this.#_(i)}this.#p();break}case"Home":case"End":this.#r&&(e.preventDefault(),this.#S(this.#_(e.key==="Home"?1:-1)));break;case"Enter":this.#r&&this.#s>=0&&t[this.#s]?(e.preventDefault(),this.#x(t[this.#s])):(this.#$()||this.#L()||this.#r)&&e.preventDefault();break;case"Escape":this.#r?(e.preventDefault(),e.stopPropagation(),this.#m(),this.#p()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#E(),this.#p());break;case"Tab":this.#m();break}}#p(){let e=this.#t,t=this.#i;if(!e||!t||!this.#n||!this.#c||!this.#o)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let i=this.#C;e.value!==i&&(e.value=i),e.disabled=this.disabled,this.placeholder?e.placeholder=this.placeholder:e.removeAttribute("placeholder"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),this.#n.setAttribute("aria-label",A().clear),this.#n.hidden=!(this.#w&&!this.disabled);let s=this.#c;if(this.name?s.name=this.name:s.removeAttribute("name"),s.value=this.value??"",s.disabled=this.disabled,!this.#r){this.#a&&this.#m();return}this.#N(e,t,this.#o)}#S(e){let t=this.#s;this.#s=e;let i=this.#a,s=this.#t;if(!i||!s||!this.#r){this.#p();return}i.querySelector("[data-active]")?.removeAttribute("data-active");let r=e>=0?i.querySelector(`[data-index="${e}"]`):null;if(!r){t!==e?this.#p():s.removeAttribute("aria-activedescendant");return}r.dataset.active="",s.setAttribute("aria-activedescendant",r.id),r.scrollIntoView?.({block:"nearest"})}#N(e,t,i){let s=A(),r=`nish-cb-list-${this.#e}`,o=this.#v,l=this.#b,a=this.#a;if(!a){a=document.createElement("ul"),a.id=r,a.className="nish-combobox-list",a.setAttribute("role","listbox");let h=c=>{let d=c.target?.closest("li[data-index]");if(!d||!a.contains(d))return null;let v=Number(d.dataset.index),f=this.#v[v];return f?{o:f,i:v}:null};a.addEventListener("mousedown",c=>c.preventDefault()),a.addEventListener("mousemove",c=>{let d=h(c);d&&!d.o.disabled&&this.#s!==d.i&&this.#S(d.i)}),a.addEventListener("click",c=>{let d=h(c);d&&this.#x(d.o)}),this.#a=a,t.append(a)}this.label?(a.setAttribute("aria-label",this.label),a.removeAttribute("aria-labelledby")):(a.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),a.setAttribute("aria-labelledby",e.id));let u=o.map((h,c)=>{let d=document.createElement("li");d.id=`${r}-opt-${c}`,d.className="nish-combobox-option",d.setAttribute("role","option"),d.dataset.index=String(c),d.setAttribute("aria-selected",String(l?.value===h.value)),h.disabled&&d.setAttribute("aria-disabled","true"),c===this.#s&&(d.dataset.active="");let v=document.createElement("span");if(v.className="nish-combobox-label",v.textContent=h.label,d.append(v),h.hint){let f=document.createElement("span");f.className="nish-combobox-hint",f.textContent=h.hint,d.append(f)}return l?.value===h.value&&d.append(Mt("M20 6 9 17l-5-5")),d});if(this.loading){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-loading";let c=document.createElement("span");c.className="nish-spinner nish-spinner--sm",c.setAttribute("aria-hidden","true"),h.append(c,document.createTextNode(s.searching)),u.push(h)}else if(o.length===0){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-empty",h.textContent=this.emptyText||s.noMatches,u.push(h)}a.replaceChildren(...u),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#s>=0&&o[this.#s]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#s}`):e.removeAttribute("aria-activedescendant"),i.textContent=this.loading?s.searching:o.length===0?this.emptyText||s.noMatches:s.resultCount(o.length),this.#k(a,e),a.querySelector(`[data-index="${this.#s}"]`)?.scrollIntoView?.({block:"nearest"})}#k(e,t){e.style.top="",e.style.bottom="",e.style.marginTop="",e.style.marginBottom="",delete e.dataset.above;let i=t.getBoundingClientRect(),s=e.getBoundingClientRect().height,r=window.innerHeight-i.bottom;s>r&&i.top>r&&(e.dataset.above="",e.style.top="auto",e.style.bottom="100%",e.style.marginTop="0",e.style.marginBottom="4px")}};y("nish-combobox",ve);var Rt=1500,Nt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",hi=$`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg>`,ci=$`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--nish-ok)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"></path></svg>`;async function ui(n){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(n),!0}catch{}let e=document.createElement("textarea");e.value=n,e.setAttribute("readonly",""),e.style.cssText="position:fixed;top:-1000px;opacity:0";let t=document.activeElement;document.body.appendChild(e),e.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return e.remove(),t?.focus?.(),i}var ge=class extends E{static properties={value:{type:String,reflect:!0},for:{type:String,reflect:!0},label:{type:String,reflect:!0},copiedLabel:{attribute:"copied-label",reflect:!0},icon:{type:Boolean,reflect:!0},copied:{state:!0},manual:{state:!0}};#e=null;constructor(){super(),this.value=null,this.for=null,this.label="",this.copiedLabel="",this.icon=!1,this.copied=!1,this.manual=!1}disconnectedCallback(){super.disconnectedCallback(),this.#e&&clearTimeout(this.#e),this.#e=null,this.copied=!1,this.manual=!1}#i(){return this.value!=null?this.value:(this.for?document.getElementById(this.for):null)?.textContent??""}async#t(){let e=this.#i();if(!await ui(e)){await this.#n();return}this.manual=!1,this.copied=!0,this.dispatchEvent(new CustomEvent("nish-copy",{bubbles:!0,detail:{text:e}})),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.copied=!1,this.#e=null},Rt)}async#n(){this.copied=!1,this.manual=!0,await this.updateComplete;let e=this.value==null&&this.for?document.getElementById(this.for):null;if(e){let t=document.createRange();t.selectNodeContents(e);let i=window.getSelection();i?.removeAllRanges(),i?.addRange(t)}else{let t=this.querySelector("textarea[data-copy-source]");t?.focus(),t?.select()}this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{document.activeElement?.matches("textarea[data-copy-source]")&&this.contains(document.activeElement)&&this.querySelector("button")?.focus(),this.manual=!1,this.#e=null},Rt)}render(){let e=A(),t=this.copiedLabel||e.copied,i=this.copied?t:this.manual?e.copyManual:this.label||e.copy,s=this.copied?ci:hi;return S`${this.icon?S`<button type="button" class="nish-icon-btn nish-icon-btn--sm nish-copy-btn" aria-label=${i} title=${i} ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),mt=/'/g,ft=/"/g,Et=/^(?:script|style|textarea|title)$/i,ze=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),S=ze(1),$=ze(2),ns=ze(3),z=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),bt=new WeakMap,U=D.createTreeWalker(D,129);function yt(n,e){if(!De(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ut!==void 0?ut.createHTML(e):e}var Xt=(n,e)=>{let t=n.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Q;for(let l=0;l<t;l++){let a=n[l],u,h,c=-1,d=0;for(;d<a.length&&(o.lastIndex=d,h=o.exec(a),h!==null);)d=o.lastIndex,o===Q?h[1]==="!--"?o=dt:h[1]!==void 0?o=pt:h[2]!==void 0?(Et.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=B):h[3]!==void 0&&(o=B):o===B?h[0]===">"?(o=s??Q,c=-1):h[1]===void 0?c=-2:(c=o.lastIndex-h[2].length,u=h[1],o=h[3]===void 0?B:h[3]==='"'?ft:mt):o===ft||o===mt?o=B:o===dt||o===pt?o=Q:(o=B,s=void 0);let v=o===B&&n[l+1].startsWith("/>")?" ":"";r+=o===Q?a+Kt:c>=0?(i.push(u),a.slice(0,c)+vt+a.slice(c)+P+v):a+P+(c===-2?l:v)}return[yt(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},ie=class n{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,o=0,l=e.length-1,a=this.parts,[u,h]=Xt(e,t);if(this.el=n.createElement(u,i),U.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=U.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(vt)){let d=h[o++],v=s.getAttribute(c).split(P),f=/([.?@])?(.*)/.exec(d);a.push({type:1,index:r,name:f[2],strings:v,ctor:f[1]==="."?He:f[1]==="?"?Ie:f[1]==="@"?Be:j}),s.removeAttribute(c)}else c.startsWith(P)&&(a.push({type:6,index:r}),s.removeAttribute(c));if(Et.test(s.tagName)){let c=s.textContent.split(P),d=c.length-1;if(d>0){s.textContent=me?me.emptyScript:"";for(let v=0;v<d;v++)s.append(c[v],ee()),U.nextNode(),a.push({type:2,index:++r});s.append(c[d],ee())}}}else if(s.nodeType===8)if(s.data===gt)a.push({type:2,index:r});else{let c=-1;for(;(c=s.data.indexOf(P,c+1))!==-1;)a.push({type:7,index:r}),c+=P.length-1}r++}}static createElement(e,t){let i=D.createElement("template");return i.innerHTML=e,i}};function W(n,e,t=n,i){if(e===z)return e;let s=i!==void 0?t._$Co?.[i]:t._$Cl,r=te(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=W(n,s._$AS(n,e.values),s,i)),e}var Oe=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??D).importNode(t,!0);U.currentNode=s;let r=U.nextNode(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let u;a.type===2?u=new se(r,r.nextSibling,this,e):a.type===1?u=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(u=new Ue(r,this,e)),this._$AV.push(u),a=i[++l]}o!==a?.index&&(r=U.nextNode(),o++)}return U.currentNode=D,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++}},se=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=p,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=W(this,e,t),te(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Yt(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!==p&&te(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.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=ie.createElement(yt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Oe(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=bt.get(e.strings);return t===void 0&&bt.set(e.strings,t=new ie(e)),t}k(e){De(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(ee()),this.O(ee()),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=ct(e).nextSibling;ct(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=p,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=p}_$AI(e,t=this,i,s){let r=this.strings,o=!1;if(r===void 0)e=W(this,e,t,0),o=!te(e)||e!==this._$AH&&e!==z,o&&(this._$AH=e);else{let l=e,a,u;for(e=r[0],a=0;a<r.length-1;a++)u=W(this,l[i+a],t,a),u===z&&(u=this._$AH[a]),o||=!te(u)||u!==this._$AH[a],u===p?e=p:e!==p&&(e+=(u??"")+r[a+1]),this._$AH[a]=u}o&&!s&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},He=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}},Ie=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==p)}},Be=class extends j{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=W(this,e,t,0)??p)===z)return;let i=this._$AH,s=e===p&&i!==p||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==p&&(i===p||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)}},Ue=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){W(this,e)}};var Zt=fe.litHtmlPolyfillSupport;Zt?.(ie,se),(fe.litHtmlVersions??=[]).push("3.3.3");var _t=(n,e,t)=>{let i=t?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=t?.renderBefore??null;i._$litPart$=s=new se(e.insertBefore(ee(),r),r,void 0,t??{})}return s._$AI(n),s};var Ve=globalThis,O=class extends N{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=_t(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};O._$litElement$=!0,O.finalized=!0,Ve.litElementHydrateSupport?.({LitElement:O});var Jt=Ve.litElementPolyfillSupport;Jt?.({LitElement:O});(Ve.litElementVersions??=[]).push("4.2.2");var Qt="2.2.0";var ei=Symbol.for("nish-ui.runtime.v1");function ti(){let n=globalThis;return n[ei]??={versions:new Set,slots:{}}}function ii(n){n.versions.add(Qt),n.versions.size>1&&!n.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(n.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...n.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var St=!1;function wt(n,e){let t=ti();return St||(St=!0,ii(t)),n in t.slots||(t.slots[n]=e()),t.slots[n]}var At={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:n=>`${n} result${n===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:n=>`${n} active`,remove:"Remove",removeNamed:n=>`Remove ${n}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:n=>`${n}: no data`,seriesNumber:n=>`Series ${n}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark"};function We(){return wt("element-strings",()=>({values:{...At},listeners:new Set}))}function si(n){let e=We(),t={...e.values};for(let[i,s]of Object.entries(n))s!==void 0&&Object.hasOwn(At,i)&&(t[i]=s);e.values=t;for(let i of Array.from(e.listeners))i()}function A(){return We().values}function xt(n){let e=We().listeners;return e.add(n),()=>{e.delete(n)}}var E=class extends O{#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=xt(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function L(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function y(n,e){customElements.get(n)||customElements.define(n,e)}function ne(n){return!!n&&getComputedStyle(n).direction==="rtl"}var $t="http://www.w3.org/2000/svg";function ni(n,e){let t=document.createElementNS($t,"svg");for(let[i,s]of Object.entries({width:String(n),height:String(n),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))t.setAttribute(i,s);for(let i of e){let s=document.createElementNS($t,"path");s.setAttribute("d",i),t.appendChild(s)}return t}var Ct=n=>ni(n,["M18 6 6 18M6 6l12 12"]);var be=class extends E{static properties={label:{type:String,reflect:!0},scrollable:{attribute:"scroll",type:Boolean,reflect:!0},single:{type:Boolean,reflect:!0}};#e=null;#i=null;#t=null;#n=e=>this.#d(e);constructor(){super(),this.label="",this.scrollable=!1,this.single=!1}get values(){return this.#e?this.#a().filter(e=>e.getAttribute("aria-pressed")==="true").map(e=>this.#r(e)):this.#t??[]}set values(e){if(!this.#e){this.#t=[...e];return}let t=new Set(e),i=!1;for(let s of this.#a()){let r=t.has(this.#r(s))&&!(this.single&&i);r&&(i=!0),s.setAttribute("aria-pressed",String(r))}}connectedCallback(){super.connectedCallback(),L(()=>this.#l())}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect(),this.#i=null,this.#e?.removeEventListener("click",this.#n),this.#e=null}updated(e){this.#s(),this.#o()}#o(){if(!this.#e)return;let e=A();for(let t of this.#a()){let i=t.querySelector(":scope > [data-nish-remove]");if(!i)continue;let s=this.#c(t);i.setAttribute("aria-label",s?e.removeNamed(s):e.remove)}}#a(){return this.#e?Array.from(this.#e.querySelectorAll(":scope > button, :scope > .nish-chip")):[]}#c(e){let t="";return e.childNodes.forEach(i=>{(i.nodeType===Node.TEXT_NODE||i instanceof HTMLElement&&!i.hasAttribute("data-nish-remove"))&&(t+=i.textContent??"")}),t.trim()}#r(e){return e.getAttribute("value")??this.#c(e)}#l(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > div.nish-chips");if(!e){for(e=document.createElement("div"),e.className="nish-chips";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,e.setAttribute("role","group"),e.addEventListener("click",this.#n),this.#s(),this.#u(),this.#t&&(this.values=this.#t,this.#t=null),this.#i=new MutationObserver(()=>{this.#i?.disconnect(),this.#u(),this.#h()}),this.#h()}#h(){this.#e&&this.#i?.observe(this.#e,{childList:!0})}#s(){this.#e&&(this.label?this.#e.setAttribute("aria-label",this.label):this.#e.removeAttribute("aria-label"),this.#e.classList.toggle("nish-chips--scroll",this.scrollable))}#u(){for(let e of this.#a())if(e.classList.add("nish-chip"),e instanceof HTMLButtonElement)e.hasAttribute("type")||(e.type="button"),e.hasAttribute("aria-pressed")||e.setAttribute("aria-pressed","false");else if(e.hasAttribute("data-removable")&&!e.querySelector(":scope > [data-nish-remove]")){let t=this.#c(e),i=document.createElement("button");i.type="button",i.className="nish-icon-btn nish-icon-btn--xs",i.setAttribute("data-nish-remove",""),i.setAttribute("aria-label",t?A().removeNamed(t):A().remove),i.appendChild(Ct(12)),e.appendChild(i)}}#d(e){let t=e.target;if(!t||!this.#e)return;let i=t.closest("[data-nish-remove]");if(i&&this.#e.contains(i)){let o=i.parentElement,l=this.#r(o);o.remove(),this.dispatchEvent(new CustomEvent("nish-remove",{bubbles:!0,detail:{value:l}}));return}let s=t.closest("button");if(!s||s.parentElement!==this.#e||s.disabled||!s.hasAttribute("aria-pressed"))return;let r=s.getAttribute("aria-pressed")!=="true";if(r&&this.single)for(let o of this.#a())o!==s&&o.hasAttribute("aria-pressed")&&o.setAttribute("aria-pressed","false");s.setAttribute("aria-pressed",String(r)),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:{values:this.values}}))}};y("nish-chip-group",be);var Tt=(n,e)=>{let t=e.trim().toLowerCase();return t?n.label.toLowerCase().includes(t)||(n.hint?.toLowerCase().includes(t)??!1):!0};var ai=0,Lt="http://www.w3.org/2000/svg",li="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";function Mt(n){let e=document.createElementNS(Lt,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","16"),e.setAttribute("height","16"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");let t=document.createElementNS(Lt,"path");return t.setAttribute("d",n),e.append(t),e}var ve=class extends E{static properties={value:{type:String,reflect:!0},placeholder:{type:String},label:{type:String},allowCustom:{type:Boolean,attribute:"allow-custom",reflect:!0},emptyText:{type:String,attribute:"empty-text"},size:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},name:{type:String},options:{attribute:!1},filter:{attribute:!1}};#e=++ai;#i=null;#t=null;#n=null;#o=null;#a=null;#c=null;#r=!1;#l="";#h=!1;#s=-1;#u;#d=!1;constructor(){super(),this.value=null,this.placeholder=null,this.label=null,this.allowCustom=!1,this.emptyText="",this.size=null,this.disabled=!1,this.loading=!1,this.name=null,this.options=[],this.filter=null}get input(){return this.#t}connectedCallback(){if(super.connectedCallback(),this.#i){this.#p();return}this.#d||(this.#d=!0,L(()=>{this.#d=!1,this.isConnected&&this.#f()}))}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this.#u),this.#m()}#f(){if(this.#i)return;let e=Array.from(this.querySelectorAll(":scope > option")),t=e.map(a=>({value:a.value,label:a.textContent?.trim()??a.value,hint:a.dataset.hint||void 0,disabled:a.disabled||void 0}));for(let a of e)a.remove();this.options.length===0&&t.length>0&&(this.options=t);let i=document.createElement("div");i.className="nish-combobox";let s=document.createElement("input");s.type="text",s.className="nish-input nish-combobox-input",s.setAttribute("role","combobox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),s.autocomplete="off",s.setAttribute("autocapitalize","off"),s.spellcheck=!1,s.addEventListener("input",()=>this.#M(s.value)),s.addEventListener("keydown",a=>this.#R(a)),s.addEventListener("focus",()=>this.#A()),s.addEventListener("click",()=>this.#A()),s.addEventListener("blur",()=>{this.#$()||(this.#m(),this.#E(),this.#p())}),s.addEventListener("change",a=>a.stopPropagation());let r=document.createElement("button");r.type="button",r.className="nish-icon-btn nish-combobox-clear",r.tabIndex=-1,r.hidden=!0,r.append(Mt("M18 6 6 18M6 6l12 12")),r.addEventListener("mousedown",a=>a.preventDefault()),r.addEventListener("click",()=>{this.#m(),this.#g(null,null),s.focus()});let o=document.createElement("span");o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.style.cssText=li;let l=document.createElement("input");l.type="hidden",i.append(s,r,o),this.append(i,l),this.#i=i,this.#t=s,this.#n=r,this.#o=o,this.#c=l,this.#p()}updated(e){e.has("value")&&e.get("value")!==void 0&&this.#E(),e.has("disabled")&&this.disabled&&this.#m(),(e.has("options")||e.has("filter")||e.has("loading"))&&this.#T(),this.#p()}get#b(){return this.options.find(e=>e.value===this.value)??null}get#w(){return this.value!=null&&this.value!==""}get#C(){return this.#h?this.#l:this.#b?.label??this.value??""}get#v(){let e=this.filter??Tt;return(this.#h?this.options.filter(i=>e(i,this.#l)):this.options).slice(0,50)}#T(){this.#s>=this.#v.length&&(this.#s=-1)}#E(){this.#h=!1,this.#l=""}#A(){if(this.#r||this.disabled||!this.#t)return;this.#r=!0;let e=this.#b,t=e?this.#v.findIndex(i=>i.value===e.value):-1;this.#s=t>=0?t:-1,this.#p()}#m(){this.#r=!1,this.#s=-1,this.#a?.remove(),this.#a=null,this.#t&&(this.#t.setAttribute("aria-expanded","false"),this.#t.removeAttribute("aria-controls"),this.#t.removeAttribute("aria-activedescendant")),this.#o&&(this.#o.textContent="")}#y(e,t){let i=this.#v,s=i.length;if(s===0)return-1;let r=e;for(let o=0;o<s;o++)if(r=(r+t+s)%s,!i[r].disabled)return r;return-1}#_(e){return e===1?this.#y(-1,1):this.#y(0,-1)}#g(e,t){this.value=e,this.#E(),this.#p();let i={value:e,option:t};this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("nish-change",{bubbles:!0,detail:i}))}#x(e){e.disabled||(this.#m(),this.#g(e.value,e))}#$(){return!this.#h||this.#l.trim()!==""||!this.#w?!1:(this.#m(),this.#g(null,null),!0)}#L(){let e=this.#l.trim();if(!this.allowCustom||!this.#h||!e)return!1;let t=this.options.find(i=>!i.disabled&&i.label.toLowerCase()===e.toLowerCase());return this.#m(),t?this.#g(t.value,t):this.#g(e,null),!0}#M(e){this.#l=e,this.#h=!0,this.#r=!0,this.allowCustom||e.trim()===""?this.#s=-1:this.#s=this.#v.findIndex(t=>!t.disabled),window.clearTimeout(this.#u),this.#u=window.setTimeout(()=>{this.dispatchEvent(new CustomEvent("nish-query",{bubbles:!0,detail:{query:e}}))},200),this.#p()}#R(e){if(this.disabled)return;let t=this.#v;switch(e.key){case"ArrowDown":case"ArrowUp":{e.preventDefault();let i=e.key==="ArrowDown"?1:-1;if(this.#r){this.#S(this.#s<0?this.#_(i):this.#y(this.#s,i));break}else{this.#r=!0;let s=this.#b,r=s?t.findIndex(o=>o.value===s.value):-1;this.#s=r>=0?r:this.#_(i)}this.#p();break}case"Home":case"End":this.#r&&(e.preventDefault(),this.#S(this.#_(e.key==="Home"?1:-1)));break;case"Enter":this.#r&&this.#s>=0&&t[this.#s]?(e.preventDefault(),this.#x(t[this.#s])):(this.#$()||this.#L()||this.#r)&&e.preventDefault();break;case"Escape":this.#r?(e.preventDefault(),e.stopPropagation(),this.#m(),this.#p()):this.#h&&(e.preventDefault(),e.stopPropagation(),this.#E(),this.#p());break;case"Tab":this.#m();break}}#p(){let e=this.#t,t=this.#i;if(!e||!t||!this.#n||!this.#c||!this.#o)return;t.classList.toggle("nish-combobox--sm",this.size==="sm");let i=this.#C;e.value!==i&&(e.value=i),e.disabled=this.disabled,this.placeholder?e.placeholder=this.placeholder:e.removeAttribute("placeholder"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"),this.#n.setAttribute("aria-label",A().clear),this.#n.hidden=!(this.#w&&!this.disabled);let s=this.#c;if(this.name?s.name=this.name:s.removeAttribute("name"),s.value=this.value??"",s.disabled=this.disabled,!this.#r){this.#a&&this.#m();return}this.#N(e,t,this.#o)}#S(e){let t=this.#s;this.#s=e;let i=this.#a,s=this.#t;if(!i||!s||!this.#r){this.#p();return}i.querySelector("[data-active]")?.removeAttribute("data-active");let r=e>=0?i.querySelector(`[data-index="${e}"]`):null;if(!r){t!==e?this.#p():s.removeAttribute("aria-activedescendant");return}r.dataset.active="",s.setAttribute("aria-activedescendant",r.id),r.scrollIntoView?.({block:"nearest"})}#N(e,t,i){let s=A(),r=`nish-cb-list-${this.#e}`,o=this.#v,l=this.#b,a=this.#a;if(!a){a=document.createElement("ul"),a.id=r,a.className="nish-combobox-list",a.setAttribute("role","listbox");let h=c=>{let d=c.target?.closest("li[data-index]");if(!d||!a.contains(d))return null;let v=Number(d.dataset.index),f=this.#v[v];return f?{o:f,i:v}:null};a.addEventListener("mousedown",c=>c.preventDefault()),a.addEventListener("mousemove",c=>{let d=h(c);d&&!d.o.disabled&&this.#s!==d.i&&this.#S(d.i)}),a.addEventListener("click",c=>{let d=h(c);d&&this.#x(d.o)}),this.#a=a,t.append(a)}this.label?(a.setAttribute("aria-label",this.label),a.removeAttribute("aria-labelledby")):(a.removeAttribute("aria-label"),e.id||(e.id=`nish-cb-${this.#e}`),a.setAttribute("aria-labelledby",e.id));let u=o.map((h,c)=>{let d=document.createElement("li");d.id=`${r}-opt-${c}`,d.className="nish-combobox-option",d.setAttribute("role","option"),d.dataset.index=String(c),d.setAttribute("aria-selected",String(l?.value===h.value)),h.disabled&&d.setAttribute("aria-disabled","true"),c===this.#s&&(d.dataset.active="");let v=document.createElement("span");if(v.className="nish-combobox-label",v.textContent=h.label,d.append(v),h.hint){let f=document.createElement("span");f.className="nish-combobox-hint",f.textContent=h.hint,d.append(f)}return l?.value===h.value&&d.append(Mt("M20 6 9 17l-5-5")),d});if(this.loading){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-loading";let c=document.createElement("span");c.className="nish-spinner nish-spinner--sm",c.setAttribute("aria-hidden","true"),h.append(c,document.createTextNode(s.searching)),u.push(h)}else if(o.length===0){let h=document.createElement("li");h.setAttribute("role","presentation"),h.className="nish-combobox-empty",h.textContent=this.emptyText||s.noMatches,u.push(h)}a.replaceChildren(...u),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",r),this.#s>=0&&o[this.#s]?e.setAttribute("aria-activedescendant",`${r}-opt-${this.#s}`):e.removeAttribute("aria-activedescendant"),i.textContent=this.loading?s.searching:o.length===0?this.emptyText||s.noMatches:s.resultCount(o.length),this.#k(a,e),a.querySelector(`[data-index="${this.#s}"]`)?.scrollIntoView?.({block:"nearest"})}#k(e,t){e.style.top="",e.style.bottom="",e.style.marginTop="",e.style.marginBottom="",delete e.dataset.above;let i=t.getBoundingClientRect(),s=e.getBoundingClientRect().height,r=window.innerHeight-i.bottom;s>r&&i.top>r&&(e.dataset.above="",e.style.top="auto",e.style.bottom="100%",e.style.marginTop="0",e.style.marginBottom="4px")}};y("nish-combobox",ve);var Rt=1500,Nt="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0",hi=$`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg>`,ci=$`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--nish-ok)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"></path></svg>`;async function ui(n){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(n),!0}catch{}let e=document.createElement("textarea");e.value=n,e.setAttribute("readonly",""),e.style.cssText="position:fixed;top:-1000px;opacity:0";let t=document.activeElement;document.body.appendChild(e),e.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return e.remove(),t?.focus?.(),i}var ge=class extends E{static properties={value:{type:String,reflect:!0},for:{type:String,reflect:!0},label:{type:String,reflect:!0},copiedLabel:{attribute:"copied-label",reflect:!0},icon:{type:Boolean,reflect:!0},copied:{state:!0},manual:{state:!0}};#e=null;constructor(){super(),this.value=null,this.for=null,this.label="",this.copiedLabel="",this.icon=!1,this.copied=!1,this.manual=!1}disconnectedCallback(){super.disconnectedCallback(),this.#e&&clearTimeout(this.#e),this.#e=null,this.copied=!1,this.manual=!1}#i(){return this.value!=null?this.value:(this.for?document.getElementById(this.for):null)?.textContent??""}async#t(){let e=this.#i();if(!await ui(e)){await this.#n();return}this.manual=!1,this.copied=!0,this.dispatchEvent(new CustomEvent("nish-copy",{bubbles:!0,detail:{text:e}})),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.copied=!1,this.#e=null},Rt)}async#n(){this.copied=!1,this.manual=!0,await this.updateComplete;let e=this.value==null&&this.for?document.getElementById(this.for):null;if(e){let t=document.createRange();t.selectNodeContents(e);let i=window.getSelection();i?.removeAllRanges(),i?.addRange(t)}else{let t=this.querySelector("textarea[data-copy-source]");t?.focus(),t?.select()}this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{document.activeElement?.matches("textarea[data-copy-source]")&&this.contains(document.activeElement)&&this.querySelector("button")?.focus(),this.manual=!1,this.#e=null},Rt)}render(){let e=A(),t=this.copiedLabel||e.copied,i=this.copied?t:this.manual?e.copyManual:this.label||e.copy,s=this.copied?ci:hi;return S`${this.icon?S`<button type="button" class="nish-icon-btn nish-icon-btn--sm nish-copy-btn" aria-label=${i} title=${i} ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
5
5
|
${s}
|
|
6
6
|
</button>`:S`<button type="button" class="nish-btn nish-btn--sm nish-copy-btn" ?data-copied=${this.copied} @click=${()=>this.#t()}>
|
|
7
7
|
${s}${i}
|