@kodaris/krubble-app-components 1.0.13 → 1.0.15

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.
@@ -14,12 +14,12 @@ import{KRContextMenu as e,KRDialog as t}from"@kodaris/krubble-components";import
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const I=globalThis,E=e=>e,A=I.trustedTypes,C=A?A.createPolicy("lit-html",{createHTML:e=>e}):void 0,N="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,S="?"+M,D=`<${S}>`,z=document,O=()=>z.createComment(""),P=e=>null===e||"object"!=typeof e&&"function"!=typeof e,U=Array.isArray,R="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,H=/>/g,L=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),X=/'/g,F=/"/g,q=/^(?:script|style|textarea|title)$/i,B=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),Y=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),Q=new WeakMap,W=z.createTreeWalker(z,129);function K(e,t){if(!U(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(t):t}const G=(e,t)=>{const i=e.length-1,r=[];let s,a=2===t?"<svg>":3===t?"<math>":"",n=T;for(let t=0;t<i;t++){const i=e[t];let o,l,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===T?"!--"===l[1]?n=j:void 0!==l[1]?n=H:void 0!==l[2]?(q.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=L):void 0!==l[3]&&(n=L):n===L?">"===l[0]?(n=s??T,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,o=l[1],n=void 0===l[3]?L:'"'===l[3]?F:X):n===F||n===X?n=L:n===j||n===H?n=T:(n=L,s=void 0);const p=n===L&&e[t+1].startsWith("/>")?" ":"";a+=n===T?i+D:d>=0?(r.push(o),i.slice(0,d)+N+i.slice(d)+M+p):i+M+(-2===d?t:p)}return[K(e,a+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]};class J{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,a=0;const n=e.length-1,o=this.parts,[l,d]=G(e,t);if(this.el=J.createElement(l,i),W.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=W.nextNode())&&o.length<n;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(N)){const t=d[a++],i=r.getAttribute(e).split(M),n=/([.?@])?(.*)/.exec(t);o.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?re:"?"===n[1]?se:"@"===n[1]?ae:ie}),r.removeAttribute(e)}else e.startsWith(M)&&(o.push({type:6,index:s}),r.removeAttribute(e));if(q.test(r.tagName)){const e=r.textContent.split(M),t=e.length-1;if(t>0){r.textContent=A?A.emptyScript:"";for(let i=0;i<t;i++)r.append(e[i],O()),W.nextNode(),o.push({type:2,index:++s});r.append(e[t],O())}}}else if(8===r.nodeType)if(r.data===S)o.push({type:2,index:s});else{let e=-1;for(;-1!==(e=r.data.indexOf(M,e+1));)o.push({type:7,index:s}),e+=M.length-1}s++}}static createElement(e,t){const i=z.createElement("template");return i.innerHTML=e,i}}function Z(e,t,i=e,r){if(t===Y)return t;let s=void 0!==r?i._$Co?.[r]:i._$Cl;const a=P(t)?void 0:t._$litDirective$;return s?.constructor!==a&&(s?._$AO?.(!1),void 0===a?s=void 0:(s=new a(e),s._$AT(e,i,r)),void 0!==r?(i._$Co??=[])[r]=s:i._$Cl=s),void 0!==s&&(t=Z(e,s._$AS(e,t.values),s,r)),t}class ee{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,r=(e?.creationScope??z).importNode(t,!0);W.currentNode=r;let s=W.nextNode(),a=0,n=0,o=i[0];for(;void 0!==o;){if(a===o.index){let t;2===o.type?t=new te(s,s.nextSibling,this,e):1===o.type?t=new o.ctor(s,o.name,o.strings,this,e):6===o.type&&(t=new ne(s,this,e)),this._$AV.push(t),o=i[++n]}a!==o?.index&&(s=W.nextNode(),a++)}return W.currentNode=z,r}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 te{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.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),P(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==Y&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>U(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&&P(this._$AH)?this._$AA.nextSibling.data=e:this.T(z.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,r="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=J.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new ee(r,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=Q.get(e.strings);return void 0===t&&Q.set(e.strings,t=new J(e)),t}k(e){U(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new te(this.O(O()),this.O(O()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=E(e).nextSibling;E(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ie{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,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,r){const s=this.strings;let a=!1;if(void 0===s)e=Z(this,e,t,0),a=!P(e)||e!==this._$AH&&e!==Y,a&&(this._$AH=e);else{const r=e;let n,o;for(e=s[0],n=0;n<s.length-1;n++)o=Z(this,r[i+n],t,n),o===Y&&(o=this._$AH[n]),a||=!P(o)||o!==this._$AH[n],o===V?e=V:e!==V&&(e+=(o??"")+s[n+1]),this._$AH[n]=o}a&&!r&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class re extends ie{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class se extends ie{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class ae extends ie{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Z(this,e,t,0)??V)===Y)return;const i=this._$AH,r=e===V&&i!==V||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==V&&(i===V||r);r&&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 ne{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 oe=I.litHtmlPolyfillSupport;oe?.(J,te),(I.litHtmlVersions??=[]).push("3.3.2");const le=globalThis;
17
+ const I=globalThis,A=e=>e,E=I.trustedTypes,C=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,N="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,S="?"+M,D=`<${S}>`,z=document,O=()=>z.createComment(""),P=e=>null===e||"object"!=typeof e&&"function"!=typeof e,U=Array.isArray,R="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,H=/>/g,L=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),X=/'/g,F=/"/g,q=/^(?:script|style|textarea|title)$/i,B=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),W=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),V=new WeakMap,Q=z.createTreeWalker(z,129);function K(e,t){if(!U(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(t):t}const G=(e,t)=>{const i=e.length-1,r=[];let s,a=2===t?"<svg>":3===t?"<math>":"",n=T;for(let t=0;t<i;t++){const i=e[t];let o,l,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===T?"!--"===l[1]?n=j:void 0!==l[1]?n=H:void 0!==l[2]?(q.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=L):void 0!==l[3]&&(n=L):n===L?">"===l[0]?(n=s??T,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,o=l[1],n=void 0===l[3]?L:'"'===l[3]?F:X):n===F||n===X?n=L:n===j||n===H?n=T:(n=L,s=void 0);const p=n===L&&e[t+1].startsWith("/>")?" ":"";a+=n===T?i+D:d>=0?(r.push(o),i.slice(0,d)+N+i.slice(d)+M+p):i+M+(-2===d?t:p)}return[K(e,a+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]};class J{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,a=0;const n=e.length-1,o=this.parts,[l,d]=G(e,t);if(this.el=J.createElement(l,i),Q.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=Q.nextNode())&&o.length<n;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(N)){const t=d[a++],i=r.getAttribute(e).split(M),n=/([.?@])?(.*)/.exec(t);o.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?re:"?"===n[1]?se:"@"===n[1]?ae:ie}),r.removeAttribute(e)}else e.startsWith(M)&&(o.push({type:6,index:s}),r.removeAttribute(e));if(q.test(r.tagName)){const e=r.textContent.split(M),t=e.length-1;if(t>0){r.textContent=E?E.emptyScript:"";for(let i=0;i<t;i++)r.append(e[i],O()),Q.nextNode(),o.push({type:2,index:++s});r.append(e[t],O())}}}else if(8===r.nodeType)if(r.data===S)o.push({type:2,index:s});else{let e=-1;for(;-1!==(e=r.data.indexOf(M,e+1));)o.push({type:7,index:s}),e+=M.length-1}s++}}static createElement(e,t){const i=z.createElement("template");return i.innerHTML=e,i}}function Z(e,t,i=e,r){if(t===W)return t;let s=void 0!==r?i._$Co?.[r]:i._$Cl;const a=P(t)?void 0:t._$litDirective$;return s?.constructor!==a&&(s?._$AO?.(!1),void 0===a?s=void 0:(s=new a(e),s._$AT(e,i,r)),void 0!==r?(i._$Co??=[])[r]=s:i._$Cl=s),void 0!==s&&(t=Z(e,s._$AS(e,t.values),s,r)),t}class ee{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,r=(e?.creationScope??z).importNode(t,!0);Q.currentNode=r;let s=Q.nextNode(),a=0,n=0,o=i[0];for(;void 0!==o;){if(a===o.index){let t;2===o.type?t=new te(s,s.nextSibling,this,e):1===o.type?t=new o.ctor(s,o.name,o.strings,this,e):6===o.type&&(t=new ne(s,this,e)),this._$AV.push(t),o=i[++n]}a!==o?.index&&(s=Q.nextNode(),a++)}return Q.currentNode=z,r}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 te{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=Y,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.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),P(e)?e===Y||null==e||""===e?(this._$AH!==Y&&this._$AR(),this._$AH=Y):e!==this._$AH&&e!==W&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>U(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!==Y&&P(this._$AH)?this._$AA.nextSibling.data=e:this.T(z.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,r="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=J.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new ee(r,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=V.get(e.strings);return void 0===t&&V.set(e.strings,t=new J(e)),t}k(e){U(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new te(this.O(O()),this.O(O()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=A(e).nextSibling;A(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ie{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=Y,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Y}_$AI(e,t=this,i,r){const s=this.strings;let a=!1;if(void 0===s)e=Z(this,e,t,0),a=!P(e)||e!==this._$AH&&e!==W,a&&(this._$AH=e);else{const r=e;let n,o;for(e=s[0],n=0;n<s.length-1;n++)o=Z(this,r[i+n],t,n),o===W&&(o=this._$AH[n]),a||=!P(o)||o!==this._$AH[n],o===Y?e=Y:e!==Y&&(e+=(o??"")+s[n+1]),this._$AH[n]=o}a&&!r&&this.j(e)}j(e){e===Y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class re extends ie{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Y?void 0:e}}class se extends ie{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Y)}}class ae extends ie{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Z(this,e,t,0)??Y)===W)return;const i=this._$AH,r=e===Y&&i!==Y||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==Y&&(i===Y||r);r&&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 ne{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 oe=I.litHtmlPolyfillSupport;oe?.(J,te),(I.litHtmlVersions??=[]).push("3.3.2");const le=globalThis;
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
- */let de=class extends ${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 r=i?.renderBefore??t;let s=r._$litPart$;if(void 0===s){const e=i?.renderBefore??null;r._$litPart$=s=new te(t.insertBefore(O(),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 Y}};de._$litElement$=!0,de.finalized=!0,le.litElementHydrateSupport?.({LitElement:de});const ce=le.litElementPolyfillSupport;ce?.({LitElement:de}),(le.litElementVersions??=[]).push("4.2.2");
22
+ */let de=class extends ${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 r=i?.renderBefore??t;let s=r._$litPart$;if(void 0===s){const e=i?.renderBefore??null;r._$litPart$=s=new te(t.insertBefore(O(),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 W}};de._$litElement$=!0,de.finalized=!0,le.litElementHydrateSupport?.({LitElement:de});const ce=le.litElementPolyfillSupport;ce?.({LitElement:de}),(le.litElementVersions??=[]).push("4.2.2");
23
23
  /**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
@@ -45,16 +45,16 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
45
45
  * @license
46
46
  * Copyright 2018 Google LLC
47
47
  * SPDX-License-Identifier: BSD-3-Clause
48
- */const _e=be(class extends xe{constructor(e){if(super(e),e.type!==ge||"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 r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return Y}});
48
+ */const _e=be(class extends xe{constructor(e){if(super(e),e.type!==ge||"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 r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return W}});
49
49
  /**
50
50
  * @license
51
51
  * Copyright 2017 Google LLC
52
52
  * SPDX-License-Identifier: BSD-3-Clause
53
- */class ye extends xe{constructor(e){if(super(e),this.it=V,e.type!==me)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===Y)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:[]}}}ye.directiveName="unsafeHTML",ye.resultType=1;const we=be(ye);var ke=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let $e=class extends de{constructor(){super(...arguments),this.logo="https://s3.amazonaws.com/kodariscom/kodariscom/content/website/kodaris-logo-icon-light-53.png",this.apps=[],this.activeAppId="",this.user=null,this.menuItems=[],this.isUserMenuOpen=!1,this.isAppsMenuOpen=!1,this.pendingRequests=0,this.originalFetch=null,this.originalXhrOpen=null,this.defaultLogoutIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"/></svg>',this.appsGridIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"/></svg>',this.closeIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><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>'}connectedCallback(){if(super.connectedCallback(),this.installFetchInterceptor(),!document.getElementById("chatlio-widget-styles")){const e=document.createElement("style");e.id="chatlio-widget-styles",e.textContent="\n .chatlio-title-bar {\n display: none !important;\n }\n \n .chatlio-widget-body {\n bottom: 36px !important;\n }\n ",document.head.appendChild(e)}}disconnectedCallback(){super.disconnectedCallback(),this.uninstallFetchInterceptor()}installFetchInterceptor(){if(this.originalFetch)return;const e=this;this.originalFetch=window.fetch.bind(window);const t=this.originalFetch;window.fetch=function(...i){return e.pendingRequests++,t(...i).finally(()=>{e.pendingRequests--})},this.originalXhrOpen=XMLHttpRequest.prototype.open;const i=this.originalXhrOpen;XMLHttpRequest.prototype.open=function(t,r,s=!0,a,n){return e.pendingRequests++,this.addEventListener("loadend",()=>{e.pendingRequests--},{once:!0}),i.call(this,t,r,s,a,n)}}uninstallFetchInterceptor(){this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null)}handleLogoClick(){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0}))}toggleUserMenu(){this.isUserMenuOpen=!this.isUserMenuOpen,this.isAppsMenuOpen=!1}closeUserMenu(){this.isUserMenuOpen=!1}toggleAppsMenu(){this.isAppsMenuOpen=!this.isAppsMenuOpen,this.isUserMenuOpen=!1}closeAppsMenu(){this.isAppsMenuOpen=!1}handleMenuItemClick(e){this.closeUserMenu(),this.dispatchEvent(new CustomEvent("menu-item-click",{detail:{item:e},bubbles:!0,composed:!0}))}handleLogout(){this.closeUserMenu(),this.dispatchEvent(new CustomEvent("logout",{bubbles:!0,composed:!0}))}handleChatClick(){void 0!==window._chatlio&&window._chatlio.showOrHide()}renderAppsMenu(){return B`
53
+ */class ye extends xe{constructor(e){if(super(e),this.it=Y,e.type!==me)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Y||null==e)return this._t=void 0,this.it=e;if(e===W)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:[]}}}ye.directiveName="unsafeHTML",ye.resultType=1;const we=be(ye);var ke=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let $e=class extends de{constructor(){super(...arguments),this.logo="https://s3.amazonaws.com/kodariscom/kodariscom/content/website/kodaris-logo-icon-light-53.png",this.apps=[],this.activeAppId="",this.user=null,this.menuItems=[],this.isUserMenuOpen=!1,this.isAppsMenuOpen=!1,this.pendingRequests=0,this.originalFetch=null,this.originalXhrOpen=null,this.defaultLogoutIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"/></svg>',this.appsGridIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"/></svg>',this.closeIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><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>'}connectedCallback(){if(super.connectedCallback(),this.installFetchInterceptor(),!document.getElementById("chatlio-widget-styles")){const e=document.createElement("style");e.id="chatlio-widget-styles",e.textContent="\n .chatlio-title-bar {\n display: none !important;\n }\n \n .chatlio-widget-body {\n bottom: 36px !important;\n }\n ",document.head.appendChild(e)}}disconnectedCallback(){super.disconnectedCallback(),this.uninstallFetchInterceptor()}installFetchInterceptor(){if(this.originalFetch)return;const e=this;this.originalFetch=window.fetch.bind(window);const t=this.originalFetch;window.fetch=function(...i){return e.pendingRequests++,t(...i).finally(()=>{e.pendingRequests--})},this.originalXhrOpen=XMLHttpRequest.prototype.open;const i=this.originalXhrOpen;XMLHttpRequest.prototype.open=function(t,r,s=!0,a,n){return e.pendingRequests++,this.addEventListener("loadend",()=>{e.pendingRequests--},{once:!0}),i.call(this,t,r,s,a,n)}}uninstallFetchInterceptor(){this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null)}handleLogoClick(){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0}))}toggleUserMenu(){this.isUserMenuOpen=!this.isUserMenuOpen,this.isAppsMenuOpen=!1}closeUserMenu(){this.isUserMenuOpen=!1}toggleAppsMenu(){this.isAppsMenuOpen=!this.isAppsMenuOpen,this.isUserMenuOpen=!1}closeAppsMenu(){this.isAppsMenuOpen=!1}handleMenuItemClick(e){this.closeUserMenu(),this.dispatchEvent(new CustomEvent("menu-item-click",{detail:{item:e},bubbles:!0,composed:!0}))}handleLogout(){this.closeUserMenu(),this.dispatchEvent(new CustomEvent("logout",{bubbles:!0,composed:!0}))}handleChatClick(){void 0!==window._chatlio&&window._chatlio.showOrHide()}renderAppsMenu(){return B`
54
54
  <div class="appbar-apps">
55
55
  ${this.isAppsMenuOpen?B`
56
56
  <div class="menu-backdrop" @click=${this.closeAppsMenu}></div>
57
- `:V}
57
+ `:Y}
58
58
 
59
59
  <button
60
60
  class=${_e({"appbar-apps-btn":!0,"appbar-apps-btn--open":this.isAppsMenuOpen})}
@@ -85,11 +85,11 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
85
85
  </div>
86
86
  </div>
87
87
  </div>
88
- `}renderUserMenu(){if(!this.user)return V;const e=this.user.name.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return B`
88
+ `}renderUserMenu(){if(!this.user)return Y;const e=this.user.name.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return B`
89
89
  <div class="appbar-user">
90
90
  ${this.isUserMenuOpen?B`
91
91
  <div class="menu-backdrop" @click=${this.closeUserMenu}></div>
92
- `:V}
92
+ `:Y}
93
93
 
94
94
  <div
95
95
  class="appbar-user__avatar"
@@ -103,7 +103,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
103
103
  <p class="appbar-user__name">${this.user.name}</p>
104
104
  ${this.user.email?B`
105
105
  <p class="appbar-user__email">${this.user.email}</p>
106
- `:V}
106
+ `:Y}
107
107
  </div>
108
108
 
109
109
  ${this.menuItems.map(e=>e.divider?B`<div class="appbar-user__menu-divider"></div>`:B`
@@ -113,14 +113,14 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
113
113
  >
114
114
  ${e.icon?B`
115
115
  <span class="appbar-user__menu-item__icon">${we(e.icon)}</span>
116
- `:V}
116
+ `:Y}
117
117
  ${e.label}
118
118
  </button>
119
119
  `)}
120
120
 
121
121
  ${this.menuItems.length>0?B`
122
122
  <div class="appbar-user__menu-divider"></div>
123
- `:V}
123
+ `:Y}
124
124
 
125
125
  <button
126
126
  class="appbar-user__menu-item appbar-user__menu-item--danger"
@@ -149,7 +149,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
149
149
  <img src=${this.logo} alt="Home" />
150
150
  </div>
151
151
  <div class="appbar-divider"></div>
152
- `:V}
152
+ `:Y}
153
153
 
154
154
  <!-- App Switcher -->
155
155
  ${this.renderAppsMenu()}
@@ -779,7 +779,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
779
779
  height: 100%;
780
780
  stroke: currentColor;
781
781
  }
782
- `,ke([ve({type:String})],$e.prototype,"logo",void 0),ke([ve({type:Array})],$e.prototype,"apps",void 0),ke([ve({type:String,attribute:"active-app-id"})],$e.prototype,"activeAppId",void 0),ke([ve({type:Object})],$e.prototype,"user",void 0),ke([ve({type:Array,attribute:"menu-items"})],$e.prototype,"menuItems",void 0),ke([fe()],$e.prototype,"isUserMenuOpen",void 0),ke([fe()],$e.prototype,"isAppsMenuOpen",void 0),ke([fe()],$e.prototype,"pendingRequests",void 0),$e=ke([pe("kr-shell")],$e);var Ie=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Ee=class extends de{constructor(){super(...arguments),this.label="",this.icon="",this.url="",this.active=!0}connectedCallback(){super.connectedCallback(),this.data&&(this.label=this.data.label||"",this.icon=this.data.icon||"",this.url=this.data.url||"",this.active=!1!==this.data.active)}handleLabelInput(e){const t=e.target;this.label=t.value}handleIconInput(e){const t=e.target;this.icon=t.value}handleUrlInput(e){const t=e.target;this.url=t.value}handleActiveChange(e){this.active=e.target.checked}handleCancel(){this.dialogRef.close(void 0)}handleSave(){this.dialogRef.close({label:this.label,icon:this.icon||void 0,url:this.url||void 0,active:this.active})}handleKeyDown(e){"Enter"===e.key&&this.handleSave()}render(){return B`
782
+ `,ke([ve({type:String})],$e.prototype,"logo",void 0),ke([ve({type:Array})],$e.prototype,"apps",void 0),ke([ve({type:String,attribute:"active-app-id"})],$e.prototype,"activeAppId",void 0),ke([ve({type:Object})],$e.prototype,"user",void 0),ke([ve({type:Array,attribute:"menu-items"})],$e.prototype,"menuItems",void 0),ke([fe()],$e.prototype,"isUserMenuOpen",void 0),ke([fe()],$e.prototype,"isAppsMenuOpen",void 0),ke([fe()],$e.prototype,"pendingRequests",void 0),$e=ke([pe("kr-shell")],$e);var Ie=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Ae=class extends de{constructor(){super(...arguments),this.label="",this.icon="",this.url="",this.active=!0}connectedCallback(){super.connectedCallback(),this.data&&(this.label=this.data.label||"",this.icon=this.data.icon||"",this.url=this.data.url||"",this.active=!1!==this.data.active)}handleLabelInput(e){const t=e.target;this.label=t.value}handleIconInput(e){const t=e.target;this.icon=t.value}handleUrlInput(e){const t=e.target;this.url=t.value}handleActiveChange(e){this.active=e.target.checked}handleCancel(){this.dialogRef.close(void 0)}handleSave(){this.dialogRef.close({label:this.label,icon:this.icon||void 0,url:this.url||void 0,active:this.active})}handleKeyDown(e){"Enter"===e.key&&this.handleSave()}render(){return B`
783
783
  <h2>Edit Navigation Item</h2>
784
784
 
785
785
  <div class="form-group">
@@ -831,7 +831,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
831
831
  <button class="btn-cancel" @click=${this.handleCancel}>Cancel</button>
832
832
  <button class="btn-save" @click=${this.handleSave}>Save</button>
833
833
  </div>
834
- `}};Ee.styles=l`
834
+ `}};Ae.styles=l`
835
835
  :host {
836
836
  display: block;
837
837
  width: 360px;
@@ -916,7 +916,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
916
916
  .btn-save:hover {
917
917
  background: #d4f472;
918
918
  }
919
- `,Ie([fe()],Ee.prototype,"label",void 0),Ie([fe()],Ee.prototype,"icon",void 0),Ie([fe()],Ee.prototype,"url",void 0),Ie([fe()],Ee.prototype,"active",void 0),Ee=Ie([pe("kr-nav-item-edit")],Ee);var Ae=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Ce=class extends de{constructor(){super(),this.defaultNavItemIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="10"/></svg>',this.navItemsExpanded=new Set,this.navQuery="",this.activeNavItemId=null,this.isNavScrolled=!1,this.isNavOpened=!0,this.isEditing=!1,this.isUserMenuOpen=!1,this.pref={nav:{}},this.draggedNavItemId=null,this.navItemDropTargetId=null,this.navItemDropPosition="above",this.pendingRequests=0,this.originalFetch=null,this.originalXhrOpen=null,this.navItemDragPreview=null,this.navItemDragStartY=0,this.isNavItemDragging=!1,this.navItemDragExpandTimeout=null,this.navInitialized=!1,this.logo="",this.title="",this.homeUrl="/",this.scheme="light",this.nav=[],this.navIconsDisplayed=!1,this.navExpanded=!1,this.user=null,this.subbar=!1,this.breadcrumbs=[],this.boundHandleMouseMove=this.handleMouseMove.bind(this),this.boundHandleMouseUp=this.handleMouseUp.bind(this)}connectedCallback(){super.connectedCallback(),this.loadPref(),this.installFetchInterceptor()}updated(e){super.updated(e),e.has("nav")&&this.nav.length>0&&(this.updateActiveNavItem(),this.navExpanded&&!this.navInitialized&&(this.navInitialized=!0,this.getComputedNav().filter(e=>"group"===e.type).forEach(e=>this.navItemsExpanded.add(e.id))))}disconnectedCallback(){super.disconnectedCallback(),this.uninstallFetchInterceptor()}installFetchInterceptor(){if(this.originalFetch)return;const e=this;this.originalFetch=window.fetch.bind(window);const t=this.originalFetch;window.fetch=function(...i){return e.pendingRequests++,t(...i).finally(()=>{e.pendingRequests--})},this.originalXhrOpen=XMLHttpRequest.prototype.open;const i=this.originalXhrOpen;XMLHttpRequest.prototype.open=function(t,r,s=!0,a,n){return e.pendingRequests++,this.addEventListener("loadend",()=>{e.pendingRequests--},{once:!0}),i.call(this,t,r,s,a,n)}}uninstallFetchInterceptor(){this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null)}getComputedNav(){const e=[];return this.nav.forEach((t,i)=>{const r=this.pref.nav[t.id];e.push({...t,...r,order:r?.order??t.order??i,parentId:r?.parentId??null}),"group"===t.type&&t.children&&t.children.forEach((i,r)=>{const s=this.pref.nav[i.id];e.push({...i,...s,order:s?.order??i.order??r,parentId:void 0!==s?.parentId?s.parentId:t.id})})}),Object.entries(this.pref.nav).forEach(([t,i])=>{t.startsWith("custom")&&i.type&&i.label&&e.push({id:t,type:i.type,label:i.label,icon:i.icon,url:i.url,active:i.active,order:i.order??e.length,parentId:i.parentId??null})}),e}getNavItemChildren(e){let t=this.getComputedNav().filter(t=>t.parentId===e).sort((e,t)=>e.order-t.order);if(this.isEditing||(t=t.filter(e=>!1!==e.active)),this.navQuery){const e=this.navQuery.toLowerCase(),i=this.getComputedNav();t=t.filter(t=>"group"===t.type?t.label.toLowerCase().includes(e)||i.some(i=>i.parentId===t.id&&!1!==i.active&&i.label.toLowerCase().includes(e)):t.label.toLowerCase().includes(e))}return t}handleNavQueryChange(e){this.navQuery=e.target.value,this.navQuery?this.getComputedNav().forEach(e=>{"group"===e.type&&this.navItemsExpanded.add(e.id)}):this.navItemsExpanded.clear()}handleNavQueryClear(){this.navQuery="",this.navItemsExpanded.clear()}handleMenuClick(){this.isNavOpened=!this.isNavOpened}handleNavHeaderClick(e){this.activeNavItemId=null;const t=new CustomEvent("nav-item-click",{detail:{item:{url:this.homeUrl}},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(t),t.defaultPrevented||(window.location.href=this.homeUrl)}handleNavScroll(e){this.isNavScrolled=e.target.scrollTop>0}toggleNavItem(e){const t=this.shadowRoot?.querySelector(`.nav-item[data-id="${e}"]`),i=t?.nextElementSibling;i&&(this.navItemsExpanded.has(e)?(this.navItemsExpanded.delete(e),i.animate([{height:`${i.scrollHeight}px`},{height:"0px"}],{duration:300,easing:"ease-in-out"}).onfinish=()=>{i.classList.remove("nav-group--expanded")}):(this.navItemsExpanded.add(e),i.classList.add("nav-group--expanded"),i.animate([{height:"0px"},{height:`${i.scrollHeight}px`}],{duration:300,easing:"ease-in-out"})),this.requestUpdate())}handleNavItemClick(e,t){if("group"===t.type)this.toggleNavItem(t.id);else{this.activeNavItemId=t.id;const i=new CustomEvent("nav-item-click",{detail:{item:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&e.preventDefault()}}updateActiveNavItem(){const e=window.location.pathname,t=this.getComputedNav().filter(e=>"item"===e.type&&e.url);let i=null,r=0;for(const s of t){const t=s.url;e.startsWith(t)&&t.length>r&&(i=s,r=t.length)}i?(this.activeNavItemId=i.id,i.parentId&&this.navItemsExpanded.add(i.parentId)):this.activeNavItemId=null}startEditing(){this.isEditing=!0}cancelEditing(){this.isEditing=!1,this.loadPref()}resetPref(){this.pref.nav={}}savePref(){const e=this.pref.uuid?`/api/system/preference/json/scaffold/${this.pref.uuid}?global=true`:"/api/system/preference/json/scaffold?global=true";i.fetch({url:e,method:this.pref.uuid?"PUT":"POST",body:JSON.stringify({nav:this.pref.nav})}).then(e=>e.json()).then(e=>{this.pref=e.data,this.isEditing=!1}).catch(e=>{console.error("Failed to save nav customizations:",e)})}loadPref(){i.fetch({url:"/api/system/preference/json/scaffold?global=true",method:"GET"}).then(e=>e.json()).then(e=>{const t=e?.data?.[0];t&&(this.pref=t)}).catch(()=>{})}handleNavItemContextMenu(t,i){this.isEditing&&(t.preventDefault(),e.open({x:t.clientX,y:t.clientY,items:[{id:"edit",label:"Edit Item"},{id:"divider-1",label:"",divider:!0},{id:"add-above",label:"Add Item Above"},{id:"add-below",label:"Add Item Below"}]}).then(e=>{if(e)switch(e.id){case"edit":this.openNavItemEdit(i);break;case"add-above":this.addNavItem(i,"above");break;case"add-below":this.addNavItem(i,"below")}}))}openNavItemEdit(e){t.open(Ee,{data:e}).afterClosed().then(t=>{const i=t;i&&(this.pref.nav[e.id]||(this.pref.nav[e.id]={}),this.pref.nav[e.id]={...this.pref.nav[e.id],...i},this.requestUpdate())})}addNavItem(e,t){const i=`custom-${Date.now()}`,r=this.getComputedNav().filter(t=>t.parentId===e.parentId).sort((e,t)=>e.order-t.order),s=r.findIndex(t=>t.id===e.id),a="above"===t?s:s+1;r.forEach((e,t)=>{t>=a&&(this.pref.nav[e.id]||(this.pref.nav[e.id]={}),this.pref.nav[e.id].order=t+1)});const n={id:i,type:"item",label:"New Item",order:a,parentId:e.parentId,active:!0};this.pref.nav[i]=n,this.requestUpdate(),this.openNavItemEdit(n)}handleNavItemMouseDown(e,t){this.isEditing&&(e.preventDefault(),this.draggedNavItemId=t.id,this.navItemDragStartY=e.clientY,this.isNavItemDragging=!1,document.addEventListener("mousemove",this.boundHandleMouseMove),document.addEventListener("mouseup",this.boundHandleMouseUp))}handleMouseMove(e){if(this.draggedNavItemId){if(!this.isNavItemDragging&&Math.abs(e.clientY-this.navItemDragStartY)>5){this.isNavItemDragging=!0,this.classList.add("kr-scaffold--dragging");const t=this.getComputedNav().find(e=>e.id===this.draggedNavItemId);t&&(this.navItemDragPreview=document.createElement("div"),this.navItemDragPreview.className="nav-item-drag-preview",this.navItemDragPreview.textContent=t.label,this.navItemDragPreview.style.left=`${e.clientX+10}px`,this.navItemDragPreview.style.top=e.clientY-20+"px",this.shadowRoot?.appendChild(this.navItemDragPreview))}this.isNavItemDragging&&(this.navItemDragPreview&&(this.navItemDragPreview.style.left=`${e.clientX+10}px`,this.navItemDragPreview.style.top=e.clientY-20+"px"),this.updateNavItemDropTarget(e))}}handleMouseUp(){document.removeEventListener("mousemove",this.boundHandleMouseMove),document.removeEventListener("mouseup",this.boundHandleMouseUp),this.isNavItemDragging&&this.navItemDropTargetId&&this.executeNavItemDrop(),this.draggedNavItemId=null,this.navItemDropTargetId=null,this.isNavItemDragging=!1,this.classList.remove("kr-scaffold--dragging"),this.navItemDragPreview&&(this.navItemDragPreview.remove(),this.navItemDragPreview=null),this.clearNavItemDragExpandTimeout(),this.requestUpdate()}updateNavItemDropTarget(e){const t=this.shadowRoot?.querySelectorAll(".nav-item[data-id]");if(!t)return;let i=!1;t.forEach(t=>{const r=t.getBoundingClientRect(),s=t.getAttribute("data-id");if(!s||s===this.draggedNavItemId)return;if(e.clientX<r.left||e.clientX>r.right||e.clientY<r.top||e.clientY>r.bottom)return;const a=this.getComputedNav().find(e=>e.id===s);if(!a)return;const n=e.clientY-r.top;let o;"group"===a.type?n<r.height/3?(o="above",this.clearNavItemDragExpandTimeout()):n>2*r.height/3?(o="below",this.clearNavItemDragExpandTimeout()):(o="center",this.navItemsExpanded.has(a.id)||this.navItemDragExpandTimeout||this.expandNavGroupOnDrag(a.id)):(o=n<r.height/2?"above":"below",this.clearNavItemDragExpandTimeout());const l="center"===o?a.id:a.parentId,d=this.getComputedNav().find(e=>e.id===this.draggedNavItemId);if(l===this.draggedNavItemId||"group"===d?.type&&null!==l)return this.navItemDropTargetId=null,void this.clearNavItemDragExpandTimeout();this.navItemDropTargetId=a.id,this.navItemDropPosition=o,i=!0}),i||(this.navItemDropTargetId=null,this.clearNavItemDragExpandTimeout()),this.requestUpdate()}clearNavItemDragExpandTimeout(){this.navItemDragExpandTimeout&&(clearTimeout(this.navItemDragExpandTimeout),this.navItemDragExpandTimeout=null)}expandNavGroupOnDrag(e){this.navItemDragExpandTimeout=window.setTimeout(()=>{this.navItemDropTargetId===e&&"center"===this.navItemDropPosition&&(this.navItemsExpanded.add(e),this.requestUpdate()),this.navItemDragExpandTimeout=null},500)}executeNavItemDrop(){if(!this.draggedNavItemId||!this.navItemDropTargetId)return;const e=this.getComputedNav(),t=e.find(e=>e.id===this.draggedNavItemId),i=e.find(e=>e.id===this.navItemDropTargetId);if(!t||!i)return;let r;if("center"===this.navItemDropPosition&&"group"===i.type){if(i.id===this.draggedNavItemId)return;r=i.id}else r=i.parentId;if(r===this.draggedNavItemId)return;const s=e.filter(e=>e.parentId===r&&e.id!==this.draggedNavItemId).sort((e,t)=>e.order-t.order),a=this.pref.nav;let n;if("center"===this.navItemDropPosition)n=s.length>0?Math.max(...s.map(e=>e.order))+1:0;else{const e=s.findIndex(e=>e.id===i.id);n=-1===e?0:"above"===this.navItemDropPosition?e:e+1,s.forEach((e,t)=>{a[e.id]||(a[e.id]={}),a[e.id].order=t>=n?t+1:t})}a[this.draggedNavItemId]||(a[this.draggedNavItemId]={}),a[this.draggedNavItemId].order=n,a[this.draggedNavItemId].parentId=r,this.pref.nav=a,this.requestUpdate()}toggleUserMenu(){this.isUserMenuOpen=!this.isUserMenuOpen}closeUserMenu(){this.isUserMenuOpen=!1}handleCustomize(){this.closeUserMenu(),this.startEditing()}renderNormalFooter(){if(!this.user)return V;const e=this.user.name.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return B`
919
+ `,Ie([fe()],Ae.prototype,"label",void 0),Ie([fe()],Ae.prototype,"icon",void 0),Ie([fe()],Ae.prototype,"url",void 0),Ie([fe()],Ae.prototype,"active",void 0),Ae=Ie([pe("kr-nav-item-edit")],Ae);var Ee=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Ce=class extends de{constructor(){super(),this.defaultNavItemIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="10"/></svg>',this.navItemsExpanded=new Set,this.navQuery="",this.activeNavItemId=null,this.isNavScrolled=!1,this.isNavOpened=!0,this.isEditing=!1,this.isUserMenuOpen=!1,this.pref={nav:{}},this.draggedNavItemId=null,this.navItemDropTargetId=null,this.navItemDropPosition="above",this.pendingRequests=0,this.originalFetch=null,this.originalXhrOpen=null,this.navItemDragPreview=null,this.navItemDragStartY=0,this.isNavItemDragging=!1,this.navItemDragExpandTimeout=null,this.navInitialized=!1,this.logo="",this.title="",this.homeUrl="/",this.scheme="light",this.nav=[],this.navIconsDisplayed=!1,this.navExpanded=!1,this.user=null,this.subbar=!1,this.breadcrumbs=[],this.boundHandleMouseMove=this.handleMouseMove.bind(this),this.boundHandleMouseUp=this.handleMouseUp.bind(this)}connectedCallback(){super.connectedCallback(),this.loadPref(),this.installFetchInterceptor()}updated(e){super.updated(e),e.has("nav")&&this.nav.length>0&&(this.updateActiveNavItem(),this.navExpanded&&!this.navInitialized&&(this.navInitialized=!0,this.getComputedNav().filter(e=>"group"===e.type).forEach(e=>this.navItemsExpanded.add(e.id))))}disconnectedCallback(){super.disconnectedCallback(),this.uninstallFetchInterceptor()}installFetchInterceptor(){if(this.originalFetch)return;const e=this;this.originalFetch=window.fetch.bind(window);const t=this.originalFetch;window.fetch=function(...i){return e.pendingRequests++,t(...i).finally(()=>{e.pendingRequests--})},this.originalXhrOpen=XMLHttpRequest.prototype.open;const i=this.originalXhrOpen;XMLHttpRequest.prototype.open=function(t,r,s=!0,a,n){return e.pendingRequests++,this.addEventListener("loadend",()=>{e.pendingRequests--},{once:!0}),i.call(this,t,r,s,a,n)}}uninstallFetchInterceptor(){this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null)}resolveUrl(e){if(!e.url)return"#";if(e.external)return e.url;const t=e.url.startsWith("/")?e.url.slice(1):e.url,i=document.querySelector("base")?.getAttribute("href")||"/";return(i.endsWith("/")?i:i+"/")+t}getComputedNav(){const e=[];return this.nav.forEach((t,i)=>{const r=this.pref.nav[t.id];e.push({...t,...r,order:r?.order??t.order??i,parentId:r?.parentId??null}),"group"===t.type&&t.children&&t.children.forEach((i,r)=>{const s=this.pref.nav[i.id];e.push({...i,...s,order:s?.order??i.order??r,parentId:void 0!==s?.parentId?s.parentId:t.id})})}),Object.entries(this.pref.nav).forEach(([t,i])=>{t.startsWith("custom")&&i.type&&i.label&&e.push({id:t,type:i.type,label:i.label,icon:i.icon,url:i.url,active:i.active,order:i.order??e.length,parentId:i.parentId??null})}),e}getNavItemChildren(e){let t=this.getComputedNav().filter(t=>t.parentId===e).sort((e,t)=>e.order-t.order);if(this.isEditing||(t=t.filter(e=>!1!==e.active)),this.navQuery){const i=this.navQuery.toLowerCase(),r=this.getComputedNav();if(null!==e){const s=r.find(t=>t.id===e);if(s?.label.toLowerCase().includes(i))return t}t=t.filter(e=>"group"===e.type?e.label.toLowerCase().includes(i)||r.some(t=>t.parentId===e.id&&!1!==t.active&&t.label.toLowerCase().includes(i)):e.label.toLowerCase().includes(i))}return t}handleNavQueryChange(e){this.navQuery=e.target.value,this.navQuery?this.getComputedNav().forEach(e=>{"group"===e.type&&this.navItemsExpanded.add(e.id)}):this.navItemsExpanded.clear()}handleNavQueryClear(){this.navQuery="",this.navItemsExpanded.clear()}handleMenuClick(){this.isNavOpened=!this.isNavOpened}handleNavHeaderClick(){this.activeNavItemId=null;const e=new CustomEvent("nav-item-click",{detail:{item:{url:this.homeUrl}},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||(window.location.href=this.homeUrl)}handleNavScroll(e){this.isNavScrolled=e.target.scrollTop>0}toggleNavItem(e){const t=this.shadowRoot?.querySelector(`.nav-item[data-id="${e}"]`),i=t?.nextElementSibling;i&&(this.navItemsExpanded.has(e)?(this.navItemsExpanded.delete(e),i.animate([{height:`${i.scrollHeight}px`},{height:"0px"}],{duration:300,easing:"ease-in-out"}).onfinish=()=>{i.classList.remove("nav-group--expanded")}):(this.navItemsExpanded.add(e),i.classList.add("nav-group--expanded"),i.animate([{height:"0px"},{height:`${i.scrollHeight}px`}],{duration:300,easing:"ease-in-out"})),this.requestUpdate())}handleNavItemClick(e,t){if("group"===t.type)this.toggleNavItem(t.id);else{if(e.ctrlKey||e.metaKey||1===e.button)return;this.activeNavItemId=t.id;const i=new CustomEvent("nav-item-click",{detail:{item:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&e.preventDefault()}}updateActiveNavItem(){const e=window.location.pathname,t=this.getComputedNav().filter(e=>"item"===e.type&&e.url);let i=null,r=0;for(const s of t){const t=this.resolveUrl(s);e.startsWith(t)&&t.length>r&&(i=s,r=t.length)}i?(this.activeNavItemId=i.id,i.parentId&&this.navItemsExpanded.add(i.parentId)):this.activeNavItemId=null}startEditing(){this.isEditing=!0}cancelEditing(){this.isEditing=!1,this.loadPref()}resetPref(){this.pref.nav={}}savePref(){const e=this.pref.uuid?`/api/system/preference/json/scaffold/${this.pref.uuid}?global=true`:"/api/system/preference/json/scaffold?global=true";i.fetch({url:e,method:this.pref.uuid?"PUT":"POST",body:JSON.stringify({nav:this.pref.nav})}).then(e=>e.json()).then(e=>{this.pref=e.data,this.isEditing=!1}).catch(e=>{console.error("Failed to save nav customizations:",e)})}loadPref(){i.fetch({url:"/api/system/preference/json/scaffold?global=true",method:"GET"}).then(e=>e.json()).then(e=>{const t=e?.data?.[0];t&&(this.pref=t)}).catch(()=>{})}handleNavItemContextMenu(t,i){this.isEditing&&(t.preventDefault(),e.open({x:t.clientX,y:t.clientY,items:[{id:"edit",label:"Edit Item"},{id:"divider-1",label:"",divider:!0},{id:"add-above",label:"Add Item Above"},{id:"add-below",label:"Add Item Below"}]}).then(e=>{if(e)switch(e.id){case"edit":this.openNavItemEdit(i);break;case"add-above":this.addNavItem(i,"above");break;case"add-below":this.addNavItem(i,"below")}}))}openNavItemEdit(e){t.open(Ae,{data:e}).afterClosed().then(t=>{const i=t;i&&(this.pref.nav[e.id]||(this.pref.nav[e.id]={}),this.pref.nav[e.id]={...this.pref.nav[e.id],...i},this.requestUpdate())})}addNavItem(e,t){const i=`custom-${Date.now()}`,r=this.getComputedNav().filter(t=>t.parentId===e.parentId).sort((e,t)=>e.order-t.order),s=r.findIndex(t=>t.id===e.id),a="above"===t?s:s+1;r.forEach((e,t)=>{t>=a&&(this.pref.nav[e.id]||(this.pref.nav[e.id]={}),this.pref.nav[e.id].order=t+1)});const n={id:i,type:"item",label:"New Item",order:a,parentId:e.parentId,active:!0};this.pref.nav[i]=n,this.requestUpdate(),this.openNavItemEdit(n)}handleNavItemMouseDown(e,t){this.isEditing&&(e.preventDefault(),this.draggedNavItemId=t.id,this.navItemDragStartY=e.clientY,this.isNavItemDragging=!1,document.addEventListener("mousemove",this.boundHandleMouseMove),document.addEventListener("mouseup",this.boundHandleMouseUp))}handleMouseMove(e){if(this.draggedNavItemId){if(!this.isNavItemDragging&&Math.abs(e.clientY-this.navItemDragStartY)>5){this.isNavItemDragging=!0,this.classList.add("kr-scaffold--dragging");const t=this.getComputedNav().find(e=>e.id===this.draggedNavItemId);t&&(this.navItemDragPreview=document.createElement("div"),this.navItemDragPreview.className="nav-item-drag-preview",this.navItemDragPreview.textContent=t.label,this.navItemDragPreview.style.left=`${e.clientX+10}px`,this.navItemDragPreview.style.top=e.clientY-20+"px",this.shadowRoot?.appendChild(this.navItemDragPreview))}this.isNavItemDragging&&(this.navItemDragPreview&&(this.navItemDragPreview.style.left=`${e.clientX+10}px`,this.navItemDragPreview.style.top=e.clientY-20+"px"),this.updateNavItemDropTarget(e))}}handleMouseUp(){document.removeEventListener("mousemove",this.boundHandleMouseMove),document.removeEventListener("mouseup",this.boundHandleMouseUp),this.isNavItemDragging&&this.navItemDropTargetId&&this.executeNavItemDrop(),this.draggedNavItemId=null,this.navItemDropTargetId=null,this.isNavItemDragging=!1,this.classList.remove("kr-scaffold--dragging"),this.navItemDragPreview&&(this.navItemDragPreview.remove(),this.navItemDragPreview=null),this.clearNavItemDragExpandTimeout(),this.requestUpdate()}updateNavItemDropTarget(e){const t=this.shadowRoot?.querySelectorAll(".nav-item[data-id]");if(!t)return;let i=!1;t.forEach(t=>{const r=t.getBoundingClientRect(),s=t.getAttribute("data-id");if(!s||s===this.draggedNavItemId)return;if(e.clientX<r.left||e.clientX>r.right||e.clientY<r.top||e.clientY>r.bottom)return;const a=this.getComputedNav().find(e=>e.id===s);if(!a)return;const n=e.clientY-r.top;let o;"group"===a.type?n<r.height/3?(o="above",this.clearNavItemDragExpandTimeout()):n>2*r.height/3?(o="below",this.clearNavItemDragExpandTimeout()):(o="center",this.navItemsExpanded.has(a.id)||this.navItemDragExpandTimeout||this.expandNavGroupOnDrag(a.id)):(o=n<r.height/2?"above":"below",this.clearNavItemDragExpandTimeout());const l="center"===o?a.id:a.parentId,d=this.getComputedNav().find(e=>e.id===this.draggedNavItemId);if(l===this.draggedNavItemId||"group"===d?.type&&null!==l)return this.navItemDropTargetId=null,void this.clearNavItemDragExpandTimeout();this.navItemDropTargetId=a.id,this.navItemDropPosition=o,i=!0}),i||(this.navItemDropTargetId=null,this.clearNavItemDragExpandTimeout()),this.requestUpdate()}clearNavItemDragExpandTimeout(){this.navItemDragExpandTimeout&&(clearTimeout(this.navItemDragExpandTimeout),this.navItemDragExpandTimeout=null)}expandNavGroupOnDrag(e){this.navItemDragExpandTimeout=window.setTimeout(()=>{this.navItemDropTargetId===e&&"center"===this.navItemDropPosition&&(this.navItemsExpanded.add(e),this.requestUpdate()),this.navItemDragExpandTimeout=null},500)}executeNavItemDrop(){if(!this.draggedNavItemId||!this.navItemDropTargetId)return;const e=this.getComputedNav(),t=e.find(e=>e.id===this.draggedNavItemId),i=e.find(e=>e.id===this.navItemDropTargetId);if(!t||!i)return;let r;if("center"===this.navItemDropPosition&&"group"===i.type){if(i.id===this.draggedNavItemId)return;r=i.id}else r=i.parentId;if(r===this.draggedNavItemId)return;const s=e.filter(e=>e.parentId===r&&e.id!==this.draggedNavItemId).sort((e,t)=>e.order-t.order),a=this.pref.nav;let n;if("center"===this.navItemDropPosition)n=s.length>0?Math.max(...s.map(e=>e.order))+1:0;else{const e=s.findIndex(e=>e.id===i.id);n=-1===e?0:"above"===this.navItemDropPosition?e:e+1,s.forEach((e,t)=>{a[e.id]||(a[e.id]={}),a[e.id].order=t>=n?t+1:t})}a[this.draggedNavItemId]||(a[this.draggedNavItemId]={}),a[this.draggedNavItemId].order=n,a[this.draggedNavItemId].parentId=r,this.pref.nav=a,this.requestUpdate()}toggleUserMenu(){this.isUserMenuOpen=!this.isUserMenuOpen}closeUserMenu(){this.isUserMenuOpen=!1}handleCustomize(){this.closeUserMenu(),this.startEditing()}renderNormalFooter(){if(!this.user)return Y;const e=this.user.name.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return B`
920
920
  <div class="user-menu-container">
921
921
  ${this.isUserMenuOpen?B`
922
922
  <div class="user-menu">
@@ -924,14 +924,14 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
924
924
  Customize Navigation
925
925
  </button>
926
926
  </div>
927
- `:V}
927
+ `:Y}
928
928
  <div class="user" @click=${this.toggleUserMenu}>
929
929
  <div class="user__avatar">
930
930
  ${this.user.avatar?B`<img src=${this.user.avatar} alt=${this.user.name} />`:e}
931
931
  </div>
932
932
  <div class="user__info">
933
933
  <div class="user__name">${this.user.name}</div>
934
- ${this.user.email?B`<div class="user__email">${this.user.email}</div>`:V}
934
+ ${this.user.email?B`<div class="user__email">${this.user.email}</div>`:Y}
935
935
  </div>
936
936
  </div>
937
937
  </div>
@@ -959,7 +959,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
959
959
  @click=${t=>this.handleNavItemClick(t,e)}
960
960
  @contextmenu=${t=>this.handleNavItemContextMenu(t,e)}
961
961
  >
962
- ${this.navIconsDisplayed?B`<span class="nav-item__icon">${we(e.icon||this.defaultNavItemIcon)}</span>`:V}
962
+ ${this.navIconsDisplayed?B`<span class="nav-item__icon">${we(e.icon||this.defaultNavItemIcon)}</span>`:Y}
963
963
  <span class="nav-item__label">${e.label}</span>
964
964
  <svg
965
965
  class="nav-item__chevron"
@@ -978,13 +978,13 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
978
978
  <a
979
979
  class=${_e({"nav-item":!0,"nav-item--active":this.activeNavItemId===e.id,"nav-item--hidden":this.isEditing&&!1===e.active,"nav-item--drop-above":this.navItemDropTargetId===e.id&&"above"===this.navItemDropPosition,"nav-item--drop-below":this.navItemDropTargetId===e.id&&"below"===this.navItemDropPosition})}
980
980
  data-id="${e.id}"
981
- href=${e.url||"#"}
982
- target=${e.external?"_blank":V}
981
+ href=${this.resolveUrl(e)}
982
+ target=${e.external?"_blank":Y}
983
983
  @mousedown=${t=>this.handleNavItemMouseDown(t,e)}
984
984
  @click=${t=>this.handleNavItemClick(t,e)}
985
985
  @contextmenu=${t=>this.handleNavItemContextMenu(t,e)}
986
986
  >
987
- ${this.navIconsDisplayed&&!t?B`<span class="nav-item__icon">${we(e.icon||this.defaultNavItemIcon)}</span>`:V}
987
+ ${this.navIconsDisplayed&&!t?B`<span class="nav-item__icon">${we(e.icon||this.defaultNavItemIcon)}</span>`:Y}
988
988
  <span class="nav-item__label">${e.label}</span>
989
989
  </a>
990
990
  `}render(){const e=this.getNavItemChildren(null),t=this.getComputedNav().filter(e=>null===e.parentId).length;return B`
@@ -1002,12 +1002,12 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
1002
1002
  <kr-subbar menu .breadcrumbs=${this.breadcrumbs} @menu-click=${this.handleMenuClick}>
1003
1003
  <slot name="subbar"></slot>
1004
1004
  </kr-subbar>
1005
- `:V}
1005
+ `:Y}
1006
1006
 
1007
1007
  <div class="wrapper">
1008
1008
  <nav class=${_e({nav:!0,"nav--scrolled":this.isNavScrolled,"nav--opened":!this.subbar||this.isNavOpened})}>
1009
1009
  <div class="nav-header" @click=${this.handleNavHeaderClick}>
1010
- ${this.title?B`<span class="nav-title">${this.title}</span>`:this.logo?B`<img class="nav-logo" src=${this.logo} alt="Logo" />`:V}
1010
+ ${this.title?B`<span class="nav-title">${this.title}</span>`:this.logo?B`<img class="nav-logo" src=${this.logo} alt="Logo" />`:Y}
1011
1011
  </div>
1012
1012
  <div class="nav-content" @scroll=${this.handleNavScroll}>
1013
1013
  ${t>20?B`
@@ -1031,10 +1031,10 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
1031
1031
  <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"/>
1032
1032
  </svg>
1033
1033
  </button>
1034
- `:V}
1034
+ `:Y}
1035
1035
  </div>
1036
1036
  </div>
1037
- `:V}
1037
+ `:Y}
1038
1038
  <div class="nav-items">
1039
1039
  ${e.map(e=>this.renderNavItem(e))}
1040
1040
  </div>
@@ -1066,9 +1066,8 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
1066
1066
  --kr-scaffold-nav-active-bg: #e5e7eb;
1067
1067
  --kr-scaffold-nav-border: rgb(229, 229, 228);
1068
1068
  --kr-scaffold-nav-divider: #e5e7eb;
1069
- --kr-scaffold-nav-search-bg: #f3f4f6;
1070
- --kr-scaffold-nav-search-focus-bg: #ffffff;
1071
- --kr-scaffold-nav-search-focus-border: #d1d5db;
1069
+ --kr-scaffold-nav-search-bg: #ffffff;
1070
+ --kr-scaffold-nav-search-border: #d1d5db;
1072
1071
  }
1073
1072
 
1074
1073
  /* Dark scheme */
@@ -1081,8 +1080,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
1081
1080
  --kr-scaffold-nav-border: transparent;
1082
1081
  --kr-scaffold-nav-divider: rgba(255, 255, 255, 0.06);
1083
1082
  --kr-scaffold-nav-search-bg: rgba(255, 255, 255, 0.15);
1084
- --kr-scaffold-nav-search-focus-bg: rgba(255, 255, 255, 0.2);
1085
- --kr-scaffold-nav-search-focus-border: rgba(255, 255, 255, 0.3);
1083
+ --kr-scaffold-nav-search-border: rgba(255, 255, 255, 0.3);
1086
1084
  }
1087
1085
 
1088
1086
  *,
@@ -1160,15 +1158,10 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
1160
1158
  padding: 0 12px;
1161
1159
  height: 40px;
1162
1160
  gap: 8px;
1163
- border: 1px solid transparent;
1161
+ border: 1px solid var(--kr-scaffold-nav-search-border);
1164
1162
  transition: all 0.15s ease;
1165
1163
  }
1166
1164
 
1167
- .nav-search__wrapper:focus-within {
1168
- background: var(--kr-scaffold-nav-search-focus-bg);
1169
- border-color: var(--kr-scaffold-nav-search-focus-border);
1170
- }
1171
-
1172
1165
  .nav-search__icon {
1173
1166
  width: 18px;
1174
1167
  height: 18px;
@@ -1785,16 +1778,16 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
1785
1778
  transform: scaleX(0.08);
1786
1779
  }
1787
1780
  }
1788
- `,Ae([fe()],Ce.prototype,"navItemsExpanded",void 0),Ae([fe()],Ce.prototype,"navQuery",void 0),Ae([fe()],Ce.prototype,"activeNavItemId",void 0),Ae([fe()],Ce.prototype,"isNavScrolled",void 0),Ae([fe()],Ce.prototype,"isNavOpened",void 0),Ae([fe()],Ce.prototype,"isEditing",void 0),Ae([fe()],Ce.prototype,"isUserMenuOpen",void 0),Ae([fe()],Ce.prototype,"pref",void 0),Ae([fe()],Ce.prototype,"draggedNavItemId",void 0),Ae([fe()],Ce.prototype,"navItemDropTargetId",void 0),Ae([fe()],Ce.prototype,"navItemDropPosition",void 0),Ae([fe()],Ce.prototype,"pendingRequests",void 0),Ae([ve({type:String})],Ce.prototype,"logo",void 0),Ae([ve({type:String})],Ce.prototype,"title",void 0),Ae([ve({type:String,attribute:"home-url"})],Ce.prototype,"homeUrl",void 0),Ae([ve({type:String,reflect:!0})],Ce.prototype,"scheme",void 0),Ae([ve({type:Array})],Ce.prototype,"nav",void 0),Ae([ve({type:Boolean,attribute:"nav-icons-displayed",reflect:!0})],Ce.prototype,"navIconsDisplayed",void 0),Ae([ve({type:Boolean,attribute:"nav-expanded"})],Ce.prototype,"navExpanded",void 0),Ae([ve({type:Object})],Ce.prototype,"user",void 0),Ae([ve({type:Boolean})],Ce.prototype,"subbar",void 0),Ae([ve({type:Array})],Ce.prototype,"breadcrumbs",void 0),Ce=Ae([pe("kr-scaffold")],Ce);var Ne=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Me=class extends de{constructor(){super(...arguments),this.title="",this.subtitle="",this.backUrl="",this.navItems=[],this.activeId=""}handleNavItemClick(e,t){const i=new CustomEvent("nav-item-click",{detail:{item:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&e.preventDefault()}updateActiveNavItem(){const e=window.location.pathname,t=this.navItems.find(t=>{if(!t.url)return!1;if(t.url.startsWith("./")){const i=t.url.replace(/^\.\//,"");return e.endsWith("/"+i)}return e===t.url||e.startsWith(t.url+"/")});t&&(this.activeId=t.id)}render(){return B`
1781
+ `,Ee([fe()],Ce.prototype,"navItemsExpanded",void 0),Ee([fe()],Ce.prototype,"navQuery",void 0),Ee([fe()],Ce.prototype,"activeNavItemId",void 0),Ee([fe()],Ce.prototype,"isNavScrolled",void 0),Ee([fe()],Ce.prototype,"isNavOpened",void 0),Ee([fe()],Ce.prototype,"isEditing",void 0),Ee([fe()],Ce.prototype,"isUserMenuOpen",void 0),Ee([fe()],Ce.prototype,"pref",void 0),Ee([fe()],Ce.prototype,"draggedNavItemId",void 0),Ee([fe()],Ce.prototype,"navItemDropTargetId",void 0),Ee([fe()],Ce.prototype,"navItemDropPosition",void 0),Ee([fe()],Ce.prototype,"pendingRequests",void 0),Ee([ve({type:String})],Ce.prototype,"logo",void 0),Ee([ve({type:String})],Ce.prototype,"title",void 0),Ee([ve({type:String,attribute:"home-url"})],Ce.prototype,"homeUrl",void 0),Ee([ve({type:String,reflect:!0})],Ce.prototype,"scheme",void 0),Ee([ve({type:Array})],Ce.prototype,"nav",void 0),Ee([ve({type:Boolean,attribute:"nav-icons-displayed",reflect:!0})],Ce.prototype,"navIconsDisplayed",void 0),Ee([ve({type:Boolean,attribute:"nav-expanded"})],Ce.prototype,"navExpanded",void 0),Ee([ve({type:Object})],Ce.prototype,"user",void 0),Ee([ve({type:Boolean})],Ce.prototype,"subbar",void 0),Ee([ve({type:Array})],Ce.prototype,"breadcrumbs",void 0),Ce=Ee([pe("kr-scaffold")],Ce);var Ne=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Me=class extends de{constructor(){super(...arguments),this.title="",this.subtitle="",this.backUrl="",this.navItems=[],this.activeId=""}handleNavItemClick(e,t){const i=new CustomEvent("nav-item-click",{detail:{item:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&e.preventDefault()}updateActiveNavItem(){const e=window.location.pathname,t=this.navItems.find(t=>{if(!t.url)return!1;if(t.url.startsWith("./")){const i=t.url.replace(/^\.\//,"");return e.endsWith("/"+i)}return e===t.url||e.startsWith(t.url+"/")});t&&(this.activeId=t.id)}render(){return B`
1789
1782
  <nav class="nav">
1790
1783
  ${this.title?B`
1791
1784
  <div class="nav-header">
1792
1785
  <div class="nav-header__text">
1793
- ${this.subtitle?B`<div class="nav-header__subtitle">${this.subtitle}</div>`:V}
1786
+ ${this.subtitle?B`<div class="nav-header__subtitle">${this.subtitle}</div>`:Y}
1794
1787
  <div class="nav-header__title">${this.title}</div>
1795
1788
  </div>
1796
1789
  </div>
1797
- `:V}
1790
+ `:Y}
1798
1791
  <div class="nav-content">
1799
1792
  <div class="nav-items">
1800
1793
  ${this.navItems.map(e=>B`
@@ -2003,7 +1996,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
2003
1996
  width: 100%;
2004
1997
  max-width: 700px;
2005
1998
  }
2006
- `,Se([ve({type:String})],De.prototype,"title",void 0),De=Se([pe("kr-screen-detail")],De);var ze=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Oe=class extends de{constructor(){super(...arguments),this.breadcrumbs=[],this.menu=!1}_handleMenuClick(){this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0}))}_handleBreadcrumbClick(e,t,i){if(i||!t.url)return void e.preventDefault();const r=new CustomEvent("breadcrumb-click",{detail:{breadcrumb:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r),r.defaultPrevented&&e.preventDefault()}render(){return B`
1999
+ `,Se([ve({type:String})],De.prototype,"title",void 0),De=Se([pe("kr-screen-detail")],De);var ze=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Oe=class extends de{constructor(){super(...arguments),this.breadcrumbs=[],this.menu=!1}_handleMenuClick(){this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0}))}resolveUrl(e){if(!e.url)return"#";const t=e.url.startsWith("/")?e.url.slice(1):e.url,i=document.querySelector("base")?.getAttribute("href")||"/";return(i.endsWith("/")?i:i+"/")+t}_handleBreadcrumbClick(e,t,i){if(i||!t.url)return void e.preventDefault();if(e.ctrlKey||e.metaKey||1===e.button)return;const r=new CustomEvent("breadcrumb-click",{detail:{breadcrumb:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r),r.defaultPrevented&&e.preventDefault()}render(){return B`
2007
2000
  ${this.menu?B`
2008
2001
  <div class="menu" @click=${this._handleMenuClick}>
2009
2002
  <svg class="menu__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
@@ -2012,13 +2005,13 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
2012
2005
  <line x1="3" y1="18" x2="21" y2="18"></line>
2013
2006
  </svg>
2014
2007
  </div>
2015
- `:V}
2008
+ `:Y}
2016
2009
  <div class="breadcrumbs">
2017
2010
  ${this.breadcrumbs.map((e,t)=>{const i=t===this.breadcrumbs.length-1;return B`
2018
2011
  ${t>0?B`<span class="breadcrumb-separator">/</span>`:""}
2019
2012
  <a
2020
2013
  class=${_e({breadcrumb:!0,"breadcrumb--current":i})}
2021
- href=${e.url||""}
2014
+ href=${this.resolveUrl(e)}
2022
2015
  @click=${t=>this._handleBreadcrumbClick(t,e,i)}
2023
2016
  >${e.label}</a>
2024
2017
  `})}
@@ -2038,6 +2031,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
2038
2031
  align-items: center;
2039
2032
  padding: 0 16px;
2040
2033
  width: 100%;
2034
+ flex-shrink: 0;
2041
2035
  }
2042
2036
 
2043
2037
  .breadcrumbs {