@arbocollab/arbo-plugin-item-table 0.1.168 → 0.1.169

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.
@@ -41049,7 +41049,8 @@ const oae = { class: "wrapper-suffix" }, sae = /* @__PURE__ */ st({
41049
41049
  me("input", {
41050
41050
  type: "checkbox",
41051
41051
  checked: s.value,
41052
- onChange: kt(o, ["stop"])
41052
+ onChange: kt(o, ["stop"]),
41053
+ style: { "--input-size": "16px" }
41053
41054
  }, null, 40, Sae),
41054
41055
  p[1] || (p[1] = Qe(" Don't show this tip again ", -1))
41055
41056
  ], 2),
@@ -89920,7 +89921,7 @@ const pIe = {
89920
89921
  "beta-tag": "_beta-tag_1sow5_56"
89921
89922
  }, ZIe = {
89922
89923
  $style: YIe
89923
- }, XIe = /* @__PURE__ */ Ct(UIe, [["__cssModules", ZIe]]), hH = "0.1.168", JIe = { key: 0 }, QIe = /* @__PURE__ */ st({
89924
+ }, XIe = /* @__PURE__ */ Ct(UIe, [["__cssModules", ZIe]]), hH = "0.1.169", JIe = { key: 0 }, QIe = /* @__PURE__ */ st({
89924
89925
  __name: "app",
89925
89926
  setup(e) {
89926
89927
  const t = Y(() => n.id.length === 0 || n.workspaceId.length === 0), n = ws({
@@ -158,7 +158,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
158
158
  * @author RubaXa <trash@rubaxa.org>
159
159
  * @author owenm <owen23355@gmail.com>
160
160
  * @license MIT
161
- */function JO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function hi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JO(Object(n),!0).forEach(function(o){Jee(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function gv(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gv=function(t){return typeof t}:gv=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gv(e)}function Jee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sa(){return sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},sa.apply(this,arguments)}function Qee(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function ete(e,t){if(e==null)return{};var n=Qee(e,t),o,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var tte="1.14.0";function ra(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ia=ra(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pf=ra(/Edge/i),QO=ra(/firefox/i),kf=ra(/safari/i)&&!ra(/chrome/i)&&!ra(/android/i),eM=ra(/iP(ad|od|hone)/i),nte=ra(/chrome/i)&&ra(/android/i),tM={capture:!1,passive:!1};function Cn(e,t,n){e.addEventListener(t,n,!ia&&tM)}function pn(e,t,n){e.removeEventListener(t,n,!ia&&tM)}function mv(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function ote(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function fi(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&mv(e,t):mv(e,t))||o&&e===n)return e;if(e===n)break}while(e=ote(e))}return null}var nM=/\s+/g;function Ns(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(nM," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(nM," ")}}function Bt(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function od(e,t){var n="";if(typeof e=="string")n=e;else do{var o=Bt(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function oM(e,t,n){if(e){var o=e.getElementsByTagName(t),s=0,r=o.length;if(n)for(;s<r;s++)n(o[s],s);return o}return[]}function pi(){var e=document.scrollingElement;return e||document.documentElement}function So(e,t,n,o,s){if(!(!e.getBoundingClientRect&&e!==window)){var r,i,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==pi()?(r=e.getBoundingClientRect(),i=r.top,a=r.left,l=r.bottom,c=r.right,u=r.height,d=r.width):(i=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(s=s||e.parentNode,!ia))do if(s&&s.getBoundingClientRect&&(Bt(s,"transform")!=="none"||n&&Bt(s,"position")!=="static")){var h=s.getBoundingClientRect();i-=h.top+parseInt(Bt(s,"border-top-width")),a-=h.left+parseInt(Bt(s,"border-left-width")),l=i+r.height,c=a+r.width;break}while(s=s.parentNode);if(o&&e!==window){var f=od(s||e),p=f&&f.a,g=f&&f.d;f&&(i/=g,a/=p,d/=p,u/=g,l=i+u,c=a+d)}return{top:i,left:a,bottom:l,right:c,width:d,height:u}}}function sM(e,t,n){for(var o=Ja(e,!0),s=So(e)[t];o;){var r=So(o)[n],i=void 0;if(i=s>=r,!i)return o;if(o===pi())break;o=Ja(o,!1)}return!1}function sd(e,t,n,o){for(var s=0,r=0,i=e.children;r<i.length;){if(i[r].style.display!=="none"&&i[r]!==$t.ghost&&(o||i[r]!==$t.dragged)&&fi(i[r],n.draggable,e,!1)){if(s===t)return i[r];s++}r++}return null}function QS(e,t){for(var n=e.lastElementChild;n&&(n===$t.ghost||Bt(n,"display")==="none"||t&&!mv(n,t));)n=n.previousElementSibling;return n||null}function rr(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==$t.clone&&(!t||mv(e,t))&&n++;return n}function rM(e){var t=0,n=0,o=pi();if(e)do{var s=od(e),r=s.a,i=s.d;t+=e.scrollLeft*r,n+=e.scrollTop*i}while(e!==o&&(e=e.parentNode));return[t,n]}function ste(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function Ja(e,t){if(!e||!e.getBoundingClientRect)return pi();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=Bt(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return pi();if(o||t)return n;o=!0}}while(n=n.parentNode);return pi()}function rte(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function eE(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Af;function iM(e,t){return function(){if(!Af){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),Af=setTimeout(function(){Af=void 0},t)}}}function ite(){clearTimeout(Af),Af=void 0}function aM(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function lM(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Ls="Sortable"+new Date().getTime();function ate(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(s){if(!(Bt(s,"display")==="none"||s===$t.ghost)){e.push({target:s,rect:So(s)});var r=hi({},e[e.length-1].rect);if(s.thisAnimationDuration){var i=od(s,!0);i&&(r.top-=i.f,r.left-=i.e)}s.fromRect=r}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(ste(e,{target:o}),1)},animateAll:function(o){var s=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,i=0;e.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=So(c),h=c.prevFromRect,f=c.prevToRect,p=a.rect,g=od(c,!0);g&&(d.top-=g.f,d.left-=g.e),c.toRect=d,c.thisAnimationDuration&&eE(h,d)&&!eE(u,d)&&(p.top-d.top)/(p.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=cte(p,h,f,s.options)),eE(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=s.options.animation),s.animate(c,p,d,l)),l&&(r=!0,i=Math.max(i,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},i):typeof o=="function"&&o(),e=[]},animate:function(o,s,r,i){if(i){Bt(o,"transition",""),Bt(o,"transform","");var a=od(this.el),l=a&&a.a,c=a&&a.d,u=(s.left-r.left)/(l||1),d=(s.top-r.top)/(c||1);o.animatingX=!!u,o.animatingY=!!d,Bt(o,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=lte(o),Bt(o,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),Bt(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){Bt(o,"transition",""),Bt(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},i)}}}}function lte(e){return e.offsetWidth}function cte(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var rd=[],tE={initializeByDefault:!0},Of={mount:function(t){for(var n in tE)tE.hasOwnProperty(n)&&!(n in t)&&(t[n]=tE[n]);rd.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),rd.push(t)},pluginEvent:function(t,n,o){var s=this;this.eventCanceled=!1,o.cancel=function(){s.eventCanceled=!0};var r=t+"Global";rd.forEach(function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](hi({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](hi({sortable:n},o)))})},initializePlugins:function(t,n,o,s){rd.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,sa(o,c.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var i=this.modifyOption(t,r,t.options[r]);typeof i<"u"&&(t.options[r]=i)}},getEventProperties:function(t,n){var o={};return rd.forEach(function(s){typeof s.eventProperties=="function"&&sa(o,s.eventProperties.call(n[s.pluginName],t))}),o},modifyOption:function(t,n,o){var s;return rd.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(s=r.optionListeners[n].call(t[r.pluginName],o))}),s}};function ute(e){var t=e.sortable,n=e.rootEl,o=e.name,s=e.targetEl,r=e.cloneEl,i=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Ls],!!t){var g,v=t.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!ia&&!Pf?g=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(o,!0,!0)),g.to=i||n,g.from=a||n,g.item=s||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=hi(hi({},p),Of.getEventProperties(o,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[w]&&v[w].call(t,g)}}var dte=["evt"],vs=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.evt,r=ete(o,dte);Of.pluginEvent.bind($t)(t,n,hi({dragEl:gt,parentEl:eo,ghostEl:Xt,rootEl:Gn,nextEl:hc,lastDownEl:vv,cloneEl:to,cloneHidden:Qa,dragStarted:Nf,putSortable:Oo,activeSortable:$t.active,originalEvent:s,oldIndex:id,oldDraggableIndex:Mf,newIndex:Vs,newDraggableIndex:el,hideGhostForTarget:gM,unhideGhostForTarget:mM,cloneNowHidden:function(){Qa=!0},cloneNowShown:function(){Qa=!1},dispatchSortableEvent:function(a){os({sortable:n,name:a,originalEvent:s})}},r))};function os(e){ute(hi({putSortable:Oo,cloneEl:to,targetEl:gt,rootEl:Gn,oldIndex:id,oldDraggableIndex:Mf,newIndex:Vs,newDraggableIndex:el},e))}var gt,eo,Xt,Gn,hc,vv,to,Qa,id,Vs,Mf,el,yv,Oo,ad=!1,wv=!1,Cv=[],fc,Nr,nE,oE,cM,uM,Nf,ld,Lf,Vf=!1,bv=!1,Sv,jo,sE=[],rE=!1,Ev=[],_v=typeof document<"u",Rv=eM,dM=Pf||ia?"cssFloat":"float",hte=_v&&!nte&&!eM&&"draggable"in document.createElement("div"),hM=function(){if(_v){if(ia)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),fM=function(t,n){var o=Bt(t),s=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=sd(t,0,n),i=sd(t,1,n),a=r&&Bt(r),l=i&&Bt(i),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+So(r).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+So(i).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return i&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=s&&o[dM]==="none"||i&&o[dM]==="none"&&c+u>s)?"vertical":"horizontal"},fte=function(t,n,o){var s=o?t.left:t.top,r=o?t.right:t.bottom,i=o?t.width:t.height,a=o?n.left:n.top,l=o?n.right:n.bottom,c=o?n.width:n.height;return s===a||r===l||s+i/2===a+c/2},pte=function(t,n){var o;return Cv.some(function(s){var r=s[Ls].options.emptyInsertThreshold;if(!(!r||QS(s))){var i=So(s),a=t>=i.left-r&&t<=i.right+r,l=n>=i.top-r&&n<=i.bottom+r;if(a&&l)return o=s}}),o},pM=function(t){function n(r,i){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(i||d))return!0;if(r==null||r===!1)return!1;if(i&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,c,u),i)(a,l,c,u);var h=(i?a:l).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},s=t.group;(!s||gv(s)!="object")&&(s={name:s}),o.name=s.name,o.checkPull=n(s.pull,!0),o.checkPut=n(s.put),o.revertClone=s.revertClone,t.group=o},gM=function(){!hM&&Xt&&Bt(Xt,"display","none")},mM=function(){!hM&&Xt&&Bt(Xt,"display","")};_v&&document.addEventListener("click",function(e){if(wv)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),wv=!1,!1},!0);var pc=function(t){if(gt){t=t.touches?t.touches[0]:t;var n=pte(t.clientX,t.clientY);if(n){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[Ls]._onDragOver(o)}}},gte=function(t){gt&&gt.parentNode[Ls]._isOutsideThisEl(t.target)};function $t(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=sa({},t),e[Ls]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return fM(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(i,a){i.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:$t.supportPointer!==!1&&"PointerEvent"in window&&!kf,emptyInsertThreshold:5};Of.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);pM(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:hte,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Cn(e,"pointerdown",this._onTapStart):(Cn(e,"mousedown",this._onTapStart),Cn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Cn(e,"dragover",this),Cn(e,"dragenter",this)),Cv.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),sa(this,ate())}$t.prototype={constructor:$t,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ld=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,gt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,s=this.options,r=s.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=s.filter;if(Ete(o),!gt&&!(/mousedown|pointerdown/.test(i)&&t.button!==0||s.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&kf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=fi(l,s.draggable,o,!1),!(l&&l.animated)&&vv!==l)){if(id=rr(l),Mf=rr(l,s.draggable),typeof u=="function"){if(u.call(this,t,l,this)){os({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:o,fromEl:o}),vs("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=fi(c,d.trim(),o,!1),d)return os({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:o,toEl:o}),vs("filter",n,{evt:t}),!0}),u)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!fi(c,s.handle,o,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,o){var s=this,r=s.el,i=s.options,a=r.ownerDocument,l;if(o&&!gt&&o.parentNode===r){var c=So(o);if(Gn=r,gt=o,eo=gt.parentNode,hc=gt.nextSibling,vv=o,yv=i.group,$t.dragged=gt,fc={target:gt,clientX:(n||t).clientX,clientY:(n||t).clientY},cM=fc.clientX-c.left,uM=fc.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,gt.style["will-change"]="all",l=function(){if(vs("delayEnded",s,{evt:t}),$t.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!QO&&s.nativeDraggable&&(gt.draggable=!0),s._triggerDragStart(t,n),os({sortable:s,name:"choose",originalEvent:t}),Ns(gt,i.chosenClass,!0)},i.ignore.split(",").forEach(function(u){oM(gt,u.trim(),iE)}),Cn(a,"dragover",pc),Cn(a,"mousemove",pc),Cn(a,"touchmove",pc),Cn(a,"mouseup",s._onDrop),Cn(a,"touchend",s._onDrop),Cn(a,"touchcancel",s._onDrop),QO&&this.nativeDraggable&&(this.options.touchStartThreshold=4,gt.draggable=!0),vs("delayStart",this,{evt:t}),i.delay&&(!i.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pf||ia))){if($t.eventCanceled){this._onDrop();return}Cn(a,"mouseup",s._disableDelayedDrag),Cn(a,"touchend",s._disableDelayedDrag),Cn(a,"touchcancel",s._disableDelayedDrag),Cn(a,"mousemove",s._delayedDragTouchMoveHandler),Cn(a,"touchmove",s._delayedDragTouchMoveHandler),i.supportPointer&&Cn(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,i.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){gt&&iE(gt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pn(t,"mouseup",this._disableDelayedDrag),pn(t,"touchend",this._disableDelayedDrag),pn(t,"touchcancel",this._disableDelayedDrag),pn(t,"mousemove",this._delayedDragTouchMoveHandler),pn(t,"touchmove",this._delayedDragTouchMoveHandler),pn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?Cn(document,"pointermove",this._onTouchMove):n?Cn(document,"touchmove",this._onTouchMove):Cn(document,"mousemove",this._onTouchMove):(Cn(gt,"dragend",this),Cn(Gn,"dragstart",this._onDragStart));try{document.selection?Tv(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(ad=!1,Gn&&gt){vs("dragStarted",this,{evt:n}),this.nativeDraggable&&Cn(document,"dragover",gte);var o=this.options;!t&&Ns(gt,o.dragClass,!1),Ns(gt,o.ghostClass,!0),$t.active=this,t&&this._appendGhost(),os({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Nr){this._lastX=Nr.clientX,this._lastY=Nr.clientY,gM();for(var t=document.elementFromPoint(Nr.clientX,Nr.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Nr.clientX,Nr.clientY),t!==n);)n=t;if(gt.parentNode[Ls]._isOutsideThisEl(t),n)do{if(n[Ls]){var o=void 0;if(o=n[Ls]._onDragOver({clientX:Nr.clientX,clientY:Nr.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);mM()}},_onTouchMove:function(t){if(fc){var n=this.options,o=n.fallbackTolerance,s=n.fallbackOffset,r=t.touches?t.touches[0]:t,i=Xt&&od(Xt,!0),a=Xt&&i&&i.a,l=Xt&&i&&i.d,c=Rv&&jo&&rM(jo),u=(r.clientX-fc.clientX+s.x)/(a||1)+(c?c[0]-sE[0]:0)/(a||1),d=(r.clientY-fc.clientY+s.y)/(l||1)+(c?c[1]-sE[1]:0)/(l||1);if(!$t.active&&!ad){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(Xt){i?(i.e+=u-(nE||0),i.f+=d-(oE||0)):i={a:1,b:0,c:0,d:1,e:u,f:d};var h="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");Bt(Xt,"webkitTransform",h),Bt(Xt,"mozTransform",h),Bt(Xt,"msTransform",h),Bt(Xt,"transform",h),nE=u,oE=d,Nr=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Xt){var t=this.options.fallbackOnBody?document.body:Gn,n=So(gt,!0,Rv,!0,t),o=this.options;if(Rv){for(jo=t;Bt(jo,"position")==="static"&&Bt(jo,"transform")==="none"&&jo!==document;)jo=jo.parentNode;jo!==document.body&&jo!==document.documentElement?(jo===document&&(jo=pi()),n.top+=jo.scrollTop,n.left+=jo.scrollLeft):jo=pi(),sE=rM(jo)}Xt=gt.cloneNode(!0),Ns(Xt,o.ghostClass,!1),Ns(Xt,o.fallbackClass,!0),Ns(Xt,o.dragClass,!0),Bt(Xt,"transition",""),Bt(Xt,"transform",""),Bt(Xt,"box-sizing","border-box"),Bt(Xt,"margin",0),Bt(Xt,"top",n.top),Bt(Xt,"left",n.left),Bt(Xt,"width",n.width),Bt(Xt,"height",n.height),Bt(Xt,"opacity","0.8"),Bt(Xt,"position",Rv?"absolute":"fixed"),Bt(Xt,"zIndex","100000"),Bt(Xt,"pointerEvents","none"),$t.ghost=Xt,t.appendChild(Xt),Bt(Xt,"transform-origin",cM/parseInt(Xt.style.width)*100+"% "+uM/parseInt(Xt.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,s=t.dataTransfer,r=o.options;if(vs("dragStart",this,{evt:t}),$t.eventCanceled){this._onDrop();return}vs("setupClone",this),$t.eventCanceled||(to=lM(gt),to.draggable=!1,to.style["will-change"]="",this._hideClone(),Ns(to,this.options.chosenClass,!1),$t.clone=to),o.cloneId=Tv(function(){vs("clone",o),!$t.eventCanceled&&(o.options.removeCloneOnHide||Gn.insertBefore(to,gt),o._hideClone(),os({sortable:o,name:"clone"}))}),!n&&Ns(gt,r.dragClass,!0),n?(wv=!0,o._loopId=setInterval(o._emulateDragOver,50)):(pn(document,"mouseup",o._onDrop),pn(document,"touchend",o._onDrop),pn(document,"touchcancel",o._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(o,s,gt)),Cn(document,"drop",o),Bt(gt,"transform","translateZ(0)")),ad=!0,o._dragStartId=Tv(o._dragStarted.bind(o,n,t)),Cn(document,"selectstart",o),Nf=!0,kf&&Bt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,s,r,i,a=this.options,l=a.group,c=$t.active,u=yv===l,d=a.sort,h=Oo||c,f,p=this,g=!1;if(rE)return;function v(J,ae){vs(J,p,hi({evt:t,isOwner:u,axis:f?"vertical":"horizontal",revert:i,dragRect:s,targetRect:r,canSort:d,fromSortable:h,target:o,completed:S,onMove:function(ee,$){return Dv(Gn,n,gt,s,ee,So(ee),t,$)},changed:b},ae))}function w(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(J){return v("dragOverCompleted",{insertion:J}),J&&(u?c._hideClone():c._showClone(p),p!==h&&(Ns(gt,Oo?Oo.options.ghostClass:c.options.ghostClass,!1),Ns(gt,a.ghostClass,!0)),Oo!==p&&p!==$t.active?Oo=p:p===$t.active&&Oo&&(Oo=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===gt&&!gt.animated||o===n&&!o.animated)&&(ld=null),!a.dragoverBubble&&!t.rootEl&&o!==document&&(gt.parentNode[Ls]._isOutsideThisEl(t.target),!J&&pc(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Vs=rr(gt),el=rr(gt,a.draggable),os({sortable:p,name:"change",toEl:n,newIndex:Vs,newDraggableIndex:el,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=fi(o,a.draggable,n,!0),v("dragOver"),$t.eventCanceled)return g;if(gt.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return S(!1);if(wv=!1,c&&!a.disabled&&(u?d||(i=eo!==Gn):Oo===this||(this.lastPutMode=yv.checkPull(this,c,gt,t))&&l.checkPut(this,c,gt,t))){if(f=this._getDirection(t,o)==="vertical",s=So(gt),v("dragOverValid"),$t.eventCanceled)return g;if(i)return eo=Gn,w(),this._hideClone(),v("revert"),$t.eventCanceled||(hc?Gn.insertBefore(gt,hc):Gn.appendChild(gt)),S(!0);var C=QS(n,a.draggable);if(!C||wte(t,f,this)&&!C.animated){if(C===gt)return S(!1);if(C&&n===t.target&&(o=C),o&&(r=So(o)),Dv(Gn,n,gt,s,o,r,t,!!o)!==!1)return w(),n.appendChild(gt),eo=n,b(),S(!0)}else if(C&&yte(t,f,this)){var _=sd(n,0,a,!0);if(_===gt)return S(!1);if(o=_,r=So(o),Dv(Gn,n,gt,s,o,r,t,!1)!==!1)return w(),n.insertBefore(gt,_),eo=n,b(),S(!0)}else if(o.parentNode===n){r=So(o);var E=0,x,I=gt.parentNode!==n,F=!fte(gt.animated&&gt.toRect||s,o.animated&&o.toRect||r,f),M=f?"top":"left",T=sM(o,"top","top")||sM(gt,"top","top"),A=T?T.scrollTop:void 0;ld!==o&&(x=r[M],Vf=!1,bv=!F&&a.invertSwap||I),E=Cte(t,o,r,f,F?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,bv,ld===o);var k;if(E!==0){var P=rr(gt);do P-=E,k=eo.children[P];while(k&&(Bt(k,"display")==="none"||k===Xt))}if(E===0||k===o)return S(!1);ld=o,Lf=E;var D=o.nextElementSibling,N=!1;N=E===1;var G=Dv(Gn,n,gt,s,o,r,t,N);if(G!==!1)return(G===1||G===-1)&&(N=G===1),rE=!0,setTimeout(vte,30),w(),N&&!D?n.appendChild(gt):o.parentNode.insertBefore(gt,N?D:o),T&&aM(T,0,A-T.scrollTop),eo=gt.parentNode,x!==void 0&&!bv&&(Sv=Math.abs(x-So(o)[M])),b(),S(!0)}if(n.contains(gt))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pn(document,"mousemove",this._onTouchMove),pn(document,"touchmove",this._onTouchMove),pn(document,"pointermove",this._onTouchMove),pn(document,"dragover",pc),pn(document,"mousemove",pc),pn(document,"touchmove",pc)},_offUpEvents:function(){var t=this.el.ownerDocument;pn(t,"mouseup",this._onDrop),pn(t,"touchend",this._onDrop),pn(t,"pointerup",this._onDrop),pn(t,"touchcancel",this._onDrop),pn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(Vs=rr(gt),el=rr(gt,o.draggable),vs("drop",this,{evt:t}),eo=gt&&gt.parentNode,Vs=rr(gt),el=rr(gt,o.draggable),$t.eventCanceled){this._nulling();return}ad=!1,bv=!1,Vf=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),aE(this.cloneId),aE(this._dragStartId),this.nativeDraggable&&(pn(document,"drop",this),pn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),kf&&Bt(document.body,"user-select",""),Bt(gt,"transform",""),t&&(Nf&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),Xt&&Xt.parentNode&&Xt.parentNode.removeChild(Xt),(Gn===eo||Oo&&Oo.lastPutMode!=="clone")&&to&&to.parentNode&&to.parentNode.removeChild(to),gt&&(this.nativeDraggable&&pn(gt,"dragend",this),iE(gt),gt.style["will-change"]="",Nf&&!ad&&Ns(gt,Oo?Oo.options.ghostClass:this.options.ghostClass,!1),Ns(gt,this.options.chosenClass,!1),os({sortable:this,name:"unchoose",toEl:eo,newIndex:null,newDraggableIndex:null,originalEvent:t}),Gn!==eo?(Vs>=0&&(os({rootEl:eo,name:"add",toEl:eo,fromEl:Gn,originalEvent:t}),os({sortable:this,name:"remove",toEl:eo,originalEvent:t}),os({rootEl:eo,name:"sort",toEl:eo,fromEl:Gn,originalEvent:t}),os({sortable:this,name:"sort",toEl:eo,originalEvent:t})),Oo&&Oo.save()):Vs!==id&&Vs>=0&&(os({sortable:this,name:"update",toEl:eo,originalEvent:t}),os({sortable:this,name:"sort",toEl:eo,originalEvent:t})),$t.active&&((Vs==null||Vs===-1)&&(Vs=id,el=Mf),os({sortable:this,name:"end",toEl:eo,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){vs("nulling",this),Gn=gt=eo=Xt=hc=to=vv=Qa=fc=Nr=Nf=Vs=el=id=Mf=ld=Lf=Oo=yv=$t.dragged=$t.ghost=$t.clone=$t.active=null,Ev.forEach(function(t){t.checked=!0}),Ev.length=nE=oE=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":gt&&(this._onDragOver(t),mte(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,s=0,r=o.length,i=this.options;s<r;s++)n=o[s],fi(n,i.draggable,this.el,!1)&&t.push(n.getAttribute(i.dataIdAttr)||Ste(n));return t},sort:function(t,n){var o={},s=this.el;this.toArray().forEach(function(r,i){var a=s.children[i];fi(a,this.options.draggable,s,!1)&&(o[r]=a)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(s.removeChild(o[r]),s.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return fi(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var s=Of.modifyOption(this,t,n);typeof s<"u"?o[t]=s:o[t]=n,t==="group"&&pM(o)},destroy:function(){vs("destroy",this);var t=this.el;t[Ls]=null,pn(t,"mousedown",this._onTapStart),pn(t,"touchstart",this._onTapStart),pn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pn(t,"dragover",this),pn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Cv.splice(Cv.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Qa){if(vs("hideClone",this),$t.eventCanceled)return;Bt(to,"display","none"),this.options.removeCloneOnHide&&to.parentNode&&to.parentNode.removeChild(to),Qa=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Qa){if(vs("showClone",this),$t.eventCanceled)return;gt.parentNode==Gn&&!this.options.group.revertClone?Gn.insertBefore(to,gt):hc?Gn.insertBefore(to,hc):Gn.appendChild(to),this.options.group.revertClone&&this.animate(gt,to),Bt(to,"display",""),Qa=!1}}};function mte(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Dv(e,t,n,o,s,r,i,a){var l,c=e[Ls],u=c.options.onMove,d;return window.CustomEvent&&!ia&&!Pf?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=o,l.related=s||t,l.relatedRect=r||So(t),l.willInsertAfter=a,l.originalEvent=i,e.dispatchEvent(l),u&&(d=u.call(c,l,i)),d}function iE(e){e.draggable=!1}function vte(){rE=!1}function yte(e,t,n){var o=So(sd(n.el,0,n.options,!0)),s=10;return t?e.clientX<o.left-s||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-s||e.clientY<o.bottom&&e.clientX<o.left}function wte(e,t,n){var o=So(QS(n.el,n.options.draggable)),s=10;return t?e.clientX>o.right+s||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+s}function Cte(e,t,n,o,s,r,i,a){var l=o?e.clientY:e.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!i){if(a&&Sv<c*s){if(!Vf&&(Lf===1?l>u+c*r/2:l<d-c*r/2)&&(Vf=!0),Vf)h=!0;else if(Lf===1?l<u+Sv:l>d-Sv)return-Lf}else if(l>u+c*(1-s)/2&&l<d-c*(1-s)/2)return bte(t)}return h=h||i,h&&(l<u+c*r/2||l>d-c*r/2)?l>u+c/2?1:-1:0}function bte(e){return rr(gt)<rr(e)?1:-1}function Ste(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function Ete(e){Ev.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&Ev.push(o)}}function Tv(e){return setTimeout(e,0)}function aE(e){return clearTimeout(e)}_v&&Cn(document,"touchmove",function(e){($t.active||ad)&&e.cancelable&&e.preventDefault()}),$t.utils={on:Cn,off:pn,css:Bt,find:oM,is:function(t,n){return!!fi(t,n,t,!1)},extend:rte,throttle:iM,closest:fi,toggleClass:Ns,clone:lM,index:rr,nextTick:Tv,cancelNextTick:aE,detectDirection:fM,getChild:sd},$t.get=function(e){return e[Ls]},$t.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&($t.utils=hi(hi({},$t.utils),o.utils)),Of.mount(o)})},$t.create=function(e,t){return new $t(e,t)},$t.version=tte;var po=[],Bf,lE,cE=!1,uE,dE,Iv,$f;function _te(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?Cn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Cn(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Cn(document,"touchmove",this._handleFallbackAutoScroll):Cn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?pn(document,"dragover",this._handleAutoScroll):(pn(document,"pointermove",this._handleFallbackAutoScroll),pn(document,"touchmove",this._handleFallbackAutoScroll),pn(document,"mousemove",this._handleFallbackAutoScroll)),vM(),xv(),ite()},nulling:function(){Iv=lE=Bf=cE=$f=uE=dE=null,po.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var s=this,r=(n.touches?n.touches[0]:n).clientX,i=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(r,i);if(Iv=n,o||this.options.forceAutoScrollFallback||Pf||ia||kf){hE(n,this.options,a,o);var l=Ja(a,!0);cE&&(!$f||r!==uE||i!==dE)&&($f&&vM(),$f=setInterval(function(){var c=Ja(document.elementFromPoint(r,i),!0);c!==l&&(l=c,xv()),hE(n,s.options,c,o)},10),uE=r,dE=i)}else{if(!this.options.bubbleScroll||Ja(a,!0)===pi()){xv();return}hE(n,this.options,Ja(a,!1),!1)}}},sa(e,{pluginName:"scroll",initializeByDefault:!0})}function xv(){po.forEach(function(e){clearInterval(e.pid)}),po=[]}function vM(){clearInterval($f)}var hE=iM(function(e,t,n,o){if(t.scroll){var s=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,i=t.scrollSensitivity,a=t.scrollSpeed,l=pi(),c=!1,u;lE!==n&&(lE=n,xv(),Bf=t.scroll,u=t.scrollFn,Bf===!0&&(Bf=Ja(n,!0)));var d=0,h=Bf;do{var f=h,p=So(f),g=p.top,v=p.bottom,w=p.left,S=p.right,b=p.width,C=p.height,_=void 0,E=void 0,x=f.scrollWidth,I=f.scrollHeight,F=Bt(f),M=f.scrollLeft,T=f.scrollTop;f===l?(_=b<x&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),E=C<I&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(_=b<x&&(F.overflowX==="auto"||F.overflowX==="scroll"),E=C<I&&(F.overflowY==="auto"||F.overflowY==="scroll"));var A=_&&(Math.abs(S-s)<=i&&M+b<x)-(Math.abs(w-s)<=i&&!!M),k=E&&(Math.abs(v-r)<=i&&T+C<I)-(Math.abs(g-r)<=i&&!!T);if(!po[d])for(var P=0;P<=d;P++)po[P]||(po[P]={});(po[d].vx!=A||po[d].vy!=k||po[d].el!==f)&&(po[d].el=f,po[d].vx=A,po[d].vy=k,clearInterval(po[d].pid),(A!=0||k!=0)&&(c=!0,po[d].pid=setInterval((function(){o&&this.layer===0&&$t.active._onTouchMove(Iv);var D=po[this.layer].vy?po[this.layer].vy*a:0,N=po[this.layer].vx?po[this.layer].vx*a:0;typeof u=="function"&&u.call($t.dragged.parentNode[Ls],N,D,e,Iv,po[this.layer].el)!=="continue"||aM(po[this.layer].el,N,D)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=Ja(h,!1)));cE=c}},30),yM=function(t){var n=t.originalEvent,o=t.putSortable,s=t.dragEl,r=t.activeSortable,i=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var c=o||r;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(i("spill"),this.onSpill({dragEl:s,putSortable:o}))}};function fE(){}fE.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var s=sd(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(n,s):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:yM},sa(fE,{pluginName:"revertOnSpill"});function pE(){}pE.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,s=o||this.sortable;s.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),s.animateAll()},drop:yM},sa(pE,{pluginName:"removeOnSpill"}),$t.mount(new _te),$t.mount(pE,fE);function Rte(e,t){return Object.values(e).indexOf(t)}function Dte(e,t,n,o){if(!e)return[];const s=Object.values(e),r=t.length-o;return[...t].map((a,l)=>l>=r?s.length:s.indexOf(a))}function Tte(e){return["transition-group","TransitionGroup"].includes(e)}function wM(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?Tte(t.name):!1}function Ite(e,t){return t?{...t.props,...t.attrs}:e}const gE=["Start","Add","Remove","Update","End"],mE=["Choose","Unchoose","Sort","Filter","Clone"],xte=["Move",...gE,...mE].map(e=>"on"+e);let vE=null;const Fte=st({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...gE.map(e=>e.toLowerCase()),...mE.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:o}){const s=B(!1),r=B(!1),i=B(0),a=B(0),l=B([]),c=B(null),u=B(null),d=q(()=>e.list?e.list:e.modelValue),h=oo();function f(){return e.component?HG(e.component):e.tag}function p(j){if(u.value)for(const te in j){const pe=ZO(te);xte.indexOf(pe)===-1&&u.value.option(pe,j[te])}}function g(){var j;return((j=h==null?void 0:h.proxy)==null?void 0:j.$el.children)||[]}async function v(){var j;await vt(),l.value=Dte(g(),((j=h==null?void 0:h.proxy)==null?void 0:j.$el.children)||[],s.value,a.value)}function w(j){const te=Rte(g()||[],j);if(te===-1)return null;const pe=d.value?d.value[te]:null;return{index:te,element:pe}}function S(j){vt(()=>t("change",j))}function b(j){if(e.list){j(e.list);return}const te=[...e.modelValue||[]];j(te),t("update:modelValue",te)}function C(...j){b(pe=>pe.splice(...j))}function _(j,te){b(ve=>ve.splice(te,0,ve.splice(j,1)[0]))}function E(j){const te=l.value,pe=te.length;return j>pe-1?pe:te[j]}function x(){var te,pe;return n.default&&((pe=(te=n.default()[0])==null?void 0:te.component)==null?void 0:pe.proxy)||null}function I(j){if(!e.noTransitionOnDrag||!s.value)return;const te=g();te[j]&&(te[j].data=null);const pe=x();pe&&(pe.children=[],pe.kept=void 0)}function F(j){v(),c.value=w(j.item),c.value&&(j.item._underlying_vm_=e.clone(c.value.element),vE=j.item)}function M(j){const te=j.item._underlying_vm_;if(te===void 0)return;JS(j.item);const pe=E(j.newIndex);C(pe,0,te),v(),S({added:{element:te,newIndex:pe}})}function T(j){var pe;if(XO((pe=h==null?void 0:h.proxy)==null?void 0:pe.$el,j.item,j.oldIndex),j.pullMode==="clone"){JS(j.clone);return}if(!c.value)return;const te=c.value.index;C(te,1),I(te),S({removed:{element:c.value.element,oldIndex:te}})}function A(j){var ve,we;JS(j.item),XO(j.from,j.item,j.oldIndex);const te=(ve=c.value)==null?void 0:ve.index,pe=E(j.newIndex);_(te,pe),S({moved:{element:(we=c.value)==null?void 0:we.element,oldIndex:te,newIndex:pe}})}function k(j,te){Object.prototype.hasOwnProperty.call(j,te)&&(j[te]+=i.value)}function P(j){return j.__draggable_component__}function D({to:j,related:te}){const pe=P(j);if(!pe)return{component:pe};const ve=pe.realList,we={list:ve,component:pe};if(j!==te&&ve&&pe.getUnderlyingVm){const re=pe.getUnderlyingVm(te);if(re)return Object.assign(re,we)}return we}function N(j,te){const pe=[...te.to.children].filter(W=>W.style.display!=="none");if(pe.length===0)return 0;const ve=pe.indexOf(te.related),we=j.component.getVmIndex(ve);return pe.indexOf(vE)!==-1||!te.willInsertAfter?we:we+1}const G=()=>{var we,re;const j={};gE.forEach(W=>{j["on"+W]=ae(W)}),mE.forEach(W=>{j["on"+W]=J.bind(null,W)});const te=Object.keys(o).reduce((W,ge)=>(W[ZO(ge)]=o[ge],W),{}),pe=Object.assign({},te,j,{onMove:(W,ge)=>ne(W,ge)});"draggable"in pe||(pe.draggable=">*");const ve=((we=h==null?void 0:h.proxy)==null?void 0:we.$el.nodeType)===1?h.proxy.$el:((re=h==null?void 0:h.proxy)==null?void 0:re.$el.parentElement)||null;ve&&(u.value=new $t(ve,pe),ve.__draggable_component__=h==null?void 0:h.proxy,v())};function J(j,te){vt(()=>t(j.toLowerCase(),te))}function ae(j){return te=>{if(d.value!==null){const pe="onDrag"+j,ve=$[pe];ve&&ve(te)}J(j,te)}}function ne(j,te){const pe=e.move;if(!pe||!d.value)return!0;const ve=D(j),we=c.value,re=N(ve,j);we&&Object.assign(we,{futureIndex:re});const W=Object.assign({},j,{relatedContext:ve,draggedContext:we});return pe(W,te)}function ee(){v(),vE=null}const $={onDragStart:F,onDragAdd:M,onDragRemove:T,onDragUpdate:A,onDragMove:ne,onDragEnd:ee};return Qt(()=>{G()}),e.list!==null&&e.modelValue!==null&&Yee.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:r,headerOffset:i,footerOffset:a,transitionMode:s,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:w,emitChanges:S,alterList:b,spliceList:C,updatePosition:_,getVmIndex:E,getComponent:x,resetTransitionData:I,onDragStart:F,onDragAdd:M,onDragRemove:T,onDragUpdate:A,updateProperty:k,onDragMove:ne,onDragEnd:ee,mounted:G,context:c,sortableInstance:u,getRelatedContextFromMoveEvent:D,getTargetedComponent:P,computeFutureIndex:N}},render(){const e=this.getTag(),t=Ite(this.$attrs,this.componentData);if(typeof e=="string"){const o=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return o?(this.transitionMode=wM(o),su(e,t,o)):su(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const o=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=wM(o||[])}return su(e,t,n)}}),Pte=Ct(st({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=B([]),o=e,s=t,r=B({}),i=()=>{n.value=o.modelValue.map(c=>({id:c.field,name:c.headerName,...c}))||[],o.modelValue.forEach(c=>{r.value[c.field]={...c}})};tt(()=>o.modelValue,c=>{i()},{immediate:!0,deep:!0}),tt(n,c=>{if(c.length===o.modelValue.length&&!c.every((d,h)=>d.id===o.modelValue[h].field)){const d=c.map(h=>r.value[h.id]);s("changed",d),s("update:modelValue",d)}});const a=()=>!(o.readOnly||o.disabled),l=c=>!(o.readOnly||o.disabled);return(c,u)=>(K(),Ue(H(Fte),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),tag:"transition-group",disabled:o.disabled||o.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:he(()=>[(K(!0),ie(xt,null,Fn(n.value,(d,h)=>(K(),ie("div",{key:d.id,class:"fade-item"},[Tt(c.$slots,"item",{item:d,index:h},()=>[Qe(ut(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),kte={key:0},Ate={key:1,style:{"font-style":"italic"}},Ote={key:2,style:{"font-style":"italic"}},Mte={key:3},Fv=Ct(st({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""},focusIndex:{}},emits:["toggle-column"],setup(e,{emit:t}){const n=Yt,o=e,s=B(o.columnStates[String(o.item.field)]||!1),r=t,i=h=>{s.value=h},a=q(()=>{var h;return(h=o.item)==null?void 0:h.context}),l=q(()=>{var f,p,g;return(f=a.value)!=null&&f.formula?"formular":((g=(p=a.value)==null?void 0:p.metric_type)==null?void 0:g.code)||"number"}),c=q(()=>{var h,f;return(f=(h=o.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),u=q(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=q(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return tt(()=>s.value,()=>{r("toggle-column",o.item.field,o.item.required)}),(h,f)=>(K(),ie("div",{key:e.item.field,class:Q([h.$style["column-config__item"],{[h.$style.disabled]:o.readOnly,[h.$style["is-metric"]]:c.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:u.value}])},[ue(LO,{focusIndex:o.focusIndex,id:`col-${e.item.field}`,"model-value":s.value==!0?H(Ft).CHECKED:H(Ft).UNCHECK,"onUpdate:modelValue":i,disabled:o.disableCheckbox||e.isDisableNewCheck&&!s.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),Ke((K(),ie("div",{class:"move-handler",style:rn({cursor:o.disableDrag?"not-allowed":"move"})},[ue(lt,{color:o.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:Q(h.$style.handler)},null,8,["color","class"])],4)),[[H(n),o.disableDrag==!0?o.disableDragTooltip:""]]),c.value?(K(),ie("div",{key:0,class:Q(h.$style["metric-type"])},[l.value=="rating"?(K(),ie("span",kte,"★")):l.value=="formular"?(K(),ie("span",Ate," ƒx ")):l.value=="number"?(K(),ie("span",Ote," # ")):(K(),ie("span",Mte,ut(l.value),1))],2)):Xe("",!0),me("span",{class:Q(h.$style["column-config__item-label"])},[Ke((K(),ie("div",null,[Qe(ut(e.item.headerName),1)])),[[H(n),{content:e.item.headerName}]])],2),d.value?Ke((K(),ie("div",{key:1,class:Q(h.$style["metric-icon"])},[ue(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[H(n),"Point metric"]]):Xe("",!0),u.value?Ke((K(),ie("div",{key:2,class:Q(h.$style["metric-icon"])},[ue(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[H(n),"Woohoo metric"]]):Xe("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_1ppdl_1","is-metric":"_is-metric_1ppdl_8","is-woohoo-metric":"_is-woohoo-metric_1ppdl_12","is-point-metric":"_is-point-metric_1ppdl_15","column-config__item-label":"_column-config__item-label_1ppdl_18",disabled:"_disabled_1ppdl_34",readOnly:"_readOnly_1ppdl_38","column-config__item--pinned":"_column-config__item--pinned_1ppdl_41",handler:"_handler_1ppdl_48",badge:"_badge_1ppdl_52","metric-type":"_metric-type_1ppdl_78","metric-icon":"_metric-icon_1ppdl_106"}}]]),Nte=Ct(st({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{hide:r,triggerRef:i,popupRef:a,isVisible:l,toggle:c}=yo({toggleOnClick:!0,placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),u=q(()=>l.value);tt(l,f=>{s(f?"open":"close")});const d=()=>{r()};t({closeDropdown:d,isOpen:u});const h=f=>{f.key==="Escape"&&a.value&&r()};return Qt(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),qn(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(K(),ie("div",{ref_key:"triggerRef",ref:i,class:Q(f.$style["dropdown-wrapper"])},[Tt(f.$slots,"trigger",{open:H(l),toggle:H(c),closeDropdown:d},()=>[me("button",{class:Q(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),me("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:Q(f.$style["dropdown-content"]),style:rn({display:H(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[Tt(f.$slots,"content",{closeDropdown:d,visible:H(l)},()=>[me("div",{class:Q(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),Lte={class:"reach-limit-icon"},Vte=Ct(st({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=ko,i=n,a=B(""),l=B(),c=q(()=>a.value.trim().length>0),u=B([]),d=B({}),{triggerRef:h,popupRef:f,isVisible:p,hide:g}=yo({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});tt(p,P=>{var D;P&&((D=l.value)==null||D.focus())});const v=q(()=>s.disabled||a.value.length>0),w=q(()=>u.value.filter(P=>P.pinned==="left"&&P.field&&P.headerName)),S=q(()=>u.value.filter(P=>P.pinned==="right"&&P.field||P.field==="blank")),b=q({get:()=>u.value.filter(P=>!P.pinned&&P.field&&P.field!=="blank"),set:P=>{u.value=[...w.value,...P,...S.value]}}),C=q(()=>{if(!a.value)return{};const P=a.value.toLowerCase();return[...u.value,...b.value].reduce((D,N)=>{var G;return(G=N.headerName)!=null&&G.toLowerCase().includes(P)&&N.field&&(D[N.field]=!0),D},{})}),_=q(()=>s.modelValue),E=()=>{const P={};u.value.forEach(D=>{D.field&&(P[D.field]=!D.hide)}),d.value=P},x=q(()=>{if(!a.value)return u.value;const P=a.value.toLowerCase();return u.value.filter(D=>{var N;return(N=D.headerName)==null?void 0:N.toLowerCase().includes(P)})}),I=()=>{var N;const P=(N=s.gridApi)==null?void 0:N.getColumnState().reduce((G,J)=>(G[J.colId]=Number(J.width),G),{}),D=u.value.map(G=>({...G,hide:G.field?!d.value[G.field]:!1,width:G.field?P==null?void 0:P[G.field]:G.width}));i("update:modelValue",D),i("change",D),i("input",D)},F=P=>{const D=[...w.value,...P,...S.value];s.checkboxColumn&&D.unshift(s.checkboxColumn),u.value=D,I()},M=P=>{P&&(d.value[P]=!d.value[P],I())};tt(_,P=>{P&&P.length>0&&(u.value=[...P],E())}),t({updateColumnDefs(P){u.value=[...P],E()}});const T=q(()=>k.value>=5),A=q(()=>s.disabled||a.value.length>0),k=q(()=>u.value.reduce((P,D)=>D.field&&D.field.includes("metric")&&d.value[D.field]===!0?P+1:P,0));return(P,D)=>(K(),ie("div",{class:Q(P.$style["table-customization"])},[me("div",{ref_key:"triggerRef",ref:h},[Tt(P.$slots,"trigger",{},()=>[Ke((K(),Ue(at,{variant:["secondary"],disabled:s.disabled,actived:H(p),style:{width:"32px"},onEscape:H(g)},{prefix:he(()=>[ue(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[H(r),"7"],[H(o),"Columns"]])])],512),me("div",{ref_key:"popupRef",ref:f,class:Q(P.$style["tippy-content-wrapper"])},[me("div",{class:Q([P.$style["column-config"],T.value?P.$style["has-warning"]:""]),style:rn({"--max-height":s.tableHeight?s.tableHeight:"max(500px, 60vh)"})},[ue(SS,{tabIndex:"7.0",modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=N=>a.value=N),ref_key:"searchBoxRef",ref:l},null,8,["modelValue"]),me("div",{class:Q(P.$style["column-config__header"])},[...D[2]||(D[2]=[me("span",null,"Manage columns",-1)])],2),T.value?(K(),ie("div",{key:0,class:Q(P.$style["reach-limit"])},[me("div",Lte,[ue(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),me("div",{class:Q(P.$style["warning-limit-text"])},[...D[3]||(D[3]=[Qe(" You’ve reached the maximum number of metric columns. ",-1),me("br",null,null,-1),Qe(" Deselect one to show another. ",-1)])],2)],2)):Xe("",!0),c.value?(K(),ie(xt,{key:1},[x.value.length===0&&c.value?(K(),ie("div",{key:0,class:Q(P.$style["no-columns"])},[...D[4]||(D[4]=[Qe(" No results. ",-1),me("br",null,null,-1),Qe(" Try another search. ",-1)])],2)):Xe("",!0),c.value&&x.value.length>0?(K(),ie("div",{key:1,class:Q(P.$style["column-config__pinned-section"])},[(K(!0),ie(xt,null,Fn(x.value,N=>{var G;return K(),Ue(Fv,{key:N.colId,item:N,columnStates:d.value,disableDrag:A.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:s.readOnly,isDisableNewCheck:T.value&&((G=N.colId)==null?void 0:G.includes("metric")),onToggleColumn:M},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Xe("",!0)],64)):Xe("",!0),c.value?Xe("",!0):(K(),ie("div",{key:2,class:Q(P.$style["column-config__list"])},[(K(!0),ie(xt,null,Fn(w.value,N=>Ke((K(),Ue(Fv,{key:N.field,item:N,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:d.value},null,8,["item","columnStates"])),[[Ks,C.value[N.field]||!a.value]])),128)),ue(Pte,{modelValue:b.value,"onUpdate:modelValue":D[1]||(D[1]=N=>b.value=N),"group-name":"columns",onChanged:F,disabled:v.value,readOnly:s.readOnly},{item:he(({item:N,index:G})=>[Ke((K(),Ue(Fv,{focusIndex:`7.${G+1}`,key:N.id,item:N,columnStates:d.value,disableDrag:A.value,disableDragTooltip:A.value?"Reordering is disabled while search is active.":void 0,readOnly:s.readOnly,isDisableNewCheck:T.value&&N.id.includes("metric"),onToggleColumn:M},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[Ks,C.value[N.field]||!a.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(K(!0),ie(xt,null,Fn(S.value.filter(N=>{var G;return N.headerName&&((G=N.headerName)==null?void 0:G.length)>0}),N=>Ke((K(),Ue(Fv,{key:N.field,item:N,disabled:s.disabled,readOnly:s.readOnly,columnStates:d.value},null,8,["item","disabled","readOnly","columnStates"])),[[Ks,C.value[N.field]||!a.value]])),128))],2))],6)],2)],2))}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),Bte=["aria-label"],$te=["aria-disabled","onClick"],Hte=Ct(st({__name:"MonthSelection",props:{monthLabels:{default:()=>["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ariaLabel:{default:"Select month"},selectedYear:{default:null},selectedMonth:{default:null},displayYear:{default:null},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},isMonthSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{emit:t}){const n=e,o=t,s=a=>{n.disabled||n.readOnly||!n.isMonthSelectable(a)||o("select",a)},r=new Date().getFullYear(),i=new Date().getMonth()+1;return(a,l)=>(K(),ie("div",{class:Q([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[me("div",{class:Q(a.$style.months)},[(K(!0),ie(xt,null,Fn(n.monthLabels,(c,u)=>(K(),ie("a",{key:c,tabindex:"0",class:Q([a.$style["month-cell"],{[a.$style.selected]:u+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:u+1===i&&H(r)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(u+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(u+1),onClick:d=>s(u+1),onKeydown:l[0]||(l[0]=d=>o("keydown",d))},ut(c),43,$te))),128))],2)],10,Bte))}}),[["__cssModules",{$style:{"month-grid":"_month-grid_1t30z_1",months:"_months_1t30z_8","month-cell":"_month-cell_1t30z_22",selected:"_selected_1t30z_36",compact:"_compact_1t30z_40",current:"_current_1t30z_53",disabled:"_disabled_1t30z_61"}}]]),Gte=["data-year","aria-disabled","onClick"],Ute=Ct(st({__name:"YearSelection",props:{years:{},selectedYear:{default:null},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},isYearSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=B(null),i=new Date().getFullYear(),a=l=>{o.disabled||!o.isYearSelectable(l)||s("select",l)};return t({rootEl:r}),Qt(()=>{if(r.value){const l=r.value.querySelector(`[data-year="${o.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,c)=>(K(),ie("div",{ref_key:"rootEl",ref:r,class:Q([l.$style["year-grid-body"],o.scrollable?l.$style.scrollable:"",o.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(K(!0),ie(xt,null,Fn(o.years,u=>(K(),ie("a",{key:u,"data-year":u,tabindex:"0",class:Q([l.$style["year-cell"],{[l.$style.selected]:u===o.selectedYear,[l.$style.current]:u===H(i),[l.$style.disabled]:o.disabled||!o.isYearSelectable(u)}]),"aria-disabled":o.disabled||!o.isYearSelectable(u),onClick:d=>a(u),onKeydown:c[0]||(c[0]=d=>s("keydown",d))},ut(u),43,Gte))),128))],2))}}),[["__cssModules",{$style:{"year-grid-body":"_year-grid-body_178a1_1",scrollable:"_scrollable_178a1_11","year-cell":"_year-cell_178a1_16",selected:"_selected_178a1_28",current:"_current_178a1_31",compact:"_compact_178a1_35",disabled:"_disabled_178a1_47"}}]]),Wte={class:"navigation"},zte={class:"picker"},jte={key:0,class:"footer"},Kte=Ct(st({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(K(),ie("div",{class:Q(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[me("div",Wte,[Tt(t.$slots,"navigation",{},void 0,!0)]),me("div",zte,[Tt(t.$slots,"picker",{},void 0,!0)]),ue(xT,{name:"fade",mode:"out-in"},{default:he(()=>[e.disableConfirm?Xe("",!0):(K(),ie("div",jte,[Tt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),qte={style:{flex:"1"}},Yte=Ct(st({__name:"CalendarFooter",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1}},emits:["cancel","confirm","goto-date"],setup(e,{emit:t}){const n=e,o=t,s=()=>{o("cancel")},r=()=>{o("confirm")},i=(l=new Date)=>{o("goto-date")},a=l=>{if(l.key==="Enter"||l.key===" "){l.preventDefault(),l.stopPropagation();const c=l.target;c.dataset.index==="today-btn"?i():c.dataset.index==="cancel-btn"?s():c.dataset.index==="save-btn"&&r()}};return(l,c)=>{const u=eu("tooltip");return n.readOnly?Xe("",!0):(K(),ie("div",{key:0,class:Q(l.$style["arbo-calendar-actions"])},[me("div",qte,[Ke((K(),Ue(H(at),{variant:"secondary",size:"medium",onClick:c[0]||(c[0]=d=>i()),onKeydown:a,"data-index":"today-btn"},{prefix:he(()=>[ue(H(lt),{src:"CalendarDay"})]),_:1})),[[u,"Today"]])]),ue(H(at),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:s,"data-index":"cancel-btn"},{default:he(()=>[Qe(ut(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),ue(H(at),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:r},{default:he(()=>[Qe(ut(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),Zte=Ct(st({__name:"CalendarNavigation",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1},minDate:{},maxDate:{},monthLabels:{},monthLabelStyle:{},locale:{},month:{},year:{},hideMonth:{type:Boolean,default:!1},mode:{}},emits:["cancel","confirm","goto-date","prev","next","toggle-months","toggle-years"],setup(e,{emit:t}){const n=e,o=hs({month:new Date().getMonth()+1,year:new Date().getFullYear()}),s=q(()=>{if(n.minDate){const h=o.month===1?12:o.month-1,f=o.month===1?o.year-1:o.year;return new Date(f,h-1,1)<new Date(n.minDate.getFullYear(),n.minDate.getMonth(),1)}return!1}),r=q(()=>{if(n.maxDate){const h=o.month===12?1:o.month+1,f=o.month===12?o.year+1:o.year;return new Date(f,h-1,1)>new Date(n.maxDate.getFullYear(),n.maxDate.getMonth(),1)}return!1}),i=t,a=()=>{s.value||(n.mode==="month"?o.month=o.month===0?11:o.month-1:n.mode==="year"&&(o.year-=1)),i("prev",{month:o.month,year:o.year})},l=()=>{r.value||(n.mode==="month"?o.month=o.month===11?0:o.month+1:n.mode==="year"&&(o.year+=1)),i("next",{month:o.month,year:o.year})},c=()=>{i("toggle-months")},u=()=>{i("toggle-years")},d=q(()=>{if(n.monthLabels&&n.monthLabels.length===12)return n.monthLabels;const h=n.locale||"en-US",f=n.monthLabelStyle||"short",p=new Intl.DateTimeFormat(h,{month:f,timeZone:"UTC"});return Array.from({length:12},(v,w)=>p.format(new Date(Date.UTC(2020,w,1))))});return(h,f)=>(K(),ie("div",{class:Q(h.$style["cal-nav-bar"])},[e.mode!="year"?(K(),Ue(H(at),{key:0,variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:s.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:jn(kt(a,["prevent","stop"]),["enter"])},{default:he(({hovered:p})=>[ue(H(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Xe("",!0),me("div",{class:Q([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Xe("",!0):(K(),Ue(H(at),{key:0,"data-index":"month-btn",variant:"secondary",onClick:c},{default:he(()=>[Qe(ut(d.value[n.month-1]),1)]),_:1})),ue(H(at),{variant:"secondary",onClick:u,"data-index":"year-btn"},{default:he(()=>[Qe(ut(n.year),1)]),_:1})],2),e.mode!="year"?(K(),Ue(H(at),{key:1,"data-index":"next-btn",variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:r.value,label:"",onClick:l,onKeydownCapture:jn(kt(l,["prevent","stop"]),["enter"])},{default:he(({hovered:p})=>[ue(H(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_1jrqr_1","cal-nav-bar":"_cal-nav-bar_1jrqr_12","cal-nav-btn":"_cal-nav-btn_1jrqr_19",prev:"_prev_1jrqr_32","year-grid-header":"_year-grid-header_1jrqr_36","cal-nav-center":"_cal-nav-center_1jrqr_45",single:"_single_1jrqr_52","cal-nav-label":"_cal-nav-label_1jrqr_56","year-grid":"_year-grid_1jrqr_36",months:"_months_1jrqr_78","month-cell":"_month-cell_1jrqr_85","year-cell":"_year-cell_1jrqr_86","pg-btn":"_pg-btn_1jrqr_108","year-grid-body":"_year-grid-body_1jrqr_121",selected:"_selected_1jrqr_125","days-slot":"_days-slot_1jrqr_131","range-label":"_range-label_1jrqr_135"}}]]),Xte=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const Jte={class:"wrapper-suffix"},CM=Ct(st({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{},workspaceId:{},id:{},maxWidth:{default:"500px"}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o=Yt,s={PER_PAGE:20,INITIAL_PAGE:1},r=(k,P=0)=>k?`${parseInt(k,10)+P}px`:"auto",i=(k,P=0)=>k?parseInt(k,10)+P:0,a=e,l=B(a.modelValue),c=n,u=q(()=>g.value.find(k=>k.id===l.value)||null),d=k=>{l.value=k.id,c("update:modelValue",k.id)},h=q(()=>{if(!l.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const k=g.value.find(D=>D.id===l.value),P=String((k==null?void 0:k.color)||"white");return{backgroundColor:P,border:Qg(P,"white")?"1px solid #ccc":"1px solid #fff"}}),f=B(null),p=()=>{var k;(k=f.value)==null||k.focus()},g=B([]),v=B(!1),w=B(!1),S=B(null),b=B(s.INITIAL_PAGE),C=B(!0),_=B(0),E=B(""),x=q(()=>!!(a.id&&a.workspaceId)),I=k=>{const P=g.value.find(D=>D.id===k.value);P&&d(P)},F=k=>({label:k.name,value:k.id,selected:l.value===k.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:k,id:k.id,color:k.color}),M=async(k=s.INITIAL_PAGE,P="",D=!1)=>{var N;if(!x.value){console.error("Missing required props",a);return}D?w.value=!0:v.value=!0,S.value=null;try{const G={workspaceId:String(a.workspaceId),itemIds:a.id,page:k,perPage:s.PER_PAGE,name_like:P.trim()};if(a.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const J=await a.getStatusFunc(G);if(!J){D||(g.value=[]),C.value=!1;return}const ae=J.data.map(F);g.value=D?[...g.value,...ae]:ae,_.value=((N=J.meta)==null?void 0:N.total)??J.data.length,C.value=g.value.length<_.value,b.value=k}catch(G){console.error("Error fetching statuses:",G),S.value="Failed to load statuses",D||(g.value=[]),C.value=!1,c("error",S.value)}finally{v.value=!1,w.value=!1}},T=async()=>{!C.value||w.value||await M(b.value+1,E.value,!0)};tt([()=>a.id,()=>a.workspaceId],()=>{M()},{deep:!0,immediate:!0});const A=async k=>{E.value=k,b.value=s.INITIAL_PAGE,await M(s.INITIAL_PAGE,k,!1)};return t({focus:p,clear:()=>{l.value=null,c("update:modelValue",null)}}),(k,P)=>(K(),Ue(Nte,{onOpen:p,placement:"bottom-start","max-width":i(a.maxWidth)},{trigger:he(({open:D})=>[ue(bo,{actived:D,class:Q(k.$style["status-wrapper"])},{suffix:he(()=>[me("div",Jte,[ue(lt,{src:"ChevronUp",source:"remote",class:Q([[k.$style["dropdown-icon"]],{[k.$style["dropdown-icon-show"]]:!D}])},null,8,["class"])])]),default:he(()=>{var N;return[me("div",{class:Q(k.$style.status)},[me("div",{class:Q(k.$style["color-indicator"]),style:rn(h.value)},null,6),Ke((K(),ie("span",{style:rn({maxWidth:r(a.maxWidth,-10)}),class:Q({[k.$style["status-text"]]:!0,[k.$style.empty]:!u.value})},[Qe(ut(u.value?u.value.label:"Select status"),1)],6)),[[H(o),{content:((N=u.value)==null?void 0:N.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:he(({closeDropdown:D})=>{var N;return[ue(na,{ref_key:"popupRef",ref:f,"selected-id":(N=u.value)==null?void 0:N.id,options:g.value,loading:v.value,itemWidth:r(a.maxWidth,-10),"loading-more":w.value,"has-more":C.value,error:S.value,onSearch:A,onSelect:G=>{I(G),D()},onLoadMore:T,onCancel:P[0]||(P[0]=G=>c("cancel")),style:rn({width:r(a.maxWidth,-10)})},null,8,["selected-id","options","loading","itemWidth","loading-more","has-more","error","onSelect","style"])]}),_:1},8,["max-width"]))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_fgfdj_1",status:"_status_fgfdj_1","color-indicator":"_color-indicator_fgfdj_13","status-text":"_status-text_fgfdj_22",empty:"_empty_fgfdj_29","dropdown-icon":"_dropdown-icon_fgfdj_33","dropdown-icon-show":"_dropdown-icon-show_fgfdj_38",options:"_options_fgfdj_42"}}]]),bM=e=>({updateCellData:({rowId:n,field:o,value:s})=>{if(!e)return;const r=e.getRowNode(n);r&&r.setDataValue(o,s),e.refreshCells({rowNodes:r?[r]:[],columns:[o],force:!0})}}),Qte={key:2},ene=Ct(st({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var S;const n=e,o=B(n.value),s=B(!0),r=B(""),i=()=>{var M,T,A;const b=(M=u.value)==null?void 0:M.restricted_type.trim(),C=((A=(T=u.value)==null?void 0:T.restricted_value)==null?void 0:A.split(",").map(Number))||[],[_,E]=C,I={range:`Enter a value between ${_} and ${E}`,not:`These values are not allowed: ${C.join(", ")}`,exact:"Value is not allowed"}[b];return s.value?"":I},a=b=>{if(u.value){if(b===null||b===""){s.value=!0;return}if(c.value!=="number"){s.value=!0;return}s.value=Tm(u.value,Number(b)),r.value=i()}};q(()=>s.value?{content:"",showOnCreate:!1}:{content:r.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=B(null),c=q(()=>uP(u.value)),u=q(()=>{var C,_;return((_=(C=n.params)==null?void 0:C.colDef)==null?void 0:_.context)||null}),{apiServices:d}=Zn(!0,n),{updateCellData:h}=bM((S=n.params)==null?void 0:S.api),f=B(!1),p=Yr(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},w=async b=>{var _,E;if(g(),f.value=!0,o.value=b||null,b===n.value){f.value=!1;return}const C={itemIds:[String(p.value)],metricId:((_=u.value)==null?void 0:_.id)||"",workspaceId:String(n.workspaceId)};b==null?C.clear=1:C.value=b,h({rowId:String(p.value),field:`metric_${C.metricId}`,value:void 0});try{const x=await((E=d.value)==null?void 0:E.bulkUpdateMetric(C));(x==null?void 0:x.message)=="Done"?h({rowId:String(p.value),field:`metric_${C.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value}),console.error("Failed to update metric value:",x),o.value=n.value)}catch(x){console.error("Error during bulk metric update:",x),h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value})}finally{f.value=!1}};return(b,C)=>(K(),ie("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[c.value=="dropdown"&&u.value?(K(),Ue(RA,{key:0,config:u.value,modelValue:o.value,"onUpdate:modelValue":C[0]||(C[0]=_=>o.value=_),onChange:w,onHandleCancel:v},null,8,["config","modelValue"])):c.value=="number"&&u.value?(K(),Ue(DA,{key:1,showInlineError:!1,autoEmit:!0,config:u.value,modelValue:o.value,"onUpdate:modelValue":C[1]||(C[1]=_=>o.value=_),style:{width:"100%"},onHandleChange:w,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(K(),ie("div",Qte,"Metric type:"+ut(c.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),tne=Ct(st({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."};q(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const o=q(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),s=B(!1);return Qt(()=>{s.value=!0}),(r,i)=>(K(),ie("div",{class:Q(r.$style["no-data-item-table"])},[me("div",{class:Q(r.$style.visual)},[s.value?(K(),Ue(Ka,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Xe("",!0)],2),me("div",{class:Q(r.$style.description)},ut(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),SM=rc("sortStore",()=>{const e=B({}),t=B(void 0),n={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},o={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=q(()=>{const c=e.value;return Object.values(c).filter(d=>d.sort!=="none"&&!!d.sort).map(d=>{let h;switch(d.colId){case"dateRange":h=o[d.sort];break;default:if(d.colId.includes("metric")){const[f,p]=d.colId.split("_");h={column:f,direction:d.sort,type:p}}else h={column:n[d.colId]||d.colId,direction:d.sort};break}return h})}),r=(c,u)=>{e.value={[c]:{colId:c,sort:u}}},i=()=>{e.value={}},a=B(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:r,clearSorting:i,isSortingRunning:a,defaultSortStorePreferences:t,setDefaultSort:c=>{console.log("Setting default sort:",c),t.value=c}}}),nne=(e,t)=>{var r;const n=sessionStorage.getItem("ws.terminology"),o=n?JSON.parse(n):null;return` ${((r=o==null?void 0:o.find(i=>i.code==="scene"))==null?void 0:r.name)||"Scene"} `.trim()},one={class:"paragraph"},sne=["href"],rne=["checked"],Pv="hideDefaultSortingNotification",ine=Ct(st({name:"DefaultSortingNotification",__name:"DefaultSortingNotification",setup(e,{expose:t}){const n=f=>{f.preventDefault(),f.metaKey||f.ctrlKey?window.open(h.value,"_blank"):window.location.href=h.value,u()},o=()=>{s.value=!s.value},s=B(localStorage.getItem(Pv)==="true"),r=()=>{s.value=localStorage.getItem(Pv)==="true",localStorage.getItem(Pv)!=="true"&&l()},i=()=>{localStorage.setItem(Pv,String(s.value)),u()},{triggerRef:a,show:l,popupRef:c,hide:u}=yo({toggleOnClick:!1,trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,zIndex:8,offset:[0,0],showOnInit:!1,interactive:!0});t({show:r,hide:u});const d=q(()=>nne()),h=q(()=>{const f=sessionStorage.getItem("BASE_URL")||"",p=sessionStorage.getItem("ws.code")||"";return`${f}/${p}/ac/prf`});return(f,p)=>(K(),ie(xt,null,[me("div",{class:"main-trigger",ref_key:"triggerRef",ref:a},[Tt(f.$slots,"default")],512),me("div",{class:"popup",ref_key:"popupRef",ref:c},[me("div",{class:Q(f.$style["default-sorting-notification"])},[me("div",one,[Qe(" This sort only applies to the current list. To change the default sorting for "+ut(d.value)+" lists, go to ",1),me("a",{href:h.value,onClick:n},"My Settings > Preferences",8,sne),p[0]||(p[0]=Qe(" . ",-1))]),me("div",{class:Q(f.$style.footer)},[me("label",{class:Q(f.$style["checkbox-section"])},[me("input",{type:"checkbox",checked:s.value,onChange:kt(o,["stop"])},null,40,rne),p[1]||(p[1]=Qe(" Don't show this tip again ",-1))],2),ue(at,{size:"small",variant:["primary","text"],style:{padding:"0 8px"},onClick:i},{default:he(()=>[...p[2]||(p[2]=[Qe(" Got it ",-1)])]),_:1})],2)],2)],512)],64))}}),[["__cssModules",{$style:{"default-sorting-notification":"_default-sorting-notification_yl9vr_1",footer:"_footer_yl9vr_19","checkbox-section":"_checkbox-section_yl9vr_25"}}]]),gc=st({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=SM(),{sorts:o,defaultSortStorePreferences:s}=ns(n),r=q(()=>{var f,p;return((p=(f=t.params)==null?void 0:f.column)==null?void 0:p.getColId())||"template_col_id"}),i=B(null),a={name:"name",template_flow_status:"status"};tt(()=>s.value,f=>{var p;f!=null&&f.field&&a[f==null?void 0:f.field]==r.value&&((p=i.value)==null||p.setDefaultSort(f))});const l=f=>{var p;console.log("Sort changed for colId:",r.value,"with sortValue:",f),r.value&&n.setSort(r.value,f),(p=u.value)==null||p.show()},c=q(()=>t.params.headerType||void 0),u=B(null),d=B("none");tt(()=>o.value,xr(()=>{var f;if(console.log("Debounced sort update triggered for colId:",r.value,"with sorts:",o.value),r.value){const p=o.value[r.value];console.log("Updating sort for colId:",r.value,"with sortEntry:",p),d.value=p?p.sort:"none",d.value=="none"&&((f=i.value)==null||f.clear())}},li),{deep:!0,immediate:!0});const h=()=>{var f;(f=u.value)==null||f.hide()};return(f,p)=>(K(),Ue(ine,{ref_key:"sortingNotificationRef",ref:u},{default:he(()=>[r.value?(K(),Ue(gee,Wt({key:0,ref_key:"headerSortingRef",ref:i},t,{"header-type":c.value,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=g=>d.value=g),onSortChanged:l,onOpen:h}),null,16,["header-type","modelValue"])):Xe("",!0)]),_:1},512))}});function ane(){const e=hs({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const s=e.name.trim();e.status,s.length===0?e.error="Name cannot be empty":s.length>255?e.error="Name cannot exceed 255 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},o=()=>{e.isCreating=!1};return tt(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:o,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const kv=rc("userStore",()=>{const e=B(null),t=B(null);return{user:e,setUser:s=>{e.value=s},setUserRoleId:s=>{t.value=s},workspaceUserRoleId:t}}),lne=["innerHTML"],cne=20,une=Ct(st({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,{triggerRef:s,popupRef:r,isVisible:i,show:a,hide:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),c=()=>{a()},u=B(null),d=()=>{M.value=[],pe.value=!1},h=q(()=>i.value),f=q(()=>{var W;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((W=M.value)==null?void 0:W.length)===0,wrapperRef:s,active:h,bordered:!0}}),{argsMain:p}=Co(f),g=Yt,v=n,w=q(()=>{var W;return Math.max(0,(((W=M.value)==null?void 0:W.length)||0)-o.maxVisible)}),S=q(()=>{var W;return w.value<=0?"":((W=M.value)==null?void 0:W.slice(o.maxVisible).map(ge=>ge.name).join(", "))||""}),b=B(!1),C=B(!1),_=B(null),E=B(1),x=B(!0),I=B(0),F=B(""),M=B([]),T=q(()=>{var W;return((W=M.value)==null?void 0:W.map(ge=>ge.id))||[]}),{assigneeList:A,mergedOptions:k}=Am({...o,value:[]}),{apiServices:P}=Zn(!1,o),D=yn("entityId"),N=async(W=1,ge="",oe=!1)=>{var U,Y,de,ke,xe;if(!P.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(oe?C.value=!0:b.value=!0,_.value=null,!((U=P.value)!=null&&U.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const _e=un.getInstance().getItem("ws.code");try{const Ve=await((Y=P.value)==null?void 0:Y.getAssignableAssignees(String(_e),{entity_ids:(D==null?void 0:D.value)||"",page:W,per_page:cne,display_name_like:ge})),ye=((de=Pu(Ve.data))==null?void 0:de.map(km))??[];A.value=oe?vu(A.value,ye,"id"):ye,I.value=Ve.meta.total,x.value=(((ke=Ve==null?void 0:Ve.meta)==null?void 0:ke.current_page)||0)<(((xe=Ve==null?void 0:Ve.meta)==null?void 0:xe.last_page)||0),E.value=W}catch(Ve){console.error("Error fetching assignable users:",Ve),_.value="Failed to load assignable users"}finally{b.value=!1,C.value=!1}},G=W=>{var ge,oe,_e;if((ge=M.value)!=null&&ge.some(U=>U.id===W.data.id)){M.value=(oe=M.value)==null?void 0:oe.filter(U=>U.id!==W.data.id);return}M.value=[...M.value||[],W.data],(_e=u.value)==null||_e.focus()},J=()=>{M.value=[]},ae=()=>{!C.value&&x.value&&N(E.value+1,F.value,!0)},ne=xr(async W=>{F.value=W,await N(1,W,!1)},li);tt(()=>i.value,W=>{var ge;W?(N(1,F.value,!1),(ge=u.value)==null||ge.focus(),v("show")):v("hide")});const ee=q(()=>{var W;return((W=M.value)==null?void 0:W.slice(0,3))||[]}),$=q(()=>ee.value.map(W=>({id:W.id,name:W.name,initial:W.initial,avatarId:W.id,profile_image:W.profile_image,color:W.color,size:24,user:W}))),j=kv(),{user:te}=ns(j),pe=B(!1);t({getData:()=>M.value,clear:d,setData:W=>{M.value=W},focus:()=>{a(),vt(()=>{var W;(W=u.value)==null||W.focus()})},hide:()=>{l()}}),tt([M,pe],()=>{v("updated",M.value)},{deep:!0});const ve=W=>{var ge;M.value=(ge=M.value)==null?void 0:ge.filter(oe=>oe.id!==W)},we=W=>{var oe;const ge=un.getInstance().getItem("ws.code");return((oe=P.value)==null?void 0:oe.getUserInformation(ge,W))||Promise.resolve(null)},re=B();return(W,ge)=>(K(),ie("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:re},[ue(bo,Wt(H(p),{style:{"--icon-size":"18px"}}),{prefix:he(()=>[$.value.length==0?(K(),ie("div",{key:0,class:Q([W.$style["icon-wrapper"],"wrapper-prefix"]),onClick:kt(c,["stop","prevent"])},[ue(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Xe("",!0)]),default:he(()=>[me("div",{class:Q([W.$style["assignee-row"],W.$style["assignee-selector"]]),ref_key:"triggerRef",ref:s},[me("div",{style:{flex:1},class:Q([W.$style["assignee-row"]])},[(K(!0),ie(xt,null,Fn($.value,oe=>(K(),Ue(If,{onClear:_e=>ve(oe.id),key:oe.user.id,"disable-remove":!1},{default:he(()=>[ue(Gu,{user:oe.user,apiUpdateFunction:we,appendTo:re.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),w.value>0?Ke((K(),ie("div",{key:0,class:Q(W.$style["extra-avatars"])},[Qe(" +"+ut(w.value),1)],2)),[[H(g),S.value]]):Xe("",!0)],2)],2)]),_:1},16),me("div",{ref_key:"popupRef",ref:r},[ue(na,Wt({"selected-id":T.value},{...o},{options:H(k),loading:b.value,"loading-more":C.value,"has-more":x.value,ref_key:"searchListRef",ref:u,onTab:ge[0]||(ge[0]=oe=>v("tab",oe)),onSelect:ge[1]||(ge[1]=oe=>{G(oe),v("start-update")}),onSearch:H(ne),onClose:ge[2]||(ge[2]=()=>v("close")),onLoadMore:ae}),{"extra-item":he(()=>[ue(ES,{onClick:J,label:"Unassign",borderLeft:!0},{icon:he(()=>[ue(lt,{src:"UserXMark",source:"remote"})]),_:1})]),item:he(({item:oe,selectedIndex:_e,isSelected:U,handleSelect:Y,handleItemHover:de,getHighlightedLabel:ke,query:xe,idx:Ve})=>[ue(ic,Wt(oe,{hover:Ve===_e,selected:U(oe),type:oe.type,onClick:kt(ye=>Y(oe,ye),["stop","prevent"]),onMouseover:ye=>de(Ve),class:W.$style["item-assignee"]}),{prefix:he(()=>[ue(Gu,{user:oe.data,apiUpdateFunction:we,appendTo:H(r)},null,8,["user","appendTo"])]),label:he(({})=>[xe?Ke((K(),ie("span",{key:0,class:Q([W.$style["item-label"],W.$style.match]),style:{flex:"1"},innerHTML:ke(oe.label)},null,10,lne)),[[H(g),{content:oe.label}]]):Ke((K(),ie("span",{key:1,class:Q(W.$style["item-label"]),style:{flex:"1"}},[Qe(ut(oe.label),1)],2)),[[H(g),{content:oe.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_1xvno_1","item-assignee":"_item-assignee_1xvno_6","item-action":"_item-action_1xvno_6","item-label":"_item-label_1xvno_16","icon-wrapper":"_icon-wrapper_1xvno_25","error-message":"_error-message_1xvno_34","empty-state":"_empty-state_1xvno_44","assignee-row":"_assignee-row_1xvno_57","assignee-selector":"_assignee-selector_1xvno_65",seperator:"_seperator_1xvno_69","extra-avatars":"_extra-avatars_1xvno_77",list:"_list_1xvno_89"}}]]),dne={key:0},hne={key:1},fne={key:0},pne={key:1},gne={key:0,class:"wrapper-suffix"},mne={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},vne=Ct(st({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const o=Yt,{triggerRef:s,popupRef:r,isVisible:i,hide:a,show:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=()=>{u.value=[null,null]},u=B([null,null]),d=C=>{const _=Dm();return C?bt.fromJSDate(C,{zone:_}).toFormat("MMM dd"):""},h=q(()=>i.value),f=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:u.value[0]===null&&u.value[1]===null,wrapperRef:s,active:h,bordered:!0})),{argsMain:p}=Co(f),g=B(!1),v=C=>{S("tab",C)},w=C=>{"start"in C&&C.start!==void 0&&(u.value[0]=C.start),"end"in C&&C.end!==void 0&&(u.value[1]=C.end)};t({getData:()=>u.value,clear:c,setData:C=>{u.value=C},focus:()=>{l(),vt(()=>{var C;(C=b.value)==null||C.focus()})},hide:()=>{a()}});const S=n;tt(()=>u.value,C=>{S("updated",C)},{deep:!0});const b=B(null);return tt(()=>i.value,C=>{C?(vt(()=>{var _;(_=b.value)==null||_.focus()}),S("show")):S("hide")}),(C,_)=>(K(),ie(xt,null,[ue(bo,Wt({ref_key:"triggerRef",ref:s},H(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:he(({focused:E})=>[me("div",{class:Q(C.$style["date-time"])},[me("div",{class:Q(C.$style.date)},[u.value[0]==null&&(E||H(i))?(K(),ie("span",dne,"MMMDD")):(K(),ie("span",hne,ut(d(u.value[0])),1))],2),u.value[0]!==null||u.value[1]!==null||E||H(i)?(K(),ie("div",{key:0,class:Q(C.$style.separator)}," → ",2)):Xe("",!0),me("div",{class:Q(C.$style.date)},[u.value[1]==null&&(E||H(i))?(K(),ie("span",fne,"MMMDD")):(K(),ie("span",pne,ut(d(u.value[1])),1))],2)],2)]),suffix:he(({hovered:E,focused:x})=>[(u.value[0]!==null||u.value[1]!==null)&&(E||x||H(i))?(K(),ie("div",gne,[Ke((K(),Ue(at,{onClick:kt(c,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:he(()=>[ue(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[H(o),"Clear"]])])):Xe("",!0)]),prefix:he(()=>[u.value[0]===null&&u.value[1]===null?(K(),ie("div",mne,[ue(lt,{src:"Calendar",color:"#A6A6A6"})])):Xe("",!0)]),_:1},16),me("div",{ref_key:"popupRef",ref:r},[H(i)?(K(),Ue(qm,{key:0,immediatelyUpdate:!1,value:u.value,onConfirmed:w,ref_key:"calendarRef",ref:b,onClosed:H(a),onStartUpdate:_[0]||(_[0]=E=>g.value=!0),onFinishUpdate:_[1]||(_[1]=E=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Xe("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),yne=Ct(st({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,s={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:r,popupRef:i,isVisible:a,show:l,hide:c}=yo({toggleOnClick:!0,appendTo:"parent"}),u=B(null),d=B([]),h=B(!1),f=B(!1),p=B(null),g=B(s.INITIAL_PAGE),v=B(!0),w=B(0),S=B(""),b=n,C=q(()=>a.value),_=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!u.value,wrapperRef:r,active:C,bordered:!0})),E=B(null),{argsMain:x}=Co(_),I=q(()=>u.value?d.value.filter(ee=>ee.id===u.value):[]),F=q(()=>!u.value||I.value.length===0?"":I.value[0].label),M=q(()=>u.value?[u.value]:[]),T=q(()=>{if(!u.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const ee=I.value[0],$=String((ee==null?void 0:ee.color)||"white");return{backgroundColor:$,border:Qg($,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),A=ee=>({label:ee.name,value:ee.id,selected:u.value===ee.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:ee,id:ee.id,color:ee.color}),{apiServices:k}=Zn(!1,o),P=async(ee=s.INITIAL_PAGE,$="",j=!1)=>{var te,pe;j?f.value=!0:h.value=!0,p.value=null;try{const ve=un.getInstance().getItem("ws.code"),we=await((te=k.value)==null?void 0:te.getAssignableStatuses(ve,{entity_id:o.entityId||"",name_like:$,page:ee,per_page:s.PER_PAGE}));if(!we){j||(d.value=[]),v.value=!1;return}const re=we.data.map(A);d.value=j?[...d.value,...re]:re,w.value=((pe=we.meta)==null?void 0:pe.total)??we.data.length,v.value=d.value.length<w.value,g.value=ee}catch(ve){console.error("Error fetching statuses:",ve),p.value="Failed to load statuses",j||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},D=(ee,$)=>{var te;$.stopImmediatePropagation(),$.preventDefault(),$.stopPropagation();const j=ee.id;u.value=j,(te=E.value)==null||te.focus(),b("update:modelValue",u.value),c()},N=async()=>{!v.value||f.value||await P(g.value+1,S.value,!0)},G=async ee=>{S.value=ee,g.value=s.INITIAL_PAGE,await P(s.INITIAL_PAGE,ee,!1)},J=()=>{u.value=null,b("update:modelValue",null)},ae=()=>{l(),vt(()=>{var ee;(ee=E.value)==null||ee.focus()})};return tt(()=>a.value,ee=>{var $;ee?(P(1,S.value,!1),($=E.value)==null||$.focus(),b("show")):b("hide")}),tt(()=>u.value,ee=>{b("updated",ee)}),t({focus:ae,clear:J,getData:()=>u.value,setData:ee=>{u.value=ee},hide:c,autoFillDefault:async()=>{S.value="",await P(1,S.value,!1),d.value.length>0&&(u.value=d.value[0].id,b("update:modelValue",u.value))}}),(ee,$)=>{const j=eu("tooltip");return K(),ie(xt,null,[ue(bo,Wt({ref_key:"triggerRef",ref:r},H(x),{style:{"--icon-size":"18px"}}),{default:he(()=>[me("div",{class:Q(ee.$style.status)},[me("div",{class:Q(ee.$style["color-indicator"]),style:rn(T.value)},null,6),Ke((K(),ie("span",{class:Q({[ee.$style.empty]:I.value.length===0,[ee.$style["status-text"]]:!0})},[Qe(ut(F.value),1)],2)),[[j,{content:F.value}]])],2)]),_:1},16),me("div",{ref_key:"popupRef",ref:i},[ue(na,{style:{width:"200px"},ref_key:"searchListRef",ref:E,"selected-id":M.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:G,onSelect:D,onLoadMore:N,onCancel:$[0]||($[0]=te=>b("cancel")),onTab:$[1]||($[1]=te=>b("tab",te)),onClose:$[2]||($[2]=()=>b("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1gv28_2",status:"_status_1gv28_6","color-indicator":"_color-indicator_1gv28_12","count-badge":"_count-badge_1gv28_25","status-text":"_status-text_1gv28_32",empty:"_empty_1gv28_41"}}],["__scopeId","data-v-6fccb209"]]),wne=Ct(st({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const o=["name","assignees","status","date","cancel","create-keep","create"],s=Yt,r=PG("target"),i=yn("workspaceId"),a=yn("entityId"),l=n,c=e,{newItemData:u,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=ane(),{apiServices:p}=Zn(!1,c),{openSceneHub:g}=mf(),v=B(!1),w=B(!1),S=B(null),b=B({assignees:!1,status:!1,date:!1}),C={name:B(null),assignees:B(null),status:B(null),date:B(null),cancel:B(null),"create-keep":B(null),create:B(null)},_=C.name,E=C.assignees,x=C.status,I=C.date,F=C.cancel,M=C["create-keep"],T=C.create,A=B(new Map),k=q(()=>!!u.error||!u.name.trim()||w.value),P=(ye,L)=>{ye&&A.value.set(L,ye.$el||ye)},D=(ye,L)=>{if(ye==="date"){const[z,le]=Array.isArray(L)?L:[void 0,void 0];u.start_date=z,u.due_date=le}else u[ye]=L},N=()=>{u.isCreating=!0,S.value="name"},G=()=>{u.isCreating=!1,h()},J=yn("switchInstance"),{addNotification:ae}=oa(),ne=ye=>{l("focus-on-id",ye)},ee=(ye,L,z)=>{const le=dP(void 0,"created");ae({id:String(ye),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${le}</b>
161
+ */function JO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function hi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JO(Object(n),!0).forEach(function(o){Jee(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function gv(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gv=function(t){return typeof t}:gv=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gv(e)}function Jee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sa(){return sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},sa.apply(this,arguments)}function Qee(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function ete(e,t){if(e==null)return{};var n=Qee(e,t),o,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var tte="1.14.0";function ra(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ia=ra(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pf=ra(/Edge/i),QO=ra(/firefox/i),kf=ra(/safari/i)&&!ra(/chrome/i)&&!ra(/android/i),eM=ra(/iP(ad|od|hone)/i),nte=ra(/chrome/i)&&ra(/android/i),tM={capture:!1,passive:!1};function Cn(e,t,n){e.addEventListener(t,n,!ia&&tM)}function pn(e,t,n){e.removeEventListener(t,n,!ia&&tM)}function mv(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function ote(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function fi(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&mv(e,t):mv(e,t))||o&&e===n)return e;if(e===n)break}while(e=ote(e))}return null}var nM=/\s+/g;function Ns(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(nM," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(nM," ")}}function Bt(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function od(e,t){var n="";if(typeof e=="string")n=e;else do{var o=Bt(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function oM(e,t,n){if(e){var o=e.getElementsByTagName(t),s=0,r=o.length;if(n)for(;s<r;s++)n(o[s],s);return o}return[]}function pi(){var e=document.scrollingElement;return e||document.documentElement}function So(e,t,n,o,s){if(!(!e.getBoundingClientRect&&e!==window)){var r,i,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==pi()?(r=e.getBoundingClientRect(),i=r.top,a=r.left,l=r.bottom,c=r.right,u=r.height,d=r.width):(i=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(s=s||e.parentNode,!ia))do if(s&&s.getBoundingClientRect&&(Bt(s,"transform")!=="none"||n&&Bt(s,"position")!=="static")){var h=s.getBoundingClientRect();i-=h.top+parseInt(Bt(s,"border-top-width")),a-=h.left+parseInt(Bt(s,"border-left-width")),l=i+r.height,c=a+r.width;break}while(s=s.parentNode);if(o&&e!==window){var f=od(s||e),p=f&&f.a,g=f&&f.d;f&&(i/=g,a/=p,d/=p,u/=g,l=i+u,c=a+d)}return{top:i,left:a,bottom:l,right:c,width:d,height:u}}}function sM(e,t,n){for(var o=Ja(e,!0),s=So(e)[t];o;){var r=So(o)[n],i=void 0;if(i=s>=r,!i)return o;if(o===pi())break;o=Ja(o,!1)}return!1}function sd(e,t,n,o){for(var s=0,r=0,i=e.children;r<i.length;){if(i[r].style.display!=="none"&&i[r]!==$t.ghost&&(o||i[r]!==$t.dragged)&&fi(i[r],n.draggable,e,!1)){if(s===t)return i[r];s++}r++}return null}function QS(e,t){for(var n=e.lastElementChild;n&&(n===$t.ghost||Bt(n,"display")==="none"||t&&!mv(n,t));)n=n.previousElementSibling;return n||null}function rr(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==$t.clone&&(!t||mv(e,t))&&n++;return n}function rM(e){var t=0,n=0,o=pi();if(e)do{var s=od(e),r=s.a,i=s.d;t+=e.scrollLeft*r,n+=e.scrollTop*i}while(e!==o&&(e=e.parentNode));return[t,n]}function ste(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function Ja(e,t){if(!e||!e.getBoundingClientRect)return pi();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=Bt(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return pi();if(o||t)return n;o=!0}}while(n=n.parentNode);return pi()}function rte(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function eE(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Af;function iM(e,t){return function(){if(!Af){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),Af=setTimeout(function(){Af=void 0},t)}}}function ite(){clearTimeout(Af),Af=void 0}function aM(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function lM(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Ls="Sortable"+new Date().getTime();function ate(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(s){if(!(Bt(s,"display")==="none"||s===$t.ghost)){e.push({target:s,rect:So(s)});var r=hi({},e[e.length-1].rect);if(s.thisAnimationDuration){var i=od(s,!0);i&&(r.top-=i.f,r.left-=i.e)}s.fromRect=r}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(ste(e,{target:o}),1)},animateAll:function(o){var s=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,i=0;e.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=So(c),h=c.prevFromRect,f=c.prevToRect,p=a.rect,g=od(c,!0);g&&(d.top-=g.f,d.left-=g.e),c.toRect=d,c.thisAnimationDuration&&eE(h,d)&&!eE(u,d)&&(p.top-d.top)/(p.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=cte(p,h,f,s.options)),eE(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=s.options.animation),s.animate(c,p,d,l)),l&&(r=!0,i=Math.max(i,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},i):typeof o=="function"&&o(),e=[]},animate:function(o,s,r,i){if(i){Bt(o,"transition",""),Bt(o,"transform","");var a=od(this.el),l=a&&a.a,c=a&&a.d,u=(s.left-r.left)/(l||1),d=(s.top-r.top)/(c||1);o.animatingX=!!u,o.animatingY=!!d,Bt(o,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=lte(o),Bt(o,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),Bt(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){Bt(o,"transition",""),Bt(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},i)}}}}function lte(e){return e.offsetWidth}function cte(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var rd=[],tE={initializeByDefault:!0},Of={mount:function(t){for(var n in tE)tE.hasOwnProperty(n)&&!(n in t)&&(t[n]=tE[n]);rd.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),rd.push(t)},pluginEvent:function(t,n,o){var s=this;this.eventCanceled=!1,o.cancel=function(){s.eventCanceled=!0};var r=t+"Global";rd.forEach(function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](hi({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](hi({sortable:n},o)))})},initializePlugins:function(t,n,o,s){rd.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,sa(o,c.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var i=this.modifyOption(t,r,t.options[r]);typeof i<"u"&&(t.options[r]=i)}},getEventProperties:function(t,n){var o={};return rd.forEach(function(s){typeof s.eventProperties=="function"&&sa(o,s.eventProperties.call(n[s.pluginName],t))}),o},modifyOption:function(t,n,o){var s;return rd.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(s=r.optionListeners[n].call(t[r.pluginName],o))}),s}};function ute(e){var t=e.sortable,n=e.rootEl,o=e.name,s=e.targetEl,r=e.cloneEl,i=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Ls],!!t){var g,v=t.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!ia&&!Pf?g=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(o,!0,!0)),g.to=i||n,g.from=a||n,g.item=s||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=hi(hi({},p),Of.getEventProperties(o,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[w]&&v[w].call(t,g)}}var dte=["evt"],vs=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.evt,r=ete(o,dte);Of.pluginEvent.bind($t)(t,n,hi({dragEl:gt,parentEl:eo,ghostEl:Xt,rootEl:Gn,nextEl:hc,lastDownEl:vv,cloneEl:to,cloneHidden:Qa,dragStarted:Nf,putSortable:Oo,activeSortable:$t.active,originalEvent:s,oldIndex:id,oldDraggableIndex:Mf,newIndex:Vs,newDraggableIndex:el,hideGhostForTarget:gM,unhideGhostForTarget:mM,cloneNowHidden:function(){Qa=!0},cloneNowShown:function(){Qa=!1},dispatchSortableEvent:function(a){os({sortable:n,name:a,originalEvent:s})}},r))};function os(e){ute(hi({putSortable:Oo,cloneEl:to,targetEl:gt,rootEl:Gn,oldIndex:id,oldDraggableIndex:Mf,newIndex:Vs,newDraggableIndex:el},e))}var gt,eo,Xt,Gn,hc,vv,to,Qa,id,Vs,Mf,el,yv,Oo,ad=!1,wv=!1,Cv=[],fc,Nr,nE,oE,cM,uM,Nf,ld,Lf,Vf=!1,bv=!1,Sv,jo,sE=[],rE=!1,Ev=[],_v=typeof document<"u",Rv=eM,dM=Pf||ia?"cssFloat":"float",hte=_v&&!nte&&!eM&&"draggable"in document.createElement("div"),hM=function(){if(_v){if(ia)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),fM=function(t,n){var o=Bt(t),s=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=sd(t,0,n),i=sd(t,1,n),a=r&&Bt(r),l=i&&Bt(i),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+So(r).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+So(i).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return i&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=s&&o[dM]==="none"||i&&o[dM]==="none"&&c+u>s)?"vertical":"horizontal"},fte=function(t,n,o){var s=o?t.left:t.top,r=o?t.right:t.bottom,i=o?t.width:t.height,a=o?n.left:n.top,l=o?n.right:n.bottom,c=o?n.width:n.height;return s===a||r===l||s+i/2===a+c/2},pte=function(t,n){var o;return Cv.some(function(s){var r=s[Ls].options.emptyInsertThreshold;if(!(!r||QS(s))){var i=So(s),a=t>=i.left-r&&t<=i.right+r,l=n>=i.top-r&&n<=i.bottom+r;if(a&&l)return o=s}}),o},pM=function(t){function n(r,i){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(i||d))return!0;if(r==null||r===!1)return!1;if(i&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,c,u),i)(a,l,c,u);var h=(i?a:l).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},s=t.group;(!s||gv(s)!="object")&&(s={name:s}),o.name=s.name,o.checkPull=n(s.pull,!0),o.checkPut=n(s.put),o.revertClone=s.revertClone,t.group=o},gM=function(){!hM&&Xt&&Bt(Xt,"display","none")},mM=function(){!hM&&Xt&&Bt(Xt,"display","")};_v&&document.addEventListener("click",function(e){if(wv)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),wv=!1,!1},!0);var pc=function(t){if(gt){t=t.touches?t.touches[0]:t;var n=pte(t.clientX,t.clientY);if(n){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[Ls]._onDragOver(o)}}},gte=function(t){gt&&gt.parentNode[Ls]._isOutsideThisEl(t.target)};function $t(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=sa({},t),e[Ls]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return fM(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(i,a){i.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:$t.supportPointer!==!1&&"PointerEvent"in window&&!kf,emptyInsertThreshold:5};Of.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);pM(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:hte,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Cn(e,"pointerdown",this._onTapStart):(Cn(e,"mousedown",this._onTapStart),Cn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Cn(e,"dragover",this),Cn(e,"dragenter",this)),Cv.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),sa(this,ate())}$t.prototype={constructor:$t,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ld=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,gt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,s=this.options,r=s.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=s.filter;if(Ete(o),!gt&&!(/mousedown|pointerdown/.test(i)&&t.button!==0||s.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&kf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=fi(l,s.draggable,o,!1),!(l&&l.animated)&&vv!==l)){if(id=rr(l),Mf=rr(l,s.draggable),typeof u=="function"){if(u.call(this,t,l,this)){os({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:o,fromEl:o}),vs("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=fi(c,d.trim(),o,!1),d)return os({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:o,toEl:o}),vs("filter",n,{evt:t}),!0}),u)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!fi(c,s.handle,o,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,o){var s=this,r=s.el,i=s.options,a=r.ownerDocument,l;if(o&&!gt&&o.parentNode===r){var c=So(o);if(Gn=r,gt=o,eo=gt.parentNode,hc=gt.nextSibling,vv=o,yv=i.group,$t.dragged=gt,fc={target:gt,clientX:(n||t).clientX,clientY:(n||t).clientY},cM=fc.clientX-c.left,uM=fc.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,gt.style["will-change"]="all",l=function(){if(vs("delayEnded",s,{evt:t}),$t.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!QO&&s.nativeDraggable&&(gt.draggable=!0),s._triggerDragStart(t,n),os({sortable:s,name:"choose",originalEvent:t}),Ns(gt,i.chosenClass,!0)},i.ignore.split(",").forEach(function(u){oM(gt,u.trim(),iE)}),Cn(a,"dragover",pc),Cn(a,"mousemove",pc),Cn(a,"touchmove",pc),Cn(a,"mouseup",s._onDrop),Cn(a,"touchend",s._onDrop),Cn(a,"touchcancel",s._onDrop),QO&&this.nativeDraggable&&(this.options.touchStartThreshold=4,gt.draggable=!0),vs("delayStart",this,{evt:t}),i.delay&&(!i.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pf||ia))){if($t.eventCanceled){this._onDrop();return}Cn(a,"mouseup",s._disableDelayedDrag),Cn(a,"touchend",s._disableDelayedDrag),Cn(a,"touchcancel",s._disableDelayedDrag),Cn(a,"mousemove",s._delayedDragTouchMoveHandler),Cn(a,"touchmove",s._delayedDragTouchMoveHandler),i.supportPointer&&Cn(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,i.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){gt&&iE(gt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pn(t,"mouseup",this._disableDelayedDrag),pn(t,"touchend",this._disableDelayedDrag),pn(t,"touchcancel",this._disableDelayedDrag),pn(t,"mousemove",this._delayedDragTouchMoveHandler),pn(t,"touchmove",this._delayedDragTouchMoveHandler),pn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?Cn(document,"pointermove",this._onTouchMove):n?Cn(document,"touchmove",this._onTouchMove):Cn(document,"mousemove",this._onTouchMove):(Cn(gt,"dragend",this),Cn(Gn,"dragstart",this._onDragStart));try{document.selection?Tv(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(ad=!1,Gn&&gt){vs("dragStarted",this,{evt:n}),this.nativeDraggable&&Cn(document,"dragover",gte);var o=this.options;!t&&Ns(gt,o.dragClass,!1),Ns(gt,o.ghostClass,!0),$t.active=this,t&&this._appendGhost(),os({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Nr){this._lastX=Nr.clientX,this._lastY=Nr.clientY,gM();for(var t=document.elementFromPoint(Nr.clientX,Nr.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Nr.clientX,Nr.clientY),t!==n);)n=t;if(gt.parentNode[Ls]._isOutsideThisEl(t),n)do{if(n[Ls]){var o=void 0;if(o=n[Ls]._onDragOver({clientX:Nr.clientX,clientY:Nr.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);mM()}},_onTouchMove:function(t){if(fc){var n=this.options,o=n.fallbackTolerance,s=n.fallbackOffset,r=t.touches?t.touches[0]:t,i=Xt&&od(Xt,!0),a=Xt&&i&&i.a,l=Xt&&i&&i.d,c=Rv&&jo&&rM(jo),u=(r.clientX-fc.clientX+s.x)/(a||1)+(c?c[0]-sE[0]:0)/(a||1),d=(r.clientY-fc.clientY+s.y)/(l||1)+(c?c[1]-sE[1]:0)/(l||1);if(!$t.active&&!ad){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(Xt){i?(i.e+=u-(nE||0),i.f+=d-(oE||0)):i={a:1,b:0,c:0,d:1,e:u,f:d};var h="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");Bt(Xt,"webkitTransform",h),Bt(Xt,"mozTransform",h),Bt(Xt,"msTransform",h),Bt(Xt,"transform",h),nE=u,oE=d,Nr=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Xt){var t=this.options.fallbackOnBody?document.body:Gn,n=So(gt,!0,Rv,!0,t),o=this.options;if(Rv){for(jo=t;Bt(jo,"position")==="static"&&Bt(jo,"transform")==="none"&&jo!==document;)jo=jo.parentNode;jo!==document.body&&jo!==document.documentElement?(jo===document&&(jo=pi()),n.top+=jo.scrollTop,n.left+=jo.scrollLeft):jo=pi(),sE=rM(jo)}Xt=gt.cloneNode(!0),Ns(Xt,o.ghostClass,!1),Ns(Xt,o.fallbackClass,!0),Ns(Xt,o.dragClass,!0),Bt(Xt,"transition",""),Bt(Xt,"transform",""),Bt(Xt,"box-sizing","border-box"),Bt(Xt,"margin",0),Bt(Xt,"top",n.top),Bt(Xt,"left",n.left),Bt(Xt,"width",n.width),Bt(Xt,"height",n.height),Bt(Xt,"opacity","0.8"),Bt(Xt,"position",Rv?"absolute":"fixed"),Bt(Xt,"zIndex","100000"),Bt(Xt,"pointerEvents","none"),$t.ghost=Xt,t.appendChild(Xt),Bt(Xt,"transform-origin",cM/parseInt(Xt.style.width)*100+"% "+uM/parseInt(Xt.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,s=t.dataTransfer,r=o.options;if(vs("dragStart",this,{evt:t}),$t.eventCanceled){this._onDrop();return}vs("setupClone",this),$t.eventCanceled||(to=lM(gt),to.draggable=!1,to.style["will-change"]="",this._hideClone(),Ns(to,this.options.chosenClass,!1),$t.clone=to),o.cloneId=Tv(function(){vs("clone",o),!$t.eventCanceled&&(o.options.removeCloneOnHide||Gn.insertBefore(to,gt),o._hideClone(),os({sortable:o,name:"clone"}))}),!n&&Ns(gt,r.dragClass,!0),n?(wv=!0,o._loopId=setInterval(o._emulateDragOver,50)):(pn(document,"mouseup",o._onDrop),pn(document,"touchend",o._onDrop),pn(document,"touchcancel",o._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(o,s,gt)),Cn(document,"drop",o),Bt(gt,"transform","translateZ(0)")),ad=!0,o._dragStartId=Tv(o._dragStarted.bind(o,n,t)),Cn(document,"selectstart",o),Nf=!0,kf&&Bt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,s,r,i,a=this.options,l=a.group,c=$t.active,u=yv===l,d=a.sort,h=Oo||c,f,p=this,g=!1;if(rE)return;function v(J,ae){vs(J,p,hi({evt:t,isOwner:u,axis:f?"vertical":"horizontal",revert:i,dragRect:s,targetRect:r,canSort:d,fromSortable:h,target:o,completed:S,onMove:function(ee,$){return Dv(Gn,n,gt,s,ee,So(ee),t,$)},changed:b},ae))}function w(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(J){return v("dragOverCompleted",{insertion:J}),J&&(u?c._hideClone():c._showClone(p),p!==h&&(Ns(gt,Oo?Oo.options.ghostClass:c.options.ghostClass,!1),Ns(gt,a.ghostClass,!0)),Oo!==p&&p!==$t.active?Oo=p:p===$t.active&&Oo&&(Oo=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===gt&&!gt.animated||o===n&&!o.animated)&&(ld=null),!a.dragoverBubble&&!t.rootEl&&o!==document&&(gt.parentNode[Ls]._isOutsideThisEl(t.target),!J&&pc(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Vs=rr(gt),el=rr(gt,a.draggable),os({sortable:p,name:"change",toEl:n,newIndex:Vs,newDraggableIndex:el,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=fi(o,a.draggable,n,!0),v("dragOver"),$t.eventCanceled)return g;if(gt.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return S(!1);if(wv=!1,c&&!a.disabled&&(u?d||(i=eo!==Gn):Oo===this||(this.lastPutMode=yv.checkPull(this,c,gt,t))&&l.checkPut(this,c,gt,t))){if(f=this._getDirection(t,o)==="vertical",s=So(gt),v("dragOverValid"),$t.eventCanceled)return g;if(i)return eo=Gn,w(),this._hideClone(),v("revert"),$t.eventCanceled||(hc?Gn.insertBefore(gt,hc):Gn.appendChild(gt)),S(!0);var C=QS(n,a.draggable);if(!C||wte(t,f,this)&&!C.animated){if(C===gt)return S(!1);if(C&&n===t.target&&(o=C),o&&(r=So(o)),Dv(Gn,n,gt,s,o,r,t,!!o)!==!1)return w(),n.appendChild(gt),eo=n,b(),S(!0)}else if(C&&yte(t,f,this)){var _=sd(n,0,a,!0);if(_===gt)return S(!1);if(o=_,r=So(o),Dv(Gn,n,gt,s,o,r,t,!1)!==!1)return w(),n.insertBefore(gt,_),eo=n,b(),S(!0)}else if(o.parentNode===n){r=So(o);var E=0,x,I=gt.parentNode!==n,F=!fte(gt.animated&&gt.toRect||s,o.animated&&o.toRect||r,f),M=f?"top":"left",T=sM(o,"top","top")||sM(gt,"top","top"),A=T?T.scrollTop:void 0;ld!==o&&(x=r[M],Vf=!1,bv=!F&&a.invertSwap||I),E=Cte(t,o,r,f,F?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,bv,ld===o);var k;if(E!==0){var P=rr(gt);do P-=E,k=eo.children[P];while(k&&(Bt(k,"display")==="none"||k===Xt))}if(E===0||k===o)return S(!1);ld=o,Lf=E;var D=o.nextElementSibling,N=!1;N=E===1;var G=Dv(Gn,n,gt,s,o,r,t,N);if(G!==!1)return(G===1||G===-1)&&(N=G===1),rE=!0,setTimeout(vte,30),w(),N&&!D?n.appendChild(gt):o.parentNode.insertBefore(gt,N?D:o),T&&aM(T,0,A-T.scrollTop),eo=gt.parentNode,x!==void 0&&!bv&&(Sv=Math.abs(x-So(o)[M])),b(),S(!0)}if(n.contains(gt))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pn(document,"mousemove",this._onTouchMove),pn(document,"touchmove",this._onTouchMove),pn(document,"pointermove",this._onTouchMove),pn(document,"dragover",pc),pn(document,"mousemove",pc),pn(document,"touchmove",pc)},_offUpEvents:function(){var t=this.el.ownerDocument;pn(t,"mouseup",this._onDrop),pn(t,"touchend",this._onDrop),pn(t,"pointerup",this._onDrop),pn(t,"touchcancel",this._onDrop),pn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(Vs=rr(gt),el=rr(gt,o.draggable),vs("drop",this,{evt:t}),eo=gt&&gt.parentNode,Vs=rr(gt),el=rr(gt,o.draggable),$t.eventCanceled){this._nulling();return}ad=!1,bv=!1,Vf=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),aE(this.cloneId),aE(this._dragStartId),this.nativeDraggable&&(pn(document,"drop",this),pn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),kf&&Bt(document.body,"user-select",""),Bt(gt,"transform",""),t&&(Nf&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),Xt&&Xt.parentNode&&Xt.parentNode.removeChild(Xt),(Gn===eo||Oo&&Oo.lastPutMode!=="clone")&&to&&to.parentNode&&to.parentNode.removeChild(to),gt&&(this.nativeDraggable&&pn(gt,"dragend",this),iE(gt),gt.style["will-change"]="",Nf&&!ad&&Ns(gt,Oo?Oo.options.ghostClass:this.options.ghostClass,!1),Ns(gt,this.options.chosenClass,!1),os({sortable:this,name:"unchoose",toEl:eo,newIndex:null,newDraggableIndex:null,originalEvent:t}),Gn!==eo?(Vs>=0&&(os({rootEl:eo,name:"add",toEl:eo,fromEl:Gn,originalEvent:t}),os({sortable:this,name:"remove",toEl:eo,originalEvent:t}),os({rootEl:eo,name:"sort",toEl:eo,fromEl:Gn,originalEvent:t}),os({sortable:this,name:"sort",toEl:eo,originalEvent:t})),Oo&&Oo.save()):Vs!==id&&Vs>=0&&(os({sortable:this,name:"update",toEl:eo,originalEvent:t}),os({sortable:this,name:"sort",toEl:eo,originalEvent:t})),$t.active&&((Vs==null||Vs===-1)&&(Vs=id,el=Mf),os({sortable:this,name:"end",toEl:eo,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){vs("nulling",this),Gn=gt=eo=Xt=hc=to=vv=Qa=fc=Nr=Nf=Vs=el=id=Mf=ld=Lf=Oo=yv=$t.dragged=$t.ghost=$t.clone=$t.active=null,Ev.forEach(function(t){t.checked=!0}),Ev.length=nE=oE=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":gt&&(this._onDragOver(t),mte(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,s=0,r=o.length,i=this.options;s<r;s++)n=o[s],fi(n,i.draggable,this.el,!1)&&t.push(n.getAttribute(i.dataIdAttr)||Ste(n));return t},sort:function(t,n){var o={},s=this.el;this.toArray().forEach(function(r,i){var a=s.children[i];fi(a,this.options.draggable,s,!1)&&(o[r]=a)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(s.removeChild(o[r]),s.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return fi(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var s=Of.modifyOption(this,t,n);typeof s<"u"?o[t]=s:o[t]=n,t==="group"&&pM(o)},destroy:function(){vs("destroy",this);var t=this.el;t[Ls]=null,pn(t,"mousedown",this._onTapStart),pn(t,"touchstart",this._onTapStart),pn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pn(t,"dragover",this),pn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Cv.splice(Cv.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Qa){if(vs("hideClone",this),$t.eventCanceled)return;Bt(to,"display","none"),this.options.removeCloneOnHide&&to.parentNode&&to.parentNode.removeChild(to),Qa=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Qa){if(vs("showClone",this),$t.eventCanceled)return;gt.parentNode==Gn&&!this.options.group.revertClone?Gn.insertBefore(to,gt):hc?Gn.insertBefore(to,hc):Gn.appendChild(to),this.options.group.revertClone&&this.animate(gt,to),Bt(to,"display",""),Qa=!1}}};function mte(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Dv(e,t,n,o,s,r,i,a){var l,c=e[Ls],u=c.options.onMove,d;return window.CustomEvent&&!ia&&!Pf?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=o,l.related=s||t,l.relatedRect=r||So(t),l.willInsertAfter=a,l.originalEvent=i,e.dispatchEvent(l),u&&(d=u.call(c,l,i)),d}function iE(e){e.draggable=!1}function vte(){rE=!1}function yte(e,t,n){var o=So(sd(n.el,0,n.options,!0)),s=10;return t?e.clientX<o.left-s||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-s||e.clientY<o.bottom&&e.clientX<o.left}function wte(e,t,n){var o=So(QS(n.el,n.options.draggable)),s=10;return t?e.clientX>o.right+s||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+s}function Cte(e,t,n,o,s,r,i,a){var l=o?e.clientY:e.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!i){if(a&&Sv<c*s){if(!Vf&&(Lf===1?l>u+c*r/2:l<d-c*r/2)&&(Vf=!0),Vf)h=!0;else if(Lf===1?l<u+Sv:l>d-Sv)return-Lf}else if(l>u+c*(1-s)/2&&l<d-c*(1-s)/2)return bte(t)}return h=h||i,h&&(l<u+c*r/2||l>d-c*r/2)?l>u+c/2?1:-1:0}function bte(e){return rr(gt)<rr(e)?1:-1}function Ste(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function Ete(e){Ev.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&Ev.push(o)}}function Tv(e){return setTimeout(e,0)}function aE(e){return clearTimeout(e)}_v&&Cn(document,"touchmove",function(e){($t.active||ad)&&e.cancelable&&e.preventDefault()}),$t.utils={on:Cn,off:pn,css:Bt,find:oM,is:function(t,n){return!!fi(t,n,t,!1)},extend:rte,throttle:iM,closest:fi,toggleClass:Ns,clone:lM,index:rr,nextTick:Tv,cancelNextTick:aE,detectDirection:fM,getChild:sd},$t.get=function(e){return e[Ls]},$t.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&($t.utils=hi(hi({},$t.utils),o.utils)),Of.mount(o)})},$t.create=function(e,t){return new $t(e,t)},$t.version=tte;var po=[],Bf,lE,cE=!1,uE,dE,Iv,$f;function _te(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?Cn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Cn(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Cn(document,"touchmove",this._handleFallbackAutoScroll):Cn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?pn(document,"dragover",this._handleAutoScroll):(pn(document,"pointermove",this._handleFallbackAutoScroll),pn(document,"touchmove",this._handleFallbackAutoScroll),pn(document,"mousemove",this._handleFallbackAutoScroll)),vM(),xv(),ite()},nulling:function(){Iv=lE=Bf=cE=$f=uE=dE=null,po.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var s=this,r=(n.touches?n.touches[0]:n).clientX,i=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(r,i);if(Iv=n,o||this.options.forceAutoScrollFallback||Pf||ia||kf){hE(n,this.options,a,o);var l=Ja(a,!0);cE&&(!$f||r!==uE||i!==dE)&&($f&&vM(),$f=setInterval(function(){var c=Ja(document.elementFromPoint(r,i),!0);c!==l&&(l=c,xv()),hE(n,s.options,c,o)},10),uE=r,dE=i)}else{if(!this.options.bubbleScroll||Ja(a,!0)===pi()){xv();return}hE(n,this.options,Ja(a,!1),!1)}}},sa(e,{pluginName:"scroll",initializeByDefault:!0})}function xv(){po.forEach(function(e){clearInterval(e.pid)}),po=[]}function vM(){clearInterval($f)}var hE=iM(function(e,t,n,o){if(t.scroll){var s=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,i=t.scrollSensitivity,a=t.scrollSpeed,l=pi(),c=!1,u;lE!==n&&(lE=n,xv(),Bf=t.scroll,u=t.scrollFn,Bf===!0&&(Bf=Ja(n,!0)));var d=0,h=Bf;do{var f=h,p=So(f),g=p.top,v=p.bottom,w=p.left,S=p.right,b=p.width,C=p.height,_=void 0,E=void 0,x=f.scrollWidth,I=f.scrollHeight,F=Bt(f),M=f.scrollLeft,T=f.scrollTop;f===l?(_=b<x&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),E=C<I&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(_=b<x&&(F.overflowX==="auto"||F.overflowX==="scroll"),E=C<I&&(F.overflowY==="auto"||F.overflowY==="scroll"));var A=_&&(Math.abs(S-s)<=i&&M+b<x)-(Math.abs(w-s)<=i&&!!M),k=E&&(Math.abs(v-r)<=i&&T+C<I)-(Math.abs(g-r)<=i&&!!T);if(!po[d])for(var P=0;P<=d;P++)po[P]||(po[P]={});(po[d].vx!=A||po[d].vy!=k||po[d].el!==f)&&(po[d].el=f,po[d].vx=A,po[d].vy=k,clearInterval(po[d].pid),(A!=0||k!=0)&&(c=!0,po[d].pid=setInterval((function(){o&&this.layer===0&&$t.active._onTouchMove(Iv);var D=po[this.layer].vy?po[this.layer].vy*a:0,N=po[this.layer].vx?po[this.layer].vx*a:0;typeof u=="function"&&u.call($t.dragged.parentNode[Ls],N,D,e,Iv,po[this.layer].el)!=="continue"||aM(po[this.layer].el,N,D)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=Ja(h,!1)));cE=c}},30),yM=function(t){var n=t.originalEvent,o=t.putSortable,s=t.dragEl,r=t.activeSortable,i=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var c=o||r;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(i("spill"),this.onSpill({dragEl:s,putSortable:o}))}};function fE(){}fE.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var s=sd(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(n,s):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:yM},sa(fE,{pluginName:"revertOnSpill"});function pE(){}pE.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,s=o||this.sortable;s.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),s.animateAll()},drop:yM},sa(pE,{pluginName:"removeOnSpill"}),$t.mount(new _te),$t.mount(pE,fE);function Rte(e,t){return Object.values(e).indexOf(t)}function Dte(e,t,n,o){if(!e)return[];const s=Object.values(e),r=t.length-o;return[...t].map((a,l)=>l>=r?s.length:s.indexOf(a))}function Tte(e){return["transition-group","TransitionGroup"].includes(e)}function wM(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?Tte(t.name):!1}function Ite(e,t){return t?{...t.props,...t.attrs}:e}const gE=["Start","Add","Remove","Update","End"],mE=["Choose","Unchoose","Sort","Filter","Clone"],xte=["Move",...gE,...mE].map(e=>"on"+e);let vE=null;const Fte=st({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...gE.map(e=>e.toLowerCase()),...mE.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:o}){const s=B(!1),r=B(!1),i=B(0),a=B(0),l=B([]),c=B(null),u=B(null),d=q(()=>e.list?e.list:e.modelValue),h=oo();function f(){return e.component?HG(e.component):e.tag}function p(j){if(u.value)for(const te in j){const pe=ZO(te);xte.indexOf(pe)===-1&&u.value.option(pe,j[te])}}function g(){var j;return((j=h==null?void 0:h.proxy)==null?void 0:j.$el.children)||[]}async function v(){var j;await vt(),l.value=Dte(g(),((j=h==null?void 0:h.proxy)==null?void 0:j.$el.children)||[],s.value,a.value)}function w(j){const te=Rte(g()||[],j);if(te===-1)return null;const pe=d.value?d.value[te]:null;return{index:te,element:pe}}function S(j){vt(()=>t("change",j))}function b(j){if(e.list){j(e.list);return}const te=[...e.modelValue||[]];j(te),t("update:modelValue",te)}function C(...j){b(pe=>pe.splice(...j))}function _(j,te){b(ve=>ve.splice(te,0,ve.splice(j,1)[0]))}function E(j){const te=l.value,pe=te.length;return j>pe-1?pe:te[j]}function x(){var te,pe;return n.default&&((pe=(te=n.default()[0])==null?void 0:te.component)==null?void 0:pe.proxy)||null}function I(j){if(!e.noTransitionOnDrag||!s.value)return;const te=g();te[j]&&(te[j].data=null);const pe=x();pe&&(pe.children=[],pe.kept=void 0)}function F(j){v(),c.value=w(j.item),c.value&&(j.item._underlying_vm_=e.clone(c.value.element),vE=j.item)}function M(j){const te=j.item._underlying_vm_;if(te===void 0)return;JS(j.item);const pe=E(j.newIndex);C(pe,0,te),v(),S({added:{element:te,newIndex:pe}})}function T(j){var pe;if(XO((pe=h==null?void 0:h.proxy)==null?void 0:pe.$el,j.item,j.oldIndex),j.pullMode==="clone"){JS(j.clone);return}if(!c.value)return;const te=c.value.index;C(te,1),I(te),S({removed:{element:c.value.element,oldIndex:te}})}function A(j){var ve,we;JS(j.item),XO(j.from,j.item,j.oldIndex);const te=(ve=c.value)==null?void 0:ve.index,pe=E(j.newIndex);_(te,pe),S({moved:{element:(we=c.value)==null?void 0:we.element,oldIndex:te,newIndex:pe}})}function k(j,te){Object.prototype.hasOwnProperty.call(j,te)&&(j[te]+=i.value)}function P(j){return j.__draggable_component__}function D({to:j,related:te}){const pe=P(j);if(!pe)return{component:pe};const ve=pe.realList,we={list:ve,component:pe};if(j!==te&&ve&&pe.getUnderlyingVm){const re=pe.getUnderlyingVm(te);if(re)return Object.assign(re,we)}return we}function N(j,te){const pe=[...te.to.children].filter(W=>W.style.display!=="none");if(pe.length===0)return 0;const ve=pe.indexOf(te.related),we=j.component.getVmIndex(ve);return pe.indexOf(vE)!==-1||!te.willInsertAfter?we:we+1}const G=()=>{var we,re;const j={};gE.forEach(W=>{j["on"+W]=ae(W)}),mE.forEach(W=>{j["on"+W]=J.bind(null,W)});const te=Object.keys(o).reduce((W,ge)=>(W[ZO(ge)]=o[ge],W),{}),pe=Object.assign({},te,j,{onMove:(W,ge)=>ne(W,ge)});"draggable"in pe||(pe.draggable=">*");const ve=((we=h==null?void 0:h.proxy)==null?void 0:we.$el.nodeType)===1?h.proxy.$el:((re=h==null?void 0:h.proxy)==null?void 0:re.$el.parentElement)||null;ve&&(u.value=new $t(ve,pe),ve.__draggable_component__=h==null?void 0:h.proxy,v())};function J(j,te){vt(()=>t(j.toLowerCase(),te))}function ae(j){return te=>{if(d.value!==null){const pe="onDrag"+j,ve=$[pe];ve&&ve(te)}J(j,te)}}function ne(j,te){const pe=e.move;if(!pe||!d.value)return!0;const ve=D(j),we=c.value,re=N(ve,j);we&&Object.assign(we,{futureIndex:re});const W=Object.assign({},j,{relatedContext:ve,draggedContext:we});return pe(W,te)}function ee(){v(),vE=null}const $={onDragStart:F,onDragAdd:M,onDragRemove:T,onDragUpdate:A,onDragMove:ne,onDragEnd:ee};return Qt(()=>{G()}),e.list!==null&&e.modelValue!==null&&Yee.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:r,headerOffset:i,footerOffset:a,transitionMode:s,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:w,emitChanges:S,alterList:b,spliceList:C,updatePosition:_,getVmIndex:E,getComponent:x,resetTransitionData:I,onDragStart:F,onDragAdd:M,onDragRemove:T,onDragUpdate:A,updateProperty:k,onDragMove:ne,onDragEnd:ee,mounted:G,context:c,sortableInstance:u,getRelatedContextFromMoveEvent:D,getTargetedComponent:P,computeFutureIndex:N}},render(){const e=this.getTag(),t=Ite(this.$attrs,this.componentData);if(typeof e=="string"){const o=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return o?(this.transitionMode=wM(o),su(e,t,o)):su(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const o=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=wM(o||[])}return su(e,t,n)}}),Pte=Ct(st({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=B([]),o=e,s=t,r=B({}),i=()=>{n.value=o.modelValue.map(c=>({id:c.field,name:c.headerName,...c}))||[],o.modelValue.forEach(c=>{r.value[c.field]={...c}})};tt(()=>o.modelValue,c=>{i()},{immediate:!0,deep:!0}),tt(n,c=>{if(c.length===o.modelValue.length&&!c.every((d,h)=>d.id===o.modelValue[h].field)){const d=c.map(h=>r.value[h.id]);s("changed",d),s("update:modelValue",d)}});const a=()=>!(o.readOnly||o.disabled),l=c=>!(o.readOnly||o.disabled);return(c,u)=>(K(),Ue(H(Fte),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),tag:"transition-group",disabled:o.disabled||o.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:he(()=>[(K(!0),ie(xt,null,Fn(n.value,(d,h)=>(K(),ie("div",{key:d.id,class:"fade-item"},[Tt(c.$slots,"item",{item:d,index:h},()=>[Qe(ut(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),kte={key:0},Ate={key:1,style:{"font-style":"italic"}},Ote={key:2,style:{"font-style":"italic"}},Mte={key:3},Fv=Ct(st({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""},focusIndex:{}},emits:["toggle-column"],setup(e,{emit:t}){const n=Yt,o=e,s=B(o.columnStates[String(o.item.field)]||!1),r=t,i=h=>{s.value=h},a=q(()=>{var h;return(h=o.item)==null?void 0:h.context}),l=q(()=>{var f,p,g;return(f=a.value)!=null&&f.formula?"formular":((g=(p=a.value)==null?void 0:p.metric_type)==null?void 0:g.code)||"number"}),c=q(()=>{var h,f;return(f=(h=o.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),u=q(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=q(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return tt(()=>s.value,()=>{r("toggle-column",o.item.field,o.item.required)}),(h,f)=>(K(),ie("div",{key:e.item.field,class:Q([h.$style["column-config__item"],{[h.$style.disabled]:o.readOnly,[h.$style["is-metric"]]:c.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:u.value}])},[ue(LO,{focusIndex:o.focusIndex,id:`col-${e.item.field}`,"model-value":s.value==!0?H(Ft).CHECKED:H(Ft).UNCHECK,"onUpdate:modelValue":i,disabled:o.disableCheckbox||e.isDisableNewCheck&&!s.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),Ke((K(),ie("div",{class:"move-handler",style:rn({cursor:o.disableDrag?"not-allowed":"move"})},[ue(lt,{color:o.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:Q(h.$style.handler)},null,8,["color","class"])],4)),[[H(n),o.disableDrag==!0?o.disableDragTooltip:""]]),c.value?(K(),ie("div",{key:0,class:Q(h.$style["metric-type"])},[l.value=="rating"?(K(),ie("span",kte,"★")):l.value=="formular"?(K(),ie("span",Ate," ƒx ")):l.value=="number"?(K(),ie("span",Ote," # ")):(K(),ie("span",Mte,ut(l.value),1))],2)):Xe("",!0),me("span",{class:Q(h.$style["column-config__item-label"])},[Ke((K(),ie("div",null,[Qe(ut(e.item.headerName),1)])),[[H(n),{content:e.item.headerName}]])],2),d.value?Ke((K(),ie("div",{key:1,class:Q(h.$style["metric-icon"])},[ue(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[H(n),"Point metric"]]):Xe("",!0),u.value?Ke((K(),ie("div",{key:2,class:Q(h.$style["metric-icon"])},[ue(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[H(n),"Woohoo metric"]]):Xe("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_1ppdl_1","is-metric":"_is-metric_1ppdl_8","is-woohoo-metric":"_is-woohoo-metric_1ppdl_12","is-point-metric":"_is-point-metric_1ppdl_15","column-config__item-label":"_column-config__item-label_1ppdl_18",disabled:"_disabled_1ppdl_34",readOnly:"_readOnly_1ppdl_38","column-config__item--pinned":"_column-config__item--pinned_1ppdl_41",handler:"_handler_1ppdl_48",badge:"_badge_1ppdl_52","metric-type":"_metric-type_1ppdl_78","metric-icon":"_metric-icon_1ppdl_106"}}]]),Nte=Ct(st({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{hide:r,triggerRef:i,popupRef:a,isVisible:l,toggle:c}=yo({toggleOnClick:!0,placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),u=q(()=>l.value);tt(l,f=>{s(f?"open":"close")});const d=()=>{r()};t({closeDropdown:d,isOpen:u});const h=f=>{f.key==="Escape"&&a.value&&r()};return Qt(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),qn(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(K(),ie("div",{ref_key:"triggerRef",ref:i,class:Q(f.$style["dropdown-wrapper"])},[Tt(f.$slots,"trigger",{open:H(l),toggle:H(c),closeDropdown:d},()=>[me("button",{class:Q(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),me("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:Q(f.$style["dropdown-content"]),style:rn({display:H(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[Tt(f.$slots,"content",{closeDropdown:d,visible:H(l)},()=>[me("div",{class:Q(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),Lte={class:"reach-limit-icon"},Vte=Ct(st({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=ko,i=n,a=B(""),l=B(),c=q(()=>a.value.trim().length>0),u=B([]),d=B({}),{triggerRef:h,popupRef:f,isVisible:p,hide:g}=yo({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});tt(p,P=>{var D;P&&((D=l.value)==null||D.focus())});const v=q(()=>s.disabled||a.value.length>0),w=q(()=>u.value.filter(P=>P.pinned==="left"&&P.field&&P.headerName)),S=q(()=>u.value.filter(P=>P.pinned==="right"&&P.field||P.field==="blank")),b=q({get:()=>u.value.filter(P=>!P.pinned&&P.field&&P.field!=="blank"),set:P=>{u.value=[...w.value,...P,...S.value]}}),C=q(()=>{if(!a.value)return{};const P=a.value.toLowerCase();return[...u.value,...b.value].reduce((D,N)=>{var G;return(G=N.headerName)!=null&&G.toLowerCase().includes(P)&&N.field&&(D[N.field]=!0),D},{})}),_=q(()=>s.modelValue),E=()=>{const P={};u.value.forEach(D=>{D.field&&(P[D.field]=!D.hide)}),d.value=P},x=q(()=>{if(!a.value)return u.value;const P=a.value.toLowerCase();return u.value.filter(D=>{var N;return(N=D.headerName)==null?void 0:N.toLowerCase().includes(P)})}),I=()=>{var N;const P=(N=s.gridApi)==null?void 0:N.getColumnState().reduce((G,J)=>(G[J.colId]=Number(J.width),G),{}),D=u.value.map(G=>({...G,hide:G.field?!d.value[G.field]:!1,width:G.field?P==null?void 0:P[G.field]:G.width}));i("update:modelValue",D),i("change",D),i("input",D)},F=P=>{const D=[...w.value,...P,...S.value];s.checkboxColumn&&D.unshift(s.checkboxColumn),u.value=D,I()},M=P=>{P&&(d.value[P]=!d.value[P],I())};tt(_,P=>{P&&P.length>0&&(u.value=[...P],E())}),t({updateColumnDefs(P){u.value=[...P],E()}});const T=q(()=>k.value>=5),A=q(()=>s.disabled||a.value.length>0),k=q(()=>u.value.reduce((P,D)=>D.field&&D.field.includes("metric")&&d.value[D.field]===!0?P+1:P,0));return(P,D)=>(K(),ie("div",{class:Q(P.$style["table-customization"])},[me("div",{ref_key:"triggerRef",ref:h},[Tt(P.$slots,"trigger",{},()=>[Ke((K(),Ue(at,{variant:["secondary"],disabled:s.disabled,actived:H(p),style:{width:"32px"},onEscape:H(g)},{prefix:he(()=>[ue(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[H(r),"7"],[H(o),"Columns"]])])],512),me("div",{ref_key:"popupRef",ref:f,class:Q(P.$style["tippy-content-wrapper"])},[me("div",{class:Q([P.$style["column-config"],T.value?P.$style["has-warning"]:""]),style:rn({"--max-height":s.tableHeight?s.tableHeight:"max(500px, 60vh)"})},[ue(SS,{tabIndex:"7.0",modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=N=>a.value=N),ref_key:"searchBoxRef",ref:l},null,8,["modelValue"]),me("div",{class:Q(P.$style["column-config__header"])},[...D[2]||(D[2]=[me("span",null,"Manage columns",-1)])],2),T.value?(K(),ie("div",{key:0,class:Q(P.$style["reach-limit"])},[me("div",Lte,[ue(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),me("div",{class:Q(P.$style["warning-limit-text"])},[...D[3]||(D[3]=[Qe(" You’ve reached the maximum number of metric columns. ",-1),me("br",null,null,-1),Qe(" Deselect one to show another. ",-1)])],2)],2)):Xe("",!0),c.value?(K(),ie(xt,{key:1},[x.value.length===0&&c.value?(K(),ie("div",{key:0,class:Q(P.$style["no-columns"])},[...D[4]||(D[4]=[Qe(" No results. ",-1),me("br",null,null,-1),Qe(" Try another search. ",-1)])],2)):Xe("",!0),c.value&&x.value.length>0?(K(),ie("div",{key:1,class:Q(P.$style["column-config__pinned-section"])},[(K(!0),ie(xt,null,Fn(x.value,N=>{var G;return K(),Ue(Fv,{key:N.colId,item:N,columnStates:d.value,disableDrag:A.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:s.readOnly,isDisableNewCheck:T.value&&((G=N.colId)==null?void 0:G.includes("metric")),onToggleColumn:M},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Xe("",!0)],64)):Xe("",!0),c.value?Xe("",!0):(K(),ie("div",{key:2,class:Q(P.$style["column-config__list"])},[(K(!0),ie(xt,null,Fn(w.value,N=>Ke((K(),Ue(Fv,{key:N.field,item:N,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:d.value},null,8,["item","columnStates"])),[[Ks,C.value[N.field]||!a.value]])),128)),ue(Pte,{modelValue:b.value,"onUpdate:modelValue":D[1]||(D[1]=N=>b.value=N),"group-name":"columns",onChanged:F,disabled:v.value,readOnly:s.readOnly},{item:he(({item:N,index:G})=>[Ke((K(),Ue(Fv,{focusIndex:`7.${G+1}`,key:N.id,item:N,columnStates:d.value,disableDrag:A.value,disableDragTooltip:A.value?"Reordering is disabled while search is active.":void 0,readOnly:s.readOnly,isDisableNewCheck:T.value&&N.id.includes("metric"),onToggleColumn:M},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[Ks,C.value[N.field]||!a.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(K(!0),ie(xt,null,Fn(S.value.filter(N=>{var G;return N.headerName&&((G=N.headerName)==null?void 0:G.length)>0}),N=>Ke((K(),Ue(Fv,{key:N.field,item:N,disabled:s.disabled,readOnly:s.readOnly,columnStates:d.value},null,8,["item","disabled","readOnly","columnStates"])),[[Ks,C.value[N.field]||!a.value]])),128))],2))],6)],2)],2))}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),Bte=["aria-label"],$te=["aria-disabled","onClick"],Hte=Ct(st({__name:"MonthSelection",props:{monthLabels:{default:()=>["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ariaLabel:{default:"Select month"},selectedYear:{default:null},selectedMonth:{default:null},displayYear:{default:null},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},isMonthSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{emit:t}){const n=e,o=t,s=a=>{n.disabled||n.readOnly||!n.isMonthSelectable(a)||o("select",a)},r=new Date().getFullYear(),i=new Date().getMonth()+1;return(a,l)=>(K(),ie("div",{class:Q([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[me("div",{class:Q(a.$style.months)},[(K(!0),ie(xt,null,Fn(n.monthLabels,(c,u)=>(K(),ie("a",{key:c,tabindex:"0",class:Q([a.$style["month-cell"],{[a.$style.selected]:u+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:u+1===i&&H(r)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(u+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(u+1),onClick:d=>s(u+1),onKeydown:l[0]||(l[0]=d=>o("keydown",d))},ut(c),43,$te))),128))],2)],10,Bte))}}),[["__cssModules",{$style:{"month-grid":"_month-grid_1t30z_1",months:"_months_1t30z_8","month-cell":"_month-cell_1t30z_22",selected:"_selected_1t30z_36",compact:"_compact_1t30z_40",current:"_current_1t30z_53",disabled:"_disabled_1t30z_61"}}]]),Gte=["data-year","aria-disabled","onClick"],Ute=Ct(st({__name:"YearSelection",props:{years:{},selectedYear:{default:null},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},isYearSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=B(null),i=new Date().getFullYear(),a=l=>{o.disabled||!o.isYearSelectable(l)||s("select",l)};return t({rootEl:r}),Qt(()=>{if(r.value){const l=r.value.querySelector(`[data-year="${o.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,c)=>(K(),ie("div",{ref_key:"rootEl",ref:r,class:Q([l.$style["year-grid-body"],o.scrollable?l.$style.scrollable:"",o.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(K(!0),ie(xt,null,Fn(o.years,u=>(K(),ie("a",{key:u,"data-year":u,tabindex:"0",class:Q([l.$style["year-cell"],{[l.$style.selected]:u===o.selectedYear,[l.$style.current]:u===H(i),[l.$style.disabled]:o.disabled||!o.isYearSelectable(u)}]),"aria-disabled":o.disabled||!o.isYearSelectable(u),onClick:d=>a(u),onKeydown:c[0]||(c[0]=d=>s("keydown",d))},ut(u),43,Gte))),128))],2))}}),[["__cssModules",{$style:{"year-grid-body":"_year-grid-body_178a1_1",scrollable:"_scrollable_178a1_11","year-cell":"_year-cell_178a1_16",selected:"_selected_178a1_28",current:"_current_178a1_31",compact:"_compact_178a1_35",disabled:"_disabled_178a1_47"}}]]),Wte={class:"navigation"},zte={class:"picker"},jte={key:0,class:"footer"},Kte=Ct(st({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(K(),ie("div",{class:Q(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[me("div",Wte,[Tt(t.$slots,"navigation",{},void 0,!0)]),me("div",zte,[Tt(t.$slots,"picker",{},void 0,!0)]),ue(xT,{name:"fade",mode:"out-in"},{default:he(()=>[e.disableConfirm?Xe("",!0):(K(),ie("div",jte,[Tt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),qte={style:{flex:"1"}},Yte=Ct(st({__name:"CalendarFooter",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1}},emits:["cancel","confirm","goto-date"],setup(e,{emit:t}){const n=e,o=t,s=()=>{o("cancel")},r=()=>{o("confirm")},i=(l=new Date)=>{o("goto-date")},a=l=>{if(l.key==="Enter"||l.key===" "){l.preventDefault(),l.stopPropagation();const c=l.target;c.dataset.index==="today-btn"?i():c.dataset.index==="cancel-btn"?s():c.dataset.index==="save-btn"&&r()}};return(l,c)=>{const u=eu("tooltip");return n.readOnly?Xe("",!0):(K(),ie("div",{key:0,class:Q(l.$style["arbo-calendar-actions"])},[me("div",qte,[Ke((K(),Ue(H(at),{variant:"secondary",size:"medium",onClick:c[0]||(c[0]=d=>i()),onKeydown:a,"data-index":"today-btn"},{prefix:he(()=>[ue(H(lt),{src:"CalendarDay"})]),_:1})),[[u,"Today"]])]),ue(H(at),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:s,"data-index":"cancel-btn"},{default:he(()=>[Qe(ut(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),ue(H(at),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:r},{default:he(()=>[Qe(ut(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),Zte=Ct(st({__name:"CalendarNavigation",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1},minDate:{},maxDate:{},monthLabels:{},monthLabelStyle:{},locale:{},month:{},year:{},hideMonth:{type:Boolean,default:!1},mode:{}},emits:["cancel","confirm","goto-date","prev","next","toggle-months","toggle-years"],setup(e,{emit:t}){const n=e,o=hs({month:new Date().getMonth()+1,year:new Date().getFullYear()}),s=q(()=>{if(n.minDate){const h=o.month===1?12:o.month-1,f=o.month===1?o.year-1:o.year;return new Date(f,h-1,1)<new Date(n.minDate.getFullYear(),n.minDate.getMonth(),1)}return!1}),r=q(()=>{if(n.maxDate){const h=o.month===12?1:o.month+1,f=o.month===12?o.year+1:o.year;return new Date(f,h-1,1)>new Date(n.maxDate.getFullYear(),n.maxDate.getMonth(),1)}return!1}),i=t,a=()=>{s.value||(n.mode==="month"?o.month=o.month===0?11:o.month-1:n.mode==="year"&&(o.year-=1)),i("prev",{month:o.month,year:o.year})},l=()=>{r.value||(n.mode==="month"?o.month=o.month===11?0:o.month+1:n.mode==="year"&&(o.year+=1)),i("next",{month:o.month,year:o.year})},c=()=>{i("toggle-months")},u=()=>{i("toggle-years")},d=q(()=>{if(n.monthLabels&&n.monthLabels.length===12)return n.monthLabels;const h=n.locale||"en-US",f=n.monthLabelStyle||"short",p=new Intl.DateTimeFormat(h,{month:f,timeZone:"UTC"});return Array.from({length:12},(v,w)=>p.format(new Date(Date.UTC(2020,w,1))))});return(h,f)=>(K(),ie("div",{class:Q(h.$style["cal-nav-bar"])},[e.mode!="year"?(K(),Ue(H(at),{key:0,variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:s.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:jn(kt(a,["prevent","stop"]),["enter"])},{default:he(({hovered:p})=>[ue(H(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Xe("",!0),me("div",{class:Q([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Xe("",!0):(K(),Ue(H(at),{key:0,"data-index":"month-btn",variant:"secondary",onClick:c},{default:he(()=>[Qe(ut(d.value[n.month-1]),1)]),_:1})),ue(H(at),{variant:"secondary",onClick:u,"data-index":"year-btn"},{default:he(()=>[Qe(ut(n.year),1)]),_:1})],2),e.mode!="year"?(K(),Ue(H(at),{key:1,"data-index":"next-btn",variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:r.value,label:"",onClick:l,onKeydownCapture:jn(kt(l,["prevent","stop"]),["enter"])},{default:he(({hovered:p})=>[ue(H(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_1jrqr_1","cal-nav-bar":"_cal-nav-bar_1jrqr_12","cal-nav-btn":"_cal-nav-btn_1jrqr_19",prev:"_prev_1jrqr_32","year-grid-header":"_year-grid-header_1jrqr_36","cal-nav-center":"_cal-nav-center_1jrqr_45",single:"_single_1jrqr_52","cal-nav-label":"_cal-nav-label_1jrqr_56","year-grid":"_year-grid_1jrqr_36",months:"_months_1jrqr_78","month-cell":"_month-cell_1jrqr_85","year-cell":"_year-cell_1jrqr_86","pg-btn":"_pg-btn_1jrqr_108","year-grid-body":"_year-grid-body_1jrqr_121",selected:"_selected_1jrqr_125","days-slot":"_days-slot_1jrqr_131","range-label":"_range-label_1jrqr_135"}}]]),Xte=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const Jte={class:"wrapper-suffix"},CM=Ct(st({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{},workspaceId:{},id:{},maxWidth:{default:"500px"}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o=Yt,s={PER_PAGE:20,INITIAL_PAGE:1},r=(k,P=0)=>k?`${parseInt(k,10)+P}px`:"auto",i=(k,P=0)=>k?parseInt(k,10)+P:0,a=e,l=B(a.modelValue),c=n,u=q(()=>g.value.find(k=>k.id===l.value)||null),d=k=>{l.value=k.id,c("update:modelValue",k.id)},h=q(()=>{if(!l.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const k=g.value.find(D=>D.id===l.value),P=String((k==null?void 0:k.color)||"white");return{backgroundColor:P,border:Qg(P,"white")?"1px solid #ccc":"1px solid #fff"}}),f=B(null),p=()=>{var k;(k=f.value)==null||k.focus()},g=B([]),v=B(!1),w=B(!1),S=B(null),b=B(s.INITIAL_PAGE),C=B(!0),_=B(0),E=B(""),x=q(()=>!!(a.id&&a.workspaceId)),I=k=>{const P=g.value.find(D=>D.id===k.value);P&&d(P)},F=k=>({label:k.name,value:k.id,selected:l.value===k.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:k,id:k.id,color:k.color}),M=async(k=s.INITIAL_PAGE,P="",D=!1)=>{var N;if(!x.value){console.error("Missing required props",a);return}D?w.value=!0:v.value=!0,S.value=null;try{const G={workspaceId:String(a.workspaceId),itemIds:a.id,page:k,perPage:s.PER_PAGE,name_like:P.trim()};if(a.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const J=await a.getStatusFunc(G);if(!J){D||(g.value=[]),C.value=!1;return}const ae=J.data.map(F);g.value=D?[...g.value,...ae]:ae,_.value=((N=J.meta)==null?void 0:N.total)??J.data.length,C.value=g.value.length<_.value,b.value=k}catch(G){console.error("Error fetching statuses:",G),S.value="Failed to load statuses",D||(g.value=[]),C.value=!1,c("error",S.value)}finally{v.value=!1,w.value=!1}},T=async()=>{!C.value||w.value||await M(b.value+1,E.value,!0)};tt([()=>a.id,()=>a.workspaceId],()=>{M()},{deep:!0,immediate:!0});const A=async k=>{E.value=k,b.value=s.INITIAL_PAGE,await M(s.INITIAL_PAGE,k,!1)};return t({focus:p,clear:()=>{l.value=null,c("update:modelValue",null)}}),(k,P)=>(K(),Ue(Nte,{onOpen:p,placement:"bottom-start","max-width":i(a.maxWidth)},{trigger:he(({open:D})=>[ue(bo,{actived:D,class:Q(k.$style["status-wrapper"])},{suffix:he(()=>[me("div",Jte,[ue(lt,{src:"ChevronUp",source:"remote",class:Q([[k.$style["dropdown-icon"]],{[k.$style["dropdown-icon-show"]]:!D}])},null,8,["class"])])]),default:he(()=>{var N;return[me("div",{class:Q(k.$style.status)},[me("div",{class:Q(k.$style["color-indicator"]),style:rn(h.value)},null,6),Ke((K(),ie("span",{style:rn({maxWidth:r(a.maxWidth,-10)}),class:Q({[k.$style["status-text"]]:!0,[k.$style.empty]:!u.value})},[Qe(ut(u.value?u.value.label:"Select status"),1)],6)),[[H(o),{content:((N=u.value)==null?void 0:N.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:he(({closeDropdown:D})=>{var N;return[ue(na,{ref_key:"popupRef",ref:f,"selected-id":(N=u.value)==null?void 0:N.id,options:g.value,loading:v.value,itemWidth:r(a.maxWidth,-10),"loading-more":w.value,"has-more":C.value,error:S.value,onSearch:A,onSelect:G=>{I(G),D()},onLoadMore:T,onCancel:P[0]||(P[0]=G=>c("cancel")),style:rn({width:r(a.maxWidth,-10)})},null,8,["selected-id","options","loading","itemWidth","loading-more","has-more","error","onSelect","style"])]}),_:1},8,["max-width"]))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_fgfdj_1",status:"_status_fgfdj_1","color-indicator":"_color-indicator_fgfdj_13","status-text":"_status-text_fgfdj_22",empty:"_empty_fgfdj_29","dropdown-icon":"_dropdown-icon_fgfdj_33","dropdown-icon-show":"_dropdown-icon-show_fgfdj_38",options:"_options_fgfdj_42"}}]]),bM=e=>({updateCellData:({rowId:n,field:o,value:s})=>{if(!e)return;const r=e.getRowNode(n);r&&r.setDataValue(o,s),e.refreshCells({rowNodes:r?[r]:[],columns:[o],force:!0})}}),Qte={key:2},ene=Ct(st({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var S;const n=e,o=B(n.value),s=B(!0),r=B(""),i=()=>{var M,T,A;const b=(M=u.value)==null?void 0:M.restricted_type.trim(),C=((A=(T=u.value)==null?void 0:T.restricted_value)==null?void 0:A.split(",").map(Number))||[],[_,E]=C,I={range:`Enter a value between ${_} and ${E}`,not:`These values are not allowed: ${C.join(", ")}`,exact:"Value is not allowed"}[b];return s.value?"":I},a=b=>{if(u.value){if(b===null||b===""){s.value=!0;return}if(c.value!=="number"){s.value=!0;return}s.value=Tm(u.value,Number(b)),r.value=i()}};q(()=>s.value?{content:"",showOnCreate:!1}:{content:r.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=B(null),c=q(()=>uP(u.value)),u=q(()=>{var C,_;return((_=(C=n.params)==null?void 0:C.colDef)==null?void 0:_.context)||null}),{apiServices:d}=Zn(!0,n),{updateCellData:h}=bM((S=n.params)==null?void 0:S.api),f=B(!1),p=Yr(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},w=async b=>{var _,E;if(g(),f.value=!0,o.value=b||null,b===n.value){f.value=!1;return}const C={itemIds:[String(p.value)],metricId:((_=u.value)==null?void 0:_.id)||"",workspaceId:String(n.workspaceId)};b==null?C.clear=1:C.value=b,h({rowId:String(p.value),field:`metric_${C.metricId}`,value:void 0});try{const x=await((E=d.value)==null?void 0:E.bulkUpdateMetric(C));(x==null?void 0:x.message)=="Done"?h({rowId:String(p.value),field:`metric_${C.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value}),console.error("Failed to update metric value:",x),o.value=n.value)}catch(x){console.error("Error during bulk metric update:",x),h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value})}finally{f.value=!1}};return(b,C)=>(K(),ie("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[c.value=="dropdown"&&u.value?(K(),Ue(RA,{key:0,config:u.value,modelValue:o.value,"onUpdate:modelValue":C[0]||(C[0]=_=>o.value=_),onChange:w,onHandleCancel:v},null,8,["config","modelValue"])):c.value=="number"&&u.value?(K(),Ue(DA,{key:1,showInlineError:!1,autoEmit:!0,config:u.value,modelValue:o.value,"onUpdate:modelValue":C[1]||(C[1]=_=>o.value=_),style:{width:"100%"},onHandleChange:w,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(K(),ie("div",Qte,"Metric type:"+ut(c.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),tne=Ct(st({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."};q(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const o=q(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),s=B(!1);return Qt(()=>{s.value=!0}),(r,i)=>(K(),ie("div",{class:Q(r.$style["no-data-item-table"])},[me("div",{class:Q(r.$style.visual)},[s.value?(K(),Ue(Ka,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Xe("",!0)],2),me("div",{class:Q(r.$style.description)},ut(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),SM=rc("sortStore",()=>{const e=B({}),t=B(void 0),n={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},o={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=q(()=>{const c=e.value;return Object.values(c).filter(d=>d.sort!=="none"&&!!d.sort).map(d=>{let h;switch(d.colId){case"dateRange":h=o[d.sort];break;default:if(d.colId.includes("metric")){const[f,p]=d.colId.split("_");h={column:f,direction:d.sort,type:p}}else h={column:n[d.colId]||d.colId,direction:d.sort};break}return h})}),r=(c,u)=>{e.value={[c]:{colId:c,sort:u}}},i=()=>{e.value={}},a=B(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:r,clearSorting:i,isSortingRunning:a,defaultSortStorePreferences:t,setDefaultSort:c=>{console.log("Setting default sort:",c),t.value=c}}}),nne=(e,t)=>{var r;const n=sessionStorage.getItem("ws.terminology"),o=n?JSON.parse(n):null;return` ${((r=o==null?void 0:o.find(i=>i.code==="scene"))==null?void 0:r.name)||"Scene"} `.trim()},one={class:"paragraph"},sne=["href"],rne=["checked"],Pv="hideDefaultSortingNotification",ine=Ct(st({name:"DefaultSortingNotification",__name:"DefaultSortingNotification",setup(e,{expose:t}){const n=f=>{f.preventDefault(),f.metaKey||f.ctrlKey?window.open(h.value,"_blank"):window.location.href=h.value,u()},o=()=>{s.value=!s.value},s=B(localStorage.getItem(Pv)==="true"),r=()=>{s.value=localStorage.getItem(Pv)==="true",localStorage.getItem(Pv)!=="true"&&l()},i=()=>{localStorage.setItem(Pv,String(s.value)),u()},{triggerRef:a,show:l,popupRef:c,hide:u}=yo({toggleOnClick:!1,trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,zIndex:8,offset:[0,0],showOnInit:!1,interactive:!0});t({show:r,hide:u});const d=q(()=>nne()),h=q(()=>{const f=sessionStorage.getItem("BASE_URL")||"",p=sessionStorage.getItem("ws.code")||"";return`${f}/${p}/ac/prf`});return(f,p)=>(K(),ie(xt,null,[me("div",{class:"main-trigger",ref_key:"triggerRef",ref:a},[Tt(f.$slots,"default")],512),me("div",{class:"popup",ref_key:"popupRef",ref:c},[me("div",{class:Q(f.$style["default-sorting-notification"])},[me("div",one,[Qe(" This sort only applies to the current list. To change the default sorting for "+ut(d.value)+" lists, go to ",1),me("a",{href:h.value,onClick:n},"My Settings > Preferences",8,sne),p[0]||(p[0]=Qe(" . ",-1))]),me("div",{class:Q(f.$style.footer)},[me("label",{class:Q(f.$style["checkbox-section"])},[me("input",{type:"checkbox",checked:s.value,onChange:kt(o,["stop"]),style:{"--input-size":"16px"}},null,40,rne),p[1]||(p[1]=Qe(" Don't show this tip again ",-1))],2),ue(at,{size:"small",variant:["primary","text"],style:{padding:"0 8px"},onClick:i},{default:he(()=>[...p[2]||(p[2]=[Qe(" Got it ",-1)])]),_:1})],2)],2)],512)],64))}}),[["__cssModules",{$style:{"default-sorting-notification":"_default-sorting-notification_yl9vr_1",footer:"_footer_yl9vr_19","checkbox-section":"_checkbox-section_yl9vr_25"}}]]),gc=st({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=SM(),{sorts:o,defaultSortStorePreferences:s}=ns(n),r=q(()=>{var f,p;return((p=(f=t.params)==null?void 0:f.column)==null?void 0:p.getColId())||"template_col_id"}),i=B(null),a={name:"name",template_flow_status:"status"};tt(()=>s.value,f=>{var p;f!=null&&f.field&&a[f==null?void 0:f.field]==r.value&&((p=i.value)==null||p.setDefaultSort(f))});const l=f=>{var p;console.log("Sort changed for colId:",r.value,"with sortValue:",f),r.value&&n.setSort(r.value,f),(p=u.value)==null||p.show()},c=q(()=>t.params.headerType||void 0),u=B(null),d=B("none");tt(()=>o.value,xr(()=>{var f;if(console.log("Debounced sort update triggered for colId:",r.value,"with sorts:",o.value),r.value){const p=o.value[r.value];console.log("Updating sort for colId:",r.value,"with sortEntry:",p),d.value=p?p.sort:"none",d.value=="none"&&((f=i.value)==null||f.clear())}},li),{deep:!0,immediate:!0});const h=()=>{var f;(f=u.value)==null||f.hide()};return(f,p)=>(K(),Ue(ine,{ref_key:"sortingNotificationRef",ref:u},{default:he(()=>[r.value?(K(),Ue(gee,Wt({key:0,ref_key:"headerSortingRef",ref:i},t,{"header-type":c.value,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=g=>d.value=g),onSortChanged:l,onOpen:h}),null,16,["header-type","modelValue"])):Xe("",!0)]),_:1},512))}});function ane(){const e=hs({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const s=e.name.trim();e.status,s.length===0?e.error="Name cannot be empty":s.length>255?e.error="Name cannot exceed 255 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},o=()=>{e.isCreating=!1};return tt(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:o,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const kv=rc("userStore",()=>{const e=B(null),t=B(null);return{user:e,setUser:s=>{e.value=s},setUserRoleId:s=>{t.value=s},workspaceUserRoleId:t}}),lne=["innerHTML"],cne=20,une=Ct(st({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,{triggerRef:s,popupRef:r,isVisible:i,show:a,hide:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),c=()=>{a()},u=B(null),d=()=>{M.value=[],pe.value=!1},h=q(()=>i.value),f=q(()=>{var W;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((W=M.value)==null?void 0:W.length)===0,wrapperRef:s,active:h,bordered:!0}}),{argsMain:p}=Co(f),g=Yt,v=n,w=q(()=>{var W;return Math.max(0,(((W=M.value)==null?void 0:W.length)||0)-o.maxVisible)}),S=q(()=>{var W;return w.value<=0?"":((W=M.value)==null?void 0:W.slice(o.maxVisible).map(ge=>ge.name).join(", "))||""}),b=B(!1),C=B(!1),_=B(null),E=B(1),x=B(!0),I=B(0),F=B(""),M=B([]),T=q(()=>{var W;return((W=M.value)==null?void 0:W.map(ge=>ge.id))||[]}),{assigneeList:A,mergedOptions:k}=Am({...o,value:[]}),{apiServices:P}=Zn(!1,o),D=yn("entityId"),N=async(W=1,ge="",oe=!1)=>{var U,Y,de,ke,xe;if(!P.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(oe?C.value=!0:b.value=!0,_.value=null,!((U=P.value)!=null&&U.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const _e=un.getInstance().getItem("ws.code");try{const Ve=await((Y=P.value)==null?void 0:Y.getAssignableAssignees(String(_e),{entity_ids:(D==null?void 0:D.value)||"",page:W,per_page:cne,display_name_like:ge})),ye=((de=Pu(Ve.data))==null?void 0:de.map(km))??[];A.value=oe?vu(A.value,ye,"id"):ye,I.value=Ve.meta.total,x.value=(((ke=Ve==null?void 0:Ve.meta)==null?void 0:ke.current_page)||0)<(((xe=Ve==null?void 0:Ve.meta)==null?void 0:xe.last_page)||0),E.value=W}catch(Ve){console.error("Error fetching assignable users:",Ve),_.value="Failed to load assignable users"}finally{b.value=!1,C.value=!1}},G=W=>{var ge,oe,_e;if((ge=M.value)!=null&&ge.some(U=>U.id===W.data.id)){M.value=(oe=M.value)==null?void 0:oe.filter(U=>U.id!==W.data.id);return}M.value=[...M.value||[],W.data],(_e=u.value)==null||_e.focus()},J=()=>{M.value=[]},ae=()=>{!C.value&&x.value&&N(E.value+1,F.value,!0)},ne=xr(async W=>{F.value=W,await N(1,W,!1)},li);tt(()=>i.value,W=>{var ge;W?(N(1,F.value,!1),(ge=u.value)==null||ge.focus(),v("show")):v("hide")});const ee=q(()=>{var W;return((W=M.value)==null?void 0:W.slice(0,3))||[]}),$=q(()=>ee.value.map(W=>({id:W.id,name:W.name,initial:W.initial,avatarId:W.id,profile_image:W.profile_image,color:W.color,size:24,user:W}))),j=kv(),{user:te}=ns(j),pe=B(!1);t({getData:()=>M.value,clear:d,setData:W=>{M.value=W},focus:()=>{a(),vt(()=>{var W;(W=u.value)==null||W.focus()})},hide:()=>{l()}}),tt([M,pe],()=>{v("updated",M.value)},{deep:!0});const ve=W=>{var ge;M.value=(ge=M.value)==null?void 0:ge.filter(oe=>oe.id!==W)},we=W=>{var oe;const ge=un.getInstance().getItem("ws.code");return((oe=P.value)==null?void 0:oe.getUserInformation(ge,W))||Promise.resolve(null)},re=B();return(W,ge)=>(K(),ie("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:re},[ue(bo,Wt(H(p),{style:{"--icon-size":"18px"}}),{prefix:he(()=>[$.value.length==0?(K(),ie("div",{key:0,class:Q([W.$style["icon-wrapper"],"wrapper-prefix"]),onClick:kt(c,["stop","prevent"])},[ue(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Xe("",!0)]),default:he(()=>[me("div",{class:Q([W.$style["assignee-row"],W.$style["assignee-selector"]]),ref_key:"triggerRef",ref:s},[me("div",{style:{flex:1},class:Q([W.$style["assignee-row"]])},[(K(!0),ie(xt,null,Fn($.value,oe=>(K(),Ue(If,{onClear:_e=>ve(oe.id),key:oe.user.id,"disable-remove":!1},{default:he(()=>[ue(Gu,{user:oe.user,apiUpdateFunction:we,appendTo:re.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),w.value>0?Ke((K(),ie("div",{key:0,class:Q(W.$style["extra-avatars"])},[Qe(" +"+ut(w.value),1)],2)),[[H(g),S.value]]):Xe("",!0)],2)],2)]),_:1},16),me("div",{ref_key:"popupRef",ref:r},[ue(na,Wt({"selected-id":T.value},{...o},{options:H(k),loading:b.value,"loading-more":C.value,"has-more":x.value,ref_key:"searchListRef",ref:u,onTab:ge[0]||(ge[0]=oe=>v("tab",oe)),onSelect:ge[1]||(ge[1]=oe=>{G(oe),v("start-update")}),onSearch:H(ne),onClose:ge[2]||(ge[2]=()=>v("close")),onLoadMore:ae}),{"extra-item":he(()=>[ue(ES,{onClick:J,label:"Unassign",borderLeft:!0},{icon:he(()=>[ue(lt,{src:"UserXMark",source:"remote"})]),_:1})]),item:he(({item:oe,selectedIndex:_e,isSelected:U,handleSelect:Y,handleItemHover:de,getHighlightedLabel:ke,query:xe,idx:Ve})=>[ue(ic,Wt(oe,{hover:Ve===_e,selected:U(oe),type:oe.type,onClick:kt(ye=>Y(oe,ye),["stop","prevent"]),onMouseover:ye=>de(Ve),class:W.$style["item-assignee"]}),{prefix:he(()=>[ue(Gu,{user:oe.data,apiUpdateFunction:we,appendTo:H(r)},null,8,["user","appendTo"])]),label:he(({})=>[xe?Ke((K(),ie("span",{key:0,class:Q([W.$style["item-label"],W.$style.match]),style:{flex:"1"},innerHTML:ke(oe.label)},null,10,lne)),[[H(g),{content:oe.label}]]):Ke((K(),ie("span",{key:1,class:Q(W.$style["item-label"]),style:{flex:"1"}},[Qe(ut(oe.label),1)],2)),[[H(g),{content:oe.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_1xvno_1","item-assignee":"_item-assignee_1xvno_6","item-action":"_item-action_1xvno_6","item-label":"_item-label_1xvno_16","icon-wrapper":"_icon-wrapper_1xvno_25","error-message":"_error-message_1xvno_34","empty-state":"_empty-state_1xvno_44","assignee-row":"_assignee-row_1xvno_57","assignee-selector":"_assignee-selector_1xvno_65",seperator:"_seperator_1xvno_69","extra-avatars":"_extra-avatars_1xvno_77",list:"_list_1xvno_89"}}]]),dne={key:0},hne={key:1},fne={key:0},pne={key:1},gne={key:0,class:"wrapper-suffix"},mne={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},vne=Ct(st({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const o=Yt,{triggerRef:s,popupRef:r,isVisible:i,hide:a,show:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=()=>{u.value=[null,null]},u=B([null,null]),d=C=>{const _=Dm();return C?bt.fromJSDate(C,{zone:_}).toFormat("MMM dd"):""},h=q(()=>i.value),f=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:u.value[0]===null&&u.value[1]===null,wrapperRef:s,active:h,bordered:!0})),{argsMain:p}=Co(f),g=B(!1),v=C=>{S("tab",C)},w=C=>{"start"in C&&C.start!==void 0&&(u.value[0]=C.start),"end"in C&&C.end!==void 0&&(u.value[1]=C.end)};t({getData:()=>u.value,clear:c,setData:C=>{u.value=C},focus:()=>{l(),vt(()=>{var C;(C=b.value)==null||C.focus()})},hide:()=>{a()}});const S=n;tt(()=>u.value,C=>{S("updated",C)},{deep:!0});const b=B(null);return tt(()=>i.value,C=>{C?(vt(()=>{var _;(_=b.value)==null||_.focus()}),S("show")):S("hide")}),(C,_)=>(K(),ie(xt,null,[ue(bo,Wt({ref_key:"triggerRef",ref:s},H(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:he(({focused:E})=>[me("div",{class:Q(C.$style["date-time"])},[me("div",{class:Q(C.$style.date)},[u.value[0]==null&&(E||H(i))?(K(),ie("span",dne,"MMMDD")):(K(),ie("span",hne,ut(d(u.value[0])),1))],2),u.value[0]!==null||u.value[1]!==null||E||H(i)?(K(),ie("div",{key:0,class:Q(C.$style.separator)}," → ",2)):Xe("",!0),me("div",{class:Q(C.$style.date)},[u.value[1]==null&&(E||H(i))?(K(),ie("span",fne,"MMMDD")):(K(),ie("span",pne,ut(d(u.value[1])),1))],2)],2)]),suffix:he(({hovered:E,focused:x})=>[(u.value[0]!==null||u.value[1]!==null)&&(E||x||H(i))?(K(),ie("div",gne,[Ke((K(),Ue(at,{onClick:kt(c,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:he(()=>[ue(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[H(o),"Clear"]])])):Xe("",!0)]),prefix:he(()=>[u.value[0]===null&&u.value[1]===null?(K(),ie("div",mne,[ue(lt,{src:"Calendar",color:"#A6A6A6"})])):Xe("",!0)]),_:1},16),me("div",{ref_key:"popupRef",ref:r},[H(i)?(K(),Ue(qm,{key:0,immediatelyUpdate:!1,value:u.value,onConfirmed:w,ref_key:"calendarRef",ref:b,onClosed:H(a),onStartUpdate:_[0]||(_[0]=E=>g.value=!0),onFinishUpdate:_[1]||(_[1]=E=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Xe("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),yne=Ct(st({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,s={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:r,popupRef:i,isVisible:a,show:l,hide:c}=yo({toggleOnClick:!0,appendTo:"parent"}),u=B(null),d=B([]),h=B(!1),f=B(!1),p=B(null),g=B(s.INITIAL_PAGE),v=B(!0),w=B(0),S=B(""),b=n,C=q(()=>a.value),_=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!u.value,wrapperRef:r,active:C,bordered:!0})),E=B(null),{argsMain:x}=Co(_),I=q(()=>u.value?d.value.filter(ee=>ee.id===u.value):[]),F=q(()=>!u.value||I.value.length===0?"":I.value[0].label),M=q(()=>u.value?[u.value]:[]),T=q(()=>{if(!u.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const ee=I.value[0],$=String((ee==null?void 0:ee.color)||"white");return{backgroundColor:$,border:Qg($,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),A=ee=>({label:ee.name,value:ee.id,selected:u.value===ee.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:ee,id:ee.id,color:ee.color}),{apiServices:k}=Zn(!1,o),P=async(ee=s.INITIAL_PAGE,$="",j=!1)=>{var te,pe;j?f.value=!0:h.value=!0,p.value=null;try{const ve=un.getInstance().getItem("ws.code"),we=await((te=k.value)==null?void 0:te.getAssignableStatuses(ve,{entity_id:o.entityId||"",name_like:$,page:ee,per_page:s.PER_PAGE}));if(!we){j||(d.value=[]),v.value=!1;return}const re=we.data.map(A);d.value=j?[...d.value,...re]:re,w.value=((pe=we.meta)==null?void 0:pe.total)??we.data.length,v.value=d.value.length<w.value,g.value=ee}catch(ve){console.error("Error fetching statuses:",ve),p.value="Failed to load statuses",j||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},D=(ee,$)=>{var te;$.stopImmediatePropagation(),$.preventDefault(),$.stopPropagation();const j=ee.id;u.value=j,(te=E.value)==null||te.focus(),b("update:modelValue",u.value),c()},N=async()=>{!v.value||f.value||await P(g.value+1,S.value,!0)},G=async ee=>{S.value=ee,g.value=s.INITIAL_PAGE,await P(s.INITIAL_PAGE,ee,!1)},J=()=>{u.value=null,b("update:modelValue",null)},ae=()=>{l(),vt(()=>{var ee;(ee=E.value)==null||ee.focus()})};return tt(()=>a.value,ee=>{var $;ee?(P(1,S.value,!1),($=E.value)==null||$.focus(),b("show")):b("hide")}),tt(()=>u.value,ee=>{b("updated",ee)}),t({focus:ae,clear:J,getData:()=>u.value,setData:ee=>{u.value=ee},hide:c,autoFillDefault:async()=>{S.value="",await P(1,S.value,!1),d.value.length>0&&(u.value=d.value[0].id,b("update:modelValue",u.value))}}),(ee,$)=>{const j=eu("tooltip");return K(),ie(xt,null,[ue(bo,Wt({ref_key:"triggerRef",ref:r},H(x),{style:{"--icon-size":"18px"}}),{default:he(()=>[me("div",{class:Q(ee.$style.status)},[me("div",{class:Q(ee.$style["color-indicator"]),style:rn(T.value)},null,6),Ke((K(),ie("span",{class:Q({[ee.$style.empty]:I.value.length===0,[ee.$style["status-text"]]:!0})},[Qe(ut(F.value),1)],2)),[[j,{content:F.value}]])],2)]),_:1},16),me("div",{ref_key:"popupRef",ref:i},[ue(na,{style:{width:"200px"},ref_key:"searchListRef",ref:E,"selected-id":M.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:G,onSelect:D,onLoadMore:N,onCancel:$[0]||($[0]=te=>b("cancel")),onTab:$[1]||($[1]=te=>b("tab",te)),onClose:$[2]||($[2]=()=>b("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1gv28_2",status:"_status_1gv28_6","color-indicator":"_color-indicator_1gv28_12","count-badge":"_count-badge_1gv28_25","status-text":"_status-text_1gv28_32",empty:"_empty_1gv28_41"}}],["__scopeId","data-v-6fccb209"]]),wne=Ct(st({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const o=["name","assignees","status","date","cancel","create-keep","create"],s=Yt,r=PG("target"),i=yn("workspaceId"),a=yn("entityId"),l=n,c=e,{newItemData:u,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=ane(),{apiServices:p}=Zn(!1,c),{openSceneHub:g}=mf(),v=B(!1),w=B(!1),S=B(null),b=B({assignees:!1,status:!1,date:!1}),C={name:B(null),assignees:B(null),status:B(null),date:B(null),cancel:B(null),"create-keep":B(null),create:B(null)},_=C.name,E=C.assignees,x=C.status,I=C.date,F=C.cancel,M=C["create-keep"],T=C.create,A=B(new Map),k=q(()=>!!u.error||!u.name.trim()||w.value),P=(ye,L)=>{ye&&A.value.set(L,ye.$el||ye)},D=(ye,L)=>{if(ye==="date"){const[z,le]=Array.isArray(L)?L:[void 0,void 0];u.start_date=z,u.due_date=le}else u[ye]=L},N=()=>{u.isCreating=!0,S.value="name"},G=()=>{u.isCreating=!1,h()},J=yn("switchInstance"),{addNotification:ae}=oa(),ne=ye=>{l("focus-on-id",ye)},ee=(ye,L,z)=>{const le=dP(void 0,"created");ae({id:String(ye),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${le}</b>
162
162
  <span>${L} </span></div>`,actions:[{label:"Find in table",variant:"secondary",btnIcon:"MagnifyingGlass",action:()=>{l("search-for-code",{code:z,name:L}),ne(String(ye))}},{label:"Full view",btnIcon:"CustomSceneHub",variant:"primary",action:Ge=>{if(Ge.ctrlKey||Ge.metaKey){const be=es({type:"scene_hub",config:{ws_code:i,baseDomain:un.getInstance().getItem("BASE_URL")||"",scene_id:String(ye)}}).url;window.open(be,"_blank");return}else J("scene_hub",{id:String(ye)},{showLoading:!1})}}],type:"interactive"})},$=ye=>{ye&&vt(()=>{var z;const L=(z=C[ye])==null?void 0:z.value;L&&(typeof L.focus=="function"?L.focus():L.$el&&typeof L.$el.focus=="function"&&L.$el.focus())})},j=ye=>{var L;(L=r.value)==null||L.focus()},te=ye=>{const L=z=>{var le;return(le=z==null?void 0:z.hide)==null?void 0:le.call(z)};ye!=="assignees"&&L(E.value),ye!=="status"&&L(x.value),ye!=="date"&&L(I.value)},pe=(ye,L)=>{L instanceof KeyboardEvent&&L.key!=="Tab"&&L.preventDefault();const z=S.value?o.indexOf(S.value):-1;if(z===-1){$("name");return}let Ge=(z+(ye==="next"?1:-1)+o.length)%o.length,be=o[Ge];(be==="create"||be==="create-keep")&&k.value&&(Ge=0,be=o[0]),te(be),$(be)},ve=ye=>{b.value[ye]=!0,S.value=ye},we=ye=>{b.value[ye]=!1,j()},re=ye=>{b.value[ye]||(S.value=null)},W=ye=>{ye.target===r.value&&$("name")},ge=ye=>{var L,z,le;if(ye.key==="Enter"){if(!S.value)return;switch(ye.preventDefault(),ye.stopPropagation(),S.value){case"create":k.value||de("clear");break;case"create-keep":k.value||de("keep");break;case"cancel":f();break;case"assignees":(L=E.value)==null||L.focus();break;case"status":(z=x.value)==null||z.focus();break;case"date":(le=I.value)==null||le.focus();break}return}if(ye.key==="Tab"){ye.preventDefault(),ye.stopImmediatePropagation(),ye.stopPropagation(),S.value!=="name"&&oe(ye);return}if(ye.key==="Escape"){S.value=null,G();return}},oe=ye=>{ye.preventDefault(),ye.stopImmediatePropagation(),ye.stopPropagation();const L=ye.shiftKey?"prev":"next";pe(L,ye)},_e=()=>{var ye;return(ye=E.value)==null?void 0:ye.focus()},U=()=>{var ye;return(ye=x.value)==null?void 0:ye.focus()},Y=()=>{var ye;return(ye=I.value)==null?void 0:ye.focus()},de=async(ye="clear")=>{vt(async()=>{var z,le,Ge,be,ze,qe,Ee,Me,wt,At,Ut;if(k.value||v.value||w.value)return;w.value=!0,v.value=!0;const L={name:u.name,template_flow_status_id:u.status??void 0,ws_user_role_ids:(z=u.assignees)==null?void 0:z.map(tn=>tn.id),start_date:u.start_date?Pm(u.start_date):void 0,due_date:u.due_date?Pm(u.due_date):void 0};if(!((le=p.value)!=null&&le.addNewItem)){console.warn("API service unavailable"),v.value=!1;return}try{const tn=await p.value.addNewItem(i,a,L),zt=u.name;if(ee(tn.id,tn.name,tn.code),!tn.id)throw new Error("Invalid response from server: missing scene ID");switch(w.value=!1,v.value=!1,ye){case"close":h(),(Ge=E.value)==null||Ge.setData([]),(be=x.value)==null||be.setData(null),(ze=I.value)==null||ze.setData([null,null]),f(),G();break;case"close-open":h(),(qe=E.value)==null||qe.setData([]),(Ee=x.value)==null||Ee.setData(null),(Me=I.value)==null||Me.setData([null,null]),f(),G(),g(tn.id);break;case"clear":l("create-new-item",zt),h(),(wt=E.value)==null||wt.setData([]),(At=x.value)==null||At.setData(null),(Ut=I.value)==null||Ut.setData([null,null]),$("name");break;case"keep":l("create-new-item",zt),u.name="",u.error="",$("name");break}}catch(tn){console.error("Error creating scene:",tn),ye=="close"&&(f(),G())}finally{v.value=!1,w.value=!1}})},ke=(ye,L)=>{k.value||(L.metaKey||L.ctrlKey?de("close-open"):L.shiftKey?de("keep"):de("clear"))},xe=(ye=!1)=>{u.isCreating&&(!k.value&&!u.error?de(ye?"close":"clear"):G())},Ve=()=>{f(),u.name="",vt(()=>{var ye;(ye=_.value)==null||ye.setValue(u.name)})};return CS(r,ye=>{const L=ye.target.closest(".notification-center"),z=ye.target.closest("#people-insight-container");if(L||z)return!1;xe(!0)}),tt(()=>u.isCreating,ye=>{ye&&$("name")}),t({show:N,hide:G}),(ye,L)=>Ke((K(),ie("div",{class:Q(ye.$style.newRow),ref_key:"target",ref:r,onKeydown:ge,onClick:W,tabindex:"-1"},[me("div",{ref:z=>P(z,"name"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="name"})},[ue(bS,{ref_key:"nameInputRef",ref:_,disabled:v.value||w.value,modelValue:H(u).name,"onUpdate:modelValue":L[0]||(L[0]=z=>H(u).name=z),onChange:H(d),onEnter:ke,onCancel:Ve,onTab:L[1]||(L[1]=(z,le)=>oe(le)),onFocus:L[2]||(L[2]=z=>S.value="name"),placeholder:"Enter name",focused:!0,"max-length":255,type:"text","auto-emit":!0,style:{"--bg-input":"transparent","--border-color":"#f3f5f7"},bordered:!0,class:"border-f3f5f7"},null,8,["disabled","modelValue","onChange"])],2),me("div",{ref:z=>P(z,"assignees"),onEnter:kt(_e,["prevent","stop"]),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="assignees"})},[ue(une,{ref_key:"assigneeRef",ref:E,onUpdated:L[3]||(L[3]=z=>D("assignees",z)),onTab:L[4]||(L[4]=z=>oe(z)),onEnter:_e,onFocus:L[5]||(L[5]=z=>S.value="assignees"),onBlur:L[6]||(L[6]=z=>re("assignees")),onShow:L[7]||(L[7]=z=>ve("assignees")),onHide:L[8]||(L[8]=z=>we("assignees"))},null,512)],34),me("div",{ref:z=>P(z,"status"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="status"})},[ue(yne,{ref_key:"statusRef",ref:x,"entity-id":H(a),onUpdated:L[9]||(L[9]=z=>D("status",z)),onTab:L[10]||(L[10]=z=>oe(z)),onEnter:U,onFocus:L[11]||(L[11]=z=>S.value="status"),onBlur:L[12]||(L[12]=z=>re("status")),onShow:L[13]||(L[13]=z=>ve("status")),onHide:L[14]||(L[14]=z=>we("status"))},null,8,["entity-id"])],2),me("div",{ref:z=>P(z,"date"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="date"})},[ue(vne,{ref_key:"dateRef",ref:I,onUpdated:L[15]||(L[15]=z=>D("date",z)),onTab:L[16]||(L[16]=z=>oe(z)),onEnter:Y,onFocus:L[17]||(L[17]=z=>S.value="date"),onBlur:L[18]||(L[18]=z=>re("date")),onShow:L[19]||(L[19]=z=>ve("date")),onHide:L[20]||(L[20]=z=>we("date"))},null,512)],2),me("div",{class:Q(ye.$style["field-actions"])},[me("div",{ref:z=>P(z,"cancel"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="cancel",[ye.$style["field-button"]]:!0})},[ue(at,{ref_key:"cancelRef",ref:F,variant:["secondary"],onClick:H(f),onKeydown:[jn(H(f),["enter"]),L[22]||(L[22]=jn(z=>oe(z),["tab"]))],onFocus:L[21]||(L[21]=z=>S.value="cancel"),tabindex:"0"},{default:he(()=>[...L[31]||(L[31]=[Qe(" Cancel ",-1)])]),_:1},8,["onClick","onKeydown"])],2),Ke((K(),ie("div",{ref:z=>P(z,"create-keep"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style["field-button"]]:!0,[ye.$style.active]:S.value==="create-keep"})},[ue(at,{ref_key:"createKeepRef",ref:M,onClick:L[23]||(L[23]=()=>de("keep")),onKeydown:[L[24]||(L[24]=jn(z=>!k.value&&de("keep"),["enter"])),L[26]||(L[26]=jn(z=>oe(z),["tab"]))],onFocus:L[25]||(L[25]=z=>S.value="create-keep"),disabled:k.value,variant:["primary"],loading:v.value,tabindex:"0",style:rn([{padding:"4px 8px",width:"100%"},{"letter-spacing":"-0.5px"}])},{default:he(()=>[...L[32]||(L[32]=[Qe(" Create & Keep ",-1)])]),_:1},8,["disabled","loading"])],2)),[[H(s),k.value?"Enter a name and select a status to continue.":"Create and keep field values (⇧↵ Shift+Enter)"]]),Ke((K(),ie("div",{ref:z=>P(z,"create"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="create",[ye.$style["field-button"]]:!0})},[ue(at,{ref_key:"createRef",ref:T,onClick:L[27]||(L[27]=()=>de("clear")),onKeydown:[L[28]||(L[28]=jn(z=>!k.value&&de("clear"),["enter"])),L[30]||(L[30]=jn(z=>oe(z),["tab"]))],onFocus:L[29]||(L[29]=z=>S.value="create"),disabled:k.value,variant:["primary"],loading:v.value,tabindex:"0"},{default:he(()=>[...L[33]||(L[33]=[Qe(" Create ",-1)])]),_:1},8,["disabled","loading"])],2)),[[H(s),k.value?"Enter a name and select a status to continue.":"Create and clear the fields (↵ Enter)"]])],2)],34)),[[Ks,H(u).isCreating]])}}),[["__cssModules",{$style:{newRow:"_newRow_nxn1y_1","field-actions":"_field-actions_nxn1y_14","field-wrapper":"_field-wrapper_nxn1y_43",active:"_active_nxn1y_49","field-button":"_field-button_nxn1y_52","warning-text":"_warning-text_nxn1y_55","has-error":"_has-error_nxn1y_60"}}]]),Cne=["innerHTML"],bne=["accept"],EM=Ct(st({__name:"FileUploader",props:{modelValue:{},acceptTypes:{default:()=>["xlsx","xls","csv"]}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const o=B(null),s=F=>`<svg xmlns="http://www.w3.org/2000/svg" width="49" height="49" viewBox="0 0 49 49" fill="none">
163
163
  <g clip-path="url(#clip0)">
164
164
  <path d="M9.86719 3.56641C9.86719 2.05448 11.1053 0.816406 12.6172 0.816406H33.5136L45.3672 12.67V45.5664C45.3672 47.0783 44.1291 48.3164 42.6172 48.3164H12.6172C11.1053 48.3164 9.86719 47.0783 9.86719 45.5664V3.56641Z" stroke="#232323" stroke-width="0.5"/>
@@ -260,4 +260,4 @@ If you are trying to annotate ${o} with application data, use the '${o}.context'
260
260
  `,dbe=class extends $ve{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,I$),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=I$),this.isFirstLine=!1}},hbe=class extends Bve{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Pt(this.gos,{})):t.fileName;Hve(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new dbe({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function fbe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function pbe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var gbe={moduleName:"CsvExport",version:dt,beans:[hbe],apiFunctions:{getDataAsCsv:fbe,exportDataAsCsv:pbe},dependsOn:[ube]},mbe=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new pl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Bn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Pt(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new pl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},vbe=2,ybe=class extends We{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new mbe(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(ll(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=vbe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ft(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},wbe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new pl(e);this.rootNode=t,t.level=-1,this.rowHeight=Rc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Rc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Yf(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;_d(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:Rc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new ybe(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function Cbe(e){var t;(t=Uy(e))==null||t.refreshCache()}function bbe(e){var t;(t=Uy(e))==null||t.purgeCache()}function Sbe(e){var t;return(t=Uy(e))==null?void 0:t.getRowCount()}var Ebe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=hae(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Lo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Gr(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){ll(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){ll(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},_be={moduleName:"InfiniteRowModelCore",version:dt,rowModels:["infinite"],beans:[wbe,Ebe]},Rbe={moduleName:"InfiniteRowModel",version:dt,apiFunctions:{refreshInfiniteCache:Cbe,purgeInfiniteCache:bbe,getInfiniteRowCount:Sbe},dependsOn:[_be,VCe]},Dbe="↑",Tbe="↓",Ibe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},xbe=class extends bn{constructor(){super(Ibe),this.eValue=ht,this.eDelta=ht,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=Dbe+s:i.textContent=Tbe+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),No(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:No(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Fbe=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",Pbe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},kbe=class extends bn{constructor(){super(Pbe),this.eCurrent=ht,this.refreshCount=0,this.registerCSS(Fbe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=ao({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Bn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:No(o),!0}},Abe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=khe(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Obe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var Mbe={moduleName:"HighlightChanges",version:dt,beans:[Abe],userComponents:{agAnimateShowChangeCellRenderer:xbe,agAnimateSlideCellRenderer:kbe},apiFunctions:{flashCells:Obe}};function Nbe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Lbe(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function x$(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Vbe(e)),e.version=dt,e}function Vbe(e){return e.cellSelection=Bbe(e,"rangeSelection"),e}function Bbe(e,t){if(e&&typeof e=="object")return e[t]}var $be=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Lo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Lo(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Lo(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=ro(e);const o=x$(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=x$(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Nve(hy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(T,A)=>{const k=!(o!=null&&o.has(T))&&!!(A||t==="api");return h||(h=k),k},p={},g=T=>{let A=p[T];return A||(A={colId:T},p[T]=A,A)},v={},w=f("sort",s);w&&(s==null||s.sortModel.forEach(({colId:T,sort:A},k)=>{const P=g(T);P.sort=A,P.sortIndex=k})),(w||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((T,A)=>{const k=g(T);k.rowGroup=!0,k.rowGroupIndex=A})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:T,aggFunc:A})=>{g(T).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((T,A)=>{const k=g(T);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const T of(l==null?void 0:l.leftColIds)??[])g(T).pinned="left";for(const T of(l==null?void 0:l.rightColIds)??[])g(T).pinned="right"}(_||!n)&&(v.pinned=null);const E=f("columnVisibility",c);if(E)for(const T of(c==null?void 0:c.hiddenColIds)??[])g(T).hide=!0;(E||!n)&&(v.hide=null);const x=f("columnSizing",u);if(x)for(const{colId:T,flex:A,width:k}of(u==null?void 0:u.columnSizingModel)??[]){const P=g(T);P.flex=A??null,P.width=k}(x||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,F=!!(I!=null&&I.length)&&!(o!=null&&o.has("columnOrder")),M=F?I.map(T=>g(T)):Object.values(p);(M.length||h)&&(this.columnStates=M,Ur(this.beans,{state:M,applyOrder:F,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Ur(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Lve(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!ha(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Yf(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Yf(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},Hbe={moduleName:"GridState",version:dt,beans:[$be],apiFunctions:{getState:Nbe,setState:Lbe}};function Gbe(e){return e.rowModel.isLastRowIndexKnown()}function Ube(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Wbe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function zbe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function jbe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Kbe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function qbe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Ybe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Zbe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Xbe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Jbe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(Rc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Lo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Pp="paginationPageSizeSelector",Qbe={tag:"span",cls:"ag-paging-page-size"},eSe=class extends bn{constructor(){super(Qbe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(Pp,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){No(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(Pp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(Pp)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Pp}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(dl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new B0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Pp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},tSe={selector:"AG-PAGE-SIZE-SELECTOR",component:eSe},nSe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",oSe=class extends $V{constructor(){super(),this.btFirst=ht,this.btPrevious=ht,this.btNext=ht,this.btLast=ht,this.lbRecordCount=ht,this.lbFirstRowOnPage=ht,this.lbLastRowOnPage=ht,this.lbCurrent=ht,this.lbTotal=ht,this.pageSizeComp=ht,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(nSe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[tSe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Jue(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Oe.ENTER||o.key===Oe.SPACE)&&(o.preventDefault(),n())}})}Xue(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):Vve(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){hie(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const S=h("more","more");v=S,w=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(u,d,w,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},sSe={selector:"AG-PAGINATION",component:oSe},rSe=class extends We{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return sSe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},iSe={moduleName:"Pagination",version:dt,beans:[rSe,Jbe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Gbe,paginationGetPageSize:Ube,paginationGetCurrentPage:Wbe,paginationGetTotalPages:zbe,paginationGetRowCount:jbe,paginationGoToNextPage:Kbe,paginationGoToPreviousPage:qbe,paginationGoToFirstPage:Ybe,paginationGoToLastPage:Zbe,paginationGoToPage:Xbe},dependsOn:[Wy]};function aSe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function F$(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&F$(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function lSe(e,t){return e.rowModel.getRowNode(t)}function cSe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function uSe(e){return e.rowRenderer.getRenderedNodes()}function dSe(e,t,n){e.rowModel.forEachNode(t,n)}function hSe(e){return e.rowRenderer.firstRenderedRow}function fSe(e){return e.rowRenderer.lastRenderedRow}function pSe(e,t){return e.rowModel.getRow(t)}function gSe(e){return e.rowModel.getRowCount()}var mSe={moduleName:"RowApi",version:dt,apiFunctions:{redrawRows:aSe,setRowNodeExpanded:F$,getRowNode:lSe,addRenderedRowListener:cSe,getRenderedNodes:uSe,forEachNode:dSe,getFirstDisplayedRowIndex:hSe,getLastDisplayedRowIndex:fSe,getDisplayedRowAtIndex:pSe,getDisplayedRowCount:gSe}},vSe={moduleName:"ScrollApi",version:dt,apiFunctions:{getVerticalPixelRange:Fwe,getHorizontalPixelRange:Pwe,ensureColumnVisible:d$,ensureIndexVisible:h$,ensureNodeVisible:kwe}};function ySe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function wSe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function CSe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function bSe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function SSe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function ESe(e){return{rowHeight:Rc(e),headerHeight:yp(e)}}function _Se(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(gp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=N_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!L_(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(gp(c))}}return[...o,...n]}var RSe={moduleName:"RenderApi",version:dt,apiFunctions:{setGridAriaProperty:ySe,refreshCells:wSe,refreshHeader:CSe,isAnimationFrameQueueEmpty:bSe,flushAllAnimationFrames:SSe,getSizesForCurrentTheme:ESe,getCellRendererInstances:_Se}};function DSe(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function P$({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function TSe(e,t){var n;t&&typeof t=="object"?P$(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var ISe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&ro(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Td(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=k$(this.beans),i=u=>n.leftCols.some(d=>hp(d,u)),a=u=>n.rightCols.some(d=>hp(d,u)),l=e.colKeys.filter(u=>!pa(u)&&!ga(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let w=-1;const S=Object.fromEntries(c.map(({colId:_,...E})=>[_,E])),b=s??this.gos.get("skipHeaderOnAutoSize"),C=r??b;for(;w!==0;){w=0;const _=[];for(const E of o){if(!E||Rae(E))continue;const x=f.getCol(E);if(!x||v.has(x))continue;const I=p.getPreferredWidthForColumn(x,b);if(I>0){const F=S[x.colId]??{};F.minWidth??(F.minWidth=l),F.maxWidth??(F.maxWidth=a);const M=xSe(x,I,F);x.setActualWidth(M,u),v.add(x),w++}_.push(x)}_.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new Mc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=k$(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...w}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=w;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=fa(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[w.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),C=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),_=w.getActualWidth();return(b==null||_>=b)&&(C==null||_<=C)}))return;const l=[],c=[];for(const v of r){const w=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>hp(v,S)))??!0;v.getColDef().suppressSizeToFit||!w?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Gr(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const w=s==null?void 0:s[v.getId()],S=(w==null?void 0:w.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(w==null?void 0:w.maxWidth)??(o==null?void 0:o.defaultMaxWidth),C=v.getActualWidth();typeof S=="number"&&C<S?v.setActualWidth(S,t,!0):typeof b=="number"&&C>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-fa(c);if(v<=0)for(const w of l){const S=((g=s==null?void 0:s[w.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??w.minWidth;w.setActualWidth(S,t,!0)}else{const w=v/fa(l);let S=v;for(let b=l.length-1;b>=0;b--){const C=l[b],_=s==null?void 0:s[C.getId()],E=(_==null?void 0:_.minWidth)??(o==null?void 0:o.defaultMinWidth),x=(_==null?void 0:_.maxWidth)??(o==null?void 0:o.defaultMaxWidth),I=C.getMinWidth(),F=C.getMaxWidth(),M=typeof E=="number"&&E>I?E:I,T=typeof x=="number"&&x<F?x:F;let A=Math.round(C.getActualWidth()*w);A<M?(A=M,h(C),d=!1):A>T?(A=T,h(C),d=!1):b===0&&(A=S),C.setActualWidth(A,t,!0),S-=A}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Td(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function xSe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function k$({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return ep(n.eGridBody)-s}var FSe={moduleName:"ColumnAutoSize",version:dt,beans:[ISe],apiFunctions:{sizeColumnsToFit:DSe,autoSizeColumns:P$,autoSizeAllColumns:TSe},dependsOn:[oB]},PSe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function kSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function ASe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function OSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function MSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function NSe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var LSe={moduleName:"PinnedRow",version:dt,beans:[Ode],css:[PSe],apiFunctions:{getPinnedTopRowCount:kSe,getPinnedBottomRowCount:ASe,getPinnedTopRow:OSe,getPinnedBottomRow:MSe,forEachPinnedRow:NSe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},VSe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},BSe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(C,_)=>{p=C,g=null,v=_},S=C=>{const _=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!_){w(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(C,r.getValue(t,C));return}const E=r.getValue(t,C);if(f){const x=Pt(n,{valueA:v,nodeA:p,valueB:E,nodeB:C,column:t,colDef:a});if(!h(x)){w(C,E);return}}else if(d?!d(v,E):v!==E){w(C,E);return}if(!g){const x=l==null?void 0:l.get(p);(x==null?void 0:x.firstNode)===p?(x.reset(),g=x):g=new VSe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,C=>{(!i||i.isRowInPage(C.rowIndex))&&S(C)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},$Se=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new BSe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},HSe=class extends Bd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||jv(e,t.rowIndex)}setAriaRowSpan(){vie(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(ky(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},GSe=class extends Gy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new HSe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},USe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new GSe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},WSe={moduleName:"CellSpan",version:dt,beans:[$Se,USe]},zSe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);O_(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Pt(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},jSe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){O_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new zSe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},KSe={moduleName:"CellStyle",version:dt,beans:[jSe]},qSe={moduleName:"RowStyle",version:dt,beans:[Ome]};function YSe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var ZSe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},XSe="ag-column-hover",JSe=class extends We{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(XSe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new ZSe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},QSe={moduleName:"ColumnHover",version:dt,beans:[JSe],apiFunctions:{isColumnHovered:YSe}},eEe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!By.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{By.has(i)&&t(i,a)},o=(i,a)=>{By.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function tEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function nEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function oEe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function sEe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var rEe={moduleName:"EventApi",version:dt,apiFunctions:{addEventListener:tEe,addGlobalListener:oEe,removeEventListener:nEe,removeGlobalListener:sEe},beans:[eEe]},iEe={moduleName:"Locale",version:dt,beans:[Mve]},aEe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Lo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=cl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=Ec(o),g=d+h+f+p,w=t.offsetHeight+g;if(u<5){const b=Io(i),C=!(b!=null&&b.contains(t)),_=w==0;if(C||_){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,w,r)},l=()=>a(0);l();const c=il(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},lEe={moduleName:"RowAutoHeight",version:dt,beans:[aEe]},cEe={moduleName:"AllCommunity",version:dt,dependsOn:[T$,gbe,Rbe,Qve,cCe,uCe,dCe,hCe,fCe,pCe,gCe,lCe,twe,nwe,owe,ewe,rwe,iwe,Hbe,$Ce,iSe,aB,mSe,vSe,RSe,FSe,qhe,LSe,FCe,mve,KSe,QSe,qSe,rEe,wve,Mbe,l$,iEe,lEe,Khe,lbe,WSe]};let A$=!1;A$||(tae.registerModules([cEe,T$]),A$=!0);class uEe{constructor(t,n){no(this,"gridApi",null);no(this,"container");no(this,"config");no(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=Pve(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const dEe=fB.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),hEe=st({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=B(null);CS(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=q(()=>({width:"100%",height:o.height||"500px"})),l=q(()=>({...o,theme:dEe}));function c(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new uEe(r.value,g),i.value.init(),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var w,S;if(!g)return;(w=i.value)==null||w.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return tt(()=>o.columnDefs,(g,v)=>{const w=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");w!==S&&d(g)},{deep:!0}),qn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Qt(()=>{c()}),qn(()=>{h()}),(g,v)=>(K(),ie("div",{ref_key:"gridContainerRef",ref:r,style:rn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function Wd(e){return hL(e)}const fEe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Wd(gc),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>qf.fromType(n))],Zy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},pEe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Zy.WIDTH,minWidth:Zy.WIDTH,maxWidth:Zy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Zy.HEADER_CLASS,headerComponent:zv(vee),suppressMovable:!0}),O$="blank",gEe=[O$,"__checkboxSelection","options"],mEe=["uiColumnResized","uiColumnMoved","api"],vEe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},M$=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,yEe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=$h({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=B([]),a=pEe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=[];f==null||f.forEach(D=>{const{field:N,hide:G,width:J,pinned:ae}=D;p.push([N,G])});const g=new Map(p),v=fEe(),w=qf.fromType(vEe),S=!!f,C=((d==null?void 0:d.map(D=>{var N;return{headerName:D.name,field:`metric_${D.id}`,editable:((N=D==null?void 0:D.auth_permission)==null?void 0:N.permission)==2,sortable:!0,filter:!1,flex:1,context:{...D},hide:S?!g.get(`metric_${D.id}`):!(D.is_primary||D.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:zv(gc),headerComponentParams:()=>({headerType:D.metric_type.code=="number"||D.metric_type.code=="formula"?"number":"default"})}}))||[]).map(D=>qf.fromType(D)),_=[a,...v,...C,w],E=[],x=[],I=[];for(const D of _)D.pinned==="left"?E.push(D):D.pinned==="right"||D.field===O$?x.push(D):I.push(D);if(!f||f.length===0){i.value=_;return}const F=new Map(f.map(D=>[D.field,D])),M=new Map(I.map(D=>[D.field,D])),T=[];for(const D of f)if(D.field&&M.has(D.field)){const N=M.get(D.field);T.push({...M$(N,D),hide:D.hide}),M.delete(D.field)}const A=Array.from(M.values()),k=[...T,...A].map(D=>({...D,lockPinned:!0})),P=D=>M$(D,F.get(D.field));i.value=[...E.map(P),...k,...x.map(P)]};tt(e,d=>c(d),{immediate:!0});const u=xr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!mEe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(w=>{w.width&&g.set(w.colId,Number(w.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(w=>w.field&&!gEe.includes(w.field)).map(w=>({field:w.field,hide:w.hide,width:g.get(w.field)||w.width,pinned:w.pinned}));s(t,JSON.stringify(v))},li);return HR(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},wEe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},CEe=e=>{var A,k,P;const{showMessage:t,showErrorNetMessage:n}=oa(),o=oo(),s={domainApi:wEe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(P=(k=(A=o==null?void 0:o.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:P.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new FO(r,s);i.on("call-api",D=>{D.success?t(D.apiCode,"success"):n(D)});const a=hs({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=$7(),v=D=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:D}),w=50,S=async(D,N,G)=>{if(!D.length)return[];const J=e8(D,N);return(await Promise.all(J.map(G))).flat()},b=async D=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:D})).data.map(G=>[G==null?void 0:G.id,G.permission])}catch(N){return console.error("Failed to fetch item permissions chunk:",N),[]}},C=async(D,N)=>{try{const G=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:D,per_page:D.length*N.length,metric_ids:N}),J=G.data.map(ne=>{const ee=new Map(ne.item_metrics.map(j=>[j.metric_id,{value:j.value,auth_permission:j==null?void 0:j.auth_permission}])),$=Object.fromEntries(N.map(j=>[j,ee.get(j)??null]));return[ne==null?void 0:ne.id,$]}),ae=new Set(G.data.map(ne=>ne==null?void 0:ne.id));for(const ne of D)if(!ae.has(ne)){const ee=Object.fromEntries(N.map($=>[$,{value:null,auth_permission:void 0}]));J.push([ne,ee])}return J}catch(G){return console.error("Failed to fetch a chunk of metric values:",G),D.map(ae=>[ae,Object.fromEntries(N.map(ne=>[ne,void 0]))])}},_=async D=>{try{const N=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:D,per_page:D.length}),G=N.data.flatMap(J=>J.assignees);return g(G),N.data.map(J=>[J==null?void 0:J.id,J==null?void 0:J.assignees])}catch(N){return console.error("Failed to fetch a chunk of assigned users:",N),[]}},E=async D=>{if(!D.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const N=await S(D,w,b);return Object.fromEntries(N)}catch(N){return console.error("Failed to fetch item permissions:",N),{}}},x=async(D,N)=>!D.length||!N.length?{}:(p=p.then(async()=>{try{const ae=[];let ne=0;for(let $=0;$<N.length;$+=5){ne++;const j=N.slice($,$+5),te=[];for(let ve=0;ve<j.length;ve++){const we=j[ve],re=await S(D,w,W=>C(W,[we]));te.push(re),await new Promise(W=>setTimeout(W,500))}ae.push(...te);const pe=$+5>=N.length}const ee={};for(const $ of ae.flat()){const[j,te]=$;ee[j]||(ee[j]={}),Object.assign(ee[j],te)}return ee}catch(G){return console.error("Failed to fetch metric values:",G),{}}}),p),I=async D=>{if(!D.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const N=await S(D,w,_);return Object.fromEntries(N)}catch(N){return console.error("Failed to fetch assigned users:",N),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async D=>{const{cursor:N,offset:G,size:J,searchQuery:ae}=D;let ne=[];c.value=!0,u.value=null;try{const ee=await i.getAllItem_cursor({...D,cursor:N||void 0,offset:G||void 0,pageSize:J||f.value,...v(ae),sortBy:D.sort_by});return l.value=ee.data,d.value=ee.meta,h.value=ee.meta.current_page||0,ne=ee.data.map($=>$==null?void 0:$.id),ee}catch(ee){throw u.value=ee,console.error("Failed to fetch items (cursor):",ee),ee}finally{const ee=async()=>{try{const[$,j]=await Promise.all([I(ne),E(ne)]);e.value.updateItemData({assignees:$,permission:j},ne);const te=await x(ne,e.value.metricIds);e.value.setMetricValues(te,new Set(ne),e.value.metricIds)}catch($){console.error("Post-fetch processing failed:",$)}};c.value=!1,setTimeout(ee)}},getAssignableStatus:async D=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:D})}catch(N){throw console.error("Failed to fetch assignable status:",N),N}},getMetricList:async D=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:D})}catch(N){throw console.error("Failed to fetch metric list:",N),N}},getMetricValues:x,getAssignedUsers:I}};function bEe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=T7((o.assignees[c]||[]).map(rP));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function SEe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function EEe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:w,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=SEe(r,e.perPage,()=>o.value,C=>{i.value=C},C=>{a.value=C});return S==null||S("datasource",b),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,S;if((w=s.value)==null||w.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=xr(v=>{d(v)},li),p=()=>{s.value},g=B(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const _Ee={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},REe=e=>{var t;return(t=Object.entries(_Ee.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},DEe={key:1},TEe=Ct(st({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=B(null),s=e,r=()=>{o.value&&o.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=Zn(!1,{}),u=B(!1),d=async()=>{u.value=!0;const T=s.workspaceId,A=s.entityId;if(!T||!A||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,A))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var P,D,N;const A=new FormData,k=((P=T.name.split(".").pop())==null?void 0:P.toString())||"";if(A.append("file",T),A.append("format",k),A.append("entity_id",s.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,A),g()}catch(G){throw console.error("Error uploading file:",G),v(((N=(D=G.response)==null?void 0:D.data)==null?void 0:N.message)||"An unknown error occurred during file upload."),G}},g=()=>{a.value="success"},v=T=>{i.value=T,a.value="error"},w=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;E(),(T=o.value)==null||T.hide()};t({close:S,open:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=B(null),E=()=>{var T;(T=_.value)==null||T.clear(),i.value="",l.value={file:null,format:null},a.value="idle"},x=yn("switchInstance"),I=()=>{x?x("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1}),console.log("Toolbox opened")},F=(T,A)=>new File([T],A,{type:T.type});let M;return Qt(()=>{const T=sessionStorage.getItem("BASE_URL");M=jE({target:window,allowedOrigins:[T||"https://app.arbocollab.com"],onMessage:(A,k)=>{var D;if(console.log("PopupCreateScenes: Received message:",A),A.type!=="TOOLBOX_EXPORT_DATA")return;console.log("Received from:",k.origin),console.log("File name:",A.payload.fileName);const P=F(A.payload.file,A.payload.fileName);(D=_.value)==null||D.setFile(P)},onInvalidMessage:(A,k,P)=>{console.warn("Rejected postMessage:",k,P.origin)}})}),qn(()=>{M==null||M()}),(T,A)=>(K(),Ue(H(jS),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:E},tu({default:he(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Ue(oL,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(K(),ie("div",DEe,[me("div",{class:Q(T.$style["step-section"])},[me("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),me("span",{class:Q(T.$style["step-description"])},[...A[1]||(A[1]=[Qe(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),me("br",null,null,-1),me("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),me("div",{class:Q(T.$style["actions-section"])},[ue(H(at),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:he(()=>[ue(H(lt),{src:"Download"})]),default:he(()=>[A[2]||(A[2]=Qe(" Download file ",-1))]),_:1},8,["class","disabled"]),ue(H(at),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:I},{default:he(()=>[...A[3]||(A[3]=[Qe(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),me("div",{class:Q(T.$style["step-section"])},[me("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ue(H(EM),{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),me("div",{class:Q(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ue(sL)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"secondary",onClick:S},{default:he(()=>[...A[4]||(A[4]=[Qe(" Cancel ",-1)])]),_:1}),ue(H(at),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:w},{default:he(()=>[...A[5]||(A[5]=[Qe(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:f},{default:he(()=>[...A[6]||(A[6]=[Qe(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:E},{default:he(()=>[...A[7]||(A[7]=[Qe(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ji92_1","step-title":"_step-title_1ji92_12","step-title-2":"_step-title-2_1ji92_18","step-description":"_step-description_1ji92_24","date-format-guide":"_date-format-guide_1ji92_29","import-error":"_import-error_1ji92_40","drop-area":"_drop-area_1ji92_50","is-dragging":"_is-dragging_1ji92_50","drop-area-content":"_drop-area-content_1ji92_53",browse:"_browse_1ji92_62","download-sample-btn":"_download-sample-btn_1ji92_66","actions-section":"_actions-section_1ji92_70"}}]]),IEe={class:"visual-btn-visual"},xEe={class:"visual-btn--label"},FEe={key:0,class:"visual-btn--description"},PEe={key:1,class:"visual-btn--description"},N$=Ct(st({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(K(),ie("div",{class:Q(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[me("div",IEe,[Tt(r.$slots,"visual",{},()=>[i[0]||(i[0]=kU('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-db9bdf1b><g clip-path="url(#clip0_4824_13082)" data-v-db9bdf1b><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-db9bdf1b></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-db9bdf1b></path></g><defs data-v-db9bdf1b><clipPath id="clip0_4824_13082" data-v-db9bdf1b><rect width="41.1429" height="36" fill="white" data-v-db9bdf1b></rect></clipPath></defs></svg>',1))],!0)]),me("div",xEe,ut(n.label),1),n.disabled?(K(),ie("div",FEe," Coming soon ")):(K(),ie("div",PEe,ut(n.description),1))],2))}}),[["__scopeId","data-v-db9bdf1b"]]),eR="xlsx_toolbox",kEe="TOOLBOX_EXPORT_DATA",AEe="https://app.arbocollab.com",OEe=e=>{const t=yn("switchInstance",void 0),n=r=>{const{source:i,template:a}=r??{};console.log("Opening toolbox with payload:",r);const l={showLoad:!1};if(t?t(eR,"",l):window.appManager.switchInstance(eR,"",l),!i||!a)throw new Error("Source or template file is missing");setTimeout(()=>{const c=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:load",payload:{source:i,template:a}},c)},1e3)};let o;const s=r=>{var i;if(console.log("Received postMessage event:",r),((i=r.data)==null?void 0:i.type)===kEe){const{file:a,fileName:l}=r.data.payload;e(new File([a],l,{type:a.type}),l),window.appManager.hide(eR)}};return Qt(()=>{o=jE({target:window,allowedOrigins:[sessionStorage.getItem("BASE_URL")||AEe],onMessage:r=>{s({data:r})},onInvalidMessage:(r,i,a)=>{console.warn("Rejected postMessage:",i,a.origin)}}),window.addEventListener("message",s)}),qn(()=>o==null?void 0:o()),{openToolbox:n}},MEe={class:"header-name"},NEe={class:"modal-body"},LEe={class:"description"},VEe={key:0,class:"error-message"},BEe={class:"dynamic"},$Ee={key:1,class:"choose-method-container"},HEe={key:2,class:"select-status-container"},GEe={key:3,class:"result-container"},UEe={key:4,class:"result-container"},L$="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",WEe=20,zEe=Ct(st({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=q(()=>dP()),s=q(()=>({1:{title:`Create ${o.value} in bulk`,description:""},2:{title:"Select status",description:"Choose a status for the new work "},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"File doesn’t meet requirements. Check file and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),r={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},i=e,a=n,{apiServices:l}=Zn(!1,i),c=B(),u=B(1),d=B(null),h=B(null),f=B(null),p=B(void 0),g=B(null),v=q(()=>s.value[u.value]),w=()=>{d.value=null,u.value=1,h.value=null,f.value=null,S.value=null,g.value=null,p.value=void 0};tt([h,f],([P,D])=>{u.value===1&&P&&D&&(u.value=2)});const S=B(null),b=P=>{console.error(P),S.value=P},C=async(P,D)=>{var G,J,ae;if(A.value=!0,console.log("Uploading file:",P),!l.value||!i.workspaceId||!i.entityId){console.error("API services not available");return}const N=new FormData;N.append("file",P),N.append("format",((G=D??P.name)==null?void 0:G.split(".").pop())??P.name.split(".").pop()??""),N.append("entity_id",i.entityId),N.append("template_flow_status_id",d.value??"");try{await l.value.addNewSceneViaImportFile(i.workspaceId,i.entityId,N),u.value=3,a("import-success")}catch(ne){console.error("Error uploading file:",ne),b(((ae=(J=ne.response)==null?void 0:J.data)==null?void 0:ae.message)||"An unknown error occurred during file upload."),u.value=4}finally{A.value=!1}},{openToolbox:_}=OEe((P,D)=>{console.log("File received from toolbox:",P),f.value=P,p.value=D??P.name,u.value=2}),E=async()=>{const P=await I();try{_({source:void 0,template:P})}catch(D){console.error("Error opening toolbox:",D),oa().showErrorNetMessage("Failed to open toolbox.")}},x=B(!1),I=async()=>{x.value=!0;const P=i.workspaceId,D=i.entityId;if(!P||!D||!l.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const N=await l.value.downloadTemplate(P,D,!1);if(console.log("Downloaded template response:",N),!N)throw new Error("No response from downloadTemplate API");return N}catch(N){return console.error("Error downloading template:",N),Promise.reject(N)}finally{x.value=!1}},F=P=>{console.log("Validating file:",P.type);const D=L$.includes(P.type);return D||(console.error("Invalid file type:",P.type),oa().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),D},M=async()=>{const P=document.createElement("input");P.type="file",P.accept=L$,P.onchange=async()=>{var N;const D=(N=P.files)==null?void 0:N[0];if(D){if(!F(D)){w();return}h.value=sb(D);try{const G=await I();if(console.log("Template file downloaded:",G),!G){oa().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}_({source:D,template:G})}catch(G){console.error("Error opening toolbox:",G),oa().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},P.click()},T=async P=>{var D;if(!((D=l.value)!=null&&D.getAssignableStatuses)){console.error("API services not available");return}return l.value.getAssignableStatuses(i.workspaceId,{entity_id:i.entityId,name_like:P.name_like,page:P.page,per_page:WEe})},A=B(!1),k=()=>{d.value&&f.value&&(A.value=!0,C(f.value,p.value).finally(()=>{A.value=!1}))};return t({open:()=>{var P;return(P=c.value)==null?void 0:P.show()},close:()=>{var P;return(P=c.value)==null?void 0:P.hide()}}),(P,D)=>(K(),Ue(H(jS),Wt({ref_key:"popupRef",ref:c,style:r,onHidden:w},{popupIndex:10,popupName:v.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0}),tu({header:he(()=>[me("span",MEe,ut(v.value.title),1)]),default:he(()=>[me("div",NEe,[me("div",LEe,ut(v.value.description),1),S.value?(K(),ie("div",VEe,[D[1]||(D[1]=Qe(" Error code ",-1)),me("span",BEe,ut(S.value),1)])):Xe("",!0),u.value===1?(K(),ie("div",$Ee,[ue(N$,{disabled:!0,label:"Start with a blank sheet",description:`Type or paste ${o.value} details
261
261
  into a table.`,onOnClick:E},{visual:he(()=>[ue(H(Ka),{src:"BlankSheet",size:65})]),_:1},8,["description"]),ue(N$,{label:"Import from file",description:`Create ${o.value} from a CSV or
262
262
  Excel file.`,onOnClick:M},{visual:he(()=>[ue(H(Ka),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):u.value===2?(K(),ie("div",HEe,[ue(H(CM),{modelValue:d.value,"onUpdate:modelValue":D[0]||(D[0]=N=>d.value=N),"get-status-func":T,"workspace-id":i.workspaceId,id:i.entityId,style:{width:"100%"},"max-width":"372px"},null,8,["modelValue","workspace-id","id"])])):u.value===3?(K(),ie("div",GEe,[ue(H(Ka),{src:"Success",width:240,height:180,ratio:"unset"})])):u.value===4?(K(),ie("div",UEe,[ue(H(Ka),{src:"Failed",width:240,height:180,ratio:"unset"})])):Xe("",!0)])]),_:2},[u.value===2||u.value===4?{name:"footer",fn:he(()=>[u.value===2?(K(),Ue(H(at),{key:0,loading:A.value,disabled:A.value||!d.value,onClick:k},{default:he(()=>[...D[2]||(D[2]=[Qe(" Import ",-1)])]),_:1},8,["loading","disabled"])):(K(),Ue(H(at),{key:1,onClick:w},{default:he(()=>[...D[3]||(D[3]=[Qe(" Try Again ",-1)])]),_:1}))]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-6d122354"]]),jEe=Ct(st({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Ts,o=mS(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=ns(o),a=Yt,l=ko,c=B(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=B(""),h=q(()=>{var Ze;const Ae=((Ze=i.value)==null?void 0:Ze.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Ae},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",type:"text",hide:!Ae,id:"overwrite_scenes_option"}]}),f=e;qf.initialize({wrapVueCellRenderer:zv,wrapVueCellEditor:hL});const p=mf(),{switchInstanceFunc:g}=ns(p);Qt(()=>{const Ae=oo();g.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const Ze=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ze.postMessage("Focusable elements updated")},7e3)})});const v=B(null),w=B([]),S=cv(),{rowCount:b}=ns(S),C=B(!1),_=B(""),E=B(),x=EA(),{metricList:I}=ns(x),F=B(""),M=B(!1),T=B(new Set),A=B(new Map),{apiServices:k}=Zn(!1,f),{columnDefs:P,checkboxColumn:D,saveColumnConfig:N}=yEe(I,f.entityId,v),G=B();tt(()=>P,()=>{var Ae;(Ae=G.value)==null||Ae.updateColumnDefs(P.value)},{deep:!0});const J=(Ae,Ze)=>{N(Ae,Ze)},{updateRowData:ae,setMetricValues:ne}=bEe(v),ee=q(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(Ve.value||{}).length==1&&Object.keys(Ve.value)[0]=="preflight_status")&&Object.keys(Ve.value||{}).length>0})),$=q(Dm),j=q(()=>P.value.filter(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.replace("metric_",""))||""}));Jr("timezone",$);const te=q(()=>({autoFetch:!1,workspaceId:f.workspaceId,entityId:f.entityId,metricIds:j.value,updateItemData:ae,setMetricValues:ne})),{fetchItems:pe,getMetricList:ve,cusorMap:we,getMetricValues:re}=CEe(te),W=q(()=>{if(!v.value)return!1;const Ae=v.value.getSelectedRows().length;return Ae>0&&Ae>=b.value.total}),ge=q(()=>{var Ae;return((Ae=c.value)==null?void 0:Ae.name)||"Items"}),oe=Ae=>{setTimeout(()=>{vt(()=>{var Ze,Kt;v.value&&(Ae?(Ze=v.value)==null||Ze.showNoRowsOverlay():(Kt=v.value)==null||Kt.hideOverlay())})},500)},_e=(Ae,Ze)=>{var Kt;b.value.total=Ae.meta.total??0,(Kt=Ae.meta.next)!=null&&Kt.cursor&&(we[Ze+1]=Ae.meta.next.cursor),F.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?oe(!0):oe(!1)},U=SM(),{setDefaultSort:Y}=U,de=B(null),{sortingAPIConfiguration:ke,isSortingRunning:xe}=ns(U),Ve=B({preflight_status:"1"}),ye=q(()=>({...Ve.value,search:_.value}));Jr("filterParams",ye);const L=B([]),z=async({page:Ae,pageSize:Ze,filterText:Kt})=>{var $c,Ea,In;($c=v.value)==null||$c.hideOverlay();const hn=we[Ae],Ni=!hn&&Ae>1?(Ae-1)*Ze:void 0,as=ke.value;as.length>0&&(xe.value=!0);try{const zr={cursor:hn,size:Ze,searchQuery:Kt,offset:Ni,sort_by:as,...Ve.value},ls=await pe(zr);if(!ls)return{rows:[],total:0};const kp=(In=(Ea=ls.meta)==null?void 0:Ea.extra)==null?void 0:In.default_sort;kp&&Y(kp);const Sl=Ap=>{const Zd=Ap.data.map(yr=>aP(yr,$.value));return Zd.forEach(yr=>{T.value.add(String(yr.id)),A.value.set(String(yr.id),{})}),Zd};console.log(" processFetchedItems res:",ls);const Yd=Sl(ls);return _e(ls,Ae),{rows:Yd,total:b.value.total}}catch(zr){return console.error("Failed to fetch items:",zr),{rows:[],total:0}}finally{xe.value=!1}},{isLoading:le,toggleSidebar:Ge,onGridReady:be,handleUnSelect:ze,handleSelectAll:qe,onSearch:Ee,firstLoad:Me}=EEe({selectRowData:B([]),isSidebarOpen:C,quickFilterText:_,gridApi:v,perPage:u.ROWS_PER_PAGE,fetcher:z}),wt=B([]),At=()=>{var Ae;wt.value=((Ae=v.value)==null?void 0:Ae.getSelectedRows())||[]},Ut=hs({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),tn=q(()=>({blockLoadDebounceMillis:1e3,columnDefs:P.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:zt,noRowsOverlayComponent:zv(tne),noRowsOverlayComponentParams:()=>ee.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const Ze=["row-highlight"];return Ae.data.id||Ze.push("row-inactive"),Ae.data.isDeleted&&Ze.push("row-deleted"),Ae.data.disabled&&Ze.push("row-deleted"),Ae.data.isArchived&&Ze.push("row-archived"),Ae.data.isLocked&&Ze.push("row-locked"),Ze},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:f.workspaceId,entityId:f.entityId,apiServices:k.value,sorting:xe.value},onCellKeyDown:Ae=>{var Ze,Kt,hn;if(Ae.data.isDeleted)return!1;if(((Ze=Ae==null?void 0:Ae.event)==null?void 0:Ze.key)==="Enter"){const{api:Ni,node:as,column:$c}=Ae,Ea=Ni.getCellRendererInstances({rowNodes:[as],columns:[$c]});if(Ea.length>0){const In=Ea[0];In&&typeof((Kt=In.componsenExposed)==null?void 0:Kt.focus)=="function"&&((hn=In.componsenExposed)==null||hn.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var hn;if((hn=Ae.data)!=null&&hn.isDeleted)return!0;const Ze=Ae.event.key,Kt=Ae.editing;return Kt&&Ze==="Tab"?!0:Kt&&Ze==="Enter"?!1:Ze==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):Ze==="ArrowUp"||Ze==="ArrowDown"||Ze==="ArrowLeft"||Ze==="ArrowRight"||Ze==="Tab"||Ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const Ze=Ae.api.getFirstDisplayedRowIndex(),Kt=Ae.api.getLastDisplayedRowIndex();Ut.rowsDisplay.fromIndex=Ze,Ut.rowsDisplay.toIndex=Kt,Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(hn=>hn.getColId())},onViewportChanged:Ae=>{Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ze=>Ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),Ae.colDef.field=="options"){const Ze=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});Ze.length>0&&Ze[0].focusUi()}},tabToNextCell:Ae=>{let Ze=Ae.nextCellPosition;if(Ze&&Ze.column.getColId()==="ag-Grid-SelectionColumn"){const Kt=Ae.api.getAllDisplayedColumns(),hn=Kt.indexOf(Ze.column),Ni=Ae.backwards?-1:1,as=Kt[hn+Ni];if(as)return{rowIndex:Ze.rowIndex,column:as,rowPinned:Ze.rowPinned}}return Ze}}));function zt(){if(!v.value)return;let Ae=0;v.value.forEachNode(Ze=>{Ze.data&&Ae++}),b.value.loaded=Math.min(Ae,b.value.total)}tt(()=>ke,()=>{v.value&&(F.value="",T.value.clear(),v.value.deselectAll(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),v.value.purgeInfiniteCache(),v.value.ensureIndexVisible(0))},{deep:!0});const Le=B(),je=B(),_t=B(),Nt=()=>{var Ae;(Ae=_t.value)==null||Ae.open()},jt=()=>{var Ae;(Ae=je.value)==null||Ae.open()},nt=async()=>{Me.value=!0,v.value&&(F.value="",T.value.clear(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),await v.value.deselectAll(),await v.value.ensureIndexVisible(0,"top"),await v.value.purgeInfiniteCache(),await v.value.refreshInfiniteCache())},Fo=q(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),gr=B();q(()=>{var Ae;return(Ae=REe(Fo.value))==null?void 0:Ae.map(Ze=>`<div>• ${Ze}</div>`).join(`
263
- `)});function Fi(Ae){var Ze;Ae==="new_scene"?(Ze=gr.value)==null||Ze.show():Ae==="import_scenes"?jt():Ae==="overwrite_scenes"&&Nt()}const mr=Ae=>{w.value=Ae.api.getSelectedRows().map(Ze=>Ze.id)},Sa=Ae=>{const Ze=be(Ae);return Ze&&(Ze.addEventListener("modelUpdated",zt),Ze.addEventListener("bodyScroll",()=>Ze.stopEditing()),Ze.addEventListener("selectionChanged",At),Ze.addEventListener("columnMoved",hn=>J(hn,!0)),Ze.addEventListener("columnResized",hn=>J(hn,!0)),Ze.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ae==null||Ae.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ze},Pi=()=>{var Ae;d.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Qt(()=>{vt(()=>{Pi()}),window.addEventListener("resize",Pi);function Ae(){requestAnimationFrame(Ae)}Ae()}),qn(()=>{window.removeEventListener("resize",Pi)});const ki=async({code:Ae,name:Ze})=>{await Ee(Ae),setTimeout(()=>{var Kt;(Kt=E.value)==null||Kt.setValue(Ze)},300)},Ai=Ae=>{if(!v.value)return;const Ze=v.value.getRowNode(Ae);Ze?(v.value.ensureIndexVisible(Number(Ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},vr=Ae=>Ae.metric_type.code==="number"?"number":"default",Oi=async()=>{if(f.entityId)try{const Ae=await ve(f.entityId);I.value=Ae.data.map(Ze=>({...Ze,sortType:vr(Ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),I.value=[]}},zd=async()=>{if(k.value)try{const Ae=await k.value.getUserPermission(f.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},On=async()=>{if(k.value)try{const Ae=await k.value.getEntityDetail(f.workspaceId,f.entityId);r(Ae.permission),c.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},lo=kv(),{setUser:nR}=lo,jd=async()=>{if(k.value)try{const Ae=await k.value.getMe();return nR(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},Kd=async()=>{var Ae;if(k.value)try{const Ze=await k.value.getWorkspaces(f.workspaceId),Kt=(Ae=Ze.data[0])==null?void 0:Ae.ws_user_role_id;return Kt&&lo.setUserRoleId(Kt),Ze}catch(Ze){console.error("Failed to fetch workspace details:",Ze)}};tt(()=>[f.entityId,f.workspaceId],async([Ae,Ze])=>{!Ae||!Ze||(jd(),Kd(),Oi(),zd(),On())},{immediate:!0,deep:!0}),tt(j,(Ae,Ze)=>{const Kt=Ae.filter(hn=>!(Ze!=null&&Ze.includes(hn)));Kt.length>0&&re(Array.from(T.value),Kt).then(hn=>{ne(hn,T.value,Kt)})},{immediate:!0,deep:!0}),tt(F,(Ae,Ze)=>{M.value=!!(Ze&&Ae&&Ze!==Ae)}),t({refreshTable:nt});const qd=Ae=>{Ve.value=Ae,nt()},oR=Ae=>{L.value=Ae,nt()},Mi=Ae=>{P.value=Ae||[],J({},!0)},bl=q(()=>{var hn;const Ae=un.getInstance().getItem("ws.terminology"),Ze=Ae?JSON.parse(Ae):null;return`New ${((hn=Ze==null?void 0:Ze.find(Ni=>Ni.code==="scene"))==null?void 0:hn.name)||"Scene"}`});return(Ae,Ze)=>(K(),Ue(H(uee),{"is-sidebar-open":C.value,onCloseSidebar:H(Ge),onSidebarClear:H(Ge),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(Ge)},{"header-left":he(()=>{var Kt;return[((Kt=H(i))==null?void 0:Kt.has_create_item_permission)==1?(K(),Ue(H(zS),{key:0,variant:["primary"],options:h.value,onSelect:Fi,onHandleClick:Ze[1]||(Ze[1]=hn=>Fi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:he(()=>[Ke(ue(H(at),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ze[0]||(Ze[0]=hn=>Fi("new_scene")),label:bl.value},null,8,["label"]),[[H(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":he(()=>[ue(H(Une),{"onUpdate:assignees":oR,onApplyFilter:qd,loading:H(Me),entityId:f.entityId},null,8,["loading","entityId"]),Ke(ue(H(SS),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ze[2]||(Ze[2]=Kt=>_.value=Kt),onSearch:H(Ee),class:Q(Ae.$style.itemSearchBox),onClear:Ze[3]||(Ze[3]=Kt=>H(Ee)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke((K(),Ue(H(vA),{status:H(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":M.value},{default:he(()=>[Ke((K(),Ue(H(at),{variant:["secondary","icon"],disabled:H(le),onClick:nt},{default:he(()=>[ue(H(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[H(l),5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke(ue(H(Vte),{"model-value":H(P),onChange:Ze[4]||(Ze[4]=Kt=>Mi(Kt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:G,"checkbox-column":H(D),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]])]),grid:he(({availableHeight:Kt})=>[ue(H(hEe),Wt({id:"item_table_main",ref_key:"agGrid",ref:de},tn.value,{height:Kt+"px",isSorting:H(xe),onOnGridReady:Sa,onSelectionChanged:mr}),null,16,["height","isSorting"])]),footer:he(()=>[me("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[me("span",null,[Ze[5]||(Ze[5]=Qe(" Showing ",-1)),me("b",null,ut(H(b).loaded)+" of "+ut(H(b).total),1)])],2)]),"new-row":he(()=>[ue(H(wne),{ref_key:"createNewSceneRef",ref:gr,onSearchForCode:ki,onFocusOnId:Ai},null,512)]),"bulk-update-actions":he(()=>[!C.value&&w.value.length>0?Ke((K(),Ue(H(nee),{key:0,selectRowData:wt.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:H(ze),onSelectAll:H(qe),"take-name":ge.value,"selected-all":W.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:At,loading:H(le)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ks,!C.value&&w.value.length>0]]):Xe("",!0)]),snackbar:he(()=>[ue(H(Kee))]),popup:he(()=>[ue(zre,{ref_key:"popupCreateSceneRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(zEe,{ref_key:"popupToolboxUploaderRef",ref:je,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(TEe,{ref_key:"popupOverwriteScenesRef",ref:_t,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),V$="0.1.168",KEe={key:0},qEe=Ct(st({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=hs({id:"",workspaceId:"",apiConfig:{}}),o=oa(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};gh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",V$);try{if(l.value=oo(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new FO(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),qn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=q(()=>n.id),d=q(()=>n.workspaceId);return Jr("workspaceId",d),Jr("entityId",u),(h,f)=>(K(),ie("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(K(),ie("span",KEe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),Ue(H(jEe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),tR=async(e={},t={})=>{const n=n1(qEe),o=dZ();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${V$}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",ko);const i=await Are();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=tR),Mn.default=tR,Mn.initDashboard=tR,Object.defineProperties(Mn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
263
+ `)});function Fi(Ae){var Ze;Ae==="new_scene"?(Ze=gr.value)==null||Ze.show():Ae==="import_scenes"?jt():Ae==="overwrite_scenes"&&Nt()}const mr=Ae=>{w.value=Ae.api.getSelectedRows().map(Ze=>Ze.id)},Sa=Ae=>{const Ze=be(Ae);return Ze&&(Ze.addEventListener("modelUpdated",zt),Ze.addEventListener("bodyScroll",()=>Ze.stopEditing()),Ze.addEventListener("selectionChanged",At),Ze.addEventListener("columnMoved",hn=>J(hn,!0)),Ze.addEventListener("columnResized",hn=>J(hn,!0)),Ze.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ae==null||Ae.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ze},Pi=()=>{var Ae;d.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Qt(()=>{vt(()=>{Pi()}),window.addEventListener("resize",Pi);function Ae(){requestAnimationFrame(Ae)}Ae()}),qn(()=>{window.removeEventListener("resize",Pi)});const ki=async({code:Ae,name:Ze})=>{await Ee(Ae),setTimeout(()=>{var Kt;(Kt=E.value)==null||Kt.setValue(Ze)},300)},Ai=Ae=>{if(!v.value)return;const Ze=v.value.getRowNode(Ae);Ze?(v.value.ensureIndexVisible(Number(Ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},vr=Ae=>Ae.metric_type.code==="number"?"number":"default",Oi=async()=>{if(f.entityId)try{const Ae=await ve(f.entityId);I.value=Ae.data.map(Ze=>({...Ze,sortType:vr(Ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),I.value=[]}},zd=async()=>{if(k.value)try{const Ae=await k.value.getUserPermission(f.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},On=async()=>{if(k.value)try{const Ae=await k.value.getEntityDetail(f.workspaceId,f.entityId);r(Ae.permission),c.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},lo=kv(),{setUser:nR}=lo,jd=async()=>{if(k.value)try{const Ae=await k.value.getMe();return nR(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},Kd=async()=>{var Ae;if(k.value)try{const Ze=await k.value.getWorkspaces(f.workspaceId),Kt=(Ae=Ze.data[0])==null?void 0:Ae.ws_user_role_id;return Kt&&lo.setUserRoleId(Kt),Ze}catch(Ze){console.error("Failed to fetch workspace details:",Ze)}};tt(()=>[f.entityId,f.workspaceId],async([Ae,Ze])=>{!Ae||!Ze||(jd(),Kd(),Oi(),zd(),On())},{immediate:!0,deep:!0}),tt(j,(Ae,Ze)=>{const Kt=Ae.filter(hn=>!(Ze!=null&&Ze.includes(hn)));Kt.length>0&&re(Array.from(T.value),Kt).then(hn=>{ne(hn,T.value,Kt)})},{immediate:!0,deep:!0}),tt(F,(Ae,Ze)=>{M.value=!!(Ze&&Ae&&Ze!==Ae)}),t({refreshTable:nt});const qd=Ae=>{Ve.value=Ae,nt()},oR=Ae=>{L.value=Ae,nt()},Mi=Ae=>{P.value=Ae||[],J({},!0)},bl=q(()=>{var hn;const Ae=un.getInstance().getItem("ws.terminology"),Ze=Ae?JSON.parse(Ae):null;return`New ${((hn=Ze==null?void 0:Ze.find(Ni=>Ni.code==="scene"))==null?void 0:hn.name)||"Scene"}`});return(Ae,Ze)=>(K(),Ue(H(uee),{"is-sidebar-open":C.value,onCloseSidebar:H(Ge),onSidebarClear:H(Ge),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(Ge)},{"header-left":he(()=>{var Kt;return[((Kt=H(i))==null?void 0:Kt.has_create_item_permission)==1?(K(),Ue(H(zS),{key:0,variant:["primary"],options:h.value,onSelect:Fi,onHandleClick:Ze[1]||(Ze[1]=hn=>Fi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:he(()=>[Ke(ue(H(at),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ze[0]||(Ze[0]=hn=>Fi("new_scene")),label:bl.value},null,8,["label"]),[[H(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":he(()=>[ue(H(Une),{"onUpdate:assignees":oR,onApplyFilter:qd,loading:H(Me),entityId:f.entityId},null,8,["loading","entityId"]),Ke(ue(H(SS),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ze[2]||(Ze[2]=Kt=>_.value=Kt),onSearch:H(Ee),class:Q(Ae.$style.itemSearchBox),onClear:Ze[3]||(Ze[3]=Kt=>H(Ee)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke((K(),Ue(H(vA),{status:H(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":M.value},{default:he(()=>[Ke((K(),Ue(H(at),{variant:["secondary","icon"],disabled:H(le),onClick:nt},{default:he(()=>[ue(H(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[H(l),5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke(ue(H(Vte),{"model-value":H(P),onChange:Ze[4]||(Ze[4]=Kt=>Mi(Kt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:G,"checkbox-column":H(D),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]])]),grid:he(({availableHeight:Kt})=>[ue(H(hEe),Wt({id:"item_table_main",ref_key:"agGrid",ref:de},tn.value,{height:Kt+"px",isSorting:H(xe),onOnGridReady:Sa,onSelectionChanged:mr}),null,16,["height","isSorting"])]),footer:he(()=>[me("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[me("span",null,[Ze[5]||(Ze[5]=Qe(" Showing ",-1)),me("b",null,ut(H(b).loaded)+" of "+ut(H(b).total),1)])],2)]),"new-row":he(()=>[ue(H(wne),{ref_key:"createNewSceneRef",ref:gr,onSearchForCode:ki,onFocusOnId:Ai},null,512)]),"bulk-update-actions":he(()=>[!C.value&&w.value.length>0?Ke((K(),Ue(H(nee),{key:0,selectRowData:wt.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:H(ze),onSelectAll:H(qe),"take-name":ge.value,"selected-all":W.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:At,loading:H(le)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ks,!C.value&&w.value.length>0]]):Xe("",!0)]),snackbar:he(()=>[ue(H(Kee))]),popup:he(()=>[ue(zre,{ref_key:"popupCreateSceneRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(zEe,{ref_key:"popupToolboxUploaderRef",ref:je,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(TEe,{ref_key:"popupOverwriteScenesRef",ref:_t,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),V$="0.1.169",KEe={key:0},qEe=Ct(st({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=hs({id:"",workspaceId:"",apiConfig:{}}),o=oa(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};gh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",V$);try{if(l.value=oo(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new FO(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),qn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=q(()=>n.id),d=q(()=>n.workspaceId);return Jr("workspaceId",d),Jr("entityId",u),(h,f)=>(K(),ie("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(K(),ie("span",KEe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),Ue(H(jEe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),tR=async(e={},t={})=>{const n=n1(qEe),o=dZ();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${V$}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",ko);const i=await Are();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=tR),Mn.default=tR,Mn.initDashboard=tR,Object.defineProperties(Mn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbocollab/arbo-plugin-item-table",
3
- "version": "0.1.168",
3
+ "version": "0.1.169",
4
4
  "type": "module",
5
5
  "main": "./lib/index.umd.js",
6
6
  "module": "./lib/index.es.js",