@aquera/nile-elements 1.8.1 → 1.8.2

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.
Files changed (36) hide show
  1. package/README.md +3 -0
  2. package/dist/index.js +323 -174
  3. package/dist/nile-slider/nile-slider.cjs.js +1 -1
  4. package/dist/nile-slider/nile-slider.cjs.js.map +1 -1
  5. package/dist/nile-slider/nile-slider.css.cjs.js +1 -1
  6. package/dist/nile-slider/nile-slider.css.cjs.js.map +1 -1
  7. package/dist/nile-slider/nile-slider.css.esm.js +162 -41
  8. package/dist/nile-slider/nile-slider.esm.js +5 -3
  9. package/dist/nile-slider/nile-slider.template.cjs.js +1 -1
  10. package/dist/nile-slider/nile-slider.template.cjs.js.map +1 -1
  11. package/dist/nile-slider/nile-slider.template.esm.js +49 -23
  12. package/dist/nile-slider/utils/nile-slider.utils.cjs.js +1 -1
  13. package/dist/nile-slider/utils/nile-slider.utils.cjs.js.map +1 -1
  14. package/dist/nile-slider/utils/nile-slider.utils.esm.js +1 -1
  15. package/dist/src/nile-slider/nile-slider.css.js +160 -39
  16. package/dist/src/nile-slider/nile-slider.css.js.map +1 -1
  17. package/dist/src/nile-slider/nile-slider.d.ts +5 -1
  18. package/dist/src/nile-slider/nile-slider.js +23 -1
  19. package/dist/src/nile-slider/nile-slider.js.map +1 -1
  20. package/dist/src/nile-slider/nile-slider.template.d.ts +2 -0
  21. package/dist/src/nile-slider/nile-slider.template.js +38 -1
  22. package/dist/src/nile-slider/nile-slider.template.js.map +1 -1
  23. package/dist/src/nile-slider/types/nile-slider.types.d.ts +1 -0
  24. package/dist/src/nile-slider/types/nile-slider.types.js.map +1 -1
  25. package/dist/src/nile-slider/utils/nile-slider.utils.js +4 -0
  26. package/dist/src/nile-slider/utils/nile-slider.utils.js.map +1 -1
  27. package/dist/src/version.js +1 -1
  28. package/dist/src/version.js.map +1 -1
  29. package/dist/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +1 -1
  31. package/src/nile-slider/nile-slider.css.ts +160 -39
  32. package/src/nile-slider/nile-slider.template.ts +45 -2
  33. package/src/nile-slider/nile-slider.ts +11 -3
  34. package/src/nile-slider/types/nile-slider.types.ts +2 -0
  35. package/src/nile-slider/utils/nile-slider.utils.ts +2 -0
  36. package/vscode-html-custom-data.json +38 -9
package/dist/index.js CHANGED
@@ -5736,7 +5736,7 @@ class no{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
5736
5736
  * @license
5737
5737
  * Copyright 2021 Google LLC
5738
5738
  * SPDX-License-Identifier: BSD-3-Clause
5739
- */(this._hostElement,e),this._scrollerController=new oo(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((e=>{e.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(e),this._hostElementRO.observe(e)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((e=>this._childrenRO.observe(e))),this._scrollEventListeners.forEach((e=>e.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((e=>e.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){const e=this._hostElement;if(!this._sizer){let t=e.querySelector(`[${so}]`);t||(t=document.createElement("div"),t.setAttribute(so,""),e.appendChild(t)),Object.assign(t.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),t.textContent="&nbsp;",t.setAttribute(so,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||ao;if("function"==typeof t&&this._layout instanceof t){const t={...e};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(e){let t,i;if("function"==typeof e.type){i=e.type;const n={...e};delete n.type,t=n}else t=e;void 0===i&&(ao=i=(await Promise.resolve().then((function(){return Yv}))).FlowLayout),this._layout=new i((e=>this._handleLayoutMessage(e)),t),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const e=window.performance.now(),t=e-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter((t=>t.startTime>=this._benchmarkStart&&t.startTime<e)).reduce(((e,t)=>e+t.duration),0);return this._benchmarkStart=null,{timeElapsed:t,virtualizationTime:i}}return null}_measureChildren(){const e={},t=this._children,i=this._measureChildOverride||this._measureChild;for(let n=0;n<t.length;n++){const o=t[n],M=this._first+n;(this._itemsChanged||this._toBeMeasured.has(o))&&(e[M]=i.call(this,o,this._items[M]))}this._childMeasurements=e,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(e){const{width:t,height:i}=e.getBoundingClientRect();return Object.assign({width:t,height:i},function(e){const t=window.getComputedStyle(e);return{marginTop:go(t.marginTop),marginRight:go(t.marginRight),marginBottom:go(t.marginBottom),marginLeft:go(t.marginLeft)}}(e))}async _schedule(e){this._scheduled.has(e)||(this._scheduled.add(e),await Promise.resolve(),this._scheduled.delete(e),e.call(this))}async _updateDOM(e){this._scrollSize=e.scrollSize,this._adjustRange(e.range),this._childrenPos=e.childPositions,this._scrollError=e.scrollError||null;const{_rangeChanged:t,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(t||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((e=>this._childrenRO.observe(e))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(e){console.warn("Error measuring performance data: ",e)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(e){if("scroll"===e.type)(e.currentTarget===window||this._clippingAncestors.includes(e.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",e)}_handleLayoutMessage(e){"stateChanged"===e.type?this._updateDOM(e):"visibilityChanged"===e.type?(this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._notifyVisibility()):"unpinned"===e.type&&this._hostElement.dispatchEvent(new io)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(so)||e.push(t),t=t.nextElementSibling;return e}_updateView(){const e=this._hostElement,t=this._scrollerController?.element,i=this._layout;if(e&&t&&i){let n,o,M,r;const s=e.getBoundingClientRect();n=0,o=0,M=window.innerHeight,r=window.innerWidth;const a=this._clippingAncestors.map((e=>e.getBoundingClientRect()));a.unshift(s);for(const e of a)n=Math.max(n,e.top),o=Math.max(o,e.left),M=Math.min(M,e.bottom),r=Math.min(r,e.right);const l=t.getBoundingClientRect(),g={left:s.left-l.left,top:s.top-l.top},N={width:t.scrollWidth,height:t.scrollHeight},c=n-s.top+e.scrollTop,u=o-s.left+e.scrollLeft,D=Math.max(0,M-n),d=Math.max(0,r-o);i.viewportSize={width:d,height:D},i.viewportScroll={top:c,left:u},i.totalScrollSize=N,i.offsetWithinScroller=g}}_sizeHostElement(e){const t=82e5,i=e&&null!==e.width?Math.min(t,e.width):0,n=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${n}px)`;else{const e=this._hostElement.style;e.minWidth=i?`${i}px`:"100%",e.minHeight=n?`${n}px`:"100%"}}_positionChildren(e){e&&e.forEach((({top:e,left:t,width:i,height:n,xOffset:o,yOffset:M},r)=>{const s=this._children[r-this._first];s&&(s.style.position="absolute",s.style.boxSizing="border-box",s.style.transform=`translate(${t}px, ${e}px)`,void 0!==i&&(s.style.width=i+"px"),void 0!==n&&(s.style.height=n+"px"),s.style.left=void 0===o?null:o+"px",s.style.top=void 0===M?null:M+"px")}))}async _adjustRange(e){const{_first:t,_last:i,_firstVisible:n,_lastVisible:o}=this;this._first=e.first,this._last=e.last,this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==t||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==n||this._lastVisible!==o}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:i,left:n}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-i,left:t-n})}}element(e){return e===1/0&&(e=this._items.length-1),void 0===this._items?.[e]?void 0:{scrollIntoView:(t={})=>this._scrollElementIntoView({...t,index:e})}}_scrollElementIntoView(e){if(e.index>=this._first&&e.index<=this._last)this._children[e.index-this._first].scrollIntoView(e);else if(e.index=Math.min(e.index,this._items.length-1),"smooth"===e.behavior){const t=this._layout.getScrollIntoViewCoordinates(e),{behavior:i}=e;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(t,{behavior:i}),(()=>this._layout.getScrollIntoViewCoordinates(e)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=e}else this._layout.pin=e}_checkScrollIntoViewTarget(e){const{index:t}=this._scrollIntoViewTarget||{};t&&e?.has(t)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new eo({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new to({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((e,t)=>{this._layoutCompleteResolver=e,this._layoutCompleteRejecter=t}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(e){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(e),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(e){if(this._layout?.measureChildren){for(const t of e)this._toBeMeasured.set(t.target,t.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function go(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function No(e){if(null!==e.assignedSlot)return e.assignedSlot;if(null!==e.parentElement)return e.parentElement;const t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const co=Ae(class extends Xn{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>((e,t)=>_`${t}: ${JSON.stringify(e,null,2)}`)(e,t+this._first),this._keyFunction=(e,t)=>(e=>e)(e,this._first),this._items=[],e.type!==ye)throw new Error("The virtualize directive can only be used in child expressions")}render(e){e&&this._setFunctions(e);const t=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)t.push(this._items[e]);return Kn(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);const i=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),i?R:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){const i=e.parentNode;this._makeVirtualizer(i,t)}this._virtualizer.items=this._items}_setFunctions(e){const{renderItem:t,keyFunction:i}=e;t&&(this._renderItem=(e,i)=>t(e,i+this._first)),i&&(this._keyFunction=(e,t)=>i(e,t+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();const{layout:i,scroller:n,items:o}=t;this._virtualizer=new lo({hostElement:e,layout:i,scroller:n}),this._virtualizer.items=o,this._virtualizer.connected()}_initialize(e,t){const i=e.parentNode;i&&1===i.nodeType&&(i.addEventListener("rangeChanged",(e=>{this._first=e.first,this._last=e.last,this.setValue(this.render())})),this._makeVirtualizer(i,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});class uo{static getVirtualizedContent(e,t,i,n,o,M,r,s,a,l,g,N,c,u,D,d){return _`
5739
+ */(this._hostElement,e),this._scrollerController=new oo(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((e=>{e.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(e),this._hostElementRO.observe(e)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((e=>this._childrenRO.observe(e))),this._scrollEventListeners.forEach((e=>e.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((e=>e.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){const e=this._hostElement;if(!this._sizer){let t=e.querySelector(`[${so}]`);t||(t=document.createElement("div"),t.setAttribute(so,""),e.appendChild(t)),Object.assign(t.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),t.textContent="&nbsp;",t.setAttribute(so,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||ao;if("function"==typeof t&&this._layout instanceof t){const t={...e};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(e){let t,i;if("function"==typeof e.type){i=e.type;const n={...e};delete n.type,t=n}else t=e;void 0===i&&(ao=i=(await Promise.resolve().then((function(){return Zv}))).FlowLayout),this._layout=new i((e=>this._handleLayoutMessage(e)),t),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const e=window.performance.now(),t=e-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter((t=>t.startTime>=this._benchmarkStart&&t.startTime<e)).reduce(((e,t)=>e+t.duration),0);return this._benchmarkStart=null,{timeElapsed:t,virtualizationTime:i}}return null}_measureChildren(){const e={},t=this._children,i=this._measureChildOverride||this._measureChild;for(let n=0;n<t.length;n++){const o=t[n],M=this._first+n;(this._itemsChanged||this._toBeMeasured.has(o))&&(e[M]=i.call(this,o,this._items[M]))}this._childMeasurements=e,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(e){const{width:t,height:i}=e.getBoundingClientRect();return Object.assign({width:t,height:i},function(e){const t=window.getComputedStyle(e);return{marginTop:go(t.marginTop),marginRight:go(t.marginRight),marginBottom:go(t.marginBottom),marginLeft:go(t.marginLeft)}}(e))}async _schedule(e){this._scheduled.has(e)||(this._scheduled.add(e),await Promise.resolve(),this._scheduled.delete(e),e.call(this))}async _updateDOM(e){this._scrollSize=e.scrollSize,this._adjustRange(e.range),this._childrenPos=e.childPositions,this._scrollError=e.scrollError||null;const{_rangeChanged:t,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(t||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((e=>this._childrenRO.observe(e))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(e){console.warn("Error measuring performance data: ",e)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(e){if("scroll"===e.type)(e.currentTarget===window||this._clippingAncestors.includes(e.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",e)}_handleLayoutMessage(e){"stateChanged"===e.type?this._updateDOM(e):"visibilityChanged"===e.type?(this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._notifyVisibility()):"unpinned"===e.type&&this._hostElement.dispatchEvent(new io)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(so)||e.push(t),t=t.nextElementSibling;return e}_updateView(){const e=this._hostElement,t=this._scrollerController?.element,i=this._layout;if(e&&t&&i){let n,o,M,r;const s=e.getBoundingClientRect();n=0,o=0,M=window.innerHeight,r=window.innerWidth;const a=this._clippingAncestors.map((e=>e.getBoundingClientRect()));a.unshift(s);for(const e of a)n=Math.max(n,e.top),o=Math.max(o,e.left),M=Math.min(M,e.bottom),r=Math.min(r,e.right);const l=t.getBoundingClientRect(),g={left:s.left-l.left,top:s.top-l.top},N={width:t.scrollWidth,height:t.scrollHeight},c=n-s.top+e.scrollTop,u=o-s.left+e.scrollLeft,D=Math.max(0,M-n),d=Math.max(0,r-o);i.viewportSize={width:d,height:D},i.viewportScroll={top:c,left:u},i.totalScrollSize=N,i.offsetWithinScroller=g}}_sizeHostElement(e){const t=82e5,i=e&&null!==e.width?Math.min(t,e.width):0,n=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${n}px)`;else{const e=this._hostElement.style;e.minWidth=i?`${i}px`:"100%",e.minHeight=n?`${n}px`:"100%"}}_positionChildren(e){e&&e.forEach((({top:e,left:t,width:i,height:n,xOffset:o,yOffset:M},r)=>{const s=this._children[r-this._first];s&&(s.style.position="absolute",s.style.boxSizing="border-box",s.style.transform=`translate(${t}px, ${e}px)`,void 0!==i&&(s.style.width=i+"px"),void 0!==n&&(s.style.height=n+"px"),s.style.left=void 0===o?null:o+"px",s.style.top=void 0===M?null:M+"px")}))}async _adjustRange(e){const{_first:t,_last:i,_firstVisible:n,_lastVisible:o}=this;this._first=e.first,this._last=e.last,this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==t||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==n||this._lastVisible!==o}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:i,left:n}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-i,left:t-n})}}element(e){return e===1/0&&(e=this._items.length-1),void 0===this._items?.[e]?void 0:{scrollIntoView:(t={})=>this._scrollElementIntoView({...t,index:e})}}_scrollElementIntoView(e){if(e.index>=this._first&&e.index<=this._last)this._children[e.index-this._first].scrollIntoView(e);else if(e.index=Math.min(e.index,this._items.length-1),"smooth"===e.behavior){const t=this._layout.getScrollIntoViewCoordinates(e),{behavior:i}=e;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(t,{behavior:i}),(()=>this._layout.getScrollIntoViewCoordinates(e)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=e}else this._layout.pin=e}_checkScrollIntoViewTarget(e){const{index:t}=this._scrollIntoViewTarget||{};t&&e?.has(t)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new eo({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new to({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((e,t)=>{this._layoutCompleteResolver=e,this._layoutCompleteRejecter=t}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(e){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(e),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(e){if(this._layout?.measureChildren){for(const t of e)this._toBeMeasured.set(t.target,t.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function go(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function No(e){if(null!==e.assignedSlot)return e.assignedSlot;if(null!==e.parentElement)return e.parentElement;const t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const co=Ae(class extends Xn{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>((e,t)=>_`${t}: ${JSON.stringify(e,null,2)}`)(e,t+this._first),this._keyFunction=(e,t)=>(e=>e)(e,this._first),this._items=[],e.type!==ye)throw new Error("The virtualize directive can only be used in child expressions")}render(e){e&&this._setFunctions(e);const t=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)t.push(this._items[e]);return Kn(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);const i=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),i?R:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){const i=e.parentNode;this._makeVirtualizer(i,t)}this._virtualizer.items=this._items}_setFunctions(e){const{renderItem:t,keyFunction:i}=e;t&&(this._renderItem=(e,i)=>t(e,i+this._first)),i&&(this._keyFunction=(e,t)=>i(e,t+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();const{layout:i,scroller:n,items:o}=t;this._virtualizer=new lo({hostElement:e,layout:i,scroller:n}),this._virtualizer.items=o,this._virtualizer.connected()}_initialize(e,t){const i=e.parentNode;i&&1===i.nodeType&&(i.addEventListener("rangeChanged",(e=>{this._first=e.first,this._last=e.last,this.setValue(this.render())})),this._makeVirtualizer(i,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});class uo{static getVirtualizedContent(e,t,i,n,o,M,r,s,a,l,g,N,c,u,D,d){return _`
5740
5740
  <div part="select-options" class="select__options ${t?"select__options__search-enabled":""} ${c?"loading":""}">
5741
5741
  ${g&&!c?_`
5742
5742
  <div part="select-no-results" class="select__no-results">
@@ -15076,12 +15076,31 @@ nile-badge::part(content) {
15076
15076
  display: block;
15077
15077
  }
15078
15078
 
15079
+ /* Field header */
15080
+
15081
+ .field-header {
15082
+ display: flex;
15083
+ justify-content: space-between;
15084
+ align-items: center;
15085
+ gap: var(--nile-spacing-md, var(--ng-spacing-md));
15086
+ margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));
15087
+ }
15088
+
15089
+ .field-label {
15090
+ font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
15091
+ font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
15092
+ font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
15093
+ color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));
15094
+ }
15095
+
15096
+ /* Layout */
15097
+
15079
15098
  .container {
15080
15099
  display: flex;
15081
15100
  justify-content: center;
15082
15101
  align-items: center;
15083
- gap: 10px;
15084
- height: 100px;
15102
+ gap: var(--nile-spacing-md, var(--ng-spacing-md));
15103
+ min-height: var(--nile-spacing-5xl, var(--ng-spacing-5xl));
15085
15104
  }
15086
15105
 
15087
15106
  .align-item-center {
@@ -15089,14 +15108,14 @@ nile-badge::part(content) {
15089
15108
  }
15090
15109
 
15091
15110
  slot.span {
15092
- font-size: var(--nile-font-size-micro);
15093
- margin-top: 14px;
15111
+ font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));
15094
15112
  }
15095
15113
 
15096
15114
  .range-container {
15097
15115
  display: flex;
15098
15116
  flex-direction: column;
15099
- gap: var(--nile-spacing-sm);
15117
+ flex: 1 1 auto;
15118
+ gap: var(--nile-spacing-sm, var(--ng-spacing-sm));
15100
15119
  }
15101
15120
 
15102
15121
  .column-reverse {
@@ -15109,18 +15128,21 @@ nile-badge::part(content) {
15109
15128
  }
15110
15129
 
15111
15130
  .label-container span {
15112
- margin: var(--nile-spacing-none);
15113
- padding: var(--nile-spacing-none);
15114
- font-size: var(--nile-font-size-micro);
15131
+ margin: var(--nile-spacing-none, var(--ng-spacing-none));
15132
+ padding: var(--nile-spacing-none, var(--ng-spacing-none));
15133
+ font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));
15134
+ color: var(--nile-colors-dark-500, var(--ng-colors-text-tertiary-600));
15115
15135
  }
15116
15136
 
15137
+ /* track & fill */
15138
+
15117
15139
  .range {
15118
15140
  position: relative;
15119
- width: 228px;
15120
- height: 4px;
15121
- background-color: var(--nile-colors-neutral-400);
15141
+ width: var(--nile-slider-width, 228px);
15142
+ height: var(--nile-spacing-xs, var(--ng-spacing-sm));
15143
+ background-color: var(--nile-colors-neutral-400, var(--ng-colors-bg-quaternary));
15122
15144
  user-select: none;
15123
- border-radius: var(--nile-radius-radius-3xl);
15145
+ border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));
15124
15146
  }
15125
15147
 
15126
15148
  .range:hover {
@@ -15131,52 +15153,158 @@ nile-badge::part(content) {
15131
15153
  position: absolute;
15132
15154
  height: 100%;
15133
15155
  width: 0%;
15134
- background-color: var(--nile-colors-primary-600);
15156
+ background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-solid));
15135
15157
  top: 0px;
15136
15158
  left: 0px;
15137
15159
  z-index: 98;
15138
- border-radius: var(--nile-radius-radius-3xl);
15160
+ border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));
15139
15161
  }
15140
15162
 
15141
- .range-button {
15142
- height: 12px;
15143
- width: 12px;
15144
- background-color: var(--nile-colors-primary-600);
15163
+ /* ------------------------------------------------------------------ */
15164
+ /* Inline value label (valueLabel="bottom") */
15165
+ /* ------------------------------------------------------------------ */
15166
+
15167
+ .value-label {
15168
+ position: absolute;
15169
+ /* Start at the track bottom, then push down past the handle and the
15170
+ largest (pressed, 8px) ring */
15171
+ top: 100%;
15172
+ margin-top: var(--nile-spacing-xl, var(--ng-spacing-xl));
15173
+ transform: translateX(-50%);
15174
+ font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
15175
+ font-size: var(--nile-font-size-micro, var(--ng-font-size-text-xs));
15176
+ font-variant-numeric: tabular-nums;
15177
+ color: var(--nile-colors-dark-500, var(--ng-colors-text-quaternary-500));
15178
+ white-space: nowrap;
15179
+ pointer-events: none;
15180
+ user-select: none;
15181
+ -webkit-user-select: none;
15182
+ }
15183
+
15184
+ /* Reserve room below the track for the inline value label */
15185
+ :host([valuelabel='bottom']) .container {
15186
+ padding-bottom: var(--nile-spacing-2xl, var(--ng-spacing-2xl));
15187
+ }
15188
+
15189
+ /* Handles */
15190
+
15191
+ .range-button,
15192
+ .range-button-two {
15193
+ height: var(--nile-spacing-lg, var(--ng-spacing-2xl));
15194
+ width: var(--nile-spacing-lg, var(--ng-spacing-2xl));
15195
+ box-sizing: border-box;
15196
+ /* Enterprise: solid brand dot - NextGen: white fill + brand border */
15197
+ background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-primary));
15198
+ border: var(--nile-spacing-xxs, var(--ng-spacing-xxs)) solid
15199
+ var(--nile-colors-primary-600, var(--ng-colors-border-brand-alt));
15145
15200
  position: absolute;
15146
15201
  top: 50%;
15147
15202
  transform: translate(-50%, -50%);
15148
- border-radius: var(--nile-radius-radius-3xl);
15203
+ border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-full));
15149
15204
  left: 0;
15150
15205
  z-index: 100;
15151
- box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;
15152
- transition: box-shadow var(--nile-transition-duration-default) ease;
15206
+ cursor: grab;
15207
+ transition:
15208
+ box-shadow var(--nile-transition-duration-short, 120ms) ease,
15209
+ background-color var(--nile-transition-duration-short, 120ms) ease,
15210
+ transform var(--nile-transition-duration-shorter, 80ms) ease;
15153
15211
  }
15154
15212
 
15155
- .range-button:hover, .range-button-two:hover {
15156
- cursor: pointer;
15157
- background-color: var(--nile-colors-primary-700);
15213
+ .range-button-two {
15214
+ left: 100%;
15158
15215
  }
15159
15216
 
15160
- .range-button:active, .range-button-two:active {
15161
- transition: box-shadow var(--nile-transition-duration-default) ease;
15162
- background-color: var(--nile-colors-primary-700);
15163
- box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 4px;
15217
+ /* Hover: ring (Enterprise 2px - NextGen 6px) */
15218
+ .range-button:hover,
15219
+ .range-button-two:hover {
15220
+ cursor: grab;
15221
+ box-shadow: 0 0 0 var(--nile-spacing-xxs, var(--ng-spacing-sm))
15222
+ var(--nile-colors-primary-100, var(--ng-colors-bg-brand-secondary));
15164
15223
  }
15165
15224
 
15166
- .range-button-two {
15167
- height: 12px;
15168
- width: 12px;
15169
- background-color: var(--nile-colors-primary-600);
15170
- position: absolute;
15171
- top: 50%;
15225
+ /* Focused: theme focus ring */
15226
+ .range-button:focus-visible,
15227
+ .range-button-two:focus-visible {
15228
+ outline: none;
15229
+ box-shadow: var(--nile-focus-ring,
15230
+ var(--ng-focus-ring,
15231
+ 0 0 0 var(--nile-spacing-xs) var(--nile-colors-primary-100)));
15232
+ }
15233
+
15234
+ /* Pressed: ring (Enterprise 4px - NextGen 8px) + 1.1x scale */
15235
+ .range-button:active,
15236
+ .range-button-two:active {
15237
+ cursor: grabbing;
15238
+ transform: translate(-50%, -50%) scale(1.1);
15239
+ box-shadow: 0 0 0 var(--nile-spacing-xs, var(--ng-spacing-md))
15240
+ var(--nile-colors-primary-100, var(--ng-colors-bg-brand-secondary));
15241
+ }
15242
+
15243
+ /* Error state */
15244
+ :host([error]) .range-completed {
15245
+ background-color: var(--nile-colors-red-700, var(--ng-colors-bg-error-solid));
15246
+ }
15247
+
15248
+ :host([error]) .range-button,
15249
+ :host([error]) .range-button-two {
15250
+ background-color: var(--nile-colors-red-700, var(--ng-colors-bg-primary));
15251
+ border-color: var(--nile-colors-red-700, var(--ng-colors-border-error));
15252
+ }
15253
+
15254
+ :host([error]) .range-button:hover,
15255
+ :host([error]) .range-button-two:hover {
15256
+ box-shadow: 0 0 0 var(--nile-spacing-xxs, var(--ng-spacing-sm))
15257
+ var(--nile-colors-red-100, var(--ng-colors-bg-error-secondary, var(--ng-color-error-100)));
15258
+ }
15259
+
15260
+ :host([error]) .range-button:focus-visible,
15261
+ :host([error]) .range-button-two:focus-visible {
15262
+ box-shadow: var(--nile-focus-ring-error,
15263
+ var(--ng-focus-ring-error,
15264
+ 0 0 0 var(--nile-spacing-xs) var(--nile-colors-red-100)));
15265
+ }
15266
+
15267
+ /* Disabled state */
15268
+ :host([disabled]) .range,
15269
+ :host([disabled]) .range:hover {
15270
+ cursor: not-allowed;
15271
+ background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-disabled));
15272
+ }
15273
+
15274
+ :host([disabled]) .range-completed {
15275
+ background-color: var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled));
15276
+ }
15277
+
15278
+ :host([disabled]) .range-button,
15279
+ :host([disabled]) .range-button-two {
15280
+ background-color: var(--nile-colors-neutral-500, var(--ng-colors-bg-primary));
15281
+ border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));
15282
+ cursor: not-allowed;
15283
+ }
15284
+
15285
+ :host([disabled]) .range-button:hover,
15286
+ :host([disabled]) .range-button-two:hover,
15287
+ :host([disabled]) .range-button:active,
15288
+ :host([disabled]) .range-button-two:active {
15289
+ box-shadow: none;
15172
15290
  transform: translate(-50%, -50%);
15173
- border-radius: var(--nile-radius-radius-3xl);
15174
- left: 100%;
15175
- z-index: 100;
15176
- box-shadow: rgba(0, 82, 145, 0.1) 0px 1px 2px 0px, rgba(0, 94, 166, 0.15) 0px 0px 0px 2px;
15177
- transition: box-shadow var(--nile-transition-duration-default) ease;
15178
15291
  }
15179
- `,tm=(e,t)=>Math.max(0,Math.min(t,e.width))/e.width*100,im=(e,t)=>{const i=t.minValue+e/100*(t.maxValue-t.minValue);return t.maxValue-t.minValue<1?parseFloat(i.toFixed(2)):Math.floor(i)},nm=(e,t)=>(e-t.minValue)/(t.maxValue-t.minValue)*100,om=(e,t,i)=>{const n=e.clientX-t.left,o=tm(t,n);i.value=im(o,i),i.emit("nile-change",{value:i.value}),i.buttonOne.style.left=`${o}%`,i.completed.style.width=`${o}%`},Mm=e=>{window.addEventListener("mousemove",e.onMouseMove),window.addEventListener("mouseup",e.onMouseUp)};let rm=class extends Fe{constructor(){super(...arguments),this.minValue=0,this.value=this.minValue,this.maxValue=100,this.rangeOneValue=this.minValue,this.rangeTwoValue=this.maxValue,this.showLabel=!1,this.labelStart="",this.labelEnd="",this.rangeSlider=!1,this.labelPosition="top",this.tooltipPosition="top",this.activeThumb=null,this.onMouseMove=e=>{const t=this.range.getBoundingClientRect();if(this.rangeSlider){"one"===this.activeThumb?((e,t,i)=>{const n=e.clientX-t.left,o=tm(t,n);i.rangeOneValue=im(o,i),i.rangeOneValue=Math.min(i.rangeOneValue,i.rangeTwoValue),i.emit("nile-button-first-change",{value:i.rangeOneValue}),i.rangeTwoValue>i.rangeOneValue&&(i.buttonOne.style.left=`${o}%`)})(e,t,this):"two"===this.activeThumb&&((e,t,i)=>{const n=e.clientX-t.left,o=tm(t,n);i.rangeTwoValue=im(o,i),i.rangeTwoValue=Math.max(i.rangeTwoValue,i.rangeOneValue),i.emit("nile-button-last-change",{value:i.rangeTwoValue}),i.rangeTwoValue>i.rangeOneValue&&(i.buttonTwo.style.left=`${o}%`)})(e,t,this);const i=nm(this.rangeOneValue,this),n=nm(this.rangeTwoValue,this),o=Math.min(i,n),M=Math.abs(n-i);this.rangeTwoValue>=this.rangeOneValue&&(this.completed.style.left=`${o}%`,this.completed.style.width=`${M}%`)}else om(e,t,this)},this.onMouseUp=()=>{var e;this.rangeSlider?(this.emit("nile-button-first-change-end",{value:this.rangeOneValue}),this.emit("nile-button-last-change-end",{value:this.rangeTwoValue})):this.emit("nile-change-end",{value:this.value}),this.activeThumb=null,e=this,window.removeEventListener("mousemove",e.onMouseMove),window.removeEventListener("mouseup",e.onMouseUp)},this.onMouseDown=e=>{const t=this.range.getBoundingClientRect(),i=(e.clientX-t.left)/t.width*100,n=this.minValue+i/100*(this.maxValue-this.minValue);if(this.rangeSlider){((e,t)=>{if(Math.abs(e-t.rangeOneValue)<=Math.abs(e-t.rangeTwoValue)){const i=Math.min(e,t.rangeTwoValue);t.rangeOneValue=t.checkValueValidity(i,t.minValue,t.maxValue)}else{const i=Math.max(e,t.rangeOneValue);t.rangeTwoValue=t.checkValueValidity(i,t.minValue,t.maxValue)}const i=nm(t.rangeOneValue,t),n=nm(t.rangeTwoValue,t);t.buttonOne.style.left=`${i}%`,t.buttonTwo.style.left=`${n}%`;const o=Math.min(i,n),M=Math.abs(n-i);t.completed.style.left=`${o}%`,t.completed.style.width=`${M}%`,t.emit("nile-button-first-change",{value:t.rangeOneValue}),t.emit("nile-button-last-change",{value:t.rangeTwoValue})})(n,this);const e=Math.abs(n-this.rangeOneValue),t=Math.abs(n-this.rangeTwoValue);this.activeThumb=e<=t?"one":"two",Mm(this)}else om(e,t,this),this.activeThumb="one",Mm(this)}}static get styles(){return[em]}connectedCallback(){super.connectedCallback(),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity()}firstUpdated(e){var t;if((t=this).range=t.renderRoot.querySelector(".range"),t.buttonOne=t.renderRoot.querySelector(".range-button"),t.buttonTwo=t.renderRoot.querySelector(".range-button-two"),t.completed=t.renderRoot.querySelector(".range-completed"),t.range.addEventListener("mousedown",t.onMouseDown),t.buttonOne?.addEventListener("mousedown",(()=>{t.activeThumb="one",Mm(t)})),t.buttonTwo?.addEventListener("mousedown",(()=>{t.activeThumb="two",Mm(t)})),!this.rangeSlider&&e.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);const e=nm(this.value,this);this.buttonOne.style.left=`${e}%`,this.completed.style.width=`${e}%`}else if(this.rangeSlider){const e=nm(this.rangeOneValue,this),t=nm(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left=`${e}%`),this.buttonTwo&&(this.buttonTwo.style.left=`${t}%`);const i=Math.min(e,t),n=Math.abs(t-e);this.completed.style.left=`${i}%`,this.completed.style.width=`${n}%`}}checkValueValidity(e,t,i){return i-t<=1?Math.max(t,Math.min(e,i)):Math.floor(Math.max(t,Math.min(e,i)))}checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue)}render(){const e=this.showLabel,t=e?"label-start label-end":void 0;return _`
15292
+
15293
+ :host([disabled]) .field-label,
15294
+ :host([disabled]) .value-label,
15295
+ :host([disabled]) .label-container span {
15296
+ color: var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled));
15297
+ user-select: none;
15298
+ -webkit-user-select: none;
15299
+ }
15300
+ `,tm=(e,t)=>Math.max(0,Math.min(t,e.width))/e.width*100,im=(e,t)=>{const i=t.minValue+e/100*(t.maxValue-t.minValue);return t.maxValue-t.minValue<1?parseFloat(i.toFixed(2)):Math.floor(i)},nm=(e,t)=>(e-t.minValue)/(t.maxValue-t.minValue)*100,om=(e,t,i)=>{const n=e.clientX-t.left,o=tm(t,n);i.value=im(o,i),i.emit("nile-change",{value:i.value}),i.buttonOne.style.left=`${o}%`,i.completed.style.width=`${o}%`},Mm=e=>{window.addEventListener("mousemove",e.onMouseMove),window.addEventListener("mouseup",e.onMouseUp)},rm=e=>e.disabled||"tooltip"!==e.valueLabel;let sm=class extends Fe{constructor(){super(...arguments),this.minValue=0,this.value=this.minValue,this.maxValue=100,this.rangeOneValue=this.minValue,this.rangeTwoValue=this.maxValue,this.showLabel=!1,this.labelStart="",this.labelEnd="",this.rangeSlider=!1,this.labelPosition="top",this.tooltipPosition="top",this.label="",this.disabled=!1,this.error=!1,this.valueLabel="tooltip",this.activeThumb=null,this.onMouseMove=e=>{if(this.disabled)return;const t=this.range.getBoundingClientRect();if(this.rangeSlider){"one"===this.activeThumb?((e,t,i)=>{const n=e.clientX-t.left,o=tm(t,n);i.rangeOneValue=im(o,i),i.rangeOneValue=Math.min(i.rangeOneValue,i.rangeTwoValue),i.emit("nile-button-first-change",{value:i.rangeOneValue}),i.rangeTwoValue>i.rangeOneValue&&(i.buttonOne.style.left=`${o}%`)})(e,t,this):"two"===this.activeThumb&&((e,t,i)=>{const n=e.clientX-t.left,o=tm(t,n);i.rangeTwoValue=im(o,i),i.rangeTwoValue=Math.max(i.rangeTwoValue,i.rangeOneValue),i.emit("nile-button-last-change",{value:i.rangeTwoValue}),i.rangeTwoValue>i.rangeOneValue&&(i.buttonTwo.style.left=`${o}%`)})(e,t,this);const i=nm(this.rangeOneValue,this),n=nm(this.rangeTwoValue,this),o=Math.min(i,n),M=Math.abs(n-i);this.rangeTwoValue>=this.rangeOneValue&&(this.completed.style.left=`${o}%`,this.completed.style.width=`${M}%`)}else om(e,t,this)},this.onMouseUp=()=>{var e;this.rangeSlider?(this.emit("nile-button-first-change-end",{value:this.rangeOneValue}),this.emit("nile-button-last-change-end",{value:this.rangeTwoValue})):this.emit("nile-change-end",{value:this.value}),this.activeThumb=null,e=this,window.removeEventListener("mousemove",e.onMouseMove),window.removeEventListener("mouseup",e.onMouseUp)},this.onMouseDown=e=>{if(this.disabled)return;const t=this.range.getBoundingClientRect(),i=(e.clientX-t.left)/t.width*100,n=this.minValue+i/100*(this.maxValue-this.minValue);if(this.rangeSlider){((e,t)=>{if(Math.abs(e-t.rangeOneValue)<=Math.abs(e-t.rangeTwoValue)){const i=Math.min(e,t.rangeTwoValue);t.rangeOneValue=t.checkValueValidity(i,t.minValue,t.maxValue)}else{const i=Math.max(e,t.rangeOneValue);t.rangeTwoValue=t.checkValueValidity(i,t.minValue,t.maxValue)}const i=nm(t.rangeOneValue,t),n=nm(t.rangeTwoValue,t);t.buttonOne.style.left=`${i}%`,t.buttonTwo.style.left=`${n}%`;const o=Math.min(i,n),M=Math.abs(n-i);t.completed.style.left=`${o}%`,t.completed.style.width=`${M}%`,t.emit("nile-button-first-change",{value:t.rangeOneValue}),t.emit("nile-button-last-change",{value:t.rangeTwoValue})})(n,this);const e=Math.abs(n-this.rangeOneValue),t=Math.abs(n-this.rangeTwoValue);this.activeThumb=e<=t?"one":"two",Mm(this)}else om(e,t,this),this.activeThumb="one",Mm(this)}}static get styles(){return[em]}connectedCallback(){super.connectedCallback(),this.emit("nile-init"),this.rangeSlider&&this.checkRangeValidity()}firstUpdated(e){var t;if((t=this).range=t.renderRoot.querySelector(".range"),t.buttonOne=t.renderRoot.querySelector(".range-button"),t.buttonTwo=t.renderRoot.querySelector(".range-button-two"),t.completed=t.renderRoot.querySelector(".range-completed"),t.range.addEventListener("mousedown",t.onMouseDown),t.buttonOne?.addEventListener("mousedown",(()=>{t.disabled||(t.activeThumb="one",Mm(t))})),t.buttonTwo?.addEventListener("mousedown",(()=>{t.disabled||(t.activeThumb="two",Mm(t))})),!this.rangeSlider&&e.has("value")){this.value=this.checkValueValidity(this.value,this.minValue,this.maxValue);const e=nm(this.value,this);this.buttonOne.style.left=`${e}%`,this.completed.style.width=`${e}%`}else if(this.rangeSlider){const e=nm(this.rangeOneValue,this),t=nm(this.rangeTwoValue,this);this.buttonOne&&(this.buttonOne.style.left=`${e}%`),this.buttonTwo&&(this.buttonTwo.style.left=`${t}%`);const i=Math.min(e,t),n=Math.abs(t-e);this.completed.style.left=`${i}%`,this.completed.style.width=`${n}%`}}checkValueValidity(e,t,i){return i-t<=1?Math.max(t,Math.min(e,i)):Math.floor(Math.max(t,Math.min(e,i)))}checkRangeValidity(){this.rangeTwoValue>this.maxValue?this.rangeTwoValue=this.maxValue:this.rangeTwoValue<this.rangeOneValue&&(this.rangeTwoValue=this.rangeOneValue),this.rangeOneValue<this.minValue?this.rangeOneValue=this.minValue:this.rangeOneValue>this.rangeTwoValue&&(this.rangeOneValue=this.rangeTwoValue)}render(){const e=this.showLabel,t=e?"label-start label-end":void 0;return _`
15301
+ ${this.label?(i=this,_`
15302
+ <div part="field-header" class="field-header">
15303
+ <label id="field-label" part="field-label" class="field-label">
15304
+ ${i.label}
15305
+ </label>
15306
+ </div>
15307
+ `):_``}
15180
15308
  <div
15181
15309
  part="base"
15182
15310
  class=${xe({container:!0,"align-item-center":!e})}
@@ -15187,12 +15315,12 @@ nile-badge::part(content) {
15187
15315
  part="range-container"
15188
15316
  class=${xe({"range-container":!0,"column-reverse":"bottom"===this.labelPosition})}
15189
15317
  >
15190
- ${e?(i=this,_`
15318
+ ${e?(e=>_`
15191
15319
  <div part="label-container" class="label-container">
15192
- <span id="label-start">${i.labelStart}</span>
15193
- <span id="label-end">${i.labelEnd}</span>
15320
+ <span id="label-start">${e.labelStart}</span>
15321
+ <span id="label-end">${e.labelEnd}</span>
15194
15322
  </div>
15195
- `):_``}
15323
+ `)(this):_``}
15196
15324
 
15197
15325
  <div
15198
15326
  class="range"
@@ -15206,6 +15334,7 @@ nile-badge::part(content) {
15206
15334
  <nile-tooltip
15207
15335
  content=${e.rangeOneValue}
15208
15336
  placement=${e.tooltipPosition}
15337
+ ?disabled=${rm(e)}
15209
15338
  >
15210
15339
  <div
15211
15340
  id="range-one"
@@ -15222,6 +15351,7 @@ nile-badge::part(content) {
15222
15351
  <nile-tooltip
15223
15352
  content=${e.rangeTwoValue}
15224
15353
  placement=${e.tooltipPosition}
15354
+ ?disabled=${rm(e)}
15225
15355
  >
15226
15356
  <div
15227
15357
  id="range-two"
@@ -15241,6 +15371,7 @@ nile-badge::part(content) {
15241
15371
  <nile-tooltip
15242
15372
  content=${e.value}
15243
15373
  placement=${e.tooltipPosition}
15374
+ ?disabled=${rm(e)}
15244
15375
  >
15245
15376
  <div
15246
15377
  class=${xe({"range-button":!0,"range-button-active":"one"===e.activeThumb})}
@@ -15250,17 +15381,35 @@ nile-badge::part(content) {
15250
15381
  aria-valuemin=${e.minValue}
15251
15382
  aria-valuemax=${e.maxValue}
15252
15383
  aria-valuenow=${e.value}
15253
- aria-label=${e.ariaLabel||"Slider value"}
15384
+ aria-label=${e.ariaLabel||e.label||"Slider value"}
15254
15385
  ></div>
15255
15386
  </nile-tooltip>
15256
15387
  </div>
15257
15388
  `)(this)}
15389
+ ${"bottom"===this.valueLabel?(e=>e.rangeSlider?_`
15390
+ <span
15391
+ part="value-label"
15392
+ class="value-label"
15393
+ style="left: ${nm(e.rangeOneValue,e)}%"
15394
+ >${e.rangeOneValue}</span>
15395
+ <span
15396
+ part="value-label"
15397
+ class="value-label"
15398
+ style="left: ${nm(e.rangeTwoValue,e)}%"
15399
+ >${e.rangeTwoValue}</span>
15400
+ `:_`
15401
+ <span
15402
+ part="value-label"
15403
+ class="value-label"
15404
+ style="left: ${nm(e.value,e)}%"
15405
+ >${e.value}</span>
15406
+ `)(this):_``}
15258
15407
  </div>
15259
15408
  </div>
15260
15409
 
15261
15410
  <slot class="span" name="suffix"></slot>
15262
15411
  </div>
15263
- `;var i}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};e([ue({type:Number})],rm.prototype,"minValue",void 0),e([ue({type:Number})],rm.prototype,"value",void 0),e([ue({type:Number})],rm.prototype,"maxValue",void 0),e([ue({type:Number})],rm.prototype,"rangeOneValue",void 0),e([ue({type:Number})],rm.prototype,"rangeTwoValue",void 0),e([ue({type:Boolean})],rm.prototype,"showLabel",void 0),e([ue({type:String})],rm.prototype,"labelStart",void 0),e([ue({type:String})],rm.prototype,"labelEnd",void 0),e([ue({type:Boolean})],rm.prototype,"rangeSlider",void 0),e([ue({type:String})],rm.prototype,"labelPosition",void 0),e([ue({type:String})],rm.prototype,"tooltipPosition",void 0),rm=e([ge("nile-slider")],rm);const sm=r`
15412
+ `;var i}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};e([ue({type:Number})],sm.prototype,"minValue",void 0),e([ue({type:Number})],sm.prototype,"value",void 0),e([ue({type:Number})],sm.prototype,"maxValue",void 0),e([ue({type:Number})],sm.prototype,"rangeOneValue",void 0),e([ue({type:Number})],sm.prototype,"rangeTwoValue",void 0),e([ue({type:Boolean})],sm.prototype,"showLabel",void 0),e([ue({type:String})],sm.prototype,"labelStart",void 0),e([ue({type:String})],sm.prototype,"labelEnd",void 0),e([ue({type:Boolean})],sm.prototype,"rangeSlider",void 0),e([ue({type:String})],sm.prototype,"labelPosition",void 0),e([ue({type:String})],sm.prototype,"tooltipPosition",void 0),e([ue({type:String})],sm.prototype,"label",void 0),e([ue({type:Boolean,reflect:!0})],sm.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0})],sm.prototype,"error",void 0),e([ue({type:String,reflect:!0})],sm.prototype,"valueLabel",void 0),sm=e([ge("nile-slider")],sm);const am=r`
15264
15413
  :host {
15265
15414
  display: inline-block;
15266
15415
  width: 100%;
@@ -15879,7 +16028,7 @@ nile-badge::part(content) {
15879
16028
  font-size: var(--nile-type-scale-2);
15880
16029
  display: inline-block;
15881
16030
  }
15882
- `;var am,lm,gm,Nm,cm,um,Dm;!function(e){e.DEFAULT="default",e.DISABLED="disabled",e.HOVER="hover",e.DRAG="drag",e.ERROR="error"}(am||(am={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(lm||(lm={})),function(e){e.INVALID_FORMAT="Invalid file format! Upload valid file.",e.SIZE_LIMIT_EXCEEDED="File exceeds size limit! Upload smaller file.",e.MULTIPLE_NOT_ALLOWED="Please Upload Single File!",e.DUPLICATES_NOT_ALLOWED="Duplicate Files Are Not Allowed!",e.UPLOAD_URL_REQUIRED="Upload URL is required!",e.SERVER_SIDE_ERROR="Error from server! Please try again later.",e.NETWORK_ERROR="Network error! Please try again later.",e.UPLOAD_CANCELLED="File upload cancelled."}(gm||(gm={})),function(e){e.NILE_INIT="nile-init",e.NILE_BROWSE="nile-browse",e.NILE_CHANGE="nile-change",e.NILE_UPLOADING="nile-uploading",e.NILE_UPLOAD_PROGRESS="nile-upload-progress",e.NILE_UPLOAD_SUCCESS="nile-upload-success",e.NILE_UPLOAD_CANCELLED="nile-upload-cancelled",e.NILE_SIZE_EXCEED_FILES="nile-size-exceed-files",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_NETWORK_ERROR="nile-network-error",e.SERVER_SIDE_ERROR="nile-server-error",e.NILE_DESTROY="nile-destroy",e.NILE_ERROR="nile-error"}(Nm||(Nm={})),function(e){e.TITLE="Drag and drop to upload",e.SUBTITLE="PNG, JPG or SVG (upto 1MB) | 1:1 ratio",e.ERROR_MESSAGE="Invalid File Format.",e.DRAG_STATE_DEFAULT="Drop files here to upload",e.CUSTOM_ERROR="Error Occured!"}(cm||(cm={})),function(e){e.INVALID_FORMAT="Invalid Format",e.SIZE_LIMIT_EXCEEDED="Size Limit Exceeded",e.SERVER_SIDE_ERROR="Server Side Error",e.NETWORK_ERROR="Network Error",e.UPLOAD_CANCELLED="Upload Cancelled"}(um||(um={})),function(e){e.SERVER="SERVER",e.NETWORK="NETWORK",e.UPLOAD_CANCELLED="UPLOAD_CANCELLED",e.VALIDATION="VALIDATION"}(Dm||(Dm={}));const dm=(e,t)=>{t.setIsDisabled((()=>e.state===am.DISABLED)),t.onStateChange((t=>{e.state=t})),t.onFileDrop((t=>{if(e.state===am.DISABLED)return;e.errorMessage="";const i=function(e){const t={B:1,KB:1024,MB:1048576,GB:1024**3},i=parseFloat(e),n=e.replace(/[0-9.\s]/g,"").toUpperCase(),o=t[n]||1;return i*o}(e.size),n=e.uploadedFiles;if(!e.allowMultiple&&n.length+t.length>1)return e.errorMessage=gm.MULTIPLE_NOT_ALLOWED,void e.requestUpdate();let o=!1,M=!1;const r=[],s=[];for(const a of t)a.size>i?(o=!0,s.push(a)):e.allowDuplicates||!n.some((e=>e.name===a.name&&e.size===a.size&&e.type===a.type))?s.includes(a)||r.push(a):(M=!0,s.push(a));if(o){e.errorMessage=gm.SIZE_LIMIT_EXCEEDED;const t=s.filter((e=>e.size>i));e.dispatchEvent(new CustomEvent(Nm.NILE_ERROR,{detail:{files:t,type:um.SIZE_LIMIT_EXCEEDED,errorType:Dm.VALIDATION,message:gm.SIZE_LIMIT_EXCEEDED},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(Nm.NILE_SIZE_EXCEED_FILES,{detail:{files:s}})),e.requestUpdate()}M&&0===r.length&&(e.errorMessage=gm.DUPLICATES_NOT_ALLOWED,e.requestUpdate());let a=[];if(e.allowedTypes.length>0)for(const t of r)e.allowedTypes.includes(t.type)?a.push(t):e.errorMessage=gm.INVALID_FORMAT;0===a.length&&(a=r),e.uploadedFiles=[...n,...a],e.requestUpdate()})),t.setErrorMessage((t=>{e.errorMessage=t}))},hm=(e,t,i)=>{e.addEventListener("mouseenter",(t=>{return i=e.setState,void(e.state===am.DEFAULT&&i(am.HOVER));var i})),e.addEventListener("mouseleave",(t=>{return i=e.setState,void(e.state===am.HOVER&&i(am.DEFAULT));var i})),e.addEventListener("dragenter",(e=>t.dragEnter(e))),e.addEventListener("dragleave",(e=>t.dragLeave(e))),e.addEventListener("dragover",(e=>t.dragOver(e))),e.addEventListener("drop",(e=>t.drop(e)));const n=e.browseFiles.bind(e);new ResizeObserver((t=>{for(const i of t)i.contentRect.width<400?e.horizontalDiv.addEventListener("click",n):e.horizontalDiv.removeEventListener("click",n)})).observe(e.horizontalDiv),Im(e,i),ym(e.uploadedFiles,e)};function jm(e){const{uploadedFiles:t,fileUploadUrl:i,uploadRequests:n}=e;if(i&&t?.length)for(const o of t){if(n.has(o))continue;if(e.doNotUpload.includes(o))continue;if(o.errorMessage)continue;const t=new FormData;t.append("file",o);const M=new XMLHttpRequest;n.set(o,M),e.emit(Nm.NILE_UPLOADING),M.upload.onprogress=t=>{const i=Math.floor(t.loaded/t.total*100);e.dispatchEvent(new CustomEvent(Nm.NILE_UPLOAD_PROGRESS,{detail:{file:o,progress:i},bubbles:!0,composed:!0}))},M.onload=()=>{M.status>=200&&M.status<300?e.dispatchEvent(new CustomEvent(Nm.NILE_UPLOAD_SUCCESS,{detail:{file:o,response:M.response},bubbles:!0,composed:!0})):(e.errorMessage=gm.SERVER_SIDE_ERROR,e.dispatchEvent(new CustomEvent(Nm.SERVER_SIDE_ERROR,{detail:{file:o,status:M.status,response:M.response}})),e.dispatchEvent(new CustomEvent(Nm.NILE_ERROR,{detail:{type:um.SERVER_SIDE_ERROR,file:o,status:M?.status||0,response:M?.response,message:gm.SERVER_SIDE_ERROR,errorType:Dm.SERVER},bubbles:!0,composed:!0})),e.requestUpdate())},M.onerror=()=>{n.delete(o),e.doNotUpload.push(o),e.errorMessage=gm.NETWORK_ERROR,e.dispatchEvent(new CustomEvent(Nm.NILE_ERROR,{detail:{type:um.NETWORK_ERROR,file:o,status:M.status,response:M.response,errorType:Dm.NETWORK,message:gm.NETWORK_ERROR},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(Nm.NILE_NETWORK_ERROR,{detail:{file:o,status:M.status,response:M.response},bubbles:!0,composed:!0}))},M.open("POST",i),M.send(t)}}const Im=(e,t)=>{document.addEventListener(Nm.NILE_CANCEL_UPLOAD,(i=>{const n=i.detail.file,o=t.get(n);o&&o.abort(),t.delete(n),e.uploadedFiles=e.uploadedFiles.filter((e=>e!==n)),e.dispatchEvent(new CustomEvent(Nm.NILE_ERROR,{detail:{type:um.UPLOAD_CANCELLED,file:n,message:gm.UPLOAD_CANCELLED,errorType:Dm.UPLOAD_CANCELLED},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(Nm.NILE_UPLOAD_CANCELLED,{detail:{file:n}}))}))};const zm=e=>{e.preventDefault?.(),e.stopPropagation()},ym=(e,t)=>{document.addEventListener("nile-remove",(i=>{const{value:n}=i.detail;e=e.filter((e=>e!==n)),t.uploadedFiles=e,t.errorMessage="",t.requestUpdate()}))},pm=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};class Tm{constructor(){this.currentState=am.DEFAULT}setErrorMessage(e){this.errorMessageCallback=e}setIsDisabled(e){this.isDisabledCallback=e}setValuesInDragHandler(e){this.currentState=e}onFileDrop(e){this.fileDropCallback=e}onStateChange(e){this.stateChangeCallback=e}setState(e){this.currentState===am.DISABLED||this.isDisabledCallback?.()||(this.currentState=e,this.stateChangeCallback?.(e))}dragEnter(e){zm(e),this.currentState===am.DISABLED||this.isDisabledCallback?.()||this.setState(am.DRAG)}dragLeave(e){zm(e),this.currentState===am.DISABLED||this.isDisabledCallback?.()||this.setState(am.DEFAULT)}dragOver(e){zm(e),this.currentState!==am.DISABLED&&this.isDisabledCallback?.()}drop(e){zm(e),this.currentState===am.DISABLED||this.isDisabledCallback?.()||(this.setState(am.DEFAULT),this.handleFiles(e))}handleDocumentDrop(e){zm(e),this.currentState!==am.DISABLED&&this.setState(am.DEFAULT)}preventDragOver(e){zm(e)}preventDrop(e){zm(e)}handleFiles(e){if(zm(e),this.currentState===am.DISABLED||this.isDisabledCallback?.())return;let t=null;if("dataTransfer"in e&&e.dataTransfer&&(t=e.dataTransfer.files),!t&&e.target instanceof HTMLInputElement&&(t=e.target.files),t&&t.length>0){const e=Array.from(t);this.fileDropCallback?.(e)}e.target instanceof HTMLInputElement&&(e.target.value="")}}const Am=(e,t,i,n,o,M,r,s,a)=>(pm(a),_`
16031
+ `;var lm,gm,Nm,cm,um,Dm,dm;!function(e){e.DEFAULT="default",e.DISABLED="disabled",e.HOVER="hover",e.DRAG="drag",e.ERROR="error"}(lm||(lm={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(gm||(gm={})),function(e){e.INVALID_FORMAT="Invalid file format! Upload valid file.",e.SIZE_LIMIT_EXCEEDED="File exceeds size limit! Upload smaller file.",e.MULTIPLE_NOT_ALLOWED="Please Upload Single File!",e.DUPLICATES_NOT_ALLOWED="Duplicate Files Are Not Allowed!",e.UPLOAD_URL_REQUIRED="Upload URL is required!",e.SERVER_SIDE_ERROR="Error from server! Please try again later.",e.NETWORK_ERROR="Network error! Please try again later.",e.UPLOAD_CANCELLED="File upload cancelled."}(Nm||(Nm={})),function(e){e.NILE_INIT="nile-init",e.NILE_BROWSE="nile-browse",e.NILE_CHANGE="nile-change",e.NILE_UPLOADING="nile-uploading",e.NILE_UPLOAD_PROGRESS="nile-upload-progress",e.NILE_UPLOAD_SUCCESS="nile-upload-success",e.NILE_UPLOAD_CANCELLED="nile-upload-cancelled",e.NILE_SIZE_EXCEED_FILES="nile-size-exceed-files",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_NETWORK_ERROR="nile-network-error",e.SERVER_SIDE_ERROR="nile-server-error",e.NILE_DESTROY="nile-destroy",e.NILE_ERROR="nile-error"}(cm||(cm={})),function(e){e.TITLE="Drag and drop to upload",e.SUBTITLE="PNG, JPG or SVG (upto 1MB) | 1:1 ratio",e.ERROR_MESSAGE="Invalid File Format.",e.DRAG_STATE_DEFAULT="Drop files here to upload",e.CUSTOM_ERROR="Error Occured!"}(um||(um={})),function(e){e.INVALID_FORMAT="Invalid Format",e.SIZE_LIMIT_EXCEEDED="Size Limit Exceeded",e.SERVER_SIDE_ERROR="Server Side Error",e.NETWORK_ERROR="Network Error",e.UPLOAD_CANCELLED="Upload Cancelled"}(Dm||(Dm={})),function(e){e.SERVER="SERVER",e.NETWORK="NETWORK",e.UPLOAD_CANCELLED="UPLOAD_CANCELLED",e.VALIDATION="VALIDATION"}(dm||(dm={}));const hm=(e,t)=>{t.setIsDisabled((()=>e.state===lm.DISABLED)),t.onStateChange((t=>{e.state=t})),t.onFileDrop((t=>{if(e.state===lm.DISABLED)return;e.errorMessage="";const i=function(e){const t={B:1,KB:1024,MB:1048576,GB:1024**3},i=parseFloat(e),n=e.replace(/[0-9.\s]/g,"").toUpperCase(),o=t[n]||1;return i*o}(e.size),n=e.uploadedFiles;if(!e.allowMultiple&&n.length+t.length>1)return e.errorMessage=Nm.MULTIPLE_NOT_ALLOWED,void e.requestUpdate();let o=!1,M=!1;const r=[],s=[];for(const a of t)a.size>i?(o=!0,s.push(a)):e.allowDuplicates||!n.some((e=>e.name===a.name&&e.size===a.size&&e.type===a.type))?s.includes(a)||r.push(a):(M=!0,s.push(a));if(o){e.errorMessage=Nm.SIZE_LIMIT_EXCEEDED;const t=s.filter((e=>e.size>i));e.dispatchEvent(new CustomEvent(cm.NILE_ERROR,{detail:{files:t,type:Dm.SIZE_LIMIT_EXCEEDED,errorType:dm.VALIDATION,message:Nm.SIZE_LIMIT_EXCEEDED},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(cm.NILE_SIZE_EXCEED_FILES,{detail:{files:s}})),e.requestUpdate()}M&&0===r.length&&(e.errorMessage=Nm.DUPLICATES_NOT_ALLOWED,e.requestUpdate());let a=[];if(e.allowedTypes.length>0)for(const t of r)e.allowedTypes.includes(t.type)?a.push(t):e.errorMessage=Nm.INVALID_FORMAT;0===a.length&&(a=r),e.uploadedFiles=[...n,...a],e.requestUpdate()})),t.setErrorMessage((t=>{e.errorMessage=t}))},jm=(e,t,i)=>{e.addEventListener("mouseenter",(t=>{return i=e.setState,void(e.state===lm.DEFAULT&&i(lm.HOVER));var i})),e.addEventListener("mouseleave",(t=>{return i=e.setState,void(e.state===lm.HOVER&&i(lm.DEFAULT));var i})),e.addEventListener("dragenter",(e=>t.dragEnter(e))),e.addEventListener("dragleave",(e=>t.dragLeave(e))),e.addEventListener("dragover",(e=>t.dragOver(e))),e.addEventListener("drop",(e=>t.drop(e)));const n=e.browseFiles.bind(e);new ResizeObserver((t=>{for(const i of t)i.contentRect.width<400?e.horizontalDiv.addEventListener("click",n):e.horizontalDiv.removeEventListener("click",n)})).observe(e.horizontalDiv),zm(e,i),pm(e.uploadedFiles,e)};function Im(e){const{uploadedFiles:t,fileUploadUrl:i,uploadRequests:n}=e;if(i&&t?.length)for(const o of t){if(n.has(o))continue;if(e.doNotUpload.includes(o))continue;if(o.errorMessage)continue;const t=new FormData;t.append("file",o);const M=new XMLHttpRequest;n.set(o,M),e.emit(cm.NILE_UPLOADING),M.upload.onprogress=t=>{const i=Math.floor(t.loaded/t.total*100);e.dispatchEvent(new CustomEvent(cm.NILE_UPLOAD_PROGRESS,{detail:{file:o,progress:i},bubbles:!0,composed:!0}))},M.onload=()=>{M.status>=200&&M.status<300?e.dispatchEvent(new CustomEvent(cm.NILE_UPLOAD_SUCCESS,{detail:{file:o,response:M.response},bubbles:!0,composed:!0})):(e.errorMessage=Nm.SERVER_SIDE_ERROR,e.dispatchEvent(new CustomEvent(cm.SERVER_SIDE_ERROR,{detail:{file:o,status:M.status,response:M.response}})),e.dispatchEvent(new CustomEvent(cm.NILE_ERROR,{detail:{type:Dm.SERVER_SIDE_ERROR,file:o,status:M?.status||0,response:M?.response,message:Nm.SERVER_SIDE_ERROR,errorType:dm.SERVER},bubbles:!0,composed:!0})),e.requestUpdate())},M.onerror=()=>{n.delete(o),e.doNotUpload.push(o),e.errorMessage=Nm.NETWORK_ERROR,e.dispatchEvent(new CustomEvent(cm.NILE_ERROR,{detail:{type:Dm.NETWORK_ERROR,file:o,status:M.status,response:M.response,errorType:dm.NETWORK,message:Nm.NETWORK_ERROR},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(cm.NILE_NETWORK_ERROR,{detail:{file:o,status:M.status,response:M.response},bubbles:!0,composed:!0}))},M.open("POST",i),M.send(t)}}const zm=(e,t)=>{document.addEventListener(cm.NILE_CANCEL_UPLOAD,(i=>{const n=i.detail.file,o=t.get(n);o&&o.abort(),t.delete(n),e.uploadedFiles=e.uploadedFiles.filter((e=>e!==n)),e.dispatchEvent(new CustomEvent(cm.NILE_ERROR,{detail:{type:Dm.UPLOAD_CANCELLED,file:n,message:Nm.UPLOAD_CANCELLED,errorType:dm.UPLOAD_CANCELLED},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(cm.NILE_UPLOAD_CANCELLED,{detail:{file:n}}))}))};const ym=e=>{e.preventDefault?.(),e.stopPropagation()},pm=(e,t)=>{document.addEventListener("nile-remove",(i=>{const{value:n}=i.detail;e=e.filter((e=>e!==n)),t.uploadedFiles=e,t.errorMessage="",t.requestUpdate()}))},Tm=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};class Am{constructor(){this.currentState=lm.DEFAULT}setErrorMessage(e){this.errorMessageCallback=e}setIsDisabled(e){this.isDisabledCallback=e}setValuesInDragHandler(e){this.currentState=e}onFileDrop(e){this.fileDropCallback=e}onStateChange(e){this.stateChangeCallback=e}setState(e){this.currentState===lm.DISABLED||this.isDisabledCallback?.()||(this.currentState=e,this.stateChangeCallback?.(e))}dragEnter(e){ym(e),this.currentState===lm.DISABLED||this.isDisabledCallback?.()||this.setState(lm.DRAG)}dragLeave(e){ym(e),this.currentState===lm.DISABLED||this.isDisabledCallback?.()||this.setState(lm.DEFAULT)}dragOver(e){ym(e),this.currentState!==lm.DISABLED&&this.isDisabledCallback?.()}drop(e){ym(e),this.currentState===lm.DISABLED||this.isDisabledCallback?.()||(this.setState(lm.DEFAULT),this.handleFiles(e))}handleDocumentDrop(e){ym(e),this.currentState!==lm.DISABLED&&this.setState(lm.DEFAULT)}preventDragOver(e){ym(e)}preventDrop(e){ym(e)}handleFiles(e){if(ym(e),this.currentState===lm.DISABLED||this.isDisabledCallback?.())return;let t=null;if("dataTransfer"in e&&e.dataTransfer&&(t=e.dataTransfer.files),!t&&e.target instanceof HTMLInputElement&&(t=e.target.files),t&&t.length>0){const e=Array.from(t);this.fileDropCallback?.(e)}e.target instanceof HTMLInputElement&&(e.target.value="")}}const Om=(e,t,i,n,o,M,r,s,a)=>(Tm(a),_`
15883
16032
  <div class="wrapper" part="horizontal-wrapper">
15884
16033
  <div part="horizontal-div" class=${xe({"hover-border":"hover"===M,"horizontal-div":!0,disable:n})}>
15885
16034
  <div part="inner-div" class="inner-div">
@@ -15904,18 +16053,18 @@ nile-badge::part(content) {
15904
16053
  </nile-button>
15905
16054
  </slot>
15906
16055
  </div>
15907
- ${r||a.state===am.ERROR?_`
16056
+ ${r||a.state===lm.ERROR?_`
15908
16057
  <slot name="error-message">
15909
16058
  <div class="upload-error" part="horizontal-upload-error">
15910
16059
  <nile-icon name="warning" size="12" color="var(--nile-colors-red-700)"></nile-icon>
15911
- ${a.isStringTruncated?_`<nile-lite-tooltip .content=${r||cm.CUSTOM_ERROR}>
15912
- <span>${r||cm.CUSTOM_ERROR}</span>
15913
- </nile-lite-tooltip>`:_`<span>${r||cm.CUSTOM_ERROR}</span>`}
16060
+ ${a.isStringTruncated?_`<nile-lite-tooltip .content=${r||um.CUSTOM_ERROR}>
16061
+ <span>${r||um.CUSTOM_ERROR}</span>
16062
+ </nile-lite-tooltip>`:_`<span>${r||um.CUSTOM_ERROR}</span>`}
15914
16063
  </div>
15915
16064
  </slot>
15916
16065
  `:_``}
15917
16066
  </div>
15918
- `),Om=(e,t,i,n,o,M,r,s)=>Am(e,t,i,!1,n,o,M,r,s),xm=(e,t,i,n,o,M,r,s)=>(pm(s),_`
16067
+ `),xm=(e,t,i,n,o,M,r,s)=>Om(e,t,i,!1,n,o,M,r,s),Lm=(e,t,i,n,o,M,r,s)=>(Tm(s),_`
15919
16068
  <div part="vertical-wrapper" class="wrapper">
15920
16069
  <div part="vertical-default" class="vertical-default vertical-div ${n?"disable":""}">
15921
16070
  <slot name="upload-icon">
@@ -15938,16 +16087,16 @@ nile-badge::part(content) {
15938
16087
  </nile-button>
15939
16088
  </slot>
15940
16089
  </div>
15941
- ${M||s.state===am.ERROR?_`<div class="vertical-upload-error" part="vertical-upload-error">
16090
+ ${M||s.state===lm.ERROR?_`<div class="vertical-upload-error" part="vertical-upload-error">
15942
16091
  <nile-icon name="warning" size="12" color="var(--nile-colors-red-700)"></nile-icon>
15943
- ${s.isStringTruncated?_`<nile-lite-tooltip .content=${M||cm.CUSTOM_ERROR}>
15944
- <span>${M||cm.CUSTOM_ERROR}</span>
15945
- </nile-lite-tooltip>`:_`<span>${M||cm.CUSTOM_ERROR}</span>`}
16092
+ ${s.isStringTruncated?_`<nile-lite-tooltip .content=${M||um.CUSTOM_ERROR}>
16093
+ <span>${M||um.CUSTOM_ERROR}</span>
16094
+ </nile-lite-tooltip>`:_`<span>${M||um.CUSTOM_ERROR}</span>`}
15946
16095
  </div>`:_``}
15947
16096
  </div>
15948
- `),Lm=(e,t,i,n,o,M,r)=>xm(e,t,i,!1,n,o,M,r);let mm=class extends Fe{constructor(){super(...arguments),this.size="10MB",this.error=!1,this.errorMessage="",this.allowMultiple=!1,this.allowDuplicates=!1,this.allowedTypes=[],this.uploadedFiles=[],this.title=cm.TITLE,this.subtitle=cm.SUBTITLE,this.state=am.DEFAULT,this.variant=lm.HORIZONTAL,this.fileUploadUrl="",this.autoUpload=!0,this.doNotUpload=[],this.uploadRequests=new Map,this.fileSizeExceededFilesNumber=0,this.isStringTruncated=!1,this.setState=e=>{this.state=e}}static get styles(){return[sm]}connectedCallback(){super.connectedCallback(),this.emit(Nm.NILE_INIT)}firstUpdated(e){var t;super.firstUpdated(e),this.dragHandler=new Tm,dm(this,this.dragHandler),hm(this,this.dragHandler,this.uploadRequests),t=this.dragHandler,document.addEventListener("dragover",t.preventDragOver,{passive:!1}),document.addEventListener("drop",t.preventDrop,{passive:!1})}updated(e){super.updated(e),e.has("uploadedFiles")?(this.fileUploadUrl&&this.autoUpload&&jm(this),this.emit(Nm.NILE_CHANGE,{files:this.uploadedFiles})):e.has("state")&&this.dragHandler.setValuesInDragHandler(this.state),e.has("autoUpload")&&this.autoUpload&&(this.fileUploadUrl&&this.autoUpload&&jm(this),this.emit(Nm.NILE_CHANGE,{files:this.uploadedFiles}))}browseFiles(){this.emit(Nm.NILE_BROWSE),this.errorMessage="",this.input.click()}render(){return _`
16097
+ `),mm=(e,t,i,n,o,M,r)=>Lm(e,t,i,!1,n,o,M,r);let Sm=class extends Fe{constructor(){super(...arguments),this.size="10MB",this.error=!1,this.errorMessage="",this.allowMultiple=!1,this.allowDuplicates=!1,this.allowedTypes=[],this.uploadedFiles=[],this.title=um.TITLE,this.subtitle=um.SUBTITLE,this.state=lm.DEFAULT,this.variant=gm.HORIZONTAL,this.fileUploadUrl="",this.autoUpload=!0,this.doNotUpload=[],this.uploadRequests=new Map,this.fileSizeExceededFilesNumber=0,this.isStringTruncated=!1,this.setState=e=>{this.state=e}}static get styles(){return[am]}connectedCallback(){super.connectedCallback(),this.emit(cm.NILE_INIT)}firstUpdated(e){var t;super.firstUpdated(e),this.dragHandler=new Am,hm(this,this.dragHandler),jm(this,this.dragHandler,this.uploadRequests),t=this.dragHandler,document.addEventListener("dragover",t.preventDragOver,{passive:!1}),document.addEventListener("drop",t.preventDrop,{passive:!1})}updated(e){super.updated(e),e.has("uploadedFiles")?(this.fileUploadUrl&&this.autoUpload&&Im(this),this.emit(cm.NILE_CHANGE,{files:this.uploadedFiles})):e.has("state")&&this.dragHandler.setValuesInDragHandler(this.state),e.has("autoUpload")&&this.autoUpload&&(this.fileUploadUrl&&this.autoUpload&&Im(this),this.emit(cm.NILE_CHANGE,{files:this.uploadedFiles}))}browseFiles(){this.emit(cm.NILE_BROWSE),this.errorMessage="",this.input.click()}render(){return _`
15949
16098
  ${this.getState()}
15950
- `}clearAllUploadedFiles(){this.uploadedFiles=[],this.state=am.DEFAULT,this.errorMessage=""}getState(){return this.variant===lm.HORIZONTAL?this.getHorizontalState():this.getVerticalState()}getHorizontalState(){switch(this.state){case am.DEFAULT:return Om(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this);case am.DISABLED:return e=this.browseFiles,t=this.title,i=this.subtitle,n=this.dragHandler,o=this.state,M=this.errorMessage,r=this.allowedTypes,Am(e,t,i,!0,n,o,M,r,this);case am.DRAG:return _`
16099
+ `}clearAllUploadedFiles(){this.uploadedFiles=[],this.state=lm.DEFAULT,this.errorMessage=""}getState(){return this.variant===gm.HORIZONTAL?this.getHorizontalState():this.getVerticalState()}getHorizontalState(){switch(this.state){case lm.DEFAULT:return xm(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this);case lm.DISABLED:return e=this.browseFiles,t=this.title,i=this.subtitle,n=this.dragHandler,o=this.state,M=this.errorMessage,r=this.allowedTypes,Om(e,t,i,!0,n,o,M,r,this);case lm.DRAG:return _`
15951
16100
  <div part="horizontal-drag-state" class="horizontal-div dragging">
15952
16101
  <div class="icons-container">
15953
16102
  <nile-icon
@@ -15963,9 +16112,9 @@ nile-badge::part(content) {
15963
16112
  class="image-icon"
15964
16113
  ></nile-icon>
15965
16114
  </div>
15966
- <p>${cm.DRAG_STATE_DEFAULT}</p>
16115
+ <p>${um.DRAG_STATE_DEFAULT}</p>
15967
16116
  </div>
15968
- `;case am.ERROR:return((e,t,i,n,o,M,r,s)=>Am(e,t,i,!1,n,o,M,r,s))(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this);default:return Om(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this)}var e,t,i,n,o,M,r}getVerticalState(){switch(this.state){case am.DEFAULT:return Lm(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this);case am.DISABLED:return e=this.browseFiles,t=this.title,i=this.subtitle,n=this.dragHandler,o=this.errorMessage,M=this.allowedTypes,xm(e,t,i,!0,n,o,M,this);case am.DRAG:return _`
16117
+ `;case lm.ERROR:return((e,t,i,n,o,M,r,s)=>Om(e,t,i,!1,n,o,M,r,s))(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this);default:return xm(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this)}var e,t,i,n,o,M,r}getVerticalState(){switch(this.state){case lm.DEFAULT:return mm(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this);case lm.DISABLED:return e=this.browseFiles,t=this.title,i=this.subtitle,n=this.dragHandler,o=this.errorMessage,M=this.allowedTypes,Lm(e,t,i,!0,n,o,M,this);case lm.DRAG:return _`
15969
16118
  <div part="vertical-drag-state" class="vertical-div vertical-drag">
15970
16119
  <div class="icons-container">
15971
16120
  <nile-icon
@@ -15981,9 +16130,9 @@ nile-badge::part(content) {
15981
16130
  class="image-icon"
15982
16131
  ></nile-icon>
15983
16132
  </div>
15984
- <p>${cm.DRAG_STATE_DEFAULT}</p>
16133
+ <p>${um.DRAG_STATE_DEFAULT}</p>
15985
16134
  </div>
15986
- `;case am.ERROR:return((e,t,i,n,o,M,r)=>xm(e,t,i,!1,n,o,M,r))(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this);default:return Lm(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this)}var e,t,i,n,o,M}disconnectedCallback(){this.emit(Nm.NILE_DESTROY)}};e([ue({type:String})],mm.prototype,"size",void 0),e([ue({type:Boolean})],mm.prototype,"error",void 0),e([ue({type:String})],mm.prototype,"errorMessage",void 0),e([ue({type:Boolean})],mm.prototype,"allowMultiple",void 0),e([ue({type:Boolean})],mm.prototype,"allowDuplicates",void 0),e([ue({type:Array})],mm.prototype,"allowedTypes",void 0),e([ue({type:Array})],mm.prototype,"uploadedFiles",void 0),e([ue({type:String})],mm.prototype,"title",void 0),e([ue({type:String})],mm.prototype,"subtitle",void 0),e([ue({type:String})],mm.prototype,"state",void 0),e([ue({type:String})],mm.prototype,"variant",void 0),e([ue({type:String})],mm.prototype,"fileUploadUrl",void 0),e([ue({type:Boolean})],mm.prototype,"autoUpload",void 0),e([De()],mm.prototype,"doNotUpload",void 0),e([he("input")],mm.prototype,"input",void 0),e([he(".horizontal-div")],mm.prototype,"horizontalDiv",void 0),mm=e([ge("nile-file-upload")],mm);const Sm=r`
16135
+ `;case lm.ERROR:return((e,t,i,n,o,M,r)=>Lm(e,t,i,!1,n,o,M,r))(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this);default:return mm(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this)}var e,t,i,n,o,M}disconnectedCallback(){this.emit(cm.NILE_DESTROY)}};e([ue({type:String})],Sm.prototype,"size",void 0),e([ue({type:Boolean})],Sm.prototype,"error",void 0),e([ue({type:String})],Sm.prototype,"errorMessage",void 0),e([ue({type:Boolean})],Sm.prototype,"allowMultiple",void 0),e([ue({type:Boolean})],Sm.prototype,"allowDuplicates",void 0),e([ue({type:Array})],Sm.prototype,"allowedTypes",void 0),e([ue({type:Array})],Sm.prototype,"uploadedFiles",void 0),e([ue({type:String})],Sm.prototype,"title",void 0),e([ue({type:String})],Sm.prototype,"subtitle",void 0),e([ue({type:String})],Sm.prototype,"state",void 0),e([ue({type:String})],Sm.prototype,"variant",void 0),e([ue({type:String})],Sm.prototype,"fileUploadUrl",void 0),e([ue({type:Boolean})],Sm.prototype,"autoUpload",void 0),e([De()],Sm.prototype,"doNotUpload",void 0),e([he("input")],Sm.prototype,"input",void 0),e([he(".horizontal-div")],Sm.prototype,"horizontalDiv",void 0),Sm=e([ge("nile-file-upload")],Sm);const wm=r`
15987
16136
  :host {
15988
16137
  display: inline-block;
15989
16138
  width: 100%;
@@ -16561,7 +16710,7 @@ nile-badge::part(content) {
16561
16710
  .preview-file-info p {
16562
16711
  width: 100%;
16563
16712
  }
16564
- `;var wm,Em,bm,km;!function(e){e.DEFAULT="default",e.UPLOADING="uploading",e.PREVIEW="preview",e.NO_PREVIEW="no-preview",e.ERROR="error"}(wm||(wm={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(Em||(Em={})),function(e){e.INVALID_FORMAT="Invalid File Format. Please try again.",e.SIZE_LIMIT="File exceeds size limit.",e.FAILED_TO_LOAD="Failed to load file from URL",e.UNKNOWN_FILE_NAME="unknown-file",e.UPLOAD_CANCEL="File upload cancelled.",e.NO_FILE_SELECTED="No file selected.",e.UNABLE_TO_GENEARTE_URL="Unable to generate the url.",e.NETWORK_ERROR="Network error! Please try again later.",e.CUSTOM_ERROR="Error Occured!"}(bm||(bm={})),function(e){e.NILE_INIT="nile-init",e.NILE_RECEIVE="nile-receive",e.NILE_REMOVE="nile-remove",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_DESTROY="nile-destroy"}(km||(km={}));const vm=(e,t,i)=>{t.target&&t.target.dispatchEvent(new CustomEvent(km.NILE_REMOVE,{detail:{value:e,url:i},bubbles:!0,composed:!0}))},fm=(e,t,i)=>{t.target&&(t.target.dispatchEvent(new CustomEvent(km.NILE_CANCEL_UPLOAD,{detail:{file:e},bubbles:!0,composed:!0})),i.state=wm.ERROR,i.errorMessage=bm.UPLOAD_CANCEL,i.requestUpdate())},Qm=e=>{const t=e/1e3,i=e/1e6,n=e/1e9;return n>=1?n.toFixed(2)+" GB":i>=1?i.toFixed(2)+" MB":t>=1?t.toFixed(2)+" KB":e+" B"},Cm=(e,t)=>{if(t)return e.name.split(".").pop()||"";return((e.type||"").split("/")[1]||"").toUpperCase()},Um=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};function Ym(e,t,i){return _`
16713
+ `;var Em,bm,km,vm;!function(e){e.DEFAULT="default",e.UPLOADING="uploading",e.PREVIEW="preview",e.NO_PREVIEW="no-preview",e.ERROR="error"}(Em||(Em={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(bm||(bm={})),function(e){e.INVALID_FORMAT="Invalid File Format. Please try again.",e.SIZE_LIMIT="File exceeds size limit.",e.FAILED_TO_LOAD="Failed to load file from URL",e.UNKNOWN_FILE_NAME="unknown-file",e.UPLOAD_CANCEL="File upload cancelled.",e.NO_FILE_SELECTED="No file selected.",e.UNABLE_TO_GENEARTE_URL="Unable to generate the url.",e.NETWORK_ERROR="Network error! Please try again later.",e.CUSTOM_ERROR="Error Occured!"}(km||(km={})),function(e){e.NILE_INIT="nile-init",e.NILE_RECEIVE="nile-receive",e.NILE_REMOVE="nile-remove",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_DESTROY="nile-destroy"}(vm||(vm={}));const fm=(e,t,i)=>{t.target&&t.target.dispatchEvent(new CustomEvent(vm.NILE_REMOVE,{detail:{value:e,url:i},bubbles:!0,composed:!0}))},Qm=(e,t,i)=>{t.target&&(t.target.dispatchEvent(new CustomEvent(vm.NILE_CANCEL_UPLOAD,{detail:{file:e},bubbles:!0,composed:!0})),i.state=Em.ERROR,i.errorMessage=km.UPLOAD_CANCEL,i.requestUpdate())},Cm=e=>{const t=e/1e3,i=e/1e6,n=e/1e9;return n>=1?n.toFixed(2)+" GB":i>=1?i.toFixed(2)+" MB":t>=1?t.toFixed(2)+" KB":e+" B"},Um=(e,t)=>{if(t)return e.name.split(".").pop()||"";return((e.type||"").split("/")[1]||"").toUpperCase()},Ym=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};function Zm(e,t,i){return _`
16565
16714
  <div class="no-preview horizontal-div" part="horizontal-no-preview-state">
16566
16715
  <div class="no-preview-container" part="horizontal-no-preview-container">
16567
16716
  <div class="document-icon" part="horizontal-no-preview-document-icon">
@@ -16572,14 +16721,14 @@ nile-badge::part(content) {
16572
16721
  <slot name="file-name">${e.name}</slot>
16573
16722
  </p>
16574
16723
  <p part="horizontal-no-preview-file-info-type">
16575
- <slot name="file-type">${Cm(e,i)}</slot>
16724
+ <slot name="file-type">${Um(e,i)}</slot>
16576
16725
  &#8226;
16577
- <slot name="file-size">${Qm(Number(e.size))}</slot>
16726
+ <slot name="file-size">${Cm(Number(e.size))}</slot>
16578
16727
  </p>
16579
16728
  </div>
16580
16729
  </div>
16581
16730
  <div>
16582
- <slot @click=${i=>vm(e,i,t)} name="cancelIcon">
16731
+ <slot @click=${i=>fm(e,i,t)} name="cancelIcon">
16583
16732
  <nile-icon
16584
16733
  name="trash"
16585
16734
  size="14"
@@ -16589,7 +16738,7 @@ nile-badge::part(content) {
16589
16738
  </slot>
16590
16739
  </div>
16591
16740
  </div>
16592
- `}function Zm(e,t,i,n){return Um(n),_`
16741
+ `}function Vm(e,t,i,n){return Ym(n),_`
16593
16742
  <div class="error horizontal-div" part="horizontal-error-state">
16594
16743
  <div class="error-container" part="horizontal-error-container">
16595
16744
  <div class="error-icon" part="horizontal-error-icon">
@@ -16606,7 +16755,7 @@ nile-badge::part(content) {
16606
16755
  </nile-lite-tooltip>`:_`<span>${t}</span>`}
16607
16756
  </div>
16608
16757
  </div>
16609
- <slot @click=${t=>vm(e,t,i)} name="cancelIcon">
16758
+ <slot @click=${t=>fm(e,t,i)} name="cancelIcon">
16610
16759
  <nile-icon
16611
16760
  name="close"
16612
16761
  size="14"
@@ -16615,7 +16764,7 @@ nile-badge::part(content) {
16615
16764
  ></nile-icon>
16616
16765
  </slot>
16617
16766
  </div>
16618
- `}function Vm(e,t,i){return _`
16767
+ `}function Pm(e,t,i){return _`
16619
16768
  <div class="vertical-div vertical-no-preview" part="vertical-no-preview-state">
16620
16769
  <div class="vertical-document-icon" part="vertical-no-preview-document-icon">
16621
16770
  <nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
@@ -16626,13 +16775,13 @@ nile-badge::part(content) {
16626
16775
  <slot name="file-name">${e.name}</slot>
16627
16776
  </p>
16628
16777
  <p part="vertical-no-preview-file-info-type">
16629
- <slot name="file-type">${Cm(e,i)}</slot>
16778
+ <slot name="file-type">${Um(e,i)}</slot>
16630
16779
  &#8226;
16631
- <slot name="file-size">${Qm(Number(e.size))}</slot>
16780
+ <slot name="file-size">${Cm(Number(e.size))}</slot>
16632
16781
  </p>
16633
16782
  </div>
16634
16783
 
16635
- <slot @click=${i=>vm(e,i,t)} name="cancelIcon">
16784
+ <slot @click=${i=>fm(e,i,t)} name="cancelIcon">
16636
16785
  <nile-icon
16637
16786
  name="trash"
16638
16787
  size="14"
@@ -16641,7 +16790,7 @@ nile-badge::part(content) {
16641
16790
  ></nile-icon>
16642
16791
  </slot>
16643
16792
  </div>
16644
- `}function Pm(e,t,i,n){return Um(n),_`
16793
+ `}function Wm(e,t,i,n){return Ym(n),_`
16645
16794
  <div class="vertical-div vertical-error" part="vertical-error-state">
16646
16795
  <div class="vertical-document-icon error-bg" part="vertical-error-document-icon">
16647
16796
  <nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
@@ -16656,7 +16805,7 @@ nile-badge::part(content) {
16656
16805
  </nile-lite-tooltip>`:_`<span>${t}</span>`}
16657
16806
  </div>
16658
16807
 
16659
- <slot @click=${t=>vm(e,t,i)} name="cancelIcon">
16808
+ <slot @click=${t=>fm(e,t,i)} name="cancelIcon">
16660
16809
  <nile-icon
16661
16810
  name="close"
16662
16811
  size="14"
@@ -16665,7 +16814,7 @@ nile-badge::part(content) {
16665
16814
  ></nile-icon>
16666
16815
  </slot>
16667
16816
  </div>
16668
- `}let Wm=class extends Fe{constructor(){super(...arguments),this.errorMessage="",this.fileUrl="",this.uploadStatus=0,this.state=wm.DEFAULT,this.variant=Em.HORIZONTAL,this.inputFileName="",this.showFileType=!1,this.inputFileHtml=null,this.originalUrl="",this.isStringTruncated=!1}static get styles(){return[Sm]}connectedCallback(){super.connectedCallback(),this.emit(km.NILE_INIT)}firstUpdated(e){super.firstUpdated(e)}updated(e){e.has("uploadStatus")&&this.uploadStatus?this.uploadStatus<100?this.createUploadState(this.inputFile,this.uploadStatus):this.createState(this.inputFile):e.has("inputFile")&&this.inputFile?(this.createState(this.inputFile),this.emit(km.NILE_RECEIVE)):e.has("fileUrl")&&this.fileUrl?(this.handleFileUrl(this.fileUrl),this.emit(km.NILE_RECEIVE)):e.has("errorMessage")&&this.createState(this.inputFile)}createUploadState(e,t){const i=this.variant===Em.HORIZONTAL;this.inputFileHtml=i?function(e,t,i){return _`
16817
+ `}let _m=class extends Fe{constructor(){super(...arguments),this.errorMessage="",this.fileUrl="",this.uploadStatus=0,this.state=Em.DEFAULT,this.variant=bm.HORIZONTAL,this.inputFileName="",this.showFileType=!1,this.inputFileHtml=null,this.originalUrl="",this.isStringTruncated=!1}static get styles(){return[wm]}connectedCallback(){super.connectedCallback(),this.emit(vm.NILE_INIT)}firstUpdated(e){super.firstUpdated(e)}updated(e){e.has("uploadStatus")&&this.uploadStatus?this.uploadStatus<100?this.createUploadState(this.inputFile,this.uploadStatus):this.createState(this.inputFile):e.has("inputFile")&&this.inputFile?(this.createState(this.inputFile),this.emit(vm.NILE_RECEIVE)):e.has("fileUrl")&&this.fileUrl?(this.handleFileUrl(this.fileUrl),this.emit(vm.NILE_RECEIVE)):e.has("errorMessage")&&this.createState(this.inputFile)}createUploadState(e,t){const i=this.variant===bm.HORIZONTAL;this.inputFileHtml=i?function(e,t,i){return _`
16669
16818
  <div class="uploading" part="horizontal-uploading-state">
16670
16819
  <nile-loader width="24" height="24"></nile-loader>
16671
16820
  <div class="progress-bar-container" part="horizontal-progress-bar-container">
@@ -16679,7 +16828,7 @@ nile-badge::part(content) {
16679
16828
  ></nile-progress-bar>
16680
16829
  <p class="horizontal-file-name" part="horizontal-file-name">${e.name}</p>
16681
16830
  </div>
16682
- <slot @click=${t=>fm(e,t,i)} name="cancelIcon">
16831
+ <slot @click=${t=>Qm(e,t,i)} name="cancelIcon">
16683
16832
  <nile-icon
16684
16833
  name="close"
16685
16834
  size="14"
@@ -16702,7 +16851,7 @@ nile-badge::part(content) {
16702
16851
  <p class="vertical-file-name" part="vertical-file-name">${e.name}</p>
16703
16852
  </div>
16704
16853
 
16705
- <slot @click=${t=>fm(e,t,i)} name="cancelIcon">
16854
+ <slot @click=${t=>Qm(e,t,i)} name="cancelIcon">
16706
16855
  <nile-icon
16707
16856
  name="close"
16708
16857
  size="14"
@@ -16711,7 +16860,7 @@ nile-badge::part(content) {
16711
16860
  ></nile-icon>
16712
16861
  </slot>
16713
16862
  </div>
16714
- `}(e,t,this),this.requestUpdate()}async handleFileUrl(e){this.originalUrl=e;try{const t=await fetch(e),i=await t.blob(),n=this.inputFileName||e.split("/").pop()||bm.UNKNOWN_FILE_NAME,o=new File([i],n,{type:i.type});this.createState(o)}catch(e){const t=new File([],this.inputFileName||bm.UNKNOWN_FILE_NAME,{type:"application/octet-stream"});this.errorMessage=bm.FAILED_TO_LOAD,console.error(this.errorMessage),this.inputFileHtml=this.variant===Em.HORIZONTAL?Zm(t,this.errorMessage,this.originalUrl,this):Pm(t,this.errorMessage,this.originalUrl,this),this.requestUpdate()}}async createState(e){const t=this.variant===Em.HORIZONTAL;if(this.errorMessage)this.inputFileHtml=t?Zm(e,this.errorMessage,this.originalUrl,this):Pm(e,this.errorMessage,this.originalUrl,this);else{let i=!1;try{i=e&&await(e=>new Promise((t=>{const i=new Blob([e],{type:e.type}),n=URL.createObjectURL(i),o=new Image;o.onload=()=>{URL.revokeObjectURL(n),t(!0)},o.onerror=()=>{URL.revokeObjectURL(n),t(!1)},o.src=n})))(e)}catch(e){i=!1}if(i)try{const i=await(e=>new Promise(((t,i)=>{const n=new FileReader;e?n.readAsDataURL(e):i(bm.NO_FILE_SELECTED),n.onload=()=>{const e=n.result;t(e)},n.onerror=e=>{i(bm.UNABLE_TO_GENEARTE_URL)}})))(e);this.inputFileHtml=t?function(e,t,i,n){return _`
16863
+ `}(e,t,this),this.requestUpdate()}async handleFileUrl(e){this.originalUrl=e;try{const t=await fetch(e),i=await t.blob(),n=this.inputFileName||e.split("/").pop()||km.UNKNOWN_FILE_NAME,o=new File([i],n,{type:i.type});this.createState(o)}catch(e){const t=new File([],this.inputFileName||km.UNKNOWN_FILE_NAME,{type:"application/octet-stream"});this.errorMessage=km.FAILED_TO_LOAD,console.error(this.errorMessage),this.inputFileHtml=this.variant===bm.HORIZONTAL?Vm(t,this.errorMessage,this.originalUrl,this):Wm(t,this.errorMessage,this.originalUrl,this),this.requestUpdate()}}async createState(e){const t=this.variant===bm.HORIZONTAL;if(this.errorMessage)this.inputFileHtml=t?Vm(e,this.errorMessage,this.originalUrl,this):Wm(e,this.errorMessage,this.originalUrl,this);else{let i=!1;try{i=e&&await(e=>new Promise((t=>{const i=new Blob([e],{type:e.type}),n=URL.createObjectURL(i),o=new Image;o.onload=()=>{URL.revokeObjectURL(n),t(!0)},o.onerror=()=>{URL.revokeObjectURL(n),t(!1)},o.src=n})))(e)}catch(e){i=!1}if(i)try{const i=await(e=>new Promise(((t,i)=>{const n=new FileReader;e?n.readAsDataURL(e):i(km.NO_FILE_SELECTED),n.onload=()=>{const e=n.result;t(e)},n.onerror=e=>{i(km.UNABLE_TO_GENEARTE_URL)}})))(e);this.inputFileHtml=t?function(e,t,i,n){return _`
16715
16864
  <div class="preview horizontal-div" part="horizontal-preview-state">
16716
16865
  <div class="preview-inner" part="horizontal-preview-inner">
16717
16866
  <div class="preview-image-container" part="horizontal-preview-image-container">
@@ -16727,14 +16876,14 @@ nile-badge::part(content) {
16727
16876
  <slot name="file-name">${t.name}</slot>
16728
16877
  </p>
16729
16878
  <p part="horizontal-preview-file-info-type">
16730
- <slot name="file-type">${Cm(t,n)}</slot>
16879
+ <slot name="file-type">${Um(t,n)}</slot>
16731
16880
  &#8226;
16732
- <slot name="file-size">${Qm(Number(t.size))}</slot>
16881
+ <slot name="file-size">${Cm(Number(t.size))}</slot>
16733
16882
  </p>
16734
16883
  </div>
16735
16884
  </div>
16736
16885
  <div class="preview-actions" part="horizontal-preview-actions">
16737
- <slot @click=${e=>vm(t,e,i)} name="cancel-icon">
16886
+ <slot @click=${e=>fm(t,e,i)} name="cancel-icon">
16738
16887
  <nile-icon
16739
16888
  name="trash"
16740
16889
  size="14"
@@ -16760,13 +16909,13 @@ nile-badge::part(content) {
16760
16909
  <slot name="file-name">${t.name}</slot>
16761
16910
  </p>
16762
16911
  <p part="vertical-preview-file-info-type">
16763
- <slot name="file-type">${Cm(t,n)}</slot>
16912
+ <slot name="file-type">${Um(t,n)}</slot>
16764
16913
  &#8226;
16765
- <slot name="file-size">${Qm(Number(t.size))}</slot>
16914
+ <slot name="file-size">${Cm(Number(t.size))}</slot>
16766
16915
  </p>
16767
16916
  </div>
16768
16917
 
16769
- <slot @click=${e=>vm(t,e,i)} name="cancelIcon">
16918
+ <slot @click=${e=>fm(t,e,i)} name="cancelIcon">
16770
16919
  <nile-icon
16771
16920
  name="trash"
16772
16921
  size="14"
@@ -16775,7 +16924,7 @@ nile-badge::part(content) {
16775
16924
  ></nile-icon>
16776
16925
  </slot>
16777
16926
  </div>
16778
- `}(i,e,this.originalUrl,this.showFileType)}catch(i){this.inputFileHtml=t?Ym(e,this.originalUrl,this.showFileType):Vm(e,this.originalUrl,this.showFileType)}else this.inputFileHtml=t?Ym(e,this.originalUrl,this.showFileType):Vm(e,this.originalUrl,this.showFileType)}this.requestUpdate()}render(){return _`${this.inputFileHtml??_``}`}disconnectedCallback(){super.disconnectedCallback(),this.emit(km.NILE_DESTROY)}};e([ue({type:String})],Wm.prototype,"errorMessage",void 0),e([ue({type:Object})],Wm.prototype,"inputFile",void 0),e([ue({type:String})],Wm.prototype,"fileUrl",void 0),e([ue({type:Number})],Wm.prototype,"uploadStatus",void 0),e([ue({type:String})],Wm.prototype,"state",void 0),e([ue({type:String})],Wm.prototype,"variant",void 0),e([ue({type:String})],Wm.prototype,"inputFileName",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],Wm.prototype,"showFileType",void 0),Wm=e([ge("nile-file-preview")],Wm);const _m=r`
16927
+ `}(i,e,this.originalUrl,this.showFileType)}catch(i){this.inputFileHtml=t?Zm(e,this.originalUrl,this.showFileType):Pm(e,this.originalUrl,this.showFileType)}else this.inputFileHtml=t?Zm(e,this.originalUrl,this.showFileType):Pm(e,this.originalUrl,this.showFileType)}this.requestUpdate()}render(){return _`${this.inputFileHtml??_``}`}disconnectedCallback(){super.disconnectedCallback(),this.emit(vm.NILE_DESTROY)}};e([ue({type:String})],_m.prototype,"errorMessage",void 0),e([ue({type:Object})],_m.prototype,"inputFile",void 0),e([ue({type:String})],_m.prototype,"fileUrl",void 0),e([ue({type:Number})],_m.prototype,"uploadStatus",void 0),e([ue({type:String})],_m.prototype,"state",void 0),e([ue({type:String})],_m.prototype,"variant",void 0),e([ue({type:String})],_m.prototype,"inputFileName",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],_m.prototype,"showFileType",void 0),_m=e([ge("nile-file-preview")],_m);const Rm=r`
16779
16928
  .option-group-header {
16780
16929
  height: 40px;
16781
16930
  display: flex;
@@ -16834,7 +16983,7 @@ nile-badge::part(content) {
16834
16983
  top: 46px;
16835
16984
  }
16836
16985
 
16837
- `;let Rm=class extends Fe{constructor(){super(...arguments),this.name="",this.data=null,this.sticky=!1}static get styles(){return[_m]}checkForImageOrIcon(){return this.data?.prefix?.icon?.name||this.data?.prefix?.image?.src||this.data?.prefix?.prefixText}normalizeImageDimension(e){if(null==e||""===e)return"20";const t=Number(e);return isNaN(t)||t<=0?"20":t>40?"25":t.toString()}render(){return _`
16986
+ `;let Bm=class extends Fe{constructor(){super(...arguments),this.name="",this.data=null,this.sticky=!1}static get styles(){return[Rm]}checkForImageOrIcon(){return this.data?.prefix?.icon?.name||this.data?.prefix?.image?.src||this.data?.prefix?.prefixText}normalizeImageDimension(e){if(null==e||""===e)return"20";const t=Number(e);return isNaN(t)||t<=0?"20":t>40?"25":t.toString()}render(){return _`
16838
16987
  <div part="option-group-header" class="option-group-header">
16839
16988
  <div part="content-container" class="content-container ${this.checkForImageOrIcon()?"gap-18px":""}">
16840
16989
  <!-- prefix content -->
@@ -16847,7 +16996,7 @@ nile-badge::part(content) {
16847
16996
  <!-- suffix content -->
16848
16997
  ${this.data?.suffix?.icon?.name?_`<nile-icon part="suffix-icon" name="${this.data?.suffix?.icon?.name}" size="${this.data?.suffix?.icon?.size||"16"}" color="${this.data?.suffix?.icon?.color||"var(--nile-colors-dark-500)"}" method="${this.data?.suffix?.icon?.method||"fill"}"></nile-icon>`:this.data?.suffix?.suffixText?_`<span part="suffix-text">${this.data?.suffix?.suffixText}</span>`:this.data?.suffix?.image?.src?_`<img part="suffix-image" src="${this.data?.prefix?.image?.src}" width="${this.normalizeImageDimension(this.data?.suffix?.image?.width)}" height="${this.normalizeImageDimension(this.data?.suffix?.image?.height)}">`:_`<slot part="suffix" name="suffix" class="option-group-suffix"></slot>`}
16849
16998
  </div>
16850
- `}};e([ue({type:String,reflect:!0,attribute:!0})],Rm.prototype,"name",void 0),e([ue({type:Object,reflect:!0,attribute:!0})],Rm.prototype,"data",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],Rm.prototype,"sticky",void 0),Rm=e([ge("nile-option-group")],Rm);const Bm=r`
16999
+ `}};e([ue({type:String,reflect:!0,attribute:!0})],Bm.prototype,"name",void 0),e([ue({type:Object,reflect:!0,attribute:!0})],Bm.prototype,"data",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],Bm.prototype,"sticky",void 0),Bm=e([ge("nile-option-group")],Bm);const Gm=r`
16851
17000
  :host {
16852
17001
  --min-width: 180px;
16853
17002
  display: grid;
@@ -16881,7 +17030,7 @@ nile-badge::part(content) {
16881
17030
  display: none;
16882
17031
  bottom: 0;
16883
17032
  }
16884
- `;function Gm(e,t,i,n,o,M){const r=e.minColumnWidth,s=function(e){return Math.max(0,(e.getBoundingClientRect().width||0)-4)}(e),a=function(e,t,i,n,o,M,r){const s=Array(t).fill(null);if(M){const n=eS(e);n&&function(e,t,i,n,o){const M=[...e.children].filter((e=>"nile-grid-row"===e.tagName.toLowerCase()));for(const e of M)Fm(e,t,i,n,o)}(n,s,t,i,o)}r?.length&&r.some((e=>e>0))&&r?.length===t&&function(e,t,i){for(let n=0;n<t.length;n++)null==e[n]&&Number.isFinite(t[n])&&(e[n]=Math.max(i.minColumnWidth,Math.round(t[n])))}(s,r,n);return s}(n,t,s,e,o,M,i),l=function(e,t,i){const n=Array(e.length).fill(!1);for(let o=0;o<e.length;o++){const M=e[o]??null;t[o]=null==M||Number.isNaN(M)?0:Math.max(i,Number(M)),n[o]=null!=M&&!Number.isNaN(M)}return n}(a,i,r);!function(e,t,i,n){const o=e.reduce(((e,t)=>e+t),0),M=i-o,r=Array.from({length:e.length},((e,t)=>t)).filter((e=>!t[e]));if(0===r.length)return;const s=M/r.length;for(const t of r)e[t]=Math.max(n,s)}(i,l,s,r),e.enableScroll||function(e,t,i){let n=(o=e,o.reduce(((e,t)=>e+t),0));var o;n<t?function(e,t,i){if(!e.length)return;const n=t-i,o=i||1;for(let t=0;t<e.length;t++)e[t]+=n*(e[t]/o)}(e,t,n):n>t&&function(e,t,i,n){let o=i-t;for(let t=0;t<8&&o>.5;t++){const{candidates:t,weightSum:i}=Hm(e,n);if(!t.length||i<=0)break;const M=$m(e,t,i,o,n);if(o-=M,M<.5)break}}(e,t,n,i)}(i,s,r),function(e,t){for(let i=0;i<e.length;i++)e[i]=Math.max(t,Math.round(e[i]))}(i,r),lS(e,i)}function Fm(e,t,i,n,o){const M=[...e.children].filter((e=>"nile-grid-head-item"===e.tagName.toLowerCase())).map((e=>function(e,t,i){const n=Number(e.dataset?.cStart)||1,o=Math.max(1,Number(e.getAttribute("colspan"))||1),M=e.width??e.getAttribute("width")??null;e.hasAttribute("lockWidth")&&(i[n-1]=!0);const r=function(e,t){if(null==e)return null;if("number"==typeof e&&Number.isFinite(e))return e;const i=String(e).trim().toLowerCase();if(!i)return null;if(i.endsWith("px")){const e=parseFloat(i);return Number.isFinite(e)?e:null}if(i.endsWith("%")){const e=parseFloat(i);return Number.isFinite(e)?e/100*t:null}const n=parseFloat(i);return Number.isFinite(n)?n:null}(M,t);return{cStart:n,colspan:o,cw:r}}(e,n,o))).filter((e=>null!=e.cw));M.sort(((e,t)=>e.colspan-t.colspan)),M.forEach((({cStart:e,colspan:n,cw:o})=>{!function(e,t,i,n,o){const M=Math.round(n/i);for(let n=0;n<i;n++){const i=t-1+n;i>=0&&i<o&&null==e[i]&&(e[i]=M)}}(t,e,n,o,i)}))}function Hm(e,t){const i=[];let n=0;for(let o=0;o<e.length;o++){Math.max(0,e[o]-t)>0&&(i.push(o),n+=e[o])}return{candidates:i,weightSum:n}}function $m(e,t,i,n,o){let M=0;for(const r of t){const t=Math.max(0,e[r]-o),s=e[r]/i,a=Math.min(t,n*s);e[r]-=a,M+=a}return M}const Jm=(e,t,i,n,o,M)=>{t.style.display="block",i.style.display="block",t.style.height=o+"px",i.style.height=o+"px";const r=e,s=e=>Math.max(0,Math.round(e||0)),a=s(M.reduce(((e,t)=>e+(t||0)),0)),l=(g=n,s(M.slice(0,Math.max(0,g)).reduce(((e,t)=>e+(t||0)),0)));var g;let N=l+s(Math.max(r,M[n]??r));const c=l+r,u=a;N=Math.min(Math.max(N,c),u),N=Math.max(N,20),t.style.left=N-6+"px",i.style.left=N-2+"px"};function Xm({grid:e,col:t,prevW:i,newW:n,floor:o}){if(e.lockedWidthColumns?.[t])return;let M=n-i;if(M>0){const n=function(e,t,i,n){let o=0;for(let M=t;M<e.length;M++)n?.[M]||(o+=Math.max(0,e[M]-i));return o}(e.columnWidths,t+1,o,e.lockedWidthColumns);if(n<=0)return;M=Math.min(M,n),e.columnWidths[t]=i+M,function(e,t,i,n,o){let M=i;for(let i=t;i<e.length&&M>0;i++){if(o?.[i])continue;const t=e[i]-n;if(t<=0)continue;const r=Math.min(t,M);e[i]-=r,M-=r}}(e.columnWidths,t+1,M,o,e.lockedWidthColumns)}else{const M=Math.max(o,n),r=i-M;e.columnWidths[t]=M,function(e,t,i){let n=i;t<e.length&&n>0&&(e[t]+=n,n=0)}(e.columnWidths,t+1,r)}}function qm(e,t){Jm(e.minColumnWidth,e.resizeStart,e.resizeEnd,t,e.scrollHeight,e.columnWidths)}const Km=(e,t,i,n)=>{e.addEventListener("nile-column-resize",t),e.addEventListener("nile-resize-start",(t=>{t.stopPropagation(),e.resizeBaseColumnWidths=[...e.columnWidths],e.resizeStart.style.display="block"})),e.addEventListener("nile-resize-end",(t=>{var i,n;t.stopPropagation(),i=e,n=t.detail.col,Jm(i.minColumnWidth,i.resizeStart,i.resizeEnd,n,i.scrollHeight,i.columnWidths),lS(i,i.columnWidths),e.resizeBaseColumnWidths=[],e.resizeStart.style.display="none",e.resizeEnd.style.display="none"})),i.addEventListener("slotchange",(()=>n())),e.addEventListener("scroll",(()=>iS(e)))},eS=e=>(e?.assignedElements()??[]).find((e=>"nile-grid-head"===e.tagName.toLowerCase()))||null,tS=e=>(e?.assignedElements()??[]).find((e=>"nile-grid-body"===e.tagName.toLowerCase()))||null,iS=e=>{const t=Math.max(1,e.scrollHeight-e.clientHeight),i=Math.max(1,e.scrollWidth-e.clientWidth),n=Math.round(e.scrollTop/t*100),o=Math.round(e.scrollLeft/i*100);e.emit("nile-scroll",{bubbles:!0,composed:!0,detail:{horizontalScroll:o,verticalScroll:n,left:e.scrollLeft,top:e.scrollTop}})};const nS="NILE-GRID-HEAD-ITEM",oS=(e,t,i,n,o)=>{const M=eS(t),r=tS(t);if(!M&&!r)return;let s=e.colCount||0,a=!1;if(e.needsStructureLayout)a=!0,e.headRows=M?Array.from(M.querySelectorAll("nile-grid-row")):[],s=0,e.headRows.length&&(s=function(e,t,i,n,o,M){return MS(e,t,i,n,o,M,{itemSelector:"nile-grid-head-item",useStickyAttr:!0,handleRowBg:!1})}(e,e.headRows,[],s,n,o)),r&&(e.bodyRows=Array.from(r.querySelectorAll("nile-grid-row")),s?aS(e,e.bodyRows,[],s,n,o):s=aS(e,e.bodyRows,[],s,n,o)),e.stickyLeftIndexes.length||e.stickyRightIndexes.length?function(e){const{head:t,body:i}=function(e){if(!e.shadowRoot)return{head:void 0,body:void 0};const t=e.slotEl.assignedElements(),i=e=>t.find((t=>t.tagName.toLowerCase()===e));return{head:i("nile-grid-head"),body:i("nile-grid-body")}}(e);e.stickyLeftHeadEls=t?Array.from(t.querySelectorAll('nile-grid-head-item[data-sticky="left"]')):[],e.stickyRightHeadEls=t?Array.from(t.querySelectorAll('nile-grid-head-item[data-sticky="right"]')):[],e.stickyLeftBodyEls=i?Array.from(i.querySelectorAll('nile-grid-cell-item[data-sticky="left"]')):[],e.stickyRightBodyEls=i?Array.from(i.querySelectorAll('nile-grid-cell-item[data-sticky="right"]')):[]}(e):(e.stickyLeftHeadEls=[],e.stickyRightHeadEls=[],e.stickyLeftBodyEls=[],e.stickyRightBodyEls=[],e.shadowLeftVisibleSticky=!1,e.shadowRightVisibleSticky=!1),e.colCount=s,e.needsStructureLayout=!1,e.needsSpanLayout=!1,e.needsWidthLayout=!0;else if(e.needsSpanLayout&&r){const t=e.bodyRows;s=e.colCount||0,s&&aS(e,t,[],s,n,o),e.needsSpanLayout=!1}if(e.needsWidthLayout){if(s=e.colCount||s,!s)return;i(s),Gm(e,s,e.columnWidths,t,e.lockedWidthColumns,a),function(e){const t=e.columnWidths,i=e.stickyLeftIndexes,n=e.stickyRightIndexes,o=[],M=e;let r=0;for(let e=0;e<i.length;e++){const n=i[e];o.push({colNumber:n,left:r,right:0}),M.style.setProperty(`--sticky-left-${n}`,`${r}px`),r+=t[n]}let s=0;for(let e=n.length-1;e>=0;e--){const i=n[e];o.push({colNumber:i,left:0,right:s}),M.style.setProperty(`--sticky-right-${i}`,`${s}px`),s+=t[i]}e.prefixSumColumnsWidth=o}(e),lS(e,e.columnWidths),e.needsWidthLayout=!1,e.isGridReady||(e.isGridReady=!0,e.emit("nile-grid-ready"))}};function MS(e,t,i,n,o,M,r){return t.forEach(((t,s)=>{e.hoverable&&t.setAttribute("hover","true"),n=function(e,t,i,n,o,M,r,s){let a=1;const l=i+1,g=s.itemSelector.toLowerCase(),N=Array.from(t.children).filter((e=>e.tagName.toLowerCase()===g));for(const t of N){for(;(n[a-1]||0)>0;)a++;({c:a,colCount:o}=rS(e,t,a,l,n,o,M,r,s))}return function(e){for(let t=0;t<e.length;t++)e[t]>0&&e[t]--}(n),o}(e,t,s,i,n,o,M,r)})),n}function rS(e,t,i,n,o,M,r,s,a){const l=Math.max(1,+t.getAttribute("colspan")||1),g=Math.max(1,+t.getAttribute("rowspan")||1);!function(e,t,i){if(i<=1)return;t.style.position="absolute",t.style.zIndex="1",t.tagName===nS?(e.headHeight||(e.headHeight=t.getBoundingClientRect().height),t.style.height=e.headHeight*i+(i-1)+"px",t.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))",t.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))"):(e.cellHeight||(e.cellHeight=t.getBoundingClientRect().height),t.style.height=e.cellHeight*i+(i-1)+"px",t.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))",t.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))")}(e,t,g);const N=i,c=i+l;!function(e,t,i,n,o){const M=n+o;e.style.gridColumn=`${t} / ${i}`,e.style.gridRow=`${n} / ${M}`,e.dataset.cStart=String(t)}(t,N,c,n,g),(a.useStickyAttr||r.length||s.length)&&function(e,t,i,n,o){i.useStickyAttr&&"left"===e.getAttribute("sticky")&&!n.includes(t-1)&&n.push(t-1);i.useStickyAttr&&"right"===e.getAttribute("sticky")&&!o.includes(t-1)&&o.push(t-1);!function(e,t,i,n){const o=i.includes(t),M=n.includes(t);if(!o&&!M)return;(function(e){e.style.position="sticky",e.style.left="",e.style.right="",e.removeAttribute("data-sticky")})(e),o&&!M?function(e,t){e.setAttribute("data-sticky","left"),e.tagName===nS?e.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))":e.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))";e.style.zIndex="1",e.style.left=`var(--sticky-left-${t})`}(e,t):function(e,t){e.setAttribute("data-sticky","right"),e.tagName===nS?e.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))":e.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))";e.style.zIndex="1",e.style.right=`var(--sticky-right-${t})`}(e,t)}(e,t-1,n,o)}(t,N,a,r,s);for(let e=0;e<l;e++)o[i-1+e]=Math.max(o[i-1+e]||0,g);return{c:c,colCount:Math.max(M,c-1)}}function sS(e){if(!e.stickyLeftIndexes.length&&!e.stickyRightIndexes.length)return;const{showRightOnLeftStickies:t,showLeftOnRightStickies:i}=function(e){const t=Math.max(0,e.scrollWidth-e.clientWidth);return{showRightOnLeftStickies:e.scrollLeft>0,showLeftOnRightStickies:e.scrollLeft<t}}(e);if(e.shadowLeftVisibleSticky!==t||e.shadowRightVisibleSticky!==i){e.shadowLeftVisibleSticky=t,e.shadowRightVisibleSticky=i;for(const i of e.stickyLeftHeadEls)i.classList.toggle("shadow-left",t);for(const i of e.stickyLeftBodyEls)i.classList.toggle("shadow-left",t);for(const t of e.stickyRightHeadEls)t.classList.toggle("shadow-right",i);for(const t of e.stickyRightBodyEls)t.classList.toggle("shadow-right",i)}}function aS(e,t,i,n,o,M){return MS(e,t,i,n,o,M,{itemSelector:"nile-grid-cell-item",useStickyAttr:!1,handleRowBg:!0})}function lS(e,t){const i=t.map(((e,i)=>i===t.length-1?`minmax(${Math.round(e)}px, auto)`:`${Math.max(0,Math.round(e))}px`)).join(" ");e.style.setProperty("--nile-grid-columns",i)}let gS=class extends Fe{static get styles(){return[Bm]}constructor(){super(),this.columnWidths=[],this.enableScroll=!1,this.hoverable=!1,this.overflowScrollBehaviour="none",this.raf=0,this.minColumnWidth=40,this.stickyLeftIndexes=[],this.stickyRightIndexes=[],this.cellHeight=null,this.headHeight=null,this.widthsInitialized=!1,this.lockedWidthColumns=[],this.prefixSumColumnsWidth=[],this.stickyColumns=[],this.bodyRows=[],this.headRows=[],this.needsStructureLayout=!1,this.needsWidthLayout=!1,this.needsSpanLayout=!1,this.colCount=0,this.isGridReady=!1,this.stickyLeftHeadEls=[],this.stickyRightHeadEls=[],this.stickyLeftBodyEls=[],this.stickyRightBodyEls=[],this.resizeTimer=0,this.shadowRaf=0,this.resizeBaseColumnWidths=[],this.syncStickyShadowsRaf=()=>{this.shadowRaf||(this.shadowRaf=requestAnimationFrame((()=>{this.shadowRaf=0,sS(this)})))},this.onResize=e=>{e.stopPropagation(),this.emit("nile-resize",{columnNumber:e.detail.col,columnWidth:e.detail.widthPx});const{col:t,widthPx:i}=e.detail;if(!this.resizeBaseColumnWidths)return;!function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)e[n]=t[n]}(this.columnWidths,this.resizeBaseColumnWidths);const{prevW:n,newW:o,delta0:M}=function(e){const{target:t,col:i,widthPx:n,floor:o,columnWidths:M}=e,r=!!t.getAttribute("colspan")&&parseInt(t.getAttribute("colspan"),10)>1,s=M[i]??o,a=r?n-(M[i-1]??0):n,l=Math.max(o,Math.round(Number.isFinite(a)?a:s));return{prevW:s,newW:l,delta0:l-s}}({target:e.target,col:t,widthPx:i,floor:this.minColumnWidth,columnWidths:this.columnWidths});0!==M?(this.enableScroll?function(e){const{grid:t,col:i,newW:n}=e;t.lockedWidthColumns?.[i]||(t.columnWidths[i]=n)}({grid:this,col:t,newW:o}):Xm({grid:this,col:t,prevW:n,newW:o,floor:this.minColumnWidth}),qm(this,t)):qm(this,t)}}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}updateOverscrollBehavior(){const e=this.scrollHeight>this.clientHeight;this.style.overscrollBehavior=e?this.overflowScrollBehaviour:""}scheduleLayout(){this.raf&&cancelAnimationFrame(this.raf),this.raf=requestAnimationFrame((()=>{this.raf=0,oS(this,this.slotEl,this.ensureWidths.bind(this),this.stickyLeftIndexes,this.stickyRightIndexes),sS(this)}))}ensureWidths(e){this.columnWidths.length!==e&&(this.columnWidths=Array(e).fill(0),this.lockedWidthColumns=Array(e).fill(!1))}firstUpdated(){this.setAttribute("role","table"),Km(this,this.onResize,this.slotEl,this._attachObserverAndLayout.bind(this)),this.addEventListener("scroll",this.syncStickyShadowsRaf),this.resizeObserverStickyShadows=new ResizeObserver((()=>{sS(this),this.updateOverscrollBehavior()})),this.resizeObserverStickyShadows.observe(this),this.syncStickyShadowsRaf()}updated(e){e.has("overflowScrollBehaviour")&&this.updateOverscrollBehavior()}_attachObserverAndLayout(){this.mo?.disconnect(),this.mo=new MutationObserver((()=>{this.needsStructureLayout=!0,this.needsWidthLayout=!0,this.needsSpanLayout=!0,this.scheduleLayout()})),this.resizeObserver?.disconnect(),this.resizeObserver=new ResizeObserver((()=>{this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout((()=>{this.resizeTimer=0,this.needsWidthLayout=!0,this.scheduleLayout()}),16)}));const e=eS(this.slotEl),t=tS(this.slotEl);if(!e&&!t)return;const i=e??this;this.mo.observe(i,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["colspan","rowspan","width","lockwidth","sticky"]}),this.resizeObserver?.observe(this),this.colCount&&this.columnWidths?.length||(this.needsStructureLayout=!0,this.needsSpanLayout=!0,this.needsWidthLayout=!0,this.scheduleLayout())}render(){return _`
17033
+ `;function Fm(e,t,i,n,o,M){const r=e.minColumnWidth,s=function(e){return Math.max(0,(e.getBoundingClientRect().width||0)-4)}(e),a=function(e,t,i,n,o,M,r){const s=Array(t).fill(null);if(M){const n=tS(e);n&&function(e,t,i,n,o){const M=[...e.children].filter((e=>"nile-grid-row"===e.tagName.toLowerCase()));for(const e of M)Hm(e,t,i,n,o)}(n,s,t,i,o)}r?.length&&r.some((e=>e>0))&&r?.length===t&&function(e,t,i){for(let n=0;n<t.length;n++)null==e[n]&&Number.isFinite(t[n])&&(e[n]=Math.max(i.minColumnWidth,Math.round(t[n])))}(s,r,n);return s}(n,t,s,e,o,M,i),l=function(e,t,i){const n=Array(e.length).fill(!1);for(let o=0;o<e.length;o++){const M=e[o]??null;t[o]=null==M||Number.isNaN(M)?0:Math.max(i,Number(M)),n[o]=null!=M&&!Number.isNaN(M)}return n}(a,i,r);!function(e,t,i,n){const o=e.reduce(((e,t)=>e+t),0),M=i-o,r=Array.from({length:e.length},((e,t)=>t)).filter((e=>!t[e]));if(0===r.length)return;const s=M/r.length;for(const t of r)e[t]=Math.max(n,s)}(i,l,s,r),e.enableScroll||function(e,t,i){let n=(o=e,o.reduce(((e,t)=>e+t),0));var o;n<t?function(e,t,i){if(!e.length)return;const n=t-i,o=i||1;for(let t=0;t<e.length;t++)e[t]+=n*(e[t]/o)}(e,t,n):n>t&&function(e,t,i,n){let o=i-t;for(let t=0;t<8&&o>.5;t++){const{candidates:t,weightSum:i}=$m(e,n);if(!t.length||i<=0)break;const M=Jm(e,t,i,o,n);if(o-=M,M<.5)break}}(e,t,n,i)}(i,s,r),function(e,t){for(let i=0;i<e.length;i++)e[i]=Math.max(t,Math.round(e[i]))}(i,r),gS(e,i)}function Hm(e,t,i,n,o){const M=[...e.children].filter((e=>"nile-grid-head-item"===e.tagName.toLowerCase())).map((e=>function(e,t,i){const n=Number(e.dataset?.cStart)||1,o=Math.max(1,Number(e.getAttribute("colspan"))||1),M=e.width??e.getAttribute("width")??null;e.hasAttribute("lockWidth")&&(i[n-1]=!0);const r=function(e,t){if(null==e)return null;if("number"==typeof e&&Number.isFinite(e))return e;const i=String(e).trim().toLowerCase();if(!i)return null;if(i.endsWith("px")){const e=parseFloat(i);return Number.isFinite(e)?e:null}if(i.endsWith("%")){const e=parseFloat(i);return Number.isFinite(e)?e/100*t:null}const n=parseFloat(i);return Number.isFinite(n)?n:null}(M,t);return{cStart:n,colspan:o,cw:r}}(e,n,o))).filter((e=>null!=e.cw));M.sort(((e,t)=>e.colspan-t.colspan)),M.forEach((({cStart:e,colspan:n,cw:o})=>{!function(e,t,i,n,o){const M=Math.round(n/i);for(let n=0;n<i;n++){const i=t-1+n;i>=0&&i<o&&null==e[i]&&(e[i]=M)}}(t,e,n,o,i)}))}function $m(e,t){const i=[];let n=0;for(let o=0;o<e.length;o++){Math.max(0,e[o]-t)>0&&(i.push(o),n+=e[o])}return{candidates:i,weightSum:n}}function Jm(e,t,i,n,o){let M=0;for(const r of t){const t=Math.max(0,e[r]-o),s=e[r]/i,a=Math.min(t,n*s);e[r]-=a,M+=a}return M}const Xm=(e,t,i,n,o,M)=>{t.style.display="block",i.style.display="block",t.style.height=o+"px",i.style.height=o+"px";const r=e,s=e=>Math.max(0,Math.round(e||0)),a=s(M.reduce(((e,t)=>e+(t||0)),0)),l=(g=n,s(M.slice(0,Math.max(0,g)).reduce(((e,t)=>e+(t||0)),0)));var g;let N=l+s(Math.max(r,M[n]??r));const c=l+r,u=a;N=Math.min(Math.max(N,c),u),N=Math.max(N,20),t.style.left=N-6+"px",i.style.left=N-2+"px"};function qm({grid:e,col:t,prevW:i,newW:n,floor:o}){if(e.lockedWidthColumns?.[t])return;let M=n-i;if(M>0){const n=function(e,t,i,n){let o=0;for(let M=t;M<e.length;M++)n?.[M]||(o+=Math.max(0,e[M]-i));return o}(e.columnWidths,t+1,o,e.lockedWidthColumns);if(n<=0)return;M=Math.min(M,n),e.columnWidths[t]=i+M,function(e,t,i,n,o){let M=i;for(let i=t;i<e.length&&M>0;i++){if(o?.[i])continue;const t=e[i]-n;if(t<=0)continue;const r=Math.min(t,M);e[i]-=r,M-=r}}(e.columnWidths,t+1,M,o,e.lockedWidthColumns)}else{const M=Math.max(o,n),r=i-M;e.columnWidths[t]=M,function(e,t,i){let n=i;t<e.length&&n>0&&(e[t]+=n,n=0)}(e.columnWidths,t+1,r)}}function Km(e,t){Xm(e.minColumnWidth,e.resizeStart,e.resizeEnd,t,e.scrollHeight,e.columnWidths)}const eS=(e,t,i,n)=>{e.addEventListener("nile-column-resize",t),e.addEventListener("nile-resize-start",(t=>{t.stopPropagation(),e.resizeBaseColumnWidths=[...e.columnWidths],e.resizeStart.style.display="block"})),e.addEventListener("nile-resize-end",(t=>{var i,n;t.stopPropagation(),i=e,n=t.detail.col,Xm(i.minColumnWidth,i.resizeStart,i.resizeEnd,n,i.scrollHeight,i.columnWidths),gS(i,i.columnWidths),e.resizeBaseColumnWidths=[],e.resizeStart.style.display="none",e.resizeEnd.style.display="none"})),i.addEventListener("slotchange",(()=>n())),e.addEventListener("scroll",(()=>nS(e)))},tS=e=>(e?.assignedElements()??[]).find((e=>"nile-grid-head"===e.tagName.toLowerCase()))||null,iS=e=>(e?.assignedElements()??[]).find((e=>"nile-grid-body"===e.tagName.toLowerCase()))||null,nS=e=>{const t=Math.max(1,e.scrollHeight-e.clientHeight),i=Math.max(1,e.scrollWidth-e.clientWidth),n=Math.round(e.scrollTop/t*100),o=Math.round(e.scrollLeft/i*100);e.emit("nile-scroll",{bubbles:!0,composed:!0,detail:{horizontalScroll:o,verticalScroll:n,left:e.scrollLeft,top:e.scrollTop}})};const oS="NILE-GRID-HEAD-ITEM",MS=(e,t,i,n,o)=>{const M=tS(t),r=iS(t);if(!M&&!r)return;let s=e.colCount||0,a=!1;if(e.needsStructureLayout)a=!0,e.headRows=M?Array.from(M.querySelectorAll("nile-grid-row")):[],s=0,e.headRows.length&&(s=function(e,t,i,n,o,M){return rS(e,t,i,n,o,M,{itemSelector:"nile-grid-head-item",useStickyAttr:!0,handleRowBg:!1})}(e,e.headRows,[],s,n,o)),r&&(e.bodyRows=Array.from(r.querySelectorAll("nile-grid-row")),s?lS(e,e.bodyRows,[],s,n,o):s=lS(e,e.bodyRows,[],s,n,o)),e.stickyLeftIndexes.length||e.stickyRightIndexes.length?function(e){const{head:t,body:i}=function(e){if(!e.shadowRoot)return{head:void 0,body:void 0};const t=e.slotEl.assignedElements(),i=e=>t.find((t=>t.tagName.toLowerCase()===e));return{head:i("nile-grid-head"),body:i("nile-grid-body")}}(e);e.stickyLeftHeadEls=t?Array.from(t.querySelectorAll('nile-grid-head-item[data-sticky="left"]')):[],e.stickyRightHeadEls=t?Array.from(t.querySelectorAll('nile-grid-head-item[data-sticky="right"]')):[],e.stickyLeftBodyEls=i?Array.from(i.querySelectorAll('nile-grid-cell-item[data-sticky="left"]')):[],e.stickyRightBodyEls=i?Array.from(i.querySelectorAll('nile-grid-cell-item[data-sticky="right"]')):[]}(e):(e.stickyLeftHeadEls=[],e.stickyRightHeadEls=[],e.stickyLeftBodyEls=[],e.stickyRightBodyEls=[],e.shadowLeftVisibleSticky=!1,e.shadowRightVisibleSticky=!1),e.colCount=s,e.needsStructureLayout=!1,e.needsSpanLayout=!1,e.needsWidthLayout=!0;else if(e.needsSpanLayout&&r){const t=e.bodyRows;s=e.colCount||0,s&&lS(e,t,[],s,n,o),e.needsSpanLayout=!1}if(e.needsWidthLayout){if(s=e.colCount||s,!s)return;i(s),Fm(e,s,e.columnWidths,t,e.lockedWidthColumns,a),function(e){const t=e.columnWidths,i=e.stickyLeftIndexes,n=e.stickyRightIndexes,o=[],M=e;let r=0;for(let e=0;e<i.length;e++){const n=i[e];o.push({colNumber:n,left:r,right:0}),M.style.setProperty(`--sticky-left-${n}`,`${r}px`),r+=t[n]}let s=0;for(let e=n.length-1;e>=0;e--){const i=n[e];o.push({colNumber:i,left:0,right:s}),M.style.setProperty(`--sticky-right-${i}`,`${s}px`),s+=t[i]}e.prefixSumColumnsWidth=o}(e),gS(e,e.columnWidths),e.needsWidthLayout=!1,e.isGridReady||(e.isGridReady=!0,e.emit("nile-grid-ready"))}};function rS(e,t,i,n,o,M,r){return t.forEach(((t,s)=>{e.hoverable&&t.setAttribute("hover","true"),n=function(e,t,i,n,o,M,r,s){let a=1;const l=i+1,g=s.itemSelector.toLowerCase(),N=Array.from(t.children).filter((e=>e.tagName.toLowerCase()===g));for(const t of N){for(;(n[a-1]||0)>0;)a++;({c:a,colCount:o}=sS(e,t,a,l,n,o,M,r,s))}return function(e){for(let t=0;t<e.length;t++)e[t]>0&&e[t]--}(n),o}(e,t,s,i,n,o,M,r)})),n}function sS(e,t,i,n,o,M,r,s,a){const l=Math.max(1,+t.getAttribute("colspan")||1),g=Math.max(1,+t.getAttribute("rowspan")||1);!function(e,t,i){if(i<=1)return;t.style.position="absolute",t.style.zIndex="1",t.tagName===oS?(e.headHeight||(e.headHeight=t.getBoundingClientRect().height),t.style.height=e.headHeight*i+(i-1)+"px",t.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))",t.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))"):(e.cellHeight||(e.cellHeight=t.getBoundingClientRect().height),t.style.height=e.cellHeight*i+(i-1)+"px",t.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))",t.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))")}(e,t,g);const N=i,c=i+l;!function(e,t,i,n,o){const M=n+o;e.style.gridColumn=`${t} / ${i}`,e.style.gridRow=`${n} / ${M}`,e.dataset.cStart=String(t)}(t,N,c,n,g),(a.useStickyAttr||r.length||s.length)&&function(e,t,i,n,o){i.useStickyAttr&&"left"===e.getAttribute("sticky")&&!n.includes(t-1)&&n.push(t-1);i.useStickyAttr&&"right"===e.getAttribute("sticky")&&!o.includes(t-1)&&o.push(t-1);!function(e,t,i,n){const o=i.includes(t),M=n.includes(t);if(!o&&!M)return;(function(e){e.style.position="sticky",e.style.left="",e.style.right="",e.removeAttribute("data-sticky")})(e),o&&!M?function(e,t){e.setAttribute("data-sticky","left"),e.tagName===oS?e.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))":e.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))";e.style.zIndex="1",e.style.left=`var(--sticky-left-${t})`}(e,t):function(e,t){e.setAttribute("data-sticky","right"),e.tagName===oS?e.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))":e.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))";e.style.zIndex="1",e.style.right=`var(--sticky-right-${t})`}(e,t)}(e,t-1,n,o)}(t,N,a,r,s);for(let e=0;e<l;e++)o[i-1+e]=Math.max(o[i-1+e]||0,g);return{c:c,colCount:Math.max(M,c-1)}}function aS(e){if(!e.stickyLeftIndexes.length&&!e.stickyRightIndexes.length)return;const{showRightOnLeftStickies:t,showLeftOnRightStickies:i}=function(e){const t=Math.max(0,e.scrollWidth-e.clientWidth);return{showRightOnLeftStickies:e.scrollLeft>0,showLeftOnRightStickies:e.scrollLeft<t}}(e);if(e.shadowLeftVisibleSticky!==t||e.shadowRightVisibleSticky!==i){e.shadowLeftVisibleSticky=t,e.shadowRightVisibleSticky=i;for(const i of e.stickyLeftHeadEls)i.classList.toggle("shadow-left",t);for(const i of e.stickyLeftBodyEls)i.classList.toggle("shadow-left",t);for(const t of e.stickyRightHeadEls)t.classList.toggle("shadow-right",i);for(const t of e.stickyRightBodyEls)t.classList.toggle("shadow-right",i)}}function lS(e,t,i,n,o,M){return rS(e,t,i,n,o,M,{itemSelector:"nile-grid-cell-item",useStickyAttr:!1,handleRowBg:!0})}function gS(e,t){const i=t.map(((e,i)=>i===t.length-1?`minmax(${Math.round(e)}px, auto)`:`${Math.max(0,Math.round(e))}px`)).join(" ");e.style.setProperty("--nile-grid-columns",i)}let NS=class extends Fe{static get styles(){return[Gm]}constructor(){super(),this.columnWidths=[],this.enableScroll=!1,this.hoverable=!1,this.overflowScrollBehaviour="none",this.raf=0,this.minColumnWidth=40,this.stickyLeftIndexes=[],this.stickyRightIndexes=[],this.cellHeight=null,this.headHeight=null,this.widthsInitialized=!1,this.lockedWidthColumns=[],this.prefixSumColumnsWidth=[],this.stickyColumns=[],this.bodyRows=[],this.headRows=[],this.needsStructureLayout=!1,this.needsWidthLayout=!1,this.needsSpanLayout=!1,this.colCount=0,this.isGridReady=!1,this.stickyLeftHeadEls=[],this.stickyRightHeadEls=[],this.stickyLeftBodyEls=[],this.stickyRightBodyEls=[],this.resizeTimer=0,this.shadowRaf=0,this.resizeBaseColumnWidths=[],this.syncStickyShadowsRaf=()=>{this.shadowRaf||(this.shadowRaf=requestAnimationFrame((()=>{this.shadowRaf=0,aS(this)})))},this.onResize=e=>{e.stopPropagation(),this.emit("nile-resize",{columnNumber:e.detail.col,columnWidth:e.detail.widthPx});const{col:t,widthPx:i}=e.detail;if(!this.resizeBaseColumnWidths)return;!function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)e[n]=t[n]}(this.columnWidths,this.resizeBaseColumnWidths);const{prevW:n,newW:o,delta0:M}=function(e){const{target:t,col:i,widthPx:n,floor:o,columnWidths:M}=e,r=!!t.getAttribute("colspan")&&parseInt(t.getAttribute("colspan"),10)>1,s=M[i]??o,a=r?n-(M[i-1]??0):n,l=Math.max(o,Math.round(Number.isFinite(a)?a:s));return{prevW:s,newW:l,delta0:l-s}}({target:e.target,col:t,widthPx:i,floor:this.minColumnWidth,columnWidths:this.columnWidths});0!==M?(this.enableScroll?function(e){const{grid:t,col:i,newW:n}=e;t.lockedWidthColumns?.[i]||(t.columnWidths[i]=n)}({grid:this,col:t,newW:o}):qm({grid:this,col:t,prevW:n,newW:o,floor:this.minColumnWidth}),Km(this,t)):Km(this,t)}}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}updateOverscrollBehavior(){const e=this.scrollHeight>this.clientHeight;this.style.overscrollBehavior=e?this.overflowScrollBehaviour:""}scheduleLayout(){this.raf&&cancelAnimationFrame(this.raf),this.raf=requestAnimationFrame((()=>{this.raf=0,MS(this,this.slotEl,this.ensureWidths.bind(this),this.stickyLeftIndexes,this.stickyRightIndexes),aS(this)}))}ensureWidths(e){this.columnWidths.length!==e&&(this.columnWidths=Array(e).fill(0),this.lockedWidthColumns=Array(e).fill(!1))}firstUpdated(){this.setAttribute("role","table"),eS(this,this.onResize,this.slotEl,this._attachObserverAndLayout.bind(this)),this.addEventListener("scroll",this.syncStickyShadowsRaf),this.resizeObserverStickyShadows=new ResizeObserver((()=>{aS(this),this.updateOverscrollBehavior()})),this.resizeObserverStickyShadows.observe(this),this.syncStickyShadowsRaf()}updated(e){e.has("overflowScrollBehaviour")&&this.updateOverscrollBehavior()}_attachObserverAndLayout(){this.mo?.disconnect(),this.mo=new MutationObserver((()=>{this.needsStructureLayout=!0,this.needsWidthLayout=!0,this.needsSpanLayout=!0,this.scheduleLayout()})),this.resizeObserver?.disconnect(),this.resizeObserver=new ResizeObserver((()=>{this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout((()=>{this.resizeTimer=0,this.needsWidthLayout=!0,this.scheduleLayout()}),16)}));const e=tS(this.slotEl),t=iS(this.slotEl);if(!e&&!t)return;const i=e??this;this.mo.observe(i,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["colspan","rowspan","width","lockwidth","sticky"]}),this.resizeObserver?.observe(this),this.colCount&&this.columnWidths?.length||(this.needsStructureLayout=!0,this.needsSpanLayout=!0,this.needsWidthLayout=!0,this.scheduleLayout())}render(){return _`
16885
17034
  <div part="grid-base" class="nile-grid-base">
16886
17035
  <div part="grid-slot-wrapper">
16887
17036
  <slot part="grid-slot"></slot>
@@ -16889,16 +17038,16 @@ nile-badge::part(content) {
16889
17038
  <div part="resize-start" class="nile-resize-start"></div>
16890
17039
  <div part="resize-end" class="nile-resize-end"></div>
16891
17040
  </div>
16892
- `}disconnectedCallback(){var e,t,i,n;this.emit("nile-destroy"),super.disconnectedCallback?.(),this.mo?.disconnect(),this.resizeObserver?.disconnect(),this.resizeObserverStickyShadows?.disconnect(),this.raf&&cancelAnimationFrame(this.raf),e=this,t=this.onResize,i=this.slotEl,n=this._attachObserverAndLayout.bind(this),e.removeEventListener("nile-column-resize",t),e.removeEventListener("nile-resize-start",(()=>{e.resizeStart.style.display="block"})),e.removeEventListener("nile-resize-end",(()=>{e.resizeStart.style.display="none",e.resizeEnd.style.display="none"})),i.removeEventListener("slotchange",(()=>n())),e.removeEventListener("scroll",(()=>iS(e)))}};e([De()],gS.prototype,"columnWidths",void 0),e([he("slot")],gS.prototype,"slotEl",void 0),e([he(".nile-resize-start")],gS.prototype,"resizeStart",void 0),e([he(".nile-resize-end")],gS.prototype,"resizeEnd",void 0),e([he(".shadow-left")],gS.prototype,"shadowLeft",void 0),e([he(".shadow-right")],gS.prototype,"shadowRight",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],gS.prototype,"enableScroll",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],gS.prototype,"hoverable",void 0),e([ue({type:String,attribute:!0,reflect:!0})],gS.prototype,"overflowScrollBehaviour",void 0),e([ue({type:Number,reflect:!0,attribute:!0})],gS.prototype,"minColumnWidth",void 0),e([De()],gS.prototype,"stickyLeftIndexes",void 0),e([De()],gS.prototype,"stickyRightIndexes",void 0),e([De()],gS.prototype,"cellHeight",void 0),e([De()],gS.prototype,"headHeight",void 0),e([De()],gS.prototype,"widthsInitialized",void 0),e([De()],gS.prototype,"lockedWidthColumns",void 0),e([De()],gS.prototype,"prefixSumColumnsWidth",void 0),e([De()],gS.prototype,"stickyColumns",void 0),e([De()],gS.prototype,"bodyRows",void 0),e([De()],gS.prototype,"headRows",void 0),e([De()],gS.prototype,"needsStructureLayout",void 0),e([De()],gS.prototype,"needsWidthLayout",void 0),e([De()],gS.prototype,"needsSpanLayout",void 0),e([De()],gS.prototype,"colCount",void 0),gS=e([ge("nile-grid")],gS);const NS=r`
17041
+ `}disconnectedCallback(){var e,t,i,n;this.emit("nile-destroy"),super.disconnectedCallback?.(),this.mo?.disconnect(),this.resizeObserver?.disconnect(),this.resizeObserverStickyShadows?.disconnect(),this.raf&&cancelAnimationFrame(this.raf),e=this,t=this.onResize,i=this.slotEl,n=this._attachObserverAndLayout.bind(this),e.removeEventListener("nile-column-resize",t),e.removeEventListener("nile-resize-start",(()=>{e.resizeStart.style.display="block"})),e.removeEventListener("nile-resize-end",(()=>{e.resizeStart.style.display="none",e.resizeEnd.style.display="none"})),i.removeEventListener("slotchange",(()=>n())),e.removeEventListener("scroll",(()=>nS(e)))}};e([De()],NS.prototype,"columnWidths",void 0),e([he("slot")],NS.prototype,"slotEl",void 0),e([he(".nile-resize-start")],NS.prototype,"resizeStart",void 0),e([he(".nile-resize-end")],NS.prototype,"resizeEnd",void 0),e([he(".shadow-left")],NS.prototype,"shadowLeft",void 0),e([he(".shadow-right")],NS.prototype,"shadowRight",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],NS.prototype,"enableScroll",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],NS.prototype,"hoverable",void 0),e([ue({type:String,attribute:!0,reflect:!0})],NS.prototype,"overflowScrollBehaviour",void 0),e([ue({type:Number,reflect:!0,attribute:!0})],NS.prototype,"minColumnWidth",void 0),e([De()],NS.prototype,"stickyLeftIndexes",void 0),e([De()],NS.prototype,"stickyRightIndexes",void 0),e([De()],NS.prototype,"cellHeight",void 0),e([De()],NS.prototype,"headHeight",void 0),e([De()],NS.prototype,"widthsInitialized",void 0),e([De()],NS.prototype,"lockedWidthColumns",void 0),e([De()],NS.prototype,"prefixSumColumnsWidth",void 0),e([De()],NS.prototype,"stickyColumns",void 0),e([De()],NS.prototype,"bodyRows",void 0),e([De()],NS.prototype,"headRows",void 0),e([De()],NS.prototype,"needsStructureLayout",void 0),e([De()],NS.prototype,"needsWidthLayout",void 0),e([De()],NS.prototype,"needsSpanLayout",void 0),e([De()],NS.prototype,"colCount",void 0),NS=e([ge("nile-grid")],NS);const cS=r`
16893
17042
  :host {
16894
17043
  box-sizing: border-box;
16895
17044
  background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
16896
17045
  }
16897
- `;let cS=class extends Fe{static get styles(){return[NS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","rowgroup")}render(){return _`
17046
+ `;let uS=class extends Fe{static get styles(){return[cS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","rowgroup")}render(){return _`
16898
17047
  <div part="grid-body-base">
16899
17048
  <slot></slot>
16900
17049
  </div>
16901
- `}};cS=e([ge("nile-grid-body")],cS);const uS=r`
17050
+ `}};uS=e([ge("nile-grid-body")],uS);const DS=r`
16902
17051
  .row-base {
16903
17052
  display: grid;
16904
17053
  grid-template-columns: var(--nile-grid-columns);
@@ -16934,14 +17083,14 @@ nile-badge::part(content) {
16934
17083
  :host-context(nile-grid-body):host(:last-child)::part(grid-row-base) {
16935
17084
  border-bottom: none;
16936
17085
  }
16937
- `;let DS=class extends Fe{constructor(){super(...arguments),this.disabled=!1,this.hover=!1,this.selected=!1}static get styles(){return[uS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","row")}render(){return _`
17086
+ `;let dS=class extends Fe{constructor(){super(...arguments),this.disabled=!1,this.hover=!1,this.selected=!1}static get styles(){return[DS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","row")}render(){return _`
16938
17087
  <div part="grid-row-base" class="row-base">
16939
17088
  <div part="row-slot" class="row-slot">
16940
17089
  <slot></slot>
16941
17090
  </div>
16942
17091
  <div part="row-bg" class="row-bg"></div>
16943
17092
  </div>
16944
- `}};e([ue({type:Boolean,reflect:!0,attribute:!0})],DS.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],DS.prototype,"hover",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],DS.prototype,"selected",void 0),DS=e([ge("nile-grid-row")],DS);const dS=r`
17093
+ `}};e([ue({type:Boolean,reflect:!0,attribute:!0})],dS.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],dS.prototype,"hover",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],dS.prototype,"selected",void 0),dS=e([ge("nile-grid-row")],dS);const hS=r`
16945
17094
  :host {
16946
17095
  --padding: var(--nile-spacing-lg, var(--ng-spacing-lg)) var(--nile-spacing-10px, var(--ng-spacing-3xl));
16947
17096
  --height: 50px;
@@ -17007,7 +17156,7 @@ nile-badge::part(content) {
17007
17156
  z-index: 1;
17008
17157
  background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
17009
17158
  }
17010
- `;let hS=class extends Fe{constructor(){super(...arguments),this.colspan=1,this.rowspan=1,this.resizable=!1,this.width=null,this.sticky=null,this.lockWidth=!1,this.onHandlePointerDown=e=>{const t=this,i=this.closest("nile-grid"),n={value:0},o={value:0},M=function(e,t,i,n){t.preventDefault(),t.stopPropagation();const o=Number(e.dataset.cStart);if(!o)return null;const M=Number(e.getAttribute("colspan"))||1,r=Math.max(0,o+M-1-1);i.value=t.clientX,n.value=e.getBoundingClientRect().width;const s=t.currentTarget;return s.setPointerCapture(t.pointerId),e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:r,widthPx:n.value},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("nile-resize-start",{bubbles:!0,composed:!0})),{target:s,col:r}}(t,e,n,o);if(!M)return;const{target:r,col:s}=M,a=e=>function(e,t,i,n,o,M){const r=Math.max(M.minColumnWidth,Math.round(i+(o.clientX-n)));e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:t,widthPx:r},bubbles:!0,composed:!0}))}(t,s,o.value,n.value,e,i),l=e=>{!function(e,t,i,n,o){n.releasePointerCapture(i.pointerId),n.removeEventListener("pointermove",o),e.dispatchEvent(new CustomEvent("nile-resize-end",{bubbles:!0,composed:!0,detail:{col:t}}))}(t,s,e,r,a),function(e,t,i){e.removeEventListener("pointermove",t),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),window.removeEventListener("pointerup",i)}(r,a,l)};!function(e,t,i){e.addEventListener("pointermove",t),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),window.addEventListener("pointerup",i,{once:!0})}(r,a,l)}}static get styles(){return[dS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","row")}disconnectedCallback(){super.disconnectedCallback(),this.removeAttribute("role")}render(){return _`
17159
+ `;let jS=class extends Fe{constructor(){super(...arguments),this.colspan=1,this.rowspan=1,this.resizable=!1,this.width=null,this.sticky=null,this.lockWidth=!1,this.onHandlePointerDown=e=>{const t=this,i=this.closest("nile-grid"),n={value:0},o={value:0},M=function(e,t,i,n){t.preventDefault(),t.stopPropagation();const o=Number(e.dataset.cStart);if(!o)return null;const M=Number(e.getAttribute("colspan"))||1,r=Math.max(0,o+M-1-1);i.value=t.clientX,n.value=e.getBoundingClientRect().width;const s=t.currentTarget;return s.setPointerCapture(t.pointerId),e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:r,widthPx:n.value},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("nile-resize-start",{bubbles:!0,composed:!0})),{target:s,col:r}}(t,e,n,o);if(!M)return;const{target:r,col:s}=M,a=e=>function(e,t,i,n,o,M){const r=Math.max(M.minColumnWidth,Math.round(i+(o.clientX-n)));e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:t,widthPx:r},bubbles:!0,composed:!0}))}(t,s,o.value,n.value,e,i),l=e=>{!function(e,t,i,n,o){n.releasePointerCapture(i.pointerId),n.removeEventListener("pointermove",o),e.dispatchEvent(new CustomEvent("nile-resize-end",{bubbles:!0,composed:!0,detail:{col:t}}))}(t,s,e,r,a),function(e,t,i){e.removeEventListener("pointermove",t),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),window.removeEventListener("pointerup",i)}(r,a,l)};!function(e,t,i){e.addEventListener("pointermove",t),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),window.addEventListener("pointerup",i,{once:!0})}(r,a,l)}}static get styles(){return[hS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","row")}disconnectedCallback(){super.disconnectedCallback(),this.removeAttribute("role")}render(){return _`
17011
17160
  <div part="grid-head-item-base" class="head-item-base">
17012
17161
  <slot></slot>
17013
17162
  ${this.resizable?_`
@@ -17019,7 +17168,7 @@ nile-badge::part(content) {
17019
17168
  ></div>
17020
17169
  `:null}
17021
17170
  </div>
17022
- `}};e([ue({type:Number,reflect:!0,attribute:!0})],hS.prototype,"colspan",void 0),e([ue({type:Number,reflect:!0,attribute:!0})],hS.prototype,"rowspan",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],hS.prototype,"resizable",void 0),e([ue({type:String,reflect:!0,attribute:!0})],hS.prototype,"width",void 0),e([ue({type:String,reflect:!0,attribute:!0})],hS.prototype,"sticky",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],hS.prototype,"lockWidth",void 0),hS=e([ge("nile-grid-head-item")],hS);const jS=r`
17171
+ `}};e([ue({type:Number,reflect:!0,attribute:!0})],jS.prototype,"colspan",void 0),e([ue({type:Number,reflect:!0,attribute:!0})],jS.prototype,"rowspan",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],jS.prototype,"resizable",void 0),e([ue({type:String,reflect:!0,attribute:!0})],jS.prototype,"width",void 0),e([ue({type:String,reflect:!0,attribute:!0})],jS.prototype,"sticky",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],jS.prototype,"lockWidth",void 0),jS=e([ge("nile-grid-head-item")],jS);const IS=r`
17023
17172
  :host {
17024
17173
  --padding: var(--nile-spacing-xl, var(--ng-spacing-lg)) var(--nile-spacing-10px, var(--ng-spacing-3xl));
17025
17174
  --height: 44px;
@@ -17095,7 +17244,7 @@ nile-badge::part(content) {
17095
17244
  z-index: 1;
17096
17245
  background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
17097
17246
  }
17098
- `;let IS=class extends Fe{constructor(){super(...arguments),this.colspan=1,this.rowspan=1,this.resizable=!1,this.onHandlePointerDown=e=>{const t=this,i={value:0},n={value:0},o=function(e,t,i,n){t.preventDefault(),t.stopPropagation();const o=Number(e.dataset.cStart);if(!o)return null;const M=Number(e.getAttribute("colspan"))||1,r=Math.max(0,o+M-1-1);i.value=t.clientX,n.value=e.getBoundingClientRect().width;const s=t.currentTarget;return s.setPointerCapture(t.pointerId),e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:r,widthPx:n.value},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("nile-resize-start",{bubbles:!0,composed:!0})),{target:s,col:r}}(t,e,i,n);if(!o)return;const{target:M,col:r}=o,s=e=>function(e,t,i,n,o){const M=Math.max(40,Math.round(i+(o.clientX-n)));e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:t,widthPx:M},bubbles:!0,composed:!0}))}(t,r,n.value,i.value,e),a=()=>function(e,t,i,n,o){n.releasePointerCapture(i.pointerId),n.removeEventListener("pointermove",o),e.dispatchEvent(new CustomEvent("nile-resize-end",{bubbles:!0,composed:!0,detail:{col:t}}))}(t,r,e,M,s);M.addEventListener("pointermove",s),M.addEventListener("pointerup",a,{once:!0}),M.addEventListener("pointercancel",a,{once:!0})}}static get styles(){return[jS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","cell")}render(){return _`
17247
+ `;let zS=class extends Fe{constructor(){super(...arguments),this.colspan=1,this.rowspan=1,this.resizable=!1,this.onHandlePointerDown=e=>{const t=this,i={value:0},n={value:0},o=function(e,t,i,n){t.preventDefault(),t.stopPropagation();const o=Number(e.dataset.cStart);if(!o)return null;const M=Number(e.getAttribute("colspan"))||1,r=Math.max(0,o+M-1-1);i.value=t.clientX,n.value=e.getBoundingClientRect().width;const s=t.currentTarget;return s.setPointerCapture(t.pointerId),e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:r,widthPx:n.value},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("nile-resize-start",{bubbles:!0,composed:!0})),{target:s,col:r}}(t,e,i,n);if(!o)return;const{target:M,col:r}=o,s=e=>function(e,t,i,n,o){const M=Math.max(40,Math.round(i+(o.clientX-n)));e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:t,widthPx:M},bubbles:!0,composed:!0}))}(t,r,n.value,i.value,e),a=()=>function(e,t,i,n,o){n.releasePointerCapture(i.pointerId),n.removeEventListener("pointermove",o),e.dispatchEvent(new CustomEvent("nile-resize-end",{bubbles:!0,composed:!0,detail:{col:t}}))}(t,r,e,M,s);M.addEventListener("pointermove",s),M.addEventListener("pointerup",a,{once:!0}),M.addEventListener("pointercancel",a,{once:!0})}}static get styles(){return[IS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","cell")}render(){return _`
17099
17248
  <div class="cell-item-base" part="grid-cell-item-base">
17100
17249
  <slot></slot>
17101
17250
  ${this.resizable?_`
@@ -17106,7 +17255,7 @@ nile-badge::part(content) {
17106
17255
  ></div>
17107
17256
  `:null}
17108
17257
  </div>
17109
- `}};e([ue({type:Number,reflect:!0,attribute:!0})],IS.prototype,"colspan",void 0),e([ue({type:Number,reflect:!0,attribute:!0})],IS.prototype,"rowspan",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],IS.prototype,"resizable",void 0),IS=e([ge("nile-grid-cell-item")],IS);const zS=r`
17258
+ `}};e([ue({type:Number,reflect:!0,attribute:!0})],zS.prototype,"colspan",void 0),e([ue({type:Number,reflect:!0,attribute:!0})],zS.prototype,"rowspan",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],zS.prototype,"resizable",void 0),zS=e([ge("nile-grid-cell-item")],zS);const yS=r`
17110
17259
  :host([sticky]) {
17111
17260
  position: sticky;
17112
17261
  z-index: 2;
@@ -17118,11 +17267,11 @@ nile-badge::part(content) {
17118
17267
  display: block;
17119
17268
  }
17120
17269
  }
17121
- `;let yS=class extends Fe{constructor(){super(...arguments),this.sticky=!1}static get styles(){return[zS]}render(){return _`
17270
+ `;let pS=class extends Fe{constructor(){super(...arguments),this.sticky=!1}static get styles(){return[yS]}render(){return _`
17122
17271
  <div part="grid-head-base">
17123
17272
  <slot></slot>
17124
17273
  </div>
17125
- `}};e([ue({type:Boolean,reflect:!0,attribute:!0})],yS.prototype,"sticky",void 0),yS=e([ge("nile-grid-head")],yS);let pS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};pS=e([ge("nile-rte-toolbar")],pS);let TS=class extends ae{constructor(){super(...arguments),this.name="",this.label=""}createRenderRoot(){return this}shouldUpdate(){return!1}};e([ue({type:String,attribute:!0,reflect:!0})],TS.prototype,"name",void 0),e([ue({type:String,attribute:!0,reflect:!0})],TS.prototype,"label",void 0),TS=e([ge("nile-rte-toolbar-item")],TS);const AS=new Set(["p","h1","h2","h3","h4","h5","h6"]);function OS(e){return AS.has(e)}let xS=class extends ae{constructor(){super(...arguments),this.type="",this.options="[]",this.label="",this.disabled=!1,this.selectedValue=""}createRenderRoot(){return this}mapAlignIcon(e){return{left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify"}[e]||"format_align_left"}get parsedOptions(){const e=this.optionsObj??this.options;let t=(()=>{if(Array.isArray(e))return e;try{return JSON.parse(String(e))}catch{return[]}})();"align"===this.type&&0===t.length&&(t=[{value:"left",label:"Align Left"},{value:"center",label:"Align Center"},{value:"right",label:"Align Right"},{value:"justify",label:"Justify"}]);let i=t.map((e=>{const t=e?.value??e;return{value:t,label:e?.label??e?.value??e,icon:e?.icon??("align"===this.type?this.mapAlignIcon(String(t)):void 0)}}));if("heading"===this.type){i.length;i=i.filter((e=>OS(e.value))),i.length,this.selectedValue&&!OS(this.selectedValue)&&(this.selectedValue="")}return i}ensureDefault(){if(!this.selectedValue){const e=this.parsedOptions[0];e&&(this.selectedValue=e.value)}}onSelect(e){"heading"!==this.type||OS(e)?(this.selectedValue=e,this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))):console.warn(`[nile-rte-select] Ignoring invalid heading value: ${e}`)}connectedCallback(){super.connectedCallback(),this.injectLocalStyles()}injectLocalStyles(){if(this.querySelector("style[data-rte-select-style]"))return;const e=document.createElement("style");e.setAttribute("data-rte-select-style","true"),e.textContent="\n nile-menu.rte-align-menu::part(menu__items-wrapper) {\n display: flex;\n }\n nile-menu.rte-align-menu,\n nile-menu.rte-default-menu {\n margin-top: 0px;\n }\n nile-button.rte-align-trigger::part(base),\n nile-button.rte-default-trigger::part(base) {\n min-width: 32px;\n height: 32px;\n padding: 0px 6px;\n box-shadow: none;\n }\n nile-button.rte-align-trigger::part(base) {\n\n border: none;\n}\n\n \n ",this.insertBefore(e,this.firstChild)}render(){const e=this.parsedOptions;this.ensureDefault();const t=e.find((e=>e.value===this.selectedValue));if("align"===this.type){const i=t?.icon?_`<nile-icon name="${t.icon}" color=${this.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))"} size="20"></nile-icon>`:this.label||"Align";return _`
17274
+ `}};e([ue({type:Boolean,reflect:!0,attribute:!0})],pS.prototype,"sticky",void 0),pS=e([ge("nile-grid-head")],pS);let TS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};TS=e([ge("nile-rte-toolbar")],TS);let AS=class extends ae{constructor(){super(...arguments),this.name="",this.label=""}createRenderRoot(){return this}shouldUpdate(){return!1}};e([ue({type:String,attribute:!0,reflect:!0})],AS.prototype,"name",void 0),e([ue({type:String,attribute:!0,reflect:!0})],AS.prototype,"label",void 0),AS=e([ge("nile-rte-toolbar-item")],AS);const OS=new Set(["p","h1","h2","h3","h4","h5","h6"]);function xS(e){return OS.has(e)}let LS=class extends ae{constructor(){super(...arguments),this.type="",this.options="[]",this.label="",this.disabled=!1,this.selectedValue=""}createRenderRoot(){return this}mapAlignIcon(e){return{left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify"}[e]||"format_align_left"}get parsedOptions(){const e=this.optionsObj??this.options;let t=(()=>{if(Array.isArray(e))return e;try{return JSON.parse(String(e))}catch{return[]}})();"align"===this.type&&0===t.length&&(t=[{value:"left",label:"Align Left"},{value:"center",label:"Align Center"},{value:"right",label:"Align Right"},{value:"justify",label:"Justify"}]);let i=t.map((e=>{const t=e?.value??e;return{value:t,label:e?.label??e?.value??e,icon:e?.icon??("align"===this.type?this.mapAlignIcon(String(t)):void 0)}}));if("heading"===this.type){i.length;i=i.filter((e=>xS(e.value))),i.length,this.selectedValue&&!xS(this.selectedValue)&&(this.selectedValue="")}return i}ensureDefault(){if(!this.selectedValue){const e=this.parsedOptions[0];e&&(this.selectedValue=e.value)}}onSelect(e){"heading"!==this.type||xS(e)?(this.selectedValue=e,this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))):console.warn(`[nile-rte-select] Ignoring invalid heading value: ${e}`)}connectedCallback(){super.connectedCallback(),this.injectLocalStyles()}injectLocalStyles(){if(this.querySelector("style[data-rte-select-style]"))return;const e=document.createElement("style");e.setAttribute("data-rte-select-style","true"),e.textContent="\n nile-menu.rte-align-menu::part(menu__items-wrapper) {\n display: flex;\n }\n nile-menu.rte-align-menu,\n nile-menu.rte-default-menu {\n margin-top: 0px;\n }\n nile-button.rte-align-trigger::part(base),\n nile-button.rte-default-trigger::part(base) {\n min-width: 32px;\n height: 32px;\n padding: 0px 6px;\n box-shadow: none;\n }\n nile-button.rte-align-trigger::part(base) {\n\n border: none;\n}\n\n \n ",this.insertBefore(e,this.firstChild)}render(){const e=this.parsedOptions;this.ensureDefault();const t=e.find((e=>e.value===this.selectedValue));if("align"===this.type){const i=t?.icon?_`<nile-icon name="${t.icon}" color=${this.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))"} size="20"></nile-icon>`:this.label||"Align";return _`
17126
17275
  <nile-dropdown ?disabled=${this.disabled} class="rte-align-dd">
17127
17276
  <nile-button
17128
17277
  slot="trigger"
@@ -17188,7 +17337,7 @@ nile-badge::part(content) {
17188
17337
  `))}
17189
17338
  </nile-menu>
17190
17339
  </nile-dropdown>
17191
- `}};e([ue({type:String,attribute:!0,reflect:!0})],xS.prototype,"type",void 0),e([ue({type:String,attribute:!0,reflect:!0})],xS.prototype,"options",void 0),e([ue({attribute:!1})],xS.prototype,"optionsObj",void 0),e([ue({type:String,attribute:!0,reflect:!0})],xS.prototype,"label",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],xS.prototype,"disabled",void 0),e([De()],xS.prototype,"selectedValue",void 0),xS=e([ge("nile-rte-select")],xS);let LS=class extends ae{constructor(){super(...arguments),this.mode="foreColor",this.label="Text Color",this.value="#000000",this.palette=["#000000","#444444","#666666","#999999","#cccccc","#eeeeee","#ffffff","#d32f2f","#f44336","#ff9800","#ffeb3b","#4caf50","#2196f3","#3f51b5","#9c27b0","#03a9f4","#00bcd4","#009688","#8bc34a","#cddc39","#ffc107","#ff5722"],this.recentColors=[],this.pickCustom=()=>this.inputEl.click()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.injectCss("\n nile-button.rte-color-trigger::part(base){\n width:32px; height:32px; padding:0px 6px;\n }\n\n .glyph-stack { display:grid; align-items:center; justify-items:center; line-height:1; }\n .glyph { font-size:14px; margin-bottom:2px; }\n .underline { width:18px; height:3px; border-radius:2px; }\n .swatch-box { width:18px; height:16px; border-radius:4px; border:1px solid rgba(0,0,0,0.35); }\n\n nile-popover::part(popover) {\n min-width: 225px;\n height: 250px;\n padding: 0px;\n gap: 0px;\n }\n\n .swatch-dropdown {\n height: 245px;\n width: 275px;\n padding: 12px;\n background: #fff;\n border-radius: 8px;\n box-sizing: border-box;\n overflow-y: auto;\n }\n\n .section { margin-bottom: 12px; }\n .title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color:#111; }\n\n .swatches {\n display: grid;\n grid-template-columns: repeat(auto-fill, 24px);\n gap: 8px;\n }\n\n .swatch {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n border: 1px solid rgba(0,0,0,0.25);\n cursor: pointer;\n position: relative;\n background-clip: content-box;\n }\n\n .swatch.add {\n display:flex;\n align-items:center;\n justify-content:center;\n font-weight:bold;\n font-size:16px;\n background:#fff;\n }\n\n .checkmark {\n position: absolute;\n top: 50%; left: 50%;\n transform: translate(-50%,-50%);\n font-size: 13px;\n color: white;\n text-shadow: 0 0 2px rgba(0,0,0,0.6);\n }\n "),this.inputEl=document.createElement("input"),this.inputEl.type="color",this.inputEl.style.position="absolute",this.inputEl.style.opacity="0",this.inputEl.style.pointerEvents="none",this.inputEl.value=this.value,this.appendChild(this.inputEl),this.inputEl.addEventListener("input",(()=>this.setColor(this.inputEl.value)))}injectCss(e){if(this.querySelector("style[data-rte-color-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-color-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}setColor(e){this.value=e,this.recentColors=[e,...this.recentColors.filter((t=>t!==e))].slice(0,8),this.dispatchEvent(new CustomEvent("change",{detail:{mode:this.mode,value:e},bubbles:!0,composed:!0}))}render(){return _`
17340
+ `}};e([ue({type:String,attribute:!0,reflect:!0})],LS.prototype,"type",void 0),e([ue({type:String,attribute:!0,reflect:!0})],LS.prototype,"options",void 0),e([ue({attribute:!1})],LS.prototype,"optionsObj",void 0),e([ue({type:String,attribute:!0,reflect:!0})],LS.prototype,"label",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],LS.prototype,"disabled",void 0),e([De()],LS.prototype,"selectedValue",void 0),LS=e([ge("nile-rte-select")],LS);let mS=class extends ae{constructor(){super(...arguments),this.mode="foreColor",this.label="Text Color",this.value="#000000",this.palette=["#000000","#444444","#666666","#999999","#cccccc","#eeeeee","#ffffff","#d32f2f","#f44336","#ff9800","#ffeb3b","#4caf50","#2196f3","#3f51b5","#9c27b0","#03a9f4","#00bcd4","#009688","#8bc34a","#cddc39","#ffc107","#ff5722"],this.recentColors=[],this.pickCustom=()=>this.inputEl.click()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.injectCss("\n nile-button.rte-color-trigger::part(base){\n width:32px; height:32px; padding:0px 6px;\n }\n\n .glyph-stack { display:grid; align-items:center; justify-items:center; line-height:1; }\n .glyph { font-size:14px; margin-bottom:2px; }\n .underline { width:18px; height:3px; border-radius:2px; }\n .swatch-box { width:18px; height:16px; border-radius:4px; border:1px solid rgba(0,0,0,0.35); }\n\n nile-popover::part(popover) {\n min-width: 225px;\n height: 250px;\n padding: 0px;\n gap: 0px;\n }\n\n .swatch-dropdown {\n height: 245px;\n width: 275px;\n padding: 12px;\n background: #fff;\n border-radius: 8px;\n box-sizing: border-box;\n overflow-y: auto;\n }\n\n .section { margin-bottom: 12px; }\n .title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color:#111; }\n\n .swatches {\n display: grid;\n grid-template-columns: repeat(auto-fill, 24px);\n gap: 8px;\n }\n\n .swatch {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n border: 1px solid rgba(0,0,0,0.25);\n cursor: pointer;\n position: relative;\n background-clip: content-box;\n }\n\n .swatch.add {\n display:flex;\n align-items:center;\n justify-content:center;\n font-weight:bold;\n font-size:16px;\n background:#fff;\n }\n\n .checkmark {\n position: absolute;\n top: 50%; left: 50%;\n transform: translate(-50%,-50%);\n font-size: 13px;\n color: white;\n text-shadow: 0 0 2px rgba(0,0,0,0.6);\n }\n "),this.inputEl=document.createElement("input"),this.inputEl.type="color",this.inputEl.style.position="absolute",this.inputEl.style.opacity="0",this.inputEl.style.pointerEvents="none",this.inputEl.value=this.value,this.appendChild(this.inputEl),this.inputEl.addEventListener("input",(()=>this.setColor(this.inputEl.value)))}injectCss(e){if(this.querySelector("style[data-rte-color-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-color-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}setColor(e){this.value=e,this.recentColors=[e,...this.recentColors.filter((t=>t!==e))].slice(0,8),this.dispatchEvent(new CustomEvent("change",{detail:{mode:this.mode,value:e},bubbles:!0,composed:!0}))}render(){return _`
17192
17341
  <nile-popover placement="bottom-start" distance="6" .arrow=${!1}>
17193
17342
  <nile-button
17194
17343
  slot="anchor"
@@ -17240,7 +17389,7 @@ nile-badge::part(content) {
17240
17389
  </div>
17241
17390
  </div>
17242
17391
  </nile-popover>
17243
- `}};e([ue({type:String,attribute:!0,reflect:!0})],LS.prototype,"mode",void 0),e([ue({type:String,attribute:!0,reflect:!0})],LS.prototype,"label",void 0),e([ue({type:String,attribute:!0,reflect:!0})],LS.prototype,"value",void 0),e([ue({type:Array,attribute:!0,reflect:!0})],LS.prototype,"palette",void 0),e([De()],LS.prototype,"recentColors",void 0),LS=e([ge("nile-rte-color")],LS);let mS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};mS=e([ge("nile-rte-divider")],mS);let SS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};SS=e([ge("nile-rte-preview")],SS);let wS=class extends ae{constructor(){super(...arguments),this.displayFormat=!1,this.mentions={},this.mentionFormat={},this.itemsFormats={},this.mentionColors={},this.externalConfig={},this.itemsConfig={},this.mentionActiveIndex=-1,this.itemsColors={},this.editorEl=null,this.hostEl=null,this.dropdownEl=null,this.menuEl=null,this.lastRange=null,this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionSuggestions=[],this.mentionFiltered=[],this.mentionX=0,this.mentionY=0,this.triggerBtn=null,this.mo=null,this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange())},this.saveSelection=()=>{const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())},this.onEditorInput=()=>{if(this.mentionOpen)return void this.handleMention();const e=window.getSelection();if(!e||!e.anchorNode)return;let t=e.anchorNode;if(t.nodeType!==Node.TEXT_NODE&&t.firstChild?.nodeType===Node.TEXT_NODE&&(t=t.firstChild),!t||t.nodeType!==Node.TEXT_NODE)return;const i=t.textContent||"",n=this.config;for(const t of Object.keys(n)){const n=i.lastIndexOf(t);if(-1!==n){const i=e.focusOffset;if(i>=n+t.length&&i<=n+t.length+1)return void this.openMention(t)}}},this.onEditorKeyUp=e=>{this.saveSelection();const t=e.key,i=this.config;if(t&&i[t])return this.mentionOpen&&this.mentionTrigger!==t&&this.closeMention(),void this.openMention(t);this.mentionOpen&&this.handleMention()},this.onEditorKeyDown=e=>{if(!this.mentionOpen)return;const t=e.key;if("ArrowDown"===t||"ArrowUp"===t){if(e.preventDefault(),!this.mentionFiltered.length)return;this.mentionActiveIndex="ArrowDown"===t?(this.mentionActiveIndex+1)%this.mentionFiltered.length:(this.mentionActiveIndex-1+this.mentionFiltered.length)%this.mentionFiltered.length,this.renderMentionList()}else"Enter"===t?this.mentionActiveIndex>=0&&this.mentionFiltered[this.mentionActiveIndex]&&(e.preventDefault(),this.selectMention(this.mentionFiltered[this.mentionActiveIndex])):"Escape"===t&&(e.preventDefault(),this.closeMention())},this.repositionMention=()=>{if(!this.mentionOpen||!this.hostEl||!this.triggerBtn)return;const e=this.getCaretClientRect();if(!e)return;const t=this.hostEl.getBoundingClientRect();this.mentionX=e.left-t.left,this.mentionY=e.bottom-t.top,this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`}}createRenderRoot(){return this}getTriggerFormat(e){const t=this.itemsFormats[e]||{},i=this.mentionFormat[e]||{};return{prefix:t.prefix??i.prefix??"",suffix:t.suffix??i.suffix??""}}formatLabel(e,t){const{prefix:i,suffix:n}=this.getTriggerFormat(e);return`${i??""}${t}${n??""}`}get config(){return{...this.externalConfig,...this.mentions,...this.itemsConfig}}attach(e,t){this.editorEl=e,this.hostEl=t,this.injectStyles(),this.ensureMentionDropdown(),this.rebuildConfigFromChildren(),this.mo=new MutationObserver((()=>this.rebuildConfigFromChildren())),this.mo.observe(this,{childList:!0,subtree:!0,attributes:!0}),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.saveSelection),this.editorEl.addEventListener("keyup",this.onEditorKeyUp),this.editorEl.addEventListener("keydown",this.onEditorKeyDown),this.editorEl.addEventListener("scroll",this.repositionMention),document.addEventListener("selectionchange",this.onSelectionChange,!0)}detach(){this.mo&&(this.mo.disconnect(),this.mo=null),this.editorEl&&(this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.saveSelection),this.editorEl.removeEventListener("keyup",this.onEditorKeyUp),this.editorEl.removeEventListener("keydown",this.onEditorKeyDown),this.editorEl.removeEventListener("scroll",this.repositionMention)),document.removeEventListener("selectionchange",this.onSelectionChange,!0)}setExternalConfig(e){this.externalConfig=e||{}}disconnectedCallback(){this.detach(),super.disconnectedCallback()}rebuildConfigFromChildren(){const e={},t={},i={},n=Array.from(this.querySelectorAll("nile-rte-mentions-item"));for(const o of n){const n=o.mentionsCharacter??o.getAttribute("mentionscharacter")??"";if(!n||"string"!=typeof n)continue;let M=o.mentionsData??(()=>{const e=o.getAttribute("mentionsdata");if(!e)return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)):[]}catch{return[]}})();const r=o.mentionsColor??o.getAttribute("mentionscolor")??"",s=o.mentionsPrefix??o.getAttribute("mentionsprefix")??"",a=o.mentionsSuffix??o.getAttribute("mentionssuffix")??"";Array.isArray(M)||(M=[]),e[n]=M,r&&(t[n]=String(r)),(s||a)&&(i[n]={prefix:s,suffix:a})}this.itemsConfig=e,this.itemsColors=t,this.itemsFormats=i}injectStyles(){if(this.querySelector("style[data-mentions-style]"))return;const e=document.createElement("style");e.setAttribute("data-mentions-style","true"),e.textContent="\n .mention-dropdown {\n position: absolute; z-index: 1000; list-style: none; margin: 0; padding: 4px;\n border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;\n box-shadow: 0 4px 10px rgba(0,0,0,.08); max-height: 180px; overflow: auto; font-size: 14px;\n }\n .mention-dropdown li { padding: 6px 8px; cursor: pointer; border-radius: 4px; }\n .mention-dropdown li:hover { background: #f1f5f9; }\n .mention { background: #eef2ff; padding: 0 3px; border-radius: 3px; }\n nile-menu.mentions-menu::part(menu__items-wrapper){\n max-height: 260px;\n overflow-y: auto;\n }\n .mentions-menu nile-menu-item.active {\n background: #dbeafe; /* highlight */\n outline: none;\n}\n\n\n ",this.insertBefore(e,this.firstChild)}getTriggerColor(e){return this.itemsColors[e]??this.mentionColors[e]}ensureMentionDropdown(){if(this.dropdownEl||!this.hostEl)return;const e=document.createElement("nile-dropdown");e.style.zIndex="1000";const t=document.createElement("nile-button");t.setAttribute("slot","trigger"),t.style.position="absolute",t.style.width="1px",t.style.height="1px",t.style.border="0",t.style.padding="0",t.style.opacity="0",t.style.pointerEvents="none",e.appendChild(t),this.triggerBtn=t;const i=document.createElement("nile-menu");i.classList.add("mentions-menu"),e.appendChild(i),this.hostEl.appendChild(e),this.dropdownEl=e,this.menuEl=i}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}getCaretClientRect(){const e=document.getSelection();if(!e||0===e.rangeCount)return null;const t=e.getRangeAt(0).cloneRange();t.collapse(!1);const i=t.getClientRects();if(i&&i.length>0)return i[0];const n=document.createElement("span");n.setAttribute("data-caret-marker","1"),n.textContent="​",t.insertNode(n);const o=n.getBoundingClientRect(),M=document.createRange();return M.setStartAfter(n),M.collapse(!0),e.removeAllRanges(),e.addRange(M),n.remove(),o||null}openMention(e){if(this.saveSelection(),!this.editorEl||!this.dropdownEl||!this.hostEl)return;const t=this.getCaretClientRect();if(!t)return;const i=this.hostEl.getBoundingClientRect();this.mentionX=t.left-i.left,this.mentionY=t.bottom-i.top,this.mentionTrigger=e,this.mentionSuggestions=this.config[e]||[],this.mentionQuery="",this.updateMentionFiltered(),this.mentionActiveIndex=this.mentionFiltered.length?0:-1,this.mentionOpen=!0,this.renderMentionList(),this.dispatchEvent(new CustomEvent("nile-mention-opened",{detail:{trigger:e,suggestions:this.mentionSuggestions},bubbles:!0,composed:!0}))}closeMention(){this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionFiltered=[],this.dropdownEl?.removeAttribute("open")}handleMention(){if(!this.mentionOpen||!this.mentionTrigger)return;const e=window.getSelection();if(!e||!e.anchorNode)return;let t=e.anchorNode;if(t.nodeType!==Node.TEXT_NODE){const i=t.childNodes?.[e.anchorOffset]||t.firstChild;i?.nodeType===Node.TEXT_NODE&&(t=i)}const i=t&&t.nodeType===Node.TEXT_NODE&&t.textContent||"",n=i.lastIndexOf(this.mentionTrigger);n>=0?(this.mentionQuery=i.substring(n+1),this.updateMentionFiltered(),this.renderMentionList()):this.closeMention()}updateMentionFiltered(){const e=this.mentionQuery.toLowerCase();this.mentionFiltered=(this.mentionSuggestions||[]).filter((t=>t.label.toLowerCase().startsWith(e)))}renderMentionList(){this.dropdownEl&&this.menuEl&&this.triggerBtn&&(this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`,this.menuEl.innerHTML="",this.mentionOpen&&this.mentionFiltered.length?(this.mentionFiltered.forEach(((e,t)=>{const i=document.createElement("nile-menu-item");i.textContent=e.label,i.setAttribute("role","option"),t===this.mentionActiveIndex?(i.classList.add("active"),i.setAttribute("aria-selected","true")):(i.classList.remove("active"),i.removeAttribute("aria-selected")),i.addEventListener("mouseenter",(()=>{this.mentionActiveIndex=t,this.renderMentionList()})),i.addEventListener("pointerdown",(t=>{t.preventDefault(),this.selectMention(e)})),this.menuEl?.appendChild(i)})),this.dropdownEl.setAttribute("open","")):this.dropdownEl.removeAttribute("open"))}selectMention(e){if(this.restoreSelection(),!this.lastRange||!this.mentionTrigger||!this.editorEl)return;const t=this.mentionTrigger;let i=this.lastRange.startContainer,n=this.lastRange.startOffset;if(i.nodeType!==Node.TEXT_NODE){const e=i.childNodes[n];if(e?.nodeType!==Node.TEXT_NODE)return;i=e,n=0}const o=i,M=(o.textContent||"").lastIndexOf(this.mentionTrigger,n);if(M<0)return;const r=M+1+this.mentionQuery.length,s=document.createRange();s.setStart(o,M),s.setEnd(o,r),s.deleteContents();const a=document.createElement("span");a.classList.add("mention");const l=this.getTriggerFormat(this.mentionTrigger);this.displayFormat?a.textContent=`${l.prefix??""}${e.label}${l.suffix??""}`:(a.textContent=`${this.mentionTrigger}${e.label}`,l.prefix&&a.setAttribute("data-mention-prefix",l.prefix),l.suffix&&a.setAttribute("data-mention-suffix",l.suffix)),a.setAttribute("data-mention-key",e.key),a.setAttribute("data-mention-label",e.label),a.setAttribute("data-mention-trigger",this.mentionTrigger);const g=this.getTriggerColor(this.mentionTrigger);g&&(a.style.backgroundColor=g),s.insertNode(a);const N=document.createTextNode(" ");a.after(N);const c=window.getSelection(),u=document.createRange();u.setStartAfter(N),u.collapse(!0),c?.removeAllRanges(),c?.addRange(u),this.lastRange=u.cloneRange(),this.closeMention(),this.dispatchEvent(new CustomEvent("nile-mention-selected",{detail:{trigger:t,key:e.key,label:e.label,prefix:l.prefix??"",suffix:l.suffix??""},bubbles:!0,composed:!0})),this.editorEl.dispatchEvent(new InputEvent("input",{bubbles:!0}))}};e([ue({type:Boolean,attribute:"displayformat",reflect:!0})],wS.prototype,"displayFormat",void 0),e([ue({attribute:"mentions",converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const n=t[e];Array.isArray(n)&&(i[e]=n.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],wS.prototype,"mentions",void 0),e([ue({attribute:"mentionformat",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},toAttribute:e=>JSON.stringify(e??{})}})],wS.prototype,"mentionFormat",void 0),e([De()],wS.prototype,"itemsFormats",void 0),e([ue({attribute:"mentioncolors",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},toAttribute:e=>JSON.stringify(e??{})}})],wS.prototype,"mentionColors",void 0),e([De()],wS.prototype,"externalConfig",void 0),e([De()],wS.prototype,"itemsConfig",void 0),e([De()],wS.prototype,"mentionActiveIndex",void 0),e([De()],wS.prototype,"itemsColors",void 0),wS=e([ge("nile-rte-mentions")],wS);let ES=class extends ae{constructor(){super(...arguments),this.newTab=!1,this.disabled=!1,this.showTextSupport=!1,this.placeholder="Type or paste link here",this.textPlaceholder="Display text",this.label="Link",this.linkValue="",this.textValue="",this.hasActiveLink=!1,this.popoverStyle="",this.selectionRange=null,this.activeAnchor=null,this.ignoreBlur=!1,this.isApplying=!1,this.onScroll=()=>{this.closePopover()},this.onOpen=()=>{if(this.disabled)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;if(!this.editorEl.contains(e.getRangeAt(0).commonAncestorContainer))return;this.selectionRange=e.getRangeAt(0).cloneRange(),this.activeAnchor=null,this.hasActiveLink=!1;let t=this.selectionRange.startContainer;for(;t&&t!==this.editorEl;){if(t instanceof HTMLAnchorElement){this.activeAnchor=t,this.hasActiveLink=!0;break}t=t.parentNode}this.linkValue=this.activeAnchor?this.displayUrl(this.activeAnchor.href):"",this.showTextSupport&&(this.activeAnchor?this.textValue=this.activeAnchor.textContent||"":this.selectionRange.collapsed?this.textValue="":this.textValue=this.selectionRange.toString()),this.positionPopover(),this.openPopover(),requestAnimationFrame((()=>{const e=this.querySelectorAll("nile-input"),t=e.length>1?e[1]:e[0];t?.focus()}))},this.onInputKeydown=e=>{if("Escape"===e.key||"Enter"===e.key)if(e.preventDefault(),e.stopPropagation(),"Escape"!==e.key){this.isApplying=!0;try{this.applyLink()}finally{this.isApplying=!1}}else this.closePopover()},this.onInputBlur=()=>{this.ignoreBlur||this.isApplying||requestAnimationFrame((()=>{if(this.ignoreBlur||this.isApplying)return;const e=this.querySelector("nile-popover");e?.matches(":focus-within")||this.closePopover()}))},this.onLinkInput=e=>{this.linkValue=e.detail.value},this.onTextInput=e=>{this.textValue=e.detail.value},this.onPopoverMousedown=()=>{this.ignoreBlur=!0},this.onPopoverMouseup=()=>{this.ignoreBlur=!1},this.onToolbarButtonMousedown=e=>{e.preventDefault()},this.onActionMousedown=e=>{e.preventDefault(),this.ignoreBlur=!0},this.onApplyClick=()=>{this.isApplying=!0,this.applyLink(),this.isApplying=!1,this.ignoreBlur=!1},this.onUnlinkClick=()=>{this.isApplying=!0,this.onRemove(),this.isApplying=!1,this.ignoreBlur=!1}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.injectCss("\n nile-popover.rte-link-popover::part(popover) {\n min-width: 340px;\n max-width: 420px;\n background: white;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-componentcolors-utility-gray-400));\n border-radius: 8px;\n padding: 0;\n gap: 0;\n overflow: hidden;\n height: auto;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);\n }\n\n .link-popup-wrap {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 12px;\n }\n\n .link-popup-wrap nile-input {\n width: 100%;\n }\n\n .link-popup-wrap .link-input-row {\n width: 100%;\n }\n\n .link-popup-wrap .link-actions-row {\n display: flex;\n align-items: flex-end;\n gap: 4px;\n width: 100%;\n }\n\n .link-popup-wrap .link-actions-row nile-input {\n flex: 1;\n min-width: 0;\n }\n\n \n nile-button.rte-link-button::part(base) {\n border: none;\n height: 32px;\n width: 32px;\n }\n nile-button.rte-edit-button::part(base) {\n border: none;\n height: 32px;\n width: 32px;\n flex-shrink: 0;\n }\n ")}injectCss(e){if(this.querySelector("style[data-rte-link-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-link-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}normalizeUrl(e){return/^(https?:|mailto:|tel:)/i.test(e)?e:`https://${e}`}displayUrl(e){return e}getSelectionRect(){if(!this.selectionRange)return null;let e=this.selectionRange.getBoundingClientRect();if(0===e.width&&0===e.height){const t=document.createElement("span");t.textContent="​";this.selectionRange.cloneRange().insertNode(t),e=t.getBoundingClientRect(),t.remove()}return e}positionPopover(){const e=this.getSelectionRect();e&&(this.popoverStyle=`\n position: fixed;\n top: ${e.bottom+8}px;\n left: ${e.left+e.width/2}px;\n transform: translateX(-50%);\n z-index: 1000;\n `)}openPopover(){requestAnimationFrame((()=>{const e=this.querySelector("nile-popover");e&&(e.isShow=!0),window.addEventListener("scroll",this.onScroll,!0)}))}closePopover(){const e=this.querySelector("nile-popover");e&&(e.isShow=!1),window.removeEventListener("scroll",this.onScroll,!0),this.linkValue="",this.textValue="",this.selectionRange=null,this.activeAnchor=null,this.hasActiveLink=!1,this.popoverStyle=""}unwrapLink(e){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}applyLink(){if(!(this.selectionRange instanceof Range))return;let e=this.linkValue.trim();if(!e)return;if(/^javascript:/i.test(e))return;/^(https?:\/\/|mailto:|tel:|\/)/i.test(e)||(e=`https://${e}`),this.editorEl.focus();const t=document.getSelection();if(!t)return;t.removeAllRanges(),t.addRange(this.selectionRange);const i=this.showTextSupport&&this.textValue.trim()?this.textValue.trim():"";if(this.activeAnchor)this.activeAnchor.href=e,i&&(this.activeAnchor.textContent=i),this.newTab?(this.activeAnchor.target="_blank",this.activeAnchor.rel="noopener noreferrer"):(this.activeAnchor.removeAttribute("target"),this.activeAnchor.removeAttribute("rel"));else{const t=document.createElement("a");if(t.href=e,this.newTab?(t.target="_blank",t.rel="noopener noreferrer"):(t.removeAttribute("target"),t.removeAttribute("rel")),i)this.selectionRange.deleteContents(),t.textContent=i,this.selectionRange.insertNode(t);else if(this.selectionRange.collapsed)t.textContent=e,this.selectionRange.insertNode(t);else try{this.selectionRange.surroundContents(t)}catch{const e=this.selectionRange.extractContents();t.appendChild(e),this.selectionRange.insertNode(t)}}this.emit(e),this.closePopover()}onRemove(){this.activeAnchor&&(this.unwrapLink(this.activeAnchor),this.emit(""),this.closePopover())}emit(e){this.dispatchEvent(new CustomEvent("nile-link-changed",{detail:{href:e},bubbles:!0,composed:!0}))}render(){const e=this.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))";return _`
17392
+ `}};e([ue({type:String,attribute:!0,reflect:!0})],mS.prototype,"mode",void 0),e([ue({type:String,attribute:!0,reflect:!0})],mS.prototype,"label",void 0),e([ue({type:String,attribute:!0,reflect:!0})],mS.prototype,"value",void 0),e([ue({type:Array,attribute:!0,reflect:!0})],mS.prototype,"palette",void 0),e([De()],mS.prototype,"recentColors",void 0),mS=e([ge("nile-rte-color")],mS);let SS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};SS=e([ge("nile-rte-divider")],SS);let wS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};wS=e([ge("nile-rte-preview")],wS);let ES=class extends ae{constructor(){super(...arguments),this.displayFormat=!1,this.mentions={},this.mentionFormat={},this.itemsFormats={},this.mentionColors={},this.externalConfig={},this.itemsConfig={},this.mentionActiveIndex=-1,this.itemsColors={},this.editorEl=null,this.hostEl=null,this.dropdownEl=null,this.menuEl=null,this.lastRange=null,this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionSuggestions=[],this.mentionFiltered=[],this.mentionX=0,this.mentionY=0,this.triggerBtn=null,this.mo=null,this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange())},this.saveSelection=()=>{const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())},this.onEditorInput=()=>{if(this.mentionOpen)return void this.handleMention();const e=window.getSelection();if(!e||!e.anchorNode)return;let t=e.anchorNode;if(t.nodeType!==Node.TEXT_NODE&&t.firstChild?.nodeType===Node.TEXT_NODE&&(t=t.firstChild),!t||t.nodeType!==Node.TEXT_NODE)return;const i=t.textContent||"",n=this.config;for(const t of Object.keys(n)){const n=i.lastIndexOf(t);if(-1!==n){const i=e.focusOffset;if(i>=n+t.length&&i<=n+t.length+1)return void this.openMention(t)}}},this.onEditorKeyUp=e=>{this.saveSelection();const t=e.key,i=this.config;if(t&&i[t])return this.mentionOpen&&this.mentionTrigger!==t&&this.closeMention(),void this.openMention(t);this.mentionOpen&&this.handleMention()},this.onEditorKeyDown=e=>{if(!this.mentionOpen)return;const t=e.key;if("ArrowDown"===t||"ArrowUp"===t){if(e.preventDefault(),!this.mentionFiltered.length)return;this.mentionActiveIndex="ArrowDown"===t?(this.mentionActiveIndex+1)%this.mentionFiltered.length:(this.mentionActiveIndex-1+this.mentionFiltered.length)%this.mentionFiltered.length,this.renderMentionList()}else"Enter"===t?this.mentionActiveIndex>=0&&this.mentionFiltered[this.mentionActiveIndex]&&(e.preventDefault(),this.selectMention(this.mentionFiltered[this.mentionActiveIndex])):"Escape"===t&&(e.preventDefault(),this.closeMention())},this.repositionMention=()=>{if(!this.mentionOpen||!this.hostEl||!this.triggerBtn)return;const e=this.getCaretClientRect();if(!e)return;const t=this.hostEl.getBoundingClientRect();this.mentionX=e.left-t.left,this.mentionY=e.bottom-t.top,this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`}}createRenderRoot(){return this}getTriggerFormat(e){const t=this.itemsFormats[e]||{},i=this.mentionFormat[e]||{};return{prefix:t.prefix??i.prefix??"",suffix:t.suffix??i.suffix??""}}formatLabel(e,t){const{prefix:i,suffix:n}=this.getTriggerFormat(e);return`${i??""}${t}${n??""}`}get config(){return{...this.externalConfig,...this.mentions,...this.itemsConfig}}attach(e,t){this.editorEl=e,this.hostEl=t,this.injectStyles(),this.ensureMentionDropdown(),this.rebuildConfigFromChildren(),this.mo=new MutationObserver((()=>this.rebuildConfigFromChildren())),this.mo.observe(this,{childList:!0,subtree:!0,attributes:!0}),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.saveSelection),this.editorEl.addEventListener("keyup",this.onEditorKeyUp),this.editorEl.addEventListener("keydown",this.onEditorKeyDown),this.editorEl.addEventListener("scroll",this.repositionMention),document.addEventListener("selectionchange",this.onSelectionChange,!0)}detach(){this.mo&&(this.mo.disconnect(),this.mo=null),this.editorEl&&(this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.saveSelection),this.editorEl.removeEventListener("keyup",this.onEditorKeyUp),this.editorEl.removeEventListener("keydown",this.onEditorKeyDown),this.editorEl.removeEventListener("scroll",this.repositionMention)),document.removeEventListener("selectionchange",this.onSelectionChange,!0)}setExternalConfig(e){this.externalConfig=e||{}}disconnectedCallback(){this.detach(),super.disconnectedCallback()}rebuildConfigFromChildren(){const e={},t={},i={},n=Array.from(this.querySelectorAll("nile-rte-mentions-item"));for(const o of n){const n=o.mentionsCharacter??o.getAttribute("mentionscharacter")??"";if(!n||"string"!=typeof n)continue;let M=o.mentionsData??(()=>{const e=o.getAttribute("mentionsdata");if(!e)return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)):[]}catch{return[]}})();const r=o.mentionsColor??o.getAttribute("mentionscolor")??"",s=o.mentionsPrefix??o.getAttribute("mentionsprefix")??"",a=o.mentionsSuffix??o.getAttribute("mentionssuffix")??"";Array.isArray(M)||(M=[]),e[n]=M,r&&(t[n]=String(r)),(s||a)&&(i[n]={prefix:s,suffix:a})}this.itemsConfig=e,this.itemsColors=t,this.itemsFormats=i}injectStyles(){if(this.querySelector("style[data-mentions-style]"))return;const e=document.createElement("style");e.setAttribute("data-mentions-style","true"),e.textContent="\n .mention-dropdown {\n position: absolute; z-index: 1000; list-style: none; margin: 0; padding: 4px;\n border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;\n box-shadow: 0 4px 10px rgba(0,0,0,.08); max-height: 180px; overflow: auto; font-size: 14px;\n }\n .mention-dropdown li { padding: 6px 8px; cursor: pointer; border-radius: 4px; }\n .mention-dropdown li:hover { background: #f1f5f9; }\n .mention { background: #eef2ff; padding: 0 3px; border-radius: 3px; }\n nile-menu.mentions-menu::part(menu__items-wrapper){\n max-height: 260px;\n overflow-y: auto;\n }\n .mentions-menu nile-menu-item.active {\n background: #dbeafe; /* highlight */\n outline: none;\n}\n\n\n ",this.insertBefore(e,this.firstChild)}getTriggerColor(e){return this.itemsColors[e]??this.mentionColors[e]}ensureMentionDropdown(){if(this.dropdownEl||!this.hostEl)return;const e=document.createElement("nile-dropdown");e.style.zIndex="1000";const t=document.createElement("nile-button");t.setAttribute("slot","trigger"),t.style.position="absolute",t.style.width="1px",t.style.height="1px",t.style.border="0",t.style.padding="0",t.style.opacity="0",t.style.pointerEvents="none",e.appendChild(t),this.triggerBtn=t;const i=document.createElement("nile-menu");i.classList.add("mentions-menu"),e.appendChild(i),this.hostEl.appendChild(e),this.dropdownEl=e,this.menuEl=i}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}getCaretClientRect(){const e=document.getSelection();if(!e||0===e.rangeCount)return null;const t=e.getRangeAt(0).cloneRange();t.collapse(!1);const i=t.getClientRects();if(i&&i.length>0)return i[0];const n=document.createElement("span");n.setAttribute("data-caret-marker","1"),n.textContent="​",t.insertNode(n);const o=n.getBoundingClientRect(),M=document.createRange();return M.setStartAfter(n),M.collapse(!0),e.removeAllRanges(),e.addRange(M),n.remove(),o||null}openMention(e){if(this.saveSelection(),!this.editorEl||!this.dropdownEl||!this.hostEl)return;const t=this.getCaretClientRect();if(!t)return;const i=this.hostEl.getBoundingClientRect();this.mentionX=t.left-i.left,this.mentionY=t.bottom-i.top,this.mentionTrigger=e,this.mentionSuggestions=this.config[e]||[],this.mentionQuery="",this.updateMentionFiltered(),this.mentionActiveIndex=this.mentionFiltered.length?0:-1,this.mentionOpen=!0,this.renderMentionList(),this.dispatchEvent(new CustomEvent("nile-mention-opened",{detail:{trigger:e,suggestions:this.mentionSuggestions},bubbles:!0,composed:!0}))}closeMention(){this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionFiltered=[],this.dropdownEl?.removeAttribute("open")}handleMention(){if(!this.mentionOpen||!this.mentionTrigger)return;const e=window.getSelection();if(!e||!e.anchorNode)return;let t=e.anchorNode;if(t.nodeType!==Node.TEXT_NODE){const i=t.childNodes?.[e.anchorOffset]||t.firstChild;i?.nodeType===Node.TEXT_NODE&&(t=i)}const i=t&&t.nodeType===Node.TEXT_NODE&&t.textContent||"",n=i.lastIndexOf(this.mentionTrigger);n>=0?(this.mentionQuery=i.substring(n+1),this.updateMentionFiltered(),this.renderMentionList()):this.closeMention()}updateMentionFiltered(){const e=this.mentionQuery.toLowerCase();this.mentionFiltered=(this.mentionSuggestions||[]).filter((t=>t.label.toLowerCase().startsWith(e)))}renderMentionList(){this.dropdownEl&&this.menuEl&&this.triggerBtn&&(this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`,this.menuEl.innerHTML="",this.mentionOpen&&this.mentionFiltered.length?(this.mentionFiltered.forEach(((e,t)=>{const i=document.createElement("nile-menu-item");i.textContent=e.label,i.setAttribute("role","option"),t===this.mentionActiveIndex?(i.classList.add("active"),i.setAttribute("aria-selected","true")):(i.classList.remove("active"),i.removeAttribute("aria-selected")),i.addEventListener("mouseenter",(()=>{this.mentionActiveIndex=t,this.renderMentionList()})),i.addEventListener("pointerdown",(t=>{t.preventDefault(),this.selectMention(e)})),this.menuEl?.appendChild(i)})),this.dropdownEl.setAttribute("open","")):this.dropdownEl.removeAttribute("open"))}selectMention(e){if(this.restoreSelection(),!this.lastRange||!this.mentionTrigger||!this.editorEl)return;const t=this.mentionTrigger;let i=this.lastRange.startContainer,n=this.lastRange.startOffset;if(i.nodeType!==Node.TEXT_NODE){const e=i.childNodes[n];if(e?.nodeType!==Node.TEXT_NODE)return;i=e,n=0}const o=i,M=(o.textContent||"").lastIndexOf(this.mentionTrigger,n);if(M<0)return;const r=M+1+this.mentionQuery.length,s=document.createRange();s.setStart(o,M),s.setEnd(o,r),s.deleteContents();const a=document.createElement("span");a.classList.add("mention");const l=this.getTriggerFormat(this.mentionTrigger);this.displayFormat?a.textContent=`${l.prefix??""}${e.label}${l.suffix??""}`:(a.textContent=`${this.mentionTrigger}${e.label}`,l.prefix&&a.setAttribute("data-mention-prefix",l.prefix),l.suffix&&a.setAttribute("data-mention-suffix",l.suffix)),a.setAttribute("data-mention-key",e.key),a.setAttribute("data-mention-label",e.label),a.setAttribute("data-mention-trigger",this.mentionTrigger);const g=this.getTriggerColor(this.mentionTrigger);g&&(a.style.backgroundColor=g),s.insertNode(a);const N=document.createTextNode(" ");a.after(N);const c=window.getSelection(),u=document.createRange();u.setStartAfter(N),u.collapse(!0),c?.removeAllRanges(),c?.addRange(u),this.lastRange=u.cloneRange(),this.closeMention(),this.dispatchEvent(new CustomEvent("nile-mention-selected",{detail:{trigger:t,key:e.key,label:e.label,prefix:l.prefix??"",suffix:l.suffix??""},bubbles:!0,composed:!0})),this.editorEl.dispatchEvent(new InputEvent("input",{bubbles:!0}))}};e([ue({type:Boolean,attribute:"displayformat",reflect:!0})],ES.prototype,"displayFormat",void 0),e([ue({attribute:"mentions",converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const n=t[e];Array.isArray(n)&&(i[e]=n.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],ES.prototype,"mentions",void 0),e([ue({attribute:"mentionformat",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},toAttribute:e=>JSON.stringify(e??{})}})],ES.prototype,"mentionFormat",void 0),e([De()],ES.prototype,"itemsFormats",void 0),e([ue({attribute:"mentioncolors",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},toAttribute:e=>JSON.stringify(e??{})}})],ES.prototype,"mentionColors",void 0),e([De()],ES.prototype,"externalConfig",void 0),e([De()],ES.prototype,"itemsConfig",void 0),e([De()],ES.prototype,"mentionActiveIndex",void 0),e([De()],ES.prototype,"itemsColors",void 0),ES=e([ge("nile-rte-mentions")],ES);let bS=class extends ae{constructor(){super(...arguments),this.newTab=!1,this.disabled=!1,this.showTextSupport=!1,this.placeholder="Type or paste link here",this.textPlaceholder="Display text",this.label="Link",this.linkValue="",this.textValue="",this.hasActiveLink=!1,this.popoverStyle="",this.selectionRange=null,this.activeAnchor=null,this.ignoreBlur=!1,this.isApplying=!1,this.onScroll=()=>{this.closePopover()},this.onOpen=()=>{if(this.disabled)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;if(!this.editorEl.contains(e.getRangeAt(0).commonAncestorContainer))return;this.selectionRange=e.getRangeAt(0).cloneRange(),this.activeAnchor=null,this.hasActiveLink=!1;let t=this.selectionRange.startContainer;for(;t&&t!==this.editorEl;){if(t instanceof HTMLAnchorElement){this.activeAnchor=t,this.hasActiveLink=!0;break}t=t.parentNode}this.linkValue=this.activeAnchor?this.displayUrl(this.activeAnchor.href):"",this.showTextSupport&&(this.activeAnchor?this.textValue=this.activeAnchor.textContent||"":this.selectionRange.collapsed?this.textValue="":this.textValue=this.selectionRange.toString()),this.positionPopover(),this.openPopover(),requestAnimationFrame((()=>{const e=this.querySelectorAll("nile-input"),t=e.length>1?e[1]:e[0];t?.focus()}))},this.onInputKeydown=e=>{if("Escape"===e.key||"Enter"===e.key)if(e.preventDefault(),e.stopPropagation(),"Escape"!==e.key){this.isApplying=!0;try{this.applyLink()}finally{this.isApplying=!1}}else this.closePopover()},this.onInputBlur=()=>{this.ignoreBlur||this.isApplying||requestAnimationFrame((()=>{if(this.ignoreBlur||this.isApplying)return;const e=this.querySelector("nile-popover");e?.matches(":focus-within")||this.closePopover()}))},this.onLinkInput=e=>{this.linkValue=e.detail.value},this.onTextInput=e=>{this.textValue=e.detail.value},this.onPopoverMousedown=()=>{this.ignoreBlur=!0},this.onPopoverMouseup=()=>{this.ignoreBlur=!1},this.onToolbarButtonMousedown=e=>{e.preventDefault()},this.onActionMousedown=e=>{e.preventDefault(),this.ignoreBlur=!0},this.onApplyClick=()=>{this.isApplying=!0,this.applyLink(),this.isApplying=!1,this.ignoreBlur=!1},this.onUnlinkClick=()=>{this.isApplying=!0,this.onRemove(),this.isApplying=!1,this.ignoreBlur=!1}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.injectCss("\n nile-popover.rte-link-popover::part(popover) {\n min-width: 340px;\n max-width: 420px;\n background: white;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-componentcolors-utility-gray-400));\n border-radius: 8px;\n padding: 0;\n gap: 0;\n overflow: hidden;\n height: auto;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);\n }\n\n .link-popup-wrap {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 12px;\n }\n\n .link-popup-wrap nile-input {\n width: 100%;\n }\n\n .link-popup-wrap .link-input-row {\n width: 100%;\n }\n\n .link-popup-wrap .link-actions-row {\n display: flex;\n align-items: flex-end;\n gap: 4px;\n width: 100%;\n }\n\n .link-popup-wrap .link-actions-row nile-input {\n flex: 1;\n min-width: 0;\n }\n\n \n nile-button.rte-link-button::part(base) {\n border: none;\n height: 32px;\n width: 32px;\n }\n nile-button.rte-edit-button::part(base) {\n border: none;\n height: 32px;\n width: 32px;\n flex-shrink: 0;\n }\n ")}injectCss(e){if(this.querySelector("style[data-rte-link-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-link-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}normalizeUrl(e){return/^(https?:|mailto:|tel:)/i.test(e)?e:`https://${e}`}displayUrl(e){return e}getSelectionRect(){if(!this.selectionRange)return null;let e=this.selectionRange.getBoundingClientRect();if(0===e.width&&0===e.height){const t=document.createElement("span");t.textContent="​";this.selectionRange.cloneRange().insertNode(t),e=t.getBoundingClientRect(),t.remove()}return e}positionPopover(){const e=this.getSelectionRect();e&&(this.popoverStyle=`\n position: fixed;\n top: ${e.bottom+8}px;\n left: ${e.left+e.width/2}px;\n transform: translateX(-50%);\n z-index: 1000;\n `)}openPopover(){requestAnimationFrame((()=>{const e=this.querySelector("nile-popover");e&&(e.isShow=!0),window.addEventListener("scroll",this.onScroll,!0)}))}closePopover(){const e=this.querySelector("nile-popover");e&&(e.isShow=!1),window.removeEventListener("scroll",this.onScroll,!0),this.linkValue="",this.textValue="",this.selectionRange=null,this.activeAnchor=null,this.hasActiveLink=!1,this.popoverStyle=""}unwrapLink(e){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}applyLink(){if(!(this.selectionRange instanceof Range))return;let e=this.linkValue.trim();if(!e)return;if(/^javascript:/i.test(e))return;/^(https?:\/\/|mailto:|tel:|\/)/i.test(e)||(e=`https://${e}`),this.editorEl.focus();const t=document.getSelection();if(!t)return;t.removeAllRanges(),t.addRange(this.selectionRange);const i=this.showTextSupport&&this.textValue.trim()?this.textValue.trim():"";if(this.activeAnchor)this.activeAnchor.href=e,i&&(this.activeAnchor.textContent=i),this.newTab?(this.activeAnchor.target="_blank",this.activeAnchor.rel="noopener noreferrer"):(this.activeAnchor.removeAttribute("target"),this.activeAnchor.removeAttribute("rel"));else{const t=document.createElement("a");if(t.href=e,this.newTab?(t.target="_blank",t.rel="noopener noreferrer"):(t.removeAttribute("target"),t.removeAttribute("rel")),i)this.selectionRange.deleteContents(),t.textContent=i,this.selectionRange.insertNode(t);else if(this.selectionRange.collapsed)t.textContent=e,this.selectionRange.insertNode(t);else try{this.selectionRange.surroundContents(t)}catch{const e=this.selectionRange.extractContents();t.appendChild(e),this.selectionRange.insertNode(t)}}this.emit(e),this.closePopover()}onRemove(){this.activeAnchor&&(this.unwrapLink(this.activeAnchor),this.emit(""),this.closePopover())}emit(e){this.dispatchEvent(new CustomEvent("nile-link-changed",{detail:{href:e},bubbles:!0,composed:!0}))}render(){const e=this.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))";return _`
17244
17393
  <nile-lite-tooltip content=${this.label}>
17245
17394
  <nile-button
17246
17395
  variant="tertiary"
@@ -17306,7 +17455,7 @@ nile-badge::part(content) {
17306
17455
  </div>
17307
17456
  </div>
17308
17457
  </nile-popover>
17309
- `}};function bS(e,t){for(;e&&e!==t;){if(e instanceof HTMLElement){const t=getComputedStyle(e).display;if(e.tagName.match(/^(P|DIV|H1|H2|H3|H4|H5|H6|LI)$/)||"block"===t||"list-item"===t)return e}e=e?.parentNode||null}return t}function kS(e,t){const i=window.getSelection();if(!i||0===i.rangeCount)return;const n=i.getRangeAt(0),o=n.commonAncestorContainer,M=[],r=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t=e;return n.intersectsNode(t)&&/^(P|DIV|LI|H[1-6])$/.test(t.tagName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=r.nextNode();for(;s;)M.push(s),s=r.nextNode();if(0===M.length){const t=bS(i.focusNode,e);t&&M.push(t)}M.forEach((e=>{e.style.textAlign=t}))}function vS(e,t,i){const n=window.getSelection();if(!n||0===n.rangeCount)return;const o=n.getRangeAt(0),M={strong:["strong","b"],em:["em","i"],u:["u"],span:["span"]}[t]??[t],r=e=>M.includes(e.tagName.toLowerCase());function s(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function a(e){e.querySelectorAll(M.join(",")).forEach((e=>{if(!e.textContent?.trim())return void e.remove();Array.from(e.querySelectorAll(M.join(","))).forEach((t=>{if(t!==e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}))}))}function l(e){Array.from(e.querySelectorAll(M.join(","))).forEach((e=>{const t=e.nextSibling;if(t instanceof HTMLElement&&r(t)){for(;t.firstChild;)e.appendChild(t.firstChild);t.remove()}}))}if(o.collapsed){let M=!1,g=o.startContainer;for(;g&&g!==e;){if(g instanceof HTMLElement&&r(g)){M=!0;break}g=g.parentNode}if(M&&g instanceof HTMLElement)s(g);else{const e=document.createElement(t);i&&Object.entries(i).forEach((([t,i])=>e.setAttribute(t,i))),e.appendChild(document.createTextNode("​")),o.insertNode(e),o.setStart(e.firstChild,1),o.collapse(!0),n.removeAllRanges(),n.addRange(o)}return a(e),void l(e)}o.startContainer.nodeType===Node.TEXT_NODE&&o.startContainer.splitText(o.startOffset),o.endContainer.nodeType===Node.TEXT_NODE&&o.endContainer.splitText(o.endOffset);const g=document.createTreeWalker(o.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:e=>{if(!e.nodeValue?.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(e);return o.compareBoundaryPoints(Range.END_TO_START,t)<0&&o.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),N=[];let c;for(;c=g.nextNode();)N.push(c);const u=N.length>0&&N.every((t=>{let i=t;for(;i&&i!==e;){if(i instanceof HTMLElement&&r(i))return!0;i=i.parentNode}return!1}));if(u){const i=N[0],n=N[N.length-1],o=i.parentElement?.closest(t);if(o&&o.contains(n)){const e=o.parentNode;if(e){const M=document.createRange();M.setStartBefore(o),M.setEndBefore(i);const r=M.cloneContents(),s=document.createRange();s.setStartAfter(n),s.setEndAfter(o);const a=s.cloneContents(),l=document.createRange();l.setStartBefore(i),l.setEndAfter(n);const g=l.extractContents(),N=document.createDocumentFragment();if(r.childNodes.length){const e=document.createElement(t);for(;r.firstChild;)e.appendChild(r.firstChild);N.appendChild(e)}for(;g.firstChild;)N.appendChild(g.firstChild);if(a.childNodes.length){const e=document.createElement(t);for(;a.firstChild;)e.appendChild(a.firstChild);N.appendChild(e)}e.insertBefore(N,o),e.removeChild(o)}}else N.forEach((t=>{let i=t;for(;i&&i!==e;){if(i instanceof HTMLElement&&r(i)){s(i);break}i=i.parentNode}}))}else N.forEach((e=>{const n=e.parentElement?.closest(".mention, nile-mention");if(n)return;const o=e.parentElement?.closest("a");if(o&&"span"===t)return;const M=document.createElement(t);i&&Object.entries(i).forEach((([e,t])=>M.setAttribute(e,t))),o?(o.insertBefore(M,e),M.appendChild(e)):(e.parentNode?.insertBefore(M,e),M.appendChild(e))}));a(e),l(e),n.removeAllRanges(),n.addRange(o)}function fS(e){const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!t)return"#000000";return`#${Number(t[1]).toString(16).padStart(2,"0")}${Number(t[2]).toString(16).padStart(2,"0")}${Number(t[3]).toString(16).padStart(2,"0")}`}function QS(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const n=i.getRangeAt(0);if(n.collapsed){const e=document.createElement("span");e.style.fontFamily=t,e.appendChild(document.createTextNode("​")),n.insertNode(e);const o=document.createRange();return o.setStart(e.firstChild,1),o.collapse(!0),i.removeAllRanges(),void i.addRange(o)}!function(e,t,i){const n=document.createElement(t);i&&Object.entries(i).forEach((([e,t])=>n.setAttribute(e,t)));try{e.surroundContents(n)}catch{const t=e.extractContents();n.appendChild(t),e.insertNode(n)}}(n,"span",{style:`font-family:${t}`})}function CS(e,t,i){for(;t&&t!==e;){if(t instanceof HTMLSpanElement&&t.hasAttribute(i))return t;t=t.parentNode}return null}function US(e,t,i,n){const o=window.getSelection();if(!o||0===o.rangeCount)return;const M=o.getRangeAt(0);if(!e.contains(M.commonAncestorContainer))return;const r=M.cloneRange();if(r.collapsed){const M=CS(e,r.startContainer,n);if(M)return M.style[t]=i,void YS(e,n,t);const s=document.createElement("span");s.setAttribute(n,"1"),s.style[t]=i,s.appendChild(document.createTextNode("​")),r.insertNode(s);const a=document.createRange();return a.setStart(s.firstChild,1),a.collapse(!0),o.removeAllRanges(),o.addRange(a),void YS(e,n,t)}const s=CS(e,r.startContainer,n),a=CS(e,r.endContainer,n);if(s&&s===a){if(function(e,t){const i=document.createRange();return i.selectNodeContents(t),e.compareBoundaryPoints(Range.START_TO_START,i)<=0&&e.compareBoundaryPoints(Range.END_TO_END,i)>=0}(r,s))s.style[t]=i;else{const e=function(e,t,i,n,o){const M=e.style[n],r=document.createRange();r.setStart(e,0),r.setEnd(t.startContainer,t.startOffset);const s=document.createRange();s.setStart(t.endContainer,t.endOffset),s.setEnd(e,e.childNodes.length);const a=document.createDocumentFragment(),l=e=>{const t=document.createElement("span");return t.setAttribute(i,"1"),t.style[n]=e,t};if(ZS(r)){const e=l(M);e.appendChild(r.cloneContents()),a.appendChild(e)}const g=l(o);if(g.appendChild(t.cloneContents()),a.appendChild(g),ZS(s)){const e=l(M);e.appendChild(s.cloneContents()),a.appendChild(e)}return e.replaceWith(a),g}(s,r,n,t,i),o=window.getSelection(),M=document.createRange();M.selectNodeContents(e),o?.removeAllRanges(),o?.addRange(M)}return void YS(e,n,t)}const l=(()=>{let e=r.commonAncestorContainer;for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e})(),g=document.createTreeWalker(l||e,NodeFilter.SHOW_TEXT,{acceptNode:e=>{if(!e.nodeValue||!e.nodeValue.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(e);return r.compareBoundaryPoints(Range.END_TO_START,t)<0&&r.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),N=[];let c;for(;c=g.nextNode();)N.push(c);N.forEach((o=>{let M=0,s=o.length;o===r.startContainer&&(M=r.startOffset),o===r.endContainer&&(s=r.endOffset),M>0&&(o=o.splitText(M)),s<o.length&&o.splitText(s);const a=CS(e,o,n);if(a)return void(a.style[t]=i);const l=document.createElement("span");l.setAttribute(n,"1"),l.style[t]=i;o.parentElement.replaceChild(l,o),l.appendChild(o)})),YS(e,n,t),o.removeAllRanges(),o.addRange(r)}function YS(e,t,i){const n=Array.from(e.querySelectorAll(`span[${t}]`)),o=e=>e.style[i];n.forEach((e=>{Array.from(e.querySelectorAll(`span[${t}]`)).forEach((t=>{if(o(t)===o(e)){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}));const i=e.previousSibling;if(i instanceof HTMLSpanElement&&i.hasAttribute(t)&&o(i)===o(e)){for(;e.firstChild;)i.appendChild(e.firstChild);return void e.remove()}const n=e.nextSibling;if(n instanceof HTMLSpanElement&&n.hasAttribute(t)&&o(n)===o(e)){for(;n.firstChild;)e.appendChild(n.firstChild);n.remove()}}))}function ZS(e){if(e.collapsed)return!1;return(e.cloneContents().textContent||"").length>0}function VS(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const n=i.getRangeAt(0);function o(e){e.style.margin="0"}function M(e){const t=document.getSelection();if(!t)return;const i=document.createRange();i.selectNodeContents(e),i.collapse(!0),t.removeAllRanges(),t.addRange(i)}function r(t){for(;t&&t!==e;){if(t instanceof HTMLElement){const e=getComputedStyle(t).display;if(t.tagName.match(/^(P|DIV|H[1-6]|LI)$/)||"block"===e||"list-item"===e)return t}t=t.parentNode}return null}function s(e,t){const i=document.createElement(t);for(o(i);e.firstChild;)i.appendChild(e.firstChild);e.replaceWith(i)}if(n.collapsed){const i=r(n.startContainer),l=i?.closest("ul,ol");if(l&&l.tagName.toLowerCase()===t)return void function(e){const t=e.closest("li");if(!t)return;const i=t.parentElement,n=document.createElement("p");for(t.style.textAlign&&(n.style.textAlign=t.style.textAlign);t.firstChild;)n.appendChild(t.firstChild);i.parentNode?.insertBefore(n,i.nextSibling),t.remove(),0===i.childNodes.length&&i.remove(),M(n)}(i);if(l&&l.tagName.toLowerCase()!==t)return void s(l,t);if(!i||i===e||0===i.childNodes.length||(a=i,!a.textContent?.trim()&&!a.querySelector("img,br"))){const e=document.createElement(t),i=document.createElement("li");return i.appendChild(document.createElement("br")),e.appendChild(i),o(e),n.insertNode(e),void M(i)}const g=document.createElement(t);o(g);const N=document.createElement("li");for(i.style.textAlign&&(N.style.textAlign=i.style.textAlign);i.firstChild;)N.appendChild(i.firstChild);return g.appendChild(N),i.replaceWith(g),void M(N)}var a;const l=[],g=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{if(!(e instanceof HTMLElement))return NodeFilter.FILTER_SKIP;if(!/^(P|DIV|LI|H[1-6])$/.test(e.tagName))return NodeFilter.FILTER_SKIP;const t=document.createRange();t.selectNodeContents(e);return n.compareBoundaryPoints(Range.END_TO_START,t)<0&&n.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let N;for(;N=g.nextNode();)l.push(N);if(0===l.length){const e=r(n.startContainer);e&&l.push(e)}const c=l[0].closest("li");if(c){const e=c.closest("ul,ol");if(!e)return;return void(e.tagName.toLowerCase()===t?function(e){const t=document.createDocumentFragment();Array.from(e.querySelectorAll("li")).forEach((e=>{const i=document.createElement("p");for(e.style.textAlign&&(i.style.textAlign=e.style.textAlign);e.firstChild;)i.appendChild(e.firstChild);t.appendChild(i)})),e.replaceWith(t)}(e):s(e,t))}const u=document.createElement(t);o(u);for(const e of l){const t=document.createElement("li");for(e.style.textAlign&&(t.style.textAlign=e.style.textAlign);e.firstChild;)t.appendChild(e.firstChild);u.appendChild(t)}l[0].replaceWith(u);for(let e=1;e<l.length;e++)l[e].remove()}e([ue({attribute:!1})],ES.prototype,"editorEl",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],ES.prototype,"newTab",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],ES.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],ES.prototype,"showTextSupport",void 0),e([ue({type:String,reflect:!0,attribute:!0})],ES.prototype,"placeholder",void 0),e([ue({type:String,reflect:!0,attribute:!0})],ES.prototype,"textPlaceholder",void 0),e([ue({type:String,reflect:!0,attribute:!0})],ES.prototype,"label",void 0),e([De()],ES.prototype,"linkValue",void 0),e([De()],ES.prototype,"textValue",void 0),e([De()],ES.prototype,"hasActiveLink",void 0),e([De()],ES.prototype,"popoverStyle",void 0),ES=e([ge("nile-rte-link")],ES);const PS=r`
17458
+ `}};function kS(e,t){for(;e&&e!==t;){if(e instanceof HTMLElement){const t=getComputedStyle(e).display;if(e.tagName.match(/^(P|DIV|H1|H2|H3|H4|H5|H6|LI)$/)||"block"===t||"list-item"===t)return e}e=e?.parentNode||null}return t}function vS(e,t){const i=window.getSelection();if(!i||0===i.rangeCount)return;const n=i.getRangeAt(0),o=n.commonAncestorContainer,M=[],r=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t=e;return n.intersectsNode(t)&&/^(P|DIV|LI|H[1-6])$/.test(t.tagName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=r.nextNode();for(;s;)M.push(s),s=r.nextNode();if(0===M.length){const t=kS(i.focusNode,e);t&&M.push(t)}M.forEach((e=>{e.style.textAlign=t}))}function fS(e,t,i){const n=window.getSelection();if(!n||0===n.rangeCount)return;const o=n.getRangeAt(0),M={strong:["strong","b"],em:["em","i"],u:["u"],span:["span"]}[t]??[t],r=e=>M.includes(e.tagName.toLowerCase());function s(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function a(e){e.querySelectorAll(M.join(",")).forEach((e=>{if(!e.textContent?.trim())return void e.remove();Array.from(e.querySelectorAll(M.join(","))).forEach((t=>{if(t!==e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}))}))}function l(e){Array.from(e.querySelectorAll(M.join(","))).forEach((e=>{const t=e.nextSibling;if(t instanceof HTMLElement&&r(t)){for(;t.firstChild;)e.appendChild(t.firstChild);t.remove()}}))}if(o.collapsed){let M=!1,g=o.startContainer;for(;g&&g!==e;){if(g instanceof HTMLElement&&r(g)){M=!0;break}g=g.parentNode}if(M&&g instanceof HTMLElement)s(g);else{const e=document.createElement(t);i&&Object.entries(i).forEach((([t,i])=>e.setAttribute(t,i))),e.appendChild(document.createTextNode("​")),o.insertNode(e),o.setStart(e.firstChild,1),o.collapse(!0),n.removeAllRanges(),n.addRange(o)}return a(e),void l(e)}o.startContainer.nodeType===Node.TEXT_NODE&&o.startContainer.splitText(o.startOffset),o.endContainer.nodeType===Node.TEXT_NODE&&o.endContainer.splitText(o.endOffset);const g=document.createTreeWalker(o.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:e=>{if(!e.nodeValue?.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(e);return o.compareBoundaryPoints(Range.END_TO_START,t)<0&&o.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),N=[];let c;for(;c=g.nextNode();)N.push(c);const u=N.length>0&&N.every((t=>{let i=t;for(;i&&i!==e;){if(i instanceof HTMLElement&&r(i))return!0;i=i.parentNode}return!1}));if(u){const i=N[0],n=N[N.length-1],o=i.parentElement?.closest(t);if(o&&o.contains(n)){const e=o.parentNode;if(e){const M=document.createRange();M.setStartBefore(o),M.setEndBefore(i);const r=M.cloneContents(),s=document.createRange();s.setStartAfter(n),s.setEndAfter(o);const a=s.cloneContents(),l=document.createRange();l.setStartBefore(i),l.setEndAfter(n);const g=l.extractContents(),N=document.createDocumentFragment();if(r.childNodes.length){const e=document.createElement(t);for(;r.firstChild;)e.appendChild(r.firstChild);N.appendChild(e)}for(;g.firstChild;)N.appendChild(g.firstChild);if(a.childNodes.length){const e=document.createElement(t);for(;a.firstChild;)e.appendChild(a.firstChild);N.appendChild(e)}e.insertBefore(N,o),e.removeChild(o)}}else N.forEach((t=>{let i=t;for(;i&&i!==e;){if(i instanceof HTMLElement&&r(i)){s(i);break}i=i.parentNode}}))}else N.forEach((e=>{const n=e.parentElement?.closest(".mention, nile-mention");if(n)return;const o=e.parentElement?.closest("a");if(o&&"span"===t)return;const M=document.createElement(t);i&&Object.entries(i).forEach((([e,t])=>M.setAttribute(e,t))),o?(o.insertBefore(M,e),M.appendChild(e)):(e.parentNode?.insertBefore(M,e),M.appendChild(e))}));a(e),l(e),n.removeAllRanges(),n.addRange(o)}function QS(e){const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!t)return"#000000";return`#${Number(t[1]).toString(16).padStart(2,"0")}${Number(t[2]).toString(16).padStart(2,"0")}${Number(t[3]).toString(16).padStart(2,"0")}`}function CS(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const n=i.getRangeAt(0);if(n.collapsed){const e=document.createElement("span");e.style.fontFamily=t,e.appendChild(document.createTextNode("​")),n.insertNode(e);const o=document.createRange();return o.setStart(e.firstChild,1),o.collapse(!0),i.removeAllRanges(),void i.addRange(o)}!function(e,t,i){const n=document.createElement(t);i&&Object.entries(i).forEach((([e,t])=>n.setAttribute(e,t)));try{e.surroundContents(n)}catch{const t=e.extractContents();n.appendChild(t),e.insertNode(n)}}(n,"span",{style:`font-family:${t}`})}function US(e,t,i){for(;t&&t!==e;){if(t instanceof HTMLSpanElement&&t.hasAttribute(i))return t;t=t.parentNode}return null}function YS(e,t,i,n){const o=window.getSelection();if(!o||0===o.rangeCount)return;const M=o.getRangeAt(0);if(!e.contains(M.commonAncestorContainer))return;const r=M.cloneRange();if(r.collapsed){const M=US(e,r.startContainer,n);if(M)return M.style[t]=i,void ZS(e,n,t);const s=document.createElement("span");s.setAttribute(n,"1"),s.style[t]=i,s.appendChild(document.createTextNode("​")),r.insertNode(s);const a=document.createRange();return a.setStart(s.firstChild,1),a.collapse(!0),o.removeAllRanges(),o.addRange(a),void ZS(e,n,t)}const s=US(e,r.startContainer,n),a=US(e,r.endContainer,n);if(s&&s===a){if(function(e,t){const i=document.createRange();return i.selectNodeContents(t),e.compareBoundaryPoints(Range.START_TO_START,i)<=0&&e.compareBoundaryPoints(Range.END_TO_END,i)>=0}(r,s))s.style[t]=i;else{const e=function(e,t,i,n,o){const M=e.style[n],r=document.createRange();r.setStart(e,0),r.setEnd(t.startContainer,t.startOffset);const s=document.createRange();s.setStart(t.endContainer,t.endOffset),s.setEnd(e,e.childNodes.length);const a=document.createDocumentFragment(),l=e=>{const t=document.createElement("span");return t.setAttribute(i,"1"),t.style[n]=e,t};if(VS(r)){const e=l(M);e.appendChild(r.cloneContents()),a.appendChild(e)}const g=l(o);if(g.appendChild(t.cloneContents()),a.appendChild(g),VS(s)){const e=l(M);e.appendChild(s.cloneContents()),a.appendChild(e)}return e.replaceWith(a),g}(s,r,n,t,i),o=window.getSelection(),M=document.createRange();M.selectNodeContents(e),o?.removeAllRanges(),o?.addRange(M)}return void ZS(e,n,t)}const l=(()=>{let e=r.commonAncestorContainer;for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e})(),g=document.createTreeWalker(l||e,NodeFilter.SHOW_TEXT,{acceptNode:e=>{if(!e.nodeValue||!e.nodeValue.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(e);return r.compareBoundaryPoints(Range.END_TO_START,t)<0&&r.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),N=[];let c;for(;c=g.nextNode();)N.push(c);N.forEach((o=>{let M=0,s=o.length;o===r.startContainer&&(M=r.startOffset),o===r.endContainer&&(s=r.endOffset),M>0&&(o=o.splitText(M)),s<o.length&&o.splitText(s);const a=US(e,o,n);if(a)return void(a.style[t]=i);const l=document.createElement("span");l.setAttribute(n,"1"),l.style[t]=i;o.parentElement.replaceChild(l,o),l.appendChild(o)})),ZS(e,n,t),o.removeAllRanges(),o.addRange(r)}function ZS(e,t,i){const n=Array.from(e.querySelectorAll(`span[${t}]`)),o=e=>e.style[i];n.forEach((e=>{Array.from(e.querySelectorAll(`span[${t}]`)).forEach((t=>{if(o(t)===o(e)){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}));const i=e.previousSibling;if(i instanceof HTMLSpanElement&&i.hasAttribute(t)&&o(i)===o(e)){for(;e.firstChild;)i.appendChild(e.firstChild);return void e.remove()}const n=e.nextSibling;if(n instanceof HTMLSpanElement&&n.hasAttribute(t)&&o(n)===o(e)){for(;n.firstChild;)e.appendChild(n.firstChild);n.remove()}}))}function VS(e){if(e.collapsed)return!1;return(e.cloneContents().textContent||"").length>0}function PS(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const n=i.getRangeAt(0);function o(e){e.style.margin="0"}function M(e){const t=document.getSelection();if(!t)return;const i=document.createRange();i.selectNodeContents(e),i.collapse(!0),t.removeAllRanges(),t.addRange(i)}function r(t){for(;t&&t!==e;){if(t instanceof HTMLElement){const e=getComputedStyle(t).display;if(t.tagName.match(/^(P|DIV|H[1-6]|LI)$/)||"block"===e||"list-item"===e)return t}t=t.parentNode}return null}function s(e,t){const i=document.createElement(t);for(o(i);e.firstChild;)i.appendChild(e.firstChild);e.replaceWith(i)}if(n.collapsed){const i=r(n.startContainer),l=i?.closest("ul,ol");if(l&&l.tagName.toLowerCase()===t)return void function(e){const t=e.closest("li");if(!t)return;const i=t.parentElement,n=document.createElement("p");for(t.style.textAlign&&(n.style.textAlign=t.style.textAlign);t.firstChild;)n.appendChild(t.firstChild);i.parentNode?.insertBefore(n,i.nextSibling),t.remove(),0===i.childNodes.length&&i.remove(),M(n)}(i);if(l&&l.tagName.toLowerCase()!==t)return void s(l,t);if(!i||i===e||0===i.childNodes.length||(a=i,!a.textContent?.trim()&&!a.querySelector("img,br"))){const e=document.createElement(t),i=document.createElement("li");return i.appendChild(document.createElement("br")),e.appendChild(i),o(e),n.insertNode(e),void M(i)}const g=document.createElement(t);o(g);const N=document.createElement("li");for(i.style.textAlign&&(N.style.textAlign=i.style.textAlign);i.firstChild;)N.appendChild(i.firstChild);return g.appendChild(N),i.replaceWith(g),void M(N)}var a;const l=[],g=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{if(!(e instanceof HTMLElement))return NodeFilter.FILTER_SKIP;if(!/^(P|DIV|LI|H[1-6])$/.test(e.tagName))return NodeFilter.FILTER_SKIP;const t=document.createRange();t.selectNodeContents(e);return n.compareBoundaryPoints(Range.END_TO_START,t)<0&&n.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let N;for(;N=g.nextNode();)l.push(N);if(0===l.length){const e=r(n.startContainer);e&&l.push(e)}const c=l[0].closest("li");if(c){const e=c.closest("ul,ol");if(!e)return;return void(e.tagName.toLowerCase()===t?function(e){const t=document.createDocumentFragment();Array.from(e.querySelectorAll("li")).forEach((e=>{const i=document.createElement("p");for(e.style.textAlign&&(i.style.textAlign=e.style.textAlign);e.firstChild;)i.appendChild(e.firstChild);t.appendChild(i)})),e.replaceWith(t)}(e):s(e,t))}const u=document.createElement(t);o(u);for(const e of l){const t=document.createElement("li");for(e.style.textAlign&&(t.style.textAlign=e.style.textAlign);e.firstChild;)t.appendChild(e.firstChild);u.appendChild(t)}l[0].replaceWith(u);for(let e=1;e<l.length;e++)l[e].remove()}e([ue({attribute:!1})],bS.prototype,"editorEl",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],bS.prototype,"newTab",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],bS.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],bS.prototype,"showTextSupport",void 0),e([ue({type:String,reflect:!0,attribute:!0})],bS.prototype,"placeholder",void 0),e([ue({type:String,reflect:!0,attribute:!0})],bS.prototype,"textPlaceholder",void 0),e([ue({type:String,reflect:!0,attribute:!0})],bS.prototype,"label",void 0),e([De()],bS.prototype,"linkValue",void 0),e([De()],bS.prototype,"textValue",void 0),e([De()],bS.prototype,"hasActiveLink",void 0),e([De()],bS.prototype,"popoverStyle",void 0),bS=e([ge("nile-rte-link")],bS);const WS=r`
17310
17459
  .editor { all: revert;
17311
17460
  }
17312
17461
  .rte-container .editor.safari {
@@ -17523,7 +17672,7 @@ nile-rich-text-editor[disabled] .editor a {
17523
17672
 
17524
17673
 
17525
17674
 
17526
- `,WS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"},_S=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];let RS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.disabled=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.whitelist=[],this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.linkEl=null,this.mentionsEl=null,this.onEditorClick=e=>{if(this.disabled)return void e.preventDefault();const t=e.target.closest?.("a");t&&e.preventDefault()},this.onEditorPaste=e=>{this.disabled&&e.preventDefault()},this.onEditorDrop=e=>{this.disabled&&e.preventDefault()},this.onEditorInput=()=>{this.disabled||(this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState())},this.onEditorMouseup=()=>{this.saveSelection(),this.updateToolbarState()},this.onEditorKeyup=e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()},this.onEditorKeydown=e=>{if(this.disabled)return void e.preventDefault();if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),vS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,n=i.startOffset,o=e.data.slice(0,n),M=o.replace(/(\t|[ \u00a0]{2})$/,"");if(M.length!==o.length){e.data=M+e.data.slice(n);const i=document.createRange();i.setStart(e,M.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const n=document.createTextNode("\t");i.insertNode(n);const o=document.createRange();o.setStartAfter(n),o.collapse(!0),t.removeAllRanges(),t.addRange(o),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(PS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}firstUpdated(e){if(super.firstUpdated(e),this.editorEl){/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.editorEl.classList.add("safari")}}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){this.unwireEditor(),document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor)),e.has("disabled")&&this.editorEl&&(this.editorEl.setAttribute("contenteditable",this.disabled?"false":"true"),this.editorEl.tabIndex=this.disabled?-1:0,this.linkEl&&(this.linkEl.disabled=this.disabled)),e.has("placeholder")&&this.editorEl&&(this.placeholder?this.editorEl.dataset.placeholder=this.placeholder:delete this.editorEl.dataset.placeholder)}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable",this.disabled?"false":"true"),e.tabIndex=this.disabled?-1:0,this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const n=t?(e.textContent??"").replace(/\u200B/g,""):"",o=document.createTextNode(n);i.insertBefore(o,e),i.removeChild(e);const M=document.createRange();M.setStartAfter(o),M.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(M)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),n=t.getAttribute("data-mention-label"),o=t.getAttribute("data-mention-trigger")||"",M=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!n&&M.length>0&&M.startsWith(o)&&M.includes(n);M&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("click",this.onEditorClick),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.onEditorMouseup),this.editorEl.addEventListener("keyup",this.onEditorKeyup),this.editorEl.addEventListener("keydown",this.onEditorKeydown),this.editorEl.addEventListener("paste",this.onEditorPaste),this.editorEl.addEventListener("drop",this.onEditorDrop)}unwireEditor(){this.editorEl&&(this.editorEl.removeEventListener("click",this.onEditorClick),this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.onEditorMouseup),this.editorEl.removeEventListener("keyup",this.onEditorKeyup),this.editorEl.removeEventListener("keydown",this.onEditorKeydown),this.editorEl.removeEventListener("paste",this.onEditorPaste),this.editorEl.removeEventListener("drop",this.onEditorDrop))}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"===t&&"align"===e.getAttribute("type"))return e.disabled=this.disabled,void e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;kS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}));if("nile-rte-link"===t)return e.editorEl=this.editorEl,e.disabled=this.disabled,this.linkEl=e,void e.addEventListener("nile-link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",n=e.getAttribute("label")||i,o=e.getAttribute("icon"),M=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),t.disabled=this.disabled,o)t.innerHTML=`<nile-icon name="${o}" color="${this.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))"}" ></nile-icon>`,e.innerHTML="";else if(M)t.innerHTML=e.innerHTML,e.innerHTML="";else{const o=WS[i];o?t.innerHTML=`<nile-icon name="${o}" size="20" color="${this.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))"}" ></nile-icon>`:t.textContent=n||i,e.innerHTML=""}if(!t.isConnected)if(this.disabled)e.appendChild(t);else{const i=document.createElement("nile-lite-tooltip");i.setAttribute("content",n),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",n),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?US(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){US(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const n=bS(i.getRangeAt(0).startContainer,e);if(!n)return;if(n.tagName.toLowerCase()===t)return;const o=document.createElement(t);for(;n.firstChild;)o.appendChild(n.firstChild);n.replaceWith(o);const M=document.createRange();M.selectNodeContents(o),M.collapse(!0),i.removeAllRanges(),i.addRange(M)}(this.editorEl,i):"font"===t&&QS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),n=document.createElement("div");n.appendChild(i),Array.from(n.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t){e.innerHTML="<p><br></p>";const t=e.querySelector("p");if(t){const e=document.createRange();e.setStart(t,0),e.collapse(!0);const i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(e))}return}if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){if(!this.disabled){switch(this.focusAndRestore(),e){case"bold":vS(this.editorEl,"strong");break;case"italic":vS(this.editorEl,"em");break;case"underline":vS(this.editorEl,"u");break;case"left":kS(this.editorEl,"left");break;case"center":kS(this.editorEl,"center");break;case"right":kS(this.editorEl,"right");break;case"justify":kS(this.editorEl,"justify");break;case"ul":VS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":VS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,n=getComputedStyle(i),o=bS(t.startContainer,this.editorEl)||this.editorEl,M=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=o.style.textAlign||getComputedStyle(o).textAlign||"start",g="start"===l?"left":l,N=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",M),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.linkEl){const e=this.linkEl.querySelector("nile-button");e&&e.toggleAttribute("data-active",a)}if(this.setBtnActive("left","left"===g&&!["center","right","justify"].includes(g)),this.setBtnActive("center","center"===g),this.setBtnActive("right","right"===g),this.setBtnActive("justify","justify"===g),this.setBtnActive("ul","ul"===N),this.setBtnActive("ol","ol"===N),this.headingSelect){const e=o.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(n.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=fS(n.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=fS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}getComputedImportantProps(){return Array.from(new Set([..._S,...this.whitelist??[]]))}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=window.getSelection(),i=t&&t.rangeCount>0&&this.editorEl.contains(t.getRangeAt(0).startContainer)?t.getRangeAt(0).cloneRange():null,n=this.editorEl.cloneNode(!0);if(this.noStyles)n.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT),i=this.getComputedImportantProps();for(;e.nextNode()&&t.nextNode();){const n=e.currentNode,o=t.currentNode,M=window.getComputedStyle(n),r=i.map((e=>`${e}:${M.getPropertyValue(e)}`)).join(";");r.trim()&&o.setAttribute("style",r)}}i&&t&&this.editorEl.contains(i.startContainer)&&(t.removeAllRanges(),t.addRange(i)),this.content=n.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ue({type:String,attribute:!0,reflect:!0})],RS.prototype,"value",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],RS.prototype,"noStyles",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],RS.prototype,"disabled",void 0),e([ue({type:Boolean,attribute:"singlelineeditor",reflect:!0})],RS.prototype,"singleLineEditor",void 0),e([ue({type:String})],RS.prototype,"placeholder",void 0),e([ue({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const n=t[e];Array.isArray(n)&&(i[e]=n.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],RS.prototype,"mentions",void 0),e([ue({attribute:"whitelist",reflect:!1,converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>"string"==typeof e)):[]}catch{return[]}}}})],RS.prototype,"whitelist",void 0),e([De()],RS.prototype,"content",void 0),RS=e([ge("nile-rich-text-editor")],RS);const BS=[{color:"#131316",name:"Black"},{color:"#26272B",name:"Dark Gray"},{color:"#525252",name:"Gray"},{color:"#737373",name:"Medium Gray"},{color:"#A3A3A3",name:"Silver"},{color:"#D6D6D6",name:"Light Gray"},{color:"#F5F5F5",name:"Off White"},{color:"#FFFFFF",name:"White"},{color:"#CA8504",name:"Yellow 3"},{color:"#C01048",name:"Red 3"},{color:"#DD2590",name:"Pink 3"},{color:"#155EEF",name:"Blue Dark 3"},{color:"#444CE7",name:"Indigo 3"},{color:"#7A5AF8",name:"Purple 3"},{color:"#3E4784",name:"Gray Blue 3"},{color:"#087443",name:"Green 3"},{color:"#FDE272",name:"Yellow 2"},{color:"#FEA3B4",name:"Red 2"},{color:"#FAA7E0",name:"Pink 2"},{color:"#528BFF",name:"Blue Dark 2"},{color:"#A4BCFD",name:"Indigo 2"},{color:"#BDB4FE",name:"Purple 2"},{color:"#B3B8DB",name:"Gray Blue 2"},{color:"#73E2A3",name:"Green 2"},{color:"#FEFBE8",name:"Yellow 1"},{color:"#FFF1F3",name:"Red 1"},{color:"#FDF2FA",name:"Pink 1"},{color:"#EFF4FF",name:"Blue Dark 1"},{color:"#EEF4FF",name:"Indigo 1"},{color:"#F4F3FF",name:"Purple 1"},{color:"#F8F9FC",name:"Gray Blue 1"},{color:"#EDFCF2",name:"Green 1"}];function GS(e){const t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function FS(e,t,i){e/=255,t/=255,i/=255;const n=Math.max(e,t,i),o=n-Math.min(e,t,i);let M=0;return 0!==o&&(M=n===e?((t-i)/o+6)%6:n===t?(i-e)/o+2:(e-t)/o+4,M*=60),[M,0===n?0:o/n,n]}function HS(e,t,i){const n=i*t,o=n*(1-Math.abs(e/60%2-1)),M=i-n;let r=0,s=0,a=0;return e<60?(r=n,s=o):e<120?(r=o,s=n):e<180?(s=n,a=o):e<240?(s=o,a=n):e<300?(r=o,a=n):(r=n,a=o),[Math.round(255*(r+M)),Math.round(255*(s+M)),Math.round(255*(a+M))]}let $S=class extends ae{constructor(){super(...arguments),this.type="swatches",this.value="#000000",this.swatchTooltip="name",this.recentColorsCount=3,this.noFill=!1,this.mode="inline",this.showCanvas=!0,this.showHue=!0,this.showInputs=!0,this.showActions=!0,this.open=!1,this.palette=[],this._view="swatches",this._recentColors=[],this._hue=220,this._sat=.7,this._val=.93,this._colorMode="HEX",this._hexInput="#366AEE",this._r=54,this._g=106,this._b=238,this._svCanvas=null,this._hueCanvas=null,this._draggingSV=!1,this._draggingHue=!1,this._pendingColor="#366AEE",this._onSVMouseDown=e=>{e.preventDefault(),this._draggingSV=!0,this._updateSV(e)},this._onHueMouseDown=e=>{e.preventDefault(),this._draggingHue=!0,this._updateHue(e)},this._onGlobalMouseMove=e=>{this._draggingSV&&this._updateSV(e),this._draggingHue&&this._updateHue(e)},this._onGlobalMouseUp=()=>{const e=this._draggingSV,t=this._draggingHue;this.showActions||"picker"!==this._view||!e&&!t||this._commitPickerIfNoActions(),this._draggingSV=!1,this._draggingHue=!1},this._onHexInput=e=>{let t=(e.detail?.value??e.target.value??"").trim();if(t.startsWith("#")||(t="#"+t),/^#[0-9a-f]{6}$/i.test(t)){const[e,i,n]=GS(t);[this._hue,this._sat,this._val]=FS(e,i,n),this._syncInputs(),"picker"===this._view&&this._commitPickerIfNoActions()}},this._onRgbInput=(e,t)=>{const i=t.detail?.value??t.target.value,n=Math.max(0,Math.min(255,parseInt(String(i),10)||0));"r"===e?this._r=n:"g"===e?this._g=n:this._b=n,[this._hue,this._sat,this._val]=FS(this._r,this._g,this._b),this._syncInputs(),"picker"===this._view&&this._commitPickerIfNoActions()},this._onColorModeSelect=e=>{e.stopPropagation();const t=e.detail?.value;"HEX"!==t&&"RGB"!==t||(this._colorMode=t)},this._pickEyedropper=async()=>{const e=window.EyeDropper;if(e)try{const t=await(new e).open();t?.sRGBHex&&this._apply(t.sRGBHex)}catch{}else this._openPicker()}}createRenderRoot(){return this}connectedCallback(){if(super.connectedCallback(),this._view=this.type,"picker"===this.type){const[e,t,i]=GS(this._norm(this.value));[this._hue,this._sat,this._val]=FS(e,t,i),this._syncInputs()}this._injectCss(),document.addEventListener("mousemove",this._onGlobalMouseMove),document.addEventListener("mouseup",this._onGlobalMouseUp)}disconnectedCallback(){document.removeEventListener("mousemove",this._onGlobalMouseMove),document.removeEventListener("mouseup",this._onGlobalMouseUp),super.disconnectedCallback()}updated(e){if(e.has("type")&&(this._view=this.type,"picker"===this.type)){const[e,t,i]=GS(this._norm(this.value));[this._hue,this._sat,this._val]=FS(e,t,i),this._syncInputs()}if(e.has("value")&&"picker"===this.type&&"picker"===this._view&&!this._draggingSV&&!this._draggingHue){const[e,t,i]=GS(this._norm(this.value));[this._hue,this._sat,this._val]=FS(e,t,i),this._syncInputs()}"picker"===this._view&&requestAnimationFrame((()=>{this._svCanvas=this.querySelector(".ncp-sv-canvas"),this._hueCanvas=this.querySelector(".ncp-hue-canvas"),this._drawSV(),this._drawHue()}))}reset(){this._view=this.type}_injectCss(){if(this.querySelector("style[data-nile-color-picker]"))return;const e=document.createElement("style");e.setAttribute("data-nile-color-picker",""),e.textContent="\n \n .ncp-trigger {\n display: block;\n width: 20px;\n height: 20px;\n border-radius: 4px;\n border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n padding: 0;\n cursor: pointer;\n box-sizing: border-box;\n transition: box-shadow 0.15s ease, transform 0.15s ease;\n }\n .ncp-trigger:hover {\n transform: translateY(-1px);\n }\n .ncp-trigger:focus-visible {\n outline: none;\n }\n .ncp-trigger--no-fill {\n background:\n repeating-conic-gradient(#E4E7EC 0% 25%, #FFFFFF 0% 50%)\n 0 0 / 12px 12px;\n }\n\n /* ── inline panel ────────────────────────────────────────────────── */\n .ncp-panel {\n padding: 8px;\n background: #FFFFFF;\n box-sizing: border-box;\n width: 236px;\n border-radius: 8px;\n }\n .ncp-panel--picker {\n width: 260px;\n }\n\n .ncp-palette-grid {\n display: grid;\n grid-template-columns: repeat(8, 24px);\n column-gap: 4px;\n row-gap: 4px;\n align-content: start;\n max-height: min(240px, 42vh);\n overflow-x: hidden;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n min-height: 0;\n }\n nile-popover#color-picker-popover::part(popover) {\n min-width: 236px;\n gap: 0px;\n padding: 4px;\n }\n\n /* no fill */\n .ncp-no-fill {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n width: 100%;\n margin-top: 8px;\n padding: 8px 0;\n border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n border-radius: 8px;\n background: #FFFFFF;\n color: #475467;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s ease;\n }\n .ncp-no-fill:hover { background: #F9FAFB; }\n\n /* custom section */\n .ncp-custom-section {\n margin-top: 16px;\n padding-top: 8px;\n border-top: 1px solid #EAECF0;\n }\n .ncp-custom-title {\n margin: 0 0 8px;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary-700));\n font-size: 13px;\n font-weight: 600;\n line-height: 18px;\n font-weight: 500;\n }\n .ncp-custom-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 4px;\n }\n /* tooltip wrappers default to inline — must be block so flex aligns them correctly */\n .ncp-custom-row nile-lite-tooltip {\n display: block;\n line-height: 0;\n }\n .ncp-custom-row nile-color-swatch {\n display: block;\n }\n .ncp-action-btn {\n width: 24px;\n height: 24px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n border: 1.5px solid #CBD5E1;\n background: #FFFFFF;\n color: #111827;\n cursor: pointer;\n box-sizing: border-box;\n padding: 0;\n transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;\n }\n .ncp-action-btn:hover {\n border-color: #98A2B3;\n background: #F8FAFC;\n transform: translateY(-1px);\n }\n .ncp-plus-icon {\n position: relative;\n width: 12px;\n height: 12px;\n }\n .ncp-plus-icon::before,\n .ncp-plus-icon::after {\n content: '';\n position: absolute;\n left: 50%; top: 50%;\n background: currentColor;\n transform: translate(-50%,-50%);\n border-radius: 999px;\n }\n .ncp-plus-icon::before { width: 12px; height: 2px; }\n .ncp-plus-icon::after { width: 2px; height: 12px; }\n\n /* ── picker panel ───────────────────────────────────────────────── */\n .ncp-sv-area {\n position: relative;\n width: 244px;\n height: 130px;\n border-radius: 8px;\n overflow: hidden;\n cursor: crosshair;\n user-select: none;\n }\n .ncp-sv-canvas { display: block; width: 100%; height: 100%; }\n .ncp-sv-thumb {\n position: absolute;\n width: 20px; height: 20px;\n transform: translate(-50%,-50%);\n pointer-events: none;\n }\n .ncp-sv-thumb-inner {\n width: 20px; height: 20px;\n border-radius: 50%;\n border: 2.5px solid #FFFFFF;\n box-shadow: 0 0 0 1px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.2);\n box-sizing: border-box;\n }\n\n .ncp-hue-row {\n display: flex;\n align-items: center;\n gap: 10px;\n margin-top: 14px;\n }\n .ncp-hue-wrap {\n position: relative;\n flex: 1;\n height: 14px;\n border-radius: 7px;\n overflow: hidden;\n cursor: pointer;\n user-select: none;\n }\n .ncp-hue-canvas { display: block; width: 100%; height: 100%; border-radius: 7px; }\n .ncp-hue-thumb {\n position: absolute;\n top: 50%;\n width: 18px; height: 18px;\n border-radius: 50%;\n border: 2.5px solid #FFFFFF;\n box-shadow: 0 0 0 1px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.18);\n transform: translate(-50%,-50%);\n pointer-events: none;\n box-sizing: border-box;\n }\n .ncp-eyedropper {\n width: 28px; height: 28px;\n display: flex; align-items: center; justify-content: center;\n border: none; background: none;\n color: #475467; cursor: pointer; padding: 0; border-radius: 6px;\n }\n .ncp-eyedropper:hover { background: #F3F4F6; }\n\n .ncp-input-row {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 14px;\n }\n /* Safari: display:block needed so the custom element participates in flex layout */\n .ncp-input-row .ncp-mode-dropdown { display: block; flex-shrink: 0; width: 62px; min-width: 62px; }\n .ncp-input-row .ncp-mode-dropdown nile-button.ncp-mode-btn { width: 100%; min-width: 0; white-space: nowrap; }\n .ncp-input-row .ncp-mode-dropdown nile-button.ncp-mode-btn::part(base) {\n padding: 0 6px; width: 100%; min-width: 0; font-size: 11px; gap: 2px;\n }\n /* Safari: custom elements default to display:inline — must be block to flex-grow */\n .ncp-input-row nile-input.ncp-hex { display: block; flex: 1; min-width: 0; }\n .ncp-input-row nile-input.ncp-rgb { display: block; flex: 1; min-width: 0; }\n .ncp-input-row nile-input.ncp-rgb::part(input)::-webkit-inner-spin-button,\n .ncp-input-row nile-input.ncp-rgb::part(input)::-webkit-outer-spin-button { -webkit-appearance: none; }\n\n .ncp-picker-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 16px;\n }\n",this.insertBefore(e,this.firstChild)}_norm(e){const t=e.trim();if(/^#[0-9a-f]{6}$/i.test(t))return t.toUpperCase();if(/^#[0-9a-f]{3}$/i.test(t)){const[e,i,n]=t.slice(1).toUpperCase().split("");return`#${e}${e}${i}${i}${n}${n}`}return"#000000"}get _paletteColors(){return this.palette.length>0?this.palette:BS}_emit(e){this.dispatchEvent(new CustomEvent("nile-change",{detail:{value:e},bubbles:!0,composed:!0}))}_apply(e){const t=this._norm(e);this.value=t;const i={color:t,name:t};this._recentColors=[i,...this._recentColors.filter((e=>this._norm(e.color)!==t))].slice(0,this.recentColorsCount),this._emit(t),"popover"===this.mode&&"swatches"===this._view&&this._closePopover()}_closePopover(){const e=this.querySelector("nile-popover");e&&(e.isShow=!1)}_openPicker(){const[e,t,i]=GS(this._norm(this.value)),[n,o,M]=FS(e,t,i);this._hue=n,this._sat=o,this._val=M,this._syncInputs(),this._view="picker"}_syncInputs(){const[e,t,i]=HS(this._hue,this._sat,this._val),n=function(e,t,i){return"#"+[e,t,i].map((e=>e.toString(16).padStart(2,"0"))).join("").toUpperCase()}(e,t,i);this._hexInput=n,this._r=e,this._g=t,this._b=i,this._pendingColor=n}_drawSV(){const e=this._svCanvas;if(!e)return;const t=e.getContext("2d");if(!t)return;const{width:i,height:n}=e,[o,M,r]=HS(this._hue,1,1);t.fillStyle=`rgb(${o},${M},${r})`,t.fillRect(0,0,i,n);const s=t.createLinearGradient(0,0,i,0);s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=s,t.fillRect(0,0,i,n);const a=t.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=a,t.fillRect(0,0,i,n)}_drawHue(){const e=this._hueCanvas;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=t.createLinearGradient(0,0,e.width,0);["#FF0000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF","#FF0000"].forEach(((e,t,n)=>i.addColorStop(t/(n.length-1),e))),t.fillStyle=i,t.fillRect(0,0,e.width,e.height)}_commitPickerIfNoActions(){this.showActions||(this._apply(this._pendingColor),"popover"===this.mode&&("swatches"===this.type&&(this._view="swatches"),this._closePopover()))}_updateSV(e){const t=this._svCanvas;if(!t)return;const i=t.getBoundingClientRect();this._sat=Math.max(0,Math.min(e.clientX-i.left,i.width))/i.width,this._val=1-Math.max(0,Math.min(e.clientY-i.top,i.height))/i.height,this._syncInputs()}_updateHue(e){const t=this._hueCanvas;if(!t)return;const i=t.getBoundingClientRect();this._hue=Math.max(0,Math.min(e.clientX-i.left,i.width))/i.width*360,this._syncInputs()}_renderSwatch(e){const t=this._norm(e.color),i=this._norm(this.value)===t,n="name"===this.swatchTooltip?e.name||t:"value"===this.swatchTooltip?t:e.name?`${e.name} (${t})`:t;return _`
17675
+ `,_S={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"},RS=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];let BS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.disabled=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.whitelist=[],this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.linkEl=null,this.mentionsEl=null,this.onEditorClick=e=>{if(this.disabled)return void e.preventDefault();const t=e.target.closest?.("a");t&&e.preventDefault()},this.onEditorPaste=e=>{this.disabled&&e.preventDefault()},this.onEditorDrop=e=>{this.disabled&&e.preventDefault()},this.onEditorInput=()=>{this.disabled||(this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState())},this.onEditorMouseup=()=>{this.saveSelection(),this.updateToolbarState()},this.onEditorKeyup=e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()},this.onEditorKeydown=e=>{if(this.disabled)return void e.preventDefault();if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),fS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,n=i.startOffset,o=e.data.slice(0,n),M=o.replace(/(\t|[ \u00a0]{2})$/,"");if(M.length!==o.length){e.data=M+e.data.slice(n);const i=document.createRange();i.setStart(e,M.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const n=document.createTextNode("\t");i.insertNode(n);const o=document.createRange();o.setStartAfter(n),o.collapse(!0),t.removeAllRanges(),t.addRange(o),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(WS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}firstUpdated(e){if(super.firstUpdated(e),this.editorEl){/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.editorEl.classList.add("safari")}}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){this.unwireEditor(),document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor)),e.has("disabled")&&this.editorEl&&(this.editorEl.setAttribute("contenteditable",this.disabled?"false":"true"),this.editorEl.tabIndex=this.disabled?-1:0,this.linkEl&&(this.linkEl.disabled=this.disabled)),e.has("placeholder")&&this.editorEl&&(this.placeholder?this.editorEl.dataset.placeholder=this.placeholder:delete this.editorEl.dataset.placeholder)}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable",this.disabled?"false":"true"),e.tabIndex=this.disabled?-1:0,this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const n=t?(e.textContent??"").replace(/\u200B/g,""):"",o=document.createTextNode(n);i.insertBefore(o,e),i.removeChild(e);const M=document.createRange();M.setStartAfter(o),M.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(M)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),n=t.getAttribute("data-mention-label"),o=t.getAttribute("data-mention-trigger")||"",M=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!n&&M.length>0&&M.startsWith(o)&&M.includes(n);M&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("click",this.onEditorClick),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.onEditorMouseup),this.editorEl.addEventListener("keyup",this.onEditorKeyup),this.editorEl.addEventListener("keydown",this.onEditorKeydown),this.editorEl.addEventListener("paste",this.onEditorPaste),this.editorEl.addEventListener("drop",this.onEditorDrop)}unwireEditor(){this.editorEl&&(this.editorEl.removeEventListener("click",this.onEditorClick),this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.onEditorMouseup),this.editorEl.removeEventListener("keyup",this.onEditorKeyup),this.editorEl.removeEventListener("keydown",this.onEditorKeydown),this.editorEl.removeEventListener("paste",this.onEditorPaste),this.editorEl.removeEventListener("drop",this.onEditorDrop))}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"===t&&"align"===e.getAttribute("type"))return e.disabled=this.disabled,void e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;vS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}));if("nile-rte-link"===t)return e.editorEl=this.editorEl,e.disabled=this.disabled,this.linkEl=e,void e.addEventListener("nile-link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",n=e.getAttribute("label")||i,o=e.getAttribute("icon"),M=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),t.disabled=this.disabled,o)t.innerHTML=`<nile-icon name="${o}" color="${this.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))"}" ></nile-icon>`,e.innerHTML="";else if(M)t.innerHTML=e.innerHTML,e.innerHTML="";else{const o=_S[i];o?t.innerHTML=`<nile-icon name="${o}" size="20" color="${this.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))"}" ></nile-icon>`:t.textContent=n||i,e.innerHTML=""}if(!t.isConnected)if(this.disabled)e.appendChild(t);else{const i=document.createElement("nile-lite-tooltip");i.setAttribute("content",n),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",n),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?YS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){YS(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const n=kS(i.getRangeAt(0).startContainer,e);if(!n)return;if(n.tagName.toLowerCase()===t)return;const o=document.createElement(t);for(;n.firstChild;)o.appendChild(n.firstChild);n.replaceWith(o);const M=document.createRange();M.selectNodeContents(o),M.collapse(!0),i.removeAllRanges(),i.addRange(M)}(this.editorEl,i):"font"===t&&CS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),n=document.createElement("div");n.appendChild(i),Array.from(n.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t){e.innerHTML="<p><br></p>";const t=e.querySelector("p");if(t){const e=document.createRange();e.setStart(t,0),e.collapse(!0);const i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(e))}return}if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){if(!this.disabled){switch(this.focusAndRestore(),e){case"bold":fS(this.editorEl,"strong");break;case"italic":fS(this.editorEl,"em");break;case"underline":fS(this.editorEl,"u");break;case"left":vS(this.editorEl,"left");break;case"center":vS(this.editorEl,"center");break;case"right":vS(this.editorEl,"right");break;case"justify":vS(this.editorEl,"justify");break;case"ul":PS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":PS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,n=getComputedStyle(i),o=kS(t.startContainer,this.editorEl)||this.editorEl,M=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=o.style.textAlign||getComputedStyle(o).textAlign||"start",g="start"===l?"left":l,N=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",M),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.linkEl){const e=this.linkEl.querySelector("nile-button");e&&e.toggleAttribute("data-active",a)}if(this.setBtnActive("left","left"===g&&!["center","right","justify"].includes(g)),this.setBtnActive("center","center"===g),this.setBtnActive("right","right"===g),this.setBtnActive("justify","justify"===g),this.setBtnActive("ul","ul"===N),this.setBtnActive("ol","ol"===N),this.headingSelect){const e=o.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(n.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=QS(n.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=QS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}getComputedImportantProps(){return Array.from(new Set([...RS,...this.whitelist??[]]))}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=window.getSelection(),i=t&&t.rangeCount>0&&this.editorEl.contains(t.getRangeAt(0).startContainer)?t.getRangeAt(0).cloneRange():null,n=this.editorEl.cloneNode(!0);if(this.noStyles)n.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT),i=this.getComputedImportantProps();for(;e.nextNode()&&t.nextNode();){const n=e.currentNode,o=t.currentNode,M=window.getComputedStyle(n),r=i.map((e=>`${e}:${M.getPropertyValue(e)}`)).join(";");r.trim()&&o.setAttribute("style",r)}}i&&t&&this.editorEl.contains(i.startContainer)&&(t.removeAllRanges(),t.addRange(i)),this.content=n.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ue({type:String,attribute:!0,reflect:!0})],BS.prototype,"value",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],BS.prototype,"noStyles",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],BS.prototype,"disabled",void 0),e([ue({type:Boolean,attribute:"singlelineeditor",reflect:!0})],BS.prototype,"singleLineEditor",void 0),e([ue({type:String})],BS.prototype,"placeholder",void 0),e([ue({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const n=t[e];Array.isArray(n)&&(i[e]=n.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],BS.prototype,"mentions",void 0),e([ue({attribute:"whitelist",reflect:!1,converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>"string"==typeof e)):[]}catch{return[]}}}})],BS.prototype,"whitelist",void 0),e([De()],BS.prototype,"content",void 0),BS=e([ge("nile-rich-text-editor")],BS);const GS=[{color:"#131316",name:"Black"},{color:"#26272B",name:"Dark Gray"},{color:"#525252",name:"Gray"},{color:"#737373",name:"Medium Gray"},{color:"#A3A3A3",name:"Silver"},{color:"#D6D6D6",name:"Light Gray"},{color:"#F5F5F5",name:"Off White"},{color:"#FFFFFF",name:"White"},{color:"#CA8504",name:"Yellow 3"},{color:"#C01048",name:"Red 3"},{color:"#DD2590",name:"Pink 3"},{color:"#155EEF",name:"Blue Dark 3"},{color:"#444CE7",name:"Indigo 3"},{color:"#7A5AF8",name:"Purple 3"},{color:"#3E4784",name:"Gray Blue 3"},{color:"#087443",name:"Green 3"},{color:"#FDE272",name:"Yellow 2"},{color:"#FEA3B4",name:"Red 2"},{color:"#FAA7E0",name:"Pink 2"},{color:"#528BFF",name:"Blue Dark 2"},{color:"#A4BCFD",name:"Indigo 2"},{color:"#BDB4FE",name:"Purple 2"},{color:"#B3B8DB",name:"Gray Blue 2"},{color:"#73E2A3",name:"Green 2"},{color:"#FEFBE8",name:"Yellow 1"},{color:"#FFF1F3",name:"Red 1"},{color:"#FDF2FA",name:"Pink 1"},{color:"#EFF4FF",name:"Blue Dark 1"},{color:"#EEF4FF",name:"Indigo 1"},{color:"#F4F3FF",name:"Purple 1"},{color:"#F8F9FC",name:"Gray Blue 1"},{color:"#EDFCF2",name:"Green 1"}];function FS(e){const t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function HS(e,t,i){e/=255,t/=255,i/=255;const n=Math.max(e,t,i),o=n-Math.min(e,t,i);let M=0;return 0!==o&&(M=n===e?((t-i)/o+6)%6:n===t?(i-e)/o+2:(e-t)/o+4,M*=60),[M,0===n?0:o/n,n]}function $S(e,t,i){const n=i*t,o=n*(1-Math.abs(e/60%2-1)),M=i-n;let r=0,s=0,a=0;return e<60?(r=n,s=o):e<120?(r=o,s=n):e<180?(s=n,a=o):e<240?(s=o,a=n):e<300?(r=o,a=n):(r=n,a=o),[Math.round(255*(r+M)),Math.round(255*(s+M)),Math.round(255*(a+M))]}let JS=class extends ae{constructor(){super(...arguments),this.type="swatches",this.value="#000000",this.swatchTooltip="name",this.recentColorsCount=3,this.noFill=!1,this.mode="inline",this.showCanvas=!0,this.showHue=!0,this.showInputs=!0,this.showActions=!0,this.open=!1,this.palette=[],this._view="swatches",this._recentColors=[],this._hue=220,this._sat=.7,this._val=.93,this._colorMode="HEX",this._hexInput="#366AEE",this._r=54,this._g=106,this._b=238,this._svCanvas=null,this._hueCanvas=null,this._draggingSV=!1,this._draggingHue=!1,this._pendingColor="#366AEE",this._onSVMouseDown=e=>{e.preventDefault(),this._draggingSV=!0,this._updateSV(e)},this._onHueMouseDown=e=>{e.preventDefault(),this._draggingHue=!0,this._updateHue(e)},this._onGlobalMouseMove=e=>{this._draggingSV&&this._updateSV(e),this._draggingHue&&this._updateHue(e)},this._onGlobalMouseUp=()=>{const e=this._draggingSV,t=this._draggingHue;this.showActions||"picker"!==this._view||!e&&!t||this._commitPickerIfNoActions(),this._draggingSV=!1,this._draggingHue=!1},this._onHexInput=e=>{let t=(e.detail?.value??e.target.value??"").trim();if(t.startsWith("#")||(t="#"+t),/^#[0-9a-f]{6}$/i.test(t)){const[e,i,n]=FS(t);[this._hue,this._sat,this._val]=HS(e,i,n),this._syncInputs(),"picker"===this._view&&this._commitPickerIfNoActions()}},this._onRgbInput=(e,t)=>{const i=t.detail?.value??t.target.value,n=Math.max(0,Math.min(255,parseInt(String(i),10)||0));"r"===e?this._r=n:"g"===e?this._g=n:this._b=n,[this._hue,this._sat,this._val]=HS(this._r,this._g,this._b),this._syncInputs(),"picker"===this._view&&this._commitPickerIfNoActions()},this._onColorModeSelect=e=>{e.stopPropagation();const t=e.detail?.value;"HEX"!==t&&"RGB"!==t||(this._colorMode=t)},this._pickEyedropper=async()=>{const e=window.EyeDropper;if(e)try{const t=await(new e).open();t?.sRGBHex&&this._apply(t.sRGBHex)}catch{}else this._openPicker()}}createRenderRoot(){return this}connectedCallback(){if(super.connectedCallback(),this._view=this.type,"picker"===this.type){const[e,t,i]=FS(this._norm(this.value));[this._hue,this._sat,this._val]=HS(e,t,i),this._syncInputs()}this._injectCss(),document.addEventListener("mousemove",this._onGlobalMouseMove),document.addEventListener("mouseup",this._onGlobalMouseUp)}disconnectedCallback(){document.removeEventListener("mousemove",this._onGlobalMouseMove),document.removeEventListener("mouseup",this._onGlobalMouseUp),super.disconnectedCallback()}updated(e){if(e.has("type")&&(this._view=this.type,"picker"===this.type)){const[e,t,i]=FS(this._norm(this.value));[this._hue,this._sat,this._val]=HS(e,t,i),this._syncInputs()}if(e.has("value")&&"picker"===this.type&&"picker"===this._view&&!this._draggingSV&&!this._draggingHue){const[e,t,i]=FS(this._norm(this.value));[this._hue,this._sat,this._val]=HS(e,t,i),this._syncInputs()}"picker"===this._view&&requestAnimationFrame((()=>{this._svCanvas=this.querySelector(".ncp-sv-canvas"),this._hueCanvas=this.querySelector(".ncp-hue-canvas"),this._drawSV(),this._drawHue()}))}reset(){this._view=this.type}_injectCss(){if(this.querySelector("style[data-nile-color-picker]"))return;const e=document.createElement("style");e.setAttribute("data-nile-color-picker",""),e.textContent="\n \n .ncp-trigger {\n display: block;\n width: 20px;\n height: 20px;\n border-radius: 4px;\n border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n padding: 0;\n cursor: pointer;\n box-sizing: border-box;\n transition: box-shadow 0.15s ease, transform 0.15s ease;\n }\n .ncp-trigger:hover {\n transform: translateY(-1px);\n }\n .ncp-trigger:focus-visible {\n outline: none;\n }\n .ncp-trigger--no-fill {\n background:\n repeating-conic-gradient(#E4E7EC 0% 25%, #FFFFFF 0% 50%)\n 0 0 / 12px 12px;\n }\n\n /* ── inline panel ────────────────────────────────────────────────── */\n .ncp-panel {\n padding: 8px;\n background: #FFFFFF;\n box-sizing: border-box;\n width: 236px;\n border-radius: 8px;\n }\n .ncp-panel--picker {\n width: 260px;\n }\n\n .ncp-palette-grid {\n display: grid;\n grid-template-columns: repeat(8, 24px);\n column-gap: 4px;\n row-gap: 4px;\n align-content: start;\n max-height: min(240px, 42vh);\n overflow-x: hidden;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n min-height: 0;\n }\n nile-popover#color-picker-popover::part(popover) {\n min-width: 236px;\n gap: 0px;\n padding: 4px;\n }\n\n /* no fill */\n .ncp-no-fill {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n width: 100%;\n margin-top: 8px;\n padding: 8px 0;\n border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n border-radius: 8px;\n background: #FFFFFF;\n color: #475467;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s ease;\n }\n .ncp-no-fill:hover { background: #F9FAFB; }\n\n /* custom section */\n .ncp-custom-section {\n margin-top: 16px;\n padding-top: 8px;\n border-top: 1px solid #EAECF0;\n }\n .ncp-custom-title {\n margin: 0 0 8px;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary-700));\n font-size: 13px;\n font-weight: 600;\n line-height: 18px;\n font-weight: 500;\n }\n .ncp-custom-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 4px;\n }\n /* tooltip wrappers default to inline — must be block so flex aligns them correctly */\n .ncp-custom-row nile-lite-tooltip {\n display: block;\n line-height: 0;\n }\n .ncp-custom-row nile-color-swatch {\n display: block;\n }\n .ncp-action-btn {\n width: 24px;\n height: 24px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n border: 1.5px solid #CBD5E1;\n background: #FFFFFF;\n color: #111827;\n cursor: pointer;\n box-sizing: border-box;\n padding: 0;\n transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;\n }\n .ncp-action-btn:hover {\n border-color: #98A2B3;\n background: #F8FAFC;\n transform: translateY(-1px);\n }\n .ncp-plus-icon {\n position: relative;\n width: 12px;\n height: 12px;\n }\n .ncp-plus-icon::before,\n .ncp-plus-icon::after {\n content: '';\n position: absolute;\n left: 50%; top: 50%;\n background: currentColor;\n transform: translate(-50%,-50%);\n border-radius: 999px;\n }\n .ncp-plus-icon::before { width: 12px; height: 2px; }\n .ncp-plus-icon::after { width: 2px; height: 12px; }\n\n /* ── picker panel ───────────────────────────────────────────────── */\n .ncp-sv-area {\n position: relative;\n width: 244px;\n height: 130px;\n border-radius: 8px;\n overflow: hidden;\n cursor: crosshair;\n user-select: none;\n }\n .ncp-sv-canvas { display: block; width: 100%; height: 100%; }\n .ncp-sv-thumb {\n position: absolute;\n width: 20px; height: 20px;\n transform: translate(-50%,-50%);\n pointer-events: none;\n }\n .ncp-sv-thumb-inner {\n width: 20px; height: 20px;\n border-radius: 50%;\n border: 2.5px solid #FFFFFF;\n box-shadow: 0 0 0 1px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.2);\n box-sizing: border-box;\n }\n\n .ncp-hue-row {\n display: flex;\n align-items: center;\n gap: 10px;\n margin-top: 14px;\n }\n .ncp-hue-wrap {\n position: relative;\n flex: 1;\n height: 14px;\n border-radius: 7px;\n overflow: hidden;\n cursor: pointer;\n user-select: none;\n }\n .ncp-hue-canvas { display: block; width: 100%; height: 100%; border-radius: 7px; }\n .ncp-hue-thumb {\n position: absolute;\n top: 50%;\n width: 18px; height: 18px;\n border-radius: 50%;\n border: 2.5px solid #FFFFFF;\n box-shadow: 0 0 0 1px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.18);\n transform: translate(-50%,-50%);\n pointer-events: none;\n box-sizing: border-box;\n }\n .ncp-eyedropper {\n width: 28px; height: 28px;\n display: flex; align-items: center; justify-content: center;\n border: none; background: none;\n color: #475467; cursor: pointer; padding: 0; border-radius: 6px;\n }\n .ncp-eyedropper:hover { background: #F3F4F6; }\n\n .ncp-input-row {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 14px;\n }\n /* Safari: display:block needed so the custom element participates in flex layout */\n .ncp-input-row .ncp-mode-dropdown { display: block; flex-shrink: 0; width: 62px; min-width: 62px; }\n .ncp-input-row .ncp-mode-dropdown nile-button.ncp-mode-btn { width: 100%; min-width: 0; white-space: nowrap; }\n .ncp-input-row .ncp-mode-dropdown nile-button.ncp-mode-btn::part(base) {\n padding: 0 6px; width: 100%; min-width: 0; font-size: 11px; gap: 2px;\n }\n /* Safari: custom elements default to display:inline — must be block to flex-grow */\n .ncp-input-row nile-input.ncp-hex { display: block; flex: 1; min-width: 0; }\n .ncp-input-row nile-input.ncp-rgb { display: block; flex: 1; min-width: 0; }\n .ncp-input-row nile-input.ncp-rgb::part(input)::-webkit-inner-spin-button,\n .ncp-input-row nile-input.ncp-rgb::part(input)::-webkit-outer-spin-button { -webkit-appearance: none; }\n\n .ncp-picker-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 16px;\n }\n",this.insertBefore(e,this.firstChild)}_norm(e){const t=e.trim();if(/^#[0-9a-f]{6}$/i.test(t))return t.toUpperCase();if(/^#[0-9a-f]{3}$/i.test(t)){const[e,i,n]=t.slice(1).toUpperCase().split("");return`#${e}${e}${i}${i}${n}${n}`}return"#000000"}get _paletteColors(){return this.palette.length>0?this.palette:GS}_emit(e){this.dispatchEvent(new CustomEvent("nile-change",{detail:{value:e},bubbles:!0,composed:!0}))}_apply(e){const t=this._norm(e);this.value=t;const i={color:t,name:t};this._recentColors=[i,...this._recentColors.filter((e=>this._norm(e.color)!==t))].slice(0,this.recentColorsCount),this._emit(t),"popover"===this.mode&&"swatches"===this._view&&this._closePopover()}_closePopover(){const e=this.querySelector("nile-popover");e&&(e.isShow=!1)}_openPicker(){const[e,t,i]=FS(this._norm(this.value)),[n,o,M]=HS(e,t,i);this._hue=n,this._sat=o,this._val=M,this._syncInputs(),this._view="picker"}_syncInputs(){const[e,t,i]=$S(this._hue,this._sat,this._val),n=function(e,t,i){return"#"+[e,t,i].map((e=>e.toString(16).padStart(2,"0"))).join("").toUpperCase()}(e,t,i);this._hexInput=n,this._r=e,this._g=t,this._b=i,this._pendingColor=n}_drawSV(){const e=this._svCanvas;if(!e)return;const t=e.getContext("2d");if(!t)return;const{width:i,height:n}=e,[o,M,r]=$S(this._hue,1,1);t.fillStyle=`rgb(${o},${M},${r})`,t.fillRect(0,0,i,n);const s=t.createLinearGradient(0,0,i,0);s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=s,t.fillRect(0,0,i,n);const a=t.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=a,t.fillRect(0,0,i,n)}_drawHue(){const e=this._hueCanvas;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=t.createLinearGradient(0,0,e.width,0);["#FF0000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF","#FF0000"].forEach(((e,t,n)=>i.addColorStop(t/(n.length-1),e))),t.fillStyle=i,t.fillRect(0,0,e.width,e.height)}_commitPickerIfNoActions(){this.showActions||(this._apply(this._pendingColor),"popover"===this.mode&&("swatches"===this.type&&(this._view="swatches"),this._closePopover()))}_updateSV(e){const t=this._svCanvas;if(!t)return;const i=t.getBoundingClientRect();this._sat=Math.max(0,Math.min(e.clientX-i.left,i.width))/i.width,this._val=1-Math.max(0,Math.min(e.clientY-i.top,i.height))/i.height,this._syncInputs()}_updateHue(e){const t=this._hueCanvas;if(!t)return;const i=t.getBoundingClientRect();this._hue=Math.max(0,Math.min(e.clientX-i.left,i.width))/i.width*360,this._syncInputs()}_renderSwatch(e){const t=this._norm(e.color),i=this._norm(this.value)===t,n="name"===this.swatchTooltip?e.name||t:"value"===this.swatchTooltip?t:e.name?`${e.name} (${t})`:t;return _`
17527
17676
  <nile-lite-tooltip content=${n}>
17528
17677
  <nile-color-swatch
17529
17678
  color=${t}
@@ -17633,7 +17782,7 @@ nile-rich-text-editor[disabled] .editor a {
17633
17782
  ${this._renderTrigger()}
17634
17783
  ${e}
17635
17784
  </nile-popover>
17636
- `:e}};e([ue({type:String,attribute:!0,reflect:!0})],$S.prototype,"type",void 0),e([ue({type:String,attribute:!0,reflect:!0})],$S.prototype,"value",void 0),e([ue({type:String,reflect:!0})],$S.prototype,"swatchTooltip",void 0),e([ue({type:Number,reflect:!0})],$S.prototype,"recentColorsCount",void 0),e([ue({type:Boolean,reflect:!0})],$S.prototype,"noFill",void 0),e([ue({type:String,reflect:!0})],$S.prototype,"mode",void 0),e([ue({type:Boolean,reflect:!0})],$S.prototype,"showCanvas",void 0),e([ue({type:Boolean,reflect:!0})],$S.prototype,"showHue",void 0),e([ue({type:Boolean,reflect:!0})],$S.prototype,"showInputs",void 0),e([ue({type:Boolean,reflect:!0})],$S.prototype,"showActions",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],$S.prototype,"open",void 0),e([ue({attribute:"palette",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.map((e=>"string"==typeof e?{color:e,name:e}:e&&"string"==typeof e.color?{color:e.color,name:e.name||e.color}:null)).filter(Boolean):[]}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],$S.prototype,"palette",void 0),e([De()],$S.prototype,"_view",void 0),e([De()],$S.prototype,"_recentColors",void 0),e([De()],$S.prototype,"_hue",void 0),e([De()],$S.prototype,"_sat",void 0),e([De()],$S.prototype,"_val",void 0),e([De()],$S.prototype,"_colorMode",void 0),e([De()],$S.prototype,"_hexInput",void 0),e([De()],$S.prototype,"_r",void 0),e([De()],$S.prototype,"_g",void 0),e([De()],$S.prototype,"_b",void 0),$S=e([ge("nile-color-picker")],$S);const JS=r`
17785
+ `:e}};e([ue({type:String,attribute:!0,reflect:!0})],JS.prototype,"type",void 0),e([ue({type:String,attribute:!0,reflect:!0})],JS.prototype,"value",void 0),e([ue({type:String,reflect:!0})],JS.prototype,"swatchTooltip",void 0),e([ue({type:Number,reflect:!0})],JS.prototype,"recentColorsCount",void 0),e([ue({type:Boolean,reflect:!0})],JS.prototype,"noFill",void 0),e([ue({type:String,reflect:!0})],JS.prototype,"mode",void 0),e([ue({type:Boolean,reflect:!0})],JS.prototype,"showCanvas",void 0),e([ue({type:Boolean,reflect:!0})],JS.prototype,"showHue",void 0),e([ue({type:Boolean,reflect:!0})],JS.prototype,"showInputs",void 0),e([ue({type:Boolean,reflect:!0})],JS.prototype,"showActions",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],JS.prototype,"open",void 0),e([ue({attribute:"palette",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.map((e=>"string"==typeof e?{color:e,name:e}:e&&"string"==typeof e.color?{color:e.color,name:e.name||e.color}:null)).filter(Boolean):[]}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],JS.prototype,"palette",void 0),e([De()],JS.prototype,"_view",void 0),e([De()],JS.prototype,"_recentColors",void 0),e([De()],JS.prototype,"_hue",void 0),e([De()],JS.prototype,"_sat",void 0),e([De()],JS.prototype,"_val",void 0),e([De()],JS.prototype,"_colorMode",void 0),e([De()],JS.prototype,"_hexInput",void 0),e([De()],JS.prototype,"_r",void 0),e([De()],JS.prototype,"_g",void 0),e([De()],JS.prototype,"_b",void 0),JS=e([ge("nile-color-picker")],JS);const XS=r`
17637
17786
  :host {
17638
17787
  display: inline-block;
17639
17788
  }
@@ -17676,7 +17825,7 @@ nile-rich-text-editor[disabled] .editor a {
17676
17825
  --size: var(--nile-spacing-2xl, var(--ng-spacing-2xl));
17677
17826
  display: block;
17678
17827
  }
17679
- `;let XS=class extends ae{constructor(){super(...arguments),this.color="#000000",this.active=!1}static get styles(){return[JS]}_tickColor(){const e=this.color.replace("#","");if(6!==e.length)return"#FFFFFF";const t=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),M=.2126*o(t)+.7152*o(i)+.0722*o(n);return 1.05/(M+.05)>(M+.05)/.05?"#FFFFFF":"#111827"}render(){const e="swatch"+(this.active?" swatch--active":""),t=this._tickColor();return _`
17828
+ `;let qS=class extends ae{constructor(){super(...arguments),this.color="#000000",this.active=!1}static get styles(){return[XS]}_tickColor(){const e=this.color.replace("#","");if(6!==e.length)return"#FFFFFF";const t=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),M=.2126*o(t)+.7152*o(i)+.0722*o(n);return 1.05/(M+.05)>(M+.05)/.05?"#FFFFFF":"#111827"}render(){const e="swatch"+(this.active?" swatch--active":""),t=this._tickColor();return _`
17680
17829
  <button
17681
17830
  class=${e}
17682
17831
  part="base"
@@ -17691,7 +17840,7 @@ nile-rich-text-editor[disabled] .editor a {
17691
17840
  </span>
17692
17841
  `:B}
17693
17842
  </button>
17694
- `}};e([ue({type:String,reflect:!0})],XS.prototype,"color",void 0),e([ue({type:Boolean,reflect:!0})],XS.prototype,"active",void 0),XS=e([ge("nile-color-swatch")],XS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.8.1"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const qS=r`
17843
+ `}};e([ue({type:String,reflect:!0})],qS.prototype,"color",void 0),e([ue({type:Boolean,reflect:!0})],qS.prototype,"active",void 0),qS=e([ge("nile-color-swatch")],qS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.8.2"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const KS=r`
17695
17844
  :host {
17696
17845
 
17697
17846
  top: 0;
@@ -17772,13 +17921,13 @@ nile-rich-text-editor[disabled] .editor a {
17772
17921
 
17773
17922
 
17774
17923
 
17775
- `;let KS=class extends Fe{constructor(){super(...arguments),this.position="left",this.collapsed=!1,this.fullHeight=!1,this.width=null,this.collapsedWidth=null}static get styles(){return[qS]}updated(e){super.updated(e),e.has("collapsed")&&this.querySelectorAll("\n nile-side-bar-logo,\n nile-side-bar-footer-item,\n nile-side-bar-group-item,\n nile-side-bar-group,\n nile-side-bar-header,\n nile-side-bar-group-item-text,\n nile-side-bar-group-item-icon,\n nile-side-bar-expand\n ").forEach((e=>e.toggleAttribute("collapsed",this.collapsed))),e.has("width")&&null!==this.width&&this.style.setProperty("--sidebar-width",`${this.width}px`),e.has("collapsedWidth")&&null!==this.collapsedWidth&&this.style.setProperty("--sidebar-collapsed-width",`${this.collapsedWidth}px`)}render(){return _`
17924
+ `;let ew=class extends Fe{constructor(){super(...arguments),this.position="left",this.collapsed=!1,this.fullHeight=!1,this.width=null,this.collapsedWidth=null}static get styles(){return[KS]}updated(e){super.updated(e),e.has("collapsed")&&this.querySelectorAll("\n nile-side-bar-logo,\n nile-side-bar-footer-item,\n nile-side-bar-group-item,\n nile-side-bar-group,\n nile-side-bar-header,\n nile-side-bar-group-item-text,\n nile-side-bar-group-item-icon,\n nile-side-bar-expand\n ").forEach((e=>e.toggleAttribute("collapsed",this.collapsed))),e.has("width")&&null!==this.width&&this.style.setProperty("--sidebar-width",`${this.width}px`),e.has("collapsedWidth")&&null!==this.collapsedWidth&&this.style.setProperty("--sidebar-collapsed-width",`${this.collapsedWidth}px`)}render(){return _`
17776
17925
  <slot name="header" part="header"></slot>
17777
17926
  <div class="scroll-container" part="scroll-container">
17778
17927
  <slot></slot>
17779
17928
  </div>
17780
17929
  <slot name="footer" part="footer"></slot>
17781
- `}};e([ue({type:String,reflect:!0,attribute:!0})],KS.prototype,"position",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],KS.prototype,"collapsed",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],KS.prototype,"fullHeight",void 0),e([ue({type:Number,attribute:!0})],KS.prototype,"width",void 0),e([ue({type:Number,attribute:!0})],KS.prototype,"collapsedWidth",void 0),KS=e([ge("nile-side-bar")],KS);const ew=r`
17930
+ `}};e([ue({type:String,reflect:!0,attribute:!0})],ew.prototype,"position",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],ew.prototype,"collapsed",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],ew.prototype,"fullHeight",void 0),e([ue({type:Number,attribute:!0})],ew.prototype,"width",void 0),e([ue({type:Number,attribute:!0})],ew.prototype,"collapsedWidth",void 0),ew=e([ge("nile-side-bar")],ew);const tw=r`
17782
17931
  :host {
17783
17932
  display: flex;
17784
17933
  align-items: center;
@@ -17823,12 +17972,12 @@ nile-rich-text-editor[disabled] .editor a {
17823
17972
  gap: var(--nile-spacing-md);
17824
17973
  }
17825
17974
 
17826
- `;let tw=class extends Fe{static get styles(){return[ew]}render(){return _`
17975
+ `;let iw=class extends Fe{static get styles(){return[tw]}render(){return _`
17827
17976
  <div class="header-content" part="header-content">
17828
17977
  <slot name="logo" part="logo"></slot>
17829
17978
  <slot name="expand" part="expand"></slot>
17830
17979
  </div>
17831
- `}};tw=e([ge("nile-side-bar-header")],tw);const iw=r`
17980
+ `}};iw=e([ge("nile-side-bar-header")],iw);const nw=r`
17832
17981
  :host {
17833
17982
  justify-content: center;
17834
17983
  height: 100%;
@@ -17864,10 +18013,10 @@ nile-rich-text-editor[disabled] .editor a {
17864
18013
  :host(:not([collapsed])) .logo.collapsed {
17865
18014
  display: none;
17866
18015
  }
17867
- `;let nw=class extends Fe{constructor(){super(...arguments),this.src="https://assets.aquera.io/img/aquera-logo-blue.svg",this.collapsedSrc="https://assets.aqueralabs.com/img/aquera-logo-mini.png"}static get styles(){return[iw]}render(){return _`
18016
+ `;let ow=class extends Fe{constructor(){super(...arguments),this.src="https://assets.aquera.io/img/aquera-logo-blue.svg",this.collapsedSrc="https://assets.aqueralabs.com/img/aquera-logo-mini.png"}static get styles(){return[nw]}render(){return _`
17868
18017
  <img class="logo expanded" src="${this.src}" alt="Logo" part="logo-expanded" />
17869
18018
  <img class="logo collapsed" src="${this.collapsedSrc}" alt="Logo icon" part="logo-collapsed" />
17870
- `}};e([ue({type:String,attribute:!0,reflect:!0})],nw.prototype,"src",void 0),e([ue({type:String,attribute:"collapsed-src"})],nw.prototype,"collapsedSrc",void 0),nw=e([ge("nile-side-bar-logo")],nw);const ow=r`
18019
+ `}};e([ue({type:String,attribute:!0,reflect:!0})],ow.prototype,"src",void 0),e([ue({type:String,attribute:"collapsed-src"})],ow.prototype,"collapsedSrc",void 0),ow=e([ge("nile-side-bar-logo")],ow);const Mw=r`
17871
18020
  :host {
17872
18021
  display: inline-flex;
17873
18022
  }
@@ -17886,7 +18035,7 @@ nile-rich-text-editor[disabled] .editor a {
17886
18035
  transition: background-color 0.2s ease;
17887
18036
  }
17888
18037
 
17889
- `;let Mw=class extends Fe{constructor(){super(...arguments),this.collapsed=!1,this.expandTooltipText="Expand Sidebar",this.collapseTooltipText="Collapse Sidebar"}static get styles(){return[ow]}connectedCallback(){super.connectedCallback();const e=this.closest("nile-side-bar");e&&(this.collapsed=e.hasAttribute("collapsed"))}toggleSidebar(){const e=this.closest("nile-side-bar");if(!e)return;e.hasAttribute("collapsed")?(e.removeAttribute("collapsed"),this.collapsed=!1):(e.setAttribute("collapsed",""),this.collapsed=!0)}render(){return _`
18038
+ `;let rw=class extends Fe{constructor(){super(...arguments),this.collapsed=!1,this.expandTooltipText="Expand Sidebar",this.collapseTooltipText="Collapse Sidebar"}static get styles(){return[Mw]}connectedCallback(){super.connectedCallback();const e=this.closest("nile-side-bar");e&&(this.collapsed=e.hasAttribute("collapsed"))}toggleSidebar(){const e=this.closest("nile-side-bar");if(!e)return;e.hasAttribute("collapsed")?(e.removeAttribute("collapsed"),this.collapsed=!1):(e.setAttribute("collapsed",""),this.collapsed=!0)}render(){return _`
17890
18039
  <button class="expand-btn" part="expand-btn" @click=${this.toggleSidebar}>
17891
18040
  ${this.collapsed?_`
17892
18041
  <nile-lite-tooltip placement="right" hoist content=${this.expandTooltipText}>
@@ -17898,7 +18047,7 @@ nile-rich-text-editor[disabled] .editor a {
17898
18047
  </nile-lite-tooltip>
17899
18048
  `}
17900
18049
  </button>
17901
- `}};e([ue({type:Boolean,reflect:!0})],Mw.prototype,"collapsed",void 0),e([ue({type:String,reflect:!0,attribute:!0})],Mw.prototype,"expandTooltipText",void 0),e([ue({type:String,reflect:!0,attribute:!0})],Mw.prototype,"collapseTooltipText",void 0),Mw=e([ge("nile-side-bar-expand")],Mw);const rw=r`
18050
+ `}};e([ue({type:Boolean,reflect:!0})],rw.prototype,"collapsed",void 0),e([ue({type:String,reflect:!0,attribute:!0})],rw.prototype,"expandTooltipText",void 0),e([ue({type:String,reflect:!0,attribute:!0})],rw.prototype,"collapseTooltipText",void 0),rw=e([ge("nile-side-bar-expand")],rw);const sw=r`
17902
18051
  :host {
17903
18052
  display: flex;
17904
18053
  flex-direction: column;
@@ -17943,7 +18092,7 @@ nile-rich-text-editor[disabled] .editor a {
17943
18092
  align-items: center;
17944
18093
  justify-content: center;
17945
18094
  }
17946
- `;let sw=class extends Fe{constructor(){super(...arguments),this.label="",this.footer=!1,this.divider=!1}static get styles(){return[rw]}render(){return _`
18095
+ `;let aw=class extends Fe{constructor(){super(...arguments),this.label="",this.footer=!1,this.divider=!1}static get styles(){return[sw]}render(){return _`
17947
18096
  <section
17948
18097
  part="base"
17949
18098
  class="side-bar-group"
@@ -17954,7 +18103,7 @@ justify-content: center;
17954
18103
  ${this.label?_`<div part="label" class="group-label">${this.label}</div>`:null}
17955
18104
  <slot></slot>
17956
18105
  </section>
17957
- `}};e([ue({type:String})],sw.prototype,"label",void 0),e([ue({type:Boolean,reflect:!0})],sw.prototype,"footer",void 0),e([ue({type:Boolean,reflect:!0})],sw.prototype,"divider",void 0),sw=e([ge("nile-side-bar-group")],sw);const aw=r`
18106
+ `}};e([ue({type:String})],aw.prototype,"label",void 0),e([ue({type:Boolean,reflect:!0})],aw.prototype,"footer",void 0),e([ue({type:Boolean,reflect:!0})],aw.prototype,"divider",void 0),aw=e([ge("nile-side-bar-group")],aw);const lw=r`
17958
18107
  :host {
17959
18108
  display: block;
17960
18109
  }
@@ -18014,7 +18163,7 @@ justify-content: center;
18014
18163
  pointer-events: none;
18015
18164
  cursor: not-allowed;
18016
18165
  }
18017
- `;let lw=class extends Fe{constructor(){super(...arguments),this.link=null,this.active=!1,this.type="default",this.expanded=!1,this.disabled=!1}static get styles(){return[aw]}toggleExpand(){"dropdown"!==this.type&&"popover"!==this.type||this.disabled||(this.expanded=!this.expanded)}connectedCallback(){super.connectedCallback(),this.link&&window.location.pathname===this.link&&(this.active=!0)}handleSelect(e){if(e.preventDefault(),this.disabled)return void e.stopImmediatePropagation();this.link||e.preventDefault();const t=this.closest("nile-side-bar");t&&t.querySelectorAll("nile-side-bar-group-item[active]").forEach((e=>{e!==this&&(e.active=!1,e.expanded=!1)})),this.active=!0,"dropdown"!==this.type&&"popover"!==this.type||this.disabled||(this.expanded=!0),this.dispatchEvent(new CustomEvent("nile-click",{bubbles:!0,composed:!0,detail:{href:this.link,text:this.textContent?.trim()||"",type:this.type}}))}render(){const e="dropdown"===this.type||"popover"===this.type;return _`
18166
+ `;let gw=class extends Fe{constructor(){super(...arguments),this.link=null,this.active=!1,this.type="default",this.expanded=!1,this.disabled=!1}static get styles(){return[lw]}toggleExpand(){"dropdown"!==this.type&&"popover"!==this.type||this.disabled||(this.expanded=!this.expanded)}connectedCallback(){super.connectedCallback(),this.link&&window.location.pathname===this.link&&(this.active=!0)}handleSelect(e){if(e.preventDefault(),this.disabled)return void e.stopImmediatePropagation();this.link||e.preventDefault();const t=this.closest("nile-side-bar");t&&t.querySelectorAll("nile-side-bar-group-item[active]").forEach((e=>{e!==this&&(e.active=!1,e.expanded=!1)})),this.active=!0,"dropdown"!==this.type&&"popover"!==this.type||this.disabled||(this.expanded=!0),this.dispatchEvent(new CustomEvent("nile-click",{bubbles:!0,composed:!0,detail:{href:this.link,text:this.textContent?.trim()||"",type:this.type}}))}render(){const e="dropdown"===this.type||"popover"===this.type;return _`
18018
18167
  <div
18019
18168
  part="base"
18020
18169
  class="group-item ${this.disabled?"disabled":""}"
@@ -18058,7 +18207,7 @@ justify-content: center;
18058
18207
  <slot name="content"></slot>
18059
18208
  </div>
18060
18209
  `:null}
18061
- `}};e([ue({type:String})],lw.prototype,"link",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],lw.prototype,"active",void 0),e([ue({type:String,reflect:!0})],lw.prototype,"type",void 0),e([ue({type:Boolean,reflect:!0})],lw.prototype,"expanded",void 0),e([ue({type:Boolean,reflect:!0})],lw.prototype,"disabled",void 0),lw=e([ge("nile-side-bar-group-item")],lw);const gw=r`
18210
+ `}};e([ue({type:String})],gw.prototype,"link",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],gw.prototype,"active",void 0),e([ue({type:String,reflect:!0})],gw.prototype,"type",void 0),e([ue({type:Boolean,reflect:!0})],gw.prototype,"expanded",void 0),e([ue({type:Boolean,reflect:!0})],gw.prototype,"disabled",void 0),gw=e([ge("nile-side-bar-group-item")],gw);const Nw=r`
18062
18211
  :host {
18063
18212
  display: inline-flex;
18064
18213
  align-items: center;
@@ -18091,7 +18240,7 @@ justify-content: center;
18091
18240
  padding-right: var(--nile-spacing-sm, var(--ng-spacing-sm));
18092
18241
  overflow-x: hidden;
18093
18242
  }
18094
- `;let Nw=class extends Fe{constructor(){super(...arguments),this.icon="",this.tooltip="",this.method="fill",this.size="14",this.enableVisibilityEffect=!1,this.duration=200,this.sidebar=null}static get styles(){return[gw]}connectedCallback(){if(this.hasAttribute("slot")||this.setAttribute("slot","icon"),super.connectedCallback(),this.sidebar=this.closest("nile-side-bar"),this.sidebar){const e=new MutationObserver((()=>this.requestUpdate()));e.observe(this.sidebar,{attributes:!0,attributeFilter:["collapsed"]}),this._observer=e}}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}getSiblingText(){const e=this.parentElement,t=e?.querySelector("nile-side-bar-group-item-text");return t?.textContent?.trim()??""}render(){const e=!!this.sidebar?.collapsed,t=this.tooltip||this.getSiblingText();return e&&t?_`
18243
+ `;let cw=class extends Fe{constructor(){super(...arguments),this.icon="",this.tooltip="",this.method="fill",this.size="14",this.enableVisibilityEffect=!1,this.duration=200,this.sidebar=null}static get styles(){return[Nw]}connectedCallback(){if(this.hasAttribute("slot")||this.setAttribute("slot","icon"),super.connectedCallback(),this.sidebar=this.closest("nile-side-bar"),this.sidebar){const e=new MutationObserver((()=>this.requestUpdate()));e.observe(this.sidebar,{attributes:!0,attributeFilter:["collapsed"]}),this._observer=e}}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}getSiblingText(){const e=this.parentElement,t=e?.querySelector("nile-side-bar-group-item-text");return t?.textContent?.trim()??""}render(){const e=!!this.sidebar?.collapsed,t=this.tooltip||this.getSiblingText();return e&&t?_`
18095
18244
 
18096
18245
  <slot>
18097
18246
  <nile-lite-tooltip hoist distance="18" content=${t} placement="right" enableVisibilityEffect=${this.enableVisibilityEffect} duration=${this.duration}>
@@ -18103,7 +18252,7 @@ justify-content: center;
18103
18252
  <slot>
18104
18253
  ${this.icon?_`<nile-icon size=${this.size} color="var(--nile-colors-dark-900,var(--ng-colors-fg-quaternary-400))" size="14" name=${this.icon} method=${this.method}></nile-icon>`:null}
18105
18254
  </slot>
18106
- `}};e([ue({type:String,reflect:!0})],Nw.prototype,"icon",void 0),e([ue({type:String})],Nw.prototype,"tooltip",void 0),e([ue({type:String})],Nw.prototype,"method",void 0),e([ue({type:String})],Nw.prototype,"size",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],Nw.prototype,"enableVisibilityEffect",void 0),e([ue({type:Number,attribute:!0,reflect:!0})],Nw.prototype,"duration",void 0),Nw=e([ge("nile-side-bar-group-item-icon")],Nw);const cw=r`
18255
+ `}};e([ue({type:String,reflect:!0})],cw.prototype,"icon",void 0),e([ue({type:String})],cw.prototype,"tooltip",void 0),e([ue({type:String})],cw.prototype,"method",void 0),e([ue({type:String})],cw.prototype,"size",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],cw.prototype,"enableVisibilityEffect",void 0),e([ue({type:Number,attribute:!0,reflect:!0})],cw.prototype,"duration",void 0),cw=e([ge("nile-side-bar-group-item-icon")],cw);const uw=r`
18107
18256
  :host {
18108
18257
  display: block;
18109
18258
  flex: 1 1 auto;
@@ -18125,7 +18274,7 @@ justify-content: center;
18125
18274
  :host([collapsed]) {
18126
18275
  display: none;
18127
18276
  }
18128
- `;let uw=class extends Fe{static get styles(){return[cw]}connectedCallback(){super.connectedCallback(),this.hasAttribute("slot")||this.setAttribute("slot","text")}render(){return _` <slot></slot> `}};uw=e([ge("nile-side-bar-group-item-text")],uw);const Dw=r`
18277
+ `;let Dw=class extends Fe{static get styles(){return[uw]}connectedCallback(){super.connectedCallback(),this.hasAttribute("slot")||this.setAttribute("slot","text")}render(){return _` <slot></slot> `}};Dw=e([ge("nile-side-bar-group-item-text")],Dw);const dw=r`
18129
18278
  :host {
18130
18279
  display: block;
18131
18280
  bottom: var(--nile-spacing-md);
@@ -18162,11 +18311,11 @@ justify-content: center;
18162
18311
 
18163
18312
 
18164
18313
 
18165
- `;let dw=class extends Fe{static get styles(){return[Dw]}render(){return _`
18314
+ `;let hw=class extends Fe{static get styles(){return[dw]}render(){return _`
18166
18315
  <div part="base" class="footer">
18167
18316
  <slot> </slot>
18168
18317
  </div>
18169
- `}};dw=e([ge("nile-side-bar-footer")],dw);const hw=r`
18318
+ `}};hw=e([ge("nile-side-bar-footer")],hw);const jw=r`
18170
18319
  :host {
18171
18320
  display: block;
18172
18321
  width: 100%;
@@ -18254,13 +18403,13 @@ border: none;
18254
18403
  height: 38px;
18255
18404
  width: 38px;
18256
18405
  }
18257
- `;let jw=class extends Fe{constructor(){super(...arguments),this.type=null}static get styles(){return[hw]}handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{type:this.type},bubbles:!0,composed:!0}))}render(){return _`
18406
+ `;let Iw=class extends Fe{constructor(){super(...arguments),this.type=null}static get styles(){return[jw]}handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{type:this.type},bubbles:!0,composed:!0}))}render(){return _`
18258
18407
  <div part="base" class="footer-item" @click=${this.handleClick}>
18259
18408
  <slot name="icon" part="icon"></slot>
18260
18409
  <slot name="text" part="text"></slot>
18261
18410
  <slot name="action" part="action"></slot>
18262
18411
  </div>
18263
- `}};e([ue({type:String,reflect:!0})],jw.prototype,"type",void 0),jw=e([ge("nile-side-bar-footer-item")],jw);const Iw=r`
18412
+ `}};e([ue({type:String,reflect:!0})],Iw.prototype,"type",void 0),Iw=e([ge("nile-side-bar-footer-item")],Iw);const zw=r`
18264
18413
  :host {
18265
18414
  display: inline-block;
18266
18415
  -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
@@ -18310,7 +18459,7 @@ border: none;
18310
18459
  max-width: var(--auto-size-available-width) !important;
18311
18460
  max-height: var(--auto-size-available-height) !important;
18312
18461
  }
18313
- `;class zw{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,n=window.innerWidth,o=i-t.bottom,M=t.top,r=n-t.right;return{spaceAbove:M,spaceBelow:o,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:n}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":o>=200&&o>=n?"right":n>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),n=e.overflow,o=e.overflowY,M=e.overflowX;"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o&&"auto"!==M&&"scroll"!==M||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const n=t-(e.y+e.height),o=e.y;return i.startsWith("top")?Math.max(o-20,100):i.startsWith("bottom")?Math.max(n-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(o,n)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:n,spaceLeft:o,spaceRight:M}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&n>i)&&(!(s&&i>n)&&(!(a&&M>o)&&!(l&&o>M)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:n}=t.flip;if(e.setAttribute("data-placement",i),n&&n.length>0){const t=n.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:n}=t.shift;void 0===i||void 0===n||0===i&&0===n?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${n}`)}if(t.size){const{availableWidth:i,availableHeight:n}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==n&&e.setAttribute("data-available-height",n.toString())}}}class yw{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const n=document.createElement("div");return n.className="dropdown__panel",n.setAttribute("part","panel"),n.setAttribute("aria-hidden","false"),n.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);n.appendChild(t)})),n}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let n=i?.assignedElements({flatten:!0})||[];if(0===n.length){n=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}n.forEach((t=>{const i=t.cloneNode(!0);e.appendChild(i)}))}}class pw{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}}class Tw{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:n,placement:o,middlewareData:M}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,n,o,M)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=zw.findBoundaryElements(e),n=this.getInitialPlacement(),o=this.createFloatingUIMiddleware(i);return await pn(e,t,{placement:n,strategy:"fixed",middleware:o,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[hn(this.component.distance||0)];return this.component.sync&&t.push(zn({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(In({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(jn({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:n}){const o=zw.calculateOptimalHeight(n.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${n.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${n.reference.height}px`),i.floating.style.maxHeight=`${o}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${o}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return un}applyFloatingUIPosition(e,t,i,n,o,M){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${n}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=o,this.currentMiddlewareData=M,zw.applyCollisionData(e,M,o);const s=o.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,n=t-e.bottom,o=e.top,M=i-e.right,r=e.left;let s,a,l,g=e.left;const N=this.component.placement||"bottom-start";N.startsWith("bottom")?(l=Math.max(n-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):N.startsWith("top")?(l=Math.max(o-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):N.startsWith("right")?(l=Math.max(Math.min(M,n,o)-20,100),s=e.top,g=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,n,o)-20,100),s=e.top,g=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${g}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const n=window.innerHeight,o=window.innerWidth;let M,r=o-e.left-10;"top"===i?M=e.top-10:"bottom"===i?M=n-e.bottom-10:"left"===i?(M=Math.min(n-e.top,e.bottom),r=e.left-10):(M=Math.min(n-e.top,e.bottom),r=o-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(M,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=dn(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=zw.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=zw.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return yw.createPortalPanel(this.component)}setupPortalEventListeners(){pw.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,n=this.currentPlacement.startsWith("top"),o=this.currentPlacement.startsWith("bottom");return!(n&&t>i)&&!(o&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(yw.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition())}}let Aw=class extends Fe{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.portal=!1,this.portalManager=null,this.triggerDropdown="click"}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new Tw(this))}))}firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const e=this.trigger;e&&(e.addEventListener("mouseenter",this.handleTriggerMouseEnter),e.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0)}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===e.key&&setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),n=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||n||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),n=i[0],o=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(n),n.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>qt(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,Jt(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,Jt(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new Tw(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new Tw(this),this.portalManager.setupPortalAppend()),await Yt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=Rt(this,"dropdown.show",{dir:""});await Qt(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await Yt(this),!this.portal){const{keyframes:e,options:t}=Rt(this,"dropdown.hide",{dir:""});await Qt(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return _`
18462
+ `;class yw{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,n=window.innerWidth,o=i-t.bottom,M=t.top,r=n-t.right;return{spaceAbove:M,spaceBelow:o,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:n}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":o>=200&&o>=n?"right":n>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),n=e.overflow,o=e.overflowY,M=e.overflowX;"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o&&"auto"!==M&&"scroll"!==M||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const n=t-(e.y+e.height),o=e.y;return i.startsWith("top")?Math.max(o-20,100):i.startsWith("bottom")?Math.max(n-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(o,n)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:n,spaceLeft:o,spaceRight:M}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&n>i)&&(!(s&&i>n)&&(!(a&&M>o)&&!(l&&o>M)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:n}=t.flip;if(e.setAttribute("data-placement",i),n&&n.length>0){const t=n.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:n}=t.shift;void 0===i||void 0===n||0===i&&0===n?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${n}`)}if(t.size){const{availableWidth:i,availableHeight:n}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==n&&e.setAttribute("data-available-height",n.toString())}}}class pw{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const n=document.createElement("div");return n.className="dropdown__panel",n.setAttribute("part","panel"),n.setAttribute("aria-hidden","false"),n.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);n.appendChild(t)})),n}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let n=i?.assignedElements({flatten:!0})||[];if(0===n.length){n=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}n.forEach((t=>{const i=t.cloneNode(!0);e.appendChild(i)}))}}class Tw{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}}class Aw{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:n,placement:o,middlewareData:M}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,n,o,M)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=yw.findBoundaryElements(e),n=this.getInitialPlacement(),o=this.createFloatingUIMiddleware(i);return await pn(e,t,{placement:n,strategy:"fixed",middleware:o,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[hn(this.component.distance||0)];return this.component.sync&&t.push(zn({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(In({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(jn({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:n}){const o=yw.calculateOptimalHeight(n.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${n.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${n.reference.height}px`),i.floating.style.maxHeight=`${o}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${o}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return un}applyFloatingUIPosition(e,t,i,n,o,M){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${n}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=o,this.currentMiddlewareData=M,yw.applyCollisionData(e,M,o);const s=o.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,n=t-e.bottom,o=e.top,M=i-e.right,r=e.left;let s,a,l,g=e.left;const N=this.component.placement||"bottom-start";N.startsWith("bottom")?(l=Math.max(n-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):N.startsWith("top")?(l=Math.max(o-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):N.startsWith("right")?(l=Math.max(Math.min(M,n,o)-20,100),s=e.top,g=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,n,o)-20,100),s=e.top,g=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${g}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const n=window.innerHeight,o=window.innerWidth;let M,r=o-e.left-10;"top"===i?M=e.top-10:"bottom"===i?M=n-e.bottom-10:"left"===i?(M=Math.min(n-e.top,e.bottom),r=e.left-10):(M=Math.min(n-e.top,e.bottom),r=o-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(M,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=dn(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=yw.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=yw.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return pw.createPortalPanel(this.component)}setupPortalEventListeners(){Tw.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,n=this.currentPlacement.startsWith("top"),o=this.currentPlacement.startsWith("bottom");return!(n&&t>i)&&!(o&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(pw.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition())}}let Ow=class extends Fe{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.portal=!1,this.portalManager=null,this.triggerDropdown="click"}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new Aw(this))}))}firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const e=this.trigger;e&&(e.addEventListener("mouseenter",this.handleTriggerMouseEnter),e.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0)}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===e.key&&setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),n=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||n||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),n=i[0],o=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(n),n.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>qt(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,Jt(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,Jt(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new Aw(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new Aw(this),this.portalManager.setupPortalAppend()),await Yt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=Rt(this,"dropdown.show",{dir:""});await Qt(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await Yt(this),!this.portal){const{keyframes:e,options:t}=Rt(this,"dropdown.hide",{dir:""});await Qt(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return _`
18314
18463
  <nile-popup
18315
18464
  part="base"
18316
18465
  id="sidebar-action-dropdown"
@@ -18344,7 +18493,7 @@ border: none;
18344
18493
  style=${this.portal&&this.portalManager?"display: none;":""}
18345
18494
  ></slot>
18346
18495
  </nile-popup>
18347
- `}};Aw.styles=[Iw],e([he(".dropdown")],Aw.prototype,"popup",void 0),e([he(".dropdown__trigger")],Aw.prototype,"trigger",void 0),e([he(".dropdown__panel")],Aw.prototype,"panel",void 0),e([ue({type:Boolean,reflect:!0})],Aw.prototype,"open",void 0),e([ue({reflect:!0})],Aw.prototype,"placement",void 0),e([ue({type:Boolean,reflect:!0})],Aw.prototype,"disabled",void 0),e([ue({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],Aw.prototype,"stayOpenOnSelect",void 0),e([ue({attribute:!1})],Aw.prototype,"containingElement",void 0),e([ue({type:Number})],Aw.prototype,"distance",void 0),e([ue({type:Number})],Aw.prototype,"skidding",void 0),e([ue()],Aw.prototype,"sync",void 0),e([ue({type:Boolean})],Aw.prototype,"hoist",void 0),e([ue({type:Boolean,reflect:!0})],Aw.prototype,"portal",void 0),e([ue({reflect:!0})],Aw.prototype,"triggerDropdown",void 0),e([We("open",{waitUntilFirstUpdate:!0})],Aw.prototype,"handleOpenChange",null),Aw=e([ge("nile-side-bar-action")],Aw),_t("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),_t("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});const Ow=r`
18496
+ `}};Ow.styles=[zw],e([he(".dropdown")],Ow.prototype,"popup",void 0),e([he(".dropdown__trigger")],Ow.prototype,"trigger",void 0),e([he(".dropdown__panel")],Ow.prototype,"panel",void 0),e([ue({type:Boolean,reflect:!0})],Ow.prototype,"open",void 0),e([ue({reflect:!0})],Ow.prototype,"placement",void 0),e([ue({type:Boolean,reflect:!0})],Ow.prototype,"disabled",void 0),e([ue({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],Ow.prototype,"stayOpenOnSelect",void 0),e([ue({attribute:!1})],Ow.prototype,"containingElement",void 0),e([ue({type:Number})],Ow.prototype,"distance",void 0),e([ue({type:Number})],Ow.prototype,"skidding",void 0),e([ue()],Ow.prototype,"sync",void 0),e([ue({type:Boolean})],Ow.prototype,"hoist",void 0),e([ue({type:Boolean,reflect:!0})],Ow.prototype,"portal",void 0),e([ue({reflect:!0})],Ow.prototype,"triggerDropdown",void 0),e([We("open",{waitUntilFirstUpdate:!0})],Ow.prototype,"handleOpenChange",null),Ow=e([ge("nile-side-bar-action")],Ow),_t("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),_t("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});const xw=r`
18348
18497
  :host {
18349
18498
  display: block;
18350
18499
  line-height: 20px;
@@ -18373,12 +18522,12 @@ border: none;
18373
18522
  overflow: hidden;
18374
18523
  text-overflow: ellipsis;
18375
18524
  }
18376
- `;let xw=class extends Fe{constructor(){super(...arguments),this.text="",this.subtext=""}static get styles(){return[Ow]}render(){return _`
18525
+ `;let Lw=class extends Fe{constructor(){super(...arguments),this.text="",this.subtext=""}static get styles(){return[xw]}render(){return _`
18377
18526
  <div class="footer-text" part="footer-text">
18378
18527
  <div class="main" part="main">${this.text}</div>
18379
18528
  ${this.subtext?_`<div class="sub" part="sub">${this.subtext}</div>`:null}
18380
18529
  </div>
18381
- `}};e([ue({type:String})],xw.prototype,"text",void 0),e([ue({type:String})],xw.prototype,"subtext",void 0),xw=e([ge("nile-side-bar-footer-text")],xw);const Lw=r`
18530
+ `}};e([ue({type:String})],Lw.prototype,"text",void 0),e([ue({type:String})],Lw.prototype,"subtext",void 0),Lw=e([ge("nile-side-bar-footer-text")],Lw);const mw=r`
18382
18531
  :host {
18383
18532
  box-sizing: border-box;
18384
18533
  -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
@@ -18505,7 +18654,7 @@ border: none;
18505
18654
  }
18506
18655
 
18507
18656
  }
18508
- `;let mw=class extends Fe{constructor(){super(...arguments),this.type="normal",this.checked=!1,this.value="",this.disabled=!1,this.hasSubMenu=!1}connectedCallback(){super.connectedCallback(),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick)}handleDefaultSlotChange(){const e=this.getTextLabel();void 0!==this.cachedTextLabel?e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange")):this.cachedTextLabel=e}handleHostClick(e){this.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}handleCheckedChange(){if(this.checked&&"checkbox"!==this.type)return this.checked=!1,void console.error('The checked attribute can only be used on menu items with type="checkbox"',this);"checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleTypeChange(){"checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return Ve(this.defaultSlot)}render(){return _`
18657
+ `;let Sw=class extends Fe{constructor(){super(...arguments),this.type="normal",this.checked=!1,this.value="",this.disabled=!1,this.hasSubMenu=!1}connectedCallback(){super.connectedCallback(),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick)}handleDefaultSlotChange(){const e=this.getTextLabel();void 0!==this.cachedTextLabel?e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange")):this.cachedTextLabel=e}handleHostClick(e){this.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}handleCheckedChange(){if(this.checked&&"checkbox"!==this.type)return this.checked=!1,void console.error('The checked attribute can only be used on menu items with type="checkbox"',this);"checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleTypeChange(){"checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return Ve(this.defaultSlot)}render(){return _`
18509
18658
  <div
18510
18659
  part="base"
18511
18660
  class=${xe({"menu-item":!0,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--has-submenu":this.hasSubMenu})}
@@ -18541,7 +18690,7 @@ border: none;
18541
18690
  ></nile-icon>
18542
18691
  </span>`:""}
18543
18692
  </div>
18544
- `}};mw.styles=Lw,e([he("slot:not([name])")],mw.prototype,"defaultSlot",void 0),e([he(".menu-item")],mw.prototype,"menuItem",void 0),e([ue()],mw.prototype,"type",void 0),e([ue({type:Boolean,reflect:!0})],mw.prototype,"checked",void 0),e([ue()],mw.prototype,"value",void 0),e([ue({type:Boolean,reflect:!0})],mw.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0})],mw.prototype,"hasSubMenu",void 0),e([We("checked")],mw.prototype,"handleCheckedChange",null),e([We("disabled")],mw.prototype,"handleDisabledChange",null),e([We("type")],mw.prototype,"handleTypeChange",null),mw=e([ge("nile-side-bar-action-menu-item")],mw);const Sw=r`
18693
+ `}};Sw.styles=mw,e([he("slot:not([name])")],Sw.prototype,"defaultSlot",void 0),e([he(".menu-item")],Sw.prototype,"menuItem",void 0),e([ue()],Sw.prototype,"type",void 0),e([ue({type:Boolean,reflect:!0})],Sw.prototype,"checked",void 0),e([ue()],Sw.prototype,"value",void 0),e([ue({type:Boolean,reflect:!0})],Sw.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0})],Sw.prototype,"hasSubMenu",void 0),e([We("checked")],Sw.prototype,"handleCheckedChange",null),e([We("disabled")],Sw.prototype,"handleDisabledChange",null),e([We("type")],Sw.prototype,"handleTypeChange",null),Sw=e([ge("nile-side-bar-action-menu-item")],Sw);const ww=r`
18545
18694
  :host {
18546
18695
  display: block;
18547
18696
  position: relative;
@@ -18601,7 +18750,7 @@ border: none;
18601
18750
  .menu__footer:hover {
18602
18751
  background-color:var(--nile-menu-item-background-color, var(--ng-colors-bg-secondary));
18603
18752
  }
18604
- `;let ww=class extends Fe{constructor(){super(...arguments),this.searchValue="",this.searchWidth=0,this.searchEnabled=!1,this.customSearch=!1,this.showNoResults=!1,this.allowSpaceKey=!1,this.noResultsMessage="No results found",this.hasSlotController=new Ze(this,"menu__footer","menu__header")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){const t=e.target.closest("nile-menu-item");t?.hasSubMenu||t&&!t.disabled&&("checkbox"===t.type&&(t.checked=!t.checked),this.emit("nile-select",{value:t.value}))}handleKeyDown(e){if("Enter"===e.key){const t=this.getCurrentItem();e.preventDefault(),t?.click()}if(this.allowSpaceKey||" "!==e.key||e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getAllItems(),i=this.getCurrentItem();let n=i?t.indexOf(i):0;t.length>0&&(e.preventDefault(),"ArrowDown"===e.key?n++:"ArrowUp"===e.key?n--:"Home"===e.key?n=0:"End"===e.key&&(n=t.length-1),n<0&&(n=t.length-1),n>t.length-1&&(n=0),this.setCurrentItem(t[n]),t[n].focus())}}handleMouseDown(e){const t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){const e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){return"nile-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes(e.getAttribute("role")??"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter((e=>!!this.isMenuItem(e)))}getCurrentItem(){return this.getAllItems().find((e=>"0"===e.getAttribute("tabindex")))}setCurrentItem(e){this.getAllItems().forEach((t=>{t.setAttribute("tabindex",t===e?"0":"-1")}))}handleSearchChange(e){let t=this.getAllItems(),i=e.target.value;if(this.customSearch)return void this.emit("nile-search-value",{value:i});let n=0;t.map((t=>{this.searchWidth=Math.max(this.searchWidth,t.offsetWidth),t.innerText.toLowerCase().includes(e.target.value.toLowerCase())?(t.style.display="block",n++):t.style.display="none"})),this.showNoResults=0===n}render(){return _`
18753
+ `;let Ew=class extends Fe{constructor(){super(...arguments),this.searchValue="",this.searchWidth=0,this.searchEnabled=!1,this.customSearch=!1,this.showNoResults=!1,this.allowSpaceKey=!1,this.noResultsMessage="No results found",this.hasSlotController=new Ze(this,"menu__footer","menu__header")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){const t=e.target.closest("nile-menu-item");t?.hasSubMenu||t&&!t.disabled&&("checkbox"===t.type&&(t.checked=!t.checked),this.emit("nile-select",{value:t.value}))}handleKeyDown(e){if("Enter"===e.key){const t=this.getCurrentItem();e.preventDefault(),t?.click()}if(this.allowSpaceKey||" "!==e.key||e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getAllItems(),i=this.getCurrentItem();let n=i?t.indexOf(i):0;t.length>0&&(e.preventDefault(),"ArrowDown"===e.key?n++:"ArrowUp"===e.key?n--:"Home"===e.key?n=0:"End"===e.key&&(n=t.length-1),n<0&&(n=t.length-1),n>t.length-1&&(n=0),this.setCurrentItem(t[n]),t[n].focus())}}handleMouseDown(e){const t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){const e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){return"nile-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes(e.getAttribute("role")??"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter((e=>!!this.isMenuItem(e)))}getCurrentItem(){return this.getAllItems().find((e=>"0"===e.getAttribute("tabindex")))}setCurrentItem(e){this.getAllItems().forEach((t=>{t.setAttribute("tabindex",t===e?"0":"-1")}))}handleSearchChange(e){let t=this.getAllItems(),i=e.target.value;if(this.customSearch)return void this.emit("nile-search-value",{value:i});let n=0;t.map((t=>{this.searchWidth=Math.max(this.searchWidth,t.offsetWidth),t.innerText.toLowerCase().includes(e.target.value.toLowerCase())?(t.style.display="block",n++):t.style.display="none"})),this.showNoResults=0===n}render(){return _`
18605
18754
  <slot name="menu__pre-header" part="menu__pre-header" @click=${e=>{e.stopPropagation()}}></slot>
18606
18755
  ${this.searchEnabled?_`<div class="search__wrapper" part="search__wrapper">
18607
18756
  <nile-input
@@ -18641,7 +18790,7 @@ border: none;
18641
18790
  class="menu__footer"
18642
18791
  ></slot>`:null}
18643
18792
 
18644
- `}};ww.styles=Sw,e([De()],ww.prototype,"searchValue",void 0),e([De()],ww.prototype,"searchWidth",void 0),e([ue({type:Boolean,reflect:!0})],ww.prototype,"searchEnabled",void 0),e([ue({type:Boolean,reflect:!0})],ww.prototype,"customSearch",void 0),e([ue({type:Boolean})],ww.prototype,"showNoResults",void 0),e([ue({type:Boolean})],ww.prototype,"allowSpaceKey",void 0),e([ue({type:String})],ww.prototype,"noResultsMessage",void 0),e([he("slot:not([name])")],ww.prototype,"defaultSlot",void 0),ww=e([ge("nile-side-bar-action-menu")],ww);const Ew=r`
18793
+ `}};Ew.styles=ww,e([De()],Ew.prototype,"searchValue",void 0),e([De()],Ew.prototype,"searchWidth",void 0),e([ue({type:Boolean,reflect:!0})],Ew.prototype,"searchEnabled",void 0),e([ue({type:Boolean,reflect:!0})],Ew.prototype,"customSearch",void 0),e([ue({type:Boolean})],Ew.prototype,"showNoResults",void 0),e([ue({type:Boolean})],Ew.prototype,"allowSpaceKey",void 0),e([ue({type:String})],Ew.prototype,"noResultsMessage",void 0),e([he("slot:not([name])")],Ew.prototype,"defaultSlot",void 0),Ew=e([ge("nile-side-bar-action-menu")],Ew);const bw=r`
18645
18794
  :host {
18646
18795
  display: block;
18647
18796
  }
@@ -18672,7 +18821,7 @@ border: none;
18672
18821
  flex-direction: column;
18673
18822
  gap: var(--nile-spacing-xs, var(--ng-spacing-xs));
18674
18823
  }
18675
- `;let bw=class extends Fe{constructor(){super(...arguments),this.label="",this.divider=!1}static get styles(){return[Ew]}render(){return _`
18824
+ `;let kw=class extends Fe{constructor(){super(...arguments),this.label="",this.divider=!1}static get styles(){return[bw]}render(){return _`
18676
18825
  <div class="group">
18677
18826
  ${this.label||this.hasLabelSlot()?_`
18678
18827
  <div class="group-label">
@@ -18683,7 +18832,7 @@ border: none;
18683
18832
  <slot></slot>
18684
18833
  </div>
18685
18834
  </div>
18686
- `}hasLabelSlot(){const e=this.shadowRoot?.querySelector('slot[name="label"]');return!!e}};e([ue({type:String})],bw.prototype,"label",void 0),e([ue({type:Boolean,reflect:!0})],bw.prototype,"divider",void 0),bw=e([ge("nile-inline-sidebar-group")],bw);const kw=r`
18835
+ `}hasLabelSlot(){const e=this.shadowRoot?.querySelector('slot[name="label"]');return!!e}};e([ue({type:String})],kw.prototype,"label",void 0),e([ue({type:Boolean,reflect:!0})],kw.prototype,"divider",void 0),kw=e([ge("nile-inline-sidebar-group")],kw);const vw=r`
18687
18836
  :host {
18688
18837
  display: flex;
18689
18838
  height: 100%;
@@ -18855,7 +19004,7 @@ border: none;
18855
19004
  padding-right: 0;
18856
19005
  padding-left: var(--nile-spacing-xl, var(--ng-spacing-xl));
18857
19006
  }
18858
- `;let vw=class extends Fe{constructor(){super(...arguments),this.collapsed=!1,this.fixed=!1,this.showTooltip=!1,this.placement="left",this.resizable=!1,this.sidebarWidth=216,this.minSidebarWidth=120,this.showToggleBtn=!0,this.maxSidebarWidth=400,this.variant="minimal",this.activeIndex=-1,this.handleKeyDown=e=>{if(this.collapsed)return;const t=this.focusableItems;if(!t.length)return;const i=this.sidebarItems.find((e=>e===document.activeElement||e===this.shadowRoot?.activeElement||e.matches(":focus-within"))),n=i?t.indexOf(i):-1;let o=null;switch(e.key){case"ArrowDown":o=n<t.length-1?n+1:0;break;case"ArrowUp":o=n>0?n-1:t.length-1;break;case"Home":o=0;break;case"End":o=t.length-1;break;default:return}e.preventDefault(),null!==o&&t[o]&&this.focusItem(t[o])},this.handleItemSelect=e=>{const t=e.detail.item,i=this.sidebarItems.indexOf(t);this.sidebarItems.forEach(((e,t)=>e.active=t===i)),this.activeIndex=i,this.updateTabIndices(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{selectedItem:t,index:i},bubbles:!0,composed:!0})),this.requestUpdate()}}static get styles(){return[kw]}get sidebarItems(){if(!this.defaultSlot)return[];return this.defaultSlot.assignedElements({flatten:!0}).flatMap((e=>"nile-inline-sidebar-item"===e.tagName.toLowerCase()?[e]:Array.from(e.querySelectorAll("nile-inline-sidebar-item"))))}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-click",this.handleItemSelect),this.addEventListener("keydown",this.handleKeyDown),this.mutationObserver=new MutationObserver((()=>this.syncActiveFromItems()))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeEventListener("nile-click",this.handleItemSelect),this.removeEventListener("keydown",this.handleKeyDown)}firstUpdated(){this.observeSidebarItems(),this.syncActiveFromItems(),this.syncChildSidebarItemVariants(),this.fixed&&(this.collapsed=!1)}updated(e){super.updated(e),e.has("variant")&&this.syncChildSidebarItemVariants()}syncChildSidebarItemVariants(){const e=this.querySelectorAll("nile-inline-sidebar-item"),t=this.variant??"minimal";e.forEach((e=>{e.variant=t}))}observeSidebarItems(){this.sidebarItems?.length&&this.mutationObserver&&this.sidebarItems.forEach((e=>this.mutationObserver.observe(e,{attributes:!0,attributeFilter:["active"]})))}syncActiveFromItems(){if(!this.sidebarItems?.length)return;const e=this.sidebarItems.findIndex((e=>e.hasAttribute("active")));-1!==e&&e!==this.activeIndex&&(this.activeIndex=e,this.requestUpdate()),this.updateTabIndices()}get focusableItems(){return this.sidebarItems.filter((e=>!e.hasAttribute("disabled")))}updateTabIndices(){const e=this.sidebarItems;if(!e.length)return;const t=this.activeIndex>=0?e[this.activeIndex]:null;e.forEach((e=>{e.hasAttribute("disabled")?e.setAttribute("tabindex","-1"):e===t?e.setAttribute("tabindex","0"):t||e!==this.focusableItems[0]?e.setAttribute("tabindex","-1"):e.setAttribute("tabindex","0")}))}focusItem(e){this.sidebarItems.forEach((e=>e.setAttribute("tabindex","-1"))),e.setAttribute("tabindex","0"),e.focus()}toggleCollapse(){this.fixed||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}handleMenuItemClick(e){const t=this.sidebarItems[e];if(!t||t.hasAttribute("disabled"))return;this.sidebarItems.forEach(((t,i)=>t.active=i===e)),this.activeIndex=e;const i=t.textContent?.trim()||"",n=t.href;this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:t,href:n,text:i},bubbles:!0,composed:!0})),n&&(window.location.href=n),this.requestUpdate()}handleSeparatorDrag(e){if(!this.resizable||this.collapsed)return;e.cancelable&&e.preventDefault();const t="right"===this.placement;this.style.setProperty("--sidebar-transition","none"),jL(this,{onMove:e=>{const i=this.getBoundingClientRect();let n;n=t?i.width-e:e,this.sidebarWidth=Ox(n,this.minSidebarWidth,this.maxSidebarWidth),this.emit("nile-sidebar-resize",{width:this.sidebarWidth})},onStop:()=>{this.style.removeProperty("--sidebar-transition")},initialEvent:e})}handleSeparatorKeyDown(e){if(!this.resizable||this.collapsed)return;const t=e.shiftKey?10:1;let i=this.sidebarWidth;switch(e.key){case"ArrowLeft":i-=t;break;case"ArrowRight":i+=t;break;case"Home":i=this.minSidebarWidth;break;case"End":i=this.maxSidebarWidth;break;default:return}e.preventDefault(),this.sidebarWidth=Ox(i,this.minSidebarWidth,this.maxSidebarWidth),this.emit("nile-sidebar-resize",{width:this.sidebarWidth})}get separatorTemplate(){return!this.resizable||this.collapsed?B:_`
19007
+ `;let fw=class extends Fe{constructor(){super(...arguments),this.collapsed=!1,this.fixed=!1,this.showTooltip=!1,this.placement="left",this.resizable=!1,this.sidebarWidth=216,this.minSidebarWidth=120,this.showToggleBtn=!0,this.maxSidebarWidth=400,this.variant="minimal",this.activeIndex=-1,this.handleKeyDown=e=>{if(this.collapsed)return;const t=this.focusableItems;if(!t.length)return;const i=this.sidebarItems.find((e=>e===document.activeElement||e===this.shadowRoot?.activeElement||e.matches(":focus-within"))),n=i?t.indexOf(i):-1;let o=null;switch(e.key){case"ArrowDown":o=n<t.length-1?n+1:0;break;case"ArrowUp":o=n>0?n-1:t.length-1;break;case"Home":o=0;break;case"End":o=t.length-1;break;default:return}e.preventDefault(),null!==o&&t[o]&&this.focusItem(t[o])},this.handleItemSelect=e=>{const t=e.detail.item,i=this.sidebarItems.indexOf(t);this.sidebarItems.forEach(((e,t)=>e.active=t===i)),this.activeIndex=i,this.updateTabIndices(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{selectedItem:t,index:i},bubbles:!0,composed:!0})),this.requestUpdate()}}static get styles(){return[vw]}get sidebarItems(){if(!this.defaultSlot)return[];return this.defaultSlot.assignedElements({flatten:!0}).flatMap((e=>"nile-inline-sidebar-item"===e.tagName.toLowerCase()?[e]:Array.from(e.querySelectorAll("nile-inline-sidebar-item"))))}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-click",this.handleItemSelect),this.addEventListener("keydown",this.handleKeyDown),this.mutationObserver=new MutationObserver((()=>this.syncActiveFromItems()))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeEventListener("nile-click",this.handleItemSelect),this.removeEventListener("keydown",this.handleKeyDown)}firstUpdated(){this.observeSidebarItems(),this.syncActiveFromItems(),this.syncChildSidebarItemVariants(),this.fixed&&(this.collapsed=!1)}updated(e){super.updated(e),e.has("variant")&&this.syncChildSidebarItemVariants()}syncChildSidebarItemVariants(){const e=this.querySelectorAll("nile-inline-sidebar-item"),t=this.variant??"minimal";e.forEach((e=>{e.variant=t}))}observeSidebarItems(){this.sidebarItems?.length&&this.mutationObserver&&this.sidebarItems.forEach((e=>this.mutationObserver.observe(e,{attributes:!0,attributeFilter:["active"]})))}syncActiveFromItems(){if(!this.sidebarItems?.length)return;const e=this.sidebarItems.findIndex((e=>e.hasAttribute("active")));-1!==e&&e!==this.activeIndex&&(this.activeIndex=e,this.requestUpdate()),this.updateTabIndices()}get focusableItems(){return this.sidebarItems.filter((e=>!e.hasAttribute("disabled")))}updateTabIndices(){const e=this.sidebarItems;if(!e.length)return;const t=this.activeIndex>=0?e[this.activeIndex]:null;e.forEach((e=>{e.hasAttribute("disabled")?e.setAttribute("tabindex","-1"):e===t?e.setAttribute("tabindex","0"):t||e!==this.focusableItems[0]?e.setAttribute("tabindex","-1"):e.setAttribute("tabindex","0")}))}focusItem(e){this.sidebarItems.forEach((e=>e.setAttribute("tabindex","-1"))),e.setAttribute("tabindex","0"),e.focus()}toggleCollapse(){this.fixed||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}handleMenuItemClick(e){const t=this.sidebarItems[e];if(!t||t.hasAttribute("disabled"))return;this.sidebarItems.forEach(((t,i)=>t.active=i===e)),this.activeIndex=e;const i=t.textContent?.trim()||"",n=t.href;this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:t,href:n,text:i},bubbles:!0,composed:!0})),n&&(window.location.href=n),this.requestUpdate()}handleSeparatorDrag(e){if(!this.resizable||this.collapsed)return;e.cancelable&&e.preventDefault();const t="right"===this.placement;this.style.setProperty("--sidebar-transition","none"),jL(this,{onMove:e=>{const i=this.getBoundingClientRect();let n;n=t?i.width-e:e,this.sidebarWidth=Ox(n,this.minSidebarWidth,this.maxSidebarWidth),this.emit("nile-sidebar-resize",{width:this.sidebarWidth})},onStop:()=>{this.style.removeProperty("--sidebar-transition")},initialEvent:e})}handleSeparatorKeyDown(e){if(!this.resizable||this.collapsed)return;const t=e.shiftKey?10:1;let i=this.sidebarWidth;switch(e.key){case"ArrowLeft":i-=t;break;case"ArrowRight":i+=t;break;case"Home":i=this.minSidebarWidth;break;case"End":i=this.maxSidebarWidth;break;default:return}e.preventDefault(),this.sidebarWidth=Ox(i,this.minSidebarWidth,this.maxSidebarWidth),this.emit("nile-sidebar-resize",{width:this.sidebarWidth})}get separatorTemplate(){return!this.resizable||this.collapsed?B:_`
18859
19008
  <div
18860
19009
  class="separator"
18861
19010
  part="separator"
@@ -18936,7 +19085,7 @@ border: none;
18936
19085
  </nav>
18937
19086
  </div>
18938
19087
  ${this.separatorTemplate}
18939
- `}};e([ue({type:Boolean,reflect:!0})],vw.prototype,"collapsed",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],vw.prototype,"fixed",void 0),e([ue({type:Boolean,reflect:!0})],vw.prototype,"showTooltip",void 0),e([ue({type:String,reflect:!0})],vw.prototype,"placement",void 0),e([ue({type:Boolean,reflect:!0})],vw.prototype,"resizable",void 0),e([ue({type:Number,attribute:!0})],vw.prototype,"sidebarWidth",void 0),e([ue({type:Number,attribute:!0})],vw.prototype,"minSidebarWidth",void 0),e([ue({type:Boolean,attribute:!0})],vw.prototype,"showToggleBtn",void 0),e([ue({type:Number,attribute:!0})],vw.prototype,"maxSidebarWidth",void 0),e([ue({type:String,reflect:!0,attribute:!0})],vw.prototype,"variant",void 0),e([De()],vw.prototype,"activeIndex",void 0),e([he("slot")],vw.prototype,"defaultSlot",void 0),vw=e([ge("nile-inline-sidebar")],vw);const fw=r`
19088
+ `}};e([ue({type:Boolean,reflect:!0})],fw.prototype,"collapsed",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],fw.prototype,"fixed",void 0),e([ue({type:Boolean,reflect:!0})],fw.prototype,"showTooltip",void 0),e([ue({type:String,reflect:!0})],fw.prototype,"placement",void 0),e([ue({type:Boolean,reflect:!0})],fw.prototype,"resizable",void 0),e([ue({type:Number,attribute:!0})],fw.prototype,"sidebarWidth",void 0),e([ue({type:Number,attribute:!0})],fw.prototype,"minSidebarWidth",void 0),e([ue({type:Boolean,attribute:!0})],fw.prototype,"showToggleBtn",void 0),e([ue({type:Number,attribute:!0})],fw.prototype,"maxSidebarWidth",void 0),e([ue({type:String,reflect:!0,attribute:!0})],fw.prototype,"variant",void 0),e([De()],fw.prototype,"activeIndex",void 0),e([he("slot")],fw.prototype,"defaultSlot",void 0),fw=e([ge("nile-inline-sidebar")],fw);const Qw=r`
18940
19089
  :host {
18941
19090
  display: block;
18942
19091
  font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));
@@ -18992,7 +19141,7 @@ a {
18992
19141
  color: inherit;
18993
19142
  text-decoration: none;
18994
19143
  }
18995
- `;let Qw=class extends Fe{constructor(){super(...arguments),this.active=!1,this.disabled=!1,this.tooltip=!1,this.variant="minimal",this._handleHostKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._select(e))}}static get styles(){return[fw]}firstUpdated(e){super.firstUpdated(e),this.syncBodyAndHeaderStates()}updated(e){super.updated(e),(e.has("disabled")||e.has("active"))&&this.syncBodyAndHeaderStates()}syncBodyAndHeaderStates(){const e=[this.querySelector('[slot="body"]'),this.querySelector('[slot="header"]')],t={disabled:this.disabled,active:this.active};e.forEach((e=>{e&&Object.entries(t).forEach((([t,i])=>{t in e&&(e[t]=i)}))}))}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex",this.disabled?"-1":"0"),this.hasAttribute("role")||this.setAttribute("role","menuitem"),this.addEventListener("keydown",this._handleHostKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleHostKeyDown)}_select(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();const t=this.closest("nile-inline-sidebar");if(t){t.querySelectorAll("nile-inline-sidebar-item").forEach((e=>e.active=e===this))}const i=this.textContent?.trim()||"";this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:this,href:this.href,text:i},bubbles:!0,composed:!0})),this.href&&(window.location.href=this.href)}handleClick(e){this._select(e)}render(){return _`
19144
+ `;let Cw=class extends Fe{constructor(){super(...arguments),this.active=!1,this.disabled=!1,this.tooltip=!1,this.variant="minimal",this._handleHostKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._select(e))}}static get styles(){return[Qw]}firstUpdated(e){super.firstUpdated(e),this.syncBodyAndHeaderStates()}updated(e){super.updated(e),(e.has("disabled")||e.has("active"))&&this.syncBodyAndHeaderStates()}syncBodyAndHeaderStates(){const e=[this.querySelector('[slot="body"]'),this.querySelector('[slot="header"]')],t={disabled:this.disabled,active:this.active};e.forEach((e=>{e&&Object.entries(t).forEach((([t,i])=>{t in e&&(e[t]=i)}))}))}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex",this.disabled?"-1":"0"),this.hasAttribute("role")||this.setAttribute("role","menuitem"),this.addEventListener("keydown",this._handleHostKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleHostKeyDown)}_select(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();const t=this.closest("nile-inline-sidebar");if(t){t.querySelectorAll("nile-inline-sidebar-item").forEach((e=>e.active=e===this))}const i=this.textContent?.trim()||"";this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:this,href:this.href,text:i},bubbles:!0,composed:!0})),this.href&&(window.location.href=this.href)}handleClick(e){this._select(e)}render(){return _`
18996
19145
  <div
18997
19146
  class=${xe({item:!0,"item--rich":"rich"===this.variant})}
18998
19147
  @click=${this.handleClick}
@@ -19019,7 +19168,7 @@ a {
19019
19168
  </div>
19020
19169
  `}
19021
19170
  </div>
19022
- `}};e([ue({type:Boolean,reflect:!0})],Qw.prototype,"active",void 0),e([ue({type:Boolean,reflect:!0})],Qw.prototype,"disabled",void 0),e([ue({type:String})],Qw.prototype,"href",void 0),e([ue({type:Boolean,reflect:!0})],Qw.prototype,"tooltip",void 0),e([ue({type:String,reflect:!0,attribute:!0})],Qw.prototype,"variant",void 0),e([ue({type:String,reflect:!0})],Qw.prototype,"panel",void 0),Qw=e([ge("nile-inline-sidebar-item")],Qw);const Cw=r`
19171
+ `}};e([ue({type:Boolean,reflect:!0})],Cw.prototype,"active",void 0),e([ue({type:Boolean,reflect:!0})],Cw.prototype,"disabled",void 0),e([ue({type:String})],Cw.prototype,"href",void 0),e([ue({type:Boolean,reflect:!0})],Cw.prototype,"tooltip",void 0),e([ue({type:String,reflect:!0,attribute:!0})],Cw.prototype,"variant",void 0),e([ue({type:String,reflect:!0})],Cw.prototype,"panel",void 0),Cw=e([ge("nile-inline-sidebar-item")],Cw);const Uw=r`
19023
19172
  :host {
19024
19173
  display: none;
19025
19174
  height: 100%;
@@ -19037,11 +19186,11 @@ a {
19037
19186
  height: 100%;
19038
19187
  overflow: auto;
19039
19188
  }
19040
- `;let Uw=class extends Fe{constructor(){super(...arguments),this.name="",this.active=!1}static get styles(){return[Cw]}render(){return _`
19189
+ `;let Yw=class extends Fe{constructor(){super(...arguments),this.name="",this.active=!1}static get styles(){return[Uw]}render(){return _`
19041
19190
  <div class="panel" part="base">
19042
19191
  <slot></slot>
19043
19192
  </div>
19044
- `}};e([ue({type:String,reflect:!0})],Uw.prototype,"name",void 0),e([ue({type:Boolean,reflect:!0})],Uw.prototype,"active",void 0),Uw=e([ge("nile-inline-sidebar-panel")],Uw);const Yw=r`
19193
+ `}};e([ue({type:String,reflect:!0})],Yw.prototype,"name",void 0),e([ue({type:Boolean,reflect:!0})],Yw.prototype,"active",void 0),Yw=e([ge("nile-inline-sidebar-panel")],Yw);const Zw=r`
19045
19194
  :host {
19046
19195
  display: flex;
19047
19196
  height: 100%;
@@ -19070,7 +19219,7 @@ a {
19070
19219
  display: flex;
19071
19220
  overflow: hidden;
19072
19221
  }
19073
- `;let Zw=class extends Fe{constructor(){super(...arguments),this.placement="left",this.handleSidebarItemClick=e=>{const t=e.detail,i=t?.item?.panel;i&&this.activatePanel(i)}}static get styles(){return[Yw]}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-click",this.handleSidebarItemClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("nile-click",this.handleSidebarItemClick)}get panels(){return this.defaultSlot?this.defaultSlot.assignedElements({flatten:!0}).filter((e=>"nile-inline-sidebar-panel"===e.tagName.toLowerCase())):[]}activatePanel(e){this.panels.forEach((t=>{t.active=t.name===e})),this.emit("nile-panel-change",{panel:e})}render(){return _`
19222
+ `;let Vw=class extends Fe{constructor(){super(...arguments),this.placement="left",this.handleSidebarItemClick=e=>{const t=e.detail,i=t?.item?.panel;i&&this.activatePanel(i)}}static get styles(){return[Zw]}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-click",this.handleSidebarItemClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("nile-click",this.handleSidebarItemClick)}get panels(){return this.defaultSlot?this.defaultSlot.assignedElements({flatten:!0}).filter((e=>"nile-inline-sidebar-panel"===e.tagName.toLowerCase())):[]}activatePanel(e){this.panels.forEach((t=>{t.active=t.name===e})),this.emit("nile-panel-change",{panel:e})}render(){return _`
19074
19223
  <div class="panel-group" part="base">
19075
19224
  <div class="sidebar-container" part="sidebar-container">
19076
19225
  <slot name="sidebar"></slot>
@@ -19081,7 +19230,7 @@ a {
19081
19230
  ></slot>
19082
19231
  </div>
19083
19232
  </div>
19084
- `}};e([ue({type:String,reflect:!0})],Zw.prototype,"placement",void 0),e([he("slot:not([name])")],Zw.prototype,"defaultSlot",void 0),Zw=e([ge("nile-inline-sidebar-panel-group")],Zw);const Vw=r`
19233
+ `}};e([ue({type:String,reflect:!0})],Vw.prototype,"placement",void 0),e([he("slot:not([name])")],Vw.prototype,"defaultSlot",void 0),Vw=e([ge("nile-inline-sidebar-panel-group")],Vw);const Pw=r`
19085
19234
  :host { }
19086
19235
 
19087
19236
  .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0; }
@@ -19183,16 +19332,16 @@ a {
19183
19332
  .tippy-svg-arrow > svg {
19184
19333
  position: absolute;
19185
19334
  }
19186
- `;!function(){const e="nile-lite-tooltip-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=Vw.cssText,document.head.appendChild(t)}();var Pw="top",Ww="bottom",_w="right",Rw="left",Bw="auto",Gw=[Pw,Ww,_w,Rw],Fw="start",Hw="end",$w="viewport",Jw="popper",Xw=Gw.reduce((function(e,t){return e.concat([t+"-"+Fw,t+"-"+Hw])}),[]),qw=[].concat(Gw,[Bw]).reduce((function(e,t){return e.concat([t,t+"-"+Fw,t+"-"+Hw])}),[]),Kw=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function eE(e){return e?(e.nodeName||"").toLowerCase():null}function tE(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function iE(e){return e instanceof tE(e).Element||e instanceof Element}function nE(e){return e instanceof tE(e).HTMLElement||e instanceof HTMLElement}function oE(e){return"undefined"!=typeof ShadowRoot&&(e instanceof tE(e).ShadowRoot||e instanceof ShadowRoot)}var ME={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];nE(o)&&eE(o)&&(Object.assign(o.style,i),Object.keys(n).forEach((function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],o=t.attributes[e]||{},M=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});nE(n)&&eE(n)&&(Object.assign(n.style,M),Object.keys(o).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]};function rE(e){return e.split("-")[0]}var sE=Math.max,aE=Math.min,lE=Math.round;function gE(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function NE(){return!/^((?!chrome|android).)*safari/i.test(gE())}function cE(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),o=1,M=1;t&&nE(e)&&(o=e.offsetWidth>0&&lE(n.width)/e.offsetWidth||1,M=e.offsetHeight>0&&lE(n.height)/e.offsetHeight||1);var r=(iE(e)?tE(e):window).visualViewport,s=!NE()&&i,a=(n.left+(s&&r?r.offsetLeft:0))/o,l=(n.top+(s&&r?r.offsetTop:0))/M,g=n.width/o,N=n.height/M;return{width:g,height:N,top:l,right:a+g,bottom:l+N,left:a,x:a,y:l}}function uE(e){var t=cE(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function DE(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&oE(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function dE(e){return tE(e).getComputedStyle(e)}function hE(e){return["table","td","th"].indexOf(eE(e))>=0}function jE(e){return((iE(e)?e.ownerDocument:e.document)||window.document).documentElement}function IE(e){return"html"===eE(e)?e:e.assignedSlot||e.parentNode||(oE(e)?e.host:null)||jE(e)}function zE(e){return nE(e)&&"fixed"!==dE(e).position?e.offsetParent:null}function yE(e){for(var t=tE(e),i=zE(e);i&&hE(i)&&"static"===dE(i).position;)i=zE(i);return i&&("html"===eE(i)||"body"===eE(i)&&"static"===dE(i).position)?t:i||function(e){var t=/firefox/i.test(gE());if(/Trident/i.test(gE())&&nE(e)&&"fixed"===dE(e).position)return null;var i=IE(e);for(oE(i)&&(i=i.host);nE(i)&&["html","body"].indexOf(eE(i))<0;){var n=dE(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}function pE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function TE(e,t,i){return sE(e,aE(t,i))}function AE(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function OE(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}var xE={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,o=e.options,M=i.elements.arrow,r=i.modifiersData.popperOffsets,s=rE(i.placement),a=pE(s),l=[Rw,_w].indexOf(s)>=0?"height":"width";if(M&&r){var g=function(e,t){return AE("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:OE(e,Gw))}(o.padding,i),N=uE(M),c="y"===a?Pw:Rw,u="y"===a?Ww:_w,D=i.rects.reference[l]+i.rects.reference[a]-r[a]-i.rects.popper[l],d=r[a]-i.rects.reference[a],h=yE(M),j=h?"y"===a?h.clientHeight||0:h.clientWidth||0:0,I=D/2-d/2,z=g[c],y=j-N[l]-g[u],p=j/2-N[l]/2+I,T=TE(z,p,y),A=a;i.modifiersData[n]=((t={})[A]=T,t.centerOffset=T-p,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&DE(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function LE(e){return e.split("-")[1]}var mE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function SE(e){var t,i=e.popper,n=e.popperRect,o=e.placement,M=e.variation,r=e.offsets,s=e.position,a=e.gpuAcceleration,l=e.adaptive,g=e.roundOffsets,N=e.isFixed,c=r.x,u=void 0===c?0:c,D=r.y,d=void 0===D?0:D,h="function"==typeof g?g({x:u,y:d}):{x:u,y:d};u=h.x,d=h.y;var j=r.hasOwnProperty("x"),I=r.hasOwnProperty("y"),z=Rw,y=Pw,p=window;if(l){var T=yE(i),A="clientHeight",O="clientWidth";if(T===tE(i)&&"static"!==dE(T=jE(i)).position&&"absolute"===s&&(A="scrollHeight",O="scrollWidth"),o===Pw||(o===Rw||o===_w)&&M===Hw)y=Ww,d-=(N&&T===p&&p.visualViewport?p.visualViewport.height:T[A])-n.height,d*=a?1:-1;if(o===Rw||(o===Pw||o===Ww)&&M===Hw)z=_w,u-=(N&&T===p&&p.visualViewport?p.visualViewport.width:T[O])-n.width,u*=a?1:-1}var x,L=Object.assign({position:s},l&&mE),m=!0===g?function(e,t){var i=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:lE(i*o)/o||0,y:lE(n*o)/o||0}}({x:u,y:d},tE(i)):{x:u,y:d};return u=m.x,d=m.y,a?Object.assign({},L,((x={})[y]=I?"0":"",x[z]=j?"0":"",x.transform=(p.devicePixelRatio||1)<=1?"translate("+u+"px, "+d+"px)":"translate3d("+u+"px, "+d+"px, 0)",x)):Object.assign({},L,((t={})[y]=I?d+"px":"",t[z]=j?u+"px":"",t.transform="",t))}var wE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,o=void 0===n||n,M=i.adaptive,r=void 0===M||M,s=i.roundOffsets,a=void 0===s||s,l={placement:rE(t.placement),variation:LE(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,SE(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,SE(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},EE={passive:!0};var bE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,o=n.scroll,M=void 0===o||o,r=n.resize,s=void 0===r||r,a=tE(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return M&&l.forEach((function(e){e.addEventListener("scroll",i.update,EE)})),s&&a.addEventListener("resize",i.update,EE),function(){M&&l.forEach((function(e){e.removeEventListener("scroll",i.update,EE)})),s&&a.removeEventListener("resize",i.update,EE)}},data:{}},kE={left:"right",right:"left",bottom:"top",top:"bottom"};function vE(e){return e.replace(/left|right|bottom|top/g,(function(e){return kE[e]}))}var fE={start:"end",end:"start"};function QE(e){return e.replace(/start|end/g,(function(e){return fE[e]}))}function CE(e){var t=tE(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function UE(e){return cE(jE(e)).left+CE(e).scrollLeft}function YE(e){var t=dE(e),i=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function ZE(e){return["html","body","#document"].indexOf(eE(e))>=0?e.ownerDocument.body:nE(e)&&YE(e)?e:ZE(IE(e))}function VE(e,t){var i;void 0===t&&(t=[]);var n=ZE(e),o=n===(null==(i=e.ownerDocument)?void 0:i.body),M=tE(n),r=o?[M].concat(M.visualViewport||[],YE(n)?n:[]):n,s=t.concat(r);return o?s:s.concat(VE(IE(r)))}function PE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function WE(e,t,i){return t===$w?PE(function(e,t){var i=tE(e),n=jE(e),o=i.visualViewport,M=n.clientWidth,r=n.clientHeight,s=0,a=0;if(o){M=o.width,r=o.height;var l=NE();(l||!l&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}return{width:M,height:r,x:s+UE(e),y:a}}(e,i)):iE(t)?function(e,t){var i=cE(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):PE(function(e){var t,i=jE(e),n=CE(e),o=null==(t=e.ownerDocument)?void 0:t.body,M=sE(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),r=sE(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+UE(e),a=-n.scrollTop;return"rtl"===dE(o||i).direction&&(s+=sE(i.clientWidth,o?o.clientWidth:0)-M),{width:M,height:r,x:s,y:a}}(jE(e)))}function _E(e,t,i,n){var o="clippingParents"===t?function(e){var t=VE(IE(e)),i=["absolute","fixed"].indexOf(dE(e).position)>=0&&nE(e)?yE(e):e;return iE(i)?t.filter((function(e){return iE(e)&&DE(e,i)&&"body"!==eE(e)})):[]}(e):[].concat(t),M=[].concat(o,[i]),r=M[0],s=M.reduce((function(t,i){var o=WE(e,i,n);return t.top=sE(o.top,t.top),t.right=aE(o.right,t.right),t.bottom=aE(o.bottom,t.bottom),t.left=sE(o.left,t.left),t}),WE(e,r,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function RE(e){var t,i=e.reference,n=e.element,o=e.placement,M=o?rE(o):null,r=o?LE(o):null,s=i.x+i.width/2-n.width/2,a=i.y+i.height/2-n.height/2;switch(M){case Pw:t={x:s,y:i.y-n.height};break;case Ww:t={x:s,y:i.y+i.height};break;case _w:t={x:i.x+i.width,y:a};break;case Rw:t={x:i.x-n.width,y:a};break;default:t={x:i.x,y:i.y}}var l=M?pE(M):null;if(null!=l){var g="y"===l?"height":"width";switch(r){case Fw:t[l]=t[l]-(i[g]/2-n[g]/2);break;case Hw:t[l]=t[l]+(i[g]/2-n[g]/2)}}return t}function BE(e,t){void 0===t&&(t={});var i=t,n=i.placement,o=void 0===n?e.placement:n,M=i.strategy,r=void 0===M?e.strategy:M,s=i.boundary,a=void 0===s?"clippingParents":s,l=i.rootBoundary,g=void 0===l?$w:l,N=i.elementContext,c=void 0===N?Jw:N,u=i.altBoundary,D=void 0!==u&&u,d=i.padding,h=void 0===d?0:d,j=AE("number"!=typeof h?h:OE(h,Gw)),I=c===Jw?"reference":Jw,z=e.rects.popper,y=e.elements[D?I:c],p=_E(iE(y)?y:y.contextElement||jE(e.elements.popper),a,g,r),T=cE(e.elements.reference),A=RE({reference:T,element:z,strategy:"absolute",placement:o}),O=PE(Object.assign({},z,A)),x=c===Jw?O:T,L={top:p.top-x.top+j.top,bottom:x.bottom-p.bottom+j.bottom,left:p.left-x.left+j.left,right:x.right-p.right+j.right},m=e.modifiersData.offset;if(c===Jw&&m){var S=m[o];Object.keys(L).forEach((function(e){var t=[_w,Ww].indexOf(e)>=0?1:-1,i=[Pw,Ww].indexOf(e)>=0?"y":"x";L[e]+=S[i]*t}))}return L}function GE(e,t){void 0===t&&(t={});var i=t,n=i.placement,o=i.boundary,M=i.rootBoundary,r=i.padding,s=i.flipVariations,a=i.allowedAutoPlacements,l=void 0===a?qw:a,g=LE(n),N=g?s?Xw:Xw.filter((function(e){return LE(e)===g})):Gw,c=N.filter((function(e){return l.indexOf(e)>=0}));0===c.length&&(c=N);var u=c.reduce((function(t,i){return t[i]=BE(e,{placement:i,boundary:o,rootBoundary:M,padding:r})[rE(i)],t}),{});return Object.keys(u).sort((function(e,t){return u[e]-u[t]}))}var FE={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=i.mainAxis,M=void 0===o||o,r=i.altAxis,s=void 0===r||r,a=i.fallbackPlacements,l=i.padding,g=i.boundary,N=i.rootBoundary,c=i.altBoundary,u=i.flipVariations,D=void 0===u||u,d=i.allowedAutoPlacements,h=t.options.placement,j=rE(h),I=a||(j===h||!D?[vE(h)]:function(e){if(rE(e)===Bw)return[];var t=vE(e);return[QE(e),t,QE(t)]}(h)),z=[h].concat(I).reduce((function(e,i){return e.concat(rE(i)===Bw?GE(t,{placement:i,boundary:g,rootBoundary:N,padding:l,flipVariations:D,allowedAutoPlacements:d}):i)}),[]),y=t.rects.reference,p=t.rects.popper,T=new Map,A=!0,O=z[0],x=0;x<z.length;x++){var L=z[x],m=rE(L),S=LE(L)===Fw,w=[Pw,Ww].indexOf(m)>=0,E=w?"width":"height",b=BE(t,{placement:L,boundary:g,rootBoundary:N,altBoundary:c,padding:l}),k=w?S?_w:Rw:S?Ww:Pw;y[E]>p[E]&&(k=vE(k));var v=vE(k),f=[];if(M&&f.push(b[m]<=0),s&&f.push(b[k]<=0,b[v]<=0),f.every((function(e){return e}))){O=L,A=!1;break}T.set(L,f)}if(A)for(var Q=function(e){var t=z.find((function(t){var i=T.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},C=D?3:1;C>0;C--){if("break"===Q(C))break}t.placement!==O&&(t.modifiersData[n]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function HE(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function $E(e){return[Pw,_w,Ww,Rw].some((function(t){return e[t]>=0}))}var JE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,o=t.rects.popper,M=t.modifiersData.preventOverflow,r=BE(t,{elementContext:"reference"}),s=BE(t,{altBoundary:!0}),a=HE(r,n),l=HE(s,o,M),g=$E(a),N=$E(l);t.modifiersData[i]={referenceClippingOffsets:a,popperEscapeOffsets:l,isReferenceHidden:g,hasPopperEscaped:N},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":g,"data-popper-escaped":N})}};var XE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,o=i.offset,M=void 0===o?[0,0]:o,r=qw.reduce((function(e,i){return e[i]=function(e,t,i){var n=rE(e),o=[Rw,Pw].indexOf(n)>=0?-1:1,M="function"==typeof i?i(Object.assign({},t,{placement:e})):i,r=M[0],s=M[1];return r=r||0,s=(s||0)*o,[Rw,_w].indexOf(n)>=0?{x:s,y:r}:{x:r,y:s}}(i,t.rects,M),e}),{}),s=r[t.placement],a=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=l),t.modifiersData[n]=r}};var qE={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=RE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var KE={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,o=i.mainAxis,M=void 0===o||o,r=i.altAxis,s=void 0!==r&&r,a=i.boundary,l=i.rootBoundary,g=i.altBoundary,N=i.padding,c=i.tether,u=void 0===c||c,D=i.tetherOffset,d=void 0===D?0:D,h=BE(t,{boundary:a,rootBoundary:l,padding:N,altBoundary:g}),j=rE(t.placement),I=LE(t.placement),z=!I,y=pE(j),p="x"===y?"y":"x",T=t.modifiersData.popperOffsets,A=t.rects.reference,O=t.rects.popper,x="function"==typeof d?d(Object.assign({},t.rects,{placement:t.placement})):d,L="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),m=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(T){if(M){var w,E="y"===y?Pw:Rw,b="y"===y?Ww:_w,k="y"===y?"height":"width",v=T[y],f=v+h[E],Q=v-h[b],C=u?-O[k]/2:0,U=I===Fw?A[k]:O[k],Y=I===Fw?-O[k]:-A[k],Z=t.elements.arrow,V=u&&Z?uE(Z):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=P[E],_=P[b],R=TE(0,A[k],V[k]),B=z?A[k]/2-C-R-W-L.mainAxis:U-R-W-L.mainAxis,G=z?-A[k]/2+C+R+_+L.mainAxis:Y+R+_+L.mainAxis,F=t.elements.arrow&&yE(t.elements.arrow),H=F?"y"===y?F.clientTop||0:F.clientLeft||0:0,$=null!=(w=null==m?void 0:m[y])?w:0,J=v+G-$,X=TE(u?aE(f,v+B-$-H):f,v,u?sE(Q,J):Q);T[y]=X,S[y]=X-v}if(s){var q,K="x"===y?Pw:Rw,ee="x"===y?Ww:_w,te=T[p],ie="y"===p?"height":"width",ne=te+h[K],oe=te-h[ee],Me=-1!==[Pw,Rw].indexOf(j),re=null!=(q=null==m?void 0:m[p])?q:0,se=Me?ne:te-A[ie]-O[ie]-re+L.altAxis,ae=Me?te+A[ie]+O[ie]-re-L.altAxis:oe,le=u&&Me?function(e,t,i){var n=TE(e,t,i);return n>i?i:n}(se,te,ae):TE(u?se:ne,te,u?ae:oe);T[p]=le,S[p]=le-te}t.modifiersData[n]=S}},requiresIfExists:["offset"]};function eb(e,t,i){void 0===i&&(i=!1);var n,o,M=nE(t),r=nE(t)&&function(e){var t=e.getBoundingClientRect(),i=lE(t.width)/e.offsetWidth||1,n=lE(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),s=jE(t),a=cE(e,r,i),l={scrollLeft:0,scrollTop:0},g={x:0,y:0};return(M||!M&&!i)&&(("body"!==eE(t)||YE(s))&&(l=(n=t)!==tE(n)&&nE(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:CE(n)),nE(t)?((g=cE(t,!0)).x+=t.clientLeft,g.y+=t.clientTop):s&&(g.x=UE(s))),{x:a.left+l.scrollLeft-g.x,y:a.top+l.scrollTop-g.y,width:a.width,height:a.height}}function tb(e){var t=new Map,i=new Set,n=[];function o(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var n=t.get(e);n&&o(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||o(e)})),n}var ib={placement:"bottom",modifiers:[],strategy:"absolute"};function nb(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function ob(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,o=t.defaultOptions,M=void 0===o?ib:o;return function(e,t,i){void 0===i&&(i=M);var o,r,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},ib,M),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],l=!1,g={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;N(),s.options=Object.assign({},M,s.options,o),s.scrollParents={reference:iE(e)?VE(e):e.contextElement?VE(e.contextElement):[],popper:VE(t)};var r=function(e){var t=tb(e);return Kw.reduce((function(e,i){return e.concat(t.filter((function(e){return e.phase===i})))}),[])}(function(e){var t=e.reduce((function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers)));return s.orderedModifiers=r.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,o=e.effect;if("function"==typeof o){var M=o({state:s,name:t,instance:g,options:n}),r=function(){};a.push(M||r)}})),g.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,i=e.popper;if(nb(t,i)){s.rects={reference:eb(t,yE(i),"fixed"===s.options.strategy),popper:uE(i)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var n=0;n<s.orderedModifiers.length;n++)if(!0!==s.reset){var o=s.orderedModifiers[n],M=o.fn,r=o.options,a=void 0===r?{}:r,N=o.name;"function"==typeof M&&(s=M({state:s,options:a,name:N,instance:g})||s)}else s.reset=!1,n=-1}}},update:(o=function(){return new Promise((function(e){g.forceUpdate(),e(s)}))},function(){return r||(r=new Promise((function(e){Promise.resolve().then((function(){r=void 0,e(o())}))}))),r}),destroy:function(){N(),l=!0}};if(!nb(e,t))return g;function N(){a.forEach((function(e){return e()})),a=[]}return g.setOptions(i).then((function(e){!l&&i.onFirstUpdate&&i.onFirstUpdate(e)})),g}}var Mb=ob({defaultModifiers:[bE,qE,wE,ME,XE,FE,KE,xE,JE]}),rb='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',sb="tippy-content",ab="tippy-arrow",lb="tippy-svg-arrow",gb={passive:!0,capture:!0},Nb=function(){return document.body};function cb(e,t,i){if(Array.isArray(e)){var n=e[t];return null==n?Array.isArray(i)?i[t]:i:n}return e}function ub(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function Db(e,t){return"function"==typeof e?e.apply(void 0,t):e}function db(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout((function(){e(n)}),t)};var i}function hb(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function jb(e){return[].concat(e)}function Ib(e,t){-1===e.indexOf(t)&&e.push(t)}function zb(e){return[].slice.call(e)}function yb(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function pb(){return document.createElement("div")}function Tb(e){return["Element","Fragment"].some((function(t){return ub(e,t)}))}function Ab(e){return ub(e,"MouseEvent")}function Ob(e){return Tb(e)?[e]:function(e){return ub(e,"NodeList")}(e)?zb(e):Array.isArray(e)?e:zb(document.querySelectorAll(e))}function xb(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Lb(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function mb(e){var t,i=jb(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function Sb(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[n](t,i)}))}function wb(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var Eb={isTouch:!1},bb=0;function kb(){Eb.isTouch||(Eb.isTouch=!0,window.performance&&document.addEventListener("mousemove",vb))}function vb(){var e=performance.now();e-bb<20&&(Eb.isTouch=!1,document.removeEventListener("mousemove",vb)),bb=e}function fb(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var i=t._tippy;t.blur&&!i.state.isVisible&&t.blur()}}var Qb,Cb=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function Ub(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Yb(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function Zb(e){return Yb("\n %ctippy.js\n\n %c"+Yb(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function Vb(e){return[Zb(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function Pb(e,t){var i;e&&!Qb.has(t)&&(Qb.add(t),(i=console).warn.apply(i,Vb(t)))}function Wb(e,t){var i;e&&!Qb.has(t)&&(Qb.add(t),(i=console).error.apply(i,Vb(t)))}"production"!==process.env.NODE_ENV&&(Qb=new Set);var _b={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Rb=Object.assign({appendTo:Nb,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},_b,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Bb=Object.keys(Rb);function Gb(e){var t=(e.plugins||[]).reduce((function(t,i){var n,o=i.name,M=i.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Rb[o])?n:M);return t}),{});return Object.assign({},e,t)}function Fb(e,t){var i=Object.assign({},t,{content:Db(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Gb(Object.assign({},Rb,{plugins:t}))):Bb).reduce((function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},Rb.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function Hb(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,n,o=hb(Rb,Object.keys(_b)),M=(i=o,n=e,!{}.hasOwnProperty.call(i,n));M&&(M=0===t.filter((function(t){return t.name===e})).length),Pb(M,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function $b(e,t){e.innerHTML=t}function Jb(e){var t=pb();return!0===e?t.className=ab:(t.className=lb,Tb(e)?t.appendChild(e):$b(t,e)),t}function Xb(e,t){Tb(t.content)?($b(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?$b(e,t.content):e.textContent=t.content)}function qb(e){var t=e.firstElementChild,i=zb(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(sb)})),arrow:i.find((function(e){return e.classList.contains(ab)||e.classList.contains(lb)})),backdrop:i.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function Kb(e){var t=pb(),i=pb();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=pb();function o(i,n){var o=qb(t),M=o.box,r=o.content,s=o.arrow;n.theme?M.setAttribute("data-theme",n.theme):M.removeAttribute("data-theme"),"string"==typeof n.animation?M.setAttribute("data-animation",n.animation):M.removeAttribute("data-animation"),n.inertia?M.setAttribute("data-inertia",""):M.removeAttribute("data-inertia"),M.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?M.setAttribute("role",n.role):M.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Xb(r,e.props),n.arrow?s?i.arrow!==n.arrow&&(M.removeChild(s),M.appendChild(Jb(n.arrow))):M.appendChild(Jb(n.arrow)):s&&M.removeChild(s)}return n.className=sb,n.setAttribute("data-state","hidden"),Xb(n,e.props),t.appendChild(i),i.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Kb.$$tippy=!0;var ek=1,tk=[],ik=[];function nk(e,t){var i,n,o,M,r,s,a,l,g=Fb(e,Object.assign({},Rb,Gb(yb(t)))),N=!1,c=!1,u=!1,D=!1,d=[],h=db(F,g.interactiveDebounce),j=ek++,I=(l=g.plugins).filter((function(e,t){return l.indexOf(e)===t})),z={id:j,reference:e,popper:pb(),popperInstance:null,props:g,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:I,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){"production"!==process.env.NODE_ENV&&Pb(z.state.isDestroyed,Ub("setProps"));if(z.state.isDestroyed)return;v("onBeforeUpdate",[z,t]),B();var i=z.props,n=Fb(e,Object.assign({},i,yb(t),{ignoreAttributes:!0}));z.props=n,R(),i.interactiveDebounce!==n.interactiveDebounce&&(C(),h=db(F,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?jb(i.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):n.triggerTarget&&e.removeAttribute("aria-expanded");Q(),k(),T&&T(i,n);z.popperInstance&&(X(),K().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));v("onAfterUpdate",[z,t])},setContent:function(e){z.setProps({content:e})},show:function(){"production"!==process.env.NODE_ENV&&Pb(z.state.isDestroyed,Ub("show"));var e=z.state.isVisible,t=z.state.isDestroyed,i=!z.state.isEnabled,n=Eb.isTouch&&!z.props.touch,o=cb(z.props.duration,0,Rb.duration);if(e||t||i||n)return;if(S().hasAttribute("disabled"))return;if(v("onShow",[z],!1),!1===z.props.onShow(z))return;z.state.isVisible=!0,m()&&(p.style.visibility="visible");k(),V(),z.state.isMounted||(p.style.transition="none");if(m()){var M=E();xb([M.box,M.content],0)}s=function(){var e;if(z.state.isVisible&&!D){if(D=!0,p.offsetHeight,p.style.transition=z.props.moveTransition,m()&&z.props.animation){var t=E(),i=t.box,n=t.content;xb([i,n],o),Lb([i,n],"visible")}f(),Q(),Ib(ik,z),null==(e=z.popperInstance)||e.forceUpdate(),v("onMount",[z]),z.props.animation&&m()&&function(e,t){W(e,t)}(o,(function(){z.state.isShown=!0,v("onShown",[z])}))}},function(){var e,t=z.props.appendTo,i=S();e=z.props.interactive&&t===Nb||"parent"===t?i.parentNode:Db(t,[i]);e.contains(p)||e.appendChild(p);z.state.isMounted=!0,X(),"production"!==process.env.NODE_ENV&&Pb(z.props.interactive&&t===Rb.appendTo&&i.nextElementSibling!==p,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==process.env.NODE_ENV&&Pb(z.state.isDestroyed,Ub("hide"));var e=!z.state.isVisible,t=z.state.isDestroyed,i=!z.state.isEnabled,n=cb(z.props.duration,1,Rb.duration);if(e||t||i)return;if(v("onHide",[z],!1),!1===z.props.onHide(z))return;z.state.isVisible=!1,z.state.isShown=!1,D=!1,N=!1,m()&&(p.style.visibility="hidden");if(C(),P(),k(!0),m()){var o=E(),M=o.box,r=o.content;z.props.animation&&(xb([M,r],n),Lb([M,r],"hidden"))}f(),Q(),z.props.animation?m()&&function(e,t){W(e,(function(){!z.state.isVisible&&p.parentNode&&p.parentNode.contains(p)&&t()}))}(n,z.unmount):z.unmount()},hideWithInteractivity:function(e){"production"!==process.env.NODE_ENV&&Pb(z.state.isDestroyed,Ub("hideWithInteractivity"));w().addEventListener("mousemove",h),Ib(tk,h),h(e)},enable:function(){z.state.isEnabled=!0},disable:function(){z.hide(),z.state.isEnabled=!1},unmount:function(){"production"!==process.env.NODE_ENV&&Pb(z.state.isDestroyed,Ub("unmount"));z.state.isVisible&&z.hide();if(!z.state.isMounted)return;q(),K().forEach((function(e){e._tippy.unmount()})),p.parentNode&&p.parentNode.removeChild(p);ik=ik.filter((function(e){return e!==z})),z.state.isMounted=!1,v("onHidden",[z])},destroy:function(){"production"!==process.env.NODE_ENV&&Pb(z.state.isDestroyed,Ub("destroy"));if(z.state.isDestroyed)return;z.clearDelayTimeouts(),z.unmount(),B(),delete e._tippy,z.state.isDestroyed=!0,v("onDestroy",[z])}};if(!g.render)return"production"!==process.env.NODE_ENV&&Wb(!0,"render() function has not been supplied."),z;var y=g.render(z),p=y.popper,T=y.onUpdate;p.setAttribute("data-tippy-root",""),p.id="tippy-"+z.id,z.popper=p,e._tippy=z,p._tippy=z;var A=I.map((function(e){return e.fn(z)})),O=e.hasAttribute("aria-expanded");return R(),Q(),k(),v("onCreate",[z]),g.showOnCreate&&ee(),p.addEventListener("mouseenter",(function(){z.props.interactive&&z.state.isVisible&&z.clearDelayTimeouts()})),p.addEventListener("mouseleave",(function(){z.props.interactive&&z.props.trigger.indexOf("mouseenter")>=0&&w().addEventListener("mousemove",h)})),z;function x(){var e=z.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===x()[0]}function m(){var e;return!(null==(e=z.props.render)||!e.$$tippy)}function S(){return a||e}function w(){var e=S().parentNode;return e?mb(e):document}function E(){return qb(p)}function b(e){return z.state.isMounted&&!z.state.isVisible||Eb.isTouch||M&&"focus"===M.type?0:cb(z.props.delay,e?0:1,Rb.delay)}function k(e){void 0===e&&(e=!1),p.style.pointerEvents=z.props.interactive&&!e?"":"none",p.style.zIndex=""+z.props.zIndex}function v(e,t,i){var n;(void 0===i&&(i=!0),A.forEach((function(i){i[e]&&i[e].apply(i,t)})),i)&&(n=z.props)[e].apply(n,t)}function f(){var t=z.props.aria;if(t.content){var i="aria-"+t.content,n=p.id;jb(z.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(z.state.isVisible)e.setAttribute(i,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(i,o):e.removeAttribute(i)}}))}}function Q(){!O&&z.props.aria.expanded&&jb(z.props.triggerTarget||e).forEach((function(e){z.props.interactive?e.setAttribute("aria-expanded",z.state.isVisible&&e===S()?"true":"false"):e.removeAttribute("aria-expanded")}))}function C(){w().removeEventListener("mousemove",h),tk=tk.filter((function(e){return e!==h}))}function U(t){if(!Eb.isTouch||!u&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!z.props.interactive||!wb(p,i)){if(jb(z.props.triggerTarget||e).some((function(e){return wb(e,i)}))){if(Eb.isTouch)return;if(z.state.isVisible&&z.props.trigger.indexOf("click")>=0)return}else v("onClickOutside",[z,t]);!0===z.props.hideOnClick&&(z.clearDelayTimeouts(),z.hide(),c=!0,setTimeout((function(){c=!1})),z.state.isMounted||P())}}}function Y(){u=!0}function Z(){u=!1}function V(){var e=w();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,gb),e.addEventListener("touchstart",Z,gb),e.addEventListener("touchmove",Y,gb)}function P(){var e=w();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,gb),e.removeEventListener("touchstart",Z,gb),e.removeEventListener("touchmove",Y,gb)}function W(e,t){var i=E().box;function n(e){e.target===i&&(Sb(i,"remove",n),t())}if(0===e)return t();Sb(i,"remove",r),Sb(i,"add",n),r=n}function _(t,i,n){void 0===n&&(n=!1),jb(z.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,n),d.push({node:e,eventType:t,handler:i,options:n})}))}function R(){var e;L()&&(_("touchstart",G,{passive:!0}),_("touchend",H,{passive:!0})),(e=z.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(_(e,G),e){case"mouseenter":_("mouseleave",H);break;case"focus":_(Cb?"focusout":"blur",$);break;case"focusin":_("focusout",$)}}))}function B(){d.forEach((function(e){var t=e.node,i=e.eventType,n=e.handler,o=e.options;t.removeEventListener(i,n,o)})),d=[]}function G(e){var t,i=!1;if(z.state.isEnabled&&!J(e)&&!c){var n="focus"===(null==(t=M)?void 0:t.type);M=e,a=e.currentTarget,Q(),!z.state.isVisible&&Ab(e)&&tk.forEach((function(t){return t(e)})),"click"===e.type&&(z.props.trigger.indexOf("mouseenter")<0||N)&&!1!==z.props.hideOnClick&&z.state.isVisible?i=!0:ee(e),"click"===e.type&&(N=!i),i&&!n&&te(e)}}function F(e){var t=e.target,i=S().contains(t)||p.contains(t);if("mousemove"!==e.type||!i){var n=K().concat(p).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:g}:null})).filter(Boolean);(function(e,t){var i=t.clientX,n=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,M=e.props.interactiveBorder,r=o.placement.split("-")[0],s=o.modifiersData.offset;if(!s)return!0;var a="bottom"===r?s.top.y:0,l="top"===r?s.bottom.y:0,g="right"===r?s.left.x:0,N="left"===r?s.right.x:0,c=t.top-n+a>M,u=n-t.bottom-l>M,D=t.left-i+g>M,d=i-t.right-N>M;return c||u||D||d}))})(n,e)&&(C(),te(e))}}function H(e){J(e)||z.props.trigger.indexOf("click")>=0&&N||(z.props.interactive?z.hideWithInteractivity(e):te(e))}function $(e){z.props.trigger.indexOf("focusin")<0&&e.target!==S()||z.props.interactive&&e.relatedTarget&&p.contains(e.relatedTarget)||te(e)}function J(e){return!!Eb.isTouch&&L()!==e.type.indexOf("touch")>=0}function X(){q();var t=z.props,i=t.popperOptions,n=t.placement,o=t.offset,M=t.getReferenceClientRect,r=t.moveTransition,a=m()?qb(p).arrow:null,l=M?{getBoundingClientRect:M,contextElement:M.contextElement||S()}:e,g={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(m()){var i=E().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},N=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},g];m()&&a&&N.push({name:"arrow",options:{element:a,padding:3}}),N.push.apply(N,(null==i?void 0:i.modifiers)||[]),z.popperInstance=Mb(l,p,Object.assign({},i,{placement:n,onFirstUpdate:s,modifiers:N}))}function q(){z.popperInstance&&(z.popperInstance.destroy(),z.popperInstance=null)}function K(){return zb(p.querySelectorAll("[data-tippy-root]"))}function ee(e){z.clearDelayTimeouts(),e&&v("onTrigger",[z,e]),V();var t=b(!0),n=x(),o=n[0],M=n[1];Eb.isTouch&&"hold"===o&&M&&(t=M),t?i=setTimeout((function(){z.show()}),t):z.show()}function te(e){if(z.clearDelayTimeouts(),v("onUntrigger",[z,e]),z.state.isVisible){if(!(z.props.trigger.indexOf("mouseenter")>=0&&z.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&N)){var t=b(!1);t?n=setTimeout((function(){z.state.isVisible&&z.hide()}),t):o=requestAnimationFrame((function(){z.hide()}))}}else P()}}function ok(e,t){void 0===t&&(t={});var i=Rb.plugins.concat(t.plugins||[]);"production"!==process.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;Wb(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Wb(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),Hb(t,i)),document.addEventListener("touchstart",kb,gb),window.addEventListener("blur",fb);var n=Object.assign({},t,{plugins:i}),o=Ob(e);if("production"!==process.env.NODE_ENV){var M=Tb(n.content),r=o.length>1;Pb(M&&r,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var s=o.reduce((function(e,t){var i=t&&nk(t,n);return i&&e.push(i),e}),[]);return Tb(e)?s[0]:s}ok.defaultProps=Rb,ok.setDefaultProps=function(e){"production"!==process.env.NODE_ENV&&Hb(e,[]),Object.keys(e).forEach((function(t){Rb[t]=e[t]}))},ok.currentInput=Eb;var Mk=Object.assign({},ME,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),rk=function(e,t){var i;void 0===t&&(t={}),"production"!==process.env.NODE_ENV&&Wb(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var n,o=e,M=[],r=[],s=t.overrides,a=[],l=!1;function g(){r=o.map((function(e){return jb(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function N(){M=o.map((function(e){return e.reference}))}function c(e){o.forEach((function(t){e?t.enable():t.disable()}))}function u(e){return o.map((function(t){var i=t.setProps;return t.setProps=function(o){i(o),t.reference===n&&e.setProps(o)},function(){t.setProps=i}}))}function D(e,t){var i=r.indexOf(t);if(t!==n){n=t;var a=(s||[]).concat("content").reduce((function(e,t){return e[t]=o[i].props[t],e}),{});e.setProps(Object.assign({},a,{getReferenceClientRect:"function"==typeof a.getReferenceClientRect?a.getReferenceClientRect:function(){var e;return null==(e=M[i])?void 0:e.getBoundingClientRect()}}))}}c(!1),N(),g();var d={fn:function(){return{onDestroy:function(){c(!0)},onHidden:function(){n=null},onClickOutside:function(e){e.props.showOnCreate&&!l&&(l=!0,n=null)},onShow:function(e){e.props.showOnCreate&&!l&&(l=!0,D(e,M[0]))},onTrigger:function(e,t){D(e,t.currentTarget)}}}},h=ok(pb(),Object.assign({},hb(t,["overrides"]),{plugins:[d].concat(t.plugins||[]),triggerTarget:r,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(i=t.popperOptions)?void 0:i.modifiers)||[],[Mk])})})),j=h.show;h.show=function(e){if(j(),!n&&null==e)return D(h,M[0]);if(!n||null!=e){if("number"==typeof e)return M[e]&&D(h,M[e]);if(o.indexOf(e)>=0){var t=e.reference;return D(h,t)}return M.indexOf(e)>=0?D(h,e):void 0}},h.showNext=function(){var e=M[0];if(!n)return h.show(0);var t=M.indexOf(n);h.show(M[t+1]||e)},h.showPrevious=function(){var e=M[M.length-1];if(!n)return h.show(e);var t=M.indexOf(n),i=M[t-1]||e;h.show(i)};var I=h.setProps;return h.setProps=function(e){s=e.overrides||s,I(e)},h.setInstances=function(e){c(!0),a.forEach((function(e){return e()})),o=e,c(!1),N(),g(),a=u(h),h.setProps({triggerTarget:r})},a=u(h),h},sk={clientX:0,clientY:0},ak=[];function lk(e){var t=e.clientX,i=e.clientY;sk={clientX:t,clientY:i}}var gk={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=mb(e.props.triggerTarget||t),n=!1,o=!1,M=!0,r=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function a(){i.addEventListener("mousemove",N)}function l(){i.removeEventListener("mousemove",N)}function g(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function N(i){var n=!i.target||t.contains(i.target),o=e.props.followCursor,M=i.clientX,r=i.clientY,s=t.getBoundingClientRect(),a=M-s.left,l=r-s.top;!n&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=M,n=r;"initial"===o&&(i=e.left+a,n=e.top+l);var s="horizontal"===o?e.top:n,g="vertical"===o?e.right:i,N="horizontal"===o?e.bottom:n,c="vertical"===o?e.left:i;return{width:g-c,height:N-s,top:s,right:g,bottom:N,left:c}}})}function c(){e.props.followCursor&&(ak.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",lk)}(i))}function u(){0===(ak=ak.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",lk)}(i)}return{onCreate:c,onDestroy:u,onBeforeUpdate:function(){r=e.props},onAfterUpdate:function(t,i){var M=i.followCursor;n||void 0!==M&&r.followCursor!==M&&(u(),M?(c(),!e.state.isMounted||o||s()||a()):(l(),g()))},onMount:function(){e.props.followCursor&&!o&&(M&&(N(sk),M=!1),s()||a())},onTrigger:function(e,t){Ab(t)&&(sk={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(g(),l(),M=!0)}}}};function Nk(e){return!0===e||"true"===e||!1!==e&&"false"!==e&&(!!["initial","horizontal","vertical"].includes(String(e))&&e)}function ck(e){if(Array.isArray(e))return e;if("number"==typeof e)return e;if("string"==typeof e){if(e.includes(",")){const t=e.split(",").map((e=>parseInt(e.trim(),10)));return t}const t=parseInt(e,10);if(!isNaN(t))return t}return 200}ok.setDefaultProps({render:Kb});let uk=class extends Fe{static get styles(){return[Vw]}createRenderRoot(){return this}constructor(){super(),this.for=null,this.content="",this.size="small",this.duration=200,this.interactive=!1,this.placement="top",this.disabled=!1,this.distance=8,this.skidding=0,this.open=!1,this.trigger="mouseenter focus",this.allowHTML=!1,this.followCursor=!1,this.arrow="default",this.singleton=!1,this.enableRecursiveMode=!1,this.delay=0,this.maxWidth="auto",this.zIndex=9999,this.hideOnClick=!0,this.inertia=!1,this.interactiveBorder=2,this.enableVisibilityEffect=!1,this.enableTabClose=!1}firstUpdated(){this.attachTooltip();const e=this.for&&document.getElementById(this.for)||this.firstElementChild;this.visibilityManager=new mn({host:this,target:e,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}refresh(){this.attachTooltip()}hasValidContent(){const e=this.content??this.getAttribute("data-tippy-content")??"";return"string"==typeof e&&e.trim().length>0}attachTooltip(){if(this.destroyTooltips(),this.disabled||!this.enableRecursiveMode&&!this.singleton&&!this.hasValidContent())return;const e={content:this.content||this.getAttribute("data-tippy-content")||void 0,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"lite",animation:"fade",interactive:this.interactive,arrow:rb,duration:ck(this.duration),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:!1,inertia:this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:Nk(this.followCursor),plugins:Nk(this.followCursor)?[gk]:[],onShow:e=>{this.open=!0;const t=e.popper.querySelector(".tippy-content");t&&(this.width&&(t.style.width=this.width),this.height&&(t.style.height=this.height,t.style.overflow="auto")),this.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:e,target:e.reference}}))},onHide:e=>{this.open=!1,this.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:e,target:e.reference}}))}};if(this.for){if(this.singleton&&!this.for.startsWith("#")&&!document.getElementById(this.for)){const t=Array.from(document.querySelectorAll(`.${this.for}`));if(t.length>0)return this.tooltipInstances=t.map((t=>{const i=ok(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=rk(this.tooltipInstances,{delay:[75,0],arrow:rb,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}const t=document.getElementById(this.for);if(this.singleton&&t){const i=Array.from(t.querySelectorAll("[content]"));if(i.length>0)return this.tooltipInstances=i.map((t=>{const i=ok(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=rk(this.tooltipInstances,{delay:[75,0],arrow:rb,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}if(this.targetEl=document.getElementById(this.for),!this.targetEl)return;this.id||(this.generatedId=`nile-tooltip-${Math.random().toString(36).slice(2,9)}`,this.id=this.generatedId),this.prevDescribedby=this.targetEl.getAttribute("aria-describedby");const i=this.prevDescribedby?`${this.prevDescribedby} ${this.id}`:this.id;return this.targetEl.setAttribute("aria-describedby",i),this.singleInstance=ok(this.targetEl,e),this.size&&this.singleInstance.popper.querySelector(".tippy-box")?.classList.add(this.size),void(this.open&&queueMicrotask((()=>this.singleInstance?.show())))}if(this.enableRecursiveMode){const t=Array.from(this.querySelectorAll("[content]")).filter((e=>{const t=e.getAttribute("content");return null!==t&&t.trim().length>0}));t.length>0&&(this.tooltipInstances=t.map((t=>{const i=t,n=i.getAttribute("content")||this.content,o=ok(i,{...e,content:n});return o.popper.querySelector(".tippy-box")?.classList.add(this.size),o})),this.singleton&&this.tooltipInstances.length>1&&(this.singletonInstance=rk(this.tooltipInstances,{delay:[75,0],arrow:rb,moveTransition:"transform 0.15s ease-out"})),this.open&&(this.singletonInstance?this.singletonInstance.show():this.tooltipInstances.forEach((e=>e.show()))))}else{const t=this.firstElementChild;if(t){const i=t.getAttribute("content")||this.content,n=ok(t,{...e,content:i});n.popper.querySelector(".tippy-box")?.classList.add(this.size),this.tooltipInstances=[n],this.open&&n.show()}}}destroyTooltips(){if(this.tooltipInstances?.forEach((e=>e.destroy())),this.singleInstance?.destroy(),this.singletonInstance?.destroy(),this.tooltipInstances=void 0,this.singleInstance=void 0,this.singletonInstance=void 0,this.targetEl&&this.id){const e=this.targetEl.getAttribute("aria-describedby")?.split(" ").filter((e=>e!==this.id)).join(" ").trim();e?this.targetEl.setAttribute("aria-describedby",e):this.targetEl.removeAttribute("aria-describedby")}}hideAllTooltips(){this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.destroyTooltips()}updated(e){super.updated(e),["for","content","placement","distance","skidding","trigger","disabled","hoist","size","arrow","singleton"].some((t=>e.has(t)))&&this.attachTooltip(),e.has("open")&&(this.open?(this.visibilityManager?.setup(),this.singleInstance?.show(),this.singletonInstance?.show(),this.tooltipInstances?.forEach((e=>e.show()))):(this.visibilityManager?.cleanup(),this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))))}};e([ue({type:String,attribute:"for"})],uk.prototype,"for",void 0),e([ue({type:String,reflect:!0})],uk.prototype,"content",void 0),e([ue({type:String,reflect:!0})],uk.prototype,"size",void 0),e([ue({type:String,reflect:!0})],uk.prototype,"duration",void 0),e([ue({type:Boolean,reflect:!0})],uk.prototype,"interactive",void 0),e([ue({type:String})],uk.prototype,"placement",void 0),e([ue({type:Boolean})],uk.prototype,"disabled",void 0),e([ue({type:Number})],uk.prototype,"distance",void 0),e([ue({type:Number})],uk.prototype,"skidding",void 0),e([ue({type:Boolean,reflect:!0})],uk.prototype,"open",void 0),e([ue({type:String})],uk.prototype,"trigger",void 0),e([ue({type:Boolean,reflect:!0})],uk.prototype,"allowHTML",void 0),e([ue({type:String,reflect:!0,attribute:!0})],uk.prototype,"followCursor",void 0),e([ue({type:String,reflect:!0,attribute:!0})],uk.prototype,"arrow",void 0),e([ue({type:Boolean,reflect:!0})],uk.prototype,"singleton",void 0),e([ue({type:Boolean,reflect:!0})],uk.prototype,"enableRecursiveMode",void 0),e([ue({type:String,reflect:!0})],uk.prototype,"delay",void 0),e([ue({type:String,reflect:!0})],uk.prototype,"maxWidth",void 0),e([ue({type:Number})],uk.prototype,"zIndex",void 0),e([ue({type:[Boolean,String],reflect:!0})],uk.prototype,"hideOnClick",void 0),e([ue({type:Boolean,reflect:!0})],uk.prototype,"inertia",void 0),e([ue({type:Number})],uk.prototype,"interactiveBorder",void 0),e([ue({type:Boolean,reflect:!0})],uk.prototype,"enableVisibilityEffect",void 0),e([ue({type:Boolean,reflect:!0})],uk.prototype,"enableTabClose",void 0),e([ue({type:String,reflect:!0})],uk.prototype,"width",void 0),e([ue({type:String,reflect:!0})],uk.prototype,"height",void 0),uk=e([ge("nile-lite-tooltip")],uk);const Dk=r`
19335
+ `;!function(){const e="nile-lite-tooltip-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=Pw.cssText,document.head.appendChild(t)}();var Ww="top",_w="bottom",Rw="right",Bw="left",Gw="auto",Fw=[Ww,_w,Rw,Bw],Hw="start",$w="end",Jw="viewport",Xw="popper",qw=Fw.reduce((function(e,t){return e.concat([t+"-"+Hw,t+"-"+$w])}),[]),Kw=[].concat(Fw,[Gw]).reduce((function(e,t){return e.concat([t,t+"-"+Hw,t+"-"+$w])}),[]),eE=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function tE(e){return e?(e.nodeName||"").toLowerCase():null}function iE(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function nE(e){return e instanceof iE(e).Element||e instanceof Element}function oE(e){return e instanceof iE(e).HTMLElement||e instanceof HTMLElement}function ME(e){return"undefined"!=typeof ShadowRoot&&(e instanceof iE(e).ShadowRoot||e instanceof ShadowRoot)}var rE={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];oE(o)&&tE(o)&&(Object.assign(o.style,i),Object.keys(n).forEach((function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],o=t.attributes[e]||{},M=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});oE(n)&&tE(n)&&(Object.assign(n.style,M),Object.keys(o).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]};function sE(e){return e.split("-")[0]}var aE=Math.max,lE=Math.min,gE=Math.round;function NE(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function cE(){return!/^((?!chrome|android).)*safari/i.test(NE())}function uE(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),o=1,M=1;t&&oE(e)&&(o=e.offsetWidth>0&&gE(n.width)/e.offsetWidth||1,M=e.offsetHeight>0&&gE(n.height)/e.offsetHeight||1);var r=(nE(e)?iE(e):window).visualViewport,s=!cE()&&i,a=(n.left+(s&&r?r.offsetLeft:0))/o,l=(n.top+(s&&r?r.offsetTop:0))/M,g=n.width/o,N=n.height/M;return{width:g,height:N,top:l,right:a+g,bottom:l+N,left:a,x:a,y:l}}function DE(e){var t=uE(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function dE(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&ME(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function hE(e){return iE(e).getComputedStyle(e)}function jE(e){return["table","td","th"].indexOf(tE(e))>=0}function IE(e){return((nE(e)?e.ownerDocument:e.document)||window.document).documentElement}function zE(e){return"html"===tE(e)?e:e.assignedSlot||e.parentNode||(ME(e)?e.host:null)||IE(e)}function yE(e){return oE(e)&&"fixed"!==hE(e).position?e.offsetParent:null}function pE(e){for(var t=iE(e),i=yE(e);i&&jE(i)&&"static"===hE(i).position;)i=yE(i);return i&&("html"===tE(i)||"body"===tE(i)&&"static"===hE(i).position)?t:i||function(e){var t=/firefox/i.test(NE());if(/Trident/i.test(NE())&&oE(e)&&"fixed"===hE(e).position)return null;var i=zE(e);for(ME(i)&&(i=i.host);oE(i)&&["html","body"].indexOf(tE(i))<0;){var n=hE(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}function TE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function AE(e,t,i){return aE(e,lE(t,i))}function OE(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function xE(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}var LE={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,o=e.options,M=i.elements.arrow,r=i.modifiersData.popperOffsets,s=sE(i.placement),a=TE(s),l=[Bw,Rw].indexOf(s)>=0?"height":"width";if(M&&r){var g=function(e,t){return OE("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:xE(e,Fw))}(o.padding,i),N=DE(M),c="y"===a?Ww:Bw,u="y"===a?_w:Rw,D=i.rects.reference[l]+i.rects.reference[a]-r[a]-i.rects.popper[l],d=r[a]-i.rects.reference[a],h=pE(M),j=h?"y"===a?h.clientHeight||0:h.clientWidth||0:0,I=D/2-d/2,z=g[c],y=j-N[l]-g[u],p=j/2-N[l]/2+I,T=AE(z,p,y),A=a;i.modifiersData[n]=((t={})[A]=T,t.centerOffset=T-p,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&dE(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function mE(e){return e.split("-")[1]}var SE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wE(e){var t,i=e.popper,n=e.popperRect,o=e.placement,M=e.variation,r=e.offsets,s=e.position,a=e.gpuAcceleration,l=e.adaptive,g=e.roundOffsets,N=e.isFixed,c=r.x,u=void 0===c?0:c,D=r.y,d=void 0===D?0:D,h="function"==typeof g?g({x:u,y:d}):{x:u,y:d};u=h.x,d=h.y;var j=r.hasOwnProperty("x"),I=r.hasOwnProperty("y"),z=Bw,y=Ww,p=window;if(l){var T=pE(i),A="clientHeight",O="clientWidth";if(T===iE(i)&&"static"!==hE(T=IE(i)).position&&"absolute"===s&&(A="scrollHeight",O="scrollWidth"),o===Ww||(o===Bw||o===Rw)&&M===$w)y=_w,d-=(N&&T===p&&p.visualViewport?p.visualViewport.height:T[A])-n.height,d*=a?1:-1;if(o===Bw||(o===Ww||o===_w)&&M===$w)z=Rw,u-=(N&&T===p&&p.visualViewport?p.visualViewport.width:T[O])-n.width,u*=a?1:-1}var x,L=Object.assign({position:s},l&&SE),m=!0===g?function(e,t){var i=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:gE(i*o)/o||0,y:gE(n*o)/o||0}}({x:u,y:d},iE(i)):{x:u,y:d};return u=m.x,d=m.y,a?Object.assign({},L,((x={})[y]=I?"0":"",x[z]=j?"0":"",x.transform=(p.devicePixelRatio||1)<=1?"translate("+u+"px, "+d+"px)":"translate3d("+u+"px, "+d+"px, 0)",x)):Object.assign({},L,((t={})[y]=I?d+"px":"",t[z]=j?u+"px":"",t.transform="",t))}var EE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,o=void 0===n||n,M=i.adaptive,r=void 0===M||M,s=i.roundOffsets,a=void 0===s||s,l={placement:sE(t.placement),variation:mE(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,wE(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,wE(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},bE={passive:!0};var kE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,o=n.scroll,M=void 0===o||o,r=n.resize,s=void 0===r||r,a=iE(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return M&&l.forEach((function(e){e.addEventListener("scroll",i.update,bE)})),s&&a.addEventListener("resize",i.update,bE),function(){M&&l.forEach((function(e){e.removeEventListener("scroll",i.update,bE)})),s&&a.removeEventListener("resize",i.update,bE)}},data:{}},vE={left:"right",right:"left",bottom:"top",top:"bottom"};function fE(e){return e.replace(/left|right|bottom|top/g,(function(e){return vE[e]}))}var QE={start:"end",end:"start"};function CE(e){return e.replace(/start|end/g,(function(e){return QE[e]}))}function UE(e){var t=iE(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function YE(e){return uE(IE(e)).left+UE(e).scrollLeft}function ZE(e){var t=hE(e),i=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function VE(e){return["html","body","#document"].indexOf(tE(e))>=0?e.ownerDocument.body:oE(e)&&ZE(e)?e:VE(zE(e))}function PE(e,t){var i;void 0===t&&(t=[]);var n=VE(e),o=n===(null==(i=e.ownerDocument)?void 0:i.body),M=iE(n),r=o?[M].concat(M.visualViewport||[],ZE(n)?n:[]):n,s=t.concat(r);return o?s:s.concat(PE(zE(r)))}function WE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _E(e,t,i){return t===Jw?WE(function(e,t){var i=iE(e),n=IE(e),o=i.visualViewport,M=n.clientWidth,r=n.clientHeight,s=0,a=0;if(o){M=o.width,r=o.height;var l=cE();(l||!l&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}return{width:M,height:r,x:s+YE(e),y:a}}(e,i)):nE(t)?function(e,t){var i=uE(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):WE(function(e){var t,i=IE(e),n=UE(e),o=null==(t=e.ownerDocument)?void 0:t.body,M=aE(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),r=aE(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+YE(e),a=-n.scrollTop;return"rtl"===hE(o||i).direction&&(s+=aE(i.clientWidth,o?o.clientWidth:0)-M),{width:M,height:r,x:s,y:a}}(IE(e)))}function RE(e,t,i,n){var o="clippingParents"===t?function(e){var t=PE(zE(e)),i=["absolute","fixed"].indexOf(hE(e).position)>=0&&oE(e)?pE(e):e;return nE(i)?t.filter((function(e){return nE(e)&&dE(e,i)&&"body"!==tE(e)})):[]}(e):[].concat(t),M=[].concat(o,[i]),r=M[0],s=M.reduce((function(t,i){var o=_E(e,i,n);return t.top=aE(o.top,t.top),t.right=lE(o.right,t.right),t.bottom=lE(o.bottom,t.bottom),t.left=aE(o.left,t.left),t}),_E(e,r,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function BE(e){var t,i=e.reference,n=e.element,o=e.placement,M=o?sE(o):null,r=o?mE(o):null,s=i.x+i.width/2-n.width/2,a=i.y+i.height/2-n.height/2;switch(M){case Ww:t={x:s,y:i.y-n.height};break;case _w:t={x:s,y:i.y+i.height};break;case Rw:t={x:i.x+i.width,y:a};break;case Bw:t={x:i.x-n.width,y:a};break;default:t={x:i.x,y:i.y}}var l=M?TE(M):null;if(null!=l){var g="y"===l?"height":"width";switch(r){case Hw:t[l]=t[l]-(i[g]/2-n[g]/2);break;case $w:t[l]=t[l]+(i[g]/2-n[g]/2)}}return t}function GE(e,t){void 0===t&&(t={});var i=t,n=i.placement,o=void 0===n?e.placement:n,M=i.strategy,r=void 0===M?e.strategy:M,s=i.boundary,a=void 0===s?"clippingParents":s,l=i.rootBoundary,g=void 0===l?Jw:l,N=i.elementContext,c=void 0===N?Xw:N,u=i.altBoundary,D=void 0!==u&&u,d=i.padding,h=void 0===d?0:d,j=OE("number"!=typeof h?h:xE(h,Fw)),I=c===Xw?"reference":Xw,z=e.rects.popper,y=e.elements[D?I:c],p=RE(nE(y)?y:y.contextElement||IE(e.elements.popper),a,g,r),T=uE(e.elements.reference),A=BE({reference:T,element:z,strategy:"absolute",placement:o}),O=WE(Object.assign({},z,A)),x=c===Xw?O:T,L={top:p.top-x.top+j.top,bottom:x.bottom-p.bottom+j.bottom,left:p.left-x.left+j.left,right:x.right-p.right+j.right},m=e.modifiersData.offset;if(c===Xw&&m){var S=m[o];Object.keys(L).forEach((function(e){var t=[Rw,_w].indexOf(e)>=0?1:-1,i=[Ww,_w].indexOf(e)>=0?"y":"x";L[e]+=S[i]*t}))}return L}function FE(e,t){void 0===t&&(t={});var i=t,n=i.placement,o=i.boundary,M=i.rootBoundary,r=i.padding,s=i.flipVariations,a=i.allowedAutoPlacements,l=void 0===a?Kw:a,g=mE(n),N=g?s?qw:qw.filter((function(e){return mE(e)===g})):Fw,c=N.filter((function(e){return l.indexOf(e)>=0}));0===c.length&&(c=N);var u=c.reduce((function(t,i){return t[i]=GE(e,{placement:i,boundary:o,rootBoundary:M,padding:r})[sE(i)],t}),{});return Object.keys(u).sort((function(e,t){return u[e]-u[t]}))}var HE={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=i.mainAxis,M=void 0===o||o,r=i.altAxis,s=void 0===r||r,a=i.fallbackPlacements,l=i.padding,g=i.boundary,N=i.rootBoundary,c=i.altBoundary,u=i.flipVariations,D=void 0===u||u,d=i.allowedAutoPlacements,h=t.options.placement,j=sE(h),I=a||(j===h||!D?[fE(h)]:function(e){if(sE(e)===Gw)return[];var t=fE(e);return[CE(e),t,CE(t)]}(h)),z=[h].concat(I).reduce((function(e,i){return e.concat(sE(i)===Gw?FE(t,{placement:i,boundary:g,rootBoundary:N,padding:l,flipVariations:D,allowedAutoPlacements:d}):i)}),[]),y=t.rects.reference,p=t.rects.popper,T=new Map,A=!0,O=z[0],x=0;x<z.length;x++){var L=z[x],m=sE(L),S=mE(L)===Hw,w=[Ww,_w].indexOf(m)>=0,E=w?"width":"height",b=GE(t,{placement:L,boundary:g,rootBoundary:N,altBoundary:c,padding:l}),k=w?S?Rw:Bw:S?_w:Ww;y[E]>p[E]&&(k=fE(k));var v=fE(k),f=[];if(M&&f.push(b[m]<=0),s&&f.push(b[k]<=0,b[v]<=0),f.every((function(e){return e}))){O=L,A=!1;break}T.set(L,f)}if(A)for(var Q=function(e){var t=z.find((function(t){var i=T.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},C=D?3:1;C>0;C--){if("break"===Q(C))break}t.placement!==O&&(t.modifiersData[n]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function $E(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function JE(e){return[Ww,Rw,_w,Bw].some((function(t){return e[t]>=0}))}var XE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,o=t.rects.popper,M=t.modifiersData.preventOverflow,r=GE(t,{elementContext:"reference"}),s=GE(t,{altBoundary:!0}),a=$E(r,n),l=$E(s,o,M),g=JE(a),N=JE(l);t.modifiersData[i]={referenceClippingOffsets:a,popperEscapeOffsets:l,isReferenceHidden:g,hasPopperEscaped:N},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":g,"data-popper-escaped":N})}};var qE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,o=i.offset,M=void 0===o?[0,0]:o,r=Kw.reduce((function(e,i){return e[i]=function(e,t,i){var n=sE(e),o=[Bw,Ww].indexOf(n)>=0?-1:1,M="function"==typeof i?i(Object.assign({},t,{placement:e})):i,r=M[0],s=M[1];return r=r||0,s=(s||0)*o,[Bw,Rw].indexOf(n)>=0?{x:s,y:r}:{x:r,y:s}}(i,t.rects,M),e}),{}),s=r[t.placement],a=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=l),t.modifiersData[n]=r}};var KE={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=BE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var eb={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,o=i.mainAxis,M=void 0===o||o,r=i.altAxis,s=void 0!==r&&r,a=i.boundary,l=i.rootBoundary,g=i.altBoundary,N=i.padding,c=i.tether,u=void 0===c||c,D=i.tetherOffset,d=void 0===D?0:D,h=GE(t,{boundary:a,rootBoundary:l,padding:N,altBoundary:g}),j=sE(t.placement),I=mE(t.placement),z=!I,y=TE(j),p="x"===y?"y":"x",T=t.modifiersData.popperOffsets,A=t.rects.reference,O=t.rects.popper,x="function"==typeof d?d(Object.assign({},t.rects,{placement:t.placement})):d,L="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),m=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(T){if(M){var w,E="y"===y?Ww:Bw,b="y"===y?_w:Rw,k="y"===y?"height":"width",v=T[y],f=v+h[E],Q=v-h[b],C=u?-O[k]/2:0,U=I===Hw?A[k]:O[k],Y=I===Hw?-O[k]:-A[k],Z=t.elements.arrow,V=u&&Z?DE(Z):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=P[E],_=P[b],R=AE(0,A[k],V[k]),B=z?A[k]/2-C-R-W-L.mainAxis:U-R-W-L.mainAxis,G=z?-A[k]/2+C+R+_+L.mainAxis:Y+R+_+L.mainAxis,F=t.elements.arrow&&pE(t.elements.arrow),H=F?"y"===y?F.clientTop||0:F.clientLeft||0:0,$=null!=(w=null==m?void 0:m[y])?w:0,J=v+G-$,X=AE(u?lE(f,v+B-$-H):f,v,u?aE(Q,J):Q);T[y]=X,S[y]=X-v}if(s){var q,K="x"===y?Ww:Bw,ee="x"===y?_w:Rw,te=T[p],ie="y"===p?"height":"width",ne=te+h[K],oe=te-h[ee],Me=-1!==[Ww,Bw].indexOf(j),re=null!=(q=null==m?void 0:m[p])?q:0,se=Me?ne:te-A[ie]-O[ie]-re+L.altAxis,ae=Me?te+A[ie]+O[ie]-re-L.altAxis:oe,le=u&&Me?function(e,t,i){var n=AE(e,t,i);return n>i?i:n}(se,te,ae):AE(u?se:ne,te,u?ae:oe);T[p]=le,S[p]=le-te}t.modifiersData[n]=S}},requiresIfExists:["offset"]};function tb(e,t,i){void 0===i&&(i=!1);var n,o,M=oE(t),r=oE(t)&&function(e){var t=e.getBoundingClientRect(),i=gE(t.width)/e.offsetWidth||1,n=gE(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),s=IE(t),a=uE(e,r,i),l={scrollLeft:0,scrollTop:0},g={x:0,y:0};return(M||!M&&!i)&&(("body"!==tE(t)||ZE(s))&&(l=(n=t)!==iE(n)&&oE(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:UE(n)),oE(t)?((g=uE(t,!0)).x+=t.clientLeft,g.y+=t.clientTop):s&&(g.x=YE(s))),{x:a.left+l.scrollLeft-g.x,y:a.top+l.scrollTop-g.y,width:a.width,height:a.height}}function ib(e){var t=new Map,i=new Set,n=[];function o(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var n=t.get(e);n&&o(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||o(e)})),n}var nb={placement:"bottom",modifiers:[],strategy:"absolute"};function ob(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Mb(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,o=t.defaultOptions,M=void 0===o?nb:o;return function(e,t,i){void 0===i&&(i=M);var o,r,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},nb,M),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],l=!1,g={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;N(),s.options=Object.assign({},M,s.options,o),s.scrollParents={reference:nE(e)?PE(e):e.contextElement?PE(e.contextElement):[],popper:PE(t)};var r=function(e){var t=ib(e);return eE.reduce((function(e,i){return e.concat(t.filter((function(e){return e.phase===i})))}),[])}(function(e){var t=e.reduce((function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers)));return s.orderedModifiers=r.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,o=e.effect;if("function"==typeof o){var M=o({state:s,name:t,instance:g,options:n}),r=function(){};a.push(M||r)}})),g.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,i=e.popper;if(ob(t,i)){s.rects={reference:tb(t,pE(i),"fixed"===s.options.strategy),popper:DE(i)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var n=0;n<s.orderedModifiers.length;n++)if(!0!==s.reset){var o=s.orderedModifiers[n],M=o.fn,r=o.options,a=void 0===r?{}:r,N=o.name;"function"==typeof M&&(s=M({state:s,options:a,name:N,instance:g})||s)}else s.reset=!1,n=-1}}},update:(o=function(){return new Promise((function(e){g.forceUpdate(),e(s)}))},function(){return r||(r=new Promise((function(e){Promise.resolve().then((function(){r=void 0,e(o())}))}))),r}),destroy:function(){N(),l=!0}};if(!ob(e,t))return g;function N(){a.forEach((function(e){return e()})),a=[]}return g.setOptions(i).then((function(e){!l&&i.onFirstUpdate&&i.onFirstUpdate(e)})),g}}var rb=Mb({defaultModifiers:[kE,KE,EE,rE,qE,HE,eb,LE,XE]}),sb='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',ab="tippy-content",lb="tippy-arrow",gb="tippy-svg-arrow",Nb={passive:!0,capture:!0},cb=function(){return document.body};function ub(e,t,i){if(Array.isArray(e)){var n=e[t];return null==n?Array.isArray(i)?i[t]:i:n}return e}function Db(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function db(e,t){return"function"==typeof e?e.apply(void 0,t):e}function hb(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout((function(){e(n)}),t)};var i}function jb(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function Ib(e){return[].concat(e)}function zb(e,t){-1===e.indexOf(t)&&e.push(t)}function yb(e){return[].slice.call(e)}function pb(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function Tb(){return document.createElement("div")}function Ab(e){return["Element","Fragment"].some((function(t){return Db(e,t)}))}function Ob(e){return Db(e,"MouseEvent")}function xb(e){return Ab(e)?[e]:function(e){return Db(e,"NodeList")}(e)?yb(e):Array.isArray(e)?e:yb(document.querySelectorAll(e))}function Lb(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function mb(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Sb(e){var t,i=Ib(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function wb(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[n](t,i)}))}function Eb(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var bb={isTouch:!1},kb=0;function vb(){bb.isTouch||(bb.isTouch=!0,window.performance&&document.addEventListener("mousemove",fb))}function fb(){var e=performance.now();e-kb<20&&(bb.isTouch=!1,document.removeEventListener("mousemove",fb)),kb=e}function Qb(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var i=t._tippy;t.blur&&!i.state.isVisible&&t.blur()}}var Cb,Ub=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function Yb(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Zb(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function Vb(e){return Zb("\n %ctippy.js\n\n %c"+Zb(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function Pb(e){return[Vb(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function Wb(e,t){var i;e&&!Cb.has(t)&&(Cb.add(t),(i=console).warn.apply(i,Pb(t)))}function _b(e,t){var i;e&&!Cb.has(t)&&(Cb.add(t),(i=console).error.apply(i,Pb(t)))}"production"!==process.env.NODE_ENV&&(Cb=new Set);var Rb={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bb=Object.assign({appendTo:cb,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Rb,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Gb=Object.keys(Bb);function Fb(e){var t=(e.plugins||[]).reduce((function(t,i){var n,o=i.name,M=i.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bb[o])?n:M);return t}),{});return Object.assign({},e,t)}function Hb(e,t){var i=Object.assign({},t,{content:db(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Fb(Object.assign({},Bb,{plugins:t}))):Gb).reduce((function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},Bb.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function $b(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,n,o=jb(Bb,Object.keys(Rb)),M=(i=o,n=e,!{}.hasOwnProperty.call(i,n));M&&(M=0===t.filter((function(t){return t.name===e})).length),Wb(M,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function Jb(e,t){e.innerHTML=t}function Xb(e){var t=Tb();return!0===e?t.className=lb:(t.className=gb,Ab(e)?t.appendChild(e):Jb(t,e)),t}function qb(e,t){Ab(t.content)?(Jb(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Jb(e,t.content):e.textContent=t.content)}function Kb(e){var t=e.firstElementChild,i=yb(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(ab)})),arrow:i.find((function(e){return e.classList.contains(lb)||e.classList.contains(gb)})),backdrop:i.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function ek(e){var t=Tb(),i=Tb();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=Tb();function o(i,n){var o=Kb(t),M=o.box,r=o.content,s=o.arrow;n.theme?M.setAttribute("data-theme",n.theme):M.removeAttribute("data-theme"),"string"==typeof n.animation?M.setAttribute("data-animation",n.animation):M.removeAttribute("data-animation"),n.inertia?M.setAttribute("data-inertia",""):M.removeAttribute("data-inertia"),M.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?M.setAttribute("role",n.role):M.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||qb(r,e.props),n.arrow?s?i.arrow!==n.arrow&&(M.removeChild(s),M.appendChild(Xb(n.arrow))):M.appendChild(Xb(n.arrow)):s&&M.removeChild(s)}return n.className=ab,n.setAttribute("data-state","hidden"),qb(n,e.props),t.appendChild(i),i.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}ek.$$tippy=!0;var tk=1,ik=[],nk=[];function ok(e,t){var i,n,o,M,r,s,a,l,g=Hb(e,Object.assign({},Bb,Fb(pb(t)))),N=!1,c=!1,u=!1,D=!1,d=[],h=hb(F,g.interactiveDebounce),j=tk++,I=(l=g.plugins).filter((function(e,t){return l.indexOf(e)===t})),z={id:j,reference:e,popper:Tb(),popperInstance:null,props:g,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:I,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){"production"!==process.env.NODE_ENV&&Wb(z.state.isDestroyed,Yb("setProps"));if(z.state.isDestroyed)return;v("onBeforeUpdate",[z,t]),B();var i=z.props,n=Hb(e,Object.assign({},i,pb(t),{ignoreAttributes:!0}));z.props=n,R(),i.interactiveDebounce!==n.interactiveDebounce&&(C(),h=hb(F,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?Ib(i.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):n.triggerTarget&&e.removeAttribute("aria-expanded");Q(),k(),T&&T(i,n);z.popperInstance&&(X(),K().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));v("onAfterUpdate",[z,t])},setContent:function(e){z.setProps({content:e})},show:function(){"production"!==process.env.NODE_ENV&&Wb(z.state.isDestroyed,Yb("show"));var e=z.state.isVisible,t=z.state.isDestroyed,i=!z.state.isEnabled,n=bb.isTouch&&!z.props.touch,o=ub(z.props.duration,0,Bb.duration);if(e||t||i||n)return;if(S().hasAttribute("disabled"))return;if(v("onShow",[z],!1),!1===z.props.onShow(z))return;z.state.isVisible=!0,m()&&(p.style.visibility="visible");k(),V(),z.state.isMounted||(p.style.transition="none");if(m()){var M=E();Lb([M.box,M.content],0)}s=function(){var e;if(z.state.isVisible&&!D){if(D=!0,p.offsetHeight,p.style.transition=z.props.moveTransition,m()&&z.props.animation){var t=E(),i=t.box,n=t.content;Lb([i,n],o),mb([i,n],"visible")}f(),Q(),zb(nk,z),null==(e=z.popperInstance)||e.forceUpdate(),v("onMount",[z]),z.props.animation&&m()&&function(e,t){W(e,t)}(o,(function(){z.state.isShown=!0,v("onShown",[z])}))}},function(){var e,t=z.props.appendTo,i=S();e=z.props.interactive&&t===cb||"parent"===t?i.parentNode:db(t,[i]);e.contains(p)||e.appendChild(p);z.state.isMounted=!0,X(),"production"!==process.env.NODE_ENV&&Wb(z.props.interactive&&t===Bb.appendTo&&i.nextElementSibling!==p,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==process.env.NODE_ENV&&Wb(z.state.isDestroyed,Yb("hide"));var e=!z.state.isVisible,t=z.state.isDestroyed,i=!z.state.isEnabled,n=ub(z.props.duration,1,Bb.duration);if(e||t||i)return;if(v("onHide",[z],!1),!1===z.props.onHide(z))return;z.state.isVisible=!1,z.state.isShown=!1,D=!1,N=!1,m()&&(p.style.visibility="hidden");if(C(),P(),k(!0),m()){var o=E(),M=o.box,r=o.content;z.props.animation&&(Lb([M,r],n),mb([M,r],"hidden"))}f(),Q(),z.props.animation?m()&&function(e,t){W(e,(function(){!z.state.isVisible&&p.parentNode&&p.parentNode.contains(p)&&t()}))}(n,z.unmount):z.unmount()},hideWithInteractivity:function(e){"production"!==process.env.NODE_ENV&&Wb(z.state.isDestroyed,Yb("hideWithInteractivity"));w().addEventListener("mousemove",h),zb(ik,h),h(e)},enable:function(){z.state.isEnabled=!0},disable:function(){z.hide(),z.state.isEnabled=!1},unmount:function(){"production"!==process.env.NODE_ENV&&Wb(z.state.isDestroyed,Yb("unmount"));z.state.isVisible&&z.hide();if(!z.state.isMounted)return;q(),K().forEach((function(e){e._tippy.unmount()})),p.parentNode&&p.parentNode.removeChild(p);nk=nk.filter((function(e){return e!==z})),z.state.isMounted=!1,v("onHidden",[z])},destroy:function(){"production"!==process.env.NODE_ENV&&Wb(z.state.isDestroyed,Yb("destroy"));if(z.state.isDestroyed)return;z.clearDelayTimeouts(),z.unmount(),B(),delete e._tippy,z.state.isDestroyed=!0,v("onDestroy",[z])}};if(!g.render)return"production"!==process.env.NODE_ENV&&_b(!0,"render() function has not been supplied."),z;var y=g.render(z),p=y.popper,T=y.onUpdate;p.setAttribute("data-tippy-root",""),p.id="tippy-"+z.id,z.popper=p,e._tippy=z,p._tippy=z;var A=I.map((function(e){return e.fn(z)})),O=e.hasAttribute("aria-expanded");return R(),Q(),k(),v("onCreate",[z]),g.showOnCreate&&ee(),p.addEventListener("mouseenter",(function(){z.props.interactive&&z.state.isVisible&&z.clearDelayTimeouts()})),p.addEventListener("mouseleave",(function(){z.props.interactive&&z.props.trigger.indexOf("mouseenter")>=0&&w().addEventListener("mousemove",h)})),z;function x(){var e=z.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===x()[0]}function m(){var e;return!(null==(e=z.props.render)||!e.$$tippy)}function S(){return a||e}function w(){var e=S().parentNode;return e?Sb(e):document}function E(){return Kb(p)}function b(e){return z.state.isMounted&&!z.state.isVisible||bb.isTouch||M&&"focus"===M.type?0:ub(z.props.delay,e?0:1,Bb.delay)}function k(e){void 0===e&&(e=!1),p.style.pointerEvents=z.props.interactive&&!e?"":"none",p.style.zIndex=""+z.props.zIndex}function v(e,t,i){var n;(void 0===i&&(i=!0),A.forEach((function(i){i[e]&&i[e].apply(i,t)})),i)&&(n=z.props)[e].apply(n,t)}function f(){var t=z.props.aria;if(t.content){var i="aria-"+t.content,n=p.id;Ib(z.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(z.state.isVisible)e.setAttribute(i,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(i,o):e.removeAttribute(i)}}))}}function Q(){!O&&z.props.aria.expanded&&Ib(z.props.triggerTarget||e).forEach((function(e){z.props.interactive?e.setAttribute("aria-expanded",z.state.isVisible&&e===S()?"true":"false"):e.removeAttribute("aria-expanded")}))}function C(){w().removeEventListener("mousemove",h),ik=ik.filter((function(e){return e!==h}))}function U(t){if(!bb.isTouch||!u&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!z.props.interactive||!Eb(p,i)){if(Ib(z.props.triggerTarget||e).some((function(e){return Eb(e,i)}))){if(bb.isTouch)return;if(z.state.isVisible&&z.props.trigger.indexOf("click")>=0)return}else v("onClickOutside",[z,t]);!0===z.props.hideOnClick&&(z.clearDelayTimeouts(),z.hide(),c=!0,setTimeout((function(){c=!1})),z.state.isMounted||P())}}}function Y(){u=!0}function Z(){u=!1}function V(){var e=w();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,Nb),e.addEventListener("touchstart",Z,Nb),e.addEventListener("touchmove",Y,Nb)}function P(){var e=w();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,Nb),e.removeEventListener("touchstart",Z,Nb),e.removeEventListener("touchmove",Y,Nb)}function W(e,t){var i=E().box;function n(e){e.target===i&&(wb(i,"remove",n),t())}if(0===e)return t();wb(i,"remove",r),wb(i,"add",n),r=n}function _(t,i,n){void 0===n&&(n=!1),Ib(z.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,n),d.push({node:e,eventType:t,handler:i,options:n})}))}function R(){var e;L()&&(_("touchstart",G,{passive:!0}),_("touchend",H,{passive:!0})),(e=z.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(_(e,G),e){case"mouseenter":_("mouseleave",H);break;case"focus":_(Ub?"focusout":"blur",$);break;case"focusin":_("focusout",$)}}))}function B(){d.forEach((function(e){var t=e.node,i=e.eventType,n=e.handler,o=e.options;t.removeEventListener(i,n,o)})),d=[]}function G(e){var t,i=!1;if(z.state.isEnabled&&!J(e)&&!c){var n="focus"===(null==(t=M)?void 0:t.type);M=e,a=e.currentTarget,Q(),!z.state.isVisible&&Ob(e)&&ik.forEach((function(t){return t(e)})),"click"===e.type&&(z.props.trigger.indexOf("mouseenter")<0||N)&&!1!==z.props.hideOnClick&&z.state.isVisible?i=!0:ee(e),"click"===e.type&&(N=!i),i&&!n&&te(e)}}function F(e){var t=e.target,i=S().contains(t)||p.contains(t);if("mousemove"!==e.type||!i){var n=K().concat(p).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:g}:null})).filter(Boolean);(function(e,t){var i=t.clientX,n=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,M=e.props.interactiveBorder,r=o.placement.split("-")[0],s=o.modifiersData.offset;if(!s)return!0;var a="bottom"===r?s.top.y:0,l="top"===r?s.bottom.y:0,g="right"===r?s.left.x:0,N="left"===r?s.right.x:0,c=t.top-n+a>M,u=n-t.bottom-l>M,D=t.left-i+g>M,d=i-t.right-N>M;return c||u||D||d}))})(n,e)&&(C(),te(e))}}function H(e){J(e)||z.props.trigger.indexOf("click")>=0&&N||(z.props.interactive?z.hideWithInteractivity(e):te(e))}function $(e){z.props.trigger.indexOf("focusin")<0&&e.target!==S()||z.props.interactive&&e.relatedTarget&&p.contains(e.relatedTarget)||te(e)}function J(e){return!!bb.isTouch&&L()!==e.type.indexOf("touch")>=0}function X(){q();var t=z.props,i=t.popperOptions,n=t.placement,o=t.offset,M=t.getReferenceClientRect,r=t.moveTransition,a=m()?Kb(p).arrow:null,l=M?{getBoundingClientRect:M,contextElement:M.contextElement||S()}:e,g={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(m()){var i=E().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},N=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},g];m()&&a&&N.push({name:"arrow",options:{element:a,padding:3}}),N.push.apply(N,(null==i?void 0:i.modifiers)||[]),z.popperInstance=rb(l,p,Object.assign({},i,{placement:n,onFirstUpdate:s,modifiers:N}))}function q(){z.popperInstance&&(z.popperInstance.destroy(),z.popperInstance=null)}function K(){return yb(p.querySelectorAll("[data-tippy-root]"))}function ee(e){z.clearDelayTimeouts(),e&&v("onTrigger",[z,e]),V();var t=b(!0),n=x(),o=n[0],M=n[1];bb.isTouch&&"hold"===o&&M&&(t=M),t?i=setTimeout((function(){z.show()}),t):z.show()}function te(e){if(z.clearDelayTimeouts(),v("onUntrigger",[z,e]),z.state.isVisible){if(!(z.props.trigger.indexOf("mouseenter")>=0&&z.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&N)){var t=b(!1);t?n=setTimeout((function(){z.state.isVisible&&z.hide()}),t):o=requestAnimationFrame((function(){z.hide()}))}}else P()}}function Mk(e,t){void 0===t&&(t={});var i=Bb.plugins.concat(t.plugins||[]);"production"!==process.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;_b(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),_b(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),$b(t,i)),document.addEventListener("touchstart",vb,Nb),window.addEventListener("blur",Qb);var n=Object.assign({},t,{plugins:i}),o=xb(e);if("production"!==process.env.NODE_ENV){var M=Ab(n.content),r=o.length>1;Wb(M&&r,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var s=o.reduce((function(e,t){var i=t&&ok(t,n);return i&&e.push(i),e}),[]);return Ab(e)?s[0]:s}Mk.defaultProps=Bb,Mk.setDefaultProps=function(e){"production"!==process.env.NODE_ENV&&$b(e,[]),Object.keys(e).forEach((function(t){Bb[t]=e[t]}))},Mk.currentInput=bb;var rk=Object.assign({},rE,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),sk=function(e,t){var i;void 0===t&&(t={}),"production"!==process.env.NODE_ENV&&_b(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var n,o=e,M=[],r=[],s=t.overrides,a=[],l=!1;function g(){r=o.map((function(e){return Ib(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function N(){M=o.map((function(e){return e.reference}))}function c(e){o.forEach((function(t){e?t.enable():t.disable()}))}function u(e){return o.map((function(t){var i=t.setProps;return t.setProps=function(o){i(o),t.reference===n&&e.setProps(o)},function(){t.setProps=i}}))}function D(e,t){var i=r.indexOf(t);if(t!==n){n=t;var a=(s||[]).concat("content").reduce((function(e,t){return e[t]=o[i].props[t],e}),{});e.setProps(Object.assign({},a,{getReferenceClientRect:"function"==typeof a.getReferenceClientRect?a.getReferenceClientRect:function(){var e;return null==(e=M[i])?void 0:e.getBoundingClientRect()}}))}}c(!1),N(),g();var d={fn:function(){return{onDestroy:function(){c(!0)},onHidden:function(){n=null},onClickOutside:function(e){e.props.showOnCreate&&!l&&(l=!0,n=null)},onShow:function(e){e.props.showOnCreate&&!l&&(l=!0,D(e,M[0]))},onTrigger:function(e,t){D(e,t.currentTarget)}}}},h=Mk(Tb(),Object.assign({},jb(t,["overrides"]),{plugins:[d].concat(t.plugins||[]),triggerTarget:r,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(i=t.popperOptions)?void 0:i.modifiers)||[],[rk])})})),j=h.show;h.show=function(e){if(j(),!n&&null==e)return D(h,M[0]);if(!n||null!=e){if("number"==typeof e)return M[e]&&D(h,M[e]);if(o.indexOf(e)>=0){var t=e.reference;return D(h,t)}return M.indexOf(e)>=0?D(h,e):void 0}},h.showNext=function(){var e=M[0];if(!n)return h.show(0);var t=M.indexOf(n);h.show(M[t+1]||e)},h.showPrevious=function(){var e=M[M.length-1];if(!n)return h.show(e);var t=M.indexOf(n),i=M[t-1]||e;h.show(i)};var I=h.setProps;return h.setProps=function(e){s=e.overrides||s,I(e)},h.setInstances=function(e){c(!0),a.forEach((function(e){return e()})),o=e,c(!1),N(),g(),a=u(h),h.setProps({triggerTarget:r})},a=u(h),h},ak={clientX:0,clientY:0},lk=[];function gk(e){var t=e.clientX,i=e.clientY;ak={clientX:t,clientY:i}}var Nk={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=Sb(e.props.triggerTarget||t),n=!1,o=!1,M=!0,r=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function a(){i.addEventListener("mousemove",N)}function l(){i.removeEventListener("mousemove",N)}function g(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function N(i){var n=!i.target||t.contains(i.target),o=e.props.followCursor,M=i.clientX,r=i.clientY,s=t.getBoundingClientRect(),a=M-s.left,l=r-s.top;!n&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=M,n=r;"initial"===o&&(i=e.left+a,n=e.top+l);var s="horizontal"===o?e.top:n,g="vertical"===o?e.right:i,N="horizontal"===o?e.bottom:n,c="vertical"===o?e.left:i;return{width:g-c,height:N-s,top:s,right:g,bottom:N,left:c}}})}function c(){e.props.followCursor&&(lk.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",gk)}(i))}function u(){0===(lk=lk.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",gk)}(i)}return{onCreate:c,onDestroy:u,onBeforeUpdate:function(){r=e.props},onAfterUpdate:function(t,i){var M=i.followCursor;n||void 0!==M&&r.followCursor!==M&&(u(),M?(c(),!e.state.isMounted||o||s()||a()):(l(),g()))},onMount:function(){e.props.followCursor&&!o&&(M&&(N(ak),M=!1),s()||a())},onTrigger:function(e,t){Ob(t)&&(ak={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(g(),l(),M=!0)}}}};function ck(e){return!0===e||"true"===e||!1!==e&&"false"!==e&&(!!["initial","horizontal","vertical"].includes(String(e))&&e)}function uk(e){if(Array.isArray(e))return e;if("number"==typeof e)return e;if("string"==typeof e){if(e.includes(",")){const t=e.split(",").map((e=>parseInt(e.trim(),10)));return t}const t=parseInt(e,10);if(!isNaN(t))return t}return 200}Mk.setDefaultProps({render:ek});let Dk=class extends Fe{static get styles(){return[Pw]}createRenderRoot(){return this}constructor(){super(),this.for=null,this.content="",this.size="small",this.duration=200,this.interactive=!1,this.placement="top",this.disabled=!1,this.distance=8,this.skidding=0,this.open=!1,this.trigger="mouseenter focus",this.allowHTML=!1,this.followCursor=!1,this.arrow="default",this.singleton=!1,this.enableRecursiveMode=!1,this.delay=0,this.maxWidth="auto",this.zIndex=9999,this.hideOnClick=!0,this.inertia=!1,this.interactiveBorder=2,this.enableVisibilityEffect=!1,this.enableTabClose=!1}firstUpdated(){this.attachTooltip();const e=this.for&&document.getElementById(this.for)||this.firstElementChild;this.visibilityManager=new mn({host:this,target:e,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}refresh(){this.attachTooltip()}hasValidContent(){const e=this.content??this.getAttribute("data-tippy-content")??"";return"string"==typeof e&&e.trim().length>0}attachTooltip(){if(this.destroyTooltips(),this.disabled||!this.enableRecursiveMode&&!this.singleton&&!this.hasValidContent())return;const e={content:this.content||this.getAttribute("data-tippy-content")||void 0,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"lite",animation:"fade",interactive:this.interactive,arrow:sb,duration:uk(this.duration),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:!1,inertia:this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:ck(this.followCursor),plugins:ck(this.followCursor)?[Nk]:[],onShow:e=>{this.open=!0;const t=e.popper.querySelector(".tippy-content");t&&(this.width&&(t.style.width=this.width),this.height&&(t.style.height=this.height,t.style.overflow="auto")),this.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:e,target:e.reference}}))},onHide:e=>{this.open=!1,this.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:e,target:e.reference}}))}};if(this.for){if(this.singleton&&!this.for.startsWith("#")&&!document.getElementById(this.for)){const t=Array.from(document.querySelectorAll(`.${this.for}`));if(t.length>0)return this.tooltipInstances=t.map((t=>{const i=Mk(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=sk(this.tooltipInstances,{delay:[75,0],arrow:sb,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}const t=document.getElementById(this.for);if(this.singleton&&t){const i=Array.from(t.querySelectorAll("[content]"));if(i.length>0)return this.tooltipInstances=i.map((t=>{const i=Mk(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=sk(this.tooltipInstances,{delay:[75,0],arrow:sb,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}if(this.targetEl=document.getElementById(this.for),!this.targetEl)return;this.id||(this.generatedId=`nile-tooltip-${Math.random().toString(36).slice(2,9)}`,this.id=this.generatedId),this.prevDescribedby=this.targetEl.getAttribute("aria-describedby");const i=this.prevDescribedby?`${this.prevDescribedby} ${this.id}`:this.id;return this.targetEl.setAttribute("aria-describedby",i),this.singleInstance=Mk(this.targetEl,e),this.size&&this.singleInstance.popper.querySelector(".tippy-box")?.classList.add(this.size),void(this.open&&queueMicrotask((()=>this.singleInstance?.show())))}if(this.enableRecursiveMode){const t=Array.from(this.querySelectorAll("[content]")).filter((e=>{const t=e.getAttribute("content");return null!==t&&t.trim().length>0}));t.length>0&&(this.tooltipInstances=t.map((t=>{const i=t,n=i.getAttribute("content")||this.content,o=Mk(i,{...e,content:n});return o.popper.querySelector(".tippy-box")?.classList.add(this.size),o})),this.singleton&&this.tooltipInstances.length>1&&(this.singletonInstance=sk(this.tooltipInstances,{delay:[75,0],arrow:sb,moveTransition:"transform 0.15s ease-out"})),this.open&&(this.singletonInstance?this.singletonInstance.show():this.tooltipInstances.forEach((e=>e.show()))))}else{const t=this.firstElementChild;if(t){const i=t.getAttribute("content")||this.content,n=Mk(t,{...e,content:i});n.popper.querySelector(".tippy-box")?.classList.add(this.size),this.tooltipInstances=[n],this.open&&n.show()}}}destroyTooltips(){if(this.tooltipInstances?.forEach((e=>e.destroy())),this.singleInstance?.destroy(),this.singletonInstance?.destroy(),this.tooltipInstances=void 0,this.singleInstance=void 0,this.singletonInstance=void 0,this.targetEl&&this.id){const e=this.targetEl.getAttribute("aria-describedby")?.split(" ").filter((e=>e!==this.id)).join(" ").trim();e?this.targetEl.setAttribute("aria-describedby",e):this.targetEl.removeAttribute("aria-describedby")}}hideAllTooltips(){this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.destroyTooltips()}updated(e){super.updated(e),["for","content","placement","distance","skidding","trigger","disabled","hoist","size","arrow","singleton"].some((t=>e.has(t)))&&this.attachTooltip(),e.has("open")&&(this.open?(this.visibilityManager?.setup(),this.singleInstance?.show(),this.singletonInstance?.show(),this.tooltipInstances?.forEach((e=>e.show()))):(this.visibilityManager?.cleanup(),this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))))}};e([ue({type:String,attribute:"for"})],Dk.prototype,"for",void 0),e([ue({type:String,reflect:!0})],Dk.prototype,"content",void 0),e([ue({type:String,reflect:!0})],Dk.prototype,"size",void 0),e([ue({type:String,reflect:!0})],Dk.prototype,"duration",void 0),e([ue({type:Boolean,reflect:!0})],Dk.prototype,"interactive",void 0),e([ue({type:String})],Dk.prototype,"placement",void 0),e([ue({type:Boolean})],Dk.prototype,"disabled",void 0),e([ue({type:Number})],Dk.prototype,"distance",void 0),e([ue({type:Number})],Dk.prototype,"skidding",void 0),e([ue({type:Boolean,reflect:!0})],Dk.prototype,"open",void 0),e([ue({type:String})],Dk.prototype,"trigger",void 0),e([ue({type:Boolean,reflect:!0})],Dk.prototype,"allowHTML",void 0),e([ue({type:String,reflect:!0,attribute:!0})],Dk.prototype,"followCursor",void 0),e([ue({type:String,reflect:!0,attribute:!0})],Dk.prototype,"arrow",void 0),e([ue({type:Boolean,reflect:!0})],Dk.prototype,"singleton",void 0),e([ue({type:Boolean,reflect:!0})],Dk.prototype,"enableRecursiveMode",void 0),e([ue({type:String,reflect:!0})],Dk.prototype,"delay",void 0),e([ue({type:String,reflect:!0})],Dk.prototype,"maxWidth",void 0),e([ue({type:Number})],Dk.prototype,"zIndex",void 0),e([ue({type:[Boolean,String],reflect:!0})],Dk.prototype,"hideOnClick",void 0),e([ue({type:Boolean,reflect:!0})],Dk.prototype,"inertia",void 0),e([ue({type:Number})],Dk.prototype,"interactiveBorder",void 0),e([ue({type:Boolean,reflect:!0})],Dk.prototype,"enableVisibilityEffect",void 0),e([ue({type:Boolean,reflect:!0})],Dk.prototype,"enableTabClose",void 0),e([ue({type:String,reflect:!0})],Dk.prototype,"width",void 0),e([ue({type:String,reflect:!0})],Dk.prototype,"height",void 0),Dk=e([ge("nile-lite-tooltip")],Dk);const dk=r`
19187
19336
  :host {
19188
19337
  width: 100%;
19189
19338
  height: 100%;
19190
19339
  overflow-y: auto;
19191
19340
  }
19192
19341
 
19193
- `;let dk=class extends Fe{static get styles(){return[Dk]}render(){return _`
19342
+ `;let hk=class extends Fe{static get styles(){return[dk]}render(){return _`
19194
19343
  <slot> </slot>
19195
- `}};dk=e([ge("nile-side-bar-panel")],dk);const hk=r`
19344
+ `}};hk=e([ge("nile-side-bar-panel")],hk);const jk=r`
19196
19345
  :host {
19197
19346
  box-sizing: border-box;
19198
19347
  -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
@@ -19610,7 +19759,7 @@ a {
19610
19759
  .detail--light .detail__selection-content {
19611
19760
  padding: var(--nile-spacing-3xl, var(--ng-spacing-3xl));
19612
19761
  }
19613
- `;async function jk(e){if(!e.open&&!e.disabled)return e.open=!0,Jt(e,"nile-after-show")}async function Ik(e){if(e.open&&!e.disabled)return e.open=!1,Jt(e,"nile-after-hide")}_t("detail.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),_t("detail.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});const zk="undefined"!=typeof window;let yk=class extends Fe{constructor(){super(...arguments),this.open=!1,this.heading="",this.description="",this.expandIconPlacement="right",this.disabled=!1,this.variant="default",this.items=[],this.selected=[],this.allowHtmlLabel=!1,this.disableLocalSearch=!1,this.pageSize=200,this.placeholderLabel="Loading…",this.searchPlaceholder="Search...",this.itemsLabel="attributes",this.restoreLabel="Restore",this.clearLabel="Clear",this.gridRows=6,this.gridColumns=3,this.minColumnWidth="220px",this.laneHeight=32,this.orientation="horizontal",this.maxHeight="320px",this.matrixColumns=20,this.virtualize=!1,this.virtualizeThreshold=60,this.overscan=4,this._detailOpen=!1,this._hasSlottedContent=!1,this._searchTerm="",this._selectedSet=new Set,this._showSelectedOnly=!1,this.showSelectedToggle=!1,this.selectedOnlyLabel="Selected",this.showAllLabel="Show all",this._restoreDefaults=null,this._gridResizeObserver=null,this._virtCtrl=null,this._rowVirtCtrl=null,this._colVirtCtrl=null,this._pageCache=new Map,this._pendingPages=new Set}get _isSelectionVariant(){return"selection"===this.variant||"select-light"===this.variant}get _isLightVariant(){return"light"===this.variant||"select-light"===this.variant}get _isInfiniteMode(){return this._isSelectionVariant&&"function"==typeof this.fetchPage&&"number"==typeof this.totalCount&&"both"!==this.orientation}_effectiveTotalCount(){return this._isInfiniteMode?this.totalCount??0:this._filteredItems.length}_getItemAt(e){if(!this._isInfiniteMode)return this._filteredItems[e];const t=Math.max(1,this.pageSize),i=Math.floor(e/t),n=this._pageCache.get(i);return n?n[e-i*t]:void 0}_scheduleFetchForRange(e,t){if(!this._isInfiniteMode||!this.fetchPage)return;const i=Math.max(1,this.pageSize),n=this.totalCount??0;if(n<=0)return;const o=Math.floor(e/i),M=Math.floor(Math.min(t,n-1)/i);for(let e=o;e<=M;e++)this._pageCache.has(e)||this._pendingPages.has(e)||this._loadPage(e)}async _loadPage(e){if(!this.fetchPage)return;const t=Math.max(1,this.pageSize),i=e*t,n=this.totalCount??0,o=Math.min(t,Math.max(0,n-i));if(!(o<=0)){this._pendingPages.add(e);try{const t=await this.fetchPage(i,o);this._pageCache.set(e,Array.isArray(t)?t:[]),this.dispatchEvent(new CustomEvent("nile-page-load",{detail:{pageIndex:e,offset:i,limit:o,rows:this._pageCache.get(e)},bubbles:!0,composed:!0}))}catch(t){this.dispatchEvent(new CustomEvent("nile-page-error",{detail:{pageIndex:e,offset:i,limit:o,error:t},bubbles:!0,composed:!0}))}finally{this._pendingPages.delete(e),this.requestUpdate()}}}resetPages(){this._pageCache=new Map,this._pendingPages=new Set,this.requestUpdate()}get _isVirtualized(){return!!zk&&(!!this._isInfiniteMode||this._isSelectionVariant&&(this.virtualize||this.items.length>this.virtualizeThreshold))}get _columnWidthPx(){const e=parseInt(this.minColumnWidth,10);return Number.isFinite(e)&&e>0?e:220}firstUpdated(){this._detailOpen=this.open,this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0",this._syncSelectedFromProperty(),null===this._restoreDefaults&&(this._restoreDefaults=[...this._selectedSet]),this._setupGridResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this._gridResizeObserver?.disconnect(),this._gridResizeObserver=null}updated(e){this._isSelectionVariant&&(this._setupGridResizeObserver(),this._syncVirtualizer(),this._scheduleTooltipOverflowCheck())}_syncVirtualizer(){if(!zk)return;if(!this._isVirtualized)return this._virtCtrl=null,this._rowVirtCtrl=null,void(this._colVirtCtrl=null);const e=this.shadowRoot?.querySelector(".detail__selection-grid");if(!e)return;if("both"===this.orientation)return this._virtCtrl=null,void this._syncBothVirtualizers();this._rowVirtCtrl=null,this._colVirtCtrl=null;const t=this._effectiveTotalCount(),i="vertical"===this.orientation,n=Math.max(1,i?this.gridColumns:this.gridRows),o=i?this.laneHeight:this._columnWidthPx;if(!this._virtCtrl)return void(this._virtCtrl=new lM(this,{count:t,getScrollElement:()=>this.shadowRoot?.querySelector(".detail__selection-grid"),estimateSize:()=>o,horizontal:!i,lanes:n,overscan:this.overscan}));const M=this._virtCtrl.getVirtualizer(),r=M.options,s=!!r.horizontal!=!i;(r.count!==t||r.lanes!==n||r.overscan!==this.overscan||s)&&(M.setOptions({...r,count:t,lanes:n,overscan:this.overscan,horizontal:!i,estimateSize:()=>o}),M.measure())}_syncBothVirtualizers(){const e=this._filteredItems.length,t=Math.max(1,this.matrixColumns),i=Math.max(1,Math.ceil(e/t)),n=this._columnWidthPx,o=this.laneHeight,M=()=>this.shadowRoot?.querySelector(".detail__selection-grid");if(this._rowVirtCtrl){const e=this._rowVirtCtrl.getVirtualizer(),t=e.options;t.count===i&&t.overscan===this.overscan||(e.setOptions({...t,count:i,overscan:this.overscan,estimateSize:()=>o}),e.measure())}else this._rowVirtCtrl=new lM(this,{count:i,getScrollElement:M,estimateSize:()=>o,horizontal:!1,overscan:this.overscan});if(this._colVirtCtrl){const e=this._colVirtCtrl.getVirtualizer(),i=e.options;i.count===t&&i.overscan===this.overscan||(e.setOptions({...i,count:t,overscan:this.overscan,estimateSize:()=>n}),e.measure())}else this._colVirtCtrl=new lM(this,{count:t,getScrollElement:M,estimateSize:()=>n,horizontal:!0,overscan:this.overscan})}_setupGridResizeObserver(){if(!this._isSelectionVariant)return;if("undefined"==typeof ResizeObserver)return;const e=this.shadowRoot?.querySelector(".detail__selection-grid");e&&(this._gridResizeObserver||(this._gridResizeObserver=new ResizeObserver((()=>this._scheduleTooltipOverflowCheck())),this._gridResizeObserver.observe(e)))}_scheduleTooltipOverflowCheck(){"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame((()=>this._updateTooltipOverflowStates()))}async _updateTooltipOverflowStates(){const e=this.shadowRoot?.querySelectorAll(".detail__selection-tooltip");if(e)for(const t of e){const e=t.querySelector("nile-checkbox");if(!e)continue;e.updateComplete&&await e.updateComplete;const i=e.shadowRoot?.querySelector('[part="label"]');!!i&&i.scrollWidth>i.clientWidth+1?t.removeAttribute("disabled"):t.setAttribute("disabled","")}}_onSelectedPropertyChange(){this._syncSelectedFromProperty()}_onConfigChange(){this._applyConfig()}_applyConfig(){const e=this.config;if(e){if(void 0!==e.variant&&(this.variant=e.variant),void 0!==e.heading&&(this.heading=e.heading),void 0!==e.description&&(this.description=e.description),void 0!==e.itemsLabel&&(this.itemsLabel=e.itemsLabel),void 0!==e.open&&(this.open=e.open),void 0!==e.disabled&&(this.disabled=e.disabled),void 0!==e.items&&(this.items=e.items),void 0!==e.selected&&(this.selected=e.selected),void 0!==e.renderItemConfig&&(this.renderItemConfig=e.renderItemConfig),void 0!==e.allowHtmlLabel&&(this.allowHtmlLabel=e.allowHtmlLabel),e.layout){const t=e.layout;void 0!==t.orientation&&(this.orientation=t.orientation),void 0!==t.gridRows&&(this.gridRows=t.gridRows),void 0!==t.gridColumns&&(this.gridColumns=t.gridColumns),void 0!==t.matrixColumns&&(this.matrixColumns=t.matrixColumns),void 0!==t.minColumnWidth&&(this.minColumnWidth=t.minColumnWidth),void 0!==t.laneHeight&&(this.laneHeight=t.laneHeight),void 0!==t.maxHeight&&(this.maxHeight=t.maxHeight),void 0!==t.expandIconPlacement&&(this.expandIconPlacement=t.expandIconPlacement)}e.search&&(void 0!==e.search.placeholder&&(this.searchPlaceholder=e.search.placeholder),void 0!==e.search.disableLocal&&(this.disableLocalSearch=e.search.disableLocal)),e.virtualization&&(void 0!==e.virtualization.enabled&&(this.virtualize=e.virtualization.enabled),void 0!==e.virtualization.threshold&&(this.virtualizeThreshold=e.virtualization.threshold),void 0!==e.virtualization.overscan&&(this.overscan=e.virtualization.overscan)),e.pagination&&(void 0!==e.pagination.totalCount&&(this.totalCount=e.pagination.totalCount),void 0!==e.pagination.pageSize&&(this.pageSize=e.pagination.pageSize),void 0!==e.pagination.fetchPage&&(this.fetchPage=e.pagination.fetchPage),void 0!==e.pagination.placeholderLabel&&(this.placeholderLabel=e.pagination.placeholderLabel)),e.labels&&(void 0!==e.labels.restore&&(this.restoreLabel=e.labels.restore),void 0!==e.labels.clear&&(this.clearLabel=e.labels.clear),void 0!==e.labels.selectedOnly&&(this.selectedOnlyLabel=e.labels.selectedOnly),void 0!==e.labels.showAll&&(this.showAllLabel=e.labels.showAll)),void 0!==e.showSelectedToggle&&(this.showSelectedToggle=e.showSelectedToggle)}}_syncSelectedFromProperty(){this._selectedSet=new Set(this.selected||[])}_getItemValue(e){const t=this.renderItemConfig;return t?.getValue?String(t.getValue(e)):"string"==typeof e?e:String(e.value??"")}_getItemLabel(e){const t=this.renderItemConfig;return t?.getDisplayText?t.getDisplayText(e):"string"==typeof e?e:e.label??this._getItemValue(e)}_getItemSearchText(e){const t=this.renderItemConfig;return t?.getSearchText?t.getSearchText(e):this._getItemLabel(e)}_getItemDescription(e){const t=this.renderItemConfig;return t?.getDescription?t.getDescription(e)??"":"string"==typeof e?"":e.description??""}_getItemPrefix(e){const t=this.renderItemConfig;return t?.getPrefix?t.getPrefix(e)??"":"string"==typeof e?"":e.prefix??""}_getItemSuffix(e){const t=this.renderItemConfig;return t?.getSuffix?t.getSuffix(e)??"":"string"==typeof e?"":e.suffix??""}_getItemDisabled(e){const t=this.renderItemConfig;return t?.getDisabled?!!t.getDisabled(e):"string"!=typeof e&&!!e.disabled}_getItemClassName(e){const t=this.renderItemConfig;return t?.getClassName?t.getClassName(e)??"":"string"==typeof e?"":e.className??""}get _filteredItems(){let e=this.items;if(this._showSelectedOnly&&(e=e.filter((e=>this._selectedSet.has(this._getItemValue(e))))),this.disableLocalSearch)return e;const t=this._searchTerm.trim().toLowerCase();return t?e.filter((e=>this._getItemSearchText(e).toLowerCase().includes(t))):e}_onToggleSelectedOnly(e){e.preventDefault();const t=!this._showSelectedOnly;t&&0===this._selectedSet.size||(this._showSelectedOnly=t)}_selectableValues(){return(this._isInfiniteMode?Array.from(this._pageCache.values()).flat():this.items).filter((e=>!this._getItemDisabled(e))).map((e=>this._getItemValue(e)))}get _allChecked(){const e=this._selectableValues();return 0!==e.length&&e.every((e=>this._selectedSet.has(e)))}get _indeterminate(){const e=this._selectableValues(),t=e.filter((e=>this._selectedSet.has(e))).length;return t>0&&t<e.length}get _countLabel(){const e=this._isInfiniteMode?this.totalCount??0:this.items.length;return`${this._selectedSet.size} of ${e} ${this.itemsLabel} selected`}_emitSelectionChange(){this.selected=[...this._selectedSet],this.dispatchEvent(new CustomEvent("nile-change",{detail:{selected:[...this._selectedSet]},bubbles:!0,composed:!0}))}_onItemChange(e,t,i){if(t)return void i.preventDefault();const n=i.target,o=new Set(this._selectedSet);n.checked?o.add(e):o.delete(e),this._selectedSet=o,this._emitSelectionChange()}_onSelectAllChange(e){const t=e.target,i=this._selectableValues(),n=new Set(this._selectedSet);t.checked?i.forEach((e=>n.add(e))):i.forEach((e=>n.delete(e))),this._selectedSet=n,this._emitSelectionChange()}_emitSearch(e){this.dispatchEvent(new CustomEvent("nile-search",{detail:{value:e},bubbles:!0,composed:!0}))}_onSearchInput(e){const t=e.target.value??"";this._searchTerm=t,this.disableLocalSearch&&this._emitSearch(t)}_onSearchClear(){this._searchTerm="",this.disableLocalSearch&&this._emitSearch("")}_onRestore(e){e.preventDefault();const t=this._restoreDefaults??this._selectableValues();this._selectedSet=new Set(t),this._emitSelectionChange()}_onClear(e){e.preventDefault(),this._selectedSet=new Set,this._showSelectedOnly=!1,this._emitSelectionChange()}_handleDefaultSlotChange(e){const t=e.target.assignedNodes({flatten:!0});this._hasSlottedContent=t.some((e=>e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&!(!e.textContent||!e.textContent.trim())))}_stopHeaderToggle(e){e.stopPropagation()}_handleSummaryClick(e){e.preventDefault(),function(e){e.disabled||(e.open?Ik(e):jk(e))}(this)}_handleSummaryKeyDown(e){!function(e,t){e.preventDefault(),"Enter"!==e.key&&" "!==e.key||(t.open?Ik(t):jk(t)),"ArrowUp"!==e.key&&"ArrowLeft"!==e.key||Ik(t),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||jk(t)}(e,this)}async handleOpenChange(){this.open?(this._detailOpen=!0,await async function(e){if(e.emit("nile-show",{cancelable:!0}).defaultPrevented)return void(e.open=!1);await Yt(e.body),e.body.hidden=!1;const{keyframes:t,options:i}=Rt(e,"detail.show",{dir:"ltr"});await Qt(e.body,Zt(t,e.body.scrollHeight),i),e.body.style.height="auto",e.emit("nile-after-show")}(this)):(await async function(e){if(e.emit("nile-hide",{cancelable:!0}).defaultPrevented)return void(e.open=!0);await Yt(e.body);const{keyframes:t,options:i}=Rt(e,"detail.hide",{dir:"ltr"});await Qt(e.body,Zt(t,e.body.scrollHeight),i),e.body.hidden=!0,e.body.style.height="auto",e.emit("nile-after-hide")}(this),this._detailOpen=!1)}async show(){return jk(this)}async hide(){return Ik(this)}get _summaryLabel(){return[this.heading,this.description].filter(Boolean).join(", ")}_renderSelectionLabel(){return _`
19762
+ `;async function Ik(e){if(!e.open&&!e.disabled)return e.open=!0,Jt(e,"nile-after-show")}async function zk(e){if(e.open&&!e.disabled)return e.open=!1,Jt(e,"nile-after-hide")}_t("detail.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),_t("detail.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});const yk="undefined"!=typeof window;let pk=class extends Fe{constructor(){super(...arguments),this.open=!1,this.heading="",this.description="",this.expandIconPlacement="right",this.disabled=!1,this.variant="default",this.items=[],this.selected=[],this.allowHtmlLabel=!1,this.disableLocalSearch=!1,this.pageSize=200,this.placeholderLabel="Loading…",this.searchPlaceholder="Search...",this.itemsLabel="attributes",this.restoreLabel="Restore",this.clearLabel="Clear",this.gridRows=6,this.gridColumns=3,this.minColumnWidth="220px",this.laneHeight=32,this.orientation="horizontal",this.maxHeight="320px",this.matrixColumns=20,this.virtualize=!1,this.virtualizeThreshold=60,this.overscan=4,this._detailOpen=!1,this._hasSlottedContent=!1,this._searchTerm="",this._selectedSet=new Set,this._showSelectedOnly=!1,this.showSelectedToggle=!1,this.selectedOnlyLabel="Selected",this.showAllLabel="Show all",this._restoreDefaults=null,this._gridResizeObserver=null,this._virtCtrl=null,this._rowVirtCtrl=null,this._colVirtCtrl=null,this._pageCache=new Map,this._pendingPages=new Set}get _isSelectionVariant(){return"selection"===this.variant||"select-light"===this.variant}get _isLightVariant(){return"light"===this.variant||"select-light"===this.variant}get _isInfiniteMode(){return this._isSelectionVariant&&"function"==typeof this.fetchPage&&"number"==typeof this.totalCount&&"both"!==this.orientation}_effectiveTotalCount(){return this._isInfiniteMode?this.totalCount??0:this._filteredItems.length}_getItemAt(e){if(!this._isInfiniteMode)return this._filteredItems[e];const t=Math.max(1,this.pageSize),i=Math.floor(e/t),n=this._pageCache.get(i);return n?n[e-i*t]:void 0}_scheduleFetchForRange(e,t){if(!this._isInfiniteMode||!this.fetchPage)return;const i=Math.max(1,this.pageSize),n=this.totalCount??0;if(n<=0)return;const o=Math.floor(e/i),M=Math.floor(Math.min(t,n-1)/i);for(let e=o;e<=M;e++)this._pageCache.has(e)||this._pendingPages.has(e)||this._loadPage(e)}async _loadPage(e){if(!this.fetchPage)return;const t=Math.max(1,this.pageSize),i=e*t,n=this.totalCount??0,o=Math.min(t,Math.max(0,n-i));if(!(o<=0)){this._pendingPages.add(e);try{const t=await this.fetchPage(i,o);this._pageCache.set(e,Array.isArray(t)?t:[]),this.dispatchEvent(new CustomEvent("nile-page-load",{detail:{pageIndex:e,offset:i,limit:o,rows:this._pageCache.get(e)},bubbles:!0,composed:!0}))}catch(t){this.dispatchEvent(new CustomEvent("nile-page-error",{detail:{pageIndex:e,offset:i,limit:o,error:t},bubbles:!0,composed:!0}))}finally{this._pendingPages.delete(e),this.requestUpdate()}}}resetPages(){this._pageCache=new Map,this._pendingPages=new Set,this.requestUpdate()}get _isVirtualized(){return!!yk&&(!!this._isInfiniteMode||this._isSelectionVariant&&(this.virtualize||this.items.length>this.virtualizeThreshold))}get _columnWidthPx(){const e=parseInt(this.minColumnWidth,10);return Number.isFinite(e)&&e>0?e:220}firstUpdated(){this._detailOpen=this.open,this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0",this._syncSelectedFromProperty(),null===this._restoreDefaults&&(this._restoreDefaults=[...this._selectedSet]),this._setupGridResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this._gridResizeObserver?.disconnect(),this._gridResizeObserver=null}updated(e){this._isSelectionVariant&&(this._setupGridResizeObserver(),this._syncVirtualizer(),this._scheduleTooltipOverflowCheck())}_syncVirtualizer(){if(!yk)return;if(!this._isVirtualized)return this._virtCtrl=null,this._rowVirtCtrl=null,void(this._colVirtCtrl=null);const e=this.shadowRoot?.querySelector(".detail__selection-grid");if(!e)return;if("both"===this.orientation)return this._virtCtrl=null,void this._syncBothVirtualizers();this._rowVirtCtrl=null,this._colVirtCtrl=null;const t=this._effectiveTotalCount(),i="vertical"===this.orientation,n=Math.max(1,i?this.gridColumns:this.gridRows),o=i?this.laneHeight:this._columnWidthPx;if(!this._virtCtrl)return void(this._virtCtrl=new lM(this,{count:t,getScrollElement:()=>this.shadowRoot?.querySelector(".detail__selection-grid"),estimateSize:()=>o,horizontal:!i,lanes:n,overscan:this.overscan}));const M=this._virtCtrl.getVirtualizer(),r=M.options,s=!!r.horizontal!=!i;(r.count!==t||r.lanes!==n||r.overscan!==this.overscan||s)&&(M.setOptions({...r,count:t,lanes:n,overscan:this.overscan,horizontal:!i,estimateSize:()=>o}),M.measure())}_syncBothVirtualizers(){const e=this._filteredItems.length,t=Math.max(1,this.matrixColumns),i=Math.max(1,Math.ceil(e/t)),n=this._columnWidthPx,o=this.laneHeight,M=()=>this.shadowRoot?.querySelector(".detail__selection-grid");if(this._rowVirtCtrl){const e=this._rowVirtCtrl.getVirtualizer(),t=e.options;t.count===i&&t.overscan===this.overscan||(e.setOptions({...t,count:i,overscan:this.overscan,estimateSize:()=>o}),e.measure())}else this._rowVirtCtrl=new lM(this,{count:i,getScrollElement:M,estimateSize:()=>o,horizontal:!1,overscan:this.overscan});if(this._colVirtCtrl){const e=this._colVirtCtrl.getVirtualizer(),i=e.options;i.count===t&&i.overscan===this.overscan||(e.setOptions({...i,count:t,overscan:this.overscan,estimateSize:()=>n}),e.measure())}else this._colVirtCtrl=new lM(this,{count:t,getScrollElement:M,estimateSize:()=>n,horizontal:!0,overscan:this.overscan})}_setupGridResizeObserver(){if(!this._isSelectionVariant)return;if("undefined"==typeof ResizeObserver)return;const e=this.shadowRoot?.querySelector(".detail__selection-grid");e&&(this._gridResizeObserver||(this._gridResizeObserver=new ResizeObserver((()=>this._scheduleTooltipOverflowCheck())),this._gridResizeObserver.observe(e)))}_scheduleTooltipOverflowCheck(){"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame((()=>this._updateTooltipOverflowStates()))}async _updateTooltipOverflowStates(){const e=this.shadowRoot?.querySelectorAll(".detail__selection-tooltip");if(e)for(const t of e){const e=t.querySelector("nile-checkbox");if(!e)continue;e.updateComplete&&await e.updateComplete;const i=e.shadowRoot?.querySelector('[part="label"]');!!i&&i.scrollWidth>i.clientWidth+1?t.removeAttribute("disabled"):t.setAttribute("disabled","")}}_onSelectedPropertyChange(){this._syncSelectedFromProperty()}_onConfigChange(){this._applyConfig()}_applyConfig(){const e=this.config;if(e){if(void 0!==e.variant&&(this.variant=e.variant),void 0!==e.heading&&(this.heading=e.heading),void 0!==e.description&&(this.description=e.description),void 0!==e.itemsLabel&&(this.itemsLabel=e.itemsLabel),void 0!==e.open&&(this.open=e.open),void 0!==e.disabled&&(this.disabled=e.disabled),void 0!==e.items&&(this.items=e.items),void 0!==e.selected&&(this.selected=e.selected),void 0!==e.renderItemConfig&&(this.renderItemConfig=e.renderItemConfig),void 0!==e.allowHtmlLabel&&(this.allowHtmlLabel=e.allowHtmlLabel),e.layout){const t=e.layout;void 0!==t.orientation&&(this.orientation=t.orientation),void 0!==t.gridRows&&(this.gridRows=t.gridRows),void 0!==t.gridColumns&&(this.gridColumns=t.gridColumns),void 0!==t.matrixColumns&&(this.matrixColumns=t.matrixColumns),void 0!==t.minColumnWidth&&(this.minColumnWidth=t.minColumnWidth),void 0!==t.laneHeight&&(this.laneHeight=t.laneHeight),void 0!==t.maxHeight&&(this.maxHeight=t.maxHeight),void 0!==t.expandIconPlacement&&(this.expandIconPlacement=t.expandIconPlacement)}e.search&&(void 0!==e.search.placeholder&&(this.searchPlaceholder=e.search.placeholder),void 0!==e.search.disableLocal&&(this.disableLocalSearch=e.search.disableLocal)),e.virtualization&&(void 0!==e.virtualization.enabled&&(this.virtualize=e.virtualization.enabled),void 0!==e.virtualization.threshold&&(this.virtualizeThreshold=e.virtualization.threshold),void 0!==e.virtualization.overscan&&(this.overscan=e.virtualization.overscan)),e.pagination&&(void 0!==e.pagination.totalCount&&(this.totalCount=e.pagination.totalCount),void 0!==e.pagination.pageSize&&(this.pageSize=e.pagination.pageSize),void 0!==e.pagination.fetchPage&&(this.fetchPage=e.pagination.fetchPage),void 0!==e.pagination.placeholderLabel&&(this.placeholderLabel=e.pagination.placeholderLabel)),e.labels&&(void 0!==e.labels.restore&&(this.restoreLabel=e.labels.restore),void 0!==e.labels.clear&&(this.clearLabel=e.labels.clear),void 0!==e.labels.selectedOnly&&(this.selectedOnlyLabel=e.labels.selectedOnly),void 0!==e.labels.showAll&&(this.showAllLabel=e.labels.showAll)),void 0!==e.showSelectedToggle&&(this.showSelectedToggle=e.showSelectedToggle)}}_syncSelectedFromProperty(){this._selectedSet=new Set(this.selected||[])}_getItemValue(e){const t=this.renderItemConfig;return t?.getValue?String(t.getValue(e)):"string"==typeof e?e:String(e.value??"")}_getItemLabel(e){const t=this.renderItemConfig;return t?.getDisplayText?t.getDisplayText(e):"string"==typeof e?e:e.label??this._getItemValue(e)}_getItemSearchText(e){const t=this.renderItemConfig;return t?.getSearchText?t.getSearchText(e):this._getItemLabel(e)}_getItemDescription(e){const t=this.renderItemConfig;return t?.getDescription?t.getDescription(e)??"":"string"==typeof e?"":e.description??""}_getItemPrefix(e){const t=this.renderItemConfig;return t?.getPrefix?t.getPrefix(e)??"":"string"==typeof e?"":e.prefix??""}_getItemSuffix(e){const t=this.renderItemConfig;return t?.getSuffix?t.getSuffix(e)??"":"string"==typeof e?"":e.suffix??""}_getItemDisabled(e){const t=this.renderItemConfig;return t?.getDisabled?!!t.getDisabled(e):"string"!=typeof e&&!!e.disabled}_getItemClassName(e){const t=this.renderItemConfig;return t?.getClassName?t.getClassName(e)??"":"string"==typeof e?"":e.className??""}get _filteredItems(){let e=this.items;if(this._showSelectedOnly&&(e=e.filter((e=>this._selectedSet.has(this._getItemValue(e))))),this.disableLocalSearch)return e;const t=this._searchTerm.trim().toLowerCase();return t?e.filter((e=>this._getItemSearchText(e).toLowerCase().includes(t))):e}_onToggleSelectedOnly(e){e.preventDefault();const t=!this._showSelectedOnly;t&&0===this._selectedSet.size||(this._showSelectedOnly=t)}_selectableValues(){return(this._isInfiniteMode?Array.from(this._pageCache.values()).flat():this.items).filter((e=>!this._getItemDisabled(e))).map((e=>this._getItemValue(e)))}get _allChecked(){const e=this._selectableValues();return 0!==e.length&&e.every((e=>this._selectedSet.has(e)))}get _indeterminate(){const e=this._selectableValues(),t=e.filter((e=>this._selectedSet.has(e))).length;return t>0&&t<e.length}get _countLabel(){const e=this._isInfiniteMode?this.totalCount??0:this.items.length;return`${this._selectedSet.size} of ${e} ${this.itemsLabel} selected`}_emitSelectionChange(){this.selected=[...this._selectedSet],this.dispatchEvent(new CustomEvent("nile-change",{detail:{selected:[...this._selectedSet]},bubbles:!0,composed:!0}))}_onItemChange(e,t,i){if(t)return void i.preventDefault();const n=i.target,o=new Set(this._selectedSet);n.checked?o.add(e):o.delete(e),this._selectedSet=o,this._emitSelectionChange()}_onSelectAllChange(e){const t=e.target,i=this._selectableValues(),n=new Set(this._selectedSet);t.checked?i.forEach((e=>n.add(e))):i.forEach((e=>n.delete(e))),this._selectedSet=n,this._emitSelectionChange()}_emitSearch(e){this.dispatchEvent(new CustomEvent("nile-search",{detail:{value:e},bubbles:!0,composed:!0}))}_onSearchInput(e){const t=e.target.value??"";this._searchTerm=t,this.disableLocalSearch&&this._emitSearch(t)}_onSearchClear(){this._searchTerm="",this.disableLocalSearch&&this._emitSearch("")}_onRestore(e){e.preventDefault();const t=this._restoreDefaults??this._selectableValues();this._selectedSet=new Set(t),this._emitSelectionChange()}_onClear(e){e.preventDefault(),this._selectedSet=new Set,this._showSelectedOnly=!1,this._emitSelectionChange()}_handleDefaultSlotChange(e){const t=e.target.assignedNodes({flatten:!0});this._hasSlottedContent=t.some((e=>e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&!(!e.textContent||!e.textContent.trim())))}_stopHeaderToggle(e){e.stopPropagation()}_handleSummaryClick(e){e.preventDefault(),function(e){e.disabled||(e.open?zk(e):Ik(e))}(this)}_handleSummaryKeyDown(e){!function(e,t){e.preventDefault(),"Enter"!==e.key&&" "!==e.key||(t.open?zk(t):Ik(t)),"ArrowUp"!==e.key&&"ArrowLeft"!==e.key||zk(t),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||Ik(t)}(e,this)}async handleOpenChange(){this.open?(this._detailOpen=!0,await async function(e){if(e.emit("nile-show",{cancelable:!0}).defaultPrevented)return void(e.open=!1);await Yt(e.body),e.body.hidden=!1;const{keyframes:t,options:i}=Rt(e,"detail.show",{dir:"ltr"});await Qt(e.body,Zt(t,e.body.scrollHeight),i),e.body.style.height="auto",e.emit("nile-after-show")}(this)):(await async function(e){if(e.emit("nile-hide",{cancelable:!0}).defaultPrevented)return void(e.open=!0);await Yt(e.body);const{keyframes:t,options:i}=Rt(e,"detail.hide",{dir:"ltr"});await Qt(e.body,Zt(t,e.body.scrollHeight),i),e.body.hidden=!0,e.body.style.height="auto",e.emit("nile-after-hide")}(this),this._detailOpen=!1)}async show(){return Ik(this)}async hide(){return zk(this)}get _summaryLabel(){return[this.heading,this.description].filter(Boolean).join(", ")}_renderSelectionLabel(){return _`
19614
19763
  <div part="selection-label" class="detail__selection-label">
19615
19764
  <nile-checkbox
19616
19765
  part="select-all"
@@ -19755,7 +19904,7 @@ a {
19755
19904
  ></slot>
19756
19905
  </div>
19757
19906
  </details>
19758
- `}};yk.styles=hk,e([he("details")],yk.prototype,"detail",void 0),e([he("summary")],yk.prototype,"header",void 0),e([he(".detail__body")],yk.prototype,"body",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],yk.prototype,"open",void 0),e([ue({attribute:!0,type:String,reflect:!0})],yk.prototype,"heading",void 0),e([ue({attribute:!0,type:String,reflect:!0})],yk.prototype,"description",void 0),e([ue({attribute:!0,reflect:!0})],yk.prototype,"expandIconPlacement",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],yk.prototype,"disabled",void 0),e([ue({attribute:!0,type:String,reflect:!0})],yk.prototype,"variant",void 0),e([ue({attribute:!1,type:Array})],yk.prototype,"items",void 0),e([ue({attribute:!1,type:Array})],yk.prototype,"selected",void 0),e([ue({attribute:!1})],yk.prototype,"renderItemConfig",void 0),e([ue({attribute:"allow-html-label",type:Boolean})],yk.prototype,"allowHtmlLabel",void 0),e([ue({attribute:"disable-local-search",type:Boolean})],yk.prototype,"disableLocalSearch",void 0),e([ue({attribute:"total-count",type:Number})],yk.prototype,"totalCount",void 0),e([ue({attribute:"page-size",type:Number})],yk.prototype,"pageSize",void 0),e([ue({attribute:!1})],yk.prototype,"fetchPage",void 0),e([ue({attribute:"placeholder-label",type:String})],yk.prototype,"placeholderLabel",void 0),e([ue({attribute:!1})],yk.prototype,"config",void 0),e([ue({attribute:"search-placeholder",type:String})],yk.prototype,"searchPlaceholder",void 0),e([ue({attribute:"items-label",type:String})],yk.prototype,"itemsLabel",void 0),e([ue({attribute:"restore-label",type:String})],yk.prototype,"restoreLabel",void 0),e([ue({attribute:"clear-label",type:String})],yk.prototype,"clearLabel",void 0),e([ue({attribute:"grid-rows",type:Number})],yk.prototype,"gridRows",void 0),e([ue({attribute:"grid-columns",type:Number})],yk.prototype,"gridColumns",void 0),e([ue({attribute:"min-column-width",type:String})],yk.prototype,"minColumnWidth",void 0),e([ue({attribute:"lane-height",type:Number})],yk.prototype,"laneHeight",void 0),e([ue({attribute:!0,type:String,reflect:!0})],yk.prototype,"orientation",void 0),e([ue({attribute:"max-height",type:String})],yk.prototype,"maxHeight",void 0),e([ue({attribute:"matrix-columns",type:Number})],yk.prototype,"matrixColumns",void 0),e([ue({attribute:!0,type:Boolean})],yk.prototype,"virtualize",void 0),e([ue({attribute:"virtualize-threshold",type:Number})],yk.prototype,"virtualizeThreshold",void 0),e([ue({attribute:"overscan",type:Number})],yk.prototype,"overscan",void 0),e([De()],yk.prototype,"_detailOpen",void 0),e([De()],yk.prototype,"_hasSlottedContent",void 0),e([De()],yk.prototype,"_searchTerm",void 0),e([De()],yk.prototype,"_selectedSet",void 0),e([De()],yk.prototype,"_showSelectedOnly",void 0),e([ue({attribute:"show-selected-toggle",type:Boolean,reflect:!0})],yk.prototype,"showSelectedToggle",void 0),e([ue({attribute:"selected-only-label",type:String})],yk.prototype,"selectedOnlyLabel",void 0),e([ue({attribute:"show-all-label",type:String})],yk.prototype,"showAllLabel",void 0),e([We("selected",{waitUntilFirstUpdate:!1})],yk.prototype,"_onSelectedPropertyChange",null),e([We("config",{waitUntilFirstUpdate:!1})],yk.prototype,"_onConfigChange",null),e([We("open",{waitUntilFirstUpdate:!0})],yk.prototype,"handleOpenChange",null),yk=e([ge("nile-detail")],yk);const pk=r`
19907
+ `}};pk.styles=jk,e([he("details")],pk.prototype,"detail",void 0),e([he("summary")],pk.prototype,"header",void 0),e([he(".detail__body")],pk.prototype,"body",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],pk.prototype,"open",void 0),e([ue({attribute:!0,type:String,reflect:!0})],pk.prototype,"heading",void 0),e([ue({attribute:!0,type:String,reflect:!0})],pk.prototype,"description",void 0),e([ue({attribute:!0,reflect:!0})],pk.prototype,"expandIconPlacement",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],pk.prototype,"disabled",void 0),e([ue({attribute:!0,type:String,reflect:!0})],pk.prototype,"variant",void 0),e([ue({attribute:!1,type:Array})],pk.prototype,"items",void 0),e([ue({attribute:!1,type:Array})],pk.prototype,"selected",void 0),e([ue({attribute:!1})],pk.prototype,"renderItemConfig",void 0),e([ue({attribute:"allow-html-label",type:Boolean})],pk.prototype,"allowHtmlLabel",void 0),e([ue({attribute:"disable-local-search",type:Boolean})],pk.prototype,"disableLocalSearch",void 0),e([ue({attribute:"total-count",type:Number})],pk.prototype,"totalCount",void 0),e([ue({attribute:"page-size",type:Number})],pk.prototype,"pageSize",void 0),e([ue({attribute:!1})],pk.prototype,"fetchPage",void 0),e([ue({attribute:"placeholder-label",type:String})],pk.prototype,"placeholderLabel",void 0),e([ue({attribute:!1})],pk.prototype,"config",void 0),e([ue({attribute:"search-placeholder",type:String})],pk.prototype,"searchPlaceholder",void 0),e([ue({attribute:"items-label",type:String})],pk.prototype,"itemsLabel",void 0),e([ue({attribute:"restore-label",type:String})],pk.prototype,"restoreLabel",void 0),e([ue({attribute:"clear-label",type:String})],pk.prototype,"clearLabel",void 0),e([ue({attribute:"grid-rows",type:Number})],pk.prototype,"gridRows",void 0),e([ue({attribute:"grid-columns",type:Number})],pk.prototype,"gridColumns",void 0),e([ue({attribute:"min-column-width",type:String})],pk.prototype,"minColumnWidth",void 0),e([ue({attribute:"lane-height",type:Number})],pk.prototype,"laneHeight",void 0),e([ue({attribute:!0,type:String,reflect:!0})],pk.prototype,"orientation",void 0),e([ue({attribute:"max-height",type:String})],pk.prototype,"maxHeight",void 0),e([ue({attribute:"matrix-columns",type:Number})],pk.prototype,"matrixColumns",void 0),e([ue({attribute:!0,type:Boolean})],pk.prototype,"virtualize",void 0),e([ue({attribute:"virtualize-threshold",type:Number})],pk.prototype,"virtualizeThreshold",void 0),e([ue({attribute:"overscan",type:Number})],pk.prototype,"overscan",void 0),e([De()],pk.prototype,"_detailOpen",void 0),e([De()],pk.prototype,"_hasSlottedContent",void 0),e([De()],pk.prototype,"_searchTerm",void 0),e([De()],pk.prototype,"_selectedSet",void 0),e([De()],pk.prototype,"_showSelectedOnly",void 0),e([ue({attribute:"show-selected-toggle",type:Boolean,reflect:!0})],pk.prototype,"showSelectedToggle",void 0),e([ue({attribute:"selected-only-label",type:String})],pk.prototype,"selectedOnlyLabel",void 0),e([ue({attribute:"show-all-label",type:String})],pk.prototype,"showAllLabel",void 0),e([We("selected",{waitUntilFirstUpdate:!1})],pk.prototype,"_onSelectedPropertyChange",null),e([We("config",{waitUntilFirstUpdate:!1})],pk.prototype,"_onConfigChange",null),e([We("open",{waitUntilFirstUpdate:!0})],pk.prototype,"handleOpenChange",null),pk=e([ge("nile-detail")],pk);const Tk=r`
19759
19908
  :host {
19760
19909
  display: inline-block;
19761
19910
  -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
@@ -19766,7 +19915,7 @@ a {
19766
19915
  canvas {
19767
19916
  display: block;
19768
19917
  }
19769
- `,Tk={L:0,M:1,Q:2,H:3},Ak=[[19,16,13,9],[34,28,22,16],[55,44,34,26],[80,64,48,36],[108,86,62,46],[136,108,76,60],[156,124,88,66],[194,154,110,86],[232,182,132,100],[274,216,154,122],[324,254,180,140],[370,290,206,158],[428,334,244,180],[461,365,261,197],[523,415,295,223],[589,453,325,253],[647,507,367,283],[721,563,397,313],[795,627,445,341],[861,669,485,385],[932,714,512,406],[1006,782,568,442],[1094,860,614,464],[1174,914,664,514],[1276,1e3,718,538],[1370,1062,754,596],[1468,1128,808,628],[1531,1193,871,661],[1631,1267,911,701],[1735,1373,985,745],[1843,1455,1033,793],[1955,1541,1115,845],[2071,1631,1171,901],[2191,1725,1231,961],[2306,1812,1286,986],[2434,1914,1354,1054],[2566,1992,1426,1096],[2702,2102,1502,1142],[2812,2216,1582,1222],[2956,2334,1666,1276]],Ok=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],xk=[[[1,19,0,0],[1,16,0,0],[1,13,0,0],[1,9,0,0]],[[1,34,0,0],[1,28,0,0],[1,22,0,0],[1,16,0,0]],[[1,55,0,0],[1,44,0,0],[2,17,0,0],[2,13,0,0]],[[1,80,0,0],[2,32,0,0],[2,24,0,0],[4,9,0,0]],[[1,108,0,0],[2,43,0,0],[2,15,2,16],[2,11,2,12]],[[2,68,0,0],[4,27,0,0],[4,19,0,0],[4,15,0,0]],[[2,78,0,0],[4,31,0,0],[2,14,4,15],[4,13,1,14]],[[2,97,0,0],[2,38,2,39],[4,18,2,19],[4,14,2,15]],[[2,116,0,0],[3,36,2,37],[4,16,4,17],[4,12,4,13]],[[2,68,2,69],[4,43,1,44],[6,19,2,20],[6,15,2,16]],[[4,81,0,0],[1,50,4,51],[4,22,4,23],[3,12,8,13]],[[2,92,2,93],[6,36,2,37],[4,20,6,21],[7,14,4,15]],[[4,107,0,0],[8,37,1,38],[8,20,4,21],[12,11,4,12]],[[3,115,1,116],[4,40,5,41],[11,16,5,17],[11,12,5,13]],[[5,87,1,88],[5,41,5,42],[5,24,7,25],[11,12,7,13]],[[5,98,1,99],[7,45,3,46],[15,19,2,20],[3,15,13,16]],[[1,107,5,108],[10,46,1,47],[1,22,15,23],[2,14,17,15]],[[5,120,1,121],[9,43,4,44],[17,22,1,23],[2,14,19,15]],[[3,113,4,114],[3,44,11,45],[17,21,4,22],[9,13,16,14]],[[3,107,5,108],[3,41,13,42],[15,24,5,25],[15,15,10,16]],[[4,116,4,117],[17,42,0,0],[17,22,6,23],[19,16,6,17]],[[2,111,7,112],[17,46,0,0],[7,24,16,25],[34,13,0,0]],[[4,121,5,122],[4,47,14,48],[11,24,14,25],[16,15,14,16]],[[6,117,4,118],[6,45,14,46],[11,24,16,25],[30,16,2,17]],[[8,106,4,107],[8,47,13,48],[7,24,22,25],[22,15,13,16]],[[10,114,2,115],[19,46,4,47],[28,22,6,23],[33,16,4,17]],[[8,122,4,123],[22,45,3,46],[8,23,26,24],[12,15,28,16]],[[3,117,10,118],[3,45,23,46],[4,24,31,25],[11,15,31,16]],[[7,116,7,117],[21,45,7,46],[1,23,37,24],[19,15,26,16]],[[5,115,10,116],[19,47,10,48],[15,24,25,25],[23,15,25,16]],[[13,115,3,116],[2,46,29,47],[42,24,1,25],[23,15,28,16]],[[17,115,0,0],[10,46,23,47],[10,24,35,25],[19,15,35,16]],[[17,115,1,116],[14,46,21,47],[29,24,19,25],[11,15,46,16]],[[13,115,6,116],[14,46,23,47],[44,24,7,25],[59,16,1,17]],[[12,121,7,122],[12,47,26,48],[39,24,14,25],[22,15,41,16]],[[6,121,14,122],[6,47,34,48],[46,24,10,25],[2,15,64,16]],[[17,122,4,123],[29,46,14,47],[49,24,10,25],[24,15,46,16]],[[4,122,18,123],[13,46,32,47],[48,24,14,25],[42,15,32,16]],[[20,117,4,118],[40,47,7,48],[43,24,22,25],[10,15,67,16]],[[19,118,6,119],[18,47,31,48],[34,24,34,25],[20,15,61,16]]],Lk=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],mk=[[30660,29427,32170,30877,26159,25368,27713,26998],[21522,20773,24188,23371,17913,16590,20375,19104],[13663,12392,16177,14854,9396,8579,11994,11245],[5769,5054,7399,6608,1890,597,3340,2107]],Sk=[31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017],wk=new Uint8Array(512),Ek=new Uint8Array(256);function bk(e,t){return 0===e||0===t?0:wk[Ek[e]+Ek[t]]}function kk(e,t){const i=function(e){const t=new Uint8Array(e+1);t[0]=1;for(let i=0;i<e;i++)for(let n=e;n>=1;n--)t[n]=t[n]^bk(t[n-1],wk[i]);return t}(t),n=new Uint8Array(t);for(let o=0;o<e.length;o++){const M=e[o]^n[0];for(let e=0;e<t-1;e++)n[e]=n[e+1]^bk(i[e+1],M);n[t-1]=bk(i[t],M)}return n}function vk(e){return Array.from({length:e},(()=>Array(e).fill(-1)))}function fk(e,t,i,n){t>=0&&t<e.length&&i>=0&&i<e.length&&(e[t][i]=n)}function Qk(e,t,i){for(let n=-1;n<=7;n++)for(let o=-1;o<=7;o++){let M=0;n>=0&&n<=6&&o>=0&&o<=6&&(0===n||6===n||0===o||6===o||n>=2&&n<=4&&o>=2&&o<=4)&&(M=1),fk(e,t+n,i+o,M)}}function Ck(e,t){if(t<2)return;const i=Lk[t-1];for(const t of i)for(const n of i)if(-1===e[t][n])for(let i=-2;i<=2;i++)for(let o=-2;o<=2;o++){fk(e,t+i,n+o,2===Math.abs(i)||2===Math.abs(o)||0===i&&0===o?1:0)}}function Uk(e){const t=e.length;for(let i=8;i<t-8;i++)-1===e[6][i]&&(e[6][i]=(i+1)%2),-1===e[i][6]&&(e[i][6]=(i+1)%2)}function Yk(e){const t=e.length;for(let t=0;t<=8;t++)-1===e[8][t]&&(e[8][t]=0),-1===e[t][8]&&(e[t][8]=0);for(let i=0;i<=7;i++)-1===e[8][t-1-i]&&(e[8][t-1-i]=0);for(let i=0;i<=7;i++)-1===e[t-1-i][8]&&(e[t-1-i][8]=0);e[t-8][8]=1}function Zk(e,t){if(t<7)return;const i=e.length;for(let t=0;t<6;t++)for(let n=0;n<3;n++)-1===e[t][i-11+n]&&(e[t][i-11+n]=0),-1===e[i-11+n][t]&&(e[i-11+n][t]=0)}!function(){let e=1;for(let t=0;t<255;t++)wk[t]=e,Ek[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)wk[e]=wk[e-255]}();const Vk=[(e,t)=>(e+t)%2==0,(e,t)=>e%2==0,(e,t)=>t%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0];function Pk(e,t,i,n){return-1!==t[i][n]}function Wk(e,t,i){const n=e.length,o=e.map((e=>[...e])),M=Vk[i];for(let e=0;e<n;e++)for(let i=0;i<n;i++)!Pk(0,t,e,i)&&M(e,i)&&(o[e][i]^=1);return o}function _k(e,t,i){const n=mk[Tk[t]][i],o=e.length;for(let t=0;t<=5;t++)e[8][t]=n>>>14-t&1;e[8][7]=n>>>8&1,e[8][8]=n>>>7&1,e[7][8]=n>>>6&1;for(let t=0;t<=5;t++)e[5-t][8]=n>>>t&1;for(let t=0;t<=7;t++)e[8][o-1-t]=n>>>t&1;for(let t=0;t<=6;t++)e[o-1-t][8]=n>>>14-t&1;e[o-8][8]=1}function Rk(e,t){if(t<7)return;const i=Sk[t-7],n=e.length;for(let t=0;t<6;t++)for(let o=0;o<3;o++){const M=i>>>3*t+o&1;e[t][n-11+o]=M,e[n-11+o][t]=M}}function Bk(e){const t=e.length;let i=0;for(let n=0;n<t;n++){let o=1;for(let M=1;M<t;M++)e[n][M]===e[n][M-1]?o++:(o>=5&&(i+=o-2),o=1);o>=5&&(i+=o-2)}for(let n=0;n<t;n++){let o=1;for(let M=1;M<t;M++)e[M][n]===e[M-1][n]?o++:(o>=5&&(i+=o-2),o=1);o>=5&&(i+=o-2)}for(let n=0;n<t-1;n++)for(let o=0;o<t-1;o++){const t=e[n][o];t===e[n][o+1]&&t===e[n+1][o]&&t===e[n+1][o+1]&&(i+=3)}const n=[1,0,1,1,1,0,1,0,0,0,0],o=[0,0,0,0,1,0,1,1,1,0,1];for(let M=0;M<t;M++)for(let r=0;r<=t-11;r++){let t=!0,s=!0;for(let i=0;i<11;i++)e[M][r+i]!==n[i]&&(t=!1),e[M][r+i]!==o[i]&&(s=!1);(t||s)&&(i+=40)}for(let M=0;M<t;M++)for(let r=0;r<=t-11;r++){let t=!0,s=!0;for(let i=0;i<11;i++)e[r+i][M]!==n[i]&&(t=!1),e[r+i][M]!==o[i]&&(s=!1);(t||s)&&(i+=40)}let M=0;for(let i=0;i<t;i++)for(let n=0;n<t;n++)1===e[i][n]&&M++;const r=M/(t*t)*100,s=5*Math.floor(r/5),a=s+5;return i+=10*Math.min(Math.abs(s-50)/5,Math.abs(a-50)/5),i}function Gk(e,t="H"){if(!e)return Array.from({length:21},(()=>Array(21).fill(0)));const i=function(e,t){const i=(new TextEncoder).encode(e).length,n=Tk[t];for(let e=1;e<=40;e++)if(4+(e<=9?8:16)+8*i<=8*Ak[e-1][n])return e;throw new Error("Data too long for any QR version")}(e,t),n=function(e){return 4*e+17}(i),o=vk(n);Qk(o,0,0),Qk(o,0,n-7),Qk(o,n-7,0),Ck(o,i),Uk(o),Yk(o),Zk(o,i);const M=vk(n);Qk(M,0,0),Qk(M,0,n-7),Qk(M,n-7,0),Ck(M,i),Uk(M),Yk(M),Zk(M,i);const r=function(e,t,i){const n=Ak[t-1][Tk[i]],o=(new TextEncoder).encode(e),M=[],r=(e,t)=>{for(let i=t-1;i>=0;i--)M.push(e>>>i&1)};r(4,4);const s=t<=9?8:16;r(o.length,s);for(const e of o)r(e,8);const a=8*n;for(r(0,Math.min(4,a-M.length));M.length%8!=0;)M.push(0);const l=[236,17];let g=0;for(;M.length<a;)r(l[g],8),g^=1;const N=new Uint8Array(n);for(let e=0;e<n;e++){let t=0;for(let i=0;i<8;i++)t=t<<1|M[8*e+i];N[e]=t}return N}(e,i,t),s=function(e,t,i){const n=Tk[i],[o,M,r,s]=xk[t-1][n],a=Ok[t-1],l=o+r,g=Math.floor((a-Ak[t-1][n])/l),N=[],c=[];let u=0;for(let t=0;t<o;t++){const t=e.slice(u,u+M);N.push(t),c.push(kk(t,g)),u+=M}for(let t=0;t<r;t++){const t=e.slice(u,u+s);N.push(t),c.push(kk(t,g)),u+=s}const D=[],d=Math.max(M,s);for(let e=0;e<d;e++)for(let t=0;t<l;t++)e<N[t].length&&D.push(N[t][e]);for(let e=0;e<g;e++)for(let t=0;t<l;t++)D.push(c[t][e]);return new Uint8Array(D)}(r,i,t);!function(e,t){const i=e.length;let n=0;const o=8*t.length;let M=!0;for(let r=i-1;r>=1;r-=2){6===r&&(r=5);for(let s=0;s<i;s++){const a=M?i-1-s:s;for(let i=0;i<=1;i++){const M=r-i;if(-1===e[a][M])if(n<o){const i=n>>>3,o=7-(7&n);e[a][M]=t[i]>>>o&1,n++}else e[a][M]=0}}M=!M}}(M,s);let a=0,l=1/0,g=M;for(let e=0;e<8;e++){const n=Wk(M,o,e);_k(n,t,e),Rk(n,i);const r=Bk(n);r<l&&(l=r,a=e,g=n)}return _k(g,t,a),Rk(g,i),g}let Fk=class extends Fe{constructor(){super(...arguments),this.value="",this.size=128,this.fill="black",this.background="white",this.radius=0,this.errorCorrection="H",this.label="",this.image="",this.imageSize=.25,this.imagePadding=4,this.imageRadius=4,this.fillGradient="",this._loadedImage=null,this._imageLoadPromise=null}static get styles(){return[pk]}updated(e){if(super.updated(e),e.has("image")&&(this._loadedImage=null,this._imageLoadPromise=null,this.image))return void this.loadImage(this.image);const t=["value","size","fill","background","radius","errorCorrection","imageSize","imagePadding","imageRadius","fillGradient"].some((t=>e.has(t)));t&&this.drawQrCode()}render(){const e=this.label||this.value||"QR Code";return _`
19918
+ `,Ak={L:0,M:1,Q:2,H:3},Ok=[[19,16,13,9],[34,28,22,16],[55,44,34,26],[80,64,48,36],[108,86,62,46],[136,108,76,60],[156,124,88,66],[194,154,110,86],[232,182,132,100],[274,216,154,122],[324,254,180,140],[370,290,206,158],[428,334,244,180],[461,365,261,197],[523,415,295,223],[589,453,325,253],[647,507,367,283],[721,563,397,313],[795,627,445,341],[861,669,485,385],[932,714,512,406],[1006,782,568,442],[1094,860,614,464],[1174,914,664,514],[1276,1e3,718,538],[1370,1062,754,596],[1468,1128,808,628],[1531,1193,871,661],[1631,1267,911,701],[1735,1373,985,745],[1843,1455,1033,793],[1955,1541,1115,845],[2071,1631,1171,901],[2191,1725,1231,961],[2306,1812,1286,986],[2434,1914,1354,1054],[2566,1992,1426,1096],[2702,2102,1502,1142],[2812,2216,1582,1222],[2956,2334,1666,1276]],xk=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],Lk=[[[1,19,0,0],[1,16,0,0],[1,13,0,0],[1,9,0,0]],[[1,34,0,0],[1,28,0,0],[1,22,0,0],[1,16,0,0]],[[1,55,0,0],[1,44,0,0],[2,17,0,0],[2,13,0,0]],[[1,80,0,0],[2,32,0,0],[2,24,0,0],[4,9,0,0]],[[1,108,0,0],[2,43,0,0],[2,15,2,16],[2,11,2,12]],[[2,68,0,0],[4,27,0,0],[4,19,0,0],[4,15,0,0]],[[2,78,0,0],[4,31,0,0],[2,14,4,15],[4,13,1,14]],[[2,97,0,0],[2,38,2,39],[4,18,2,19],[4,14,2,15]],[[2,116,0,0],[3,36,2,37],[4,16,4,17],[4,12,4,13]],[[2,68,2,69],[4,43,1,44],[6,19,2,20],[6,15,2,16]],[[4,81,0,0],[1,50,4,51],[4,22,4,23],[3,12,8,13]],[[2,92,2,93],[6,36,2,37],[4,20,6,21],[7,14,4,15]],[[4,107,0,0],[8,37,1,38],[8,20,4,21],[12,11,4,12]],[[3,115,1,116],[4,40,5,41],[11,16,5,17],[11,12,5,13]],[[5,87,1,88],[5,41,5,42],[5,24,7,25],[11,12,7,13]],[[5,98,1,99],[7,45,3,46],[15,19,2,20],[3,15,13,16]],[[1,107,5,108],[10,46,1,47],[1,22,15,23],[2,14,17,15]],[[5,120,1,121],[9,43,4,44],[17,22,1,23],[2,14,19,15]],[[3,113,4,114],[3,44,11,45],[17,21,4,22],[9,13,16,14]],[[3,107,5,108],[3,41,13,42],[15,24,5,25],[15,15,10,16]],[[4,116,4,117],[17,42,0,0],[17,22,6,23],[19,16,6,17]],[[2,111,7,112],[17,46,0,0],[7,24,16,25],[34,13,0,0]],[[4,121,5,122],[4,47,14,48],[11,24,14,25],[16,15,14,16]],[[6,117,4,118],[6,45,14,46],[11,24,16,25],[30,16,2,17]],[[8,106,4,107],[8,47,13,48],[7,24,22,25],[22,15,13,16]],[[10,114,2,115],[19,46,4,47],[28,22,6,23],[33,16,4,17]],[[8,122,4,123],[22,45,3,46],[8,23,26,24],[12,15,28,16]],[[3,117,10,118],[3,45,23,46],[4,24,31,25],[11,15,31,16]],[[7,116,7,117],[21,45,7,46],[1,23,37,24],[19,15,26,16]],[[5,115,10,116],[19,47,10,48],[15,24,25,25],[23,15,25,16]],[[13,115,3,116],[2,46,29,47],[42,24,1,25],[23,15,28,16]],[[17,115,0,0],[10,46,23,47],[10,24,35,25],[19,15,35,16]],[[17,115,1,116],[14,46,21,47],[29,24,19,25],[11,15,46,16]],[[13,115,6,116],[14,46,23,47],[44,24,7,25],[59,16,1,17]],[[12,121,7,122],[12,47,26,48],[39,24,14,25],[22,15,41,16]],[[6,121,14,122],[6,47,34,48],[46,24,10,25],[2,15,64,16]],[[17,122,4,123],[29,46,14,47],[49,24,10,25],[24,15,46,16]],[[4,122,18,123],[13,46,32,47],[48,24,14,25],[42,15,32,16]],[[20,117,4,118],[40,47,7,48],[43,24,22,25],[10,15,67,16]],[[19,118,6,119],[18,47,31,48],[34,24,34,25],[20,15,61,16]]],mk=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],Sk=[[30660,29427,32170,30877,26159,25368,27713,26998],[21522,20773,24188,23371,17913,16590,20375,19104],[13663,12392,16177,14854,9396,8579,11994,11245],[5769,5054,7399,6608,1890,597,3340,2107]],wk=[31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017],Ek=new Uint8Array(512),bk=new Uint8Array(256);function kk(e,t){return 0===e||0===t?0:Ek[bk[e]+bk[t]]}function vk(e,t){const i=function(e){const t=new Uint8Array(e+1);t[0]=1;for(let i=0;i<e;i++)for(let n=e;n>=1;n--)t[n]=t[n]^kk(t[n-1],Ek[i]);return t}(t),n=new Uint8Array(t);for(let o=0;o<e.length;o++){const M=e[o]^n[0];for(let e=0;e<t-1;e++)n[e]=n[e+1]^kk(i[e+1],M);n[t-1]=kk(i[t],M)}return n}function fk(e){return Array.from({length:e},(()=>Array(e).fill(-1)))}function Qk(e,t,i,n){t>=0&&t<e.length&&i>=0&&i<e.length&&(e[t][i]=n)}function Ck(e,t,i){for(let n=-1;n<=7;n++)for(let o=-1;o<=7;o++){let M=0;n>=0&&n<=6&&o>=0&&o<=6&&(0===n||6===n||0===o||6===o||n>=2&&n<=4&&o>=2&&o<=4)&&(M=1),Qk(e,t+n,i+o,M)}}function Uk(e,t){if(t<2)return;const i=mk[t-1];for(const t of i)for(const n of i)if(-1===e[t][n])for(let i=-2;i<=2;i++)for(let o=-2;o<=2;o++){Qk(e,t+i,n+o,2===Math.abs(i)||2===Math.abs(o)||0===i&&0===o?1:0)}}function Yk(e){const t=e.length;for(let i=8;i<t-8;i++)-1===e[6][i]&&(e[6][i]=(i+1)%2),-1===e[i][6]&&(e[i][6]=(i+1)%2)}function Zk(e){const t=e.length;for(let t=0;t<=8;t++)-1===e[8][t]&&(e[8][t]=0),-1===e[t][8]&&(e[t][8]=0);for(let i=0;i<=7;i++)-1===e[8][t-1-i]&&(e[8][t-1-i]=0);for(let i=0;i<=7;i++)-1===e[t-1-i][8]&&(e[t-1-i][8]=0);e[t-8][8]=1}function Vk(e,t){if(t<7)return;const i=e.length;for(let t=0;t<6;t++)for(let n=0;n<3;n++)-1===e[t][i-11+n]&&(e[t][i-11+n]=0),-1===e[i-11+n][t]&&(e[i-11+n][t]=0)}!function(){let e=1;for(let t=0;t<255;t++)Ek[t]=e,bk[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)Ek[e]=Ek[e-255]}();const Pk=[(e,t)=>(e+t)%2==0,(e,t)=>e%2==0,(e,t)=>t%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0];function Wk(e,t,i,n){return-1!==t[i][n]}function _k(e,t,i){const n=e.length,o=e.map((e=>[...e])),M=Pk[i];for(let e=0;e<n;e++)for(let i=0;i<n;i++)!Wk(0,t,e,i)&&M(e,i)&&(o[e][i]^=1);return o}function Rk(e,t,i){const n=Sk[Ak[t]][i],o=e.length;for(let t=0;t<=5;t++)e[8][t]=n>>>14-t&1;e[8][7]=n>>>8&1,e[8][8]=n>>>7&1,e[7][8]=n>>>6&1;for(let t=0;t<=5;t++)e[5-t][8]=n>>>t&1;for(let t=0;t<=7;t++)e[8][o-1-t]=n>>>t&1;for(let t=0;t<=6;t++)e[o-1-t][8]=n>>>14-t&1;e[o-8][8]=1}function Bk(e,t){if(t<7)return;const i=wk[t-7],n=e.length;for(let t=0;t<6;t++)for(let o=0;o<3;o++){const M=i>>>3*t+o&1;e[t][n-11+o]=M,e[n-11+o][t]=M}}function Gk(e){const t=e.length;let i=0;for(let n=0;n<t;n++){let o=1;for(let M=1;M<t;M++)e[n][M]===e[n][M-1]?o++:(o>=5&&(i+=o-2),o=1);o>=5&&(i+=o-2)}for(let n=0;n<t;n++){let o=1;for(let M=1;M<t;M++)e[M][n]===e[M-1][n]?o++:(o>=5&&(i+=o-2),o=1);o>=5&&(i+=o-2)}for(let n=0;n<t-1;n++)for(let o=0;o<t-1;o++){const t=e[n][o];t===e[n][o+1]&&t===e[n+1][o]&&t===e[n+1][o+1]&&(i+=3)}const n=[1,0,1,1,1,0,1,0,0,0,0],o=[0,0,0,0,1,0,1,1,1,0,1];for(let M=0;M<t;M++)for(let r=0;r<=t-11;r++){let t=!0,s=!0;for(let i=0;i<11;i++)e[M][r+i]!==n[i]&&(t=!1),e[M][r+i]!==o[i]&&(s=!1);(t||s)&&(i+=40)}for(let M=0;M<t;M++)for(let r=0;r<=t-11;r++){let t=!0,s=!0;for(let i=0;i<11;i++)e[r+i][M]!==n[i]&&(t=!1),e[r+i][M]!==o[i]&&(s=!1);(t||s)&&(i+=40)}let M=0;for(let i=0;i<t;i++)for(let n=0;n<t;n++)1===e[i][n]&&M++;const r=M/(t*t)*100,s=5*Math.floor(r/5),a=s+5;return i+=10*Math.min(Math.abs(s-50)/5,Math.abs(a-50)/5),i}function Fk(e,t="H"){if(!e)return Array.from({length:21},(()=>Array(21).fill(0)));const i=function(e,t){const i=(new TextEncoder).encode(e).length,n=Ak[t];for(let e=1;e<=40;e++)if(4+(e<=9?8:16)+8*i<=8*Ok[e-1][n])return e;throw new Error("Data too long for any QR version")}(e,t),n=function(e){return 4*e+17}(i),o=fk(n);Ck(o,0,0),Ck(o,0,n-7),Ck(o,n-7,0),Uk(o,i),Yk(o),Zk(o),Vk(o,i);const M=fk(n);Ck(M,0,0),Ck(M,0,n-7),Ck(M,n-7,0),Uk(M,i),Yk(M),Zk(M),Vk(M,i);const r=function(e,t,i){const n=Ok[t-1][Ak[i]],o=(new TextEncoder).encode(e),M=[],r=(e,t)=>{for(let i=t-1;i>=0;i--)M.push(e>>>i&1)};r(4,4);const s=t<=9?8:16;r(o.length,s);for(const e of o)r(e,8);const a=8*n;for(r(0,Math.min(4,a-M.length));M.length%8!=0;)M.push(0);const l=[236,17];let g=0;for(;M.length<a;)r(l[g],8),g^=1;const N=new Uint8Array(n);for(let e=0;e<n;e++){let t=0;for(let i=0;i<8;i++)t=t<<1|M[8*e+i];N[e]=t}return N}(e,i,t),s=function(e,t,i){const n=Ak[i],[o,M,r,s]=Lk[t-1][n],a=xk[t-1],l=o+r,g=Math.floor((a-Ok[t-1][n])/l),N=[],c=[];let u=0;for(let t=0;t<o;t++){const t=e.slice(u,u+M);N.push(t),c.push(vk(t,g)),u+=M}for(let t=0;t<r;t++){const t=e.slice(u,u+s);N.push(t),c.push(vk(t,g)),u+=s}const D=[],d=Math.max(M,s);for(let e=0;e<d;e++)for(let t=0;t<l;t++)e<N[t].length&&D.push(N[t][e]);for(let e=0;e<g;e++)for(let t=0;t<l;t++)D.push(c[t][e]);return new Uint8Array(D)}(r,i,t);!function(e,t){const i=e.length;let n=0;const o=8*t.length;let M=!0;for(let r=i-1;r>=1;r-=2){6===r&&(r=5);for(let s=0;s<i;s++){const a=M?i-1-s:s;for(let i=0;i<=1;i++){const M=r-i;if(-1===e[a][M])if(n<o){const i=n>>>3,o=7-(7&n);e[a][M]=t[i]>>>o&1,n++}else e[a][M]=0}}M=!M}}(M,s);let a=0,l=1/0,g=M;for(let e=0;e<8;e++){const n=_k(M,o,e);Rk(n,t,e),Bk(n,i);const r=Gk(n);r<l&&(l=r,a=e,g=n)}return Rk(g,t,a),Bk(g,i),g}let Hk=class extends Fe{constructor(){super(...arguments),this.value="",this.size=128,this.fill="black",this.background="white",this.radius=0,this.errorCorrection="H",this.label="",this.image="",this.imageSize=.25,this.imagePadding=4,this.imageRadius=4,this.fillGradient="",this._loadedImage=null,this._imageLoadPromise=null}static get styles(){return[Tk]}updated(e){if(super.updated(e),e.has("image")&&(this._loadedImage=null,this._imageLoadPromise=null,this.image))return void this.loadImage(this.image);const t=["value","size","fill","background","radius","errorCorrection","imageSize","imagePadding","imageRadius","fillGradient"].some((t=>e.has(t)));t&&this.drawQrCode()}render(){const e=this.label||this.value||"QR Code";return _`
19770
19919
  <canvas
19771
19920
  part="base"
19772
19921
  role="img"
@@ -19774,7 +19923,7 @@ a {
19774
19923
  width=${this.size}
19775
19924
  height=${this.size}
19776
19925
  ></canvas>
19777
- `}download(e="qr-code.png"){if(!this.canvas)return;const t=document.createElement("a");t.download=e,t.href=this.canvas.toDataURL("image/png"),t.click()}toDataURL(e="image/png"){return this.canvas?this.canvas.toDataURL(e):""}loadImage(e){const t=new Image;t.crossOrigin="anonymous",this._imageLoadPromise=new Promise((i=>{t.onload=()=>{this._loadedImage=t,this._imageLoadPromise=null,this.drawQrCode(),i()},t.onerror=()=>{this._loadedImage=null,this._imageLoadPromise=null,this.emit("nile-qr-image-error",{src:e}),this.drawQrCode(),i()}})),t.src=e}drawQrCode(){if(!this.canvas)return;const e=this.canvas.getContext("2d");if(!e)return;const{size:t,fill:i,background:n,radius:o,errorCorrection:M,value:r}=this,s=Math.max(0,Math.min(.5,o)),a=Gk(r,M),l=a.length,g=t/l;e.clearRect(0,0,t,t),n&&"transparent"!==n&&(e.fillStyle=n,e.fillRect(0,0,t,t));const N=Math.max(.1,Math.min(.4,this.imageSize)),c=this._loadedImage?t*N:0,u=c+(this._loadedImage?2*this.imagePadding:0),D=(t-u)/2,d=D+u,h=this.resolveModuleFill(e,t);e.fillStyle=h;for(let t=0;t<l;t++)for(let i=0;i<l;i++){if(1!==a[t][i])continue;const n=i*g,o=t*g;if(this._loadedImage){if(n>=D&&n+g<=d&&o>=D&&o+g<=d)continue}s>0?this.drawRoundedModule(e,n,o,g,g,s*g):e.fillRect(n,o,g,g)}this._loadedImage&&this.drawCenterImage(e,t,c)}resolveModuleFill(e,t){if(!this.fillGradient)return this.fill;const i=this.fillGradient.split(",").map((e=>e.trim()));if(i.length<3)return this.fill;const n=parseFloat(i[0]);if(Number.isNaN(n))return this.fill;const o=n*Math.PI/180,M=t/2,r=t/2,s=t/2,a=M-Math.cos(o)*s,l=r-Math.sin(o)*s,g=M+Math.cos(o)*s,N=r+Math.sin(o)*s,c=e.createLinearGradient(a,l,g,N),u=i.slice(1);for(let e=0;e<u.length;e++)c.addColorStop(e/(u.length-1),u[e]);return c}drawCenterImage(e,t,i){if(!this._loadedImage)return;const n=(t-i)/2,o=(t-i)/2,M=Math.min(this.imageRadius,i/2),r=this.imagePadding;if(r>0&&this.background&&"transparent"!==this.background){e.fillStyle=this.background;const t=n-r,s=o-r,a=i+2*r,l=i+2*r,g=M+.5*r;this.drawRoundedRect(e,t,s,a,l,g),e.fill()}e.save(),this.clipRoundedRect(e,n,o,i,i,M),e.drawImage(this._loadedImage,n,o,i,i),e.restore()}drawRoundedModule(e,t,i,n,o,M){e.beginPath(),e.moveTo(t+M,i),e.lineTo(t+n-M,i),e.arcTo(t+n,i,t+n,i+M,M),e.lineTo(t+n,i+o-M),e.arcTo(t+n,i+o,t+n-M,i+o,M),e.lineTo(t+M,i+o),e.arcTo(t,i+o,t,i+o-M,M),e.lineTo(t,i+M),e.arcTo(t,i,t+M,i,M),e.closePath(),e.fill()}drawRoundedRect(e,t,i,n,o,M){e.beginPath(),e.moveTo(t+M,i),e.lineTo(t+n-M,i),e.arcTo(t+n,i,t+n,i+M,M),e.lineTo(t+n,i+o-M),e.arcTo(t+n,i+o,t+n-M,i+o,M),e.lineTo(t+M,i+o),e.arcTo(t,i+o,t,i+o-M,M),e.lineTo(t,i+M),e.arcTo(t,i,t+M,i,M),e.closePath()}clipRoundedRect(e,t,i,n,o,M){e.beginPath(),e.moveTo(t+M,i),e.lineTo(t+n-M,i),e.arcTo(t+n,i,t+n,i+M,M),e.lineTo(t+n,i+o-M),e.arcTo(t+n,i+o,t+n-M,i+o,M),e.lineTo(t+M,i+o),e.arcTo(t,i+o,t,i+o-M,M),e.lineTo(t,i+M),e.arcTo(t,i,t+M,i,M),e.closePath(),e.clip()}};e([ue({type:String,reflect:!0})],Fk.prototype,"value",void 0),e([ue({type:Number,reflect:!0})],Fk.prototype,"size",void 0),e([ue({type:String,reflect:!0})],Fk.prototype,"fill",void 0),e([ue({type:String,reflect:!0})],Fk.prototype,"background",void 0),e([ue({type:Number,reflect:!0})],Fk.prototype,"radius",void 0),e([ue({attribute:"error-correction",reflect:!0})],Fk.prototype,"errorCorrection",void 0),e([ue({type:String,reflect:!0})],Fk.prototype,"label",void 0),e([ue({type:String,reflect:!0})],Fk.prototype,"image",void 0),e([ue({attribute:"image-size",type:Number,reflect:!0})],Fk.prototype,"imageSize",void 0),e([ue({attribute:"image-padding",type:Number,reflect:!0})],Fk.prototype,"imagePadding",void 0),e([ue({attribute:"image-radius",type:Number,reflect:!0})],Fk.prototype,"imageRadius",void 0),e([ue({attribute:"fill-gradient",type:String,reflect:!0})],Fk.prototype,"fillGradient",void 0),e([he("canvas")],Fk.prototype,"canvas",void 0),Fk=e([ge("nile-qr-code")],Fk);const Hk=r`
19926
+ `}download(e="qr-code.png"){if(!this.canvas)return;const t=document.createElement("a");t.download=e,t.href=this.canvas.toDataURL("image/png"),t.click()}toDataURL(e="image/png"){return this.canvas?this.canvas.toDataURL(e):""}loadImage(e){const t=new Image;t.crossOrigin="anonymous",this._imageLoadPromise=new Promise((i=>{t.onload=()=>{this._loadedImage=t,this._imageLoadPromise=null,this.drawQrCode(),i()},t.onerror=()=>{this._loadedImage=null,this._imageLoadPromise=null,this.emit("nile-qr-image-error",{src:e}),this.drawQrCode(),i()}})),t.src=e}drawQrCode(){if(!this.canvas)return;const e=this.canvas.getContext("2d");if(!e)return;const{size:t,fill:i,background:n,radius:o,errorCorrection:M,value:r}=this,s=Math.max(0,Math.min(.5,o)),a=Fk(r,M),l=a.length,g=t/l;e.clearRect(0,0,t,t),n&&"transparent"!==n&&(e.fillStyle=n,e.fillRect(0,0,t,t));const N=Math.max(.1,Math.min(.4,this.imageSize)),c=this._loadedImage?t*N:0,u=c+(this._loadedImage?2*this.imagePadding:0),D=(t-u)/2,d=D+u,h=this.resolveModuleFill(e,t);e.fillStyle=h;for(let t=0;t<l;t++)for(let i=0;i<l;i++){if(1!==a[t][i])continue;const n=i*g,o=t*g;if(this._loadedImage){if(n>=D&&n+g<=d&&o>=D&&o+g<=d)continue}s>0?this.drawRoundedModule(e,n,o,g,g,s*g):e.fillRect(n,o,g,g)}this._loadedImage&&this.drawCenterImage(e,t,c)}resolveModuleFill(e,t){if(!this.fillGradient)return this.fill;const i=this.fillGradient.split(",").map((e=>e.trim()));if(i.length<3)return this.fill;const n=parseFloat(i[0]);if(Number.isNaN(n))return this.fill;const o=n*Math.PI/180,M=t/2,r=t/2,s=t/2,a=M-Math.cos(o)*s,l=r-Math.sin(o)*s,g=M+Math.cos(o)*s,N=r+Math.sin(o)*s,c=e.createLinearGradient(a,l,g,N),u=i.slice(1);for(let e=0;e<u.length;e++)c.addColorStop(e/(u.length-1),u[e]);return c}drawCenterImage(e,t,i){if(!this._loadedImage)return;const n=(t-i)/2,o=(t-i)/2,M=Math.min(this.imageRadius,i/2),r=this.imagePadding;if(r>0&&this.background&&"transparent"!==this.background){e.fillStyle=this.background;const t=n-r,s=o-r,a=i+2*r,l=i+2*r,g=M+.5*r;this.drawRoundedRect(e,t,s,a,l,g),e.fill()}e.save(),this.clipRoundedRect(e,n,o,i,i,M),e.drawImage(this._loadedImage,n,o,i,i),e.restore()}drawRoundedModule(e,t,i,n,o,M){e.beginPath(),e.moveTo(t+M,i),e.lineTo(t+n-M,i),e.arcTo(t+n,i,t+n,i+M,M),e.lineTo(t+n,i+o-M),e.arcTo(t+n,i+o,t+n-M,i+o,M),e.lineTo(t+M,i+o),e.arcTo(t,i+o,t,i+o-M,M),e.lineTo(t,i+M),e.arcTo(t,i,t+M,i,M),e.closePath(),e.fill()}drawRoundedRect(e,t,i,n,o,M){e.beginPath(),e.moveTo(t+M,i),e.lineTo(t+n-M,i),e.arcTo(t+n,i,t+n,i+M,M),e.lineTo(t+n,i+o-M),e.arcTo(t+n,i+o,t+n-M,i+o,M),e.lineTo(t+M,i+o),e.arcTo(t,i+o,t,i+o-M,M),e.lineTo(t,i+M),e.arcTo(t,i,t+M,i,M),e.closePath()}clipRoundedRect(e,t,i,n,o,M){e.beginPath(),e.moveTo(t+M,i),e.lineTo(t+n-M,i),e.arcTo(t+n,i,t+n,i+M,M),e.lineTo(t+n,i+o-M),e.arcTo(t+n,i+o,t+n-M,i+o,M),e.lineTo(t+M,i+o),e.arcTo(t,i+o,t,i+o-M,M),e.lineTo(t,i+M),e.arcTo(t,i,t+M,i,M),e.closePath(),e.clip()}};e([ue({type:String,reflect:!0})],Hk.prototype,"value",void 0),e([ue({type:Number,reflect:!0})],Hk.prototype,"size",void 0),e([ue({type:String,reflect:!0})],Hk.prototype,"fill",void 0),e([ue({type:String,reflect:!0})],Hk.prototype,"background",void 0),e([ue({type:Number,reflect:!0})],Hk.prototype,"radius",void 0),e([ue({attribute:"error-correction",reflect:!0})],Hk.prototype,"errorCorrection",void 0),e([ue({type:String,reflect:!0})],Hk.prototype,"label",void 0),e([ue({type:String,reflect:!0})],Hk.prototype,"image",void 0),e([ue({attribute:"image-size",type:Number,reflect:!0})],Hk.prototype,"imageSize",void 0),e([ue({attribute:"image-padding",type:Number,reflect:!0})],Hk.prototype,"imagePadding",void 0),e([ue({attribute:"image-radius",type:Number,reflect:!0})],Hk.prototype,"imageRadius",void 0),e([ue({attribute:"fill-gradient",type:String,reflect:!0})],Hk.prototype,"fillGradient",void 0),e([he("canvas")],Hk.prototype,"canvas",void 0),Hk=e([ge("nile-qr-code")],Hk);const $k=r`
19778
19927
 
19779
19928
  [hidden] {
19780
19929
  display: none;
@@ -19963,7 +20112,7 @@ a {
19963
20112
  }
19964
20113
 
19965
20114
 
19966
- `;let $k=0,Jk=class extends Fe{constructor(){super(...arguments),this.attrId=++$k,this.componentId=`nile-nav-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1,this.centered=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab"),this.syncA11yState()}firstUpdated(){this.syncA11yState(),this.updateAccessibleName()}updated(){this.syncA11yState(),this.updateAccessibleName()}syncA11yState(){this.id=this.id||this.componentId,this.tabIndex=this.disabled?-1:this.active?0:-1,this.setAttribute("aria-selected",this.active?"true":"false"),this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled?this.setAttribute("aria-hidden","true"):this.removeAttribute("aria-hidden")}updateAccessibleName(){if(this.hasAttribute("aria-label")&&"true"!==this.getAttribute("data-auto-aria-label"))return;const e=(this.textContent||"").replace(/\s+/g," ").trim();e?(this.setAttribute("aria-label",e),this.setAttribute("data-auto-aria-label","true")):(this.removeAttribute("aria-label"),this.removeAttribute("data-auto-aria-label"))}handleCloseClick(e){e.preventDefault(),e.stopPropagation(),this.emit("nile-close")}handleTabClick(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();Object.values(ut).some((t=>e[t]))||0!==e.button||e.preventDefault()}handleActiveChange(){this.syncA11yState()}handleDisabledChange(){this.syncA11yState()}focus(e){super.focus(e)}blur(){super.blur()}render(){return this.id=this.id||this.componentId,_`
20115
+ `;let Jk=0,Xk=class extends Fe{constructor(){super(...arguments),this.attrId=++Jk,this.componentId=`nile-nav-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1,this.centered=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab"),this.syncA11yState()}firstUpdated(){this.syncA11yState(),this.updateAccessibleName()}updated(){this.syncA11yState(),this.updateAccessibleName()}syncA11yState(){this.id=this.id||this.componentId,this.tabIndex=this.disabled?-1:this.active?0:-1,this.setAttribute("aria-selected",this.active?"true":"false"),this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled?this.setAttribute("aria-hidden","true"):this.removeAttribute("aria-hidden")}updateAccessibleName(){if(this.hasAttribute("aria-label")&&"true"!==this.getAttribute("data-auto-aria-label"))return;const e=(this.textContent||"").replace(/\s+/g," ").trim();e?(this.setAttribute("aria-label",e),this.setAttribute("data-auto-aria-label","true")):(this.removeAttribute("aria-label"),this.removeAttribute("data-auto-aria-label"))}handleCloseClick(e){e.preventDefault(),e.stopPropagation(),this.emit("nile-close")}handleTabClick(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();Object.values(ut).some((t=>e[t]))||0!==e.button||e.preventDefault()}handleActiveChange(){this.syncA11yState()}handleDisabledChange(){this.syncA11yState()}focus(e){super.focus(e)}blur(){super.blur()}render(){return this.id=this.id||this.componentId,_`
19967
20116
  <li part="base tab" class="nav-tab-container" role="presentation">
19968
20117
  <nile-link
19969
20118
  class=${xe({"nav-tab":!0,"tab--centered":this.centered,"nav-tab--active":this.active,"nav-tab--closable":this.closable,"nav-tab--disabled":this.disabled})}
@@ -19998,13 +20147,13 @@ a {
19998
20147
  `:B}
19999
20148
  </nile-link>
20000
20149
  </li>
20001
- `}};Jk.styles=Hk,e([he(".nav-tab")],Jk.prototype,"navTab",void 0),e([ue({reflect:!0})],Jk.prototype,"panel",void 0),e([ue({type:Boolean,reflect:!0})],Jk.prototype,"active",void 0),e([ue({type:Boolean})],Jk.prototype,"closable",void 0),e([ue({type:Boolean,reflect:!0})],Jk.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0})],Jk.prototype,"centered",void 0),e([ue({type:String,reflect:!0})],Jk.prototype,"link",void 0),e([We("active")],Jk.prototype,"handleActiveChange",null),e([We("disabled")],Jk.prototype,"handleDisabledChange",null),Jk=e([ge("nile-nav-tab")],Jk);
20150
+ `}};Xk.styles=$k,e([he(".nav-tab")],Xk.prototype,"navTab",void 0),e([ue({reflect:!0})],Xk.prototype,"panel",void 0),e([ue({type:Boolean,reflect:!0})],Xk.prototype,"active",void 0),e([ue({type:Boolean})],Xk.prototype,"closable",void 0),e([ue({type:Boolean,reflect:!0})],Xk.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0})],Xk.prototype,"centered",void 0),e([ue({type:String,reflect:!0})],Xk.prototype,"link",void 0),e([We("active")],Xk.prototype,"handleActiveChange",null),e([We("disabled")],Xk.prototype,"handleDisabledChange",null),Xk=e([ge("nile-nav-tab")],Xk);
20002
20151
  /**
20003
20152
  * @license
20004
20153
  * Copyright 2018 Google LLC
20005
20154
  * SPDX-License-Identifier: BSD-3-Clause
20006
20155
  */
20007
- const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e),e.type!==ze||"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 n=e[i];return null==n?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}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 n=t[e];if(null!=n){this.ft.add(e);const t="string"==typeof n&&n.endsWith(qk);e.includes("-")||t?i.setProperty(e,t?n.slice(0,-11):n,t?Xk:""):i[e]=n}}return R}}),ev=r`
20156
+ const qk="important",Kk=" !"+qk,ev=Ae(class extends Oe{constructor(e){if(super(e),e.type!==ze||"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 n=e[i];return null==n?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}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 n=t[e];if(null!=n){this.ft.add(e);const t="string"==typeof n&&n.endsWith(Kk);e.includes("-")||t?i.setProperty(e,t?n.slice(0,-11):n,t?qk:""):i[e]=n}}return R}}),tv=r`
20008
20157
 
20009
20158
  [hidden] {
20010
20159
  display: none;
@@ -20671,11 +20820,11 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
20671
20820
  :host([placement='bottom']:not([variant])) {
20672
20821
  --nile-nav-tab-padding: var(--nile-spacing-lg, var(--ng-spacing-3)) var(--nile-spacing-none, var(--ng-spacing-none)) var(--nile-spacing-none, var(--ng-spacing-none)) var(--nile-spacing-none, var(--ng-spacing-none));
20673
20822
  }
20674
- `;let tv=class extends Fe{constructor(){super(...arguments),this.pillRepositionTimer=null,this.pillTransitionClassTimer=null,this.pillReady=!1,this.observedTabs=new Set,this.tabs=[],this.panels=[],this.handleCloseEvent=e=>{if(e.target===this)return;const t=e.target,i=t?.getAttribute("panel");i&&(e.stopImmediatePropagation(),e.stopPropagation(),this.syncIndicator(),this.emit("nile-close",{panel:i}))},this.tabGroupWasIntersecting=!1,this.lastNavClientWidth=0,this.hasScrollControls=!1,this.placement="top",this.activeTabProp="",this.noTrack=!1,this.noScrollControls=!1,this.centered=!1,this.variant="underline",this.indicatorPlacement="",this.fullWidth=!1,this.width="",this.showIndicatorOnHover=!1,this.activeTabName=""}get showScrollControlButtons(){return!this.noScrollControls&&this.hasScrollControls}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.setScrollControls();const e=this.nav?.clientWidth??0,t=0===this.lastNavClientWidth&&e>0;this.lastNavClientWidth=e,this.repositionIndicator({skipTransition:t}),this.debouncedPositionPill()})),this.mutationObserver=new MutationObserver((e=>{if(e.some((e=>!["aria-labelledby","aria-controls"].includes(e.attributeName)))&&setTimeout((()=>this.setAriaLabels())),e.some((e=>"disabled"===e.attributeName))&&this.syncTabsAndPanels(),e.some((e=>"active"===e.attributeName))){const e=this.getAllTabs({includeDisabled:!1}).find((e=>e.active));e&&e.panel!==this.activeTabName&&(this.activeTabName=e.panel)}e.some((e=>"childList"===e.type||"characterData"===e.type))&&(this.repositionIndicator(),this.debouncedPositionPill(),requestAnimationFrame((()=>this.setScrollControls())))})),this.updateComplete.then((async()=>{if(this.setScrollControls(),await Promise.all(this.getAllTabs({includeDisabled:!0}).map((e=>e.updateComplete))),await Promise.all(this.getAllPanels().map((e=>e.updateComplete))),this.syncTabsAndPanels(),this.activeTabProp)this.activeTabName=this.activeTabProp;else{const e=this.getActiveTab();this.activeTabName=e?e.panel:""}requestAnimationFrame((()=>{this.indicator&&(this.indicator.style.transition="none"),this.syncIndicator(),this.positionPill(),requestAnimationFrame((()=>{this.indicator&&(this.indicator.style.transition="")}))})),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),this.resizeObserver.observe(this.nav),this.visibilityObserver=new IntersectionObserver((e=>{const t=e[0];if(t.isIntersecting&&t.intersectionRatio>0){this.setAriaLabels(),this.debouncedPositionPill();const e=!this.tabGroupWasIntersecting;this.tabGroupWasIntersecting=!0,this.repositionIndicator({skipTransition:e})}else this.tabGroupWasIntersecting=!1})),this.visibilityObserver.observe(this.tabGroup)})),this.addEventListener("nile-close",this.handleCloseEvent),this.addEventListener("click",this.handleNavClick),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){this.mutationObserver.disconnect(),this.resizeObserver.disconnect(),this.observedTabs.clear(),this.visibilityObserver?.disconnect(),this.removeEventListener("nile-close",this.handleCloseEvent),this.removeEventListener("click",this.handleNavClick),this.removeEventListener("keydown",this.handleKeyDown)}updated(e){let t=e.has("activeTabName");if(e.has("activeTabProp")&&this.activeTabName!==this.activeTabProp&&(this.activeTabName=this.activeTabProp,t=!0),t){const e=this.getActiveTab();e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}e.has("noScrollControls")&&requestAnimationFrame((()=>this.setScrollControls()))}syncIndicator(){if(requestAnimationFrame((()=>this.setScrollControls())),!this.indicator)return;const e=this.getActiveTab();e&&!e.disabled?(this.indicator.style.display="block",this.repositionIndicator()):this.indicator.style.display="none"}handleNavClick(e){const t=e.composedPath().find((e=>e instanceof HTMLElement&&"nile-nav-tab"===e.tagName.toLowerCase()));if(!t)return;if(!this.getAllTabs({includeDisabled:!0}).includes(t))return;if(t.hasAttribute("disabled")||t.disabled)return;Object.values(ut).some((t=>e[t]))||0!==e.button||(this.activeTabProp=t.panel,this.activeTabName=t.panel,t.focus())}positionPill(e=!1){const t=this.shadowRoot?.querySelector(".nav-tab-group__pill");if(!t)return;this.pillTransitionClassTimer&&(clearTimeout(this.pillTransitionClassTimer),this.pillTransitionClassTimer=null);const i=this.getActiveTab();if(!i||i.disabled)return t.classList.add("nav-tab-group__pill--inactive"),void t.classList.remove("nav-tab-group__pill--transitioning");t.classList.remove("nav-tab-group__pill--inactive");const n=i.shadowRoot?.querySelector(".nav-tab-container");if(!n)return;const o=this.shadowRoot?.querySelector(".nav-tab-group__tabs");if(!o)return;if(0===n.offsetWidth||0===n.offsetHeight)return;const M=this.getLayoutBoxRelativeToContainer(n,o);if(!M)return;const r=M.x,s=M.y,a=M.width,l=M.height,g=o.clientWidth,N=Math.max(0,g-r-a);if(e){const e="cubic-bezier(0.4, 0, 0.2, 1)";t.style.transition=`left 400ms ${e}, right 400ms ${e}, top 400ms ${e}, height 400ms ${e}`,"toggle"===this.variant&&t.classList.add("nav-tab-group__pill--transitioning")}else t.style.transition="","toggle"===this.variant&&t.classList.remove("nav-tab-group__pill--transitioning");if(t.style.transform="",t.style.left=`${r}px`,t.style.right=`${N}px`,t.style.width="auto",t.style.top=`${s}px`,t.style.height=`${l}px`,t.style.opacity="1",this.pillReady||(this.pillReady=!0),e){const e=()=>{t.style.transition="",t.removeEventListener("transitionend",e)};t.addEventListener("transitionend",e),"toggle"===this.variant&&(this.pillTransitionClassTimer=setTimeout((()=>{this.pillTransitionClassTimer=null,t.classList.remove("nav-tab-group__pill--transitioning")}),420))}}debouncedPositionPill(){this.pillRepositionTimer&&clearTimeout(this.pillRepositionTimer),this.pillRepositionTimer=setTimeout((()=>{this.pillRepositionTimer=null,this.positionPill()}),150)}handleTabHover(e){if(!this.showIndicatorOnHover)return;const t=e.composedPath().find((e=>e instanceof HTMLElement&&"nile-nav-tab"===e.tagName.toLowerCase()));if(!t||t.disabled||t.hasAttribute("disabled"))return;this.getAllTabs({includeDisabled:!0}).includes(t)&&this.positionHoverIndicator(t)}handleTabHoverLeave(){this.showIndicatorOnHover&&this.hoverIndicator&&(this.hoverIndicator.style.opacity="0")}positionHoverIndicator(e){if(!this.hoverIndicator)return;const t=this.shadowRoot?.querySelector(".nav-tab-group__tabs");if(!t)return;const i=e.shadowRoot?.querySelector(".nav-tab-container");if(!i)return;const n=this.getLayoutBoxRelativeToContainer(i,t);if(n){switch(this.hoverIndicator.style.transition="none",this.placement){case"top":case"bottom":this.hoverIndicator.style.width=`${i.offsetWidth}px`,this.hoverIndicator.style.height="auto",this.hoverIndicator.style.translate=`${n.x}px 0px`;break;case"start":case"end":this.hoverIndicator.style.height=`${i.offsetHeight}px`,this.hoverIndicator.style.width="auto",this.hoverIndicator.style.translate=`0px ${n.y}px`}this.hoverIndicator.style.opacity="1"}}render(){const e="filled"===this.variant||"neutral-filled"===this.variant||"toggle"===this.variant||"toggle-button"===this.variant,t="filled"!==this.variant&&"neutral-filled"!==this.variant&&"toggle-button"!==this.variant&&"toggle"!==this.variant,i="toggle"===this.variant;return _`
20823
+ `;let iv=class extends Fe{constructor(){super(...arguments),this.pillRepositionTimer=null,this.pillTransitionClassTimer=null,this.pillReady=!1,this.observedTabs=new Set,this.tabs=[],this.panels=[],this.handleCloseEvent=e=>{if(e.target===this)return;const t=e.target,i=t?.getAttribute("panel");i&&(e.stopImmediatePropagation(),e.stopPropagation(),this.syncIndicator(),this.emit("nile-close",{panel:i}))},this.tabGroupWasIntersecting=!1,this.lastNavClientWidth=0,this.hasScrollControls=!1,this.placement="top",this.activeTabProp="",this.noTrack=!1,this.noScrollControls=!1,this.centered=!1,this.variant="underline",this.indicatorPlacement="",this.fullWidth=!1,this.width="",this.showIndicatorOnHover=!1,this.activeTabName=""}get showScrollControlButtons(){return!this.noScrollControls&&this.hasScrollControls}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.setScrollControls();const e=this.nav?.clientWidth??0,t=0===this.lastNavClientWidth&&e>0;this.lastNavClientWidth=e,this.repositionIndicator({skipTransition:t}),this.debouncedPositionPill()})),this.mutationObserver=new MutationObserver((e=>{if(e.some((e=>!["aria-labelledby","aria-controls"].includes(e.attributeName)))&&setTimeout((()=>this.setAriaLabels())),e.some((e=>"disabled"===e.attributeName))&&this.syncTabsAndPanels(),e.some((e=>"active"===e.attributeName))){const e=this.getAllTabs({includeDisabled:!1}).find((e=>e.active));e&&e.panel!==this.activeTabName&&(this.activeTabName=e.panel)}e.some((e=>"childList"===e.type||"characterData"===e.type))&&(this.repositionIndicator(),this.debouncedPositionPill(),requestAnimationFrame((()=>this.setScrollControls())))})),this.updateComplete.then((async()=>{if(this.setScrollControls(),await Promise.all(this.getAllTabs({includeDisabled:!0}).map((e=>e.updateComplete))),await Promise.all(this.getAllPanels().map((e=>e.updateComplete))),this.syncTabsAndPanels(),this.activeTabProp)this.activeTabName=this.activeTabProp;else{const e=this.getActiveTab();this.activeTabName=e?e.panel:""}requestAnimationFrame((()=>{this.indicator&&(this.indicator.style.transition="none"),this.syncIndicator(),this.positionPill(),requestAnimationFrame((()=>{this.indicator&&(this.indicator.style.transition="")}))})),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),this.resizeObserver.observe(this.nav),this.visibilityObserver=new IntersectionObserver((e=>{const t=e[0];if(t.isIntersecting&&t.intersectionRatio>0){this.setAriaLabels(),this.debouncedPositionPill();const e=!this.tabGroupWasIntersecting;this.tabGroupWasIntersecting=!0,this.repositionIndicator({skipTransition:e})}else this.tabGroupWasIntersecting=!1})),this.visibilityObserver.observe(this.tabGroup)})),this.addEventListener("nile-close",this.handleCloseEvent),this.addEventListener("click",this.handleNavClick),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){this.mutationObserver.disconnect(),this.resizeObserver.disconnect(),this.observedTabs.clear(),this.visibilityObserver?.disconnect(),this.removeEventListener("nile-close",this.handleCloseEvent),this.removeEventListener("click",this.handleNavClick),this.removeEventListener("keydown",this.handleKeyDown)}updated(e){let t=e.has("activeTabName");if(e.has("activeTabProp")&&this.activeTabName!==this.activeTabProp&&(this.activeTabName=this.activeTabProp,t=!0),t){const e=this.getActiveTab();e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}e.has("noScrollControls")&&requestAnimationFrame((()=>this.setScrollControls()))}syncIndicator(){if(requestAnimationFrame((()=>this.setScrollControls())),!this.indicator)return;const e=this.getActiveTab();e&&!e.disabled?(this.indicator.style.display="block",this.repositionIndicator()):this.indicator.style.display="none"}handleNavClick(e){const t=e.composedPath().find((e=>e instanceof HTMLElement&&"nile-nav-tab"===e.tagName.toLowerCase()));if(!t)return;if(!this.getAllTabs({includeDisabled:!0}).includes(t))return;if(t.hasAttribute("disabled")||t.disabled)return;Object.values(ut).some((t=>e[t]))||0!==e.button||(this.activeTabProp=t.panel,this.activeTabName=t.panel,t.focus())}positionPill(e=!1){const t=this.shadowRoot?.querySelector(".nav-tab-group__pill");if(!t)return;this.pillTransitionClassTimer&&(clearTimeout(this.pillTransitionClassTimer),this.pillTransitionClassTimer=null);const i=this.getActiveTab();if(!i||i.disabled)return t.classList.add("nav-tab-group__pill--inactive"),void t.classList.remove("nav-tab-group__pill--transitioning");t.classList.remove("nav-tab-group__pill--inactive");const n=i.shadowRoot?.querySelector(".nav-tab-container");if(!n)return;const o=this.shadowRoot?.querySelector(".nav-tab-group__tabs");if(!o)return;if(0===n.offsetWidth||0===n.offsetHeight)return;const M=this.getLayoutBoxRelativeToContainer(n,o);if(!M)return;const r=M.x,s=M.y,a=M.width,l=M.height,g=o.clientWidth,N=Math.max(0,g-r-a);if(e){const e="cubic-bezier(0.4, 0, 0.2, 1)";t.style.transition=`left 400ms ${e}, right 400ms ${e}, top 400ms ${e}, height 400ms ${e}`,"toggle"===this.variant&&t.classList.add("nav-tab-group__pill--transitioning")}else t.style.transition="","toggle"===this.variant&&t.classList.remove("nav-tab-group__pill--transitioning");if(t.style.transform="",t.style.left=`${r}px`,t.style.right=`${N}px`,t.style.width="auto",t.style.top=`${s}px`,t.style.height=`${l}px`,t.style.opacity="1",this.pillReady||(this.pillReady=!0),e){const e=()=>{t.style.transition="",t.removeEventListener("transitionend",e)};t.addEventListener("transitionend",e),"toggle"===this.variant&&(this.pillTransitionClassTimer=setTimeout((()=>{this.pillTransitionClassTimer=null,t.classList.remove("nav-tab-group__pill--transitioning")}),420))}}debouncedPositionPill(){this.pillRepositionTimer&&clearTimeout(this.pillRepositionTimer),this.pillRepositionTimer=setTimeout((()=>{this.pillRepositionTimer=null,this.positionPill()}),150)}handleTabHover(e){if(!this.showIndicatorOnHover)return;const t=e.composedPath().find((e=>e instanceof HTMLElement&&"nile-nav-tab"===e.tagName.toLowerCase()));if(!t||t.disabled||t.hasAttribute("disabled"))return;this.getAllTabs({includeDisabled:!0}).includes(t)&&this.positionHoverIndicator(t)}handleTabHoverLeave(){this.showIndicatorOnHover&&this.hoverIndicator&&(this.hoverIndicator.style.opacity="0")}positionHoverIndicator(e){if(!this.hoverIndicator)return;const t=this.shadowRoot?.querySelector(".nav-tab-group__tabs");if(!t)return;const i=e.shadowRoot?.querySelector(".nav-tab-container");if(!i)return;const n=this.getLayoutBoxRelativeToContainer(i,t);if(n){switch(this.hoverIndicator.style.transition="none",this.placement){case"top":case"bottom":this.hoverIndicator.style.width=`${i.offsetWidth}px`,this.hoverIndicator.style.height="auto",this.hoverIndicator.style.translate=`${n.x}px 0px`;break;case"start":case"end":this.hoverIndicator.style.height=`${i.offsetHeight}px`,this.hoverIndicator.style.width="auto",this.hoverIndicator.style.translate=`0px ${n.y}px`}this.hoverIndicator.style.opacity="1"}}render(){const e="filled"===this.variant||"neutral-filled"===this.variant||"toggle"===this.variant||"toggle-button"===this.variant,t="filled"!==this.variant&&"neutral-filled"!==this.variant&&"toggle-button"!==this.variant&&"toggle"!==this.variant,i="toggle"===this.variant;return _`
20675
20824
  <div
20676
20825
  part="base"
20677
20826
  class=${xe({"nav-tab-group":!0,"nav-tab-group--top":"top"===this.placement,"nav-tab-group--bottom":"bottom"===this.placement,"nav-tab-group--start":"start"===this.placement,"nav-tab-group--end":"end"===this.placement,"nav-tab-group--rtl":!0,"nav-tab-group--has-scroll-controls":this.showScrollControlButtons,hide__track:this.noTrack})}
20678
- style=${Kk(this.width?{"--nav-tab-item-width":this.width}:{})}
20827
+ style=${ev(this.width?{"--nav-tab-item-width":this.width}:{})}
20679
20828
  >
20680
20829
  <nav class="nav-tab-group__nav-container" part="nav">
20681
20830
  ${i?_`<div class="nav-tab-group__toggle-frame" part="toggle-frame"></div>`:B}
@@ -20731,7 +20880,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
20731
20880
 
20732
20881
  <slot part="body" class="nav-tab-group__body" @slotchange=${this.syncTabsAndPanels}></slot>
20733
20882
  </div>
20734
- `}getAllTabs(e={includeDisabled:!0}){const t=this.shadowRoot.querySelector('slot[name="nav"]').assignedElements().filter((e=>"nile-nav-tab"===e.tagName.toLowerCase()));return e.includeDisabled?t:t.filter((e=>!e.disabled))}getAllPanels(){return[...this.body.assignedElements()].filter((e=>"nile-nav-tab-panel"===e.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((e=>this.activeTabName?e.panel===this.activeTabName:e.active))??this.tabs.find((e=>!e.disabled))??this.tabs[0]}setScrollControls(){this.nav&&(this.noScrollControls?this.hasScrollControls=!1:this.hasScrollControls=["top","bottom"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth)}handleKeyDown(e){const t=e.composedPath().find((e=>e instanceof HTMLElement&&"nile-nav-tab"===e.tagName.toLowerCase()));if(t?.disabled)return void e.preventDefault();if(!t||!this.tabs.includes(t))return;if("Enter"===e.key||" "===e.key)return e.preventDefault(),this.activeTabProp=t.panel,void(this.activeTabName=t.panel);if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key))return;let i=this.tabs.indexOf(t);const n=["top","bottom"].includes(this.placement),o="rtl"===getComputedStyle(this).direction;"Home"===e.key?i=0:"End"===e.key?i=this.tabs.length-1:n&&(o&&"ArrowRight"===e.key||!o&&"ArrowLeft"===e.key)||["start","end"].includes(this.placement)&&"ArrowUp"===e.key?i--:(n&&(o&&"ArrowLeft"===e.key||!o&&"ArrowRight"===e.key)||["start","end"].includes(this.placement)&&"ArrowDown"===e.key)&&i++,i<0&&(i=this.tabs.length-1),i>this.tabs.length-1&&(i=0),this.tabs[i].focus({preventScroll:!0}),n&&Ht(this.tabs[i],this.nav,"horizontal"),e.preventDefault()}handleScrollToStart(){this.nav.scroll({left:-this.nav.scrollWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:this.nav.scrollWidth,behavior:"smooth"})}setActiveTab(e,t){if(t={emitEvents:!0,scrollBehavior:"auto",...t},e!==this.activeTab&&!e.disabled){const i=this.activeTab;this.activeTab=e,this.activeTabProp!==this.activeTab.panel&&(this.activeTabProp=this.activeTab.panel),this.tabs.forEach((e=>e.active=e===this.activeTab)),this.panels.forEach((e=>e.active=e.name===this.activeTab?.panel)),this.syncIndicator(),this.positionPill(this.pillReady),["top","bottom"].includes(this.placement)&&Ht(this.activeTab,this.nav,"horizontal",t.scrollBehavior),t.emitEvents&&this.emit("nile-tab-change",{value:this.activeTab.panel,previousValue:i?.panel??null,index:this.tabs.indexOf(this.activeTab),previousIndex:i?this.tabs.indexOf(i):-1,link:this.activeTab.link})}}setAriaLabels(){const e=this.getAllTabs({includeDisabled:!0});for(const t of e){const e=this.panels.find((e=>e.name===t.panel));if(t.disabled){t.removeAttribute("aria-controls"),e&&e.removeAttribute("aria-labelledby");continue}if(!e)continue;const i=e.getAttribute("id"),n=t.getAttribute("id");i&&n&&(t.setAttribute("aria-controls",i),e.setAttribute("aria-labelledby",n))}}getRelativeOffsetToAncestor(e,t){let i=0,n=0,o=e;for(;o&&o!==t;)i+=o.offsetLeft,n+=o.offsetTop,o=o.offsetParent;return o===t?{x:i,y:n}:null}getLayoutBoxRelativeToContainer(e,t){const i=t.getBoundingClientRect(),n=e.getBoundingClientRect();if(0===n.width||0===n.height)return null;const o=t.offsetWidth>0?i.width/t.offsetWidth:1,M=t.offsetHeight>0?i.height/t.offsetHeight:1;if(o>0&&M>0&&Number.isFinite(o)&&Number.isFinite(M)){if(Math.abs(o-1)<.001&&Math.abs(M-1)<.001){const i=this.getRelativeOffsetToAncestor(e,t);if(i)return{x:i.x,y:i.y,width:e.offsetWidth,height:e.offsetHeight}}const r=(n.left-i.left)/o,s=(n.top-i.top)/M;let a=n.width/o,l=n.height/M;const g=e.offsetWidth,N=e.offsetHeight;return g>0&&(a=Math.min(a,g)),N>0&&(l=Math.min(l,N)),{x:r,y:s,width:a,height:l}}const r=this.getRelativeOffsetToAncestor(e,t);return r?{x:r.x,y:r.y,width:e.offsetWidth,height:e.offsetHeight}:null}repositionIndicator(e){const t=this.getActiveTab();if(!t||!this.indicator)return;const i=this.shadowRoot?.querySelector(".nav-tab-group__tabs");if(!i)return;const n=t.shadowRoot?.querySelector(".nav-tab-container");if(!n)return;const o=!0===e?.skipTransition;o&&(this.indicator.style.transition="none");const M=this.getLayoutBoxRelativeToContainer(n,i);if(!M)return void(o&&requestAnimationFrame((()=>{this.indicator&&(this.indicator.style.transition="")})));const r=M.x,s=M.y;switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${M.width}px`,this.indicator.style.height="auto",this.indicator.style.translate=`${r}px 0px`;break;case"start":case"end":this.indicator.style.width="auto",this.indicator.style.height=`${M.height}px`,this.indicator.style.translate=`0px ${s}px`}o&&requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.indicator&&(this.indicator.style.transition="")}))}))}syncTabsAndPanels(){this.tabs=this.getAllTabs({includeDisabled:!1}),this.panels=this.getAllPanels();const e=this.getAllTabs({includeDisabled:!0}),t=this.getAllTabs({includeDisabled:!1}),i=t.length,n=new Set(e);for(const e of this.observedTabs)n.has(e)||(this.resizeObserver.unobserve(e),this.observedTabs.delete(e));e.forEach((e=>{if(e.centered=this.centered,e.disabled)e.removeAttribute("aria-posinset"),e.removeAttribute("aria-setsize");else{const n=t.indexOf(e);e.setAttribute("aria-posinset",String(n+1)),e.setAttribute("aria-setsize",String(i))}this.observedTabs.has(e)||(this.resizeObserver.observe(e),this.observedTabs.add(e))})),this.setScrollControls(),this.setAriaLabels()}};tv.styles=ev,e([he(".nav-tab-group")],tv.prototype,"tabGroup",void 0),e([he(".nav-tab-group__body")],tv.prototype,"body",void 0),e([he(".nav-tab-group__nav")],tv.prototype,"nav",void 0),e([he(".nav-tab-group__indicator")],tv.prototype,"indicator",void 0),e([he(".nav-tab-group__hover-indicator")],tv.prototype,"hoverIndicator",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],tv.prototype,"hasScrollControls",void 0),e([ue()],tv.prototype,"placement",void 0),e([ue({reflect:!0,attribute:"value",type:String})],tv.prototype,"activeTabProp",void 0),e([ue({type:Boolean,reflect:!0,attribute:"no-track"})],tv.prototype,"noTrack",void 0),e([ue({attribute:"no-scroll-controls",type:Boolean})],tv.prototype,"noScrollControls",void 0),e([ue({type:Boolean,reflect:!0})],tv.prototype,"centered",void 0),e([ue({type:String,reflect:!0})],tv.prototype,"variant",void 0),e([ue({type:String,reflect:!0})],tv.prototype,"indicatorPlacement",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],tv.prototype,"fullWidth",void 0),e([ue({type:String,reflect:!0})],tv.prototype,"width",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],tv.prototype,"showIndicatorOnHover",void 0),e([De()],tv.prototype,"activeTabName",void 0),e([We("placement",{waitUntilFirstUpdate:!0})],tv.prototype,"syncIndicator",null),tv=e([ge("nile-nav-tab-group")],tv);const iv=r`
20883
+ `}getAllTabs(e={includeDisabled:!0}){const t=this.shadowRoot.querySelector('slot[name="nav"]').assignedElements().filter((e=>"nile-nav-tab"===e.tagName.toLowerCase()));return e.includeDisabled?t:t.filter((e=>!e.disabled))}getAllPanels(){return[...this.body.assignedElements()].filter((e=>"nile-nav-tab-panel"===e.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((e=>this.activeTabName?e.panel===this.activeTabName:e.active))??this.tabs.find((e=>!e.disabled))??this.tabs[0]}setScrollControls(){this.nav&&(this.noScrollControls?this.hasScrollControls=!1:this.hasScrollControls=["top","bottom"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth)}handleKeyDown(e){const t=e.composedPath().find((e=>e instanceof HTMLElement&&"nile-nav-tab"===e.tagName.toLowerCase()));if(t?.disabled)return void e.preventDefault();if(!t||!this.tabs.includes(t))return;if("Enter"===e.key||" "===e.key)return e.preventDefault(),this.activeTabProp=t.panel,void(this.activeTabName=t.panel);if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key))return;let i=this.tabs.indexOf(t);const n=["top","bottom"].includes(this.placement),o="rtl"===getComputedStyle(this).direction;"Home"===e.key?i=0:"End"===e.key?i=this.tabs.length-1:n&&(o&&"ArrowRight"===e.key||!o&&"ArrowLeft"===e.key)||["start","end"].includes(this.placement)&&"ArrowUp"===e.key?i--:(n&&(o&&"ArrowLeft"===e.key||!o&&"ArrowRight"===e.key)||["start","end"].includes(this.placement)&&"ArrowDown"===e.key)&&i++,i<0&&(i=this.tabs.length-1),i>this.tabs.length-1&&(i=0),this.tabs[i].focus({preventScroll:!0}),n&&Ht(this.tabs[i],this.nav,"horizontal"),e.preventDefault()}handleScrollToStart(){this.nav.scroll({left:-this.nav.scrollWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:this.nav.scrollWidth,behavior:"smooth"})}setActiveTab(e,t){if(t={emitEvents:!0,scrollBehavior:"auto",...t},e!==this.activeTab&&!e.disabled){const i=this.activeTab;this.activeTab=e,this.activeTabProp!==this.activeTab.panel&&(this.activeTabProp=this.activeTab.panel),this.tabs.forEach((e=>e.active=e===this.activeTab)),this.panels.forEach((e=>e.active=e.name===this.activeTab?.panel)),this.syncIndicator(),this.positionPill(this.pillReady),["top","bottom"].includes(this.placement)&&Ht(this.activeTab,this.nav,"horizontal",t.scrollBehavior),t.emitEvents&&this.emit("nile-tab-change",{value:this.activeTab.panel,previousValue:i?.panel??null,index:this.tabs.indexOf(this.activeTab),previousIndex:i?this.tabs.indexOf(i):-1,link:this.activeTab.link})}}setAriaLabels(){const e=this.getAllTabs({includeDisabled:!0});for(const t of e){const e=this.panels.find((e=>e.name===t.panel));if(t.disabled){t.removeAttribute("aria-controls"),e&&e.removeAttribute("aria-labelledby");continue}if(!e)continue;const i=e.getAttribute("id"),n=t.getAttribute("id");i&&n&&(t.setAttribute("aria-controls",i),e.setAttribute("aria-labelledby",n))}}getRelativeOffsetToAncestor(e,t){let i=0,n=0,o=e;for(;o&&o!==t;)i+=o.offsetLeft,n+=o.offsetTop,o=o.offsetParent;return o===t?{x:i,y:n}:null}getLayoutBoxRelativeToContainer(e,t){const i=t.getBoundingClientRect(),n=e.getBoundingClientRect();if(0===n.width||0===n.height)return null;const o=t.offsetWidth>0?i.width/t.offsetWidth:1,M=t.offsetHeight>0?i.height/t.offsetHeight:1;if(o>0&&M>0&&Number.isFinite(o)&&Number.isFinite(M)){if(Math.abs(o-1)<.001&&Math.abs(M-1)<.001){const i=this.getRelativeOffsetToAncestor(e,t);if(i)return{x:i.x,y:i.y,width:e.offsetWidth,height:e.offsetHeight}}const r=(n.left-i.left)/o,s=(n.top-i.top)/M;let a=n.width/o,l=n.height/M;const g=e.offsetWidth,N=e.offsetHeight;return g>0&&(a=Math.min(a,g)),N>0&&(l=Math.min(l,N)),{x:r,y:s,width:a,height:l}}const r=this.getRelativeOffsetToAncestor(e,t);return r?{x:r.x,y:r.y,width:e.offsetWidth,height:e.offsetHeight}:null}repositionIndicator(e){const t=this.getActiveTab();if(!t||!this.indicator)return;const i=this.shadowRoot?.querySelector(".nav-tab-group__tabs");if(!i)return;const n=t.shadowRoot?.querySelector(".nav-tab-container");if(!n)return;const o=!0===e?.skipTransition;o&&(this.indicator.style.transition="none");const M=this.getLayoutBoxRelativeToContainer(n,i);if(!M)return void(o&&requestAnimationFrame((()=>{this.indicator&&(this.indicator.style.transition="")})));const r=M.x,s=M.y;switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${M.width}px`,this.indicator.style.height="auto",this.indicator.style.translate=`${r}px 0px`;break;case"start":case"end":this.indicator.style.width="auto",this.indicator.style.height=`${M.height}px`,this.indicator.style.translate=`0px ${s}px`}o&&requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.indicator&&(this.indicator.style.transition="")}))}))}syncTabsAndPanels(){this.tabs=this.getAllTabs({includeDisabled:!1}),this.panels=this.getAllPanels();const e=this.getAllTabs({includeDisabled:!0}),t=this.getAllTabs({includeDisabled:!1}),i=t.length,n=new Set(e);for(const e of this.observedTabs)n.has(e)||(this.resizeObserver.unobserve(e),this.observedTabs.delete(e));e.forEach((e=>{if(e.centered=this.centered,e.disabled)e.removeAttribute("aria-posinset"),e.removeAttribute("aria-setsize");else{const n=t.indexOf(e);e.setAttribute("aria-posinset",String(n+1)),e.setAttribute("aria-setsize",String(i))}this.observedTabs.has(e)||(this.resizeObserver.observe(e),this.observedTabs.add(e))})),this.setScrollControls(),this.setAriaLabels()}};iv.styles=tv,e([he(".nav-tab-group")],iv.prototype,"tabGroup",void 0),e([he(".nav-tab-group__body")],iv.prototype,"body",void 0),e([he(".nav-tab-group__nav")],iv.prototype,"nav",void 0),e([he(".nav-tab-group__indicator")],iv.prototype,"indicator",void 0),e([he(".nav-tab-group__hover-indicator")],iv.prototype,"hoverIndicator",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],iv.prototype,"hasScrollControls",void 0),e([ue()],iv.prototype,"placement",void 0),e([ue({reflect:!0,attribute:"value",type:String})],iv.prototype,"activeTabProp",void 0),e([ue({type:Boolean,reflect:!0,attribute:"no-track"})],iv.prototype,"noTrack",void 0),e([ue({attribute:"no-scroll-controls",type:Boolean})],iv.prototype,"noScrollControls",void 0),e([ue({type:Boolean,reflect:!0})],iv.prototype,"centered",void 0),e([ue({type:String,reflect:!0})],iv.prototype,"variant",void 0),e([ue({type:String,reflect:!0})],iv.prototype,"indicatorPlacement",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],iv.prototype,"fullWidth",void 0),e([ue({type:String,reflect:!0})],iv.prototype,"width",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],iv.prototype,"showIndicatorOnHover",void 0),e([De()],iv.prototype,"activeTabName",void 0),e([We("placement",{waitUntilFirstUpdate:!0})],iv.prototype,"syncIndicator",null),iv=e([ge("nile-nav-tab-group")],iv);const nv=r`
20735
20884
  [hidden] {
20736
20885
  display: none;
20737
20886
  }
@@ -20752,14 +20901,14 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
20752
20901
  display: block;
20753
20902
  padding: var(--padding);
20754
20903
  }
20755
- `;let nv=0,ov=class extends Fe{constructor(){super(...arguments),this.attrId=++nv,this.componentId=`nile-nav-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel"),this.handleActiveChange()}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true"),this.setAttribute("tabindex",this.active?"0":"-1")}render(){return _`
20904
+ `;let ov=0,Mv=class extends Fe{constructor(){super(...arguments),this.attrId=++ov,this.componentId=`nile-nav-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel"),this.handleActiveChange()}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true"),this.setAttribute("tabindex",this.active?"0":"-1")}render(){return _`
20756
20905
  <div
20757
20906
  part="base"
20758
20907
  class=${xe({"nav-tab-panel":!0,"nav-tab-panel--active":this.active})}
20759
20908
  >
20760
20909
  <slot></slot>
20761
20910
  </div>
20762
- `}};ov.styles=iv,e([ue({reflect:!0})],ov.prototype,"name",void 0),e([ue({type:Boolean,reflect:!0})],ov.prototype,"active",void 0),e([We("active")],ov.prototype,"handleActiveChange",null),ov=e([ge("nile-nav-tab-panel")],ov);const Mv=r`
20911
+ `}};Mv.styles=nv,e([ue({reflect:!0})],Mv.prototype,"name",void 0),e([ue({type:Boolean,reflect:!0})],Mv.prototype,"active",void 0),e([We("active")],Mv.prototype,"handleActiveChange",null),Mv=e([ge("nile-nav-tab-panel")],Mv);const rv=r`
20763
20912
  nile-floating-panel {
20764
20913
  display: inline-block;
20765
20914
  }
@@ -20911,7 +21060,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
20911
21060
  border-color: transparent;
20912
21061
  border-style: solid;
20913
21062
  }
20914
- `;var rv;!function(){if("undefined"==typeof document)return;const e="nile-floating-panel-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=Mv.cssText,document.head?.appendChild(t)}();let sv=rv=class extends Fe{constructor(){super(...arguments),this.placement="bottom",this.trigger="click",this.distance=12,this.skidding=0,this.arrow="round",this.animation="fade",this.duration=200,this.delay=0,this.interactive=!0,this.interactiveBorder=2,this.maxWidth="none",this.zIndex=9999,this.followCursor=!1,this.hideOnClick=!0,this.inertia=!1,this.allowHTML=!1,this.flip=!0,this.for=null,this.open=!1,this.preventOverlayClose=!1,this.title="",this.disabled=!1,this.group=null,this.closeOnEscape=!0,this.panelClass="",this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.tippyInstance=null,this.panelContainer=null,this.anchorEl=null,this._suppressOpenWatch=!1,this._panelId=`nile-fp-${Math.random().toString(36).slice(2,9)}`,this._boundEscHandler=this._handleEscapeKey.bind(this),this._pendingShowListener=null,this._pendingHideListener=null}static get prefersReducedMotion(){return rv._reducedMotionQuery||(rv._reducedMotionQuery=window.matchMedia("(prefers-reduced-motion: reduce)")),rv._reducedMotionQuery.matches}static get styles(){return[Mv]}createRenderRoot(){return this}firstUpdated(){this._buildDOM(),this._attachTippy(),this._joinGroup(),this.visibilityManager=new mn({host:this,target:this.anchorEl||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this._setOpen(!1),this.tippyInstance?.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this._setOpen(!1),this.tippyInstance?.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)}),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this._cleanupPendingShowListener(),this._cleanupPendingHideListener(),this.visibilityManager?.cleanup(),this._leaveGroup(),this._removeEscListener(),this._destroyTippy(),this.emit("nile-destroy")}updated(e){if(super.updated(e),!this.panelContainer)return;e.has("open")&&!this._suppressOpenWatch&&(this.open?(this.visibilityManager?.setup(),queueMicrotask((()=>this.tippyInstance?.show()))):(this.visibilityManager?.cleanup(),this.tippyInstance?.hide())),e.has("group")&&(this._leaveGroup(e.get("group")),this._joinGroup());["placement","trigger","distance","skidding","arrow","animation","duration","delay","interactive","interactiveBorder","maxWidth","zIndex","followCursor","hideOnClick","inertia","allowHTML","flip","preventOverlayClose","disabled","width","height","panelClass"].some((t=>e.has(t)))&&this._attachTippy()}show(){return this.open=!0,new Promise((e=>{this._cleanupPendingShowListener();const t=()=>{this._pendingShowListener=null,e()};this._pendingShowListener=t,this.addEventListener("nile-after-show",t,{once:!0})}))}hide(){return this.open=!1,new Promise((e=>{this._cleanupPendingHideListener();const t=()=>{this._pendingHideListener=null,e()};this._pendingHideListener=t,this.addEventListener("nile-after-hide",t,{once:!0})}))}_cleanupPendingShowListener(){this._pendingShowListener&&(this.removeEventListener("nile-after-show",this._pendingShowListener),this._pendingShowListener=null)}_cleanupPendingHideListener(){this._pendingHideListener&&(this.removeEventListener("nile-after-hide",this._pendingHideListener),this._pendingHideListener=null)}toggle(){this.open=!this.open}refresh(){this._attachTippy()}reposition(){this.tippyInstance?.popperInstance?.update()}getCurrentPlacement(){const e=this.tippyInstance?.popper,t=e?.querySelector(".tippy-box");return t?.dataset.placement??this.placement}isPositioningOptimal(){return this.getCurrentPlacement()===this.placement}_joinGroup(){if(!this.group)return;let e=rv._groups.get(this.group);e||(e=new Set,rv._groups.set(this.group,e)),e.add(this)}_leaveGroup(e){const t=e??this.group;if(!t)return;const i=rv._groups.get(t);i&&(i.delete(this),0===i.size&&rv._groups.delete(t))}_hideGroupSiblings(){if(!this.group)return;const e=rv._groups.get(this.group);e&&e.forEach((e=>{e!==this&&e.open&&(e._setOpen(!1),e.tippyInstance?.hide())}))}_addEscListener(){this.closeOnEscape&&document.addEventListener("keydown",this._boundEscHandler)}_removeEscListener(){document.removeEventListener("keydown",this._boundEscHandler)}_handleEscapeKey(e){"Escape"===e.key&&this.open&&(this._setOpen(!1),this.tippyInstance?.hide())}_applyAria(){this.anchorEl&&this.panelContainer&&(this.panelContainer.setAttribute("role","dialog"),this.panelContainer.id=this._panelId,this.anchorEl.setAttribute("aria-haspopup","dialog"),this._syncAriaExpanded())}_syncAriaExpanded(){this.anchorEl?.setAttribute("aria-expanded",String(this.open)),this.open?this.anchorEl?.setAttribute("aria-describedby",this._panelId):this.anchorEl?.removeAttribute("aria-describedby")}_buildDOM(){const e=Array.from(this.childNodes);this.anchorEl=null;const t=[],i=[],n=[];let o=!1;for(const M of e){if(M instanceof HTMLElement){const e=M.getAttribute("slot");if("title"===e){M.removeAttribute("slot"),t.push(M);continue}if("action"===e){M.removeAttribute("slot"),i.push(M);continue}if(!o&&!this.for){this.anchorEl=M,o=!0;continue}}n.push(M)}if(this.for){const e=document.getElementById(this.for);e&&(this.anchorEl=e)}for(;this.firstChild;)this.removeChild(this.firstChild);this.anchorEl&&!this.for&&this.appendChild(this.anchorEl),this.panelContainer=document.createElement("div"),this.panelContainer.className="nile-floating-panel__content",this.panelContainer.style.display="none";const M=document.createElement("div");if(M.className="nile-floating-panel__body",t.length>0||this.title){const e=document.createElement("div");e.className="nile-floating-panel__title",this.title?e.textContent=this.title:t.forEach((t=>e.appendChild(t))),M.appendChild(e)}if(n.length>0){const e=document.createElement("div");e.className="nile-floating-panel__main",n.forEach((t=>e.appendChild(t))),M.appendChild(e)}if(i.length>0){const e=document.createElement("div");e.className="nile-floating-panel__action",i.forEach((t=>e.appendChild(t))),M.appendChild(e)}this.panelContainer.appendChild(M),this.appendChild(this.panelContainer),this._applyAria()}_resolveArrow(){switch(this.arrow){case"round":return rb;case"none":return!1;default:return!0}}_setOpen(e){this._suppressOpenWatch=!0,this.open=e,this._syncAriaExpanded(),this._suppressOpenWatch=!1}_getEffectiveDuration(){return rv.prefersReducedMotion?0:ck(this.duration)}_getEffectiveAnimation(){return!rv.prefersReducedMotion&&this.animation}_attachTippy(){if(this._destroyTippy(),this.disabled||!this.anchorEl||!this.panelContainer)return;const e=Nk(this.followCursor),t=!this.preventOverlayClose&&this.hideOnClick,i={content:this.panelContainer,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"floating-panel",animation:this._getEffectiveAnimation(),interactive:this.interactive,arrow:this._resolveArrow(),duration:this._getEffectiveDuration(),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:t,inertia:!rv.prefersReducedMotion&&this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:e,plugins:e?[gk]:[],popperOptions:{modifiers:[{name:"flip",enabled:this.flip}]},onMount:e=>{this.panelContainer&&(this.panelContainer.style.display=""),this.panelClass&&this.panelClass.split(/\s+/).filter(Boolean).forEach((t=>{e.popper.classList.add(t)}))},onShow:e=>{this.panelContainer&&(this.panelContainer.style.display="");const t=e.popper.querySelector(".tippy-content");t&&(this.width&&(t.style.width=this.width),this.height&&(t.style.height=this.height,t.style.overflow="auto")),this._hideGroupSiblings(),this._setOpen(!0),this._addEscListener(),this.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:e,target:e.reference}}))},onShown:e=>{this.dispatchEvent(new CustomEvent("nile-after-show",{detail:{instance:e,target:e.reference}}))},onHide:e=>{this._setOpen(!1),this._removeEscListener(),this.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:e,target:e.reference}}))},onHidden:e=>{this.panelContainer&&(this.panelContainer.style.display="none"),this.dispatchEvent(new CustomEvent("nile-after-hide",{detail:{instance:e,target:e.reference}}))}};this.tippyInstance=ok(this.anchorEl,i),this.open&&queueMicrotask((()=>this.tippyInstance?.show()))}_destroyTippy(){this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null),this.panelContainer&&(this.panelContainer.style.display="none",this.panelContainer.parentElement!==this&&this.appendChild(this.panelContainer))}};sv._groups=new Map,sv._reducedMotionQuery=null,e([ue({type:String})],sv.prototype,"placement",void 0),e([ue({type:String})],sv.prototype,"trigger",void 0),e([ue({type:Number})],sv.prototype,"distance",void 0),e([ue({type:Number})],sv.prototype,"skidding",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"arrow",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"animation",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"duration",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"delay",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"interactive",void 0),e([ue({type:Number,reflect:!0})],sv.prototype,"interactiveBorder",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"maxWidth",void 0),e([ue({type:Number,reflect:!0})],sv.prototype,"zIndex",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"followCursor",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"hideOnClick",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"inertia",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"allowHTML",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"flip",void 0),e([ue({type:String,attribute:"for"})],sv.prototype,"for",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"open",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"preventOverlayClose",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"title",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"disabled",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"width",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"height",void 0),e([ue({type:String,reflect:!0})],sv.prototype,"group",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"closeOnEscape",void 0),e([ue({type:String,reflect:!0,attribute:!0})],sv.prototype,"panelClass",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"enableVisibilityEffect",void 0),e([ue({type:Boolean,reflect:!0})],sv.prototype,"enableTabClose",void 0),sv=rv=e([ge("nile-floating-panel")],sv);const av=r`
21063
+ `;var sv;!function(){if("undefined"==typeof document)return;const e="nile-floating-panel-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=rv.cssText,document.head?.appendChild(t)}();let av=sv=class extends Fe{constructor(){super(...arguments),this.placement="bottom",this.trigger="click",this.distance=12,this.skidding=0,this.arrow="round",this.animation="fade",this.duration=200,this.delay=0,this.interactive=!0,this.interactiveBorder=2,this.maxWidth="none",this.zIndex=9999,this.followCursor=!1,this.hideOnClick=!0,this.inertia=!1,this.allowHTML=!1,this.flip=!0,this.for=null,this.open=!1,this.preventOverlayClose=!1,this.title="",this.disabled=!1,this.group=null,this.closeOnEscape=!0,this.panelClass="",this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.tippyInstance=null,this.panelContainer=null,this.anchorEl=null,this._suppressOpenWatch=!1,this._panelId=`nile-fp-${Math.random().toString(36).slice(2,9)}`,this._boundEscHandler=this._handleEscapeKey.bind(this),this._pendingShowListener=null,this._pendingHideListener=null}static get prefersReducedMotion(){return sv._reducedMotionQuery||(sv._reducedMotionQuery=window.matchMedia("(prefers-reduced-motion: reduce)")),sv._reducedMotionQuery.matches}static get styles(){return[rv]}createRenderRoot(){return this}firstUpdated(){this._buildDOM(),this._attachTippy(),this._joinGroup(),this.visibilityManager=new mn({host:this,target:this.anchorEl||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this._setOpen(!1),this.tippyInstance?.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this._setOpen(!1),this.tippyInstance?.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)}),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this._cleanupPendingShowListener(),this._cleanupPendingHideListener(),this.visibilityManager?.cleanup(),this._leaveGroup(),this._removeEscListener(),this._destroyTippy(),this.emit("nile-destroy")}updated(e){if(super.updated(e),!this.panelContainer)return;e.has("open")&&!this._suppressOpenWatch&&(this.open?(this.visibilityManager?.setup(),queueMicrotask((()=>this.tippyInstance?.show()))):(this.visibilityManager?.cleanup(),this.tippyInstance?.hide())),e.has("group")&&(this._leaveGroup(e.get("group")),this._joinGroup());["placement","trigger","distance","skidding","arrow","animation","duration","delay","interactive","interactiveBorder","maxWidth","zIndex","followCursor","hideOnClick","inertia","allowHTML","flip","preventOverlayClose","disabled","width","height","panelClass"].some((t=>e.has(t)))&&this._attachTippy()}show(){return this.open=!0,new Promise((e=>{this._cleanupPendingShowListener();const t=()=>{this._pendingShowListener=null,e()};this._pendingShowListener=t,this.addEventListener("nile-after-show",t,{once:!0})}))}hide(){return this.open=!1,new Promise((e=>{this._cleanupPendingHideListener();const t=()=>{this._pendingHideListener=null,e()};this._pendingHideListener=t,this.addEventListener("nile-after-hide",t,{once:!0})}))}_cleanupPendingShowListener(){this._pendingShowListener&&(this.removeEventListener("nile-after-show",this._pendingShowListener),this._pendingShowListener=null)}_cleanupPendingHideListener(){this._pendingHideListener&&(this.removeEventListener("nile-after-hide",this._pendingHideListener),this._pendingHideListener=null)}toggle(){this.open=!this.open}refresh(){this._attachTippy()}reposition(){this.tippyInstance?.popperInstance?.update()}getCurrentPlacement(){const e=this.tippyInstance?.popper,t=e?.querySelector(".tippy-box");return t?.dataset.placement??this.placement}isPositioningOptimal(){return this.getCurrentPlacement()===this.placement}_joinGroup(){if(!this.group)return;let e=sv._groups.get(this.group);e||(e=new Set,sv._groups.set(this.group,e)),e.add(this)}_leaveGroup(e){const t=e??this.group;if(!t)return;const i=sv._groups.get(t);i&&(i.delete(this),0===i.size&&sv._groups.delete(t))}_hideGroupSiblings(){if(!this.group)return;const e=sv._groups.get(this.group);e&&e.forEach((e=>{e!==this&&e.open&&(e._setOpen(!1),e.tippyInstance?.hide())}))}_addEscListener(){this.closeOnEscape&&document.addEventListener("keydown",this._boundEscHandler)}_removeEscListener(){document.removeEventListener("keydown",this._boundEscHandler)}_handleEscapeKey(e){"Escape"===e.key&&this.open&&(this._setOpen(!1),this.tippyInstance?.hide())}_applyAria(){this.anchorEl&&this.panelContainer&&(this.panelContainer.setAttribute("role","dialog"),this.panelContainer.id=this._panelId,this.anchorEl.setAttribute("aria-haspopup","dialog"),this._syncAriaExpanded())}_syncAriaExpanded(){this.anchorEl?.setAttribute("aria-expanded",String(this.open)),this.open?this.anchorEl?.setAttribute("aria-describedby",this._panelId):this.anchorEl?.removeAttribute("aria-describedby")}_buildDOM(){const e=Array.from(this.childNodes);this.anchorEl=null;const t=[],i=[],n=[];let o=!1;for(const M of e){if(M instanceof HTMLElement){const e=M.getAttribute("slot");if("title"===e){M.removeAttribute("slot"),t.push(M);continue}if("action"===e){M.removeAttribute("slot"),i.push(M);continue}if(!o&&!this.for){this.anchorEl=M,o=!0;continue}}n.push(M)}if(this.for){const e=document.getElementById(this.for);e&&(this.anchorEl=e)}for(;this.firstChild;)this.removeChild(this.firstChild);this.anchorEl&&!this.for&&this.appendChild(this.anchorEl),this.panelContainer=document.createElement("div"),this.panelContainer.className="nile-floating-panel__content",this.panelContainer.style.display="none";const M=document.createElement("div");if(M.className="nile-floating-panel__body",t.length>0||this.title){const e=document.createElement("div");e.className="nile-floating-panel__title",this.title?e.textContent=this.title:t.forEach((t=>e.appendChild(t))),M.appendChild(e)}if(n.length>0){const e=document.createElement("div");e.className="nile-floating-panel__main",n.forEach((t=>e.appendChild(t))),M.appendChild(e)}if(i.length>0){const e=document.createElement("div");e.className="nile-floating-panel__action",i.forEach((t=>e.appendChild(t))),M.appendChild(e)}this.panelContainer.appendChild(M),this.appendChild(this.panelContainer),this._applyAria()}_resolveArrow(){switch(this.arrow){case"round":return sb;case"none":return!1;default:return!0}}_setOpen(e){this._suppressOpenWatch=!0,this.open=e,this._syncAriaExpanded(),this._suppressOpenWatch=!1}_getEffectiveDuration(){return sv.prefersReducedMotion?0:uk(this.duration)}_getEffectiveAnimation(){return!sv.prefersReducedMotion&&this.animation}_attachTippy(){if(this._destroyTippy(),this.disabled||!this.anchorEl||!this.panelContainer)return;const e=ck(this.followCursor),t=!this.preventOverlayClose&&this.hideOnClick,i={content:this.panelContainer,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"floating-panel",animation:this._getEffectiveAnimation(),interactive:this.interactive,arrow:this._resolveArrow(),duration:this._getEffectiveDuration(),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:t,inertia:!sv.prefersReducedMotion&&this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:e,plugins:e?[Nk]:[],popperOptions:{modifiers:[{name:"flip",enabled:this.flip}]},onMount:e=>{this.panelContainer&&(this.panelContainer.style.display=""),this.panelClass&&this.panelClass.split(/\s+/).filter(Boolean).forEach((t=>{e.popper.classList.add(t)}))},onShow:e=>{this.panelContainer&&(this.panelContainer.style.display="");const t=e.popper.querySelector(".tippy-content");t&&(this.width&&(t.style.width=this.width),this.height&&(t.style.height=this.height,t.style.overflow="auto")),this._hideGroupSiblings(),this._setOpen(!0),this._addEscListener(),this.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:e,target:e.reference}}))},onShown:e=>{this.dispatchEvent(new CustomEvent("nile-after-show",{detail:{instance:e,target:e.reference}}))},onHide:e=>{this._setOpen(!1),this._removeEscListener(),this.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:e,target:e.reference}}))},onHidden:e=>{this.panelContainer&&(this.panelContainer.style.display="none"),this.dispatchEvent(new CustomEvent("nile-after-hide",{detail:{instance:e,target:e.reference}}))}};this.tippyInstance=Mk(this.anchorEl,i),this.open&&queueMicrotask((()=>this.tippyInstance?.show()))}_destroyTippy(){this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null),this.panelContainer&&(this.panelContainer.style.display="none",this.panelContainer.parentElement!==this&&this.appendChild(this.panelContainer))}};av._groups=new Map,av._reducedMotionQuery=null,e([ue({type:String})],av.prototype,"placement",void 0),e([ue({type:String})],av.prototype,"trigger",void 0),e([ue({type:Number})],av.prototype,"distance",void 0),e([ue({type:Number})],av.prototype,"skidding",void 0),e([ue({type:String,reflect:!0})],av.prototype,"arrow",void 0),e([ue({type:String,reflect:!0})],av.prototype,"animation",void 0),e([ue({type:String,reflect:!0})],av.prototype,"duration",void 0),e([ue({type:String,reflect:!0})],av.prototype,"delay",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"interactive",void 0),e([ue({type:Number,reflect:!0})],av.prototype,"interactiveBorder",void 0),e([ue({type:String,reflect:!0})],av.prototype,"maxWidth",void 0),e([ue({type:Number,reflect:!0})],av.prototype,"zIndex",void 0),e([ue({type:String,reflect:!0})],av.prototype,"followCursor",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"hideOnClick",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"inertia",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"allowHTML",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"flip",void 0),e([ue({type:String,attribute:"for"})],av.prototype,"for",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"open",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"preventOverlayClose",void 0),e([ue({type:String,reflect:!0})],av.prototype,"title",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"disabled",void 0),e([ue({type:String,reflect:!0})],av.prototype,"width",void 0),e([ue({type:String,reflect:!0})],av.prototype,"height",void 0),e([ue({type:String,reflect:!0})],av.prototype,"group",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"closeOnEscape",void 0),e([ue({type:String,reflect:!0,attribute:!0})],av.prototype,"panelClass",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"enableVisibilityEffect",void 0),e([ue({type:Boolean,reflect:!0})],av.prototype,"enableTabClose",void 0),av=sv=e([ge("nile-floating-panel")],av);const lv=r`
20915
21064
  :host {
20916
21065
  box-sizing: border-box;
20917
21066
  -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
@@ -20961,7 +21110,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
20961
21110
  height: 1px;
20962
21111
  background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
20963
21112
  }
20964
- `;!function(){if("undefined"==typeof document)return;const e="nile-context-menu-overrides";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n .nile-context-menu-panel .nile-floating-panel__body {\n min-width: 0;\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n gap: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .nile-floating-panel__main {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .tippy-box[data-theme~='floating-panel'] {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n background: transparent;\n border: none;\n border-radius: var(--nile-radius-none, var(--ng-radius-none));\n box-shadow: none;\n }\n .nile-context-menu__menu[role='menu'] {\n min-width: 200px;\n max-width: 540px;\n max-height: min(60vh, 400px);\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-none, var(--ng-spacing-none));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-border-surface, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md));\n box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08),\n 0px 8px 8px -4px rgba(16, 24, 40, 0.03);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n user-select: none;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-item,\n .nile-context-menu__menu[role='menu'] nile-context-menu-group {\n font-family: inherit;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group {\n position: relative;\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group::before {\n content: '';\n position: absolute;\n top: 0;\n left: var(--nile-spacing-xl, var(--ng-spacing-lg));\n right: var(--nile-spacing-xl, var(--ng-spacing-lg));\n height: 1px;\n background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n",document.head?.appendChild(t)}();const lv=r`
21113
+ `;!function(){if("undefined"==typeof document)return;const e="nile-context-menu-overrides";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n .nile-context-menu-panel .nile-floating-panel__body {\n min-width: 0;\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n gap: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .nile-floating-panel__main {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n .nile-context-menu-panel .tippy-box[data-theme~='floating-panel'] {\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n background: transparent;\n border: none;\n border-radius: var(--nile-radius-none, var(--ng-radius-none));\n box-shadow: none;\n }\n .nile-context-menu__menu[role='menu'] {\n min-width: 200px;\n max-width: 540px;\n max-height: min(60vh, 400px);\n padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) var(--nile-spacing-none, var(--ng-spacing-none));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-border-surface, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md));\n box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08),\n 0px 8px 8px -4px rgba(16, 24, 40, 0.03);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));\n color: var(--nile-colors-text-default, var(--ng-colors-text-secondary-700));\n user-select: none;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-item,\n .nile-context-menu__menu[role='menu'] nile-context-menu-group {\n font-family: inherit;\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group {\n position: relative;\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n }\n .nile-context-menu__menu[role='menu'] nile-context-menu-group + nile-context-menu-group::before {\n content: '';\n position: absolute;\n top: 0;\n left: var(--nile-spacing-xl, var(--ng-spacing-lg));\n right: var(--nile-spacing-xl, var(--ng-spacing-lg));\n height: 1px;\n background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n",document.head?.appendChild(t)}();const gv=r`
20965
21114
  :host {
20966
21115
  box-sizing: border-box;
20967
21116
  display: block;
@@ -20980,7 +21129,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
20980
21129
  line-height: var(--nile-line-height-1-8, var(--ng-line-height-text-md));
20981
21130
  color: var(--nile-colors-neutral-500, var(--ng-colors-text-placeholder-subtle));
20982
21131
  }
20983
- `;var gv;let Nv=gv=class extends Fe{constructor(){super(...arguments),this.label="",this._labelId="nile-context-menu-group-label-"+ ++gv._idSeq}static get styles(){return[lv]}render(){const e=this.label||this.id;return _`
21132
+ `;var Nv;let cv=Nv=class extends Fe{constructor(){super(...arguments),this.label="",this._labelId="nile-context-menu-group-label-"+ ++Nv._idSeq}static get styles(){return[gv]}render(){const e=this.label||this.id;return _`
20984
21133
  <div
20985
21134
  part="group"
20986
21135
  class="group"
@@ -20990,7 +21139,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
20990
21139
  ${e?_`<div part="label" class="label" id=${this._labelId}>${e}</div>`:null}
20991
21140
  <slot></slot>
20992
21141
  </div>
20993
- `}};Nv._idSeq=0,e([ue({attribute:!0,type:String,reflect:!0})],Nv.prototype,"label",void 0),Nv=gv=e([ge("nile-context-menu-group")],Nv);const cv=r`
21142
+ `}};cv._idSeq=0,e([ue({attribute:!0,type:String,reflect:!0})],cv.prototype,"label",void 0),cv=Nv=e([ge("nile-context-menu-group")],cv);const uv=r`
20994
21143
  :host {
20995
21144
  box-sizing: border-box;
20996
21145
  display: block;
@@ -21061,7 +21210,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
21061
21210
  line-height: 1;
21062
21211
  opacity: 0.6;
21063
21212
  }
21064
- `;let uv=class extends Fe{constructor(){super(...arguments),this.value="",this.disabled=!1,this.open=!1,this._hasSubmenu=!1,this._hasIcon=!1,this._submenuExpanded=!1,this._onSlotChange=e=>{const t=e.target.assignedElements({flatten:!0});this._hasSubmenu=t.some((e=>"nile-context-submenu"===e.tagName.toLowerCase()))},this._onIconSlotChange=e=>{const t=e.target;this._hasIcon=t.assignedNodes({flatten:!0}).some((e=>e.nodeType===Node.ELEMENT_NODE||""!==(e.textContent??"").trim()))}}static get styles(){return[cv]}setSubmenuExpanded(e){this._submenuExpanded=e}focus(e){const t=this.shadowRoot?.querySelector(".item");t?.focus(e)}get hasSubmenu(){return this._hasSubmenu}render(){return _`
21213
+ `;let Dv=class extends Fe{constructor(){super(...arguments),this.value="",this.disabled=!1,this.open=!1,this._hasSubmenu=!1,this._hasIcon=!1,this._submenuExpanded=!1,this._onSlotChange=e=>{const t=e.target.assignedElements({flatten:!0});this._hasSubmenu=t.some((e=>"nile-context-submenu"===e.tagName.toLowerCase()))},this._onIconSlotChange=e=>{const t=e.target;this._hasIcon=t.assignedNodes({flatten:!0}).some((e=>e.nodeType===Node.ELEMENT_NODE||""!==(e.textContent??"").trim()))}}static get styles(){return[uv]}setSubmenuExpanded(e){this._submenuExpanded=e}focus(e){const t=this.shadowRoot?.querySelector(".item");t?.focus(e)}get hasSubmenu(){return this._hasSubmenu}render(){return _`
21065
21214
  <div
21066
21215
  part="item"
21067
21216
  class="item"
@@ -21080,9 +21229,9 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
21080
21229
  <nile-glyph name="ng-chevron-right" size="16" method="stroke"></nile-glyph>
21081
21230
  </span>`:""}
21082
21231
  </div>
21083
- `}};var Dv;e([ue({attribute:!0,type:String,reflect:!0})],uv.prototype,"value",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],uv.prototype,"disabled",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],uv.prototype,"open",void 0),e([De()],uv.prototype,"_hasSubmenu",void 0),e([De()],uv.prototype,"_hasIcon",void 0),e([De()],uv.prototype,"_submenuExpanded",void 0),uv=e([ge("nile-context-menu-item")],uv);const dv="nile-context-menu-item",hv="nile-context-submenu";let jv=0,Iv=Dv=class extends Fe{constructor(){super(...arguments),this.zIndex=9999,this._open=!1,this._parentItem=null,this._proxyId="nile-context-submenu-anchor-"+ ++jv,this._menuContainerRef=null,this._setupDone=!1,this._repositionQueued=!1,this._onParentEnter=()=>{this._parentItem?.disabled||(this._clearTimers(),this._open||(this._openTimer=window.setTimeout((()=>this.openSubmenu()),100)))},this._onParentLeave=()=>{null!=this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._pinnedOpen||this._open&&(this._closeTimer=window.setTimeout((()=>this.closeSubmenu()),300))},this._onParentClick=e=>{e.stopPropagation(),this._parentItem?.disabled||(this._clearTimers(),this._open?this._pinnedOpen||this.closeSubmenu():this.openSubmenu())},this._onPanelEnter=()=>{this._clearTimers()},this._onReposition=()=>{!this._repositionQueued&&this._open&&(this._repositionQueued=!0,requestAnimationFrame((()=>{this._repositionQueued=!1,this._open&&(this._syncProxyToParent(),this._floatingPanelEl?.reposition())})))},this._onPanelLeave=()=>{this._pinnedOpen||this._open&&(this._closeTimer=window.setTimeout((()=>{Dv.openStack.some((e=>e!==this&&this._menuContainerRef?.contains(e)))||this.closeSubmenu()}),300))},this._onMenuMouseOver=e=>{const t=e.composedPath().find((e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===dv));t&&!t.disabled&&t.focus()},this._onNestedSelect=e=>{e.target!==this&&"click"===e.detail?.type&&this.emit("nile-change",e.detail)},this._onMenuClick=e=>{const t=e.composedPath().find((e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===dv));if(!t||t.disabled)return;if(t.querySelector(`:scope > ${hv}`))return;const i={id:t.id,value:t.value,name:(t.textContent??"").trim(),target:null,originalEvent:e};try{t.onSelect?.(i)}catch(e){console.error("[nile-context-submenu] onSelect callback threw:",e)}this.emit("nile-change",{type:"click",...i})}}static get styles(){return[r`
21232
+ `}};var dv;e([ue({attribute:!0,type:String,reflect:!0})],Dv.prototype,"value",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],Dv.prototype,"disabled",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],Dv.prototype,"open",void 0),e([De()],Dv.prototype,"_hasSubmenu",void 0),e([De()],Dv.prototype,"_hasIcon",void 0),e([De()],Dv.prototype,"_submenuExpanded",void 0),Dv=e([ge("nile-context-menu-item")],Dv);const hv="nile-context-menu-item",jv="nile-context-submenu";let Iv=0,zv=dv=class extends Fe{constructor(){super(...arguments),this.zIndex=9999,this._open=!1,this._parentItem=null,this._proxyId="nile-context-submenu-anchor-"+ ++Iv,this._menuContainerRef=null,this._setupDone=!1,this._repositionQueued=!1,this._onParentEnter=()=>{this._parentItem?.disabled||(this._clearTimers(),this._open||(this._openTimer=window.setTimeout((()=>this.openSubmenu()),100)))},this._onParentLeave=()=>{null!=this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._pinnedOpen||this._open&&(this._closeTimer=window.setTimeout((()=>this.closeSubmenu()),300))},this._onParentClick=e=>{e.stopPropagation(),this._parentItem?.disabled||(this._clearTimers(),this._open?this._pinnedOpen||this.closeSubmenu():this.openSubmenu())},this._onPanelEnter=()=>{this._clearTimers()},this._onReposition=()=>{!this._repositionQueued&&this._open&&(this._repositionQueued=!0,requestAnimationFrame((()=>{this._repositionQueued=!1,this._open&&(this._syncProxyToParent(),this._floatingPanelEl?.reposition())})))},this._onPanelLeave=()=>{this._pinnedOpen||this._open&&(this._closeTimer=window.setTimeout((()=>{dv.openStack.some((e=>e!==this&&this._menuContainerRef?.contains(e)))||this.closeSubmenu()}),300))},this._onMenuMouseOver=e=>{const t=e.composedPath().find((e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===hv));t&&!t.disabled&&t.focus()},this._onNestedSelect=e=>{e.target!==this&&"click"===e.detail?.type&&this.emit("nile-change",e.detail)},this._onMenuClick=e=>{const t=e.composedPath().find((e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===hv));if(!t||t.disabled)return;if(t.querySelector(`:scope > ${jv}`))return;const i={id:t.id,value:t.value,name:(t.textContent??"").trim(),target:null,originalEvent:e};try{t.onSelect?.(i)}catch(e){console.error("[nile-context-submenu] onSelect callback threw:",e)}this.emit("nile-change",{type:"click",...i})}}static get styles(){return[r`
21084
21233
  :host { display: contents; }
21085
- `]}get _pinnedOpen(){return!(!this._parentItem?.open||this._parentItem.disabled)}connectedCallback(){super.connectedCallback();let e=this.parentElement;for(;e&&e.tagName.toLowerCase()!==dv;)e=e.parentElement;this._parentItem=e,this._ensureProxy(),this._parentItem&&(this._parentItem.setSubmenuExpanded?.(!1),this._parentItem.addEventListener("mouseenter",this._onParentEnter),this._parentItem.addEventListener("mouseleave",this._onParentLeave),this._parentItem.addEventListener("click",this._onParentClick,!0),this._parentObserver=new MutationObserver((()=>{this._pinnedOpen?this._isParentVisible()&&this.openSubmenu():this._open&&this.closeSubmenu()})),this._parentObserver.observe(this._parentItem,{attributes:!0,attributeFilter:["open"]})),this._ensureBodyPanel()}_isParentVisible(){const e=this._parentItem?.getBoundingClientRect();return!!e&&e.width>0&&e.height>0}_ensureProxy(){if(this._proxyEl)return;const e=document.createElement("div");e.id=this._proxyId,e.setAttribute("aria-hidden","true"),e.style.cssText="position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none;",document.body.appendChild(e),this._proxyEl=e}_syncProxyToParent(){if(!this._proxyEl||!this._parentItem)return;const e=this._parentItem.getBoundingClientRect();this._pinnedOpen?(this._proxyEl.style.position="absolute",this._proxyEl.style.left=`${e.left+window.scrollX}px`,this._proxyEl.style.top=`${e.top+window.scrollY}px`):(this._proxyEl.style.position="fixed",this._proxyEl.style.left=`${e.left}px`,this._proxyEl.style.top=`${e.top}px`),this._proxyEl.style.width=`${e.width}px`,this._proxyEl.style.height=`${e.height}px`}disconnectedCallback(){super.disconnectedCallback(),this._parentItem&&(this._parentItem.removeEventListener("mouseenter",this._onParentEnter),this._parentItem.removeEventListener("mouseleave",this._onParentLeave),this._parentItem.removeEventListener("click",this._onParentClick,!0)),this._parentObserver?.disconnect(),this._parentObserver=void 0,this._clearTimers(),this._open&&this.closeSubmenu(),this._teardownBodyArtifacts(),Dv.openStack=Dv.openStack.filter((e=>e!==this))}_teardownBodyArtifacts(){const e=this._menuContainerRef;if(e)for(e.removeEventListener("click",this._onMenuClick),e.removeEventListener("mouseover",this._onMenuMouseOver),e.removeEventListener("mouseenter",this._onPanelEnter),e.removeEventListener("mouseleave",this._onPanelLeave),e.removeEventListener("nile-change",this._onNestedSelect);e.firstChild;)this.appendChild(e.firstChild);this._floatingPanelEl?.remove(),this._floatingPanelEl=void 0,this._menuContainerRef=null,this._setupDone=!1,this._proxyEl?.remove(),this._proxyEl=void 0}_ensureBodyPanel(){if(this._setupDone)return;const e=document.createElement("nile-floating-panel");e.setAttribute("for",this._proxyId),e.setAttribute("trigger","manual"),e.setAttribute("placement","right-start"),e.panelClass="nile-context-menu-panel",e.zIndex=this.zIndex,e.interactive=!0,e.hideOnClick=!1,e.closeOnEscape=!1,e.arrow="none",e.distance=0;const t=document.createElement("div");t.className="nile-context-menu__menu",t.setAttribute("role","menu"),e.appendChild(t),document.body.appendChild(e),this._floatingPanelEl=e,this._menuContainerRef=t,t.addEventListener("click",this._onMenuClick),t.addEventListener("mouseover",this._onMenuMouseOver),t.addEventListener("mouseenter",this._onPanelEnter),t.addEventListener("mouseleave",this._onPanelLeave),t.addEventListener("nile-change",this._onNestedSelect),this._relocateLightChildren(),this._setupDone=!0}firstUpdated(){this._relocateLightChildren()}_relocateLightChildren(){if(this._menuContainerRef)for(const e of Array.from(this.children))this._menuContainerRef.appendChild(e)}_clearTimers(){null!=this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=void 0),null!=this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=void 0)}openSubmenu(){this._open||this._parentItem?.disabled||(this._closeSiblingSubmenus(),this._ensureProxy(),this._ensureBodyPanel(),this._syncProxyToParent(),this._open=!0,this._floatingPanelEl&&(this._floatingPanelEl.addEventListener("nile-after-show",(()=>{this._open&&this._openPinnedDescendants()}),{once:!0}),this._floatingPanelEl.open=!0),Dv.openStack.push(this),window.addEventListener("scroll",this._onReposition,!0),window.addEventListener("resize",this._onReposition),requestAnimationFrame((()=>requestAnimationFrame((()=>{this._open&&this._openPinnedDescendants()})))),this._parentItem?.setSubmenuExpanded?.(!0))}_openPinnedDescendants(){if(!this._menuContainerRef)return;const e=Array.from(this._menuContainerRef.querySelectorAll(dv));for(const t of e){if(!this._isDirectChildItem(t))continue;if(!t.open||t.disabled)continue;const e=t.querySelector(`:scope > ${hv}`);e?.openSubmenu()}}_isDirectChildItem(e){let t=e.parentElement;for(;t&&t!==this._menuContainerRef;){if(t.tagName.toLowerCase()===hv)return!1;t=t.parentElement}return!0}closeSubmenu(){if(this._open){for(const e of[...Dv.openStack])e!==this&&this._menuContainerRef?.contains(e)&&e.closeSubmenu();this._open=!1,this._floatingPanelEl&&(this._floatingPanelEl.open=!1),window.removeEventListener("scroll",this._onReposition,!0),window.removeEventListener("resize",this._onReposition),Dv.openStack=Dv.openStack.filter((e=>e!==this)),this._clearTimers(),this._parentItem?.setSubmenuExpanded?.(!1)}}get isOpen(){return this._open}static findByContainer(e){for(const t of Dv.openStack)if(t._menuContainerRef===e)return t;return null}get parentItem(){return this._parentItem}focusFirstItem(){if(!this._menuContainerRef)return;const e=Array.from(this._menuContainerRef.querySelectorAll(dv));for(const t of e)if(this._isDirectChildItem(t)&&!t.disabled)return void t.focus()}_closeSiblingSubmenus(){const e=this._parentLevel();for(const t of[...Dv.openStack])t!==this&&(t._pinnedOpen||t._parentLevel()===e&&t.closeSubmenu())}_parentLevel(){const e=this._parentItem;return e?e.parentElement?.closest(".nile-context-menu__menu")??null:null}render(){return _``}};var zv;Iv.openStack=[],e([ue({attribute:!0,type:Number,reflect:!0})],Iv.prototype,"zIndex",void 0),e([De()],Iv.prototype,"_open",void 0),Iv=Dv=e([ge("nile-context-submenu")],Iv);const yv="nile-context-menu-item",pv="nile-context-submenu",Tv="nile-context-menu__menu",Av=["value","disabled"];let Ov=0,xv=zv=class extends Fe{constructor(){super(...arguments),this.for="",this.trigger="right",this.skipOn="",this.zIndex=9999,this.open=!1,this.items=[],this._items=[],this._open=!1,this._pinned=!1,this._openContext=null,this._targetEl=null,this._previouslyFocused=null,this._proxyId="nile-context-menu-anchor-"+ ++Ov,this._wasDataMode=!1,this._onPinnedReposition=()=>{if(!this._open||!this._pinned||!this._targetEl)return;const e=this._targetEl.getBoundingClientRect();this._positionProxyAt(e.left,e.bottom)},this._menuContainerRef=null,this._onKeydown=e=>{if(this._open)switch(e.key){case"Escape":return e.preventDefault(),void this.close("escape");case"Tab":return void this.close("programmatic");case"ArrowDown":return e.preventDefault(),void this._moveFocus(1);case"ArrowUp":return e.preventDefault(),void this._moveFocus(-1);case"ArrowRight":{const{item:t}=this._getFocusedItemAnyLevel(),i=t?.querySelector(`:scope > ${pv}`);if(!i)return;return e.preventDefault(),i.openSubmenu?.(),void requestAnimationFrame((()=>{i.focusFirstItem?.()}))}case"ArrowLeft":{const{item:t,container:i}=this._getFocusedItemAnyLevel();if(!t||!i)return;const n=this._findSubmenuOwning(i);if(!n)return;return e.preventDefault(),n.parentItem?.open||n.closeSubmenu?.(),void n.parentItem?.focus()}case"Enter":case" ":{e.preventDefault();const{item:t}=this._getFocusedItemAnyLevel();if(!t||t.disabled)return;const i=t.querySelector(`:scope > ${pv}`);return i?(i.openSubmenu?.(),void requestAnimationFrame((()=>{const e=i.shadowRoot?.querySelector(`.${Tv}`),t=e?this._enabledItemsIn(e)[0]:void 0;t?.focus()}))):void this._selectItem(t)}}},this._onScroll=e=>{if(!this._open)return;if(this._pinned)return void this._onPinnedReposition();const t=e.composedPath();if(!this._menuContainerRef||!t.includes(this._menuContainerRef)){for(const e of t)if(e instanceof HTMLElement&&e.classList?.contains(Tv))return;this.close("programmatic")}},this._onOutsidePointer=e=>{if(!this._open)return;const t=e.composedPath();if(!this._menuContainerRef||!t.includes(this._menuContainerRef)){for(const e of t)if(e instanceof HTMLElement&&e.classList?.contains(Tv))return;this.close("outside-click")}},this._onDescendantSelect=e=>{"click"===e.detail?.type&&this.close("select")},this._onPanelShown=e=>{e.stopPropagation(),this._openPinnedSubmenus()},this._onMenuMouseOver=e=>{const t=e.composedPath().find((e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===yv));t&&!t.disabled&&t.focus()},this._onMenuClick=e=>{const t=e.composedPath().find((e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===yv));t&&!t.disabled&&(t.querySelector(`:scope > ${pv}`)||this._selectItem(t))}}static get styles(){return[av]}get _isDataMode(){return Array.isArray(this.items)&&this.items.length>0}connectedCallback(){super.connectedCallback(),this._ensureProxy(),this._resolveTarget(),this._attachTriggers(),this._lightObserver=new MutationObserver((()=>{this._isDataMode||this._relocateLightChildren()})),this._lightObserver.observe(this,{childList:!0}),this.open&&!this._open&&this.updateComplete.then((()=>{this.isConnected&&this.open&&!this._open&&(this._pinned=!0,this._openAtTarget())}))}updated(e){super.updated(e),(e.has("for")||e.has("trigger")||e.has("skipOn"))&&this._open&&this.close("programmatic"),e.has("for")?(this._resolveTarget(),this._attachTriggers()):(e.has("trigger")||e.has("skipOn"))&&this._attachTriggers(),e.has("items")&&this._menuContainerRef&&(this._isDataMode?(this._renderDataItems(),this._wasDataMode=!0):this._wasDataMode&&(this._renderDataItems(),this._wasDataMode=!1)),e.has("open")&&(this.open&&!this._open?(this._pinned=!0,this._openAtTarget()):!this.open&&this._open&&this.close("programmatic"))}_openAtTarget(){const e=this._targetEl?.getBoundingClientRect();this.openAt({x:e?e.left:0,y:e?e.bottom:0,target:this._targetEl??void 0})}_resolveTarget(){const e=this.for?.trim();if(!e)return void(this._targetEl=null);const t=this.getRootNode()??document;/^[#.\[:]/.test(e)?this._targetEl=t.querySelector(e):this._targetEl="getElementById"in t?t.getElementById(e):document.getElementById(e)}get targetElement(){return this._targetEl}_attachTriggers(){this._detachTriggers?.(),this._detachTriggers=void 0;const e=this.trigger;if("manual"===e)return;const t=[];if("global"===e){const e=this.skipOn?.trim()??"",i=t=>!(!t||!e)&&!!t.closest(e),n=e=>{const t=e;i(t.target)||(t.preventDefault(),this._open||this.openAt({x:t.clientX,y:t.clientY,target:t.target??void 0,originalEvent:t}))};return window.addEventListener("contextmenu",n,!0),t.push((()=>window.removeEventListener("contextmenu",n,!0))),void(this._detachTriggers=()=>t.forEach((e=>e())))}const i=this._targetEl;if(!i)return;const n="left"===e||"both"===e;if("right"===e||"both"===e){const e=e=>{const t=e;t.preventDefault(),this.openAt({x:t.clientX,y:t.clientY,target:i,originalEvent:t})};i.addEventListener("contextmenu",e),t.push((()=>i.removeEventListener("contextmenu",e)))}if(n){const e=e=>{const t=e;this.openAt({x:t.clientX,y:t.clientY,target:i,originalEvent:t})};i.addEventListener("click",e),t.push((()=>i.removeEventListener("click",e)))}0!==t.length&&(this._detachTriggers=()=>t.forEach((e=>e())))}disconnectedCallback(){super.disconnectedCallback(),zv._openInstances.delete(this),this._open=!1,this._detachTriggers?.(),this._detachTriggers=void 0,this._lightObserver?.disconnect(),this._lightObserver=void 0,this._menuObserver?.disconnect(),this._menuObserver=void 0,this._menuContainerRef?.removeEventListener("click",this._onMenuClick),this._menuContainerRef?.removeEventListener("mouseover",this._onMenuMouseOver),this._menuContainerRef?.removeEventListener("nile-change",this._onDescendantSelect),document.removeEventListener("pointerdown",this._onOutsidePointer,!0),document.removeEventListener("keydown",this._onKeydown,!0),window.removeEventListener("scroll",this._onScroll,!0),window.removeEventListener("resize",this._onPinnedReposition),this._proxyEl?.remove(),this._proxyEl=void 0}firstUpdated(){this._menuContainerRef=this.renderRoot.querySelector(".nile-context-menu__menu"),this._isDataMode?(this._renderDataItems(),this._wasDataMode=!0):this._relocateLightChildren(),this._menuContainerRef&&(this._menuObserver=new MutationObserver((()=>this._parseChildren())),this._menuObserver.observe(this._menuContainerRef,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Av}),this._menuContainerRef.addEventListener("click",this._onMenuClick),this._menuContainerRef.addEventListener("mouseover",this._onMenuMouseOver),this._menuContainerRef.addEventListener("nile-change",this._onDescendantSelect)),this._parseChildren()}_ensureProxy(){if(this._proxyEl)return;const e=document.createElement("div");e.id=this._proxyId,e.setAttribute("aria-hidden","true"),e.style.cssText="position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none;",document.body.appendChild(e),this._proxyEl=e}_positionProxyAt(e,t){if(this._proxyEl){if(this._pinned&&this._targetEl){const e=this._targetEl.getBoundingClientRect();return this._proxyEl.style.position="absolute",this._proxyEl.style.left=`${e.left+window.scrollX}px`,this._proxyEl.style.top=`${e.top+window.scrollY}px`,this._proxyEl.style.width=`${e.width}px`,void(this._proxyEl.style.height=`${e.height}px`)}this._proxyEl.style.position="fixed",this._proxyEl.style.left=`${e}px`,this._proxyEl.style.top=`${t}px`,this._proxyEl.style.width="0",this._proxyEl.style.height="0"}}_relocateLightChildren(){if(!this._menuContainerRef)return;const e=Array.from(this.children);if(0!==e.length)for(const t of e)this._menuContainerRef.appendChild(t)}_renderDataItems(){const e=this._menuContainerRef;if(e){for(;e.firstChild;)e.removeChild(e.firstChild);for(const t of this.items){const i=this._createDataNode(t);i&&e.appendChild(i)}}}_createDataNode(e){if("group"===e.type){const t=document.createElement("nile-context-menu-group");e.name&&(t.label=e.name);for(const i of e.data??[])t.appendChild(this._createItemNode(i));return t}return null}_createItemNode(e){const t=document.createElement("nile-context-menu-item");if(e.id&&(t.id=e.id),t.value=e.value??e.id??"",e.disabled&&(t.disabled=!0),e.open&&(t.open=!0),e.icon){const i=document.createElement("nile-glyph");i.setAttribute("slot","icon"),i.setAttribute("name",e.icon),e.iconSet&&i.setAttribute("set",e.iconSet),e.iconSize&&i.setAttribute("size",e.iconSize),e.iconMethod&&i.setAttribute("method",e.iconMethod),e.iconColor&&i.setAttribute("color",e.iconColor),t.appendChild(i)}if(t.appendChild(document.createTextNode(e.label)),e.submenu&&e.submenu.length>0){const i=document.createElement("nile-context-submenu");for(const t of e.submenu){const e=this._createDataNode(t);e&&i.appendChild(e)}t.appendChild(i)}return t}_parseChildren(){const e=this._menuContainerRef??this,t=Array.from(e.querySelectorAll(yv));this._items=t.filter((t=>!this._isInsideDescendantSubmenu(t,e)))}_isInsideDescendantSubmenu(e,t){let i=e.parentElement;for(;i&&i!==t;){if(i.tagName.toLowerCase()===pv)return!0;i=i.parentElement}return!1}get menuItems(){return this._items}getItemByValue(e){return this._items.find((t=>t.value===e))}get isOpen(){return this._open}openAt(e){if(!this._open){for(const e of zv._openInstances)e!==this&&e.close("programmatic");this._previouslyFocused=document.activeElement,this._openContext={x:e.x,y:e.y,target:e.target??null,originalEvent:e.originalEvent??null},this._ensureProxy(),this._positionProxyAt(e.x,e.y),this._open=!0,this.open=!0,zv._openInstances.add(this),document.addEventListener("pointerdown",this._onOutsidePointer,!0),document.addEventListener("keydown",this._onKeydown,!0),this._pinned&&window.addEventListener("resize",this._onPinnedReposition),requestAnimationFrame((()=>{this._open&&window.addEventListener("scroll",this._onScroll,!0),requestAnimationFrame((()=>this._openPinnedSubmenus()))})),this.emit("nile-change",{type:"open",...this._openContext})}}close(e="programmatic"){if(!this._open)return;this._open=!1,this.open=!1,this._pinned=!1,this._openContext=null,zv._openInstances.delete(this);const t=this._menuContainerRef?.querySelectorAll(pv);t?.forEach((e=>e.closeSubmenu?.())),document.removeEventListener("pointerdown",this._onOutsidePointer,!0),document.removeEventListener("keydown",this._onKeydown,!0),window.removeEventListener("scroll",this._onScroll,!0),window.removeEventListener("resize",this._onPinnedReposition);const i=document.activeElement;(i===this||this._items.some((e=>e===i||e.shadowRoot?.contains(i))))&&this._previouslyFocused?.focus?.(),this._previouslyFocused=null,this.emit("nile-change",{type:"close",reason:e})}_enabledItems(){return this._items.filter((e=>!e.disabled))}_getFocusedItem(){const e=document.activeElement;for(const t of this._items)if(t===e||t.shadowRoot?.contains(e))return t;return null}_getFocusedItemAnyLevel(){let e=document.activeElement;for(;e&&e.tagName?.toLowerCase()!==yv;){const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:e.parentElement}if(!e)return{item:null,container:null};const t=e.closest(`.${Tv}`);return{item:e,container:t}}_enabledItemsIn(e){return Array.from(e.querySelectorAll(yv)).filter((t=>!t.disabled&&!this._isInsideDescendantSubmenu(t,e)))}_focusFirstEnabled(){const e=this._enabledItems();e[0]?.focus()}_moveFocus(e){const{item:t,container:i}=this._getFocusedItemAnyLevel(),n=i??this._menuContainerRef??this,o=this._enabledItemsIn(n);if(0===o.length)return;const M=t?o.indexOf(t):-1;o[((M+e)%o.length+o.length)%o.length].focus()}_findSubmenuOwning(e){const t=window.customElements.get(pv);return t?.findByContainer?.(e)??null}_stop(e){e.stopPropagation()}_openPinnedSubmenus(){if(this._open&&this._menuContainerRef)for(const e of this._items){if(!e.open||e.disabled)continue;const t=e.querySelector(`:scope > ${pv}`);t?.openSubmenu?.()}}_selectItem(e){const t={id:e.id,value:e.value,name:(e.textContent??"").trim(),target:this._openContext?.target??null,originalEvent:this._openContext?.originalEvent??null};try{e.onSelect?.(t)}catch(e){console.error("[nile-context-menu] onSelect callback threw:",e)}this.emit("nile-change",{type:"click",...t}),this.close("select")}render(){return _`
21234
+ `]}get _pinnedOpen(){return!(!this._parentItem?.open||this._parentItem.disabled)}connectedCallback(){super.connectedCallback();let e=this.parentElement;for(;e&&e.tagName.toLowerCase()!==hv;)e=e.parentElement;this._parentItem=e,this._ensureProxy(),this._parentItem&&(this._parentItem.setSubmenuExpanded?.(!1),this._parentItem.addEventListener("mouseenter",this._onParentEnter),this._parentItem.addEventListener("mouseleave",this._onParentLeave),this._parentItem.addEventListener("click",this._onParentClick,!0),this._parentObserver=new MutationObserver((()=>{this._pinnedOpen?this._isParentVisible()&&this.openSubmenu():this._open&&this.closeSubmenu()})),this._parentObserver.observe(this._parentItem,{attributes:!0,attributeFilter:["open"]})),this._ensureBodyPanel()}_isParentVisible(){const e=this._parentItem?.getBoundingClientRect();return!!e&&e.width>0&&e.height>0}_ensureProxy(){if(this._proxyEl)return;const e=document.createElement("div");e.id=this._proxyId,e.setAttribute("aria-hidden","true"),e.style.cssText="position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none;",document.body.appendChild(e),this._proxyEl=e}_syncProxyToParent(){if(!this._proxyEl||!this._parentItem)return;const e=this._parentItem.getBoundingClientRect();this._pinnedOpen?(this._proxyEl.style.position="absolute",this._proxyEl.style.left=`${e.left+window.scrollX}px`,this._proxyEl.style.top=`${e.top+window.scrollY}px`):(this._proxyEl.style.position="fixed",this._proxyEl.style.left=`${e.left}px`,this._proxyEl.style.top=`${e.top}px`),this._proxyEl.style.width=`${e.width}px`,this._proxyEl.style.height=`${e.height}px`}disconnectedCallback(){super.disconnectedCallback(),this._parentItem&&(this._parentItem.removeEventListener("mouseenter",this._onParentEnter),this._parentItem.removeEventListener("mouseleave",this._onParentLeave),this._parentItem.removeEventListener("click",this._onParentClick,!0)),this._parentObserver?.disconnect(),this._parentObserver=void 0,this._clearTimers(),this._open&&this.closeSubmenu(),this._teardownBodyArtifacts(),dv.openStack=dv.openStack.filter((e=>e!==this))}_teardownBodyArtifacts(){const e=this._menuContainerRef;if(e)for(e.removeEventListener("click",this._onMenuClick),e.removeEventListener("mouseover",this._onMenuMouseOver),e.removeEventListener("mouseenter",this._onPanelEnter),e.removeEventListener("mouseleave",this._onPanelLeave),e.removeEventListener("nile-change",this._onNestedSelect);e.firstChild;)this.appendChild(e.firstChild);this._floatingPanelEl?.remove(),this._floatingPanelEl=void 0,this._menuContainerRef=null,this._setupDone=!1,this._proxyEl?.remove(),this._proxyEl=void 0}_ensureBodyPanel(){if(this._setupDone)return;const e=document.createElement("nile-floating-panel");e.setAttribute("for",this._proxyId),e.setAttribute("trigger","manual"),e.setAttribute("placement","right-start"),e.panelClass="nile-context-menu-panel",e.zIndex=this.zIndex,e.interactive=!0,e.hideOnClick=!1,e.closeOnEscape=!1,e.arrow="none",e.distance=0;const t=document.createElement("div");t.className="nile-context-menu__menu",t.setAttribute("role","menu"),e.appendChild(t),document.body.appendChild(e),this._floatingPanelEl=e,this._menuContainerRef=t,t.addEventListener("click",this._onMenuClick),t.addEventListener("mouseover",this._onMenuMouseOver),t.addEventListener("mouseenter",this._onPanelEnter),t.addEventListener("mouseleave",this._onPanelLeave),t.addEventListener("nile-change",this._onNestedSelect),this._relocateLightChildren(),this._setupDone=!0}firstUpdated(){this._relocateLightChildren()}_relocateLightChildren(){if(this._menuContainerRef)for(const e of Array.from(this.children))this._menuContainerRef.appendChild(e)}_clearTimers(){null!=this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=void 0),null!=this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=void 0)}openSubmenu(){this._open||this._parentItem?.disabled||(this._closeSiblingSubmenus(),this._ensureProxy(),this._ensureBodyPanel(),this._syncProxyToParent(),this._open=!0,this._floatingPanelEl&&(this._floatingPanelEl.addEventListener("nile-after-show",(()=>{this._open&&this._openPinnedDescendants()}),{once:!0}),this._floatingPanelEl.open=!0),dv.openStack.push(this),window.addEventListener("scroll",this._onReposition,!0),window.addEventListener("resize",this._onReposition),requestAnimationFrame((()=>requestAnimationFrame((()=>{this._open&&this._openPinnedDescendants()})))),this._parentItem?.setSubmenuExpanded?.(!0))}_openPinnedDescendants(){if(!this._menuContainerRef)return;const e=Array.from(this._menuContainerRef.querySelectorAll(hv));for(const t of e){if(!this._isDirectChildItem(t))continue;if(!t.open||t.disabled)continue;const e=t.querySelector(`:scope > ${jv}`);e?.openSubmenu()}}_isDirectChildItem(e){let t=e.parentElement;for(;t&&t!==this._menuContainerRef;){if(t.tagName.toLowerCase()===jv)return!1;t=t.parentElement}return!0}closeSubmenu(){if(this._open){for(const e of[...dv.openStack])e!==this&&this._menuContainerRef?.contains(e)&&e.closeSubmenu();this._open=!1,this._floatingPanelEl&&(this._floatingPanelEl.open=!1),window.removeEventListener("scroll",this._onReposition,!0),window.removeEventListener("resize",this._onReposition),dv.openStack=dv.openStack.filter((e=>e!==this)),this._clearTimers(),this._parentItem?.setSubmenuExpanded?.(!1)}}get isOpen(){return this._open}static findByContainer(e){for(const t of dv.openStack)if(t._menuContainerRef===e)return t;return null}get parentItem(){return this._parentItem}focusFirstItem(){if(!this._menuContainerRef)return;const e=Array.from(this._menuContainerRef.querySelectorAll(hv));for(const t of e)if(this._isDirectChildItem(t)&&!t.disabled)return void t.focus()}_closeSiblingSubmenus(){const e=this._parentLevel();for(const t of[...dv.openStack])t!==this&&(t._pinnedOpen||t._parentLevel()===e&&t.closeSubmenu())}_parentLevel(){const e=this._parentItem;return e?e.parentElement?.closest(".nile-context-menu__menu")??null:null}render(){return _``}};var yv;zv.openStack=[],e([ue({attribute:!0,type:Number,reflect:!0})],zv.prototype,"zIndex",void 0),e([De()],zv.prototype,"_open",void 0),zv=dv=e([ge("nile-context-submenu")],zv);const pv="nile-context-menu-item",Tv="nile-context-submenu",Av="nile-context-menu__menu",Ov=["value","disabled"];let xv=0,Lv=yv=class extends Fe{constructor(){super(...arguments),this.for="",this.trigger="right",this.skipOn="",this.zIndex=9999,this.open=!1,this.items=[],this._items=[],this._open=!1,this._pinned=!1,this._openContext=null,this._targetEl=null,this._previouslyFocused=null,this._proxyId="nile-context-menu-anchor-"+ ++xv,this._wasDataMode=!1,this._onPinnedReposition=()=>{if(!this._open||!this._pinned||!this._targetEl)return;const e=this._targetEl.getBoundingClientRect();this._positionProxyAt(e.left,e.bottom)},this._menuContainerRef=null,this._onKeydown=e=>{if(this._open)switch(e.key){case"Escape":return e.preventDefault(),void this.close("escape");case"Tab":return void this.close("programmatic");case"ArrowDown":return e.preventDefault(),void this._moveFocus(1);case"ArrowUp":return e.preventDefault(),void this._moveFocus(-1);case"ArrowRight":{const{item:t}=this._getFocusedItemAnyLevel(),i=t?.querySelector(`:scope > ${Tv}`);if(!i)return;return e.preventDefault(),i.openSubmenu?.(),void requestAnimationFrame((()=>{i.focusFirstItem?.()}))}case"ArrowLeft":{const{item:t,container:i}=this._getFocusedItemAnyLevel();if(!t||!i)return;const n=this._findSubmenuOwning(i);if(!n)return;return e.preventDefault(),n.parentItem?.open||n.closeSubmenu?.(),void n.parentItem?.focus()}case"Enter":case" ":{e.preventDefault();const{item:t}=this._getFocusedItemAnyLevel();if(!t||t.disabled)return;const i=t.querySelector(`:scope > ${Tv}`);return i?(i.openSubmenu?.(),void requestAnimationFrame((()=>{const e=i.shadowRoot?.querySelector(`.${Av}`),t=e?this._enabledItemsIn(e)[0]:void 0;t?.focus()}))):void this._selectItem(t)}}},this._onScroll=e=>{if(!this._open)return;if(this._pinned)return void this._onPinnedReposition();const t=e.composedPath();if(!this._menuContainerRef||!t.includes(this._menuContainerRef)){for(const e of t)if(e instanceof HTMLElement&&e.classList?.contains(Av))return;this.close("programmatic")}},this._onOutsidePointer=e=>{if(!this._open)return;const t=e.composedPath();if(!this._menuContainerRef||!t.includes(this._menuContainerRef)){for(const e of t)if(e instanceof HTMLElement&&e.classList?.contains(Av))return;this.close("outside-click")}},this._onDescendantSelect=e=>{"click"===e.detail?.type&&this.close("select")},this._onPanelShown=e=>{e.stopPropagation(),this._openPinnedSubmenus()},this._onMenuMouseOver=e=>{const t=e.composedPath().find((e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===pv));t&&!t.disabled&&t.focus()},this._onMenuClick=e=>{const t=e.composedPath().find((e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===pv));t&&!t.disabled&&(t.querySelector(`:scope > ${Tv}`)||this._selectItem(t))}}static get styles(){return[lv]}get _isDataMode(){return Array.isArray(this.items)&&this.items.length>0}connectedCallback(){super.connectedCallback(),this._ensureProxy(),this._resolveTarget(),this._attachTriggers(),this._lightObserver=new MutationObserver((()=>{this._isDataMode||this._relocateLightChildren()})),this._lightObserver.observe(this,{childList:!0}),this.open&&!this._open&&this.updateComplete.then((()=>{this.isConnected&&this.open&&!this._open&&(this._pinned=!0,this._openAtTarget())}))}updated(e){super.updated(e),(e.has("for")||e.has("trigger")||e.has("skipOn"))&&this._open&&this.close("programmatic"),e.has("for")?(this._resolveTarget(),this._attachTriggers()):(e.has("trigger")||e.has("skipOn"))&&this._attachTriggers(),e.has("items")&&this._menuContainerRef&&(this._isDataMode?(this._renderDataItems(),this._wasDataMode=!0):this._wasDataMode&&(this._renderDataItems(),this._wasDataMode=!1)),e.has("open")&&(this.open&&!this._open?(this._pinned=!0,this._openAtTarget()):!this.open&&this._open&&this.close("programmatic"))}_openAtTarget(){const e=this._targetEl?.getBoundingClientRect();this.openAt({x:e?e.left:0,y:e?e.bottom:0,target:this._targetEl??void 0})}_resolveTarget(){const e=this.for?.trim();if(!e)return void(this._targetEl=null);const t=this.getRootNode()??document;/^[#.\[:]/.test(e)?this._targetEl=t.querySelector(e):this._targetEl="getElementById"in t?t.getElementById(e):document.getElementById(e)}get targetElement(){return this._targetEl}_attachTriggers(){this._detachTriggers?.(),this._detachTriggers=void 0;const e=this.trigger;if("manual"===e)return;const t=[];if("global"===e){const e=this.skipOn?.trim()??"",i=t=>!(!t||!e)&&!!t.closest(e),n=e=>{const t=e;i(t.target)||(t.preventDefault(),this._open||this.openAt({x:t.clientX,y:t.clientY,target:t.target??void 0,originalEvent:t}))};return window.addEventListener("contextmenu",n,!0),t.push((()=>window.removeEventListener("contextmenu",n,!0))),void(this._detachTriggers=()=>t.forEach((e=>e())))}const i=this._targetEl;if(!i)return;const n="left"===e||"both"===e;if("right"===e||"both"===e){const e=e=>{const t=e;t.preventDefault(),this.openAt({x:t.clientX,y:t.clientY,target:i,originalEvent:t})};i.addEventListener("contextmenu",e),t.push((()=>i.removeEventListener("contextmenu",e)))}if(n){const e=e=>{const t=e;this.openAt({x:t.clientX,y:t.clientY,target:i,originalEvent:t})};i.addEventListener("click",e),t.push((()=>i.removeEventListener("click",e)))}0!==t.length&&(this._detachTriggers=()=>t.forEach((e=>e())))}disconnectedCallback(){super.disconnectedCallback(),yv._openInstances.delete(this),this._open=!1,this._detachTriggers?.(),this._detachTriggers=void 0,this._lightObserver?.disconnect(),this._lightObserver=void 0,this._menuObserver?.disconnect(),this._menuObserver=void 0,this._menuContainerRef?.removeEventListener("click",this._onMenuClick),this._menuContainerRef?.removeEventListener("mouseover",this._onMenuMouseOver),this._menuContainerRef?.removeEventListener("nile-change",this._onDescendantSelect),document.removeEventListener("pointerdown",this._onOutsidePointer,!0),document.removeEventListener("keydown",this._onKeydown,!0),window.removeEventListener("scroll",this._onScroll,!0),window.removeEventListener("resize",this._onPinnedReposition),this._proxyEl?.remove(),this._proxyEl=void 0}firstUpdated(){this._menuContainerRef=this.renderRoot.querySelector(".nile-context-menu__menu"),this._isDataMode?(this._renderDataItems(),this._wasDataMode=!0):this._relocateLightChildren(),this._menuContainerRef&&(this._menuObserver=new MutationObserver((()=>this._parseChildren())),this._menuObserver.observe(this._menuContainerRef,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Ov}),this._menuContainerRef.addEventListener("click",this._onMenuClick),this._menuContainerRef.addEventListener("mouseover",this._onMenuMouseOver),this._menuContainerRef.addEventListener("nile-change",this._onDescendantSelect)),this._parseChildren()}_ensureProxy(){if(this._proxyEl)return;const e=document.createElement("div");e.id=this._proxyId,e.setAttribute("aria-hidden","true"),e.style.cssText="position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none;",document.body.appendChild(e),this._proxyEl=e}_positionProxyAt(e,t){if(this._proxyEl){if(this._pinned&&this._targetEl){const e=this._targetEl.getBoundingClientRect();return this._proxyEl.style.position="absolute",this._proxyEl.style.left=`${e.left+window.scrollX}px`,this._proxyEl.style.top=`${e.top+window.scrollY}px`,this._proxyEl.style.width=`${e.width}px`,void(this._proxyEl.style.height=`${e.height}px`)}this._proxyEl.style.position="fixed",this._proxyEl.style.left=`${e}px`,this._proxyEl.style.top=`${t}px`,this._proxyEl.style.width="0",this._proxyEl.style.height="0"}}_relocateLightChildren(){if(!this._menuContainerRef)return;const e=Array.from(this.children);if(0!==e.length)for(const t of e)this._menuContainerRef.appendChild(t)}_renderDataItems(){const e=this._menuContainerRef;if(e){for(;e.firstChild;)e.removeChild(e.firstChild);for(const t of this.items){const i=this._createDataNode(t);i&&e.appendChild(i)}}}_createDataNode(e){if("group"===e.type){const t=document.createElement("nile-context-menu-group");e.name&&(t.label=e.name);for(const i of e.data??[])t.appendChild(this._createItemNode(i));return t}return null}_createItemNode(e){const t=document.createElement("nile-context-menu-item");if(e.id&&(t.id=e.id),t.value=e.value??e.id??"",e.disabled&&(t.disabled=!0),e.open&&(t.open=!0),e.icon){const i=document.createElement("nile-glyph");i.setAttribute("slot","icon"),i.setAttribute("name",e.icon),e.iconSet&&i.setAttribute("set",e.iconSet),e.iconSize&&i.setAttribute("size",e.iconSize),e.iconMethod&&i.setAttribute("method",e.iconMethod),e.iconColor&&i.setAttribute("color",e.iconColor),t.appendChild(i)}if(t.appendChild(document.createTextNode(e.label)),e.submenu&&e.submenu.length>0){const i=document.createElement("nile-context-submenu");for(const t of e.submenu){const e=this._createDataNode(t);e&&i.appendChild(e)}t.appendChild(i)}return t}_parseChildren(){const e=this._menuContainerRef??this,t=Array.from(e.querySelectorAll(pv));this._items=t.filter((t=>!this._isInsideDescendantSubmenu(t,e)))}_isInsideDescendantSubmenu(e,t){let i=e.parentElement;for(;i&&i!==t;){if(i.tagName.toLowerCase()===Tv)return!0;i=i.parentElement}return!1}get menuItems(){return this._items}getItemByValue(e){return this._items.find((t=>t.value===e))}get isOpen(){return this._open}openAt(e){if(!this._open){for(const e of yv._openInstances)e!==this&&e.close("programmatic");this._previouslyFocused=document.activeElement,this._openContext={x:e.x,y:e.y,target:e.target??null,originalEvent:e.originalEvent??null},this._ensureProxy(),this._positionProxyAt(e.x,e.y),this._open=!0,this.open=!0,yv._openInstances.add(this),document.addEventListener("pointerdown",this._onOutsidePointer,!0),document.addEventListener("keydown",this._onKeydown,!0),this._pinned&&window.addEventListener("resize",this._onPinnedReposition),requestAnimationFrame((()=>{this._open&&window.addEventListener("scroll",this._onScroll,!0),requestAnimationFrame((()=>this._openPinnedSubmenus()))})),this.emit("nile-change",{type:"open",...this._openContext})}}close(e="programmatic"){if(!this._open)return;this._open=!1,this.open=!1,this._pinned=!1,this._openContext=null,yv._openInstances.delete(this);const t=this._menuContainerRef?.querySelectorAll(Tv);t?.forEach((e=>e.closeSubmenu?.())),document.removeEventListener("pointerdown",this._onOutsidePointer,!0),document.removeEventListener("keydown",this._onKeydown,!0),window.removeEventListener("scroll",this._onScroll,!0),window.removeEventListener("resize",this._onPinnedReposition);const i=document.activeElement;(i===this||this._items.some((e=>e===i||e.shadowRoot?.contains(i))))&&this._previouslyFocused?.focus?.(),this._previouslyFocused=null,this.emit("nile-change",{type:"close",reason:e})}_enabledItems(){return this._items.filter((e=>!e.disabled))}_getFocusedItem(){const e=document.activeElement;for(const t of this._items)if(t===e||t.shadowRoot?.contains(e))return t;return null}_getFocusedItemAnyLevel(){let e=document.activeElement;for(;e&&e.tagName?.toLowerCase()!==pv;){const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:e.parentElement}if(!e)return{item:null,container:null};const t=e.closest(`.${Av}`);return{item:e,container:t}}_enabledItemsIn(e){return Array.from(e.querySelectorAll(pv)).filter((t=>!t.disabled&&!this._isInsideDescendantSubmenu(t,e)))}_focusFirstEnabled(){const e=this._enabledItems();e[0]?.focus()}_moveFocus(e){const{item:t,container:i}=this._getFocusedItemAnyLevel(),n=i??this._menuContainerRef??this,o=this._enabledItemsIn(n);if(0===o.length)return;const M=t?o.indexOf(t):-1;o[((M+e)%o.length+o.length)%o.length].focus()}_findSubmenuOwning(e){const t=window.customElements.get(Tv);return t?.findByContainer?.(e)??null}_stop(e){e.stopPropagation()}_openPinnedSubmenus(){if(this._open&&this._menuContainerRef)for(const e of this._items){if(!e.open||e.disabled)continue;const t=e.querySelector(`:scope > ${Tv}`);t?.openSubmenu?.()}}_selectItem(e){const t={id:e.id,value:e.value,name:(e.textContent??"").trim(),target:this._openContext?.target??null,originalEvent:this._openContext?.originalEvent??null};try{e.onSelect?.(t)}catch(e){console.error("[nile-context-menu] onSelect callback threw:",e)}this.emit("nile-change",{type:"click",...t}),this.close("select")}render(){return _`
21086
21235
  <nile-floating-panel
21087
21236
  for=${this._proxyId}
21088
21237
  trigger="manual"
@@ -21106,7 +21255,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
21106
21255
  >
21107
21256
  <div class="nile-context-menu__menu" role="menu"></div>
21108
21257
  </nile-floating-panel>
21109
- `}};xv._openInstances=new Set,e([ue({attribute:!0,type:String,reflect:!0})],xv.prototype,"for",void 0),e([ue({attribute:!0,type:String,reflect:!0})],xv.prototype,"trigger",void 0),e([ue({attribute:!0,type:String,reflect:!0})],xv.prototype,"skipOn",void 0),e([ue({attribute:!0,type:Number,reflect:!0})],xv.prototype,"zIndex",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],xv.prototype,"open",void 0),e([ue({attribute:!1})],xv.prototype,"items",void 0),e([he("nile-floating-panel")],xv.prototype,"_floatingPanel",void 0),e([De()],xv.prototype,"_items",void 0),e([De()],xv.prototype,"_open",void 0),xv=zv=e([ge("nile-context-menu")],xv);const Lv=r`
21258
+ `}};Lv._openInstances=new Set,e([ue({attribute:!0,type:String,reflect:!0})],Lv.prototype,"for",void 0),e([ue({attribute:!0,type:String,reflect:!0})],Lv.prototype,"trigger",void 0),e([ue({attribute:!0,type:String,reflect:!0})],Lv.prototype,"skipOn",void 0),e([ue({attribute:!0,type:Number,reflect:!0})],Lv.prototype,"zIndex",void 0),e([ue({attribute:!0,type:Boolean,reflect:!0})],Lv.prototype,"open",void 0),e([ue({attribute:!1})],Lv.prototype,"items",void 0),e([he("nile-floating-panel")],Lv.prototype,"_floatingPanel",void 0),e([De()],Lv.prototype,"_items",void 0),e([De()],Lv.prototype,"_open",void 0),Lv=yv=e([ge("nile-context-menu")],Lv);const mv=r`
21110
21259
  :host {
21111
21260
  font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));
21112
21261
  }
@@ -21133,7 +21282,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
21133
21282
  :host([disabled]) .item-header .body-content .header-text {
21134
21283
  color: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled));
21135
21284
  }
21136
- `;let mv=class extends Fe{constructor(){super(...arguments),this.active=!1,this.disabled=!1}static get styles(){return[Lv]}render(){return _`
21285
+ `;let Sv=class extends Fe{constructor(){super(...arguments),this.active=!1,this.disabled=!1}static get styles(){return[mv]}render(){return _`
21137
21286
  <div class="item-header" part="item-header">
21138
21287
  <div class="prefix-content" part="prefix-content">
21139
21288
  <slot name="prefix"></slot>
@@ -21148,7 +21297,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
21148
21297
  <slot name="suffix"></slot>
21149
21298
  </div>
21150
21299
  </div>
21151
- `}};e([ue({type:Boolean,reflect:!0,attribute:!0})],mv.prototype,"active",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],mv.prototype,"disabled",void 0),mv=e([ge("nile-inline-sidebar-item-header")],mv);const Sv=r`
21300
+ `}};e([ue({type:Boolean,reflect:!0,attribute:!0})],Sv.prototype,"active",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],Sv.prototype,"disabled",void 0),Sv=e([ge("nile-inline-sidebar-item-header")],Sv);const wv=r`
21152
21301
  :host {
21153
21302
  display: block;
21154
21303
  min-width: 0;
@@ -21200,7 +21349,7 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
21200
21349
  :host([disabled]) .body-content {
21201
21350
  color: var(--nile-colors-neutral-300, var(--ng-colors-text-disabled));
21202
21351
  }
21203
- `;let wv=class extends Fe{constructor(){super(...arguments),this.lines=2,this.content="",this.showTooltip=!1,this.isTruncated=!1,this.disabled=!1,this.active=!1}static get styles(){return[Sv]}firstUpdated(){this.checkTruncation(),this.bodyContentEl&&(this.resizeObserver=new ResizeObserver((()=>this.checkTruncation())),this.resizeObserver.observe(this.bodyContentEl))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}checkTruncation(){if(this.bodyContentEl){const e=this.bodyContentEl.scrollHeight>this.bodyContentEl.clientHeight;e!==this.isTruncated&&(this.isTruncated=e)}}get contentTemplate(){const e=_`<div class="body-text" part="body-text">${this.content}</div>`;return this.isTruncated&&this.showTooltip?_`<nile-lite-tooltip content=${this.content} hoist>${e}</nile-lite-tooltip>`:e}render(){return _`
21352
+ `;let Ev=class extends Fe{constructor(){super(...arguments),this.lines=2,this.content="",this.showTooltip=!1,this.isTruncated=!1,this.disabled=!1,this.active=!1}static get styles(){return[wv]}firstUpdated(){this.checkTruncation(),this.bodyContentEl&&(this.resizeObserver=new ResizeObserver((()=>this.checkTruncation())),this.resizeObserver.observe(this.bodyContentEl))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}checkTruncation(){if(this.bodyContentEl){const e=this.bodyContentEl.scrollHeight>this.bodyContentEl.clientHeight;e!==this.isTruncated&&(this.isTruncated=e)}}get contentTemplate(){const e=_`<div class="body-text" part="body-text">${this.content}</div>`;return this.isTruncated&&this.showTooltip?_`<nile-lite-tooltip content=${this.content} hoist>${e}</nile-lite-tooltip>`:e}render(){return _`
21204
21353
  <div class="item-body" part="item-body">
21205
21354
  <div class="prefix-content" part="prefix-content">
21206
21355
  <slot name="prefix"></slot>
@@ -21212,20 +21361,20 @@ const Xk="important",qk=" !"+Xk,Kk=Ae(class extends Oe{constructor(e){if(super(e
21212
21361
  <slot name="suffix"></slot>
21213
21362
  </div>
21214
21363
  </div>
21215
- `}};e([ue({type:Number,reflect:!0})],wv.prototype,"lines",void 0),e([ue({type:String,reflect:!0})],wv.prototype,"content",void 0),e([ue({type:Boolean,reflect:!0})],wv.prototype,"showTooltip",void 0),e([De()],wv.prototype,"isTruncated",void 0),e([he(".body-content")],wv.prototype,"bodyContentEl",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],wv.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],wv.prototype,"active",void 0),wv=e([ge("nile-inline-sidebar-item-body")],wv);
21364
+ `}};e([ue({type:Number,reflect:!0})],Ev.prototype,"lines",void 0),e([ue({type:String,reflect:!0})],Ev.prototype,"content",void 0),e([ue({type:Boolean,reflect:!0})],Ev.prototype,"showTooltip",void 0),e([De()],Ev.prototype,"isTruncated",void 0),e([he(".body-content")],Ev.prototype,"bodyContentEl",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],Ev.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0,attribute:!0})],Ev.prototype,"active",void 0),Ev=e([ge("nile-inline-sidebar-item-body")],Ev);
21216
21365
  /**
21217
21366
  * @license
21218
21367
  * Copyright 2021 Google LLC
21219
21368
  * SPDX-License-Identifier: BSD-3-Clause
21220
21369
  */
21221
- class Ev{constructor(e){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===e?.roundAverageSize&&(this._roundAverageSize=!0)}set(e,t){const i=this._map.get(e)||0;this._map.set(e,t),this.totalSize+=t-i}get averageSize(){if(this._map.size>0){const e=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(e):e}return 0}getSize(e){return this._map.get(e)}clear(){this._map.clear(),this.totalSize=0}}
21370
+ class bv{constructor(e){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===e?.roundAverageSize&&(this._roundAverageSize=!0)}set(e,t){const i=this._map.get(e)||0;this._map.set(e,t),this.totalSize+=t-i}get averageSize(){if(this._map.size>0){const e=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(e):e}return 0}getSize(e){return this._map.get(e)}clear(){this._map.clear(),this.totalSize=0}}
21222
21371
  /**
21223
21372
  * @license
21224
21373
  * Copyright 2021 Google LLC
21225
21374
  * SPDX-License-Identifier: BSD-3-Clause
21226
- */function bv(e){return"horizontal"===e?"width":"height"}class kv{_getDefaultConfig(){return{direction:"vertical"}}constructor(e,t){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=e,Promise.resolve().then((()=>this.config=t||this._getDefaultConfig()))}set config(e){Object.assign(this,Object.assign({},this._getDefaultConfig(),e))}get config(){return{direction:this.direction}}get items(){return this._items}set items(e){this._setItems(e)}_setItems(e){e!==this._items&&(this._items=e,this._scheduleReflow())}get direction(){return this._direction}set direction(e){(e="horizontal"===e?e:"vertical")!==this._direction&&(this._direction=e,this._sizeDim="horizontal"===e?"width":"height",this._secondarySizeDim="horizontal"===e?"height":"width",this._positionDim="horizontal"===e?"left":"top",this._secondaryPositionDim="horizontal"===e?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(e){const{_viewDim1:t,_viewDim2:i}=this;Object.assign(this._viewportSize,e),i!==this._viewDim2?this._scheduleLayoutUpdate():t!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(e){Object.assign(this._latestCoords,e);const t=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(t-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(e=!1){(e||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(e){this._pin=e,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:e,block:t}=this._pin;return{index:Math.max(0,Math.min(e,this.items.length-1)),block:t}}return null}_clampScrollPosition(e){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(e,this.totalScrollSize[bv(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const e=this._scrollPosition,{index:t,block:i}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:t,block:i||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=e-this._scrollPosition}}_calculateScrollIntoViewPosition(e){const{block:t}=e,i=Math.min(this.items.length,Math.max(0,e.index)),n=this._getItemPosition(i)[this._positionDim];let o=n;if("start"!==t){const e=this._getItemSize(i)[this._sizeDim];if("center"===t)o=n-.5*this._viewDim1+.5*e;else{const i=n-this._viewDim1+e;if("end"===t)o=i;else{const e=this._scrollPosition;o=Math.abs(e-n)<Math.abs(e-i)?n:i}}}return o+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(o)}getScrollIntoViewCoordinates(e){return{[this._positionDim]:this._calculateScrollIntoViewPosition(e)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const e=new Map;if(-1!==this._first&&-1!==this._last)for(let t=this._first;t<=this._last;t++)e.set(t,this._getItemPosition(t));const t={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:e};this._scrollError&&(t.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(t)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const e=Math.max(0,this._scrollPosition-this._overhang),t=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>e||this._physicalMax<t?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(e){if(-1===this._first||-1===this._last)return;let t=this._first;for(;t<this._last&&Math.round(this._getItemPosition(t)[this._positionDim]+this._getItemSize(t)[this._sizeDim])<=Math.round(this._scrollPosition);)t++;let i=this._last;for(;i>this._first&&Math.round(this._getItemPosition(i)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)i--;t===this._firstVisible&&i===this._lastVisible||(this._firstVisible=t,this._lastVisible=i,e&&e.emit&&this._sendVisibilityChangedMessage())}}
21375
+ */function kv(e){return"horizontal"===e?"width":"height"}class vv{_getDefaultConfig(){return{direction:"vertical"}}constructor(e,t){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=e,Promise.resolve().then((()=>this.config=t||this._getDefaultConfig()))}set config(e){Object.assign(this,Object.assign({},this._getDefaultConfig(),e))}get config(){return{direction:this.direction}}get items(){return this._items}set items(e){this._setItems(e)}_setItems(e){e!==this._items&&(this._items=e,this._scheduleReflow())}get direction(){return this._direction}set direction(e){(e="horizontal"===e?e:"vertical")!==this._direction&&(this._direction=e,this._sizeDim="horizontal"===e?"width":"height",this._secondarySizeDim="horizontal"===e?"height":"width",this._positionDim="horizontal"===e?"left":"top",this._secondaryPositionDim="horizontal"===e?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(e){const{_viewDim1:t,_viewDim2:i}=this;Object.assign(this._viewportSize,e),i!==this._viewDim2?this._scheduleLayoutUpdate():t!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(e){Object.assign(this._latestCoords,e);const t=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(t-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(e=!1){(e||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(e){this._pin=e,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:e,block:t}=this._pin;return{index:Math.max(0,Math.min(e,this.items.length-1)),block:t}}return null}_clampScrollPosition(e){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(e,this.totalScrollSize[kv(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const e=this._scrollPosition,{index:t,block:i}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:t,block:i||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=e-this._scrollPosition}}_calculateScrollIntoViewPosition(e){const{block:t}=e,i=Math.min(this.items.length,Math.max(0,e.index)),n=this._getItemPosition(i)[this._positionDim];let o=n;if("start"!==t){const e=this._getItemSize(i)[this._sizeDim];if("center"===t)o=n-.5*this._viewDim1+.5*e;else{const i=n-this._viewDim1+e;if("end"===t)o=i;else{const e=this._scrollPosition;o=Math.abs(e-n)<Math.abs(e-i)?n:i}}}return o+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(o)}getScrollIntoViewCoordinates(e){return{[this._positionDim]:this._calculateScrollIntoViewPosition(e)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const e=new Map;if(-1!==this._first&&-1!==this._last)for(let t=this._first;t<=this._last;t++)e.set(t,this._getItemPosition(t));const t={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:e};this._scrollError&&(t.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(t)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const e=Math.max(0,this._scrollPosition-this._overhang),t=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>e||this._physicalMax<t?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(e){if(-1===this._first||-1===this._last)return;let t=this._first;for(;t<this._last&&Math.round(this._getItemPosition(t)[this._positionDim]+this._getItemSize(t)[this._sizeDim])<=Math.round(this._scrollPosition);)t++;let i=this._last;for(;i>this._first&&Math.round(this._getItemPosition(i)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)i--;t===this._firstVisible&&i===this._lastVisible||(this._firstVisible=t,this._lastVisible=i,e&&e.emit&&this._sendVisibilityChangedMessage())}}
21227
21376
  /**
21228
21377
  * @license
21229
21378
  * Copyright 2021 Google LLC
21230
21379
  * SPDX-License-Identifier: BSD-3-Clause
21231
- */function vv(e){return"horizontal"===e?"marginLeft":"marginTop"}function fv(e){return"horizontal"===e?"marginRight":"marginBottom"}function Qv(e){return"horizontal"===e?"xOffset":"yOffset"}function Cv(e,t){const i=[e,t].sort();return i[1]<=0?Math.min(...i):i[0]>=0?Math.max(...i):i[0]+i[1]}class Uv{constructor(){this._childSizeCache=new Ev,this._marginSizeCache=new Ev,this._metricsCache=new Map}update(e,t){const i=new Set;Object.keys(e).forEach((n=>{const o=Number(n);this._metricsCache.set(o,e[o]),this._childSizeCache.set(o,e[o][bv(t)]),i.add(o),i.add(o+1)}));for(const e of i){const i=this._metricsCache.get(e)?.[vv(t)]||0,n=this._metricsCache.get(e-1)?.[fv(t)]||0;this._marginSizeCache.set(e,Cv(i,n))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(e,t){return this._metricsCache.get(e)?.[vv(t)]||0}getChildSize(e){return this._childSizeCache.getSize(e)}getMarginSize(e){return this._marginSizeCache.getSize(e)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var Yv=Object.freeze({__proto__:null,FlowLayout:class extends kv{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Uv,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(e){this._metricsCache.update(e,this.direction),this._scheduleReflow()}_getPhysicalItem(e){return this._newPhysicalItems.get(e)??this._physicalItems.get(e)}_getSize(e){return this._getPhysicalItem(e)&&this._metricsCache.getChildSize(e)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(e){const t=this._metricsCache;if(-1===this._first||-1===this._last)return t.averageMarginSize+e*(t.averageMarginSize+this._getAverageSize());if(e<this._first){const i=this._first-e;return this._getPhysicalItem(this._first).pos-(t.getMarginSize(this._first-1)||t.averageMarginSize)-(i*t.averageChildSize+(i-1)*t.averageMarginSize)}{const i=e-this._last;return this._getPhysicalItem(this._last).pos+(t.getChildSize(this._last)||t.averageChildSize)+(t.getMarginSize(this._last)||t.averageMarginSize)+i*(t.averageChildSize+t.averageMarginSize)}}_getPosition(e){const t=this._getPhysicalItem(e),{averageMarginSize:i}=this._metricsCache;return 0===e?this._metricsCache.getMarginSize(0)??i:t?t.pos:this._estimatePosition(e)}_calculateAnchor(e,t){return e<=0?0:t>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((e+t)/2/this._delta)))}_getAnchor(e,t){if(0===this._physicalItems.size)return this._calculateAnchor(e,t);if(this._first<0)return this._calculateAnchor(e,t);if(this._last<0)return this._calculateAnchor(e,t);const i=this._getPhysicalItem(this._first),n=this._getPhysicalItem(this._last),o=i.pos;if(n.pos+this._metricsCache.getChildSize(this._last)<e)return this._calculateAnchor(e,t);if(o>t)return this._calculateAnchor(e,t);let M=this._firstVisible-1,r=-1/0;for(;r<e;){r=this._getPhysicalItem(++M).pos+this._metricsCache.getChildSize(M)}return M}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const e=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e,this._stable=!0}_getItems(){const e=this._newPhysicalItems;let t,i;if(this._stable=!0,null!==this.pin){const{index:e}=this.pin;this._anchorIdx=e,this._anchorPos=this._getPosition(e)}if(t=this._scrollPosition-this._overhang,i=this._scrollPosition+this._viewDim1+this._overhang,i<0||t>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(t,i),this._anchorPos=this._getPosition(this._anchorIdx));let n=this._getSize(this._anchorIdx);void 0===n&&(this._stable=!1,n=this._getAverageSize());const o=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,M=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=o),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-M-n);let r=0;for(this._anchorPos+n+M<t&&(r=t-(this._anchorPos+n+M)),this._anchorPos-o>i&&(r=i-(this._anchorPos-o)),r&&(this._scrollPosition-=r,t-=r,i-=r,this._scrollError+=r),e.set(this._anchorIdx,{pos:this._anchorPos,size:n}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-o,this._physicalMax=this._anchorPos+n+M;this._physicalMin>t&&this._first>0;){let t=this._getSize(--this._first);void 0===t&&(this._stable=!1,t=this._getAverageSize());let i=this._metricsCache.getMarginSize(this._first);void 0===i&&(this._stable=!1,i=this._metricsCache.averageMarginSize),this._physicalMin-=t;const n=this._physicalMin;if(e.set(this._first,{pos:n,size:t}),this._physicalMin-=i,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<i&&this._last<this.items.length-1;){let t=this._getSize(++this._last);void 0===t&&(this._stable=!1,t=this._getAverageSize());let i=this._metricsCache.getMarginSize(this._last);void 0===i&&(this._stable=!1,i=this._metricsCache.averageMarginSize);const n=this._physicalMax;if(e.set(this._last,{pos:n,size:t}),this._physicalMax+=t+i,!this._stable&&!this._estimate)break}const s=this._calculateError();s&&(this._physicalMin-=s,this._physicalMax-=s,this._anchorPos-=s,this._scrollPosition-=s,e.forEach((e=>e.pos-=s)),this._scrollError+=s),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:e,_last:t}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===e&&this._last===t)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:e}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(e+this._getAverageSize())+e)}get _delta(){const{averageMarginSize:e}=this._metricsCache;return this._getAverageSize()+e}_getItemPosition(e){return{[this._positionDim]:this._getPosition(e),[this._secondaryPositionDim]:0,[Qv(this.direction)]:-(this._metricsCache.getLeadingMarginValue(e,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(e){return{[this._sizeDim]:this._getSize(e)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});export{kL as NileAccordion,Vo as NileAutoComplete,Kx as NileAvatar,kt as NileBadge,Dx as NileBreadcrumb,hx as NileBreadcrumbItem,Xe as NileButton,fx as NileButtonFilter,YM as NileButtonToggle,VM as NileButtonToggleGroup,kM as NileCalendar,yx as NileCard,Lx as NileCarousel,Tx as NileCarouselItem,oi as NileCheckbox,ri as NileCheckboxGroup,pM as NileChip,Cx as NileCircularProgressbar,ax as NileCodeEditor,$S as NileColorPicker,XS as NileColorSwatch,zM as NileCombobox,HM as NileContentEditor,xv as NileContextMenu,Nv as NileContextMenuGroup,uv as NileContextMenuItem,mM as NileDatePicker,yk as NileDetail,JM as NileDialog,fL as NileDivider,ii as NileDrawer,fo as NileDropdown,nL as NileEmptyState,wM as NileErrorMessage,qM as NileErrorNotification,Wm as NileFilePreview,mm as NileFileUpload,JL as NileFilterChip,sv as NileFloatingPanel,At as NileFormErrorMessage,Ix as NileFormGroup,pt as NileFormHelpText,dL as NileFormatDate,gS as NileGrid,cS as NileGridBody,IS as NileGridCellItem,yS as NileGridHead,hS as NileGridHeadItem,DS as NileGridRow,qe as NileHeading,ML as NileHero,NL as NileHeroHeader,ke as NileIcon,wt as NileIconButton,BL as NileInlineEdit,vw as NileInlineSidebar,bw as NileInlineSidebarGroup,Qw as NileInlineSidebarItem,wv as NileInlineSidebarItemBody,mv as NileInlineSidebarItemHeader,Uw as NileInlineSidebarPanel,Zw as NileInlineSidebarPanelGroup,gt as NileInput,QM as NileLink,EL as NileList,SL as NileListItem,kn as NileLoader,Lt as NileMenu,So as NileMenuItem,Jk as NileNavTab,tv as NileNavTabGroup,ov as NileNavTabPanel,Lo as NileOption,Rm as NileOptionGroup,Ot as NileOtpInput,tL as NilePageHeader,KL as NilePagination,kx as NilePopover,xn as NilePopup,fn as NileProgressBar,Fk as NileQrCode,ai as NileRadio,gi as NileRadioGroup,RS as NileRichTextEditor,YL as NileSectionMessage,Oo as NileSelect,KS as NileSideBar,Aw as NileSideBarAction,ww as NileSideBarActionMenu,mw as NileSideBarActionMenuItem,Mw as NileSideBarExpand,dw as NileSideBarFooter,jw as NileSideBarFooterItem,xw as NileSideBarFooterText,sw as NileSideBarGroup,lw as NileSideBarGroupItem,Nw as NileSideBarGroupItemIcon,uw as NileSideBarGroupItemText,tw as NileSideBarHeader,nw as NileSideBarLogo,dk as NileSideBarPanel,Yn as NileSkeletonLoader,En as NileSlideToggle,rm as NileSlider,Cn as NileSpinner,IL as NileSplitPanel,ft as NileStatusLight,lL as NileStepper,sL as NileStepperItem,GM as NileSwitcher,nr as NileTab,er as NileTabGroup,rr as NileTabPanel,FL as NileTable,$x as NileTableBody,Bx as NileTableCellItem,Xx as NileTableHeaderItem,Fx as NileTableRow,Pn as NileTag,AM as NileTextarea,CL as NileTitle,cx as NileToast,VL as NileToolbar,Sn as NileTooltip,LL as NileTree,AL as NileTreeItem,uL as NileVerticalStepperItem,po as NileVirtualSelect,uk as NileliteTooltip};
21380
+ */function fv(e){return"horizontal"===e?"marginLeft":"marginTop"}function Qv(e){return"horizontal"===e?"marginRight":"marginBottom"}function Cv(e){return"horizontal"===e?"xOffset":"yOffset"}function Uv(e,t){const i=[e,t].sort();return i[1]<=0?Math.min(...i):i[0]>=0?Math.max(...i):i[0]+i[1]}class Yv{constructor(){this._childSizeCache=new bv,this._marginSizeCache=new bv,this._metricsCache=new Map}update(e,t){const i=new Set;Object.keys(e).forEach((n=>{const o=Number(n);this._metricsCache.set(o,e[o]),this._childSizeCache.set(o,e[o][kv(t)]),i.add(o),i.add(o+1)}));for(const e of i){const i=this._metricsCache.get(e)?.[fv(t)]||0,n=this._metricsCache.get(e-1)?.[Qv(t)]||0;this._marginSizeCache.set(e,Uv(i,n))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(e,t){return this._metricsCache.get(e)?.[fv(t)]||0}getChildSize(e){return this._childSizeCache.getSize(e)}getMarginSize(e){return this._marginSizeCache.getSize(e)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var Zv=Object.freeze({__proto__:null,FlowLayout:class extends vv{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Yv,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(e){this._metricsCache.update(e,this.direction),this._scheduleReflow()}_getPhysicalItem(e){return this._newPhysicalItems.get(e)??this._physicalItems.get(e)}_getSize(e){return this._getPhysicalItem(e)&&this._metricsCache.getChildSize(e)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(e){const t=this._metricsCache;if(-1===this._first||-1===this._last)return t.averageMarginSize+e*(t.averageMarginSize+this._getAverageSize());if(e<this._first){const i=this._first-e;return this._getPhysicalItem(this._first).pos-(t.getMarginSize(this._first-1)||t.averageMarginSize)-(i*t.averageChildSize+(i-1)*t.averageMarginSize)}{const i=e-this._last;return this._getPhysicalItem(this._last).pos+(t.getChildSize(this._last)||t.averageChildSize)+(t.getMarginSize(this._last)||t.averageMarginSize)+i*(t.averageChildSize+t.averageMarginSize)}}_getPosition(e){const t=this._getPhysicalItem(e),{averageMarginSize:i}=this._metricsCache;return 0===e?this._metricsCache.getMarginSize(0)??i:t?t.pos:this._estimatePosition(e)}_calculateAnchor(e,t){return e<=0?0:t>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((e+t)/2/this._delta)))}_getAnchor(e,t){if(0===this._physicalItems.size)return this._calculateAnchor(e,t);if(this._first<0)return this._calculateAnchor(e,t);if(this._last<0)return this._calculateAnchor(e,t);const i=this._getPhysicalItem(this._first),n=this._getPhysicalItem(this._last),o=i.pos;if(n.pos+this._metricsCache.getChildSize(this._last)<e)return this._calculateAnchor(e,t);if(o>t)return this._calculateAnchor(e,t);let M=this._firstVisible-1,r=-1/0;for(;r<e;){r=this._getPhysicalItem(++M).pos+this._metricsCache.getChildSize(M)}return M}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const e=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e,this._stable=!0}_getItems(){const e=this._newPhysicalItems;let t,i;if(this._stable=!0,null!==this.pin){const{index:e}=this.pin;this._anchorIdx=e,this._anchorPos=this._getPosition(e)}if(t=this._scrollPosition-this._overhang,i=this._scrollPosition+this._viewDim1+this._overhang,i<0||t>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(t,i),this._anchorPos=this._getPosition(this._anchorIdx));let n=this._getSize(this._anchorIdx);void 0===n&&(this._stable=!1,n=this._getAverageSize());const o=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,M=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=o),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-M-n);let r=0;for(this._anchorPos+n+M<t&&(r=t-(this._anchorPos+n+M)),this._anchorPos-o>i&&(r=i-(this._anchorPos-o)),r&&(this._scrollPosition-=r,t-=r,i-=r,this._scrollError+=r),e.set(this._anchorIdx,{pos:this._anchorPos,size:n}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-o,this._physicalMax=this._anchorPos+n+M;this._physicalMin>t&&this._first>0;){let t=this._getSize(--this._first);void 0===t&&(this._stable=!1,t=this._getAverageSize());let i=this._metricsCache.getMarginSize(this._first);void 0===i&&(this._stable=!1,i=this._metricsCache.averageMarginSize),this._physicalMin-=t;const n=this._physicalMin;if(e.set(this._first,{pos:n,size:t}),this._physicalMin-=i,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<i&&this._last<this.items.length-1;){let t=this._getSize(++this._last);void 0===t&&(this._stable=!1,t=this._getAverageSize());let i=this._metricsCache.getMarginSize(this._last);void 0===i&&(this._stable=!1,i=this._metricsCache.averageMarginSize);const n=this._physicalMax;if(e.set(this._last,{pos:n,size:t}),this._physicalMax+=t+i,!this._stable&&!this._estimate)break}const s=this._calculateError();s&&(this._physicalMin-=s,this._physicalMax-=s,this._anchorPos-=s,this._scrollPosition-=s,e.forEach((e=>e.pos-=s)),this._scrollError+=s),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:e,_last:t}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===e&&this._last===t)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:e}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(e+this._getAverageSize())+e)}get _delta(){const{averageMarginSize:e}=this._metricsCache;return this._getAverageSize()+e}_getItemPosition(e){return{[this._positionDim]:this._getPosition(e),[this._secondaryPositionDim]:0,[Cv(this.direction)]:-(this._metricsCache.getLeadingMarginValue(e,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(e){return{[this._sizeDim]:this._getSize(e)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});export{kL as NileAccordion,Vo as NileAutoComplete,Kx as NileAvatar,kt as NileBadge,Dx as NileBreadcrumb,hx as NileBreadcrumbItem,Xe as NileButton,fx as NileButtonFilter,YM as NileButtonToggle,VM as NileButtonToggleGroup,kM as NileCalendar,yx as NileCard,Lx as NileCarousel,Tx as NileCarouselItem,oi as NileCheckbox,ri as NileCheckboxGroup,pM as NileChip,Cx as NileCircularProgressbar,ax as NileCodeEditor,JS as NileColorPicker,qS as NileColorSwatch,zM as NileCombobox,HM as NileContentEditor,Lv as NileContextMenu,cv as NileContextMenuGroup,Dv as NileContextMenuItem,mM as NileDatePicker,pk as NileDetail,JM as NileDialog,fL as NileDivider,ii as NileDrawer,fo as NileDropdown,nL as NileEmptyState,wM as NileErrorMessage,qM as NileErrorNotification,_m as NileFilePreview,Sm as NileFileUpload,JL as NileFilterChip,av as NileFloatingPanel,At as NileFormErrorMessage,Ix as NileFormGroup,pt as NileFormHelpText,dL as NileFormatDate,NS as NileGrid,uS as NileGridBody,zS as NileGridCellItem,pS as NileGridHead,jS as NileGridHeadItem,dS as NileGridRow,qe as NileHeading,ML as NileHero,NL as NileHeroHeader,ke as NileIcon,wt as NileIconButton,BL as NileInlineEdit,fw as NileInlineSidebar,kw as NileInlineSidebarGroup,Cw as NileInlineSidebarItem,Ev as NileInlineSidebarItemBody,Sv as NileInlineSidebarItemHeader,Yw as NileInlineSidebarPanel,Vw as NileInlineSidebarPanelGroup,gt as NileInput,QM as NileLink,EL as NileList,SL as NileListItem,kn as NileLoader,Lt as NileMenu,So as NileMenuItem,Xk as NileNavTab,iv as NileNavTabGroup,Mv as NileNavTabPanel,Lo as NileOption,Bm as NileOptionGroup,Ot as NileOtpInput,tL as NilePageHeader,KL as NilePagination,kx as NilePopover,xn as NilePopup,fn as NileProgressBar,Hk as NileQrCode,ai as NileRadio,gi as NileRadioGroup,BS as NileRichTextEditor,YL as NileSectionMessage,Oo as NileSelect,ew as NileSideBar,Ow as NileSideBarAction,Ew as NileSideBarActionMenu,Sw as NileSideBarActionMenuItem,rw as NileSideBarExpand,hw as NileSideBarFooter,Iw as NileSideBarFooterItem,Lw as NileSideBarFooterText,aw as NileSideBarGroup,gw as NileSideBarGroupItem,cw as NileSideBarGroupItemIcon,Dw as NileSideBarGroupItemText,iw as NileSideBarHeader,ow as NileSideBarLogo,hk as NileSideBarPanel,Yn as NileSkeletonLoader,En as NileSlideToggle,sm as NileSlider,Cn as NileSpinner,IL as NileSplitPanel,ft as NileStatusLight,lL as NileStepper,sL as NileStepperItem,GM as NileSwitcher,nr as NileTab,er as NileTabGroup,rr as NileTabPanel,FL as NileTable,$x as NileTableBody,Bx as NileTableCellItem,Xx as NileTableHeaderItem,Fx as NileTableRow,Pn as NileTag,AM as NileTextarea,CL as NileTitle,cx as NileToast,VL as NileToolbar,Sn as NileTooltip,LL as NileTree,AL as NileTreeItem,uL as NileVerticalStepperItem,po as NileVirtualSelect,Dk as NileliteTooltip};