@kodaris/krubble-components 1.0.43 → 1.0.44

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.
@@ -3,23 +3,23 @@
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;let r=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(t,e))}return e}toString(){return this.cssText}};const n=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,o)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1]),e[0]);return new r(i,e,o)},l=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,o))(t)})(e):e
6
+ */const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;let r=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(t,e))}return e}toString(){return this.cssText}};const l=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,o)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1]),e[0]);return new r(i,e,o)},n=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,o))(t)})(e):e
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */,{is:a,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,g=globalThis,f=g.trustedTypes,b=f?f.emptyScript:"",v=g.reactiveElementPolyfillSupport,y=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},x=(e,t)=>!a(e,t),_={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;let k=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){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){const i=Symbol(),o=this.getPropertyDescriptor(e,i,t);void 0!==o&&d(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){const{get:o,set:s}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const r=o?.call(this);s?.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...h(e),...p(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(l(e))}else void 0!==e&&t.push(l(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?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),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,o)=>{if(i)e.adoptedStyleSheets=o.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const i of o){const o=document.createElement("style"),s=t.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=i.cssText,e.appendChild(o)}})(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){const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:m).toAttribute(t,i.type);this._$Em=e,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(e,t){const i=this.constructor,o=i._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=i.getPropertyOptions(o),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:m;this._$Em=o;const r=s.fromAttribute(t,e.type);this[o]=r??this._$Ej?.get(o)??r,this._$Em=null}}requestUpdate(e,t,i,o=!1,s){if(void 0!==e){const r=this.constructor;if(!1===o&&(s=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??x)(s,t)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:s},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==s||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===o&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,o=this[t];!0!==e||this._$AL.has(t)||void 0===o||this.C(t,void 0,i,o)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.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((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[y("elementProperties")]=new Map,k[y("finalized")]=new Map,v?.({ReactiveElement:k}),(g.reactiveElementVersions??=[]).push("2.1.2");
11
+ */,{is:a,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,g=globalThis,f=g.trustedTypes,v=f?f.emptyScript:"",b=g.reactiveElementPolyfillSupport,m=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?v:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},x=(e,t)=>!a(e,t),_={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;let k=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){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){const i=Symbol(),o=this.getPropertyDescriptor(e,i,t);void 0!==o&&d(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){const{get:o,set:s}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const r=o?.call(this);s?.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const e=this.properties,t=[...h(e),...p(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(n(e))}else void 0!==e&&t.push(n(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?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),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,o)=>{if(i)e.adoptedStyleSheets=o.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const i of o){const o=document.createElement("style"),s=t.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=i.cssText,e.appendChild(o)}})(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){const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:y).toAttribute(t,i.type);this._$Em=e,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(e,t){const i=this.constructor,o=i._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=i.getPropertyOptions(o),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=o;const r=s.fromAttribute(t,e.type);this[o]=r??this._$Ej?.get(o)??r,this._$Em=null}}requestUpdate(e,t,i,o=!1,s){if(void 0!==e){const r=this.constructor;if(!1===o&&(s=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??x)(s,t)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:s},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==s||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===o&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,o=this[t];!0!==e||this._$AL.has(t)||void 0===o||this.C(t,void 0,i,o)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.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((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[m("elementProperties")]=new Map,k[m("finalized")]=new Map,b?.({ReactiveElement:k}),(g.reactiveElementVersions??=[]).push("2.1.2");
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const w=globalThis,$=w.trustedTypes,R=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,S="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+C,A=`<${T}>`,K=document,E=()=>K.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,z=Array.isArray,P="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,j=/>/g,M=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,B=/"/g,F=/^(?:script|style|textarea|title)$/i,q=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),H=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),U=new WeakMap,N=K.createTreeWalker(K,129);function W(e,t){if(!z(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(t):t}const Z=(e,t)=>{const i=e.length-1,o=[];let s,r=2===t?"<svg>":3===t?"<math>":"",n=L;for(let t=0;t<i;t++){const i=e[t];let l,a,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,a=n.exec(i),null!==a);)c=n.lastIndex,n===L?"!--"===a[1]?n=D:void 0!==a[1]?n=j:void 0!==a[2]?(F.test(a[2])&&(s=RegExp("</"+a[2],"g")),n=M):void 0!==a[3]&&(n=M):n===M?">"===a[0]?(n=s??L,d=-1):void 0===a[1]?d=-2:(d=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?M:'"'===a[3]?B:I):n===B||n===I?n=M:n===D||n===j?n=L:(n=M,s=void 0);const h=n===M&&e[t+1].startsWith("/>")?" ":"";r+=n===L?i+A:d>=0?(o.push(l),i.slice(0,d)+S+i.slice(d)+C+h):i+C+(-2===d?t:h)}return[W(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class G{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let s=0,r=0;const n=e.length-1,l=this.parts,[a,d]=Z(e,t);if(this.el=G.createElement(a,i),N.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=N.nextNode())&&l.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(S)){const t=d[r++],i=o.getAttribute(e).split(C),n=/([.?@])?(.*)/.exec(t);l.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?ee:"?"===n[1]?te:"@"===n[1]?ie:J}),o.removeAttribute(e)}else e.startsWith(C)&&(l.push({type:6,index:s}),o.removeAttribute(e));if(F.test(o.tagName)){const e=o.textContent.split(C),t=e.length-1;if(t>0){o.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],E()),N.nextNode(),l.push({type:2,index:++s});o.append(e[t],E())}}}else if(8===o.nodeType)if(o.data===T)l.push({type:2,index:s});else{let e=-1;for(;-1!==(e=o.data.indexOf(C,e+1));)l.push({type:7,index:s}),e+=C.length-1}s++}}static createElement(e,t){const i=K.createElement("template");return i.innerHTML=e,i}}function Q(e,t,i=e,o){if(t===H)return t;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=O(t)?void 0:t._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(e),s._$AT(e,i,o)),void 0!==o?(i._$Co??=[])[o]=s:i._$Cl=s),void 0!==s&&(t=Q(e,s._$AS(e,t.values),s,o)),t}class X{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){const{el:{content:t},parts:i}=this._$AD,o=(e?.creationScope??K).importNode(t,!0);N.currentNode=o;let s=N.nextNode(),r=0,n=0,l=i[0];for(;void 0!==l;){if(r===l.index){let t;2===l.type?t=new Y(s,s.nextSibling,this,e):1===l.type?t=new l.ctor(s,l.name,l.strings,this,e):6===l.type&&(t=new oe(s,this,e)),this._$AV.push(t),l=i[++n]}r!==l?.index&&(s=N.nextNode(),r++)}return N.currentNode=K,o}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Y{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Q(this,e,t),O(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==H&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>z(e)||"function"==typeof e?.[Symbol.iterator])(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!==V&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(K.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,o="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=G.createElement(W(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(t);else{const e=new X(o,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=U.get(e.strings);return void 0===t&&U.set(e.strings,t=new G(e)),t}k(e){z(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const s of e)o===t.length?t.push(i=new Y(this.O(E()),this.O(E()),this,this.options)):i=t[o],i._$AI(s),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,s){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}_$AI(e,t=this,i,o){const s=this.strings;let r=!1;if(void 0===s)e=Q(this,e,t,0),r=!O(e)||e!==this._$AH&&e!==H,r&&(this._$AH=e);else{const o=e;let n,l;for(e=s[0],n=0;n<s.length-1;n++)l=Q(this,o[i+n],t,n),l===H&&(l=this._$AH[n]),r||=!O(l)||l!==this._$AH[n],l===V?e=V:e!==V&&(e+=(l??"")+s[n+1]),this._$AH[n]=l}r&&!o&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ee extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class te extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class ie extends J{constructor(e,t,i,o,s){super(e,t,i,o,s),this.type=5}_$AI(e,t=this){if((e=Q(this,e,t,0)??V)===H)return;const i=this._$AH,o=e===V&&i!==V||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==V&&(i===V||o);o&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class oe{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){Q(this,e)}}const se=w.litHtmlPolyfillSupport;se?.(G,Y),(w.litHtmlVersions??=[]).push("3.3.2");const re=globalThis;
17
+ const w=globalThis,$=w.trustedTypes,R=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,C="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,z="?"+S,T=`<${z}>`,E=document,K=()=>E.createComment(""),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,O=Array.isArray,L="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,D=/>/g,M=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,B=/"/g,F=/^(?:script|style|textarea|title)$/i,I=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),V=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),U=new WeakMap,N=E.createTreeWalker(E,129);function W(e,t){if(!O(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(t):t}const X=(e,t)=>{const i=e.length-1,o=[];let s,r=2===t?"<svg>":3===t?"<math>":"",l=P;for(let t=0;t<i;t++){const i=e[t];let n,a,d=-1,c=0;for(;c<i.length&&(l.lastIndex=c,a=l.exec(i),null!==a);)c=l.lastIndex,l===P?"!--"===a[1]?l=j:void 0!==a[1]?l=D:void 0!==a[2]?(F.test(a[2])&&(s=RegExp("</"+a[2],"g")),l=M):void 0!==a[3]&&(l=M):l===M?">"===a[0]?(l=s??P,d=-1):void 0===a[1]?d=-2:(d=l.lastIndex-a[2].length,n=a[1],l=void 0===a[3]?M:'"'===a[3]?B:H):l===B||l===H?l=M:l===j||l===D?l=P:(l=M,s=void 0);const h=l===M&&e[t+1].startsWith("/>")?" ":"";r+=l===P?i+T:d>=0?(o.push(n),i.slice(0,d)+C+i.slice(d)+S+h):i+S+(-2===d?t:h)}return[W(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class Y{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let s=0,r=0;const l=e.length-1,n=this.parts,[a,d]=X(e,t);if(this.el=Y.createElement(a,i),N.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=N.nextNode())&&n.length<l;){if(1===o.nodeType){if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(C)){const t=d[r++],i=o.getAttribute(e).split(S),l=/([.?@])?(.*)/.exec(t);n.push({type:1,index:s,name:l[2],strings:i,ctor:"."===l[1]?ee:"?"===l[1]?te:"@"===l[1]?ie:J}),o.removeAttribute(e)}else e.startsWith(S)&&(n.push({type:6,index:s}),o.removeAttribute(e));if(F.test(o.tagName)){const e=o.textContent.split(S),t=e.length-1;if(t>0){o.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],K()),N.nextNode(),n.push({type:2,index:++s});o.append(e[t],K())}}}else if(8===o.nodeType)if(o.data===z)n.push({type:2,index:s});else{let e=-1;for(;-1!==(e=o.data.indexOf(S,e+1));)n.push({type:7,index:s}),e+=S.length-1}s++}}static createElement(e,t){const i=E.createElement("template");return i.innerHTML=e,i}}function Z(e,t,i=e,o){if(t===V)return t;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=A(t)?void 0:t._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(e),s._$AT(e,i,o)),void 0!==o?(i._$Co??=[])[o]=s:i._$Cl=s),void 0!==s&&(t=Z(e,s._$AS(e,t.values),s,o)),t}class G{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){const{el:{content:t},parts:i}=this._$AD,o=(e?.creationScope??E).importNode(t,!0);N.currentNode=o;let s=N.nextNode(),r=0,l=0,n=i[0];for(;void 0!==n;){if(r===n.index){let t;2===n.type?t=new Q(s,s.nextSibling,this,e):1===n.type?t=new n.ctor(s,n.name,n.strings,this,e):6===n.type&&(t=new oe(s,this,e)),this._$AV.push(t),n=i[++l]}r!==n?.index&&(s=N.nextNode(),r++)}return N.currentNode=E,o}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Z(this,e,t),A(e)?e===q||null==e||""===e?(this._$AH!==q&&this._$AR(),this._$AH=q):e!==this._$AH&&e!==V&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>O(e)||"function"==typeof e?.[Symbol.iterator])(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!==q&&A(this._$AH)?this._$AA.nextSibling.data=e:this.T(E.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,o="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Y.createElement(W(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(t);else{const e=new G(o,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=U.get(e.strings);return void 0===t&&U.set(e.strings,t=new Y(e)),t}k(e){O(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const s of e)o===t.length?t.push(i=new Q(this.O(K()),this.O(K()),this,this.options)):i=t[o],i._$AI(s),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,s){this.type=1,this._$AH=q,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=q}_$AI(e,t=this,i,o){const s=this.strings;let r=!1;if(void 0===s)e=Z(this,e,t,0),r=!A(e)||e!==this._$AH&&e!==V,r&&(this._$AH=e);else{const o=e;let l,n;for(e=s[0],l=0;l<s.length-1;l++)n=Z(this,o[i+l],t,l),n===V&&(n=this._$AH[l]),r||=!A(n)||n!==this._$AH[l],n===q?e=q:e!==q&&(e+=(n??"")+s[l+1]),this._$AH[l]=n}r&&!o&&this.j(e)}j(e){e===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ee extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===q?void 0:e}}class te extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==q)}}class ie extends J{constructor(e,t,i,o,s){super(e,t,i,o,s),this.type=5}_$AI(e,t=this){if((e=Z(this,e,t,0)??q)===V)return;const i=this._$AH,o=e===q&&i!==q||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==q&&(i===q||o);o&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class oe{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){Z(this,e)}}const se=w.litHtmlPolyfillSupport;se?.(Y,Q),(w.litHtmlVersions??=[]).push("3.3.2");const re=globalThis;
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
- */let ne=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const o=i?.renderBefore??t;let s=o._$litPart$;if(void 0===s){const e=i?.renderBefore??null;o._$litPart$=s=new Y(t.insertBefore(E(),e),e,void 0,i??{})}return s._$AI(e),s})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};ne._$litElement$=!0,ne.finalized=!0,re.litElementHydrateSupport?.({LitElement:ne});const le=re.litElementPolyfillSupport;le?.({LitElement:ne}),(re.litElementVersions??=[]).push("4.2.2");const ae=n`
22
+ */let le=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const o=i?.renderBefore??t;let s=o._$litPart$;if(void 0===s){const e=i?.renderBefore??null;o._$litPart$=s=new Q(t.insertBefore(K(),e),e,void 0,i??{})}return s._$AI(e),s})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}};le._$litElement$=!0,le.finalized=!0,re.litElementHydrateSupport?.({LitElement:le});const ne=re.litElementPolyfillSupport;ne?.({LitElement:le}),(re.litElementVersions??=[]).push("4.2.2");const ae=l`
23
23
  :host,
24
24
  *,
25
25
  *::before,
@@ -56,7 +56,7 @@ const w=globalThis,$=w.trustedTypes,R=$?$.createPolicy("lit-html",{createHTML:e=
56
56
  * @license
57
57
  * Copyright 2017 Google LLC
58
58
  * SPDX-License-Identifier: BSD-3-Clause
59
- */,ce={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:x},he=(e=ce,t,i)=>{const{kind:o,metadata:s}=i;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),"setter"===o&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===o){const{name:o}=i;return{set(i){const s=t.get.call(this);t.set.call(this,i),this.requestUpdate(o,s,e,!0,i)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===o){const{name:o}=i;return function(i){const s=this[o];t.call(this,i),this.requestUpdate(o,s,e,!0,i)}}throw Error("Unsupported decorator location: "+o)};function pe(e){return(t,i)=>"object"==typeof i?he(e,t,i):((e,t,i)=>{const o=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),o?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)
59
+ */,ce={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:x},he=(e=ce,t,i)=>{const{kind:o,metadata:s}=i;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),"setter"===o&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===o){const{name:o}=i;return{set(i){const s=t.get.call(this);t.set.call(this,i),this.requestUpdate(o,s,e,!0,i)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===o){const{name:o}=i;return function(i){const s=this[o];t.call(this,i),this.requestUpdate(o,s,e,!0,i)}}throw Error("Unsupported decorator location: "+o)};function pe(e){return(t,i)=>"object"==typeof i?he(e,t,i):((e,t,i)=>{const o=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),o?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)
60
60
  /**
61
61
  * @license
62
62
  * Copyright 2017 Google LLC
@@ -72,7 +72,7 @@ const w=globalThis,$=w.trustedTypes,R=$?$.createPolicy("lit-html",{createHTML:e=
72
72
  * Copyright 2017 Google LLC
73
73
  * SPDX-License-Identifier: BSD-3-Clause
74
74
  */
75
- function ge(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}var fe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRAccordion=class extends ne{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return q`
75
+ function ge(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}var fe=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRAccordion=class extends le{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return I`
76
76
  <div class="header" @click=${this.toggle}>
77
77
  <span class="header__title">${this.header}</span>
78
78
  <svg class="header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
@@ -86,7 +86,7 @@ function ge(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
86
86
  </div>
87
87
  </div>
88
88
  </div>
89
- `}},e.KRAccordion.styles=n`
89
+ `}},e.KRAccordion.styles=l`
90
90
  :host {
91
91
  display: block;
92
92
  margin-bottom: 16px;
@@ -144,24 +144,24 @@ function ge(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
144
144
  * Copyright 2017 Google LLC
145
145
  * SPDX-License-Identifier: BSD-3-Clause
146
146
  */
147
- const be=1,ve=2,ye=3,me=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let _e=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};
147
+ const ve=1,be=2,me=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let _e=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};
148
148
  /**
149
149
  * @license
150
150
  * Copyright 2018 Google LLC
151
151
  * SPDX-License-Identifier: BSD-3-Clause
152
- */const ke=xe(class extends _e{constructor(e){if(super(e),e.type!==be||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const o=!!t[e];o===this.st.has(e)||this.nt?.has(e)||(o?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return H}});var we=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRAlert=class extends ne{constructor(){super(...arguments),this.type="info",this.title="",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}render(){const e={info:q`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:q`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:q`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:q`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return q`
152
+ */const ke=xe(class extends _e{constructor(e){if(super(e),e.type!==ve||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const o=!!t[e];o===this.st.has(e)||this.nt?.has(e)||(o?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return V}});var we=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRAlert=class extends le{constructor(){super(...arguments),this.type="info",this.title="",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}render(){const e={info:I`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:I`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:I`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:I`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return I`
153
153
  <div
154
154
  class=${ke({alert:!0,["alert--"+this.type]:!0,"alert--has-header":!!this.title,"alert--hidden":!this.visible})}
155
155
  role="alert"
156
156
  >
157
157
  ${e[this.type]}
158
158
  <div class="content">
159
- ${this.title?q`<h4 class="header">${this.title}</h4>`:V}
159
+ ${this.title?I`<h4 class="header">${this.title}</h4>`:q}
160
160
  <div class="message">
161
161
  <slot></slot>
162
162
  </div>
163
163
  </div>
164
- ${this.dismissible?q`
164
+ ${this.dismissible?I`
165
165
  <button
166
166
  class="dismiss"
167
167
  type="button"
@@ -172,9 +172,9 @@ const be=1,ve=2,ye=3,me=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let _e=cl
172
172
  <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
173
173
  </svg>
174
174
  </button>
175
- `:V}
175
+ `:q}
176
176
  </div>
177
- `}},e.KRAlert.styles=n`
177
+ `}},e.KRAlert.styles=l`
178
178
  :host {
179
179
  display: block;
180
180
  }
@@ -290,26 +290,26 @@ const be=1,ve=2,ye=3,me=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let _e=cl
290
290
  outline: 2px solid #3b82f6;
291
291
  outline-offset: 2px;
292
292
  }
293
- `,we([pe({type:String})],e.KRAlert.prototype,"type",void 0),we([pe({type:String})],e.KRAlert.prototype,"title",void 0),we([pe({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),we([pe({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=we([de("kr-alert")],e.KRAlert);var $e=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRButton=class extends ne{constructor(){super(...arguments),this.variant="flat",this.color="primary",this.size="medium",this.disabled=!1,this.options=[],this.iconPosition="left",this._state="idle",this._stateText="",this._dropdownOpened=!1,this._handleHostClick=e=>{this.options.length&&(e.stopPropagation(),this._toggleDropdown())},this._handleKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.options.length?this._toggleDropdown():this.click()),"Escape"===e.key&&this._dropdownOpened&&(this._dropdownOpened=!1)},this._handleClickOutside=e=>{this._dropdownOpened&&!this.contains(e.target)&&(this._dropdownOpened=!1)}}connectedCallback(){super.connectedCallback(),this.setAttribute("role",this.href?"link":"button"),this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeydown),this.addEventListener("click",this._handleHostClick),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown),this.removeEventListener("click",this._handleHostClick),document.removeEventListener("click",this._handleClickOutside)}_toggleDropdown(){this._dropdownOpened=!this._dropdownOpened,this._dropdownOpened&&requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(e){const t=this.getBoundingClientRect();e.style.top=t.bottom+4+"px",e.style.left=t.left+"px",e.style.minWidth=t.width+"px";e.getBoundingClientRect().right>window.innerWidth&&(e.style.left="",e.style.right=window.innerWidth-t.right+"px")}}))}_handleOptionClick(e,t){t.stopPropagation(),this._dropdownOpened=!1,this.dispatchEvent(new CustomEvent("option-select",{detail:{id:e.id,label:e.label},bubbles:!0,composed:!0}))}showLoading(){this._clearStateTimeout(),this._state="loading",this._stateText=""}showSuccess(e="Success",t=2e3){this._clearStateTimeout(),this._state="success",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}showError(e="Error",t=2e3){this._clearStateTimeout(),this._state="error",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}reset(){this._clearStateTimeout(),this._state="idle",this._stateText=""}_clearStateTimeout(){this._stateTimeout&&(clearTimeout(this._stateTimeout),this._stateTimeout=void 0)}updated(e){this.classList.toggle("kr-button--loading","loading"===this._state),this.classList.toggle("kr-button--success","success"===this._state),this.classList.toggle("kr-button--error","error"===this._state),this.classList.toggle(`kr-button--${this.variant}`,!0),this.classList.toggle(`kr-button--${this.color}`,!0),this.classList.toggle("kr-button--small","small"===this.size),this.classList.toggle("kr-button--large","large"===this.size)}render(){const e=q`
293
+ `,we([pe({type:String})],e.KRAlert.prototype,"type",void 0),we([pe({type:String})],e.KRAlert.prototype,"title",void 0),we([pe({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),we([pe({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=we([de("kr-alert")],e.KRAlert);var $e=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRButton=class extends le{constructor(){super(...arguments),this.variant="flat",this.color="primary",this.size="medium",this.disabled=!1,this.options=[],this.iconPosition="left",this._state="idle",this._stateText="",this._dropdownOpened=!1,this._handleHostClick=e=>{this.options.length&&(e.stopPropagation(),this._toggleDropdown())},this._handleKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.options.length?this._toggleDropdown():this.click()),"Escape"===e.key&&this._dropdownOpened&&(this._dropdownOpened=!1)},this._handleClickOutside=e=>{this._dropdownOpened&&!this.contains(e.target)&&(this._dropdownOpened=!1)}}connectedCallback(){super.connectedCallback(),this.setAttribute("role",this.href?"link":"button"),this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeydown),this.addEventListener("click",this._handleHostClick),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown),this.removeEventListener("click",this._handleHostClick),document.removeEventListener("click",this._handleClickOutside)}_toggleDropdown(){this._dropdownOpened=!this._dropdownOpened,this._dropdownOpened&&requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(e){const t=this.getBoundingClientRect();e.style.top=t.bottom+4+"px",e.style.left=t.left+"px",e.style.minWidth=t.width+"px";e.getBoundingClientRect().right>window.innerWidth&&(e.style.left="",e.style.right=window.innerWidth-t.right+"px")}}))}_handleOptionClick(e,t){t.stopPropagation(),this._dropdownOpened=!1,this.dispatchEvent(new CustomEvent("option-select",{detail:{id:e.id,label:e.label},bubbles:!0,composed:!0}))}showLoading(){this._clearStateTimeout(),this._state="loading",this._stateText=""}showSuccess(e="Success",t=2e3){this._clearStateTimeout(),this._state="success",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}showError(e="Error",t=2e3){this._clearStateTimeout(),this._state="error",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}reset(){this._clearStateTimeout(),this._state="idle",this._stateText=""}_clearStateTimeout(){this._stateTimeout&&(clearTimeout(this._stateTimeout),this._stateTimeout=void 0)}updated(e){this.classList.toggle("kr-button--loading","loading"===this._state),this.classList.toggle("kr-button--success","success"===this._state),this.classList.toggle("kr-button--error","error"===this._state),this.classList.toggle(`kr-button--${this.variant}`,!0),this.classList.toggle(`kr-button--${this.color}`,!0),this.classList.toggle("kr-button--small","small"===this.size),this.classList.toggle("kr-button--large","large"===this.size)}render(){const e=I`
294
294
  <span class="content">
295
295
  <slot name="icon"></slot>
296
296
  <slot></slot>
297
297
  </span>
298
- ${this.options.length?q`<svg class="caret" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 24 24" fill="currentColor"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>`:V}
299
- ${"idle"!==this._state?q`<span class="state-overlay">
300
- ${"loading"===this._state?q`<span class="spinner"></span>`:this._stateText}
301
- </span>`:V}
302
- ${this.options.length?q`
298
+ ${this.options.length?I`<svg class="caret" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 24 24" fill="currentColor"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>`:q}
299
+ ${"idle"!==this._state?I`<span class="state-overlay">
300
+ ${"loading"===this._state?I`<span class="spinner"></span>`:this._stateText}
301
+ </span>`:q}
302
+ ${this.options.length?I`
303
303
  <div class="dropdown ${this._dropdownOpened?"dropdown--opened":""}">
304
- ${this.options.map((e=>q`
304
+ ${this.options.map((e=>I`
305
305
  <button
306
306
  class="dropdown-item"
307
307
  @click=${t=>this._handleOptionClick(e,t)}
308
308
  >${e.label}</button>
309
309
  `))}
310
310
  </div>
311
- `:V}
312
- `;return this.href?q`<a class="link" href=${this.href} target=${this.target||V}>${e}</a>`:e}},e.KRButton.styles=n`
311
+ `:q}
312
+ `;return this.href?I`<a class="link" href=${this.href} target=${this.target||q}>${e}</a>`:e}},e.KRButton.styles=l`
313
313
  :host {
314
314
  display: inline-flex;
315
315
  position: relative;
@@ -570,7 +570,7 @@ const be=1,ve=2,ye=3,me=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let _e=cl
570
570
  * Copyright 2017 Google LLC
571
571
  * SPDX-License-Identifier: BSD-3-Clause
572
572
  */
573
- class Re extends _e{constructor(e){if(super(e),this.it=V,e.type!==ve)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===V||null==e)return this._t=void 0,this.it=e;if(e===H)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Re.directiveName="unsafeHTML",Re.resultType=1;const Se=xe(Re);var Ce=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRCodeDemo=class extends ne{constructor(){super(...arguments),this.language="html",this.code="",this.activeTab="preview",this.copied=!1,this.highlightedCode=""}connectedCallback(){super.connectedCallback(),requestAnimationFrame((()=>{this.code||(this.code=this.innerHTML.trim().replace(/=""(?=[\s>])/g,"")),this.querySelectorAll("script").forEach((e=>{const t=document.createElement("script");t.textContent=e.textContent,e.replaceWith(t)})),this.code&&window.hljs&&window.hljs.getLanguage(this.language)?this.highlightedCode=window.hljs.highlight(this.code,{language:this.language}).value:this.highlightedCode=this.code.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}))}activateTab(e){this.activeTab=e}copyCode(){this.code&&navigator.clipboard.writeText(this.code).then((()=>{this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}))}render(){return q`
573
+ class Re extends _e{constructor(e){if(super(e),this.it=q,e.type!==be)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===q||null==e)return this._t=void 0,this.it=e;if(e===V)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Re.directiveName="unsafeHTML",Re.resultType=1;const Ce=xe(Re);var Se=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRCodeDemo=class extends le{constructor(){super(...arguments),this.language="html",this.code="",this.activeTab="preview",this.copied=!1,this.highlightedCode=""}connectedCallback(){super.connectedCallback(),requestAnimationFrame((()=>{this.code||(this.code=this.innerHTML.trim().replace(/=""(?=[\s>])/g,"")),this.querySelectorAll("script").forEach((e=>{const t=document.createElement("script");t.textContent=e.textContent,e.replaceWith(t)})),this.code&&window.hljs&&window.hljs.getLanguage(this.language)?this.highlightedCode=window.hljs.highlight(this.code,{language:this.language}).value:this.highlightedCode=this.code.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}))}activateTab(e){this.activeTab=e}copyCode(){this.code&&navigator.clipboard.writeText(this.code).then((()=>{this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}))}render(){return I`
574
574
  <div class="tabs">
575
575
  <button
576
576
  class=${ke({tab:!0,"tab--active":"preview"===this.activeTab})}
@@ -589,7 +589,7 @@ class Re extends _e{constructor(e){if(super(e),this.it=V,e.type!==ve)throw Error
589
589
  @click=${this.copyCode}
590
590
  title=${this.copied?"Copied!":"Copy code"}
591
591
  >
592
- ${this.copied?q`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>`:q`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>`}
592
+ ${this.copied?I`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>`:I`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>`}
593
593
  </button>
594
594
  </div>
595
595
 
@@ -598,10 +598,10 @@ class Re extends _e{constructor(e){if(super(e),this.it=V,e.type!==ve)throw Error
598
598
  </div>
599
599
 
600
600
  <div class=${ke({panel:!0,"panel--active":"code"===this.activeTab,"panel--code":!0})}>
601
- <pre class="code"><code>${Se(this.highlightedCode)}</code></pre>
601
+ <pre class="code"><code>${Ce(this.highlightedCode)}</code></pre>
602
602
  </div>
603
603
 
604
- `}},e.KRCodeDemo.styles=[ae,n`
604
+ `}},e.KRCodeDemo.styles=[ae,l`
605
605
  :host {
606
606
  display: block;
607
607
  border: 1px solid #d5dbdb;
@@ -723,20 +723,20 @@ class Re extends _e{constructor(e){if(super(e),this.it=V,e.type!==ve)throw Error
723
723
  .hljs-attribute { color: #005cc5; }
724
724
  .hljs-property { color: #005cc5; }
725
725
 
726
- `],Ce([pe({type:String})],e.KRCodeDemo.prototype,"language",void 0),Ce([ue()],e.KRCodeDemo.prototype,"code",void 0),Ce([ue()],e.KRCodeDemo.prototype,"activeTab",void 0),Ce([ue()],e.KRCodeDemo.prototype,"copied",void 0),Ce([ue()],e.KRCodeDemo.prototype,"highlightedCode",void 0),e.KRCodeDemo=Ce([de("kr-code-demo")],e.KRCodeDemo);var Te=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRContextMenu=class extends ne{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(e){const t=document.querySelector("kr-context-menu");t&&t.remove();const i=document.createElement("kr-context-menu");return document.body.appendChild(i),i.show(e)}async show(e){this.items=e.items,this.style.left=`${e.x}px`,this.style.top=`${e.y}px`,await this.updateComplete;const t=this.getBoundingClientRect();return t.right>window.innerWidth&&(this.style.left=e.x-t.width+"px"),t.bottom>window.innerHeight&&(this.style.top=e.y-t.height+"px"),requestAnimationFrame((()=>{document.addEventListener("click",this.boundHandleOutsideClick),document.addEventListener("contextmenu",this.boundHandleOutsideClick),document.addEventListener("keydown",this.boundHandleKeyDown)})),new Promise((e=>{this.resolvePromise=e}))}handleOutsideClick(e){this.contains(e.target)||this.close(null)}handleKeyDown(e){"Escape"===e.key&&this.close(null)}handleItemClick(e){e.disabled||e.divider||this.close(e)}close(e){document.removeEventListener("click",this.boundHandleOutsideClick),document.removeEventListener("contextmenu",this.boundHandleOutsideClick),document.removeEventListener("keydown",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.remove()}render(){return q`
726
+ `],Se([pe({type:String})],e.KRCodeDemo.prototype,"language",void 0),Se([ue()],e.KRCodeDemo.prototype,"code",void 0),Se([ue()],e.KRCodeDemo.prototype,"activeTab",void 0),Se([ue()],e.KRCodeDemo.prototype,"copied",void 0),Se([ue()],e.KRCodeDemo.prototype,"highlightedCode",void 0),e.KRCodeDemo=Se([de("kr-code-demo")],e.KRCodeDemo);var ze=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRContextMenu=class extends le{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(e){const t=document.querySelector("kr-context-menu");t&&t.remove();const i=document.createElement("kr-context-menu");return document.body.appendChild(i),i.show(e)}async show(e){this.items=e.items,this.style.left=`${e.x}px`,this.style.top=`${e.y}px`,await this.updateComplete;const t=this.getBoundingClientRect();return t.right>window.innerWidth&&(this.style.left=e.x-t.width+"px"),t.bottom>window.innerHeight&&(this.style.top=e.y-t.height+"px"),requestAnimationFrame((()=>{document.addEventListener("click",this.boundHandleOutsideClick),document.addEventListener("contextmenu",this.boundHandleOutsideClick),document.addEventListener("keydown",this.boundHandleKeyDown)})),new Promise((e=>{this.resolvePromise=e}))}handleOutsideClick(e){this.contains(e.target)||this.close(null)}handleKeyDown(e){"Escape"===e.key&&this.close(null)}handleItemClick(e){e.disabled||e.divider||this.close(e)}close(e){document.removeEventListener("click",this.boundHandleOutsideClick),document.removeEventListener("contextmenu",this.boundHandleOutsideClick),document.removeEventListener("keydown",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.remove()}render(){return I`
727
727
  <div class="menu">
728
- ${this.items.map((e=>e.divider?q`<div class="menu__divider"></div>`:q`
728
+ ${this.items.map((e=>e.divider?I`<div class="menu__divider"></div>`:I`
729
729
  <button
730
730
  class="menu__item"
731
731
  ?disabled=${e.disabled}
732
732
  @click=${()=>this.handleItemClick(e)}
733
733
  >
734
- ${e.icon?q`<span class="menu__item-icon">${e.icon}</span>`:null}
734
+ ${e.icon?I`<span class="menu__item-icon">${e.icon}</span>`:null}
735
735
  ${e.label}
736
736
  </button>
737
737
  `))}
738
738
  </div>
739
- `}},e.KRContextMenu.styles=n`
739
+ `}},e.KRContextMenu.styles=l`
740
740
  :host {
741
741
  position: fixed;
742
742
  z-index: 10000;
@@ -791,13 +791,13 @@ class Re extends _e{constructor(e){if(super(e),this.it=V,e.type!==ve)throw Error
791
791
  background: rgba(255, 255, 255, 0.1);
792
792
  margin: 4px 0;
793
793
  }
794
- `,Te([ue()],e.KRContextMenu.prototype,"items",void 0),e.KRContextMenu=Te([de("kr-context-menu")],e.KRContextMenu);
794
+ `,ze([ue()],e.KRContextMenu.prototype,"items",void 0),e.KRContextMenu=ze([de("kr-context-menu")],e.KRContextMenu);
795
795
  /**
796
796
  * @license
797
797
  * Copyright 2018 Google LLC
798
798
  * SPDX-License-Identifier: BSD-3-Clause
799
799
  */
800
- const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e),e.type!==be||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const o=e[i];return null==o?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const o=t[e];if(null!=o){this.ft.add(e);const t="string"==typeof o&&o.endsWith(Ke);e.includes("-")||t?i.setProperty(e,t?o.slice(0,-11):o,t?Ae:""):i[e]=o}}return H}});var Oe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ze=class extends ne{render(){return q`<slot></slot>`}};ze.styles=n`
800
+ const Te="important",Ee=" !"+Te,Ke=xe(class extends _e{constructor(e){if(super(e),e.type!==ve||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const o=e[i];return null==o?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const o=t[e];if(null!=o){this.ft.add(e);const t="string"==typeof o&&o.endsWith(Ee);e.includes("-")||t?i.setProperty(e,t?o.slice(0,-11):o,t?Te:""):i[e]=o}}return V}});var Ae=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};let Oe=class extends le{render(){return I`<slot></slot>`}};Oe.styles=l`
801
801
  :host {
802
802
  display: flex;
803
803
  padding: 0 24px;
@@ -812,14 +812,14 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
812
812
  font-size: 18px;
813
813
  font-weight: 600;
814
814
  }
815
- `,ze=Oe([de("kr-dialog-header")],ze);let Pe=class extends ne{render(){return q`<slot></slot>`}};Pe.styles=n`
815
+ `,Oe=Ae([de("kr-dialog-header")],Oe);let Le=class extends le{render(){return I`<slot></slot>`}};Le.styles=l`
816
816
  :host {
817
817
  display: block;
818
818
  padding: 24px;
819
819
  overflow: auto;
820
820
  flex: 1 1 auto;
821
821
  }
822
- `,Pe=Oe([de("kr-dialog-content")],Pe);let Le=class extends ne{render(){return q`<slot></slot>`}};Le.styles=n`
822
+ `,Le=Ae([de("kr-dialog-content")],Le);let Pe=class extends le{render(){return I`<slot></slot>`}};Pe.styles=l`
823
823
  :host {
824
824
  display: flex;
825
825
  padding: 0 24px;
@@ -830,13 +830,13 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
830
830
  gap: 12px;
831
831
  justify-content: flex-end;
832
832
  }
833
- `,Le=Oe([de("kr-dialog-footer")],Le);class De{constructor(){this._resolvePromise=null,this._dialogElement=null,this._promise=new Promise((e=>{this._resolvePromise=e}))}setDialogElement(e){this._dialogElement=e}close(e){this._resolvePromise&&(this._resolvePromise(e),this._resolvePromise=null),this._dialogElement?.remove()}afterClosed(){return this._promise}}e.KRDialog=class extends ne{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label="",this.width="560px",this._handleDocumentKeyDown=e=>{"Escape"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has("opened")&&(this.opened?document.addEventListener("keydown",this._handleDocumentKeyDown):document.removeEventListener("keydown",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll("kr-dialog").forEach((e=>{e._dialogRef&&e.remove()}));const i=new De,o=document.createElement("kr-dialog");i.setDialogElement(o),o._dialogRef=i;const s=new e;return s.dialogRef=i,t?.data&&(s.data=t.data),t?.label&&(o.label=t.label),t?.width&&(o.width=t.width),o._contentElement=s,o.opened=!0,document.body.appendChild(o),i}_handleBackdropClick(e){e.target.classList.contains("backdrop")&&this.close()}render(){return q`
833
+ `,Pe=Ae([de("kr-dialog-footer")],Pe);class je{constructor(){this._resolvePromise=null,this._dialogElement=null,this._promise=new Promise((e=>{this._resolvePromise=e}))}setDialogElement(e){this._dialogElement=e}close(e){this._resolvePromise&&(this._resolvePromise(e),this._resolvePromise=null),this._dialogElement?.remove()}afterClosed(){return this._promise}}e.KRDialog=class extends le{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label="",this.width="560px",this._handleDocumentKeyDown=e=>{"Escape"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has("opened")&&(this.opened?document.addEventListener("keydown",this._handleDocumentKeyDown):document.removeEventListener("keydown",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll("kr-dialog").forEach((e=>{e._dialogRef&&e.remove()}));const i=new je,o=document.createElement("kr-dialog");i.setDialogElement(o),o._dialogRef=i;const s=new e;return s.dialogRef=i,t?.data&&(s.data=t.data),t?.label&&(o.label=t.label),t?.width&&(o.width=t.width),o._contentElement=s,o.opened=!0,document.body.appendChild(o),i}_handleBackdropClick(e){e.target.classList.contains("backdrop")&&this.close()}render(){return I`
834
834
  <div class="backdrop" @click=${this._handleBackdropClick}></div>
835
- <div class="dialog" style=${Ee({width:this.width})}>
836
- ${this.label?q`<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>`:""}
837
- ${this._contentElement?this._contentElement:q`<slot></slot>`}
835
+ <div class="dialog" style=${Ke({width:this.width})}>
836
+ ${this.label?I`<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>`:""}
837
+ ${this._contentElement?this._contentElement:I`<slot></slot>`}
838
838
  </div>
839
- `}},e.KRDialog.styles=n`
839
+ `}},e.KRDialog.styles=l`
840
840
  :host {
841
841
  position: fixed;
842
842
  inset: 0;
@@ -894,10 +894,10 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
894
894
  font-size: 18px;
895
895
  font-weight: 600;
896
896
  }
897
- `,Oe([ue()],e.KRDialog.prototype,"_contentElement",void 0),Oe([pe({type:Boolean,reflect:!0})],e.KRDialog.prototype,"opened",void 0),Oe([pe({type:String})],e.KRDialog.prototype,"label",void 0),Oe([pe({type:String})],e.KRDialog.prototype,"width",void 0),e.KRDialog=Oe([de("kr-dialog")],e.KRDialog);var je,Me=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRSnackbar=je=class extends ne{constructor(){super(...arguments),this.dismissTimeout=null,this.type="info",this.title="",this.message="",this.duration=5e3}static show(e){for(const e of this.activeSnackbars)e.dismiss();const t=document.createElement("kr-snackbar");return t.message=e.message,t.title=e.title??"",t.type=e.type??"info",void 0!==e.duration?t.duration=e.duration:"error"===t.type?t.duration=0:t.duration=5e3,document.body.appendChild(t),t}connectedCallback(){super.connectedCallback(),this.setAttribute("role","alert"),this.classList.add(`kr-snackbar--${this.type}`),this.title&&this.classList.add("kr-snackbar--has-title"),je.activeSnackbars.push(this),this.duration>0&&(this.dismissTimeout=window.setTimeout((()=>{this.dismiss()}),this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=je.activeSnackbars.indexOf(this);e>-1&&je.activeSnackbars.splice(e,1),this.dismissTimeout&&clearTimeout(this.dismissTimeout)}dismiss(){this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.classList.add("kr-snackbar--closing"),this.addEventListener("animationend",(()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0})),this.remove()}),{once:!0})}render(){const e={info:q`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:q`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:q`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:q`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return q`
897
+ `,Ae([ue()],e.KRDialog.prototype,"_contentElement",void 0),Ae([pe({type:Boolean,reflect:!0})],e.KRDialog.prototype,"opened",void 0),Ae([pe({type:String})],e.KRDialog.prototype,"label",void 0),Ae([pe({type:String})],e.KRDialog.prototype,"width",void 0),e.KRDialog=Ae([de("kr-dialog")],e.KRDialog);var De,Me=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRSnackbar=De=class extends le{constructor(){super(...arguments),this.dismissTimeout=null,this.type="info",this.title="",this.message="",this.duration=5e3}static show(e){for(const e of this.activeSnackbars)e.dismiss();const t=document.createElement("kr-snackbar");return t.message=e.message,t.title=e.title??"",t.type=e.type??"info",void 0!==e.duration?t.duration=e.duration:"error"===t.type?t.duration=0:t.duration=5e3,document.body.appendChild(t),t}connectedCallback(){super.connectedCallback(),this.setAttribute("role","alert"),this.classList.add(`kr-snackbar--${this.type}`),this.title&&this.classList.add("kr-snackbar--has-title"),De.activeSnackbars.push(this),this.duration>0&&(this.dismissTimeout=window.setTimeout((()=>{this.dismiss()}),this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=De.activeSnackbars.indexOf(this);e>-1&&De.activeSnackbars.splice(e,1),this.dismissTimeout&&clearTimeout(this.dismissTimeout)}dismiss(){this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.classList.add("kr-snackbar--closing"),this.addEventListener("animationend",(()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0})),this.remove()}),{once:!0})}render(){const e={info:I`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:I`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:I`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:I`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return I`
898
898
  ${e[this.type]}
899
899
  <div class="content">
900
- ${this.title?q`<div class="title">${this.title}</div>`:""}
900
+ ${this.title?I`<div class="title">${this.title}</div>`:""}
901
901
  <div class="message">${this.message}</div>
902
902
  </div>
903
903
  <button
@@ -910,7 +910,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
910
910
  <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
911
911
  </svg>
912
912
  </button>
913
- `}},e.KRSnackbar.styles=n`
913
+ `}},e.KRSnackbar.styles=l`
914
914
  :host,
915
915
  *,
916
916
  *::before,
@@ -1058,9 +1058,9 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1058
1058
  outline: 2px solid #3b82f6;
1059
1059
  outline-offset: 2px;
1060
1060
  }
1061
- `,e.KRSnackbar.activeSnackbars=[],Me([pe({type:String})],e.KRSnackbar.prototype,"type",void 0),Me([pe({type:String})],e.KRSnackbar.prototype,"title",void 0),Me([pe({type:String})],e.KRSnackbar.prototype,"message",void 0),Me([pe({type:Number})],e.KRSnackbar.prototype,"duration",void 0),e.KRSnackbar=je=Me([de("kr-snackbar")],e.KRSnackbar);var Ie=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRTabGroup=class extends ne{constructor(){super(...arguments),this.justified=!1,this.size="medium"}updated(e){e.has("activeTabId")&&this._updateActiveTab()}firstUpdated(){this._updateActiveTab()}_getTabs(){return Array.from(this.querySelectorAll("kr-tab"))}_updateActiveTab(){const e=this._getTabs();0!==e.length&&(this.activeTabId||(this.activeTabId=e[0]?.id),e.forEach((e=>{e.active=e.id===this.activeTabId})),this.requestUpdate())}_handleTabClick(e){e.disabled||(this.activeTabId=e.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:e.id},bubbles:!0,composed:!0})))}_handleTabDismiss(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("tab-dismiss",{detail:{tabId:e.id},bubbles:!0,composed:!0}))}_handleKeyDown(e){const t=this._getTabs().filter((e=>!e.disabled)),i=t.findIndex((e=>e.id===this.activeTabId));let o=-1;switch(e.key){case"ArrowLeft":o=i>0?i-1:t.length-1;break;case"ArrowRight":o=i<t.length-1?i+1:0;break;case"Home":o=0;break;case"End":o=t.length-1}if(o>=0){e.preventDefault();const i=t[o];this.activeTabId=i.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:i.id},bubbles:!0,composed:!0}));const s=this.shadowRoot?.querySelectorAll(".label"),r=Array.from(s||[]).find((e=>e.getAttribute("data-tab-id")===i.id));r?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return V;const i=t.cloneNode(!0);return i.removeAttribute("slot"),q`<span class="label-icon">${i}</span>`}render(){return q`
1061
+ `,e.KRSnackbar.activeSnackbars=[],Me([pe({type:String})],e.KRSnackbar.prototype,"type",void 0),Me([pe({type:String})],e.KRSnackbar.prototype,"title",void 0),Me([pe({type:String})],e.KRSnackbar.prototype,"message",void 0),Me([pe({type:Number})],e.KRSnackbar.prototype,"duration",void 0),e.KRSnackbar=De=Me([de("kr-snackbar")],e.KRSnackbar);var He=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRTabGroup=class extends le{constructor(){super(...arguments),this.justified=!1,this.size="medium"}updated(e){e.has("activeTabId")&&this._updateActiveTab()}firstUpdated(){this._updateActiveTab()}_getTabs(){return Array.from(this.querySelectorAll("kr-tab"))}_updateActiveTab(){const e=this._getTabs();0!==e.length&&(this.activeTabId||(this.activeTabId=e[0]?.id),e.forEach((e=>{e.active=e.id===this.activeTabId})),this.requestUpdate())}_handleTabClick(e){e.disabled||(this.activeTabId=e.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:e.id},bubbles:!0,composed:!0})))}_handleTabDismiss(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("tab-dismiss",{detail:{tabId:e.id},bubbles:!0,composed:!0}))}_handleKeyDown(e){const t=this._getTabs().filter((e=>!e.disabled)),i=t.findIndex((e=>e.id===this.activeTabId));let o=-1;switch(e.key){case"ArrowLeft":o=i>0?i-1:t.length-1;break;case"ArrowRight":o=i<t.length-1?i+1:0;break;case"Home":o=0;break;case"End":o=t.length-1}if(o>=0){e.preventDefault();const i=t[o];this.activeTabId=i.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:i.id},bubbles:!0,composed:!0}));const s=this.shadowRoot?.querySelectorAll(".label"),r=Array.from(s||[]).find((e=>e.getAttribute("data-tab-id")===i.id));r?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return q;const i=t.cloneNode(!0);return i.removeAttribute("slot"),I`<span class="label-icon">${i}</span>`}render(){return I`
1062
1062
  <div class="header" role="tablist" @keydown=${this._handleKeyDown}>
1063
- ${this._getTabs().map((e=>q`
1063
+ ${this._getTabs().map((e=>I`
1064
1064
  <button
1065
1065
  class=${ke({label:!0,"label--active":e.id===this.activeTabId,"label--justified":this.justified})}
1066
1066
  role="tab"
@@ -1073,8 +1073,8 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1073
1073
  >
1074
1074
  ${this._renderTabIcon(e)}
1075
1075
  <span>${e.label}</span>
1076
- ${e.badge?q`<span class="label-badge" style=${Ee({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:V}
1077
- ${e.dismissible?q`
1076
+ ${e.badge?I`<span class="label-badge" style=${Ke({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:q}
1077
+ ${e.dismissible?I`
1078
1078
  <button
1079
1079
  class="label-dismiss"
1080
1080
  type="button"
@@ -1083,14 +1083,14 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1083
1083
  >
1084
1084
  <svg viewBox="0 0 20 20" fill="currentColor" width="12" height="12"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>
1085
1085
  </button>
1086
- `:V}
1086
+ `:q}
1087
1087
  </button>
1088
1088
  `))}
1089
1089
  </div>
1090
1090
  <div class="content" role="tabpanel" aria-labelledby=${this.activeTabId||""}>
1091
1091
  <slot @slotchange=${this._updateActiveTab}></slot>
1092
1092
  </div>
1093
- `}},e.KRTabGroup.styles=[ae,n`
1093
+ `}},e.KRTabGroup.styles=[ae,l`
1094
1094
  :host {
1095
1095
  display: flex;
1096
1096
  flex-direction: column;
@@ -1223,7 +1223,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1223
1223
  ::slotted(kr-tab[active]) {
1224
1224
  display: block;
1225
1225
  }
1226
- `],Ie([pe({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),Ie([pe({type:Boolean})],e.KRTabGroup.prototype,"justified",void 0),Ie([pe({type:String,reflect:!0})],e.KRTabGroup.prototype,"size",void 0),e.KRTabGroup=Ie([de("kr-tab-group")],e.KRTabGroup);var Be=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRTab=class extends ne{constructor(){super(...arguments),this.id="",this.label="",this.badge="",this.badgeBackground="",this.badgeColor="",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot="icon"]')}render(){return console.log("tab render"),q`<slot></slot>`}},e.KRTab.styles=[ae,n`
1226
+ `],He([pe({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),He([pe({type:Boolean})],e.KRTabGroup.prototype,"justified",void 0),He([pe({type:String,reflect:!0})],e.KRTabGroup.prototype,"size",void 0),e.KRTabGroup=He([de("kr-tab-group")],e.KRTabGroup);var Be=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRTab=class extends le{constructor(){super(...arguments),this.id="",this.label="",this.badge="",this.badgeBackground="",this.badgeColor="",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot="icon"]')}render(){return console.log("tab render"),I`<slot></slot>`}},e.KRTab.styles=[ae,l`
1227
1227
  :host {
1228
1228
  display: none;
1229
1229
  }
@@ -1233,7 +1233,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1233
1233
  width: 100%;
1234
1234
  height: 100%;
1235
1235
  }
1236
- `],Be([pe({type:String,reflect:!0})],e.KRTab.prototype,"id",void 0),Be([pe({type:String})],e.KRTab.prototype,"label",void 0),Be([pe({type:String})],e.KRTab.prototype,"badge",void 0),Be([pe({type:String,attribute:"badge-background"})],e.KRTab.prototype,"badgeBackground",void 0),Be([pe({type:String,attribute:"badge-color"})],e.KRTab.prototype,"badgeColor",void 0),Be([pe({type:Boolean})],e.KRTab.prototype,"disabled",void 0),Be([pe({type:Boolean})],e.KRTab.prototype,"dismissible",void 0),Be([pe({type:Boolean,reflect:!0})],e.KRTab.prototype,"active",void 0),e.KRTab=Be([de("kr-tab")],e.KRTab);var Fe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const qe=['"',"+","-","&&","||","!","(",")","{","}","[","]","^","~","*","?",":"],He=['\\"',"\\+","\\-","\\&\\&","\\|\\|","\\!","\\(","\\)","\\{","\\}","\\[","\\]","\\^","\\~","\\*","\\?","\\:"];function Ve(e){let t=e;for(let e=0;e<qe.length;e++)t=t.split(qe[e]).join(He[e]);return t}e.KRTable=class extends ne{constructor(){super(...arguments),this._scrollStyle="overlay",this._data=[],this._dataState="idle",this._page=1,this._pageSize=50,this._totalItems=0,this._totalPages=0,this._searchQuery="",this._canScrollLeft=!1,this._canScrollRight=!1,this._canScrollHorizontal=!1,this._columnPickerOpen=!1,this._displayedColumns=[],this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._def={columns:[]},this.def={columns:[]},this._handleClickOutsideColumnPicker=e=>{if(!this._columnPickerOpen)return;const t=e.composedPath(),i=this.shadowRoot?.querySelector(".column-picker-wrapper");i&&!t.includes(i)&&(this._columnPickerOpen=!1)},this._handleResizeMove=e=>{if(!this._resizing)return;const t=this._def.columns.find((e=>e.id===this._resizing.columnId));if(t){const i=this._resizing.startWidth+(e.clientX-this._resizing.startX);t.width=`${Math.min(900,Math.max(50,i))}px`,this.requestUpdate()}},this._handleResizeEnd=()=>{this._resizing=null,document.removeEventListener("mousemove",this._handleResizeMove),document.removeEventListener("mouseup",this._handleResizeEnd)}}connectedCallback(){super.connectedCallback(),this.classList.toggle("kr-table--scroll-overlay","overlay"===this._scrollStyle),this.classList.toggle("kr-table--scroll-edge","edge"===this._scrollStyle),this._fetch(),this._initRefresh(),document.addEventListener("click",this._handleClickOutsideColumnPicker),this._resizeObserver=new ResizeObserver((()=>{this._searchPositionLocked=!1,this._updateSearchPosition()})),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this._refreshTimer),document.removeEventListener("click",this._handleClickOutsideColumnPicker),this._resizeObserver?.disconnect()}willUpdate(e){e.has("def")&&(this._def={...this.def,columns:this.def.columns.map((e=>"actions"===e.type?{...e,label:e.label??"",sticky:"right",resizable:!1}:{...e}))},this._displayedColumns=this._def.displayedColumns||this._def.columns.map((e=>e.id)),this._fetch(),this._initRefresh())}updated(e){this._updateScrollFlags(),this._syncSlottedContent()}_syncSlottedContent(){const e=this.getDisplayedColumns().filter((e=>e.render));e.length&&(this.querySelectorAll('[slot^="cell-"]').forEach((e=>e.remove())),this._data.forEach(((t,i)=>{e.forEach((e=>{const o=e.render(t),s="string"==typeof o?o:"";if(s){const t=document.createElement("span");t.slot=`cell-${i}-${e.id}`,"actions"===e.type&&(t.style.display="flex",t.style.gap="8px"),t.innerHTML=s,this.appendChild(t)}}))})))}refresh(){this._fetch()}goToPrevPage(){this._page>1&&(this._page--,this._fetch())}goToNextPage(){this._page<this._totalPages&&(this._page++,this._fetch())}goToPage(e){e>=1&&e<=this._totalPages&&(this._page=e,this._fetch())}_fetch(){if(!this._def.dataSource)return;let t;switch(this._dataState="loading",this._def.dataSource.mode){case"opensearch":throw Error("Opensearch not supported yet");case"db":t={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]},this._searchQuery?.trim().length&&this._def.columns.filter((e=>e.searchable)).forEach((e=>{t.queryFields.push({name:e.id,operation:"CONTAINS",value:this._searchQuery,and:!1})}));break;default:t={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]},this._searchQuery?.trim().length&&t.queryFields.push({name:"_text_",operation:"IS",value:Ve(this._searchQuery)})}this._def.dataSource.fetch(t).then((e=>{switch(this._def.dataSource?.mode){case"opensearch":throw Error("Opensearch not supported yet");case"db":{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size;break}default:{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size}}this._dataState="success",this._updateSearchPosition()})).catch((t=>{this._dataState="error",e.KRSnackbar.show({message:t instanceof Error?t.message:"Failed to load data",type:"error"})}))}_initRefresh(){clearInterval(this._refreshTimer),this._def.refreshInterval&&this._def.refreshInterval>0&&(this._refreshTimer=window.setInterval((()=>{this._fetch()}),this._def.refreshInterval))}_handleSearch(e){const t=e.target;this._searchQuery=t.value,this._page=1,this._fetch()}_getGridTemplateColumns(){return this.getDisplayedColumns().map((e=>e.width?e.width:"actions"===e.type?"max-content":"minmax(80px, auto)")).join(" ")}_updateSearchPosition(){if(this._searchPositionLocked)return;const e=this.shadowRoot?.querySelector(".search"),t=e?.querySelector(".search-field");e&&t&&(e.style.justifyContent="center",t.style.marginLeft="",requestAnimationFrame((()=>{const i=e.getBoundingClientRect(),o=t.getBoundingClientRect().left-i.left;e.style.justifyContent="flex-start",t.style.marginLeft=`${o}px`,this._searchPositionLocked=!0})))}_toggleColumnPicker(){this._columnPickerOpen=!this._columnPickerOpen}_toggleColumn(e){this._displayedColumns.includes(e)?this._displayedColumns=this._displayedColumns.filter((t=>t!==e)):this._displayedColumns=[...this._displayedColumns,e]}_handleRowMouseDown(){this._def.rowClickable&&window.getSelection()?.removeAllRanges()}_handleRowClick(e,t){if(!this._def.rowClickable)return;const i=window.getSelection();i&&i.toString().length>0||this.dispatchEvent(new CustomEvent("row-click",{detail:{row:e,rowIndex:t},bubbles:!0,composed:!0}))}getDisplayedColumns(){return this._displayedColumns.map((e=>this._def.columns.find((t=>t.id===e)))).sort(((e,t)=>"actions"===e.type&&"actions"!==t.type?1:"actions"!==e.type&&"actions"===t.type?-1:0))}_handleScroll(e){const t=e.target;this._canScrollLeft=t.scrollLeft>0,this._canScrollRight=t.scrollLeft<t.scrollWidth-t.clientWidth-1}_updateScrollFlags(){const e=this.shadowRoot?.querySelector(".content");e&&(this._canScrollLeft=e.scrollLeft>0,this._canScrollRight=e.scrollWidth>e.clientWidth&&e.scrollLeft<e.scrollWidth-e.clientWidth-1,this._canScrollHorizontal=e.scrollWidth>e.clientWidth),this.classList.toggle("kr-table--scroll-left-available",this._canScrollLeft),this.classList.toggle("kr-table--scroll-right-available",this._canScrollRight),this.classList.toggle("kr-table--scroll-horizontal-available",this._canScrollHorizontal),this.classList.toggle("kr-table--sticky-left",this.getDisplayedColumns().some((e=>"left"===e.sticky))),this.classList.toggle("kr-table--sticky-right",this.getDisplayedColumns().some((e=>"right"===e.sticky)))}_handleResizeStart(e,t){e.preventDefault();const i=this.shadowRoot?.querySelector(`.header-cell[data-column-id="${t}"]`);this._resizing={columnId:t,startX:e.clientX,startWidth:i?.offsetWidth||200},document.addEventListener("mousemove",this._handleResizeMove),document.addEventListener("mouseup",this._handleResizeEnd)}_handleAction(e){e.href||this.dispatchEvent(new CustomEvent("action",{detail:{action:e.id},bubbles:!0,composed:!0}))}_renderCellContent(e,t,i){const o=t[e.id];if(e.render)return q`<slot name="cell-${i}-${e.id}"></slot>`;if(null==o)return"";switch(e.type){case"number":return"number"==typeof o?o.toLocaleString():String(o);case"currency":return"number"==typeof o?o.toLocaleString("en-US",{style:"currency",currency:"USD"}):String(o);case"date":{let e;if(o instanceof Date)e=o;else if("string"==typeof o&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(o)){const t=o.replace(/(\d{2}:\d{2}:\d{2}):(\d+)$/,"$1.$2").replace(" ","T")+"Z";e=new Date(t)}else e=new Date(o);return e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}case"boolean":return!0===o?"Yes":!1===o?"No":"";default:return String(o)}}_getHeaderCellClasses(e,t){return{"header-cell":!0,"header-cell--align-center":"center"===e.align,"header-cell--align-right":"right"===e.align,"header-cell--sticky-left":"left"===e.sticky,"header-cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"header-cell--sticky-right":"right"===e.sticky,"header-cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellClasses(e,t){return{cell:!0,"cell--actions":"actions"===e.type,"cell--align-center":"center"===e.align,"cell--align-right":"right"===e.align,"cell--sticky-left":"left"===e.sticky,"cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"cell--sticky-right":"right"===e.sticky,"cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellStyle(e,t){const i={};if("left"===e.sticky){let e=0;for(let i=0;i<t;i++){const t=this.getDisplayedColumns()[i];"left"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.left=`${e}px`}if("right"===e.sticky){let e=0;for(let i=t+1;i<this.getDisplayedColumns().length;i++){const t=this.getDisplayedColumns()[i];"right"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.right=`${e}px`}return i}_renderPagination(){const e=(this._page-1)*this._pageSize+1,t=Math.min(this._page*this._pageSize,this._totalItems);return q`
1236
+ `],Be([pe({type:String,reflect:!0})],e.KRTab.prototype,"id",void 0),Be([pe({type:String})],e.KRTab.prototype,"label",void 0),Be([pe({type:String})],e.KRTab.prototype,"badge",void 0),Be([pe({type:String,attribute:"badge-background"})],e.KRTab.prototype,"badgeBackground",void 0),Be([pe({type:String,attribute:"badge-color"})],e.KRTab.prototype,"badgeColor",void 0),Be([pe({type:Boolean})],e.KRTab.prototype,"disabled",void 0),Be([pe({type:Boolean})],e.KRTab.prototype,"dismissible",void 0),Be([pe({type:Boolean,reflect:!0})],e.KRTab.prototype,"active",void 0),e.KRTab=Be([de("kr-tab")],e.KRTab);var Fe=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};const Ie=['"',"+","-","&&","||","!","(",")","{","}","[","]","^","~","*","?",":"],Ve=['\\"',"\\+","\\-","\\&\\&","\\|\\|","\\!","\\(","\\)","\\{","\\}","\\[","\\]","\\^","\\~","\\*","\\?","\\:"];function qe(e){let t=e;for(let e=0;e<Ie.length;e++)t=t.split(Ie[e]).join(Ve[e]);return t}e.KRTable=class extends le{constructor(){super(...arguments),this._scrollStyle="overlay",this._data=[],this._dataState="idle",this._page=1,this._pageSize=50,this._totalItems=0,this._totalPages=0,this._searchQuery="",this._canScrollLeft=!1,this._canScrollRight=!1,this._canScrollHorizontal=!1,this._columnPickerOpen=!1,this._displayedColumns=[],this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._def={columns:[]},this.def={columns:[]},this._handleClickOutsideColumnPicker=e=>{if(!this._columnPickerOpen)return;const t=e.composedPath(),i=this.shadowRoot?.querySelector(".column-picker-wrapper");i&&!t.includes(i)&&(this._columnPickerOpen=!1)},this._handleResizeMove=e=>{if(!this._resizing)return;const t=this._def.columns.find((e=>e.id===this._resizing.columnId));if(t){const i=this._resizing.startWidth+(e.clientX-this._resizing.startX);t.width=`${Math.min(900,Math.max(50,i))}px`,this.requestUpdate()}},this._handleResizeEnd=()=>{this._resizing=null,document.removeEventListener("mousemove",this._handleResizeMove),document.removeEventListener("mouseup",this._handleResizeEnd)}}connectedCallback(){super.connectedCallback(),this.classList.toggle("kr-table--scroll-overlay","overlay"===this._scrollStyle),this.classList.toggle("kr-table--scroll-edge","edge"===this._scrollStyle),this._fetch(),this._initRefresh(),document.addEventListener("click",this._handleClickOutsideColumnPicker),this._resizeObserver=new ResizeObserver((()=>{this._searchPositionLocked=!1,this._updateSearchPosition()})),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this._refreshTimer),document.removeEventListener("click",this._handleClickOutsideColumnPicker),this._resizeObserver?.disconnect()}willUpdate(e){e.has("def")&&(this._def={...this.def,columns:this.def.columns.map((e=>"actions"===e.type?{...e,label:e.label??"",sticky:"right",resizable:!1}:{...e}))},this._displayedColumns=this._def.displayedColumns||this._def.columns.map((e=>e.id)),this._fetch(),this._initRefresh())}updated(e){this._updateScrollFlags(),this._syncSlottedContent()}_syncSlottedContent(){const e=this.getDisplayedColumns().filter((e=>e.render));e.length&&(this.querySelectorAll('[slot^="cell-"]').forEach((e=>e.remove())),this._data.forEach(((t,i)=>{e.forEach((e=>{const o=e.render(t),s="string"==typeof o?o:"";if(s){const t=document.createElement("span");t.slot=`cell-${i}-${e.id}`,"actions"===e.type&&(t.style.display="flex",t.style.gap="8px"),t.innerHTML=s,this.appendChild(t)}}))})))}refresh(){this._fetch()}goToPrevPage(){this._page>1&&(this._page--,this._fetch())}goToNextPage(){this._page<this._totalPages&&(this._page++,this._fetch())}goToPage(e){e>=1&&e<=this._totalPages&&(this._page=e,this._fetch())}_fetch(){if(!this._def.dataSource)return;let t;switch(this._dataState="loading",this._def.dataSource.mode){case"opensearch":throw Error("Opensearch not supported yet");case"db":t={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]},this._searchQuery?.trim().length&&this._def.columns.filter((e=>e.searchable)).forEach((e=>{t.queryFields.push({name:e.id,operation:"CONTAINS",value:this._searchQuery,and:!1})}));break;default:t={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]},this._searchQuery?.trim().length&&t.queryFields.push({name:"_text_",operation:"IS",value:qe(this._searchQuery)})}this._def.dataSource.fetch(t).then((e=>{switch(this._def.dataSource?.mode){case"opensearch":throw Error("Opensearch not supported yet");case"db":{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size;break}default:{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size}}this._dataState="success",this._updateSearchPosition()})).catch((t=>{this._dataState="error",e.KRSnackbar.show({message:t instanceof Error?t.message:"Failed to load data",type:"error"})}))}_initRefresh(){clearInterval(this._refreshTimer),this._def.refreshInterval&&this._def.refreshInterval>0&&(this._refreshTimer=window.setInterval((()=>{this._fetch()}),this._def.refreshInterval))}_handleSearch(e){const t=e.target;this._searchQuery=t.value,this._page=1,this._fetch()}_getGridTemplateColumns(){return this.getDisplayedColumns().map((e=>e.width?e.width:"actions"===e.type?"max-content":"minmax(80px, auto)")).join(" ")}_updateSearchPosition(){if(this._searchPositionLocked)return;const e=this.shadowRoot?.querySelector(".search"),t=e?.querySelector(".search-field");e&&t&&(e.style.justifyContent="center",t.style.marginLeft="",requestAnimationFrame((()=>{const i=e.getBoundingClientRect(),o=t.getBoundingClientRect().left-i.left;e.style.justifyContent="flex-start",t.style.marginLeft=`${o}px`,this._searchPositionLocked=!0})))}_toggleColumnPicker(){this._columnPickerOpen=!this._columnPickerOpen}_toggleColumn(e){this._displayedColumns.includes(e)?this._displayedColumns=this._displayedColumns.filter((t=>t!==e)):this._displayedColumns=[...this._displayedColumns,e]}_handleRowMouseDown(){this._def.rowClickable&&window.getSelection()?.removeAllRanges()}_handleRowClick(e,t){if(!this._def.rowClickable)return;const i=window.getSelection();i&&i.toString().length>0||this.dispatchEvent(new CustomEvent("row-click",{detail:{row:e,rowIndex:t},bubbles:!0,composed:!0}))}getDisplayedColumns(){return this._displayedColumns.map((e=>this._def.columns.find((t=>t.id===e)))).sort(((e,t)=>"actions"===e.type&&"actions"!==t.type?1:"actions"!==e.type&&"actions"===t.type?-1:0))}_handleScroll(e){const t=e.target;this._canScrollLeft=t.scrollLeft>0,this._canScrollRight=t.scrollLeft<t.scrollWidth-t.clientWidth-1}_updateScrollFlags(){const e=this.shadowRoot?.querySelector(".content");e&&(this._canScrollLeft=e.scrollLeft>0,this._canScrollRight=e.scrollWidth>e.clientWidth&&e.scrollLeft<e.scrollWidth-e.clientWidth-1,this._canScrollHorizontal=e.scrollWidth>e.clientWidth),this.classList.toggle("kr-table--scroll-left-available",this._canScrollLeft),this.classList.toggle("kr-table--scroll-right-available",this._canScrollRight),this.classList.toggle("kr-table--scroll-horizontal-available",this._canScrollHorizontal),this.classList.toggle("kr-table--sticky-left",this.getDisplayedColumns().some((e=>"left"===e.sticky))),this.classList.toggle("kr-table--sticky-right",this.getDisplayedColumns().some((e=>"right"===e.sticky)))}_handleResizeStart(e,t){e.preventDefault();const i=this.shadowRoot?.querySelector(`.header-cell[data-column-id="${t}"]`);this._resizing={columnId:t,startX:e.clientX,startWidth:i?.offsetWidth||200},document.addEventListener("mousemove",this._handleResizeMove),document.addEventListener("mouseup",this._handleResizeEnd)}_handleAction(e){e.href||this.dispatchEvent(new CustomEvent("action",{detail:{action:e.id},bubbles:!0,composed:!0}))}_renderCellContent(e,t,i){const o=t[e.id];if(e.render)return I`<slot name="cell-${i}-${e.id}"></slot>`;if(null==o)return"";switch(e.type){case"number":return"number"==typeof o?o.toLocaleString():String(o);case"currency":return"number"==typeof o?o.toLocaleString("en-US",{style:"currency",currency:"USD"}):String(o);case"date":{let e;if(o instanceof Date)e=o;else if("string"==typeof o&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(o)){const t=o.replace(/(\d{2}:\d{2}:\d{2}):(\d+)$/,"$1.$2").replace(" ","T")+"Z";e=new Date(t)}else e=new Date(o);return e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}case"boolean":return!0===o?"Yes":!1===o?"No":"";default:return String(o)}}_getHeaderCellClasses(e,t){return{"header-cell":!0,"header-cell--align-center":"center"===e.align,"header-cell--align-right":"right"===e.align,"header-cell--sticky-left":"left"===e.sticky,"header-cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"header-cell--sticky-right":"right"===e.sticky,"header-cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellClasses(e,t){return{cell:!0,"cell--actions":"actions"===e.type,"cell--align-center":"center"===e.align,"cell--align-right":"right"===e.align,"cell--sticky-left":"left"===e.sticky,"cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"cell--sticky-right":"right"===e.sticky,"cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellStyle(e,t){const i={};if("left"===e.sticky){let e=0;for(let i=0;i<t;i++){const t=this.getDisplayedColumns()[i];"left"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.left=`${e}px`}if("right"===e.sticky){let e=0;for(let i=t+1;i<this.getDisplayedColumns().length;i++){const t=this.getDisplayedColumns()[i];"right"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.right=`${e}px`}return i}_renderPagination(){const e=(this._page-1)*this._pageSize+1,t=Math.min(this._page*this._pageSize,this._totalItems);return I`
1237
1237
  <div class="pagination">
1238
1238
  <span
1239
1239
  class="pagination-icon ${1===this._page?"pagination-icon--disabled":""}"
@@ -1249,10 +1249,10 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1249
1249
  <svg viewBox="0 0 24 24" fill="currentColor"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>
1250
1250
  </span>
1251
1251
  </div>
1252
- `}_renderHeader(){return!this._def.title&&!this._def.actions?.length&&this._totalPages<=1?V:q`
1252
+ `}_renderHeader(){return!this._def.title&&!this._def.actions?.length&&this._totalPages<=1?q:I`
1253
1253
  <div class="header">
1254
1254
  <div class="title">${this._def.title??""}</div>
1255
- ${"db"!==this._def.dataSource?.mode||this._def.columns.some((e=>e.searchable))?q`
1255
+ ${"db"!==this._def.dataSource?.mode||this._def.columns.some((e=>e.searchable))?I`
1256
1256
  <div class="search">
1257
1257
  <!-- TODO: Saved views dropdown
1258
1258
  <div class="views">
@@ -1271,7 +1271,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1271
1271
  />
1272
1272
  </div>
1273
1273
  </div>
1274
- `:q`<div class="search"></div>`}
1274
+ `:I`<div class="search"></div>`}
1275
1275
  <div class="tools">
1276
1276
  ${this._renderPagination()}
1277
1277
  <span class="refresh" title="Refresh" @click=${()=>this.refresh()}>
@@ -1282,7 +1282,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1282
1282
  <svg viewBox="0 -960 960 960" fill="currentColor"><path d="M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"/></svg>
1283
1283
  </span>
1284
1284
  <div class="column-picker ${this._columnPickerOpen?"open":""}">
1285
- ${[...this._def.columns].filter((e=>"actions"!==e.type)).sort(((e,t)=>(e.label??e.id).localeCompare(t.label??t.id))).map((e=>q`
1285
+ ${[...this._def.columns].filter((e=>"actions"!==e.type)).sort(((e,t)=>(e.label??e.id).localeCompare(t.label??t.id))).map((e=>I`
1286
1286
  <div class="column-picker-item" @click=${()=>this._toggleColumn(e.id)}>
1287
1287
  <div class="column-picker-checkbox ${this._displayedColumns.includes(e.id)?"checked":""}">
1288
1288
  <svg viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>
@@ -1292,7 +1292,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1292
1292
  `))}
1293
1293
  </div>
1294
1294
  </div>
1295
- ${1===this._def.actions?.length?q`
1295
+ ${1===this._def.actions?.length?I`
1296
1296
  <kr-button
1297
1297
  class="actions"
1298
1298
  .href=${this._def.actions[0].href}
@@ -1301,7 +1301,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1301
1301
  >
1302
1302
  ${this._def.actions[0].label}
1303
1303
  </kr-button>
1304
- `:this._def.actions?.length?q`
1304
+ `:this._def.actions?.length?I`
1305
1305
  <kr-button
1306
1306
  class="actions"
1307
1307
  .options=${this._def.actions.map((e=>({id:e.id,label:e.label})))}
@@ -1309,10 +1309,10 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1309
1309
  >
1310
1310
  Actions
1311
1311
  </kr-button>
1312
- `:V}
1312
+ `:q}
1313
1313
  </div>
1314
1314
  </div>
1315
- `}_renderStatus(){return"loading"===this._dataState&&0===this._data.length?q`<div class="status">Loading...</div>`:"error"===this._dataState&&0===this._data.length?q`<div class="status status--error">Error loading data</div>`:0===this._data.length?q`<div class="status">No data available</div>`:V}_renderTable(){return q`
1315
+ `}_renderStatus(){return"loading"===this._dataState&&0===this._data.length?I`<div class="status">Loading...</div>`:"error"===this._dataState&&0===this._data.length?I`<div class="status status--error">Error loading data</div>`:0===this._data.length?I`<div class="status">No data available</div>`:q}_renderTable(){return I`
1316
1316
  <div class="wrapper">
1317
1317
  <div class="overlay-left"></div>
1318
1318
  <div class="overlay-right"></div>
@@ -1320,27 +1320,27 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1320
1320
  <div class="content" @scroll=${this._handleScroll}>
1321
1321
  <div class="table" style="grid-template-columns: ${this._getGridTemplateColumns()}">
1322
1322
  <div class="header-row">
1323
- ${this.getDisplayedColumns().map(((e,t)=>q`
1323
+ ${this.getDisplayedColumns().map(((e,t)=>I`
1324
1324
  <div
1325
1325
  class=${ke(this._getHeaderCellClasses(e,t))}
1326
- style=${Ee(this._getCellStyle(e,t))}
1326
+ style=${Ke(this._getCellStyle(e,t))}
1327
1327
  data-column-id=${e.id}
1328
- >${e.label??e.id}${!1!==e.resizable?q`<div
1328
+ >${e.label??e.id}${!1!==e.resizable?I`<div
1329
1329
  class="header-cell__resize"
1330
1330
  @mousedown=${t=>this._handleResizeStart(t,e.id)}
1331
- ></div>`:V}</div>
1331
+ ></div>`:q}</div>
1332
1332
  `))}
1333
1333
  </div>
1334
- ${this._data.map(((e,t)=>q`
1334
+ ${this._data.map(((e,t)=>I`
1335
1335
  <div
1336
1336
  class=${ke({row:!0,"row--clickable":!!this._def.rowClickable})}
1337
1337
  @mousedown=${()=>this._handleRowMouseDown()}
1338
1338
  @click=${()=>this._handleRowClick(e,t)}
1339
1339
  >
1340
- ${this.getDisplayedColumns().map(((i,o)=>q`
1340
+ ${this.getDisplayedColumns().map(((i,o)=>I`
1341
1341
  <div
1342
1342
  class=${ke(this._getCellClasses(i,o))}
1343
- style=${Ee(this._getCellStyle(i,o))}
1343
+ style=${Ke(this._getCellStyle(i,o))}
1344
1344
  data-column-id=${i.id}
1345
1345
  >
1346
1346
  ${this._renderCellContent(i,e,t)}
@@ -1351,10 +1351,10 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1351
1351
  </div>
1352
1352
  </div>
1353
1353
  </div>
1354
- `}render(){return this._def.columns.length?q`
1354
+ `}render(){return this._def.columns.length?I`
1355
1355
  ${this._renderHeader()}
1356
1356
  ${this._renderTable()}
1357
- `:q`<slot></slot>`}},e.KRTable.styles=[ae,n`
1357
+ `:I`<slot></slot>`}},e.KRTable.styles=[ae,l`
1358
1358
  /* -------------------------------------------------------------------------
1359
1359
  * Host
1360
1360
  * ----------------------------------------------------------------------- */
@@ -1867,7 +1867,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1867
1867
  .status--error {
1868
1868
  color: #dc2626;
1869
1869
  }
1870
- `],Fe([ue()],e.KRTable.prototype,"_data",void 0),Fe([ue()],e.KRTable.prototype,"_dataState",void 0),Fe([ue()],e.KRTable.prototype,"_page",void 0),Fe([ue()],e.KRTable.prototype,"_pageSize",void 0),Fe([ue()],e.KRTable.prototype,"_totalItems",void 0),Fe([ue()],e.KRTable.prototype,"_totalPages",void 0),Fe([ue()],e.KRTable.prototype,"_searchQuery",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollLeft",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollRight",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollHorizontal",void 0),Fe([ue()],e.KRTable.prototype,"_columnPickerOpen",void 0),Fe([ue()],e.KRTable.prototype,"_displayedColumns",void 0),Fe([pe({type:Object})],e.KRTable.prototype,"def",void 0),e.KRTable=Fe([de("kr-table")],e.KRTable);var Ue=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRSpinner=class extends ne{constructor(){super(...arguments),this.size="md",this.color="dark"}render(){var e="",t="";return e="sm"==this.size?"16px":"md"==this.size?"24px":"lg"==this.size?"32px":"xl"==this.size?"48px":this.size,t="dark"==this.color?"#163052":"light"==this.color?"#ffffff":this.color,q`
1870
+ `],Fe([ue()],e.KRTable.prototype,"_data",void 0),Fe([ue()],e.KRTable.prototype,"_dataState",void 0),Fe([ue()],e.KRTable.prototype,"_page",void 0),Fe([ue()],e.KRTable.prototype,"_pageSize",void 0),Fe([ue()],e.KRTable.prototype,"_totalItems",void 0),Fe([ue()],e.KRTable.prototype,"_totalPages",void 0),Fe([ue()],e.KRTable.prototype,"_searchQuery",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollLeft",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollRight",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollHorizontal",void 0),Fe([ue()],e.KRTable.prototype,"_columnPickerOpen",void 0),Fe([ue()],e.KRTable.prototype,"_displayedColumns",void 0),Fe([pe({type:Object})],e.KRTable.prototype,"def",void 0),e.KRTable=Fe([de("kr-table")],e.KRTable);var Ue=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRSpinner=class extends le{constructor(){super(...arguments),this.size="md",this.color="dark"}render(){var e="",t="";return e="sm"==this.size?"16px":"md"==this.size?"24px":"lg"==this.size?"32px":"xl"==this.size?"48px":this.size,t="dark"==this.color?"#163052":"light"==this.color?"#ffffff":this.color,I`
1871
1871
  <svg
1872
1872
  class="spinner"
1873
1873
  style=${`width: ${e}; height: ${e}; color: ${t}`}
@@ -1884,7 +1884,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1884
1884
  stroke-width="4"
1885
1885
  />
1886
1886
  </svg>
1887
- `}},e.KRSpinner.styles=n`
1887
+ `}},e.KRSpinner.styles=l`
1888
1888
  :host {
1889
1889
  display: inline-flex;
1890
1890
  align-items: center;
@@ -1927,7 +1927,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1927
1927
  stroke: currentColor;
1928
1928
  stroke-linecap: round;
1929
1929
  }
1930
- `,Ue([pe({type:String,reflect:!0})],e.KRSpinner.prototype,"size",void 0),Ue([pe({type:String,reflect:!0})],e.KRSpinner.prototype,"color",void 0),e.KRSpinner=Ue([de("kr-spinner")],e.KRSpinner);var Ne=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRProgressBar=class extends ne{constructor(){super(...arguments),this.color="dark"}render(){let e="",t="";return e="dark"===this.color?"#163052":"light"===this.color?"#ffffff":this.color,t=this.trackColor?this.trackColor:"light"===this.color?"#ffffff4d":"#0000001a",q`
1930
+ `,Ue([pe({type:String,reflect:!0})],e.KRSpinner.prototype,"size",void 0),Ue([pe({type:String,reflect:!0})],e.KRSpinner.prototype,"color",void 0),e.KRSpinner=Ue([de("kr-spinner")],e.KRSpinner);var Ne=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRProgressBar=class extends le{constructor(){super(...arguments),this.color="dark"}render(){let e="",t="";return e="dark"===this.color?"#163052":"light"===this.color?"#ffffff":this.color,t=this.trackColor?this.trackColor:"light"===this.color?"#ffffff4d":"#0000001a",I`
1931
1931
  <div
1932
1932
  class="progress-bar"
1933
1933
  style=${`background: ${t}`}
@@ -1936,7 +1936,7 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1936
1936
  >
1937
1937
  <div class="fill" style=${`background: ${e}`}></div>
1938
1938
  </div>
1939
- `}},e.KRProgressBar.styles=n`
1939
+ `}},e.KRProgressBar.styles=l`
1940
1940
  :host {
1941
1941
  display: block;
1942
1942
  width: 100%;
@@ -1968,28 +1968,384 @@ const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e
1968
1968
  left: 100%;
1969
1969
  }
1970
1970
  }
1971
- `,Ne([pe({type:String,reflect:!0})],e.KRProgressBar.prototype,"color",void 0),Ne([pe({type:String,reflect:!0})],e.KRProgressBar.prototype,"trackColor",void 0),e.KRProgressBar=Ne([de("kr-progress-bar")],e.KRProgressBar);
1971
+ `,Ne([pe({type:String,reflect:!0})],e.KRProgressBar.prototype,"color",void 0),Ne([pe({type:String,reflect:!0})],e.KRProgressBar.prototype,"trackColor",void 0),e.KRProgressBar=Ne([de("kr-progress-bar")],e.KRProgressBar);var We,Xe=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRFilePreview=We=class extends le{constructor(){super(...arguments),this._zoom=100,this._panX=0,this._panY=0,this._dragging=!1,this._dragStartX=0,this._dragStartY=0,this._panStartX=0,this._panStartY=0,this.src="",this.name="",this._zoomLevel=100,this._textContent=null,this._handleKeydown=e=>{"Escape"===e.key&&this._close()},this._handleDragMove=e=>{this._dragging&&(this._panX=this._panStartX+(e.clientX-this._dragStartX),this._panY=this._panStartY+(e.clientY-this._dragStartY),this.requestUpdate())},this._handleDragEnd=()=>{this._dragging=!1,document.removeEventListener("mousemove",this._handleDragMove),document.removeEventListener("mouseup",this._handleDragEnd)}}static open(e){this._activePreview&&this._activePreview._close();const t=document.createElement("kr-file-preview");return t.src=e.src,t.name=e.name,document.body.appendChild(t),this._activePreview=t,t}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._handleKeydown),this._isText()&&this._loadTextContent()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleKeydown)}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),We._activePreview===this&&(We._activePreview=null),this.remove()}_handleDownload(){this.dispatchEvent(new CustomEvent("download",{bubbles:!0,composed:!0,detail:{src:this.src,name:this.name}})),fetch(this.src).then((e=>e.blob())).then((e=>{const t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=this.name||"file",i.click(),URL.revokeObjectURL(t)}))}_handleZoomIn(){this._zoomLevel=Math.min(this._zoomLevel+25,300),this._zoomLevel<=100&&(this._panX=0,this._panY=0)}_handleZoomOut(){this._zoomLevel=Math.max(this._zoomLevel-25,25),this._zoomLevel<=100&&(this._panX=0,this._panY=0)}_handleZoomReset(){this._zoomLevel=100,this._panX=0,this._panY=0}_handleDragStart(e){this._zoomLevel<=100||(e.preventDefault(),this._dragging=!0,this._dragStartX=e.clientX,this._dragStartY=e.clientY,this._panStartX=this._panX,this._panStartY=this._panY,document.addEventListener("mousemove",this._handleDragMove),document.addEventListener("mouseup",this._handleDragEnd))}_handleBackdropClick(e){e.target===e.currentTarget&&this._close()}_getExtension(){return(this.name||"").split(".").pop()?.toLowerCase()||""}_isImage(){return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(this._getExtension())}_isPdf(){return"pdf"===this._getExtension()}_isText(){return["csv","txt","json","xml","log","md","yml","yaml","ini","cfg","conf","env","sh","bat"].includes(this._getExtension())}_isCsv(){return"csv"===this._getExtension()}_loadTextContent(){fetch(this.src).then((e=>e.text())).then((e=>{this._isCsv()?this._textContent=this._formatCsv(e):this._textContent=e})).catch((()=>{this._textContent="Failed to load file content."}))}_formatCsv(e){const t=e.trim().split("\n");if(!t.length)return e;const i=t.map((e=>e.split(",").map((e=>e.trim())))),o=Math.max(...i.map((e=>e.length))),s=[];for(let e=0;e<o;e++){let t=0;for(const o of i){const i=(o[e]||"").length;i>t&&(t=i)}s.push(t)}return i.map((e=>e.map(((e,t)=>e.padEnd(s[t]||0))).join(" "))).join("\n")}_getFallbackIconClass(e){return["doc","docx","rtf","txt"].includes(e)?"fallback__icon--doc":["xls","xlsx","csv"].includes(e)?"fallback__icon--xls":["zip","rar","7z","gz","tar"].includes(e)?"fallback__icon--zip":"fallback__icon--default"}_getFallbackIcon(e){return["doc","docx","rtf","txt"].includes(e)?I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2zm0 8h5v2H8v-2z"/></svg>`:["xls","xlsx","csv"].includes(e)?I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h14zm0 5v4H5v-4h14zM5 19v-3h14v3H5zm2-8h4v2H7v-2zm0 5h4v2H7v-2z"/></svg>`:["zip","rar","7z","gz","tar"].includes(e)?I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h-2v-2zm0-4h2v2h-2v-2zm-2 2h2v2h-2v-2z"/></svg>`:I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>`}render(){let e;if(this._isImage()){const t=this._zoomLevel/100,i=this._panX/t,o=this._panY/t,s=this._zoomLevel>100?"grab":"default";e=I`<img
1972
+ class="body__image"
1973
+ src="${this.src}"
1974
+ alt="${this.name}"
1975
+ style="transform: scale(${t}) translate(${i}px, ${o}px); cursor: ${s}"
1976
+ @mousedown=${this._handleDragStart}
1977
+ />`}else if(this._isPdf())e=I`<iframe class="body__iframe" src="${this.src}"></iframe>`;else if(this._isText())e=null===this._textContent?I`<div class="body__text-loading">Loading...</div>`:I`<pre class="body__text">${this._textContent}</pre>`;else{const t=this._getExtension();e=I`
1978
+ <div class="fallback">
1979
+ <div class="fallback__icon ${this._getFallbackIconClass(t)}">
1980
+ ${this._getFallbackIcon(t)}
1981
+ </div>
1982
+ <div class="fallback__name">${this.name}</div>
1983
+ <div class="fallback__hint">No preview available for this file type</div>
1984
+ <kr-button color="primary" @click=${this._handleDownload}>
1985
+ <svg class="fallback__btn" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5v-2z"/></svg>
1986
+ Download
1987
+ </kr-button>
1988
+ </div>
1989
+ `}return I`
1990
+ <div class="toolbar">
1991
+ <div class="toolbar__name">${this.name}</div>
1992
+ <div class="toolbar__controls">
1993
+ ${this._isImage()?I`
1994
+ <button class="toolbar__btn" @click=${this._handleZoomOut} title="Zoom out">
1995
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7V9z"/></svg>
1996
+ </button>
1997
+ <div class="toolbar__zoom-label" @click=${this._handleZoomReset}>${this._zoomLevel}%</div>
1998
+ <button class="toolbar__btn" @click=${this._handleZoomIn} title="Zoom in">
1999
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm-2-5h2V7h1v2h2v1h-2v2H9v-2H7V9z"/></svg>
2000
+ </button>
2001
+ <div class="toolbar__separator"></div>
2002
+ `:q}
2003
+ <button class="toolbar__btn" @click=${this._handleDownload} title="Download">
2004
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5v-2z"/></svg>
2005
+ </button>
2006
+ <button class="toolbar__btn" @click=${()=>this._close()} title="Close">
2007
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
2008
+ </button>
2009
+ </div>
2010
+ </div>
2011
+ <div class="body" @click=${this._handleBackdropClick}>
2012
+ ${e}
2013
+ </div>
2014
+ `}},e.KRFilePreview.styles=l`
2015
+ *,
2016
+ *::after,
2017
+ *::before,
2018
+ :host {
2019
+ box-sizing: border-box;
2020
+ }
2021
+
2022
+ :host {
2023
+ position: fixed;
2024
+ top: 0;
2025
+ left: 0;
2026
+ width: 100%;
2027
+ height: 100%;
2028
+ background: rgba(0, 0, 0, 0.85);
2029
+ display: flex;
2030
+ flex-direction: column;
2031
+ z-index: 10000;
2032
+ }
2033
+
2034
+ .toolbar {
2035
+ display: flex;
2036
+ align-items: center;
2037
+ height: 56px;
2038
+ padding: 0 24px;
2039
+ flex-shrink: 0;
2040
+ }
2041
+
2042
+ .toolbar__name {
2043
+ color: white;
2044
+ font-size: 16px;
2045
+ font-weight: 500;
2046
+ white-space: nowrap;
2047
+ overflow: hidden;
2048
+ text-overflow: ellipsis;
2049
+ margin-right: auto;
2050
+ }
2051
+
2052
+ .toolbar__controls {
2053
+ display: flex;
2054
+ align-items: center;
2055
+ gap: 4px;
2056
+ }
2057
+
2058
+ .toolbar__btn {
2059
+ width: 40px;
2060
+ height: 40px;
2061
+ border: none;
2062
+ border-radius: 50%;
2063
+ background: transparent;
2064
+ cursor: pointer;
2065
+ display: flex;
2066
+ align-items: center;
2067
+ justify-content: center;
2068
+ padding: 0;
2069
+ }
2070
+
2071
+ .toolbar__btn:hover {
2072
+ background: rgba(255, 255, 255, 0.15);
2073
+ }
2074
+
2075
+ .toolbar__btn svg {
2076
+ width: 24px;
2077
+ height: 24px;
2078
+ fill: white;
2079
+ }
2080
+
2081
+ .toolbar__zoom-label {
2082
+ color: white;
2083
+ font-size: 13px;
2084
+ min-width: 40px;
2085
+ text-align: center;
2086
+ user-select: none;
2087
+ cursor: pointer;
2088
+ }
2089
+
2090
+ .toolbar__separator {
2091
+ width: 1px;
2092
+ height: 24px;
2093
+ background: rgba(255, 255, 255, 0.25);
2094
+ margin: 0 8px;
2095
+ }
2096
+
2097
+ .body {
2098
+ flex: 1;
2099
+ overflow: auto;
2100
+ display: flex;
2101
+ align-items: center;
2102
+ justify-content: center;
2103
+ padding: 0 36px 36px 36px;
2104
+ }
2105
+
2106
+ .body__image {
2107
+ max-width: 100%;
2108
+ max-height: 100%;
2109
+ object-fit: contain;
2110
+ transition: transform 0.15s ease;
2111
+ transform-origin: center center;
2112
+ }
2113
+
2114
+ .body__iframe {
2115
+ width: 80vw;
2116
+ height: 100%;
2117
+ border: 1px solid #5e5e5e;
2118
+ border-radius: 4px;
2119
+ background: white;
2120
+ }
2121
+
2122
+ .body__text {
2123
+ width: 80vw;
2124
+ max-height: 100%;
2125
+ overflow: auto;
2126
+ background: white;
2127
+ color: #000;
2128
+ border-radius: 4px;
2129
+ padding: 24px;
2130
+ font-family: monospace;
2131
+ font-size: 14px;
2132
+ line-height: 1.6;
2133
+ white-space: pre;
2134
+ margin: 0;
2135
+ tab-size: 4;
2136
+ }
2137
+
2138
+ .body__text-loading {
2139
+ color: #888;
2140
+ font-style: italic;
2141
+ font-family: 'Inter', sans-serif;
2142
+ font-size: 14px;
2143
+ }
2144
+
2145
+ .fallback {
2146
+ background: white;
2147
+ border-radius: 12px;
2148
+ padding: 48px 64px;
2149
+ text-align: center;
2150
+ color: #000;
2151
+ display: flex;
2152
+ flex-direction: column;
2153
+ align-items: center;
2154
+ gap: 12px;
2155
+ }
2156
+
2157
+ .fallback__icon {
2158
+ width: 72px;
2159
+ height: 72px;
2160
+ border-radius: 12px;
2161
+ display: flex;
2162
+ align-items: center;
2163
+ justify-content: center;
2164
+ }
2165
+
2166
+ .fallback__icon svg {
2167
+ width: 36px;
2168
+ height: 36px;
2169
+ }
2170
+
2171
+ .fallback__icon--doc { background: #dbeafe; color: #2563eb; }
2172
+ .fallback__icon--xls { background: #d1fae5; color: #16a34a; }
2173
+ .fallback__icon--zip { background: #fef3c7; color: #b45309; }
2174
+ .fallback__icon--default { background: #f4f5f7; color: #555; }
2175
+
2176
+ .fallback__name {
2177
+ font-size: 18px;
2178
+ font-weight: 600;
2179
+ max-width: 320px;
2180
+ word-break: break-all;
2181
+ }
2182
+
2183
+ .fallback__hint {
2184
+ font-size: 14px;
2185
+ color: black;
2186
+ margin-bottom: 6px;
2187
+ }
2188
+
2189
+ .fallback__btn svg {
2190
+ width: 18px;
2191
+ height: 18px;
2192
+ fill: currentColor;
2193
+ }
2194
+ `,e.KRFilePreview._activePreview=null,Xe([pe({type:String})],e.KRFilePreview.prototype,"src",void 0),Xe([pe({type:String})],e.KRFilePreview.prototype,"name",void 0),Xe([ue()],e.KRFilePreview.prototype,"_zoomLevel",void 0),Xe([ue()],e.KRFilePreview.prototype,"_textContent",void 0),e.KRFilePreview=We=Xe([de("kr-file-preview")],e.KRFilePreview);var Ye=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRFileList=class extends le{constructor(){super(...arguments),this.files=[],this.emptyMessage="No files"}_handleFileClick(t){this.dispatchEvent(new CustomEvent("file-click",{bubbles:!0,composed:!0,detail:{file:t}})),t.url&&e.KRFilePreview.open({src:t.url,name:t.name})}_handleDownload(e){this.dispatchEvent(new CustomEvent("download",{bubbles:!0,composed:!0,detail:{file:e}})),e.url&&fetch(e.url).then((e=>e.blob())).then((t=>{const i=URL.createObjectURL(t),o=document.createElement("a");o.href=i,o.download=e.name||"file",o.click(),URL.revokeObjectURL(i)}))}_handleDelete(e){this.dispatchEvent(new CustomEvent("delete",{bubbles:!0,composed:!0,detail:{file:e}}))}_getExtension(e){return e.split(".").pop()?.toLowerCase()||""}_getExtClass(e){return["pdf"].includes(e)?"file-list__ext--pdf":["doc","docx","rtf","txt"].includes(e)?"file-list__ext--doc":["xls","xlsx","csv"].includes(e)?"file-list__ext--xls":["zip","rar","7z","gz","tar"].includes(e)?"file-list__ext--zip":["jpg","jpeg","png","gif","webp","svg","bmp"].includes(e)?"file-list__ext--img":"file-list__ext--default"}_getExtIcon(e){return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(e)?I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"/></svg>`:["pdf"].includes(e)?I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"/></svg>`:["doc","docx","rtf","txt"].includes(e)?I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2zm0 8h5v2H8v-2z"/></svg>`:["xls","xlsx","csv"].includes(e)?I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h14zm0 5v4H5v-4h14zM5 19v-3h14v3H5zm2-8h4v2H7v-2zm0 5h4v2H7v-2z"/></svg>`:["zip","rar","7z","gz","tar"].includes(e)?I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h-2v-2zm0-4h2v2h-2v-2zm-2 2h2v2h-2v-2z"/></svg>`:I`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>`}render(){return this.files.length?I`
2195
+ <div class="file-list">
2196
+ ${this.files.map((e=>{const t=this._getExtension(e.name),i=e.meta||e.date||"";return I`
2197
+ <div class="file-list__item">
2198
+ <div class="file-list__ext ${this._getExtClass(t)}">${this._getExtIcon(t)}</div>
2199
+ <div class="file-list__info">
2200
+ <a class="file-list__name" @click=${()=>this._handleFileClick(e)}>${e.name}</a>
2201
+ ${i?I`<div class="file-list__meta">${i}</div>`:""}
2202
+ </div>
2203
+ <div class="file-list__actions">
2204
+ <svg class="file-list__action" @click=${()=>this._handleDownload(e)} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" title="Download"><path d="M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5v-2z"/></svg>
2205
+ <svg class="file-list__action file-list__action--delete" @click=${()=>this._handleDelete(e)} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" title="Delete"><path d="M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"/></svg>
2206
+ </div>
2207
+ </div>
2208
+ `}))}
2209
+ </div>
2210
+ `:I`<div class="file-list__empty">${this.emptyMessage}</div>`}},e.KRFileList.styles=l`
2211
+ *,
2212
+ *::after,
2213
+ *::before,
2214
+ :host {
2215
+ box-sizing: border-box;
2216
+ }
2217
+
2218
+ :host {
2219
+ display: block;
2220
+ }
2221
+
2222
+ .file-list {
2223
+ display: flex;
2224
+ flex-direction: column;
2225
+ }
2226
+
2227
+ .file-list__item {
2228
+ display: flex;
2229
+ align-items: center;
2230
+ gap: 16px;
2231
+ padding: 16px 20px;
2232
+ background: white;
2233
+ transition: background 0.15s;
2234
+ }
2235
+
2236
+ .file-list__item:not(:last-child) {
2237
+ border-bottom: 1px solid #eeeff1;
2238
+ }
2239
+
2240
+ .file-list__item:hover {
2241
+ background: #f8f9fa;
2242
+ }
2243
+
2244
+ .file-list__ext {
2245
+ width: 36px;
2246
+ height: 36px;
2247
+ flex-shrink: 0;
2248
+ border-radius: 6px;
2249
+ display: flex;
2250
+ align-items: center;
2251
+ justify-content: center;
2252
+ font-size: 11px;
2253
+ font-weight: 700;
2254
+ text-transform: uppercase;
2255
+ letter-spacing: 0.3px;
2256
+ }
2257
+
2258
+ .file-list__ext svg {
2259
+ width: 20px;
2260
+ height: 20px;
2261
+ }
2262
+
2263
+ .file-list__ext--img { background: #fde8e8; color: #d93025; }
2264
+ .file-list__ext--pdf { background: #fde8e8; color: #c0392b; }
2265
+ .file-list__ext--doc { background: #dbeafe; color: #2563eb; }
2266
+ .file-list__ext--xls { background: #d1fae5; color: #16a34a; }
2267
+ .file-list__ext--zip { background: #fef3c7; color: #b45309; }
2268
+ .file-list__ext--default { background: #f4f5f7; color: #555; }
2269
+
2270
+ .file-list__info {
2271
+ flex: 1;
2272
+ min-width: 0;
2273
+ }
2274
+
2275
+ .file-list__name {
2276
+ font-weight: 500;
2277
+ color: #000;
2278
+ text-decoration: none;
2279
+ cursor: pointer;
2280
+ overflow: hidden;
2281
+ text-overflow: ellipsis;
2282
+ white-space: nowrap;
2283
+ display: block;
2284
+ font-size: 14px;
2285
+ }
2286
+
2287
+ .file-list__name:hover {
2288
+ color: #000;
2289
+ text-decoration: underline;
2290
+ }
2291
+
2292
+ .file-list__meta {
2293
+ font-size: 13px;
2294
+ color: #000;
2295
+ margin-top: 6px;
2296
+ }
2297
+
2298
+ .file-list__actions {
2299
+ display: flex;
2300
+ align-items: center;
2301
+ gap: 12px;
2302
+ flex-shrink: 0;
2303
+ }
2304
+
2305
+ .file-list__action {
2306
+ width: 24px;
2307
+ height: 24px;
2308
+ fill: #666;
2309
+ cursor: pointer;
2310
+ transition: fill 0.15s;
2311
+ }
2312
+
2313
+ .file-list__action:hover {
2314
+ fill: #000;
2315
+ }
2316
+
2317
+ .file-list__action--delete:hover {
2318
+ fill: #dc3545;
2319
+ }
2320
+
2321
+ .file-list__empty {
2322
+ color: #000;
2323
+ font-size: 14px;
2324
+ font-style: italic;
2325
+ padding: 20px;
2326
+ }
2327
+ `,Ye([pe({type:Array})],e.KRFileList.prototype,"files",void 0),Ye([pe({type:String,attribute:"empty-message"})],e.KRFileList.prototype,"emptyMessage",void 0),e.KRFileList=Ye([de("kr-file-list")],e.KRFileList);
1972
2328
  /**
1973
2329
  * @license
1974
2330
  * Copyright 2018 Google LLC
1975
2331
  * SPDX-License-Identifier: BSD-3-Clause
1976
2332
  */
1977
- const We=e=>e??V
2333
+ const Ze=e=>e??q
1978
2334
  /**
1979
2335
  * @license
1980
2336
  * Copyright 2020 Google LLC
1981
2337
  * SPDX-License-Identifier: BSD-3-Clause
1982
- */,Ze={},Ge=xe(class extends _e{constructor(e){if(super(e),e.type!==ye&&e.type!==be&&e.type!==me)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===H||t===V)return t;const i=e.element,o=e.name;if(e.type===ye){if(t===i[o])return H}else if(e.type===me){if(!!t===i.hasAttribute(o))return H}else if(e.type===be&&i.getAttribute(o)===t+"")return H;return((e,t=Ze)=>{e._$AH=t;
2338
+ */,Ge={},Qe=xe(class extends _e{constructor(e){if(super(e),e.type!==me&&e.type!==ve&&e.type!==ye)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===V||t===q)return t;const i=e.element,o=e.name;if(e.type===me){if(t===i[o])return V}else if(e.type===ye){if(!!t===i.hasAttribute(o))return V}else if(e.type===ve&&i.getAttribute(o)===t+"")return V;return((e,t=Ge)=>{e._$AH=t;
1983
2339
  /**
1984
2340
  * @license
1985
2341
  * Copyright 2020 Google LLC
1986
2342
  * SPDX-License-Identifier: BSD-3-Clause
1987
- */})(e),t}});var Qe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRTextField=class extends ne{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage)}render(){let e="";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),q`
2343
+ */})(e),t}});var Je=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRTextField=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage)}render(){let e="";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),I`
1988
2344
  <div class="wrapper">
1989
- ${this.label?q`
2345
+ ${this.label?I`
1990
2346
  <label for="input">
1991
2347
  ${this.label}
1992
- ${this.required?q`<span class="required" aria-hidden="true">*</span>`:""}
2348
+ ${this.required?I`<span class="required" aria-hidden="true">*</span>`:""}
1993
2349
  </label>
1994
2350
  `:""}
1995
2351
  <input
@@ -1997,22 +2353,22 @@ const We=e=>e??V
1997
2353
  class=${ke({"input--invalid":this._touched&&this._input&&!this._input.validity.valid})}
1998
2354
  type=${this.type}
1999
2355
  name=${this.name}
2000
- .value=${Ge(this.value)}
2356
+ .value=${Qe(this.value)}
2001
2357
  placeholder=${this.placeholder}
2002
2358
  ?required=${this.required}
2003
2359
  ?disabled=${this.disabled}
2004
2360
  ?readonly=${this.readonly}
2005
- minlength=${We(this.minlength)}
2006
- maxlength=${We(this.maxlength)}
2007
- pattern=${We(this.pattern)}
2008
- autocomplete=${We(this.autocomplete||void 0)}
2361
+ minlength=${Ze(this.minlength)}
2362
+ maxlength=${Ze(this.maxlength)}
2363
+ pattern=${Ze(this.pattern)}
2364
+ autocomplete=${Ze(this.autocomplete||void 0)}
2009
2365
  @input=${this._handleInput}
2010
2366
  @change=${this._handleChange}
2011
2367
  @blur=${this._handleBlur}
2012
2368
  />
2013
- ${e?q`<div class="validation-message">${e}</div>`:this.hint?q`<div class="hint">${this.hint}</div>`:""}
2369
+ ${e?I`<div class="validation-message">${e}</div>`:this.hint?I`<div class="hint">${this.hint}</div>`:""}
2014
2370
  </div>
2015
- `}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=n`
2371
+ `}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=l`
2016
2372
  :host {
2017
2373
  display: block;
2018
2374
  font-family: inherit;
@@ -2079,14 +2435,14 @@ const We=e=>e??V
2079
2435
  font-size: 0.75rem;
2080
2436
  color: var(--kr-text-field-helper-color, #6b7280);
2081
2437
  }
2082
- `,e.KRTextField.formAssociated=!0,Qe([pe({type:String})],e.KRTextField.prototype,"label",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"name",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"value",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"placeholder",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"type",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"required",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),Qe([pe({type:Number})],e.KRTextField.prototype,"minlength",void 0),Qe([pe({type:Number})],e.KRTextField.prototype,"maxlength",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"pattern",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"autocomplete",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"hint",void 0),Qe([ge("input")],e.KRTextField.prototype,"_input",void 0),Qe([ue()],e.KRTextField.prototype,"_touched",void 0),Qe([ue()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=Qe([de("kr-text-field")],e.KRTextField);var Xe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRSelectField=class extends ne{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="Select an option",this.disabled=!1,this.required=!1,this.readonly=!1,this.hint="",this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._handleOutsideClick=e=>{e.composedPath().includes(this)||this._close()},this._handleKeyDown=e=>{if(!this._isOpen)return;const t=Array.from(this.querySelectorAll("kr-select-option"));switch(e.key){case"Escape":this._close(),this._triggerElement?.focus();break;case"ArrowDown":if(e.preventDefault(),t.some((e=>!e.disabled))){let e=this._highlightedIndex+1;for(;e<t.length&&t[e]?.disabled;)e++;e<t.length&&(this._highlightedIndex=e)}break;case"ArrowUp":e.preventDefault();{let e=this._highlightedIndex-1;for(;e>=0&&t[e]?.disabled;)e--;e>=0&&(this._highlightedIndex=e)}break;case"Enter":e.preventDefault(),this._highlightedIndex>=0&&this._highlightedIndex<t.length&&this._selectOption(t[this._highlightedIndex])}},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick),document.addEventListener("keydown",this._handleKeyDown),this.addEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick),document.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("invalid",this._handleInvalid)}_toggle(){if(!this.disabled&&!this.readonly)if(this._isOpen)this._close();else{this._isOpen=!0;const e=Array.from(this.querySelectorAll("kr-select-option"));this._highlightedIndex=e.findIndex((e=>e.value===this.value)),requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".select-dropdown");if(e){const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8;e.style.top=t.bottom+4+"px",e.style.left=t.left+"px",e.style.width=t.width+"px",e.style.maxHeight=i+"px"}}))}}_close(){this._isOpen=!1,this._highlightedIndex=-1}_selectOption(e){e.disabled||(this.value=e.value,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._close(),this._triggerElement?.focus())}_handleBlur(){this._touched=!0,this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option",this._triggerElement):this._internals.setValidity({})}render(){const e=Array.from(this.querySelectorAll("kr-select-option")),t=e.find((e=>e.value===this.value))?.label;return q`
2438
+ `,e.KRTextField.formAssociated=!0,Je([pe({type:String})],e.KRTextField.prototype,"label",void 0),Je([pe({type:String})],e.KRTextField.prototype,"name",void 0),Je([pe({type:String})],e.KRTextField.prototype,"value",void 0),Je([pe({type:String})],e.KRTextField.prototype,"placeholder",void 0),Je([pe({type:String})],e.KRTextField.prototype,"type",void 0),Je([pe({type:Boolean})],e.KRTextField.prototype,"required",void 0),Je([pe({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),Je([pe({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),Je([pe({type:Number})],e.KRTextField.prototype,"minlength",void 0),Je([pe({type:Number})],e.KRTextField.prototype,"maxlength",void 0),Je([pe({type:String})],e.KRTextField.prototype,"pattern",void 0),Je([pe({type:String})],e.KRTextField.prototype,"autocomplete",void 0),Je([pe({type:String})],e.KRTextField.prototype,"hint",void 0),Je([ge("input")],e.KRTextField.prototype,"_input",void 0),Je([ue()],e.KRTextField.prototype,"_touched",void 0),Je([ue()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=Je([de("kr-text-field")],e.KRTextField);var et=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRSelectField=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="Select an option",this.disabled=!1,this.required=!1,this.readonly=!1,this.hint="",this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._handleOutsideClick=e=>{e.composedPath().includes(this)||this._close()},this._handleKeyDown=e=>{if(!this._isOpen)return;const t=Array.from(this.querySelectorAll("kr-select-option"));switch(e.key){case"Escape":this._close(),this._triggerElement?.focus();break;case"ArrowDown":if(e.preventDefault(),t.some((e=>!e.disabled))){let e=this._highlightedIndex+1;for(;e<t.length&&t[e]?.disabled;)e++;e<t.length&&(this._highlightedIndex=e)}break;case"ArrowUp":e.preventDefault();{let e=this._highlightedIndex-1;for(;e>=0&&t[e]?.disabled;)e--;e>=0&&(this._highlightedIndex=e)}break;case"Enter":e.preventDefault(),this._highlightedIndex>=0&&this._highlightedIndex<t.length&&this._selectOption(t[this._highlightedIndex])}},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick),document.addEventListener("keydown",this._handleKeyDown),this.addEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick),document.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("invalid",this._handleInvalid)}_toggle(){if(!this.disabled&&!this.readonly)if(this._isOpen)this._close();else{this._isOpen=!0;const e=Array.from(this.querySelectorAll("kr-select-option"));this._highlightedIndex=e.findIndex((e=>e.value===this.value)),requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".select-dropdown");if(e){const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8;e.style.top=t.bottom+4+"px",e.style.left=t.left+"px",e.style.width=t.width+"px",e.style.maxHeight=i+"px"}}))}}_close(){this._isOpen=!1,this._highlightedIndex=-1}_selectOption(e){e.disabled||(this.value=e.value,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._close(),this._triggerElement?.focus())}_handleBlur(){this._touched=!0,this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option",this._triggerElement):this._internals.setValidity({})}render(){const e=Array.from(this.querySelectorAll("kr-select-option")),t=e.find((e=>e.value===this.value))?.label;return I`
2083
2439
  <div class="wrapper">
2084
- ${this.label?q`
2440
+ ${this.label?I`
2085
2441
  <label>
2086
2442
  ${this.label}
2087
- ${this.required?q`<span class="required" aria-hidden="true">*</span>`:""}
2443
+ ${this.required?I`<span class="required" aria-hidden="true">*</span>`:""}
2088
2444
  </label>
2089
- `:V}
2445
+ `:q}
2090
2446
  <div class="select-wrapper">
2091
2447
  <button
2092
2448
  class=${ke({"select-trigger":!0,"select-trigger--open":this._isOpen,"select-trigger--invalid":this._touched&&this.required&&!this.value})}
@@ -2111,7 +2467,7 @@ const We=e=>e??V
2111
2467
 
2112
2468
  <div class=${ke({"select-dropdown":!0,hidden:!this._isOpen})} role="listbox">
2113
2469
  <div class="select-options">
2114
- ${0===e.length?q`<div class="select-empty">No options available</div>`:e.map(((e,t)=>{const i=e.value===this.value;return q`
2470
+ ${0===e.length?I`<div class="select-empty">No options available</div>`:e.map(((e,t)=>{const i=e.value===this.value;return I`
2115
2471
  <div
2116
2472
  class=${ke({"select-option":!0,"select-option--selected":i,"select-option--disabled":e.disabled,"select-option--highlighted":t===this._highlightedIndex})}
2117
2473
  role="option"
@@ -2125,12 +2481,12 @@ const We=e=>e??V
2125
2481
  </div>
2126
2482
  </div>
2127
2483
  </div>
2128
- ${this._touched&&this.required&&!this.value?q`<div class="validation-message">Please select an option</div>`:this.hint?q`<div class="hint">${this.hint}</div>`:""}
2484
+ ${this._touched&&this.required&&!this.value?I`<div class="validation-message">Please select an option</div>`:this.hint?I`<div class="hint">${this.hint}</div>`:""}
2129
2485
  </div>
2130
2486
  <div class="options-slot">
2131
2487
  <slot @slotchange=${()=>this.requestUpdate()}></slot>
2132
2488
  </div>
2133
- `}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}},e.KRSelectField.styles=[ae,n`
2489
+ `}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}},e.KRSelectField.styles=[ae,l`
2134
2490
  :host {
2135
2491
  display: block;
2136
2492
  font-family: inherit;
@@ -2306,39 +2662,39 @@ const We=e=>e??V
2306
2662
  .options-slot {
2307
2663
  display: none;
2308
2664
  }
2309
- `],e.KRSelectField.formAssociated=!0,Xe([pe({type:String})],e.KRSelectField.prototype,"label",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"name",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"value",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"placeholder",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"required",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"hint",void 0),Xe([ue()],e.KRSelectField.prototype,"_isOpen",void 0),Xe([ue()],e.KRSelectField.prototype,"_highlightedIndex",void 0),Xe([ue()],e.KRSelectField.prototype,"_touched",void 0),Xe([ge(".select-trigger")],e.KRSelectField.prototype,"_triggerElement",void 0),e.KRSelectField=Xe([de("kr-select-field")],e.KRSelectField);var Ye=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRSelectOption=class extends ne{constructor(){super(...arguments),this.value="",this.disabled=!1}get label(){return this.textContent?.trim()||""}render(){return q`<slot></slot>`}},e.KRSelectOption.styles=n`
2665
+ `],e.KRSelectField.formAssociated=!0,et([pe({type:String})],e.KRSelectField.prototype,"label",void 0),et([pe({type:String})],e.KRSelectField.prototype,"name",void 0),et([pe({type:String})],e.KRSelectField.prototype,"value",void 0),et([pe({type:String})],e.KRSelectField.prototype,"placeholder",void 0),et([pe({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),et([pe({type:Boolean})],e.KRSelectField.prototype,"required",void 0),et([pe({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),et([pe({type:String})],e.KRSelectField.prototype,"hint",void 0),et([ue()],e.KRSelectField.prototype,"_isOpen",void 0),et([ue()],e.KRSelectField.prototype,"_highlightedIndex",void 0),et([ue()],e.KRSelectField.prototype,"_touched",void 0),et([ge(".select-trigger")],e.KRSelectField.prototype,"_triggerElement",void 0),e.KRSelectField=et([de("kr-select-field")],e.KRSelectField);var tt=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRSelectOption=class extends le{constructor(){super(...arguments),this.value="",this.disabled=!1}get label(){return this.textContent?.trim()||""}render(){return I`<slot></slot>`}},e.KRSelectOption.styles=l`
2310
2666
  :host {
2311
2667
  display: none;
2312
2668
  }
2313
- `,Ye([pe({type:String})],e.KRSelectOption.prototype,"value",void 0),Ye([pe({type:Boolean})],e.KRSelectOption.prototype,"disabled",void 0),e.KRSelectOption=Ye([de("kr-select-option")],e.KRSelectOption);var Je=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRTextareaField=class extends ne{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=3,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._textarea&&this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}render(){let e="";return this._touched&&this._textarea&&!this._textarea.validity.valid&&(e=this._textarea.validationMessage),q`
2669
+ `,tt([pe({type:String})],e.KRSelectOption.prototype,"value",void 0),tt([pe({type:Boolean})],e.KRSelectOption.prototype,"disabled",void 0),e.KRSelectOption=tt([de("kr-select-option")],e.KRSelectOption);var it=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRTextareaField=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=3,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._textarea&&this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}render(){let e="";return this._touched&&this._textarea&&!this._textarea.validity.valid&&(e=this._textarea.validationMessage),I`
2314
2670
  <div class="wrapper">
2315
- ${this.label?q`
2671
+ ${this.label?I`
2316
2672
  <label for="textarea">
2317
2673
  ${this.label}
2318
- ${this.required?q`<span class="required" aria-hidden="true">*</span>`:V}
2674
+ ${this.required?I`<span class="required" aria-hidden="true">*</span>`:q}
2319
2675
  </label>
2320
- `:V}
2676
+ `:q}
2321
2677
  <textarea
2322
2678
  id="textarea"
2323
2679
  class=${ke({"textarea--invalid":this._touched&&this._textarea&&!this._textarea.validity.valid})}
2324
2680
  name=${this.name}
2325
- .value=${Ge(this.value)}
2681
+ .value=${Qe(this.value)}
2326
2682
  placeholder=${this.placeholder}
2327
2683
  ?required=${this.required}
2328
2684
  ?disabled=${this.disabled}
2329
2685
  ?readonly=${this.readonly}
2330
2686
  rows=${this.rows}
2331
- cols=${We(this.cols)}
2332
- minlength=${We(this.minlength)}
2333
- maxlength=${We(this.maxlength)}
2334
- autocomplete=${We(this.autocomplete||void 0)}
2687
+ cols=${Ze(this.cols)}
2688
+ minlength=${Ze(this.minlength)}
2689
+ maxlength=${Ze(this.maxlength)}
2690
+ autocomplete=${Ze(this.autocomplete||void 0)}
2335
2691
  @input=${this._handleInput}
2336
2692
  @change=${this._handleChange}
2337
2693
  @blur=${this._handleBlur}
2338
2694
  ></textarea>
2339
- ${e?q`<div class="validation-message">${e}</div>`:this.hint?q`<div class="hint">${this.hint}</div>`:V}
2695
+ ${e?I`<div class="validation-message">${e}</div>`:this.hint?I`<div class="hint">${this.hint}</div>`:q}
2340
2696
  </div>
2341
- `}focus(){this._textarea?.focus()}blur(){this._textarea?.blur()}select(){this._textarea?.select()}},e.KRTextareaField.styles=n`
2697
+ `}focus(){this._textarea?.focus()}blur(){this._textarea?.blur()}select(){this._textarea?.select()}},e.KRTextareaField.styles=l`
2342
2698
  :host {
2343
2699
  display: block;
2344
2700
  font-family: inherit;
@@ -2408,12 +2764,12 @@ const We=e=>e??V
2408
2764
  font-size: 0.75rem;
2409
2765
  color: var(--kr-textarea-field-helper-color, #6b7280);
2410
2766
  }
2411
- `,e.KRTextareaField.formAssociated=!0,Je([pe({type:String})],e.KRTextareaField.prototype,"label",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"name",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"value",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"rows",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"cols",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"hint",void 0),Je([ge("textarea")],e.KRTextareaField.prototype,"_textarea",void 0),Je([ue()],e.KRTextareaField.prototype,"_touched",void 0),Je([ue()],e.KRTextareaField.prototype,"_dirty",void 0),e.KRTextareaField=Je([de("kr-textarea-field")],e.KRTextareaField);var et=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tt=class extends ne{constructor(){super(...arguments),this.label="",this.value=""}render(){return q`
2767
+ `,e.KRTextareaField.formAssociated=!0,it([pe({type:String})],e.KRTextareaField.prototype,"label",void 0),it([pe({type:String})],e.KRTextareaField.prototype,"name",void 0),it([pe({type:String})],e.KRTextareaField.prototype,"value",void 0),it([pe({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),it([pe({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),it([pe({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),it([pe({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),it([pe({type:Number})],e.KRTextareaField.prototype,"rows",void 0),it([pe({type:Number})],e.KRTextareaField.prototype,"cols",void 0),it([pe({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),it([pe({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),it([pe({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),it([pe({type:String})],e.KRTextareaField.prototype,"hint",void 0),it([ge("textarea")],e.KRTextareaField.prototype,"_textarea",void 0),it([ue()],e.KRTextareaField.prototype,"_touched",void 0),it([ue()],e.KRTextareaField.prototype,"_dirty",void 0),e.KRTextareaField=it([de("kr-textarea-field")],e.KRTextareaField);var ot=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};let st=class extends le{constructor(){super(...arguments),this.label="",this.value=""}render(){return I`
2412
2768
  <div class="wrapper">
2413
- ${this.label?q`<label>${this.label}</label>`:V}
2769
+ ${this.label?I`<label>${this.label}</label>`:q}
2414
2770
  <div class="value">${this.value}</div>
2415
2771
  </div>
2416
- `}};tt.styles=n`
2772
+ `}};st.styles=l`
2417
2773
  :host {
2418
2774
  display: block;
2419
2775
  font-family: inherit;
@@ -2435,7 +2791,7 @@ const We=e=>e??V
2435
2791
  font-size: 14px;
2436
2792
  color: black;
2437
2793
  }
2438
- `,et([pe({type:String})],tt.prototype,"label",void 0),et([pe({type:String})],tt.prototype,"value",void 0),tt=et([de("kr-detail-field")],tt);var it=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};function ot(e){return"options"in e}e.KRAutoSuggest=class extends ne{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint="",this.options=[],this.statusType="finished",this.loadingText="Loading...",this.errorText="Error loading options",this.emptyText="No matches found",this.filteringType="auto",this.highlightMatches=!0,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._dirty=!1,this._handleDocumentClick=this._onDocumentClick.bind(this),this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick)}firstUpdated(){this._updateFormValue()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._isOpen=!1,this._highlightedIndex=-1,this._updateFormValue()}formStateRestoreCallback(e){this.value=e}get _filteredOptions(){if("manual"===this.filteringType||!this.value)return this.options;const e=this.value.toLowerCase(),t=[];for(const i of this.options)if(ot(i)){const o=i.options.filter((t=>{const i=(t.label||t.value).toLowerCase(),o=t.filteringTags?.join(" ").toLowerCase()||"";return i.includes(e)||o.includes(e)}));o.length>0&&t.push({...i,options:o})}else{const o=(i.label||i.value).toLowerCase(),s=i.filteringTags?.join(" ").toLowerCase()||"";(o.includes(e)||s.includes(e))&&t.push(i)}return t}get _flatOptions(){const e=[];for(const t of this._filteredOptions)ot(t)?e.push(...t.options):e.push(t);return e}_updateFormValue(){this._internals.setFormValue(this.value),this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"This field is required",this._input):this._internals.setValidity({})}_onInput(e){const t=e.target;this.value=t.value,this._dirty=!0,this._isOpen=!0,this._highlightedIndex=-1,this._updateFormValue(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),"manual"===this.filteringType&&this.dispatchEvent(new CustomEvent("load-items",{detail:{filteringText:this.value},bubbles:!0,composed:!0}))}_onFocus(){this._isOpen=!0,"manual"===this.filteringType&&this.dispatchEvent(new CustomEvent("load-items",{detail:{filteringText:this.value},bubbles:!0,composed:!0}))}_onBlur(){this._touched=!0,setTimeout((()=>{this._isOpen=!1,this._highlightedIndex=-1}),200),this._updateFormValue()}_onKeyDown(e){const t=this._flatOptions;switch(e.key){case"ArrowDown":e.preventDefault(),this._isOpen=!0,this._highlightedIndex=Math.min(this._highlightedIndex+1,t.length-1),this._scrollToHighlighted();break;case"ArrowUp":e.preventDefault(),this._highlightedIndex=Math.max(this._highlightedIndex-1,-1),this._scrollToHighlighted();break;case"Enter":this._highlightedIndex>=0&&t[this._highlightedIndex]&&(e.preventDefault(),this._selectOption(t[this._highlightedIndex]));break;case"Escape":e.preventDefault(),this._isOpen=!1,this._highlightedIndex=-1;break;case"Tab":this._isOpen=!1,this._highlightedIndex=-1}}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(".dropdown"),t=this.shadowRoot?.querySelector(".option.is-highlighted");if(e&&t){const i=e.getBoundingClientRect(),o=t.getBoundingClientRect();(o.bottom>i.bottom||o.top<i.top)&&t.scrollIntoView({block:"nearest"})}}))}_selectOption(e){e.disabled||(this.value=e.label||e.value,this._isOpen=!1,this._highlightedIndex=-1,this._dirty=!0,this._updateFormValue(),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,selectedOption:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_handleClear(){this.value="",this._updateFormValue(),this.dispatchEvent(new CustomEvent("change",{detail:{value:""},bubbles:!0,composed:!0})),this._input?.focus()}_onDocumentClick(e){e.composedPath().includes(this)||(this._isOpen=!1)}_highlightMatch(e){if(!this.value||"manual"===this.filteringType||!this.highlightMatches)return q`${e}`;const t=this.value.toLowerCase(),i=e.toLowerCase().indexOf(t);if(-1===i)return q`${e}`;const o=e.slice(0,i),s=e.slice(i,i+this.value.length),r=e.slice(i+this.value.length);return q`${o}<span class="highlight">${s}</span>${r}`}_renderOption(e,t){const i=t===this._highlightedIndex;return q`
2794
+ `,ot([pe({type:String})],st.prototype,"label",void 0),ot([pe({type:String})],st.prototype,"value",void 0),st=ot([de("kr-detail-field")],st);var rt=function(e,t,i,o){var s,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(r<3?s(l):r>3?s(t,i,l):s(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};function lt(e){return"options"in e}e.KRAutoSuggest=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint="",this.options=[],this.statusType="finished",this.loadingText="Loading...",this.errorText="Error loading options",this.emptyText="No matches found",this.filteringType="auto",this.highlightMatches=!0,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._dirty=!1,this._handleDocumentClick=this._onDocumentClick.bind(this),this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick)}firstUpdated(){this._updateFormValue()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._isOpen=!1,this._highlightedIndex=-1,this._updateFormValue()}formStateRestoreCallback(e){this.value=e}get _filteredOptions(){if("manual"===this.filteringType||!this.value)return this.options;const e=this.value.toLowerCase(),t=[];for(const i of this.options)if(lt(i)){const o=i.options.filter((t=>{const i=(t.label||t.value).toLowerCase(),o=t.filteringTags?.join(" ").toLowerCase()||"";return i.includes(e)||o.includes(e)}));o.length>0&&t.push({...i,options:o})}else{const o=(i.label||i.value).toLowerCase(),s=i.filteringTags?.join(" ").toLowerCase()||"";(o.includes(e)||s.includes(e))&&t.push(i)}return t}get _flatOptions(){const e=[];for(const t of this._filteredOptions)lt(t)?e.push(...t.options):e.push(t);return e}_updateFormValue(){this._internals.setFormValue(this.value),this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"This field is required",this._input):this._internals.setValidity({})}_onInput(e){const t=e.target;this.value=t.value,this._dirty=!0,this._isOpen=!0,this._highlightedIndex=-1,this._updateFormValue(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),"manual"===this.filteringType&&this.dispatchEvent(new CustomEvent("load-items",{detail:{filteringText:this.value},bubbles:!0,composed:!0}))}_onFocus(){this._isOpen=!0,"manual"===this.filteringType&&this.dispatchEvent(new CustomEvent("load-items",{detail:{filteringText:this.value},bubbles:!0,composed:!0}))}_onBlur(){this._touched=!0,setTimeout((()=>{this._isOpen=!1,this._highlightedIndex=-1}),200),this._updateFormValue()}_onKeyDown(e){const t=this._flatOptions;switch(e.key){case"ArrowDown":e.preventDefault(),this._isOpen=!0,this._highlightedIndex=Math.min(this._highlightedIndex+1,t.length-1),this._scrollToHighlighted();break;case"ArrowUp":e.preventDefault(),this._highlightedIndex=Math.max(this._highlightedIndex-1,-1),this._scrollToHighlighted();break;case"Enter":this._highlightedIndex>=0&&t[this._highlightedIndex]&&(e.preventDefault(),this._selectOption(t[this._highlightedIndex]));break;case"Escape":e.preventDefault(),this._isOpen=!1,this._highlightedIndex=-1;break;case"Tab":this._isOpen=!1,this._highlightedIndex=-1}}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(".dropdown"),t=this.shadowRoot?.querySelector(".option.is-highlighted");if(e&&t){const i=e.getBoundingClientRect(),o=t.getBoundingClientRect();(o.bottom>i.bottom||o.top<i.top)&&t.scrollIntoView({block:"nearest"})}}))}_selectOption(e){e.disabled||(this.value=e.label||e.value,this._isOpen=!1,this._highlightedIndex=-1,this._dirty=!0,this._updateFormValue(),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,selectedOption:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_handleClear(){this.value="",this._updateFormValue(),this.dispatchEvent(new CustomEvent("change",{detail:{value:""},bubbles:!0,composed:!0})),this._input?.focus()}_onDocumentClick(e){e.composedPath().includes(this)||(this._isOpen=!1)}_highlightMatch(e){if(!this.value||"manual"===this.filteringType||!this.highlightMatches)return I`${e}`;const t=this.value.toLowerCase(),i=e.toLowerCase().indexOf(t);if(-1===i)return I`${e}`;const o=e.slice(0,i),s=e.slice(i,i+this.value.length),r=e.slice(i+this.value.length);return I`${o}<span class="highlight">${s}</span>${r}`}_renderOption(e,t){const i=t===this._highlightedIndex;return I`
2439
2795
  <button
2440
2796
  class=${ke({option:!0,"is-highlighted":i})}
2441
2797
  type="button"
@@ -2448,22 +2804,22 @@ const We=e=>e??V
2448
2804
  <div class="option-content">
2449
2805
  <div class="option-label">
2450
2806
  ${this._highlightMatch(e.label||e.value)}
2451
- ${e.labelTag?q`<span class="option-tag">${e.labelTag}</span>`:V}
2807
+ ${e.labelTag?I`<span class="option-tag">${e.labelTag}</span>`:q}
2452
2808
  </div>
2453
- ${e.description?q`<div class="option-description">${e.description}</div>`:V}
2454
- ${e.tags&&e.tags.length>0?q`
2809
+ ${e.description?I`<div class="option-description">${e.description}</div>`:q}
2810
+ ${e.tags&&e.tags.length>0?I`
2455
2811
  <div class="option-tags">
2456
- ${e.tags.map((e=>q`<span class="option-tag">${e}</span>`))}
2812
+ ${e.tags.map((e=>I`<span class="option-tag">${e}</span>`))}
2457
2813
  </div>
2458
- `:V}
2814
+ `:q}
2459
2815
  </div>
2460
2816
  </button>
2461
- `}_renderDropdownContent(){if("loading"===this.statusType)return q`
2817
+ `}_renderDropdownContent(){if("loading"===this.statusType)return I`
2462
2818
  <div class="status">
2463
2819
  <div class="spinner"></div>
2464
2820
  ${this.loadingText}
2465
2821
  </div>
2466
- `;if("error"===this.statusType)return q`
2822
+ `;if("error"===this.statusType)return I`
2467
2823
  <div class="status is-error">
2468
2824
  <svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
2469
2825
  <path
@@ -2472,30 +2828,30 @@ const We=e=>e??V
2472
2828
  </svg>
2473
2829
  ${this.errorText}
2474
2830
  </div>
2475
- `;const e=this._filteredOptions;if(0===e.length)return q`<div class="empty">${this.emptyText}</div>`;let t=0;return q`
2476
- ${e.map((e=>{if(ot(e)){const i=e.options.map((e=>{const i=this._renderOption(e,t);return t++,i}));return q`
2831
+ `;const e=this._filteredOptions;if(0===e.length)return I`<div class="empty">${this.emptyText}</div>`;let t=0;return I`
2832
+ ${e.map((e=>{if(lt(e)){const i=e.options.map((e=>{const i=this._renderOption(e,t);return t++,i}));return I`
2477
2833
  <div class="group-label">${e.label}</div>
2478
2834
  ${i}
2479
2835
  `}const i=this._renderOption(e,t);return t++,i}))}
2480
- `}render(){const e=this._touched&&!this.validity.valid;return q`
2836
+ `}render(){const e=this._touched&&!this.validity.valid;return I`
2481
2837
  <div class="field-wrapper">
2482
- ${this.label?q`
2838
+ ${this.label?I`
2483
2839
  <label>
2484
2840
  ${this.label}
2485
- ${this.required?q`<span class="required">*</span>`:V}
2841
+ ${this.required?I`<span class="required">*</span>`:q}
2486
2842
  </label>
2487
- `:V}
2843
+ `:q}
2488
2844
 
2489
2845
  <div class="input-container">
2490
2846
  <div class="input-wrapper">
2491
2847
  <input
2492
2848
  type="text"
2493
- .value=${Ge(this.value)}
2494
- placeholder=${We(this.placeholder||void 0)}
2849
+ .value=${Qe(this.value)}
2850
+ placeholder=${Ze(this.placeholder||void 0)}
2495
2851
  ?disabled=${this.disabled}
2496
2852
  ?readonly=${this.readonly}
2497
2853
  ?required=${this.required}
2498
- name=${We(this.name||void 0)}
2854
+ name=${Ze(this.name||void 0)}
2499
2855
  autocomplete="off"
2500
2856
  role="combobox"
2501
2857
  aria-autocomplete="list"
@@ -2508,7 +2864,7 @@ const We=e=>e??V
2508
2864
  @keydown=${this._onKeyDown}
2509
2865
  />
2510
2866
  <div class="icon-container">
2511
- ${!this.value||this.disabled||this.readonly?"":q`
2867
+ ${!this.value||this.disabled||this.readonly?"":I`
2512
2868
  <button
2513
2869
  class="clear-button"
2514
2870
  type="button"
@@ -2522,7 +2878,7 @@ const We=e=>e??V
2522
2878
  </svg>
2523
2879
  </button>
2524
2880
  `}
2525
- ${this.value||this.disabled||this.readonly?"":q`
2881
+ ${this.value||this.disabled||this.readonly?"":I`
2526
2882
  <svg class="search-icon" fill="currentColor" viewBox="0 0 16 16">
2527
2883
  <path
2528
2884
  d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
@@ -2541,9 +2897,9 @@ const We=e=>e??V
2541
2897
  </div>
2542
2898
  </div>
2543
2899
 
2544
- ${e?q`<div class="validation-message">${this.validationMessage}</div>`:this.hint?q`<div class="hint">${this.hint}</div>`:V}
2900
+ ${e?I`<div class="validation-message">${this.validationMessage}</div>`:this.hint?I`<div class="hint">${this.hint}</div>`:q}
2545
2901
  </div>
2546
- `}},e.KRAutoSuggest.styles=n`
2902
+ `}},e.KRAutoSuggest.styles=l`
2547
2903
  :host {
2548
2904
  display: block;
2549
2905
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
@@ -2807,5 +3163,5 @@ const We=e=>e??V
2807
3163
  color: var(--kr-text-field-error-border-color, #ef4444);
2808
3164
  margin-top: 2px;
2809
3165
  }
2810
- `,e.KRAutoSuggest.formAssociated=!0,it([pe({type:String})],e.KRAutoSuggest.prototype,"label",void 0),it([pe({type:String})],e.KRAutoSuggest.prototype,"name",void 0),it([pe({type:String})],e.KRAutoSuggest.prototype,"value",void 0),it([pe({type:String})],e.KRAutoSuggest.prototype,"placeholder",void 0),it([pe({type:Boolean})],e.KRAutoSuggest.prototype,"disabled",void 0),it([pe({type:Boolean})],e.KRAutoSuggest.prototype,"readonly",void 0),it([pe({type:Boolean})],e.KRAutoSuggest.prototype,"required",void 0),it([pe({type:String})],e.KRAutoSuggest.prototype,"hint",void 0),it([pe({type:Array})],e.KRAutoSuggest.prototype,"options",void 0),it([pe({type:String,attribute:"status-type"})],e.KRAutoSuggest.prototype,"statusType",void 0),it([pe({type:String,attribute:"loading-text"})],e.KRAutoSuggest.prototype,"loadingText",void 0),it([pe({type:String,attribute:"error-text"})],e.KRAutoSuggest.prototype,"errorText",void 0),it([pe({type:String,attribute:"empty-text"})],e.KRAutoSuggest.prototype,"emptyText",void 0),it([pe({type:String,attribute:"filtering-type"})],e.KRAutoSuggest.prototype,"filteringType",void 0),it([pe({type:Boolean,attribute:"highlight-matches"})],e.KRAutoSuggest.prototype,"highlightMatches",void 0),it([ue()],e.KRAutoSuggest.prototype,"_isOpen",void 0),it([ue()],e.KRAutoSuggest.prototype,"_highlightedIndex",void 0),it([ue()],e.KRAutoSuggest.prototype,"_touched",void 0),it([ue()],e.KRAutoSuggest.prototype,"_dirty",void 0),it([ge("input")],e.KRAutoSuggest.prototype,"_input",void 0),e.KRAutoSuggest=it([de("kr-auto-suggest")],e.KRAutoSuggest),e.KRDialogRef=De,e.krBaseCSS=ae})),function(e){Object.keys(e).forEach((function(t){t.startsWith("KR")&&"function"==typeof e[t]&&(e[t.slice(2)]=e[t],delete e[t])}))}(kr);
3166
+ `,e.KRAutoSuggest.formAssociated=!0,rt([pe({type:String})],e.KRAutoSuggest.prototype,"label",void 0),rt([pe({type:String})],e.KRAutoSuggest.prototype,"name",void 0),rt([pe({type:String})],e.KRAutoSuggest.prototype,"value",void 0),rt([pe({type:String})],e.KRAutoSuggest.prototype,"placeholder",void 0),rt([pe({type:Boolean})],e.KRAutoSuggest.prototype,"disabled",void 0),rt([pe({type:Boolean})],e.KRAutoSuggest.prototype,"readonly",void 0),rt([pe({type:Boolean})],e.KRAutoSuggest.prototype,"required",void 0),rt([pe({type:String})],e.KRAutoSuggest.prototype,"hint",void 0),rt([pe({type:Array})],e.KRAutoSuggest.prototype,"options",void 0),rt([pe({type:String,attribute:"status-type"})],e.KRAutoSuggest.prototype,"statusType",void 0),rt([pe({type:String,attribute:"loading-text"})],e.KRAutoSuggest.prototype,"loadingText",void 0),rt([pe({type:String,attribute:"error-text"})],e.KRAutoSuggest.prototype,"errorText",void 0),rt([pe({type:String,attribute:"empty-text"})],e.KRAutoSuggest.prototype,"emptyText",void 0),rt([pe({type:String,attribute:"filtering-type"})],e.KRAutoSuggest.prototype,"filteringType",void 0),rt([pe({type:Boolean,attribute:"highlight-matches"})],e.KRAutoSuggest.prototype,"highlightMatches",void 0),rt([ue()],e.KRAutoSuggest.prototype,"_isOpen",void 0),rt([ue()],e.KRAutoSuggest.prototype,"_highlightedIndex",void 0),rt([ue()],e.KRAutoSuggest.prototype,"_touched",void 0),rt([ue()],e.KRAutoSuggest.prototype,"_dirty",void 0),rt([ge("input")],e.KRAutoSuggest.prototype,"_input",void 0),e.KRAutoSuggest=rt([de("kr-auto-suggest")],e.KRAutoSuggest),e.KRDialogRef=je,e.krBaseCSS=ae})),function(e){Object.keys(e).forEach((function(t){t.startsWith("KR")&&"function"==typeof e[t]&&(e[t.slice(2)]=e[t])}))}(kr);
2811
3167
  //# sourceMappingURL=krubble-components.umd.min.js.map