@arbocollab/arbo-plugin-item-table 0.1.111 → 0.1.112

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.
@@ -139,7 +139,7 @@ Only state can be modified.`);i[0]="$state",Ic=!1,s.set(r,i,s.state.value),Ic=!0
139
139
  state: () => new MyClass()
140
140
  Found in store "${T.$id}".`),p&&r&&n.hydrate&&n.hydrate(T.$state,p),u=!0,c=!0,T}/*! #__NO_SIDE_EFFECTS__ */function Ql(e,t,n){let s;const o=typeof t=="function";s=o?n:t;function r(i,a){const l=Rw();if(i=(q.env.NODE_ENV==="test"&&Zl&&Zl._testing?null:i)||(l?_n(_m,null):null),i&&Jh(i),q.env.NODE_ENV!=="production"&&!Zl)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
141
141
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
142
- This will fail in production.`);i=Zl,i._s.has(e)||(o?Kb(e,t,s,i):AA(e,s,i),q.env.NODE_ENV!=="production"&&(r._pinia=i));const u=i._s.get(e);if(q.env.NODE_ENV!=="production"&&a){const c="__hot:"+e,d=o?Kb(c,t,s,i,!0):AA(c,or({},s),i,!0);a._hotUpdate(d),delete i.state.value[c],i._s.delete(c)}if(q.env.NODE_ENV!=="production"&&Xi){const c=es();if(c&&c.proxy&&!a){const d=c.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=u}}return u}return r.$id=e,r}function Js(e){const t=Lt(e),n={};for(const s in t){const o=t[s];o.effect?n[s]=Y({get:()=>e[s],set(r){e[s]=r}}):(gn(o)||zo(o))&&(n[s]=qr(e,s))}return n}const qb=Ql("permissionStore",()=>{const e=B([]),t=B(),n=B({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),uY="woohoo_getWoohooUserInterface_read",Yb="media_getReviewUserInterface_read",cY="update_getUpdateUserInterface_read",kA="Unarchive parent folder first to continue",dY=(e,t,n,s,o,r)=>{const i=qb(),{userPermissions:a}=Js(i),l=Y(()=>{const I=En.getInstance().getItem("BASE_URL"),x=En.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:F,entity_id:E,scene_id:A}=e.value;return{baseDomain:I||"",ws_code:F||"",entity_id:E||"",scene_id:A||"",reviewDomain:x||"",take_id:E||"",woohoo_id:E||"",parent_id:E||""}}),u=Y(()=>{var x;const I=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(Yb),canCopyLink:!0,canRename:(I==null?void 0:I.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(Yb),canOpenTakeInUpdate:a.value.includes(cY),canOpenTakeInWoohoo:a.value.includes(uY),canDeleteRendition:((x=I==null?void 0:I.media)==null?void 0:x.has_delete_rendition_permission)??!1,canDeleteThumbnail:(I==null?void 0:I.has_edit_thumbnail_permission)??!1,canArchiveScene:I==null?void 0:I.has_archive_permission,canUnarchiveScene:I==null?void 0:I.has_archive_permission,canDeleteScene:(I==null?void 0:I.has_delete_permission)??!1}}),c=Y(()=>({project:co({type:"project",config:l.value}).url,take_review:co({type:"review_take",config:l.value}).url,review:co({type:"review_scene",config:l.value}).url,review_scene:co({type:"review_scene",config:l.value}).url,woohoo:co({type:"woohoo",config:l.value}).url,update:co({type:"update",config:l.value}).url,scene_hub:co({type:"scene_hub",config:l.value}).url})),d=(I,x)=>{const F=I.metaKey||I.ctrlKey,E=c.value[x]||"";if(E){if(x==="scene_hub"){if(F){window.open(E,"_blank");return}if(!s){console.error("Switch instance not found.",{openSceneHub:s,windowFunc:globalThis.window.$switchInstance});return}s(l.value.scene_id||"");return}F?window.open(E,"_blank"):window.location.href=E}},h=async(I,x)=>{var F;try{const E=await((F=e.value.axiosService.value)==null?void 0:F.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(E==null?void 0:E.message)!="Done"&&console.error("Failed to delete rendition.")}catch(E){console.error("Error deleting rendition",E)}finally{o()}},f=async(I,x)=>{var F;try{await((F=e.value.axiosService.value)==null?void 0:F.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(E){console.error("Error deleting thumbnail",E)}finally{o()}},p=async(I,x)=>{var F;try{const E=await((F=e.value.axiosService.value)==null?void 0:F.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(E==null?void 0:E.message)!="Done"&&console.error("Failed to archive scene."),x&&x("archived")}catch(E){console.error("Error archiving item",E)}finally{o()}},g=async(I,x)=>{var F;try{const E=await((F=e.value.axiosService.value)==null?void 0:F.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(E==null?void 0:E.message)!="Done"&&console.error("Failed to delete scene."),x&&x("deleted")}catch(E){console.error("Error deleting item",E)}finally{o()}},v=I=>{const x=c.value.scene_hub||"";x&&(_.value="Copied",navigator.clipboard.writeText(x),setTimeout(()=>{_.value="Copy link"},5e3))},C=async(I,x)=>{var F;try{const E=await((F=e.value.axiosService.value)==null?void 0:F.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(E==null?void 0:E.message)!="Done"&&console.error("Failed to unarchive scene."),x&&x("unarchived")}catch(E){console.error("Error unarchiving item",E)}finally{o()}},S=I=>p(I,t),b=I=>C(I,t),w=I=>g(I,t),_=B("Copy link"),D=I=>d(I,"review"),T=Y(()=>{let I=[];if(!l.value.scene_id&&e.value.optionBlock&&I.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const x=()=>Math.random().toString(36).substring(2,9);return[{id:x(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:D,hide:!u.value.canOpenReview,disabled:!u.value.canOpenReview,description:"",type:"icon"},{id:x(),label:_.value,icon:"Link",action:v,hide:!u.value.canCopyLink,disabled:!u.value.canCopyLink,description:"",type:"icon"}]},{id:x(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:u.value.canArchiveScene==0,disabled:u.value.canArchiveScene!==1,description:u.value.canArchiveScene==-1?kA:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:u.value.canUnarchiveScene==0,disabled:u.value.canUnarchiveScene!==1,description:u.value.canUnarchiveScene===-1?kA:"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:w,hide:!u.value.canDeleteScene,type:"icon"}]}]});return{linkMap:c,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:C,options:T}};function vs(e){const t=B(!1),n=B(!1),s=Y(()=>{var d;const u=e.value,c=!!u.readOnly;return{readOnly:c,disabled:!!u.disabled,hovered:n.value,focused:t.value,isEmpty:u.empty??!1,error:!!u.error,actived:!!((d=u.active)!=null&&d.value),clickable:c?!1:u.clickable??!1}}),o=()=>{t.value=!0,mt(()=>{const u=l(e.value.inputRef);u==null||u.focus()})},r=()=>{t.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1},l=u=>{if(!u)return null;const c=u.value||u;return(c instanceof HTMLElement?c:c==null?void 0:c.$el)||null};return rn(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.addEventListener("focus",o),u.addEventListener("blur",r)),c&&(c.addEventListener("mouseenter",i),c.addEventListener("mouseleave",a))}),Ss(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.removeEventListener("focus",o),u.removeEventListener("blur",r)),c&&(c.removeEventListener("mouseenter",i),c.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:s,handleFocus:o}}const Fc=e=>{const t=B(!1),n=Y(()=>t.value);return rn(()=>{var a,l,u,c;const s=(a=e.params)==null?void 0:a.api,o=(l=e.params)==null?void 0:l.node,r=o==null?void 0:o.rowIndex,i=(c=(u=e.params)==null?void 0:u.colDef)==null?void 0:c.field;return s==null||s.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),s==null||s.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},OA=_t(it({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:void 0},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=To,{triggerRef:n,popupRef:s}=Fs({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),o=Y(()=>{switch(r.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),r=e;return(i,a)=>(K(),ce("div",{class:te(i.$style["status-badge-wrapper"]),style:dn({"--badge-size":`${r.size}px`,"--badge-color":o.value})},[Tt(i.$slots,"default"),qe(Re("div",{class:te(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ko,r.showBadge],[U(t),{isLoading:r.loading,fullwidth:!0}]]),Re("div",{ref_key:"popupRef",ref:s,class:te(i.$style["badge-tooltip"])},Ct(r.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),Qh=Ql("switchStore",()=>{const e=B(null),t=_n("switchInstance");return{openSceneHub:(o,r)=>{if(o){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");t("scene_hub",{id:o,commentId:r},{showLoading:!1})}},openPeopleInsight:o=>{const r=t||e.value;if(!r)throw console.error("Switch instance not found"),new Error("Switch instance not found");o||console.trace("No people_id provided, defaulting to empty string"),r("people_insight",{tab:"home",id:o||""},{showLoading:!1})},switchInstanceFunc:e}}),hY=it({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:um()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1},showPrivateUser:{type:Boolean,default:!1}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Qt,s=To,o=e,r=t,i={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=B(new Date),l=B(!0),u=B(!1),c=B(!1),d=B(null);let h=null,f=null;const p=Qh(),{openPeopleInsight:g}=p,v=Y(()=>!o.private&&!u.value),C=Y(()=>{var N,W;return((N=d.value)==null?void 0:N.display_name)??((W=o.user)==null?void 0:W.name)}),S=Y(()=>{var N,W;return!v.value||!d.value?o.status:(N=d.value.private_info)!=null&&N.is_offline?"offline":(W=d.value.private_info)!=null&&W.last_active?"active":"away"}),b=Y(()=>{const N=S.value;return N?i[N]:""}),w=Y(()=>{var N,W;return((W=(N=d.value)==null?void 0:N.private_info)==null?void 0:W.timezone)??o.timezone}),_=Y(()=>{if(!w.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:w.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",w.value),""}}),D=Y(()=>{var N,W,X;return{id:o.user.id,name:C.value,initial:((N=d.value)==null?void 0:N.initial)??o.user.initial,profile_image:((W=d.value)==null?void 0:W.profile_image)??o.user.profile_image,color:((X=d.value)==null?void 0:X.color)??o.user.color,size:72,borderRadius:"8px"}}),T=Y(()=>{const N=globalThis.location.origin,W=En.getInstance().getItem("ws.code")||"";return co({type:"people_insight",config:{ws_code:W,baseDomain:N,user_id:o.user.id}}).url}),{copyToClipboard:I,tooltip:x}=FF(T.value,()=>r("copyLink",o.user.id)),F=async()=>{if(!o.apiUpdateFunction){l.value=!1;return}try{const N=await o.apiUpdateFunction(o.user.id);N?(d.value=N,r("dataUpdated",N)):(u.value=!0,c.value=!0,r("dataUpdated",null))}catch(N){u.value=!0,c.value=!0,console.error("Failed to fetch user data:",N)}finally{l.value=!1}},E=()=>{A(),o.apiUpdateFunction&&o.enableAutoRefresh&&(f=setInterval(F,o.refreshInterval))},A=()=>{f!==null&&(clearInterval(f),f=null)},k=N=>{if(N.ctrlKey||N.metaKey){window.open(T.value,"_blank");return}try{g(String(o.user.id))}catch{window.open(T.value,"_blank")}},O=N=>{k(N),r("insightClick",o.user.id)};return et([()=>o.enableAutoRefresh,()=>o.refreshInterval,()=>o.apiUpdateFunction],E),rn(async()=>{h=setInterval(()=>{a.value=new Date},1e4),o.apiUpdateFunction?(await F(),E()):l.value=!1}),zu(()=>{h&&clearInterval(h),A()}),(N,W)=>o.showPrivateUser&&(o.private||c.value)?(K(),ce("div",{key:0,class:te([N.$style["info-row"],N.$style["private-badge"]])},[...W[0]||(W[0]=[Re("span",null,"Private User",-1)])],2)):(K(),ce("div",{key:1,class:te([N.$style["mini-people-card"],{[N.$style.loading]:l.value},"bg-skeleton"])},[Re("div",{class:te(N.$style["avatar-section"])},[v.value?(K(),Ke(OA,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":b.value},{default:me(()=>[pe(Dh,Kt({readOnly:!0},D.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(K(),Ke(Dh,Kt({key:1,readOnly:!0},D.value),null,16))],2),Re("div",{class:te(N.$style["user-info"])},[Re("div",{class:te(N.$style["info-column"])},[qe((K(),ce("span",{class:te(N.$style["user-name"])},[st(Ct(C.value),1)],2)),[[U(n),{content:C.value,delay:[1e3,0]}]]),w.value&&v.value?(K(),ce("div",{key:0,class:te([N.$style["info-row"],N.$style["time-row"]])},[qe((K(),ce("div",{class:te(N.$style["time-display"])},[pe(lt,{source:"remote",src:"Globe",class:te(N.$style["clock-icon"]),size:"10"},null,8,["class"]),Re("span",{class:te(N.$style["time-text"])},Ct(_.value)+" ("+Ct(w.value)+")",3)],2)),[[U(s),{isLoading:l.value,fullwidth:!0}]])],2)):Je("",!0)],2),!e.readOnly&&v.value?(K(),ce("div",{key:0,class:te([N.$style["info-row"],N.$style.actions])},[e.showInsightButton?(K(),Ke(vt,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Pt(O,["prevent","stop"]),disabled:o.disabled},null,8,["disabled"])):Je("",!0),e.showCopyLinkButton?qe((K(),Ke(vt,{key:1,variant:["icon","secondary"],size:"small",onClick:Pt(U(I),["prevent","stop"]),disabled:o.disabled},{default:me(()=>[pe(lt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[U(n),{content:U(x),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Je("",!0)],2)):Je("",!0)],2)],2))}}),fY=_t(hY,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_ign8a_1",loading:"_loading_ign8a_25","avatar-section":"_avatar-section_ign8a_28","user-info":"_user-info_ign8a_33","info-column":"_info-column_ign8a_42","info-row":"_info-row_ign8a_50","time-row":"_time-row_ign8a_56","time-display":"_time-display_ign8a_62","time-text":"_time-text_ign8a_70",actions:"_actions_ign8a_79","user-name":"_user-name_ign8a_83","v-enter-active":"_v-enter-active_ign8a_103","v-leave-active":"_v-leave-active_ign8a_104","v-enter-from":"_v-enter-from_ign8a_108","v-leave-to":"_v-leave-to_ign8a_109"}}]]),pY=_t(it({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e,{expose:t}){const n=Wi,s=Qt,o=e,{isEditing:r}=Fc(o),i=()=>{var h,f;const c=(h=o.params)==null?void 0:h.api,d={rowIndex:(f=c==null?void 0:c.getRowNode(String(o.id)))==null?void 0:f.rowIndex,colKey:"options"};c==null||c.startEditingCell(d)},a=Y(()=>{var d,h;const c=(h=(d=o.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(o.id));return((c==null?void 0:c.rowIndex)??0)+10}),l=()=>{var c,d;(d=(c=o.params)==null?void 0:c.api)==null||d.stopEditing()},u=B();return t({focus(){var c;(c=u.value)==null||c.focus()},blur(){var c;(c=u.value)==null||c.blur()}}),(c,d)=>qe((K(),Ke(vt,{class:te(c.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:U(r),onClick:Pt(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:u},{default:me(()=>[pe(lt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[U(s),"More actions"],[U(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_w8s4g_1"}}]]),gY=["src","width","height","alt"],Fm=_t(it({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=To,{getCachedValue:n,setCachedValue:s}=_h({dbName:"visual-cache-db",storeName:"visuals"}),o=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},r=e,i=Y(()=>({minWidth:o(r.minWidth),maxWidth:o(r.maxWidth),minHeight:o(r.minHeight),maxHeight:o(r.maxHeight),aspectRatio:r.ratio,width:o(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await s(h,f)},u=Y(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:c,loading:d}=W1(u,"visual",l,a);return(h,f)=>qe((K(),ce("div",{class:te([h.$style.visualWrapper,{[h.$style.loading]:U(d)}]),style:dn(i.value)},[Re("img",{src:U(c),width:e.size,height:e.size,alt:"visual-"+e.src,style:dn(i.value)},null,12,gY)],6)),[[U(t),{isLoading:U(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),mY=["tabindex"],ys=_t(it({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const s=e,o=n;ng();const r=mg(),i=B(null),a=B("default"),l=Y(()=>{if(typeof s.size=="number")return`${s.size}px`;switch(s.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),u=Y(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),c=Y(()=>({[r["display-wrapper"]]:!0,[r.disabled]:s.disabled,[r.readOnly]:s.readOnly,[r.error]:s.error,[r.clickable]:s.clickable,[r.active]:s.actived,[r.hovered]:s.hovered,[r.focused]:!s.readOnly&&!s.disabled&&s.focused,[r.bordered]:s.bordered})),d=()=>{var w,_;const g=((w=i.value)==null?void 0:w.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((_=i.value)==null?void 0:_.querySelectorAll(":scope > .wrapper-suffix").length)||0,C="var(--icon-size)",b=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${C}) calc(100% - (${g} * ${C} + ${b}))`:!g&&v?`calc(100% - (${v} * ${C} + ${b})) repeat(${v}, ${C})`:g&&v?`repeat(${g}, ${C}) calc(100% - (${g} * ${C} + ${v} * ${C} + ${b})) repeat(${v}, ${C})`:"100%"},h=B("100%"),f=()=>{h.value=d()};eh(()=>{f()}),rn(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{mt(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{o("escape")}}),(g,v)=>(K(),ce("div",{ref_key:"rootEl",ref:i,class:te([U(r)["display-wrapper"],c.value]),tabindex:e.tabIndex,style:dn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":u.value})},[Tt(g.$slots,"prefix",{hovered:s.hovered,focused:s.focused}),Tt(g.$slots,"default",{hovered:s.hovered,focused:s.focused,updateComponentState:p,disabled:s.disabled}),Tt(g.$slots,"suffix",{hovered:s.hovered,focused:s.focused})],14,mY))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_11gbb_1",readOnly:"_readOnly_11gbb_26",bordered:"_bordered_11gbb_29",disabled:"_disabled_11gbb_29",active:"_active_11gbb_29",focused:"_focused_11gbb_29",hovered:"_hovered_11gbb_34",error:"_error_11gbb_38",clickable:"_clickable_11gbb_51",suffix:"_suffix_11gbb_57",prefix:"_prefix_11gbb_58"}}]]),vY=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const yY=Object.prototype.toString,wY=e=>yY.call(e)==="[object Object]",Pc=()=>{};function CY(e,t){function n(...s){return new Promise((o,r)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(o).catch(r)})}return n}function bY(e,t={}){let n,s,o=Pc;const r=l=>{clearTimeout(l),o(),o=Pc};let i;return l=>{const u=Li(e),c=Li(t.maxWait);return n&&r(n),u<=0||c!==void 0&&c<=0?(s&&(r(s),s=void 0),Promise.resolve(l())):new Promise((d,h)=>{o=t.rejectOnCancel?h:d,i=l,c&&!s&&(s=setTimeout(()=>{n&&r(n),s=void 0,d(i())},c)),n=setTimeout(()=>{s&&r(s),s=void 0,d(l())},u)})}}function Zb(e){return Array.isArray(e)?e:[e]}function SY(e,t=200,n={}){return CY(bY(t,n),e)}function EY(e,t,n){return et(e,t,{...n,immediate:!0})}const MA=vY?window:void 0;function ef(e){var t;const n=Li(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Xb(...e){const t=(s,o,r,i)=>(s.addEventListener(o,r,i),()=>s.removeEventListener(o,r,i)),n=Y(()=>{const s=Zb(Li(e[0])).filter(o=>o!=null);return s.every(o=>typeof o!="string")?s:void 0});return EY(()=>{var s,o;return[(s=(o=n.value)===null||o===void 0?void 0:o.map(r=>ef(r)))!==null&&s!==void 0?s:[MA].filter(r=>r!=null),Zb(Li(n.value?e[1]:e[0])),Zb(U(n.value?e[2]:e[1])),Li(n.value?e[3]:e[2])]},([s,o,r,i],a,l)=>{if(!(s!=null&&s.length)||!(o!=null&&o.length)||!(r!=null&&r.length))return;const u=wY(i)?{...i}:i,c=s.flatMap(d=>o.flatMap(h=>r.map(f=>t(d,h,f,u))));l(()=>{c.forEach(d=>d())})},{flush:"post"})}function Jb(e,t,n={}){const{window:s=MA,ignore:o=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!s)return a?{stop:Pc,cancel:Pc,trigger:Pc}:Pc;let l=!0;const u=v=>Li(o).some(C=>{if(typeof C=="string")return Array.from(s.document.querySelectorAll(C)).some(S=>S===v.target||v.composedPath().includes(S));{const S=ef(C);return S&&(v.target===S||v.composedPath().includes(S))}});function c(v){const C=Li(v);return C&&C.$.subTree.shapeFlag===16}function d(v,C){const S=Li(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(w=>w.el===C.target||C.composedPath().includes(w.el))}const h=v=>{const C=ef(e);if(v.target!=null&&!(!(C instanceof Element)&&c(e)&&d(e,v))&&!(!C||C===v.target||v.composedPath().includes(C))){if("detail"in v&&v.detail===0&&(l=!u(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[Xb(s,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),Xb(s,"pointerdown",v=>{const C=ef(e);l=!u(v)&&!!(C&&!v.composedPath().includes(C))},{passive:!0}),i&&Xb(s,"blur",v=>{setTimeout(()=>{var C;const S=ef(e);((C=s.document.activeElement)===null||C===void 0?void 0:C.tagName)==="IFRAME"&&!(S!=null&&S.contains(s.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const _Y=["value","placeholder","disabled","readonly","inputmode","maxlength"],Qb=_t(it({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},maxDecimalChar:{},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const s=Wi,o=Qt,r=e,i=n,a=B(null),l=B(r.modelValue||"");et(l,()=>{i("onValidation",l.value)});const u=B(!1),c=B(r.modelValue||"");et(()=>r.modelValue,V=>{l.value=V||"",c.value=V||""});const d=Y(()=>{var V;return((V=l.value)==null?void 0:V.length)>0}),h={text:V=>V.slice(0,r.maxLength||255),number:V=>{let H=V.replace(/[^\d.-]/g,"");const Q=H.split(".");Q.length>2&&(H=Q[0]+"."+Q.slice(1).join("")),H=H.replace(/-/g,(j,ge)=>ge===0?j:"");const ve=H.startsWith("-")?"-":"",re=H.replace("-","").split(".");return re[0].length>17&&(re[0]=re[0].substring(0,17)),r.maxDecimalChar!==void 0&&re.length>1&&(re[1]=re[1].substring(0,r.maxDecimalChar)),H=ve+re.join("."),H},email:V=>V.replace(/\s/g,"").slice(0,r.maxLength||255),url:V=>V.replace(/\s/g,"").slice(0,r.maxLength||255),tel:V=>V.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},f=V=>{const H=h[r.type];return H?H(V):V},p=SY(V=>{r.autoEmit&&(i("update:modelValue",V),i("input",V))},r.debounceDelay),g=V=>{const H=V;if(r.disabled||r.readOnly){H.preventDefault();return}const Q=H.target,fe=Q.selectionStart||0,ve=l.value,oe=f(Q.value);ve!==oe&&(l.value=oe,i("input",oe),r.autoEmit&&p(oe),Q.value!==oe&&(Q.value=oe,mt(()=>{let re=fe;if(oe.length<Q.value.length)re=fe;else{const j=oe.length-ve.length;re=fe+j}re=Math.max(0,Math.min(re,oe.length)),Q.setSelectionRange(re,re)})))},v=V=>{if(r.disabled||r.readOnly){V.preventDefault();return}u.value=!0;const H=l.value;l.value="",i("update:modelValue",""),i("clear"),H!==""&&i("change",""),V.preventDefault(),V.stopImmediatePropagation(),V.stopPropagation(),mt(()=>{var Q;(Q=a.value)==null||Q.focus(),setTimeout(()=>{u.value=!1},100)})},C=V=>{r.disabled||r.readOnly||(i("focus",V),r.selectOnFocus&&mt(()=>{V.target.select()}))},S=V=>{if(u.value)return;const Q=V.target.value;r.autoEmit||i("update:modelValue",Q),c.value!==Q&&(i("change",Q),c.value=Q),i("blur",Q,V)},b=V=>{setTimeout(()=>{mt(()=>{const Q=V.target.value;i("enter",Q,V),i("enterValue",Q),r.submitOnEnter&&(V.preventDefault(),r.autoEmit||i("update:modelValue",Q),c.value!==Q&&(i("change",Q),c.value=Q))})},1e3)},w=V=>{const H=V.target,Q=H.value;if(i("escape",Q,V),V.preventDefault(),V.stopImmediatePropagation(),V.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&H.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&H.blur()},_=V=>{const Q=V.target.value;i("tab",Q,V),r.autoEmit||(i("update:modelValue",Q),c.value!==Q&&(i("change",Q),c.value=Q))},D=(V,H,Q)=>V===""?!0:V==="."?Q>0:new RegExp(`^\\d{0,${H}}(\\.\\d{0,${Q}})?$`).test(V),T=V=>{if(i("keydown",V),V.key===" "&&V.stopPropagation(),r.type==="number"){if(V.key==="e"||V.key==="E"){V.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(V.key)||V.ctrlKey||V.metaKey||V.altKey)){if(Number.isNaN(Number(V.key))&&V.key!=="."&&V.key!=="-"){V.preventDefault();return}const fe=l.value+V.key;if(!D(fe,17,r.maxDecimalChar||2)){V.preventDefault(),console.log("BLOCKED",fe);return}}}V.key==="Escape"?w(V):V.key==="Enter"?b(V):V.key==="Tab"?_(V):(V.key==="ArrowUp"||V.key==="ArrowDown")&&r.type==="number"&&V.preventDefault()},I=V=>{i("keyup",V)},x=V=>{if(r.disabled||r.readOnly){V.preventDefault();return}i("paste",V)},F=V=>{if(r.disabled||r.readOnly){V.preventDefault();return}i("cut",V)},E=V=>{i("select",V)},A=`input-text-${Math.random().toString(36).substr(2,9)}`,k=B(!1),O=Y(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});et(()=>l.value,V=>{r.validatorFnc?k.value=!!V&&!r.validatorFnc(V):k.value=!1});const N=B(null),W=Y(()=>({disabled:r.disabled,readOnly:r.readOnly,error:k.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:N,bordered:!0})),{argsMain:X,isHover:ee,isFocus:ie}=vs(W);t({triggerFocus:()=>{mt(()=>{var V;(V=a.value)==null||V.focus()})},focus:()=>{ae()},blur:()=>{mt(()=>{var V;(V=a.value)==null||V.blur()})},select:()=>{mt(()=>{var V;(V=a.value)==null||V.select()})},setSelectionRange:(V,H)=>{mt(()=>{var Q;(Q=a.value)==null||Q.setSelectionRange(V,H)})},getValue:()=>l.value,setValue:V=>{l.value=f(V),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const ae=()=>{!r.disabled&&!r.readOnly&&mt(()=>{var V;(V=a.value)==null||V.focus()})},J=Y(()=>ie.value&&d.value);return(V,H)=>(K(),ce("div",{class:te([V.$style["input-wrapper"],"input-editor"]),onClick:ae},[qe((K(),Ke(ys,Kt(U(X),{ref_key:"wrapperRef",ref:N,class:[V.$style["input-box"],{[V.$style["is-hovered"]]:U(ee),[V.$style["is-focused"]]:U(ie),[V.$style["has-input"]]:d.value,[V.$style["is-editting"]]:J.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:me(()=>[Tt(V.$slots,"prefix")]),suffix:me(()=>[d.value&&!r.disabled&&!r.readOnly?Tt(V.$slots,"clear",{key:0},()=>[qe((K(),Ke(vt,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Pt(v,["prevent","stop"]),size:18,rounded:!0,class:te(["wrapper-suffix",V.$style["clear-button"]])},{default:me(()=>[pe(lt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[U(o),{content:"Clear",contentClass:"extra-padding"}]])]):Tt(V.$slots,"suffix",{key:1})]),default:me(()=>[Re("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:te([V.$style["column-config__input"]]),id:A,disabled:e.disabled,readonly:e.readOnly,inputmode:O.value,maxlength:r.maxLength,onInput:g,onFocus:C,onBlur:S,onKeydown:T,onKeyup:I,onPaste:x,onCut:F,onSelect:E},null,42,_Y)]),_:3},16,["class","bordered"])),[[U(s),r.focusIndex]]),k.value?Tt(V.$slots,"error",{key:0}):Je("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_wqanj_1","is-disabled":"_is-disabled_wqanj_16","is-readonly":"_is-readonly_wqanj_16","is-hovered":"_is-hovered_wqanj_16","is-focused":"_is-focused_wqanj_20","column-config__input":"_column-config__input_wqanj_40","clear-button":"_clear-button_wqanj_55"}}]]),RY={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},eS=it({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(null),i=Tr(u=>{o("update:modelValue",u),o("search",u)},ai),a=()=>{o("update:modelValue",""),o("clear"),mt(()=>{var u;(u=r.value)==null||u.focus()})},l=B(s.modelValue);return t({focus:()=>{var u;(u=r.value)==null||u.focus()},setValue(u){l.value=u}}),(u,c)=>(K(),Ke(Qb,{focusIndex:s.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:U(i),onClear:a,onCancel:c[1]||(c[1]=d=>o("cancel")),"auto-emit":!0},{prefix:me(()=>[Re("div",RY,[pe(lt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),eu=_t(it({name:"ListItem",directives:{tooltip:Qt},__name:"ListItem",props:{label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(!1),i=B(!1);function a(w){if(!w||typeof w!="object")return!1;const _=w;return typeof _.name=="string"&&typeof _.id=="string"&&typeof _.initial=="string"}const l=Y(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!b.prefix),u=Y(()=>!!b.suffix||s.danger&&r.value),c=Y(()=>{var w;return s.type==="status"&&typeof((w=s.data)==null?void 0:w.color)=="string"?{backgroundColor:s.data.color,border:Ng(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=mg(),h=Y(()=>({[d.active]:s.selected??!1,[d.disabled]:s.disabled??!1,[d.hover]:s.hover??!1,[d.clickable]:(s.clickable??!0)&&!s.disabled,[d.danger]:s.danger??!1,[d["has-prefix"]]:l.value,[d["has-suffix"]]:u.value,[d.readOnly]:s.readOnly}));Y(()=>({content:"Cancel",...S})),Y(()=>({content:"Confirm",theme:"warning",...S}));function f(w){return{name:w.name,initial:w.initial,id:w.id,profile_image:w.profile_image??null,color:w.color,size:24}}function p(){r.value=!1}function g(w){w?o("click",w):(s.clickable??!0)&&(o("update:selected",!s.selected),o("select",!s.selected))}function v(w){if(!s.disabled){if(s.danger&&!r.value){r.value=!0;return}else s.danger||g(w);o("handleClick",w)}}const C=()=>{r.value?p():o("escape")},S=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),b=ng();return et(()=>s.show,w=>{w===!1&&(r.value=!1)}),t({select:()=>{v(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(w,_)=>{const D=Eo("focusable"),T=Eo("tooltip");return qe((K(),Ke(vt,{variant:["menu-item",e.danger?"danger":"menu-item"],class:te([w.$style["list-item"],h.value]),onHandleClick:v,onMouseenter:_[0]||(_[0]=I=>i.value=!0),onMouseleave:_[1]||(_[1]=I=>i.value=!1),onEscape:C,style:{width:"200px"}},{default:me(()=>[l.value?(K(),ce("div",{key:0,class:te(w.$style["list-item__prefix"])},[Tt(w.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(K(),Ke(lt,{key:0,src:e.icon,source:"remote",class:te(w.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(K(),ce("div",{key:1,class:te(w.$style["status-indicator"]),style:dn(c.value)},null,6)):e.type==="assignee"&&a(e.data)?(K(),Ke(Dh,Kt({key:2},f(e.data),{class:w.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Je("",!0)])],2)):Je("",!0),Re("div",{class:te(w.$style["list-item__label"])},[Tt(w.$slots,"label",{selected:e.selected},()=>[st(Ct(e.label),1)])],2),u.value?(K(),ce("div",{key:1,class:te(w.$style["list-item__suffix"])},[Tt(w.$slots,"suffix",{item:w.$props,hovered:i.value},()=>[e.danger&&r.value?(K(),ce("div",{key:0,class:te(w.$style["confirm-action"])},[qe((K(),Ke(vt,{variant:["tertiary","icon","danger"],size:"small",onClick:Pt(p,["stop","prevent"])},{default:me(()=>[pe(lt,{src:"Xmark",source:"remote"})]),_:1})),[[D,`${s.focusIndex}.0`],[T,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),qe((K(),Ke(vt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(g,["stop","prevent"])},{default:me(()=>[pe(lt,{src:"Check",source:"remote"})]),_:1})),[[D,`${s.focusIndex}.1`],[T,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Je("",!0)])],2)):Je("",!0)]),_:3},8,["variant","class"])),[[D,s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_tuyyv_1",disabled:"_disabled_tuyyv_16",danger:"_danger_tuyyv_23","has-prefix":"_has-prefix_tuyyv_26","has-suffix":"_has-suffix_tuyyv_26",clickable:"_clickable_tuyyv_40",readOnly:"_readOnly_tuyyv_43",hover:"_hover_tuyyv_47",active:"_active_tuyyv_53","list-item__prefix":"_list-item__prefix_tuyyv_78","list-item__label":"_list-item__label_tuyyv_86","list-item__suffix":"_list-item__suffix_tuyyv_100","status-indicator":"_status-indicator_tuyyv_107","item-icon":"_item-icon_tuyyv_113","arbo-icon-state":"_arbo-icon-state_tuyyv_118","item-avatar":"_item-avatar_tuyyv_121","confirm-action":"_confirm-action_tuyyv_130"}}]]),DY=["aria-activedescendant"],TY=["innerHTML"],IY=10,Qi=_t(it({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const s=Qt,o={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=B(""),l=B(-1),u=B(null),c=B(null),d=B(new Map),h=Y(()=>gb(a.value)),f=()=>{const J=h.value;if(!J||J.length<r.minQueryLength)return r.options;if(d.value.has(J))return d.value.get(J);const V=r.options.map(H=>({item:H,score:_7(` ${H.label} `,J)})).filter(({score:H})=>H>0).sort((H,Q)=>Q.score-H.score).map(({item:H})=>H);return d.value.set(J,V),V},p=B([]);et(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Y(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=Tr(J=>{a.value=J,l.value=-1,i("search",J)},ai),C=async J=>{ie.value=0,await v(J||""),ie.value=1},S=J=>a.value?R7(J,a.value):J,b=J=>{const H={[o.ARROW_DOWN]:()=>w(J),[o.ARROW_UP]:()=>_(J),[o.ENTER]:()=>I(J),[o.ESCAPE]:()=>x(J),[o.TAB]:()=>F(J)}[J.key];H&&H()},w=J=>{J.preventDefault(),D(1)},_=J=>{J.preventDefault(),D(-1)},D=J=>{const V=p.value.length;if(V===0)return;let H;J>0?H=(l.value+1)%V:l.value>0?H=l.value-1:H=V-1,l.value=H,T()},T=()=>{mt(()=>{var V;const J=(V=c.value)==null?void 0:V.querySelectorAll('[role="menuitem"]')[l.value];J==null||J.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},I=J=>{if(J.preventDefault(),l.value>=0&&l.value<p.value.length){const H=p.value[l.value];E(H,J)}},x=J=>{J.preventDefault(),k()},F=J=>{i("tab",J)},E=(J,V)=>{!J||J.disabled||(i("select",J,V),l.value=-1,k())},A=J=>{J>=0&&J<p.value.length&&(l.value=J)},k=()=>{i("close")},O=()=>{if(!g.value||!c.value)return;const{scrollTop:J,clientHeight:V,scrollHeight:H}=c.value;H-(J+V)<=IY&&i("loadMore")},N=()=>{var J,V,H;(J=c.value)==null||J.addEventListener("scroll",O),(H=(V=ee.value)==null?void 0:V.$el)==null||H.addEventListener("keydown",b)},W=()=>{var J,V,H;(J=c.value)==null||J.removeEventListener("scroll",O),(H=(V=ee.value)==null?void 0:V.$el)==null||H.removeEventListener("keydown",b)};rn(()=>{N()}),Ss(()=>{W()}),et(()=>r.loading,J=>{!J&&p.value.length>0&&(l.value=-1)});const X=J=>J?Array.isArray(r.selectedId)?r.selectedId.includes(String(J.id)):r.selectedId==J.id:!1,ee=B(null);et(l,()=>{T()}),t({focus:()=>{mt(()=>{var J;(J=ee.value)==null||J.focus()})},reset:()=>{var J;(J=ee.value)==null||J.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:k,clearSearch:()=>{a.value=""},scrollTo:J=>{c.value&&(c.value.scrollTop=J)},selectIndex:J=>{J>=0&&J<p.value.length&&(l.value=J,T())}});const ie=B(0);et([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const J=r.options.length>0&&p.value.length>0,V=!J&&a.value.length>0,H=!J&&a.value.length===0;r.loading?ie.value=0:J?ie.value=1:V?ie.value=2:H&&(ie.value=3)},{immediate:!0,deep:!0});const ae=()=>{i("cancel")};return(J,V)=>(K(),ce("datalist",{ref_key:"searchListRef",ref:u,class:te([J.$style["search-list"],ie.value===3||ie.value===2?J.$style.empty:"",p.value.length>8?J.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:dn({width:e.width})},[pe(eS,{ref_key:"searchBoxRef",ref:ee,modelValue:a.value,"onUpdate:modelValue":V[0]||(V[0]=H=>a.value=H),class:te(J.$style["search-box"]),disabled:e.loading,onSearch:C,onClear:V[1]||(V[1]=H=>C("")),onCancel:ae},null,8,["modelValue","class","disabled"]),Re("div",{ref_key:"popupRef",ref:c,class:te(J.$style["list-container"])},[Tt(J.$slots,"extra-item",{query:a.value,isEmpty:ie.value===3||ie.value===2,isLoading:r.loading}),(K(!0),ce(xt,null,xn(p.value,(H,Q)=>qe((K(),ce("div",{key:`${H.id}-${Q}`,role:"menuitem"},[Tt(J.$slots,"item",{item:H,index:Q,selectedIndex:l.value,isSelected:X,handleSelect:E,handleItemHover:A,getHighlightedLabel:S,query:a.value,idx:Q,focused:l.value==Q},()=>[H.hide?Je("",!0):(K(),Ke(eu,Kt({key:0,ref_for:!0},H,{hover:Q===l.value,selected:X(H),type:H.type,id:`item-${Q}`,"aria-selected":Q===l.value,onClick:fe=>E(H,fe),onMouseover:fe=>A(Q),onEscape:k}),{prefix:me(()=>[Tt(J.$slots,"prefix-item",{item:H})]),label:me(()=>[a.value?qe((K(),ce("span",{key:0,class:te(J.$style.match),innerHTML:S(H.label)},null,10,TY)),[[U(s),{content:H.label,delay:[1e3,0]}]]):qe((K(),ce("span",{key:1,class:te(J.$style["item-label"])},[st(Ct(H.label),1)],2)),[[U(s),{content:H.label,delay:[1e3,0]}]])]),suffix:me(({hovered:fe})=>[Tt(J.$slots,"action",{item:H,isHovered:Q===l.value,hovered:fe,selected:l.value==Q})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[Ko,ie.value===1]])),128)),ie.value===0?Tt(J.$slots,"loading-more",{key:0},()=>[(K(),ce(xt,null,xn(8,H=>Re("div",{class:te(J.$style["loading-more"]),key:H},[Re("div",{class:te(J.$style["loading-skeleton"])},null,2),Re("div",{class:te(J.$style["loading-skeleton"])},null,2)],2)),64))]):Je("",!0),ie.value===2?(K(),ce("div",{key:1,class:te(J.$style["no-results"])},[Tt(J.$slots,"empty",{query:a.value},()=>[Re("div",{class:te(J.$style["no-results-content"])},[...V[2]||(V[2]=[Re("div",null,[st(" No results. "),Re("br"),st(" Try another search. ")],-1)])],2)])],2)):Je("",!0),ie.value===3?(K(),ce("div",{key:2,class:te(J.$style["no-results"])},[Tt(J.$slots,"empty-list",{},()=>[Re("div",{class:te(J.$style["no-results-content"])},[...V[3]||(V[3]=[Re("div",null,"No items available.",-1)])],2)])],2)):Je("",!0),Tt(J.$slots,"footer")],2)],14,DY))}}),[["__cssModules",{$style:{"search-list":"_search-list_1rcj9_1",empty:"_empty_1rcj9_11",scrollable:"_scrollable_1rcj9_17","list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:"_title_1rcj9_137",tips:"_tips_1rcj9_143",match:"_match_1rcj9_157","skeleton-loading":"_skeleton-loading_1rcj9_1"}}]]),Ac=it({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=hz,n=e,s=B(n.appendTo||void 0),o=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:s.value}),r=B(o());et(()=>n,()=>{setTimeout(()=>{mt(()=>{s.value=n.appendTo||void 0,r.value=o()})},50)},{immediate:!0,deep:!0});const i=Y(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial}));return(a,l)=>qe((K(),Ke(Dh,v$(PD(i.value)),null,16)),[[U(t),r.value]])}}),xY={class:"avatar-wrapper"},FY={class:"assignee-label"},NA=_t(it({__name:"AssigneeItem",props:{user:{},hover:{type:Boolean},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Qt,s=e,o=Y(()=>({name:s.user.name,id:s.user.id,profile_image:s.user.profile_image,color:{bgColor:s.user.color.bgColor,textColor:s.user.color.textColor},initial:s.user.initial})),r=Y(()=>s.isMe),i=ng(),a=Y(()=>{if(!l.value&&!s.hover&&!s.focused||!i.actions)return 0;let u=0;const c=d=>{d.forEach(h=>{h.type===xt&&Array.isArray(h.children)?c(h.children):h.type!==qn&&h.type!==Ta&&u++})};return c(i.actions()),u}),l=B(!1);return(u,c)=>(K(),ce("div",{class:te(["assignee-selector-item",{hovered:l.value||s.hover,disabled:s.disabled,selected:s.selected,single:a.value==0,focused:s.focused}]),style:dn({"--actions-count":a.value}),onMouseenter:c[0]||(c[0]=d=>l.value=!0),onMouseleave:c[1]||(c[1]=d=>l.value=!1)},[Re("div",xY,[pe(Ac,{user:o.value,"show-profile":!0,isMe:r.value,"append-to":s.appendTo,"api-update-function":s.apiUpdateFunction},null,8,["user","isMe","append-to","api-update-function"]),s.multipleSelect?(K(),ce("div",{key:0,class:te(["avatar-indicator",[s.selected?"remove":"add"]])},[s.selected?(K(),Ke(lt,{key:0,src:"CircleXMark"})):(K(),Ke(lt,{key:1,src:"CirclePlus"}))],2)):Je("",!0)]),qe((K(),ce("div",FY,[Tt(u.$slots,"name",{},()=>[st(Ct(s.user.name),1)],!0)])),[[U(n),{content:s.user.name,delay:[1e3,0]}]]),l.value||s.hover||s.focused?Tt(u.$slots,"actions",{key:0},void 0,!0):Je("",!0)],38))}}),[["__scopeId","data-v-690cf591"]]),PY={class:"unassign-icon"},tS=_t(it({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,s=()=>{n("click")};return(o,r)=>(K(),Ke(U(vt),{variant:"menu-item",onClick:s,actived:e.actived,style:dn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:me(()=>[Re("div",PY,[Tt(o.$slots,"icon",{},()=>[r[0]||(r[0]=Re("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"#a6a6a6"})],-1))],!0)])]),default:me(()=>[Tt(o.$slots,"label",{},()=>[st(Ct(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),AY=["innerHTML"],kY=20,LA=_t(it({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","update-start","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,{id:r}=Gp(o),i=n,a=Q=>{var ve,oe;const fe=(oe=(ve=o.params)==null?void 0:ve.api)==null?void 0:oe.getRowNode(String(r.value));fe==null||fe.setDataValue("assignees",OI(Q.assignees)),H("updated",Q),console.log("Row data updated with new assignees:",Q.assignees)};et(()=>o.ids,Q=>{console.log("IDs changed:",Q)},{deep:!0});const l=B(!1),u=B(!1),c=B(null),d=B(1),h=B(!0),f=B(0),p=B(""),g=_n("bulkUpdate",B(!1)),v=_n("isSelectAll",B(!1)),C=Y(()=>{var Q;return console.log("Computing selected IDs with bulkUpdate:",g.value,"isSelectAll:",v.value,"props.ids:",o.ids),g.value&&v.value?[]:(Q=o.ids)!=null&&Q.length?o.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:w,assigneeList:_,mergedOptions:D,selectedUserIds:T}=gm({...o,entityId:o.entityId,updateRowData:a,value:o.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{H("update-failed")}},C),{apiServices:I}=ts(!g.value,o),x=_n("workspaceId"),F=async(Q=1,fe="",ve=!1)=>{var oe,re,j,ge,se;if(!I.value||!o.id&&!o.ids)throw console.error("API service or item identifiers are undefined",I.value,o.id,o.ids),new Error("API service or item identifiers are undefined");if(ve?u.value=!0:l.value=!0,c.value=null,!((oe=I.value)!=null&&oe.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const be=await((re=I.value)==null?void 0:re.multipleAssignableUser({workspaceId:String(x),itemIds:(o.ids??(o.id?[o.id]:[])).map(String),page:Q,perPage:kY,q:fe.trim()})),G=((j=bc(be.data))==null?void 0:j.map(pm))??[];_.value=ve?ac(_.value,G,"id"):G,f.value=be.meta.total,h.value=(((ge=be==null?void 0:be.meta)==null?void 0:ge.current_page)||0)<(((se=be==null?void 0:be.meta)==null?void 0:se.last_page)||0),d.value=Q}catch(be){console.error("Error fetching assignable users:",be),c.value="Failed to load assignable users"}finally{l.value=!1,u.value=!1}},E=()=>{!u.value&&h.value&&F(d.value+1,p.value,!0)},A=Tr(async Q=>{p.value=Q,await F(1,Q,!1)},ai),k=()=>F(1,p.value,!1);rn(()=>{var Q;(Q=N.value)==null||Q.focus()}),t({getValue:()=>{var Q;return(Q=D.value.find(fe=>fe.selected))==null?void 0:Q.value},refresh:k,clearInternal:()=>{T.value=[]},focus:()=>{var Q;(Q=N.value)==null||Q.focus()}});const O=()=>{const Q=En.getInstance().getItem("BASE_URL"),fe=co({type:"access_setting",config:{baseDomain:Q,ws_code:o.workspaceId,entity_id:x}}).url;window.open(fe,"_blank")},N=B(null);rn(()=>{mt(()=>{var Q;(Q=N.value)==null||Q.focus()})}),et([()=>o.id,()=>o.workspaceId],()=>{F()},{deep:!0,immediate:!0});const W=Q=>{var ve;const fe=En.getInstance().getItem("ws.code");return((ve=I.value)==null?void 0:ve.getUserInformation(fe,Q))||Promise.resolve(null)},X=async(Q,fe,ve)=>{fe.preventDefault(),fe.stopPropagation(),fe.stopImmediatePropagation(),H("update-start");try{const oe=await w(Q);if(console.log("handleUpdateItem",oe),oe)H("update-completed");else throw new Error("Failed to update assignees")}catch(oe){H("update-failed"),console.error("Error updating assignees:",oe)}},ee=async()=>{try{H("update-start");const Q=await S();if(console.log("handleUnAssignAll",Q),Q)H("update-completed");else throw new Error("Failed to unassign all assignees")}catch(Q){H("update-failed"),console.error("Error unassigning all assignees:",Q)}finally{}},ie=async Q=>{try{H("update-start");const fe=await b(Q);if(console.log("handleReplaceAssignees",fe),fe)H("update-completed");else throw new Error("Failed to replace assignees")}catch(fe){H("update-failed"),console.error("Error replacing assignees:",fe)}finally{}},ae=()=>{var Q,fe;i("cancel"),(fe=(Q=o.params)==null?void 0:Q.api)==null||fe.stopEditing()};Xr("popupAttachRef",N);const J=B(),V=B(!1),H=(Q,fe)=>{switch(Q){case"updated":console.log("Emitting updated event with params:",fe),i("updated",fe);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed");break}};return rn(()=>{mt(()=>{setTimeout(()=>{V.value=!0},50)})}),(Q,fe)=>(K(),ce("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:J},[pe(Qi,Kt({"selected-id":U(T)},{...o},{options:U(D),loading:l.value,ref_key:"popupRef",ref:N,"loading-more":u.value,"has-more":h.value,onSelect:fe[0]||(fe[0]=(ve,oe)=>{X(ve,oe)}),"data-wrapper":"true",onSearch:U(A),onLoadMore:E,onCancel:ae,onClose:ae}),th({"extra-item":me(({isEmpty:ve,isLoading:oe})=>[!ve&&!oe?(K(),Ke(tS,{key:0,onClick:ee,actived:!1,label:"Unassign"},{icon:me(()=>[pe(lt,{src:"UserXMark",source:"remote"})]),_:1})):Je("",!0)]),item:me(({item:ve,selectedIndex:oe,isSelected:re,handleItemHover:j,getHighlightedLabel:ge,query:se,idx:be,focused:G})=>[pe(NA,{user:ve.data,"multiple-select":!0,"append-to":J.value,isMe:!1,hover:be===oe,selected:re(ve),focused:G,onClick:Pt(Z=>X(ve,Z,"click"),["stop","prevent"]),onMouseover:Z=>j(be),"api-update-function":W},{name:me(()=>[se?qe((K(),ce("span",{key:0,class:te([Q.$style["item-label"],Q.$style.match]),style:{flex:"1"},innerHTML:ge(ve.label)},null,10,AY)),[[U(s),{content:ve.label}]]):qe((K(),ce("span",{key:1,class:te(Q.$style["item-label"]),style:{flex:"1"}},[st(Ct(ve.label),1)],2)),[[U(s),{content:ve.label}]])]),actions:me(()=>[qe((K(),Ke(vt,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:Pt(Z=>{var de;return ie((de=ve.data)==null?void 0:de.id)},["stop"])},{default:me(()=>[pe(lt,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[U(s),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":me(()=>[Re("div",{class:te(Q.$style["empty-state"])},[fe[3]||(fe[3]=st(" No assignee available. ",-1)),fe[4]||(fe[4]=Re("br",null,null,-1)),pe(vt,{onClick:O,variant:["tertiary"],size:"small"},{default:me(()=>[...fe[2]||(fe[2]=[st(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[c.value?{name:"error",fn:me(()=>[Re("div",{class:te(Q.$style["error-message"])},[st(Ct(c.value)+" ",1),pe(vt,{onClick:k,size:"small"},{default:me(()=>[...fe[1]||(fe[1]=[st(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_nv6on_1","item-assignee":"_item-assignee_nv6on_6","item-action":"_item-action_nv6on_6","item-label":"_item-label_nv6on_16","error-message":"_error-message_nv6on_25","empty-state":"_empty-state_nv6on_35","skeleton-avatar":"_skeleton-avatar_nv6on_48"}}]]),OY={key:0,class:"inner"},tf=_t(it({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const s=e,o=B(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:u,show:c}=Fs({toggleOnClick:!0,zIndex:2,disabled:s.disabled,placement:"top",appendTo:o.value||void 0}),d=B(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=ao({isShow:!1,isRender:!1});rn(()=>{var C;const v=d.value instanceof HTMLElement?d.value:(C=d.value)==null?void 0:C.$el;v&&v.addEventListener("keydown",h)}),Ss(()=>{var C;const v=d.value instanceof HTMLElement?d.value:(C=d.value)==null?void 0:C.$el;v&&v.removeEventListener("keydown",h)});const p=n,g=(v,C)=>{f.isShow=v,f.isRender=C};return et(()=>a.value,(v,C)=>{v&&v!==C&&mt(()=>{g(!0,!0)}),p("onVisibleChange",v,C)}),t({hide:()=>{l(),g(!1,!0)},isVisible:a,open:()=>{c(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),et(f,v=>{console.log("Popup visibility changed:",v)},{deep:!0}),(v,C)=>(K(),ce("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:o},[Re("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[Tt(v.$slots,"trigger",{isVisible:U(a),hide:U(l),disabled:s.isUpdating||s.disabled,popupRef:U(i),triggerRef:U(r),toggle:U(u)},void 0,!0)],512),Re("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?qe((K(),ce("div",OY,[Tt(v.$slots,"popup",{isVisible:U(a),hide:U(l),popupRef:U(i),triggerRef:U(r),toggle:U(u),open:U(c)},void 0,!0)],512)),[[Ko,!s.isUpdating&&!s.disabled&&f.isShow]]):Je("",!0)],512)],512))}}),[["__scopeId","data-v-ede22ac9"]]),MY=it({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;Xr("bulkUpdate",!0);const s=B(!1),o=t,r=B(null),i=()=>{var d;(d=l.value)==null||d.hide(),s.value=!0,o("update-start")},a=d=>{var h,f;console.log("Update completed with success:",d),s.value=!1,d?(o("update-completed"),(h=l.value)==null||h.destroy()):(o("update-failed"),(f=l.value)==null||f.open())},l=B(null),u=d=>{var h;console.log("Updating assignees with params:",d),o("update",d),(h=r.value)==null||h.clearInternal()},c=(d,h)=>{mt(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return et(()=>n.ids,()=>{mt(()=>{var d;(d=l.value)==null||d.destroy()})}),(d,h)=>(K(),Ke(tf,{ref_key:"wrapperRef",ref:l,isUpdating:s.value,disabled:n.disabled||s.value,onOnVisibleChange:c},{trigger:me(({hide:f,disabled:p})=>[pe(vt,{variant:n.variant,loading:s.value,disabled:p,onEscape:f},{default:me(()=>[pe(lt,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=st(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:me(({hide:f})=>[pe(LA,Kt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:u,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0)),onCancel:f}),null,16,["ids","onCancel"])]),default:me(()=>[h[3]||(h[3]=st(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),nf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],NY=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),Wa=(e,t)=>{const n=s=>{var o,r;if(s.key==="Tab"){const i=s.shiftKey||s.metaKey;s.preventDefault(),s.stopImmediatePropagation(),s.stopPropagation();const a=document.activeElement,l=(o=a==null?void 0:a.dataset)==null?void 0:o.index;if(l){let u=nf.indexOf(l);const c=i?-1:1;for(const d of nf){u=(u+c+nf.length)%nf.length;const h=nf[u],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(s.key==="Enter")(r=s.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(s.key==="Escape"){s.stopPropagation(),s.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(NY.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},LY=["aria-label"],VY=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],BY={style:{flex:"1"}},$Y=_t(it({__name:"MainCalendar",props:eD({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:eD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const s=Qt,o=B(null),r=e,i=Y(()=>r.startDate&&r.endDate),a=JH(e,"tracingCase"),l=n,u=B(r.year),c=B(r.month);et(()=>[r.year,r.month],([V,H])=>{u.value=V,c.value=H});const d=Y(()=>bt.fromObject({year:u.value,month:c.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),h=Y(()=>bt.now().setZone(r.timezone)),f=Y(()=>r.startDate?bt.fromJSDate(r.startDate,{zone:r.timezone}):null),p=Y(()=>r.endDate?bt.fromJSDate(r.endDate,{zone:r.timezone}):null),g=B(f.value),v=B(p.value),C=B(f.value),S=B(p.value);et([f,p],()=>{r.requireConfirm||(g.value=f.value,v.value=p.value,C.value=f.value,S.value=p.value)},{immediate:!0});const b=Y(()=>r.requireConfirm?g.value:f.value),w=Y(()=>r.requireConfirm?v.value:p.value);et(()=>r.activeField,V=>{const H=V==="start"?b.value:w.value;H&&(u.value=H.year,c.value=H.month)}),et(()=>{var V,H;return[(V=b.value)==null?void 0:V.toISODate(),(H=w.value)==null?void 0:H.toISODate(),r.activeField]},()=>{const V=r.activeField==="start"?b.value:w.value;V&&(V.year!==u.value||V.month!==c.value)&&(u.value=V.year,c.value=V.month)});function _(V){return V.setZone("utc")}const D=B("");function T(V){D.value=V.toISODate()||"",mt(()=>{const H=document.querySelector(`.arbo-calendar-day[data-date="${D.value}"]`);H==null||H.focus()})}et(()=>{var V,H;return[u.value,c.value,r.activeField,(V=b.value)==null?void 0:V.toISODate(),(H=w.value)==null?void 0:H.toISODate()]},()=>{const V=r.activeField==="start"?b.value:w.value;let H;V&&V.year===u.value&&V.month===c.value?H=V:b.value&&b.value.year===u.value&&b.value.month===c.value?H=b.value:H=h.value,T(H)});function I(V){return V.toFormat("d")}const x=Y(()=>{const V=bt.fromObject({year:u.value,month:c.value,day:1},{zone:r.timezone}),H=V.weekday,Q=r.weekStart===1?(H+6)%7:H%7;let fe=V.minus({days:Q});const ve=[],oe=wc.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),re=mg();for(let ge=0;ge<42;ge++){const se=[];fe.month!==c.value&&se.push(re["is-outside"]),fe.hasSame(h.value,"day")&&se.push(re["is-today"]),b.value&&fe.hasSame(b.value,"day")&&se.push(re["is-selected-start"]),w.value&&fe.hasSame(w.value,"day")&&se.push(re["is-selected-end"]),b.value&&w.value&&fe>b.value&&fe<w.value&&se.push(re["is-in-range"]);const be=I(fe),G=oe[fe.weekday-1]||"";ve.push({dt:fe,iso:fe.toISODate()||"",label:fe.toFormat("d"),displayLabel:be,weekdayLabel:G,aria:fe.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:se}),fe=fe.plus({days:1})}const j=[];for(let ge=0;ge<6;ge++)j.push(ve.slice(ge*7,ge*7+7));return j}),F=Y(()=>{const V=wc.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?V:[V[6],...V.slice(0,6)]});function E(V,H,Q){const fe=V==="start"?H.startOf("day"):H.endOf("day"),ve=_(fe),oe={year:fe.year,month:fe.month,day:fe.day,utc:ve.toISO()||""};V==="start"?(l("select-start",oe,Q??!0),l("select-start-utc",oe.utc)):(l("select-end",oe),l("select-end-utc",oe.utc))}function A(V){let H=u.value,Q=c.value+V;for(;Q<1;)Q+=12,H-=1;for(;Q>12;)Q-=12,H+=1;u.value=H,c.value=Q,l("update:year",H),l("update:month",Q)}function k(V){const Q=(D.value?bt.fromISO(D.value,{zone:r.timezone}):h.value).plus({days:V});Q.month===c.value&&Q.year===u.value&&T(Q)}function O(V=!1){const Q=(D.value?bt.fromISO(D.value,{zone:r.timezone}):h.value).weekday%7,fe=V?6-Q:-Q;k(fe)}const N=V=>{W(V)};function W(V){switch(V.preventDefault(),V.stopPropagation(),V.key){case"ArrowLeft":V.preventDefault(),k(-1);break;case"ArrowRight":V.preventDefault(),k(1);break;case"ArrowUp":V.preventDefault(),k(-7);break;case"ArrowDown":V.preventDefault(),k(7);break;case"Home":V.preventDefault(),O(!1);break;case"End":V.preventDefault(),O(!0);break;case"PageUp":V.preventDefault(),A(V.shiftKey?-12:-1);break;case"PageDown":V.preventDefault(),A(V.shiftKey?12:1);break;case"Enter":case" ":{V.preventDefault();const H=D.value?bt.fromISO(D.value,{zone:r.timezone}):h.value,Q=x.value.flat().find(fe=>fe.iso===H.toISODate());Q&&ee(Q);break}}}const X=V=>{const H=bt.now().setZone(r.timezone);u.value=H.year,c.value=H.month,l("update:year",H.year),l("update:month",H.month),T(H),l("gotoToday")};function ee(V){var de,Ae;const H=!!f.value,Q=!!p.value,fe=r.activeField,ve=((de=f.value)==null?void 0:de.toISODate())||"null",oe=((Ae=p.value)==null?void 0:Ae.toISODate())||"null",re=V.dt.toISODate()||"",j=(Fe,Le)=>{a.value={case:Fe,behavior:Le}},ge=()=>`Selected start ${re} > existing end ${oe} -> reset both to ${re}`,se=()=>`Selected end ${re} < existing start ${ve} -> reset both to ${re}`,be=()=>{E("start",V.dt,!0),E("end",V.dt),l("update:activeField","end")},G=(Fe=!1)=>{E("start",V.dt,Fe),Fe&&l("update:activeField","end")},Z=(Fe=!1)=>{E("end",V.dt),Fe&&l("close")};if(H&&Q){fe==="start"?p.value&&V.dt>p.value?(be(),j("INVERT_RANGE_FROM_START",ge())):(G(!1),j("UPDATE_START_IN_RANGE",`Updated start from ${ve} to ${re}; end remains ${oe}`)):f.value&&V.dt<f.value?(be(),j("INVERT_RANGE_FROM_END",se())):(Z(!1),j("UPDATE_END_IN_RANGE",`Updated end from ${oe} to ${re}; start remains ${ve}`));return}if(!H&&Q&&fe==="start"&&p.value&&V.dt>p.value){be(),j("CREATE_RANGE_FROM_LATE_START",ge());return}if(H&&!Q&&fe==="end"&&f.value&&V.dt<f.value){be(),j("CREATE_RANGE_FROM_EARLY_END",se());return}if(!H&&!Q){if(fe==="start"){G(!0),j("INIT_START",`Picked start ${re}; awaiting end selection`);return}Z(r.immediatelyUpdate),j("INIT_END",`Picked end ${re}; awaiting start selection`);return}if(!H&&Q){if(fe==="start"){G(!0),j("FILL_MISSING_START",`Inserted start ${re}; existing end ${oe}`);return}Z(!1),j("STRICT_UPDATE_END_ONLY",`Updated end to ${re}; start still null`);return}if(H&&!Q){if(fe==="start"){G(!0),j("RESELECT_START_BEFORE_END",`Replaced start with ${re}; end still null, switching to end`);return}Z(r.immediatelyUpdate),j("FILL_MISSING_END",`Picked end ${re}; start ${ve}`);return}}function ie(){C.value=g.value,S.value=v.value,l("confirm")}function ae(){g.value=C.value,v.value=S.value,l("cancel")}function J(){mt(()=>{var V;(V=o.value)==null||V.focus()})}return rn(()=>{J()}),t({focus:J}),(V,H)=>(K(),ce("div",{ref_key:"calendarRef",ref:o,class:te([V.$style["arbo-calendar"],{[V.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[Re("div",{class:te([V.$style["arbo-calendar-header"],V.$style["arbo-calendar-week"]]),role:"row"},[(K(!0),ce(xt,null,xn(F.value,Q=>(K(),ce("div",{key:Q,class:te(V.$style["arbo-calendar-weekday"]),role:"columnheader"},Ct(Q),3))),128))],2),Re("div",{class:te(V.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:H[0]||(H[0]=Pt(Q=>U(Wa)(Q,N),["prevent","stop"]))},[(K(!0),ce(xt,null,xn(x.value,(Q,fe)=>(K(),ce("div",{key:fe,class:te(V.$style["arbo-calendar-week"])},[(K(!0),ce(xt,null,xn(Q,ve=>(K(),ce("div",{key:ve.iso,class:te([V.$style["arbo-calendar-day"],ve.classes,{[V.$style["is-focused"]]:ve.iso===D.value}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":ve.aria,"data-date":ve.iso,"data-weekday":ve.weekdayLabel,tabindex:ve.iso===D.value?0:-1,onClick:oe=>ee(ve)},Ct(ve.displayLabel),11,VY))),128))],2))),128))],34),r.readOnly?Je("",!0):(K(),ce("div",{key:0,class:te(V.$style["arbo-calendar-actions"])},[Re("div",BY,[qe((K(),Ke(vt,{variant:"secondary",size:"medium",onClick:H[1]||(H[1]=Q=>X()),onKeydown:U(Wa),"data-index":"today-btn"},{prefix:me(()=>[pe(lt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[U(s),"Today"]])]),pe(vt,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:U(Wa),variant:"secondary",size:"medium",onClick:ae,"data-index":"cancel-btn"},{default:me(()=>[st(Ct(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),pe(vt,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:U(Wa),onClick:ie},{default:me(()=>[st(Ct(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,LY))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_1a7wo_1","arbo-calendar-day":"_arbo-calendar-day_1a7wo_2","arbo-calendar-week":"_arbo-calendar-week_1a7wo_3","arbo-calendar":"_arbo-calendar_1a7wo_2","arbo-calendar-nav":"_arbo-calendar-nav_1a7wo_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_1a7wo_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_1a7wo_53","arbo-calendar-weekday":"_arbo-calendar-weekday_1a7wo_58","arbo-calendar-weeks":"_arbo-calendar-weeks_1a7wo_63","is-today":"_is-today_1a7wo_92","is-selected-start":"_is-selected-start_1a7wo_97","is-selected-end":"_is-selected-end_1a7wo_105","is-outside":"_is-outside_1a7wo_125","is-focused":"_is-focused_1a7wo_128","is-in-range":"_is-in-range_1a7wo_133","arbo-calendar-actions":"_arbo-calendar-actions_1a7wo_139","arbo-calendar-btn":"_arbo-calendar-btn_1a7wo_147",cancel:"_cancel_1a7wo_156",confirm:"_confirm_1a7wo_161"}}]]),HY=["onClick"],GY=["variant","onClick"],UY=_t(it({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const s=e,o=Y(()=>{if(s.monthLabels&&s.monthLabels.length===12)return s.monthLabels;const k=s.locale||"en-US",O=s.monthLabelStyle||"short",N=new Intl.DateTimeFormat(k,{month:O,timeZone:"UTC"});return Array.from({length:12},(X,ee)=>N.format(new Date(Date.UTC(2020,ee,1))))}),r=n,i=B(s.year),a=B(s.month),l=B(s.year);et(()=>s.year,k=>{k!==i.value&&(i.value=k,l.value=k)}),et(()=>s.month,k=>{k!==a.value&&(a.value=k)});const u=B("days");function c(k){u.value!==k&&(u.value=k,r("mode-change",k))}const d=Y(()=>s.minYear),h=Y(()=>s.maxYear),f=Y(()=>{const k=s.yearSpan;return l.value-l.value%k}),p=Y(()=>f.value+s.yearSpan-1);function g(){const k=s.yearSpan,O=f.value-k;O>=d.value&&(l.value=O)}function v(){const k=s.yearSpan,O=f.value+k;O<=h.value&&(l.value=O)}const C=Y(()=>f.value-s.yearSpan<d.value),S=Y(()=>p.value+s.yearSpan>h.value),b=Y(()=>{const k=s.yearSpan;return Math.ceil(k/3)});function w(k){const N=f.value+(k-1)*3;return Array.from({length:3},(W,X)=>N+X).filter(W=>W<=p.value)}function _(){u.value==="months"?c("days"):c("months")}function D(){u.value==="years"?c("days"):c("years")}function T(k){i.value=k,l.value=k,r("update:year",k),r("year-selected",k),c("months")}function I(k){a.value=k,r("update:month",k),r("month-selected",k),c("days")}function x(){if(u.value==="days"){let k=i.value,O=a.value-1;if(O<1&&(O=12,k--),k<d.value)return;i.value=k,a.value=O,r("update:year",k),r("update:month",O)}else if(u.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else u.value==="years"&&g()}function F(){if(u.value==="days"){let k=i.value,O=a.value+1;if(O>12&&(O=1,k++),k>h.value)return;i.value=k,a.value=O,r("update:year",k),r("update:month",O)}else if(u.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else u.value==="years"&&v()}const E=Y(()=>u.value==="days"?i.value===d.value&&a.value===1:u.value==="months"?i.value-1<d.value:C.value),A=Y(()=>u.value==="days"?i.value===h.value&&a.value===12:u.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(k,O)=>{i.value=k,a.value=O}}),(k,O)=>(K(),ce("div",{class:te([k.$style["cal-nav-wrapper"]])},[Tt(k.$slots,"selection"),u.value==="days"?(K(),ce("div",{key:0,class:te(k.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[pe(vt,{variant:"tertiary",class:te([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Previous",disabled:E.value,label:"",onClick:x,"data-index":"prev-btn",onKeydownCapture:zn(Pt(x,["prevent","stop"]),["enter"]),onKeydown:U(Wa)},{default:me(({hovered:N})=>[pe(lt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),Re("div",{class:te(k.$style["cal-nav-center"])},[pe(vt,{"data-index":"month-btn",variant:"secondary",onClick:_,onKeydown:U(Wa)},{default:me(()=>[st(Ct(o.value[a.value-1]),1)]),_:1},8,["onKeydown"]),pe(vt,{variant:"secondary",onClick:D,"data-index":"year-btn",onKeydown:U(Wa)},{default:me(()=>[st(Ct(i.value),1)]),_:1},8,["onKeydown"])],2),pe(vt,{"data-index":"next-btn",variant:"tertiary",class:te([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:A.value,label:"",onClick:F,onKeydownCapture:zn(Pt(F,["prevent","stop"]),["enter"]),onKeydown:U(Wa)},{default:me(({hovered:N})=>[pe(lt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Je("",!0),u.value==="years"?(K(),ce("div",{key:1,class:te(k.$style["year-grid"])},[Re("div",{class:te(k.$style["year-grid-header"])},[pe(vt,{variant:"tertiary",class:te([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Next",disabled:C.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:me(({hovered:N})=>[pe(lt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),Re("div",{class:te(k.$style["range-label"])},Ct(f.value)+" - "+Ct(p.value),3),pe(vt,{variant:"tertiary",class:te([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:me(({hovered:N})=>[pe(lt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),Re("div",{class:te(k.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(K(!0),ce(xt,null,xn(b.value,N=>(K(),ce("div",{key:"yr-row-"+N,class:te(k.$style["year-grid-row"])},[(K(!0),ce(xt,null,xn(w(N),W=>(K(),ce("a",{key:W,tabindex:"0",class:te([k.$style["year-cell"],{[k.$style.selected]:W===i.value}]),onClick:X=>T(W)},Ct(W),11,HY))),128))],2))),128))],2)],2)):u.value==="months"?(K(),ce("div",{key:2,class:te(k.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[Re("div",{class:te(k.$style.months)},[(K(!0),ce(xt,null,xn(o.value,(N,W)=>(K(),ce("a",{tabindex:"0",key:N,variant:W+1===a.value?"primary":"text",class:te([k.$style["month-cell"],{[k.$style.selected]:W+1===a.value}]),onClick:X=>I(W+1)},Ct(N),11,GY))),128))],2)],2)):(K(),ce("div",{key:3,class:te(k.$style["days-slot"])},[Tt(k.$slots,"default",{year:i.value,month:a.value,mode:u.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_unh71_1","cal-nav-bar":"_cal-nav-bar_unh71_12","cal-nav-btn":"_cal-nav-btn_unh71_20",prev:"_prev_unh71_33","year-grid-header":"_year-grid-header_unh71_37","cal-nav-center":"_cal-nav-center_unh71_46","cal-nav-label":"_cal-nav-label_unh71_52","month-grid":"_month-grid_unh71_66","year-grid":"_year-grid_unh71_37",months:"_months_unh71_75","month-cell":"_month-cell_unh71_82","year-cell":"_year-cell_unh71_83","pg-btn":"_pg-btn_unh71_105","year-grid-body":"_year-grid-body_unh71_118","year-grid-row":"_year-grid-row_unh71_125",selected:"_selected_unh71_131","days-slot":"_days-slot_unh71_137","range-label":"_range-label_unh71_141"}}]]);function WY(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:s,maxDate:o}=e,r=B(""),i=Y(()=>{const g=bt.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=Y(()=>{if(!s||!i.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const C=new Date(g.year,g.month-1,g.day),S=new Date(v.year,v.month-1,v.day);return C<S?-1:C>S?1:0},u=Y(()=>{if(!o||!i.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),c=Y(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&u.value),d=Y(()=>r.value.length===t.length&&c.value);return{inputValue:r,isValid:c,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=bt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>c.value?i.value:null}}const zY={key:0,style:{marginLeft:"8px"}},jY=["disabled","readonly","placeholder"],VA=_t(it({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=n,i=B(null),a=B(null),{isValid:l,isComplete:u,inputValue:c,clear:d,setDate:h,getDate:f}=WY({format:o.format,allowPastDates:o.allowPastDates,allowFutureDates:o.allowFutureDates,timezone:o.timezone,minDate:o.minDate,maxDate:o.maxDate}),p=Y(()=>o.active),g=Y(()=>({disabled:o.disabled,error:!l.value&&c.value.length>0,readOnly:o.readOnly,isEmpty:c.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:C,isFocus:S}=vs(g),b=I=>{var F;const x=(F=I.clipboardData)==null?void 0:F.getData("text/plain");x&&(c.value=x.trim())},w=I=>{if(I.key==="Escape"){r("blur"),I.target.blur(),I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation();return}else I.key==="Tab"&&T(I)},_=()=>{d(),r("clear")};t({clear:_,setDate:h,getDate:f,focus:()=>{var I;return(I=i.value)==null?void 0:I.focus()}}),et(()=>o.modelValue,I=>{I?h(I):d()},{immediate:!0}),et([()=>u.value,()=>c.value],()=>{if(c.value.length===0)r("complete",null);else if(l.value&&!o.readOnly&&!o.disabled&&u.value){const I=f();(I||c.value.length===0)&&r("complete",I)}}),et(()=>l.value,I=>{I||r("invalid","")});const D=Y(()=>!!o.isMultipleDate),T=I=>{I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation(),r("tab",I)};return(I,x)=>(K(),Ke(ys,Kt(U(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:me(()=>[Re("div",{class:te([I.$style["date-input-wrapper"]])},[D.value?(K(),ce("span",zY," Multiple ")):qe((K(),ce("input",{key:1,disabled:o.disabled,readonly:o.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":x[0]||(x[0]=F=>gn(c)?c.value=F:null),onPaste:Pt(b,["prevent"]),placeholder:o.placeholder,class:te([I.$style["date-input"]]),onKeydown:w},null,42,jY)),[[mT,U(c)]]),Tt(I.$slots,"clear",{handleClear:_},()=>[(U(c).length>0||D.value)&&!o.readOnly&&!o.disabled&&(U(C)||U(S))?qe((K(),Ke(vt,{key:0,variant:["icon","primary"],onClick:Pt(_,["stop"]),size:16,rounded:!0},{default:me(()=>[pe(lt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[U(s),"Clear"]]):(K(),Ke(lt,{key:1,src:"Calendar",source:"remote",class:te(I.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_1yset_1","icon-calendar":"_icon-calendar_1yset_9",focus:"_focus_1yset_12",hover:"_hover_1yset_12",active:"_active_1yset_12","date-input":"_date-input_1yset_1",invalid:"_invalid_1yset_38"}}]]),KY=it({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:yb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const s=B({case:"",behavior:""}),o=e,r=B(null),i=n,a=async(j,ge)=>{i("start-update"),await j(),i("finish-update"),mt(()=>{var se,be;ge(),(be=(se=o.params)==null?void 0:se.api)==null||be.stopEditing()})},l=(j,ge)=>{j(),mt(()=>{var se,be;ge(),(be=(se=o.params)==null?void 0:se.api)==null||be.stopEditing()})},u=()=>{var ge;const j=bt.now().setZone(o.timezone);H.value=j.year,Q.value=j.month,(ge=V.value)==null||ge.setNavigation(j.year,j.month)},c=ao({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:C,beginInteraction:S,clearStart:b,clearDue:w}=F7(o,i),_=Y(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});et(()=>o.multipleStartDates,j=>{h.value=!!j},{immediate:!0}),et(()=>o.multipleDueDates,j=>{f.value=!!j},{immediate:!0});const D=B(null),T=B(null),I=j=>{j.preventDefault(),j.stopImmediatePropagation(),j.stopPropagation(),ie()},x=()=>{var j;(j=T.value)==null||j.focus()},F=j=>{if(!j){c.start=!1,b();return}const ge=d.endDate?bt.fromJSDate(d.endDate,{zone:o.timezone}):null;if(ge&&E(j,ge)>0){const be={year:j.year,month:j.month,day:j.day};c.start=!1,C(be,!1),p(be),mt(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const se={year:j.year,month:j.month,day:j.day};c.start=!1,C(se,!0)},E=(j,ge)=>{const se=j.startOf("day"),be=ge.startOf("day");return se<be?-1:se>be?1:0},A=j=>{var ge;j.preventDefault(),j.stopImmediatePropagation(),j.stopPropagation(),(ge=document.querySelector('[data-index="prev-btn"]'))==null||ge.focus()},k=j=>{if(!j){c.end=!1,w();return}const ge=d.startDate?bt.fromJSDate(d.startDate,{zone:o.timezone}):null;if(ge&&E(j,ge)<0){const be={year:j.year,month:j.month,day:j.day};c.end=!1,C(be),p(be),mt(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const se={year:j.year,month:j.month,day:j.day};c.end=!1,p(se)},O=()=>{h.value=!1,b()},N=()=>{f.value=!1,w()},W=()=>{ae()},X=Y(()=>d.isSelectingStart||d.isSelectingEnd);function ee(){o.disabled||o.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,mt(()=>{var j;(j=r.value)==null||j.focus()}))}function ie(){o.disabled||o.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,mt(()=>{var j;(j=D.value)==null||j.focus()}))}function ae(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function J(j){j.key==="Escape"?(j.stopPropagation(),ae()):j.key=="Tab"&&i("tab",j)}const V=B(null),H=B(new Date().getFullYear()),Q=B(new Date().getMonth()+1);et(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(H.value=d.startDate.getFullYear(),Q.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(H.value=d.endDate.getFullYear(),Q.value=d.endDate.getMonth()+1)},{immediate:!0});const fe=B(null);function ve(){if(Array.isArray(o.value)){const[ge,se]=o.value;d.startDate=ge||null,d.endDate=se||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const j=d.startDate||d.endDate||new Date;H.value=j.getFullYear(),Q.value=j.getMonth()+1}et(()=>{var j,ge,se,be,G,Z,de,Ae;return[((se=(ge=(j=o.value)==null?void 0:j[0])==null?void 0:ge.getTime)==null?void 0:se.call(ge))||((be=o.value)==null?void 0:be[0]),((de=(Z=(G=o.value)==null?void 0:G[1])==null?void 0:Z.getTime)==null?void 0:de.call(Z))||((Ae=o.value)==null?void 0:Ae[1]),o.timezone,o.format,o.placeholder,o.enableRangeFeedback]},()=>{ve()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ve,openStart:ee,openEnd:ie,closePicker:ae,clearAll:W,isOpen:X,drpRef:fe,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?ee():ie():ee()}});const re=B(null);return et(()=>X.value,j=>{if(o.disabled||o.readOnly)return;const ge=re.value;ge&&(j?ge.show():ge.hide())},{immediate:!0}),(j,ge)=>(K(),ce("div",{class:te(j.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:T,onKeydown:J,tabindex:"1","data-index":"calendar-wrapper"},[pe(UY,{year:H.value,"onUpdate:year":ge[6]||(ge[6]=se=>H.value=se),month:Q.value,"onUpdate:month":ge[7]||(ge[7]=se=>Q.value=se),locale:o.locale,disabled:o.disabled,readOnly:o.readOnly,ref_key:"navigationRef",ref:V},{selection:me(()=>[Re("div",{class:te(j.$style["calendar-input-section"])},[pe(VA,{ref_key:"starDateRef",ref:r,"model-value":U(d).startDate,placeholder:o.startPlaceholder,timezone:o.timezone,active:U(d).isSelectingStart,onClick:ee,onClear:O,onComplete:F,onInvalid:ge[0]||(ge[0]=se=>c.start=!0),disabled:o.disabled,readOnly:o.readOnly,onBlur:x,onTab:I},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),pe(VA,{ref_key:"endDateRef",ref:D,"model-value":U(d).endDate,placeholder:o.duePlaceholder,timezone:o.timezone,active:U(d).isSelectingEnd,onClick:ie,onClear:N,disabled:o.disabled,onComplete:k,onInvalid:ge[1]||(ge[1]=se=>c.end=!0),readOnly:o.readOnly,isMultipleDate:U(f),onTab:A},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:me(({year:se,month:be})=>[pe($Y,{disabled:o.disabled,disableConfirm:c.end||c.start,readOnly:o.readOnly,ref_key:"drpRef",ref:fe,"tracing-case":s.value,"onUpdate:tracingCase":ge[2]||(ge[2]=G=>s.value=G),year:se,month:be,"start-date":U(d).startDate,"end-date":U(d).endDate,"active-field":_.value,timezone:o.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:U(C),onSelectEnd:U(p),onGotoToday:u,onConfirm:ge[3]||(ge[3]=()=>{a(U(v),ae)}),onCancel:ge[4]||(ge[4]=G=>l(U(g),ae)),onClose:ge[5]||(ge[5]=G=>a(U(v),ae))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),Pm=_t(KY,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_1wull_1","calendar-input-section":"_calendar-input-section_1wull_11","display-wrapper":"_display-wrapper_1wull_19","calendar-actions":"_calendar-actions_1wull_23","clear-all-btn":"_clear-all-btn_1wull_29"}}]]),qY=it({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,s=e,o=_n("isSelectAll",B(!1)),r=_n("bulkUpdate",B(!1)),i=Y(()=>!!s.entityId&&r.value&&o.value),{apiServices:a}=ts(!r.value,s),l=_n("filterParams",null),u=B(null),c=async I=>{var x,F,E,A;try{w.value=!0,n("update-start");let k={workspaceId:s.workspaceId,entityId:s.entityId,itemIds:s.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in I&&(k.startDate=I.start?fm(I.start):null),"end"in I&&(k.dueDate=I.end?fm(I.end):null),i.value?(k.itemIds=void 0,k.entityId=s.entityId):k.entityId=void 0,await((F=(x=a.value)==null?void 0:x.changeDate)==null?void 0:F.call(x,k)),n("updated",{workspaceId:s.workspaceId,itemIds:s.ids,data:k}),n("update-completed"),(E=u.value)==null||E.hide()}catch(k){console.error("Failed to update dates:",k),mt(()=>{mt(()=>{var O;n("update-failed"),(O=u.value)==null||O.open()})})}finally{(A=S.value)==null||A.resetCalendarLogic(),w.value=!1}},d=()=>{if(!s.rowSelected||s.rowSelected.length===0){h();return}s.rowSelected.length===1?f():p()},h=()=>{C.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const x=s.rowSelected[0].dateRange;b.value=[(x==null?void 0:x[0])??null,(x==null?void 0:x[1])??null],C.value=!1,v.value=!1},p=()=>{var x,F;if(s.rowSelected.some(E=>E.dateRange&&(E.dateRange[0]!==null||E.dateRange[1]!==null))){const E=g(0),A=g(1);if(v.value=E,C.value=A,E)b.value[0]=null;else{const k=((x=s.rowSelected[0].dateRange)==null?void 0:x[0])??null;b.value[0]=k}if(A)b.value[1]=null;else{const k=((F=s.rowSelected[0].dateRange)==null?void 0:F[1])??null;b.value[1]=k}}else v.value=!1,C.value=!1,b.value=[null,null]},g=I=>{const x=s.rowSelected.map(E=>{var A;return(A=E.dateRange)==null?void 0:A[I]});return x.length===0?!1:new Set(x.map(E=>{var A;return(A=E==null?void 0:E.getTime)==null?void 0:A.call(E)})).size>1},v=B(!1),C=B(!1),S=B(null),b=B([null,null]);et([()=>s.ids,()=>s.rowSelected],I=>{d(),mt(()=>{var x;(x=S.value)==null||x.focus()})},{immediate:!0,deep:!0});const w=B(!1),_=()=>{w.value=!0},D=()=>{mt(()=>{setTimeout(()=>{w.value=!1},500)})},T=(I,x)=>{I&&mt(()=>{var F;(F=S.value)==null||F.focus()})};return(I,x)=>(K(),Ke(tf,{ref_key:"wrapperRef",ref:u,isUpdating:w.value,disabled:s.disabled||w.value,onOnVisibleChange:T},{trigger:me(({hide:F,disabled:E})=>[pe(vt,{variant:s.variant,loading:w.value,disabled:E,onEscape:F},{default:me(()=>[pe(lt,{src:"Calendar"}),x[0]||(x[0]=st(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:me(({isVisible:F,hide:E})=>[F?(K(),Ke(Pm,{key:0,immediatelyUpdate:!1,value:b.value,onConfirmed:c,ref_key:"calendarRef",ref:S,onClosed:E,onStartUpdate:_,onFinishUpdate:D,multipleDueDates:C.value,multipleStartDates:v.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Je("",!0)]),default:me(()=>[x[1]||(x[1]=st(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),YY=e=>{if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"},BA=Ql("metricStore",()=>{const e=B();return{metricList:e,setMetricList:s=>{e.value=s},checkEditType:s=>{var o;if(((o=s==null?void 0:s.auth_permission)==null?void 0:o.permission)==2)return YY(s)}}}),ZY=["onKeydown"],XY=["width","height","viewBox"],JY=["d"],QY="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",$A=it({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(s.modelValue??0),i=B(null),a=Y(()=>{var E;return((E=s.params)==null?void 0:E.size)??24}),l=Y(()=>{var E;return((E=s.params)==null?void 0:E.iconViewBox)??"0 0 24 24"}),u=Y(()=>{var E;return((E=s.params)==null?void 0:E.iconPath)??QY}),c=Y(()=>{var E;return((E=s.params)==null?void 0:E.wrapperTag)??"span"}),d=Y(()=>{var E;return s.disabled||((E=s.params)==null?void 0:E.disabled)||!1}),h=Y(()=>{var E;return s.readOnly||((E=s.params)==null?void 0:E.readOnly)||!1}),f=Y(()=>!d.value&&!h.value),p=Y(()=>d.value?"not-allowed":h.value?"default":"pointer");et(()=>s.modelValue,E=>{typeof E=="number"&&E!==r.value&&(r.value=E)});const g=E=>{var A;return((A=s.params)==null?void 0:A.maxRating)-E+1<=r.value&&!v.value},v=B(!1),C=()=>{v.value=!0},S=()=>{v.value=!1},b=E=>{f.value&&w(E)},w=E=>{var k,O;if(!f.value)return;let A=((k=s.params)==null?void 0:k.maxRating)-E+1;A===r.value&&(A=0),r.value=A,o("update:modelValue",A),o("update",A),o("change",A),(O=s.params)!=null&&O.onUpdate&&s.params.onUpdate(A)},_=E=>{var A;E!==r.value&&(r.value=E,o("update:modelValue",E),o("update",E),o("change",E),(A=s.params)!=null&&A.onUpdate&&s.params.onUpdate(E),D.value=E)},D=B(r.value),T=E=>{E.preventDefault(),E.stopPropagation(),E.stopImmediatePropagation(),r.value=D.value,o("cancel")},I=E=>{E.preventDefault(),_(r.value),o("handleEnter",r.value)},x=()=>{f.value&&(r.value=Math.min(r.value+1%(s.params.maxRating+1),s.params.maxRating),_(r.value))},F=()=>{f.value&&(r.value=Math.max(r.value-1,0),_(r.value))};return t({focus:()=>{var E;(E=i.value)==null||E.focus()}}),(E,A)=>(K(),ce("div",{class:te(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:dn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[zn(Pt(F,["prevent"]),["left"]),zn(Pt(x,["prevent"]),["right"]),zn(Pt(F,["prevent"]),["down"]),zn(Pt(x,["prevent"]),["up"]),zn(Pt(I,["prevent"]),["enter"]),zn(Pt(I,["prevent"]),["tab"]),zn(Pt(T,["prevent"]),["escape"])]},[(K(!0),ce(xt,null,xn(e.params.maxRating,k=>(K(),Ke(yw(c.value),{key:k,class:te(["rating-item",{filled:g(k),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:dn({cursor:p.value,order:e.params.maxRating-k,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(k),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-k+1,tabindex:-1,onClick:Pt(O=>b(k),["prevent","stop"]),onMouseenter:C,onMouseleave:S},{default:me(()=>[Tt(E.$slots,"icon",{index:k,filled:g(k),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:k},()=>[(K(),ce("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[Re("path",{d:u.value},null,8,JY)],8,XY))]),Tt(E.$slots,"overlay",{index:k,filled:g(k),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,ZY))}}),eZ={style:{maxWidth:"180px",lineHeight:"15px"}},tZ=["innerHTML"],HA=it({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=n,i=()=>{r("handleCancel")},a=()=>{r("close")},l=v=>{var C;if(v.format_type==="dropdown"&&v.format_value)try{const S=JSON.parse(v.format_value);if(Array.isArray(S)){const b=S.map(w=>({label:w.name,value:w.name,id:w.name}));return b.unshift({label:"-",value:void 0,id:"-"}),b}}catch(S){console.error("Failed to parse dropdown options",S)}if(v.format_type=="number"&&v.restricted_type=="exact"){const S=((C=v.restricted_value)==null?void 0:C.split(",").map(b=>({label:v.mapping[`!${b}`]||b,value:b,id:b})))||[];return S.unshift({label:"-",value:void 0,id:"-"}),S}return[]},u=Y(()=>l(o.config)),c=B(o.modelValue),d=v=>{c.value=v,r("update:modelValue",v),r("change",v||null)},h=B(u.value),f=B(!1),p=v=>{f.value=!0,v?h.value=u.value.filter(C=>C.label.toLowerCase().includes(v.toLowerCase())):h.value=u.value,setTimeout(()=>{f.value=!1},300)},g=B(null);return rn(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,C)=>(K(),Ke(Qi,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:C[0]||(C[0]=S=>d(S.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:i},{item:me(({item:S,getHighlightedLabel:b,selectedIndex:w,index:_})=>[pe(eu,{hover:w==_,selected:S.value===e.modelValue,label:S.label,onSelect:D=>d(S.value||null),onClick:D=>d(S.value||null)},{label:me(()=>[Re("div",eZ,[qe(Re("span",{innerHTML:b(S.label)},null,8,tZ),[[U(s),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":me(()=>[...C[1]||(C[1]=[st("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),nZ={class:"metric-input-wrapper"},sZ={key:0,class:"error-text input-2"},GA=it({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=B(o.modelValue),i=B(o.modelValue),a=B(!1),l=B(!0),u=B(""),c=Y(()=>{var N;const O=Number.parseInt(String((N=o.config)==null?void 0:N.format_value)||"2",10);return Number.isFinite(O)&&O>=0?O:2}),d=O=>{if(!O)return O;const N=String(O).split(".");return N.length>1&&N[1].length>c.value?c.value===0?N[0]:`${N[0]}.${N[1].slice(0,c.value)}`:String(O)},h=O=>{const N=d(O);N!==O&&b.value?r.value=N:r.value=O},f=O=>{const N=O.target;if(!N)return;const W=N.value||"",X=W.indexOf(".");if(O.key==="."&&c.value===0){O.preventDefault();return}X!==-1&&/[0-9]/.test(O.key)&&W.slice(X+1).length>=c.value&&O.preventDefault()},p=Y(()=>l.value||o.showInlineError?{content:""}:{content:u.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var J;const O=o.config.restricted_type.trim(),N=((J=o.config.restricted_value)==null?void 0:J.split(",").map(Number))||[],[W,X]=N,ie={range:`Enter a value between ${W} and ${X}`,not:`These values are not allowed: ${N.join(", ")}`,exact:"Value is not allowed"}[O];return l.value?"":ie},v=Y(()=>{var N;let O="";return Number((N=o.config)==null?void 0:N.format_value)&&(O+="."+Array.from({length:Number(o.config.format_value)}).map(()=>"0").join("")),`0${O}`});et(()=>o.modelValue,O=>{r.value=O,i.value=O});const C=O=>cm(o.config,O),S=n,b=B(null),w=O=>{const N=O===""?null:O,W=i.value===""?null:i.value;return N!==W},_=O=>{const N=d(O);if(!w(N))return!1;const W=N===""?null:N;return r.value=W,i.value=W,S("update:modelValue",W),S("handleChange",W),!0},D=()=>{r.value=i.value,S("update:modelValue",i.value)},T=(O,N)=>{_(O),S("enter")},I=(O,N)=>{if(a.value){a.value=!1;return}o.saveOnBlur?_(O):D()},x=O=>{if(O===null||O===""){l.value=!0;return}l.value=cm(o.config,Number(O)),u.value=l.value?"":g()},F=(O,N)=>{a.value=!0,o.saveOnEscape?_(O):D(),S("cancel"),setTimeout(()=>{a.value=!1},100)},E=O=>{x(O),S("onValidation",O)},A=()=>{a.value=!0,D(),S("cancel"),setTimeout(()=>{a.value=!1},100)},k=()=>{var O;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(O=b.value)==null||O.focus()};return t({focus:()=>{var O;return(O=b.value)==null?void 0:O.focus()},blur:()=>{var O;return(O=b.value)==null?void 0:O.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>_(r.value),revert:D}),rn(()=>{var O;(O=b.value)==null||O.focus()}),(O,N)=>qe((K(),ce("div",nZ,[pe(Qb,{maxDecimalChar:c.value,modelValue:r.value,"onUpdate:modelValue":N[0]||(N[0]=W=>r.value=W),placeholder:v.value,validatorFnc:C,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:T,onBlur:I,onClear:k,onEscape:F,onCancel:A,onOnValidation:E,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(K(),ce("span",sZ,Ct(u.value),1)):Je("",!0)])),[[U(s),p.value]])}}),oZ={key:2},rZ={class:"wrapper-suffix"},iZ={key:3},aZ=_t(it({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=B(null),i=B(0),a=B(null),l=B(null),u=Y(()=>IF(o.config)),c=B(!1),d=Y(()=>!!fe.value),h=n,f=()=>{c.value=!1,Q(),h("cancel")},p=B(!0),g=re=>{if(re===null||re===""){p.value=!0;return}if(u.value!=="number"){p.value=!0;return}p.value=cm(o.config,Number(re)),C.value=S()},v=()=>{c.value=!0,X()},C=B(""),S=()=>{var de;const re=o.config.restricted_type.trim(),j=((de=o.config.restricted_value)==null?void 0:de.split(",").map(Number))||[],[ge,se]=j,G={range:`Enter a value between ${ge} and ${se}`,not:`These values are not allowed: ${j.join(", ")}`,exact:"Value is not allowed"}[re];return p.value?"":G},b=Y(()=>{var j;const re=Number.parseInt(String((j=o.config)==null?void 0:j.format_value)||"2",10);return Number.isFinite(re)&&re>=0?re:2}),w=re=>{c.value=!0,r.value=re},_=()=>{c.value=!0,Q(),X()},D=re=>{i.value=re,c.value=!0,X()},T=()=>(o.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(j=>j.charAt(0).toUpperCase()+j.slice(1)).join("").replace(/Outline|Solid/g,""),I=B(null),x=B(!0),F=Y(()=>{var re;return{disabled:o.disabled,error:!1,readOnly:!1,isEmpty:((re=r.value)==null?void 0:re.length)===0,wrapperRef:V,active:d,focus:o.focus,bordered:!0}}),E=B(null),A=Y(()=>x.value),k=Y(()=>({disabled:o.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:E,active:A,focus:x.value,bordered:!0})),{argsMain:O}=vs(k),{argsMain:N}=vs(F),W=B(null),X=()=>{mt(()=>{var re;(re=W.value)==null||re.focus()})},ee=re=>{var j;if(re.format_type==="dropdown"&&re.format_value)try{const ge=JSON.parse(re.format_value);if(Array.isArray(ge))return ge.map(se=>({label:se.name,value:se.name,id:se.name}))}catch(ge){console.error("Failed to parse dropdown options",ge)}return re.format_type=="number"&&re.restricted_type=="exact"?((j=re.restricted_value)==null?void 0:j.split(",").map(se=>({label:re.mapping[`!${se}`]||se,value:se,id:se})))||[]:[]},ie=Y(()=>ee(o.config)),ae=Y(()=>{var re;return((re=ie.value.find(j=>j.value===r.value))==null?void 0:re.label)||r.value||"-"}),J=()=>{var re;if(u.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(u.value=="number"){const j=(re=l.value)==null?void 0:re.getValue();h("updateMetric",j||null)}else h("updateMetric",r.value||null);c.value=!1,Q()},{triggerRef:V,popupRef:H,hide:Q,isVisible:fe,show:ve}=Fs({toggleOnClick:!0,appendTo:()=>o.attachTo||"parent",zIndex:1e4,offset:[0,0]}),oe=()=>{switch(u.value){case"number":mt(()=>{var re;(re=l.value)==null||re.focus()});break;case"dropdown":ve(),mt(()=>{var re;(re=I.value)==null||re.focus()});break;case"rating":x.value=!0,mt(()=>{var re;(re=a.value)==null||re.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,c.value=!1},focus:oe,hasChanges:()=>c.value}),rn(()=>{mt(()=>{setTimeout(()=>{oe()},300)})}),(re,j)=>(K(),ce("div",{class:te(re.$style["metric-editor"])},[u.value=="number"?(K(),Ke(GA,{key:0,config:o.config,modelValue:r.value,"onUpdate:modelValue":j[0]||(j[0]=ge=>r.value=ge),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:w,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):u.value=="rating"?(K(),Ke(ys,Kt({key:1,"tab-index":1},U(O),{ref_key:"triggerRef2",ref:E,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:me(()=>[pe($A,{params:{maxRating:o.config.range},modelValue:i.value,"onUpdate:modelValue":j[1]||(j[1]=ge=>i.value=ge),onHandleEnter:D,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:me(()=>[pe(lt,{source:"rating",src:T()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):u.value=="dropdown"?(K(),ce("div",oZ,[pe(ys,Kt(U(N),{ref_key:"triggerRef",ref:V,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:me(({})=>[Re("div",rZ,[pe(lt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:me(()=>[qe((K(),ce("span",null,[st(Ct(ae.value||""),1)])),[[U(s),{content:ae.value}]])]),_:1},16),Re("div",{ref_key:"popupRef",ref:H},[U(fe)?(K(),Ke(HA,{key:0,ref_key:"metricEditorDropdownRef",ref:I,config:o.config,modelValue:r.value,"onUpdate:modelValue":j[2]||(j[2]=ge=>r.value=ge),onChange:_,onCancel:f},null,8,["config","modelValue"])):Je("",!0)],512)])):(K(),ce("span",iZ,"Formular")),qe((K(),Ke(vt,{ref_key:"confirmButtonRef",ref:W,onHandleClick:J,"tab-index":"1",onKeypress:[zn(Pt(oe,["shift","prevent"]),["tab"]),zn(Pt(f,["prevent"]),["escape"])],disabled:!p.value},{default:me(()=>[pe(lt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[U(s),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),lZ=_t(it({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=n,i=B(!1),a=B(null),l=B(null),u=()=>{i.value=!i.value},c=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await mt(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:o.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),r("loseFocus")},p=g=>{const C={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),r("focusOnSearch",g)},Tab:()=>{i.value&&c()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];C&&C()};return et(i,g=>{g&&r("open")}),t({hide:c,show:d}),(g,v)=>(K(),ce("div",{class:te([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[Re("div",{class:te(g.$style["metric-label"]),onClick:Pt(u,["stop"])},[Tt(g.$slots,"default",{open:i.value},()=>[qe((K(),ce("span",{class:te(g.$style["metric-name"])},[st(Ct(e.label),1)],2)),[[U(s),{content:e.label}]]),e.morpheme&&i.value?(K(),ce("small",{key:0,class:te(g.$style["metric-morpheme"])}," ("+Ct(e.morpheme)+") ",3)):Je("",!0)])],2),pe(jD,{mode:"out-in",name:"slide"},{default:me(()=>[i.value?(K(),Ke(aZ,{key:`editor-${e.config.id}`,"read-only":!1,focus:i.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Je("",!0)]),_:1})],34))}}),[["__cssModules",{$style:{"metric-item":"_metric-item_18ft8_1","metric-label":"_metric-label_18ft8_11",open:"_open_18ft8_19","metric-name":"_metric-name_18ft8_23","metric-morpheme":"_metric-morpheme_18ft8_29"}}]]);var kc=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(kc||{});function UA(e,t){return function(){return e.apply(t,arguments)}}const{toString:uZ}=Object.prototype,{getPrototypeOf:nS}=Object,{iterator:Am,toStringTag:WA}=Symbol,km=(e=>t=>{const n=uZ.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kr=e=>(e=e.toLowerCase(),t=>km(t)===e),Om=e=>t=>typeof t===e,{isArray:Oc}=Array,Mc=Om("undefined");function sf(e){return e!==null&&!Mc(e)&&e.constructor!==null&&!Mc(e.constructor)&&ho(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zA=kr("ArrayBuffer");function cZ(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zA(e.buffer),t}const dZ=Om("string"),ho=Om("function"),jA=Om("number"),of=e=>e!==null&&typeof e=="object",hZ=e=>e===!0||e===!1,Mm=e=>{if(km(e)!=="object")return!1;const t=nS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(WA in e)&&!(Am in e)},fZ=e=>{if(!of(e)||sf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},pZ=kr("Date"),gZ=kr("File"),mZ=kr("Blob"),vZ=kr("FileList"),yZ=e=>of(e)&&ho(e.pipe),wZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ho(e.append)&&((t=km(e))==="formdata"||t==="object"&&ho(e.toString)&&e.toString()==="[object FormData]"))},CZ=kr("URLSearchParams"),[bZ,SZ,EZ,_Z]=["ReadableStream","Request","Response","Headers"].map(kr),RZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,o;if(typeof e!="object"&&(e=[e]),Oc(e))for(s=0,o=e.length;s<o;s++)t.call(null,e[s],s,e);else{if(sf(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(s=0;s<i;s++)a=r[s],t.call(null,e[a],a,e)}}function KA(e,t){if(sf(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,o;for(;s-- >0;)if(o=n[s],t===o.toLowerCase())return o;return null}const tu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qA=e=>!Mc(e)&&e!==tu;function sS(){const{caseless:e,skipUndefined:t}=qA(this)&&this||{},n={},s=(o,r)=>{const i=e&&KA(n,r)||r;Mm(n[i])&&Mm(o)?n[i]=sS(n[i],o):Mm(o)?n[i]=sS({},o):Oc(o)?n[i]=o.slice():(!t||!Mc(o))&&(n[i]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&rf(arguments[o],s);return n}const DZ=(e,t,n,{allOwnKeys:s}={})=>(rf(t,(o,r)=>{n&&ho(o)?e[r]=UA(o,n):e[r]=o},{allOwnKeys:s}),e),TZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),IZ=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},xZ=(e,t,n,s)=>{let o,r,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),r=o.length;r-- >0;)i=o[r],(!s||s(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&nS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},FZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},PZ=e=>{if(!e)return null;if(Oc(e))return e;let t=e.length;if(!jA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},AZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&nS(Uint8Array)),kZ=(e,t)=>{const s=(e&&e[Am]).call(e);let o;for(;(o=s.next())&&!o.done;){const r=o.value;t.call(e,r[0],r[1])}},OZ=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},MZ=kr("HTMLFormElement"),NZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,o){return s.toUpperCase()+o}),YA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),LZ=kr("RegExp"),ZA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};rf(n,(o,r)=>{let i;(i=t(o,r,e))!==!1&&(s[r]=i||o)}),Object.defineProperties(e,s)},VZ=e=>{ZA(e,(t,n)=>{if(ho(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(ho(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},BZ=(e,t)=>{const n={},s=o=>{o.forEach(r=>{n[r]=!0})};return Oc(e)?s(e):s(String(e).split(t)),n},$Z=()=>{},HZ=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function GZ(e){return!!(e&&ho(e.append)&&e[WA]==="FormData"&&e[Am])}const UZ=e=>{const t=new Array(10),n=(s,o)=>{if(of(s)){if(t.indexOf(s)>=0)return;if(sf(s))return s;if(!("toJSON"in s)){t[o]=s;const r=Oc(s)?[]:{};return rf(s,(i,a)=>{const l=n(i,o+1);!Mc(l)&&(r[a]=l)}),t[o]=void 0,r}}return s};return n(e,0)},WZ=kr("AsyncFunction"),zZ=e=>e&&(of(e)||ho(e))&&ho(e.then)&&ho(e.catch),XA=((e,t)=>e?setImmediate:t?((n,s)=>(tu.addEventListener("message",({source:o,data:r})=>{o===tu&&r===n&&s.length&&s.shift()()},!1),o=>{s.push(o),tu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ho(tu.postMessage)),jZ=typeof queueMicrotask<"u"?queueMicrotask.bind(tu):typeof q<"u"&&q.nextTick||XA,Be={isArray:Oc,isArrayBuffer:zA,isBuffer:sf,isFormData:wZ,isArrayBufferView:cZ,isString:dZ,isNumber:jA,isBoolean:hZ,isObject:of,isPlainObject:Mm,isEmptyObject:fZ,isReadableStream:bZ,isRequest:SZ,isResponse:EZ,isHeaders:_Z,isUndefined:Mc,isDate:pZ,isFile:gZ,isBlob:mZ,isRegExp:LZ,isFunction:ho,isStream:yZ,isURLSearchParams:CZ,isTypedArray:AZ,isFileList:vZ,forEach:rf,merge:sS,extend:DZ,trim:RZ,stripBOM:TZ,inherits:IZ,toFlatObject:xZ,kindOf:km,kindOfTest:kr,endsWith:FZ,toArray:PZ,forEachEntry:kZ,matchAll:OZ,isHTMLForm:MZ,hasOwnProperty:YA,hasOwnProp:YA,reduceDescriptors:ZA,freezeMethods:VZ,toObjectSet:BZ,toCamelCase:NZ,noop:$Z,toFiniteNumber:HZ,findKey:KA,global:tu,isContextDefined:qA,isSpecCompliantForm:GZ,toJSONObject:UZ,isAsyncFn:WZ,isThenable:zZ,setImmediate:XA,asap:jZ,isIterable:e=>e!=null&&ho(e[Am])};function qt(e,t,n,s,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status?o.status:null)}Be.inherits(qt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const JA=qt.prototype,QA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{QA[e]={value:e}}),Object.defineProperties(qt,QA),Object.defineProperty(JA,"isAxiosError",{value:!0}),qt.from=(e,t,n,s,o,r)=>{const i=Object.create(JA);Be.toFlatObject(e,i,function(c){return c!==Error.prototype},u=>u!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return qt.call(i,a,l,n,s,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",r&&Object.assign(i,r),i};const KZ=null;function oS(e){return Be.isPlainObject(e)||Be.isArray(e)}function ek(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function tk(e,t,n){return e?e.concat(t).map(function(o,r){return o=ek(o),!n&&r?"["+o+"]":o}).join(n?".":""):t}function qZ(e){return Be.isArray(e)&&!e.some(oS)}const YZ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function Nm(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Be.isUndefined(v[g])});const s=n.metaTokens,o=n.visitor||c,r=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(Be.isDate(p))return p.toISOString();if(Be.isBoolean(p))return p.toString();if(!l&&Be.isBlob(p))throw new qt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(p)||Be.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,g,v){let C=p;if(p&&!v&&typeof p=="object"){if(Be.endsWith(g,"{}"))g=s?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&qZ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(C=Be.toArray(p)))return g=ek(g),C.forEach(function(b,w){!(Be.isUndefined(b)||b===null)&&t.append(i===!0?tk([g],w,r):i===null?g:g+"[]",u(b))}),!1}return oS(p)?!0:(t.append(tk(v,g,r),u(p)),!1)}const d=[],h=Object.assign(YZ,{defaultVisitor:c,convertValue:u,isVisitable:oS});function f(p,g){if(!Be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Be.forEach(p,function(C,S){(!(Be.isUndefined(C)||C===null)&&o.call(t,C,Be.isString(S)?S.trim():S,g,h))===!0&&f(C,g?g.concat(S):[S])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function nk(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function rS(e,t){this._pairs=[],e&&Nm(e,this,t)}const sk=rS.prototype;sk.append=function(t,n){this._pairs.push([t,n])},sk.toString=function(t){const n=t?function(s){return t.call(this,s,nk)}:nk;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function ZZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ok(e,t,n){if(!t)return e;const s=n&&n.encode||ZZ;Be.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let r;if(o?r=o(t,n):r=Be.isURLSearchParams(t)?t.toString():new rS(t,n).toString(s),r){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class rk{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(s){s!==null&&t(s)})}}const ik={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},XZ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:rS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},iS=typeof window<"u"&&typeof document<"u",aS=typeof navigator=="object"&&navigator||void 0,JZ=iS&&(!aS||["ReactNative","NativeScript","NS"].indexOf(aS.product)<0),QZ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",eX=iS&&window.location.href||"http://localhost",Gs={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:iS,hasStandardBrowserEnv:JZ,hasStandardBrowserWebWorkerEnv:QZ,navigator:aS,origin:eX},Symbol.toStringTag,{value:"Module"})),...XZ};function tX(e,t){return Nm(e,new Gs.classes.URLSearchParams,{visitor:function(n,s,o,r){return Gs.isNode&&Be.isBuffer(n)?(this.append(s,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}function nX(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function sX(e){const t={},n=Object.keys(e);let s;const o=n.length;let r;for(s=0;s<o;s++)r=n[s],t[r]=e[r];return t}function ak(e){function t(n,s,o,r){let i=n[r++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=r>=n.length;return i=!i&&Be.isArray(o)?o.length:i,l?(Be.hasOwnProp(o,i)?o[i]=[o[i],s]:o[i]=s,!a):((!o[i]||!Be.isObject(o[i]))&&(o[i]=[]),t(n,s,o[i],r)&&Be.isArray(o[i])&&(o[i]=sX(o[i])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(s,o)=>{t(nX(s),o,n,0)}),n}return null}function oX(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const af={transitional:ik,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",o=s.indexOf("application/json")>-1,r=Be.isObject(t);if(r&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return o?JSON.stringify(ak(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return tX(t,this.formSerializer).toString();if((a=Be.isFileList(t))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Nm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return r||o?(n.setContentType("application/json",!1),oX(t)):t}],transformResponse:[function(t){const n=this.transitional||af.transitional,s=n&&n.forcedJSONParsing,o=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(s&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?qt.from(a,qt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gs.classes.FormData,Blob:Gs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{af.headers[e]={}});const rX=Be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),iX=e=>{const t={};let n,s,o;return e&&e.split(`
142
+ This will fail in production.`);i=Zl,i._s.has(e)||(o?Kb(e,t,s,i):AA(e,s,i),q.env.NODE_ENV!=="production"&&(r._pinia=i));const u=i._s.get(e);if(q.env.NODE_ENV!=="production"&&a){const c="__hot:"+e,d=o?Kb(c,t,s,i,!0):AA(c,or({},s),i,!0);a._hotUpdate(d),delete i.state.value[c],i._s.delete(c)}if(q.env.NODE_ENV!=="production"&&Xi){const c=es();if(c&&c.proxy&&!a){const d=c.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=u}}return u}return r.$id=e,r}function Js(e){const t=Lt(e),n={};for(const s in t){const o=t[s];o.effect?n[s]=Y({get:()=>e[s],set(r){e[s]=r}}):(gn(o)||zo(o))&&(n[s]=qr(e,s))}return n}const qb=Ql("permissionStore",()=>{const e=B([]),t=B(),n=B({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),uY="woohoo_getWoohooUserInterface_read",Yb="media_getReviewUserInterface_read",cY="update_getUpdateUserInterface_read",kA="Unarchive parent folder first to continue",dY=(e,t,n,s,o,r)=>{const i=qb(),{userPermissions:a}=Js(i),l=Y(()=>{const I=En.getInstance().getItem("BASE_URL"),x=En.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:F,entity_id:E,scene_id:A}=e.value;return{baseDomain:I||"",ws_code:F||"",entity_id:E||"",scene_id:A||"",reviewDomain:x||"",take_id:E||"",woohoo_id:E||"",parent_id:E||""}}),u=Y(()=>{var x;const I=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(Yb),canCopyLink:!0,canRename:(I==null?void 0:I.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(Yb),canOpenTakeInUpdate:a.value.includes(cY),canOpenTakeInWoohoo:a.value.includes(uY),canDeleteRendition:((x=I==null?void 0:I.media)==null?void 0:x.has_delete_rendition_permission)??!1,canDeleteThumbnail:(I==null?void 0:I.has_edit_thumbnail_permission)??!1,canArchiveScene:I==null?void 0:I.has_archive_permission,canUnarchiveScene:I==null?void 0:I.has_archive_permission,canDeleteScene:(I==null?void 0:I.has_delete_permission)??!1}}),c=Y(()=>({project:co({type:"project",config:l.value}).url,take_review:co({type:"review_take",config:l.value}).url,review:co({type:"review_scene",config:l.value}).url,review_scene:co({type:"review_scene",config:l.value}).url,woohoo:co({type:"woohoo",config:l.value}).url,update:co({type:"update",config:l.value}).url,scene_hub:co({type:"scene_hub",config:l.value}).url})),d=(I,x)=>{const F=I.metaKey||I.ctrlKey,E=c.value[x]||"";if(E){if(x==="scene_hub"){if(F){window.open(E,"_blank");return}if(!s){console.error("Switch instance not found.",{openSceneHub:s,windowFunc:globalThis.window.$switchInstance});return}s(l.value.scene_id||"");return}F?window.open(E,"_blank"):window.location.href=E}},h=async(I,x)=>{var F;try{const E=await((F=e.value.axiosService.value)==null?void 0:F.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(E==null?void 0:E.message)!="Done"&&console.error("Failed to delete rendition.")}catch(E){console.error("Error deleting rendition",E)}finally{o()}},f=async(I,x)=>{var F;try{await((F=e.value.axiosService.value)==null?void 0:F.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(E){console.error("Error deleting thumbnail",E)}finally{o()}},p=async(I,x)=>{var F;try{const E=await((F=e.value.axiosService.value)==null?void 0:F.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(E==null?void 0:E.message)!="Done"&&console.error("Failed to archive scene."),x&&x("archived")}catch(E){console.error("Error archiving item",E)}finally{o()}},g=async(I,x)=>{var F;try{const E=await((F=e.value.axiosService.value)==null?void 0:F.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(E==null?void 0:E.message)!="Done"&&console.error("Failed to delete scene."),x&&x("deleted")}catch(E){console.error("Error deleting item",E)}finally{o()}},v=I=>{const x=c.value.scene_hub||"";x&&(_.value="Copied",navigator.clipboard.writeText(x),setTimeout(()=>{_.value="Copy link"},5e3))},C=async(I,x)=>{var F;try{const E=await((F=e.value.axiosService.value)==null?void 0:F.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(E==null?void 0:E.message)!="Done"&&console.error("Failed to unarchive scene."),x&&x("unarchived")}catch(E){console.error("Error unarchiving item",E)}finally{o()}},S=I=>p(I,t),b=I=>C(I,t),w=I=>g(I,t),_=B("Copy link"),D=I=>d(I,"review"),T=Y(()=>{let I=[];if(!l.value.scene_id&&e.value.optionBlock&&I.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const x=()=>Math.random().toString(36).substring(2,9);return[{id:x(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:D,hide:!u.value.canOpenReview,disabled:!u.value.canOpenReview,description:"",type:"icon"},{id:x(),label:_.value,icon:"Link",action:v,hide:!u.value.canCopyLink,disabled:!u.value.canCopyLink,description:"",type:"icon"}]},{id:x(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:u.value.canArchiveScene==0,disabled:u.value.canArchiveScene!==1,description:u.value.canArchiveScene==-1?kA:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:u.value.canUnarchiveScene==0,disabled:u.value.canUnarchiveScene!==1,description:u.value.canUnarchiveScene===-1?kA:"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:w,hide:!u.value.canDeleteScene,type:"icon"}]}]});return{linkMap:c,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:C,options:T}};function vs(e){const t=B(!1),n=B(!1),s=Y(()=>{var d;const u=e.value,c=!!u.readOnly;return{readOnly:c,disabled:!!u.disabled,hovered:n.value,focused:t.value,isEmpty:u.empty??!1,error:!!u.error,actived:!!((d=u.active)!=null&&d.value),clickable:c?!1:u.clickable??!1}}),o=()=>{t.value=!0,mt(()=>{const u=l(e.value.inputRef);u==null||u.focus()})},r=()=>{t.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1},l=u=>{if(!u)return null;const c=u.value||u;return(c instanceof HTMLElement?c:c==null?void 0:c.$el)||null};return rn(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.addEventListener("focus",o),u.addEventListener("blur",r)),c&&(c.addEventListener("mouseenter",i),c.addEventListener("mouseleave",a))}),Ss(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.removeEventListener("focus",o),u.removeEventListener("blur",r)),c&&(c.removeEventListener("mouseenter",i),c.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:s,handleFocus:o}}const Fc=e=>{const t=B(!1),n=Y(()=>t.value);return rn(()=>{var a,l,u,c;const s=(a=e.params)==null?void 0:a.api,o=(l=e.params)==null?void 0:l.node,r=o==null?void 0:o.rowIndex,i=(c=(u=e.params)==null?void 0:u.colDef)==null?void 0:c.field;return s==null||s.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),s==null||s.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},OA=_t(it({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:void 0},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=To,{triggerRef:n,popupRef:s}=Fs({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),o=Y(()=>{switch(r.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),r=e;return(i,a)=>(K(),ce("div",{class:te(i.$style["status-badge-wrapper"]),style:dn({"--badge-size":`${r.size}px`,"--badge-color":o.value})},[Tt(i.$slots,"default"),qe(Re("div",{class:te(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ko,r.showBadge],[U(t),{isLoading:r.loading,fullwidth:!0}]]),Re("div",{ref_key:"popupRef",ref:s,class:te(i.$style["badge-tooltip"])},Ct(r.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),Qh=Ql("switchStore",()=>{const e=B(null),t=_n("switchInstance");return{openSceneHub:(o,r)=>{if(o){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:o,commentId:r},{showLoading:!1}):t("scene_hub",{id:o,tab:"home"},{showLoading:!1})}},openPeopleInsight:o=>{const r=t||e.value;if(!r)throw console.error("Switch instance not found"),new Error("Switch instance not found");o||console.trace("No people_id provided, defaulting to empty string"),r("people_insight",{tab:"home",id:o||""},{showLoading:!1})},switchInstanceFunc:e}}),hY=it({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:um()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1},showPrivateUser:{type:Boolean,default:!1}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Qt,s=To,o=e,r=t,i={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=B(new Date),l=B(!0),u=B(!1),c=B(!1),d=B(null);let h=null,f=null;const p=Qh(),{openPeopleInsight:g}=p,v=Y(()=>!o.private&&!u.value),C=Y(()=>{var N,W;return((N=d.value)==null?void 0:N.display_name)??((W=o.user)==null?void 0:W.name)}),S=Y(()=>{var N,W;return!v.value||!d.value?o.status:(N=d.value.private_info)!=null&&N.is_offline?"offline":(W=d.value.private_info)!=null&&W.last_active?"active":"away"}),b=Y(()=>{const N=S.value;return N?i[N]:""}),w=Y(()=>{var N,W;return((W=(N=d.value)==null?void 0:N.private_info)==null?void 0:W.timezone)??o.timezone}),_=Y(()=>{if(!w.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:w.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",w.value),""}}),D=Y(()=>{var N,W,X;return{id:o.user.id,name:C.value,initial:((N=d.value)==null?void 0:N.initial)??o.user.initial,profile_image:((W=d.value)==null?void 0:W.profile_image)??o.user.profile_image,color:((X=d.value)==null?void 0:X.color)??o.user.color,size:72,borderRadius:"8px"}}),T=Y(()=>{const N=globalThis.location.origin,W=En.getInstance().getItem("ws.code")||"";return co({type:"people_insight",config:{ws_code:W,baseDomain:N,user_id:o.user.id}}).url}),{copyToClipboard:I,tooltip:x}=FF(T.value,()=>r("copyLink",o.user.id)),F=async()=>{if(!o.apiUpdateFunction){l.value=!1;return}try{const N=await o.apiUpdateFunction(o.user.id);N?(d.value=N,r("dataUpdated",N)):(u.value=!0,c.value=!0,r("dataUpdated",null))}catch(N){u.value=!0,c.value=!0,console.error("Failed to fetch user data:",N)}finally{l.value=!1}},E=()=>{A(),o.apiUpdateFunction&&o.enableAutoRefresh&&(f=setInterval(F,o.refreshInterval))},A=()=>{f!==null&&(clearInterval(f),f=null)},k=N=>{if(N.ctrlKey||N.metaKey){window.open(T.value,"_blank");return}try{g(String(o.user.id))}catch{window.open(T.value,"_blank")}},O=N=>{k(N),r("insightClick",o.user.id)};return et([()=>o.enableAutoRefresh,()=>o.refreshInterval,()=>o.apiUpdateFunction],E),rn(async()=>{h=setInterval(()=>{a.value=new Date},1e4),o.apiUpdateFunction?(await F(),E()):l.value=!1}),zu(()=>{h&&clearInterval(h),A()}),(N,W)=>o.showPrivateUser&&(o.private||c.value)?(K(),ce("div",{key:0,class:te([N.$style["info-row"],N.$style["private-badge"]])},[...W[0]||(W[0]=[Re("span",null,"Private User",-1)])],2)):(K(),ce("div",{key:1,class:te([N.$style["mini-people-card"],{[N.$style.loading]:l.value},"bg-skeleton"])},[Re("div",{class:te(N.$style["avatar-section"])},[v.value?(K(),Ke(OA,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":b.value},{default:me(()=>[pe(Dh,Kt({readOnly:!0},D.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(K(),Ke(Dh,Kt({key:1,readOnly:!0},D.value),null,16))],2),Re("div",{class:te(N.$style["user-info"])},[Re("div",{class:te(N.$style["info-column"])},[qe((K(),ce("span",{class:te(N.$style["user-name"])},[st(Ct(C.value),1)],2)),[[U(n),{content:C.value,delay:[1e3,0]}]]),w.value&&v.value?(K(),ce("div",{key:0,class:te([N.$style["info-row"],N.$style["time-row"]])},[qe((K(),ce("div",{class:te(N.$style["time-display"])},[pe(lt,{source:"remote",src:"Globe",class:te(N.$style["clock-icon"]),size:"10"},null,8,["class"]),Re("span",{class:te(N.$style["time-text"])},Ct(_.value)+" ("+Ct(w.value)+")",3)],2)),[[U(s),{isLoading:l.value,fullwidth:!0}]])],2)):Je("",!0)],2),!e.readOnly&&v.value?(K(),ce("div",{key:0,class:te([N.$style["info-row"],N.$style.actions])},[e.showInsightButton?(K(),Ke(vt,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Pt(O,["prevent","stop"]),disabled:o.disabled},null,8,["disabled"])):Je("",!0),e.showCopyLinkButton?qe((K(),Ke(vt,{key:1,variant:["icon","secondary"],size:"small",onClick:Pt(U(I),["prevent","stop"]),disabled:o.disabled},{default:me(()=>[pe(lt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[U(n),{content:U(x),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Je("",!0)],2)):Je("",!0)],2)],2))}}),fY=_t(hY,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_ign8a_1",loading:"_loading_ign8a_25","avatar-section":"_avatar-section_ign8a_28","user-info":"_user-info_ign8a_33","info-column":"_info-column_ign8a_42","info-row":"_info-row_ign8a_50","time-row":"_time-row_ign8a_56","time-display":"_time-display_ign8a_62","time-text":"_time-text_ign8a_70",actions:"_actions_ign8a_79","user-name":"_user-name_ign8a_83","v-enter-active":"_v-enter-active_ign8a_103","v-leave-active":"_v-leave-active_ign8a_104","v-enter-from":"_v-enter-from_ign8a_108","v-leave-to":"_v-leave-to_ign8a_109"}}]]),pY=_t(it({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e,{expose:t}){const n=Wi,s=Qt,o=e,{isEditing:r}=Fc(o),i=()=>{var h,f;const c=(h=o.params)==null?void 0:h.api,d={rowIndex:(f=c==null?void 0:c.getRowNode(String(o.id)))==null?void 0:f.rowIndex,colKey:"options"};c==null||c.startEditingCell(d)},a=Y(()=>{var d,h;const c=(h=(d=o.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(o.id));return((c==null?void 0:c.rowIndex)??0)+10}),l=()=>{var c,d;(d=(c=o.params)==null?void 0:c.api)==null||d.stopEditing()},u=B();return t({focus(){var c;(c=u.value)==null||c.focus()},blur(){var c;(c=u.value)==null||c.blur()}}),(c,d)=>qe((K(),Ke(vt,{class:te(c.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:U(r),onClick:Pt(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:u},{default:me(()=>[pe(lt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[U(s),"More actions"],[U(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_w8s4g_1"}}]]),gY=["src","width","height","alt"],Fm=_t(it({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=To,{getCachedValue:n,setCachedValue:s}=_h({dbName:"visual-cache-db",storeName:"visuals"}),o=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},r=e,i=Y(()=>({minWidth:o(r.minWidth),maxWidth:o(r.maxWidth),minHeight:o(r.minHeight),maxHeight:o(r.maxHeight),aspectRatio:r.ratio,width:o(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await s(h,f)},u=Y(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:c,loading:d}=W1(u,"visual",l,a);return(h,f)=>qe((K(),ce("div",{class:te([h.$style.visualWrapper,{[h.$style.loading]:U(d)}]),style:dn(i.value)},[Re("img",{src:U(c),width:e.size,height:e.size,alt:"visual-"+e.src,style:dn(i.value)},null,12,gY)],6)),[[U(t),{isLoading:U(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),mY=["tabindex"],ys=_t(it({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const s=e,o=n;ng();const r=mg(),i=B(null),a=B("default"),l=Y(()=>{if(typeof s.size=="number")return`${s.size}px`;switch(s.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),u=Y(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),c=Y(()=>({[r["display-wrapper"]]:!0,[r.disabled]:s.disabled,[r.readOnly]:s.readOnly,[r.error]:s.error,[r.clickable]:s.clickable,[r.active]:s.actived,[r.hovered]:s.hovered,[r.focused]:!s.readOnly&&!s.disabled&&s.focused,[r.bordered]:s.bordered})),d=()=>{var w,_;const g=((w=i.value)==null?void 0:w.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((_=i.value)==null?void 0:_.querySelectorAll(":scope > .wrapper-suffix").length)||0,C="var(--icon-size)",b=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${C}) calc(100% - (${g} * ${C} + ${b}))`:!g&&v?`calc(100% - (${v} * ${C} + ${b})) repeat(${v}, ${C})`:g&&v?`repeat(${g}, ${C}) calc(100% - (${g} * ${C} + ${v} * ${C} + ${b})) repeat(${v}, ${C})`:"100%"},h=B("100%"),f=()=>{h.value=d()};eh(()=>{f()}),rn(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{mt(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{o("escape")}}),(g,v)=>(K(),ce("div",{ref_key:"rootEl",ref:i,class:te([U(r)["display-wrapper"],c.value]),tabindex:e.tabIndex,style:dn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":u.value})},[Tt(g.$slots,"prefix",{hovered:s.hovered,focused:s.focused}),Tt(g.$slots,"default",{hovered:s.hovered,focused:s.focused,updateComponentState:p,disabled:s.disabled}),Tt(g.$slots,"suffix",{hovered:s.hovered,focused:s.focused})],14,mY))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_11gbb_1",readOnly:"_readOnly_11gbb_26",bordered:"_bordered_11gbb_29",disabled:"_disabled_11gbb_29",active:"_active_11gbb_29",focused:"_focused_11gbb_29",hovered:"_hovered_11gbb_34",error:"_error_11gbb_38",clickable:"_clickable_11gbb_51",suffix:"_suffix_11gbb_57",prefix:"_prefix_11gbb_58"}}]]),vY=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const yY=Object.prototype.toString,wY=e=>yY.call(e)==="[object Object]",Pc=()=>{};function CY(e,t){function n(...s){return new Promise((o,r)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(o).catch(r)})}return n}function bY(e,t={}){let n,s,o=Pc;const r=l=>{clearTimeout(l),o(),o=Pc};let i;return l=>{const u=Li(e),c=Li(t.maxWait);return n&&r(n),u<=0||c!==void 0&&c<=0?(s&&(r(s),s=void 0),Promise.resolve(l())):new Promise((d,h)=>{o=t.rejectOnCancel?h:d,i=l,c&&!s&&(s=setTimeout(()=>{n&&r(n),s=void 0,d(i())},c)),n=setTimeout(()=>{s&&r(s),s=void 0,d(l())},u)})}}function Zb(e){return Array.isArray(e)?e:[e]}function SY(e,t=200,n={}){return CY(bY(t,n),e)}function EY(e,t,n){return et(e,t,{...n,immediate:!0})}const MA=vY?window:void 0;function ef(e){var t;const n=Li(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Xb(...e){const t=(s,o,r,i)=>(s.addEventListener(o,r,i),()=>s.removeEventListener(o,r,i)),n=Y(()=>{const s=Zb(Li(e[0])).filter(o=>o!=null);return s.every(o=>typeof o!="string")?s:void 0});return EY(()=>{var s,o;return[(s=(o=n.value)===null||o===void 0?void 0:o.map(r=>ef(r)))!==null&&s!==void 0?s:[MA].filter(r=>r!=null),Zb(Li(n.value?e[1]:e[0])),Zb(U(n.value?e[2]:e[1])),Li(n.value?e[3]:e[2])]},([s,o,r,i],a,l)=>{if(!(s!=null&&s.length)||!(o!=null&&o.length)||!(r!=null&&r.length))return;const u=wY(i)?{...i}:i,c=s.flatMap(d=>o.flatMap(h=>r.map(f=>t(d,h,f,u))));l(()=>{c.forEach(d=>d())})},{flush:"post"})}function Jb(e,t,n={}){const{window:s=MA,ignore:o=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!s)return a?{stop:Pc,cancel:Pc,trigger:Pc}:Pc;let l=!0;const u=v=>Li(o).some(C=>{if(typeof C=="string")return Array.from(s.document.querySelectorAll(C)).some(S=>S===v.target||v.composedPath().includes(S));{const S=ef(C);return S&&(v.target===S||v.composedPath().includes(S))}});function c(v){const C=Li(v);return C&&C.$.subTree.shapeFlag===16}function d(v,C){const S=Li(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(w=>w.el===C.target||C.composedPath().includes(w.el))}const h=v=>{const C=ef(e);if(v.target!=null&&!(!(C instanceof Element)&&c(e)&&d(e,v))&&!(!C||C===v.target||v.composedPath().includes(C))){if("detail"in v&&v.detail===0&&(l=!u(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[Xb(s,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),Xb(s,"pointerdown",v=>{const C=ef(e);l=!u(v)&&!!(C&&!v.composedPath().includes(C))},{passive:!0}),i&&Xb(s,"blur",v=>{setTimeout(()=>{var C;const S=ef(e);((C=s.document.activeElement)===null||C===void 0?void 0:C.tagName)==="IFRAME"&&!(S!=null&&S.contains(s.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const _Y=["value","placeholder","disabled","readonly","inputmode","maxlength"],Qb=_t(it({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},maxDecimalChar:{},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const s=Wi,o=Qt,r=e,i=n,a=B(null),l=B(r.modelValue||"");et(l,()=>{i("onValidation",l.value)});const u=B(!1),c=B(r.modelValue||"");et(()=>r.modelValue,V=>{l.value=V||"",c.value=V||""});const d=Y(()=>{var V;return((V=l.value)==null?void 0:V.length)>0}),h={text:V=>V.slice(0,r.maxLength||255),number:V=>{let H=V.replace(/[^\d.-]/g,"");const Q=H.split(".");Q.length>2&&(H=Q[0]+"."+Q.slice(1).join("")),H=H.replace(/-/g,(j,ge)=>ge===0?j:"");const ve=H.startsWith("-")?"-":"",re=H.replace("-","").split(".");return re[0].length>17&&(re[0]=re[0].substring(0,17)),r.maxDecimalChar!==void 0&&re.length>1&&(re[1]=re[1].substring(0,r.maxDecimalChar)),H=ve+re.join("."),H},email:V=>V.replace(/\s/g,"").slice(0,r.maxLength||255),url:V=>V.replace(/\s/g,"").slice(0,r.maxLength||255),tel:V=>V.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},f=V=>{const H=h[r.type];return H?H(V):V},p=SY(V=>{r.autoEmit&&(i("update:modelValue",V),i("input",V))},r.debounceDelay),g=V=>{const H=V;if(r.disabled||r.readOnly){H.preventDefault();return}const Q=H.target,fe=Q.selectionStart||0,ve=l.value,oe=f(Q.value);ve!==oe&&(l.value=oe,i("input",oe),r.autoEmit&&p(oe),Q.value!==oe&&(Q.value=oe,mt(()=>{let re=fe;if(oe.length<Q.value.length)re=fe;else{const j=oe.length-ve.length;re=fe+j}re=Math.max(0,Math.min(re,oe.length)),Q.setSelectionRange(re,re)})))},v=V=>{if(r.disabled||r.readOnly){V.preventDefault();return}u.value=!0;const H=l.value;l.value="",i("update:modelValue",""),i("clear"),H!==""&&i("change",""),V.preventDefault(),V.stopImmediatePropagation(),V.stopPropagation(),mt(()=>{var Q;(Q=a.value)==null||Q.focus(),setTimeout(()=>{u.value=!1},100)})},C=V=>{r.disabled||r.readOnly||(i("focus",V),r.selectOnFocus&&mt(()=>{V.target.select()}))},S=V=>{if(u.value)return;const Q=V.target.value;r.autoEmit||i("update:modelValue",Q),c.value!==Q&&(i("change",Q),c.value=Q),i("blur",Q,V)},b=V=>{setTimeout(()=>{mt(()=>{const Q=V.target.value;i("enter",Q,V),i("enterValue",Q),r.submitOnEnter&&(V.preventDefault(),r.autoEmit||i("update:modelValue",Q),c.value!==Q&&(i("change",Q),c.value=Q))})},1e3)},w=V=>{const H=V.target,Q=H.value;if(i("escape",Q,V),V.preventDefault(),V.stopImmediatePropagation(),V.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&H.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&H.blur()},_=V=>{const Q=V.target.value;i("tab",Q,V),r.autoEmit||(i("update:modelValue",Q),c.value!==Q&&(i("change",Q),c.value=Q))},D=(V,H,Q)=>V===""?!0:V==="."?Q>0:new RegExp(`^\\d{0,${H}}(\\.\\d{0,${Q}})?$`).test(V),T=V=>{if(i("keydown",V),V.key===" "&&V.stopPropagation(),r.type==="number"){if(V.key==="e"||V.key==="E"){V.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(V.key)||V.ctrlKey||V.metaKey||V.altKey)){if(Number.isNaN(Number(V.key))&&V.key!=="."&&V.key!=="-"){V.preventDefault();return}const fe=l.value+V.key;if(!D(fe,17,r.maxDecimalChar||2)){V.preventDefault(),console.log("BLOCKED",fe);return}}}V.key==="Escape"?w(V):V.key==="Enter"?b(V):V.key==="Tab"?_(V):(V.key==="ArrowUp"||V.key==="ArrowDown")&&r.type==="number"&&V.preventDefault()},I=V=>{i("keyup",V)},x=V=>{if(r.disabled||r.readOnly){V.preventDefault();return}i("paste",V)},F=V=>{if(r.disabled||r.readOnly){V.preventDefault();return}i("cut",V)},E=V=>{i("select",V)},A=`input-text-${Math.random().toString(36).substr(2,9)}`,k=B(!1),O=Y(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});et(()=>l.value,V=>{r.validatorFnc?k.value=!!V&&!r.validatorFnc(V):k.value=!1});const N=B(null),W=Y(()=>({disabled:r.disabled,readOnly:r.readOnly,error:k.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:N,bordered:!0})),{argsMain:X,isHover:ee,isFocus:ie}=vs(W);t({triggerFocus:()=>{mt(()=>{var V;(V=a.value)==null||V.focus()})},focus:()=>{ae()},blur:()=>{mt(()=>{var V;(V=a.value)==null||V.blur()})},select:()=>{mt(()=>{var V;(V=a.value)==null||V.select()})},setSelectionRange:(V,H)=>{mt(()=>{var Q;(Q=a.value)==null||Q.setSelectionRange(V,H)})},getValue:()=>l.value,setValue:V=>{l.value=f(V),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const ae=()=>{!r.disabled&&!r.readOnly&&mt(()=>{var V;(V=a.value)==null||V.focus()})},J=Y(()=>ie.value&&d.value);return(V,H)=>(K(),ce("div",{class:te([V.$style["input-wrapper"],"input-editor"]),onClick:ae},[qe((K(),Ke(ys,Kt(U(X),{ref_key:"wrapperRef",ref:N,class:[V.$style["input-box"],{[V.$style["is-hovered"]]:U(ee),[V.$style["is-focused"]]:U(ie),[V.$style["has-input"]]:d.value,[V.$style["is-editting"]]:J.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:me(()=>[Tt(V.$slots,"prefix")]),suffix:me(()=>[d.value&&!r.disabled&&!r.readOnly?Tt(V.$slots,"clear",{key:0},()=>[qe((K(),Ke(vt,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Pt(v,["prevent","stop"]),size:18,rounded:!0,class:te(["wrapper-suffix",V.$style["clear-button"]])},{default:me(()=>[pe(lt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[U(o),{content:"Clear",contentClass:"extra-padding"}]])]):Tt(V.$slots,"suffix",{key:1})]),default:me(()=>[Re("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:te([V.$style["column-config__input"]]),id:A,disabled:e.disabled,readonly:e.readOnly,inputmode:O.value,maxlength:r.maxLength,onInput:g,onFocus:C,onBlur:S,onKeydown:T,onKeyup:I,onPaste:x,onCut:F,onSelect:E},null,42,_Y)]),_:3},16,["class","bordered"])),[[U(s),r.focusIndex]]),k.value?Tt(V.$slots,"error",{key:0}):Je("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_wqanj_1","is-disabled":"_is-disabled_wqanj_16","is-readonly":"_is-readonly_wqanj_16","is-hovered":"_is-hovered_wqanj_16","is-focused":"_is-focused_wqanj_20","column-config__input":"_column-config__input_wqanj_40","clear-button":"_clear-button_wqanj_55"}}]]),RY={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},eS=it({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(null),i=Tr(u=>{o("update:modelValue",u),o("search",u)},ai),a=()=>{o("update:modelValue",""),o("clear"),mt(()=>{var u;(u=r.value)==null||u.focus()})},l=B(s.modelValue);return t({focus:()=>{var u;(u=r.value)==null||u.focus()},setValue(u){l.value=u}}),(u,c)=>(K(),Ke(Qb,{focusIndex:s.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:U(i),onClear:a,onCancel:c[1]||(c[1]=d=>o("cancel")),"auto-emit":!0},{prefix:me(()=>[Re("div",RY,[pe(lt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),eu=_t(it({name:"ListItem",directives:{tooltip:Qt},__name:"ListItem",props:{label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(!1),i=B(!1);function a(w){if(!w||typeof w!="object")return!1;const _=w;return typeof _.name=="string"&&typeof _.id=="string"&&typeof _.initial=="string"}const l=Y(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!b.prefix),u=Y(()=>!!b.suffix||s.danger&&r.value),c=Y(()=>{var w;return s.type==="status"&&typeof((w=s.data)==null?void 0:w.color)=="string"?{backgroundColor:s.data.color,border:Ng(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=mg(),h=Y(()=>({[d.active]:s.selected??!1,[d.disabled]:s.disabled??!1,[d.hover]:s.hover??!1,[d.clickable]:(s.clickable??!0)&&!s.disabled,[d.danger]:s.danger??!1,[d["has-prefix"]]:l.value,[d["has-suffix"]]:u.value,[d.readOnly]:s.readOnly}));Y(()=>({content:"Cancel",...S})),Y(()=>({content:"Confirm",theme:"warning",...S}));function f(w){return{name:w.name,initial:w.initial,id:w.id,profile_image:w.profile_image??null,color:w.color,size:24}}function p(){r.value=!1}function g(w){w?o("click",w):(s.clickable??!0)&&(o("update:selected",!s.selected),o("select",!s.selected))}function v(w){if(!s.disabled){if(s.danger&&!r.value){r.value=!0;return}else s.danger||g(w);o("handleClick",w)}}const C=()=>{r.value?p():o("escape")},S=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),b=ng();return et(()=>s.show,w=>{w===!1&&(r.value=!1)}),t({select:()=>{v(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(w,_)=>{const D=Eo("focusable"),T=Eo("tooltip");return qe((K(),Ke(vt,{variant:["menu-item",e.danger?"danger":"menu-item"],class:te([w.$style["list-item"],h.value]),onHandleClick:v,onMouseenter:_[0]||(_[0]=I=>i.value=!0),onMouseleave:_[1]||(_[1]=I=>i.value=!1),onEscape:C,style:{width:"200px"}},{default:me(()=>[l.value?(K(),ce("div",{key:0,class:te(w.$style["list-item__prefix"])},[Tt(w.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(K(),Ke(lt,{key:0,src:e.icon,source:"remote",class:te(w.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(K(),ce("div",{key:1,class:te(w.$style["status-indicator"]),style:dn(c.value)},null,6)):e.type==="assignee"&&a(e.data)?(K(),Ke(Dh,Kt({key:2},f(e.data),{class:w.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Je("",!0)])],2)):Je("",!0),Re("div",{class:te(w.$style["list-item__label"])},[Tt(w.$slots,"label",{selected:e.selected},()=>[st(Ct(e.label),1)])],2),u.value?(K(),ce("div",{key:1,class:te(w.$style["list-item__suffix"])},[Tt(w.$slots,"suffix",{item:w.$props,hovered:i.value},()=>[e.danger&&r.value?(K(),ce("div",{key:0,class:te(w.$style["confirm-action"])},[qe((K(),Ke(vt,{variant:["tertiary","icon","danger"],size:"small",onClick:Pt(p,["stop","prevent"])},{default:me(()=>[pe(lt,{src:"Xmark",source:"remote"})]),_:1})),[[D,`${s.focusIndex}.0`],[T,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),qe((K(),Ke(vt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(g,["stop","prevent"])},{default:me(()=>[pe(lt,{src:"Check",source:"remote"})]),_:1})),[[D,`${s.focusIndex}.1`],[T,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Je("",!0)])],2)):Je("",!0)]),_:3},8,["variant","class"])),[[D,s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_tuyyv_1",disabled:"_disabled_tuyyv_16",danger:"_danger_tuyyv_23","has-prefix":"_has-prefix_tuyyv_26","has-suffix":"_has-suffix_tuyyv_26",clickable:"_clickable_tuyyv_40",readOnly:"_readOnly_tuyyv_43",hover:"_hover_tuyyv_47",active:"_active_tuyyv_53","list-item__prefix":"_list-item__prefix_tuyyv_78","list-item__label":"_list-item__label_tuyyv_86","list-item__suffix":"_list-item__suffix_tuyyv_100","status-indicator":"_status-indicator_tuyyv_107","item-icon":"_item-icon_tuyyv_113","arbo-icon-state":"_arbo-icon-state_tuyyv_118","item-avatar":"_item-avatar_tuyyv_121","confirm-action":"_confirm-action_tuyyv_130"}}]]),DY=["aria-activedescendant"],TY=["innerHTML"],IY=10,Qi=_t(it({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const s=Qt,o={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=B(""),l=B(-1),u=B(null),c=B(null),d=B(new Map),h=Y(()=>gb(a.value)),f=()=>{const J=h.value;if(!J||J.length<r.minQueryLength)return r.options;if(d.value.has(J))return d.value.get(J);const V=r.options.map(H=>({item:H,score:_7(` ${H.label} `,J)})).filter(({score:H})=>H>0).sort((H,Q)=>Q.score-H.score).map(({item:H})=>H);return d.value.set(J,V),V},p=B([]);et(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Y(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=Tr(J=>{a.value=J,l.value=-1,i("search",J)},ai),C=async J=>{ie.value=0,await v(J||""),ie.value=1},S=J=>a.value?R7(J,a.value):J,b=J=>{const H={[o.ARROW_DOWN]:()=>w(J),[o.ARROW_UP]:()=>_(J),[o.ENTER]:()=>I(J),[o.ESCAPE]:()=>x(J),[o.TAB]:()=>F(J)}[J.key];H&&H()},w=J=>{J.preventDefault(),D(1)},_=J=>{J.preventDefault(),D(-1)},D=J=>{const V=p.value.length;if(V===0)return;let H;J>0?H=(l.value+1)%V:l.value>0?H=l.value-1:H=V-1,l.value=H,T()},T=()=>{mt(()=>{var V;const J=(V=c.value)==null?void 0:V.querySelectorAll('[role="menuitem"]')[l.value];J==null||J.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},I=J=>{if(J.preventDefault(),l.value>=0&&l.value<p.value.length){const H=p.value[l.value];E(H,J)}},x=J=>{J.preventDefault(),k()},F=J=>{i("tab",J)},E=(J,V)=>{!J||J.disabled||(i("select",J,V),l.value=-1,k())},A=J=>{J>=0&&J<p.value.length&&(l.value=J)},k=()=>{i("close")},O=()=>{if(!g.value||!c.value)return;const{scrollTop:J,clientHeight:V,scrollHeight:H}=c.value;H-(J+V)<=IY&&i("loadMore")},N=()=>{var J,V,H;(J=c.value)==null||J.addEventListener("scroll",O),(H=(V=ee.value)==null?void 0:V.$el)==null||H.addEventListener("keydown",b)},W=()=>{var J,V,H;(J=c.value)==null||J.removeEventListener("scroll",O),(H=(V=ee.value)==null?void 0:V.$el)==null||H.removeEventListener("keydown",b)};rn(()=>{N()}),Ss(()=>{W()}),et(()=>r.loading,J=>{!J&&p.value.length>0&&(l.value=-1)});const X=J=>J?Array.isArray(r.selectedId)?r.selectedId.includes(String(J.id)):r.selectedId==J.id:!1,ee=B(null);et(l,()=>{T()}),t({focus:()=>{mt(()=>{var J;(J=ee.value)==null||J.focus()})},reset:()=>{var J;(J=ee.value)==null||J.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:k,clearSearch:()=>{a.value=""},scrollTo:J=>{c.value&&(c.value.scrollTop=J)},selectIndex:J=>{J>=0&&J<p.value.length&&(l.value=J,T())}});const ie=B(0);et([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const J=r.options.length>0&&p.value.length>0,V=!J&&a.value.length>0,H=!J&&a.value.length===0;r.loading?ie.value=0:J?ie.value=1:V?ie.value=2:H&&(ie.value=3)},{immediate:!0,deep:!0});const ae=()=>{i("cancel")};return(J,V)=>(K(),ce("datalist",{ref_key:"searchListRef",ref:u,class:te([J.$style["search-list"],ie.value===3||ie.value===2?J.$style.empty:"",p.value.length>8?J.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:dn({width:e.width})},[pe(eS,{ref_key:"searchBoxRef",ref:ee,modelValue:a.value,"onUpdate:modelValue":V[0]||(V[0]=H=>a.value=H),class:te(J.$style["search-box"]),disabled:e.loading,onSearch:C,onClear:V[1]||(V[1]=H=>C("")),onCancel:ae},null,8,["modelValue","class","disabled"]),Re("div",{ref_key:"popupRef",ref:c,class:te(J.$style["list-container"])},[Tt(J.$slots,"extra-item",{query:a.value,isEmpty:ie.value===3||ie.value===2,isLoading:r.loading}),(K(!0),ce(xt,null,xn(p.value,(H,Q)=>qe((K(),ce("div",{key:`${H.id}-${Q}`,role:"menuitem"},[Tt(J.$slots,"item",{item:H,index:Q,selectedIndex:l.value,isSelected:X,handleSelect:E,handleItemHover:A,getHighlightedLabel:S,query:a.value,idx:Q,focused:l.value==Q},()=>[H.hide?Je("",!0):(K(),Ke(eu,Kt({key:0,ref_for:!0},H,{hover:Q===l.value,selected:X(H),type:H.type,id:`item-${Q}`,"aria-selected":Q===l.value,onClick:fe=>E(H,fe),onMouseover:fe=>A(Q),onEscape:k}),{prefix:me(()=>[Tt(J.$slots,"prefix-item",{item:H})]),label:me(()=>[a.value?qe((K(),ce("span",{key:0,class:te(J.$style.match),innerHTML:S(H.label)},null,10,TY)),[[U(s),{content:H.label,delay:[1e3,0]}]]):qe((K(),ce("span",{key:1,class:te(J.$style["item-label"])},[st(Ct(H.label),1)],2)),[[U(s),{content:H.label,delay:[1e3,0]}]])]),suffix:me(({hovered:fe})=>[Tt(J.$slots,"action",{item:H,isHovered:Q===l.value,hovered:fe,selected:l.value==Q})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[Ko,ie.value===1]])),128)),ie.value===0?Tt(J.$slots,"loading-more",{key:0},()=>[(K(),ce(xt,null,xn(8,H=>Re("div",{class:te(J.$style["loading-more"]),key:H},[Re("div",{class:te(J.$style["loading-skeleton"])},null,2),Re("div",{class:te(J.$style["loading-skeleton"])},null,2)],2)),64))]):Je("",!0),ie.value===2?(K(),ce("div",{key:1,class:te(J.$style["no-results"])},[Tt(J.$slots,"empty",{query:a.value},()=>[Re("div",{class:te(J.$style["no-results-content"])},[...V[2]||(V[2]=[Re("div",null,[st(" No results. "),Re("br"),st(" Try another search. ")],-1)])],2)])],2)):Je("",!0),ie.value===3?(K(),ce("div",{key:2,class:te(J.$style["no-results"])},[Tt(J.$slots,"empty-list",{},()=>[Re("div",{class:te(J.$style["no-results-content"])},[...V[3]||(V[3]=[Re("div",null,"No items available.",-1)])],2)])],2)):Je("",!0),Tt(J.$slots,"footer")],2)],14,DY))}}),[["__cssModules",{$style:{"search-list":"_search-list_1rcj9_1",empty:"_empty_1rcj9_11",scrollable:"_scrollable_1rcj9_17","list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:"_title_1rcj9_137",tips:"_tips_1rcj9_143",match:"_match_1rcj9_157","skeleton-loading":"_skeleton-loading_1rcj9_1"}}]]),Ac=it({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=hz,n=e,s=B(n.appendTo||void 0),o=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:s.value}),r=B(o());et(()=>n,()=>{setTimeout(()=>{mt(()=>{s.value=n.appendTo||void 0,r.value=o()})},50)},{immediate:!0,deep:!0});const i=Y(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial}));return(a,l)=>qe((K(),Ke(Dh,v$(PD(i.value)),null,16)),[[U(t),r.value]])}}),xY={class:"avatar-wrapper"},FY={class:"assignee-label"},NA=_t(it({__name:"AssigneeItem",props:{user:{},hover:{type:Boolean},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Qt,s=e,o=Y(()=>({name:s.user.name,id:s.user.id,profile_image:s.user.profile_image,color:{bgColor:s.user.color.bgColor,textColor:s.user.color.textColor},initial:s.user.initial})),r=Y(()=>s.isMe),i=ng(),a=Y(()=>{if(!l.value&&!s.hover&&!s.focused||!i.actions)return 0;let u=0;const c=d=>{d.forEach(h=>{h.type===xt&&Array.isArray(h.children)?c(h.children):h.type!==qn&&h.type!==Ta&&u++})};return c(i.actions()),u}),l=B(!1);return(u,c)=>(K(),ce("div",{class:te(["assignee-selector-item",{hovered:l.value||s.hover,disabled:s.disabled,selected:s.selected,single:a.value==0,focused:s.focused}]),style:dn({"--actions-count":a.value}),onMouseenter:c[0]||(c[0]=d=>l.value=!0),onMouseleave:c[1]||(c[1]=d=>l.value=!1)},[Re("div",xY,[pe(Ac,{user:o.value,"show-profile":!0,isMe:r.value,"append-to":s.appendTo,"api-update-function":s.apiUpdateFunction},null,8,["user","isMe","append-to","api-update-function"]),s.multipleSelect?(K(),ce("div",{key:0,class:te(["avatar-indicator",[s.selected?"remove":"add"]])},[s.selected?(K(),Ke(lt,{key:0,src:"CircleXMark"})):(K(),Ke(lt,{key:1,src:"CirclePlus"}))],2)):Je("",!0)]),qe((K(),ce("div",FY,[Tt(u.$slots,"name",{},()=>[st(Ct(s.user.name),1)],!0)])),[[U(n),{content:s.user.name,delay:[1e3,0]}]]),l.value||s.hover||s.focused?Tt(u.$slots,"actions",{key:0},void 0,!0):Je("",!0)],38))}}),[["__scopeId","data-v-690cf591"]]),PY={class:"unassign-icon"},tS=_t(it({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,s=()=>{n("click")};return(o,r)=>(K(),Ke(U(vt),{variant:"menu-item",onClick:s,actived:e.actived,style:dn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:me(()=>[Re("div",PY,[Tt(o.$slots,"icon",{},()=>[r[0]||(r[0]=Re("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"#a6a6a6"})],-1))],!0)])]),default:me(()=>[Tt(o.$slots,"label",{},()=>[st(Ct(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),AY=["innerHTML"],kY=20,LA=_t(it({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","update-start","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,{id:r}=Gp(o),i=n,a=Q=>{var ve,oe;const fe=(oe=(ve=o.params)==null?void 0:ve.api)==null?void 0:oe.getRowNode(String(r.value));fe==null||fe.setDataValue("assignees",OI(Q.assignees)),H("updated",Q),console.log("Row data updated with new assignees:",Q.assignees)};et(()=>o.ids,Q=>{console.log("IDs changed:",Q)},{deep:!0});const l=B(!1),u=B(!1),c=B(null),d=B(1),h=B(!0),f=B(0),p=B(""),g=_n("bulkUpdate",B(!1)),v=_n("isSelectAll",B(!1)),C=Y(()=>{var Q;return console.log("Computing selected IDs with bulkUpdate:",g.value,"isSelectAll:",v.value,"props.ids:",o.ids),g.value&&v.value?[]:(Q=o.ids)!=null&&Q.length?o.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:w,assigneeList:_,mergedOptions:D,selectedUserIds:T}=gm({...o,entityId:o.entityId,updateRowData:a,value:o.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{H("update-failed")}},C),{apiServices:I}=ts(!g.value,o),x=_n("workspaceId"),F=async(Q=1,fe="",ve=!1)=>{var oe,re,j,ge,se;if(!I.value||!o.id&&!o.ids)throw console.error("API service or item identifiers are undefined",I.value,o.id,o.ids),new Error("API service or item identifiers are undefined");if(ve?u.value=!0:l.value=!0,c.value=null,!((oe=I.value)!=null&&oe.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const be=await((re=I.value)==null?void 0:re.multipleAssignableUser({workspaceId:String(x),itemIds:(o.ids??(o.id?[o.id]:[])).map(String),page:Q,perPage:kY,q:fe.trim()})),G=((j=bc(be.data))==null?void 0:j.map(pm))??[];_.value=ve?ac(_.value,G,"id"):G,f.value=be.meta.total,h.value=(((ge=be==null?void 0:be.meta)==null?void 0:ge.current_page)||0)<(((se=be==null?void 0:be.meta)==null?void 0:se.last_page)||0),d.value=Q}catch(be){console.error("Error fetching assignable users:",be),c.value="Failed to load assignable users"}finally{l.value=!1,u.value=!1}},E=()=>{!u.value&&h.value&&F(d.value+1,p.value,!0)},A=Tr(async Q=>{p.value=Q,await F(1,Q,!1)},ai),k=()=>F(1,p.value,!1);rn(()=>{var Q;(Q=N.value)==null||Q.focus()}),t({getValue:()=>{var Q;return(Q=D.value.find(fe=>fe.selected))==null?void 0:Q.value},refresh:k,clearInternal:()=>{T.value=[]},focus:()=>{var Q;(Q=N.value)==null||Q.focus()}});const O=()=>{const Q=En.getInstance().getItem("BASE_URL"),fe=co({type:"access_setting",config:{baseDomain:Q,ws_code:o.workspaceId,entity_id:x}}).url;window.open(fe,"_blank")},N=B(null);rn(()=>{mt(()=>{var Q;(Q=N.value)==null||Q.focus()})}),et([()=>o.id,()=>o.workspaceId],()=>{F()},{deep:!0,immediate:!0});const W=Q=>{var ve;const fe=En.getInstance().getItem("ws.code");return((ve=I.value)==null?void 0:ve.getUserInformation(fe,Q))||Promise.resolve(null)},X=async(Q,fe,ve)=>{fe.preventDefault(),fe.stopPropagation(),fe.stopImmediatePropagation(),H("update-start");try{const oe=await w(Q);if(console.log("handleUpdateItem",oe),oe)H("update-completed");else throw new Error("Failed to update assignees")}catch(oe){H("update-failed"),console.error("Error updating assignees:",oe)}},ee=async()=>{try{H("update-start");const Q=await S();if(console.log("handleUnAssignAll",Q),Q)H("update-completed");else throw new Error("Failed to unassign all assignees")}catch(Q){H("update-failed"),console.error("Error unassigning all assignees:",Q)}finally{}},ie=async Q=>{try{H("update-start");const fe=await b(Q);if(console.log("handleReplaceAssignees",fe),fe)H("update-completed");else throw new Error("Failed to replace assignees")}catch(fe){H("update-failed"),console.error("Error replacing assignees:",fe)}finally{}},ae=()=>{var Q,fe;i("cancel"),(fe=(Q=o.params)==null?void 0:Q.api)==null||fe.stopEditing()};Xr("popupAttachRef",N);const J=B(),V=B(!1),H=(Q,fe)=>{switch(Q){case"updated":console.log("Emitting updated event with params:",fe),i("updated",fe);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed");break}};return rn(()=>{mt(()=>{setTimeout(()=>{V.value=!0},50)})}),(Q,fe)=>(K(),ce("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:J},[pe(Qi,Kt({"selected-id":U(T)},{...o},{options:U(D),loading:l.value,ref_key:"popupRef",ref:N,"loading-more":u.value,"has-more":h.value,onSelect:fe[0]||(fe[0]=(ve,oe)=>{X(ve,oe)}),"data-wrapper":"true",onSearch:U(A),onLoadMore:E,onCancel:ae,onClose:ae}),th({"extra-item":me(({isEmpty:ve,isLoading:oe})=>[!ve&&!oe?(K(),Ke(tS,{key:0,onClick:ee,actived:!1,label:"Unassign"},{icon:me(()=>[pe(lt,{src:"UserXMark",source:"remote"})]),_:1})):Je("",!0)]),item:me(({item:ve,selectedIndex:oe,isSelected:re,handleItemHover:j,getHighlightedLabel:ge,query:se,idx:be,focused:G})=>[pe(NA,{user:ve.data,"multiple-select":!0,"append-to":J.value,isMe:!1,hover:be===oe,selected:re(ve),focused:G,onClick:Pt(Z=>X(ve,Z,"click"),["stop","prevent"]),onMouseover:Z=>j(be),"api-update-function":W},{name:me(()=>[se?qe((K(),ce("span",{key:0,class:te([Q.$style["item-label"],Q.$style.match]),style:{flex:"1"},innerHTML:ge(ve.label)},null,10,AY)),[[U(s),{content:ve.label}]]):qe((K(),ce("span",{key:1,class:te(Q.$style["item-label"]),style:{flex:"1"}},[st(Ct(ve.label),1)],2)),[[U(s),{content:ve.label}]])]),actions:me(()=>[qe((K(),Ke(vt,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:Pt(Z=>{var de;return ie((de=ve.data)==null?void 0:de.id)},["stop"])},{default:me(()=>[pe(lt,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[U(s),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":me(()=>[Re("div",{class:te(Q.$style["empty-state"])},[fe[3]||(fe[3]=st(" No assignee available. ",-1)),fe[4]||(fe[4]=Re("br",null,null,-1)),pe(vt,{onClick:O,variant:["tertiary"],size:"small"},{default:me(()=>[...fe[2]||(fe[2]=[st(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[c.value?{name:"error",fn:me(()=>[Re("div",{class:te(Q.$style["error-message"])},[st(Ct(c.value)+" ",1),pe(vt,{onClick:k,size:"small"},{default:me(()=>[...fe[1]||(fe[1]=[st(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_nv6on_1","item-assignee":"_item-assignee_nv6on_6","item-action":"_item-action_nv6on_6","item-label":"_item-label_nv6on_16","error-message":"_error-message_nv6on_25","empty-state":"_empty-state_nv6on_35","skeleton-avatar":"_skeleton-avatar_nv6on_48"}}]]),OY={key:0,class:"inner"},tf=_t(it({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const s=e,o=B(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:u,show:c}=Fs({toggleOnClick:!0,zIndex:2,disabled:s.disabled,placement:"top",appendTo:o.value||void 0}),d=B(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=ao({isShow:!1,isRender:!1});rn(()=>{var C;const v=d.value instanceof HTMLElement?d.value:(C=d.value)==null?void 0:C.$el;v&&v.addEventListener("keydown",h)}),Ss(()=>{var C;const v=d.value instanceof HTMLElement?d.value:(C=d.value)==null?void 0:C.$el;v&&v.removeEventListener("keydown",h)});const p=n,g=(v,C)=>{f.isShow=v,f.isRender=C};return et(()=>a.value,(v,C)=>{v&&v!==C&&mt(()=>{g(!0,!0)}),p("onVisibleChange",v,C)}),t({hide:()=>{l(),g(!1,!0)},isVisible:a,open:()=>{c(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),et(f,v=>{console.log("Popup visibility changed:",v)},{deep:!0}),(v,C)=>(K(),ce("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:o},[Re("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[Tt(v.$slots,"trigger",{isVisible:U(a),hide:U(l),disabled:s.isUpdating||s.disabled,popupRef:U(i),triggerRef:U(r),toggle:U(u)},void 0,!0)],512),Re("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?qe((K(),ce("div",OY,[Tt(v.$slots,"popup",{isVisible:U(a),hide:U(l),popupRef:U(i),triggerRef:U(r),toggle:U(u),open:U(c)},void 0,!0)],512)),[[Ko,!s.isUpdating&&!s.disabled&&f.isShow]]):Je("",!0)],512)],512))}}),[["__scopeId","data-v-ede22ac9"]]),MY=it({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;Xr("bulkUpdate",!0);const s=B(!1),o=t,r=B(null),i=()=>{var d;(d=l.value)==null||d.hide(),s.value=!0,o("update-start")},a=d=>{var h,f;console.log("Update completed with success:",d),s.value=!1,d?(o("update-completed"),(h=l.value)==null||h.destroy()):(o("update-failed"),(f=l.value)==null||f.open())},l=B(null),u=d=>{var h;console.log("Updating assignees with params:",d),o("update",d),(h=r.value)==null||h.clearInternal()},c=(d,h)=>{mt(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return et(()=>n.ids,()=>{mt(()=>{var d;(d=l.value)==null||d.destroy()})}),(d,h)=>(K(),Ke(tf,{ref_key:"wrapperRef",ref:l,isUpdating:s.value,disabled:n.disabled||s.value,onOnVisibleChange:c},{trigger:me(({hide:f,disabled:p})=>[pe(vt,{variant:n.variant,loading:s.value,disabled:p,onEscape:f},{default:me(()=>[pe(lt,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=st(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:me(({hide:f})=>[pe(LA,Kt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:u,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0)),onCancel:f}),null,16,["ids","onCancel"])]),default:me(()=>[h[3]||(h[3]=st(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),nf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],NY=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),Wa=(e,t)=>{const n=s=>{var o,r;if(s.key==="Tab"){const i=s.shiftKey||s.metaKey;s.preventDefault(),s.stopImmediatePropagation(),s.stopPropagation();const a=document.activeElement,l=(o=a==null?void 0:a.dataset)==null?void 0:o.index;if(l){let u=nf.indexOf(l);const c=i?-1:1;for(const d of nf){u=(u+c+nf.length)%nf.length;const h=nf[u],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(s.key==="Enter")(r=s.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(s.key==="Escape"){s.stopPropagation(),s.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(NY.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},LY=["aria-label"],VY=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],BY={style:{flex:"1"}},$Y=_t(it({__name:"MainCalendar",props:eD({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:eD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const s=Qt,o=B(null),r=e,i=Y(()=>r.startDate&&r.endDate),a=JH(e,"tracingCase"),l=n,u=B(r.year),c=B(r.month);et(()=>[r.year,r.month],([V,H])=>{u.value=V,c.value=H});const d=Y(()=>bt.fromObject({year:u.value,month:c.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),h=Y(()=>bt.now().setZone(r.timezone)),f=Y(()=>r.startDate?bt.fromJSDate(r.startDate,{zone:r.timezone}):null),p=Y(()=>r.endDate?bt.fromJSDate(r.endDate,{zone:r.timezone}):null),g=B(f.value),v=B(p.value),C=B(f.value),S=B(p.value);et([f,p],()=>{r.requireConfirm||(g.value=f.value,v.value=p.value,C.value=f.value,S.value=p.value)},{immediate:!0});const b=Y(()=>r.requireConfirm?g.value:f.value),w=Y(()=>r.requireConfirm?v.value:p.value);et(()=>r.activeField,V=>{const H=V==="start"?b.value:w.value;H&&(u.value=H.year,c.value=H.month)}),et(()=>{var V,H;return[(V=b.value)==null?void 0:V.toISODate(),(H=w.value)==null?void 0:H.toISODate(),r.activeField]},()=>{const V=r.activeField==="start"?b.value:w.value;V&&(V.year!==u.value||V.month!==c.value)&&(u.value=V.year,c.value=V.month)});function _(V){return V.setZone("utc")}const D=B("");function T(V){D.value=V.toISODate()||"",mt(()=>{const H=document.querySelector(`.arbo-calendar-day[data-date="${D.value}"]`);H==null||H.focus()})}et(()=>{var V,H;return[u.value,c.value,r.activeField,(V=b.value)==null?void 0:V.toISODate(),(H=w.value)==null?void 0:H.toISODate()]},()=>{const V=r.activeField==="start"?b.value:w.value;let H;V&&V.year===u.value&&V.month===c.value?H=V:b.value&&b.value.year===u.value&&b.value.month===c.value?H=b.value:H=h.value,T(H)});function I(V){return V.toFormat("d")}const x=Y(()=>{const V=bt.fromObject({year:u.value,month:c.value,day:1},{zone:r.timezone}),H=V.weekday,Q=r.weekStart===1?(H+6)%7:H%7;let fe=V.minus({days:Q});const ve=[],oe=wc.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),re=mg();for(let ge=0;ge<42;ge++){const se=[];fe.month!==c.value&&se.push(re["is-outside"]),fe.hasSame(h.value,"day")&&se.push(re["is-today"]),b.value&&fe.hasSame(b.value,"day")&&se.push(re["is-selected-start"]),w.value&&fe.hasSame(w.value,"day")&&se.push(re["is-selected-end"]),b.value&&w.value&&fe>b.value&&fe<w.value&&se.push(re["is-in-range"]);const be=I(fe),G=oe[fe.weekday-1]||"";ve.push({dt:fe,iso:fe.toISODate()||"",label:fe.toFormat("d"),displayLabel:be,weekdayLabel:G,aria:fe.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:se}),fe=fe.plus({days:1})}const j=[];for(let ge=0;ge<6;ge++)j.push(ve.slice(ge*7,ge*7+7));return j}),F=Y(()=>{const V=wc.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?V:[V[6],...V.slice(0,6)]});function E(V,H,Q){const fe=V==="start"?H.startOf("day"):H.endOf("day"),ve=_(fe),oe={year:fe.year,month:fe.month,day:fe.day,utc:ve.toISO()||""};V==="start"?(l("select-start",oe,Q??!0),l("select-start-utc",oe.utc)):(l("select-end",oe),l("select-end-utc",oe.utc))}function A(V){let H=u.value,Q=c.value+V;for(;Q<1;)Q+=12,H-=1;for(;Q>12;)Q-=12,H+=1;u.value=H,c.value=Q,l("update:year",H),l("update:month",Q)}function k(V){const Q=(D.value?bt.fromISO(D.value,{zone:r.timezone}):h.value).plus({days:V});Q.month===c.value&&Q.year===u.value&&T(Q)}function O(V=!1){const Q=(D.value?bt.fromISO(D.value,{zone:r.timezone}):h.value).weekday%7,fe=V?6-Q:-Q;k(fe)}const N=V=>{W(V)};function W(V){switch(V.preventDefault(),V.stopPropagation(),V.key){case"ArrowLeft":V.preventDefault(),k(-1);break;case"ArrowRight":V.preventDefault(),k(1);break;case"ArrowUp":V.preventDefault(),k(-7);break;case"ArrowDown":V.preventDefault(),k(7);break;case"Home":V.preventDefault(),O(!1);break;case"End":V.preventDefault(),O(!0);break;case"PageUp":V.preventDefault(),A(V.shiftKey?-12:-1);break;case"PageDown":V.preventDefault(),A(V.shiftKey?12:1);break;case"Enter":case" ":{V.preventDefault();const H=D.value?bt.fromISO(D.value,{zone:r.timezone}):h.value,Q=x.value.flat().find(fe=>fe.iso===H.toISODate());Q&&ee(Q);break}}}const X=V=>{const H=bt.now().setZone(r.timezone);u.value=H.year,c.value=H.month,l("update:year",H.year),l("update:month",H.month),T(H),l("gotoToday")};function ee(V){var de,Ae;const H=!!f.value,Q=!!p.value,fe=r.activeField,ve=((de=f.value)==null?void 0:de.toISODate())||"null",oe=((Ae=p.value)==null?void 0:Ae.toISODate())||"null",re=V.dt.toISODate()||"",j=(Fe,Le)=>{a.value={case:Fe,behavior:Le}},ge=()=>`Selected start ${re} > existing end ${oe} -> reset both to ${re}`,se=()=>`Selected end ${re} < existing start ${ve} -> reset both to ${re}`,be=()=>{E("start",V.dt,!0),E("end",V.dt),l("update:activeField","end")},G=(Fe=!1)=>{E("start",V.dt,Fe),Fe&&l("update:activeField","end")},Z=(Fe=!1)=>{E("end",V.dt),Fe&&l("close")};if(H&&Q){fe==="start"?p.value&&V.dt>p.value?(be(),j("INVERT_RANGE_FROM_START",ge())):(G(!1),j("UPDATE_START_IN_RANGE",`Updated start from ${ve} to ${re}; end remains ${oe}`)):f.value&&V.dt<f.value?(be(),j("INVERT_RANGE_FROM_END",se())):(Z(!1),j("UPDATE_END_IN_RANGE",`Updated end from ${oe} to ${re}; start remains ${ve}`));return}if(!H&&Q&&fe==="start"&&p.value&&V.dt>p.value){be(),j("CREATE_RANGE_FROM_LATE_START",ge());return}if(H&&!Q&&fe==="end"&&f.value&&V.dt<f.value){be(),j("CREATE_RANGE_FROM_EARLY_END",se());return}if(!H&&!Q){if(fe==="start"){G(!0),j("INIT_START",`Picked start ${re}; awaiting end selection`);return}Z(r.immediatelyUpdate),j("INIT_END",`Picked end ${re}; awaiting start selection`);return}if(!H&&Q){if(fe==="start"){G(!0),j("FILL_MISSING_START",`Inserted start ${re}; existing end ${oe}`);return}Z(!1),j("STRICT_UPDATE_END_ONLY",`Updated end to ${re}; start still null`);return}if(H&&!Q){if(fe==="start"){G(!0),j("RESELECT_START_BEFORE_END",`Replaced start with ${re}; end still null, switching to end`);return}Z(r.immediatelyUpdate),j("FILL_MISSING_END",`Picked end ${re}; start ${ve}`);return}}function ie(){C.value=g.value,S.value=v.value,l("confirm")}function ae(){g.value=C.value,v.value=S.value,l("cancel")}function J(){mt(()=>{var V;(V=o.value)==null||V.focus()})}return rn(()=>{J()}),t({focus:J}),(V,H)=>(K(),ce("div",{ref_key:"calendarRef",ref:o,class:te([V.$style["arbo-calendar"],{[V.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[Re("div",{class:te([V.$style["arbo-calendar-header"],V.$style["arbo-calendar-week"]]),role:"row"},[(K(!0),ce(xt,null,xn(F.value,Q=>(K(),ce("div",{key:Q,class:te(V.$style["arbo-calendar-weekday"]),role:"columnheader"},Ct(Q),3))),128))],2),Re("div",{class:te(V.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:H[0]||(H[0]=Pt(Q=>U(Wa)(Q,N),["prevent","stop"]))},[(K(!0),ce(xt,null,xn(x.value,(Q,fe)=>(K(),ce("div",{key:fe,class:te(V.$style["arbo-calendar-week"])},[(K(!0),ce(xt,null,xn(Q,ve=>(K(),ce("div",{key:ve.iso,class:te([V.$style["arbo-calendar-day"],ve.classes,{[V.$style["is-focused"]]:ve.iso===D.value}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":ve.aria,"data-date":ve.iso,"data-weekday":ve.weekdayLabel,tabindex:ve.iso===D.value?0:-1,onClick:oe=>ee(ve)},Ct(ve.displayLabel),11,VY))),128))],2))),128))],34),r.readOnly?Je("",!0):(K(),ce("div",{key:0,class:te(V.$style["arbo-calendar-actions"])},[Re("div",BY,[qe((K(),Ke(vt,{variant:"secondary",size:"medium",onClick:H[1]||(H[1]=Q=>X()),onKeydown:U(Wa),"data-index":"today-btn"},{prefix:me(()=>[pe(lt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[U(s),"Today"]])]),pe(vt,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:U(Wa),variant:"secondary",size:"medium",onClick:ae,"data-index":"cancel-btn"},{default:me(()=>[st(Ct(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),pe(vt,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:U(Wa),onClick:ie},{default:me(()=>[st(Ct(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,LY))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_1a7wo_1","arbo-calendar-day":"_arbo-calendar-day_1a7wo_2","arbo-calendar-week":"_arbo-calendar-week_1a7wo_3","arbo-calendar":"_arbo-calendar_1a7wo_2","arbo-calendar-nav":"_arbo-calendar-nav_1a7wo_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_1a7wo_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_1a7wo_53","arbo-calendar-weekday":"_arbo-calendar-weekday_1a7wo_58","arbo-calendar-weeks":"_arbo-calendar-weeks_1a7wo_63","is-today":"_is-today_1a7wo_92","is-selected-start":"_is-selected-start_1a7wo_97","is-selected-end":"_is-selected-end_1a7wo_105","is-outside":"_is-outside_1a7wo_125","is-focused":"_is-focused_1a7wo_128","is-in-range":"_is-in-range_1a7wo_133","arbo-calendar-actions":"_arbo-calendar-actions_1a7wo_139","arbo-calendar-btn":"_arbo-calendar-btn_1a7wo_147",cancel:"_cancel_1a7wo_156",confirm:"_confirm_1a7wo_161"}}]]),HY=["onClick"],GY=["variant","onClick"],UY=_t(it({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const s=e,o=Y(()=>{if(s.monthLabels&&s.monthLabels.length===12)return s.monthLabels;const k=s.locale||"en-US",O=s.monthLabelStyle||"short",N=new Intl.DateTimeFormat(k,{month:O,timeZone:"UTC"});return Array.from({length:12},(X,ee)=>N.format(new Date(Date.UTC(2020,ee,1))))}),r=n,i=B(s.year),a=B(s.month),l=B(s.year);et(()=>s.year,k=>{k!==i.value&&(i.value=k,l.value=k)}),et(()=>s.month,k=>{k!==a.value&&(a.value=k)});const u=B("days");function c(k){u.value!==k&&(u.value=k,r("mode-change",k))}const d=Y(()=>s.minYear),h=Y(()=>s.maxYear),f=Y(()=>{const k=s.yearSpan;return l.value-l.value%k}),p=Y(()=>f.value+s.yearSpan-1);function g(){const k=s.yearSpan,O=f.value-k;O>=d.value&&(l.value=O)}function v(){const k=s.yearSpan,O=f.value+k;O<=h.value&&(l.value=O)}const C=Y(()=>f.value-s.yearSpan<d.value),S=Y(()=>p.value+s.yearSpan>h.value),b=Y(()=>{const k=s.yearSpan;return Math.ceil(k/3)});function w(k){const N=f.value+(k-1)*3;return Array.from({length:3},(W,X)=>N+X).filter(W=>W<=p.value)}function _(){u.value==="months"?c("days"):c("months")}function D(){u.value==="years"?c("days"):c("years")}function T(k){i.value=k,l.value=k,r("update:year",k),r("year-selected",k),c("months")}function I(k){a.value=k,r("update:month",k),r("month-selected",k),c("days")}function x(){if(u.value==="days"){let k=i.value,O=a.value-1;if(O<1&&(O=12,k--),k<d.value)return;i.value=k,a.value=O,r("update:year",k),r("update:month",O)}else if(u.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else u.value==="years"&&g()}function F(){if(u.value==="days"){let k=i.value,O=a.value+1;if(O>12&&(O=1,k++),k>h.value)return;i.value=k,a.value=O,r("update:year",k),r("update:month",O)}else if(u.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else u.value==="years"&&v()}const E=Y(()=>u.value==="days"?i.value===d.value&&a.value===1:u.value==="months"?i.value-1<d.value:C.value),A=Y(()=>u.value==="days"?i.value===h.value&&a.value===12:u.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(k,O)=>{i.value=k,a.value=O}}),(k,O)=>(K(),ce("div",{class:te([k.$style["cal-nav-wrapper"]])},[Tt(k.$slots,"selection"),u.value==="days"?(K(),ce("div",{key:0,class:te(k.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[pe(vt,{variant:"tertiary",class:te([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Previous",disabled:E.value,label:"",onClick:x,"data-index":"prev-btn",onKeydownCapture:zn(Pt(x,["prevent","stop"]),["enter"]),onKeydown:U(Wa)},{default:me(({hovered:N})=>[pe(lt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),Re("div",{class:te(k.$style["cal-nav-center"])},[pe(vt,{"data-index":"month-btn",variant:"secondary",onClick:_,onKeydown:U(Wa)},{default:me(()=>[st(Ct(o.value[a.value-1]),1)]),_:1},8,["onKeydown"]),pe(vt,{variant:"secondary",onClick:D,"data-index":"year-btn",onKeydown:U(Wa)},{default:me(()=>[st(Ct(i.value),1)]),_:1},8,["onKeydown"])],2),pe(vt,{"data-index":"next-btn",variant:"tertiary",class:te([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:A.value,label:"",onClick:F,onKeydownCapture:zn(Pt(F,["prevent","stop"]),["enter"]),onKeydown:U(Wa)},{default:me(({hovered:N})=>[pe(lt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Je("",!0),u.value==="years"?(K(),ce("div",{key:1,class:te(k.$style["year-grid"])},[Re("div",{class:te(k.$style["year-grid-header"])},[pe(vt,{variant:"tertiary",class:te([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Next",disabled:C.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:me(({hovered:N})=>[pe(lt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),Re("div",{class:te(k.$style["range-label"])},Ct(f.value)+" - "+Ct(p.value),3),pe(vt,{variant:"tertiary",class:te([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:me(({hovered:N})=>[pe(lt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),Re("div",{class:te(k.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(K(!0),ce(xt,null,xn(b.value,N=>(K(),ce("div",{key:"yr-row-"+N,class:te(k.$style["year-grid-row"])},[(K(!0),ce(xt,null,xn(w(N),W=>(K(),ce("a",{key:W,tabindex:"0",class:te([k.$style["year-cell"],{[k.$style.selected]:W===i.value}]),onClick:X=>T(W)},Ct(W),11,HY))),128))],2))),128))],2)],2)):u.value==="months"?(K(),ce("div",{key:2,class:te(k.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[Re("div",{class:te(k.$style.months)},[(K(!0),ce(xt,null,xn(o.value,(N,W)=>(K(),ce("a",{tabindex:"0",key:N,variant:W+1===a.value?"primary":"text",class:te([k.$style["month-cell"],{[k.$style.selected]:W+1===a.value}]),onClick:X=>I(W+1)},Ct(N),11,GY))),128))],2)],2)):(K(),ce("div",{key:3,class:te(k.$style["days-slot"])},[Tt(k.$slots,"default",{year:i.value,month:a.value,mode:u.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_unh71_1","cal-nav-bar":"_cal-nav-bar_unh71_12","cal-nav-btn":"_cal-nav-btn_unh71_20",prev:"_prev_unh71_33","year-grid-header":"_year-grid-header_unh71_37","cal-nav-center":"_cal-nav-center_unh71_46","cal-nav-label":"_cal-nav-label_unh71_52","month-grid":"_month-grid_unh71_66","year-grid":"_year-grid_unh71_37",months:"_months_unh71_75","month-cell":"_month-cell_unh71_82","year-cell":"_year-cell_unh71_83","pg-btn":"_pg-btn_unh71_105","year-grid-body":"_year-grid-body_unh71_118","year-grid-row":"_year-grid-row_unh71_125",selected:"_selected_unh71_131","days-slot":"_days-slot_unh71_137","range-label":"_range-label_unh71_141"}}]]);function WY(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:s,maxDate:o}=e,r=B(""),i=Y(()=>{const g=bt.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=Y(()=>{if(!s||!i.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const C=new Date(g.year,g.month-1,g.day),S=new Date(v.year,v.month-1,v.day);return C<S?-1:C>S?1:0},u=Y(()=>{if(!o||!i.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),c=Y(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&u.value),d=Y(()=>r.value.length===t.length&&c.value);return{inputValue:r,isValid:c,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=bt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>c.value?i.value:null}}const zY={key:0,style:{marginLeft:"8px"}},jY=["disabled","readonly","placeholder"],VA=_t(it({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=n,i=B(null),a=B(null),{isValid:l,isComplete:u,inputValue:c,clear:d,setDate:h,getDate:f}=WY({format:o.format,allowPastDates:o.allowPastDates,allowFutureDates:o.allowFutureDates,timezone:o.timezone,minDate:o.minDate,maxDate:o.maxDate}),p=Y(()=>o.active),g=Y(()=>({disabled:o.disabled,error:!l.value&&c.value.length>0,readOnly:o.readOnly,isEmpty:c.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:C,isFocus:S}=vs(g),b=I=>{var F;const x=(F=I.clipboardData)==null?void 0:F.getData("text/plain");x&&(c.value=x.trim())},w=I=>{if(I.key==="Escape"){r("blur"),I.target.blur(),I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation();return}else I.key==="Tab"&&T(I)},_=()=>{d(),r("clear")};t({clear:_,setDate:h,getDate:f,focus:()=>{var I;return(I=i.value)==null?void 0:I.focus()}}),et(()=>o.modelValue,I=>{I?h(I):d()},{immediate:!0}),et([()=>u.value,()=>c.value],()=>{if(c.value.length===0)r("complete",null);else if(l.value&&!o.readOnly&&!o.disabled&&u.value){const I=f();(I||c.value.length===0)&&r("complete",I)}}),et(()=>l.value,I=>{I||r("invalid","")});const D=Y(()=>!!o.isMultipleDate),T=I=>{I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation(),r("tab",I)};return(I,x)=>(K(),Ke(ys,Kt(U(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:me(()=>[Re("div",{class:te([I.$style["date-input-wrapper"]])},[D.value?(K(),ce("span",zY," Multiple ")):qe((K(),ce("input",{key:1,disabled:o.disabled,readonly:o.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":x[0]||(x[0]=F=>gn(c)?c.value=F:null),onPaste:Pt(b,["prevent"]),placeholder:o.placeholder,class:te([I.$style["date-input"]]),onKeydown:w},null,42,jY)),[[mT,U(c)]]),Tt(I.$slots,"clear",{handleClear:_},()=>[(U(c).length>0||D.value)&&!o.readOnly&&!o.disabled&&(U(C)||U(S))?qe((K(),Ke(vt,{key:0,variant:["icon","primary"],onClick:Pt(_,["stop"]),size:16,rounded:!0},{default:me(()=>[pe(lt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[U(s),"Clear"]]):(K(),Ke(lt,{key:1,src:"Calendar",source:"remote",class:te(I.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_1yset_1","icon-calendar":"_icon-calendar_1yset_9",focus:"_focus_1yset_12",hover:"_hover_1yset_12",active:"_active_1yset_12","date-input":"_date-input_1yset_1",invalid:"_invalid_1yset_38"}}]]),KY=it({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:yb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const s=B({case:"",behavior:""}),o=e,r=B(null),i=n,a=async(j,ge)=>{i("start-update"),await j(),i("finish-update"),mt(()=>{var se,be;ge(),(be=(se=o.params)==null?void 0:se.api)==null||be.stopEditing()})},l=(j,ge)=>{j(),mt(()=>{var se,be;ge(),(be=(se=o.params)==null?void 0:se.api)==null||be.stopEditing()})},u=()=>{var ge;const j=bt.now().setZone(o.timezone);H.value=j.year,Q.value=j.month,(ge=V.value)==null||ge.setNavigation(j.year,j.month)},c=ao({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:C,beginInteraction:S,clearStart:b,clearDue:w}=F7(o,i),_=Y(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});et(()=>o.multipleStartDates,j=>{h.value=!!j},{immediate:!0}),et(()=>o.multipleDueDates,j=>{f.value=!!j},{immediate:!0});const D=B(null),T=B(null),I=j=>{j.preventDefault(),j.stopImmediatePropagation(),j.stopPropagation(),ie()},x=()=>{var j;(j=T.value)==null||j.focus()},F=j=>{if(!j){c.start=!1,b();return}const ge=d.endDate?bt.fromJSDate(d.endDate,{zone:o.timezone}):null;if(ge&&E(j,ge)>0){const be={year:j.year,month:j.month,day:j.day};c.start=!1,C(be,!1),p(be),mt(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const se={year:j.year,month:j.month,day:j.day};c.start=!1,C(se,!0)},E=(j,ge)=>{const se=j.startOf("day"),be=ge.startOf("day");return se<be?-1:se>be?1:0},A=j=>{var ge;j.preventDefault(),j.stopImmediatePropagation(),j.stopPropagation(),(ge=document.querySelector('[data-index="prev-btn"]'))==null||ge.focus()},k=j=>{if(!j){c.end=!1,w();return}const ge=d.startDate?bt.fromJSDate(d.startDate,{zone:o.timezone}):null;if(ge&&E(j,ge)<0){const be={year:j.year,month:j.month,day:j.day};c.end=!1,C(be),p(be),mt(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const se={year:j.year,month:j.month,day:j.day};c.end=!1,p(se)},O=()=>{h.value=!1,b()},N=()=>{f.value=!1,w()},W=()=>{ae()},X=Y(()=>d.isSelectingStart||d.isSelectingEnd);function ee(){o.disabled||o.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,mt(()=>{var j;(j=r.value)==null||j.focus()}))}function ie(){o.disabled||o.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,mt(()=>{var j;(j=D.value)==null||j.focus()}))}function ae(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function J(j){j.key==="Escape"?(j.stopPropagation(),ae()):j.key=="Tab"&&i("tab",j)}const V=B(null),H=B(new Date().getFullYear()),Q=B(new Date().getMonth()+1);et(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(H.value=d.startDate.getFullYear(),Q.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(H.value=d.endDate.getFullYear(),Q.value=d.endDate.getMonth()+1)},{immediate:!0});const fe=B(null);function ve(){if(Array.isArray(o.value)){const[ge,se]=o.value;d.startDate=ge||null,d.endDate=se||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const j=d.startDate||d.endDate||new Date;H.value=j.getFullYear(),Q.value=j.getMonth()+1}et(()=>{var j,ge,se,be,G,Z,de,Ae;return[((se=(ge=(j=o.value)==null?void 0:j[0])==null?void 0:ge.getTime)==null?void 0:se.call(ge))||((be=o.value)==null?void 0:be[0]),((de=(Z=(G=o.value)==null?void 0:G[1])==null?void 0:Z.getTime)==null?void 0:de.call(Z))||((Ae=o.value)==null?void 0:Ae[1]),o.timezone,o.format,o.placeholder,o.enableRangeFeedback]},()=>{ve()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ve,openStart:ee,openEnd:ie,closePicker:ae,clearAll:W,isOpen:X,drpRef:fe,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?ee():ie():ee()}});const re=B(null);return et(()=>X.value,j=>{if(o.disabled||o.readOnly)return;const ge=re.value;ge&&(j?ge.show():ge.hide())},{immediate:!0}),(j,ge)=>(K(),ce("div",{class:te(j.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:T,onKeydown:J,tabindex:"1","data-index":"calendar-wrapper"},[pe(UY,{year:H.value,"onUpdate:year":ge[6]||(ge[6]=se=>H.value=se),month:Q.value,"onUpdate:month":ge[7]||(ge[7]=se=>Q.value=se),locale:o.locale,disabled:o.disabled,readOnly:o.readOnly,ref_key:"navigationRef",ref:V},{selection:me(()=>[Re("div",{class:te(j.$style["calendar-input-section"])},[pe(VA,{ref_key:"starDateRef",ref:r,"model-value":U(d).startDate,placeholder:o.startPlaceholder,timezone:o.timezone,active:U(d).isSelectingStart,onClick:ee,onClear:O,onComplete:F,onInvalid:ge[0]||(ge[0]=se=>c.start=!0),disabled:o.disabled,readOnly:o.readOnly,onBlur:x,onTab:I},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),pe(VA,{ref_key:"endDateRef",ref:D,"model-value":U(d).endDate,placeholder:o.duePlaceholder,timezone:o.timezone,active:U(d).isSelectingEnd,onClick:ie,onClear:N,disabled:o.disabled,onComplete:k,onInvalid:ge[1]||(ge[1]=se=>c.end=!0),readOnly:o.readOnly,isMultipleDate:U(f),onTab:A},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:me(({year:se,month:be})=>[pe($Y,{disabled:o.disabled,disableConfirm:c.end||c.start,readOnly:o.readOnly,ref_key:"drpRef",ref:fe,"tracing-case":s.value,"onUpdate:tracingCase":ge[2]||(ge[2]=G=>s.value=G),year:se,month:be,"start-date":U(d).startDate,"end-date":U(d).endDate,"active-field":_.value,timezone:o.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:U(C),onSelectEnd:U(p),onGotoToday:u,onConfirm:ge[3]||(ge[3]=()=>{a(U(v),ae)}),onCancel:ge[4]||(ge[4]=G=>l(U(g),ae)),onClose:ge[5]||(ge[5]=G=>a(U(v),ae))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),Pm=_t(KY,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_1wull_1","calendar-input-section":"_calendar-input-section_1wull_11","display-wrapper":"_display-wrapper_1wull_19","calendar-actions":"_calendar-actions_1wull_23","clear-all-btn":"_clear-all-btn_1wull_29"}}]]),qY=it({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,s=e,o=_n("isSelectAll",B(!1)),r=_n("bulkUpdate",B(!1)),i=Y(()=>!!s.entityId&&r.value&&o.value),{apiServices:a}=ts(!r.value,s),l=_n("filterParams",null),u=B(null),c=async I=>{var x,F,E,A;try{w.value=!0,n("update-start");let k={workspaceId:s.workspaceId,entityId:s.entityId,itemIds:s.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in I&&(k.startDate=I.start?fm(I.start):null),"end"in I&&(k.dueDate=I.end?fm(I.end):null),i.value?(k.itemIds=void 0,k.entityId=s.entityId):k.entityId=void 0,await((F=(x=a.value)==null?void 0:x.changeDate)==null?void 0:F.call(x,k)),n("updated",{workspaceId:s.workspaceId,itemIds:s.ids,data:k}),n("update-completed"),(E=u.value)==null||E.hide()}catch(k){console.error("Failed to update dates:",k),mt(()=>{mt(()=>{var O;n("update-failed"),(O=u.value)==null||O.open()})})}finally{(A=S.value)==null||A.resetCalendarLogic(),w.value=!1}},d=()=>{if(!s.rowSelected||s.rowSelected.length===0){h();return}s.rowSelected.length===1?f():p()},h=()=>{C.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const x=s.rowSelected[0].dateRange;b.value=[(x==null?void 0:x[0])??null,(x==null?void 0:x[1])??null],C.value=!1,v.value=!1},p=()=>{var x,F;if(s.rowSelected.some(E=>E.dateRange&&(E.dateRange[0]!==null||E.dateRange[1]!==null))){const E=g(0),A=g(1);if(v.value=E,C.value=A,E)b.value[0]=null;else{const k=((x=s.rowSelected[0].dateRange)==null?void 0:x[0])??null;b.value[0]=k}if(A)b.value[1]=null;else{const k=((F=s.rowSelected[0].dateRange)==null?void 0:F[1])??null;b.value[1]=k}}else v.value=!1,C.value=!1,b.value=[null,null]},g=I=>{const x=s.rowSelected.map(E=>{var A;return(A=E.dateRange)==null?void 0:A[I]});return x.length===0?!1:new Set(x.map(E=>{var A;return(A=E==null?void 0:E.getTime)==null?void 0:A.call(E)})).size>1},v=B(!1),C=B(!1),S=B(null),b=B([null,null]);et([()=>s.ids,()=>s.rowSelected],I=>{d(),mt(()=>{var x;(x=S.value)==null||x.focus()})},{immediate:!0,deep:!0});const w=B(!1),_=()=>{w.value=!0},D=()=>{mt(()=>{setTimeout(()=>{w.value=!1},500)})},T=(I,x)=>{I&&mt(()=>{var F;(F=S.value)==null||F.focus()})};return(I,x)=>(K(),Ke(tf,{ref_key:"wrapperRef",ref:u,isUpdating:w.value,disabled:s.disabled||w.value,onOnVisibleChange:T},{trigger:me(({hide:F,disabled:E})=>[pe(vt,{variant:s.variant,loading:w.value,disabled:E,onEscape:F},{default:me(()=>[pe(lt,{src:"Calendar"}),x[0]||(x[0]=st(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:me(({isVisible:F,hide:E})=>[F?(K(),Ke(Pm,{key:0,immediatelyUpdate:!1,value:b.value,onConfirmed:c,ref_key:"calendarRef",ref:S,onClosed:E,onStartUpdate:_,onFinishUpdate:D,multipleDueDates:C.value,multipleStartDates:v.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Je("",!0)]),default:me(()=>[x[1]||(x[1]=st(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),YY=e=>{if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"},BA=Ql("metricStore",()=>{const e=B();return{metricList:e,setMetricList:s=>{e.value=s},checkEditType:s=>{var o;if(((o=s==null?void 0:s.auth_permission)==null?void 0:o.permission)==2)return YY(s)}}}),ZY=["onKeydown"],XY=["width","height","viewBox"],JY=["d"],QY="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",$A=it({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(s.modelValue??0),i=B(null),a=Y(()=>{var E;return((E=s.params)==null?void 0:E.size)??24}),l=Y(()=>{var E;return((E=s.params)==null?void 0:E.iconViewBox)??"0 0 24 24"}),u=Y(()=>{var E;return((E=s.params)==null?void 0:E.iconPath)??QY}),c=Y(()=>{var E;return((E=s.params)==null?void 0:E.wrapperTag)??"span"}),d=Y(()=>{var E;return s.disabled||((E=s.params)==null?void 0:E.disabled)||!1}),h=Y(()=>{var E;return s.readOnly||((E=s.params)==null?void 0:E.readOnly)||!1}),f=Y(()=>!d.value&&!h.value),p=Y(()=>d.value?"not-allowed":h.value?"default":"pointer");et(()=>s.modelValue,E=>{typeof E=="number"&&E!==r.value&&(r.value=E)});const g=E=>{var A;return((A=s.params)==null?void 0:A.maxRating)-E+1<=r.value&&!v.value},v=B(!1),C=()=>{v.value=!0},S=()=>{v.value=!1},b=E=>{f.value&&w(E)},w=E=>{var k,O;if(!f.value)return;let A=((k=s.params)==null?void 0:k.maxRating)-E+1;A===r.value&&(A=0),r.value=A,o("update:modelValue",A),o("update",A),o("change",A),(O=s.params)!=null&&O.onUpdate&&s.params.onUpdate(A)},_=E=>{var A;E!==r.value&&(r.value=E,o("update:modelValue",E),o("update",E),o("change",E),(A=s.params)!=null&&A.onUpdate&&s.params.onUpdate(E),D.value=E)},D=B(r.value),T=E=>{E.preventDefault(),E.stopPropagation(),E.stopImmediatePropagation(),r.value=D.value,o("cancel")},I=E=>{E.preventDefault(),_(r.value),o("handleEnter",r.value)},x=()=>{f.value&&(r.value=Math.min(r.value+1%(s.params.maxRating+1),s.params.maxRating),_(r.value))},F=()=>{f.value&&(r.value=Math.max(r.value-1,0),_(r.value))};return t({focus:()=>{var E;(E=i.value)==null||E.focus()}}),(E,A)=>(K(),ce("div",{class:te(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:dn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[zn(Pt(F,["prevent"]),["left"]),zn(Pt(x,["prevent"]),["right"]),zn(Pt(F,["prevent"]),["down"]),zn(Pt(x,["prevent"]),["up"]),zn(Pt(I,["prevent"]),["enter"]),zn(Pt(I,["prevent"]),["tab"]),zn(Pt(T,["prevent"]),["escape"])]},[(K(!0),ce(xt,null,xn(e.params.maxRating,k=>(K(),Ke(yw(c.value),{key:k,class:te(["rating-item",{filled:g(k),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:dn({cursor:p.value,order:e.params.maxRating-k,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(k),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-k+1,tabindex:-1,onClick:Pt(O=>b(k),["prevent","stop"]),onMouseenter:C,onMouseleave:S},{default:me(()=>[Tt(E.$slots,"icon",{index:k,filled:g(k),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:k},()=>[(K(),ce("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[Re("path",{d:u.value},null,8,JY)],8,XY))]),Tt(E.$slots,"overlay",{index:k,filled:g(k),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,ZY))}}),eZ={style:{maxWidth:"180px",lineHeight:"15px"}},tZ=["innerHTML"],HA=it({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=n,i=()=>{r("handleCancel")},a=()=>{r("close")},l=v=>{var C;if(v.format_type==="dropdown"&&v.format_value)try{const S=JSON.parse(v.format_value);if(Array.isArray(S)){const b=S.map(w=>({label:w.name,value:w.name,id:w.name}));return b.unshift({label:"-",value:void 0,id:"-"}),b}}catch(S){console.error("Failed to parse dropdown options",S)}if(v.format_type=="number"&&v.restricted_type=="exact"){const S=((C=v.restricted_value)==null?void 0:C.split(",").map(b=>({label:v.mapping[`!${b}`]||b,value:b,id:b})))||[];return S.unshift({label:"-",value:void 0,id:"-"}),S}return[]},u=Y(()=>l(o.config)),c=B(o.modelValue),d=v=>{c.value=v,r("update:modelValue",v),r("change",v||null)},h=B(u.value),f=B(!1),p=v=>{f.value=!0,v?h.value=u.value.filter(C=>C.label.toLowerCase().includes(v.toLowerCase())):h.value=u.value,setTimeout(()=>{f.value=!1},300)},g=B(null);return rn(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,C)=>(K(),Ke(Qi,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:C[0]||(C[0]=S=>d(S.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:i},{item:me(({item:S,getHighlightedLabel:b,selectedIndex:w,index:_})=>[pe(eu,{hover:w==_,selected:S.value===e.modelValue,label:S.label,onSelect:D=>d(S.value||null),onClick:D=>d(S.value||null)},{label:me(()=>[Re("div",eZ,[qe(Re("span",{innerHTML:b(S.label)},null,8,tZ),[[U(s),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":me(()=>[...C[1]||(C[1]=[st("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),nZ={class:"metric-input-wrapper"},sZ={key:0,class:"error-text input-2"},GA=it({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=B(o.modelValue),i=B(o.modelValue),a=B(!1),l=B(!0),u=B(""),c=Y(()=>{var N;const O=Number.parseInt(String((N=o.config)==null?void 0:N.format_value)||"2",10);return Number.isFinite(O)&&O>=0?O:2}),d=O=>{if(!O)return O;const N=String(O).split(".");return N.length>1&&N[1].length>c.value?c.value===0?N[0]:`${N[0]}.${N[1].slice(0,c.value)}`:String(O)},h=O=>{const N=d(O);N!==O&&b.value?r.value=N:r.value=O},f=O=>{const N=O.target;if(!N)return;const W=N.value||"",X=W.indexOf(".");if(O.key==="."&&c.value===0){O.preventDefault();return}X!==-1&&/[0-9]/.test(O.key)&&W.slice(X+1).length>=c.value&&O.preventDefault()},p=Y(()=>l.value||o.showInlineError?{content:""}:{content:u.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var J;const O=o.config.restricted_type.trim(),N=((J=o.config.restricted_value)==null?void 0:J.split(",").map(Number))||[],[W,X]=N,ie={range:`Enter a value between ${W} and ${X}`,not:`These values are not allowed: ${N.join(", ")}`,exact:"Value is not allowed"}[O];return l.value?"":ie},v=Y(()=>{var N;let O="";return Number((N=o.config)==null?void 0:N.format_value)&&(O+="."+Array.from({length:Number(o.config.format_value)}).map(()=>"0").join("")),`0${O}`});et(()=>o.modelValue,O=>{r.value=O,i.value=O});const C=O=>cm(o.config,O),S=n,b=B(null),w=O=>{const N=O===""?null:O,W=i.value===""?null:i.value;return N!==W},_=O=>{const N=d(O);if(!w(N))return!1;const W=N===""?null:N;return r.value=W,i.value=W,S("update:modelValue",W),S("handleChange",W),!0},D=()=>{r.value=i.value,S("update:modelValue",i.value)},T=(O,N)=>{_(O),S("enter")},I=(O,N)=>{if(a.value){a.value=!1;return}o.saveOnBlur?_(O):D()},x=O=>{if(O===null||O===""){l.value=!0;return}l.value=cm(o.config,Number(O)),u.value=l.value?"":g()},F=(O,N)=>{a.value=!0,o.saveOnEscape?_(O):D(),S("cancel"),setTimeout(()=>{a.value=!1},100)},E=O=>{x(O),S("onValidation",O)},A=()=>{a.value=!0,D(),S("cancel"),setTimeout(()=>{a.value=!1},100)},k=()=>{var O;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(O=b.value)==null||O.focus()};return t({focus:()=>{var O;return(O=b.value)==null?void 0:O.focus()},blur:()=>{var O;return(O=b.value)==null?void 0:O.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>_(r.value),revert:D}),rn(()=>{var O;(O=b.value)==null||O.focus()}),(O,N)=>qe((K(),ce("div",nZ,[pe(Qb,{maxDecimalChar:c.value,modelValue:r.value,"onUpdate:modelValue":N[0]||(N[0]=W=>r.value=W),placeholder:v.value,validatorFnc:C,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:T,onBlur:I,onClear:k,onEscape:F,onCancel:A,onOnValidation:E,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(K(),ce("span",sZ,Ct(u.value),1)):Je("",!0)])),[[U(s),p.value]])}}),oZ={key:2},rZ={class:"wrapper-suffix"},iZ={key:3},aZ=_t(it({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=B(null),i=B(0),a=B(null),l=B(null),u=Y(()=>IF(o.config)),c=B(!1),d=Y(()=>!!fe.value),h=n,f=()=>{c.value=!1,Q(),h("cancel")},p=B(!0),g=re=>{if(re===null||re===""){p.value=!0;return}if(u.value!=="number"){p.value=!0;return}p.value=cm(o.config,Number(re)),C.value=S()},v=()=>{c.value=!0,X()},C=B(""),S=()=>{var de;const re=o.config.restricted_type.trim(),j=((de=o.config.restricted_value)==null?void 0:de.split(",").map(Number))||[],[ge,se]=j,G={range:`Enter a value between ${ge} and ${se}`,not:`These values are not allowed: ${j.join(", ")}`,exact:"Value is not allowed"}[re];return p.value?"":G},b=Y(()=>{var j;const re=Number.parseInt(String((j=o.config)==null?void 0:j.format_value)||"2",10);return Number.isFinite(re)&&re>=0?re:2}),w=re=>{c.value=!0,r.value=re},_=()=>{c.value=!0,Q(),X()},D=re=>{i.value=re,c.value=!0,X()},T=()=>(o.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(j=>j.charAt(0).toUpperCase()+j.slice(1)).join("").replace(/Outline|Solid/g,""),I=B(null),x=B(!0),F=Y(()=>{var re;return{disabled:o.disabled,error:!1,readOnly:!1,isEmpty:((re=r.value)==null?void 0:re.length)===0,wrapperRef:V,active:d,focus:o.focus,bordered:!0}}),E=B(null),A=Y(()=>x.value),k=Y(()=>({disabled:o.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:E,active:A,focus:x.value,bordered:!0})),{argsMain:O}=vs(k),{argsMain:N}=vs(F),W=B(null),X=()=>{mt(()=>{var re;(re=W.value)==null||re.focus()})},ee=re=>{var j;if(re.format_type==="dropdown"&&re.format_value)try{const ge=JSON.parse(re.format_value);if(Array.isArray(ge))return ge.map(se=>({label:se.name,value:se.name,id:se.name}))}catch(ge){console.error("Failed to parse dropdown options",ge)}return re.format_type=="number"&&re.restricted_type=="exact"?((j=re.restricted_value)==null?void 0:j.split(",").map(se=>({label:re.mapping[`!${se}`]||se,value:se,id:se})))||[]:[]},ie=Y(()=>ee(o.config)),ae=Y(()=>{var re;return((re=ie.value.find(j=>j.value===r.value))==null?void 0:re.label)||r.value||"-"}),J=()=>{var re;if(u.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(u.value=="number"){const j=(re=l.value)==null?void 0:re.getValue();h("updateMetric",j||null)}else h("updateMetric",r.value||null);c.value=!1,Q()},{triggerRef:V,popupRef:H,hide:Q,isVisible:fe,show:ve}=Fs({toggleOnClick:!0,appendTo:()=>o.attachTo||"parent",zIndex:1e4,offset:[0,0]}),oe=()=>{switch(u.value){case"number":mt(()=>{var re;(re=l.value)==null||re.focus()});break;case"dropdown":ve(),mt(()=>{var re;(re=I.value)==null||re.focus()});break;case"rating":x.value=!0,mt(()=>{var re;(re=a.value)==null||re.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,c.value=!1},focus:oe,hasChanges:()=>c.value}),rn(()=>{mt(()=>{setTimeout(()=>{oe()},300)})}),(re,j)=>(K(),ce("div",{class:te(re.$style["metric-editor"])},[u.value=="number"?(K(),Ke(GA,{key:0,config:o.config,modelValue:r.value,"onUpdate:modelValue":j[0]||(j[0]=ge=>r.value=ge),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:w,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):u.value=="rating"?(K(),Ke(ys,Kt({key:1,"tab-index":1},U(O),{ref_key:"triggerRef2",ref:E,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:me(()=>[pe($A,{params:{maxRating:o.config.range},modelValue:i.value,"onUpdate:modelValue":j[1]||(j[1]=ge=>i.value=ge),onHandleEnter:D,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:me(()=>[pe(lt,{source:"rating",src:T()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):u.value=="dropdown"?(K(),ce("div",oZ,[pe(ys,Kt(U(N),{ref_key:"triggerRef",ref:V,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:me(({})=>[Re("div",rZ,[pe(lt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:me(()=>[qe((K(),ce("span",null,[st(Ct(ae.value||""),1)])),[[U(s),{content:ae.value}]])]),_:1},16),Re("div",{ref_key:"popupRef",ref:H},[U(fe)?(K(),Ke(HA,{key:0,ref_key:"metricEditorDropdownRef",ref:I,config:o.config,modelValue:r.value,"onUpdate:modelValue":j[2]||(j[2]=ge=>r.value=ge),onChange:_,onCancel:f},null,8,["config","modelValue"])):Je("",!0)],512)])):(K(),ce("span",iZ,"Formular")),qe((K(),Ke(vt,{ref_key:"confirmButtonRef",ref:W,onHandleClick:J,"tab-index":"1",onKeypress:[zn(Pt(oe,["shift","prevent"]),["tab"]),zn(Pt(f,["prevent"]),["escape"])],disabled:!p.value},{default:me(()=>[pe(lt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[U(s),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),lZ=_t(it({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const s=Qt,o=e,r=n,i=B(!1),a=B(null),l=B(null),u=()=>{i.value=!i.value},c=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await mt(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:o.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),r("loseFocus")},p=g=>{const C={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),r("focusOnSearch",g)},Tab:()=>{i.value&&c()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];C&&C()};return et(i,g=>{g&&r("open")}),t({hide:c,show:d}),(g,v)=>(K(),ce("div",{class:te([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[Re("div",{class:te(g.$style["metric-label"]),onClick:Pt(u,["stop"])},[Tt(g.$slots,"default",{open:i.value},()=>[qe((K(),ce("span",{class:te(g.$style["metric-name"])},[st(Ct(e.label),1)],2)),[[U(s),{content:e.label}]]),e.morpheme&&i.value?(K(),ce("small",{key:0,class:te(g.$style["metric-morpheme"])}," ("+Ct(e.morpheme)+") ",3)):Je("",!0)])],2),pe(jD,{mode:"out-in",name:"slide"},{default:me(()=>[i.value?(K(),Ke(aZ,{key:`editor-${e.config.id}`,"read-only":!1,focus:i.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Je("",!0)]),_:1})],34))}}),[["__cssModules",{$style:{"metric-item":"_metric-item_18ft8_1","metric-label":"_metric-label_18ft8_11",open:"_open_18ft8_19","metric-name":"_metric-name_18ft8_23","metric-morpheme":"_metric-morpheme_18ft8_29"}}]]);var kc=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(kc||{});function UA(e,t){return function(){return e.apply(t,arguments)}}const{toString:uZ}=Object.prototype,{getPrototypeOf:nS}=Object,{iterator:Am,toStringTag:WA}=Symbol,km=(e=>t=>{const n=uZ.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kr=e=>(e=e.toLowerCase(),t=>km(t)===e),Om=e=>t=>typeof t===e,{isArray:Oc}=Array,Mc=Om("undefined");function sf(e){return e!==null&&!Mc(e)&&e.constructor!==null&&!Mc(e.constructor)&&ho(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zA=kr("ArrayBuffer");function cZ(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zA(e.buffer),t}const dZ=Om("string"),ho=Om("function"),jA=Om("number"),of=e=>e!==null&&typeof e=="object",hZ=e=>e===!0||e===!1,Mm=e=>{if(km(e)!=="object")return!1;const t=nS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(WA in e)&&!(Am in e)},fZ=e=>{if(!of(e)||sf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},pZ=kr("Date"),gZ=kr("File"),mZ=kr("Blob"),vZ=kr("FileList"),yZ=e=>of(e)&&ho(e.pipe),wZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ho(e.append)&&((t=km(e))==="formdata"||t==="object"&&ho(e.toString)&&e.toString()==="[object FormData]"))},CZ=kr("URLSearchParams"),[bZ,SZ,EZ,_Z]=["ReadableStream","Request","Response","Headers"].map(kr),RZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,o;if(typeof e!="object"&&(e=[e]),Oc(e))for(s=0,o=e.length;s<o;s++)t.call(null,e[s],s,e);else{if(sf(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(s=0;s<i;s++)a=r[s],t.call(null,e[a],a,e)}}function KA(e,t){if(sf(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,o;for(;s-- >0;)if(o=n[s],t===o.toLowerCase())return o;return null}const tu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qA=e=>!Mc(e)&&e!==tu;function sS(){const{caseless:e,skipUndefined:t}=qA(this)&&this||{},n={},s=(o,r)=>{const i=e&&KA(n,r)||r;Mm(n[i])&&Mm(o)?n[i]=sS(n[i],o):Mm(o)?n[i]=sS({},o):Oc(o)?n[i]=o.slice():(!t||!Mc(o))&&(n[i]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&rf(arguments[o],s);return n}const DZ=(e,t,n,{allOwnKeys:s}={})=>(rf(t,(o,r)=>{n&&ho(o)?e[r]=UA(o,n):e[r]=o},{allOwnKeys:s}),e),TZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),IZ=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},xZ=(e,t,n,s)=>{let o,r,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),r=o.length;r-- >0;)i=o[r],(!s||s(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&nS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},FZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},PZ=e=>{if(!e)return null;if(Oc(e))return e;let t=e.length;if(!jA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},AZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&nS(Uint8Array)),kZ=(e,t)=>{const s=(e&&e[Am]).call(e);let o;for(;(o=s.next())&&!o.done;){const r=o.value;t.call(e,r[0],r[1])}},OZ=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},MZ=kr("HTMLFormElement"),NZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,o){return s.toUpperCase()+o}),YA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),LZ=kr("RegExp"),ZA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};rf(n,(o,r)=>{let i;(i=t(o,r,e))!==!1&&(s[r]=i||o)}),Object.defineProperties(e,s)},VZ=e=>{ZA(e,(t,n)=>{if(ho(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(ho(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},BZ=(e,t)=>{const n={},s=o=>{o.forEach(r=>{n[r]=!0})};return Oc(e)?s(e):s(String(e).split(t)),n},$Z=()=>{},HZ=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function GZ(e){return!!(e&&ho(e.append)&&e[WA]==="FormData"&&e[Am])}const UZ=e=>{const t=new Array(10),n=(s,o)=>{if(of(s)){if(t.indexOf(s)>=0)return;if(sf(s))return s;if(!("toJSON"in s)){t[o]=s;const r=Oc(s)?[]:{};return rf(s,(i,a)=>{const l=n(i,o+1);!Mc(l)&&(r[a]=l)}),t[o]=void 0,r}}return s};return n(e,0)},WZ=kr("AsyncFunction"),zZ=e=>e&&(of(e)||ho(e))&&ho(e.then)&&ho(e.catch),XA=((e,t)=>e?setImmediate:t?((n,s)=>(tu.addEventListener("message",({source:o,data:r})=>{o===tu&&r===n&&s.length&&s.shift()()},!1),o=>{s.push(o),tu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ho(tu.postMessage)),jZ=typeof queueMicrotask<"u"?queueMicrotask.bind(tu):typeof q<"u"&&q.nextTick||XA,Be={isArray:Oc,isArrayBuffer:zA,isBuffer:sf,isFormData:wZ,isArrayBufferView:cZ,isString:dZ,isNumber:jA,isBoolean:hZ,isObject:of,isPlainObject:Mm,isEmptyObject:fZ,isReadableStream:bZ,isRequest:SZ,isResponse:EZ,isHeaders:_Z,isUndefined:Mc,isDate:pZ,isFile:gZ,isBlob:mZ,isRegExp:LZ,isFunction:ho,isStream:yZ,isURLSearchParams:CZ,isTypedArray:AZ,isFileList:vZ,forEach:rf,merge:sS,extend:DZ,trim:RZ,stripBOM:TZ,inherits:IZ,toFlatObject:xZ,kindOf:km,kindOfTest:kr,endsWith:FZ,toArray:PZ,forEachEntry:kZ,matchAll:OZ,isHTMLForm:MZ,hasOwnProperty:YA,hasOwnProp:YA,reduceDescriptors:ZA,freezeMethods:VZ,toObjectSet:BZ,toCamelCase:NZ,noop:$Z,toFiniteNumber:HZ,findKey:KA,global:tu,isContextDefined:qA,isSpecCompliantForm:GZ,toJSONObject:UZ,isAsyncFn:WZ,isThenable:zZ,setImmediate:XA,asap:jZ,isIterable:e=>e!=null&&ho(e[Am])};function qt(e,t,n,s,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status?o.status:null)}Be.inherits(qt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const JA=qt.prototype,QA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{QA[e]={value:e}}),Object.defineProperties(qt,QA),Object.defineProperty(JA,"isAxiosError",{value:!0}),qt.from=(e,t,n,s,o,r)=>{const i=Object.create(JA);Be.toFlatObject(e,i,function(c){return c!==Error.prototype},u=>u!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return qt.call(i,a,l,n,s,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",r&&Object.assign(i,r),i};const KZ=null;function oS(e){return Be.isPlainObject(e)||Be.isArray(e)}function ek(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function tk(e,t,n){return e?e.concat(t).map(function(o,r){return o=ek(o),!n&&r?"["+o+"]":o}).join(n?".":""):t}function qZ(e){return Be.isArray(e)&&!e.some(oS)}const YZ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function Nm(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Be.isUndefined(v[g])});const s=n.metaTokens,o=n.visitor||c,r=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(Be.isDate(p))return p.toISOString();if(Be.isBoolean(p))return p.toString();if(!l&&Be.isBlob(p))throw new qt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(p)||Be.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,g,v){let C=p;if(p&&!v&&typeof p=="object"){if(Be.endsWith(g,"{}"))g=s?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&qZ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(C=Be.toArray(p)))return g=ek(g),C.forEach(function(b,w){!(Be.isUndefined(b)||b===null)&&t.append(i===!0?tk([g],w,r):i===null?g:g+"[]",u(b))}),!1}return oS(p)?!0:(t.append(tk(v,g,r),u(p)),!1)}const d=[],h=Object.assign(YZ,{defaultVisitor:c,convertValue:u,isVisitable:oS});function f(p,g){if(!Be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Be.forEach(p,function(C,S){(!(Be.isUndefined(C)||C===null)&&o.call(t,C,Be.isString(S)?S.trim():S,g,h))===!0&&f(C,g?g.concat(S):[S])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function nk(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function rS(e,t){this._pairs=[],e&&Nm(e,this,t)}const sk=rS.prototype;sk.append=function(t,n){this._pairs.push([t,n])},sk.toString=function(t){const n=t?function(s){return t.call(this,s,nk)}:nk;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function ZZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ok(e,t,n){if(!t)return e;const s=n&&n.encode||ZZ;Be.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let r;if(o?r=o(t,n):r=Be.isURLSearchParams(t)?t.toString():new rS(t,n).toString(s),r){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class rk{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(s){s!==null&&t(s)})}}const ik={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},XZ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:rS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},iS=typeof window<"u"&&typeof document<"u",aS=typeof navigator=="object"&&navigator||void 0,JZ=iS&&(!aS||["ReactNative","NativeScript","NS"].indexOf(aS.product)<0),QZ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",eX=iS&&window.location.href||"http://localhost",Gs={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:iS,hasStandardBrowserEnv:JZ,hasStandardBrowserWebWorkerEnv:QZ,navigator:aS,origin:eX},Symbol.toStringTag,{value:"Module"})),...XZ};function tX(e,t){return Nm(e,new Gs.classes.URLSearchParams,{visitor:function(n,s,o,r){return Gs.isNode&&Be.isBuffer(n)?(this.append(s,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}function nX(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function sX(e){const t={},n=Object.keys(e);let s;const o=n.length;let r;for(s=0;s<o;s++)r=n[s],t[r]=e[r];return t}function ak(e){function t(n,s,o,r){let i=n[r++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=r>=n.length;return i=!i&&Be.isArray(o)?o.length:i,l?(Be.hasOwnProp(o,i)?o[i]=[o[i],s]:o[i]=s,!a):((!o[i]||!Be.isObject(o[i]))&&(o[i]=[]),t(n,s,o[i],r)&&Be.isArray(o[i])&&(o[i]=sX(o[i])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(s,o)=>{t(nX(s),o,n,0)}),n}return null}function oX(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const af={transitional:ik,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",o=s.indexOf("application/json")>-1,r=Be.isObject(t);if(r&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return o?JSON.stringify(ak(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return tX(t,this.formSerializer).toString();if((a=Be.isFileList(t))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Nm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return r||o?(n.setContentType("application/json",!1),oX(t)):t}],transformResponse:[function(t){const n=this.transitional||af.transitional,s=n&&n.forcedJSONParsing,o=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(s&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?qt.from(a,qt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gs.classes.FormData,Blob:Gs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{af.headers[e]={}});const rX=Be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),iX=e=>{const t={};let n,s,o;return e&&e.split(`
143
143
  `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),s=i.substring(o+1).trim(),!(!n||t[n]&&rX[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},lk=Symbol("internals");function lf(e){return e&&String(e).trim().toLowerCase()}function Lm(e){return e===!1||e==null?e:Be.isArray(e)?e.map(Lm):String(e)}function aX(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const lX=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lS(e,t,n,s,o){if(Be.isFunction(s))return s.call(this,t,n);if(o&&(t=n),!!Be.isString(t)){if(Be.isString(s))return t.indexOf(s)!==-1;if(Be.isRegExp(s))return s.test(t)}}function uX(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function cX(e,t){const n=Be.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(o,r,i){return this[s].call(this,t,o,r,i)},configurable:!0})})}let fo=class{constructor(t){t&&this.set(t)}set(t,n,s){const o=this;function r(a,l,u){const c=lf(l);if(!c)throw new Error("header name must be a non-empty string");const d=Be.findKey(o,c);(!d||o[d]===void 0||u===!0||u===void 0&&o[d]!==!1)&&(o[d||l]=Lm(a))}const i=(a,l)=>Be.forEach(a,(u,c)=>r(u,c,l));if(Be.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(Be.isString(t)&&(t=t.trim())&&!lX(t))i(iX(t),n);else if(Be.isObject(t)&&Be.isIterable(t)){let a={},l,u;for(const c of t){if(!Be.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[u=c[0]]=(l=a[u])?Be.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}i(a,n)}else t!=null&&r(n,t,s);return this}get(t,n){if(t=lf(t),t){const s=Be.findKey(this,t);if(s){const o=this[s];if(!n)return o;if(n===!0)return aX(o);if(Be.isFunction(n))return n.call(this,o,s);if(Be.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=lf(t),t){const s=Be.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||lS(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let o=!1;function r(i){if(i=lf(i),i){const a=Be.findKey(s,i);a&&(!n||lS(s,s[a],a,n))&&(delete s[a],o=!0)}}return Be.isArray(t)?t.forEach(r):r(t),o}clear(t){const n=Object.keys(this);let s=n.length,o=!1;for(;s--;){const r=n[s];(!t||lS(this,this[r],r,t,!0))&&(delete this[r],o=!0)}return o}normalize(t){const n=this,s={};return Be.forEach(this,(o,r)=>{const i=Be.findKey(s,r);if(i){n[i]=Lm(o),delete n[r];return}const a=t?uX(r):String(r).trim();a!==r&&delete n[r],n[a]=Lm(o),s[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Be.forEach(this,(s,o)=>{s!=null&&s!==!1&&(n[o]=t&&Be.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
144
144
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(o=>s.set(o)),s}static accessor(t){const s=(this[lk]=this[lk]={accessors:{}}).accessors,o=this.prototype;function r(i){const a=lf(i);s[a]||(cX(o,i),s[a]=!0)}return Be.isArray(t)?t.forEach(r):r(t),this}};fo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Be.reduceDescriptors(fo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),Be.freezeMethods(fo);function uS(e,t){const n=this||af,s=t||n,o=fo.from(s.headers);let r=s.data;return Be.forEach(e,function(a){r=a.call(n,r,o.normalize(),t?t.status:void 0)}),o.normalize(),r}function uk(e){return!!(e&&e.__CANCEL__)}function Nc(e,t,n){qt.call(this,e??"canceled",qt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(Nc,qt,{__CANCEL__:!0});function ck(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new qt("Request failed with status code "+n.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function dX(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function hX(e,t){e=e||10;const n=new Array(e),s=new Array(e);let o=0,r=0,i;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=s[r];i||(i=u),n[o]=l,s[o]=u;let d=r,h=0;for(;d!==o;)h+=n[d++],d=d%e;if(o=(o+1)%e,o===r&&(r=(r+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(h*1e3/f):void 0}}function fX(e,t){let n=0,s=1e3/t,o,r;const i=(u,c=Date.now())=>{n=c,o=null,r&&(clearTimeout(r),r=null),e(...u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=s?i(u,c):(o=u,r||(r=setTimeout(()=>{r=null,i(o)},s-d)))},()=>o&&i(o)]}const Vm=(e,t,n=3)=>{let s=0;const o=hX(50,250);return fX(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,l=i-s,u=o(l),c=i<=a;s=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-i)/u:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},dk=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},hk=e=>(...t)=>Be.asap(()=>e(...t)),pX=Gs.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Gs.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Gs.origin),Gs.navigator&&/(msie|trident)/i.test(Gs.navigator.userAgent)):()=>!0,gX=Gs.hasStandardBrowserEnv?{write(e,t,n,s,o,r,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Be.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Be.isString(s)&&a.push(`path=${s}`),Be.isString(o)&&a.push(`domain=${o}`),r===!0&&a.push("secure"),Be.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function mX(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function vX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function fk(e,t,n){let s=!mX(t);return e&&(s||n==!1)?vX(e,t):t}const pk=e=>e instanceof fo?{...e}:e;function nu(e,t){t=t||{};const n={};function s(u,c,d,h){return Be.isPlainObject(u)&&Be.isPlainObject(c)?Be.merge.call({caseless:h},u,c):Be.isPlainObject(c)?Be.merge({},c):Be.isArray(c)?c.slice():c}function o(u,c,d,h){if(Be.isUndefined(c)){if(!Be.isUndefined(u))return s(void 0,u,d,h)}else return s(u,c,d,h)}function r(u,c){if(!Be.isUndefined(c))return s(void 0,c)}function i(u,c){if(Be.isUndefined(c)){if(!Be.isUndefined(u))return s(void 0,u)}else return s(void 0,c)}function a(u,c,d){if(d in t)return s(u,c);if(d in e)return s(void 0,u)}const l={url:r,method:r,data:r,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,c,d)=>o(pk(u),pk(c),d,!0)};return Be.forEach(Object.keys({...e,...t}),function(c){const d=l[c]||o,h=d(e[c],t[c],c);Be.isUndefined(h)&&d!==a||(n[c]=h)}),n}const gk=e=>{const t=nu({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:r,headers:i,auth:a}=t;if(t.headers=i=fo.from(i),t.url=ok(fk(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Be.isFormData(n)){if(Gs.hasStandardBrowserEnv||Gs.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Be.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&i.set(c,d)})}}if(Gs.hasStandardBrowserEnv&&(s&&Be.isFunction(s)&&(s=s(t)),s||s!==!1&&pX(t.url))){const l=o&&r&&gX.read(r);l&&i.set(o,l)}return t},yX=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const o=gk(e);let r=o.data;const i=fo.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=o,c,d,h,f,p;function g(){f&&f(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function C(){if(!v)return;const b=fo.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:b,config:e,request:v};ck(function(T){n(T),g()},function(T){s(T),g()},_),v=null}"onloadend"in v?v.onloadend=C:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(C)},v.onabort=function(){v&&(s(new qt("Request aborted",qt.ECONNABORTED,e,v)),v=null)},v.onerror=function(w){const _=w&&w.message?w.message:"Network Error",D=new qt(_,qt.ERR_NETWORK,e,v);D.event=w||null,s(D),v=null},v.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||ik;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),s(new qt(w,_.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,v)),v=null},r===void 0&&i.setContentType(null),"setRequestHeader"in v&&Be.forEach(i.toJSON(),function(w,_){v.setRequestHeader(_,w)}),Be.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),a&&a!=="json"&&(v.responseType=o.responseType),u&&([h,p]=Vm(u,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=Vm(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(o.cancelToken||o.signal)&&(c=b=>{v&&(s(!b||b.type?new Nc(null,e,v):b),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));const S=dX(o.url);if(S&&Gs.protocols.indexOf(S)===-1){s(new qt("Unsupported protocol "+S+":",qt.ERR_BAD_REQUEST,e));return}v.send(r||null)})},wX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,o;const r=function(u){if(!o){o=!0,a();const c=u instanceof Error?u:this.reason;s.abort(c instanceof qt?c:new Nc(c instanceof Error?c.message:c))}};let i=t&&setTimeout(()=>{i=null,r(new qt(`timeout ${t} of ms exceeded`,qt.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(r):u.removeEventListener("abort",r)}),e=null)};e.forEach(u=>u.addEventListener("abort",r));const{signal:l}=s;return l.unsubscribe=()=>Be.asap(a),l}},CX=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,o;for(;s<n;)o=s+t,yield e.slice(s,o),s=o},bX=async function*(e,t){for await(const n of SX(e))yield*CX(n,t)},SX=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},mk=(e,t,n,s)=>{const o=bX(e,t);let r=0,i,a=l=>{i||(i=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await o.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},vk=64*1024,{isFunction:Bm}=Be,EX=(({Request:e,Response:t})=>({Request:e,Response:t}))(Be.global),{ReadableStream:yk,TextEncoder:wk}=Be.global,Ck=(e,...t)=>{try{return!!e(...t)}catch{return!1}},_X=e=>{e=Be.merge.call({skipUndefined:!0},EX,e);const{fetch:t,Request:n,Response:s}=e,o=t?Bm(t):typeof fetch=="function",r=Bm(n),i=Bm(s);if(!o)return!1;const a=o&&Bm(yk),l=o&&(typeof wk=="function"?(p=>g=>p.encode(g))(new wk):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=r&&a&&Ck(()=>{let p=!1;const g=new n(Gs.origin,{body:new yk,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),c=i&&a&&Ck(()=>Be.isReadableStream(new s("").body)),d={stream:c&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let C=g&&g[p];if(C)return C.call(g);throw new qt(`Response type '${p}' is not supported`,qt.ERR_NOT_SUPPORT,v)})});const h=async p=>{if(p==null)return 0;if(Be.isBlob(p))return p.size;if(Be.isSpecCompliantForm(p))return(await new n(Gs.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Be.isArrayBufferView(p)||Be.isArrayBuffer(p))return p.byteLength;if(Be.isURLSearchParams(p)&&(p=p+""),Be.isString(p))return(await l(p)).byteLength},f=async(p,g)=>{const v=Be.toFiniteNumber(p.getContentLength());return v??h(g)};return async p=>{let{url:g,method:v,data:C,signal:S,cancelToken:b,timeout:w,onDownloadProgress:_,onUploadProgress:D,responseType:T,headers:I,withCredentials:x="same-origin",fetchOptions:F}=gk(p),E=t||fetch;T=T?(T+"").toLowerCase():"text";let A=wX([S,b&&b.toAbortSignal()],w),k=null;const O=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let N;try{if(D&&u&&v!=="get"&&v!=="head"&&(N=await f(I,C))!==0){let J=new n(g,{method:"POST",body:C,duplex:"half"}),V;if(Be.isFormData(C)&&(V=J.headers.get("content-type"))&&I.setContentType(V),J.body){const[H,Q]=dk(N,Vm(hk(D)));C=mk(J.body,vk,H,Q)}}Be.isString(x)||(x=x?"include":"omit");const W=r&&"credentials"in n.prototype,X={...F,signal:A,method:v.toUpperCase(),headers:I.normalize().toJSON(),body:C,duplex:"half",credentials:W?x:void 0};k=r&&new n(g,X);let ee=await(r?E(k,F):E(g,X));const ie=c&&(T==="stream"||T==="response");if(c&&(_||ie&&O)){const J={};["status","statusText","headers"].forEach(fe=>{J[fe]=ee[fe]});const V=Be.toFiniteNumber(ee.headers.get("content-length")),[H,Q]=_&&dk(V,Vm(hk(_),!0))||[];ee=new s(mk(ee.body,vk,H,()=>{Q&&Q(),O&&O()}),J)}T=T||"text";let ae=await d[Be.findKey(d,T)||"text"](ee,p);return!ie&&O&&O(),await new Promise((J,V)=>{ck(J,V,{data:ae,headers:fo.from(ee.headers),status:ee.status,statusText:ee.statusText,config:p,request:k})})}catch(W){throw O&&O(),W&&W.name==="TypeError"&&/Load failed|fetch/i.test(W.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,p,k),{cause:W.cause||W}):qt.from(W,W&&W.code,p,k)}}},RX=new Map,bk=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:o}=t,r=[s,o,n];let i=r.length,a=i,l,u,c=RX;for(;a--;)l=r[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:_X(t)),c=u;return u};bk();const cS={http:KZ,xhr:yX,fetch:{get:bk}};Be.forEach(cS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Sk=e=>`- ${e}`,DX=e=>Be.isFunction(e)||e===null||e===!1;function TX(e,t){e=Be.isArray(e)?e:[e];const{length:n}=e;let s,o;const r={};for(let i=0;i<n;i++){s=e[i];let a;if(o=s,!DX(s)&&(o=cS[(a=String(s)).toLowerCase()],o===void 0))throw new qt(`Unknown adapter '${a}'`);if(o&&(Be.isFunction(o)||(o=o.get(t))))break;r[a||"#"+i]=o}if(!o){const i=Object.entries(r).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
145
145
  `+i.map(Sk).join(`
@@ -251,4 +251,4 @@ See ${GN(e,t)}`;return Array.isArray(s)?s.concat(r):[s,r]}var nge={1:"Charting A
251
251
  If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),Wf(c)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);Wf(`to see all the valid ${s} properties please check: ${l}`)}}};function Ege(e,t,n){const s={},o=e.filter(r=>!t.some(i=>i===r));if(o.length>0)for(const r of o)s[r]=JE({inputValue:r,allSuggestions:n}).values;return s}var _ge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Rge={moduleName:"Validation",version:ut,beans:[Sge]};function H2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var Dge=class extends We{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(r=>{const i=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return i||a}):s.childrenAfterFilter=s.childrenAfterGroup,H2(s)};if(this.doingTreeDataFiltering()){const s=(r,i)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const l=r.childrenAfterGroup[a],u=i||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(r.childrenAfterGroup[a],u):n(l,u)}n(r,i)},o=r=>s(r,!1);t.executeFromRootNode(o)}else{const s=o=>n(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},Tge=class extends I0{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const r=Xf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,r),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(r),this.setupLeft(r),this.setupHover(r),this.setupFocus(r),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(r),this.setupUi(),r.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(r);const i=()=>this.onColDefChanged(r);r.addManagedListeners(this.column,{colDefChanged:i}),r.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&i()}}),r.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return Ft(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=hr("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new yd(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();sd(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var i;const{beans:t}=this;if(Un(t)===this.eGui)return;const o=Su(t,this.eGui,null,e.shiftKey);if(o){(i=t.headerNavigation)==null||i.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;Ru(e);case Oe.ENTER:t&&bu(this.eGui)&&e.preventDefault();break;case Oe.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&pu(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,r=!!(o&&o.key===Oe.TAB);if(o&&r){const i=o.shiftKey;bu(this.eGui,i)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new T0(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!$o(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:s}=this,o=r=>{if((r==null?void 0:r.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const i=this.comp.getFloatingFilterComp();i&&i.then(a=>{if(a){if(s.get("enableFilterHandlers")){const c=r;let d="filter";c!=null&&c.afterFloatingFilter?d="ui":c!=null&&c.afterDataChange?d="dataChanged":(r==null?void 0:r.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),u=r?{...r,columns:r.columns??[],source:r.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,u)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:o}),t!=null&&t.isFilterActive(n)&&o(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,o=this.active?s==null?void 0:s.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!o?this.updateCompDetails(e,o,n):r.then(i=>{!i||s!=null&&s.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,n):this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var s;if(!e)return;let n=e.params;(s=this.comp.getFloatingFilterComp())==null||s.then(o=>{var r;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Ds(((r=this.beans.colFilter)==null?void 0:r.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function Ige(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function xge(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var Fge={moduleName:"SharedMenu",version:ut,beans:[Hle],apiFunctions:{showColumnMenu:Ige,hidePopupMenu:xge}},Pge=class extends lae{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:s}=e,o=t.getBoundingClientRect(),r=this.getParentRect();this.setAlignedTo(t,n);let i=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-r.top,0),u=n.clientWidth>0?n.clientWidth:200;i||(n.style.minWidth=`${u}px`,i=!0);const d=r.right-r.left-u;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return o.right-r.left-2}function p(){return o.left-r.left-u}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,s instanceof MouseEvent?s:void 0)})}callPostProcessPopup(e,t,n,s,o){const r=this.gos.getCallback("postProcessPopup");if(r){const{column:i,rowNode:a}=e;r({column:i,rowNode:a,ePopup:n,type:t,eventSource:s,mouseEvent:o})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ga(e)}},Sy={moduleName:"Popup",version:ut,beans:[Pge]},Age=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function kge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function Oge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function Mge(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function Nge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function Lge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Vge(e,t,n){const{gos:s,colModel:o,colFilter:r}=e;n&&!s.get("enableFilterHandlers")&&(Xe(288),n=!1);const i=o.getColDefCol(t);return i?(r==null?void 0:r.getModelForColumn(i,n))??null:null}function Bge(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function $ge(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Hge(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function Gge(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function Uge(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){Xe(287);return}const{colId:r,action:i}=t;if(r){const a=n.getColById(r);a&&(s==null||s.updateModel(a,i))}else s==null||s.updateAllModels(i)}var Wge={filterHandler:()=>({doesFilterPass:()=>!0})},zge=class extends We{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...JL},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,s;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((s=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:s.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:s,dataTypeSvc:o,filterManager:r}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const i=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((u,c)=>{const d=e[c];i.push(this.setModelOnFilterWrapper(u,d)),l.delete(c)}),l.forEach(u=>{const c=s.getColDefCol(u)||s.getCol(u);if(!c){Xe(62,{colId:u});return}if(!c.isFilterAllowed()){Xe(63,{colId:u});return}const d=this.getOrCreateFilterWrapper(c,!0);if(!d){Xe(64,{colId:u});return}i.push(this.setModelOnFilterWrapper(d,e[u],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{i.push(this.setModelOnFilterWrapper(l,null))});jn.all(i).then(()=>{const l=this.getModel(!0),u=[];this.allColumnFilters.forEach((c,d)=>{const h=a?a[d]:null,f=l?l[d]:null;kf(h,f)||u.push(c.column)}),u.length>0?r==null||r.onFilterChanged({columns:u,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var r;const t={},{allColumnFilters:n,initialModel:s,beans:{colModel:o}}=this;if(n.forEach((i,a)=>{const l=this.getModelFromFilterWrapper(i);dt(l)&&(t[a]=l)}),!e)for(const i of Object.keys(s)){const a=s[i];dt(a)&&!n.has(i)&&((r=o.getCol(i))!=null&&r.isFilterAllowed())&&(t[i]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const o=t[s];this.state.set(s,{model:Ds(this.model,s),state:o})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((s,o)=>{const r=s.state;r!=null&&(n=!0,t[o]=r)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return Ds(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(Xe(66),null):s.getModel():Ds(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=u=>u?u.isFilterActive?u.isFilterActive():(Xe(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!AE(n),o=u=>{if(!u.isPrimary())return!0;const d=!t.isPivotActive();return!u.isValueActive()||!d?!1:t.isPivotMode()?!0:s},r=[],i=[],a=(u,c,d)=>{c&&(o(u)?r.push(d):i.push(d))},l=[];return this.allColumnFilters.forEach(u=>{const c=u.column,d=c.getColId();if(u.isHandler)l.push(jn.resolve().then(()=>{a(c,this.isHandlerActive(c),{colId:d,isHandler:!0,handler:u.handler,handlerParams:u.handlerParams})}));else{const h=cl(u);h&&l.push(h.then(f=>{a(c,e(f),{colId:d,isHandler:!1,comp:f})}))}}),jn.all(l).then(()=>{this.activeAggregateFilters=r,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){var s;const n=[];return this.allColumnFilters.forEach(o=>{const r=o.column;if(o.isHandler)n.push(jn.resolve().then(()=>{this.setColFilterActive(r,this.isHandlerActive(r),e,t)}));else{const i=cl(o);i&&n.push(i.then(a=>{this.setColFilterActive(r,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),jn.all(n)}doFiltersPass(e,t,n){const{data:s,aggData:o}=e,r=n?this.activeAggregateFilters:this.activeColumnFilters,i=n?o:s,a=this.model;for(let l=0;l<r.length;l++){const u=r[l],{colId:c,isHandler:d}=u;if(c!==t)if(d){const{handler:h,handlerParams:f}=u;if(!h.doesFilterPass({node:e,data:i,model:Ds(a,c),handlerParams:f}))return!1}else{const h=u.comp;if(typeof h.doesFilterPass!="function"){Sn(91);continue}if(!h.doesFilterPass({node:e,data:i}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,s=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,s=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(o=>{var a,l,u;const{column:r,isHandler:i}=o;s!==r.getColId()&&(i&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(u=cl(o,i))==null||u.then(c=>{typeof(c==null?void 0:c.onAnyFilterChanged)=="function"&&c.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var r,i;const s=n.isHandler;s&&((i=(r=n.handler).onNewRowsLoaded)==null||i.call(r));const o=cl(n,s);o&&t.push(o.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),jn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:s}=this.beans;return(o,r)=>{const i=r?s.getCol(r):e;return i?n.getValue(i,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():Ds(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=dt(Ds(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?cl(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=cl(t);return n?n.then(s=>({comp:s,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return Woe(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":Aae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,r){const i=()=>{const u=this.createFilterCompParams(e,o,r),c=s(u,o);return Kre(this.beans.userCompFactory,t,c,n)},a=i();return a?{compDetails:a,createFilterUi:u=>(u?i():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,s){var d,h;const o=this.beans.selectableFilter;o!=null&&o.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:r,handlerParams:i,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!r,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:r,handlerGenerator:a,handlerParams:i};const{compDetails:u,createFilterUi:c}=l;return this.isGlobalButtons&&((h=(d=u.params)==null?void 0:d.buttons)!=null&&h.length||Xe(281,{colId:e.getColId()})),{compDetails:u,handler:r,handlerGenerator:a,handlerParams:i,createFilterUi:c}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return Ft(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:o=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),o))??!0,rowModel:s})}createFilterCompParams(e,t,n,s){const o=this.filterChangedCallbackFactory(e),r=this.createBaseFilterParams(e,s);if(r.filterChangedCallback=o,r.filterModifiedCallback=s?()=>{}:i=>this.filterModified(e,i),t){const i=r,a=e.getColId(),l=Ds(this.model,a);i.model=l,i.state=this.state.get(a)??{model:l},i.onModelChange=(u,c)=>{this.updateStoredModel(a,u),this.refreshHandlerAndUi(e,u,"ui",!1,c).then(()=>{o({...c,source:"columnFilter"})})},i.onStateChange=u=>{this.updateState(e,u),this.updateOrRefreshFilterUi(e)},i.onAction=(u,c,d)=>{this.updateModel(e,u,c),this.dispatchLocalEvent({type:"filterAction",column:e,action:u,event:d})},i.getHandler=()=>this.getHandler(e,!0),i.onUiChange=u=>this.filterUiChanged(e,u),i.source=n}return r}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const s=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(n),o}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:s,handlerParams:o,createFilterUi:r}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),i=e.getColId();if(n)return delete this.initialModel[i],(a=n.init)==null||a.call(n,{...o,source:"init",model:Ds(this.model,i)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,r)};if(r){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,r,u=>{l.filter=u??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:r}=this.beans;let i;const a=p=>{const g=p.filter;if(yL(g)){const v=g.handler;return v||(i=g.doesFilterPass,i?()=>({doesFilterPass:i}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),u=l?a(t):void 0,c=p=>()=>this.createBean(r.createDynamicBean(p,!0));let d,h;if(typeof u=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[u];p!=null?d=p:Cae.has(u)&&(d=c(u),h=u)}else d=u;if(!d){let p;const{compName:g,jsComp:v,fwComp:C}=EL(o,t);g?p=g:v==null&&C==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=c(h))}return d?{filterHandler:d,handlerNameOrCallback:i??h}:l?(os(s)&&Xe(277,{colId:e.getColId()}),Wge):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=VE(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:r,filterHandler:i}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,i,o);return{handler:a,handlerParams:l,handlerGenerator:r??i}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(Ft(this.gos,{column:e,colDef:s})),r=this.createHandlerParams(e,n);return{handler:o,handlerParams:r}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return Ft(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:r=>{var i;return((i=this.beans.filterManager)==null?void 0:i.doesRowPassOtherFilters(s,r))??!0},onModelChange:(r,i)=>{this.updateStoredModel(s,r),this.refreshHandlerAndUi(e,r,"handler",!1,i).then(()=>{o({...i,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((r,i)=>{let a;r.column.isPrimary()?a=t.getColDefCol(i):a=t.getCol(i),!(a&&a===r.column)&&(e.push(r.column),this.disposeFilterWrapper(r,"columnChanged"),this.disposeColumnListener(i))});const o=s&&e.every(r=>s.isGroupFilter(r));e.length>0&&!o&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:s,selectableFilter:o}=this.beans,r=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(Qf(p))})},i=e.getColDef(),a=o!=null&&o.isSelectable(i)?o.getFilterDef(e,i):i,l=Lae(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",u=this.gos.get("enableFilterHandlers"),c=VE(n,a,this.createFilterCompParams(e,u,"init",!0)),d=Ft(this.gos,{column:e,filterParams:c,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:r,showParentFilter:t});if(u){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Ds(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Jre(n,i,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const r=t.getColId();delete this.initialModel[r],this.state.delete(r);const i=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;i!=null&&i.created?i.promise.then(u=>{this.destroyBean(u),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const n=e.getColId(),s=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],s&&this.disposeFilterWrapper(s,t).then(o=>{var r;o&&this.isAlive()&&((r=this.beans.filterManager)==null||r.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:s,isHandler:o,filterUi:r}=e,i=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[i],this.state.delete(i));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(i),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(r){if(r.created)return r.promise.then(l=>(n=o?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return jn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,C,S,b,w,_;const n=this.allColumnFilters.get(e);if(!n)return;const s=this.beans,o=n.column,r=o.getColDef(),i=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,u=l!=null&&l.isSelectable(r)?l.getFilterDef(o,r):r,c=i?this.createHandlerFunc(o,u,this.getDefaultFilter(o)):void 0,d=!!c,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(i?this.createFilterComp(o,u,a,D=>D,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??VE(s.userCompFactory,u,this.createFilterCompParams(o,d,"colDef"));if(h){const D=(c==null?void 0:c.handlerNameOrCallback)??(c==null?void 0:c.filterHandler),T=Ds(this.model,e);if(n.handlerGenerator!=D){const I=n.handler,{handler:x,handlerParams:F}=this.createHandlerFromFunc(o,c.filterHandler,g);n.handler=x,n.handlerParams=F,n.handlerGenerator=D,delete this.model[e],(v=x.init)==null||v.call(x,{...F,source:"init",model:null}),this.destroyBean(I),T!=null&&((C=this.beans.filterManager)==null||C.onFilterChanged({columns:[o],source:t}))}else{const I=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=I,(b=(S=n.handler).refresh)==null||b.call(S,{...I,source:"colDef",model:T})}}if(this.areFilterCompsDifferent(((w=n.filterUi)==null?void 0:w.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,o,f,p);return}n.filterUi.filterParams=g,(_=cl(n,h))==null||_.then(D=>{(D!=null&&D.refresh?D.refresh(g):!0)===!1?this.destroyFilterUi(n,o,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:g})})}refreshHandlerAndUi(e,t,n,s,o){const r=this.cachedFilter(e);if(!r)return s&&this.getOrCreateFilterWrapper(e,!0),jn.resolve();if(!r.isHandler)return jn.resolve();const{filterUi:i,handler:a,handlerParams:l}=r;return bae(()=>{if(i){const{created:u,filterParams:c}=i;if(u)return i.promise.then(d=>d?{filter:d,filterParams:c}:void 0);i.refreshed=!0}return jn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,o)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:s}=t;return!(n===s||(n==null?void 0:n.render)&&(s==null?void 0:s.render)&&n.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(s=>{n.then(o=>{s(Qf(o))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:s,model:o}=this,r=e.getColId(),i=s.get(r);return i?i.model??null:Ds(o,r)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let s=()=>{};const o=new Promise(r=>{s=r});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:Ds(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),s=n?this.getOrCreateFilterWrapper(n,!0):null;return s?this.setModelOnFilterWrapper(s,t):jn.resolve()}setColDefPropsForDataType(e,t,n){var c;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let r,i;const a=this.beans,{filterParams:l,filterValueGetter:u}=e;o==="agMultiColumnFilter"?{filterParams:r,filterValueGetter:i}=((c=a.multiFilter)==null?void 0:c.getParamsForDataType(l,u,t,n))??{}:{filterParams:r,filterValueGetter:i}=xae(o,l,u,t,n,a,this.getLocaleTextFunc()),e.filterParams=r,i&&(e.filterValueGetter=i)}setColFilterActive(e,t,n,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,s)}setModelOnFilterWrapper(e,t,n){return new jn(s=>{if(e.isHandler){const r=e.column,i=r.getColId(),a=this.model[i];if(this.updateStoredModel(i,t),n&&t===a){s();return}this.refreshHandlerAndUi(r,t,"api").then(()=>s());return}const o=cl(e);if(o){o.then(r=>{if(typeof(r==null?void 0:r.setModel)!="function"){Xe(65),s();return}(r.setModel(t)||jn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){dt(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),s={model:t,state:n==null?void 0:n.state};this.state.set(e,s)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var i;const s=e.getColId(),o=this.cachedFilter(e),r=()=>o==null?void 0:o.filterUi;tV(t,r,()=>Ds(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,u;return(u=(l=r())==null?void 0:l.filterParams)==null?void 0:u.onModelChange(a,n)},o!=null&&o.isHandler?(i=o.handler.processModelToApply)==null?void 0:i.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var i;const r=this.beans.colModel.getColDefCol(o);r&&tV(e,()=>s.filterUi,()=>Ds(this.model,o),()=>this.state.get(o),a=>this.updateState(r,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:r,action:e}),n.push(this.refreshHandlerAndUi(r,a,"ui"))},s!=null&&s.isHandler?(i=s.handler.processModelToApply)==null?void 0:i.bind(s.handler):void 0)}),n.length&&jn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();eV(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Ds(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const o of n)if(o.source==="COLUMN_MENU")return!1;let s=!1;for(const o of e.keys()){const r=e.get(o);if(r.valid===!1)return!1;(r.model??null)!==Ds(t,o)&&(s=!0)}return s}hasUnappliedModel(e){var s;const{model:t,state:n}=this;return(((s=n.get(e))==null?void 0:s.model)??null)!==Ds(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function jge(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Kge(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var qge=class extends We{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:s})=>this.onAdvFilterEnabledChanged(s),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var s;this.isAdvFilterEnabled()||(s=this.colFilter)==null||s.setState(e,t,n)}setFilterModel(e,t="api",n){var s;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(s=this.colFilter)==null||s.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){AE(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):jn.resolve()).then(()=>{var r;const o={source:t,type:"filterChanged",columns:s};n&&no(o,n),this.eventSvc.dispatchEvent(o),(r=this.colFilter)==null||r.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!AE(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){Xe(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},Yge=class extends We{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,s){e&&!e.isColumn||this.showPopup(e,o=>{var r;(r=this.popupSvc)==null||r.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:o})},n,t.target,$o(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,r="left";const i=$o(this.gos);!i&&this.gos.get("enableRtl")&&(o=1,r="right");const a=i?void 0:4*o,l=i?void 0:4;this.showPopup(e,u=>{var c;(c=this.popupSvc)==null||c.positionPopupByComponent({type:n,eventSource:t,ePopup:u,nudgeX:a,nudgeY:l,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},n,t,i,s)}showPopup(e,t,n,s,o,r){var g;const i=e?this.createBean(new Tae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=i,!(i!=null&&i.hasFilter())||!e){Sn(57);return}const a=is({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(i==null?void 0:i.getGui());let l;const u=()=>i==null?void 0:i.afterGuiDetached(),c=zoe(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{RV(e,!1,"contextMenu");const C=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),C&&s&&vi(s)){const S=FL(s);S==null||S.focus({preventScroll:!0})}u(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),r==null||r()},h=this.getLocaleTextFunc(),f=o&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:c,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),i.afterInit().then(()=>{t(a),i.afterGuiAttached({container:n,hidePopup:l})}),RV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||Su(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),bu(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},Zge=class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:r}=this.beans,i=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return i?this.executeFilterValueGetter(i,t.data,e,t,s):r.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:r,valueSvc:i}=this.beans,a=Ft(this.gos,{data:t,node:s,column:n,colDef:o,getValue:i.getValueCallback.bind(i,s)});return typeof e=="function"?e(a):r==null?void 0:r.evaluate(e,a)}},Xge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Jge=class extends wn{constructor(){super(Xge,[Yv]),this.eFloatingFilterText=ct}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,s=n.getHandler();if(s.getModelAsString){const o=s.getModelAsString(n.model);this.eFloatingFilterText.setValue(o)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},r_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],s=o=>o.some(r=>t[r]!=null)?!0:(Xe(72,{keys:o}),!1);if(!n.every(s)){this.filterOptions=e.filter(o=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;Xe(73)}else Xe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function hp(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function Ey(e){return e==null||typeof e=="string"&&e.trim().length===0}function Qge(e){return e==="AND"||e==="OR"?e:"AND"}function eme(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function tme(e,t){let n=e.length;return n>t&&(e.splice(t),Xe(78),n=t),n}function fp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:o}=n;return o??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var i_=class extends Nae{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new r_;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=Qge(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const s=n===0?e:this.optionsFactory.defaultOption;t.setValue(s,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,s=!t.operator;if(!n&&s||n&&!s)return!1;let r;if(n){const i=e,a=t;r=this.areSimpleModelsEqual(i,a)}else{const i=e,a=t;r=i.operator===a.operator&&il(i.conditions,a.conditions,(l,u)=>this.areSimpleModelsEqual(l,u))}return r}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),jn.resolve();if(e.operator){const s=e;let o=s.conditions;o==null&&(o=[],Xe(77));const r=tme(o,this.maxNumConditions),i=this.getNumConditions();if(r<i)this.removeConditionsAndOperators(r);else if(r>i)for(let l=i;l<r;l++)this.createJoinOperatorPanel(),this.createOption();const a=s.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),o.forEach((l,u)=>{this.eTypes[u].setValue(l.type,!0),this.setConditionIntoUi(l,u)})}else{const s=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),jn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Xe(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Xe(80),n=1),n>t&&(Xe(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new s0);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const s=this.getNumConditions()-1;this.forEachPositionInput(s,o=>this.resetInput(o)),this.addChangedListeners(t,s)}createJoinOperatorPanel(){const e=is({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const s=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(n,s,o),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const s=this.createManagedBean(new fie);e.push(s);const o="ag-filter-condition-operator";return s.addCss(o),s.addCss(`${o}-${n}`),t.appendChild(s.getGui()),s}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const s=e+1,o=n-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const r=this.isConditionDisabled(o,e);s.setDisabled(r||this.filterListOptions.length<=1),o===1&&(Lf(this.eJoinPanels[0],r),this.eJoinAnds[0].setDisabled(r),this.eJoinOrs[0].setDisabled(r))}),this.eConditionBodies.forEach((s,o)=>{Bn(s,this.isConditionBodyVisible(o))});const n=(t??this.getJoinOperator())==="OR";for(const s of this.eJoinAnds)s.setValue(!n,!0);for(const s of this.eJoinOrs)s.setValue(n,!0);this.forEachInput((s,o,r,i)=>{this.setElementDisplayed(s,o<i),this.setElementDisabled(s,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:s,eJoinPanels:o,eJoinAnds:r,eJoinOrs:i}=this;this.removeComponents(n,e,t),this.removeElements(s,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(r,a,t),this.removeComponents(i,a,t)}removeElements(e,t,n){const s=hp(e,t,n);for(const o of s)Br(o)}removeComponents(e,t,n){const s=hp(e,t,n);for(const o of s)Br(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof Eu&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var i;super.afterGuiDetached();const e=this.params;if((i=this.beans.colFilter)!=null&&i.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,s=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),u=a<t;(l||u)&&(this.removeConditionsAndOperators(a,1),s=!0,u&&n--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(n,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const s=this.eTypes[t].getValue(),o=this.translate(s);n=this.filterPlaceholder({filterOptionKey:s,filterOption:o,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,s,o)=>{if(!(t instanceof Eu))return;const r=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",i=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,s)),t.setInputAriaLabel(i)})}setElementValue(e,t,n){e instanceof Eu&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){mL(e)&&Bn(e.getGui(),t)}setElementDisabled(e,t){mL(e)&&Lf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Eu&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const s=fp(t,this.optionsFactory),o=this.getInputs(e);for(let r=0;r<o.length;r++){const i=o[r];i!=null&&n(i,r,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return fp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,s,o){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((s,o,r)=>{r===t&&this.setElementValue(s,n[o]!=null?n[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,s)=>{this.setElementValue(t,n===0&&s===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},G2=class{constructor(e,t,n,s,o,r){this.alive=!0,this.context=e,this.eParent=o;const i=qre(t,n,s);i&&i.newAgStackInstance().then(a=>{var c,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(c=a==null?void 0:a.afterGuiAttached)==null||c.call(a);const{tempValue:l,disabled:u}=this;l&&a.setDate(l),u!=null&&((d=a.setDisabled)==null||d.call(a,u)),r==null||r(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Bn(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},a_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function U2(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&vo(n,void 0,!0)||null,s&&vo(s,void 0,!0)||null].slice(0,fp(o,t))}var W2=1e3,z2=1/0,nme=class extends i_{constructor(){super("dateFilter",U2,a_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=W2,this.maxValidYear=z2,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,u)=>{const c=e[l];if(c!=null)if(isNaN(c))Xe(82,{param:l});else return c==null?u:Number(c);return u},n=t("minValidYear",W2),s=t("maxValidYear",z2);this.minValidYear=n,this.maxValidYear=s,n>s&&Xe(83);const{minValidDate:o,maxValidDate:r}=e,i=o instanceof Date?o:vo(o);this.minValidDate=i;const a=r instanceof Date?r:vo(r);this.maxValidDate=a,i&&a&&i>a&&Xe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,r=new G2(n,t,o.colDef,Ft(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>r.destroy()),r}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=is({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,s){const o=is({tag:"div",cls:`ag-filter-${s} ag-filter-date-${s}`});t.push(o),e.appendChild(o),n.push(this.createDateCompWrapper(o))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),hp(this.eConditionPanelsFrom,e,t),hp(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=hp(e,t,n);for(const o of s)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:s,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<s)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,s,o,r)=>{o!==e||!t||s>=r||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},s=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return s.length>0&&(n.dateFrom=Ho(s[0],!0,o)),s.length>1&&(n.dateTo=Ho(s[1],!0,o)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},j2=class extends We{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new r_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,s=[];if(n){const i=t;s.push(...i.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",r=this.params.getValue(e.node);return s[o](i=>this.individualConditionPasses(e,i,r))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:s}}=e;if(t==null)return;let r=aV(t)?t.conditions:[t];const i=(n==null?void 0:n.map(c=>typeof c=="string"?c:c.displayKey))??this.defaultOptions;if(!(!r||r.every(c=>i.find(d=>d===c.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const u=this.filterType;if((r&&!r.every(c=>c.filterType===u)||t.filterType!==u)&&(r=r.map(c=>({...c,filterType:u})),l=!0),typeof s=="number"&&r&&r.length>s&&(r=r.slice(0,s),l=!0),l){const c=r.length>1?{...t,filterType:u,conditions:r}:{...r[0],filterType:u};this.params={...e,model:c},e.onModelChange(c)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),r=s.getCustomOption(t.type),i=eme(r,o,n);return i??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},K2=class extends j2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:r}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(s)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(r)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const s=n.type;if(!this.isValid(t))return s==="notEqual"||s==="notBlank";const o=this.comparator(),r=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return r===0;case"notEqual":return r!==0;case"greaterThan":return r>0;case"greaterThanOrEqual":return r>=0;case"lessThan":return r<0;case"lessThanOrEqual":return r<=0;case"inRange":{const i=o(e[1],t);return this.params.filterParams.inRangeInclusive?r>=0&&i<=0:r>0&&i<0}case"blank":return Ey(t);case"notBlank":return!Ey(t);default:return Xe(76,{filterModelType:s}),!0}}},q2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},sme={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},l_=class extends We{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),s=t==="filterToolPanel";if(!e)return s?dl(this,"filterSummaryInactive"):null;if(e.operator!=null){const r=e,a=(r.conditions??[]).map(u=>this.getModelAsString(u,t)),l=r.operator==="AND"?"andCondition":"orCondition";return a.join(` ${dl(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?dl(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const r=e,i=this.optionsFactory.getCustomOption(r.type),{displayKey:a,displayName:l,numberOfInputs:u}=i||{};return a&&l&&u===0?n(a,l):this.conditionToString(r,s,r.type==="inRange"||u===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,s,o,r){let i;const a=this.getTypeKey(e);return a&&(i=dl(this,a)),o&&r&&(i=this.getLocaleTextFunc()(o,r)),i!=null?t?`${i} ${dl(this,"filterSummaryInRangeValues",[n(),s()])}`:`${i} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},Y2=class extends l_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,r=t.column,i=s==null?void 0:s.getDateFormatterFunction(r),a=i?i(n??void 0):n;return o.formatValue(r,null,a)}),this.filterTypeKeys=q2}conditionToString(e,t,n,s,o){const{type:r}=e,i=vo(e.dateFrom),a=vo(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,u=t?this.formatValue.bind(this):h=>XE(h,l),c=()=>i!==null?u(i):"null",d=()=>a!==null?u(a):"null";if(t){const h=this.conditionForToolPanel(r,n,c,d,s,o);if(h!=null)return h}return n?`${c()}-${d()}`:i!=null?u(i):`${r}`}};function ome(e,t){const n=t;return n<e?-1:n>e?1:0}var rme=class extends K2{constructor(){super(U2,a_),this.filterType="date",this.FilterModelFormatterClass=Y2}comparator(){return this.params.filterParams.comparator??ome}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},Z2=class extends wn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new r_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const s=this.isTypeEditable(n);this.setEditable(s)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:s,model:o}=t;if(s==="dataChanged"||s==="ui")return;this.onModelUpdated(o)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},ime={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},ame=class extends Z2{constructor(){super(ime,[Yv]),this.eReadOnlyText=ct,this.eDateWrapper=ct,this.FilterModelFormatterClass=Y2,this.filterType="date",this.defaultOptions=a_}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?vo(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Bn(this.eDateWrapper,e),Bn(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,s=Ho(e),o=s==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:s};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=h0(e,this.defaultDebounceMs);return Ft(this.gos,{onDateChanged:Os(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:s}=this;this.dateComp=new G2(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},lme={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},ume=class extends wn{constructor(){super(lme,[Yv]),this.eDateInput=ct,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&al();const{minValidYear:s,maxValidYear:o,minValidDate:r,maxValidDate:i,buttons:a,includeTime:l,colDef:u}=e.filterParams||{},c=this.beans.dataTypeSvc,d=l??((h=c==null?void 0:c.getDateIncludesTimeFlag)==null?void 0:h.call(c,u.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",r&&s&&Xe(85),i&&o&&Xe(86),r&&i){const[f,p]=[r,i].map(g=>g instanceof Date?g:vo(g));f&&p&&f.getTime()>p.getTime()&&Xe(87)}r?r instanceof Date?t.min=XE(r):t.min=r:s&&(t.min=`${s}-01-01`),i?i instanceof Date?t.max=XE(i):t.max=i:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return vo(this.eDateInput.getValue())}setDate(e){var s;const t=this.params.filterParams.colDef.cellDataType,n=((s=this.beans.dataTypeSvc)==null?void 0:s.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Ho(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},u_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function c_(e){const{allowedCharPattern:t}=e??{};return t??null}function d_(e){return e==null||isNaN(e)?null:e}function X2(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[d_(n),d_(s)].slice(0,fp(o,t))}var cme=class extends i_{constructor(){super("numberFilter",X2,u_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:s}=this.params,o=!n&&s?s(t??null):t;super.setElementValue(e,o)}createEValue(){const e=c_(this.params),t=is({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,s){const o=this.createManagedBean(s?new _u({allowedCharPattern:s}):new n0);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=s=>this.removeComponents(s,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(d_(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=ia(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},J2=class extends l_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=q2}conditionToString(e,t,n,s,o){const{filter:r,filterTo:i,type:a}=e,l=this.formatValue.bind(this);if(t){const u=this.conditionForToolPanel(a,n,()=>l(r),()=>l(i),s,o);if(u!=null)return u}return n?`${l(r)}-${l(i)}`:r!=null?l(r):`${a}`}},dme=class extends K2{constructor(){super(X2,u_),this.filterType="number",this.FilterModelFormatterClass=J2}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},Q2=class extends We{constructor(e){super(),this.params=e,this.eInput=ct,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new _u((s=this.params)==null?void 0:s.config));const t=this.eInput.getGui();e.appendChild(t);const n=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function h_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function eB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,fp(o,t))}var hme={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},tB=class extends Z2{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ct,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(hme)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:s,readOnly:o}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=ey(e.filterParams),!o){const r=h0(e.filterParams,s),i=Os(this,this.syncUpWithParentFilter.bind(this),r);n.setValueChangedListener(i)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();ks(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Oe.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:s,params:o,lastType:r}=this;let i=s.getValue();if(o.filterParams.trimInput&&(i=h_(i),s.setValue(i,!0)),n){const a=o,l=a.model,u=this.convertValue(i),c=u==null?null:{...l??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:u};a.onModelChange(c,{afterFloatingFilter:!0})}else o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(r||null,i||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},fme=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new n0),this.eTextInput=this.createManagedBean(new _u),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,s=>this.onValueChanged(s)),this.setupListeners(n,s=>this.onValueChanged(s))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},pme=class extends tB{constructor(){super(...arguments),this.FilterModelFormatterClass=J2,this.filterType="number",this.defaultOptions=u_}updateParams(e){c_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=c_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new Q2({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new fme)}convertValue(e){return e?Number(e):null}},f_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],gme=class extends i_{constructor(){super("textFilter",eB,f_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(ia(n.getValue()))}),t}createEValue(){const e=is({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const s=this.createManagedBean(new _u);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=r=>this.removeComponents(r,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},nB=class extends l_{constructor(){super(...arguments),this.filterTypeKeys=sme}conditionToString(e,t,n,s,o){const{filter:r,filterTo:i,type:a}=e;if(t){const l=c=>()=>dl(this,"filterSummaryTextQuote",[c]),u=this.conditionForToolPanel(a,n,l(r),l(i),s,o);if(u!=null)return u}return n?`${r}-${i}`:r!=null?`${r}`:`${a}`}},mme=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const s=t.lastIndexOf(n);return s>=0&&s===t.length-n.length}default:return!1}},vme=e=>e,yme=e=>e==null?null:e.toString().toLowerCase(),wme=class extends j2{constructor(){super(eB,f_),this.filterType="text",this.FilterModelFormatterClass=nB}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??mme,this.formatter=t.textFormatter??(t.caseSensitive?vme:yme)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],r=this.formatter(t),{api:i,colDef:a,column:l,context:u,filterParams:{textFormatter:c}}=this.params;if(n.type==="blank")return Ey(t);if(n.type==="notBlank")return!Ey(t);const d={api:i,colDef:a,column:l,context:u,node:s.node,data:s.data,filterOption:n.type,value:r,textFormatter:c};return o.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const s={...n},{filter:o,filterTo:r}=n;return o&&(s.filter=h_(o)??null),r&&(s.filterTo=h_(r)??null),s};return aV(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Cme=class extends tB{constructor(){super(...arguments),this.FilterModelFormatterClass=nB,this.filterType="text",this.defaultOptions=f_}createFloatingFilterInputService(){return this.createManagedBean(new Q2)}};function bme(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function Sme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Eme(e){var t;(t=e.quickFilter)==null||t.resetCache()}var _me=class extends We{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:s}=this.beans,o=t.isPivotMode(),r=e==null?void 0:e.getColumns(),i=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:i)??[];r&&(a=a.concat(r)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(u=>u.isVisible()||u.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return dt(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Xe(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const s=this.getTextForColumn(n,e);return dt(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const o=Ft(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return dt(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);dt(s)&&t.push(s)}return t.join(`
252
252
  `)}},Rme={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[Dge]},p_={moduleName:"FilterCore",version:ut,beans:[qge],apiFunctions:{isAnyFilterPresent:jge,onFilterChanged:Kge},css:[Age],dependsOn:[Rme]},sB={moduleName:"FilterValue",version:ut,beans:[Zge]},_y={moduleName:"ColumnFilter",version:ut,beans:[zge,Yge],dynamicBeans:{headerFilterCellCtrl:Tge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:kge,getColumnFilterInstance:Oge,destroyFilter:Mge,setFilterModel:Nge,getFilterModel:Lge,getColumnFilterModel:Vge,setColumnFilterModel:Bge,showColumnFilter:$ge,hideColumnFilter:Hge,getColumnFilterHandler:Gge,doFilterAction:Uge},dependsOn:[p_,Sy,sB,Fge]},Dme={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:Jge},dependsOn:[_y]},Tme={moduleName:"TextFilter",version:ut,dependsOn:[_y],userComponents:{agTextColumnFilter:{classImp:gme,params:{useForm:!0}},agTextColumnFloatingFilter:Cme},dynamicBeans:{agTextColumnFilterHandler:wme}},Ime={moduleName:"NumberFilter",version:ut,dependsOn:[_y],userComponents:{agNumberColumnFilter:{classImp:cme,params:{useForm:!0}},agNumberColumnFloatingFilter:pme},dynamicBeans:{agNumberColumnFilterHandler:dme}},xme={moduleName:"DateFilter",version:ut,dependsOn:[_y],userComponents:{agDateColumnFilter:{classImp:nme,params:{useForm:!0}},agDateInput:ume,agDateColumnFloatingFilter:ame},dynamicBeans:{agDateColumnFilterHandler:rme}},Fme={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[_me],dependsOn:[p_,sB]},Pme={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:bme,getQuickFilter:Sme,resetQuickFilter:Eme},dependsOn:[Fme]},Ame={moduleName:"ExternalFilter",version:ut,dependsOn:[p_]},kme=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",g_=(e,t,n)=>{var a,l,u;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,r=(u=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:u.errorMessages,i=o||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},Ome=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,r=o_(o),{column:i,eGui:a}=t,l=i.getColDef();!s&&r&&!l.headerComponent&&(s=xv(()=>a.querySelector(".ag-header-cell-text")));const u="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>u,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:u,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:i,colDef:i.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,r=o_(o),{column:i,eGui:a}=t,l=i.getColGroupDef();!s&&r&&!(l!=null&&l.headerGroupComponent)&&(s=xv(()=>a.querySelector(".ag-header-group-text")));const u="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>u,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:u,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:i};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:s}=this,{gos:o,editSvc:r}=s,{column:i,rowNode:a}=e;let l="cell";const u=()=>{const f=!!!(r!=null&&r.isEditing(e))&&g_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&dt(g))return lp(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Ft(o,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},c=o_(o);n||(c&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&g_(s,e,this.getLocaleTextFunc()))return!0;if(!i.isTooltipEnabled())return!1;const g=xv(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(r!=null&&r.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:u,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,s)}setupFullWidthRowTooltip(e,t,n,s){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},r=this.beans,i=r.context;e&&t.destroyBean(e,i);const a=this.createTooltipFeature(o,r);if(a)return t.createBean(a,i)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:s}=n,o=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!o)return;const r={getGui:()=>o,getTooltipValue:()=>g_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:u}=n,c=(p=u==null?void 0:u.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=u==null?void 0:u.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!c&&c.size>0,f=!!d&&d.size>0;return h||f}},i=this.createTooltipFeature(r,n);if(i)return e.createBean(i,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=dt(t.tooltipField)||dt(t.tooltipValueGetter)||dt(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},Mme=class extends rae{createTooltipComp(e,t){const n=Xre(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},oB={moduleName:"Tooltip",version:ut,beans:[Ome],dynamicBeans:{tooltipFeature:WL,highlightTooltipFeature:iae,tooltipStateManager:Mme},userComponents:{agTooltipComponent:uae},dependsOn:[Sy],css:[kme]},Dd=class{constructor(e){this.cellValueChanges=e}},m_=class extends Dd{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},Nme=10,rB=class{constructor(e){this.actionStack=[],this.maxStackSize=e||Nme,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},Lme=class extends We{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&HV(this.activeCellEdit,t),s=this.activeRowEdit!==null&&ice(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:u}=e,c={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:u,oldValue:l};this.cellValueChanges.push(c)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new rB(n),this.redoStack=new rB(n),this.addListeners();const s=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:s,newColumnsLoaded:s,columnGroupOpened:s,columnRowGroupChanged:s,columnMoved:s,columnPinned:s,columnVisible:s,rowDragEnd:s}),t.whenReady(this,o=>{this.gridBodyCtrl=o.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(n,s,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(s,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,n,s,o){if(!e)return!1;const r=e.pop();return r!=null&&r.cellValueChanges?(this.processAction(r,i=>i[s],o),r instanceof m_?this.processRange(r.ranges||[r[n]]):this.processCell(r.cellValueChanges),t.push(r),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:r,columnId:i}=s,a={rowIndex:o,rowPinned:r},l=ma(this.beans,a);l.displayed&&l.setDataValue(i,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const r=s.startRow,i=s.endRow;o===e.length-1&&(t={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:s.startColumn,columns:s.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:s}=t,o={rowIndex:n,rowPinned:s},r=ma(this.beans,o),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:r,rangeSvc:i}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const u={rowIndex:t,column:a,rowPinned:s};r.setFocusedCell({...u,forceBrowserFocus:!0}),i==null||i.setRangeToCell(u)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Dd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new Dd(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Dd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new m_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&la(n)?e=new m_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Dd(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new Dd(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},Vme=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",Bme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},$me=class extends dy{constructor(){super(Bme,[t0]),this.eEditor=ct}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:o=>this.setAriaLabel(o.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=Rv(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${s} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},Ry=class extends dy{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ct}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:s,eventKey:o,suppressPreventDefault:r}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let i,a=!0;s?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?i="":o&&o.length===1?r?a=!1:i=o:(i=t.getStartValue(),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:u}=l;(u===Oe.PAGE_UP||u===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var s,o;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;al()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},Hme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Gme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Hme}getAgComponents(){return[AL]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:r}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:r}=n;let i=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(s){const l=s instanceof Date?s:new Date(s);if(t<l){const u=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${u}`,[u]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const u=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${u}`,[u]))}}}return i.length||(i=null),r?r({value:t,cellEditorParams:n,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!dt(n)&&!dt(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ho(e,this.includeTime??!1)}},Ume=class extends Ry{constructor(){super(new Gme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Wme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},zme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Wme}getAgComponents(){return[AL]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:r}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,s=this.formatDate(this.parseDate(n??void 0)),{min:o,max:r,getValidationErrors:i}=t;let a=[];if(s){const l=new Date(s),u=this.getLocaleTextFunc();if(o){const c=new Date(o);if(l<c){const d=c.toLocaleDateString();a.push(u("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const c=new Date(r);if(l>c){const d=c.toLocaleDateString();a.push(u("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),i?i({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!dt(n)&&!dt(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Ho(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):vo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Ho(e??null,this.includeTime??!1)??void 0}},jme=class extends Ry{constructor(){super(new zme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Kme={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},qme=class extends dy{constructor(){super(Kme,[gie]),this.eEditor=ct}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:r,rows:i}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(r||60).setRows(i||10);let a;n?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,s=this.getLocaleTextFunc();e.setInputAriaLabel(s("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,s=e.getValue();return!dt(s)&&!dt(n)?n:t.parseValue(s)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getLocaleTextFunc(),o=this.getValue();let r=[];return typeof o=="string"&&t!=null&&o.length>t&&r.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:o,internalErrors:r,cellEditorParams:e}):r}},Yme={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Zme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Yme}getAgComponents(){return[mie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:r}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),r!=null&&e.setStep(r);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,r=this.eEditor.getInputElement().valueAsNumber,i=this.getLocaleTextFunc();let a=[];return typeof r=="number"&&(t!=null&&r<t&&a.push(i("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&r>n&&a.push(i("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:r,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!dt(n)&&!dt(t.value))return t.value;let s=t.parseValue(n);if(s==null)return s;if(typeof s=="string"){if(s==="")return null;s=Number(s)}return isNaN(s)?null:s}getStartValue(){return this.params.value}setCaret(){al()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Xme=class extends Ry{constructor(){super(new Zme(()=>this.getLocaleTextFunc()))}},Jme={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Qme=class extends dy{constructor(){super(Jme,[Tie]),this.eEditor=ct,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:s}=this,{values:o,value:r,eventKey:i}=e;if(Vn(o)){Xe(58);return}this.startedByEnter=i!=null?i===Oe.ENTER:!1;let a=!1;o.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||r===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:u,valueListMaxHeight:c}=e;l!=null&&t.setPickerGap(l),c!=null&&t.setPickerMaxHeight(c),u!=null&&t.setPickerMaxWidth(u),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,s=this.getValue();let o=[];if(t&&!t.includes(s)){const r=this.getLocaleTextFunc();o.push(r("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},eve={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},tve=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return eve}getAgComponents(){return[Yv]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getValue(),o=this.getLocaleTextFunc();let r=[];return t!=null&&typeof s=="string"&&s.length>t&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:s,cellEditorParams:e,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!dt(n)&&!dt(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){al()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=dt(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},iB=class extends Ry{constructor(){super(new tve(()=>this.getLocaleTextFunc()))}};function nve(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function sve(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function aB(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function lB(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function ove(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function rve(e){var t;(t=e.undoRedo)==null||t.undo("api")}function ive(e){var t;(t=e.undoRedo)==null||t.redo("api")}function ave(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function lve(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,r)=>{const{rowIndex:i,rowPinned:a}=r;o.forEach((l,u)=>{const{editorValue:c,pendingValue:d,sourceValue:h,state:f}=l,p=va(l);let g=c??d;g===pr&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:u,colId:u.getColId(),colKey:u.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function uve(e,t=!1){var s;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const o of((s=e.editModelSvc)==null?void 0:s.getEditPositions())??[])o.state==="editing"&&n.revertSingleCellEdit(o);else xu(e,{persist:!0});Ed(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function cve(e,t){var s;const n=Wn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function dve(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(s);if(!l){Xe(12,{colKey:s});return}const c=ma(e,{rowIndex:o,rowPinned:r||null});if(!c){Xe(290,{rowIndex:o,rowPinned:r});return}if(!l.isCellEditable(c))return;r==null&&lB(e,o),aB(e,s),i==null||i.startEditing({rowNode:c,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function hve(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function fve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function pve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var gve={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},mve=class extends BE{constructor(e){super(gve),this.params=e}postConstruct(){yu(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{C0(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function vve(e,{column:t},n,s,o="ui"){var u;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&s))return!0;if((n==null?void 0:n.shiftKey)&&((u=e.rangeSvc)==null?void 0:u.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=yve(e.gos,i),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:o==="api"?s??!1:!1}function yve(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function v_(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,r=e.editModelSvc;return n.isColumnFunc(t,o)||!!r&&r.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function wve(e,t,n="ui"){const s=v_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(r=>v_(e,{rowNode:t.rowNode,column:r},n))}var Dy=(e,t=!1)=>{if(e!==void 0)return va(e)||t&&e.state==="editing"};function uB(e,t,n=!1){var s;return Dy((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var cB=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const r=e[s];if(r.data&&(Dy(t==null?void 0:t.getEdit({rowNode:r,column:n}))||Dy(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||cB(r.childrenAfterGroup,t,n))return!0}};function dB(e,t){const{column:n,rowNode:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:cB(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function hB(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return Dy((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var Cve=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var o;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const r=uB(n,e)||dB(n,e)||hB(n,e);this.applyBatchingStyle(r)}else this.applyBatchingStyle(!1);const s=!!((o=this.editModelSvc)!=null&&o.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",s)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},bve=class extends We{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var i;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const r=(i=this.editModelSvc)==null?void 0:i.getRowValidationModel().hasRowValidation({rowNode:s});if(!o&&s.pinnedSibling&&(s=s.pinnedSibling,o=t==null?void 0:t.getEditRow(s)),o){const a=Array.from(o.keys()).some(l=>{const u={rowNode:s,column:l};return uB(n,u,!0)||dB(n,u)||hB(n,u)});this.applyStyle(r,a);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){var o,r;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(r=this.rowCtrl)==null||r.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",s&&t),i.toggleCss("ag-row-batch-edit",s&&t&&n),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},Sve=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(r=>s.has(r)&&o.add(r)),t==null||t.forEachPinnedRow("top",r=>s.has(r)&&o.add(r)),t==null||t.forEachPinnedRow("bottom",r=>s.has(r)&&o.add(r));for(const r of s)o.has(r)||n.removeEdits({rowNode:r});return o},Eve=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((r,i)=>!n.has(i)&&e.removeEdits({rowNode:o,column:i}))},_ve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());Eve(e,Sve(e,s),t)},Rve=new Set(["undo","redo","paste","bulk","rangeSvc"]),Dve=new Set(["ui","api"]),fB={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Tve=new Set(Object.keys(fB)),Ive=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Ty={cancel:!0,source:"api"},xve={cancel:!1,source:"api"},Td={checkSiblings:!0},pp={force:!0,suppressFlash:!0},Fve=class extends We{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:s})=>{this.stopEditing(void 0,Ty),this.createStrategy(s)});const t=_ve(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,Ty):this.isEditing()&&(this.isBatchEditing()?Ed(e,this.model.getEditPositions()):this.stopEditing(void 0,xve)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,Ty)):(this.stopEditing(void 0,Ty),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=pB(n,e);if(s){if(s.beanName===o)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,s="ui"){const o=vve(this.beans,e,t,n,s);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}shouldStopEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldCancel(e,t,n))??null}validateEdit(){return zfe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Td)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:s=null,source:o="ui",ignoreEventKey:r=!1,silent:i}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Wn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,s,n,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:s,source:o,ignoreEventKey:r,startedEdit:n,silent:i})}stopEditing(e,t){var v,C,S;const{event:n,cancel:s,source:o="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(Tve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const u=this.committing?fB[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Td))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Wn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!s&&(!!this.shouldStopEditing(e,n,u)||this.committing&&!this.batch)||(i??!1),g=s&&!!this.shouldCancelEditing(e,n,u)||(r??!1);if(p||g){xu(a,{persist:!0,isCancelling:g||s,isStopping:p});const b=l.getEditMap(),w=this.processEdits(b,s,o);(v=this.strategy)==null||v.stop(s,n);for(const _ of w)l.clearEditValue(_);this.bulkRefresh(void 0,h);for(const _ of l.getEditPositions(b)){const D=Wn(a,_),T=va(_);D==null||D.refreshCell({force:!0,suppressFlash:!T})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((C=this.strategy)!=null&&C.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,w=b===Oe.ENTER,_=b===Oe.ESCAPE,D=b===Oe.TAB;(w||D||_)&&(w||D?xu(a,{persist:!0}):_&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():Ed(a,l.getEditPositions(),{event:n,cancel:_}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else xu(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),Z0(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var u;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:r,shiftKey:i}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==Oe.ENTER||!a)return;const l=i?Oe.UP:Oe.DOWN;(u=this.beans.navigation)==null||u.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const s=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[];for(const i of s){const a=e.get(i);for(const l of a.keys()){const u=a.get(l),c={rowNode:i,column:l},d=va(u);!t&&d&&!o&&(this.setNodeDataValue(i,l,u.pendingValue,void 0,n)||r.push(c))}}return r}setNodeDataValue(e,t,n,s,o="edit"){const{beans:r}=this,i=Wn(r,{rowNode:e,column:t}),a=Dve.has(o)?"edit":o;i&&(i.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return i&&(i.suppressRefreshCell=!1),s&&(i==null||i.refreshCell(pp)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=pp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...Pve(e),...pp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:s,sourceValue:o}=n,{rowIndex:r,rowPinned:i,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:i,column:t,source:"api",data:a,newValue:s,oldValue:o,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:s,gos:o}=this,{editModelSvc:r,rowModel:i}=s;os(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=r==null?void 0:r.getEditMap(!1))==null||a.forEach((l,u)=>{for(const c of l.keys())this.refCell({rowNode:u,column:c},l.get(c),n)})))}refCell({rowNode:e,column:t},n,s={}){var d,h,f;const{beans:o,gos:r}=this,i=new Set([e]),a=new Set,l=e.pinnedSibling;l&&i.add(l);const u=e.sibling;u&&a.add(u);let c=e.parent;for(;c;)(d=c.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!c.parent&&c.sibling&&r.get("grandTotalRow")?a.add(c.sibling):a.add(c),c=c.parent;for(const p of i)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of i)(h=Wn(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Wn(o,{rowNode:p,column:t}))==null||f.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:s,beans:o}=this;if(n.group){if(s.get("treeData")){if(!n.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const r=pB(s)==="fullRow"?wve(o,e,t):v_(o,e,t);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,r,i;if(this.hasValidationErrors(e)){const a=Wn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((s=t==null?void 0:t.preventDefault)==null||s.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(i=(r=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,r,i;const n=Wn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(Ed(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Sd(this.beans,e,{silent:!0}),Fu(this.beans),n==null||n.refreshCell(pp),t&&(n==null||n.focusCell(),(i=(r=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)))}hasValidationErrors(e){var s;Fu(this.beans);const t=Wn(this.beans,e);t&&(t.refreshCell(pp),(s=t.rowCtrl.rowEditStyleFeature)==null||s.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,s="ui"){var a;let o;const r=this.isEditing(),i=r&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof _d&&r&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,i)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!i&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let s=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const i=this.model.getEdit({rowNode:o,column:t});i&&(s=i)}const r=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return r===pr||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){Bfe(this,this.beans,e)}createPopupEditorWrapper(e){return new mve(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!Ive.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const r=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Rve.has(n))return yy(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const i=this.model.getEdit(e);if(i){if(i.pendingValue===t)return!1;if(i.sourceValue!==t)return yy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0;if(i.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0}return yy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){Gfe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Td))return;const{rowNode:s,column:o}=e,{compDetails:r,valueToDisplay:i}=t;if(r){const{params:l}=r;return l.data=this.model.getEditRowDataValue(s,Td),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,Td);if(i!==void 0&&(a!=null&&a.has(o)))return{valueToDisplay:this.valueSvc.getValue(o,s)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,s){var o;(o=this.strategy)==null||o.dispatchCellEvent(e,t,n,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Ft(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var u,c;if(!n||n.length===0)return;const{beans:s,rangeSvc:o,valueSvc:r}=this;xu(s,{persist:!0});const i=this.model.getEditMap(!0),a=(c=(u=i.get(e))==null?void 0:u.get(t))==null?void 0:c.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=ma(s,h);if(f===void 0)return;const p=i.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=r.getValue(g,f,!0,"api");let C=r.parseValue(g,f??null,a,v);Number.isNaN(C)&&(C=null),p.set(g,{editorValue:void 0,pendingValue:C,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&i.set(f,p)}),this.setEditMap(i),this.batch){this.cleanupEditors(),Z0(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(i)})}),this.bulkRefresh();const l=Wn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Cve(e,t)}createRowStyleFeature(e,t){return new bve(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,r=new Map;for(let{colId:i,column:a,colKey:l,rowIndex:u,rowPinned:c,newValue:d,state:h}of e){const f=i?s.getCol(i):l?s.getCol(l):a;if(!f)continue;const p=ma(n,{rowIndex:u,rowPinned:c});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!va({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=pr),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){var r;const t=Wn(this.beans,e);if(!t||!this.isEditing(t,Td))return;const n=this.model.getEdit(t);if(!n||!va(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(r=this.beans.ariaAnnounce)==null||r.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Wn(this.beans,e)}};function Pve(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function pB(e,t){return t??e.get("editType")??"singleCell"}var gB=class extends We{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:s,beans:o}=this,r=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Wn(o,n));const{gos:i,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:u,rowIndex:c,rowPinned:d}=e,h={column:u,rowNode:ma(o,{rowIndex:c,rowPinned:d})},f=i.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?s.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:r}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,r;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const i of n){s.all.push(i);const a=this.model.getCellValidationModel().getCellValidation(i);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(i);continue}s.pass.push(i)}if(e)for(const i of n)wy(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(s);if(i.destroy.length>0)for(const a of i.destroy)wy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(i.keep.length>0)for(const a of i.keep){const l=Wn(this.beans,a);(r=this.editSvc)!=null&&r.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){xu(this.beans,{persist:!1});const n=this.model.getEditPositions(),s=[];if(e)for(const o of n)o.rowNode!==e&&s.push(o);else for(const o of n)s.push(o);Ed(this.beans,s),Z0(this.beans,t)}setFocusOutOnEditor(e){var t,n,s;(s=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||s.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const s=this.beans.gos.get("editType")==="fullRow";e.focusCell(s),e.onEditorAttachedFuncs.push(()=>{var o,r;return(r=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:r.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:r=this.model.getEditPositions()}=e,i=t instanceof KeyboardEvent&&!n&&t.key||void 0;Hfe(this.beans,r,o,i,t,s)}dispatchCellEvent(e,t,n,s){const o=Wn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=q0(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return s&&n==="api"?!0:s&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!s?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===Oe.ESCAPE||s&&n==="api"||n==="api")}setEditMap(e,t){var s;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((o,r)=>{o.forEach((i,a)=>{i.state==="editing"&&n.push({...i,rowNode:r,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(s=this.model)==null||s.setEditMap(e),n.length>0){const o=n.at(-1),r=o.pendingValue===pr?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const i=Wn(this.beans,o);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},Ave=class extends gB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!q0(this.beans,{rowNode:this.rowNode}))return!0;const r=super.shouldStop({rowNode:this.rowNode},t,n);return r!==null?r:this.rowNode?s!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:s,event:o,ignoreEventKey:r}=e,{rowNode:i}=t;this.rowNode!==i&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],u=[];for(const c of a)c.isCellEditable(i)&&u.push(c);if(u.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const c of u){const d={rowNode:i,column:c};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=i,this.setupEditors({cells:l,position:t,startedEdit:s,event:o,ignoreEventKey:r})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var o;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const s=[];if(e||this.model.getEditMap().forEach((r,i)=>{if(!(!r||r.size===0)){for(const a of r.values())if(va(a)){s.push(i);break}}}),Fu(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const r of s)this.dispatchRowEvent({rowNode:r},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const s=Wn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,s="ui",o=!1){var h,f,p,g;const r=e.cellPosition;let i;this.model.suspend(!0);try{i=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(r,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(i===!1)return null;if(i==null)return!1;const a=i.cellPosition,l=e.isCellEditable(),u=i.isCellEditable(),c=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return u&&!o?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||Sd(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(u&&o&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!c&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(i,!0),d?i.focusCell(!0,n):this.editSvc.startEditing(i,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},s)=>{var r;if(n!=="editing")return;const o=Wn(this.beans,{rowNode:t,column:s});o&&!((r=o.comp)!=null&&r.getCellEditor())&&Sd(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},kve=class extends gB{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const s=super.shouldStop(e,t,n);if(s!==null)return s;const{rowNode:o,column:r}=e||{};return(!this.rowNode||!this.column)&&o&&r?null:this.rowNode!==o||this.column!==r}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:s,ignoreEventKey:o}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:s,ignoreEventKey:o})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:s,column:o,rowPinned:r}=e,i=ma(this.beans,{rowIndex:s,rowPinned:r}),a=Y0(o),l=t.getCol(a),u=e.previousParams;if(u){const c=Y0(u.column);if((u==null?void 0:u.rowIndex)===s&&c===a&&(u==null?void 0:u.rowPinned)===r)return}n!=null&&n.isEditing({rowNode:i,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,s="ui",o=!1){var p,g,v,C,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=Cd(this.beans,r)??e);const i=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),o||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(i,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const u=a.cellPosition,c=e.isCellEditable(),d=a.isCellEditable(),h=u&&i.rowIndex===u.rowIndex&&i.rowPinned===u.rowPinned;c&&!o&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),d&&!o){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((C=a.comp)!=null&&C.getCellEditor())){const w=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});Sd(this.beans,a,{event:n,cellStartedEdit:!0,silent:w}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&o&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},gl={moduleName:"EditCore",version:ut,beans:[Vfe,Fve],apiFunctions:{getEditingCells:lve,getEditRowValues:ave,getCellEditorInstances:$fe,startEditingCell:dve,stopEditing:uve,isEditing:cve,validateEdit:hve},dynamicBeans:{singleCell:kve,fullRow:Ave},dependsOn:[Sy,oB],css:[Vme]},Ove={moduleName:"UndoRedoEdit",version:ut,beans:[Lme],apiFunctions:{undoCellEditing:rve,redoCellEditing:ive,getCurrentUndoSize:fve,getCurrentRedoSize:pve},dependsOn:[gl]},Mve={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:iB,agTextCellEditor:iB},dependsOn:[gl]},Nve={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:Xme}},dependsOn:[gl]},Lve={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:Ume,agDateStringCellEditor:jme},dependsOn:[gl]},Vve={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:$me},dependsOn:[gl]},Bve={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:Qme},dependsOn:[gl]},$ve={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:qme},dependsOn:[gl]},Hve={moduleName:"CustomEditor",version:ut,dependsOn:[gl]},Gve=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,dd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Qoe(e))}createColumns(e,t){var h,f;const n=()=>{var p;Gv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},s=e.treeDepth,r=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,i=this.generateSelectionCols();if(Joe(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,u=(l==null?void 0:l.findDepth(e.tree))??0,c=(l==null?void 0:l.balanceTreeForAutoCols(i,u))??[];this.columns={list:i,tree:c,treeDepth:u,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!ca(v));return[...i,...g]})}updateColumns(e){var n;const t=dd(e.source);for(const s of((n=this.columns)==null?void 0:n.list)??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),Hr(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>Zf(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var i,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!mu(e))return!1;const s=(((a=(i=t.autoColSvc)==null?void 0:i.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!cd(n),r=Nv(n);return o||r}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:r,...i}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(a,l,u,c){const d=u.isSelected(),h=c.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:sL,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new wu(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?cd(t):void 0,o=e&&typeof e!="string"?cd(e):void 0,r=s!==o,i=t&&typeof t!="string"?Nv(t):void 0,a=e&&typeof e!="string"?Nv(e):void 0,l=i!==a,u=Lv(e),c=Lv(t);(r||l||u!==c)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Gv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,u;if(!((l=this.columns)!=null&&l.list.length))return;const s=e.length+t.length+n.length;if(s===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const r=()=>{let c;switch(o.pinned){case"left":case!0:c=e;break;case"right":c=n;break;default:c=t}c&&$r(c,o)};(((u=this.beans.rowNumbersSvc)==null?void 0:u.getColumn(oL))?2:1)===s&&r()}};function Uve(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!rp(a)?(Xe(59),!1):a.id===void 0?(Xe(60),!1):!0))return;const{nodes:s,source:o,newValue:r}=t;(i=e.selectionSvc)==null||i.setNodesSelected({nodes:s,source:o??"api",newValue:r})}function Wve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function zve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function jve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function Kve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function qve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function Yve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function Zve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function Xve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Jve=class extends due{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=Vv(e),this.groupSelectsDescendants=qf(e),this.groupSelectsFiltered=Bv(e)==="filteredDescendants",this.masterSelectsDetail=JN(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=qf(e),n=Vv(e),s=Bv(e)==="filteredDescendants";this.masterSelectsDetail=JN(e)==="detail",(t!==this.groupSelectsDescendants||s!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(s==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,n),this.selectRange(s.select,!0,n);{const o=s.checkFilteredNodes?vB(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:o,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:s,event:o,source:r,keepDescendants:i=!1}){var u;if(s.length===0)return 0;const{gos:a}=this;if(!mu(a)&&e)return Xe(132),0;if(s.length>1&&!this.isMultiSelect())return Xe(130),0;let l=0;for(let c=0;c<s.length;c++){const d=s[c],h=Id(d);if(h.rowPinned&&!rp(h)){Xe(59);continue}if(h.id===void 0){Xe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((u=h.childrenAfterGroup)!=null&&u.length)&&(l+=this.selectChildren(h,e,r))}return n||(s.length===1&&r==="api"&&this.selectionCtx.setRoot(Id(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Id(s[0]),i,r)),l>0&&(this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const r=Id(o);if(r.group&&this.groupSelectsDescendants)return;this.selectRowNode(r,t,void 0,n)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),s}selectChildren(e,t,n){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:s}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,s)=>{e(n)&&t.set(s,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:s}=this.beans;if(!os(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new ap(!0,o),t.active=!1);let r=!1;return t.forEachChangedNodeDepthFirst(i=>{if(i!==o){const a=this.calculateSelectedFromChildren(i);r=this.selectRowNode(i,a===null?!1:a,void 0,e)||r}}),r}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(r=>{const i=r.id==e.id;if((t?!eye(e,r):!0)&&!i){const l=this.selectedNodes.get(r.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&r.parent&&s.set(r.parent.id,r.parent)}}),s.forEach(r=>{const i=this.calculateSelectedFromChildren(r);this.selectRowNode(r,i===null?!1:i,void 0,n)}),o}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new ul(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!os(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(r){for(let i=0,a=r.length;i<a;i++){const l=r[i];l.isSelected()?s.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(n),s}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=os(this.gos);let s=!1;const o=r=>{const i=this.selectRowNode(Id(r),!1,void 0,e);s||(s=i)};if(t==="currentPage"||t==="filtered"){if(!n){Sn(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(e);s||(s=r)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(s=>{this.groupSelectsDescendants&&s.group||(s.isSelected()?t++:s.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return mB(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=o=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage(o=>{if(!o.group){n(o);return}if(!o.expanded&&!o.footer){const r=i=>{var a;n(i),(a=i.childrenAfterFilter)==null||a.forEach(r)};r(o);return}this.groupSelectsDescendants||n(o)}),t;const s=this.beans.rowModel;return e==="filtered"?(s.forEachNodeAfterFilter(n),t):(s.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,s=t.getFirstRow(),o=t.getLastRow();for(let r=s;r<=o;r++){const i=n.getRow(r);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!mu(t)){Xe(132);return}if(Boe(t)&&!Kf(t)){Xe(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let r=!1;if(this.getNodesToSelect(o).forEach(i=>{const a=this.selectRowNode(Id(i),!0,void 0,s);r||(r=a)}),n.selectAll=!0,os(t)&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(s);r||(r=i)}r&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){Sn(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(r=>{s.has(r.id)&&o.push(r)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return os(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!mu(t))return;const s="selectableChanged",o=e!==void 0,r=os(t)&&this.groupSelectsDescendants,i=[],a=u=>{var d;if(o&&!u.group)return;if(r&&u.group){const h=((d=u.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(u,h,!0);return}!this.updateRowSelectable(u,!0)&&u.isSelected()&&i.push(u)};if(r){if(e===void 0){const u=n.rootNode;e=u?new ap(!1,u):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);i.length&&this.setNodesSelected({nodes:i,newValue:!1,source:s}),!o&&r&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,s))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var r,i;if(!this.masterSelectsDetail)return;const n=(i=(r=e.detailNode)==null?void 0:r.detailGridInfo)==null?void 0:i.api;if(!n)return;const s=Qve(n);if(e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!s){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!Kf(t)){Xe(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const s=this.detailSelection.get(e.id);if(s){const o=[];for(const r of s){const i=n.getRowNode(r);i&&o.push(i)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Id(e){return rp(e)?e.pinnedSibling:e.footer?e.sibling:e}function Qve(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.selectable&&n++}),mB(t,n)}function mB(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function eye(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function vB(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(vB))??!1;return t||n}var tye={moduleName:"SharedRowSelection",version:ut,beans:[Gve],apiFunctions:{setNodesSelected:Uve,selectAll:Wve,deselectAll:zve,selectAllFiltered:jve,deselectAllFiltered:Kve,selectAllOnCurrentPage:qve,deselectAllOnCurrentPage:Yve,getSelectedNodes:Zve,getSelectedRows:Xve}},nye={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[Jve],dependsOn:[tye]};function sye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function oye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function yB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function wB(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Xe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function rye(e,t,n){var o,r;const s=ige(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){Sn(238);return}s.setRowCount(t,n);return}Sn(28);return}(r=by(e))==null||r.setRowCount(t,n)}function iye(e){var t;return ad(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function aye(e){return e.rowModel.isLastRowIndexKnown()}var lye={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:sye,collapseAll:oye}},uye={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:yB,resetRowHeights:wB}},cye={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:rye,getCacheBlockState:iye,isLastRowIndexKnown:aye}},dye=class extends We{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(s=>{var r;if(!s){Sn(18),t||Sn(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(r=o.current)==null?void 0:r.api:(o.api||Sn(19),o.api)}).filter(s=>!!s&&!s.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(s=>{n.push(t(s))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":Xe(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let s=null;n&&(s=t.getProvidedColGroup(n.getGroupId())),!(n&&!s)&&t.setColumnGroupOpened(s,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const s=this.beans,{colResize:o,ctrlsSvc:r,colModel:i}=s;if(t&&(n=i.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Hr(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Hr(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Hr(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const c=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of c.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,c.finished,"alignedGridChanged");break}}const u=r.getGridBodyCtrl().isVerticalScrollShowing();for(const c of this.getAlignedGridApis())c.setGridOption("alwaysShowVerticalScroll",u)}},hye={moduleName:"AlignedGrids",version:ut,beans:[dye],dependsOn:[s2]},fye=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},CB(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:s}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const o=CB(this.rootNode),r=new Array(e.length);o._leafs=r;let i=0;const a=s==null?void 0:s.getNestedDataGetter(),l=a?new Set:null,u=(c,d)=>{const h=c.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=i,r[i++]=v,l&&!l.has(g)){l.add(g),v.treeParent=c;const C=a(g);C&&u(v,C)}}};u(o,e),r.length=i}setImmutableRowData(e,t){var C;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=ud(s),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,u=[],c=(C=this.beans.groupStage)==null?void 0:C.getNestedDataGetter();let d=s.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const w=S.sourceRowIndex;d=w<=h,h=w}S.data!==b&&(S.updateData(b),i.has(S)||a.add(S),!S.selectable&&S.isSelected()&&u.push(S))},g=(S,b,w)=>{for(let _=0,D=b.length;_<D;++_){const T=b[_];if(!T)continue;let I=this.getRowNode(o({data:T,level:w}));if(I?(p(I,T),f||(f=!!c&&I.treeParent!==S)):(I=this.createRowNode(T,w),i.add(I)),!c||l.has(I)){l.add(I);continue}l.add(I),I.treeParent=S;const x=c(T);x&&g(I,x,w+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,u)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?yye(S,l,r):vye(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(u))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,r=s.length;o<r;o++){const i=s[o];e.has(i)||(t.add(i),i.isSelected()&&n.push(i),this.deleteNode(i))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Xe(268),{remove:[],update:[],add:[]};const n=[],s=ud(this.gos),o=this.executeRemove(s,e,t,n),r=this.executeUpdate(s,e,t,n),i=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:r,add:i}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},r){const i=this.rootNode._leafs,a=i==null?void 0:i.length,l=t==null?void 0:t.length;if(!l||!a)return[];let u=0,c=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<c&&(c=v),v>d&&(d=v),g.isSelected()&&r.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(s.delete(g),o.add(g)),f[u++]=g}return f.length=u,u&&mye(i,c,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const r=t==null?void 0:t.length;if(!r)return[];const i=new Array(r);let a=0;for(let l=0;l<r;l++){const u=t[l],c=this.lookupNode(e,u);c&&(c.updateData(u),!c.selectable&&c.isSelected()&&o.push(c),i[a++]=c,n.has(c)||s.add(c))}return i.length=a,i}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,r=e.add,i=r==null?void 0:r.length;if(!i)return[];const a=o+i;let l=this.sanitizeAddIndex(s,e.addIndex);if(l<o){for(let d=o-1,h=a-1;d>=l;--d){const f=s[d];f.sourceRowIndex=h,s[h--]=f}t.reordered=!0}s.length=a;const u=new Array(i),c=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);c.add(h),h.sourceRowIndex=l,s[l]=h,u[d]=h,l++}return u}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var s;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(s=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||s.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new ul(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const s=n.id,o=this.allNodesMap;return o[s]&&Xe(2,{nodeId:s}),o[s]=n,n}deleteNode(e){var o;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const s=e.pinnedSibling;s&&((o=this.beans.pinnedRowModel)==null||o.pinRow(s,null))}lookupNode(e,t){if(!e)return gye(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(Sn(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=pye(e,t)),t}},pye=(e,t)=>{for(let n=0,s=e.length;n<s;n++){const o=e[n];if((o==null?void 0:o.rowIndex)==t-1)return n+1}return t},CB=e=>{var i;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((i=e._leafs)==null?void 0:i.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const r=e.sibling;return r&&(r.childrenAfterGroup=t,r.childrenAfterSort=n,r.childrenAfterAggFilter=s,r.childrenAfterFilter=o,r.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},gye=(e,t)=>{if(e)for(let n=0,s=e.length;n<s;n++){const o=e[n];if(o.data===t)return o}return Sn(5,{data:t}),null},mye=(e,t,n,s,o)=>{t=Math.max(0,t);for(let r=t,i=e.length;r<i;++r){const a=e[r];r<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},vye=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,r=!1;for(const i of t){const a=i.sourceRowIndex;a===s?r||(r=o):(a>=0?r=!0:o=!0,i.sourceRowIndex=s,e[s]=i),++s}return r},yye=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let r=0;for(let i=0;i<o;++i){const a=e[i];n.has(a)||(r!==i&&(a.sourceRowIndex=r,e[r]=a),++r)}for(const i of s)i.sourceRowIndex<0&&(i.sourceRowIndex=r,e[r++]=i);e.length=r},bB=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let s=0,o=t.length-1;s<=o;s++){const r=t[s],i=s===0,a=s===o;r.firstChild!==i&&(r.firstChild=i,r.dispatchRowEvent("firstChildChanged")),r.lastChild!==a&&(r.lastChild=a,r.dispatchRowEvent("lastChildChanged")),r.childIndex!==s&&(r.childIndex=s,r.dispatchRowEvent("childIndexChanged"))}},wye=class extends We{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,s){const{gos:o,colModel:r,rowGroupColsSvc:i,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:u}=this.beans,c=o.get("groupMaintainOrder"),d=r.getCols().some(S=>S.isRowGroupActive()),h=i==null?void 0:i.columns,f=r.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const C=S=>{var D,T;const b=f&&S.leafGroup;let w=c&&d&&!S.leafGroup;w&&(v??(v=this.shouldSortContainsGroupCols(e)),w&&(w=!v));let _=null;if(w){let I=!1;if(h){const x=S.level+1;x<h.length&&(I=h[x].getSort()===null)}I||(_=Sye(S))}else!e.length||b||(t&&n?_=Cye(a,S,n,s,e):_=a.doFullSort(S.childrenAfterAggFilter,e));if(_||(_=((D=S.childrenAfterAggFilter)==null?void 0:D.slice(0))??[]),g||(g=((T=S.childrenAfterSort)==null?void 0:T[0])!==_[0]),S.childrenAfterSort=_,bB(S),p){const I={nodes:S.childrenAfterSort};p(I)}};if(s==null||s.forEachChangedNodeDepthFirst(C),g&&o.get("groupHideOpenParents")){const S=u==null?void 0:u.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(bi(this.gos)){for(let n=0;n<t;++n){const s=e[n].column;if(s.isPrimary()&&s.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},Cye=(e,t,n,s,o)=>{const r=t.childrenAfterAggFilter,i=t.childrenAfterSort;if(!i)return e.doFullSort(r,o);const a=new Set,l=[],{updates:u,adds:c}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];u.has(p)||c.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=i.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),bye(e,o,l,d)},bye=(e,t,n,s)=>{let o=0,r=0;const i=n.length,a=s.length,l=new Array(i+a);let u=0;for(;o<i&&r<a;){const c=n[o],d=s[r];e.compareRowNodes(t,c,d)<0?(l[u++]=c.rowNode,++o):(l[u++]=d.rowNode,++r)}for(;o<i;)l[u++]=n[o++].rowNode;for(;r<a;)l[u++]=s[r++].rowNode;return l},Sye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,s=t==null?void 0:t.length,o=n==null?void 0:n.length;if(!s||!o)return null;const r=new Array(o),i=new Set;for(let l=0;l<o;++l)i.add(n[l]);let a=0;for(let l=0;l<s;++l){const u=t[l];i.delete(u)&&(r[a++]=u)}if(i.size===0&&a===s)return t;for(const l of i)r[a++]=l;return r.length=a,r},Eye=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Os(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new ul(e);this.rootNode=t,this.nodeManager=this.createBean(new fye(t));const n=this.refreshModel.bind(this,{step:"group"}),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(s=>!!s);this.stages=n;for(let s=n.length-1;s>=0;--s)for(const o of n[s].refreshProps)t.set(o,s);this.addManagedPropertyListeners([...t.keys()],s=>{var r;const o=(r=s.changeSet)==null?void 0:r.properties;o&&this.onPropChange(o)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,s){let o,r=!1;do{o=!1;const i=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(i,n),u=Math.min(a,s);for(let c=l;c<=u;c++){const d=this.getRow(c);if(d.rowHeightEstimated){const h=ol(this.beans,d);d.setRowHeight(h.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const r=new Set(e),i=o==null?void 0:o.onPropChange(r);let a;r.has("rowData")?a=n.get("rowData"):i&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,Xe(1));const l={step:"nothing",changedProps:r};a&&(!i&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new fy,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const u=l.rowDataUpdated?"group":this.getRefreshedStage(e);u&&(l.step=u,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,s=t.length;let o=s;for(let r=0,i=e.length;r<i&&o;++r)o=Math.min(o,n.get(e[r])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const r=Ms(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],u=l.id;if(u!=null&&(e==null||e.add(u)),l.rowHeight==null){const c=ol(t,l,r,s);l.setRowHeight(c.height,c.estimated)}l.setRowTop(o),l.setRowIndex(i),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=i=>{(i==null?void 0:i.id)!=null&&!t.has(i.id)&&i.clearRowTopAndRowIndex()},o=i=>{s(i),s(i.detailNode),s(i.sibling);const a=i.childrenAfterGroup;if(!i.hasChildren()||!a)return;const l=i.level==-1;if(!(n&&!l&&!i.expanded))for(let c=0,d=a.length;c<d;++c)o(a[c])},r=this.rootNode;r&&o(r)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,r;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=(o=e.sibling)!=null&&o.displayed?1:0;return(((r=e.childrenAfterSort)==null?void 0:r.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const r=n.childrenAfterSort,i=l=>{let u=r[l];if(this.gos.get("groupHideOpenParents"))for(;u.expanded&&u.childrenAfterSort&&u.childrenAfterSort.length>0;)u=u.childrenAfterSort[0];return u.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(s,e,r,i):i(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let r=o.parent;for(;r&&r!==t;)o=r,r=o.parent;const i=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return i>=0?i:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:ld(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const s=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:ld(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:ld(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new ap(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:s}=e;return!(!t||n||!s||t.removals.size||t.adds.size)}refreshModel(e){var u,c;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:r}=this;if(!t)return;const i=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(o&&i&&s.dispatchEvent({type:"rowDataUpdated"}),!o||r||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(u=n.masterDetailSvc)==null||u.refreshModel(e),i&&e.step!=="group"&&((c=n.colFilter)==null||c.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,s=!1;const o=[],r=qf(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(s)return;if(n&&(i===t||i===e)&&(s=!0,r&&i.group)){SB(o,i);return}if(!n){if(i!==t&&i!==e)return;n=!0,t===e&&(s=!0)}(!i.group||!r)&&o.push(i)}),o}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let s=0,o=n-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let i=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),u=t[l];if(this.isRowInPixel(u,e)||(u.rowTop<e?s=l+1:u.rowTop>e&&(o=l-1),i===s&&a===o))return l;i=s,a=o}}isRowInPixel(e,t){const n=e.rowTop,s=n+e.rowHeight;return n<=t&&s>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,s=t.length;n<s;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:s,rowGroupColsSvc:o}=this.beans;if(!s.isPivotMode())return;if(!(o!=null&&o.columns.length)){e(this.rootNode,0);return}const r=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,i=>i.leafGroup?null:i[r])}depthFirstSearchRowNodes(e,t=!1,n=r=>r.childrenAfterGroup,s=this.rootNode,o=0){let r=o;if(!s)return r;const i=s===this.rootNode;if(i||e(s,r++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;r=(l==null?void 0:l.addTotalRows(r,s,e,t,i,"top"))??r;for(const u of a)r=this.depthFirstSearchRowNodes(e,t,n,u,r);return(l==null?void 0:l.addTotalRows(r,s,e,t,i,"bottom"))??r}}return r}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(s=>{s.childrenAfterSort=s.childrenAfterAggFilter.slice(0),bB(s)})}doGrouping(e){var o;const t=this.rootNode,n=this.beans.groupStage,s=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(s===void 0){const r=t._leafs;t.childrenAfterGroup=r,t.updateHasChildren();const i=t.sibling;i&&(i.childrenAfterGroup=r)}(s||e.rowDataUpdated)&&((o=this.beans.colFilter)==null||o.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,H2(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var s,o;const t=(s=this.nodeManager)==null?void 0:s.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(u0)===0?(o=this.beans.groupStage)==null?void 0:o.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:s}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const o=[],r=[],i=new fy;for(const{rowDataTransaction:l,callback:u}of s??[]){this.rowNodesCountReady=!0;const c=e.updateRowData(l,i);o.push(c),u&&r.push(u.bind(null,c))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,u=r.length;l<u;l++)r[l]()},0),o.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var o;const t=this.nodeManager;if(!t)return null;(o=this.beans.valueCache)==null||o.onDataChanged(),this.rowNodesCountReady=!0;const n=new fy,s=t.updateRowData(e,n);return this.commitTransactions(n),s}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const s=this.rootNode.childrenAfterSort??[];for(const o of s)o.setUiLevel(0);this.rowsToDisplay=s}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const s=t.sibling;s==null||s.setRowHeight(s.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},SB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let s=0,o=n.length;s<o;++s){const r=n[s];r.data&&e.push(r),r.group&&SB(e,r)}};function _ye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function Rye(e,t){const n=pl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function Dye(e){var t;return((t=pl(e))==null?void 0:t.isEmpty())??!0}function Tye(e,t){var n;(n=pl(e))==null||n.forEachLeafNode(t)}function Iye(e,t){var n;(n=pl(e))==null||n.forEachNodeAfterFilter(t)}function xye(e,t){var n;(n=pl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function Fye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=pl(e))==null?void 0:n.updateRowData(t)})}function Pye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=pl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function Aye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=pl(e))==null?void 0:t.flushAsyncTransactions()})}function kye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var EB={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[Eye,wye],dependsOn:[A2]},Oye={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:_ye,refreshClientSideRowModel:Rye,isRowDataEmpty:Dye,forEachLeafNode:Tye,forEachNodeAfterFilter:Iye,forEachNodeAfterFilterAndSort:xye,applyTransaction:Fye,applyTransactionAsync:Pye,flushAsyncTransactions:Aye,getBestCostNodeSelection:kye,resetRowHeights:wB,onRowHeightChanged:yB},dependsOn:[lye,uye]},Mye=class extends We{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:s,skipRowGroups:o,exportRowNumbers:r}=t,i=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:r});return[this.prepareSession(i),this.prependContent(t),this.exportColumnGroups(t,i),this.exportHeaders(t,i),this.processPinnedTopRows(t,i),this.processRows(t,i),this.processPinnedBottomRows(t,i),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),i=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!i,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,u=!!s.footer,c=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&Loe(this.gos,s);if(!l&&!u&&(t.skipRowGroups||c||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!u||o(Ft(this.gos,{node:s})))return;const f=e.onNewBodyRow(s);if(n.forEach((g,v)=>{f.onColumn(g,v,s)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Ft(this.gos,{node:s}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const s=new gL,{colGroupSvc:o}=this.beans,r=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,r)=>{s.onColumn(o,r,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,r;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(i.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var u;const s=this.rowModel,o=os(this.gos),r=ad(this.gos),i=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,d)=>c.rowIndex-d.rowIndex).map(c=>s.getRow(c.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||i){const c=((u=this.beans.selectionSvc)==null?void 0:u.getSelectedNodes())??[];this.replicateSortedOrder(c),c.forEach(a)}else l==="all"?s.forEachNode(a):o||r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const s=t.getSortOptions(),o=(r,i)=>{var a,l;return r.rowIndex!=null&&i.rowIndex!=null?r.rowIndex-i.rowIndex:r.level===i.level?((a=r.parent)==null?void 0:a.id)===((l=i.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:r,currentPos:r.rowIndex??-1},{rowNode:i,currentPos:i.rowIndex??-1}):o(r.parent,i.parent):r.level>i.level?o(r.parent,i):o(r,i.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,r;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(i.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:r,gos:i,visibleCols:a}=this,l=r.isPivotMode(),u=h=>ca(h)?!1:!da(h)||s;if(o!=null&&o.length)return r.getColsForKeys(o).filter(u);const c=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>u(h)&&(n&&!c?!ME(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const r=o;if(r.getChildren)for(const i of r.getChildren()??[])s.push(i)}e.length>0&&rs(e[0])&&this.doAddHeaderHeader(t,e,n),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,n)}doAddHeaderHeader(e,t,n){const s=e.onNewHeaderGroupingRow();let o=0;for(const r of t){const i=r;let a;n?a=n(Ft(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const u=(i.isExpandable()?i.getLeafColumns():[]).reduce((c,d,h,f)=>{let p=Tn(c);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],c.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),c},[]);s.onColumn(i,a||"",o++,i.getLeafColumns().length-1,u)}}},Nye={moduleName:"SharedExport",version:ut,beans:[Mye]},_B=`\r
253
253
  `,Lye=class extends hge{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,_B),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,s)=>{s!==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,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}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 s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.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():(Xe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=_B),this.isFirstLine=!1}},Vye=class extends dge{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()){Xe(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(Ft(this.gos,{})):t.fileName;fge(this.getFileName(o),s)}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:s,valueSvc:o,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:u,suppressQuotes:c,columnSeparator:d}=e;return new Lye({colModel:t,colNames:n,valueSvc:o,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:u||void 0,suppressQuotes:c||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function Bye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function $ye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Hye={moduleName:"CsvExport",version:ut,beans:[Vye],apiFunctions:{getDataAsCsv:Bye,exportDataAsCsv:$ye},dependsOn:[Nye]},Gye=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:s,rowNodes:o}=this;for(let r=0;r<e;r++){const i=n+r,a=new ul(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){dt(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Xe(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Ft(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,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((o,r)=>{const i=e.rowData?e.rowData[r]:void 0;!o.id&&o.alreadyRendered&&i&&(t[r]=new ul(n),t[r].setRowIndex(o.rowIndex),t[r].setRowTop(o.rowTop),t[r].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},Uye=2,Wye=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 s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new Gye(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()&&(sl(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 s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=Uye-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,u=s?a>=o:!1;if(l||u){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:s}=e;return t.rowIndex>=n&&t.rowIndex<s}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:s}=this.params,r=(e.id+1)*n+s;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,dt(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,s)=>n.id-s.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 s=-1,o=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(o&&s+1!==l.id){i=!0;continue}s=l.id,l.forEachNode(u=>{const c=u===e||u===t;(o||c)&&n.push(u),c&&(o=!o)},r,this.rowCount)}return i||o?[]:n}},zye=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 ul(e);this.rootNode=t,t.level=-1,this.rowHeight=vu(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=vu(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!kf(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;ud(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:s,eventSvc:o,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:vu(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new Wye(this.cacheParams)),o.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 jye(e){var t;(t=by(e))==null||t.refreshCache()}function Kye(e){var t;(t=by(e))==null||t.purgeCache()}function qye(e){var t;return(t=by(e))==null?void 0:t.getRowCount()}var Yye=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Voe(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Os(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){$r(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){sl(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:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){sl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Zye={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[zye,Yye]},Xye={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:jye,purgeInfiniteCache:Kye,getInfiniteRowCount:qye},dependsOn:[Zye,cye]},Jye="↑",Qye="↓",ewe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},twe=class extends wn{constructor(){super(ewe),this.eValue=ct,this.eDelta=ct,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=dt(s)?s:n,r=t>=0,i=this.eDelta;r?i.textContent=Jye+o:i.textContent=Qye+o,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"),ks(this.eDelta)}refresh(e,t=!1){var u;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:r,beans:i}=this;if(n===r||(dt(s)?o.textContent=s:dt(n)?o.textContent=n:ks(o),(u=i.filterManager)!=null&&u.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 c=a-l;this.showDelta(e,c)}return r&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},nwe=".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}",swe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},owe=class extends wn{constructor(){super(swe),this.eCurrent=ct,this.refreshCount=0,this.registerCSS(nwe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=is({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,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 o;let n=e.value;if(Vn(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return dt(e.valueFormatted)?s.textContent=e.valueFormatted:dt(e.value)?s.textContent=n:ks(s),!0}},rwe=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"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const r=Date.now(),i=r+n,a=r+n+s,l={phase:"flash",flashEndTime:i,fadeEndTime:a};o.set(e,l);const u=`ag-cell-${t}`,c=`${u}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(u,!0),d.toggleCss(c,!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 s=this.animations[n],o=`ag-cell-${n}`,r=`${o}-animation`;for(const[i,a]of s){if(!i.isAlive()||!i.comp){s.delete(i);continue}const{phase:l,flashEndTime:u,fadeEndTime:c}=a,d=l==="flash"?u:c;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(o,!1),f.toggleCss(r,!0),p.transition=`background-color ${c-u}ms`,p.transitionDelay=`${u-e}ms`,t=Math.min(c,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.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=oce(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 iwe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var awe={moduleName:"HighlightChanges",version:ut,beans:[rwe],userComponents:{agAnimateShowChangeCellRenderer:twe,agAnimateSlideCellRenderer:owe},apiFunctions:{flashCells:iwe}};function lwe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function uwe(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function RB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=cwe(e)),e.version=ut,e}function cwe(e){return e.cellSelection=dwe(e,"rangeSelection"),e}function dwe(e,t){if(e&&typeof e=="object")return e[t]}var hwe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Os(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Os(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=Os(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=os(e);const s=RB(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:u})=>{u==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=RB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.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,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);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:s,rowGroupExpansion:o,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(c,d)=>!(n!=null&&n.has(c))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(r,o,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const u=this.updateCachedState.bind(this);u("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(u("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),u("rowGroupExpansion",void 0)):(u("rowGroupExpansion",this.getRowGroupExpansionState()),u("ssrmRowGroupExpansion",void 0)),u("rowSelection",this.getRowSelectionState()),u("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))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.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:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,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",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const u=this.updateCachedState.bind(this);u("sideBar",this.getSideBarState()),u("focusedCell",this.getFocusedCellState());const c=this.getRangeSelectionState();u("rangeSelection",c),u("cellSelection",c),u("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:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return lge(Wv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:u,columnSizing:c,columnOrder:d}=e;let h=!1;const f=(E,A)=>{const k=!(s!=null&&s.has(E))&&!!(A||t==="api");return h||(h=k),k},p={},g=E=>{let A=p[E];return A||(A={colId:E},p[E]=A,A)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:E,sort:A},k)=>{const O=g(E);O.sort=A,O.sortIndex=k})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((E,A)=>{const k=g(E);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:E,aggFunc:A})=>{g(E).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((E,A)=>{const k=g(E);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const E of(l==null?void 0:l.leftColIds)??[])g(E).pinned="left";for(const E of(l==null?void 0:l.rightColIds)??[])g(E).pinned="right"}(_||!n)&&(v.pinned=null);const D=f("columnVisibility",u);if(D)for(const E of(u==null?void 0:u.hiddenColIds)??[])g(E).hide=!0;(D||!n)&&(v.hide=null);const T=f("columnSizing",c);if(T)for(const{colId:E,flex:A,width:k}of(c==null?void 0:c.columnSizingModel)??[]){const O=g(E);O.flex=A??null,O.width=k}(T||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,x=!!(I!=null&&I.length)&&!(s!=null&&s.has("columnOrder")),F=x?I.map(E=>g(E)):Object.values(p);(F.length||h)&&(this.columnStates=F,Hr(this.beans,{state:F,applyOrder:x,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:r,colGroupSvc:i}=o;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Hr(o,{state:a,applyOrder:e},t)}s&&(i==null||i.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return uge(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=s.getColumnGroupState().map(({groupId:l})=>{const u=o.has(l);return u&&o.delete(l),{groupId:l,open:u}});for(const l of o)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),s.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(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:r,endRow:i,colIds:a.map(u=>u.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!la(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const u of i.colIds){const c=s.getCol(u);c&&a.push(c)}if(!a.length)continue;let l=s.getCol(i.startColId);if(!l){const u=o.allCols,c=new Set(a);l=u.find(d=>c.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:s,rowRenderer:o,animationFrameSvc:r,ctrlsSvc:i}=this.beans;s.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.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:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:r}=e??{page:0,pageSize:s.get("paginationPageSize")},i=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.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 s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const r=t[o];kf(r,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),kf(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")}},fwe={moduleName:"GridState",version:ut,beans:[hwe],apiFunctions:{getState:lwe,setState:uwe}};function pwe(e){return e.rowModel.isLastRowIndexKnown()}function gwe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function mwe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function vwe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function ywe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function wwe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Cwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function bwe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Swe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Ewe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var _we=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 s=Math.max(vu(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Os(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},gp="paginationPageSizeSelector",Rwe={tag:"span",cls:"ag-paging-page-size"},Dwe=class extends wn{constructor(){super(Rwe),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(gp,()=>{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(){ks(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(gp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),r=this.gos.get(gp)!==!0;Xe(94,{pageSizeSet:o,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Xe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:gp}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(il(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new s0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(gp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Twe={selector:"AG-PAGE-SIZE-SELECTOR",component:Dwe},Iwe=".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}",xwe=class extends NV{constructor(){super(),this.btFirst=ct,this.btPrevious=ct,this.btNext=ct,this.btLast=ct,this.lbRecordCount=ct,this.lbFirstRowOnPage=ct,this.lbLastRowOnPage=ct,this.lbCurrent=ct,this.lbTotal=ct,this.pageSizeComp=ct,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(Iwe)}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(),[Twe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),o.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):_le(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:s=>{(s.key===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Ele(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}):cge(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 s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Vse(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(),s=e?n:null,o=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*o+1,a=i+r-1,e&&a>s&&(a=s));const l=i+r-1,u=!e&&n<l,c=this.formatNumber(i);this.lbFirstRowOnPage.textContent=c;let d;const h=this.getLocaleTextFunc();u?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(c,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),u=`${e} ${a} ${t} ${l} ${n}`,c=`${i} ${s} ${l} ${o}`;u!==this.ariaRowStatus&&(this.ariaRowStatus=u,(d=this.ariaAnnounce)==null||d.announceValue(u,"paginationRow")),c!==this.ariaPageStatus&&(this.ariaPageStatus=c,(h=this.ariaAnnounce)==null||h.announceValue(c,"paginationPage"))}},Fwe={selector:"AG-PAGINATION",component:xwe},Pwe=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 Fwe}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,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.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 dt(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:dt(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:dt(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:dt(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,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,r=n*o;let i=n*(o+1)-1;if(i>s&&(i=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===s)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,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}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:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},Awe={moduleName:"Pagination",version:ut,beans:[Pwe,_we],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:pwe,paginationGetPageSize:gwe,paginationGetCurrentPage:mwe,paginationGetTotalPages:vwe,paginationGetRowCount:ywe,paginationGoToNextPage:wwe,paginationGoToPreviousPage:Cwe,paginationGoToFirstPage:bwe,paginationGoToLastPage:Swe,paginationGoToPage:Ewe},dependsOn:[Sy]};function kwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function DB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&DB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function Owe(e,t){return e.rowModel.getRowNode(t)}function Mwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function Nwe(e){return e.rowRenderer.getRenderedNodes()}function Lwe(e,t,n){e.rowModel.forEachNode(t,n)}function Vwe(e){return e.rowRenderer.firstRenderedRow}function Bwe(e){return e.rowRenderer.lastRenderedRow}function $we(e,t){return e.rowModel.getRow(t)}function Hwe(e){return e.rowModel.getRowCount()}var Gwe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:kwe,setRowNodeExpanded:DB,getRowNode:Owe,addRenderedRowListener:Mwe,getRenderedNodes:Nwe,forEachNode:Lwe,getFirstDisplayedRowIndex:Vwe,getLastDisplayedRowIndex:Bwe,getDisplayedRowAtIndex:$we,getDisplayedRowCount:Hwe}},Uwe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:nve,getHorizontalPixelRange:sve,ensureColumnVisible:aB,ensureIndexVisible:lB,ensureNodeVisible:ove}};function Wwe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function zwe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function jwe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Kwe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function qwe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function Ywe(e){return{rowHeight:vu(e),headerHeight:np(e)}}function Zwe(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(Qf(a))}if((r=t.columns)!=null&&r.length)return n;const s=[],o=e_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(o&&!t_(i.rowNode,o)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const u=a[l];u!=null&&s.push(Qf(u))}}return[...s,...n]}var Xwe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:Wwe,refreshCells:zwe,refreshHeader:jwe,isAnimationFrameQueueEmpty:Kwe,flushAllAnimationFrames:qwe,getSizesForCurrentTheme:Ywe,getCellRendererInstances:Zwe}};function Jwe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function TB({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function Qwe(e,t){var n;t&&typeof t=="object"?TB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var eCe=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 s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");s=r!=null&&r.length>0&&os(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var u;const o=c=>hd(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const r=IB(this.beans),i=c=>n.leftCols.some(d=>Zf(d,c)),a=c=>n.rightCols.some(d=>Zf(d,c)),l=e.colKeys.filter(c=>!ca(c)&&!da(c)&&!i(c)&&!a(c));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(u=e.columnLimits)==null?void 0:u.map(c=>({...c,key:c.colId})),colKeys:l,onlyScaleUp:!0}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:u=[],source:c="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 C=-1;const S=Object.fromEntries(u.map(({colId:_,...D})=>[_,D])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=r??b;for(;C!==0;){C=0;const _=[];for(const D of s){if(!D||Xoe(D))continue;const T=f.getCol(D);if(!T||v.has(T))continue;const I=p.getPreferredWidthForColumn(T,b);if(I>0){const x=S[T.colId]??{};x.minWidth??(x.minWidth=l),x.maxWidth??(x.maxWidth=a);const F=tCe(T,I,x);T.setActualWidth(F,c),v.add(T),C++}_.push(T)}_.length&&g.refresh(c)}w||this.autoSizeColumnGroupsByColumns(s,c,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,r=new Set,i=s.getColsForKeys(e);for(const l of i){let u=l.getParent();for(;u&&u!=n;)u.isPadding()||r.add(u),u=u.getParent()}let a;for(const l of r){for(const u of o.getHeaderRowContainerCtrls())if(a=u.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"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Tu(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{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:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=IB(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):Xe(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=ua(r);if(s!=null&&s.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),_=C.getActualWidth();return(b==null||_>=b)&&(w==null||_<=w)}))return;const l=[],u=[];for(const v of r){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Zf(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?u.push(v):l.push(v)}const c=l.slice(0);let d=!1;const h=v=>{$r(l,v),u.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-ua(u);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/ua(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],_=o==null?void 0:o[w.getId()],D=(_==null?void 0:_.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(_==null?void 0:_.maxWidth)??(s==null?void 0:s.defaultMaxWidth),I=w.getMinWidth(),x=w.getMaxWidth(),F=typeof D=="number"&&D>I?D:I,E=typeof T=="number"&&T<x?T:x;let A=Math.round(w.getActualWidth()*C);A<F?(A=F,h(w),d=!1):A>E?(A=E,h(w),d=!1):b===0&&(A=S),w.setActualWidth(A,t,!0),S-=A}}}for(const v of c)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&hd(this.eventSvc,c,!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 s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:r,defaultMaxWidth:i}=n,a=o==null?void 0:o.map(({colId:l,minWidth:u,maxWidth:c})=>({key:l,minWidth:u,maxWidth:c}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.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 tCe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function IB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Vf(n.eGridBody)-o}var nCe={moduleName:"ColumnAutoSize",version:ut,beans:[eCe],apiFunctions:{sizeColumnsToFit:Jwe,autoSizeColumns:TB,autoSizeAllColumns:Qwe},dependsOn:[QV]},sCe=".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 oCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function rCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function iCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function aCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function lCe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var uCe={moduleName:"PinnedRow",version:ut,beans:[iue],css:[sCe],apiFunctions:{getPinnedTopRowCount:oCe,getPinnedBottomRowCount:rCe,getPinnedTopRow:iCe,getPinnedBottomRow:aCe,forEachPinnedRow:lCe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},cCe=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 s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},dCe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),u=new Map,c=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(w,_)=>{p=w,g=null,v=_},S=w=>{const _=!w.isExpandable()&&!w.group&&!w.detail&&(c?!c({rowNode:w}):!0);if(w.rowIndex==null||!_){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,r.getValue(t,w));return}const D=r.getValue(t,w);if(f){const T=Ft(n,{valueA:v,nodeA:p,valueB:D,nodeB:w,column:t,colDef:a});if(!h(T)){C(w,D);return}}else if(d?!d(v,D):v!==D){C(w,D);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new cCe(t,p),u.set(p,g)}g.addSpannedNode(w),u.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!i||i.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=u;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=u;break;case"bottom":s==null||s.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=u;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}}},hCe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Os(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Os(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 dCe(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,s=e.column,o=e.rowIndex,r=this.spanningColumns.get(s);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(o);break;default:i=n.getRow(o)}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,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},fCe=class extends _d{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,s,o,r,i){this.eWrapper=n,super.setComp(e,t,n,s,o,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||_v(e,t.rowIndex)}setAriaRowSpan(){Use(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(cy(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}},pCe=class extends Cy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new fCe(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},gCe=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),s=n.size,o=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(u,c)=>{if(r.has(c.firstNode))return;const d=n.get(c.firstNode);if(d){r.set(c.firstNode,d),n.delete(c.firstNode);return}i=!0;const h=new pCe(c.firstNode,this.beans,!1,!1,!1);r.set(c.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===s;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 s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.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")}},mCe={moduleName:"CellSpan",version:ut,beans:[hCe,gCe]},vCe=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,s=n.cellClassRules,o=this.getCellClassParams(e,n);J0(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const r of o)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Ft(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},yCe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){J0(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new vCe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},wCe={moduleName:"CellStyle",version:ut,beans:[yCe]},CCe={moduleName:"RowStyle",version:ut,beans:[ipe]};function bCe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var SCe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:r,columns:i}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const u of this.destroyManagedListeners)u();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},ECe="ag-column-hover",_Ce=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 s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(ECe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new SCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},RCe={moduleName:"ColumnHover",version:ut,beans:[_Ce],apiFunctions:{isColumnHovered:bCe}},DCe=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,s=!vy.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{vy.has(i)&&t(i,a)},s=(i,a)=>{vy.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:i,asyncListener:a}=s.get(o);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,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:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function TCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function ICe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function xCe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function FCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var PCe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:TCe,addGlobalListener:xCe,removeEventListener:ICe,removeGlobalListener:FCe},beans:[DCe]},ACe={moduleName:"Locale",version:ut,beans:[age]},kCe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Os(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,u,c;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=ol(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.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=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",i),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",i),(u=t.forEachDisplayedNode)==null||u.call(t,i),r&&((c=t.onRowHeightChanged)==null||c.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=o.getLeftColsForRow(t);break;case"right":r=o.getRightColsForRow(t);break;case null:r=s.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:r}=e,i=this.beans,a=c=>{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}=gu(s),g=d+h+f+p,C=t.offsetHeight+g;if(c<5){const b=Rs(i),w=!(b!=null&&b.contains(t)),_=C==0;if(w||_){window.setTimeout(()=>a(c+1),0);return}}this.setRowAutoHeight(o,C,r)},l=()=>a(0);l();const u=tl(i,t,l);return n.addDestroyFunc(()=>{u(),this.setRowAutoHeight(o,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(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},OCe={moduleName:"RowAutoHeight",version:ut,beans:[kCe]},MCe={moduleName:"AllCommunity",version:ut,dependsOn:[EB,Hye,Xye,Rge,Mve,Nve,Lve,Vve,Bve,$ve,Hve,Ove,Tme,Ime,xme,Dme,Pme,Ame,fwe,hye,Awe,s2,Gwe,Uwe,Xwe,nCe,Cce,uCe,nye,Gpe,wCe,RCe,CCe,PCe,zpe,awe,oB,ACe,OCe,wce,Oye,mCe]};let xB=!1;xB||(Toe.registerModules([MCe,EB]),xB=!0);class NCe{constructor(t,n){Qn(this,"gridApi",null);Qn(this,"container");Qn(this,"config");Qn(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:s,onRowSelected:o,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=sge(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 s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const LCe=u2.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"),VCe=it({__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 s=e,o=n,r=B(null);Jb(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=Y(()=>({width:"100%",height:s.height||"500px"})),l=Y(()=>({...s,theme:LCe}));function u(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};i.value=new NCe(r.value,g),i.value.init(),c()}function c(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=i.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}: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 et(()=>s.columnDefs,(g,v)=>{const C=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(",");C!==S&&d(g)},{deep:!0}),Ss(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),rn(()=>{u()}),Ss(()=>{h()}),(g,v)=>(K(),ce("div",{ref_key:"gridContainerRef",ref:r,style:dn(a.value),class:te(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function xd(e){return lN(e)}const BCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:xd(au),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:xd(au)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:xd(au)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:xd(au)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:xd(au),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:xd(au),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>Af.fromType(n))],Iy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},$Ce={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},HCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Iy.WIDTH,minWidth:Iy.WIDTH,maxWidth:Iy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Iy.HEADER_CLASS,headerComponent:Ev(lJ),suppressMovable:!0}),GCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},UCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=_h({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const c=await s(t);if(c&&typeof c=="string")try{return JSON.parse(c)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},i=B([]),a=HCe(),l=async c=>{const d=await r(),h=new Map;d==null||d.forEach(A=>{A.width&&h.set(A.field,A.width)});const f=BCe(),p=Af.fromType(GCe),v=((c==null?void 0:c.map(A=>{var k;return{headerName:A.name,field:`metric_${A.id}`,editable:((k=A==null?void 0:A.auth_permission)==null?void 0:k.permission)==2,sortable:!0,filter:!1,flex:1,context:{...A},hide:!(A.is_primary||A.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Ev(au),headerComponentParams:O=>({headerType:A.metric_type.code=="number"||A.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${A.id}`)}}))||[]).map(A=>Af.fromType(A)),C=[a,...f,...v,$Ce,p],S=C.filter(A=>A.pinned==="left"),b=C.filter(A=>A.pinned==="right"||A.field==="blank"),w=C.filter(A=>!A.pinned&&A.field!=="blank");if(!d||d.length===0){i.value=C;return}const _=new Map(d.map(A=>[A.field,A])),D=new Map(w.map(A=>[A.field,A])),T=[];for(const A of d)if(A.field&&D.has(A.field)){const k=D.get(A.field);T.push({...k,hide:A.hide,width:A.width}),D.delete(A.field)}const I=Array.from(D.values()),x=[...T,...I],F=S.map(A=>{const k=_.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A}),E=b.map(A=>{const k=_.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A});i.value=[...F,...x,...E]};et(e,c=>l(c),{immediate:!0});const u=Tr((c,d)=>{var C,S;if(c.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(c.source)===-1){console.warn("Skipping saveColumnConfig for source:",c.source);return}else console.warn("Executing saveColumnConfig for source:",c.source);else console.warn("Executing saveColumnConfig for source:",c);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),i.value=h||i.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},ai);return{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},WCe=()=>{const e=En.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},zCe=e=>{var A,k,O;const{showMessage:t,showErrorNetMessage:n}=pf(),s=es(),o={domainApi:WCe(),wsCode:En.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(O=(k=(A=s==null?void 0:s.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:O.apiConfig;if(!r||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new Pk(r,o);i.on("call-api",N=>{N.success?t(N.apiCode,"success"):n(N)});const a=ao({}),l=B([]),u=B(!1),c=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=O7(),v=N=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:N}),C=50,S=async(N,W,X)=>{if(!N.length)return[];const ee=K4(N,W);return(await Promise.all(ee.map(X))).flat()},b=async N=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:N})).data.map(X=>[X==null?void 0:X.id,X.permission])}catch(W){return console.error("Failed to fetch item permissions chunk:",W),[]}},w=async(N,W)=>{try{const X=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:N,per_page:N.length*W.length,metric_ids:W}),ee=X.data.map(ae=>{const J=new Map(ae.item_metrics.map(H=>[H.metric_id,{value:H.value,auth_permission:H==null?void 0:H.auth_permission}])),V=Object.fromEntries(W.map(H=>[H,J.get(H)??null]));return[ae==null?void 0:ae.id,V]}),ie=new Set(X.data.map(ae=>ae==null?void 0:ae.id));for(const ae of N)if(!ie.has(ae)){const J=Object.fromEntries(W.map(V=>[V,{value:null,auth_permission:void 0}]));ee.push([ae,J])}return ee}catch(X){return console.error("Failed to fetch a chunk of metric values:",X),N.map(ie=>[ie,Object.fromEntries(W.map(ae=>[ae,void 0]))])}},_=async N=>{try{const W=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:N,per_page:N.length}),X=W.data.flatMap(ee=>ee.assignees);return g(X),W.data.map(ee=>[ee==null?void 0:ee.id,ee==null?void 0:ee.assignees])}catch(W){return console.error("Failed to fetch a chunk of assigned users:",W),[]}},D=async N=>{if(!N.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const W=await S(N,C,b);return Object.fromEntries(W)}catch(W){return console.error("Failed to fetch item permissions:",W),{}}},T=async(N,W)=>!N.length||!W.length?{}:(p=p.then(async()=>{try{const ie=[];let ae=0;for(let V=0;V<W.length;V+=5){ae++;const H=W.slice(V,V+5),Q=[];for(let ve=0;ve<H.length;ve++){const oe=H[ve],re=await S(N,C,j=>w(j,[oe]));Q.push(re),await new Promise(j=>setTimeout(j,500))}ie.push(...Q);const fe=V+5>=W.length}const J={};for(const V of ie.flat()){const[H,Q]=V;J[H]||(J[H]={}),Object.assign(J[H],Q)}return J}catch(X){return console.error("Failed to fetch metric values:",X),{}}}),p),I=async N=>{if(!N.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const W=await S(N,C,_);return Object.fromEntries(W)}catch(W){return console.error("Failed to fetch assigned users:",W),{}}};return{items:l,loading:u,error:c,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async N=>{const{cursor:W,offset:X,size:ee,searchQuery:ie}=N;let ae=[];u.value=!0,c.value=null;try{const J=await i.getAllItem_cursor({...N,cursor:W||void 0,offset:X||void 0,pageSize:ee||f.value,...v(ie),sortBy:N.sort_by});return l.value=J.data,d.value=J.meta,h.value=J.meta.current_page||0,ae=J.data.map(V=>V==null?void 0:V.id),J}catch(J){throw c.value=J,console.error("Failed to fetch items (cursor):",J),J}finally{const J=async()=>{try{const[V,H]=await Promise.all([I(ae),D(ae)]);e.value.updateItemData({assignees:V,permission:H},ae);const Q=await T(ae,e.value.metricIds);e.value.setMetricValues(Q,new Set(ae),e.value.metricIds)}catch(V){console.error("Post-fetch processing failed:",V)}};u.value=!1,setTimeout(J)}},getAssignableStatus:async N=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:N})}catch(W){throw console.error("Failed to fetch assignable status:",W),W}},getMetricList:async N=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:N})}catch(W){throw console.error("Failed to fetch metric list:",W),W}},getMetricValues:T,getAssignedUsers:I}};function jCe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);o.forEach(u=>{var d;const c=(d=e.value)==null?void 0:d.getRowNode(u);if(c){if(r.push(c),s.assignees){const h=C7((s.assignees[u]||[]).map(EF));c.data.assignees=h,i.add("assignees")}s.permission&&(c.data.permissions=s.permission[u]),l.forEach(h=>{c.data[h]=c.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(s,o,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(o).map(u=>[u,new Map(r.map(c=>[c,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==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(([u,c])=>{const d=i.getRowNode(u);return d!=null&&d.data?(c.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(u=>`metric_${u}`),force:!0})}}}function KCe(e,t,n,s,o){let r=!0;return{async getRows(i){try{s(!0),r&&(o(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,c),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),s(!1),o(!1)}}}}function qCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),u=()=>{n.value=!n.value},c=v=>{if(i.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=KCe(r,e.perPage,()=>s.value,w=>{i.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.deselectAll(),t.value=[],i.value=!0,!o.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Tr(v=>{d(v)},ai),p=()=>{o.value},g=B(!1);return{isLoading:i,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const YCe={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."]}}},ZCe=e=>{var t;return(t=Object.entries(YCe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},XCe={key:1},JCe=_t(it({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,r=()=>{s.value&&s.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:u}=ts(!1,{}),c=B(!1),d=async()=>{c.value=!0;const T=o.workspaceId,I=o.entityId;if(!T||!I||!u.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await u.value.downloadExportedItemsFile(T,I))throw new Error("No response from downloadTemplate API")}catch(x){console.error("Error downloading template:",x)}c.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var F,E,A;const I=new FormData,x=((F=T.name.split(".").pop())==null?void 0:F.toString())||"";if(I.append("file",T),I.append("format",x),I.append("entity_id",o.entityId||""),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I),g()}catch(k){throw console.error("Error uploading file:",k),v(((A=(E=k.response)==null?void 0:E.data)==null?void 0:A.message)||"An unknown error occurred during file upload."),k}},g=()=>{a.value="success"},v=T=>{i.value=T,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;D(),(T=s.value)==null||T.hide()};t({close:S,open:r});const b=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=Y(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=B(null),D=()=>{var T;(T=_.value)==null||T.clear(),i.value="",l.value={file:null,format:null},a.value="idle"};return(T,I)=>(K(),Ke(U(Bk),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:D},th({default:me(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Ke(nN,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(K(),ce("div",XCe,[Re("div",{class:te(T.$style["step-section"])},[Re("span",{class:te(T.$style["step-title"])},"Step 1: Download current data",2),Re("span",{class:te(T.$style["step-description"])},[...I[1]||(I[1]=[st(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),Re("br",null,null,-1),Re("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),pe(U(vt),{class:te(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:c.value,onHandleClick:d},{prefix:me(()=>[pe(U(lt),{src:"Download"})]),default:me(()=>[I[2]||(I[2]=st(" Download file ",-1))]),_:1},8,["class","disabled"])],2),Re("div",{class:te(T.$style["step-section"])},[Re("span",{class:te(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),pe(U(_O),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=x=>l.value=x),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),Re("div",{class:te(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[pe(sN)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:me(()=>[pe(U(vt),{style:{flex:"1"},variant:"secondary",onClick:S},{default:me(()=>[...I[3]||(I[3]=[st(" Cancel ",-1)])]),_:1}),pe(U(vt),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:me(()=>[...I[4]||(I[4]=[st(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:me(()=>[pe(U(vt),{style:{flex:"1"},variant:"primary",onClick:f},{default:me(()=>[...I[5]||(I[5]=[st(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:me(()=>[pe(U(vt),{style:{flex:"1"},variant:"primary",onClick:D},{default:me(()=>[...I[6]||(I[6]=[st(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),QCe=_t(it({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=qb(),{setUserPermissions:o,setEntityPermissions:r}=s,{entityPermissions:i}=Js(s),a=Qt,l=B(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=B(""),d=Y(()=>{var Ye;const ke=((Ye=i.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!ke},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!ke,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!ke,id:"overwrite_scenes_option"}]}),h=e;Af.initialize({wrapVueCellRenderer:Ev,wrapVueCellEditor:lN});const f=Qh(),{switchInstanceFunc:p}=Js(f);rn(()=>{const ke=es();p.value=ke==null?void 0:ke.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");mt(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),C=Um(),{rowCount:S}=Js(C),b=B(!1),w=B(""),_=B(),D=BA(),{metricList:T}=Js(D),I=B(""),x=B(!1),F=B(new Set),E=B(new Map),{apiServices:A}=ts(!1,h),{columnDefs:k,checkboxColumn:O,saveColumnConfig:N}=UCe(T,h.entityId,g),W=B();et(()=>k,()=>{var ke;(ke=W.value)==null||ke.updateColumnDefs(k.value)},{deep:!0});const X=(ke,Ye)=>{N(ke,Ye)},{updateRowData:ee,setMetricValues:ie}=jCe(g),ae=Y(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(Ae.value||{}).length==1&&Object.keys(Ae.value)[0]=="preflight_status")&&Object.keys(Ae.value||{}).length>0})),J=Y(um),V=Y(()=>k.value.filter(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.startsWith("metric_"))&&!ke.hide}).map(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.replace("metric_",""))||""}));Xr("timezone",J);const H=Y(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:V.value,updateItemData:ee,setMetricValues:ie})),{fetchItems:Q,getMetricList:fe,cusorMap:ve,getMetricValues:oe}=zCe(H),re=Y(()=>{if(!g.value)return!1;const ke=g.value.getSelectedRows().length;return ke>0&&ke>=S.value.total}),j=Y(()=>{var ke;return((ke=l.value)==null?void 0:ke.name)||"Items"}),ge=ke=>{setTimeout(()=>{mt(()=>{var Ye,Jt;g.value&&(ke?(Ye=g.value)==null||Ye.showNoRowsOverlay():(Jt=g.value)==null||Jt.hideOverlay())})},500)},se=(ke,Ye)=>{var Jt;S.value.total=ke.meta.total??0,(Jt=ke.meta.next)!=null&&Jt.cursor&&(ve[Ye+1]=ke.meta.next.cursor),I.value=ke.meta["X-Tsr-signature"]||"",ke.meta.total===0?ge(!0):ge(!1)},be=EO(),G=B(null),{sortingAPIConfiguration:Z,isSortingRunning:de}=Js(be),Ae=B({preflight_status:"1"}),Fe=Y(()=>({...Ae.value,search:w.value}));Xr("filterParams",Fe);const Le=B([]),ye=async({page:ke,pageSize:Ye,filterText:Jt})=>{var Go;(Go=g.value)==null||Go.hideOverlay();const Zt=ve[ke],Co=!Zt&&ke>1?(ke-1)*Ye:void 0,wa=Z.value;wa.length>0&&(de.value=!0);try{const Ca={cursor:Zt,size:Ye,searchQuery:Jt,offset:Co,sort_by:wa,...Ae.value},so=await Q(Ca);if(!so)return{rows:[],total:0};const mp=(Kn=>{const Ai=Kn.data.map(bo=>RF(bo,J.value));return Ai.forEach(bo=>{F.value.add(String(bo.id)),E.value.set(String(bo.id),{})}),Ai})(so);return se(so,ke),{rows:mp,total:S.value.total}}catch(Ca){return console.error("Failed to fetch items:",Ca),{rows:[],total:0}}finally{de.value=!1}},{isLoading:M,toggleSidebar:$,onGridReady:le,handleUnSelect:Ge,handleSelectAll:we,onSearch:ze,firstLoad:Ue}=qCe({selectRowData:B([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:u.ROWS_PER_PAGE,fetcher:ye}),Ee=B([]),Ve=()=>{var ke;Ee.value=((ke=g.value)==null?void 0:ke.getSelectedRows())||[]},pt=ao({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),At=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.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:Ut,noRowsOverlayComponent:Ev(KQ),noRowsOverlayComponentParams:()=>ae.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:ke=>ke.data.id,getRowClass:ke=>{if(!ke.data)return["row-empty"];const Ye=["row-highlight"];return ke.data.id||Ye.push("row-inactive"),ke.data.isDeleted&&Ye.push("row-deleted"),ke.data.disabled&&Ye.push("row-deleted"),ke.data.isArchived&&Ye.push("row-archived"),ke.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:A.value,sorting:de.value},onCellKeyDown:ke=>{var Ye,Jt,Zt;if(ke.data.isDeleted)return!1;if(((Ye=ke==null?void 0:ke.event)==null?void 0:Ye.key)==="Enter"){const{api:Co,node:wa,column:Go}=ke,Ca=Co.getCellRendererInstances({rowNodes:[wa],columns:[Go]});if(Ca.length>0){const so=Ca[0];so&&typeof((Jt=so.componsenExposed)==null?void 0:Jt.focus)=="function"&&((Zt=so.componsenExposed)==null||Zt.focus())}}},isRowSelectable:ke=>!ke.group,suppressKeyboardEvent:ke=>{var Zt;if((Zt=ke.data)!=null&&Zt.isDeleted)return!0;const Ye=ke.event.key,Jt=ke.editing;return Jt&&Ye==="Tab"?!0:Jt&&Ye==="Enter"?!1:Ye==="Enter"?(ke.event.preventDefault(),ke.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:ke=>{const Ye=ke.api.getFirstDisplayedRowIndex(),Jt=ke.api.getLastDisplayedRowIndex();pt.rowsDisplay.fromIndex=Ye,pt.rowsDisplay.toIndex=Jt,pt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Zt=>Zt.getColId())},onViewportChanged:ke=>{pt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(ke){if(ke.data.isDeleted&&ke.api.stopEditing(),ke.colDef.field=="options"){const Ye=ke.api.getCellRendererInstances({rowNodes:[ke.node],columns:[ke.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:ke=>{let Ye=ke.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const Jt=ke.api.getAllDisplayedColumns(),Zt=Jt.indexOf(Ye.column),Co=ke.backwards?-1:1,wa=Jt[Zt+Co];if(wa)return{rowIndex:Ye.rowIndex,column:wa,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let ke=0;g.value.forEachNode(Ye=>{Ye.data&&ke++}),S.value.loaded=Math.min(ke,S.value.total)}et(()=>Z,()=>{g.value&&(I.value="",F.value.clear(),g.value.deselectAll(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const en=B(),zt=B(),Ne=()=>{var ke;(ke=zt.value)==null||ke.open()},je=()=>{var ke;(ke=en.value)==null||ke.open()},wt=async()=>{Ue.value=!0,g.value&&(I.value="",F.value.clear(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Nt=Y(()=>En.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=B();Y(()=>{var ke;return(ke=ZCe(Nt.value))==null?void 0:ke.map(Ye=>`<div>• ${Ye}</div>`).join(`
254
- `)});function nt(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?je():ke==="overwrite_scenes"&&Ne()}const Ts=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},Ur=ke=>{const Ye=le(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",Zt=>X(Zt,!0)),Ye.addEventListener("columnResized",Zt=>X(Zt,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},xi=()=>{var ke;c.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};rn(()=>{mt(()=>{xi()}),window.addEventListener("resize",xi);function ke(){requestAnimationFrame(ke)}ke()}),Ss(()=>{window.removeEventListener("resize",xi)});const gr=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var Jt;(Jt=_.value)==null||Jt.setValue(Ye)},300)},ya=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},ml=ke=>ke.metric_type.code==="number"?"number":"default",Fi=async()=>{if(h.entityId)try{const ke=await fe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:ml(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},Pi=async()=>{if(A.value)try{const ke=await A.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},mr=async()=>{if(A.value)try{const ke=await A.value.getEntityDetail(h.workspaceId,h.entityId);r(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Wr=dv(),{setUser:Fd}=Wr,kn=async()=>{if(A.value)try{const ke=await A.value.getMe();return Fd(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},fs=async()=>{var ke;if(A.value)try{const Ye=await A.value.getWorkspaces(h.workspaceId),Jt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return Jt&&Wr.setUserRoleId(Jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(kn(),fs(),Fi(),Pi(),mr())},{immediate:!0,deep:!0}),et(V,(ke,Ye)=>{const Jt=ke.filter(Zt=>!(Ye!=null&&Ye.includes(Zt)));Jt.length>0&&oe(Array.from(F.value),Jt).then(Zt=>{ie(Zt,F.value,Jt)})},{immediate:!0,deep:!0}),et(I,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const w_=ke=>{Ae.value=ke,wt()},Pd=ke=>{Le.value=ke,wt()},Ad=ke=>{k.value=ke||[],X({},!0)},kd=Y(()=>{var Zt;const ke=En.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((Zt=Ye==null?void 0:Ye.find(Co=>Co.code==="scene"))==null?void 0:Zt.name)||"Scene"}`});return(ke,Ye)=>{const Jt=Eo("focusable");return K(),Ke(U(sJ),{"is-sidebar-open":b.value,onCloseSidebar:U($),onSidebarClear:U($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U($)},{"header-left":me(()=>{var Zt;return[((Zt=U(i))==null?void 0:Zt.has_create_item_permission)==1?(K(),Ke(U(fS),{key:0,variant:["primary"],options:d.value,onSelect:nt,onHandleClick:Ye[1]||(Ye[1]=Co=>nt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:me(()=>[qe(pe(U(vt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Co=>nt("new_scene")),label:kd.value},null,8,["label"]),[[Jt,1]])]),_:1},8,["options"])):Je("",!0)]}),"header-actions":me(()=>[pe(U(Fee),{"onUpdate:assignees":Pd,onApplyFilter:w_,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),qe(pe(U(eS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=Zt=>w.value=Zt),onSearch:U(ze),class:te(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=Zt=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),qe((K(),Ke(U(OA),{status:U(M)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:me(()=>[qe((K(),Ke(U(vt),{variant:["secondary","icon"],disabled:U(M),onClick:wt},{default:me(()=>[pe(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),qe(pe(U(xQ),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=Zt=>Ad(Zt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:W,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:me(({availableHeight:Zt})=>[pe(U(VCe),Kt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:Zt+"px",isSorting:U(de),onOnGridReady:Ur,onSelectionChanged:Ts}),null,16,["height","isSorting"])]),footer:me(()=>[Re("div",{class:te(ke.$style.tableFooter),id:"table_footer"},[Re("span",null,[Ye[5]||(Ye[5]=st(" Showing ",-1)),Re("b",null,Ct(U(S).loaded)+" of "+Ct(U(S).total),1)])],2)]),"new-row":me(()=>[pe(U(iee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:gr,onFocusOnId:ya},null,512)]),"bulk-update-actions":me(()=>[!b.value&&v.value.length>0?qe((K(),Ke(U(YX),{key:0,selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":j.value,"selected-all":re.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ko,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:me(()=>[pe(U(VJ))]),popup:me(()=>[pe(vse,{ref_key:"popupCreateSceneRef",ref:en,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),pe(JCe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},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"}}]]),FB="0.1.111",ebe={key:0},tbe=_t(it({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=ao({id:"",workspaceId:"",apiConfig:{}}),s=pf(),{showMessage:o,showErrorNetMessage:r}=s,i=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),u=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Qd(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",FB);try{if(l.value=es(),!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)||En.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:En.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 Pk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Ss(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=Y(()=>n.id),d=Y(()=>n.workspaceId);return Xr("workspaceId",d),Xr("entityId",c),(h,f)=>(K(),ce("div",{class:te(h.$style.dashboardPluginWrapper)},[t.value?(K(),ce("span",ebe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(K(),Ke(U(QCe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Je("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),y_=async(e={},t={})=>{const n=wT(tbe),s=rY();n.use(s);const o=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,o.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,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${FB}`,"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",Qt),n.directive("focusable",Wi);const i=await pse();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=y_),On.default=y_,On.initDashboard=y_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
254
+ `)});function nt(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?je():ke==="overwrite_scenes"&&Ne()}const Ts=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},Ur=ke=>{const Ye=le(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",Zt=>X(Zt,!0)),Ye.addEventListener("columnResized",Zt=>X(Zt,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},xi=()=>{var ke;c.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};rn(()=>{mt(()=>{xi()}),window.addEventListener("resize",xi);function ke(){requestAnimationFrame(ke)}ke()}),Ss(()=>{window.removeEventListener("resize",xi)});const gr=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var Jt;(Jt=_.value)==null||Jt.setValue(Ye)},300)},ya=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},ml=ke=>ke.metric_type.code==="number"?"number":"default",Fi=async()=>{if(h.entityId)try{const ke=await fe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:ml(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},Pi=async()=>{if(A.value)try{const ke=await A.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},mr=async()=>{if(A.value)try{const ke=await A.value.getEntityDetail(h.workspaceId,h.entityId);r(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Wr=dv(),{setUser:Fd}=Wr,kn=async()=>{if(A.value)try{const ke=await A.value.getMe();return Fd(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},fs=async()=>{var ke;if(A.value)try{const Ye=await A.value.getWorkspaces(h.workspaceId),Jt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return Jt&&Wr.setUserRoleId(Jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(kn(),fs(),Fi(),Pi(),mr())},{immediate:!0,deep:!0}),et(V,(ke,Ye)=>{const Jt=ke.filter(Zt=>!(Ye!=null&&Ye.includes(Zt)));Jt.length>0&&oe(Array.from(F.value),Jt).then(Zt=>{ie(Zt,F.value,Jt)})},{immediate:!0,deep:!0}),et(I,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const w_=ke=>{Ae.value=ke,wt()},Pd=ke=>{Le.value=ke,wt()},Ad=ke=>{k.value=ke||[],X({},!0)},kd=Y(()=>{var Zt;const ke=En.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((Zt=Ye==null?void 0:Ye.find(Co=>Co.code==="scene"))==null?void 0:Zt.name)||"Scene"}`});return(ke,Ye)=>{const Jt=Eo("focusable");return K(),Ke(U(sJ),{"is-sidebar-open":b.value,onCloseSidebar:U($),onSidebarClear:U($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U($)},{"header-left":me(()=>{var Zt;return[((Zt=U(i))==null?void 0:Zt.has_create_item_permission)==1?(K(),Ke(U(fS),{key:0,variant:["primary"],options:d.value,onSelect:nt,onHandleClick:Ye[1]||(Ye[1]=Co=>nt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:me(()=>[qe(pe(U(vt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Co=>nt("new_scene")),label:kd.value},null,8,["label"]),[[Jt,1]])]),_:1},8,["options"])):Je("",!0)]}),"header-actions":me(()=>[pe(U(Fee),{"onUpdate:assignees":Pd,onApplyFilter:w_,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),qe(pe(U(eS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=Zt=>w.value=Zt),onSearch:U(ze),class:te(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=Zt=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),qe((K(),Ke(U(OA),{status:U(M)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:me(()=>[qe((K(),Ke(U(vt),{variant:["secondary","icon"],disabled:U(M),onClick:wt},{default:me(()=>[pe(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),qe(pe(U(xQ),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=Zt=>Ad(Zt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:W,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:me(({availableHeight:Zt})=>[pe(U(VCe),Kt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:Zt+"px",isSorting:U(de),onOnGridReady:Ur,onSelectionChanged:Ts}),null,16,["height","isSorting"])]),footer:me(()=>[Re("div",{class:te(ke.$style.tableFooter),id:"table_footer"},[Re("span",null,[Ye[5]||(Ye[5]=st(" Showing ",-1)),Re("b",null,Ct(U(S).loaded)+" of "+Ct(U(S).total),1)])],2)]),"new-row":me(()=>[pe(U(iee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:gr,onFocusOnId:ya},null,512)]),"bulk-update-actions":me(()=>[!b.value&&v.value.length>0?qe((K(),Ke(U(YX),{key:0,selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":j.value,"selected-all":re.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ko,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:me(()=>[pe(U(VJ))]),popup:me(()=>[pe(vse,{ref_key:"popupCreateSceneRef",ref:en,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),pe(JCe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},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"}}]]),FB="0.1.112",ebe={key:0},tbe=_t(it({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=ao({id:"",workspaceId:"",apiConfig:{}}),s=pf(),{showMessage:o,showErrorNetMessage:r}=s,i=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),u=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Qd(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",FB);try{if(l.value=es(),!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)||En.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:En.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 Pk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Ss(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=Y(()=>n.id),d=Y(()=>n.workspaceId);return Xr("workspaceId",d),Xr("entityId",c),(h,f)=>(K(),ce("div",{class:te(h.$style.dashboardPluginWrapper)},[t.value?(K(),ce("span",ebe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(K(),Ke(U(QCe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Je("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),y_=async(e={},t={})=>{const n=wT(tbe),s=rY();n.use(s);const o=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,o.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,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${FB}`,"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",Qt),n.directive("focusable",Wi);const i=await pse();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=y_),On.default=y_,On.initDashboard=y_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});