@aquera/nile-elements 1.5.4 → 1.5.5

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 (94) hide show
  1. package/README.md +6 -0
  2. package/demo/index.css +9 -0
  3. package/dist/index.cjs.js +1 -1
  4. package/dist/index.esm.js +1 -1
  5. package/dist/index.js +417 -28
  6. package/dist/nile-detail/index.cjs.js +2 -0
  7. package/dist/nile-detail/index.cjs.js.map +1 -0
  8. package/dist/nile-detail/index.esm.js +1 -0
  9. package/dist/nile-detail/nile-detail.cjs.js +2 -0
  10. package/dist/nile-detail/nile-detail.cjs.js.map +1 -0
  11. package/dist/nile-detail/nile-detail.css.cjs.js +2 -0
  12. package/dist/nile-detail/nile-detail.css.cjs.js.map +1 -0
  13. package/dist/nile-detail/nile-detail.css.esm.js +149 -0
  14. package/dist/nile-detail/nile-detail.esm.js +45 -0
  15. package/dist/nile-detail/nile-detail.utils.cjs.js +2 -0
  16. package/dist/nile-detail/nile-detail.utils.cjs.js.map +1 -0
  17. package/dist/nile-detail/nile-detail.utils.esm.js +1 -0
  18. package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js +1 -1
  19. package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js.map +1 -1
  20. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js +1 -1
  21. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js.map +1 -1
  22. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.esm.js +19 -0
  23. package/dist/nile-inline-sidebar/nile-inline-sidebar.esm.js +16 -14
  24. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js +1 -1
  25. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js.map +1 -1
  26. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.esm.js +8 -3
  27. package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
  28. package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
  29. package/dist/nile-pagination/nile-pagination.css.cjs.js +1 -1
  30. package/dist/nile-pagination/nile-pagination.css.cjs.js.map +1 -1
  31. package/dist/nile-pagination/nile-pagination.css.esm.js +109 -5
  32. package/dist/nile-pagination/nile-pagination.esm.js +70 -3
  33. package/dist/src/index.d.ts +1 -0
  34. package/dist/src/index.js +1 -0
  35. package/dist/src/index.js.map +1 -1
  36. package/dist/src/nile-detail/index.d.ts +1 -0
  37. package/dist/src/nile-detail/index.js +2 -0
  38. package/dist/src/nile-detail/index.js.map +1 -0
  39. package/dist/src/nile-detail/nile-detail.css.d.ts +3 -0
  40. package/dist/src/nile-detail/nile-detail.css.js +152 -0
  41. package/dist/src/nile-detail/nile-detail.css.js.map +1 -0
  42. package/dist/src/nile-detail/nile-detail.d.ts +29 -0
  43. package/dist/src/nile-detail/nile-detail.js +143 -0
  44. package/dist/src/nile-detail/nile-detail.js.map +1 -0
  45. package/dist/src/nile-detail/nile-detail.test.d.ts +1 -0
  46. package/dist/src/nile-detail/nile-detail.test.js +168 -0
  47. package/dist/src/nile-detail/nile-detail.test.js.map +1 -0
  48. package/dist/src/nile-detail/nile-detail.utils.d.ts +8 -0
  49. package/dist/src/nile-detail/nile-detail.utils.js +117 -0
  50. package/dist/src/nile-detail/nile-detail.utils.js.map +1 -0
  51. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js +19 -0
  52. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js.map +1 -1
  53. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.d.ts +6 -0
  54. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js +88 -4
  55. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js.map +1 -1
  56. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.d.ts +3 -0
  57. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.js +110 -0
  58. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.js.map +1 -0
  59. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.d.ts +2 -0
  60. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.js +109 -0
  61. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.js.map +1 -0
  62. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.d.ts +4 -0
  63. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js +30 -2
  64. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js.map +1 -1
  65. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.d.ts +2 -0
  66. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.js +109 -0
  67. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.js.map +1 -0
  68. package/dist/src/nile-pagination/nile-pagination.css.js +107 -3
  69. package/dist/src/nile-pagination/nile-pagination.css.js.map +1 -1
  70. package/dist/src/nile-pagination/nile-pagination.d.ts +5 -1
  71. package/dist/src/nile-pagination/nile-pagination.js +84 -1
  72. package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
  73. package/dist/src/nile-pagination/nile-pagination.test.js +1187 -103
  74. package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -1
  75. package/dist/src/version.js +1 -1
  76. package/dist/src/version.js.map +1 -1
  77. package/dist/tsconfig.tsbuildinfo +1 -1
  78. package/package.json +1 -1
  79. package/src/index.ts +2 -2
  80. package/src/nile-detail/index.ts +1 -0
  81. package/src/nile-detail/nile-detail.css.ts +153 -0
  82. package/src/nile-detail/nile-detail.test.ts +215 -0
  83. package/src/nile-detail/nile-detail.ts +140 -0
  84. package/src/nile-detail/nile-detail.utils.ts +133 -0
  85. package/src/nile-inline-sidebar/nile-inline-sidebar.css.ts +19 -0
  86. package/src/nile-inline-sidebar/nile-inline-sidebar.test.ts +108 -0
  87. package/src/nile-inline-sidebar/nile-inline-sidebar.ts +108 -5
  88. package/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.ts +107 -0
  89. package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.ts +107 -0
  90. package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts +34 -3
  91. package/src/nile-pagination/nile-pagination.css.ts +107 -3
  92. package/src/nile-pagination/nile-pagination.test.ts +1388 -101
  93. package/src/nile-pagination/nile-pagination.ts +87 -2
  94. package/vscode-html-custom-data.json +55 -4
package/dist/index.js CHANGED
@@ -4874,7 +4874,7 @@ class CM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
4874
4874
  * @license
4875
4875
  * Copyright 2021 Google LLC
4876
4876
  * SPDX-License-Identifier: BSD-3-Clause
4877
- */(this._hostElement,e),this._scrollerController=new bM(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(`[${UM}]`);t||(t=document.createElement("div"),t.setAttribute(UM,""),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(UM,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||YM;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 M={...e};delete M.type,t=M}else t=e;void 0===i&&(YM=i=(await Promise.resolve().then((function(){return yQ}))).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 M=0;M<t.length;M++){const n=t[M],o=this._first+M;(this._itemsChanged||this._toBeMeasured.has(n))&&(e[o]=i.call(this,n,this._items[o]))}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:VM(t.marginTop),marginRight:VM(t.marginRight),marginBottom:VM(t.marginBottom),marginLeft:VM(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 kM)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(UM)||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 M,n,o,r;const s=e.getBoundingClientRect();M=0,n=0,o=window.innerHeight,r=window.innerWidth;const a=this._clippingAncestors.map((e=>e.getBoundingClientRect()));a.unshift(s);for(const e of a)M=Math.max(M,e.top),n=Math.max(n,e.left),o=Math.min(o,e.bottom),r=Math.min(r,e.right);const l=t.getBoundingClientRect(),N={left:s.left-l.left,top:s.top-l.top},g={width:t.scrollWidth,height:t.scrollHeight},u=M-s.top+e.scrollTop,c=n-s.left+e.scrollLeft,D=Math.max(0,o-M),j=Math.max(0,r-n);i.viewportSize={width:j,height:D},i.viewportScroll={top:u,left:c},i.totalScrollSize=g,i.offsetWithinScroller=N}}_sizeHostElement(e){const t=82e5,i=e&&null!==e.width?Math.min(t,e.width):0,M=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${M}px)`;else{const e=this._hostElement.style;e.minWidth=i?`${i}px`:"100%",e.minHeight=M?`${M}px`:"100%"}}_positionChildren(e){e&&e.forEach((({top:e,left:t,width:i,height:M,xOffset:n,yOffset:o},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!==M&&(s.style.height=M+"px"),s.style.left=void 0===n?null:n+"px",s.style.top=void 0===o?null:o+"px")}))}async _adjustRange(e){const{_first:t,_last:i,_firstVisible:M,_lastVisible:n}=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!==M||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:i,left:M}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-i,left:t-M})}}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 wM({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new QM({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 VM(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function WM(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 PM=Ae(class extends SM{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>((e,t)=>R`${t}: ${JSON.stringify(e,null,2)}`)(e,t+this._first),this._keyFunction=(e,t)=>(e=>e)(e,this._first),this._items=[],e.type!==he)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 EM(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?B: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:M,items:n}=t;this._virtualizer=new ZM({hostElement:e,layout:i,scroller:M}),this._virtualizer.items=n,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 RM{static getVirtualizedContent(e,t,i,M,n,o,r,s,a,l,N,g,u,c,D,j){return R`
4877
+ */(this._hostElement,e),this._scrollerController=new bM(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(`[${UM}]`);t||(t=document.createElement("div"),t.setAttribute(UM,""),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(UM,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||YM;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 M={...e};delete M.type,t=M}else t=e;void 0===i&&(YM=i=(await Promise.resolve().then((function(){return xQ}))).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 M=0;M<t.length;M++){const n=t[M],o=this._first+M;(this._itemsChanged||this._toBeMeasured.has(n))&&(e[o]=i.call(this,n,this._items[o]))}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:VM(t.marginTop),marginRight:VM(t.marginRight),marginBottom:VM(t.marginBottom),marginLeft:VM(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 kM)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(UM)||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 M,n,o,r;const s=e.getBoundingClientRect();M=0,n=0,o=window.innerHeight,r=window.innerWidth;const a=this._clippingAncestors.map((e=>e.getBoundingClientRect()));a.unshift(s);for(const e of a)M=Math.max(M,e.top),n=Math.max(n,e.left),o=Math.min(o,e.bottom),r=Math.min(r,e.right);const l=t.getBoundingClientRect(),N={left:s.left-l.left,top:s.top-l.top},g={width:t.scrollWidth,height:t.scrollHeight},u=M-s.top+e.scrollTop,c=n-s.left+e.scrollLeft,D=Math.max(0,o-M),j=Math.max(0,r-n);i.viewportSize={width:j,height:D},i.viewportScroll={top:u,left:c},i.totalScrollSize=g,i.offsetWithinScroller=N}}_sizeHostElement(e){const t=82e5,i=e&&null!==e.width?Math.min(t,e.width):0,M=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${M}px)`;else{const e=this._hostElement.style;e.minWidth=i?`${i}px`:"100%",e.minHeight=M?`${M}px`:"100%"}}_positionChildren(e){e&&e.forEach((({top:e,left:t,width:i,height:M,xOffset:n,yOffset:o},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!==M&&(s.style.height=M+"px"),s.style.left=void 0===n?null:n+"px",s.style.top=void 0===o?null:o+"px")}))}async _adjustRange(e){const{_first:t,_last:i,_firstVisible:M,_lastVisible:n}=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!==M||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:i,left:M}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-i,left:t-M})}}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 wM({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new QM({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 VM(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function WM(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 PM=Ae(class extends SM{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>((e,t)=>R`${t}: ${JSON.stringify(e,null,2)}`)(e,t+this._first),this._keyFunction=(e,t)=>(e=>e)(e,this._first),this._items=[],e.type!==he)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 EM(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?B: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:M,items:n}=t;this._virtualizer=new ZM({hostElement:e,layout:i,scroller:M}),this._virtualizer.items=n,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 RM{static getVirtualizedContent(e,t,i,M,n,o,r,s,a,l,N,g,u,c,D,j){return R`
4878
4878
  <div part="select-options" class="select__options ${t?"select__options__search-enabled":""} ${u?"loading":""}">
4879
4879
  ${N&&!u?R`
4880
4880
  <div part="select-no-results" class="select__no-results">
@@ -12447,6 +12447,15 @@ nile-badge::part(content) {
12447
12447
  :host {
12448
12448
  }
12449
12449
 
12450
+ :host([disabled]) {
12451
+ cursor: not-allowed;
12452
+ }
12453
+
12454
+ :host([disabled]) .pagination-wrapper,
12455
+ :host([disabled]) .pagination-wrapper.mini {
12456
+ pointer-events: none;
12457
+ }
12458
+
12450
12459
  .pagination-wrapper {
12451
12460
  display: flex;
12452
12461
  align-items: center;
@@ -12455,14 +12464,14 @@ nile-badge::part(content) {
12455
12464
  }
12456
12465
 
12457
12466
 
12458
- .pagination-wrapper.v2 .pager-container {
12467
+ .pagination-wrapper.mini .pager-container {
12459
12468
  flex-direction: row;
12460
12469
  align-items: center;
12461
12470
  gap: var(--nile-spacing-spacing-md, var(--ng-spacing-md));
12462
12471
  margin-right: var(--nile-spacing-spacing-xl, var(--ng-spacing-xl));
12463
12472
  }
12464
12473
 
12465
- .pagination-wrapper.v2 .range-text {
12474
+ .pagination-wrapper.mini .range-text {
12466
12475
  margin-right: var(--nile-spacing-spacing-md, var(--ng-spacing-md));
12467
12476
  font-size: var(--nile-font-size-small, var(--ng-font-size-text-sm));
12468
12477
  color: var(--nile-colors-dark-900, var( --ng-colors-text-primary-900));
@@ -12470,6 +12479,101 @@ nile-badge::part(content) {
12470
12479
  font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));
12471
12480
  }
12472
12481
 
12482
+ .pagination-wrapper.mini {
12483
+ display: inline-flex;
12484
+ align-items: center;
12485
+ gap: 2px;
12486
+ padding: var(--nile-spacing-spacing-md, var(--ng-spacing-md)) var(--nile-spacing-spacing-lg, var(--ng-spacing-lg));
12487
+ }
12488
+
12489
+ .mini-showing-label,
12490
+ .mini-of-label {
12491
+ font-size: var(--nile-font-size-small, var(--ng-font-size-text-sm));
12492
+ color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));
12493
+ font-feature-settings: 'liga' off, 'clig' off;
12494
+ font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));
12495
+ white-space: nowrap;
12496
+ line-height: 32px;
12497
+ }
12498
+
12499
+ .mini-page-dropdown nile-menu {
12500
+ overflow-y: auto;
12501
+ padding: var(--nile-spacing-spacing-lg, var(--ng-spacing-lg)) var(--nile-spacing-spacing-none, var(--ng-spacing-none));
12502
+ box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
12503
+ }
12504
+
12505
+ .mini-scroll-wrapper {
12506
+ max-height: 164px;
12507
+ overflow-y: auto;
12508
+ width: 60px;
12509
+ }
12510
+
12511
+ nile-button.mini-page-btn::part(base) {
12512
+ min-width: auto;
12513
+ height: 10px;
12514
+ padding: 0px 4px;
12515
+ gap: 2px;
12516
+ border: none ;
12517
+ box-shadow: none ;
12518
+ background: transparent ;
12519
+ font-family: var(--nile-font-family-medium, var(--ng-font-family-body));
12520
+ font-size: var(--nile-font-size-small, var(--ng-font-size-text-xs));
12521
+ font-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));
12522
+ }
12523
+
12524
+ nile-button.mini-page-btn::part(base):hover,
12525
+ nile-button.mini-page-btn::part(base):active {
12526
+ min-width: auto;
12527
+ height: 10px;
12528
+ padding: 0px 4px;
12529
+ gap: 2px;
12530
+ border: none ;
12531
+ background: transparent ;
12532
+ }
12533
+
12534
+ .mini-page-dropdown {
12535
+ display: inline-flex;
12536
+ align-items: center;
12537
+ }
12538
+
12539
+ nile-button.mini-prev-button::part(base),
12540
+ nile-button.mini-next-button::part(base) {
12541
+ border: none ;
12542
+ }
12543
+
12544
+ nile-button.mini-prev-button::part(base):hover,
12545
+ nile-button.mini-next-button::part(base):hover {
12546
+ border: none ;
12547
+ }
12548
+
12549
+ nile-button.mini-prev-button::part(base):active,
12550
+ nile-button.mini-next-button::part(base):active {
12551
+ border: none ;
12552
+ }
12553
+
12554
+ .mini-page-dropdown .chevron {
12555
+ transition: transform 0.2s;
12556
+ }
12557
+
12558
+ .mini-page-dropdown .mini-page-btn.open .chevron {
12559
+ transform: rotate(180deg);
12560
+ }
12561
+
12562
+ .mini-nav {
12563
+ display: inline-flex;
12564
+ align-items: center;
12565
+ margin-left: var(--nile-spacing-spacing-none, var(--ng-spacing-none));
12566
+ }
12567
+
12568
+ .mini-pagination {
12569
+ display: inline-flex;
12570
+ align-items: center;
12571
+ gap: 0;
12572
+ list-style: none;
12573
+ margin: 0;
12574
+ padding: 0;
12575
+ }
12576
+
12473
12577
 
12474
12578
  .pagination-wrapper.compact {
12475
12579
  min-width: 324px;
@@ -12540,7 +12644,7 @@ nile-badge::part(content) {
12540
12644
  }
12541
12645
 
12542
12646
  .pagination-wrapper.compact .pager-container {
12543
- gap: var(--nile-spacing-xxs, var(--ng-spacing-xxs)) !important;
12647
+ gap: var(--nile-spacing-xxs, var(--ng-spacing-xxs)) ;
12544
12648
  }
12545
12649
 
12546
12650
  .range-text {
@@ -12704,7 +12808,7 @@ nile-badge::part(content) {
12704
12808
  border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-primary));
12705
12809
  }
12706
12810
 
12707
- `;function rL(e,t,i){return`Showing ${(i-1)*t+1}–${Math.min(i*t,e)} of ${e}`}let sL=class extends Re{constructor(){super(...arguments),this.totalItems=0,this.currentPage=1,this.pageSize=50,this.pageSizeOptions=[10,25,50,100],this.variant="fluid",this.disabled=!1,this.showTitle=!0,this._pageSizeOpen=!1,this._pageOpen=!1}static get styles(){return[oL]}firstUpdated(){this._pageSizeDropdown&&(this._pageSizeDropdown.addEventListener("nile-show",(()=>{this._pageSizeOpen=!0})),this._pageSizeDropdown.addEventListener("nile-after-hide",(()=>{this._pageSizeOpen=!1})))}get totalPages(){return Math.max(1,(e=this.totalItems,t=this.pageSize,Math.ceil(e/t)));var e,t}goToPage(e){if(this.disabled)return;const t=this.currentPage;this.currentPage=e,this.emit("nile-change",{page:e,previousPage:t,pageSize:this.pageSize})}onPageSizeSelect(e){if(this.disabled||this.pageSize===e)return;const t=this.currentPage;this.pageSize=e,this.currentPage=1,this.emit("nile-change",{page:1,previousPage:t,pageSize:e})}renderCompactRangeText(){const e=rL(this.totalItems,this.pageSize,this.currentPage).replace(/^Showing\s*/,"");return R`<div class="range-text">${e}</div>`}renderRangeText(){return 0===this.totalItems?R`<div class="range-text">Showing 0 of 0</div>`:R`
12811
+ `;function rL(e,t,i){return`Showing ${(i-1)*t+1}–${Math.min(i*t,e)} of ${e}`}let sL=class extends Re{constructor(){super(...arguments),this.totalItems=0,this.currentPage=1,this.pageSize=50,this.pageSizeOptions=[10,25,50,100],this.variant="fluid",this.disabled=!1,this.showTitle=!0,this._pageSizeOpen=!1,this._pageOpen=!1,this._miniPageOpen=!1}static get styles(){return[oL]}firstUpdated(){this._pageSizeDropdown&&(this._pageSizeDropdown.addEventListener("nile-show",(()=>{this._pageSizeOpen=!0})),this._pageSizeDropdown.addEventListener("nile-after-hide",(()=>{this._pageSizeOpen=!1})))}get totalPages(){return Math.max(1,(e=this.totalItems,t=this.pageSize,Math.ceil(e/t)));var e,t}goToPage(e){if(this.disabled)return;const t=this.currentPage;this.currentPage=e,this.emit("nile-change",{page:e,previousPage:t,pageSize:this.pageSize})}onPageSizeSelect(e){if(this.disabled||this.pageSize===e)return;const t=this.currentPage;this.pageSize=e,this.currentPage=1,this.emit("nile-change",{page:1,previousPage:t,pageSize:e})}renderCompactRangeText(){const e=rL(this.totalItems,this.pageSize,this.currentPage).replace(/^Showing\s*/,"");return R`<div class="range-text">${e}</div>`}renderRangeText(){return 0===this.totalItems?R`<div class="range-text">Showing 0 of 0</div>`:R`
12708
12812
  <div part="range-text" class="range-text">
12709
12813
  ${rL(this.totalItems,this.pageSize,this.currentPage)}
12710
12814
  </div>
@@ -12826,6 +12930,73 @@ nile-badge::part(content) {
12826
12930
  ${e}
12827
12931
  </nile-button>
12828
12932
  </li>
12933
+ `}renderMiniPrevButton(){return R`
12934
+ <li>
12935
+ <nile-button
12936
+ variant="tertiary"
12937
+ ?disabled=${1===this.currentPage||this.disabled}
12938
+ @click=${()=>this.goToPage(this.currentPage-1)}
12939
+ class="mini-prev-button"
12940
+ >
12941
+ <nile-icon name="var(--nile-icon-arrow-left, var(--ng-icon-chevron-left))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" size="12"></nile-icon>
12942
+ </nile-button>
12943
+ </li>
12944
+ `}renderMiniNextButton(){return R`
12945
+ <li>
12946
+ <nile-button
12947
+ variant="tertiary"
12948
+ ?disabled=${this.currentPage===this.totalPages||this.disabled}
12949
+ @click=${()=>this.goToPage(this.currentPage+1)}
12950
+ class="mini-next-button"
12951
+ >
12952
+ <nile-icon name="var(--nile-icon-arrow-right, var(--ng-icon-chevron-right))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" size="12"></nile-icon>
12953
+ </nile-button>
12954
+ </li>
12955
+ `}renderMini(){return R`
12956
+ <div part="wrapper" class="pagination-wrapper mini">
12957
+ <span part="mini-showing-label" class="mini-showing-label">Showing</span>
12958
+ <nile-dropdown
12959
+ part="mini-page-dropdown"
12960
+ class="mini-page-dropdown"
12961
+ ?disabled=${this.disabled}
12962
+ @nile-show=${()=>this._miniPageOpen=!0}
12963
+ @nile-after-hide=${()=>this._miniPageOpen=!1}
12964
+ >
12965
+ <nile-button
12966
+ slot="trigger"
12967
+ variant="tertiary"
12968
+ class="mini-page-btn ${this._miniPageOpen?"open":""}"
12969
+ ?disabled=${this.disabled}
12970
+ >
12971
+ ${this.currentPage}
12972
+ <nile-icon
12973
+ name="var(--nile-icon-chevron-down, var(--ng-icon-chevron-down))"
12974
+ size="12"
12975
+ method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
12976
+ class="chevron"
12977
+ ></nile-icon>
12978
+ </nile-button>
12979
+ <nile-menu>
12980
+ <div class="mini-scroll-wrapper">
12981
+ ${Array.from({length:this.totalPages},((e,t)=>t+1)).map((e=>R`
12982
+ <nile-menu-item
12983
+ ?disabled=${this.disabled}
12984
+ @click=${()=>this.goToPage(e)}
12985
+ >
12986
+ ${e}
12987
+ </nile-menu-item>
12988
+ `))}
12989
+ </div>
12990
+ </nile-menu>
12991
+ </nile-dropdown>
12992
+ <span part="mini-of-label" class="mini-of-label">of ${this.totalPages}</span>
12993
+ <nav aria-label="Pagination" part="mini-nav" class="mini-nav">
12994
+ <ul part="mini-page-list" class="pagination mini-pagination">
12995
+ ${this.renderMiniPrevButton()}
12996
+ ${this.renderMiniNextButton()}
12997
+ </ul>
12998
+ </nav>
12999
+ </div>
12829
13000
  `}renderPageList(){if("compact"===this.variant)return R`
12830
13001
  <nav aria-label="Pagination">
12831
13002
  <ul class="pagination compact-pagination">
@@ -12876,7 +13047,7 @@ nile-badge::part(content) {
12876
13047
  ${this.renderNextButton()}
12877
13048
  </ul>
12878
13049
  </nav>
12879
- `}render(){return R`
13050
+ `}render(){return"mini"===this.variant?this.renderMini():R`
12880
13051
  <div part="wrapper" class="pagination-wrapper ${this.variant}">
12881
13052
  <div part="pager-container" class="pager-container">
12882
13053
  ${"fluid"===this.variant&&this.showTitle?this.renderRangeText():"compact"===this.variant?this.renderCompactRangeText():null}
@@ -12884,7 +13055,7 @@ nile-badge::part(content) {
12884
13055
  </div>
12885
13056
  ${this.renderPageList()}
12886
13057
  </div>
12887
- `}};e([ce({attribute:"totalitems",reflect:!0,converter:{fromAttribute:e=>{const t=Number(e);return Number.isFinite(t)&&t>=0?Math.floor(t):0}}})],sL.prototype,"totalItems",void 0),e([ce({attribute:"currentpage",reflect:!0,converter:{fromAttribute:e=>{const t=Number(e);return Number.isFinite(t)&&t>=1?Math.floor(t):1}}})],sL.prototype,"currentPage",void 0),e([ce({attribute:"pagesize",reflect:!0,converter:{fromAttribute:e=>{const t=Number(e);return Number.isFinite(t)&&t>=1?Math.floor(t):50}}})],sL.prototype,"pageSize",void 0),e([ce({attribute:"pagesizeoptions",reflect:!1,converter:{fromAttribute:e=>{try{const t=JSON.parse(e);if(Array.isArray(t)&&t.every((e=>"number"==typeof e)))return t}catch{}return[10,25,50,100]}}})],sL.prototype,"pageSizeOptions",void 0),e([ce({type:String})],sL.prototype,"variant",void 0),e([ce({type:Boolean})],sL.prototype,"disabled",void 0),e([ce({type:Boolean})],sL.prototype,"showTitle",void 0),e([De()],sL.prototype,"_pageSizeOpen",void 0),e([De()],sL.prototype,"_pageOpen",void 0),e([Ie(".page-size-dropdown")],sL.prototype,"_pageSizeDropdown",void 0),sL=e([Ne("nile-pagination")],sL);const aL=r`
13058
+ `}};e([ce({attribute:"totalitems",reflect:!0,converter:{fromAttribute:e=>{const t=Number(e);return Number.isFinite(t)&&t>=0?Math.floor(t):0}}})],sL.prototype,"totalItems",void 0),e([ce({attribute:"currentpage",reflect:!0,converter:{fromAttribute:e=>{const t=Number(e);return Number.isFinite(t)&&t>=1?Math.floor(t):1}}})],sL.prototype,"currentPage",void 0),e([ce({attribute:"pagesize",reflect:!0,converter:{fromAttribute:e=>{const t=Number(e);return Number.isFinite(t)&&t>=1?Math.floor(t):50}}})],sL.prototype,"pageSize",void 0),e([ce({attribute:"pagesizeoptions",reflect:!1,converter:{fromAttribute:e=>{try{const t=JSON.parse(e);if(Array.isArray(t)&&t.every((e=>"number"==typeof e)))return t}catch{}return[10,25,50,100]}}})],sL.prototype,"pageSizeOptions",void 0),e([ce({type:String})],sL.prototype,"variant",void 0),e([ce({type:Boolean,reflect:!0})],sL.prototype,"disabled",void 0),e([ce({type:Boolean})],sL.prototype,"showTitle",void 0),e([De()],sL.prototype,"_pageSizeOpen",void 0),e([De()],sL.prototype,"_pageOpen",void 0),e([De()],sL.prototype,"_miniPageOpen",void 0),e([Ie(".page-size-dropdown")],sL.prototype,"_pageSizeDropdown",void 0),sL=e([Ne("nile-pagination")],sL);const aL=r`
12888
13059
  :host {
12889
13060
  display: block;
12890
13061
  }
@@ -15267,7 +15438,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
15267
15438
 
15268
15439
 
15269
15440
 
15270
- `,$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"},XS=["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 qS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!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.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),WS(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,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),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(JS.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))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){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))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),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 M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}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")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=$S[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-lite-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),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?GS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){GS(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 M=ZS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&RS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;VS(this.editorEl,t),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(),M=document.createElement("div");M.appendChild(i),Array.from(M.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)return void(e.innerHTML="<p><br></p>");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){switch(this.focusAndRestore(),e){case"bold":WS(this.editorEl,"strong");break;case"italic":WS(this.editorEl,"em");break;case"underline":WS(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":HS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":HS(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,M=getComputedStyle(i),n=ZS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{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=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.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=PS(M.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=PS(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([...XS,...this.whitelist??[]]))}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=this.getComputedImportantProps();for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],qS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],qS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],qS.prototype,"singleLineEditor",void 0),e([ce({type:String})],qS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.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)}})],qS.prototype,"mentions",void 0),e([ce({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[]}}}})],qS.prototype,"whitelist",void 0),e([De()],qS.prototype,"content",void 0),qS=e([Ne("nile-rich-text-editor")],qS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.5.4"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const KS=r`
15441
+ `,$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"},XS=["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 qS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!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.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),WS(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,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),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(JS.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))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){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))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),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 M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}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")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=$S[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-lite-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),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?GS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){GS(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 M=ZS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&RS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;VS(this.editorEl,t),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(),M=document.createElement("div");M.appendChild(i),Array.from(M.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)return void(e.innerHTML="<p><br></p>");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){switch(this.focusAndRestore(),e){case"bold":WS(this.editorEl,"strong");break;case"italic":WS(this.editorEl,"em");break;case"underline":WS(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":HS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":HS(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,M=getComputedStyle(i),n=ZS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{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=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.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=PS(M.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=PS(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([...XS,...this.whitelist??[]]))}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=this.getComputedImportantProps();for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],qS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],qS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],qS.prototype,"singleLineEditor",void 0),e([ce({type:String})],qS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.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)}})],qS.prototype,"mentions",void 0),e([ce({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[]}}}})],qS.prototype,"whitelist",void 0),e([De()],qS.prototype,"content",void 0),qS=e([Ne("nile-rich-text-editor")],qS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.5.5"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const KS=r`
15271
15442
  :host {
15272
15443
 
15273
15444
  top: 0;
@@ -16356,29 +16527,48 @@ border: none;
16356
16527
  pointer-events: auto;
16357
16528
  transition-delay: 0ms;
16358
16529
  }
16359
- `;let bm=class extends Re{constructor(){super(...arguments),this.collapsed=!1,this.fixed=!1,this.showTooltip=!1,this.activeIndex=-1,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.dispatchEvent(new CustomEvent("nile-change",{detail:{selectedItem:t,index:i},bubbles:!0,composed:!0})),this.requestUpdate()}}static get styles(){return[Cm]}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.mutationObserver=new MutationObserver((()=>this.syncActiveFromItems()))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeEventListener("nile-click",this.handleItemSelect)}firstUpdated(){this.observeSidebarItems(),this.syncActiveFromItems(),this.fixed&&(this.collapsed=!1)}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())}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()||"",M=t.href;this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:t,href:M,text:i},bubbles:!0,composed:!0})),M&&(window.location.href=M),this.requestUpdate()}get menuItemsTemplate(){return this.sidebarItems?.length?this.sidebarItems.map(((e,t)=>{const i=e.tooltip,M=e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight,n=R`
16530
+
16531
+ :host([placement='right']) .sidebar {
16532
+ border-right: none;
16533
+ border-left: 1px solid var(--nile-colors-neutral-400);
16534
+ }
16535
+
16536
+ :host([placement='right']) .toggle-btn {
16537
+ right: auto;
16538
+ left: -14px;
16539
+ }
16540
+
16541
+ :host([placement='right']) .sidebar-header {
16542
+ justify-content: flex-start;
16543
+ }
16544
+
16545
+ :host([placement='right']) .sidebar-nav {
16546
+ padding-right: 0;
16547
+ padding-left: var(--nile-spacing-xl);
16548
+ }
16549
+ `;let bm=class extends Re{constructor(){super(...arguments),this.collapsed=!1,this.fixed=!1,this.showTooltip=!1,this.placement="left",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"))),M=i?t.indexOf(i):-1;let n=null;switch(e.key){case"ArrowDown":n=M<t.length-1?M+1:0;break;case"ArrowUp":n=M>0?M-1:t.length-1;break;case"Home":n=0;break;case"End":n=t.length-1;break;default:return}e.preventDefault(),null!==n&&t[n]&&this.focusItem(t[n])},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[Cm]}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.fixed&&(this.collapsed=!1)}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()||"",M=t.href;this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:t,href:M,text:i},bubbles:!0,composed:!0})),M&&(window.location.href=M),this.requestUpdate()}get menuItemsTemplate(){if(!this.sidebarItems?.length)return null;const e="right"===this.placement?"left":"right";return this.sidebarItems.map(((t,i)=>{const M=t.tooltip,n=t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight,o=R`
16360
16550
  <nile-side-bar-action-menu-item
16361
- ?disabled=${e.hasAttribute("disabled")}
16362
- ?active=${this.activeIndex===t}
16363
- @click=${()=>this.handleMenuItemClick(t)}
16551
+ ?disabled=${t.hasAttribute("disabled")}
16552
+ ?active=${this.activeIndex===i}
16553
+ @click=${()=>this.handleMenuItemClick(i)}
16364
16554
  >
16365
- ${e.textContent}
16555
+ ${t.textContent}
16366
16556
  </nile-side-bar-action-menu-item>
16367
- `;return i||M?R`
16557
+ `;return M||n?R`
16368
16558
  <nile-tooltip
16369
- content=${e.textContent?.trim()||""}
16559
+ content=${t.textContent?.trim()||""}
16370
16560
  hoist
16371
- placement="right"
16561
+ placement=${e}
16372
16562
  >
16373
- ${n}
16563
+ ${o}
16374
16564
  </nile-tooltip>
16375
- `:n})):null}render(){return R`
16565
+ `:o}))}render(){const e="right"===this.placement,t=e?"menu_open":"menu_close",i=e?"menu_close":"menu_open",M=e?"bottom-end":"bottom-start";return R`
16376
16566
  <div class="sidebar" part="base">
16377
16567
  <div class="sidebar-header" part="header">
16378
16568
  ${this.fixed?null:this.collapsed?R`
16379
16569
  <nile-side-bar-action
16380
16570
  class="toggle-action"
16381
- placement="bottom-start"
16571
+ placement=${M}
16382
16572
  hoist
16383
16573
  open
16384
16574
  triggerDropdown="hover"
@@ -16389,7 +16579,7 @@ border: none;
16389
16579
  variant="tertiary"
16390
16580
  @click=${this.toggleCollapse}
16391
16581
  >
16392
- <nile-icon name="menu_close"></nile-icon>
16582
+ <nile-icon name=${t}></nile-icon>
16393
16583
  </nile-button>
16394
16584
  <nile-side-bar-action-menu>
16395
16585
  ${this.menuItemsTemplate}
@@ -16401,13 +16591,15 @@ border: none;
16401
16591
  variant="tertiary"
16402
16592
  @click=${this.toggleCollapse}
16403
16593
  >
16404
- <nile-icon name="menu_open"></nile-icon>
16594
+ <nile-icon name=${i}></nile-icon>
16405
16595
  </nile-button>
16406
16596
  `}
16407
16597
  </div>
16408
16598
 
16409
16599
  <nav
16410
16600
  class="sidebar-nav"
16601
+ role="navigation"
16602
+ aria-label="Sidebar"
16411
16603
  style=${this.collapsed?"display:none;":""}
16412
16604
  part="nav-items"
16413
16605
  >
@@ -16416,7 +16608,7 @@ border: none;
16416
16608
  ></slot>
16417
16609
  </nav>
16418
16610
  </div>
16419
- `}};e([ce({type:Boolean,reflect:!0})],bm.prototype,"collapsed",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],bm.prototype,"fixed",void 0),e([ce({type:Boolean,reflect:!0})],bm.prototype,"showTooltip",void 0),e([De()],bm.prototype,"activeIndex",void 0),e([Ie("slot")],bm.prototype,"defaultSlot",void 0),bm=e([Ne("nile-inline-sidebar")],bm);const fm=r`
16611
+ `}};e([ce({type:Boolean,reflect:!0})],bm.prototype,"collapsed",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],bm.prototype,"fixed",void 0),e([ce({type:Boolean,reflect:!0})],bm.prototype,"showTooltip",void 0),e([ce({type:String,reflect:!0})],bm.prototype,"placement",void 0),e([De()],bm.prototype,"activeIndex",void 0),e([Ie("slot")],bm.prototype,"defaultSlot",void 0),bm=e([Ne("nile-inline-sidebar")],bm);const fm=r`
16420
16612
  :host {
16421
16613
  display: block;
16422
16614
  font-family: var(--nile-font-family-sans-serif);
@@ -16474,8 +16666,13 @@ a {
16474
16666
 
16475
16667
 
16476
16668
 
16477
- `;let vm=class extends Re{constructor(){super(...arguments),this.active=!1,this.disabled=!1,this.tooltip=!1}static get styles(){return[fm]}handleClick(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)}render(){return R`
16478
- <div class="item" @click=${this.handleClick} role="button" tabindex="0">
16669
+ `;let vm=class extends Re{constructor(){super(...arguments),this.active=!1,this.disabled=!1,this.tooltip=!1,this._handleHostKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._select(e))}}static get styles(){return[fm]}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 R`
16670
+ <div
16671
+ class="item"
16672
+ @click=${this.handleClick}
16673
+ role="menuitem"
16674
+ aria-disabled=${this.disabled}
16675
+ >
16479
16676
  ${this.href?R`<a href=${this.href} @click=${e=>e.preventDefault()}><slot></slot></a>`:R`<slot></slot>`}
16480
16677
  </div>
16481
16678
  `}};e([ce({type:Boolean,reflect:!0})],vm.prototype,"active",void 0),e([ce({type:Boolean,reflect:!0})],vm.prototype,"disabled",void 0),e([ce({type:String})],vm.prototype,"href",void 0),e([ce({type:Boolean,reflect:!0})],vm.prototype,"tooltip",void 0),vm=e([Ne("nile-inline-sidebar-item")],vm);const Um=r`
@@ -16589,20 +16786,212 @@ a {
16589
16786
 
16590
16787
  `;let uQ=class extends Re{static get styles(){return[gQ]}render(){return R`
16591
16788
  <slot> </slot>
16592
- `}};uQ=e([Ne("nile-side-bar-panel")],uQ);
16789
+ `}};uQ=e([Ne("nile-side-bar-panel")],uQ);const cQ=r`
16790
+ :host {
16791
+ box-sizing: border-box;
16792
+ -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
16793
+ -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));
16794
+ text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
16795
+ }
16796
+
16797
+ :host *,
16798
+ :host *::before,
16799
+ :host *::after {
16800
+ box-sizing: inherit;
16801
+ }
16802
+
16803
+ [hidden] {
16804
+ display: none;
16805
+ }
16806
+
16807
+ :host {
16808
+ display: block;
16809
+ width: 100%;
16810
+ }
16811
+
16812
+ .detail {
16813
+ border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
16814
+ border-radius: var(--nile-radius-md, var(--ng-radius-xl));
16815
+ background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
16816
+ box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-xs));
16817
+ overflow: hidden;
16818
+ width: 100%;
16819
+ line-height: var(--nile-line-height-inherit, var(--ng-line-height-text-sm));
16820
+ font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));
16821
+ }
16822
+
16823
+ .detail--disabled {
16824
+ opacity: var(--nile-opacity-50, var(--ng-opacity-50));
16825
+ }
16826
+
16827
+ .detail__header {
16828
+ display: flex;
16829
+ gap: var(--nile-spacing-lg, var(--ng-spacing-lg));
16830
+ align-items: center;
16831
+ border-radius: inherit;
16832
+ padding: var(--nile-spacing-xl, var(--ng-spacing-xl));
16833
+ background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-tertiary));
16834
+ font-size: var(--nile-type-scale-4, var(--ng-spacing-xl));
16835
+ font-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));
16836
+ color: var(--nile-colors-neutral-900, var(--ng-colors-text-primary));
16837
+ user-select: none;
16838
+ cursor: pointer;
16839
+ list-style: none;
16840
+ }
16841
+
16842
+ .detail__header::-webkit-details-marker {
16843
+ display: none;
16844
+ }
16845
+
16846
+ .detail__header::marker {
16847
+ content: '';
16848
+ }
16849
+
16850
+ .detail__header--icon-left {
16851
+ flex-direction: row-reverse;
16852
+ }
16853
+
16854
+ .detail__header:focus {
16855
+ outline: none;
16856
+ }
16857
+
16858
+ .detail__header:focus-visible {
16859
+ outline: solid 3px var(--nile-colors-blue-500, var(--ng-colors-fg-brand-primary-600));
16860
+ outline-offset: calc(1px + 1px);
16861
+ }
16862
+
16863
+ .detail--disabled .detail__header {
16864
+ cursor: not-allowed;
16865
+ }
16866
+
16867
+ .detail--disabled .detail__header:focus-visible {
16868
+ outline: none;
16869
+ box-shadow: none;
16870
+ }
16871
+
16872
+ .detail__label {
16873
+ width: 100%;
16874
+ display: flex;
16875
+ flex-direction: column;
16876
+ }
16877
+
16878
+ .detail__header-actions {
16879
+ flex: 0 0 auto;
16880
+ display: flex;
16881
+ align-items: center;
16882
+ gap: var(--nile-spacing-sm, var(--ng-spacing-sm));
16883
+ }
16884
+
16885
+ .detail__prefix {
16886
+ flex: 0 0 auto;
16887
+ display: flex;
16888
+ align-items: center;
16889
+ gap: var(--nile-spacing-sm, var(--ng-spacing-sm));
16890
+ }
16891
+
16892
+ .detail__suffix {
16893
+ flex: 0 0 auto;
16894
+ display: flex;
16895
+ align-items: center;
16896
+ gap: var(--nile-spacing-sm, var(--ng-spacing-sm));
16897
+ }
16898
+
16899
+ .detail__heading-text {
16900
+ font-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));
16901
+ font-family: var(--nile-font-family-medium, var(--ng-font-family-body));
16902
+ font-size: var(--nile-type-scale-4, var(--ng-spacing-xl));
16903
+ }
16904
+
16905
+ .detail__description {
16906
+ font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
16907
+ font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));
16908
+ color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary));
16909
+ margin-top: 2px;
16910
+ }
16911
+
16912
+ .detail__summary-icon {
16913
+ flex: 0 0 auto;
16914
+ display: flex;
16915
+ align-items: center;
16916
+ transition: 250ms transform ease;
16917
+ color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary));
16918
+ transform: rotate(90deg);
16919
+ }
16920
+
16921
+ .detail--open .detail__summary-icon {
16922
+ transform: rotate(-90deg);
16923
+ }
16924
+
16925
+ .detail__body {
16926
+ overflow: hidden;
16927
+ }
16928
+
16929
+ .detail__body[hidden] {
16930
+ display: none;
16931
+ }
16932
+
16933
+ .detail__content {
16934
+ display: block;
16935
+ padding: var(--nile-spacing-xl, var(--ng-spacing-xl));
16936
+ }
16937
+ `;async function DQ(e){if(!e.open&&!e.disabled)return e.open=!0,St(e,"nile-after-show")}async function jQ(e){if(e.open&&!e.disabled)return e.open=!1,St(e,"nile-after-hide")}Tt("detail.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),Tt("detail.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});let IQ=class extends Re{constructor(){super(...arguments),this.open=!1,this.heading="",this.description="",this.expandIconPlacement="right",this.disabled=!1,this._detailOpen=!1}firstUpdated(){this._detailOpen=this.open,this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0"}_handleSummaryClick(e){e.preventDefault(),function(e){e.disabled||(e.open?jQ(e):DQ(e))}(this)}_handleSummaryKeyDown(e){!function(e,t){e.preventDefault(),"Enter"!==e.key&&" "!==e.key||(t.open?jQ(t):DQ(t)),"ArrowUp"!==e.key&&"ArrowLeft"!==e.key||jQ(t),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||DQ(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 jt(e.body),e.body.hidden=!1;const{keyframes:t,options:i}=yt(e,"detail.show",{dir:"ltr"});await ut(e.body,It(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 jt(e.body);const{keyframes:t,options:i}=yt(e,"detail.hide",{dir:"ltr"});await ut(e.body,It(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 DQ(this)}async hide(){return jQ(this)}get _summaryLabel(){return[this.heading,this.description].filter(Boolean).join(", ")}render(){return R`
16938
+ <details
16939
+ part="base"
16940
+ ?open=${this._detailOpen}
16941
+ class=${pe({detail:!0,"detail--open":this.open,"detail--disabled":this.disabled})}
16942
+ >
16943
+ <summary
16944
+ part="header"
16945
+ id="header"
16946
+ class=${pe({detail__header:!0,"detail__header--icon-left":"left"===this.expandIconPlacement})}
16947
+ aria-label=${this._summaryLabel||G}
16948
+ aria-expanded=${this.open?"true":"false"}
16949
+ aria-disabled=${this.disabled?"true":"false"}
16950
+ tabindex=${this.disabled?"-1":"0"}
16951
+ @click=${this._handleSummaryClick}
16952
+ @keydown=${this._handleSummaryKeyDown}
16953
+ >
16954
+ <slot name="label" part="label" class="detail__label">
16955
+ <span part="label-text" class="detail__heading-text">${this.heading}</span>
16956
+ ${this.description?R`<span part="description" class="detail__description">${this.description}</span>`:""}
16957
+ </slot>
16958
+
16959
+ <slot name="header-actions" part="header-actions" class="detail__header-actions"></slot>
16960
+
16961
+ <slot name="prefix" part="prefix" class="detail__prefix"></slot>
16962
+
16963
+ <span part="summary-icon" class="detail__summary-icon" aria-hidden="true">
16964
+ <slot name="expand-icon">
16965
+ <nile-icon
16966
+ name="var(--nile-icon-arrow-right, var(--ng-icon-chevron-right))"
16967
+ method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
16968
+ library="system"
16969
+ ></nile-icon>
16970
+ </slot>
16971
+ </span>
16972
+
16973
+ <slot name="suffix" part="suffix" class="detail__suffix"></slot>
16974
+
16975
+ </summary>
16976
+
16977
+ <div part="content" class="detail__body">
16978
+ <slot id="content" class="detail__content"></slot>
16979
+ </div>
16980
+ </details>
16981
+ `}};IQ.styles=cQ,e([Ie("details")],IQ.prototype,"detail",void 0),e([Ie("summary")],IQ.prototype,"header",void 0),e([Ie(".detail__body")],IQ.prototype,"body",void 0),e([ce({attribute:!0,type:Boolean,reflect:!0})],IQ.prototype,"open",void 0),e([ce({attribute:!0,type:String,reflect:!0})],IQ.prototype,"heading",void 0),e([ce({attribute:!0,type:String,reflect:!0})],IQ.prototype,"description",void 0),e([ce({attribute:!0,reflect:!0})],IQ.prototype,"expandIconPlacement",void 0),e([ce({attribute:!0,type:Boolean,reflect:!0})],IQ.prototype,"disabled",void 0),e([De()],IQ.prototype,"_detailOpen",void 0),e([We("open",{waitUntilFirstUpdate:!0})],IQ.prototype,"handleOpenChange",null),IQ=e([Ne("nile-detail")],IQ);
16593
16982
  /**
16594
16983
  * @license
16595
16984
  * Copyright 2021 Google LLC
16596
16985
  * SPDX-License-Identifier: BSD-3-Clause
16597
16986
  */
16598
- class cQ{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}}
16987
+ class zQ{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}}
16599
16988
  /**
16600
16989
  * @license
16601
16990
  * Copyright 2021 Google LLC
16602
16991
  * SPDX-License-Identifier: BSD-3-Clause
16603
- */function DQ(e){return"horizontal"===e?"width":"height"}class jQ{_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[DQ(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)),M=this._getItemPosition(i)[this._positionDim];let n=M;if("start"!==t){const e=this._getItemSize(i)[this._sizeDim];if("center"===t)n=M-.5*this._viewDim1+.5*e;else{const i=M-this._viewDim1+e;if("end"===t)n=i;else{const e=this._scrollPosition;n=Math.abs(e-M)<Math.abs(e-i)?M:i}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}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())}}
16992
+ */function dQ(e){return"horizontal"===e?"width":"height"}class hQ{_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[dQ(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)),M=this._getItemPosition(i)[this._positionDim];let n=M;if("start"!==t){const e=this._getItemSize(i)[this._sizeDim];if("center"===t)n=M-.5*this._viewDim1+.5*e;else{const i=M-this._viewDim1+e;if("end"===t)n=i;else{const e=this._scrollPosition;n=Math.abs(e-M)<Math.abs(e-i)?M:i}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}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())}}
16604
16993
  /**
16605
16994
  * @license
16606
16995
  * Copyright 2021 Google LLC
16607
16996
  * SPDX-License-Identifier: BSD-3-Clause
16608
- */function IQ(e){return"horizontal"===e?"marginLeft":"marginTop"}function zQ(e){return"horizontal"===e?"marginRight":"marginBottom"}function dQ(e){return"horizontal"===e?"xOffset":"yOffset"}function hQ(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 TQ{constructor(){this._childSizeCache=new cQ,this._marginSizeCache=new cQ,this._metricsCache=new Map}update(e,t){const i=new Set;Object.keys(e).forEach((M=>{const n=Number(M);this._metricsCache.set(n,e[n]),this._childSizeCache.set(n,e[n][DQ(t)]),i.add(n),i.add(n+1)}));for(const e of i){const i=this._metricsCache.get(e)?.[IQ(t)]||0,M=this._metricsCache.get(e-1)?.[zQ(t)]||0;this._marginSizeCache.set(e,hQ(i,M))}}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)?.[IQ(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 yQ=Object.freeze({__proto__:null,FlowLayout:class extends jQ{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new TQ,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),M=this._getPhysicalItem(this._last),n=i.pos;if(M.pos+this._metricsCache.getChildSize(this._last)<e)return this._calculateAnchor(e,t);if(n>t)return this._calculateAnchor(e,t);let o=this._firstVisible-1,r=-1/0;for(;r<e;){r=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_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 M=this._getSize(this._anchorIdx);void 0===M&&(this._stable=!1,M=this._getAverageSize());const n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-M);let r=0;for(this._anchorPos+M+o<t&&(r=t-(this._anchorPos+M+o)),this._anchorPos-n>i&&(r=i-(this._anchorPos-n)),r&&(this._scrollPosition-=r,t-=r,i-=r,this._scrollError+=r),e.set(this._anchorIdx,{pos:this._anchorPos,size:M}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+M+o;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 M=this._physicalMin;if(e.set(this._first,{pos:M,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 M=this._physicalMax;if(e.set(this._last,{pos:M,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,[dQ(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{kx as NileAccordion,In as NileAutoComplete,ex as NileAvatar,gt as NileBadge,Ip as NileBreadcrumb,dp as NileBreadcrumbItem,_e as NileButton,vp as NileButtonFilter,Zn as NileButtonToggle,Wn as NileButtonToggleGroup,Cn as NileCalendar,Ap as NileCard,mp as NileCarousel,pp as NileCarouselItem,ft as NileCheckbox,dn as NileChip,Yp as NileCircularProgressbar,Np as NileCodeEditor,$n as NileContentEditor,pn as NileDatePicker,qn as NileDialog,bx as NileDivider,Ct as NileDrawer,Nn as NileDropdown,nx as NileEmptyState,Ln as NileErrorMessage,eo as NileErrorNotification,$L as NileFilePreview,fL as NileFileUpload,nL as NileFilterChip,Kx as NileFloatingPanel,mn as NileFormErrorMessage,Tp as NileFormGroup,wn as NileFormHelpText,Ix as NileFormatDate,dS as NileGrid,TS as NileGridBody,LS as NileGridCellItem,mS as NileGridHead,pS as NileGridHeadItem,AS as NileGridRow,Fe as NileHeading,rx as NileHero,ux as NileHeroHeader,Qe as NileIcon,Nt as NileIconButton,Gx as NileInlineEdit,bm as NileInlineSidebar,km as NileInlineSidebarGroup,vm as NileInlineSidebarItem,ot as NileInput,vn as NileLink,wx as NileList,mx as NileListItem,rM as NileLoader,st as NileMenu,nn as NileMenuItem,tn as NileOption,qL as NileOptionGroup,ix as NilePageHeader,sL as NilePagination,bp as NilePopover,Ki as NilePopup,aM as NileProgressBar,Ut as NileRadio,Zt as NileRadioGroup,qS as NileRichTextEditor,Yx as NileSectionMessage,KM as NileSelect,em as NileSideBar,pm as NileSideBarAction,wm as NileSideBarActionMenu,mm as NileSideBarActionMenuItem,rm as NileSideBarExpand,Im as NileSideBarFooter,dm as NileSideBarFooterItem,Lm as NileSideBarFooterText,am as NileSideBarGroup,Nm as NileSideBarGroupItem,um as NileSideBarGroupItemIcon,Dm as NileSideBarGroupItemText,im as NileSideBarHeader,nm as NileSideBarLogo,uQ as NileSideBarPanel,uM as NileSkeletonLoader,nM as NileSlideToggle,DL as NileSlider,NM as NileSpinner,dx as NileSplitPanel,Nx as NileStepper,ax as NileStepperItem,Fn as NileSwitcher,oo as NileTab,io as NileTabGroup,ao as NileTabPanel,tL as NileTable,$p as NileTableBody,_p as NileTableCellItem,qp as NileTableHeaderItem,Hp as NileTableRow,jM as NileTag,Tn as NileTextarea,vx as NileTitle,Dp as NileToast,Vx as NileToolbar,iM as NileTooltip,Lx as NileTree,Ox as NileTreeItem,Dx as NileVerticalStepperItem,$M as NileVirtualSelect,NQ as NileliteTooltip};
16997
+ */function TQ(e){return"horizontal"===e?"marginLeft":"marginTop"}function yQ(e){return"horizontal"===e?"marginRight":"marginBottom"}function AQ(e){return"horizontal"===e?"xOffset":"yOffset"}function OQ(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 pQ{constructor(){this._childSizeCache=new zQ,this._marginSizeCache=new zQ,this._metricsCache=new Map}update(e,t){const i=new Set;Object.keys(e).forEach((M=>{const n=Number(M);this._metricsCache.set(n,e[n]),this._childSizeCache.set(n,e[n][dQ(t)]),i.add(n),i.add(n+1)}));for(const e of i){const i=this._metricsCache.get(e)?.[TQ(t)]||0,M=this._metricsCache.get(e-1)?.[yQ(t)]||0;this._marginSizeCache.set(e,OQ(i,M))}}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)?.[TQ(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 xQ=Object.freeze({__proto__:null,FlowLayout:class extends hQ{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new pQ,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),M=this._getPhysicalItem(this._last),n=i.pos;if(M.pos+this._metricsCache.getChildSize(this._last)<e)return this._calculateAnchor(e,t);if(n>t)return this._calculateAnchor(e,t);let o=this._firstVisible-1,r=-1/0;for(;r<e;){r=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_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 M=this._getSize(this._anchorIdx);void 0===M&&(this._stable=!1,M=this._getAverageSize());const n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-M);let r=0;for(this._anchorPos+M+o<t&&(r=t-(this._anchorPos+M+o)),this._anchorPos-n>i&&(r=i-(this._anchorPos-n)),r&&(this._scrollPosition-=r,t-=r,i-=r,this._scrollError+=r),e.set(this._anchorIdx,{pos:this._anchorPos,size:M}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+M+o;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 M=this._physicalMin;if(e.set(this._first,{pos:M,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 M=this._physicalMax;if(e.set(this._last,{pos:M,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,[AQ(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{kx as NileAccordion,In as NileAutoComplete,ex as NileAvatar,gt as NileBadge,Ip as NileBreadcrumb,dp as NileBreadcrumbItem,_e as NileButton,vp as NileButtonFilter,Zn as NileButtonToggle,Wn as NileButtonToggleGroup,Cn as NileCalendar,Ap as NileCard,mp as NileCarousel,pp as NileCarouselItem,ft as NileCheckbox,dn as NileChip,Yp as NileCircularProgressbar,Np as NileCodeEditor,$n as NileContentEditor,pn as NileDatePicker,IQ as NileDetail,qn as NileDialog,bx as NileDivider,Ct as NileDrawer,Nn as NileDropdown,nx as NileEmptyState,Ln as NileErrorMessage,eo as NileErrorNotification,$L as NileFilePreview,fL as NileFileUpload,nL as NileFilterChip,Kx as NileFloatingPanel,mn as NileFormErrorMessage,Tp as NileFormGroup,wn as NileFormHelpText,Ix as NileFormatDate,dS as NileGrid,TS as NileGridBody,LS as NileGridCellItem,mS as NileGridHead,pS as NileGridHeadItem,AS as NileGridRow,Fe as NileHeading,rx as NileHero,ux as NileHeroHeader,Qe as NileIcon,Nt as NileIconButton,Gx as NileInlineEdit,bm as NileInlineSidebar,km as NileInlineSidebarGroup,vm as NileInlineSidebarItem,ot as NileInput,vn as NileLink,wx as NileList,mx as NileListItem,rM as NileLoader,st as NileMenu,nn as NileMenuItem,tn as NileOption,qL as NileOptionGroup,ix as NilePageHeader,sL as NilePagination,bp as NilePopover,Ki as NilePopup,aM as NileProgressBar,Ut as NileRadio,Zt as NileRadioGroup,qS as NileRichTextEditor,Yx as NileSectionMessage,KM as NileSelect,em as NileSideBar,pm as NileSideBarAction,wm as NileSideBarActionMenu,mm as NileSideBarActionMenuItem,rm as NileSideBarExpand,Im as NileSideBarFooter,dm as NileSideBarFooterItem,Lm as NileSideBarFooterText,am as NileSideBarGroup,Nm as NileSideBarGroupItem,um as NileSideBarGroupItemIcon,Dm as NileSideBarGroupItemText,im as NileSideBarHeader,nm as NileSideBarLogo,uQ as NileSideBarPanel,uM as NileSkeletonLoader,nM as NileSlideToggle,DL as NileSlider,NM as NileSpinner,dx as NileSplitPanel,Nx as NileStepper,ax as NileStepperItem,Fn as NileSwitcher,oo as NileTab,io as NileTabGroup,ao as NileTabPanel,tL as NileTable,$p as NileTableBody,_p as NileTableCellItem,qp as NileTableHeaderItem,Hp as NileTableRow,jM as NileTag,Tn as NileTextarea,vx as NileTitle,Dp as NileToast,Vx as NileToolbar,iM as NileTooltip,Lx as NileTree,Ox as NileTreeItem,Dx as NileVerticalStepperItem,$M as NileVirtualSelect,NQ as NileliteTooltip};