@arbocollab/arbo-plugin-item-table 0.1.228 → 0.1.229
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.
- package/lib/es/index.es.js +2180 -2172
- package/lib/style.css +1 -1
- package/lib/umd/index.umd.js +3 -3
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -144,7 +144,7 @@ Only state can be modified.`);i[0]="$state",nd=!1,o.set(r,i,o.state.value),nd=!0
|
|
|
144
144
|
state: () => new MyClass()
|
|
145
145
|
Found in store "${x.$id}".`),p&&r&&n.hydrate&&n.hydrate(x.$state,p),c=!0,u=!0,x}/*! #__NO_SIDE_EFFECTS__ */function Rc(e,t,n){let o;const s=typeof t=="function";o=s?n:t;function r(i,a){const l=RC();if(i=(J.env.NODE_ENV==="test"&&Sc&&Sc._testing?null:i)||(l?Dn(_v,null):null),i&&Vf(i),J.env.NODE_ENV!=="production"&&!Sc)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
146
146
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
147
|
-
This will fail in production.`);i=Sc,i._s.has(e)||(s?iE(e,t,o,i):EO(e,o,i),J.env.NODE_ENV!=="production"&&(r._pinia=i));const c=i._s.get(e);if(J.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=s?iE(u,t,o,i,!0):EO(u,Cr({},o),i,!0);a._hotUpdate(d),delete i.state.value[u],i._s.delete(u)}if(J.env.NODE_ENV!=="production"&&da){const u=ro();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return r.$id=e,r}function ts(e){const t=Bt(e),n={};for(const o in t){const s=t[o];s.effect?n[o]=Y({get:()=>e[o],set(r){e[o]=r}}):(vn(s)||Fs(s))&&(n[o]=ci(e,o))}return n}const aE=Rc("permissionStore",()=>{const e=$([]),t=$(),n=$({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),vJ="woohoo_getWoohooUserInterface_read",lE="media_getReviewUserInterface_read",yJ="update_getUpdateUserInterface_read",_O="Unarchive parent folder first to continue",wJ=(e,t,n,o,s,r)=>{const i=aE(),{userPermissions:a}=ts(i),l=Y(()=>{const R=ln.getInstance().getItem("BASE_URL"),P=ln.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:N,entity_id:I,scene_id:k}=e.value;return{baseDomain:R||"",ws_code:N||"",entity_id:I||"",scene_id:k||"",reviewDomain:P||"",take_id:I||"",woohoo_id:I||"",parent_id:I||""}}),c=Y(()=>{var P;const R=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(lE),canCopyLink:!0,canRename:(R==null?void 0:R.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(lE),canOpenTakeInUpdate:a.value.includes(yJ),canOpenTakeInWoohoo:a.value.includes(vJ),canDeleteRendition:((P=R==null?void 0:R.media)==null?void 0:P.has_delete_rendition_permission)??!1,canDeleteThumbnail:(R==null?void 0:R.has_edit_thumbnail_permission)??!1,canArchiveScene:R==null?void 0:R.has_archive_permission,canUnarchiveScene:R==null?void 0:R.has_archive_permission,canDeleteScene:(R==null?void 0:R.has_delete_permission)??!1,canEditDescription:(R==null?void 0:R.has_edit_permission)??!1}}),u=Y(()=>({project:Zo({type:"project",config:l.value}).url,take_review:Zo({type:"review_take",config:l.value}).url,review:Zo({type:"review_scene",config:l.value}).url,review_scene:Zo({type:"review_scene",config:l.value}).url,woohoo:Zo({type:"woohoo",config:l.value}).url,update:Zo({type:"update",config:l.value}).url,scene_hub:Zo({type:"scene_hub",config:l.value}).url})),d=(R,P)=>{const N=R.metaKey||R.ctrlKey,I=u.value[P]||"";if(I){if(P==="scene_hub"){if(N){window.open(I,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(l.value.scene_id||"");return}N?window.open(I,"_blank"):window.location.href=I}},h=async(R,P)=>{var N;try{const I=await((N=e.value.axiosService.value)==null?void 0:N.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(I==null?void 0:I.message)!="Done"&&console.error("Failed to delete rendition.")}catch(I){console.error("Error deleting rendition",I)}finally{s()}},f=async(R,P)=>{var N;try{await((N=e.value.axiosService.value)==null?void 0:N.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(I){console.error("Error deleting thumbnail",I)}finally{s()}},p=async(R,P)=>{var N;try{const I=await((N=e.value.axiosService.value)==null?void 0:N.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(I==null?void 0:I.message)!="Done"&&console.error("Failed to archive scene."),P&&P("archived")}catch(I){console.error("Error archiving item",I)}finally{s()}},g=async(R,P)=>{var N;try{const I=await((N=e.value.axiosService.value)==null?void 0:N.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(I==null?void 0:I.message)!="Done"&&console.error("Failed to delete scene."),P&&P("deleted")}catch(I){console.error("Error deleting item",I)}finally{s()}},v=R=>{const P=u.value.scene_hub||"";P&&(E.value="Copied",navigator.clipboard.writeText(P),setTimeout(()=>{E.value="Copy link"},5e3))},C=async(R,P)=>{var N;try{const I=await((N=e.value.axiosService.value)==null?void 0:N.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(I==null?void 0:I.message)!="Done"&&console.error("Failed to unarchive scene."),P&&P("unarchived")}catch(I){console.error("Error unarchiving item",I)}finally{s()}},S=R=>p(R,t),b=R=>C(R,t),y=R=>g(R,t),E=$("Copy link"),_=R=>d(R,"review"),x=Y(()=>{let R=[];if(!l.value.scene_id&&e.value.optionBlock&&R.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const P=()=>Math.random().toString(36).substring(2,9);return[{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:_,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:P(),label:E.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?_O:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?_O:"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:y,hide:!c.value.canDeleteScene,type:"icon"}]}]});return{linkMap:u,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:C,options:x}};function To(e){const t=$(!1),n=$(!1),o=Y(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),s=()=>{t.value=!0,ct(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},r=()=>{t.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1},l=c=>{if(!c)return null;const u=c.value||c;return(u instanceof HTMLElement?u:u==null?void 0:u.$el)||null};return Qt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",s),c.addEventListener("blur",r)),u&&(u.addEventListener("mouseenter",i),u.addEventListener("mouseleave",a))}),zn(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",s),c.removeEventListener("blur",r)),u&&(u.removeEventListener("mouseenter",i),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const sd=e=>{const t=$(!1),n=Y(()=>t.value);return Qt(()=>{var a,l,c,u;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,r=s==null?void 0:s.rowIndex,i=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}};var Us=(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))(Us||{});const Bf=Rc("bulkUpdate",()=>{const e=$(Ft.UNCHECK),t=Uo({loaded:0,total:0}),n=u=>{t.total=u},o=u=>{t.loaded=u},s=Uo({isBulkUpdating:!1});function r(u){s.isBulkUpdating=u}const i=$({}),a=u=>{i.value=u},l=(u,d)=>{i.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:s,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{c(Ft.CHECKED)}}}),CJ={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{error:"Deletion failed. Please try again."},delete_thumbnail:{error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{},bulkRename:{}},offline:{error:"You are currently offline. Please check your network connection."}};function RO(e,t,n){return(t=SJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SJ(e){var t=bJ(e,"string");return typeof t=="symbol"?t:t+""}function Tc(e){"@babel/helpers - typeof";return Tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(e)}var TO=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function DO(e){return Tc(e)==="object"&&e!==null&&!Array.isArray(e)}function xO(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function EJ(e){return typeof Blob<"u"&&e instanceof Blob}var _J=function(t){return DO(t)&&xO(t,["file","fileName"])&&EJ(t.file)&&typeof t.fileName=="string"},RJ=function(t){return DO(t)&&xO(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"};Object.freeze(RO(RO({},TO.TOOLBOX_EXPORT_DATA,_J),TO.SW_APP_LOADER,RJ));let TJ=class extends Error{},cl=class extends TJ{constructor(){super("Zone is an abstract class")}},IO=class{get type(){throw new cl}get name(){throw new cl}get ianaName(){return this.name}get isUniversal(){throw new cl}offsetName(t,n){throw new cl}formatOffset(t,n){throw new cl}offset(t){throw new cl}equals(t){throw new cl}get isValid(){throw new cl}};const cE=new Map;function DJ(e){let t=cE.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),cE.set(e,t)),t}const xJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function IJ(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function AJ(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=xJ[r];r==="era"?o[a]=i:Av(a)||(o[a]=parseInt(i,10))}return o}const uE=new Map;let PJ=class MT extends IO{static create(t){let n=uE.get(t);return n===void 0&&uE.set(t,n=new MT(t)),n}static resetCache(){uE.clear(),cE.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=MT.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return MJ(t,n,o,this.name)}formatOffset(t,n){return kv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=DJ(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?AJ(o,n):IJ(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=OJ({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},dE=null,kJ=class bg extends IO{static get utcInstance(){return dE===null&&(dE=new bg(0)),dE}static instance(t){return t===0?bg.utcInstance:new bg(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new bg(PO(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${kv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${kv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return kv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};function Av(e){return typeof e>"u"}function Pv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function AO(e){if(!(Av(e)||e===null||e===""))return parseInt(e,10)}function FJ(e){if(!(Av(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function OJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function MJ(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function PO(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function kv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Pv(n,2)}:${Pv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Pv(n,2)}${Pv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const kO=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function rd(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function id(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function FO(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=AO(t[n+s]);return[o,null,n+s]}}const OO=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,NJ=`(?:${OO.source}?(?:\\[(${kO.source})\\])?)?`,MO=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,NO=RegExp(`${MO.source}${NJ}`),hE=RegExp(`(?:[Tt]${NO.source})?`),LJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,VJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,BJ=/(\d{4})-?(\d{3})/,$J=FO("weekYear","weekNumber","weekDay"),HJ=FO("year","ordinal"),GJ=/(\d{4})-(\d\d)-(\d\d)/,LO=RegExp(`${MO.source} ?(?:${OO.source}|(${kO.source}))?`),UJ=RegExp(`(?: ${LO.source})?`);function ad(e,t,n){const o=e[t];return Av(o)?n:AO(o)}function WJ(e,t){return[{year:ad(e,t),month:ad(e,t+1,1),day:ad(e,t+2,1)},null,t+3]}function ld(e,t){return[{hours:ad(e,t,0),minutes:ad(e,t+1,0),seconds:ad(e,t+2,0),milliseconds:FJ(e[t+3])},null,t+4]}function $f(e,t){const n=!e[t]&&!e[t+1],o=PO(e[t+1],e[t+2]),s=n?null:kJ.instance(o);return[{},s,t+3]}function Hf(e,t){const n=e[t]?PJ.create(e[t]):null;return[{},n,t+1]}rd(LJ,hE),rd(VJ,hE),rd(BJ,hE),rd(NO),id(WJ,ld,$f,Hf),id($J,ld,$f,Hf),id(HJ,ld,$f,Hf),id(ld,$f,Hf),id(ld),rd(GJ,UJ),rd(LO),id(ld,$f,Hf);var Fo=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Fo||{});Fo.review,Fo.review_take,Fo.review_scene,Fo.review_rendition,Fo.review_frame,Fo.review_rendition_comment,Fo.review_comment,Fo.scene_hub,Fo.hub_rendition,Fo.hub_comment,Fo.people_insight,Fo.people_detail,Fo.project,Fo.woohoo,Fo.update,Fo.core,Fo.project_focusMode;var fE=null;function zJ(e){fE=e}function Fv(){if(!fE)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return fE}function VO(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=Fv();return"".concat(t.t("errorMessages.fallback.unknownError")," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function jJ(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&Tc(o)==="object")Object.keys(o).forEach(function(i){var a="{".concat(i,"}"),l=o[i];Array.isArray(l)?l=l.join(", "):i==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),s=s.replace(/{value}/g,r)}return s}function KJ(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var r=s[o],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function BO(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function $O(e,t){if(!e||Tc(e)!=="object")return null;try{var n=Fv();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),r=0,i=s;r<i.length;r++){var a=i[r],l=o[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var C,S=t.toUpperCase();v=(C=p[g])===null||C===void 0||(C=C.errorMessages)===null||C===void 0||(C=C[S])===null||C===void 0||(C=C.validation_rules)===null||C===void 0?void 0:C[c]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[c]}if(v&&typeof v=="string")return jJ(v,a,u,d)}catch(y){console.error("Error in validation rules",y)}}}}catch(y){return console.error("Error in getValidationErrorMessage:",y),null}return null}function HO(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return VO();var n=e.code,o=e.error,s=e.details,r=e.message;if(BO(s)&&s){var i=$O(s,o==null?void 0:o.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=Fv();return a.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(o&&Tc(o)==="object"&&o.type&&o.key){var l=o.type.toUpperCase();try{var c,u,d,h="errorMessages.".concat(l,".").concat(o.key),f=Fv(),p=((c=f.messages)===null||c===void 0?void 0:c.value)||f.messages,g=((u=f.locale)===null||u===void 0?void 0:u.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[o.key];if(v&&typeof v=="string"){var C=v;return s!=null&&s.context&&(C=KJ(C,s.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",C)),n!==""?"[".concat(n,"] ").concat(C," ").concat(t):"".concat(C," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(o&&Tc(o)!=="object"&&BO(s)){var S=$O(s);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):VO()}const Ss=Rc("toast",()=>{const e=c=>HO(c),t=c=>{var u;if((c==null?void 0:c.apiCode)==="offline")r({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const d=HO((u=c==null?void 0:c.res)==null?void 0:u.data);r({id:c==null?void 0:c.apiCode,type:"error",message:d})}},n=$([]),o=(c,u)=>{const d=CJ[c];if(d){const h=d[u];if(h){r({id:c,type:u,message:h});return}}else r({id:c,type:u,message:c})},s=new Map,r=(c,u=5e3)=>{const d={...c,id:c.id??Date.now()+Math.random()};if(n.value.push(d),u>0){const h=Date.now(),f=setTimeout(()=>{i(d.id),s.delete(d.id)},u);s.set(d.id,{timeoutId:f,remainingTime:u,startTime:h})}};function i(c){n.value=n.value.filter(d=>d.id!==c);const u=s.get(c);u&&(clearTimeout(u.timeoutId),s.delete(c))}function a(c){const u=s.get(c);if(u){clearTimeout(u.timeoutId);const d=Date.now()-u.startTime;u.remainingTime=Math.max(0,u.remainingTime-d)}}function l(c){const u=s.get(c);if(u&&u.remainingTime>0){const d=setTimeout(()=>{i(c),s.delete(c)},u.remainingTime);u.timeoutId=d,u.startTime=Date.now()}}return{notifications:n,addNotification:r,removeNotification:i,showMessage:o,showErrorNetMessage:t,pauseAutoDismiss:a,resumeAutoDismiss:l,getErrorMessageFromResponse:e}}),pE=Rc("sortStore",()=>{const e=$({}),t=$(void 0),n={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},o={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}};return{sortingAPIConfiguration:Y(()=>{const c=e.value;return Object.values(c).filter(d=>d.sort!=="none"&&!!d.sort).map(d=>{let h;switch(d.colId){case"dateRange":h=o[d.sort];break;default:if(d.colId.includes("metric")){const[f,p]=d.colId.split("_");h={column:f,direction:d.sort,type:p}}else h={column:n[d.colId]||d.colId,direction:d.sort};break}return h})}),sorts:e,setSort:(c,u)=>{e.value={[c]:{colId:c,sort:u}}},clearSorting:()=>{e.value={}},isSortingRunning:$(!1),defaultSortStorePreferences:t,setDefaultSort:c=>{t.value=c}}}),GO=10,UO=5,Gf={number:{first:"000",step:"1"},letter:{first:"A",step:"1"}},qJ={up:{first:"Start at",step:"Increase by"},down:{first:"End at",step:"Decrease by"}},YJ=/^[0-9]$/,XJ=/^[A-Za-z]$/,WO=(e,t)=>t==="first"&&e==="letter"?XJ:YJ,ZJ=(e,t,n)=>WO(e,t).test(n),JJ=e=>e==="first"?GO:UO,QJ=e=>e&&e[0]===e[0].toLowerCase()?e.toLowerCase():e.toUpperCase(),eQ=(e,t,n)=>{const o=WO(e,t),s=Array.from(n).filter(r=>o.test(r)).join("").slice(0,JJ(t));return t==="first"&&e==="letter"?QJ(s):s},zO=(e,t)=>t!==""&&(e==="first"||Number(t)>0),tQ=e=>Array.from(e.toUpperCase()).reduce((t,n)=>t*26+(n.charCodeAt(0)-64),0),nQ=e=>{let t="",n=e;for(;n>0;){const o=(n-1)%26;t=String.fromCharCode(65+o)+t,n=Math.floor((n-1)/26)}return t},jO=({type:e,direction:t,first:n,step:o,count:s})=>{const r=Number(o)||1,i=c=>(t==="up"?c:s-1-c)*r;if(e==="number"){const c=Number(n);return Array.from({length:s},(u,d)=>String(c+i(d)).padStart(n.length,"0"))}const a=tQ(n),l=n!==""&&n[0]===n[0].toLowerCase();return Array.from({length:s},(c,u)=>{const d=nQ(a+i(u));return l?d.toLowerCase():d})},oQ="Your update is queued. Reload the table later to see the changes.",gE="Update failed.",sQ=new Set(["bulkDelete","bulkArchive","bulkUnarchive","bulkDateUpdate","bulkAssignUpdate","bulkStatusUpdate","bulkMetricUpdate","bulkRename","removeAssignee","delete_thumbnail","delete_rendition"]),rQ=(e,t,n)=>{const o=e.getRowNode(t);o&&o.setData({...o.data,...n})},iQ=(e,{currentName:t,counterValue:n})=>e.map(o=>{switch(o.type){case"text":return o.value;case"current_name":return t;case"counter":return n;default:return""}}).join(""),aQ=(e,t)=>{const n=e.find(o=>o.type==="counter");return n?jO({type:n.format,direction:n.direction==="asc"?"up":"down",first:n.value,step:n.step,count:t}):[]},KO=(e,t,n)=>Ss().addNotification({id:n,type:e,message:t}),lQ=(e,t,n={})=>{const o=Bf(),{selectionStatus:s}=ts(o),{sortingAPIConfiguration:r}=ts(pE()),i=Y(()=>s.value===Ft.CHECKED),a=Y(()=>e.selectRowData.map(X=>X.id)),l=Y(()=>e.selectRowData.length>0),{apiServices:c}=io(!1,e),u=Dn("filterParams",void 0),d=Y(()=>({workspaceId:String(e.workspaceId),itemIds:l.value&&i.value?[]:a.value,entityId:e.entityId,filterParams:u!=null&&u.value?u.value:void 0})),h=$(!0),f=$(!1);let p=null;const g=X=>{var U,K;if(!X.apiCode||!sQ.has(X.apiCode))return;const D=(U=X.res)==null?void 0:U.data;p={success:X.success,status:(K=X.res)==null?void 0:K.status,data:typeof D=="object"&&D!==null?D:void 0,error:X.error}};Qe(c,(X,D)=>{D==null||D.off("call-api",g),X==null||X.on("call-api",g)},{immediate:!0}),zn(()=>{var X;return(X=c.value)==null?void 0:X.off("call-api",g)}),Qe(()=>e.selectRowData,()=>{h.value=!1},{deep:!0,immediate:!0});const v=()=>{p=null},C=X=>{var Ae,ce;const D=p,U=D==null?void 0:D.data,K=(D==null?void 0:D.error)??X,ie=(U==null?void 0:U.message)??((ce=(Ae=K==null?void 0:K.response)==null?void 0:Ae.data)==null?void 0:ce.message),we=typeof ie=="string"&&ie.trim()?ie:gE;KO("error",we,"bulk-update-error")},S=(X,D,U,K)=>{X.length!==0&&(X.forEach(ie=>{const we=D.getRowNode(ie);we&&we.setData({...we.data,...U})}),D.refreshCells({...K.length>0?{columns:K}:{},force:!0}))},b=X=>{const D=e.gridApi;if(D){if(i.value){D.deselectAll();return}X.forEach(U=>{var K;return(K=D.getRowNode(U))==null?void 0:K.setSelected(!1)})}},y=({ids:X,apply:D,columns:U,isDelete:K=!1})=>{var te;let ie=X;X.length==0&&(ie=e.selectRowData.map(oe=>oe.id)??[]);const we=p;if((we==null?void 0:we.status)!==Us.ACCEPTED){D(),K&&b(ie);return}KO("white",oQ,"bulk-update-queued");const Ae=(te=we.data)==null?void 0:te.bulk_process;let ce;typeof(Ae==null?void 0:Ae.state)=="number"?ce=Ae.state:ce=K?0:1;const G=e.gridApi;G&&(ie.forEach(oe=>rQ(G,oe,{isProcessing:{state:ce,message:typeof(Ae==null?void 0:Ae.message)=="string"?Ae.message:""}})),G.refreshCells({columns:[...U,"name"],force:!0})),(K||ce==0)&&b(ie)},E=async({request:X,apply:D,columns:U,isDelete:K=!1})=>{var Ae,ce,G;const ie=a.value,we=e.gridApi;if(!we){console.error("Grid API is not available for bulk action.");return}v();try{const te=X();if(!te)throw new Error("Bulk update service is unavailable.");await te}catch(te){console.error("Bulk action failed:",te),C(te),(Ae=t.value)==null||Ae.open();return}if((p==null?void 0:p.success)===!1){const te=p.error??new Error(gE);console.error("Bulk action failed:",te),C(te),(ce=t.value)==null||ce.open();return}y({ids:ie,columns:U,isDelete:K,apply:()=>D(ie,we)}),(G=t.value)==null||G.hide()},_=({itemIds:X,data:D})=>{const U=e.gridApi;if(!U){console.error("Grid API is undefined");return}y({ids:X,columns:["status"],apply:()=>{S(X,U,{status:D},["status"])}})},x=({itemIds:X,data:D})=>{var K;const U=e.gridApi;if(!U){console.error("Grid API is undefined");return}y({ids:X,columns:["dateRange","name"],apply:()=>{X.forEach(ie=>{const we=U.getRowNode(ie);if(we){const Ae=[...we.data.dateRange||[null,null]];"startDate"in D&&D.startDate!==void 0&&(Ae[0]=D.startDate?new Date(D.startDate):null),"dueDate"in D&&D.dueDate!==void 0&&(Ae[1]=D.dueDate?new Date(D.dueDate):null),we.setData({...we.data,dateRange:Ae})}})}}),(K=n.onUpdated)==null||K.call(n)},R=X=>{var ie;const D=e.gridApi,{id:U,value:K}=X;if(!D){console.error("Grid API is undefined");return}y({ids:a.value,columns:[`metric_${U}`,"name"],apply:()=>{S(a.value,D,{[`metric_${U}`]:K},[`metric_${U}`])}}),(ie=n.onUpdated)==null||ie.call(n)},P=X=>{const{assignees:D,type:U}=X,K=e.gridApi;if(!K){console.error("Grid API is not available for bulk update.");return}const ie=new Set(D.map(Ae=>Ae.id)),we=Ae=>{const ce=K.getRowNode(Ae);if(!ce)return;const G=ce.data.assignees||[];let te=[];switch(U){case"add":{const oe=new Set(G.map(O=>O.id));te=[...G,...D.filter(O=>!oe.has(O.id))];break}case"overwrite":te=D;break;case"remove":te=G.filter(oe=>!ie.has(oe.id));break;case"removeAll":te=[];break}ce.setData({...ce.data,assignees:te})};y({ids:a.value,columns:["assignees","name"],apply:()=>a.value.forEach(we)})},N=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.bulkDeleteItems(d.value)},isDelete:!0,columns:["name"],apply:(X,D)=>S(X,D,{isDeleted:!0,disabled:!0,isProcessing:{state:0,message:""}},[])}),I=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.bulkUnarchiveItems(d.value)},columns:["name"],apply:(X,D)=>S(X,D,{isArchived:!1},["name"])}),k=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.bulkArchiveItems(d.value)},columns:["name"],apply:(X,D)=>S(X,D,{isArchived:!0},["name"])}),A=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.deleteThumbnail(d.value)},columns:["thumbnail"],apply:(X,D)=>S(X,D,{thumbnail:null},["thumbnail"])}),M=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.deleteRendition(d.value)},columns:["name"],apply:(X,D)=>S(X,D,{},["name"])}),V=()=>{v(),h.value=!0},B=X=>{ct(()=>{h.value=!1})},z=()=>{C(),B()},ne=(X,D)=>{const U=new Map(e.selectRowData.map(ie=>[ie.id,ie.name||""])),K=aQ(X,D.length);return D.map((ie,we)=>{const Ae=U.get(ie)??"",ce=iQ(X,{currentName:Ae,counterValue:K[we]??""});return{id:ie,from:Ae,to:ce}})},re=()=>{const X=e.gridApi;return X==null?[]:e.selectRowData.map((D,U)=>{var K;return{id:D.id,rowIndex:((K=X.getRowNode(D.id))==null?void 0:K.rowIndex)??U}}).sort((D,U)=>D.rowIndex-U.rowIndex).map(({id:D})=>D)};return{apiServices:c,selectionStatus:s,isSelectAll:i,selectedIds:a,isBulkUpdate:l,isUpdating:h,isLoading:f,handleUpdateStart:V,handleUpdatePostUpdate:B,handleUpdateFailed:z,handleUpdateBulkStatus:_,handleUpdateBulkDate:x,handleBulkUpdateMetric:R,handleUpdateNewAssignee:P,handleDelete:N,handleArchive:k,handleUnarchive:I,deleteThumbnail:A,deleteRendition:M,handleBulkUpdateName:async X=>{var Ae;if(!e.workspaceId||!e.entityId)return;const D=re(),U={item_ids:D,segments:X},K=r.value;i.value&&(delete U.item_ids,U.entity_id=e.entityId),U.sort_by=K;const ie={workspaceId:e.workspaceId,entityId:e.entityId,payload:U,filter:u!=null&&u.value?u.value:void 0},we=ne(X,D);v(),h.value=!0,f.value=!0;try{const ce=(Ae=c.value)==null?void 0:Ae.bulkRename(ie);if(!ce)throw new Error("Bulk update service is unavailable.");if(await ce,(p==null?void 0:p.success)===!1){C(p.error??new Error(gE));return}}catch(ce){C(ce);return}finally{h.value=!1,f.value=!1}y({ids:D,columns:["name"],apply:()=>{var G;const ce=e.gridApi;ce&&(we.forEach(({id:te,to:oe})=>{var O;return(O=ce.getRowNode(te))==null?void 0:O.setDataValue("name",oe)}),(G=n.onRefreshSelectedRow)==null||G.call(n))}})}}},qO=bt(tt({__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=Ns,{triggerRef:n,popupRef:o}=mo({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=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)=>(q(),ue("div",{class:ae(i.$style["status-badge-wrapper"]),style:hn({"--badge-size":`${r.size}px`,"--badge-color":s.value})},[xt(i.$slots,"default"),Ke(Ee("div",{class:ae(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[lr,r.showBadge],[L(t),{isLoading:r.loading,fullwidth:!0}]]),Ee("div",{ref_key:"popupRef",ref:o,class:ae(i.$style["badge-tooltip"])},it(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"}}]]),cd=Rc("switchStore",()=>{const e=$(null),t=Dn("switchInstance");return{openSceneHub:(s,r)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:s,commentId:r},{showLoading:!1}):t("scene_hub",{id:s,tab:"home"},{showLoading:!1})}},openPeopleInsight:s=>{if(!s){console.error("No people_id provided, defaulting to empty string");return}const r=t||e.value;if(!r)console.error("Switch instance not found");else if(window.switchApploader)window.switchApploader("people_insight",{tab:"home",id:s||""},{showLoading:!1});else throw console.error("Switch instance not found and switchApploader is not available"),new Error("Switch instance not found and switchApploader is not available");r("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),cQ=tt({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:lv()},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},switchInstance:{type:Function,default:void 0}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=jt,o=Ns,s=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=$(new Date),l=$(!0),c=$(!1),u=$(!1),d=$(null);let h=null,f=null;const p=cd(),{openPeopleInsight:g}=p,v=Y(()=>!s.private&&!c.value),C=Y(()=>{var B,z;return((B=d.value)==null?void 0:B.display_name)??((z=s.user)==null?void 0:z.name)}),S=Y(()=>{var B,z;return!v.value||!d.value?s.status:(B=d.value.private_info)!=null&&B.is_offline?"offline":(z=d.value.private_info)!=null&&z.last_active?"active":"away"}),b=Y(()=>{var B;return!!((B=d.value)!=null&&B.private_info)}),y=Y(()=>{const B=S.value;return B?i[B]:""}),E=Y(()=>{var B,z;return((z=(B=d.value)==null?void 0:B.private_info)==null?void 0:z.timezone)??s.timezone}),_=Y(()=>{if(!E.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:E.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",E.value),""}}),x=Y(()=>{var B,z,ne;return{id:s.user.id,name:C.value,initial:((B=d.value)==null?void 0:B.initial)??s.user.initial,profile_image:((z=d.value)==null?void 0:z.profile_image)??s.user.profile_image,color:((ne=d.value)==null?void 0:ne.color)??s.user.color,size:72,borderRadius:"8px"}}),R=Y(()=>{const B=ln.getInstance().getItem("BASE_URL"),z=ln.getInstance().getItem("ws.code")||"";return Zo({type:"people_insight",config:{ws_code:z,baseDomain:B,user_id:s.user.id}}).url}),{copyToClipboard:P,tooltip:N}=bk(R.value,()=>r("copyLink",s.user.id)),I=async()=>{if(!s.apiUpdateFunction){l.value=!1;return}try{const B=await s.apiUpdateFunction(s.user.id);B?(d.value=B,r("dataUpdated",B)):(c.value=!0,u.value=!0,r("dataUpdated",null))}catch(B){c.value=!0,u.value=!0,console.error("Failed to fetch user data:",B)}finally{l.value=!1}},k=()=>{A(),s.apiUpdateFunction&&s.enableAutoRefresh&&(f=setInterval(I,s.refreshInterval))},A=()=>{f!==null&&(clearInterval(f),f=null)},M=B=>{var z;if(B.ctrlKey||B.metaKey){window.open(R.value,"_blank");return}try{g(String(s.user.id))}catch{s.switchInstance?(z=s.switchInstance)==null||z.call(s,"people_insight",{tab:"home",id:s.user.id||""},{showLoading:!1}):window.open(R.value,"_blank")}},V=B=>{M(B),r("insightClick",s.user.id)};return Qe([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],k),Qt(async()=>{h=setInterval(()=>{a.value=new Date},1e4),s.apiUpdateFunction?(await I(),k()):l.value=!1}),ec(()=>{h&&clearInterval(h),A()}),(B,z)=>s.showPrivateUser&&(s.private||u.value)?(q(),ue("div",{key:0,class:ae([B.$style["info-row"],B.$style["private-badge"]])},[...z[0]||(z[0]=[Ee("span",null,"Private User",-1)])],2)):(q(),ue("div",{key:1,class:ae([B.$style["mini-people-card"],{[B.$style.loading]:l.value},"bg-skeleton"])},[Ee("div",{class:ae(B.$style["avatar-section"])},[v.value&&b.value?(q(),je(qO,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":y.value},{default:ye(()=>[me(hf,zt({readOnly:!0},x.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(q(),je(hf,zt({key:1,readOnly:!0},x.value),null,16))],2),Ee("div",{class:ae(B.$style["user-info"])},[Ee("div",{class:ae(B.$style["info-column"])},[Ke((q(),ue("span",{class:ae(B.$style["user-name"])},[nt(it(C.value),1)],2)),[[L(n),{content:C.value,delay:[1e3,0]}]]),E.value&&v.value&&b.value?(q(),ue("div",{key:0,class:ae([B.$style["info-row"],B.$style["time-row"]])},[Ke((q(),ue("div",{class:ae(B.$style["time-display"])},[me(ut,{source:"remote",src:"Globe",class:ae(B.$style["clock-icon"]),size:"10"},null,8,["class"]),Ee("span",{class:ae(B.$style["time-text"])},it(_.value)+" ("+it(E.value)+")",3)],2)),[[L(o),{isLoading:l.value,fullwidth:!0}]])],2)):Ye("",!0)],2),!e.readOnly&&v.value?(q(),ue("div",{key:0,class:ae([B.$style["info-row"],B.$style.actions])},[e.showInsightButton&&b.value?(q(),je(pt,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Lt(V,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Ye("",!0),e.showCopyLinkButton&&b.value?Ke((q(),je(pt,{key:1,variant:["icon","secondary"],size:"small",onClick:Lt(L(P),["prevent","stop"]),disabled:s.disabled},{default:ye(()=>[me(ut,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[L(n),{content:L(N),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ye("",!0)],2)):Ye("",!0)],2)],2))}}),uQ=bt(cQ,[["__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"}}]]),dQ=bt(tt({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=Po,o=jt,s=e,{isEditing:r}=sd(s),i=()=>{var h,f;const u=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=Y(()=>{var d,h;const u=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=s.params)==null?void 0:u.api)==null||d.stopEditing()},c=$();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>Ke((q(),je(pt,{class:ae(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:L(r),onClick:Lt(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:ye(()=>[me(ut,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[L(o),"More actions"],[L(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_137ge_1"}}]]),hQ=["src","width","height","alt"],ul=bt(tt({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=Ns,{getCachedValue:n,setCachedValue:o}=uf({dbName:"visual-cache-db",storeName:"visuals"}),s=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:s(r.minWidth),maxWidth:s(r.maxWidth),minHeight:s(r.minHeight),maxHeight:s(r.maxHeight),aspectRatio:r.ratio,width:s(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},c=Y(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:u,loading:d}=NI(c,"visual",l,a);return(h,f)=>Ke((q(),ue("div",{class:ae([h.$style.visualWrapper,{[h.$style.loading]:L(d)}]),style:hn(i.value)},[Ee("img",{src:L(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:hn(i.value)},null,12,hQ)],6)),[[L(t),{isLoading:L(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),fQ=["tabindex"],Oo=bt(tt({__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 o=e,s=n;Zg();const r=dm(),i=$(null),a=$("default"),l=Y(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=Y(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=Y(()=>({[r["display-wrapper"]]:!0,[r.disabled]:o.disabled,[r.readOnly]:o.readOnly,[r.error]:o.error,[r.clickable]:o.clickable,[r.active]:o.actived,[r.hovered]:o.hovered,[r.focused]:!o.readOnly&&!o.disabled&&o.focused,[r.bordered]:o.bordered})),d=()=>{var y,E;const g=((y=i.value)==null?void 0:y.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((E=i.value)==null?void 0:E.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=$("100%"),f=()=>{h.value=d()};Nh(()=>{f()}),Qt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{ct(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>(q(),ue("div",{ref_key:"rootEl",ref:i,class:ae([L(r)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:hn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[xt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),xt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),xt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,fQ))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_rxmoy_1",readOnly:"_readOnly_rxmoy_26",bordered:"_bordered_rxmoy_29",disabled:"_disabled_rxmoy_29",active:"_active_rxmoy_29",focused:"_focused_rxmoy_29",hovered:"_hovered_rxmoy_33",error:"_error_rxmoy_37",clickable:"_clickable_rxmoy_50",suffix:"_suffix_rxmoy_56",prefix:"_prefix_rxmoy_57"}}]]),pQ=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const gQ=Object.prototype.toString,mQ=e=>gQ.call(e)==="[object Object]",_i=()=>{};function vQ(e,t){function n(...o){return new Promise((s,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return"cancel"in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}function yQ(e,t={}){let n,o,s=_i,r=_i;const i=Rh(!1),a=u=>{clearTimeout(u),s(),s=_i};let l;return Object.assign(u=>{const d=Zi(e),h=Zi(t.maxWait);return n&&a(n),d<=0||h!==void 0&&h<=0?(o&&(a(o),o=void 0),i.value=!1,Promise.resolve(u())):(i.value=!0,new Promise((f,p)=>{s=t.rejectOnCancel?p:f,r=f,l=u,h&&!o&&(o=setTimeout(()=>{n&&a(n),o=void 0,i.value=!1,f(l())},h)),n=setTimeout(()=>{o&&a(o),o=void 0,i.value=!1,f(u())},d)}))},{cancel:()=>{n&&(a(n),n=void 0),o&&(a(o),o=void 0),i.value=!1,r=_i},flush:()=>{if(i.value){n&&(clearTimeout(n),n=void 0),o&&(clearTimeout(o),o=void 0),i.value=!1;const u=r;s=_i,r=_i,u(l())}},isPending:Vr(i)})}function mE(e){return Array.isArray(e)?e:[e]}function wQ(e,t=200,n={}){return vQ(yQ(t,n),e)}function CQ(e,t,n){return Qe(e,t,{...n,immediate:!0})}const YO=pQ?window:void 0;function Uf(e){var t;const n=Zi(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function vE(...e){const t=(o,s,r,i)=>(o.addEventListener(s,r,i),()=>o.removeEventListener(s,r,i)),n=Y(()=>{const o=mE(Zi(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return CQ(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>Uf(r)))!==null&&o!==void 0?o:[YO].filter(r=>r!=null),mE(Zi(n.value?e[1]:e[0])),mE(L(n.value?e[2]:e[1])),Zi(n.value?e[3]:e[2])]},([o,s,r,i],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const c=mQ(i)?{...i}:i,u=o.flatMap(d=>s.flatMap(h=>r.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function yE(e,t,n={}){const{window:o=YO,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!o)return a?{stop:_i,cancel:_i,trigger:_i}:_i;let l=!0;const c=v=>Zi(s).some(C=>{if(typeof C=="string")return Array.from(o.document.querySelectorAll(C)).some(S=>S===v.target||v.composedPath().includes(S));{const S=Uf(C);return S&&(v.target===S||v.composedPath().includes(S))}});function u(v){const C=Zi(v);return C&&C.$.subTree.shapeFlag===16}function d(v,C){const S=Zi(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(y=>y.el===C.target||C.composedPath().includes(y.el))}const h=v=>{const C=Uf(e);if(v.target!=null&&!(!(C instanceof Element)&&u(e)&&d(e,v))&&!(!C||C===v.target||v.composedPath().includes(C))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[vE(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),vE(o,"pointerdown",v=>{const C=Uf(e);l=!c(v)&&!!(C&&!v.composedPath().includes(C))},{passive:!0}),i&&vE(o,"blur",v=>{setTimeout(()=>{const C=Uf(e);let S=o.document.activeElement;for(;S!=null&&S.shadowRoot;)S=S.shadowRoot.activeElement;(S==null?void 0:S.tagName)==="IFRAME"&&!(C!=null&&C.contains(o.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 bQ=["value","placeholder","disabled","readonly","inputmode","maxlength"],Wf=bt(tt({__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:{},showClear:{type:Boolean,default:!0},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 o=Po,s=jt,r=e,i=n,a=$(null),l=$(r.modelValue||"");Qe(l,()=>{i("onValidation",l.value)});const c=$(!1),u=$(r.modelValue||"");Qe(()=>r.modelValue,D=>{l.value=D||"",u.value=D||""});const d=Y(()=>{var D;return((D=l.value)==null?void 0:D.length)>0}),h={text:D=>D.slice(0,r.maxLength||255),number:D=>{let U=D.replace(/[^\d.-]/g,"");const K=U.split(".");K.length>2&&(U=K[0]+"."+K.slice(1).join("")),U=U.replace(/-/g,(G,te)=>te===0?G:"");const we=U.startsWith("-")?"-":"",ce=U.replace("-","").split(".");return ce[0].length>17&&(ce[0]=ce[0].substring(0,17)),r.maxDecimalChar!==void 0&&ce.length>1&&(ce[1]=ce[1].substring(0,r.maxDecimalChar)),U=we+ce.join("."),U},email:D=>D.replace(/\s/g,"").slice(0,r.maxLength||255),url:D=>D.replace(/\s/g,"").slice(0,r.maxLength||255),tel:D=>D.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},f=D=>{const U=h[r.type];return U?U(D):D},p=wQ(D=>{r.autoEmit&&(i("update:modelValue",D),i("input",D))},r.debounceDelay),g=D=>{const U=D;if(r.disabled||r.readOnly){U.preventDefault();return}const K=U.target,ie=K.selectionStart||0,we=l.value,Ae=f(K.value);we!==Ae&&(l.value=Ae,i("input",Ae),r.autoEmit&&p(Ae),K.value!==Ae&&(K.value=Ae,ct(()=>{let ce=ie;if(Ae.length<K.value.length)ce=ie;else{const G=Ae.length-we.length;ce=ie+G}ce=Math.max(0,Math.min(ce,Ae.length)),K.setSelectionRange(ce,ce)})))},v=D=>{if(r.disabled||r.readOnly){D.preventDefault();return}c.value=!0;const U=l.value;l.value="",i("update:modelValue",""),i("clear"),U!==""&&i("change",""),D.preventDefault(),D.stopImmediatePropagation(),D.stopPropagation(),ct(()=>{var K;(K=a.value)==null||K.focus(),setTimeout(()=>{c.value=!1},100)})},C=D=>{r.disabled||r.readOnly||(i("focus",D),r.selectOnFocus&&ct(()=>{D.target.select()}))},S=D=>{if(c.value)return;const K=D.target.value;r.autoEmit||i("update:modelValue",K),u.value!==K&&(i("change",K),u.value=K),i("blur",K,D)},b=D=>{setTimeout(()=>{ct(()=>{const K=D.target.value;i("enter",K,D),i("enterValue",K),r.submitOnEnter&&(D.preventDefault(),r.autoEmit||i("update:modelValue",K),u.value!==K&&(i("change",K),u.value=K))})},1e3)},y=D=>{const U=D.target,K=U.value;if(i("escape",K,D),D.preventDefault(),D.stopImmediatePropagation(),D.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&U.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&U.blur()},E=D=>{const K=D.target.value;i("tab",K,D),r.autoEmit||(i("update:modelValue",K),u.value!==K&&(i("change",K),u.value=K))},_=(D,U,K)=>D===""?!0:D==="."?K>0:new RegExp(`^\\d{0,${U}}(\\.\\d{0,${K}})?$`).test(D),x=D=>{if(i("keydown",D),D.key===" "&&D.stopPropagation(),r.type==="number"){if(D.key==="e"||D.key==="E"){D.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(D.key)||D.ctrlKey||D.metaKey||D.altKey)){if(Number.isNaN(Number(D.key))&&D.key!=="."&&D.key!=="-"){D.preventDefault();return}const ie=l.value+D.key;if(!_(ie,17,r.maxDecimalChar||2)){D.preventDefault();return}}}D.key==="Escape"?y(D):D.key==="Enter"?b(D):D.key==="Tab"?E(D):(D.key==="ArrowUp"||D.key==="ArrowDown")&&r.type==="number"&&D.preventDefault()},R=D=>{i("keyup",D)},P=D=>{if(r.disabled||r.readOnly){D.preventDefault();return}i("paste",D)},N=D=>{if(r.disabled||r.readOnly){D.preventDefault();return}i("cut",D)},I=D=>{i("select",D)},k=`input-text-${Math.random().toString(36).substr(2,9)}`,A=$(!1),M=Y(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});Qe(()=>l.value,D=>{r.validatorFnc?A.value=!!D&&!r.validatorFnc(D):A.value=!1});const V=$(null),B=Y(()=>({disabled:r.disabled,readOnly:r.readOnly,error:A.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:V,bordered:!0})),{argsMain:z,isHover:ne,isFocus:re}=To(B);t({triggerFocus:()=>{ct(()=>{var D;(D=a.value)==null||D.focus()})},focus:()=>{ee()},blur:()=>{ct(()=>{var D;(D=a.value)==null||D.blur()})},select:()=>{ct(()=>{var D;(D=a.value)==null||D.select()})},setSelectionRange:(D,U)=>{ct(()=>{var K;(K=a.value)==null||K.setSelectionRange(D,U)})},getValue:()=>l.value,setValue:D=>{l.value=f(D),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const ee=()=>{!r.disabled&&!r.readOnly&&ct(()=>{var D;(D=a.value)==null||D.focus()})},X=Y(()=>re.value&&d.value);return(D,U)=>(q(),ue("div",{class:ae([D.$style["input-wrapper"],"input-editor"]),onClick:ee},[Ke((q(),je(Oo,zt(L(z),{ref_key:"wrapperRef",ref:V,class:[D.$style["input-box"],{[D.$style["is-hovered"]]:L(ne),[D.$style["is-focused"]]:L(re),[D.$style["has-input"]]:d.value,[D.$style["is-editting"]]:X.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:ye(()=>[xt(D.$slots,"prefix")]),suffix:ye(()=>[d.value&&!r.disabled&&!r.readOnly&&r.showClear?xt(D.$slots,"clear",{},()=>[Ke((q(),je(pt,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Lt(v,["prevent","stop"]),size:18,rounded:!0,class:ae(["wrapper-suffix",D.$style["clear-button"]])},{default:ye(()=>[me(ut,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[L(s),{content:"Clear",contentClass:"extra-padding"}]])],void 0,0):xt(D.$slots,"suffix",{},void 0,void 0,1)]),default:ye(()=>[Ee("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:ae([D.$style["column-config__input"]]),id:k,disabled:e.disabled,readonly:e.readOnly,inputmode:M.value,maxlength:r.maxLength,onInput:g,onFocus:C,onBlur:S,onKeydown:x,onKeyup:R,onPaste:P,onCut:N,onSelect:I},null,42,bQ)]),_:3},16,["class","bordered"])),[[L(o),r.focusIndex]]),A.value?xt(D.$slots,"error",{},void 0,void 0,0):Ye("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_1g7uk_1","is-disabled":"_is-disabled_1g7uk_16","is-readonly":"_is-readonly_1g7uk_16","is-hovered":"_is-hovered_1g7uk_16","is-focused":"_is-focused_1g7uk_20","column-config__input":"_column-config__input_1g7uk_43","clear-button":"_clear-button_1g7uk_58"}}]]),SQ={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},wE=tt({__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 o=e,s=n,r=$(null),i=mr(c=>{s("update:modelValue",c),s("search",c)},bi),a=()=>{s("update:modelValue",""),s("clear"),ct(()=>{var c;(c=r.value)==null||c.focus()})},l=$(o.modelValue);return t({focus:()=>{var c;(c=r.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(q(),je(Wf,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:L(i),onClear:a,onCancel:u[1]||(u[1]=d=>s("cancel")),"auto-emit":!0},{prefix:ye(()=>[Ee("div",SQ,[me(ut,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),dl=bt(tt({name:"ListItem",directives:{tooltip:jt,focusable:Po},__name:"ListItem",props:{itemWidth:{default:"250px"},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 o=Po,s=e,r=n,i=$(!1),a=$(!1);function l(E){if(!E||typeof E!="object")return!1;const _=E;return typeof _.name=="string"&&typeof _.id=="string"&&typeof _.initial=="string"}const c=Y(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!y.prefix),u=Y(()=>!!y.suffix||s.danger&&i.value),d=Y(()=>{var E;return s.type==="status"&&typeof((E=s.data)==null?void 0:E.color)=="string"?{backgroundColor:s.data.color,border:Om(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),h=dm(),f=Y(()=>({[h.active]:s.selected??!1,[h.disabled]:s.disabled??!1,[h.hover]:s.hover??!1,[h.clickable]:(s.clickable??!0)&&!s.disabled,[h.danger]:s.danger??!1,[h["has-prefix"]]:c.value,[h["has-suffix"]]:u.value,[h.readOnly]:s.readOnly}));Y(()=>({content:"Cancel",...b})),Y(()=>({content:"Confirm",theme:"warning",...b}));function p(E){return{name:E.name,initial:E.initial,id:E.id,profile_image:E.profile_image??null,color:E.color,size:24}}function g(){i.value=!1}function v(E){E?r("click",E):(s.clickable??!0)&&(r("update:selected",!s.selected),r("select",!s.selected))}function C(E){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||v(E);r("handleClick",E)}}const S=()=>{i.value?g():r("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),y=Zg();return Qe(()=>s.show,E=>{E===!1&&(i.value=!1)}),t({select:()=>{C(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(E,_)=>{const x=Lh("tooltip");return Ke((q(),je(pt,{variant:["menu-item",e.danger?"danger":"menu-item"],class:ae([E.$style["list-item"],f.value]),onHandleClick:C,onMouseenter:_[0]||(_[0]=R=>a.value=!0),onMouseleave:_[1]||(_[1]=R=>a.value=!1),onEscape:S,style:hn({width:s.itemWidth})},{default:ye(()=>[c.value?(q(),ue("div",{key:0,class:ae(E.$style["list-item__prefix"])},[xt(E.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(q(),je(ut,{key:0,src:e.icon,source:"remote",class:ae(E.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(q(),ue("div",{key:1,class:ae(E.$style["status-indicator"]),style:hn(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(q(),je(hf,zt({key:2},p(e.data),{class:E.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ye("",!0)])],2)):Ye("",!0),Ee("div",{class:ae(E.$style["list-item__label"])},[xt(E.$slots,"label",{selected:e.selected},()=>[nt(it(e.label),1)])],2),u.value?(q(),ue("div",{key:1,class:ae(E.$style["list-item__suffix"])},[xt(E.$slots,"suffix",{item:E.$props,hovered:a.value},()=>[e.danger&&i.value?(q(),ue("div",{key:0,class:ae(E.$style["confirm-action"])},[Ke((q(),je(pt,{variant:["tertiary","icon","danger"],size:"small",onClick:Lt(g,["stop","prevent"])},{default:ye(()=>[me(ut,{src:"Xmark",source:"remote"})]),_:1})),[[L(o),`${s.focusIndex}.0`],[x,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((q(),je(pt,{variant:["danger","primary","icon"],size:"small",onClick:Lt(v,["stop","prevent"])},{default:ye(()=>[me(ut,{src:"Check",source:"remote"})]),_:1})),[[L(o),`${s.focusIndex}.1`],[x,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)])],2)):Ye("",!0)]),_:3},8,["variant","class","style"])),[[L(o),s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_iekfz_1",disabled:"_disabled_iekfz_17",danger:"_danger_iekfz_24","has-prefix":"_has-prefix_iekfz_27","has-suffix":"_has-suffix_iekfz_27",clickable:"_clickable_iekfz_41",readOnly:"_readOnly_iekfz_44",hover:"_hover_iekfz_48",active:"_active_iekfz_54","list-item__prefix":"_list-item__prefix_iekfz_79","list-item__label":"_list-item__label_iekfz_87","list-item__suffix":"_list-item__suffix_iekfz_101","status-indicator":"_status-indicator_iekfz_108","item-icon":"_item-icon_iekfz_114","arbo-icon-state":"_arbo-icon-state_iekfz_119","item-avatar":"_item-avatar_iekfz_122","confirm-action":"_confirm-action_iekfz_131"}}]]),EQ=["aria-activedescendant"],_Q=["innerHTML"],RQ=10,fa=bt(tt({__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"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=jt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=$(""),l=$(-1),c=$(null),u=$(null),d=$(new Map),h=Y(()=>DS(a.value)),f=()=>{const D=h.value;if(!D||D.length<r.minQueryLength)return r.options;if(d.value.has(D))return d.value.get(D);const U=r.options.map(K=>({item:K,score:FY(` ${K.label} `,D)})).filter(({score:K})=>K>0).sort((K,ie)=>ie.score-K.score).map(({item:K})=>K);return d.value.set(D,U),U},p=$([]);Qe(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Y(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=mr(D=>{a.value=D,l.value=-1,i("search",D)},bi),C=async D=>{ee.value=0,await v(D||""),ee.value=1},S=D=>a.value?OY(D,a.value):D,b=D=>{const K={[s.ARROW_DOWN]:()=>y(D),[s.ARROW_UP]:()=>E(D),[s.ENTER]:()=>R(D),[s.ESCAPE]:()=>P(D),[s.TAB]:()=>N(D)}[D.key];K&&K()},y=D=>{D.preventDefault(),_(1)},E=D=>{D.preventDefault(),_(-1)},_=D=>{const U=p.value.length;if(U===0)return;let K;D>0?K=(l.value+1)%U:l.value>0?K=l.value-1:K=U-1,l.value=K,x()},x=()=>{ct(()=>{var U;const D=(U=u.value)==null?void 0:U.querySelectorAll('[role="menuitem"]')[l.value];D==null||D.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},R=D=>{if(D.preventDefault(),l.value>=0&&l.value<p.value.length){const K=p.value[l.value];I(K,D)}},P=D=>{D.preventDefault(),A()},N=D=>{i("tab",D)},I=(D,U)=>{!D||D.disabled||(i("select",D,U),l.value=-1,A())},k=D=>{D>=0&&D<p.value.length&&(l.value=D)},A=()=>{i("close")},M=()=>{if(!g.value||!u.value)return;const{scrollTop:D,clientHeight:U,scrollHeight:K}=u.value;K-(D+U)<=RQ&&i("loadMore")},V=()=>{var D,U,K;(D=u.value)==null||D.addEventListener("scroll",M),(K=(U=ne.value)==null?void 0:U.$el)==null||K.addEventListener("keydown",b)},B=()=>{var D,U,K;(D=u.value)==null||D.removeEventListener("scroll",M),(K=(U=ne.value)==null?void 0:U.$el)==null||K.removeEventListener("keydown",b)};Qt(()=>{V()}),zn(()=>{B()}),Qe(()=>r.loading,D=>{!D&&p.value.length>0&&(l.value=-1)});const z=D=>D?Array.isArray(r.selectedId)?r.selectedId.includes(String(D.id)):r.selectedId==D.id:!1,ne=$(null);Qe(l,()=>{x()});const re=()=>{ct(()=>{var D;(D=ne.value)==null||D.focus()})};t({focus:()=>{ct(()=>{var D;(D=ne.value)==null||D.focus()})},reset:()=>{var D;(D=ne.value)==null||D.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:A,clearSearch:()=>{a.value=""},scrollTo:D=>{u.value&&(u.value.scrollTop=D)},selectIndex:D=>{D>=0&&D<p.value.length&&(l.value=D,x())}});const ee=$(0);Qe([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const D=r.options.length>0&&p.value.length>0,U=!D&&a.value.length>0,K=!D&&a.value.length===0;r.loading?ee.value=0:D?ee.value=1:U?ee.value=2:K&&(ee.value=3)},{immediate:!0,deep:!0});const X=()=>{i("cancel")};return(D,U)=>(q(),ue("datalist",{ref_key:"searchListRef",ref:c,class:ae([D.$style["search-list"],ee.value===3||ee.value===2?D.$style.empty:"",p.value.length>8?D.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:hn({width:e.itemWidth||e.width})},[me(wE,{ref_key:"searchBoxRef",ref:ne,modelValue:a.value,"onUpdate:modelValue":U[0]||(U[0]=K=>a.value=K),class:ae(D.$style["search-box"]),disabled:e.loading,onSearch:C,onClear:U[1]||(U[1]=K=>C("")),onCancel:X},null,8,["modelValue","class","disabled"]),Ee("div",{ref_key:"popupRef",ref:u,class:ae(D.$style["list-container"])},[xt(D.$slots,"extra-item",{query:a.value,isEmpty:ee.value===3||ee.value===2,isLoading:r.loading}),(q(!0),ue(kt,null,An(p.value,(K,ie)=>Ke((q(),ue("div",{key:`${K.id}-${ie}`,role:"menuitem"},[xt(D.$slots,"item",{item:K,index:ie,selectedIndex:l.value,isSelected:z,handleSelect:I,handleItemHover:k,getHighlightedLabel:S,query:a.value,idx:ie,focused:l.value==ie,focus:re},()=>[K.hide?Ye("",!0):(q(),je(dl,zt({key:0,ref_for:!0},K,{hover:ie===l.value,selected:z(K),type:K.type,id:`item-${ie}`,"aria-selected":ie===l.value,onClick:we=>I(K,we),onMouseover:we=>k(ie),onEscape:A,itemWidth:e.itemWidth||e.width}),{prefix:ye(()=>[xt(D.$slots,"prefix-item",{item:K})]),label:ye(()=>[a.value?Ke((q(),ue("span",{key:0,class:ae(D.$style.match),innerHTML:S(K.label)},null,10,_Q)),[[L(o),{content:K.label,delay:[1e3,0]}]]):Ke((q(),ue("span",{key:1,class:ae(D.$style["item-label"])},[nt(it(K.label),1)],2)),[[L(o),{content:K.label,delay:[1e3,0]}]])]),suffix:ye(({hovered:we})=>[xt(D.$slots,"action",{item:K,isHovered:ie===l.value,hovered:we,selected:l.value==ie})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[lr,ee.value===1]])),128)),ee.value===0?xt(D.$slots,"loading-more",{},()=>[(q(),ue(kt,null,An(8,K=>Ee("div",{class:ae(D.$style["loading-more"]),key:K},[Ee("div",{class:ae(D.$style["loading-skeleton"])},null,2),Ee("div",{class:ae(D.$style["loading-skeleton"])},null,2)],2)),64))],void 0,0):Ye("",!0),ee.value===2?(q(),ue("div",{key:1,class:ae(D.$style["no-results"])},[xt(D.$slots,"empty",{query:a.value},()=>[Ee("div",{class:ae(D.$style["no-results-content"])},[...U[2]||(U[2]=[Ee("div",null,[nt(" No results. "),Ee("br"),nt(" Try another search. ")],-1)])],2)])],2)):Ye("",!0),ee.value===3?(q(),ue("div",{key:2,class:ae(D.$style["no-results"])},[xt(D.$slots,"empty-list",{},()=>[Ee("div",{class:ae(D.$style["no-results-content"])},[...U[3]||(U[3]=[Ee("div",null,"No items available.",-1)])],2)])],2)):Ye("",!0),xt(D.$slots,"footer")],2)],14,EQ))}}),[["__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"}}]]),Dc=tt({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=v6,n=e,o=$(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),r=$(s());Qe(()=>n,()=>{setTimeout(()=>{ct(()=>{o.value=n.appendTo||void 0,r.value=s()})},50)},{immediate:!0,deep:!0});const i=Y(()=>ln.getInstance().getItem("user.ws_user_role_id")),a=Y(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial,isMe:n.user.id===i.value}));return(l,c)=>Ke((q(),je(hf,fU(S1(a.value)),null,16)),[[L(t),r.value]])}}),TQ={class:"avatar-wrapper"},DQ={class:"assignee-label"},xQ=bt(tt({__name:"AssigneeItem",props:{user:{},hovered:{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=jt,o=e,s=Y(()=>({name:o.user.name,id:o.user.id,profile_image:o.user.profile_image,color:{bgColor:o.user.color.bgColor,textColor:o.user.color.textColor},initial:o.user.initial})),r=Zg(),i=Y(()=>{if(!a.value&&!o.hover&&!o.focused||!r.actions)return 0;let l=0;const c=u=>{u.forEach(d=>{d.type===kt&&Array.isArray(d.children)?c(d.children):d.type!==so&&d.type!==ja&&l++})};return c(r.actions()),l}),a=$(!1);return(l,c)=>(q(),ue("div",{class:ae(["assignee-selector-item",{hovered:a.value||o.hovered,disabled:o.disabled,selected:o.selected,single:i.value==0,focused:o.focused}]),style:hn({"--actions-count":i.value}),onMouseenter:c[0]||(c[0]=u=>a.value=!0),onMouseleave:c[1]||(c[1]=u=>a.value=!1)},[Ee("div",TQ,[me(Dc,{user:s.value,"show-profile":!0,"append-to":o.appendTo,"api-update-function":o.apiUpdateFunction},null,8,["user","append-to","api-update-function"]),o.multipleSelect?(q(),ue("div",{key:0,class:ae(["avatar-indicator",[o.selected?"remove":"add"]])},[o.selected?(q(),je(ut,{key:0,src:"CircleXMark"})):(q(),je(ut,{key:1,src:"CirclePlus"}))],2)):Ye("",!0)]),Ke((q(),ue("div",DQ,[xt(l.$slots,"name",{},()=>[nt(it(o.user.name),1)],!0)])),[[L(n),{content:o.user.name,delay:[1e3,0]}]]),a.value||o.hovered||o.focused?xt(l.$slots,"actions",{},void 0,!0,0):Ye("",!0)],38))}}),[["__scopeId","data-v-4de522be"]]),IQ={class:"unassign-icon"},CE=bt(tt({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,o=()=>{n("click")};return(s,r)=>(q(),je(L(pt),{variant:"menu-item",onClick:o,actived:e.actived,style:hn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:ye(()=>[Ee("div",IQ,[xt(s.$slots,"icon",{},()=>[r[0]||(r[0]=Ee("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("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:ye(()=>[xt(s.$slots,"label",{},()=>[nt(it(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),AQ=["innerHTML"],XO=20,ZO=bt(tt({__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 o=jt,s=e,{id:r}=Ng(s),i=n,a=K=>{var we,Ae;const ie=(Ae=(we=s.params)==null?void 0:we.api)==null?void 0:Ae.getRowNode(String(r.value));ie==null||ie.setDataValue("assignees",Wm(K.assignees)),U("updated",K)},l=$(!1),c=$(!1),u=$(null),d=$(1),h=$(!0),f=$(0),p=$(""),g=Dn("bulkUpdate",$(!1)),v=Dn("isSelectAll",$(!1)),C=Y(()=>{var K;return g.value&&v.value?[]:(K=s.ids)!=null&&K.length?s.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:y,assigneeList:E,mergedOptions:_,selectedUserIds:x}=gv({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{U("update-failed")}},C),{apiServices:R}=io(!g.value,s),P=Dn("workspaceId"),N=async(K=1,ie="",we=!1)=>{var ce,G,te,oe,O,Q;if(!R.value)throw console.error("API service or item identifiers are undefined",R.value),new Error("API service or item identifiers are undefined");if(we?c.value=!0:l.value=!0,u.value=null,!((ce=R.value)!=null&&ce.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");const Ae=(s.ids??(s.id?[s.id]:[])).map(String);try{let se;Ae.length==0?se=await((G=R.value)==null?void 0:G.getEntityUserRoles({workspaceId:String(P),page:K,per_page:XO,display_name_like:ie.trim(),entity_ids:String(s.entityId)})):se=await((te=R.value)==null?void 0:te.multipleAssignableUser({workspaceId:String(P),itemIds:Ae,page:K,perPage:XO,q:ie.trim(),entityId:String(s.entityId)}));const ve=((oe=Yu(se.data))==null?void 0:oe.map(pv))??[];E.value=we?Mu(E.value,ve,"id"):ve,f.value=se.meta.total,h.value=(((O=se==null?void 0:se.meta)==null?void 0:O.current_page)||0)<(((Q=se==null?void 0:se.meta)==null?void 0:Q.last_page)||0),d.value=K}catch(se){console.error("Error fetching assignable users:",se),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},I=()=>{!c.value&&h.value&&N(d.value+1,p.value,!0)},k=mr(async K=>{p.value=K,await N(1,K,!1)},bi),A=()=>N(1,p.value,!1);Qt(()=>{var K;(K=V.value)==null||K.focus()}),t({getValue:()=>{var K;return(K=_.value.find(ie=>ie.selected))==null?void 0:K.value},refresh:A,clearInternal:()=>{x.value=[]},focus:()=>{var K;(K=V.value)==null||K.focus()}});const M=()=>{const K=ln.getInstance().getItem("BASE_URL"),ie=Zo({type:"access_setting",config:{baseDomain:K,ws_code:s.workspaceId,entity_id:P}}).url;window.open(ie,"_blank")},V=$(null);Qt(()=>{ct(()=>{var K;(K=V.value)==null||K.focus()})}),Qe([()=>s.id,()=>s.workspaceId],()=>{N()},{deep:!0,immediate:!0});const B=K=>{var we;const ie=ln.getInstance().getItem("ws.code");return((we=R.value)==null?void 0:we.getUserInformation(ie,K))||Promise.resolve(null)},z=async(K,ie,we)=>{ie.preventDefault(),ie.stopPropagation(),ie.stopImmediatePropagation(),U("update-start");try{const Ae=await y(K);if(Ae)U("update-completed",Ae);else throw new Error("Failed to update assignees")}catch(Ae){U("update-failed"),console.error("Error updating assignees:",Ae)}},ne=async()=>{try{U("update-start");const K=await S();if(K)U("update-completed",K);else throw new Error("Failed to unassign all assignees")}catch(K){U("update-failed"),console.error("Error unassigning all assignees:",K)}finally{}},re=async K=>{try{U("update-start");const ie=await b(K);if(ie)U("update-completed",ie);else throw new Error("Failed to replace assignees")}catch(ie){U("update-failed"),console.error("Error replacing assignees:",ie)}finally{}},ee=()=>{var K,ie;i("cancel"),(ie=(K=s.params)==null?void 0:K.api)==null||ie.stopEditing()};di("popupAttachRef",V);const X=$(),D=$(!1),U=(K,ie)=>{switch(K){case"updated":i("updated",ie);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed",ie);break}};return Qt(()=>{ct(()=>{setTimeout(()=>{D.value=!0},50)})}),(K,ie)=>(q(),ue("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:X},[me(fa,zt({"selected-id":L(x)},{...s},{options:L(_),loading:l.value,ref_key:"popupRef",ref:V,"loading-more":c.value,"has-more":h.value,onSelect:ie[0]||(ie[0]=(we,Ae)=>{z(we,Ae)}),"data-wrapper":"true",onSearch:L(k),onLoadMore:I,onCancel:ee,onClose:ee}),Vh({"extra-item":ye(({isEmpty:we,isLoading:Ae})=>[!we&&!Ae?(q(),je(CE,{key:0,onClick:ne,actived:!1,label:"Unassign"},{icon:ye(()=>[me(ut,{src:"UserXMark",source:"remote"})]),_:1})):Ye("",!0)]),item:ye(({item:we,selectedIndex:Ae,isSelected:ce,handleItemHover:G,getHighlightedLabel:te,query:oe,idx:O,focused:Q})=>[me(xQ,{user:we.data,"multiple-select":!0,"append-to":X.value,isMe:!1,hover:O===Ae,selected:ce(we),focused:Q,onClick:Lt(se=>z(we,se,"click"),["stop","prevent"]),onMouseover:se=>G(O),"api-update-function":B},{name:ye(()=>[oe?Ke((q(),ue("span",{key:0,class:ae([K.$style["item-label"],K.$style.match]),style:{flex:"1"},innerHTML:te(we.label)},null,10,AQ)),[[L(o),{content:we.label}]]):Ke((q(),ue("span",{key:1,class:ae(K.$style["item-label"]),style:{flex:"1"}},[nt(it(we.label),1)],2)),[[L(o),{content:we.label}]])]),actions:ye(()=>[Ke((q(),je(pt,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:Lt(se=>{var ve;return re((ve=we.data)==null?void 0:ve.id)},["stop"])},{default:ye(()=>[me(ut,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[L(o),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":ye(()=>[Ee("div",{class:ae(K.$style["empty-state"])},[ie[3]||(ie[3]=nt(" No assignee available. ",-1)),ie[4]||(ie[4]=Ee("br",null,null,-1)),me(pt,{onClick:M,variant:["tertiary"],size:"small"},{default:ye(()=>[...ie[2]||(ie[2]=[nt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:ye(()=>[Ee("div",{class:ae(K.$style["error-message"])},[nt(it(u.value)+" ",1),me(pt,{onClick:A,size:"small"},{default:ye(()=>[...ie[1]||(ie[1]=[nt(" 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"}}]]),PQ={key:0,class:"inner"},zf=bt(tt({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const o=e,s=$(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:c,show:u}=mo({toggleOnClick:!0,zIndex:2,disabled:o.disabled,placement:"top",appendTo:s.value||void 0}),d=$(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=Uo({isShow:!1,isRender:!1});Qt(()=>{var C;const v=d.value instanceof HTMLElement?d.value:(C=d.value)==null?void 0:C.$el;v&&v.addEventListener("keydown",h)}),zn(()=>{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 Qe(()=>a.value,(v,C)=>{v?ct(()=>{a.value&&g(!0,!0)}):f.isShow=!1,p("onVisibleChange",v,C)}),t({hide:()=>{console.log(" "),l(),g(!1,!0)},isVisible:a,open:()=>{u(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),(v,C)=>(q(),ue("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:s},[Ee("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[xt(v.$slots,"trigger",{isVisible:L(a),hide:L(l),disabled:o.isUpdating||o.disabled,popupRef:L(i),triggerRef:L(r),toggle:L(c)},void 0,!0)],512),Ee("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?Ke((q(),ue("div",PQ,[xt(v.$slots,"popup",{isVisible:L(a),hide:L(l),popupRef:L(i),triggerRef:L(r),toggle:L(c),open:L(u)},void 0,!0)],512)),[[lr,f.isShow]]):Ye("",!0)],512)],512))}}),[["__scopeId","data-v-af84b00b"]]),kQ=tt({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;di("bulkUpdate",!0);const o=$(!1),s=t,r=$(null),i=()=>{var d;o.value=!0,s("update-start"),(d=l.value)==null||d.hide()},a=(d,h)=>{var f,p;o.value=!1,d?(s("update-completed",h),(f=l.value)==null||f.destroy()):(s("update-failed"),(p=l.value)==null||p.open())},l=$(null),c=d=>{var h;s("update",d),(h=r.value)==null||h.clearInternal()},u=(d,h)=>{ct(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return(d,h)=>(q(),je(zf,{ref_key:"wrapperRef",ref:l,isUpdating:o.value,disabled:n.disabled||o.value,onOnVisibleChange:u},{trigger:ye(({hide:f,disabled:p})=>[me(pt,{variant:n.variant,loading:o.value,disabled:p,onEscape:f},{default:ye(()=>[me(ut,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=nt(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ye(({hide:f})=>[me(ZO,zt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:c,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0,p)),onCancel:f}),null,16,["ids","onCancel"])]),default:ye(()=>[h[3]||(h[3]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),jf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],FQ=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),hl=(e,t)=>{const n=o=>{var s,r;if(o.key==="Tab"){const i=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let c=jf.indexOf(l);const u=i?-1:1;for(const d of jf){c=(c+u+jf.length)%jf.length;const h=jf[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(r=o.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(FQ.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},OQ=["aria-label"],MQ=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],NQ={style:{flex:"1"}},LQ=bt(tt({__name:"MainCalendar",props:zD({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:zD(["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 o=jt,s=$(null),r=e,i=Y(()=>r.startDate&&r.endDate),a=XW(e,"tracingCase"),l=n,c=$(r.year),u=$(r.month);Qe(()=>[r.year,r.month],([D,U])=>{c.value=D,u.value=U});const d=Y(()=>St.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),h=Y(()=>St.now().setZone(r.timezone)),f=Y(()=>r.startDate?St.fromJSDate(r.startDate,{zone:r.timezone}):null),p=Y(()=>r.endDate?St.fromJSDate(r.endDate,{zone:r.timezone}):null),g=$(f.value),v=$(p.value),C=$(f.value),S=$(p.value);Qe([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),y=Y(()=>r.requireConfirm?v.value:p.value);Qe(()=>r.activeField,D=>{const U=D==="start"?b.value:y.value;U&&(c.value=U.year,u.value=U.month)}),Qe(()=>{var D,U;return[(D=b.value)==null?void 0:D.toISODate(),(U=y.value)==null?void 0:U.toISODate(),r.activeField]},()=>{const D=r.activeField==="start"?b.value:y.value;D&&(D.year!==c.value||D.month!==u.value)&&(c.value=D.year,u.value=D.month)});function E(D){return D.setZone("utc")}const _=$("");function x(D){_.value=D.toISODate()||"",ct(()=>{const U=document.querySelector(`.arbo-calendar-day[data-date="${_.value}"]`);U==null||U.focus()})}Qe(()=>{var D,U;return[c.value,u.value,r.activeField,(D=b.value)==null?void 0:D.toISODate(),(U=y.value)==null?void 0:U.toISODate()]},()=>{const D=r.activeField==="start"?b.value:y.value;let U;D&&D.year===c.value&&D.month===u.value?U=D:b.value&&b.value.year===c.value&&b.value.month===u.value?U=b.value:U=h.value,x(U)});function R(D){return D.toFormat("d")}const P=Y(()=>{const D=St.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}),U=D.weekday,K=r.weekStart===1?(U+6)%7:U%7;let ie=D.minus({days:K});const we=[],Ae=Ku.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),ce=dm();for(let te=0;te<42;te++){const oe=[];ie.month!==u.value&&oe.push(ce["is-outside"]),ie.hasSame(h.value,"day")&&oe.push(ce["is-today"]),b.value&&ie.hasSame(b.value,"day")&&oe.push(ce["is-selected-start"]),y.value&&ie.hasSame(y.value,"day")&&oe.push(ce["is-selected-end"]),b.value&&y.value&&ie>b.value&&ie<y.value&&oe.push(ce["is-in-range"]);const O=R(ie),Q=Ae[ie.weekday-1]||"";we.push({dt:ie,iso:ie.toISODate()||"",label:ie.toFormat("d"),displayLabel:O,weekdayLabel:Q,aria:ie.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:oe}),ie=ie.plus({days:1})}const G=[];for(let te=0;te<6;te++)G.push(we.slice(te*7,te*7+7));return G}),N=Y(()=>{const D=Ku.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?D:[D[6],...D.slice(0,6)]});function I(D,U,K){const ie=D==="start"?U.startOf("day"):U.endOf("day"),we=E(ie),Ae={year:ie.year,month:ie.month,day:ie.day,utc:we.toISO()||""};D==="start"?(l("select-start",Ae,K??!0),l("select-start-utc",Ae.utc)):(l("select-end",Ae),l("select-end-utc",Ae.utc))}function k(D){let U=c.value,K=u.value+D;for(;K<1;)K+=12,U-=1;for(;K>12;)K-=12,U+=1;c.value=U,u.value=K,l("update:year",U),l("update:month",K)}function A(D){const K=(_.value?St.fromISO(_.value,{zone:r.timezone}):h.value).plus({days:D});K.month===u.value&&K.year===c.value&&x(K)}function M(D=!1){const K=(_.value?St.fromISO(_.value,{zone:r.timezone}):h.value).weekday%7,ie=D?6-K:-K;A(ie)}const V=D=>{B(D)};function B(D){switch(D.preventDefault(),D.stopPropagation(),D.key){case"ArrowLeft":D.preventDefault(),A(-1);break;case"ArrowRight":D.preventDefault(),A(1);break;case"ArrowUp":D.preventDefault(),A(-7);break;case"ArrowDown":D.preventDefault(),A(7);break;case"Home":D.preventDefault(),M(!1);break;case"End":D.preventDefault(),M(!0);break;case"PageUp":D.preventDefault(),k(D.shiftKey?-12:-1);break;case"PageDown":D.preventDefault(),k(D.shiftKey?12:1);break;case"Enter":case" ":{D.preventDefault();const U=_.value?St.fromISO(_.value,{zone:r.timezone}):h.value,K=P.value.flat().find(ie=>ie.iso===U.toISODate());K&&ne(K);break}}}const z=D=>{const U=St.now().setZone(r.timezone);c.value=U.year,u.value=U.month,l("update:year",U.year),l("update:month",U.month),x(U),l("gotoToday")};function ne(D){var ve,ke;const U=!!f.value,K=!!p.value,ie=r.activeField,we=((ve=f.value)==null?void 0:ve.toISODate())||"null",Ae=((ke=p.value)==null?void 0:ke.toISODate())||"null",ce=D.dt.toISODate()||"",G=(_e,$e)=>{a.value={case:_e,behavior:$e}},te=()=>`Selected start ${ce} > existing end ${Ae} -> reset both to ${ce}`,oe=()=>`Selected end ${ce} < existing start ${we} -> reset both to ${ce}`,O=()=>{I("start",D.dt,!0),I("end",D.dt),l("update:activeField","end")},Q=(_e=!1)=>{I("start",D.dt,_e),_e&&l("update:activeField","end")},se=(_e=!1)=>{I("end",D.dt),_e&&l("close")};if(U&&K){ie==="start"?p.value&&D.dt>p.value?(O(),G("INVERT_RANGE_FROM_START",te())):(Q(!1),G("UPDATE_START_IN_RANGE",`Updated start from ${we} to ${ce}; end remains ${Ae}`)):f.value&&D.dt<f.value?(O(),G("INVERT_RANGE_FROM_END",oe())):(se(!1),G("UPDATE_END_IN_RANGE",`Updated end from ${Ae} to ${ce}; start remains ${we}`));return}if(!U&&K&&ie==="start"&&p.value&&D.dt>p.value){O(),G("CREATE_RANGE_FROM_LATE_START",te());return}if(U&&!K&&ie==="end"&&f.value&&D.dt<f.value){O(),G("CREATE_RANGE_FROM_EARLY_END",oe());return}if(!U&&!K){if(ie==="start"){Q(!0),G("INIT_START",`Picked start ${ce}; awaiting end selection`);return}se(r.immediatelyUpdate),G("INIT_END",`Picked end ${ce}; awaiting start selection`);return}if(!U&&K){if(ie==="start"){Q(!0),G("FILL_MISSING_START",`Inserted start ${ce}; existing end ${Ae}`);return}se(!1),G("STRICT_UPDATE_END_ONLY",`Updated end to ${ce}; start still null`);return}if(U&&!K){if(ie==="start"){Q(!0),G("RESELECT_START_BEFORE_END",`Replaced start with ${ce}; end still null, switching to end`);return}se(r.immediatelyUpdate),G("FILL_MISSING_END",`Picked end ${ce}; start ${we}`);return}}function re(){C.value=g.value,S.value=v.value,l("confirm")}function ee(){g.value=C.value,v.value=S.value,l("cancel")}function X(){ct(()=>{var D;(D=s.value)==null||D.focus()})}return Qt(()=>{X()}),t({focus:X}),(D,U)=>(q(),ue("div",{ref_key:"calendarRef",ref:s,class:ae([D.$style["arbo-calendar"],{[D.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[Ee("div",{class:ae([D.$style["arbo-calendar-header"],D.$style["arbo-calendar-week"]]),role:"row"},[(q(!0),ue(kt,null,An(N.value,K=>(q(),ue("div",{key:K,class:ae(D.$style["arbo-calendar-weekday"]),role:"columnheader"},it(K),3))),128))],2),Ee("div",{class:ae(D.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:U[0]||(U[0]=Lt(K=>L(hl)(K,V),["prevent","stop"]))},[(q(!0),ue(kt,null,An(P.value,(K,ie)=>(q(),ue("div",{key:ie,class:ae(D.$style["arbo-calendar-week"])},[(q(!0),ue(kt,null,An(K,we=>(q(),ue("div",{key:we.iso,class:ae([D.$style["arbo-calendar-day"],we.classes,{[D.$style["is-focused"]]:we.iso===_.value}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":we.aria,"data-date":we.iso,"data-weekday":we.weekdayLabel,tabindex:we.iso===_.value?0:-1,onClick:Ae=>ne(we)},it(we.displayLabel),11,MQ))),128))],2))),128))],34),r.readOnly?Ye("",!0):(q(),ue("div",{key:0,class:ae(D.$style["arbo-calendar-actions"])},[Ee("div",NQ,[Ke((q(),je(pt,{variant:"secondary",size:"medium",onClick:U[1]||(U[1]=K=>z()),onKeydown:L(hl),"data-index":"today-btn"},{prefix:ye(()=>[me(ut,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[L(o),"Today"]])]),me(pt,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:L(hl),variant:"secondary",size:"medium",onClick:ee,"data-index":"cancel-btn"},{default:ye(()=>[nt(it(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),me(pt,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:L(hl),onClick:re},{default:ye(()=>[nt(it(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,OQ))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_99b61_1","arbo-calendar-day":"_arbo-calendar-day_99b61_2","arbo-calendar-week":"_arbo-calendar-week_99b61_3","arbo-calendar":"_arbo-calendar_99b61_2","arbo-calendar-nav":"_arbo-calendar-nav_99b61_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_99b61_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_99b61_53","arbo-calendar-weekday":"_arbo-calendar-weekday_99b61_58","arbo-calendar-weeks":"_arbo-calendar-weeks_99b61_63","is-today":"_is-today_99b61_92","is-selected-start":"_is-selected-start_99b61_97","is-selected-end":"_is-selected-end_99b61_105","is-outside":"_is-outside_99b61_125","is-focused":"_is-focused_99b61_128","is-in-range":"_is-in-range_99b61_133","arbo-calendar-actions":"_arbo-calendar-actions_99b61_139","arbo-calendar-btn":"_arbo-calendar-btn_99b61_147",cancel:"_cancel_99b61_156",confirm:"_confirm_99b61_161"}}]]),VQ=["onClick"],BQ=["variant","onClick"],$Q=bt(tt({__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 o=e,s=Y(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const A=o.locale||"en-US",M=o.monthLabelStyle||"short",V=new Intl.DateTimeFormat(A,{month:M,timeZone:"UTC"});return Array.from({length:12},(z,ne)=>V.format(new Date(Date.UTC(2020,ne,1))))}),r=n,i=$(o.year),a=$(o.month),l=$(o.year);Qe(()=>o.year,A=>{A!==i.value&&(i.value=A,l.value=A)}),Qe(()=>o.month,A=>{A!==a.value&&(a.value=A)});const c=$("days");function u(A){c.value!==A&&(c.value=A,r("mode-change",A))}const d=Y(()=>o.minYear),h=Y(()=>o.maxYear),f=Y(()=>{const A=o.yearSpan;return l.value-l.value%A}),p=Y(()=>f.value+o.yearSpan-1);function g(){const A=o.yearSpan,M=f.value-A;M>=d.value&&(l.value=M)}function v(){const A=o.yearSpan,M=f.value+A;M<=h.value&&(l.value=M)}const C=Y(()=>f.value-o.yearSpan<d.value),S=Y(()=>p.value+o.yearSpan>h.value),b=Y(()=>{const A=o.yearSpan;return Math.ceil(A/3)});function y(A){const V=f.value+(A-1)*3;return Array.from({length:3},(B,z)=>V+z).filter(B=>B<=p.value)}function E(){c.value==="months"?u("days"):u("months")}function _(){c.value==="years"?u("days"):u("years")}function x(A){i.value=A,l.value=A,r("update:year",A),r("year-selected",A),u("months")}function R(A){a.value=A,r("update:month",A),r("month-selected",A),u("days")}function P(){if(c.value==="days"){let A=i.value,M=a.value-1;if(M<1&&(M=12,A--),A<d.value)return;i.value=A,a.value=M,r("update:year",A),r("update:month",M)}else if(c.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else c.value==="years"&&g()}function N(){if(c.value==="days"){let A=i.value,M=a.value+1;if(M>12&&(M=1,A++),A>h.value)return;i.value=A,a.value=M,r("update:year",A),r("update:month",M)}else if(c.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else c.value==="years"&&v()}const I=Y(()=>c.value==="days"?i.value===d.value&&a.value===1:c.value==="months"?i.value-1<d.value:C.value),k=Y(()=>c.value==="days"?i.value===h.value&&a.value===12:c.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(A,M)=>{i.value=A,a.value=M}}),(A,M)=>(q(),ue("div",{class:ae([A.$style["cal-nav-wrapper"]])},[xt(A.$slots,"selection"),c.value==="days"?(q(),ue("div",{key:0,class:ae(A.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[me(pt,{variant:"tertiary",class:ae([A.$style["cal-nav-btn"],A.$style.prev]),"aria-label":"Previous",disabled:I.value,label:"",onClick:P,"data-index":"prev-btn",onKeydownCapture:jn(Lt(P,["prevent","stop"]),["enter"]),onKeydown:L(hl)},{default:ye(({hovered:V})=>[me(ut,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),Ee("div",{class:ae(A.$style["cal-nav-center"])},[me(pt,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:L(hl)},{default:ye(()=>[nt(it(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),me(pt,{variant:"secondary",onClick:_,"data-index":"year-btn",onKeydown:L(hl)},{default:ye(()=>[nt(it(i.value),1)]),_:1},8,["onKeydown"])],2),me(pt,{"data-index":"next-btn",variant:"tertiary",class:ae([A.$style["cal-nav-btn"],A.$style.next]),"aria-label":"Next",disabled:k.value,label:"",onClick:N,onKeydownCapture:jn(Lt(N,["prevent","stop"]),["enter"]),onKeydown:L(hl)},{default:ye(({hovered:V})=>[me(ut,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ye("",!0),c.value==="years"?(q(),ue("div",{key:1,class:ae(A.$style["year-grid"])},[Ee("div",{class:ae(A.$style["year-grid-header"])},[me(pt,{variant:"tertiary",class:ae([A.$style["cal-nav-btn"],A.$style.prev]),"aria-label":"Next",disabled:C.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:ye(({hovered:V})=>[me(ut,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),Ee("div",{class:ae(A.$style["range-label"])},it(f.value)+" - "+it(p.value),3),me(pt,{variant:"tertiary",class:ae([A.$style["cal-nav-btn"],A.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:ye(({hovered:V})=>[me(ut,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),Ee("div",{class:ae(A.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(q(!0),ue(kt,null,An(b.value,V=>(q(),ue("div",{key:"yr-row-"+V,class:ae(A.$style["year-grid-row"])},[(q(!0),ue(kt,null,An(y(V),B=>(q(),ue("a",{key:B,tabindex:"0",class:ae([A.$style["year-cell"],{[A.$style.selected]:B===i.value}]),onClick:z=>x(B)},it(B),11,VQ))),128))],2))),128))],2)],2)):c.value==="months"?(q(),ue("div",{key:2,class:ae(A.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[Ee("div",{class:ae(A.$style.months)},[(q(!0),ue(kt,null,An(s.value,(V,B)=>(q(),ue("a",{tabindex:"0",key:V,variant:B+1===a.value?"primary":"text",class:ae([A.$style["month-cell"],{[A.$style.selected]:B+1===a.value}]),onClick:z=>R(B+1)},it(V),11,BQ))),128))],2)],2)):(q(),ue("div",{key:3,class:ae(A.$style["days-slot"])},[xt(A.$slots,"default",{year:i.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:"_prev_mtd4w_33","year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:"_months_mtd4w_75","month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:"_selected_mtd4w_131","days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"}}]]);function HQ(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,r=$(""),i=Y(()=>{const g=St.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=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}),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},c=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}),u=Y(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&c.value),d=Y(()=>r.value.length===t.length&&u.value);return{inputValue:r,isValid:u,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=St.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>u.value?i.value:null}}const GQ={key:0,style:{marginLeft:"8px"}},UQ=["disabled","readonly","placeholder"],JO=bt(tt({__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 o=jt,s=e,r=n,i=$(null),a=$(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=HQ({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=Y(()=>s.active),g=Y(()=>({disabled:s.disabled,error:!l.value&&u.value.length>0,readOnly:s.readOnly,isEmpty:u.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:C,isFocus:S}=To(g),b=R=>{var N;const P=(N=R.clipboardData)==null?void 0:N.getData("text/plain");P&&(u.value=P.trim())},y=R=>{if(R.key==="Escape"){r("blur"),R.target.blur(),R.preventDefault(),R.stopPropagation(),R.stopImmediatePropagation();return}else R.key==="Tab"&&x(R)},E=()=>{d(),r("clear")};t({clear:E,setDate:h,getDate:f,focus:()=>{var R;return(R=i.value)==null?void 0:R.focus()}}),Qe(()=>s.modelValue,R=>{R?h(R):d()},{immediate:!0}),Qe([()=>c.value,()=>u.value],()=>{if(u.value.length===0)r("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&c.value){const R=f();(R||u.value.length===0)&&r("complete",R)}}),Qe(()=>l.value,R=>{R||r("invalid","")});const _=Y(()=>!!s.isMultipleDate),x=R=>{R.preventDefault(),R.stopImmediatePropagation(),R.stopPropagation(),r("tab",R)};return(R,P)=>(q(),je(Oo,zt(L(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:ye(()=>[Ee("div",{class:ae([R.$style["date-input-wrapper"]])},[_.value?(q(),ue("span",GQ," Multiple ")):Ke((q(),ue("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":P[0]||(P[0]=N=>vn(u)?u.value=N:null),onPaste:Lt(b,["prevent"]),placeholder:s.placeholder,class:ae([R.$style["date-input"]]),onKeydown:y},null,42,UQ)),[[rx,L(u)]]),xt(R.$slots,"clear",{handleClear:E},()=>[(L(u).length>0||_.value)&&!s.readOnly&&!s.disabled&&(L(C)||L(S))?Ke((q(),je(pt,{key:0,variant:["icon","primary"],onClick:Lt(E,["stop"]),size:16,rounded:!0},{default:ye(()=>[me(ut,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[L(o),"Clear"]]):(q(),je(ut,{key:1,src:"Calendar",source:"remote",class:ae(R.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:"_focus_132fk_12",hover:"_hover_132fk_12",active:"_active_132fk_12","date-input":"_date-input_132fk_1",invalid:"_invalid_132fk_38"}}]]),WQ=tt({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:PS()},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 o=$({case:"",behavior:""}),s=e,r=$(null),i=n,a=async(G,te)=>{i("start-update"),await G(),i("finish-update"),ct(()=>{var oe,O;te(),(O=(oe=s.params)==null?void 0:oe.api)==null||O.stopEditing()})},l=(G,te)=>{G(),ct(()=>{var oe,O;te(),(O=(oe=s.params)==null?void 0:oe.api)==null||O.stopEditing()})},c=()=>{var te;const G=St.now().setZone(s.timezone);U.value=G.year,K.value=G.month,(te=D.value)==null||te.setNavigation(G.year,G.month)},u=Uo({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:C,beginInteraction:S,clearStart:b,clearDue:y}=VY(s,i),E=Y(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Qe(()=>s.multipleStartDates,G=>{h.value=!!G},{immediate:!0}),Qe(()=>s.multipleDueDates,G=>{f.value=!!G},{immediate:!0});const _=$(null),x=$(null),R=G=>{G.preventDefault(),G.stopImmediatePropagation(),G.stopPropagation(),re()},P=()=>{var G;(G=x.value)==null||G.focus()},N=G=>{if(!G){u.start=!1,b();return}const te=d.endDate?St.fromJSDate(d.endDate,{zone:s.timezone}):null;if(te&&I(G,te)>0){const O={year:G.year,month:G.month,day:G.day};u.start=!1,C(O,!1),p(O),ct(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const oe={year:G.year,month:G.month,day:G.day};u.start=!1,C(oe,!0)},I=(G,te)=>{const oe=G.startOf("day"),O=te.startOf("day");return oe<O?-1:oe>O?1:0},k=G=>{var te;G.preventDefault(),G.stopImmediatePropagation(),G.stopPropagation(),(te=document.querySelector('[data-index="prev-btn"]'))==null||te.focus()},A=G=>{if(!G){u.end=!1,y();return}const te=d.startDate?St.fromJSDate(d.startDate,{zone:s.timezone}):null;if(te&&I(G,te)<0){const O={year:G.year,month:G.month,day:G.day};u.end=!1,C(O),p(O),ct(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const oe={year:G.year,month:G.month,day:G.day};u.end=!1,p(oe)},M=()=>{h.value=!1,b()},V=()=>{f.value=!1,y()},B=()=>{ee()},z=Y(()=>d.isSelectingStart||d.isSelectingEnd);function ne(){s.disabled||s.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,ct(()=>{var G;(G=r.value)==null||G.focus()}))}function re(){s.disabled||s.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,ct(()=>{var G;(G=_.value)==null||G.focus()}))}function ee(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function X(G){G.key==="Escape"?(G.stopPropagation(),ee()):G.key=="Tab"&&i("tab",G)}const D=$(null),U=$(new Date().getFullYear()),K=$(new Date().getMonth()+1);Qe(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(U.value=d.startDate.getFullYear(),K.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(U.value=d.endDate.getFullYear(),K.value=d.endDate.getMonth()+1)},{immediate:!0});const ie=$(null);function we(){if(Array.isArray(s.value)){const[te,oe]=s.value;d.startDate=te||null,d.endDate=oe||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const G=d.startDate||d.endDate||new Date;U.value=G.getFullYear(),K.value=G.getMonth()+1}Qe(()=>{var G,te,oe,O,Q,se,ve,ke;return[((oe=(te=(G=s.value)==null?void 0:G[0])==null?void 0:te.getTime)==null?void 0:oe.call(te))||((O=s.value)==null?void 0:O[0]),((ve=(se=(Q=s.value)==null?void 0:Q[1])==null?void 0:se.getTime)==null?void 0:ve.call(se))||((ke=s.value)==null?void 0:ke[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{we()},{immediate:!0,deep:!0}),t({resetCalendarLogic:we,openStart:ne,openEnd:re,closePicker:ee,clearAll:B,isOpen:z,drpRef:ie,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?ne():re():ne()}});const ce=$(null);return Qe(()=>z.value,G=>{if(s.disabled||s.readOnly)return;const te=ce.value;te&&(G?te.show():te.hide())},{immediate:!0}),(G,te)=>(q(),ue("div",{class:ae(G.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:x,onKeydown:X,tabindex:"1","data-index":"calendar-wrapper"},[me($Q,{year:U.value,"onUpdate:year":te[6]||(te[6]=oe=>U.value=oe),month:K.value,"onUpdate:month":te[7]||(te[7]=oe=>K.value=oe),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:D},{selection:ye(()=>[Ee("div",{class:ae(G.$style["calendar-input-section"])},[me(JO,{ref_key:"starDateRef",ref:r,"model-value":L(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:L(d).isSelectingStart,onClick:ne,onClear:M,onComplete:N,onInvalid:te[0]||(te[0]=oe=>u.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:P,onTab:R},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),me(JO,{ref_key:"endDateRef",ref:_,"model-value":L(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:L(d).isSelectingEnd,onClick:re,onClear:V,disabled:s.disabled,onComplete:A,onInvalid:te[1]||(te[1]=oe=>u.end=!0),readOnly:s.readOnly,isMultipleDate:L(f),onTab:k},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:ye(({year:oe,month:O})=>[me(LQ,{disabled:s.disabled,disableConfirm:u.end||u.start,readOnly:s.readOnly,ref_key:"drpRef",ref:ie,"tracing-case":o.value,"onUpdate:tracingCase":te[2]||(te[2]=Q=>o.value=Q),year:oe,month:O,"start-date":L(d).startDate,"end-date":L(d).endDate,"active-field":E.value,timezone:s.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:L(C),onSelectEnd:L(p),onGotoToday:c,onConfirm:te[3]||(te[3]=()=>{a(L(v),ee)}),onCancel:te[4]||(te[4]=Q=>l(L(g),ee)),onClose:te[5]||(te[5]=Q=>a(L(v),ee))},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))}}),Ov=bt(WQ,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_139py_1","calendar-input-section":"_calendar-input-section_139py_11","display-wrapper":"_display-wrapper_139py_19","calendar-actions":"_calendar-actions_139py_23","clear-all-btn":"_clear-all-btn_139py_29"}}]]),zQ=tt({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,o=e,s=Dn("isSelectAll",$(!1)),r=Dn("bulkUpdate",$(!1)),i=Y(()=>!!o.entityId&&r.value&&s.value),{apiServices:a}=io(!r.value,o),l=Dn("filterParams",null),c=$(null),u=async R=>{var P,N,I,k;try{y.value=!0,n("update-start");let A={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in R&&(A.startDate=R.start?fv(R.start):null),"end"in R&&(A.dueDate=R.end?fv(R.end):null),i.value?(A.itemIds=void 0,A.entityId=o.entityId):A.entityId=void 0;const M=await((N=(P=a.value)==null?void 0:P.changeDate)==null?void 0:N.call(P,A));n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:A}),n("update-completed",M),(I=c.value)==null||I.hide()}catch(A){console.error("Failed to update dates:",A),ct(()=>{ct(()=>{var M;n("update-failed"),(M=c.value)==null||M.open()})})}finally{(k=S.value)==null||k.resetCalendarLogic(),y.value=!1}},d=()=>{if(!o.rowSelected||o.rowSelected.length===0){h();return}o.rowSelected.length===1?f():p()},h=()=>{C.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const P=o.rowSelected[0].dateRange;b.value=[(P==null?void 0:P[0])??null,(P==null?void 0:P[1])??null],C.value=!1,v.value=!1},p=()=>{var P,N;if(o.rowSelected.some(I=>I.dateRange&&(I.dateRange[0]!==null||I.dateRange[1]!==null))){const I=g(0),k=g(1);if(v.value=I,C.value=k,I)b.value[0]=null;else{const A=((P=o.rowSelected[0].dateRange)==null?void 0:P[0])??null;b.value[0]=A}if(k)b.value[1]=null;else{const A=((N=o.rowSelected[0].dateRange)==null?void 0:N[1])??null;b.value[1]=A}}else v.value=!1,C.value=!1,b.value=[null,null]},g=R=>{const P=o.rowSelected.map(I=>{var k;return(k=I.dateRange)==null?void 0:k[R]});return P.length===0?!1:new Set(P.map(I=>{var k;return(k=I==null?void 0:I.getTime)==null?void 0:k.call(I)})).size>1},v=$(!1),C=$(!1),S=$(null),b=$([null,null]);Qe([()=>o.ids,()=>o.rowSelected],R=>{d(),ct(()=>{var P;(P=S.value)==null||P.focus()})},{immediate:!0,deep:!0});const y=$(!1),E=()=>{y.value=!0},_=()=>{ct(()=>{setTimeout(()=>{y.value=!1},500)})},x=(R,P)=>{R&&ct(()=>{var N;(N=S.value)==null||N.focus()})};return(R,P)=>(q(),je(zf,{ref_key:"wrapperRef",ref:c,isUpdating:y.value,disabled:o.disabled||y.value,onOnVisibleChange:x},{trigger:ye(({hide:N,disabled:I})=>[me(pt,{variant:o.variant,loading:y.value,disabled:I,onEscape:N},{default:ye(()=>[me(ut,{src:"Calendar"}),P[0]||(P[0]=nt(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ye(({isVisible:N,hide:I})=>[N?(q(),je(Ov,{key:0,immediatelyUpdate:!1,value:b.value,onConfirmed:u,ref_key:"calendarRef",ref:S,onClosed:I,onStartUpdate:E,onFinishUpdate:_,multipleDueDates:C.value,multipleStartDates:v.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Ye("",!0)]),default:ye(()=>[P[1]||(P[1]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),jQ=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"},QO=Rc("metricStore",()=>{const e=$();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return jQ(o)}}}),KQ=["onKeydown"],qQ=["width","height","viewBox"],YQ=["d"],XQ="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",eM=tt({__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 o=e,s=n,r=$(o.modelValue??0),i=$(null),a=Y(()=>{var I;return((I=o.params)==null?void 0:I.size)??24}),l=Y(()=>{var I;return((I=o.params)==null?void 0:I.iconViewBox)??"0 0 24 24"}),c=Y(()=>{var I;return((I=o.params)==null?void 0:I.iconPath)??XQ}),u=Y(()=>{var I;return((I=o.params)==null?void 0:I.wrapperTag)??"span"}),d=Y(()=>{var I;return o.disabled||((I=o.params)==null?void 0:I.disabled)||!1}),h=Y(()=>{var I;return o.readOnly||((I=o.params)==null?void 0:I.readOnly)||!1}),f=Y(()=>!d.value&&!h.value),p=Y(()=>d.value?"not-allowed":h.value?"default":"pointer");Qe(()=>o.modelValue,I=>{typeof I=="number"&&I!==r.value&&(r.value=I)});const g=I=>{var k;return((k=o.params)==null?void 0:k.maxRating)-I+1<=r.value&&!v.value},v=$(!1),C=()=>{v.value=!0},S=()=>{v.value=!1},b=I=>{f.value&&y(I)},y=I=>{var A,M;if(!f.value)return;let k=((A=o.params)==null?void 0:A.maxRating)-I+1;k===r.value&&(k=0),r.value=k,s("update:modelValue",k),s("update",k),s("change",k),(M=o.params)!=null&&M.onUpdate&&o.params.onUpdate(k)},E=I=>{var k;I!==r.value&&(r.value=I,s("update:modelValue",I),s("update",I),s("change",I),(k=o.params)!=null&&k.onUpdate&&o.params.onUpdate(I),_.value=I)},_=$(r.value),x=I=>{I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation(),r.value=_.value,s("cancel")},R=I=>{I.preventDefault(),E(r.value),s("handleEnter",r.value)},P=()=>{f.value&&(r.value=Math.min(r.value+1%(o.params.maxRating+1),o.params.maxRating),E(r.value))},N=()=>{f.value&&(r.value=Math.max(r.value-1,0),E(r.value))};return t({focus:()=>{var I;(I=i.value)==null||I.focus()}}),(I,k)=>(q(),ue("div",{class:ae(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:hn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[jn(Lt(N,["prevent"]),["left"]),jn(Lt(P,["prevent"]),["right"]),jn(Lt(N,["prevent"]),["down"]),jn(Lt(P,["prevent"]),["up"]),jn(Lt(R,["prevent"]),["enter"]),jn(Lt(R,["prevent"]),["tab"]),jn(Lt(x,["prevent"]),["escape"])]},[(q(!0),ue(kt,null,An(e.params.maxRating,A=>(q(),je(PC(u.value),{key:A,class:ae(["rating-item",{filled:g(A),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:hn({cursor:p.value,order:e.params.maxRating-A,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(A),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-A+1,tabindex:-1,onClick:Lt(M=>b(A),["prevent","stop"]),onMouseenter:C,onMouseleave:S},{default:ye(()=>[xt(I.$slots,"icon",{index:A,filled:g(A),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:A},()=>[(q(),ue("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[Ee("path",{d:c.value},null,8,YQ)],8,qQ))]),xt(I.$slots,"overlay",{index:A,filled:g(A),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,KQ))}}),ZQ={style:{maxWidth:"180px",lineHeight:"15px"}},JQ=["innerHTML"],tM=tt({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=jt,s=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(y=>({label:y.name,value:y.name,id:y.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[]},c=Y(()=>l(s.config)),u=$(s.modelValue),d=v=>{u.value=v,r("update:modelValue",v),r("change",v||null)},h=$(c.value),f=$(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(C=>C.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=$(null);return Qt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,C)=>(q(),je(fa,{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:ye(({item:S,getHighlightedLabel:b,selectedIndex:y,index:E})=>[me(dl,{hover:y==E,selected:S.value===e.modelValue,label:S.label,onSelect:_=>d(S.value||null),onClick:_=>d(S.value||null)},{label:ye(()=>[Ee("div",ZQ,[Ke(Ee("span",{innerHTML:b(S.label)},null,8,JQ),[[L(o),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":ye(()=>[...C[1]||(C[1]=[nt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),QQ={class:"metric-input-wrapper"},eee={key:0,class:"error-text input-2"},nM=tt({__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 o=jt,s=e,r=$(s.modelValue),i=$(s.modelValue),a=$(!1),l=$(!0),c=$(""),u=Y(()=>{var V;const M=Number.parseInt(String((V=s.config)==null?void 0:V.format_value)||"2",10);return Number.isFinite(M)&&M>=0?M:2}),d=M=>{if(!M)return M;const V=String(M).split(".");return V.length>1&&V[1].length>u.value?u.value===0?V[0]:`${V[0]}.${V[1].slice(0,u.value)}`:String(M)},h=M=>{const V=d(M);V!==M&&b.value?r.value=V:r.value=M},f=M=>{const V=M.target;if(!V)return;const B=V.value||"",z=B.indexOf(".");if(M.key==="."&&u.value===0){M.preventDefault();return}z!==-1&&/[0-9]/.test(M.key)&&B.slice(z+1).length>=u.value&&M.preventDefault()},p=Y(()=>l.value||s.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var X;const M=s.config.restricted_type.trim(),V=((X=s.config.restricted_value)==null?void 0:X.split(",").map(Number))||[],[B,z]=V,re={range:`Enter a value between ${B} and ${z}`,not:`These values are not allowed: ${V.join(", ")}`,exact:"Value is not allowed"}[M];return l.value?"":re},v=Y(()=>{var V;let M="";return Number((V=s.config)==null?void 0:V.format_value)&&(M+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${M}`});Qe(()=>s.modelValue,M=>{r.value=M,i.value=M});const C=M=>cv(s.config,M),S=n,b=$(null),y=M=>{const V=M===""?null:M,B=i.value===""?null:i.value;return V!==B},E=M=>{const V=d(M);if(!y(V))return!1;const B=V===""?null:V;return r.value=B,i.value=B,S("update:modelValue",B),S("handleChange",B),!0},_=()=>{r.value=i.value,S("update:modelValue",i.value)},x=(M,V)=>{E(M),S("enter")},R=(M,V)=>{if(a.value){a.value=!1;return}s.saveOnBlur?E(M):_()},P=M=>{if(M===null||M===""){l.value=!0;return}l.value=cv(s.config,Number(M)),c.value=l.value?"":g()},N=(M,V)=>{a.value=!0,s.saveOnEscape?E(M):_(),S("cancel"),setTimeout(()=>{a.value=!1},100)},I=M=>{P(M),S("onValidation",M)},k=()=>{a.value=!0,_(),S("cancel"),setTimeout(()=>{a.value=!1},100)},A=()=>{var M;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(M=b.value)==null||M.focus()};return t({focus:()=>{var M;return(M=b.value)==null?void 0:M.focus()},blur:()=>{var M;return(M=b.value)==null?void 0:M.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>E(r.value),revert:_}),Qt(()=>{var M;(M=b.value)==null||M.focus()}),(M,V)=>Ke((q(),ue("div",QQ,[me(Wf,{maxDecimalChar:u.value,modelValue:r.value,"onUpdate:modelValue":V[0]||(V[0]=B=>r.value=B),placeholder:v.value,validatorFnc:C,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:x,onBlur:R,onClear:A,onEscape:N,onCancel:k,onOnValidation:I,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(q(),ue("span",eee,it(c.value),1)):Ye("",!0)])),[[L(o),p.value]])}}),tee={key:2},nee={class:"wrapper-suffix"},oee={key:3},see=bt(tt({__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 o=jt,s=e,r=$(null),i=$(0),a=$(null),l=$(null),c=Y(()=>wk(s.config)),u=$(!1),d=Y(()=>!!ie.value),h=n,f=()=>{u.value=!1,K(),h("cancel")},p=$(!0),g=ce=>{if(ce===null||ce===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=cv(s.config,Number(ce)),C.value=S()},v=()=>{u.value=!0,z()},C=$(""),S=()=>{var ve;const ce=s.config.restricted_type.trim(),G=((ve=s.config.restricted_value)==null?void 0:ve.split(",").map(Number))||[],[te,oe]=G,Q={range:`Enter a value between ${te} and ${oe}`,not:`These values are not allowed: ${G.join(", ")}`,exact:"Value is not allowed"}[ce];return p.value?"":Q},b=Y(()=>{var G;const ce=Number.parseInt(String((G=s.config)==null?void 0:G.format_value)||"2",10);return Number.isFinite(ce)&&ce>=0?ce:2}),y=ce=>{u.value=!0,r.value=ce},E=()=>{u.value=!0,K(),z()},_=ce=>{i.value=ce,u.value=!0,z()},x=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(G=>G.charAt(0).toUpperCase()+G.slice(1)).join("").replace(/Outline|Solid/g,""),R=$(null),P=$(!0),N=Y(()=>{var ce;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((ce=r.value)==null?void 0:ce.length)===0,wrapperRef:D,active:d,focus:s.focus,bordered:!0}}),I=$(null),k=Y(()=>P.value),A=Y(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:I,active:k,focus:P.value,bordered:!0})),{argsMain:M}=To(A),{argsMain:V}=To(N),B=$(null),z=()=>{ct(()=>{var ce;(ce=B.value)==null||ce.focus()})},ne=ce=>{var G;if(ce.format_type==="dropdown"&&ce.format_value)try{const te=JSON.parse(ce.format_value);if(Array.isArray(te))return te.map(oe=>({label:oe.name,value:oe.name,id:oe.name}))}catch(te){console.error("Failed to parse dropdown options",te)}return ce.format_type=="number"&&ce.restricted_type=="exact"?((G=ce.restricted_value)==null?void 0:G.split(",").map(oe=>({label:ce.mapping[`!${oe}`]||oe,value:oe,id:oe})))||[]:[]},re=Y(()=>ne(s.config)),ee=Y(()=>{var ce;return((ce=re.value.find(G=>G.value===r.value))==null?void 0:ce.label)||r.value||"-"}),X=()=>{var ce;if(c.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(c.value=="number"){const G=(ce=l.value)==null?void 0:ce.getValue();h("updateMetric",G||null)}else h("updateMetric",r.value||null);u.value=!1,K()},{triggerRef:D,popupRef:U,hide:K,isVisible:ie,show:we}=mo({toggleOnClick:!0,appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),Ae=()=>{switch(c.value){case"number":ct(()=>{var ce;(ce=l.value)==null||ce.focus()});break;case"dropdown":we(),ct(()=>{var ce;(ce=R.value)==null||ce.focus()});break;case"rating":P.value=!0,ct(()=>{var ce;(ce=a.value)==null||ce.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,u.value=!1},focus:Ae,hasChanges:()=>u.value}),Qt(()=>{ct(()=>{setTimeout(()=>{Ae()},300)})}),(ce,G)=>(q(),ue("div",{class:ae(ce.$style["metric-editor"])},[c.value=="number"?(q(),je(nM,{key:0,config:s.config,modelValue:r.value,"onUpdate:modelValue":G[0]||(G[0]=te=>r.value=te),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:y,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(q(),je(Oo,zt({key:1,"tab-index":1},L(M),{ref_key:"triggerRef2",ref:I,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:ye(()=>[me(eM,{params:{maxRating:s.config.range},modelValue:i.value,"onUpdate:modelValue":G[1]||(G[1]=te=>i.value=te),onHandleEnter:_,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:ye(()=>[me(ut,{source:"rating",src:x()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(q(),ue("div",tee,[me(Oo,zt(L(V),{ref_key:"triggerRef",ref:D,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:ye(({})=>[Ee("div",nee,[me(ut,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:ye(()=>[Ke((q(),ue("span",null,[nt(it(ee.value||""),1)])),[[L(o),{content:ee.value}]])]),_:1},16),Ee("div",{ref_key:"popupRef",ref:U},[L(ie)?(q(),je(tM,{key:0,ref_key:"metricEditorDropdownRef",ref:R,config:s.config,modelValue:r.value,"onUpdate:modelValue":G[2]||(G[2]=te=>r.value=te),onChange:E,onCancel:f},null,8,["config","modelValue"])):Ye("",!0)],512)])):(q(),ue("span",oee,"Formular")),Ke((q(),je(pt,{ref_key:"confirmButtonRef",ref:B,onHandleClick:X,"tab-index":"1",onKeypress:[jn(Lt(Ae,["shift","prevent"]),["tab"]),jn(Lt(f,["prevent"]),["escape"])],disabled:!p.value},{default:ye(()=>[me(ut,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[L(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),ree=bt(tt({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=jt,s=e,r=n,i=$(!1),a=$(null),l=$(null),c=()=>{i.value=!i.value},u=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await ct(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:s.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&&u()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];C&&C()};return Qe(i,g=>{g&&r("open")}),t({hide:u,show:d}),(g,v)=>(q(),ue("div",{class:ae([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[Ee("div",{class:ae(g.$style["metric-label"]),onClick:Lt(c,["stop"])},[xt(g.$slots,"default",{open:i.value},()=>[Ke((q(),ue("span",{class:ae(g.$style["metric-name"])},[nt(it(e.label),1)],2)),[[L(o),{content:e.label}]]),e.morpheme&&i.value?(q(),ue("small",{key:0,class:ae(g.$style["metric-morpheme"])}," ("+it(e.morpheme)+") ",3)):Ye("",!0)])],2),me(V1,{mode:"out-in",name:"slide"},{default:ye(()=>[i.value?(q(),je(see,{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"])):Ye("",!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"}}]]);function oM(e,t){return function(){return e.apply(t,arguments)}}const{toString:iee}=Object.prototype,{getPrototypeOf:pa}=Object,{iterator:Kf,toStringTag:sM}=Symbol,ga=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),rM=e=>typeof e=="string"&&(e==="__proto__"||e==="constructor"||e==="prototype"),Mv=(e,t,n)=>e===Object.prototype||!n&&t===null,aee=e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(n=>{if(rM(n))return!1;const o=Object.getOwnPropertyDescriptor(e,n);return!!o&&o.configurable&&o.writable===!0})},bE=(e,t)=>{let n=e;const o=[];for(;n!=null;){if(o.indexOf(n)!==-1)return!1;o.push(n);const s=pa(n);if(Mv(n,s,n===e))return!1;if(ga(n,t))return!0;n=s}return!1},lee=(e,t)=>e!=null&&bE(e,t)?e[t]:void 0,cee=e=>{if(e==null||typeof e!="object"&&typeof e!="function")return e;const t=pa(e);if(t===null&&aee(e))return e;const n=Object.create(null),o=Object.create(null),s=[];let r=e;for(;r!=null&&s.indexOf(r)===-1;){s.push(r);const i=r===e?t:pa(r);if(Mv(r,i,r===e))break;const a=Object.getOwnPropertyNames(r);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(r));for(const l of a)rM(l)||ga(o,l)||(n[l]=e[l],o[l]=!0);r=i}return n},SE=(e=>t=>{const n=iee.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),br=e=>(e=e.toLowerCase(),t=>SE(t)===e),Nv=e=>t=>typeof t===e,{isArray:xc}=Array,Ic=Nv("undefined");function ud(e){return e!==null&&!Ic(e)&&e.constructor!==null&&!Ic(e.constructor)&&Es(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const iM=br("ArrayBuffer");function uee(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&iM(e.buffer),t}const dee=Nv("string"),Es=Nv("function"),hee=Nv("number"),dd=e=>e!==null&&typeof e=="object",fee=e=>e===!0||e===!1,Lv=e=>{if(!dd(e))return!1;const t=pa(e);return(t===null||t===Object.prototype||pa(t)===null)&&(Mv(e,t,!0)||!ga(e,sM)&&!ga(e,Kf))},pee=e=>{if(!dd(e)||ud(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},gee=br("Date"),mee=br("File"),vee=e=>!!(e&&typeof e.uri<"u"),yee=e=>e&&typeof e.getParts<"u",wee=br("Blob"),Cee=br("FileList"),bee=br("Set"),See=e=>dd(e)&&Es(e.pipe);function Eee(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const aM=Eee(),lM=typeof aM.FormData<"u"?aM.FormData:void 0,_ee=e=>{if(!e)return!1;if(lM&&e instanceof lM)return!0;const t=pa(e);if(!t||t===Object.prototype||!Es(e.append))return!1;const n=SE(e);return n==="formdata"||n==="object"&&Es(e.toString)&&e.toString()==="[object FormData]"},Ree=br("URLSearchParams"),[Tee,Dee,xee,Iee]=["ReadableStream","Request","Response","Headers"].map(br),Aee=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),xc(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(ud(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function Pee(e,t){if(ud(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const Ac=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,cM=e=>!Ic(e)&&e!==Ac;function EE(...e){const{caseless:t,skipUndefined:n}=cM(this)&&this||{},o={},s=t?Object.create(null):null,r=(i,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;let l=a;if(s&&typeof a=="string"){const u=a.toLowerCase(),d=s[u];d!==void 0&&ga(o,d)?l=d:s[u]=a}const c=ga(o,l)?o[l]:void 0;Lv(c)&&Lv(i)?o[l]=EE(c,i):Lv(i)?o[l]=EE({},i):xc(i)?o[l]=i.slice():(!n||!Ic(i))&&(o[l]=i)};for(let i=0,a=e.length;i<a;i++){const l=e[i];if(!l||ud(l)||(qf(l,r),typeof l!="object"||xc(l)||!Object.getOwnPropertySymbols))continue;const c=Object.getOwnPropertySymbols(l);for(let u=0;u<c.length;u++){const d=c[u];Uee.call(l,d)&&r(l[d],d)}}return o}const kee=(e,t,n,{allOwnKeys:o}={})=>(qf(t,(s,r)=>{n&&Es(s)?Object.defineProperty(e,r,{__proto__:null,value:oM(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),Fee=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Oee=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Mee=(e,t,n,o)=>{let s,r,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)i=s[r],(!o||o(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&pa(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Nee=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},Lee=e=>{if(!e)return null;if(xc(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,o=new Set;let s=e;for(;s!=null&&n.size<t;){if(o.has(s))return null;o.add(s);const i=pa(s);if(Mv(s,i,s===e))break;Object.getOwnPropertyNames(s).forEach(a=>{const l=+a;Number.isInteger(l)&&l>=0&&l<t&&String(l)===a&&ga(s,a)&&n.add(l)}),s=i}if(n.size!==t)return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Vee=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&pa(Uint8Array)),Bee=(e,t)=>{const o=(e&&e[Kf]).call(e);let s;for(;(s=o.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},$ee=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},Hee=br("HTMLFormElement"),Gee=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),{propertyIsEnumerable:Uee}=Object.prototype,Wee=br("RegExp"),uM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};qf(n,(s,r)=>{let i;(i=t(s,r,e))!==!1&&(o[r]=i||s)}),Object.defineProperties(e,o)},zee=e=>{uM(e,(t,n)=>{if(Es(e)&&["arguments","caller","callee"].includes(n))return!1;const o=e[n];if(Es(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},jee=(e,t)=>{const n={},o=s=>{s.forEach(r=>{n[r]=!0})};return xc(e)?o(e):o(String(e).split(t)),n},Kee=()=>{},qee=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Yee(e){return!!(e&&Es(e.append)&&e[sM]==="FormData"&&e[Kf])}const Xee=e=>{const t=new WeakSet,n=o=>{if(dd(o)){if(t.has(o))return;if(ud(o))return o;if(!("toJSON"in o)){t.add(o);let s;if(bee(o)){s=[];for(const r of o){const i=n(r);!Ic(i)&&s.push(i)}}else s=xc(o)?[]:{},qf(o,(r,i)=>{const a=n(r);!Ic(a)&&(s[i]=a)});return t.delete(o),s}}return o};return n(e)},Zee=br("AsyncFunction"),Jee=e=>e&&(dd(e)||Es(e))&&Es(e.then)&&Es(e.catch),dM=((e,t)=>e?setImmediate:t?((n,o)=>(Ac.addEventListener("message",({source:s,data:r})=>{s===Ac&&r===n&&o.length&&o.shift()()},!1),s=>{o.push(s),Ac.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Es(Ac.postMessage)),Qee=typeof queueMicrotask<"u"?queueMicrotask.bind(Ac):typeof J<"u"&&J.nextTick||dM,hM=e=>e!=null&&Es(e[Kf]),de={isArray:xc,isArrayBuffer:iM,isBuffer:ud,isFormData:_ee,isArrayBufferView:uee,isString:dee,isNumber:hee,isBoolean:fee,isObject:dd,isPlainObject:Lv,isEmptyObject:pee,isReadableStream:Tee,isRequest:Dee,isResponse:xee,isHeaders:Iee,isUndefined:Ic,isDate:gee,isFile:mee,isReactNativeBlob:vee,isReactNative:yee,isBlob:wee,isRegExp:Wee,isFunction:Es,isStream:See,isURLSearchParams:Ree,isTypedArray:Vee,isFileList:Cee,forEach:qf,merge:EE,extend:kee,trim:Aee,stripBOM:Fee,inherits:Oee,toFlatObject:Mee,kindOf:SE,kindOfTest:br,endsWith:Nee,toArray:Lee,forEachEntry:Bee,matchAll:$ee,isHTMLForm:Hee,hasOwnProperty:ga,hasOwnProp:ga,hasOwnInPrototypeChain:bE,getSafeProp:lee,toSafeFlatObject:cee,reduceDescriptors:uM,freezeMethods:zee,toObjectSet:jee,toCamelCase:Gee,noop:Kee,toFiniteNumber:qee,findKey:Pee,global:Ac,isContextDefined:cM,isSpecCompliantForm:Yee,toJSONObject:Xee,isAsyncFn:Zee,isThenable:Jee,setImmediate:dM,asap:Qee,isIterable:hM,isSafeIterable:e=>e!=null&&bE(e,Kf)&&hM(e)},ete=de.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"]),tte=e=>{const t=Object.create(null);let n,o,s;return e&&e.split(`
|
|
147
|
+
This will fail in production.`);i=Sc,i._s.has(e)||(s?iE(e,t,o,i):EO(e,o,i),J.env.NODE_ENV!=="production"&&(r._pinia=i));const c=i._s.get(e);if(J.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=s?iE(u,t,o,i,!0):EO(u,Cr({},o),i,!0);a._hotUpdate(d),delete i.state.value[u],i._s.delete(u)}if(J.env.NODE_ENV!=="production"&&da){const u=ro();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return r.$id=e,r}function ts(e){const t=Bt(e),n={};for(const o in t){const s=t[o];s.effect?n[o]=Y({get:()=>e[o],set(r){e[o]=r}}):(vn(s)||Fs(s))&&(n[o]=ci(e,o))}return n}const aE=Rc("permissionStore",()=>{const e=$([]),t=$(),n=$({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),vJ="woohoo_getWoohooUserInterface_read",lE="media_getReviewUserInterface_read",yJ="update_getUpdateUserInterface_read",_O="Unarchive parent folder first to continue",wJ=(e,t,n,o,s,r)=>{const i=aE(),{userPermissions:a}=ts(i),l=Y(()=>{const R=ln.getInstance().getItem("BASE_URL"),P=ln.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:N,entity_id:I,scene_id:k}=e.value;return{baseDomain:R||"",ws_code:N||"",entity_id:I||"",scene_id:k||"",reviewDomain:P||"",take_id:I||"",woohoo_id:I||"",parent_id:I||""}}),c=Y(()=>{var P;const R=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(lE),canCopyLink:!0,canRename:(R==null?void 0:R.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(lE),canOpenTakeInUpdate:a.value.includes(yJ),canOpenTakeInWoohoo:a.value.includes(vJ),canDeleteRendition:((P=R==null?void 0:R.media)==null?void 0:P.has_delete_rendition_permission)??!1,canDeleteThumbnail:(R==null?void 0:R.has_edit_thumbnail_permission)??!1,canArchiveScene:R==null?void 0:R.has_archive_permission,canUnarchiveScene:R==null?void 0:R.has_archive_permission,canDeleteScene:(R==null?void 0:R.has_delete_permission)??!1,canEditDescription:(R==null?void 0:R.has_edit_permission)??!1}}),u=Y(()=>({project:Zo({type:"project",config:l.value}).url,take_review:Zo({type:"review_take",config:l.value}).url,review:Zo({type:"review_scene",config:l.value}).url,review_scene:Zo({type:"review_scene",config:l.value}).url,woohoo:Zo({type:"woohoo",config:l.value}).url,update:Zo({type:"update",config:l.value}).url,scene_hub:Zo({type:"scene_hub",config:l.value}).url})),d=(R,P)=>{const N=R.metaKey||R.ctrlKey,I=u.value[P]||"";if(I){if(P==="scene_hub"){if(N){window.open(I,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(l.value.scene_id||"");return}N?window.open(I,"_blank"):window.location.href=I}},h=async(R,P)=>{var N;try{const I=await((N=e.value.axiosService.value)==null?void 0:N.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(I==null?void 0:I.message)!="Done"&&console.error("Failed to delete rendition.")}catch(I){console.error("Error deleting rendition",I)}finally{s()}},f=async(R,P)=>{var N;try{await((N=e.value.axiosService.value)==null?void 0:N.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(I){console.error("Error deleting thumbnail",I)}finally{s()}},p=async(R,P)=>{var N;try{const I=await((N=e.value.axiosService.value)==null?void 0:N.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(I==null?void 0:I.message)!="Done"&&console.error("Failed to archive scene."),P&&P("archived")}catch(I){console.error("Error archiving item",I)}finally{s()}},g=async(R,P)=>{var N;try{const I=await((N=e.value.axiosService.value)==null?void 0:N.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(I==null?void 0:I.message)!="Done"&&console.error("Failed to delete scene."),P&&P("deleted")}catch(I){console.error("Error deleting item",I)}finally{s()}},v=R=>{const P=u.value.scene_hub||"";P&&(E.value="Copied",navigator.clipboard.writeText(P),setTimeout(()=>{E.value="Copy link"},5e3))},C=async(R,P)=>{var N;try{const I=await((N=e.value.axiosService.value)==null?void 0:N.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(I==null?void 0:I.message)!="Done"&&console.error("Failed to unarchive scene."),P&&P("unarchived")}catch(I){console.error("Error unarchiving item",I)}finally{s()}},S=R=>p(R,t),b=R=>C(R,t),y=R=>g(R,t),E=$("Copy link"),_=R=>d(R,"review"),x=Y(()=>{let R=[];if(!l.value.scene_id&&e.value.optionBlock&&R.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const P=()=>Math.random().toString(36).substring(2,9);return[{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:_,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:P(),label:E.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?_O:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?_O:"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:y,hide:!c.value.canDeleteScene,type:"icon"}]}]});return{linkMap:u,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:C,options:x}};function To(e){const t=$(!1),n=$(!1),o=Y(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),s=()=>{t.value=!0,ct(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},r=()=>{t.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1},l=c=>{if(!c)return null;const u=c.value||c;return(u instanceof HTMLElement?u:u==null?void 0:u.$el)||null};return Qt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",s),c.addEventListener("blur",r)),u&&(u.addEventListener("mouseenter",i),u.addEventListener("mouseleave",a))}),zn(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",s),c.removeEventListener("blur",r)),u&&(u.removeEventListener("mouseenter",i),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const sd=e=>{const t=$(!1),n=Y(()=>t.value);return Qt(()=>{var a,l,c,u;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,r=s==null?void 0:s.rowIndex,i=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}};var Us=(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))(Us||{});const Bf=Rc("bulkUpdate",()=>{const e=$(Ft.UNCHECK),t=Uo({loaded:0,total:0}),n=u=>{t.total=u},o=u=>{t.loaded=u},s=Uo({isBulkUpdating:!1});function r(u){s.isBulkUpdating=u}const i=$({}),a=u=>{i.value=u},l=(u,d)=>{i.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:s,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{c(Ft.CHECKED)}}}),CJ={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{error:"Deletion failed. Please try again."},delete_thumbnail:{error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{},bulkRename:{}},offline:{error:"You are currently offline. Please check your network connection."}};function RO(e,t,n){return(t=SJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SJ(e){var t=bJ(e,"string");return typeof t=="symbol"?t:t+""}function Tc(e){"@babel/helpers - typeof";return Tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(e)}var TO=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function DO(e){return Tc(e)==="object"&&e!==null&&!Array.isArray(e)}function xO(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function EJ(e){return typeof Blob<"u"&&e instanceof Blob}var _J=function(t){return DO(t)&&xO(t,["file","fileName"])&&EJ(t.file)&&typeof t.fileName=="string"},RJ=function(t){return DO(t)&&xO(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"};Object.freeze(RO(RO({},TO.TOOLBOX_EXPORT_DATA,_J),TO.SW_APP_LOADER,RJ));let TJ=class extends Error{},cl=class extends TJ{constructor(){super("Zone is an abstract class")}},IO=class{get type(){throw new cl}get name(){throw new cl}get ianaName(){return this.name}get isUniversal(){throw new cl}offsetName(t,n){throw new cl}formatOffset(t,n){throw new cl}offset(t){throw new cl}equals(t){throw new cl}get isValid(){throw new cl}};const cE=new Map;function DJ(e){let t=cE.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),cE.set(e,t)),t}const xJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function IJ(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function AJ(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=xJ[r];r==="era"?o[a]=i:Av(a)||(o[a]=parseInt(i,10))}return o}const uE=new Map;let PJ=class MT extends IO{static create(t){let n=uE.get(t);return n===void 0&&uE.set(t,n=new MT(t)),n}static resetCache(){uE.clear(),cE.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=MT.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return MJ(t,n,o,this.name)}formatOffset(t,n){return kv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=DJ(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?AJ(o,n):IJ(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=OJ({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},dE=null,kJ=class bg extends IO{static get utcInstance(){return dE===null&&(dE=new bg(0)),dE}static instance(t){return t===0?bg.utcInstance:new bg(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new bg(PO(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${kv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${kv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return kv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};function Av(e){return typeof e>"u"}function Pv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function AO(e){if(!(Av(e)||e===null||e===""))return parseInt(e,10)}function FJ(e){if(!(Av(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function OJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function MJ(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function PO(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function kv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Pv(n,2)}:${Pv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Pv(n,2)}${Pv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const kO=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function rd(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function id(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function FO(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=AO(t[n+s]);return[o,null,n+s]}}const OO=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,NJ=`(?:${OO.source}?(?:\\[(${kO.source})\\])?)?`,MO=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,NO=RegExp(`${MO.source}${NJ}`),hE=RegExp(`(?:[Tt]${NO.source})?`),LJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,VJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,BJ=/(\d{4})-?(\d{3})/,$J=FO("weekYear","weekNumber","weekDay"),HJ=FO("year","ordinal"),GJ=/(\d{4})-(\d\d)-(\d\d)/,LO=RegExp(`${MO.source} ?(?:${OO.source}|(${kO.source}))?`),UJ=RegExp(`(?: ${LO.source})?`);function ad(e,t,n){const o=e[t];return Av(o)?n:AO(o)}function WJ(e,t){return[{year:ad(e,t),month:ad(e,t+1,1),day:ad(e,t+2,1)},null,t+3]}function ld(e,t){return[{hours:ad(e,t,0),minutes:ad(e,t+1,0),seconds:ad(e,t+2,0),milliseconds:FJ(e[t+3])},null,t+4]}function $f(e,t){const n=!e[t]&&!e[t+1],o=PO(e[t+1],e[t+2]),s=n?null:kJ.instance(o);return[{},s,t+3]}function Hf(e,t){const n=e[t]?PJ.create(e[t]):null;return[{},n,t+1]}rd(LJ,hE),rd(VJ,hE),rd(BJ,hE),rd(NO),id(WJ,ld,$f,Hf),id($J,ld,$f,Hf),id(HJ,ld,$f,Hf),id(ld,$f,Hf),id(ld),rd(GJ,UJ),rd(LO),id(ld,$f,Hf);var Fo=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Fo||{});Fo.review,Fo.review_take,Fo.review_scene,Fo.review_rendition,Fo.review_frame,Fo.review_rendition_comment,Fo.review_comment,Fo.scene_hub,Fo.hub_rendition,Fo.hub_comment,Fo.people_insight,Fo.people_detail,Fo.project,Fo.woohoo,Fo.update,Fo.core,Fo.project_focusMode;var fE=null;function zJ(e){fE=e}function Fv(){if(!fE)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return fE}function VO(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=Fv();return"".concat(t.t("errorMessages.fallback.unknownError")," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function jJ(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&Tc(o)==="object")Object.keys(o).forEach(function(i){var a="{".concat(i,"}"),l=o[i];Array.isArray(l)?l=l.join(", "):i==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),s=s.replace(/{value}/g,r)}return s}function KJ(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var r=s[o],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function BO(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function $O(e,t){if(!e||Tc(e)!=="object")return null;try{var n=Fv();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),r=0,i=s;r<i.length;r++){var a=i[r],l=o[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var C,S=t.toUpperCase();v=(C=p[g])===null||C===void 0||(C=C.errorMessages)===null||C===void 0||(C=C[S])===null||C===void 0||(C=C.validation_rules)===null||C===void 0?void 0:C[c]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[c]}if(v&&typeof v=="string")return jJ(v,a,u,d)}catch(y){console.error("Error in validation rules",y)}}}}catch(y){return console.error("Error in getValidationErrorMessage:",y),null}return null}function HO(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return VO();var n=e.code,o=e.error,s=e.details,r=e.message;if(BO(s)&&s){var i=$O(s,o==null?void 0:o.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=Fv();return a.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(o&&Tc(o)==="object"&&o.type&&o.key){var l=o.type.toUpperCase();try{var c,u,d,h="errorMessages.".concat(l,".").concat(o.key),f=Fv(),p=((c=f.messages)===null||c===void 0?void 0:c.value)||f.messages,g=((u=f.locale)===null||u===void 0?void 0:u.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[o.key];if(v&&typeof v=="string"){var C=v;return s!=null&&s.context&&(C=KJ(C,s.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",C)),n!==""?"[".concat(n,"] ").concat(C," ").concat(t):"".concat(C," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(o&&Tc(o)!=="object"&&BO(s)){var S=$O(s);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):VO()}const Ss=Rc("toast",()=>{const e=c=>HO(c),t=c=>{var u;if((c==null?void 0:c.apiCode)==="offline")r({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const d=HO((u=c==null?void 0:c.res)==null?void 0:u.data);r({id:c==null?void 0:c.apiCode,type:"error",message:d})}},n=$([]),o=(c,u)=>{const d=CJ[c];if(d){const h=d[u];if(h){r({id:c,type:u,message:h});return}}else r({id:c,type:u,message:c})},s=new Map,r=(c,u=5e3)=>{const d={...c,id:c.id??Date.now()+Math.random()};if(n.value.push(d),u>0){const h=Date.now(),f=setTimeout(()=>{i(d.id),s.delete(d.id)},u);s.set(d.id,{timeoutId:f,remainingTime:u,startTime:h})}};function i(c){n.value=n.value.filter(d=>d.id!==c);const u=s.get(c);u&&(clearTimeout(u.timeoutId),s.delete(c))}function a(c){const u=s.get(c);if(u){clearTimeout(u.timeoutId);const d=Date.now()-u.startTime;u.remainingTime=Math.max(0,u.remainingTime-d)}}function l(c){const u=s.get(c);if(u&&u.remainingTime>0){const d=setTimeout(()=>{i(c),s.delete(c)},u.remainingTime);u.timeoutId=d,u.startTime=Date.now()}}return{notifications:n,addNotification:r,removeNotification:i,showMessage:o,showErrorNetMessage:t,pauseAutoDismiss:a,resumeAutoDismiss:l,getErrorMessageFromResponse:e}}),pE=Rc("sortStore",()=>{const e=$({}),t=$(void 0),n={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},o={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}};return{sortingAPIConfiguration:Y(()=>{const c=e.value;return Object.values(c).filter(d=>d.sort!=="none"&&!!d.sort).map(d=>{let h;switch(d.colId){case"dateRange":h=o[d.sort];break;default:if(d.colId.includes("metric")){const[f,p]=d.colId.split("_");h={column:f,direction:d.sort,type:p}}else h={column:n[d.colId]||d.colId,direction:d.sort};break}return h})}),sorts:e,setSort:(c,u)=>{e.value={[c]:{colId:c,sort:u}}},clearSorting:()=>{e.value={}},isSortingRunning:$(!1),defaultSortStorePreferences:t,setDefaultSort:c=>{t.value=c}}}),GO=10,UO=5,Gf={number:{first:"000",step:"1"},letter:{first:"A",step:"1"}},qJ={up:{first:"Start at",step:"Increase by"},down:{first:"End at",step:"Decrease by"}},YJ=/^[0-9]$/,XJ=/^[A-Za-z]$/,WO=(e,t)=>t==="first"&&e==="letter"?XJ:YJ,ZJ=(e,t,n)=>WO(e,t).test(n),JJ=e=>e==="first"?GO:UO,QJ=e=>e&&e[0]===e[0].toLowerCase()?e.toLowerCase():e.toUpperCase(),eQ=(e,t,n)=>{const o=WO(e,t),s=Array.from(n).filter(r=>o.test(r)).join("").slice(0,JJ(t));return t==="first"&&e==="letter"?QJ(s):s},zO=(e,t)=>t!==""&&(e==="first"||Number(t)>0),tQ=e=>Array.from(e.toUpperCase()).reduce((t,n)=>t*26+(n.charCodeAt(0)-64),0),nQ=e=>{let t="",n=e;for(;n>0;){const o=(n-1)%26;t=String.fromCharCode(65+o)+t,n=Math.floor((n-1)/26)}return t},jO=({type:e,direction:t,first:n,step:o,count:s})=>{const r=Number(o)||1,i=c=>(t==="up"?c:s-1-c)*r;if(e==="number"){const c=Number(n);return Array.from({length:s},(u,d)=>String(c+i(d)).padStart(n.length,"0"))}const a=tQ(n),l=n!==""&&n[0]===n[0].toLowerCase();return Array.from({length:s},(c,u)=>{const d=nQ(a+i(u));return l?d.toLowerCase():d})},oQ="Your update is queued. Reload the table later to see the changes.",gE="Update failed.",sQ=new Set(["bulkDelete","bulkArchive","bulkUnarchive","bulkDateUpdate","bulkAssignUpdate","bulkStatusUpdate","bulkMetricUpdate","bulkRename","removeAssignee","delete_thumbnail","delete_rendition"]),rQ=(e,t,n)=>{const o=e.getRowNode(t);o&&o.setData({...o.data,...n})},iQ=(e,{currentName:t,counterValue:n})=>e.map(o=>{switch(o.type){case"text":return o.value;case"current_name":return t;case"counter":return n;default:return""}}).join(""),aQ=(e,t)=>{const n=e.find(o=>o.type==="counter");return n?jO({type:n.format,direction:n.direction==="asc"?"up":"down",first:n.value,step:n.step,count:t}):[]},KO=(e,t,n)=>Ss().addNotification({id:n,type:e,message:t}),lQ=(e,t,n={})=>{const o=Bf(),{selectionStatus:s}=ts(o),{sortingAPIConfiguration:r}=ts(pE()),i=Y(()=>s.value===Ft.CHECKED),a=Y(()=>e.selectRowData.map(X=>X.id)),l=Y(()=>e.selectRowData.length>0),{apiServices:c}=io(!1,e),u=Dn("filterParams",void 0),d=Y(()=>({workspaceId:String(e.workspaceId),itemIds:l.value&&i.value?[]:a.value,entityId:e.entityId,filterParams:u!=null&&u.value?u.value:void 0})),h=$(!0),f=$(!1);let p=null;const g=X=>{var U,K;if(!X.apiCode||!sQ.has(X.apiCode))return;const D=(U=X.res)==null?void 0:U.data;p={success:X.success,status:(K=X.res)==null?void 0:K.status,data:typeof D=="object"&&D!==null?D:void 0,error:X.error}};Qe(c,(X,D)=>{D==null||D.off("call-api",g),X==null||X.on("call-api",g)},{immediate:!0}),zn(()=>{var X;return(X=c.value)==null?void 0:X.off("call-api",g)}),Qe(()=>e.selectRowData,()=>{h.value=!1},{deep:!0,immediate:!0});const v=()=>{p=null},C=X=>{var Ae,ce;const D=p,U=D==null?void 0:D.data,K=(D==null?void 0:D.error)??X,ie=(U==null?void 0:U.message)??((ce=(Ae=K==null?void 0:K.response)==null?void 0:Ae.data)==null?void 0:ce.message),we=typeof ie=="string"&&ie.trim()?ie:gE;KO("error",we,"bulk-update-error")},S=(X,D,U,K)=>{X.length!==0&&(X.forEach(ie=>{const we=D.getRowNode(ie);we&&we.setData({...we.data,...U})}),D.refreshCells({...K.length>0?{columns:K}:{},force:!0}))},b=X=>{const D=e.gridApi;if(D){if(i.value){D.deselectAll();return}X.forEach(U=>{var K;return(K=D.getRowNode(U))==null?void 0:K.setSelected(!1)})}},y=({ids:X,apply:D,columns:U,isDelete:K=!1})=>{var te;let ie=X;X.length==0&&(ie=e.selectRowData.map(oe=>oe.id)??[]),console.log("Finishing bulk action for ids:",{ids:ie,columns:U,isDelete:K,selectedRows:e.selectRowData,lastOutcome:p});const we=p;if((we==null?void 0:we.status)!==Us.ACCEPTED){D(),K&&b(ie);return}KO("white",oQ,"bulk-update-queued");const Ae=(te=we.data)==null?void 0:te.bulk_process;let ce;typeof(Ae==null?void 0:Ae.state)=="number"?ce=Ae.state:ce=K?0:1;const G=e.gridApi;G&&(ie.forEach(oe=>rQ(G,oe,{isProcessing:{state:ce,message:typeof(Ae==null?void 0:Ae.message)=="string"?Ae.message:""}})),G.refreshCells({columns:[...U,"name"],force:!0})),(K||ce==0)&&b(ie)},E=async({request:X,apply:D,columns:U,isDelete:K=!1})=>{var Ae,ce,G;const ie=a.value,we=e.gridApi;if(!we){console.error("Grid API is not available for bulk action.");return}v();try{const te=X();if(!te)throw new Error("Bulk update service is unavailable.");await te}catch(te){console.error("Bulk action failed:",te),C(te),(Ae=t.value)==null||Ae.open();return}if((p==null?void 0:p.success)===!1){const te=p.error??new Error(gE);console.error("Bulk action failed:",te),C(te),(ce=t.value)==null||ce.open();return}y({ids:ie,columns:U,isDelete:K,apply:()=>D(ie,we)}),(G=t.value)==null||G.hide()},_=({itemIds:X,data:D,isUpdateAll:U})=>{let K=X;U&&(console.log("Bulk update for all items with data:",D),K=a.value),console.log("Handling bulk update for status with itemIds:",K,"and data:",D);const ie=e.gridApi;if(!ie){console.error("Grid API is undefined");return}y({ids:K,columns:["status"],apply:()=>{S(K,ie,{status:D},["status"])}})},x=({itemIds:X,data:D})=>{var K;const U=e.gridApi;if(!U){console.error("Grid API is undefined");return}y({ids:X,columns:["dateRange","name"],apply:()=>{let ie=X;console.log("Applying bulk date update for itemIds:",X,"with data:",D),(!X||X.length===0)&&(console.warn("No itemIds provided for bulk date update."),ie=e.selectRowData.map(we=>we.id)),ie.forEach(we=>{const Ae=U.getRowNode(we);if(Ae){const ce=[...Ae.data.dateRange||[null,null]];"startDate"in D&&D.startDate!==void 0&&(ce[0]=D.startDate?new Date(D.startDate):null),"dueDate"in D&&D.dueDate!==void 0&&(ce[1]=D.dueDate?new Date(D.dueDate):null),Ae.setData({...Ae.data,dateRange:ce})}})}}),(K=n.onUpdated)==null||K.call(n)},R=X=>{var ie;const D=e.gridApi,{id:U,value:K}=X;if(!D){console.error("Grid API is undefined");return}y({ids:a.value,columns:[`metric_${U}`,"name"],apply:()=>{S(a.value,D,{[`metric_${U}`]:K},[`metric_${U}`])}}),(ie=n.onUpdated)==null||ie.call(n)},P=X=>{const{assignees:D,type:U}=X,K=e.gridApi;if(!K){console.error("Grid API is not available for bulk update.");return}const ie=new Set(D.map(Ae=>Ae.id)),we=Ae=>{const ce=K.getRowNode(Ae);if(!ce)return;const G=ce.data.assignees||[];let te=[];switch(U){case"add":{const oe=new Set(G.map(O=>O.id));te=[...G,...D.filter(O=>!oe.has(O.id))];break}case"overwrite":te=D;break;case"remove":te=G.filter(oe=>!ie.has(oe.id));break;case"removeAll":te=[];break}ce.setData({...ce.data,assignees:te})};y({ids:a.value,columns:["assignees","name"],apply:()=>a.value.forEach(we)})},N=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.bulkDeleteItems(d.value)},isDelete:!0,columns:["name"],apply:(X,D)=>S(X,D,{isDeleted:!0,disabled:!0,isProcessing:{state:0,message:""}},[])}),I=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.bulkUnarchiveItems(d.value)},columns:["name"],apply:(X,D)=>S(X,D,{isArchived:!1},["name"])}),k=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.bulkArchiveItems(d.value)},columns:["name"],apply:(X,D)=>S(X,D,{isArchived:!0},["name"])}),A=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.deleteThumbnail(d.value)},columns:["thumbnail"],apply:(X,D)=>S(X,D,{thumbnail:null},["thumbnail"])}),M=()=>E({request:()=>{var X;return(X=c.value)==null?void 0:X.deleteRendition(d.value)},columns:["name"],apply:(X,D)=>S(X,D,{},["name"])}),V=()=>{v(),h.value=!0},B=X=>{console.trace("Bulk update response:",X),ct(()=>{h.value=!1})},z=()=>{C(),B({})},ne=(X,D)=>{const U=new Map(e.selectRowData.map(ie=>[ie.id,ie.name||""])),K=aQ(X,D.length);return D.map((ie,we)=>{const Ae=U.get(ie)??"",ce=iQ(X,{currentName:Ae,counterValue:K[we]??""});return{id:ie,from:Ae,to:ce}})},re=()=>{const X=e.gridApi;return X==null?[]:e.selectRowData.map((D,U)=>{var K;return{id:D.id,rowIndex:((K=X.getRowNode(D.id))==null?void 0:K.rowIndex)??U}}).sort((D,U)=>D.rowIndex-U.rowIndex).map(({id:D})=>D)};return{apiServices:c,selectionStatus:s,isSelectAll:i,selectedIds:a,isBulkUpdate:l,isUpdating:h,isLoading:f,handleUpdateStart:V,handleUpdatePostUpdate:B,handleUpdateFailed:z,handleUpdateBulkStatus:_,handleUpdateBulkDate:x,handleBulkUpdateMetric:R,handleUpdateNewAssignee:P,handleDelete:N,handleArchive:k,handleUnarchive:I,deleteThumbnail:A,deleteRendition:M,handleBulkUpdateName:async X=>{var Ae;if(!e.workspaceId||!e.entityId)return;const D=re(),U={item_ids:D,segments:X},K=r.value;i.value&&(delete U.item_ids,U.entity_id=e.entityId),U.sort_by=K;const ie={workspaceId:e.workspaceId,entityId:e.entityId,payload:U,filter:u!=null&&u.value?u.value:void 0},we=ne(X,D);v(),h.value=!0,f.value=!0;try{const ce=(Ae=c.value)==null?void 0:Ae.bulkRename(ie);if(!ce)throw new Error("Bulk update service is unavailable.");if(await ce,(p==null?void 0:p.success)===!1){C(p.error??new Error(gE));return}}catch(ce){C(ce);return}finally{h.value=!1,f.value=!1}y({ids:D,columns:["name"],apply:()=>{var G;const ce=e.gridApi;ce&&(we.forEach(({id:te,to:oe})=>{var O;return(O=ce.getRowNode(te))==null?void 0:O.setDataValue("name",oe)}),(G=n.onRefreshSelectedRow)==null||G.call(n))}})}}},qO=bt(tt({__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=Ns,{triggerRef:n,popupRef:o}=mo({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=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)=>(q(),ue("div",{class:ae(i.$style["status-badge-wrapper"]),style:hn({"--badge-size":`${r.size}px`,"--badge-color":s.value})},[xt(i.$slots,"default"),Ke(Ee("div",{class:ae(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[lr,r.showBadge],[L(t),{isLoading:r.loading,fullwidth:!0}]]),Ee("div",{ref_key:"popupRef",ref:o,class:ae(i.$style["badge-tooltip"])},it(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"}}]]),cd=Rc("switchStore",()=>{const e=$(null),t=Dn("switchInstance");return{openSceneHub:(s,r)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:s,commentId:r},{showLoading:!1}):t("scene_hub",{id:s,tab:"home"},{showLoading:!1})}},openPeopleInsight:s=>{if(!s){console.error("No people_id provided, defaulting to empty string");return}const r=t||e.value;if(!r)console.error("Switch instance not found");else if(window.switchApploader)window.switchApploader("people_insight",{tab:"home",id:s||""},{showLoading:!1});else throw console.error("Switch instance not found and switchApploader is not available"),new Error("Switch instance not found and switchApploader is not available");r("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),cQ=tt({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:lv()},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},switchInstance:{type:Function,default:void 0}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=jt,o=Ns,s=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=$(new Date),l=$(!0),c=$(!1),u=$(!1),d=$(null);let h=null,f=null;const p=cd(),{openPeopleInsight:g}=p,v=Y(()=>!s.private&&!c.value),C=Y(()=>{var B,z;return((B=d.value)==null?void 0:B.display_name)??((z=s.user)==null?void 0:z.name)}),S=Y(()=>{var B,z;return!v.value||!d.value?s.status:(B=d.value.private_info)!=null&&B.is_offline?"offline":(z=d.value.private_info)!=null&&z.last_active?"active":"away"}),b=Y(()=>{var B;return!!((B=d.value)!=null&&B.private_info)}),y=Y(()=>{const B=S.value;return B?i[B]:""}),E=Y(()=>{var B,z;return((z=(B=d.value)==null?void 0:B.private_info)==null?void 0:z.timezone)??s.timezone}),_=Y(()=>{if(!E.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:E.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",E.value),""}}),x=Y(()=>{var B,z,ne;return{id:s.user.id,name:C.value,initial:((B=d.value)==null?void 0:B.initial)??s.user.initial,profile_image:((z=d.value)==null?void 0:z.profile_image)??s.user.profile_image,color:((ne=d.value)==null?void 0:ne.color)??s.user.color,size:72,borderRadius:"8px"}}),R=Y(()=>{const B=ln.getInstance().getItem("BASE_URL"),z=ln.getInstance().getItem("ws.code")||"";return Zo({type:"people_insight",config:{ws_code:z,baseDomain:B,user_id:s.user.id}}).url}),{copyToClipboard:P,tooltip:N}=bk(R.value,()=>r("copyLink",s.user.id)),I=async()=>{if(!s.apiUpdateFunction){l.value=!1;return}try{const B=await s.apiUpdateFunction(s.user.id);B?(d.value=B,r("dataUpdated",B)):(c.value=!0,u.value=!0,r("dataUpdated",null))}catch(B){c.value=!0,u.value=!0,console.error("Failed to fetch user data:",B)}finally{l.value=!1}},k=()=>{A(),s.apiUpdateFunction&&s.enableAutoRefresh&&(f=setInterval(I,s.refreshInterval))},A=()=>{f!==null&&(clearInterval(f),f=null)},M=B=>{var z;if(B.ctrlKey||B.metaKey){window.open(R.value,"_blank");return}try{g(String(s.user.id))}catch{s.switchInstance?(z=s.switchInstance)==null||z.call(s,"people_insight",{tab:"home",id:s.user.id||""},{showLoading:!1}):window.open(R.value,"_blank")}},V=B=>{M(B),r("insightClick",s.user.id)};return Qe([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],k),Qt(async()=>{h=setInterval(()=>{a.value=new Date},1e4),s.apiUpdateFunction?(await I(),k()):l.value=!1}),ec(()=>{h&&clearInterval(h),A()}),(B,z)=>s.showPrivateUser&&(s.private||u.value)?(q(),ue("div",{key:0,class:ae([B.$style["info-row"],B.$style["private-badge"]])},[...z[0]||(z[0]=[Ee("span",null,"Private User",-1)])],2)):(q(),ue("div",{key:1,class:ae([B.$style["mini-people-card"],{[B.$style.loading]:l.value},"bg-skeleton"])},[Ee("div",{class:ae(B.$style["avatar-section"])},[v.value&&b.value?(q(),je(qO,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":y.value},{default:ye(()=>[me(hf,zt({readOnly:!0},x.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(q(),je(hf,zt({key:1,readOnly:!0},x.value),null,16))],2),Ee("div",{class:ae(B.$style["user-info"])},[Ee("div",{class:ae(B.$style["info-column"])},[Ke((q(),ue("span",{class:ae(B.$style["user-name"])},[nt(it(C.value),1)],2)),[[L(n),{content:C.value,delay:[1e3,0]}]]),E.value&&v.value&&b.value?(q(),ue("div",{key:0,class:ae([B.$style["info-row"],B.$style["time-row"]])},[Ke((q(),ue("div",{class:ae(B.$style["time-display"])},[me(ut,{source:"remote",src:"Globe",class:ae(B.$style["clock-icon"]),size:"10"},null,8,["class"]),Ee("span",{class:ae(B.$style["time-text"])},it(_.value)+" ("+it(E.value)+")",3)],2)),[[L(o),{isLoading:l.value,fullwidth:!0}]])],2)):Ye("",!0)],2),!e.readOnly&&v.value?(q(),ue("div",{key:0,class:ae([B.$style["info-row"],B.$style.actions])},[e.showInsightButton&&b.value?(q(),je(pt,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Lt(V,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Ye("",!0),e.showCopyLinkButton&&b.value?Ke((q(),je(pt,{key:1,variant:["icon","secondary"],size:"small",onClick:Lt(L(P),["prevent","stop"]),disabled:s.disabled},{default:ye(()=>[me(ut,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[L(n),{content:L(N),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ye("",!0)],2)):Ye("",!0)],2)],2))}}),uQ=bt(cQ,[["__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"}}]]),dQ=bt(tt({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=Po,o=jt,s=e,{isEditing:r}=sd(s),i=()=>{var h,f;const u=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=Y(()=>{var d,h;const u=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=s.params)==null?void 0:u.api)==null||d.stopEditing()},c=$();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>Ke((q(),je(pt,{class:ae(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:L(r),onClick:Lt(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:ye(()=>[me(ut,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[L(o),"More actions"],[L(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_137ge_1"}}]]),hQ=["src","width","height","alt"],ul=bt(tt({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=Ns,{getCachedValue:n,setCachedValue:o}=uf({dbName:"visual-cache-db",storeName:"visuals"}),s=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:s(r.minWidth),maxWidth:s(r.maxWidth),minHeight:s(r.minHeight),maxHeight:s(r.maxHeight),aspectRatio:r.ratio,width:s(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},c=Y(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:u,loading:d}=NI(c,"visual",l,a);return(h,f)=>Ke((q(),ue("div",{class:ae([h.$style.visualWrapper,{[h.$style.loading]:L(d)}]),style:hn(i.value)},[Ee("img",{src:L(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:hn(i.value)},null,12,hQ)],6)),[[L(t),{isLoading:L(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),fQ=["tabindex"],Oo=bt(tt({__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 o=e,s=n;Zg();const r=dm(),i=$(null),a=$("default"),l=Y(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=Y(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=Y(()=>({[r["display-wrapper"]]:!0,[r.disabled]:o.disabled,[r.readOnly]:o.readOnly,[r.error]:o.error,[r.clickable]:o.clickable,[r.active]:o.actived,[r.hovered]:o.hovered,[r.focused]:!o.readOnly&&!o.disabled&&o.focused,[r.bordered]:o.bordered})),d=()=>{var y,E;const g=((y=i.value)==null?void 0:y.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((E=i.value)==null?void 0:E.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=$("100%"),f=()=>{h.value=d()};Nh(()=>{f()}),Qt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{ct(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>(q(),ue("div",{ref_key:"rootEl",ref:i,class:ae([L(r)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:hn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[xt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),xt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),xt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,fQ))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_rxmoy_1",readOnly:"_readOnly_rxmoy_26",bordered:"_bordered_rxmoy_29",disabled:"_disabled_rxmoy_29",active:"_active_rxmoy_29",focused:"_focused_rxmoy_29",hovered:"_hovered_rxmoy_33",error:"_error_rxmoy_37",clickable:"_clickable_rxmoy_50",suffix:"_suffix_rxmoy_56",prefix:"_prefix_rxmoy_57"}}]]),pQ=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const gQ=Object.prototype.toString,mQ=e=>gQ.call(e)==="[object Object]",_i=()=>{};function vQ(e,t){function n(...o){return new Promise((s,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return"cancel"in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}function yQ(e,t={}){let n,o,s=_i,r=_i;const i=Rh(!1),a=u=>{clearTimeout(u),s(),s=_i};let l;return Object.assign(u=>{const d=Zi(e),h=Zi(t.maxWait);return n&&a(n),d<=0||h!==void 0&&h<=0?(o&&(a(o),o=void 0),i.value=!1,Promise.resolve(u())):(i.value=!0,new Promise((f,p)=>{s=t.rejectOnCancel?p:f,r=f,l=u,h&&!o&&(o=setTimeout(()=>{n&&a(n),o=void 0,i.value=!1,f(l())},h)),n=setTimeout(()=>{o&&a(o),o=void 0,i.value=!1,f(u())},d)}))},{cancel:()=>{n&&(a(n),n=void 0),o&&(a(o),o=void 0),i.value=!1,r=_i},flush:()=>{if(i.value){n&&(clearTimeout(n),n=void 0),o&&(clearTimeout(o),o=void 0),i.value=!1;const u=r;s=_i,r=_i,u(l())}},isPending:Vr(i)})}function mE(e){return Array.isArray(e)?e:[e]}function wQ(e,t=200,n={}){return vQ(yQ(t,n),e)}function CQ(e,t,n){return Qe(e,t,{...n,immediate:!0})}const YO=pQ?window:void 0;function Uf(e){var t;const n=Zi(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function vE(...e){const t=(o,s,r,i)=>(o.addEventListener(s,r,i),()=>o.removeEventListener(s,r,i)),n=Y(()=>{const o=mE(Zi(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return CQ(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>Uf(r)))!==null&&o!==void 0?o:[YO].filter(r=>r!=null),mE(Zi(n.value?e[1]:e[0])),mE(L(n.value?e[2]:e[1])),Zi(n.value?e[3]:e[2])]},([o,s,r,i],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const c=mQ(i)?{...i}:i,u=o.flatMap(d=>s.flatMap(h=>r.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function yE(e,t,n={}){const{window:o=YO,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!o)return a?{stop:_i,cancel:_i,trigger:_i}:_i;let l=!0;const c=v=>Zi(s).some(C=>{if(typeof C=="string")return Array.from(o.document.querySelectorAll(C)).some(S=>S===v.target||v.composedPath().includes(S));{const S=Uf(C);return S&&(v.target===S||v.composedPath().includes(S))}});function u(v){const C=Zi(v);return C&&C.$.subTree.shapeFlag===16}function d(v,C){const S=Zi(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(y=>y.el===C.target||C.composedPath().includes(y.el))}const h=v=>{const C=Uf(e);if(v.target!=null&&!(!(C instanceof Element)&&u(e)&&d(e,v))&&!(!C||C===v.target||v.composedPath().includes(C))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[vE(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),vE(o,"pointerdown",v=>{const C=Uf(e);l=!c(v)&&!!(C&&!v.composedPath().includes(C))},{passive:!0}),i&&vE(o,"blur",v=>{setTimeout(()=>{const C=Uf(e);let S=o.document.activeElement;for(;S!=null&&S.shadowRoot;)S=S.shadowRoot.activeElement;(S==null?void 0:S.tagName)==="IFRAME"&&!(C!=null&&C.contains(o.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 bQ=["value","placeholder","disabled","readonly","inputmode","maxlength"],Wf=bt(tt({__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:{},showClear:{type:Boolean,default:!0},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 o=Po,s=jt,r=e,i=n,a=$(null),l=$(r.modelValue||"");Qe(l,()=>{i("onValidation",l.value)});const c=$(!1),u=$(r.modelValue||"");Qe(()=>r.modelValue,D=>{l.value=D||"",u.value=D||""});const d=Y(()=>{var D;return((D=l.value)==null?void 0:D.length)>0}),h={text:D=>D.slice(0,r.maxLength||255),number:D=>{let U=D.replace(/[^\d.-]/g,"");const K=U.split(".");K.length>2&&(U=K[0]+"."+K.slice(1).join("")),U=U.replace(/-/g,(G,te)=>te===0?G:"");const we=U.startsWith("-")?"-":"",ce=U.replace("-","").split(".");return ce[0].length>17&&(ce[0]=ce[0].substring(0,17)),r.maxDecimalChar!==void 0&&ce.length>1&&(ce[1]=ce[1].substring(0,r.maxDecimalChar)),U=we+ce.join("."),U},email:D=>D.replace(/\s/g,"").slice(0,r.maxLength||255),url:D=>D.replace(/\s/g,"").slice(0,r.maxLength||255),tel:D=>D.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},f=D=>{const U=h[r.type];return U?U(D):D},p=wQ(D=>{r.autoEmit&&(i("update:modelValue",D),i("input",D))},r.debounceDelay),g=D=>{const U=D;if(r.disabled||r.readOnly){U.preventDefault();return}const K=U.target,ie=K.selectionStart||0,we=l.value,Ae=f(K.value);we!==Ae&&(l.value=Ae,i("input",Ae),r.autoEmit&&p(Ae),K.value!==Ae&&(K.value=Ae,ct(()=>{let ce=ie;if(Ae.length<K.value.length)ce=ie;else{const G=Ae.length-we.length;ce=ie+G}ce=Math.max(0,Math.min(ce,Ae.length)),K.setSelectionRange(ce,ce)})))},v=D=>{if(r.disabled||r.readOnly){D.preventDefault();return}c.value=!0;const U=l.value;l.value="",i("update:modelValue",""),i("clear"),U!==""&&i("change",""),D.preventDefault(),D.stopImmediatePropagation(),D.stopPropagation(),ct(()=>{var K;(K=a.value)==null||K.focus(),setTimeout(()=>{c.value=!1},100)})},C=D=>{r.disabled||r.readOnly||(i("focus",D),r.selectOnFocus&&ct(()=>{D.target.select()}))},S=D=>{if(c.value)return;const K=D.target.value;r.autoEmit||i("update:modelValue",K),u.value!==K&&(i("change",K),u.value=K),i("blur",K,D)},b=D=>{setTimeout(()=>{ct(()=>{const K=D.target.value;i("enter",K,D),i("enterValue",K),r.submitOnEnter&&(D.preventDefault(),r.autoEmit||i("update:modelValue",K),u.value!==K&&(i("change",K),u.value=K))})},1e3)},y=D=>{const U=D.target,K=U.value;if(i("escape",K,D),D.preventDefault(),D.stopImmediatePropagation(),D.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&U.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&U.blur()},E=D=>{const K=D.target.value;i("tab",K,D),r.autoEmit||(i("update:modelValue",K),u.value!==K&&(i("change",K),u.value=K))},_=(D,U,K)=>D===""?!0:D==="."?K>0:new RegExp(`^\\d{0,${U}}(\\.\\d{0,${K}})?$`).test(D),x=D=>{if(i("keydown",D),D.key===" "&&D.stopPropagation(),r.type==="number"){if(D.key==="e"||D.key==="E"){D.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(D.key)||D.ctrlKey||D.metaKey||D.altKey)){if(Number.isNaN(Number(D.key))&&D.key!=="."&&D.key!=="-"){D.preventDefault();return}const ie=l.value+D.key;if(!_(ie,17,r.maxDecimalChar||2)){D.preventDefault();return}}}D.key==="Escape"?y(D):D.key==="Enter"?b(D):D.key==="Tab"?E(D):(D.key==="ArrowUp"||D.key==="ArrowDown")&&r.type==="number"&&D.preventDefault()},R=D=>{i("keyup",D)},P=D=>{if(r.disabled||r.readOnly){D.preventDefault();return}i("paste",D)},N=D=>{if(r.disabled||r.readOnly){D.preventDefault();return}i("cut",D)},I=D=>{i("select",D)},k=`input-text-${Math.random().toString(36).substr(2,9)}`,A=$(!1),M=Y(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});Qe(()=>l.value,D=>{r.validatorFnc?A.value=!!D&&!r.validatorFnc(D):A.value=!1});const V=$(null),B=Y(()=>({disabled:r.disabled,readOnly:r.readOnly,error:A.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:V,bordered:!0})),{argsMain:z,isHover:ne,isFocus:re}=To(B);t({triggerFocus:()=>{ct(()=>{var D;(D=a.value)==null||D.focus()})},focus:()=>{ee()},blur:()=>{ct(()=>{var D;(D=a.value)==null||D.blur()})},select:()=>{ct(()=>{var D;(D=a.value)==null||D.select()})},setSelectionRange:(D,U)=>{ct(()=>{var K;(K=a.value)==null||K.setSelectionRange(D,U)})},getValue:()=>l.value,setValue:D=>{l.value=f(D),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const ee=()=>{!r.disabled&&!r.readOnly&&ct(()=>{var D;(D=a.value)==null||D.focus()})},X=Y(()=>re.value&&d.value);return(D,U)=>(q(),ue("div",{class:ae([D.$style["input-wrapper"],"input-editor"]),onClick:ee},[Ke((q(),je(Oo,zt(L(z),{ref_key:"wrapperRef",ref:V,class:[D.$style["input-box"],{[D.$style["is-hovered"]]:L(ne),[D.$style["is-focused"]]:L(re),[D.$style["has-input"]]:d.value,[D.$style["is-editting"]]:X.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:ye(()=>[xt(D.$slots,"prefix")]),suffix:ye(()=>[d.value&&!r.disabled&&!r.readOnly&&r.showClear?xt(D.$slots,"clear",{},()=>[Ke((q(),je(pt,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Lt(v,["prevent","stop"]),size:18,rounded:!0,class:ae(["wrapper-suffix",D.$style["clear-button"]])},{default:ye(()=>[me(ut,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[L(s),{content:"Clear",contentClass:"extra-padding"}]])],void 0,0):xt(D.$slots,"suffix",{},void 0,void 0,1)]),default:ye(()=>[Ee("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:ae([D.$style["column-config__input"]]),id:k,disabled:e.disabled,readonly:e.readOnly,inputmode:M.value,maxlength:r.maxLength,onInput:g,onFocus:C,onBlur:S,onKeydown:x,onKeyup:R,onPaste:P,onCut:N,onSelect:I},null,42,bQ)]),_:3},16,["class","bordered"])),[[L(o),r.focusIndex]]),A.value?xt(D.$slots,"error",{},void 0,void 0,0):Ye("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_1g7uk_1","is-disabled":"_is-disabled_1g7uk_16","is-readonly":"_is-readonly_1g7uk_16","is-hovered":"_is-hovered_1g7uk_16","is-focused":"_is-focused_1g7uk_20","column-config__input":"_column-config__input_1g7uk_43","clear-button":"_clear-button_1g7uk_58"}}]]),SQ={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},wE=tt({__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 o=e,s=n,r=$(null),i=mr(c=>{s("update:modelValue",c),s("search",c)},bi),a=()=>{s("update:modelValue",""),s("clear"),ct(()=>{var c;(c=r.value)==null||c.focus()})},l=$(o.modelValue);return t({focus:()=>{var c;(c=r.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(q(),je(Wf,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:L(i),onClear:a,onCancel:u[1]||(u[1]=d=>s("cancel")),"auto-emit":!0},{prefix:ye(()=>[Ee("div",SQ,[me(ut,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),dl=bt(tt({name:"ListItem",directives:{tooltip:jt,focusable:Po},__name:"ListItem",props:{itemWidth:{default:"250px"},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 o=Po,s=e,r=n,i=$(!1),a=$(!1);function l(E){if(!E||typeof E!="object")return!1;const _=E;return typeof _.name=="string"&&typeof _.id=="string"&&typeof _.initial=="string"}const c=Y(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!y.prefix),u=Y(()=>!!y.suffix||s.danger&&i.value),d=Y(()=>{var E;return s.type==="status"&&typeof((E=s.data)==null?void 0:E.color)=="string"?{backgroundColor:s.data.color,border:Om(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),h=dm(),f=Y(()=>({[h.active]:s.selected??!1,[h.disabled]:s.disabled??!1,[h.hover]:s.hover??!1,[h.clickable]:(s.clickable??!0)&&!s.disabled,[h.danger]:s.danger??!1,[h["has-prefix"]]:c.value,[h["has-suffix"]]:u.value,[h.readOnly]:s.readOnly}));Y(()=>({content:"Cancel",...b})),Y(()=>({content:"Confirm",theme:"warning",...b}));function p(E){return{name:E.name,initial:E.initial,id:E.id,profile_image:E.profile_image??null,color:E.color,size:24}}function g(){i.value=!1}function v(E){E?r("click",E):(s.clickable??!0)&&(r("update:selected",!s.selected),r("select",!s.selected))}function C(E){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||v(E);r("handleClick",E)}}const S=()=>{i.value?g():r("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),y=Zg();return Qe(()=>s.show,E=>{E===!1&&(i.value=!1)}),t({select:()=>{C(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(E,_)=>{const x=Lh("tooltip");return Ke((q(),je(pt,{variant:["menu-item",e.danger?"danger":"menu-item"],class:ae([E.$style["list-item"],f.value]),onHandleClick:C,onMouseenter:_[0]||(_[0]=R=>a.value=!0),onMouseleave:_[1]||(_[1]=R=>a.value=!1),onEscape:S,style:hn({width:s.itemWidth})},{default:ye(()=>[c.value?(q(),ue("div",{key:0,class:ae(E.$style["list-item__prefix"])},[xt(E.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(q(),je(ut,{key:0,src:e.icon,source:"remote",class:ae(E.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(q(),ue("div",{key:1,class:ae(E.$style["status-indicator"]),style:hn(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(q(),je(hf,zt({key:2},p(e.data),{class:E.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ye("",!0)])],2)):Ye("",!0),Ee("div",{class:ae(E.$style["list-item__label"])},[xt(E.$slots,"label",{selected:e.selected},()=>[nt(it(e.label),1)])],2),u.value?(q(),ue("div",{key:1,class:ae(E.$style["list-item__suffix"])},[xt(E.$slots,"suffix",{item:E.$props,hovered:a.value},()=>[e.danger&&i.value?(q(),ue("div",{key:0,class:ae(E.$style["confirm-action"])},[Ke((q(),je(pt,{variant:["tertiary","icon","danger"],size:"small",onClick:Lt(g,["stop","prevent"])},{default:ye(()=>[me(ut,{src:"Xmark",source:"remote"})]),_:1})),[[L(o),`${s.focusIndex}.0`],[x,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((q(),je(pt,{variant:["danger","primary","icon"],size:"small",onClick:Lt(v,["stop","prevent"])},{default:ye(()=>[me(ut,{src:"Check",source:"remote"})]),_:1})),[[L(o),`${s.focusIndex}.1`],[x,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)])],2)):Ye("",!0)]),_:3},8,["variant","class","style"])),[[L(o),s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_iekfz_1",disabled:"_disabled_iekfz_17",danger:"_danger_iekfz_24","has-prefix":"_has-prefix_iekfz_27","has-suffix":"_has-suffix_iekfz_27",clickable:"_clickable_iekfz_41",readOnly:"_readOnly_iekfz_44",hover:"_hover_iekfz_48",active:"_active_iekfz_54","list-item__prefix":"_list-item__prefix_iekfz_79","list-item__label":"_list-item__label_iekfz_87","list-item__suffix":"_list-item__suffix_iekfz_101","status-indicator":"_status-indicator_iekfz_108","item-icon":"_item-icon_iekfz_114","arbo-icon-state":"_arbo-icon-state_iekfz_119","item-avatar":"_item-avatar_iekfz_122","confirm-action":"_confirm-action_iekfz_131"}}]]),EQ=["aria-activedescendant"],_Q=["innerHTML"],RQ=10,fa=bt(tt({__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"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=jt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=$(""),l=$(-1),c=$(null),u=$(null),d=$(new Map),h=Y(()=>DS(a.value)),f=()=>{const D=h.value;if(!D||D.length<r.minQueryLength)return r.options;if(d.value.has(D))return d.value.get(D);const U=r.options.map(K=>({item:K,score:FY(` ${K.label} `,D)})).filter(({score:K})=>K>0).sort((K,ie)=>ie.score-K.score).map(({item:K})=>K);return d.value.set(D,U),U},p=$([]);Qe(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Y(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=mr(D=>{a.value=D,l.value=-1,i("search",D)},bi),C=async D=>{ee.value=0,await v(D||""),ee.value=1},S=D=>a.value?OY(D,a.value):D,b=D=>{const K={[s.ARROW_DOWN]:()=>y(D),[s.ARROW_UP]:()=>E(D),[s.ENTER]:()=>R(D),[s.ESCAPE]:()=>P(D),[s.TAB]:()=>N(D)}[D.key];K&&K()},y=D=>{D.preventDefault(),_(1)},E=D=>{D.preventDefault(),_(-1)},_=D=>{const U=p.value.length;if(U===0)return;let K;D>0?K=(l.value+1)%U:l.value>0?K=l.value-1:K=U-1,l.value=K,x()},x=()=>{ct(()=>{var U;const D=(U=u.value)==null?void 0:U.querySelectorAll('[role="menuitem"]')[l.value];D==null||D.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},R=D=>{if(D.preventDefault(),l.value>=0&&l.value<p.value.length){const K=p.value[l.value];I(K,D)}},P=D=>{D.preventDefault(),A()},N=D=>{i("tab",D)},I=(D,U)=>{!D||D.disabled||(i("select",D,U),l.value=-1,A())},k=D=>{D>=0&&D<p.value.length&&(l.value=D)},A=()=>{i("close")},M=()=>{if(!g.value||!u.value)return;const{scrollTop:D,clientHeight:U,scrollHeight:K}=u.value;K-(D+U)<=RQ&&i("loadMore")},V=()=>{var D,U,K;(D=u.value)==null||D.addEventListener("scroll",M),(K=(U=ne.value)==null?void 0:U.$el)==null||K.addEventListener("keydown",b)},B=()=>{var D,U,K;(D=u.value)==null||D.removeEventListener("scroll",M),(K=(U=ne.value)==null?void 0:U.$el)==null||K.removeEventListener("keydown",b)};Qt(()=>{V()}),zn(()=>{B()}),Qe(()=>r.loading,D=>{!D&&p.value.length>0&&(l.value=-1)});const z=D=>D?Array.isArray(r.selectedId)?r.selectedId.includes(String(D.id)):r.selectedId==D.id:!1,ne=$(null);Qe(l,()=>{x()});const re=()=>{ct(()=>{var D;(D=ne.value)==null||D.focus()})};t({focus:()=>{ct(()=>{var D;(D=ne.value)==null||D.focus()})},reset:()=>{var D;(D=ne.value)==null||D.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:A,clearSearch:()=>{a.value=""},scrollTo:D=>{u.value&&(u.value.scrollTop=D)},selectIndex:D=>{D>=0&&D<p.value.length&&(l.value=D,x())}});const ee=$(0);Qe([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const D=r.options.length>0&&p.value.length>0,U=!D&&a.value.length>0,K=!D&&a.value.length===0;r.loading?ee.value=0:D?ee.value=1:U?ee.value=2:K&&(ee.value=3)},{immediate:!0,deep:!0});const X=()=>{i("cancel")};return(D,U)=>(q(),ue("datalist",{ref_key:"searchListRef",ref:c,class:ae([D.$style["search-list"],ee.value===3||ee.value===2?D.$style.empty:"",p.value.length>8?D.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:hn({width:e.itemWidth||e.width})},[me(wE,{ref_key:"searchBoxRef",ref:ne,modelValue:a.value,"onUpdate:modelValue":U[0]||(U[0]=K=>a.value=K),class:ae(D.$style["search-box"]),disabled:e.loading,onSearch:C,onClear:U[1]||(U[1]=K=>C("")),onCancel:X},null,8,["modelValue","class","disabled"]),Ee("div",{ref_key:"popupRef",ref:u,class:ae(D.$style["list-container"])},[xt(D.$slots,"extra-item",{query:a.value,isEmpty:ee.value===3||ee.value===2,isLoading:r.loading}),(q(!0),ue(kt,null,An(p.value,(K,ie)=>Ke((q(),ue("div",{key:`${K.id}-${ie}`,role:"menuitem"},[xt(D.$slots,"item",{item:K,index:ie,selectedIndex:l.value,isSelected:z,handleSelect:I,handleItemHover:k,getHighlightedLabel:S,query:a.value,idx:ie,focused:l.value==ie,focus:re},()=>[K.hide?Ye("",!0):(q(),je(dl,zt({key:0,ref_for:!0},K,{hover:ie===l.value,selected:z(K),type:K.type,id:`item-${ie}`,"aria-selected":ie===l.value,onClick:we=>I(K,we),onMouseover:we=>k(ie),onEscape:A,itemWidth:e.itemWidth||e.width}),{prefix:ye(()=>[xt(D.$slots,"prefix-item",{item:K})]),label:ye(()=>[a.value?Ke((q(),ue("span",{key:0,class:ae(D.$style.match),innerHTML:S(K.label)},null,10,_Q)),[[L(o),{content:K.label,delay:[1e3,0]}]]):Ke((q(),ue("span",{key:1,class:ae(D.$style["item-label"])},[nt(it(K.label),1)],2)),[[L(o),{content:K.label,delay:[1e3,0]}]])]),suffix:ye(({hovered:we})=>[xt(D.$slots,"action",{item:K,isHovered:ie===l.value,hovered:we,selected:l.value==ie})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[lr,ee.value===1]])),128)),ee.value===0?xt(D.$slots,"loading-more",{},()=>[(q(),ue(kt,null,An(8,K=>Ee("div",{class:ae(D.$style["loading-more"]),key:K},[Ee("div",{class:ae(D.$style["loading-skeleton"])},null,2),Ee("div",{class:ae(D.$style["loading-skeleton"])},null,2)],2)),64))],void 0,0):Ye("",!0),ee.value===2?(q(),ue("div",{key:1,class:ae(D.$style["no-results"])},[xt(D.$slots,"empty",{query:a.value},()=>[Ee("div",{class:ae(D.$style["no-results-content"])},[...U[2]||(U[2]=[Ee("div",null,[nt(" No results. "),Ee("br"),nt(" Try another search. ")],-1)])],2)])],2)):Ye("",!0),ee.value===3?(q(),ue("div",{key:2,class:ae(D.$style["no-results"])},[xt(D.$slots,"empty-list",{},()=>[Ee("div",{class:ae(D.$style["no-results-content"])},[...U[3]||(U[3]=[Ee("div",null,"No items available.",-1)])],2)])],2)):Ye("",!0),xt(D.$slots,"footer")],2)],14,EQ))}}),[["__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"}}]]),Dc=tt({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=v6,n=e,o=$(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),r=$(s());Qe(()=>n,()=>{setTimeout(()=>{ct(()=>{o.value=n.appendTo||void 0,r.value=s()})},50)},{immediate:!0,deep:!0});const i=Y(()=>ln.getInstance().getItem("user.ws_user_role_id")),a=Y(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial,isMe:n.user.id===i.value}));return(l,c)=>Ke((q(),je(hf,fU(S1(a.value)),null,16)),[[L(t),r.value]])}}),TQ={class:"avatar-wrapper"},DQ={class:"assignee-label"},xQ=bt(tt({__name:"AssigneeItem",props:{user:{},hovered:{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=jt,o=e,s=Y(()=>({name:o.user.name,id:o.user.id,profile_image:o.user.profile_image,color:{bgColor:o.user.color.bgColor,textColor:o.user.color.textColor},initial:o.user.initial})),r=Zg(),i=Y(()=>{if(!a.value&&!o.hover&&!o.focused||!r.actions)return 0;let l=0;const c=u=>{u.forEach(d=>{d.type===kt&&Array.isArray(d.children)?c(d.children):d.type!==so&&d.type!==ja&&l++})};return c(r.actions()),l}),a=$(!1);return(l,c)=>(q(),ue("div",{class:ae(["assignee-selector-item",{hovered:a.value||o.hovered,disabled:o.disabled,selected:o.selected,single:i.value==0,focused:o.focused}]),style:hn({"--actions-count":i.value}),onMouseenter:c[0]||(c[0]=u=>a.value=!0),onMouseleave:c[1]||(c[1]=u=>a.value=!1)},[Ee("div",TQ,[me(Dc,{user:s.value,"show-profile":!0,"append-to":o.appendTo,"api-update-function":o.apiUpdateFunction},null,8,["user","append-to","api-update-function"]),o.multipleSelect?(q(),ue("div",{key:0,class:ae(["avatar-indicator",[o.selected?"remove":"add"]])},[o.selected?(q(),je(ut,{key:0,src:"CircleXMark"})):(q(),je(ut,{key:1,src:"CirclePlus"}))],2)):Ye("",!0)]),Ke((q(),ue("div",DQ,[xt(l.$slots,"name",{},()=>[nt(it(o.user.name),1)],!0)])),[[L(n),{content:o.user.name,delay:[1e3,0]}]]),a.value||o.hovered||o.focused?xt(l.$slots,"actions",{},void 0,!0,0):Ye("",!0)],38))}}),[["__scopeId","data-v-4de522be"]]),IQ={class:"unassign-icon"},CE=bt(tt({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,o=()=>{n("click")};return(s,r)=>(q(),je(L(pt),{variant:"menu-item",onClick:o,actived:e.actived,style:hn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:ye(()=>[Ee("div",IQ,[xt(s.$slots,"icon",{},()=>[r[0]||(r[0]=Ee("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("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:ye(()=>[xt(s.$slots,"label",{},()=>[nt(it(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),AQ=["innerHTML"],XO=20,ZO=bt(tt({__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 o=jt,s=e,{id:r}=Ng(s),i=n,a=K=>{var we,Ae;const ie=(Ae=(we=s.params)==null?void 0:we.api)==null?void 0:Ae.getRowNode(String(r.value));ie==null||ie.setDataValue("assignees",Wm(K.assignees)),U("updated",K)},l=$(!1),c=$(!1),u=$(null),d=$(1),h=$(!0),f=$(0),p=$(""),g=Dn("bulkUpdate",$(!1)),v=Dn("isSelectAll",$(!1)),C=Y(()=>{var K;return g.value&&v.value?[]:(K=s.ids)!=null&&K.length?s.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:y,assigneeList:E,mergedOptions:_,selectedUserIds:x}=gv({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{U("update-failed")}},C),{apiServices:R}=io(!g.value,s),P=Dn("workspaceId"),N=async(K=1,ie="",we=!1)=>{var ce,G,te,oe,O,Q;if(!R.value)throw console.error("API service or item identifiers are undefined",R.value),new Error("API service or item identifiers are undefined");if(we?c.value=!0:l.value=!0,u.value=null,!((ce=R.value)!=null&&ce.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");const Ae=(s.ids??(s.id?[s.id]:[])).map(String);try{let se;Ae.length==0?se=await((G=R.value)==null?void 0:G.getEntityUserRoles({workspaceId:String(P),page:K,per_page:XO,display_name_like:ie.trim(),entity_ids:String(s.entityId)})):se=await((te=R.value)==null?void 0:te.multipleAssignableUser({workspaceId:String(P),itemIds:Ae,page:K,perPage:XO,q:ie.trim(),entityId:String(s.entityId)}));const ve=((oe=Yu(se.data))==null?void 0:oe.map(pv))??[];E.value=we?Mu(E.value,ve,"id"):ve,f.value=se.meta.total,h.value=(((O=se==null?void 0:se.meta)==null?void 0:O.current_page)||0)<(((Q=se==null?void 0:se.meta)==null?void 0:Q.last_page)||0),d.value=K}catch(se){console.error("Error fetching assignable users:",se),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},I=()=>{!c.value&&h.value&&N(d.value+1,p.value,!0)},k=mr(async K=>{p.value=K,await N(1,K,!1)},bi),A=()=>N(1,p.value,!1);Qt(()=>{var K;(K=V.value)==null||K.focus()}),t({getValue:()=>{var K;return(K=_.value.find(ie=>ie.selected))==null?void 0:K.value},refresh:A,clearInternal:()=>{x.value=[]},focus:()=>{var K;(K=V.value)==null||K.focus()}});const M=()=>{const K=ln.getInstance().getItem("BASE_URL"),ie=Zo({type:"access_setting",config:{baseDomain:K,ws_code:s.workspaceId,entity_id:P}}).url;window.open(ie,"_blank")},V=$(null);Qt(()=>{ct(()=>{var K;(K=V.value)==null||K.focus()})}),Qe([()=>s.id,()=>s.workspaceId],()=>{N()},{deep:!0,immediate:!0});const B=K=>{var we;const ie=ln.getInstance().getItem("ws.code");return((we=R.value)==null?void 0:we.getUserInformation(ie,K))||Promise.resolve(null)},z=async(K,ie,we)=>{ie.preventDefault(),ie.stopPropagation(),ie.stopImmediatePropagation(),U("update-start");try{const Ae=await y(K);if(Ae)U("update-completed",Ae);else throw new Error("Failed to update assignees")}catch(Ae){U("update-failed"),console.error("Error updating assignees:",Ae)}},ne=async()=>{try{U("update-start");const K=await S();if(K)U("update-completed",K);else throw new Error("Failed to unassign all assignees")}catch(K){U("update-failed"),console.error("Error unassigning all assignees:",K)}finally{}},re=async K=>{try{U("update-start");const ie=await b(K);if(ie)U("update-completed",ie);else throw new Error("Failed to replace assignees")}catch(ie){U("update-failed"),console.error("Error replacing assignees:",ie)}finally{}},ee=()=>{var K,ie;i("cancel"),(ie=(K=s.params)==null?void 0:K.api)==null||ie.stopEditing()};di("popupAttachRef",V);const X=$(),D=$(!1),U=(K,ie)=>{switch(K){case"updated":i("updated",ie);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed",ie);break}};return Qt(()=>{ct(()=>{setTimeout(()=>{D.value=!0},50)})}),(K,ie)=>(q(),ue("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:X},[me(fa,zt({"selected-id":L(x)},{...s},{options:L(_),loading:l.value,ref_key:"popupRef",ref:V,"loading-more":c.value,"has-more":h.value,onSelect:ie[0]||(ie[0]=(we,Ae)=>{z(we,Ae)}),"data-wrapper":"true",onSearch:L(k),onLoadMore:I,onCancel:ee,onClose:ee}),Vh({"extra-item":ye(({isEmpty:we,isLoading:Ae})=>[!we&&!Ae?(q(),je(CE,{key:0,onClick:ne,actived:!1,label:"Unassign"},{icon:ye(()=>[me(ut,{src:"UserXMark",source:"remote"})]),_:1})):Ye("",!0)]),item:ye(({item:we,selectedIndex:Ae,isSelected:ce,handleItemHover:G,getHighlightedLabel:te,query:oe,idx:O,focused:Q})=>[me(xQ,{user:we.data,"multiple-select":!0,"append-to":X.value,isMe:!1,hover:O===Ae,selected:ce(we),focused:Q,onClick:Lt(se=>z(we,se,"click"),["stop","prevent"]),onMouseover:se=>G(O),"api-update-function":B},{name:ye(()=>[oe?Ke((q(),ue("span",{key:0,class:ae([K.$style["item-label"],K.$style.match]),style:{flex:"1"},innerHTML:te(we.label)},null,10,AQ)),[[L(o),{content:we.label}]]):Ke((q(),ue("span",{key:1,class:ae(K.$style["item-label"]),style:{flex:"1"}},[nt(it(we.label),1)],2)),[[L(o),{content:we.label}]])]),actions:ye(()=>[Ke((q(),je(pt,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:Lt(se=>{var ve;return re((ve=we.data)==null?void 0:ve.id)},["stop"])},{default:ye(()=>[me(ut,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[L(o),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":ye(()=>[Ee("div",{class:ae(K.$style["empty-state"])},[ie[3]||(ie[3]=nt(" No assignee available. ",-1)),ie[4]||(ie[4]=Ee("br",null,null,-1)),me(pt,{onClick:M,variant:["tertiary"],size:"small"},{default:ye(()=>[...ie[2]||(ie[2]=[nt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:ye(()=>[Ee("div",{class:ae(K.$style["error-message"])},[nt(it(u.value)+" ",1),me(pt,{onClick:A,size:"small"},{default:ye(()=>[...ie[1]||(ie[1]=[nt(" 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"}}]]),PQ={key:0,class:"inner"},zf=bt(tt({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const o=e,s=$(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:c,show:u}=mo({toggleOnClick:!0,zIndex:2,disabled:o.disabled,placement:"top",appendTo:s.value||void 0}),d=$(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=Uo({isShow:!1,isRender:!1});Qt(()=>{var C;const v=d.value instanceof HTMLElement?d.value:(C=d.value)==null?void 0:C.$el;v&&v.addEventListener("keydown",h)}),zn(()=>{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 Qe(()=>a.value,(v,C)=>{v?ct(()=>{a.value&&g(!0,!0)}):f.isShow=!1,p("onVisibleChange",v,C)}),t({hide:()=>{console.log(" "),l(),g(!1,!0)},isVisible:a,open:()=>{u(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),(v,C)=>(q(),ue("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:s},[Ee("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[xt(v.$slots,"trigger",{isVisible:L(a),hide:L(l),disabled:o.isUpdating||o.disabled,popupRef:L(i),triggerRef:L(r),toggle:L(c)},void 0,!0)],512),Ee("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?Ke((q(),ue("div",PQ,[xt(v.$slots,"popup",{isVisible:L(a),hide:L(l),popupRef:L(i),triggerRef:L(r),toggle:L(c),open:L(u)},void 0,!0)],512)),[[lr,f.isShow]]):Ye("",!0)],512)],512))}}),[["__scopeId","data-v-af84b00b"]]),kQ=tt({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;di("bulkUpdate",!0);const o=$(!1),s=t,r=$(null),i=()=>{var d;o.value=!0,s("update-start"),(d=l.value)==null||d.hide()},a=(d,h)=>{var f,p;o.value=!1,d?(s("update-completed",h),(f=l.value)==null||f.destroy()):(s("update-failed"),(p=l.value)==null||p.open())},l=$(null),c=d=>{var h;s("update",d),(h=r.value)==null||h.clearInternal()},u=(d,h)=>{ct(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return(d,h)=>(q(),je(zf,{ref_key:"wrapperRef",ref:l,isUpdating:o.value,disabled:n.disabled||o.value,onOnVisibleChange:u},{trigger:ye(({hide:f,disabled:p})=>[me(pt,{variant:n.variant,loading:o.value,disabled:p,onEscape:f},{default:ye(()=>[me(ut,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=nt(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ye(({hide:f})=>[me(ZO,zt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:c,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0,p)),onCancel:f}),null,16,["ids","onCancel"])]),default:ye(()=>[h[3]||(h[3]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),jf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],FQ=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),hl=(e,t)=>{const n=o=>{var s,r;if(o.key==="Tab"){const i=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let c=jf.indexOf(l);const u=i?-1:1;for(const d of jf){c=(c+u+jf.length)%jf.length;const h=jf[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(r=o.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(FQ.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},OQ=["aria-label"],MQ=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],NQ={style:{flex:"1"}},LQ=bt(tt({__name:"MainCalendar",props:zD({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:zD(["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 o=jt,s=$(null),r=e,i=Y(()=>r.startDate&&r.endDate),a=XW(e,"tracingCase"),l=n,c=$(r.year),u=$(r.month);Qe(()=>[r.year,r.month],([D,U])=>{c.value=D,u.value=U});const d=Y(()=>St.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),h=Y(()=>St.now().setZone(r.timezone)),f=Y(()=>r.startDate?St.fromJSDate(r.startDate,{zone:r.timezone}):null),p=Y(()=>r.endDate?St.fromJSDate(r.endDate,{zone:r.timezone}):null),g=$(f.value),v=$(p.value),C=$(f.value),S=$(p.value);Qe([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),y=Y(()=>r.requireConfirm?v.value:p.value);Qe(()=>r.activeField,D=>{const U=D==="start"?b.value:y.value;U&&(c.value=U.year,u.value=U.month)}),Qe(()=>{var D,U;return[(D=b.value)==null?void 0:D.toISODate(),(U=y.value)==null?void 0:U.toISODate(),r.activeField]},()=>{const D=r.activeField==="start"?b.value:y.value;D&&(D.year!==c.value||D.month!==u.value)&&(c.value=D.year,u.value=D.month)});function E(D){return D.setZone("utc")}const _=$("");function x(D){_.value=D.toISODate()||"",ct(()=>{const U=document.querySelector(`.arbo-calendar-day[data-date="${_.value}"]`);U==null||U.focus()})}Qe(()=>{var D,U;return[c.value,u.value,r.activeField,(D=b.value)==null?void 0:D.toISODate(),(U=y.value)==null?void 0:U.toISODate()]},()=>{const D=r.activeField==="start"?b.value:y.value;let U;D&&D.year===c.value&&D.month===u.value?U=D:b.value&&b.value.year===c.value&&b.value.month===u.value?U=b.value:U=h.value,x(U)});function R(D){return D.toFormat("d")}const P=Y(()=>{const D=St.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}),U=D.weekday,K=r.weekStart===1?(U+6)%7:U%7;let ie=D.minus({days:K});const we=[],Ae=Ku.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),ce=dm();for(let te=0;te<42;te++){const oe=[];ie.month!==u.value&&oe.push(ce["is-outside"]),ie.hasSame(h.value,"day")&&oe.push(ce["is-today"]),b.value&&ie.hasSame(b.value,"day")&&oe.push(ce["is-selected-start"]),y.value&&ie.hasSame(y.value,"day")&&oe.push(ce["is-selected-end"]),b.value&&y.value&&ie>b.value&&ie<y.value&&oe.push(ce["is-in-range"]);const O=R(ie),Q=Ae[ie.weekday-1]||"";we.push({dt:ie,iso:ie.toISODate()||"",label:ie.toFormat("d"),displayLabel:O,weekdayLabel:Q,aria:ie.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:oe}),ie=ie.plus({days:1})}const G=[];for(let te=0;te<6;te++)G.push(we.slice(te*7,te*7+7));return G}),N=Y(()=>{const D=Ku.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?D:[D[6],...D.slice(0,6)]});function I(D,U,K){const ie=D==="start"?U.startOf("day"):U.endOf("day"),we=E(ie),Ae={year:ie.year,month:ie.month,day:ie.day,utc:we.toISO()||""};D==="start"?(l("select-start",Ae,K??!0),l("select-start-utc",Ae.utc)):(l("select-end",Ae),l("select-end-utc",Ae.utc))}function k(D){let U=c.value,K=u.value+D;for(;K<1;)K+=12,U-=1;for(;K>12;)K-=12,U+=1;c.value=U,u.value=K,l("update:year",U),l("update:month",K)}function A(D){const K=(_.value?St.fromISO(_.value,{zone:r.timezone}):h.value).plus({days:D});K.month===u.value&&K.year===c.value&&x(K)}function M(D=!1){const K=(_.value?St.fromISO(_.value,{zone:r.timezone}):h.value).weekday%7,ie=D?6-K:-K;A(ie)}const V=D=>{B(D)};function B(D){switch(D.preventDefault(),D.stopPropagation(),D.key){case"ArrowLeft":D.preventDefault(),A(-1);break;case"ArrowRight":D.preventDefault(),A(1);break;case"ArrowUp":D.preventDefault(),A(-7);break;case"ArrowDown":D.preventDefault(),A(7);break;case"Home":D.preventDefault(),M(!1);break;case"End":D.preventDefault(),M(!0);break;case"PageUp":D.preventDefault(),k(D.shiftKey?-12:-1);break;case"PageDown":D.preventDefault(),k(D.shiftKey?12:1);break;case"Enter":case" ":{D.preventDefault();const U=_.value?St.fromISO(_.value,{zone:r.timezone}):h.value,K=P.value.flat().find(ie=>ie.iso===U.toISODate());K&&ne(K);break}}}const z=D=>{const U=St.now().setZone(r.timezone);c.value=U.year,u.value=U.month,l("update:year",U.year),l("update:month",U.month),x(U),l("gotoToday")};function ne(D){var ve,ke;const U=!!f.value,K=!!p.value,ie=r.activeField,we=((ve=f.value)==null?void 0:ve.toISODate())||"null",Ae=((ke=p.value)==null?void 0:ke.toISODate())||"null",ce=D.dt.toISODate()||"",G=(_e,$e)=>{a.value={case:_e,behavior:$e}},te=()=>`Selected start ${ce} > existing end ${Ae} -> reset both to ${ce}`,oe=()=>`Selected end ${ce} < existing start ${we} -> reset both to ${ce}`,O=()=>{I("start",D.dt,!0),I("end",D.dt),l("update:activeField","end")},Q=(_e=!1)=>{I("start",D.dt,_e),_e&&l("update:activeField","end")},se=(_e=!1)=>{I("end",D.dt),_e&&l("close")};if(U&&K){ie==="start"?p.value&&D.dt>p.value?(O(),G("INVERT_RANGE_FROM_START",te())):(Q(!1),G("UPDATE_START_IN_RANGE",`Updated start from ${we} to ${ce}; end remains ${Ae}`)):f.value&&D.dt<f.value?(O(),G("INVERT_RANGE_FROM_END",oe())):(se(!1),G("UPDATE_END_IN_RANGE",`Updated end from ${Ae} to ${ce}; start remains ${we}`));return}if(!U&&K&&ie==="start"&&p.value&&D.dt>p.value){O(),G("CREATE_RANGE_FROM_LATE_START",te());return}if(U&&!K&&ie==="end"&&f.value&&D.dt<f.value){O(),G("CREATE_RANGE_FROM_EARLY_END",oe());return}if(!U&&!K){if(ie==="start"){Q(!0),G("INIT_START",`Picked start ${ce}; awaiting end selection`);return}se(r.immediatelyUpdate),G("INIT_END",`Picked end ${ce}; awaiting start selection`);return}if(!U&&K){if(ie==="start"){Q(!0),G("FILL_MISSING_START",`Inserted start ${ce}; existing end ${Ae}`);return}se(!1),G("STRICT_UPDATE_END_ONLY",`Updated end to ${ce}; start still null`);return}if(U&&!K){if(ie==="start"){Q(!0),G("RESELECT_START_BEFORE_END",`Replaced start with ${ce}; end still null, switching to end`);return}se(r.immediatelyUpdate),G("FILL_MISSING_END",`Picked end ${ce}; start ${we}`);return}}function re(){C.value=g.value,S.value=v.value,l("confirm")}function ee(){g.value=C.value,v.value=S.value,l("cancel")}function X(){ct(()=>{var D;(D=s.value)==null||D.focus()})}return Qt(()=>{X()}),t({focus:X}),(D,U)=>(q(),ue("div",{ref_key:"calendarRef",ref:s,class:ae([D.$style["arbo-calendar"],{[D.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[Ee("div",{class:ae([D.$style["arbo-calendar-header"],D.$style["arbo-calendar-week"]]),role:"row"},[(q(!0),ue(kt,null,An(N.value,K=>(q(),ue("div",{key:K,class:ae(D.$style["arbo-calendar-weekday"]),role:"columnheader"},it(K),3))),128))],2),Ee("div",{class:ae(D.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:U[0]||(U[0]=Lt(K=>L(hl)(K,V),["prevent","stop"]))},[(q(!0),ue(kt,null,An(P.value,(K,ie)=>(q(),ue("div",{key:ie,class:ae(D.$style["arbo-calendar-week"])},[(q(!0),ue(kt,null,An(K,we=>(q(),ue("div",{key:we.iso,class:ae([D.$style["arbo-calendar-day"],we.classes,{[D.$style["is-focused"]]:we.iso===_.value}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":we.aria,"data-date":we.iso,"data-weekday":we.weekdayLabel,tabindex:we.iso===_.value?0:-1,onClick:Ae=>ne(we)},it(we.displayLabel),11,MQ))),128))],2))),128))],34),r.readOnly?Ye("",!0):(q(),ue("div",{key:0,class:ae(D.$style["arbo-calendar-actions"])},[Ee("div",NQ,[Ke((q(),je(pt,{variant:"secondary",size:"medium",onClick:U[1]||(U[1]=K=>z()),onKeydown:L(hl),"data-index":"today-btn"},{prefix:ye(()=>[me(ut,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[L(o),"Today"]])]),me(pt,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:L(hl),variant:"secondary",size:"medium",onClick:ee,"data-index":"cancel-btn"},{default:ye(()=>[nt(it(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),me(pt,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:L(hl),onClick:re},{default:ye(()=>[nt(it(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,OQ))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_99b61_1","arbo-calendar-day":"_arbo-calendar-day_99b61_2","arbo-calendar-week":"_arbo-calendar-week_99b61_3","arbo-calendar":"_arbo-calendar_99b61_2","arbo-calendar-nav":"_arbo-calendar-nav_99b61_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_99b61_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_99b61_53","arbo-calendar-weekday":"_arbo-calendar-weekday_99b61_58","arbo-calendar-weeks":"_arbo-calendar-weeks_99b61_63","is-today":"_is-today_99b61_92","is-selected-start":"_is-selected-start_99b61_97","is-selected-end":"_is-selected-end_99b61_105","is-outside":"_is-outside_99b61_125","is-focused":"_is-focused_99b61_128","is-in-range":"_is-in-range_99b61_133","arbo-calendar-actions":"_arbo-calendar-actions_99b61_139","arbo-calendar-btn":"_arbo-calendar-btn_99b61_147",cancel:"_cancel_99b61_156",confirm:"_confirm_99b61_161"}}]]),VQ=["onClick"],BQ=["variant","onClick"],$Q=bt(tt({__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 o=e,s=Y(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const A=o.locale||"en-US",M=o.monthLabelStyle||"short",V=new Intl.DateTimeFormat(A,{month:M,timeZone:"UTC"});return Array.from({length:12},(z,ne)=>V.format(new Date(Date.UTC(2020,ne,1))))}),r=n,i=$(o.year),a=$(o.month),l=$(o.year);Qe(()=>o.year,A=>{A!==i.value&&(i.value=A,l.value=A)}),Qe(()=>o.month,A=>{A!==a.value&&(a.value=A)});const c=$("days");function u(A){c.value!==A&&(c.value=A,r("mode-change",A))}const d=Y(()=>o.minYear),h=Y(()=>o.maxYear),f=Y(()=>{const A=o.yearSpan;return l.value-l.value%A}),p=Y(()=>f.value+o.yearSpan-1);function g(){const A=o.yearSpan,M=f.value-A;M>=d.value&&(l.value=M)}function v(){const A=o.yearSpan,M=f.value+A;M<=h.value&&(l.value=M)}const C=Y(()=>f.value-o.yearSpan<d.value),S=Y(()=>p.value+o.yearSpan>h.value),b=Y(()=>{const A=o.yearSpan;return Math.ceil(A/3)});function y(A){const V=f.value+(A-1)*3;return Array.from({length:3},(B,z)=>V+z).filter(B=>B<=p.value)}function E(){c.value==="months"?u("days"):u("months")}function _(){c.value==="years"?u("days"):u("years")}function x(A){i.value=A,l.value=A,r("update:year",A),r("year-selected",A),u("months")}function R(A){a.value=A,r("update:month",A),r("month-selected",A),u("days")}function P(){if(c.value==="days"){let A=i.value,M=a.value-1;if(M<1&&(M=12,A--),A<d.value)return;i.value=A,a.value=M,r("update:year",A),r("update:month",M)}else if(c.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else c.value==="years"&&g()}function N(){if(c.value==="days"){let A=i.value,M=a.value+1;if(M>12&&(M=1,A++),A>h.value)return;i.value=A,a.value=M,r("update:year",A),r("update:month",M)}else if(c.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else c.value==="years"&&v()}const I=Y(()=>c.value==="days"?i.value===d.value&&a.value===1:c.value==="months"?i.value-1<d.value:C.value),k=Y(()=>c.value==="days"?i.value===h.value&&a.value===12:c.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(A,M)=>{i.value=A,a.value=M}}),(A,M)=>(q(),ue("div",{class:ae([A.$style["cal-nav-wrapper"]])},[xt(A.$slots,"selection"),c.value==="days"?(q(),ue("div",{key:0,class:ae(A.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[me(pt,{variant:"tertiary",class:ae([A.$style["cal-nav-btn"],A.$style.prev]),"aria-label":"Previous",disabled:I.value,label:"",onClick:P,"data-index":"prev-btn",onKeydownCapture:jn(Lt(P,["prevent","stop"]),["enter"]),onKeydown:L(hl)},{default:ye(({hovered:V})=>[me(ut,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),Ee("div",{class:ae(A.$style["cal-nav-center"])},[me(pt,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:L(hl)},{default:ye(()=>[nt(it(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),me(pt,{variant:"secondary",onClick:_,"data-index":"year-btn",onKeydown:L(hl)},{default:ye(()=>[nt(it(i.value),1)]),_:1},8,["onKeydown"])],2),me(pt,{"data-index":"next-btn",variant:"tertiary",class:ae([A.$style["cal-nav-btn"],A.$style.next]),"aria-label":"Next",disabled:k.value,label:"",onClick:N,onKeydownCapture:jn(Lt(N,["prevent","stop"]),["enter"]),onKeydown:L(hl)},{default:ye(({hovered:V})=>[me(ut,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ye("",!0),c.value==="years"?(q(),ue("div",{key:1,class:ae(A.$style["year-grid"])},[Ee("div",{class:ae(A.$style["year-grid-header"])},[me(pt,{variant:"tertiary",class:ae([A.$style["cal-nav-btn"],A.$style.prev]),"aria-label":"Next",disabled:C.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:ye(({hovered:V})=>[me(ut,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),Ee("div",{class:ae(A.$style["range-label"])},it(f.value)+" - "+it(p.value),3),me(pt,{variant:"tertiary",class:ae([A.$style["cal-nav-btn"],A.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:ye(({hovered:V})=>[me(ut,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),Ee("div",{class:ae(A.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(q(!0),ue(kt,null,An(b.value,V=>(q(),ue("div",{key:"yr-row-"+V,class:ae(A.$style["year-grid-row"])},[(q(!0),ue(kt,null,An(y(V),B=>(q(),ue("a",{key:B,tabindex:"0",class:ae([A.$style["year-cell"],{[A.$style.selected]:B===i.value}]),onClick:z=>x(B)},it(B),11,VQ))),128))],2))),128))],2)],2)):c.value==="months"?(q(),ue("div",{key:2,class:ae(A.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[Ee("div",{class:ae(A.$style.months)},[(q(!0),ue(kt,null,An(s.value,(V,B)=>(q(),ue("a",{tabindex:"0",key:V,variant:B+1===a.value?"primary":"text",class:ae([A.$style["month-cell"],{[A.$style.selected]:B+1===a.value}]),onClick:z=>R(B+1)},it(V),11,BQ))),128))],2)],2)):(q(),ue("div",{key:3,class:ae(A.$style["days-slot"])},[xt(A.$slots,"default",{year:i.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:"_prev_mtd4w_33","year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:"_months_mtd4w_75","month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:"_selected_mtd4w_131","days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"}}]]);function HQ(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,r=$(""),i=Y(()=>{const g=St.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=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}),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},c=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}),u=Y(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&c.value),d=Y(()=>r.value.length===t.length&&u.value);return{inputValue:r,isValid:u,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=St.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>u.value?i.value:null}}const GQ={key:0,style:{marginLeft:"8px"}},UQ=["disabled","readonly","placeholder"],JO=bt(tt({__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 o=jt,s=e,r=n,i=$(null),a=$(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=HQ({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=Y(()=>s.active),g=Y(()=>({disabled:s.disabled,error:!l.value&&u.value.length>0,readOnly:s.readOnly,isEmpty:u.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:C,isFocus:S}=To(g),b=R=>{var N;const P=(N=R.clipboardData)==null?void 0:N.getData("text/plain");P&&(u.value=P.trim())},y=R=>{if(R.key==="Escape"){r("blur"),R.target.blur(),R.preventDefault(),R.stopPropagation(),R.stopImmediatePropagation();return}else R.key==="Tab"&&x(R)},E=()=>{d(),r("clear")};t({clear:E,setDate:h,getDate:f,focus:()=>{var R;return(R=i.value)==null?void 0:R.focus()}}),Qe(()=>s.modelValue,R=>{R?h(R):d()},{immediate:!0}),Qe([()=>c.value,()=>u.value],()=>{if(u.value.length===0)r("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&c.value){const R=f();(R||u.value.length===0)&&r("complete",R)}}),Qe(()=>l.value,R=>{R||r("invalid","")});const _=Y(()=>!!s.isMultipleDate),x=R=>{R.preventDefault(),R.stopImmediatePropagation(),R.stopPropagation(),r("tab",R)};return(R,P)=>(q(),je(Oo,zt(L(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:ye(()=>[Ee("div",{class:ae([R.$style["date-input-wrapper"]])},[_.value?(q(),ue("span",GQ," Multiple ")):Ke((q(),ue("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":P[0]||(P[0]=N=>vn(u)?u.value=N:null),onPaste:Lt(b,["prevent"]),placeholder:s.placeholder,class:ae([R.$style["date-input"]]),onKeydown:y},null,42,UQ)),[[rx,L(u)]]),xt(R.$slots,"clear",{handleClear:E},()=>[(L(u).length>0||_.value)&&!s.readOnly&&!s.disabled&&(L(C)||L(S))?Ke((q(),je(pt,{key:0,variant:["icon","primary"],onClick:Lt(E,["stop"]),size:16,rounded:!0},{default:ye(()=>[me(ut,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[L(o),"Clear"]]):(q(),je(ut,{key:1,src:"Calendar",source:"remote",class:ae(R.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:"_focus_132fk_12",hover:"_hover_132fk_12",active:"_active_132fk_12","date-input":"_date-input_132fk_1",invalid:"_invalid_132fk_38"}}]]),WQ=tt({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:PS()},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 o=$({case:"",behavior:""}),s=e,r=$(null),i=n,a=async(G,te)=>{i("start-update"),await G(),i("finish-update"),ct(()=>{var oe,O;te(),(O=(oe=s.params)==null?void 0:oe.api)==null||O.stopEditing()})},l=(G,te)=>{G(),ct(()=>{var oe,O;te(),(O=(oe=s.params)==null?void 0:oe.api)==null||O.stopEditing()})},c=()=>{var te;const G=St.now().setZone(s.timezone);U.value=G.year,K.value=G.month,(te=D.value)==null||te.setNavigation(G.year,G.month)},u=Uo({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:C,beginInteraction:S,clearStart:b,clearDue:y}=VY(s,i),E=Y(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Qe(()=>s.multipleStartDates,G=>{h.value=!!G},{immediate:!0}),Qe(()=>s.multipleDueDates,G=>{f.value=!!G},{immediate:!0});const _=$(null),x=$(null),R=G=>{G.preventDefault(),G.stopImmediatePropagation(),G.stopPropagation(),re()},P=()=>{var G;(G=x.value)==null||G.focus()},N=G=>{if(!G){u.start=!1,b();return}const te=d.endDate?St.fromJSDate(d.endDate,{zone:s.timezone}):null;if(te&&I(G,te)>0){const O={year:G.year,month:G.month,day:G.day};u.start=!1,C(O,!1),p(O),ct(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const oe={year:G.year,month:G.month,day:G.day};u.start=!1,C(oe,!0)},I=(G,te)=>{const oe=G.startOf("day"),O=te.startOf("day");return oe<O?-1:oe>O?1:0},k=G=>{var te;G.preventDefault(),G.stopImmediatePropagation(),G.stopPropagation(),(te=document.querySelector('[data-index="prev-btn"]'))==null||te.focus()},A=G=>{if(!G){u.end=!1,y();return}const te=d.startDate?St.fromJSDate(d.startDate,{zone:s.timezone}):null;if(te&&I(G,te)<0){const O={year:G.year,month:G.month,day:G.day};u.end=!1,C(O),p(O),ct(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const oe={year:G.year,month:G.month,day:G.day};u.end=!1,p(oe)},M=()=>{h.value=!1,b()},V=()=>{f.value=!1,y()},B=()=>{ee()},z=Y(()=>d.isSelectingStart||d.isSelectingEnd);function ne(){s.disabled||s.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,ct(()=>{var G;(G=r.value)==null||G.focus()}))}function re(){s.disabled||s.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,ct(()=>{var G;(G=_.value)==null||G.focus()}))}function ee(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function X(G){G.key==="Escape"?(G.stopPropagation(),ee()):G.key=="Tab"&&i("tab",G)}const D=$(null),U=$(new Date().getFullYear()),K=$(new Date().getMonth()+1);Qe(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(U.value=d.startDate.getFullYear(),K.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(U.value=d.endDate.getFullYear(),K.value=d.endDate.getMonth()+1)},{immediate:!0});const ie=$(null);function we(){if(Array.isArray(s.value)){const[te,oe]=s.value;d.startDate=te||null,d.endDate=oe||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const G=d.startDate||d.endDate||new Date;U.value=G.getFullYear(),K.value=G.getMonth()+1}Qe(()=>{var G,te,oe,O,Q,se,ve,ke;return[((oe=(te=(G=s.value)==null?void 0:G[0])==null?void 0:te.getTime)==null?void 0:oe.call(te))||((O=s.value)==null?void 0:O[0]),((ve=(se=(Q=s.value)==null?void 0:Q[1])==null?void 0:se.getTime)==null?void 0:ve.call(se))||((ke=s.value)==null?void 0:ke[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{we()},{immediate:!0,deep:!0}),t({resetCalendarLogic:we,openStart:ne,openEnd:re,closePicker:ee,clearAll:B,isOpen:z,drpRef:ie,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?ne():re():ne()}});const ce=$(null);return Qe(()=>z.value,G=>{if(s.disabled||s.readOnly)return;const te=ce.value;te&&(G?te.show():te.hide())},{immediate:!0}),(G,te)=>(q(),ue("div",{class:ae(G.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:x,onKeydown:X,tabindex:"1","data-index":"calendar-wrapper"},[me($Q,{year:U.value,"onUpdate:year":te[6]||(te[6]=oe=>U.value=oe),month:K.value,"onUpdate:month":te[7]||(te[7]=oe=>K.value=oe),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:D},{selection:ye(()=>[Ee("div",{class:ae(G.$style["calendar-input-section"])},[me(JO,{ref_key:"starDateRef",ref:r,"model-value":L(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:L(d).isSelectingStart,onClick:ne,onClear:M,onComplete:N,onInvalid:te[0]||(te[0]=oe=>u.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:P,onTab:R},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),me(JO,{ref_key:"endDateRef",ref:_,"model-value":L(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:L(d).isSelectingEnd,onClick:re,onClear:V,disabled:s.disabled,onComplete:A,onInvalid:te[1]||(te[1]=oe=>u.end=!0),readOnly:s.readOnly,isMultipleDate:L(f),onTab:k},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:ye(({year:oe,month:O})=>[me(LQ,{disabled:s.disabled,disableConfirm:u.end||u.start,readOnly:s.readOnly,ref_key:"drpRef",ref:ie,"tracing-case":o.value,"onUpdate:tracingCase":te[2]||(te[2]=Q=>o.value=Q),year:oe,month:O,"start-date":L(d).startDate,"end-date":L(d).endDate,"active-field":E.value,timezone:s.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:L(C),onSelectEnd:L(p),onGotoToday:c,onConfirm:te[3]||(te[3]=()=>{a(L(v),ee)}),onCancel:te[4]||(te[4]=Q=>l(L(g),ee)),onClose:te[5]||(te[5]=Q=>a(L(v),ee))},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))}}),Ov=bt(WQ,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_139py_1","calendar-input-section":"_calendar-input-section_139py_11","display-wrapper":"_display-wrapper_139py_19","calendar-actions":"_calendar-actions_139py_23","clear-all-btn":"_clear-all-btn_139py_29"}}]]),zQ=tt({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,o=e,s=Dn("isSelectAll",$(!1)),r=Dn("bulkUpdate",$(!1)),i=Y(()=>!!o.entityId&&r.value&&s.value),{apiServices:a}=io(!r.value,o),l=Dn("filterParams",null),c=$(null),u=async R=>{var P,N,I,k;try{y.value=!0,n("update-start");let A={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in R&&(A.startDate=R.start?fv(R.start):null),"end"in R&&(A.dueDate=R.end?fv(R.end):null),i.value?(A.itemIds=void 0,A.entityId=o.entityId):A.entityId=void 0;const M=await((N=(P=a.value)==null?void 0:P.changeDate)==null?void 0:N.call(P,A));n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:A}),n("update-completed",M),(I=c.value)==null||I.hide()}catch(A){console.error("Failed to update dates:",A),ct(()=>{ct(()=>{var M;n("update-failed"),(M=c.value)==null||M.open()})})}finally{(k=S.value)==null||k.resetCalendarLogic(),y.value=!1}},d=()=>{if(!o.rowSelected||o.rowSelected.length===0){h();return}o.rowSelected.length===1?f():p()},h=()=>{C.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const P=o.rowSelected[0].dateRange;b.value=[(P==null?void 0:P[0])??null,(P==null?void 0:P[1])??null],C.value=!1,v.value=!1},p=()=>{var P,N;if(o.rowSelected.some(I=>I.dateRange&&(I.dateRange[0]!==null||I.dateRange[1]!==null))){const I=g(0),k=g(1);if(v.value=I,C.value=k,I)b.value[0]=null;else{const A=((P=o.rowSelected[0].dateRange)==null?void 0:P[0])??null;b.value[0]=A}if(k)b.value[1]=null;else{const A=((N=o.rowSelected[0].dateRange)==null?void 0:N[1])??null;b.value[1]=A}}else v.value=!1,C.value=!1,b.value=[null,null]},g=R=>{const P=o.rowSelected.map(I=>{var k;return(k=I.dateRange)==null?void 0:k[R]});return P.length===0?!1:new Set(P.map(I=>{var k;return(k=I==null?void 0:I.getTime)==null?void 0:k.call(I)})).size>1},v=$(!1),C=$(!1),S=$(null),b=$([null,null]);Qe([()=>o.ids,()=>o.rowSelected],R=>{d(),ct(()=>{var P;(P=S.value)==null||P.focus()})},{immediate:!0,deep:!0});const y=$(!1),E=()=>{y.value=!0},_=()=>{ct(()=>{setTimeout(()=>{y.value=!1},500)})},x=(R,P)=>{R&&ct(()=>{var N;(N=S.value)==null||N.focus()})};return(R,P)=>(q(),je(zf,{ref_key:"wrapperRef",ref:c,isUpdating:y.value,disabled:o.disabled||y.value,onOnVisibleChange:x},{trigger:ye(({hide:N,disabled:I})=>[me(pt,{variant:o.variant,loading:y.value,disabled:I,onEscape:N},{default:ye(()=>[me(ut,{src:"Calendar"}),P[0]||(P[0]=nt(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ye(({isVisible:N,hide:I})=>[N?(q(),je(Ov,{key:0,immediatelyUpdate:!1,value:b.value,onConfirmed:u,ref_key:"calendarRef",ref:S,onClosed:I,onStartUpdate:E,onFinishUpdate:_,multipleDueDates:C.value,multipleStartDates:v.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Ye("",!0)]),default:ye(()=>[P[1]||(P[1]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),jQ=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"},QO=Rc("metricStore",()=>{const e=$();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return jQ(o)}}}),KQ=["onKeydown"],qQ=["width","height","viewBox"],YQ=["d"],XQ="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",eM=tt({__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 o=e,s=n,r=$(o.modelValue??0),i=$(null),a=Y(()=>{var I;return((I=o.params)==null?void 0:I.size)??24}),l=Y(()=>{var I;return((I=o.params)==null?void 0:I.iconViewBox)??"0 0 24 24"}),c=Y(()=>{var I;return((I=o.params)==null?void 0:I.iconPath)??XQ}),u=Y(()=>{var I;return((I=o.params)==null?void 0:I.wrapperTag)??"span"}),d=Y(()=>{var I;return o.disabled||((I=o.params)==null?void 0:I.disabled)||!1}),h=Y(()=>{var I;return o.readOnly||((I=o.params)==null?void 0:I.readOnly)||!1}),f=Y(()=>!d.value&&!h.value),p=Y(()=>d.value?"not-allowed":h.value?"default":"pointer");Qe(()=>o.modelValue,I=>{typeof I=="number"&&I!==r.value&&(r.value=I)});const g=I=>{var k;return((k=o.params)==null?void 0:k.maxRating)-I+1<=r.value&&!v.value},v=$(!1),C=()=>{v.value=!0},S=()=>{v.value=!1},b=I=>{f.value&&y(I)},y=I=>{var A,M;if(!f.value)return;let k=((A=o.params)==null?void 0:A.maxRating)-I+1;k===r.value&&(k=0),r.value=k,s("update:modelValue",k),s("update",k),s("change",k),(M=o.params)!=null&&M.onUpdate&&o.params.onUpdate(k)},E=I=>{var k;I!==r.value&&(r.value=I,s("update:modelValue",I),s("update",I),s("change",I),(k=o.params)!=null&&k.onUpdate&&o.params.onUpdate(I),_.value=I)},_=$(r.value),x=I=>{I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation(),r.value=_.value,s("cancel")},R=I=>{I.preventDefault(),E(r.value),s("handleEnter",r.value)},P=()=>{f.value&&(r.value=Math.min(r.value+1%(o.params.maxRating+1),o.params.maxRating),E(r.value))},N=()=>{f.value&&(r.value=Math.max(r.value-1,0),E(r.value))};return t({focus:()=>{var I;(I=i.value)==null||I.focus()}}),(I,k)=>(q(),ue("div",{class:ae(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:hn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[jn(Lt(N,["prevent"]),["left"]),jn(Lt(P,["prevent"]),["right"]),jn(Lt(N,["prevent"]),["down"]),jn(Lt(P,["prevent"]),["up"]),jn(Lt(R,["prevent"]),["enter"]),jn(Lt(R,["prevent"]),["tab"]),jn(Lt(x,["prevent"]),["escape"])]},[(q(!0),ue(kt,null,An(e.params.maxRating,A=>(q(),je(PC(u.value),{key:A,class:ae(["rating-item",{filled:g(A),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:hn({cursor:p.value,order:e.params.maxRating-A,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(A),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-A+1,tabindex:-1,onClick:Lt(M=>b(A),["prevent","stop"]),onMouseenter:C,onMouseleave:S},{default:ye(()=>[xt(I.$slots,"icon",{index:A,filled:g(A),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:A},()=>[(q(),ue("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[Ee("path",{d:c.value},null,8,YQ)],8,qQ))]),xt(I.$slots,"overlay",{index:A,filled:g(A),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,KQ))}}),ZQ={style:{maxWidth:"180px",lineHeight:"15px"}},JQ=["innerHTML"],tM=tt({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=jt,s=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(y=>({label:y.name,value:y.name,id:y.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[]},c=Y(()=>l(s.config)),u=$(s.modelValue),d=v=>{u.value=v,r("update:modelValue",v),r("change",v||null)},h=$(c.value),f=$(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(C=>C.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=$(null);return Qt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,C)=>(q(),je(fa,{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:ye(({item:S,getHighlightedLabel:b,selectedIndex:y,index:E})=>[me(dl,{hover:y==E,selected:S.value===e.modelValue,label:S.label,onSelect:_=>d(S.value||null),onClick:_=>d(S.value||null)},{label:ye(()=>[Ee("div",ZQ,[Ke(Ee("span",{innerHTML:b(S.label)},null,8,JQ),[[L(o),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":ye(()=>[...C[1]||(C[1]=[nt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),QQ={class:"metric-input-wrapper"},eee={key:0,class:"error-text input-2"},nM=tt({__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 o=jt,s=e,r=$(s.modelValue),i=$(s.modelValue),a=$(!1),l=$(!0),c=$(""),u=Y(()=>{var V;const M=Number.parseInt(String((V=s.config)==null?void 0:V.format_value)||"2",10);return Number.isFinite(M)&&M>=0?M:2}),d=M=>{if(!M)return M;const V=String(M).split(".");return V.length>1&&V[1].length>u.value?u.value===0?V[0]:`${V[0]}.${V[1].slice(0,u.value)}`:String(M)},h=M=>{const V=d(M);V!==M&&b.value?r.value=V:r.value=M},f=M=>{const V=M.target;if(!V)return;const B=V.value||"",z=B.indexOf(".");if(M.key==="."&&u.value===0){M.preventDefault();return}z!==-1&&/[0-9]/.test(M.key)&&B.slice(z+1).length>=u.value&&M.preventDefault()},p=Y(()=>l.value||s.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var X;const M=s.config.restricted_type.trim(),V=((X=s.config.restricted_value)==null?void 0:X.split(",").map(Number))||[],[B,z]=V,re={range:`Enter a value between ${B} and ${z}`,not:`These values are not allowed: ${V.join(", ")}`,exact:"Value is not allowed"}[M];return l.value?"":re},v=Y(()=>{var V;let M="";return Number((V=s.config)==null?void 0:V.format_value)&&(M+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${M}`});Qe(()=>s.modelValue,M=>{r.value=M,i.value=M});const C=M=>cv(s.config,M),S=n,b=$(null),y=M=>{const V=M===""?null:M,B=i.value===""?null:i.value;return V!==B},E=M=>{const V=d(M);if(!y(V))return!1;const B=V===""?null:V;return r.value=B,i.value=B,S("update:modelValue",B),S("handleChange",B),!0},_=()=>{r.value=i.value,S("update:modelValue",i.value)},x=(M,V)=>{E(M),S("enter")},R=(M,V)=>{if(a.value){a.value=!1;return}s.saveOnBlur?E(M):_()},P=M=>{if(M===null||M===""){l.value=!0;return}l.value=cv(s.config,Number(M)),c.value=l.value?"":g()},N=(M,V)=>{a.value=!0,s.saveOnEscape?E(M):_(),S("cancel"),setTimeout(()=>{a.value=!1},100)},I=M=>{P(M),S("onValidation",M)},k=()=>{a.value=!0,_(),S("cancel"),setTimeout(()=>{a.value=!1},100)},A=()=>{var M;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(M=b.value)==null||M.focus()};return t({focus:()=>{var M;return(M=b.value)==null?void 0:M.focus()},blur:()=>{var M;return(M=b.value)==null?void 0:M.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>E(r.value),revert:_}),Qt(()=>{var M;(M=b.value)==null||M.focus()}),(M,V)=>Ke((q(),ue("div",QQ,[me(Wf,{maxDecimalChar:u.value,modelValue:r.value,"onUpdate:modelValue":V[0]||(V[0]=B=>r.value=B),placeholder:v.value,validatorFnc:C,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:x,onBlur:R,onClear:A,onEscape:N,onCancel:k,onOnValidation:I,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(q(),ue("span",eee,it(c.value),1)):Ye("",!0)])),[[L(o),p.value]])}}),tee={key:2},nee={class:"wrapper-suffix"},oee={key:3},see=bt(tt({__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 o=jt,s=e,r=$(null),i=$(0),a=$(null),l=$(null),c=Y(()=>wk(s.config)),u=$(!1),d=Y(()=>!!ie.value),h=n,f=()=>{u.value=!1,K(),h("cancel")},p=$(!0),g=ce=>{if(ce===null||ce===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=cv(s.config,Number(ce)),C.value=S()},v=()=>{u.value=!0,z()},C=$(""),S=()=>{var ve;const ce=s.config.restricted_type.trim(),G=((ve=s.config.restricted_value)==null?void 0:ve.split(",").map(Number))||[],[te,oe]=G,Q={range:`Enter a value between ${te} and ${oe}`,not:`These values are not allowed: ${G.join(", ")}`,exact:"Value is not allowed"}[ce];return p.value?"":Q},b=Y(()=>{var G;const ce=Number.parseInt(String((G=s.config)==null?void 0:G.format_value)||"2",10);return Number.isFinite(ce)&&ce>=0?ce:2}),y=ce=>{u.value=!0,r.value=ce},E=()=>{u.value=!0,K(),z()},_=ce=>{i.value=ce,u.value=!0,z()},x=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(G=>G.charAt(0).toUpperCase()+G.slice(1)).join("").replace(/Outline|Solid/g,""),R=$(null),P=$(!0),N=Y(()=>{var ce;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((ce=r.value)==null?void 0:ce.length)===0,wrapperRef:D,active:d,focus:s.focus,bordered:!0}}),I=$(null),k=Y(()=>P.value),A=Y(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:I,active:k,focus:P.value,bordered:!0})),{argsMain:M}=To(A),{argsMain:V}=To(N),B=$(null),z=()=>{ct(()=>{var ce;(ce=B.value)==null||ce.focus()})},ne=ce=>{var G;if(ce.format_type==="dropdown"&&ce.format_value)try{const te=JSON.parse(ce.format_value);if(Array.isArray(te))return te.map(oe=>({label:oe.name,value:oe.name,id:oe.name}))}catch(te){console.error("Failed to parse dropdown options",te)}return ce.format_type=="number"&&ce.restricted_type=="exact"?((G=ce.restricted_value)==null?void 0:G.split(",").map(oe=>({label:ce.mapping[`!${oe}`]||oe,value:oe,id:oe})))||[]:[]},re=Y(()=>ne(s.config)),ee=Y(()=>{var ce;return((ce=re.value.find(G=>G.value===r.value))==null?void 0:ce.label)||r.value||"-"}),X=()=>{var ce;if(c.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(c.value=="number"){const G=(ce=l.value)==null?void 0:ce.getValue();h("updateMetric",G||null)}else h("updateMetric",r.value||null);u.value=!1,K()},{triggerRef:D,popupRef:U,hide:K,isVisible:ie,show:we}=mo({toggleOnClick:!0,appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),Ae=()=>{switch(c.value){case"number":ct(()=>{var ce;(ce=l.value)==null||ce.focus()});break;case"dropdown":we(),ct(()=>{var ce;(ce=R.value)==null||ce.focus()});break;case"rating":P.value=!0,ct(()=>{var ce;(ce=a.value)==null||ce.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,u.value=!1},focus:Ae,hasChanges:()=>u.value}),Qt(()=>{ct(()=>{setTimeout(()=>{Ae()},300)})}),(ce,G)=>(q(),ue("div",{class:ae(ce.$style["metric-editor"])},[c.value=="number"?(q(),je(nM,{key:0,config:s.config,modelValue:r.value,"onUpdate:modelValue":G[0]||(G[0]=te=>r.value=te),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:y,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(q(),je(Oo,zt({key:1,"tab-index":1},L(M),{ref_key:"triggerRef2",ref:I,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:ye(()=>[me(eM,{params:{maxRating:s.config.range},modelValue:i.value,"onUpdate:modelValue":G[1]||(G[1]=te=>i.value=te),onHandleEnter:_,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:ye(()=>[me(ut,{source:"rating",src:x()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(q(),ue("div",tee,[me(Oo,zt(L(V),{ref_key:"triggerRef",ref:D,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:ye(({})=>[Ee("div",nee,[me(ut,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:ye(()=>[Ke((q(),ue("span",null,[nt(it(ee.value||""),1)])),[[L(o),{content:ee.value}]])]),_:1},16),Ee("div",{ref_key:"popupRef",ref:U},[L(ie)?(q(),je(tM,{key:0,ref_key:"metricEditorDropdownRef",ref:R,config:s.config,modelValue:r.value,"onUpdate:modelValue":G[2]||(G[2]=te=>r.value=te),onChange:E,onCancel:f},null,8,["config","modelValue"])):Ye("",!0)],512)])):(q(),ue("span",oee,"Formular")),Ke((q(),je(pt,{ref_key:"confirmButtonRef",ref:B,onHandleClick:X,"tab-index":"1",onKeypress:[jn(Lt(Ae,["shift","prevent"]),["tab"]),jn(Lt(f,["prevent"]),["escape"])],disabled:!p.value},{default:ye(()=>[me(ut,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[L(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),ree=bt(tt({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=jt,s=e,r=n,i=$(!1),a=$(null),l=$(null),c=()=>{i.value=!i.value},u=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await ct(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:s.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&&u()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];C&&C()};return Qe(i,g=>{g&&r("open")}),t({hide:u,show:d}),(g,v)=>(q(),ue("div",{class:ae([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[Ee("div",{class:ae(g.$style["metric-label"]),onClick:Lt(c,["stop"])},[xt(g.$slots,"default",{open:i.value},()=>[Ke((q(),ue("span",{class:ae(g.$style["metric-name"])},[nt(it(e.label),1)],2)),[[L(o),{content:e.label}]]),e.morpheme&&i.value?(q(),ue("small",{key:0,class:ae(g.$style["metric-morpheme"])}," ("+it(e.morpheme)+") ",3)):Ye("",!0)])],2),me(V1,{mode:"out-in",name:"slide"},{default:ye(()=>[i.value?(q(),je(see,{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"])):Ye("",!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"}}]]);function oM(e,t){return function(){return e.apply(t,arguments)}}const{toString:iee}=Object.prototype,{getPrototypeOf:pa}=Object,{iterator:Kf,toStringTag:sM}=Symbol,ga=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),rM=e=>typeof e=="string"&&(e==="__proto__"||e==="constructor"||e==="prototype"),Mv=(e,t,n)=>e===Object.prototype||!n&&t===null,aee=e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(n=>{if(rM(n))return!1;const o=Object.getOwnPropertyDescriptor(e,n);return!!o&&o.configurable&&o.writable===!0})},bE=(e,t)=>{let n=e;const o=[];for(;n!=null;){if(o.indexOf(n)!==-1)return!1;o.push(n);const s=pa(n);if(Mv(n,s,n===e))return!1;if(ga(n,t))return!0;n=s}return!1},lee=(e,t)=>e!=null&&bE(e,t)?e[t]:void 0,cee=e=>{if(e==null||typeof e!="object"&&typeof e!="function")return e;const t=pa(e);if(t===null&&aee(e))return e;const n=Object.create(null),o=Object.create(null),s=[];let r=e;for(;r!=null&&s.indexOf(r)===-1;){s.push(r);const i=r===e?t:pa(r);if(Mv(r,i,r===e))break;const a=Object.getOwnPropertyNames(r);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(r));for(const l of a)rM(l)||ga(o,l)||(n[l]=e[l],o[l]=!0);r=i}return n},SE=(e=>t=>{const n=iee.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),br=e=>(e=e.toLowerCase(),t=>SE(t)===e),Nv=e=>t=>typeof t===e,{isArray:xc}=Array,Ic=Nv("undefined");function ud(e){return e!==null&&!Ic(e)&&e.constructor!==null&&!Ic(e.constructor)&&Es(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const iM=br("ArrayBuffer");function uee(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&iM(e.buffer),t}const dee=Nv("string"),Es=Nv("function"),hee=Nv("number"),dd=e=>e!==null&&typeof e=="object",fee=e=>e===!0||e===!1,Lv=e=>{if(!dd(e))return!1;const t=pa(e);return(t===null||t===Object.prototype||pa(t)===null)&&(Mv(e,t,!0)||!ga(e,sM)&&!ga(e,Kf))},pee=e=>{if(!dd(e)||ud(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},gee=br("Date"),mee=br("File"),vee=e=>!!(e&&typeof e.uri<"u"),yee=e=>e&&typeof e.getParts<"u",wee=br("Blob"),Cee=br("FileList"),bee=br("Set"),See=e=>dd(e)&&Es(e.pipe);function Eee(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const aM=Eee(),lM=typeof aM.FormData<"u"?aM.FormData:void 0,_ee=e=>{if(!e)return!1;if(lM&&e instanceof lM)return!0;const t=pa(e);if(!t||t===Object.prototype||!Es(e.append))return!1;const n=SE(e);return n==="formdata"||n==="object"&&Es(e.toString)&&e.toString()==="[object FormData]"},Ree=br("URLSearchParams"),[Tee,Dee,xee,Iee]=["ReadableStream","Request","Response","Headers"].map(br),Aee=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),xc(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(ud(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function Pee(e,t){if(ud(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const Ac=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,cM=e=>!Ic(e)&&e!==Ac;function EE(...e){const{caseless:t,skipUndefined:n}=cM(this)&&this||{},o={},s=t?Object.create(null):null,r=(i,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;let l=a;if(s&&typeof a=="string"){const u=a.toLowerCase(),d=s[u];d!==void 0&&ga(o,d)?l=d:s[u]=a}const c=ga(o,l)?o[l]:void 0;Lv(c)&&Lv(i)?o[l]=EE(c,i):Lv(i)?o[l]=EE({},i):xc(i)?o[l]=i.slice():(!n||!Ic(i))&&(o[l]=i)};for(let i=0,a=e.length;i<a;i++){const l=e[i];if(!l||ud(l)||(qf(l,r),typeof l!="object"||xc(l)||!Object.getOwnPropertySymbols))continue;const c=Object.getOwnPropertySymbols(l);for(let u=0;u<c.length;u++){const d=c[u];Uee.call(l,d)&&r(l[d],d)}}return o}const kee=(e,t,n,{allOwnKeys:o}={})=>(qf(t,(s,r)=>{n&&Es(s)?Object.defineProperty(e,r,{__proto__:null,value:oM(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),Fee=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Oee=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Mee=(e,t,n,o)=>{let s,r,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)i=s[r],(!o||o(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&pa(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Nee=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},Lee=e=>{if(!e)return null;if(xc(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,o=new Set;let s=e;for(;s!=null&&n.size<t;){if(o.has(s))return null;o.add(s);const i=pa(s);if(Mv(s,i,s===e))break;Object.getOwnPropertyNames(s).forEach(a=>{const l=+a;Number.isInteger(l)&&l>=0&&l<t&&String(l)===a&&ga(s,a)&&n.add(l)}),s=i}if(n.size!==t)return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Vee=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&pa(Uint8Array)),Bee=(e,t)=>{const o=(e&&e[Kf]).call(e);let s;for(;(s=o.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},$ee=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},Hee=br("HTMLFormElement"),Gee=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),{propertyIsEnumerable:Uee}=Object.prototype,Wee=br("RegExp"),uM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};qf(n,(s,r)=>{let i;(i=t(s,r,e))!==!1&&(o[r]=i||s)}),Object.defineProperties(e,o)},zee=e=>{uM(e,(t,n)=>{if(Es(e)&&["arguments","caller","callee"].includes(n))return!1;const o=e[n];if(Es(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},jee=(e,t)=>{const n={},o=s=>{s.forEach(r=>{n[r]=!0})};return xc(e)?o(e):o(String(e).split(t)),n},Kee=()=>{},qee=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Yee(e){return!!(e&&Es(e.append)&&e[sM]==="FormData"&&e[Kf])}const Xee=e=>{const t=new WeakSet,n=o=>{if(dd(o)){if(t.has(o))return;if(ud(o))return o;if(!("toJSON"in o)){t.add(o);let s;if(bee(o)){s=[];for(const r of o){const i=n(r);!Ic(i)&&s.push(i)}}else s=xc(o)?[]:{},qf(o,(r,i)=>{const a=n(r);!Ic(a)&&(s[i]=a)});return t.delete(o),s}}return o};return n(e)},Zee=br("AsyncFunction"),Jee=e=>e&&(dd(e)||Es(e))&&Es(e.then)&&Es(e.catch),dM=((e,t)=>e?setImmediate:t?((n,o)=>(Ac.addEventListener("message",({source:s,data:r})=>{s===Ac&&r===n&&o.length&&o.shift()()},!1),s=>{o.push(s),Ac.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Es(Ac.postMessage)),Qee=typeof queueMicrotask<"u"?queueMicrotask.bind(Ac):typeof J<"u"&&J.nextTick||dM,hM=e=>e!=null&&Es(e[Kf]),de={isArray:xc,isArrayBuffer:iM,isBuffer:ud,isFormData:_ee,isArrayBufferView:uee,isString:dee,isNumber:hee,isBoolean:fee,isObject:dd,isPlainObject:Lv,isEmptyObject:pee,isReadableStream:Tee,isRequest:Dee,isResponse:xee,isHeaders:Iee,isUndefined:Ic,isDate:gee,isFile:mee,isReactNativeBlob:vee,isReactNative:yee,isBlob:wee,isRegExp:Wee,isFunction:Es,isStream:See,isURLSearchParams:Ree,isTypedArray:Vee,isFileList:Cee,forEach:qf,merge:EE,extend:kee,trim:Aee,stripBOM:Fee,inherits:Oee,toFlatObject:Mee,kindOf:SE,kindOfTest:br,endsWith:Nee,toArray:Lee,forEachEntry:Bee,matchAll:$ee,isHTMLForm:Hee,hasOwnProperty:ga,hasOwnProp:ga,hasOwnInPrototypeChain:bE,getSafeProp:lee,toSafeFlatObject:cee,reduceDescriptors:uM,freezeMethods:zee,toObjectSet:jee,toCamelCase:Gee,noop:Kee,toFiniteNumber:qee,findKey:Pee,global:Ac,isContextDefined:cM,isSpecCompliantForm:Yee,toJSONObject:Xee,isAsyncFn:Zee,isThenable:Jee,setImmediate:dM,asap:Qee,isIterable:hM,isSafeIterable:e=>e!=null&&bE(e,Kf)&&hM(e)},ete=de.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"]),tte=e=>{const t=Object.create(null);let n,o,s;return e&&e.split(`
|
|
148
148
|
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),o=i.substring(s+1).trim();const a=de.hasOwnProp(t,n);!n||a&&de.hasOwnProp(ete,n)||(n==="set-cookie"?a?t[n].push(o):t[n]=[o]:t[n]=a?t[n]+", "+o:o)}),t};function nte(e){let t=0,n=e.length;for(;t<n;){const o=e.charCodeAt(t);if(o!==9&&o!==32)break;t+=1}for(;n>t;){const o=e.charCodeAt(n-1);if(o!==9&&o!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const ote=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),ste=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function _E(e,t){return de.isArray(e)?e.map(n=>_E(n,t)):nte(String(e).replace(t,""))}const rte=e=>_E(e,ote),ite=e=>_E(e,ste);function fM(e){const t=Object.create(null);return de.forEach(e.toJSON(),(n,o)=>{t[o]=ite(n)}),t}const pM=Symbol("internals");function Yf(e){return e&&String(e).trim().toLowerCase()}function Vv(e){return e===!1||e==null?e:de.isArray(e)?e.map(Vv):rte(String(e))}function ate(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const lte=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function RE(e){let t=0,n=e.length;for(;t<n;){const o=e.charCodeAt(t);if(o!==9&&o!==32)break;t+=1}for(;n>t;){const o=e.charCodeAt(n-1);if(o!==9&&o!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function cte(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let o=1;o<t;o++){const s=e.charCodeAt(o);if(s===34||s===92&&(o+=1,o>=t))return e;n+=e[o]}return n}function ute(e){const t=Object.create(null),n=String(e);let o=0,s=!1,r=!1;function i(a){const l=RE(n.slice(o,a)),c=l.indexOf("=");if(c<1)return;const u=RE(l.slice(0,c));if(!lte.test(u))return;const d=u.toLowerCase();if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=RE(l.slice(c+1));t[d]=cte(h)}for(let a=0;a<n.length;a++){const l=n.charCodeAt(a);s?r?r=!1:l===92?r=!0:l===34&&(s=!1):l===34?s=!0:(l===44||l===59)&&(i(a),o=a+1)}return i(n.length),t}const dte=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),hte="__Proto__",gM=e=>e==="__proto__"?hte:e;function TE(e,t,n,o,s){if(de.isFunction(o))return o.call(e,t,n);if(s&&(t=n),!!de.isString(t)){if(de.isString(o))return t.indexOf(o)!==-1;if(de.isRegExp(o))return o.test(t)}}function fte(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function pte(e,t){const n=de.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{__proto__:null,value:function(s,r,i){return this[o].call(this,t,s,r,i)},configurable:!0})})}let Do=class{constructor(t){t&&this.set(t)}set(t,n,o){const s=this;function r(a,l,c){const u=Yf(l);if(!u)return;const d=de.findKey(s,u);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[gM(d||l)]=Vv(a))}const i=(a,l)=>de.forEach(a,(c,u)=>r(c,u,l));if(de.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(de.isString(t)&&(t=t.trim())&&!dte(t))i(tte(t),n);else if(de.isObject(t)&&de.isSafeIterable(t)){let a=Object.create(null),l,c;for(const u of t){if(!de.isArray(u))throw new TypeError("Object iterator must return a key-value pair");c=u[0],de.hasOwnProp(a,c)?(l=a[c],a[c]=de.isArray(l)?[...l,u[1]]:[l,u[1]]):a[c]=u[1]}i(a,n)}else t!=null&&r(n,t,o);return this}get(t,n){if(t=Yf(t),t){const o=de.findKey(this,t);if(o){const s=this[o];if(!n)return s;if(n===!0)return ate(s);if(de.isFunction(n))return n.call(this,s,o);if(de.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Yf(t),t){const o=de.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||TE(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let s=!1;function r(i){if(i=Yf(i),i){const a=de.findKey(o,i);a&&(!n||TE(o,o[a],a,n))&&(delete o[a],s=!0)}}return de.isArray(t)?t.forEach(r):r(t),s}clear(t){const n=Object.keys(this);let o=n.length,s=!1;for(;o--;){const r=n[o];(!t||TE(this,this[r],r,t,!0))&&(delete this[r],s=!0)}return s}normalize(t){const n=this,o=Object.create(null);return de.forEach(this,(s,r)=>{const i=de.findKey(o,r);if(i){n[i]=Vv(s),delete n[r];return}const a=gM(t?fte(r):String(r).trim());a!==r&&delete n[r],n[a]=Vv(s),o[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return de.forEach(this,(o,s)=>{o!=null&&o!==!1&&(n[s]=t&&de.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
149
149
|
`)}getSetCookie(){const t=this.get("set-cookie");return de.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return ute(t)}static concat(t,...n){const o=new this(t);return n.forEach(s=>o.set(s)),o}static accessor(t){const o=(this[pM]=this[pM]={accessors:{}}).accessors,s=this.prototype;function r(i){const a=Yf(i);o[a]||(pte(s,i),o[a]=!0)}return de.isArray(t)?t.forEach(r):r(t),this}};Do.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),de.reduceDescriptors(Do.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),de.freezeMethods(Do);const Bv="[REDACTED ****]";function gte(e){if(de.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(de.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function mte(e,t){const n=new Set(t.map(r=>String(r).toLowerCase())),o=[],s=r=>{if(r===null||typeof r!="object"||de.isBuffer(r))return r;if(o.indexOf(r)!==-1)return;r instanceof Do&&(r=r.toJSON()),o.push(r);let i;if(de.isArray(r))i=[],r.forEach((a,l)=>{const c=s(a);de.isUndefined(c)||(i[l]=c)});else{if(!de.isPlainObject(r)&>e(r))return o.pop(),r;i=Object.create(null);for(const[a,l]of Object.entries(r)){const c=n.has(a.toLowerCase())?Bv:s(l);de.isUndefined(c)||(i[a]=c)}}return o.pop(),i};return s(e)}function mM(e){try{return String(e)}catch{return""}}function vte(e){return e.errors.map(n=>{try{return n&&n.message?mM(n.message):mM(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}const yte=`
|
|
150
150
|
Caused by: `,DE=Symbol("causeStack");function wte(e,t){const n=de.hasOwnProp(e,DE)&&e[DE];return n&&t.endsWith(n)?t.length-n.length:-1}function Cte(e,t){try{const n=t&&t.stack;if(typeof n!="string"||!n)return;const o=e.stack;if(typeof o!="string"||!o)return;const s=yte+n;e.stack=o+s,Object.defineProperty(e,DE,{__proto__:null,value:s})}catch{}}let at=class tU extends Error{static from(t,n,o,s,r,i){let a=t.message;!a&&de.isArray(t.errors)&&t.errors.length&&(a=vte(t));const l=new tU(a,n||t.code,o,s,r);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,Cte(l,t),t.status!=null&&l.status==null&&(l.status=t.status),i&&Object.assign(l,i),l}constructor(t,n,o,s,r){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),o&&(this.config=o),s&&(this.request=s),r&&(this.response=r,this.status=r.status)}toJSON(){const t=this.config,n=t&&de.hasOwnProp(t,"redact")?t.redact:void 0,o=de.isArray(n)&&n.length>0?mte(t,n):de.toJSONObject(t);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:o,code:this.code,status:this.status}}};at.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",at.ERR_BAD_OPTION="ERR_BAD_OPTION",at.ECONNABORTED="ECONNABORTED",at.ETIMEDOUT="ETIMEDOUT",at.ECONNREFUSED="ECONNREFUSED",at.ERR_NETWORK="ERR_NETWORK",at.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",at.ERR_DEPRECATED="ERR_DEPRECATED",at.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",at.ERR_BAD_REQUEST="ERR_BAD_REQUEST",at.ERR_CANCELED="ERR_CANCELED",at.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",at.ERR_INVALID_URL="ERR_INVALID_URL",at.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const bte=null,vM=100;function xE(e){return de.isPlainObject(e)||de.isArray(e)}function yM(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function IE(e,t,n){return e?e.concat(t).map(function(s,r){return s=yM(s),!n&&r?"["+s+"]":s}).join(n?".":""):t}function Ste(e){return de.isArray(e)&&!e.some(xE)}const Ete=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function $v(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(S,b)=>{const y=de.getSafeProp(n,S);return de.isUndefined(y)?b:y},s=o("metaTokens",!0),r=o("visitor")||g,i=o("dots",!1),a=o("indexes",!1),l=o("Blob")||typeof Blob<"u"&&Blob,c=o("maxDepth",vM),u=l&&de.isSpecCompliantForm(t),d=[];if(!de.isFunction(r))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(de.isDate(S))return S.toISOString();if(de.isBoolean(S))return S.toString();if(!u&&de.isBlob(S))throw new at("Blob is not supported. Use a Buffer instead.");if(de.isArrayBuffer(S)||de.isTypedArray(S)){if(u&&typeof l=="function")return new l([S]);throw new at("Blob is not supported. Use a Buffer instead.",at.ERR_NOT_SUPPORT)}return S}function f(S){if(S>c)throw new at("Object is too deeply nested ("+S+" levels). Max depth: "+c,at.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(S,b){if(c===1/0)return JSON.stringify(S);const y=[];return JSON.stringify(S,function(_,x){if(!de.isObject(x))return x;for(;y.length&&y[y.length-1]!==this;)y.pop();return y.push(x),f(b+y.length-1),x})}function g(S,b,y){let E=S;if(de.isReactNative(t)&&de.isReactNativeBlob(S))return t.append(IE(y,b,i),h(S)),!1;if(S&&!y&&typeof S=="object"){if(de.endsWith(b,"{}"))b=s?b:b.slice(0,-2),S=p(S,1);else if(de.isArray(S)&&Ste(S)||(de.isFileList(S)||de.endsWith(b,"[]"))&&(E=de.toArray(S)))return b=yM(b),E.forEach(function(x,R){!(de.isUndefined(x)||x===null)&&t.append(a===!0?IE([b],R,i):a===null?b:b+"[]",h(x))}),!1}return xE(S)?!0:(t.append(IE(y,b,i),h(S)),!1)}const v=Object.assign(Ete,{defaultVisitor:g,convertValue:h,isVisitable:xE});function C(S,b,y=0){if(!de.isUndefined(S)){if(f(y),d.indexOf(S)!==-1)throw new Error("Circular reference detected in "+b.join("."));d.push(S),de.forEach(S,function(_,x){(!(de.isUndefined(_)||_===null)&&r.call(t,_,de.isString(x)?x.trim():x,b,v))===!0&&C(_,b?b.concat(x):[x],y+1)}),d.pop()}}if(!de.isObject(e))throw new TypeError("data must be an object");return C(e),t}function wM(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(o){return t[o]})}function AE(e,t){this._pairs=[],e&&$v(e,this,t)}const CM=AE.prototype;CM.append=function(t,n){this._pairs.push([t,n])},CM.toString=function(t){const n=t?o=>t.call(this,o,wM):wM;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function _te(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function bM(e,t,n){if(!t)return e;e=e||"";const o=de.isFunction(n)?{serialize:n}:n,s=de.getSafeProp(o,"encode")||_te,r=de.getSafeProp(o,"serialize");let i;if(r?i=r(t,o):i=de.isURLSearchParams(t)?t.toString():new AE(t,o).toString(s),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}const Xf=Symbol("internals");function SM(e){return e?e.length:0}function EM(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function Rte(e){return typeof e=="string"&&e!==""&&String(Number(e))===e?Number(e):e}function Zf(e,t){const n=e.handlers,o=SM(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):o!==t.handlersLength&&(o?t.handlerEntries.forEach(function(r,i){n[r.index]!==r.handler&&t.handlerEntries.delete(i)}):t.handlerEntries.clear()),t.handlersLength=o}class _M{constructor(){this.handlers=[],this[Xf]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(t,n,o){const s={fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null},r=this[Xf];this.handlers==null&&(this.handlers=[]),Zf(this,r);const i=r.nextId++;return this.handlers.push(s),r.handlerEntries.set(i,{handler:s,index:this.handlers.length-1}),r.handlersLength=this.handlers.length,i}eject(t){const n=this[Xf];Zf(this,n);const o=Rte(t),s=n.handlerEntries.get(o);if(s){if(n.handlerEntries.delete(o),this.handlers[s.index]!==s.handler)return;this.handlers[s.index]=null,n.iterationDepth||(EM(this.handlers),n.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Zf(this,this[Xf]))}forEach(t){const n=this[Xf];Zf(this,n),n.iterationDepth++;try{de.forEach(this.handlers,function(s){s!==null&&t(s)})}finally{--n.iterationDepth||(Zf(this,n),EM(this.handlers),n.handlersLength=SM(this.handlers))}}}const PE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0,encodeBasicAuthUsername:!1},Tte={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:AE,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},kE=typeof window<"u"&&typeof document<"u",FE=typeof navigator=="object"&&navigator||void 0,Dte=kE&&(!FE||["ReactNative","NativeScript","NS"].indexOf(FE.product)<0),xte=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ite=kE&&window.location.href||"http://localhost",vo={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:kE,hasStandardBrowserEnv:Dte,hasStandardBrowserWebWorkerEnv:xte,navigator:FE,origin:Ite},Symbol.toStringTag,{value:"Module"})),...Tte};function Ate(e,t){return $v(e,new vo.classes.URLSearchParams,{visitor:function(n,o,s,r){return vo.isNode&&de.isBuffer(n)?(this.append(o,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}const RM=vM;function TM(e){if(e>RM)throw new at("FormData field is too deeply nested ("+e+" levels). Max depth: "+RM,at.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Pte(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let o;for(;(o=n.exec(e))!==null;)TM(t.length),t.push(o[0]==="[]"?"":o[1]||o[0]);return t}function DM(e){const t={},n=Object.keys(e);let o;const s=n.length;let r;for(o=0;o<s;o++)r=n[o],t[r]=e[r];return t}function xM(e){if(!de.isArray(e))return e;const t=Object.keys(e);return t.length!==e.length||t.some((n,o)=>n!==String(o))?DM(e):e}function kte(e){const t=[e];for(;t.length;){const n=t.pop();Object.keys(n).forEach(o=>{const s=n[o]=xM(n[o]);(de.isArray(s)||de.isPlainObject(s))&&t.push(s)})}return e}function IM(e){function t(n,o,s,r){TM(r);let i=n[r++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=r>=n.length;return i=!i&&de.isArray(s)?s.length:i,l?(de.hasOwnProp(s,i)?(s[i]=xM(s[i]),s[i]=de.isArray(s[i])?s[i].concat(o):[s[i],o]):s[i]=o,!a):((!de.hasOwnProp(s,i)||!de.isObject(s[i]))&&(s[i]=[]),t(n,o,s[i],r)&&de.isArray(s[i])&&(s[i]=DM(s[i])),!a)}if(de.isFormData(e)&&de.isFunction(e.entries)){const n={};return de.forEachEntry(e,(o,s)=>{t(Pte(o),s,n,0)}),kte(n)}return null}const AM=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),hd=(e,t)=>e!=null&&de.hasOwnProp(e,t)?e[t]:void 0;function Fte(e,t,n){if(de.isString(e))try{return(t||JSON.parse)(e),de.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Jf={transitional:PE,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",s=o.indexOf("application/json")>-1,r=de.isObject(t);if(r&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return s?JSON.stringify(IM(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t)||de.isReadableStream(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){const l=hd(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return Ate(t,l).toString();if((a=de.isFileList(t))||o.indexOf("multipart/form-data")>-1){const c=hd(this,"env"),u=c&&c.FormData;return $v(a?{"files[]":t}:t,u&&new u,l)}}return r||s?(n.setContentType("application/json",!1),Fte(t)):t}],transformResponse:[function(t){const n=hd(this,"transitional")||Jf.transitional,o=n&&n.forcedJSONParsing,s=hd(this,"responseType"),r=s==="json";if(de.isResponse(t)||de.isReadableStream(t))return t;if(t&&de.isString(t)&&(o&&!s||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,hd(this,"parseReviver"))}catch(l){if(a)throw l.name==="SyntaxError"?at.from(l,at.ERR_BAD_RESPONSE,this,null,hd(this,"response")):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vo.classes.FormData,Blob:vo.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(AM,e=>{Jf.headers[e]={}});function OE(e,t){const n=this||Jf,o=t||n,s=Do.from(o.headers);let r=o.data;return de.forEach(e,function(a){r=a.call(n,r,s.normalize(),t?t.status:void 0)}),s.normalize(),r}function PM(e){return!!(e&&e.__CANCEL__)}let Qf=class extends at{constructor(t,n,o){super(t??"canceled",at.ERR_CANCELED,n,o),this.name="CanceledError",this.__CANCEL__=!0}};function kM(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new at("Request failed with status code "+n.status,n.status>=400&&n.status<500?at.ERR_BAD_REQUEST:at.ERR_BAD_RESPONSE,n.config,n.request,n))}const Ote=/[\t\n\r]/g;function FM(e){if(typeof e!="string")return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Ote,"")}function ME(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1].toLowerCase()||""}const OM=e=>{try{return decodeURIComponent(e)}catch{return e}},MM=vo.hasStandardBrowserEnv?{write(e,t,n,o,s,r,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];de.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),de.isString(o)&&a.push(`path=${o}`),de.isString(s)&&a.push(`domain=${s}`),r===!0&&a.push("secure"),de.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie;if(!t)return null;const n=t.split(";");for(let o=0;o<n.length;o++){const s=n[o].replace(/^\s+/,""),r=s.indexOf("=");if(r!==-1&&s.slice(0,r)===e)return OM(s.slice(r+1))}return null},async readAsync(e){try{const t=typeof window<"u"&&window.cookieStore;if(t&&de.isFunction(t.get)){const n=await t.get(e);return n?OM(n.value):null}}catch{}return this.read(e)},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},async readAsync(){return null},remove(){}};function Mte(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s=0,r=0,i;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=o[r];i||(i=c),n[s]=l,o[s]=c;let d=r,h=0;for(;d!==s;)h+=n[d++],d=d%e;if(s=(s+1)%e,s===r&&(r=(r+1)%e),c-i<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Nte(e,t){let n=0,o=1e3/t,s,r;const i=(u,d=Date.now())=>{n=d,s=null,r&&(clearTimeout(r),r=null),e(...u)};return[(...u)=>{const d=Date.now(),h=d-n;h>=o?i(u,d):(s=u,r||(r=setTimeout(()=>{r=null,i(s)},o-h)))},()=>s&&i(s),(...u)=>i(u)]}const Hv=(e,t,n=3)=>{let o=0;const s=Mte(50,250);return Nte(r=>{if(!r||!de.isNumber(r.loaded))return;const i=r.loaded,a=r.lengthComputable?r.total:void 0,l=Math.max(0,a!=null?Math.min(i,a):i),c=Math.max(0,l-o),u=s(c);o=Math.max(o,l);const d={loaded:l,total:a,progress:a?l/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-l)/u:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},NM=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},LM=(e,t=de.asap)=>(...n)=>t(()=>e(...n)),Lte=vo.hasStandardBrowserEnv?(e=>t=>(t=new URL(t,document.baseURI||vo.origin),e.protocol===t.protocol&&e.host===t.host&&e.port===t.port))(new URL(vo.origin)):()=>!0;function Vte(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Bte(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const $te=/^https?:(?!\/\/)/i;function Hte(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,o="")=>`${n}${o}${Bv}`)}function Gte(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Bv}@`),n=t.indexOf("#"),s=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Bv}`);return n===-1?s:`${s}#${Hte(t.slice(n+1))}`}function VM(e,t){if(typeof e=="string"){const n=FM(e);if($te.test(n))throw new at(`Invalid URL ${JSON.stringify(Gte(n))}: missing "//" after protocol`,at.ERR_INVALID_URL,t)}}function BM(e,t,n,o){VM(t,o);let s=!Vte(t);return e&&(s||n===!1)?(VM(e,o),Bte(e,t)):t}function Ute(e){const t=[{value:e}],n=new WeakSet,o=new WeakSet;for(;t.length;){const{value:s,done:r}=t.pop();if(!de.isPlainObject(s)&&!de.isArray(s))continue;if(r){n.delete(s);continue}if(n.has(s))throw new at("Circular reference detected in params",at.ERR_BAD_OPTION_VALUE);if(o.has(s))continue;o.add(s),n.add(s),t.push({value:s,done:!0});const i=Object.keys(s);Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertySymbols(s).forEach(a=>{const l=Object.getOwnPropertyDescriptor(s,a);l&&l.enumerable&&i.push(a)}),i.forEach(a=>{if(a==="__proto__"||a==="constructor"||a==="prototype"){const l=Object.getOwnPropertyDescriptor(s,a);l&&de.hasOwnProp(l,"value")&&t.push({value:l.value})}else t.push({value:s[a]})})}}const $M=e=>e instanceof Do?{...e}:e,NE=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>{const n=Object.getOwnPropertyDescriptor(e,t);return n&&n.enumerable})):Object.keys(e);function Wte(e,t){const n=[],o=new WeakMap,s={};function r(a,l){if(!de.isPlainObject(l))return de.isArray(l)?l.slice():l;const c=de.isPlainObject(a)?a:s;let u=o.get(l);if(u||(u=new WeakMap,o.set(l,u)),u.has(c))return u.get(c);const d={};return u.set(c,d),n.push({base:c,source:l,result:d}),d}const i=de.isUndefined(t)?r(void 0,e):r(e,t);for(;n.length;){const{base:a,source:l,result:c}=n.pop(),u=new Set(NE(a)),d=new Set(NE(l));new Set([...u,...d]).forEach(f=>{if(f==="__proto__"||f==="constructor"||f==="prototype")return;const p=d.has(f),g=p?l[f]:void 0,v=(!p||de.isPlainObject(g))&&u.has(f)?a[f]:void 0;c[f]=p?r(v,g):r(void 0,v)})}return Ute(i),i}function fl(e,t,n,o){return de.isPlainObject(e)&&de.isPlainObject(t)?de.merge.call({caseless:o},e,t):de.isPlainObject(t)?de.merge({},t):de.isArray(t)?t.slice():t}function HM(e,t,n,o){if(de.isUndefined(t)){if(!de.isUndefined(e))return fl(void 0,e,n,o)}else return fl(e,t,n,o)}function LE(e,t){if(!de.isUndefined(t))return fl(void 0,t)}function Hn(e,t){if(de.isUndefined(t)){if(!de.isUndefined(e))return fl(void 0,e)}else return fl(void 0,t)}function zte(e,t,n){const o=de.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!de.isUndefined(o))if(de.isPlainObject(o)){if(de.hasOwnProp(o,n))return o[n]}else return;const s=de.hasOwnProp(e,"transitional")?e.transitional:void 0;if(de.isPlainObject(s)&&de.hasOwnProp(s,n))return s[n]}function VE(e,t,n,o,s){if(de.hasOwnProp(s,n))return fl(e,t);if(de.hasOwnProp(o,n))return fl(void 0,e)}function jte(e,t,n){return HM($M(e),$M(t),n,!0)}const Kte=Object.freeze({__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0}),GM={url:LE,method:LE,data:LE,baseURL:Hn,transformRequest:Hn,transformResponse:Hn,params:Wte,paramsSerializer:Hn,timeout:Hn,timeoutErrorMessage:Hn,withCredentials:Hn,withXSRFToken:Hn,adapter:Hn,responseType:Hn,xsrfCookieName:Hn,xsrfHeaderName:Hn,onUploadProgress:Hn,onDownloadProgress:Hn,decompress:Hn,maxContentLength:Hn,maxBodyLength:Hn,beforeRedirect:Hn,transport:Hn,httpAgent:Hn,httpsAgent:Hn,cancelToken:Hn,socketPath:Hn,allowedSocketPaths:Hn,responseEncoding:Hn,validateStatus:VE,headers:jte};function Pc(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",Kte);const o=NE({...e,...t});for(let s=0,r=o.length;s<r;s++){const i=o[s];if(i==="__proto__"||i==="constructor"||i==="prototype")continue;const a=de.hasOwnProp(GM,i)?GM[i]:HM,l=de.hasOwnProp(e,i)?e[i]:void 0,c=de.hasOwnProp(t,i)?t[i]:void 0,u=a===VE?a(l,c,i,e,t):a(l,c,i);de.isUndefined(u)&&a!==VE||(n[i]=u)}return de.hasOwnProp(t,"validateStatus")&&de.isUndefined(t.validateStatus)&&zte(e,t,"validateStatusUndefinedResolves")===!1&&(de.hasOwnProp(e,"validateStatus")?n.validateStatus=fl(void 0,e.validateStatus):delete n.validateStatus),n}const qte=["content-type","content-length"];function Yte(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([o,s])=>{qte.includes(o.toLowerCase())&&e.set(o,s)})}const UM=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),Xte=e=>MM.read(e);function WM(e,t=Xte){const n=Pc({},e),o=f=>de.hasOwnProp(n,f)?n[f]:void 0,s=o("data");let r=o("withXSRFToken");const i=o("xsrfHeaderName"),a=o("xsrfCookieName");let l=o("headers");const c=o("auth"),u=o("baseURL"),d=o("allowAbsoluteUrls"),h=o("url");if(n.headers=l=Do.from(l),n.url=bM(BM(u,h,d,n),o("params"),o("paramsSerializer")),c){const f=de.getSafeProp(c,"username")||"",p=de.getSafeProp(c,"password")||"",g=o("transitional"),v=g&&de.hasOwnProp(g,"encodeBasicAuthUsername")&&g.encodeBasicAuthUsername===!0;try{l.set("Authorization","Basic "+btoa((v?UM(f):f)+":"+(p?UM(p):"")))}catch(C){throw at.from(C,at.ERR_BAD_OPTION_VALUE,e)}}if(de.isFormData(s)){const f=de.getSafeProp(s,"getHeaders");vo.hasStandardBrowserEnv||vo.hasStandardBrowserWebWorkerEnv||de.isReactNative(s)?l.setContentType(void 0):de.isFunction(f)&&Yte(l,f.call(s),o("formDataHeaderPolicy"))}if(vo.hasStandardBrowserEnv&&(de.isFunction(r)&&(r=r(n)),r===!0||r==null&&Lte(n.url))){const p=i&&a&&t(a);p&&l.set(i,p)}return n}const Zte=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){let s;try{const R=vo.hasStandardBrowserEnv&&typeof window<"u"&&window.cookieStore;s=R&&de.isFunction(R.get)}catch{}let r;const i=WM(e,s?R=>(r=R,null):void 0);let a=i.data;const l=Do.from(i.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:d}=i,h,f,p,g,v,C,S;function b(){clearTimeout(f);try{v&&v()}catch(R){setTimeout(()=>{throw R})}try{C&&C()}catch(R){setTimeout(()=>{throw R})}y&&(g&&y.removeEventListener("progress",g),y.upload&&(p&&y.upload.removeEventListener("progress",p),v&&y.upload.removeEventListener("loadend",v))),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function E(R){if(!y)return;if(y.status===0&&(ME(FM(i.url))||ME(vo.origin))!=="file"&&!(y.responseURL&&y.responseURL.startsWith("file:"))){o(new at("Request aborted",at.ECONNABORTED,e,y)),b(),y=null;return}try{R?S&&S(R):C&&C()}catch(k){setTimeout(()=>{throw k})}if(!y)return;const P=Do.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),I={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:P,config:e,request:y};kM(function(A){n(A),b()},function(A){o(A),b()},I),y=null}if("onloadend"in y?y.onloadend=E:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(E)},y.onabort=function(){y&&(o(new at("Request aborted",at.ECONNABORTED,e,y)),b(),y=null)},y.onerror=function(P){const N=P&&P.message?P.message:"Network Error",I=new at(N,at.ERR_NETWORK,e,y);I.event=P||null,o(I),b(),y=null},y.ontimeout=function(){if(!y)return;let P=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const N=i.transitional||PE;i.timeoutErrorMessage&&(P=i.timeoutErrorMessage),o(new at(P,N.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,e,y)),b(),y=null},a===void 0&&l.setContentType(null),de.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),c&&c!=="json"&&(y.responseType=i.responseType),d&&([g,C,S]=Hv(d,!0),y.addEventListener("progress",g)),u&&y.upload&&([p,v]=Hv(u),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",v)),i.cancelToken||i.signal){if(h=R=>{if(!y)return;o(!R||R.type?new Qf(null,e,y):R);const P=y;b(),y=null,P.abort()},i.cancelToken&&i.cancelToken.subscribe(h),!y)return;i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h))}if(!y)return;const _=ME(i.url);if(_&&!vo.protocols.includes(_)){o(new at("Unsupported protocol "+_+":",at.ERR_BAD_REQUEST,e)),b();return}const x=()=>{y&&("setRequestHeader"in y&&de.forEach(fM(l),function(P,N){y.setRequestHeader(N,P)}),y.send(a||null))};if(r){const R=typeof performance<"u"&&de.isFunction(performance.now)?()=>performance.now():Date.now,P=y.timeout>0?R()+Number(y.timeout):void 0,N=()=>{if(!y)return;const I=y;I.ontimeout(),I.abort()};if(P!==void 0){const I=()=>{const k=P-R();k>0?f=setTimeout(I,Math.min(k,2147483647)):N()};I()}MM.readAsync(r).then(I=>{if(y){if(P!==void 0&&R()>=P){N();return}if(I){const k=de.hasOwnProp(i,"xsrfHeaderName")&&i.xsrfHeaderName;l.set(k,I)}x()}}).catch(I=>{y&&(o(at.from(I,null,e,y)),b(),y=null)})}else x()})},Jte=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let o=!1;const s=function(l){if(!o){o=!0,i();const c=l instanceof Error?l:this.reason;n.abort(c instanceof at?c:new Qf(c instanceof Error?c.message:c))}};let r=t&&setTimeout(()=>{r=null,s(new at(`timeout of ${t}ms exceeded`,at.ETIMEDOUT))},t);const i=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(l=>{const c=de.getSafeProp(l,"unsubscribe");de.isFunction(c)?c.call(l,s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>{if(!o){if(l.aborted){s.call(l);return}l.addEventListener("abort",s,{once:!0})}});const{signal:a}=n;return a.unsubscribe=()=>de.asap(i),a},Qte=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,s;for(;o<n;)s=o+t,yield e.slice(o,s),o=s},ene=async function*(e,t){for await(const n of tne(e))yield*Qte(n,t)},tne=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},zM=(e,t,n,o)=>{const s=ene(e,t);let r=0,i,a=l=>{i||(i=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await s.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},pl=`\r
|
|
@@ -156,7 +156,7 @@ Caused by: `,DE=Symbol("causeStack");function wte(e,t){const n=de.hasOwnProp(e,D
|
|
|
156
156
|
`),l=a===-1?-1:i.indexOf(`
|
|
157
157
|
`,a+1),c=l===-1?i:i.slice(l+1),u=String(o.stack),d=wte(o,u),h=d===-1?u:u.slice(0,d),f=d===-1?"":u.slice(d);h.endsWith(c)||(o.stack=h+`
|
|
158
158
|
`+i+f)}}catch{}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Pc(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:r}=n;o!==void 0&&jv.assertOptions(o,{silentJSONParsing:Mo.transitional(Mo.boolean),forcedJSONParsing:Mo.transitional(Mo.boolean),clarifyTimeoutError:Mo.transitional(Mo.boolean),legacyInterceptorReqResOrdering:Mo.transitional(Mo.boolean),advertiseZstdAcceptEncoding:Mo.transitional(Mo.boolean),validateStatusUndefinedResolves:Mo.transitional(Mo.boolean),encodeBasicAuthUsername:Mo.transitional(Mo.boolean)},!1),s!=null&&(de.isFunction(s)?n.paramsSerializer={serialize:s}:jv.assertOptions(s,{encode:Mo.function,serialize:Mo.function},!0)),n.allowAbsoluteUrls!==void 0||(de.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jv.assertOptions(n,{baseUrl:Mo.spelling("baseURL"),withXsrfToken:Mo.spelling("withXSRFToken")},!0),n.method=(de.getSafeProp(n,"method")||de.getSafeProp(this.defaults,"method")||"get").toLowerCase();const i=de.getSafeProp(r,"common"),a=de.getSafeProp(r,n.method),l=r&&de.merge(UE(i)?i:void 0,UE(a)?a:void 0);r&&de.forEach(AM.concat("common"),v=>{UE(de.getSafeProp(r,v))&&delete r[v]}),n.headers=Do.concat(l,r);const c=[];let u=!0;this.interceptors.request.forEach(function(C){if(typeof C.runWhen=="function"&&C.runWhen(n)===!1)return;u=u&&C.synchronous;const S=n.transitional||PE;S&&S.legacyInterceptorReqResOrdering?c.unshift(C.fulfilled,C.rejected):c.push(C.fulfilled,C.rejected)});const d=[];this.interceptors.response.forEach(function(C){d.push(C.fulfilled,C.rejected)});let h,f=0,p;if(!u){const v=[GE.bind(this),void 0];for(v.unshift(...c),v.push(...d),p=v.length,h=Promise.resolve(n);f<p;)h=h.then(v[f++],v[f++]);return h}p=c.length;let g=n;for(;f<p;){const v=c[f++],C=c[f++];try{g=v?v(g):g}catch(S){if(!C){h=Promise.reject(S);break}try{const b=C.call(this,S);de.isThenable(b)&&(h=Promise.resolve(b).then(()=>GE.call(this,g)))}catch(b){h=Promise.reject(b)}break}}if(!h)try{h=GE.call(this,g)}catch(v){h=Promise.reject(v)}for(f=0,p=d.length;f<p;)h=h.then(d[f++],d[f++]);return h}getUri(t){t=Pc(this.defaults,t);const n=BM(t.baseURL,t.url,t.allowAbsoluteUrls,t);return bM(n,t.params,t.paramsSerializer)}};de.forEach(["delete","get","head","options"],function(t){kc.prototype[t]=async function(n,o){return this.request(Pc(o||{},{method:t,url:n,data:o&&de.hasOwnProp(o,"data")?o.data:void 0}))}}),de.forEach(["post","put","patch","query"],function(t){function n(o){return async function(r,i,a){return this.request(Pc(a||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}kc.prototype[t]=n(),t!=="query"&&(kc.prototype[t+"Form"]=n(!0))});let yne=class nU{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const o=this;this.promise.then(s=>{if(!o._listeners)return;let r=o._listeners.length;for(;r-- >0;)o._listeners[r](s);o._listeners=null}),this.promise.then=s=>{let r;const i=new Promise(a=>{o.subscribe(a),r=a}).then(s);return i.cancel=function(){o.unsubscribe(r)},i},t(function(r,i,a){o.reason||(o.reason=new Qf(r,i,a),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new nU(function(s){t=s}),cancel:t}}};function wne(e){return function(n){return e.apply(null,n)}}function Cne(e){return de.isObject(e)&&e.isAxiosError===!0}const Kv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Kv).forEach(([e,t])=>{Kv[t]===void 0&&(Kv[t]=e)});function rN(e){const t=new kc(e),n=oM(kc.prototype.request,t);return de.extend(n,kc.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return rN(Pc(e,s))},n}const to=rN(Jf);to.Axios=kc,to.CanceledError=Qf,to.CancelToken=yne,to.isCancel=PM,to.VERSION=BE,to.toFormData=$v,to.AxiosError=at,to.Cancel=to.CanceledError,to.all=function(t){return Promise.all(t)},to.spread=wne,to.isAxiosError=Cne,to.mergeConfig=Pc,to.AxiosHeaders=Do,to.formToJSON=e=>IM(de.isHTMLForm(e)?new FormData(e):e),to.getAdapter=nN.getAdapter,to.HttpStatusCode=Kv,to.default=to;const{Axios:Hxe,AxiosError:Gxe,CanceledError:Uxe,isCancel:Wxe,CancelToken:zxe,VERSION:jxe,all:Kxe,Cancel:qxe,isAxiosError:bne,spread:Yxe,toFormData:Xxe,AxiosHeaders:Zxe,HttpStatusCode:Jxe,formToJSON:Qxe,getAdapter:eIe,mergeConfig:tIe,create:nIe}=to;class tp extends Error{constructor(t,n,o,s,r){super(t),this.name="ApiError",this.statusCode=n,this.code=o,this.details=s,this.type=r,Object.setPrototypeOf(this,tp.prototype)}}const Sne=e=>{var t,n;if(bne(e)){const o=(t=e.response)==null?void 0:t.status,s=(n=e.response)==null?void 0:n.data,r=(s==null?void 0:s.message)||e.message||"An unexpected error occurred",i=(s==null?void 0:s.code)||e.code,a=(s==null?void 0:s.details)||s;let l="UNKNOWN";return!o||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":o>=500?l="SERVER":o===Us.UNAUTHORIZED||o===Us.FORBIDDEN?l="AUTH":o===Us.UNPROCESSABLE_ENTITY||o===Us.BAD_REQUEST?l="VALIDATION":o>=Us.BAD_REQUEST&&(l="CLIENT"),new tp(r,o,i,a,l)}return e instanceof Error?new tp(e.message,void 0,void 0,void 0,"UNKNOWN"):new tp("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};function iN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function aN(e,t,n,o,s,r,i){try{var a=e[r](i),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(o,s)}function WE(e){return function(){var t=this,n=arguments;return new Promise(function(o,s){var r=e.apply(t,n);function i(l){aN(r,o,s,i,a,"next",l)}function a(l){aN(r,o,s,i,a,"throw",l)}i(void 0)})}}function zE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ene(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,cN(o.key),o)}}function jE(e,t,n){return t&&Ene(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _ne(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=xne(e))||t){n&&(e=n);var o=0,s=function(){};return{s,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
159
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){a=!0,r=l},f:function(){try{i||n.return==null||n.return()}finally{if(a)throw r}}}}function fd(e,t,n){return(t=cN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function pd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lN(Object(n),!0).forEach(function(o){fd(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Rne(e,t){if(e==null)return{};var n,o,s=Tne(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function Tne(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function Fc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(f,p,g,v){var C=p&&p.prototype instanceof a?p:a,S=Object.create(C.prototype);return Ws(S,"_invoke",function(b,y,E){var _,x,R,P=0,N=E||[],I=!1,k={p:0,n:0,v:e,a:A,f:A.bind(e,4),d:function(M,V){return _=M,x=0,R=e,k.n=V,i}};function A(M,V){for(x=M,R=V,t=0;!I&&P&&!B&&t<N.length;t++){var B,z=N[t],ne=k.p,re=z[2];M>3?(B=re===V)&&(R=z[(x=z[4])?5:(x=3,3)],z[4]=z[5]=e):z[0]<=ne&&((B=M<2&&ne<z[1])?(x=0,k.v=V,k.n=z[1]):ne<re&&(B=M<3||z[0]>V||V>re)&&(z[4]=M,z[5]=V,k.n=re,x=0))}if(B||M>1)return i;throw I=!0,V}return function(M,V,B){if(P>1)throw TypeError("Generator is already running");for(I&&V===1&&A(V,B),x=V,R=B;(t=x<2?e:R)||!I;){_||(x?x<3?(x>1&&(k.n=-1),A(x,R)):k.n=R:k.v=R);try{if(P=2,_){if(x||(M="next"),t=_[M]){if(!(t=t.call(_,R)))throw TypeError("iterator result is not an object");if(!t.done)return t;R=t.value,x<2&&(x=0)}else x===1&&(t=_.return)&&t.call(_),x<2&&(R=TypeError("The iterator does not provide a '"+M+"' method"),x=1);_=e}else if((t=(I=k.n<0)?R:b.call(y,k))!==i)break}catch(z){_=e,x=1,R=z}finally{P=1}}return{value:t,done:I}}}(f,g,v),!0),S}var i={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(Ws(t={},o,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,c):(f.__proto__=c,Ws(f,s,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=c,Ws(d,"constructor",c),Ws(c,"constructor",l),l.displayName="GeneratorFunction",Ws(c,s,"GeneratorFunction"),Ws(d),Ws(d,s,"Generator"),Ws(d,o,function(){return this}),Ws(d,"toString",function(){return"[object Generator]"}),(Fc=function(){return{w:r,m:h}})()}function Ws(e,t,n,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}Ws=function(r,i,a,l){function c(u,d){Ws(r,u,function(h){return this._invoke(u,d,h)})}i?s?s(r,i,{value:a,enumerable:!l,configurable:!l,writable:!l}):r[i]=a:(c("next",0),c("throw",1),c("return",2))},Ws(e,t,n,o)}function Dne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cN(e){var t=Dne(e,"string");return typeof t=="symbol"?t:t+""}function qv(e){"@babel/helpers - typeof";return qv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qv(e)}function xne(e,t){if(e){if(typeof e=="string")return iN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iN(e,t):void 0}}var KE=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function uN(e){return qv(e)==="object"&&e!==null&&!Array.isArray(e)}function dN(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Ine(e){return typeof Blob<"u"&&e instanceof Blob}var Ane=function(t){return uN(t)&&dN(t,["file","fileName"])&&Ine(t.file)&&typeof t.fileName=="string"},Pne=function(t){return uN(t)&&dN(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"},kne=Object.freeze(fd(fd({},KE.TOOLBOX_EXPORT_DATA,Ane),KE.SW_APP_LOADER,Pne));function Fne(e){return qv(e)==="object"&&e!==null&&!Array.isArray(e)}function One(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Mne(e){if(!Fne(e))return{valid:!1,reason:"Message must be an object."};if(e.version!==1)return{valid:!1,reason:"Unsupported or missing message version."};if(typeof e.type!="string"||!Object.values(KE).includes(e.type))return{valid:!1,reason:"Unknown or missing message type."};if(e.id!==void 0&&typeof e.id!="string")return{valid:!1,reason:"Message id must be a string when provided."};var t=e.id===void 0?["version","type","payload"]:["version","type","payload","id"];if(!One(e,t))return{valid:!1,reason:"Message contains missing or unexpected fields."};var n=e.type;return kne[n](e.payload)?{valid:!0,message:e}:{valid:!1,reason:"Payload does not match the ".concat(n," schema.")}}function Nne(e){var t=e.target,n=e.allowedOrigins,o=e.onMessage,s=e.onInvalidMessage,r=t??(typeof window>"u"?void 0:window);if(!r)throw new TypeError("A target window is required outside a browser environment.");if(!Array.isArray(n)||n.length===0)throw new TypeError("At least one allowed message origin must be configured.");if(n.some(function(a){return typeof a!="string"||a.length===0||a==="*"}))throw new TypeError("Allowed message origins must be explicit origin strings; wildcards are not allowed.");if(typeof o!="function")throw new TypeError("An onMessage callback is required.");var i=function(l){if(!n.includes(l.origin)){s==null||s(l.data,"Untrusted message origin: ".concat(l.origin),l);return}var c=Mne(l.data);if(c.valid===!1){s==null||s(l.data,c.reason,l);return}o(c.message,l)};return r.addEventListener("message",i),function(){return r.removeEventListener("message",i)}}class Lne extends Error{}class gl extends Lne{constructor(){super("Zone is an abstract class")}}class hN{get type(){throw new gl}get name(){throw new gl}get ianaName(){return this.name}get isUniversal(){throw new gl}offsetName(t,n){throw new gl}formatOffset(t,n){throw new gl}offset(t){throw new gl}equals(t){throw new gl}get isValid(){throw new gl}}const qE=new Map;function Vne(e){let t=qE.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),qE.set(e,t)),t}const Bne={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function $ne(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function Hne(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=Bne[r];r==="era"?o[a]=i:Xv(a)||(o[a]=parseInt(i,10))}return o}const YE=new Map;class Yv extends hN{static create(t){let n=YE.get(t);return n===void 0&&YE.set(t,n=new Yv(t)),n}static resetCache(){YE.clear(),qE.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Yv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Wne(t,n,o,this.name)}formatOffset(t,n){return Jv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=Vne(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?Hne(o,n):$ne(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=Une({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let XE=null;class gd extends hN{static get utcInstance(){return XE===null&&(XE=new gd(0)),XE}static instance(t){return t===0?gd.utcInstance:new gd(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new gd(pN(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Jv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Jv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Jv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function Xv(e){return typeof e>"u"}function Zv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function fN(e){if(!(Xv(e)||e===null||e===""))return parseInt(e,10)}function Gne(e){if(!(Xv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Une(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Wne(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function pN(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function Jv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Zv(n,2)}:${Zv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Zv(n,2)}${Zv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const gN=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function md(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function vd(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function mN(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=fN(t[n+s]);return[o,null,n+s]}}const vN=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,zne=`(?:${vN.source}?(?:\\[(${gN.source})\\])?)?`,yN=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,wN=RegExp(`${yN.source}${zne}`),ZE=RegExp(`(?:[Tt]${wN.source})?`),jne=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Kne=/(\d{4})-?W(\d\d)(?:-?(\d))?/,qne=/(\d{4})-?(\d{3})/,Yne=mN("weekYear","weekNumber","weekDay"),Xne=mN("year","ordinal"),Zne=/(\d{4})-(\d\d)-(\d\d)/,CN=RegExp(`${yN.source} ?(?:${vN.source}|(${gN.source}))?`),Jne=RegExp(`(?: ${CN.source})?`);function yd(e,t,n){const o=e[t];return Xv(o)?n:fN(o)}function Qne(e,t){return[{year:yd(e,t),month:yd(e,t+1,1),day:yd(e,t+2,1)},null,t+3]}function wd(e,t){return[{hours:yd(e,t,0),minutes:yd(e,t+1,0),seconds:yd(e,t+2,0),milliseconds:Gne(e[t+3])},null,t+4]}function np(e,t){const n=!e[t]&&!e[t+1],o=pN(e[t+1],e[t+2]),s=n?null:gd.instance(o);return[{},s,t+3]}function op(e,t){const n=e[t]?Yv.create(e[t]):null;return[{},n,t+1]}md(jne,ZE),md(Kne,ZE),md(qne,ZE),md(wN),vd(Qne,wd,np,op),vd(Yne,wd,np,op),vd(Xne,wd,np,op),vd(wd,np,op),vd(wd),md(Zne,Jne),md(CN),vd(wd,np,op);var eoe=["accessTokenKey","refreshTokenKey","domain","path","secure","sameSite","canSetTokens","cookieParser"];function Tt(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).log.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function sp(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).error.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function Qv(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).warn.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function toe(){var e=typeof window<"u"?sessionStorage.getItem("BASE_DOMAIN_COOKIE")||window.location.hostname:void 0;return Tt("getStandardizedCookieConfig - domain:",e,"from BASE_DOMAIN_COOKIE:",sessionStorage.getItem("BASE_DOMAIN_COOKIE")),{accessTokenKey:"account.token",refreshTokenKey:"account.refresh_token",domain:e,path:"/",secure:!0,sameSite:"lax"}}function noe(){return{maxRetries:5,retryDelay:500,backoffFactor:1.5}}var bN=1e3,ooe=1e4;function SN(e){if(!(typeof window>"u")){var t=window.self!==window.top;try{if(t&&window.top){Tt("Inside iframe - redirecting top window to:",e),window.top.location.replace(e);return}}catch(n){sp("Top window redirect blocked, redirecting current window instead:",n)}try{Tt("Redirecting current window to:",e),window.location.replace(e)}catch(n){sp("Failed to redirect:",n)}}}function ey(e){return typeof e!="string"||!e?e:e.length<=2?"*".repeat(e.length):"".concat(e[0]).concat("*".repeat(e.length-2)).concat(e[e.length-1])}function soe(e){return pd(pd({},e),{},{access_token:ey(e.access_token),token:ey(e.token),refresh_token:ey(e.refresh_token)})}function ty(e){if(!e)return!1;var t=e.trim();return!!t&&t!=="undefined"&&t!=="null"}function EN(e){return ty(e.getAccessToken())||ty(e.getRefreshToken())}function roe(e){if(!(typeof document>"u")){var t=typeof window<"u"?window.location.hostname:"",n=e||(typeof sessionStorage<"u"?sessionStorage.getItem("BASE_DOMAIN_COOKIE"):null)||t,o=Array.from(new Set([n,t].filter(Boolean)));Tt("Clearing all cookies - domains:",o);var s=document.cookie.split(";");s.forEach(function(r){var i=r.split("=")[0].trim();i&&(document.cookie="".concat(i,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"),o.forEach(function(a){document.cookie="".concat(i,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=").concat(a)}))})}}function ioe(){typeof sessionStorage<"u"&&sessionStorage.clear()}function aoe(e){return function(t){var n,o=(n=t.response)===null||n===void 0?void 0:n.status,s=EN(e);if(Tt("getStandardizedTokenExpiredDetection - status:",o,"userLoggedIn:",s),!s)return Tt("User not logged in - returning false"),!1;if(o===400){var r,i,a,l=(r=t.response)===null||r===void 0?void 0:r.data,c=(l==null?void 0:l.error)==="invalid_token"||(l==null||(i=l.error)===null||i===void 0?void 0:i.key)==="invalid_token";return Tt(" 400 error - isInvalidToken:",c,"error:",l==null?void 0:l.error,"error.key:",l==null||(a=l.error)===null||a===void 0?void 0:a.key),!1}if(o===401){var u,d,h=(u=t.response)===null||u===void 0?void 0:u.data,f=h==null||(d=h.error)===null||d===void 0?void 0:d.key,p=h==null?void 0:h.details;return Tt(" 401 error - errorKey:",f,"details:",p),f==="unauthenticated"&&(!p||Object.keys(p).length===0||p.reason==="refresh_token_expired")?(Tt(" 401 unauthenticated - triggering refresh"),!0):(Tt(" 401 error but not unauthenticated - returning false"),!1)}return o===425?(Tt(" 425 error - triggering refresh"),!0):(Tt("Status",o,"not handled - returning false"),!1)}}var loe=function(){function e(){var t,n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};zE(this,e),this.accessTokenKey=o.accessTokenKey||"access_token",this.refreshTokenKey=o.refreshTokenKey||"refresh_token",this.domain=o.domain,this.path=o.path||"/",this.secure=(t=o.secure)!==null&&t!==void 0?t:!0,this.sameSite=o.sameSite||"lax",this.canSetTokens=(n=o.canSetTokens)!==null&&n!==void 0?n:!0,this.cookieParser=o.cookieParser}return jE(e,[{key:"getCookieValue",value:function(n){if(typeof document>"u")return null;var o=document.cookie.split(";"),s=_ne(o),r;try{for(s.s();!(r=s.n()).done;){var i=r.value;if(i=i.trim(),i.startsWith(n+"=")){var a=i.substring(n.length+1);return this.cookieParser?this.cookieParser(a,n):decodeURIComponent(a)}}}catch(l){s.e(l)}finally{s.f()}return null}},{key:"getAccessToken",value:function(){return this.getCookieValue(this.accessTokenKey)}},{key:"getRefreshToken",value:function(){return this.getCookieValue(this.refreshTokenKey)}},{key:"getExpiresInRefreshToken",value:function(){return this.getCookieValue("account.expires_in_refresh_token")}},{key:"setTokens",value:function(n){if(!this.canSetTokens||typeof document>"u"){Qv(" CookieTokenStorage: Token setting is disabled or running in a non-browser environment");return}Tt(" setTokens called - storing tokens with keys:",this.accessTokenKey,this.refreshTokenKey,"domain:",this.domain);var o=this.domain?"; domain=".concat(this.domain):"",s=this.secure?"; secure":"",r="; samesite=".concat(this.sameSite),i="",a="";if(n.expires_in&&typeof n.expires_in=="number"){var l=new Date;l.setTime(l.getTime()+n.expires_in*1e3),i=";expires=".concat(l.toUTCString())}var c=this.getExpiresInRefreshToken();if(Tt("setTokens - refresh token data:",soe(n)),Tt("setTokens - refresh token expires_in value:",c),c){var u=new Date;u.setTime(u.getTime()+Number(c)*1e3),a=";expires=".concat(u.toUTCString())}if(n.access_token||n.token){var d=n.access_token||n.token,h="".concat(this.accessTokenKey,"=").concat(encodeURIComponent(d),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(i);document.cookie=h}if(n.refresh_token_expires_in&&typeof n.refresh_token_expires_in=="number"){var f=new Date;f.setTime(f.getTime()+n.refresh_token_expires_in*1e3),i=";expires=".concat(f.toUTCString())}if(n.refresh_token){Tt("setTokens - refresh token set to:",ey(n.refresh_token)),Tt("setTokens - refresh token expires_in set to:",a);var p="".concat(this.refreshTokenKey,"=").concat(encodeURIComponent(n.refresh_token),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(a);document.cookie=p}}},{key:"hasTokens",value:function(){return!!this.getAccessToken()&&!!this.getRefreshToken()}}])}(),coe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auth_state_channel",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auth_state_event";zE(this,e),fd(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return jE(e,[{key:"initChannel",value:function(){if(typeof BroadcastChannel<"u")try{this.channel=new BroadcastChannel(this.channelName)}catch(n){console.error("Failed to create BroadcastChannel, falling back to storage events:",n),this.channel=null}}},{key:"broadcastEvent",value:function(n){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={type:n,data:s,timestamp:Date.now()};this.channel?this.channel.postMessage(r):typeof localStorage<"u"&&(localStorage.setItem(this.storageKey,JSON.stringify(r)),setTimeout(function(){return localStorage.removeItem(o.storageKey)},100))}},{key:"onEvent",value:function(n){var o=this;return this.channel?this.channel.onmessage=function(s){n(s.data)}:typeof window<"u"&&window.addEventListener("storage",function(s){if(s.key===o.storageKey&&s.newValue)try{var r=JSON.parse(s.newValue);n(r)}catch(i){console.error("Failed to parse auth event:",i)}}),function(){o.channel?o.channel.onmessage=null:typeof window<"u"&&window.removeEventListener("storage",function(){})}}},{key:"destroy",value:function(){this.channel&&(this.channel.close(),this.channel=null)}}])}(),uoe=function(){function e(t){var n=this;if(zE(this,e),fd(this,"currentAttempt",0),fd(this,"isLoggingOut",!1),this.instanceId=Math.random().toString(36).substring(2,15),this.refreshTokenFn=t.refreshTokenFn,this.tokenStorage=t.storage,this.useStandardizedConfig=t.useStandardizedConfig===!0,Tt("RefreshTokenHandler initialized - useStandardizedConfig:",this.useStandardizedConfig),this.useStandardizedConfig){var o=noe();this.maxRetries=o.maxRetries,this.retryDelay=o.retryDelay,this.backoffFactor=o.backoffFactor,Tt(" Using standardized retry config - maxRetries:",this.maxRetries,"retryDelay:",this.retryDelay,"backoffFactor:",this.backoffFactor)}else this.maxRetries=t.maxRetries||3,this.retryDelay=t.retryDelay||1e3,this.backoffFactor=t.backoffFactor||2,Tt(" Using custom retry config - maxRetries:",this.maxRetries,"retryDelay:",this.retryDelay,"backoffFactor:",this.backoffFactor);this.onCrossTabLogout=t.onCrossTabLogout,this.authStateManager=new coe,this.initCrossTabListener(),this.onRefreshSuccess=t.onRefreshSuccess||function(){Tt("Token refresh successful")},this.onRefreshFailure=t.onRefreshFailure||function(s){console.error("Token refresh failed:",s)},this.onTokenInvalid=t.onTokenInvalid||function(){Tt("Token is invalid or cannot be refreshed");var s=new Error("No refresh token available");n.useStandardizedConfig?n.handleLogout("no_refresh_token",s):(n.onRefreshFailure(s),n.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:n.instanceId,reason:"no_refresh_token",error:"No refresh token available"}))}}return jE(e,[{key:"isLogoutInProgress",get:function(){return this.isLoggingOut}},{key:"handleLogout",value:function(n,o){if(this.isLoggingOut){Tt("handleLogout skipped - logout already in progress");return}Tt("handleLogout called with reason:",n),this.onRefreshFailure&&(Tt("Calling onRefreshFailure callback"),this.onRefreshFailure(o));var s=this.getLogoutTag(n,"this-tab");this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,tag:s,error:(o==null?void 0:o.message)||"Token refresh failed"}),this.clearStateAndRedirectToLogin(s)}},{key:"getLogoutTag",value:function(n,o){return ty(this.tokenStorage.getRefreshToken())?(console.error("False logout detected. Refresh token not expired. Reason: ".concat(n)),console.error("Sender channel: ".concat(o)),-1):1}},{key:"clearStateAndRedirectToLogin",value:function(n){if(!this.isLoggingOut){this.isLoggingOut=!0;var o=typeof sessionStorage<"u"&&sessionStorage.getItem("BASE_URL")||"",s=typeof sessionStorage<"u"&&sessionStorage.getItem("BASE_DOMAIN_COOKIE")||void 0;if(typeof localStorage<"u"&&typeof window<"u")try{var r="".concat(window.location.pathname).concat(window.location.search);localStorage.setItem("last_url_access_after_timeout",r),localStorage.removeItem("retryCount"),Tt("localStorage updated - saved last URL:",r)}catch(a){sp("Failed to update localStorage:",a)}Tt("Clearing sessionStorage and cookies"),ioe(),roe(s);var i="".concat(o,"/login?timeout=").concat(n);Tt("Redirecting to login in ".concat(bN,"ms:"),i),setTimeout(function(){return SN(i)},bN)}}},{key:"initCrossTabListener",value:function(){var n=this;this.authStateManager.onEvent(function(o){if(o.type==="auth:logout")if(Tt("Received logout event:",o.data),o.data&&o.data.sourceInstanceId!==n.instanceId){if(Tt("Logout event from different tab, executing logout handlers"),n.onCrossTabLogout?(Tt("Executing onCrossTabLogout with reason: ".concat(o.data.reason||"cross_tab_logout")),n.onCrossTabLogout(o.data.reason||"cross_tab_logout")):typeof n.onLogout=="function"?(Tt("Executing legacy onLogout with reason: ".concat(o.data.reason)),n.onLogout(o.data.reason)):n.useStandardizedConfig||console.warn("No logout handler defined for cross-tab events"),n.useStandardizedConfig){var s=o.data.tag===-1||o.data.tag===1,r=s?o.data.tag:n.getLogoutTag(o.data.reason||"cross_tab_logout","cross-tab");s&&r===-1&&(console.error("False logout detected. Reason: ".concat(o.data.reason||"cross_tab_logout")),console.error("Sender channel: cross-tab")),Tt("Standardized mode - logging out this tab after cross-tab event, tag:",r),n.clearStateAndRedirectToLogin(r)}}else Tt("Ignoring self-generated logout event")})}},{key:"handleTokenRefresh",value:function(){var t=WE(Fc().m(function o(){var s=this,r,i,a,l;return Fc().w(function(c){for(;;)switch(c.p=c.n){case 0:if(r=this.tokenStorage.getRefreshToken(),Tt(" handleTokenRefresh started, refreshToken available:",!!r),r){c.n=1;break}return Tt(" ERROR: No refresh token available - cannot refresh"),this.onTokenInvalid(),c.a(2,!1);case 1:return this.currentAttempt=0,c.p=2,c.n=3,this.executeWithRetry(function(){return Tt("Refresh attempt ".concat(s.currentAttempt+1,"/").concat(s.maxRetries)),s.refreshTokenFn(s.tokenStorage.getRefreshToken())});case 3:if(i=c.v,!(!i||!i.access_token&&!i.token)){c.n=4;break}throw console.error("Invalid token response received"),new Error("Invalid token response");case 4:return i.token&&!i.access_token&&(i.access_token=i.token),Tt(" Token refresh successful, saving new tokens"),this.tokenStorage.setTokens(i),Tt(" Calling onRefreshSuccess callback"),this.onRefreshSuccess(i),c.a(2,!0);case 5:return c.p=5,l=c.v,console.error("Token refresh failed after all attempts:",l),l===void 0&&(l=new Error("Undefined error during token refresh")),this.useStandardizedConfig?this.handleLogout("max_retry_reached",l):(this.onRefreshFailure(l),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:"max_retry_reached",error:((a=l)===null||a===void 0?void 0:a.message)||"Token refresh failed after maximum retries"})),c.a(2,!1)}},o,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=WE(Fc().m(function o(s){var r,i,a,l;return Fc().w(function(c){for(;;)switch(c.p=c.n){case 0:return c.p=0,c.n=1,s();case 1:return c.a(2,c.v);case 2:if(c.p=2,l=c.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){c.n=3;break}throw Tt("Maximum retry attempts (".concat(this.maxRetries,") reached")),l;case 3:return i=(l==null||(r=l.response)===null||r===void 0?void 0:r.status)===425,a=i?this.getRetryAfterDelay(l):this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1),Tt("Retry in ".concat(a,"ms, attempt ").concat(this.currentAttempt,"/").concat(this.maxRetries)),c.n=4,new Promise(function(u){return setTimeout(u,a)});case 4:return c.a(2,this.executeWithRetry(s))}},o,this,[[0,2]])}));function n(o){return t.apply(this,arguments)}return n}()},{key:"getRetryAfterDelay",value:function(n){var o;if(n!=null&&(o=n.response)!==null&&o!==void 0&&o.headers){var s=n.response.headers["retry-after"];if(s){var r=parseInt(s,10);if(!isNaN(r))return r*1e3;var i=new Date(s);if(!isNaN(i.getTime()))return i.getTime()-Date.now()}}return this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1)}},{key:"broadcastLogout",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"manual_logout";Tt("Broadcasting logout event with reason: ".concat(n)),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,timestamp:Date.now()})}}])}();function doe(e,t){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=(n=o.useStandardizedConfig)!==null&&n!==void 0?n:t.useStandardizedConfig;Tt("createRefreshInterceptor called - useStandardizedConfig:",s);var r=s?aoe(t.tokenStorage):o.tokenExpiredDetection||function(c){var u;return((u=c.response)===null||u===void 0?void 0:u.status)===401},i=s?[401,425]:o.retryStatusCodes||[401,425],a=o.tokenHeaderFormatter||function(c){return"Bearer ".concat(c)};Tt("Interceptor config - retryStatusCodes:",i,"using standardized detection:",s);var l=null;e.interceptors.response.use(function(c){return c},function(){var c=WE(Fc().m(function u(d){var h,f,p,g,v,C,S,b,y,E,_,x,R,P,N,I,k,A,M,V,B;return Fc().w(function(z){for(;;)switch(z.p=z.n){case 0:if(g=d.config,v=function(re){var ee,X=s&&t.isLogoutInProgress;return Qv(X?"HOLD ->":"REJECT ->",((g==null?void 0:g.method)||"").toUpperCase(),g==null?void 0:g.url,"| status:",(ee=d.response)===null||ee===void 0?void 0:ee.status,"| reason:",re,"| logoutInProgress:",t.isLogoutInProgress,"| at:",new Date().toISOString().slice(11,23)),X?new Promise(function(D,U){setTimeout(function(){Qv("Logout redirect did not happen in time - releasing held request:",g==null?void 0:g.url),U(d)},ooe)}):Promise.reject(d)},g){z.n=1;break}return z.a(2,v("no request config"));case 1:if(!g._retry){z.n=2;break}return z.a(2,v("retried request failed again"));case 2:if(C=(h=d.response)===null||h===void 0?void 0:h.status,Tt(" Response error handler triggered - status:",C,"url:",g.url),S=r(d),Tt(" tokenExpiredDetection returned:",S),b=!1,C===400)if(_=(y=d.response)===null||y===void 0?void 0:y.data,x=(_==null?void 0:_.error)==="invalid_token"||(_==null||(E=_.error)===null||E===void 0?void 0:E.key)==="invalid_token",x)if(b=!1,s){if(Tt(" 400 invalid_token (standardized) - clearing account.token from cookies"),typeof document<"u")try{R=sessionStorage.getItem("BASE_DOMAIN_COOKIE")||window.location.hostname,Tt(" Clearing account.token - domain:",R),document.cookie="account.token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=".concat(R),document.cookie="account.token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/",Tt(" ✅ Removed account.token from cookies (prevents infinite 400 loop)")}catch(ne){sp(" Failed to clear account.token:",ne)}typeof window<"u"&&(P=sessionStorage.getItem("BASE_URL")||"",N="".concat(P,"/sw?redirect=1"),Tt("Redirecting to re-auth page - URL:",N),SN(N))}else Tt(" 400 invalid_token (custom config) - user handles via callbacks");else b=!1,Tt(" 400 non-invalid_token - skip refresh");else s&&C===401&&!EN(t.tokenStorage)?(I=typeof window<"u"&&window.location.pathname.includes("/login"),k=/login|refresh-token|refreshToken/i.test(g.url||""),I||k?Tt("401 with no tokens on login page/auth request - not redirecting"):(Tt("401 with no tokens - logging out and redirecting to /login"),t.handleLogout("no_tokens",new Error("No authentication tokens available"))),b=!1):(b=S&&i.includes(C),Tt(" Status",C,"- shouldRefresh:",S,"in retryStatusCodes:",i.includes(C),"canRetry:",b));if(b){z.n=3;break}return z.a(2,v("not eligible for refresh"));case 3:if(A=((f=g.url)===null||f===void 0?void 0:f.includes("refresh-token"))||((p=g.url)===null||p===void 0?void 0:p.includes("refreshToken")),!A){z.n=4;break}return z.a(2,v("refresh endpoint itself failed"));case 4:return g._retry=!0,z.p=5,l?Tt(" Using existing refresh promise"):(Tt(" Starting new token refresh"),l=t.handleTokenRefresh()),z.n=6,l;case 6:if(M=z.v,l=null,M){z.n=7;break}return z.a(2,v("token refresh failed (waiting request)"));case 7:return V=t.tokenStorage.getAccessToken(),Tt(" Token refreshed successfully, new token available:",!!V),V?(Tt(" Injecting refreshed token into Authorization header for retry"),g.headers.Authorization=a(V)):Qv(" WARNING: Token refresh succeeded but no token in storage!"),Tt(" Retrying original request with new token"),z.a(2,e(g));case 8:return z.p=8,B=z.v,sp(" Error during refresh:",B),l=null,z.a(2,v("error thrown during refresh"))}},u,null,[[5,8]])}));return function(u){return c.apply(this,arguments)}}()),e.interceptors.request.use(function(c){var u=c.headers.Authorization;if(u){var d=String(u).replace(/^Bearer\s*/i,"").trim();if(d&&d!=="undefined"&&d!=="null")return c;Tt("Removing invalid Authorization header:",u),delete c.headers.Authorization}var h=t.tokenStorage.getAccessToken(),f=t.tokenStorage.getRefreshToken();return Tt(" Request interceptor: token exists:",!!h,"refreshToken exists:",!!f,"url:",c.url),h&&ty(h)?(Tt(" Access token available - injecting into Authorization header"),c.headers.Authorization=a(h)):Tt(f?" Access token missing/empty but refresh token available - response interceptor will handle 401":" Both tokens missing/empty - allowing request (no token to inject)"),c},function(c){return Promise.reject(c)})}function hoe(e){var t=e.useStandardizedConfig===!0;Tt("createCookieRefreshHandler called - useStandardizedConfig:",t);var n;if(t){var o=toe();n=pd(pd({},o),{},{canSetTokens:e.canSetTokens,cookieParser:e.cookieParser}),Tt(" Applied standardized cookie config:",n)}else{var s=e.accessTokenKey,r=e.refreshTokenKey,i=e.domain,a=e.path,l=e.secure,c=e.sameSite,u=e.canSetTokens,d=e.cookieParser;n={accessTokenKey:s,refreshTokenKey:r,domain:i,path:a,secure:l,sameSite:c,canSetTokens:u,cookieParser:d},Tt(" Applied custom cookie config:",n)}var h=new loe(n);e.accessTokenKey,e.refreshTokenKey,e.domain,e.path,e.secure,e.sameSite,e.canSetTokens,e.cookieParser;var f=Rne(e,eoe);return new uoe(pd(pd({},f),{},{storage:h,useStandardizedConfig:t}))}var No=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(No||{});No.review,No.review_take,No.review_scene,No.review_rendition,No.review_frame,No.review_rendition_comment,No.review_comment,No.scene_hub,No.hub_rendition,No.hub_comment,No.people_insight,No.people_detail,No.project,No.woohoo,No.update,No.core,No.project_focusMode;const _N={accessToken:"account.token",refreshToken:"account.refresh_token"},foe={baseUrl:"BASE_URL"},RN="/refresh-token",poe=3e5,goe="*",TN={Accept:"application/json","Content-Type":"application/json"},moe="undefined",voe="No access token found",Oc={badRequest:400,unauthorized:401,tooEarly:425},yoe=[Oc.unauthorized,Oc.tooEarly,Oc.badRequest],woe="unauthenticated",Coe="invalid_token",boe="refresh_token_expired",Soe={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},Eoe="Session refreshed successfully",_oe="Session expired. Please log in again.",Roe=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},Toe=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==Oc.badRequest?!1:Roe((n=e.response)==null?void 0:n.data)===Coe},Doe=()=>{},xoe=e=>sessionStorage.getItem(e)||"",JE=()=>{const e=dv.get(_N.accessToken);return e&&e!==moe?e:null},Ioe=()=>!!dv.get(_N.refreshToken),Aoe=()=>{const e=window.location.origin,t=xoe(foe.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class QE{constructor(t,n=Doe,o){this.client=t,this.showMessage=n,this.onAuthExpired=o}attach(){const t=hoe({refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(Eoe,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(_oe,"error")},useStandardizedConfig:!0});this.handler=t,doe(this.client,t,{retryStatusCodes:[...yoe],tokenExpiredDetection:QE.isTokenExpired})}refreshAccessToken(){return!this.handler||!Ioe()?Promise.resolve(!1):(this.pendingRefresh??(this.pendingRefresh=this.handler.handleTokenRefresh().catch(()=>!1).finally(()=>{this.pendingRefresh=void 0})),this.pendingRefresh)}static isTokenExpired(t){var i,a;const n=(i=t==null?void 0:t.response)==null?void 0:i.status;if(n===Oc.tooEarly)return!0;const{error:o,details:s={}}=((a=t==null?void 0:t.response)==null?void 0:a.data)??{},r=typeof o=="string"?o:o==null?void 0:o.key;return n===Oc.badRequest||n!==Oc.unauthorized||typeof o=="string"||r!==woe?!1:Object.keys(s).length===0||s.reason===boe}async refresh(t){const n=await this.client.post(RN,{refresh_token:t}),o="data"in n&&n.data?n.data:n;return{access_token:o.access_token,refresh_token:o.refresh_token,expires_in:o.expires_in}}handleAuthExpired(){var t;if(window.self===window.top){(t=this.onAuthExpired)==null||t.call(this);return}window.parent.postMessage(Soe,Aoe())}}class Poe{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=to.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??poe,headers:{...TN,...t.headers}}),this.setupRequestInterceptor(),this.setupResponseInterceptor(),this.setupErrorHandling()}get(t,n){return this.request({...n,method:"GET",url:t})}post(t,n,o){return this.request({...o,method:"POST",url:t,data:n})}put(t,n,o){return this.request({...o,method:"PUT",url:t,data:n})}patch(t,n,o){return this.request({...o,method:"PATCH",url:t,data:n})}delete(t,n){return this.request({...n,method:"DELETE",url:t})}request(t){return this.client.request(t)}setupRequestInterceptor(){this.client.interceptors.request.use(async t=>{const{baseURL:n,dynamicHeaders:o,requireToken:s}=this.options;typeof n=="function"&&(t.baseURL=n());const r=t.url===RN,i=r?JE():await this.resolveAccessToken();if(!i&&s&&!r)throw new Error(voe);t.headers.set("Accept-Language",goe),t.headers.has("Content-Type")||t.headers.set("Content-Type",TN["Content-Type"]),t.headers.has("Content-Type")&&t.headers.get("Content-Type")==="multipart/form-data"&&t.headers.delete("Content-Type"),i&&t.headers.set("Authorization",`Bearer ${i}`);for(const[a,l]of Object.entries((o==null?void 0:o(t))??{}))t.headers.set(a,l);return t})}async resolveAccessToken(){const t=JE();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),JE())}setupResponseInterceptor(){this.client.interceptors.response.use(t=>this.options.unwrapResponse?t.data:t)}setupErrorHandling(){const{withRefreshToken:t,showMessage:n,onAuthExpired:o,onError:s}=this.options;t&&(this.tokenRefresher=new QE(this.client,n,o),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,r=>(Toe(r)&&(o==null||o("/sw?redirect=1")),Promise.reject(r))),s&&this.client.interceptors.response.use(void 0,s)}}const koe=5,Foe=1e3,Ooe=3,Moe="default",Noe=e=>new URL(e,"http://localhost").pathname;class Loe{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??koe,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??Foe}async run(t,n){const o=this.resolveGroup(t);await this.acquire(o);try{return await n()}finally{this.release(o)}}resolveGroup(t){const n=Noe(t),o=this.rules.find(i=>i.pattern.test(n)),s=o?o.pattern.source:Moe;let r=this.groups.get(s);return r||(r={limit:(o==null?void 0:o.limit)??this.defaultLimit,ongoing:0,queue:[]},this.groups.set(s,r)),r}acquire(t){return new Promise(n=>{const o=()=>{t.ongoing++,n()};t.ongoing<t.limit?o():t.queue.push(o)})}release(t){t.ongoing--;const n=t.queue.shift();n&&setTimeout(n,this.releaseDelayMs)}}const Voe=(e,t)=>{const n=new Loe(t),o=to.getAdapter(e.defaults.adapter);return e.defaults.adapter=s=>n.run(s.url??"",()=>o(s)),n},Boe=(e,{maxRetries:t=Ooe}={})=>{e.interceptors.response.use(void 0,async n=>{var a,l;const o=n.config;if(((a=n.response)==null?void 0:a.status)!==429||!o)return Promise.reject(n);const s=(o._retryCount??0)+1;if(s>t)return Promise.reject(n);o._retryCount=s;const r=Number.parseInt(String(((l=n.response.headers)==null?void 0:l["retry-after"])??""),10),i=Number.isNaN(r)?2**s*1e3:r*1e3;return await new Promise(c=>setTimeout(c,i)),e.request(o)})},$oe=6e4,Hoe="/start",Goe=(e=Hoe)=>{const n=`${sessionStorage.getItem("BASE_URL")||""}${e}`;window.location.replace(n)};function Uoe(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class Woe{constructor(t,n={}){const{concurrency:o,rateLimitRetry:s,...r}=n,i=()=>Uoe("API_BASE_URL","");this.callbackFunc=t,this.api=new Poe({baseURL:i,timeout:$oe,requireToken:!0,onAuthExpired:Goe,...r,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,o!==!1&&Voe(this.axios,o),s!==!1&&Boe(this.axios,s)}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([s,r])=>{r!=null&&r!==""&&(Array.isArray(r)?r.forEach(i=>n.append(s,String(i))):typeof r=="object"?n.append(s,JSON.stringify(r)):n.append(s,String(r)))});const o=n.toString();return o?`?${o}`:""}async send(t,n,{params:o,data:s,options:r}={}){try{const i=o?this.buildQueryParams(o):"",a={...r,method:t,url:`${this.buildUrl(n)}${i}`};return s!==void 0&&(a.data=s),(await this.axios.request(a)).data}catch(i){throw Sne(i)}}get(t="",n,o){return this.send("GET",t,{params:n,options:o})}post(t="",n,o,s){return this.send("POST",t,{params:n,data:o,options:s})}put(t="",n,o){return this.send("PUT",t,{data:n,options:o})}patch(t="",n,o){return this.send("PATCH",t,{data:n,options:o})}delete(t="",n,o){return this.send("DELETE",t,{data:n,options:o})}}const zoe=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"},bulkRename:{url:`${e}/v1/workspace/${t}/item/2/bulk-rename`,method:"put",code:"bulkRename"}}),joe=(e,t)=>{const n=new Blob([e]),o=globalThis.URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(o)},Koe=15e3,qoe=new Set(["bulkDelete","bulkArchive","bulkUnarchive","bulkDateUpdate","bulkAssignUpdate","bulkStatusUpdate","bulkMetricUpdate","bulkRename","removeAssignee","delete_thumbnail","delete_rendition"]);class DN extends Woe{constructor(t,n,o){const s=n==null?void 0:n.domainApi,r=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(o,{concurrency:{rules:[{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2$/,limit:1},{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2\/metrics$/,limit:5}]}}),this.events=Object.create(null);const a=zoe({domainApi:s,wsCode:r,entityId:i}),l={};Object.entries(a).forEach(([c,u])=>{const d=c;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=u)}),this.apiConfig=l}on(t,n){var o;((o=this.events)[t]??(o[t]=[])).push(n)}off(t,n){const o=this.events[t];o&&(this.events[t]=o.filter(s=>s!==n))}emit(t,...n){const o=this.events[t];o!=null&&o.length&&o.forEach(s=>{try{s(...n)}catch(r){console.error(`Error in event listener for ${t}:`,r)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:r,responseType:i,autoDownload:a=!0,unwrapResponse:l=!0,timeout:c}){var h,f;const u=this.buildHeaders(s);let d;try{if(d=await this.axios.request({method:t,url:n,params:o,data:s,headers:u,responseType:i,timeout:c}),(((h=d.headers)==null?void 0:h["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const g=((f=d.headers)==null?void 0:f["content-disposition"])||"",v=g.includes("filename=")?g.split("filename=")[1]:"exported_items.xlsx";a&&joe(d.data,v)}if(d.status>=400&&d.status<=500)throw new Error(`Client error (${d.status}): ${d.statusText}`);return this.emit("call-api",{apiCode:r,path:n,params:o,payload:s,res:d,success:!0}),l?d.data:d}catch(p){throw console.error("API Request Error:",p),p.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:o,payload:s,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:o,payload:s,error:p,success:!1,apiCode:r,res:p==null?void 0:p.response}),p}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,r])=>{o=o.replace(`{${s}}`,String(r))}),o}async request(t,n,o={}){const{url:s,code:r,method:i}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:i,path:a,params:o.params,payload:o.payload,code:r,responseType:o.responseType,autoDownload:o.autoDownload,unwrapResponse:o.unwrapResponse,timeout:qoe.has(t)?Koe:void 0})}async getAllItem_cursor(t){var r;const n=t.workspaceId,o={entity_ids:((r=t.entityIds)==null?void 0:r.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},s=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:o,payload:{sort_by:s}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},o={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:o,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:o,query:s,per_page:r}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:r||100,page:o||1,name_like:s||void 0,permission:"1,2"}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const r={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:1},payload:r})}async multipleAssignableUser(t){const n=t.workspaceId,o=t.itemIds,s={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:o||[]};return o.length||(delete s.item_ids,s.entity_id=t.entityId),this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){var s;const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return((s=t.itemIds)==null?void 0:s.length)==0&&(o.entity_id=t.entityId,delete o.item_ids),this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const r={item_id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:r})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:r,params:s})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:o=!1,entityId:s,filterParams:r}){const i={item_ids:n,delete_all:o?1:void 0,entity_id:s};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i,params:r,unwrapResponse:!1})}async archiveScene(t,n,o){const s={item_ids:o,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:s})}async changeDate({workspaceId:t,itemIds:n,startDate:o,dueDate:s,entityId:r,filterParams:i}){const a={item_ids:n,start_date:o,due_date:s,entity_id:r};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:i})}async updateAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:o,entityId:s}=t,r={item_ids:n,ws_user_role_ids:o,entity_id:s};return!n||n.length===0?(r.item_ids=void 0,r.entity_id=s):(r.item_ids=n,r.entity_id=void 0),r}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:i})}async addAssignee({workspaceId:t,itemIds:n,userIds:o,entityId:s,filterParams:r}){const i={item_ids:n,ws_user_role_ids:o,entity_id:s};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:i,params:r})}async unAssignAll(t){const{workspaceId:n,entityId:o,itemIds:s,filterParams:r}=t,i={item_ids:s,entity_id:o,ws_user_role_ids:[]};return!s||s.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(o)},{payload:i,params:r})}async updateItemStatus(t){const{workspaceId:n,itemIds:o=[],statusId:s,entityId:r}=t,i={item_ids:o,template_flow_status_id:s};return o.length||(i.item_ids=void 0,i.entity_id=r),this.request("bulkStatusUpdate",{workspaceId:n},{payload:i,params:t.filterParams,unwrapResponse:!1})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:r,params:s})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,status:1,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:r,params:s,unwrapResponse:!1})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,status:0,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:r,params:s,unwrapResponse:!1})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:r,clear:i}=t,a={item_ids:o,metric_id:s,metric_value:r,clear:i??(r==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=o,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams,unwrapResponse:!1})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:50}})}async unarchiveScene(t,n,o){const s={item_ids:o,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:s})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n,o=!0){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async downloadExportedItemsFile(t,n,o=!0){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:r,entity_ids:i}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:r,entity_ids:i}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:o}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:o},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,o){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:o})}async getFilterStatuses(t,n,o){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:o})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}async bulkRename(t){return this.request("bulkRename",{workspaceId:t.workspaceId,entityId:t.entityId},{payload:t.payload,params:t.filter,unwrapResponse:!1})}}const Yoe=(e,t,n,o,s,r,i)=>{const a=$(!1),{apiServices:l}=io(n,o),c=Y(()=>!!(s!=null&&s.value&&(r!=null&&r.value))),u=Dn("filterParams",null);return{isUpdating:a,handleUpdate:async h=>{var p;const f=h.value;try{const g={itemIds:e.value.itemIds,metricId:h.id,workspaceId:String(e.value.workspaceId),filterParams:u!=null&&u.value?u.value:void 0};h.value==null?g.clear=1:g.value=f,c.value?(delete g.itemIds,g.entityId=String(o.entityId)):g.itemIds=e.value.itemIds,a.value=!0;const v=await((p=l.value)==null?void 0:p.bulkUpdateMetric(g));return((v==null?void 0:v.status)==Us.OK||(v==null?void 0:v.status)==Us.ACCEPTED)&&t(h,v),v}catch(g){console.error("Error during bulk metric update:",g)}finally{a.value=!1}}}},Xoe=bt(tt({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=QO(),o=$([]),s=e,r=t,i=$([]),a=$(null),l=z=>{var ee,X,D;const ne=o.value.findIndex(U=>U.id===z.id);a.value=ne;const re=(ee=i.value[ne])==null?void 0:ee.$el;(X=E.value)==null||X.scrollTo(ne*30),re&&re.scrollIntoView({behavior:"smooth",block:"center"}),c(ne),(D=i.value[ne])==null||D.show()},c=z=>{a.value=z,i.value.forEach((ne,re)=>{re!==z&&ne&&ne.hide()})},u=$(""),d=()=>{u.value="",i.value.forEach(z=>{z==null||z.hide()}),a.value=null},h=Y(()=>s.selectedIds||[]),f=Y(()=>({itemIds:h.value,workspaceId:String(s.workspaceId)})),p=Dn("isSelectAll",$(!1)),g=Dn("bulkUpdate",$(!1)),v=$(null),{handleUpdate:C,isUpdating:S}=Yoe(f,(z,ne)=>{((ne==null?void 0:ne.status)==Us.OK||(ne==null?void 0:ne.status)==Us.ACCEPTED)&&r("update",z)},!1,s,g,p),b=async z=>{var ne;r("update-start");try{const re=await C(z);(re==null?void 0:re.status)!==Us.ACCEPTED&&(re==null?void 0:re.status)!==Us.OK?r("update-failed"):(r("update-completed",re),setTimeout(()=>{var ee;d(),(ee=v.value)==null||ee.hide()},500))}catch(re){console.error("Failed to update metric:",re),r("update-failed"),(ne=v.value)==null||ne.open()}},y=z=>{d(),ct(()=>{var ne;(ne=E.value)==null||ne.focus()})},E=$(null),_=(z,ne)=>{var re;z?(re=E.value)==null||re.focus():d(),z&&ne!==z&&B("")},x=$(!0),R=$(!0),{apiServices:P}=io(!1,s),N=async(z,ne,re)=>{var ee;try{return re?R.value=!0:x.value=!0,await((ee=P.value)==null?void 0:ee.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:z,query:ne,per_page:10}))}catch(X){throw console.error("Failed to fetch metric list:",X),X}finally{x.value=!1,R.value=!1}},I=$(0),k=$(!0),A=z=>({id:String(z.id),label:String(z.name),value:String(z.id),description:z.morpheme_value?`${String(z.morpheme_value)}`:"",type:n.checkEditType(z),metricConfig:z}),M=z=>z.filter(ne=>!ne.formula).filter(ne=>{var re;return((re=ne==null?void 0:ne.auth_permission)==null?void 0:re.permission)==2}).map(A),V=async()=>{I.value+=1;const z=await N(I.value,u.value,!0);if(z&&z.data){const ne=M(z.data);o.value=[...o.value,...ne],k.value=z.meta.last_page!=z.meta.current_page}else k.value=!1},B=async z=>{u.value=z,I.value=1;try{const ne=await N(I.value,u.value);ne&&ne.data?(o.value=M(ne.data),k.value=ne.meta.last_page!=ne.meta.current_page):o.value=[]}catch{o.value=[]}};return(z,ne)=>(q(),je(zf,{ref_key:"wrapperRef",ref:v,isUpdating:L(S),disabled:s.disabled,onOnVisibleChange:_},{trigger:ye(({hide:re,disabled:ee})=>[me(pt,{variant:s.variant,loading:L(S),disabled:ee,onEscape:re},{default:ye(()=>[me(ut,{src:"SquareRootVariable",class:"icon"}),ne[1]||(ne[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ye(({isVisible:re,popupRef:ee,hide:X})=>[Ke(me(fa,{ref_key:"searchListRef",ref:E,style:{width:"320px"},options:o.value,loading:x.value,"loading-more":R.value,"selected-id":void 0,"has-more":k.value,onSearch:B,onSelect:l,onLoadMore:ne[0]||(ne[0]=()=>V()),onCancel:X},{item:ye(({item:D,index:U,selectedIndex:K})=>[me(ree,{ref:ie=>i.value[U]=ie,label:D.label,type:D.type,morpheme:D.description||"",onFocusOnSearch:y,onOpen:ie=>c(U),attachTo:ee,config:D.metricConfig,onHandleUpdate:b,class:ae(["metric-update-item",{selected:a.value===U||K===U}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":ye(()=>[...ne[2]||(ne[2]=[Ee("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ye(()=>[...ne[3]||(ne[3]=[nt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[lr,re]])]),default:ye(()=>[ne[4]||(ne[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-162cbb07"]]),Zoe={class:"status-label"},xN=bt(tt({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=jt,o=e,s=t,r=a=>{s("select",a)},i=a=>new On(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(q(),ue("div",{class:ae(["status-option",{selected:o.selected,focused:o.focused,hovered:o.hovered}]),onClick:l[0]||(l[0]=c=>r(e.status.id))},[Ee("div",{class:"status-color",style:hn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),Ke((q(),ue("div",Zoe,[xt(a.$slots,"label",{},()=>[nt(it(e.status.name),1)],!0)])),[[L(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),Joe=["innerHTML"],IN=bt(tt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},s=e,r=n,i=$([]),a=$(!1),l=$(!1),c=$(null),u=$(o.INITIAL_PAGE),d=$(!0),h=$(0),f=$(""),p=Y(()=>{var A;return(A=s.value)==null?void 0:A.id});Y(()=>!!(s.id||s.ids&&s.ids.length>0));const g=A=>({label:A.name,value:A.id,selected:p.value===A.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:A,id:A.id,color:A.color}),v=Y(()=>{const A=new Set;return s.id&&A.add(String(s.id)),s.ids&&s.ids.forEach(M=>{M&&A.add(String(M))}),Array.from(A)}),C=Dn("bulkUpdate",!1),{apiServices:S}=io(!C,s),b=Bf(),{selectionStatus:y}=ts(b),E=Dn("filterParams",null),_=async(A=o.INITIAL_PAGE,M="",V=!1)=>{var B,z,ne,re;V?l.value=!0:a.value=!0,c.value=null;try{const ee={workspaceId:String(s.workspaceId),itemIds:v.value,page:A,perPage:o.PER_PAGE,name_like:M.trim(),...E||{},entityId:String(s.entityId)};if(((B=S.value)==null?void 0:B.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const X=await((z=S.value)==null?void 0:z.getAssignableStatus(ee));if(!(X!=null&&X.data)){V||(i.value=[]),d.value=!1;return}const D=X.data.map(g);i.value=V?[...i.value,...D]:D,h.value=((ne=X.meta)==null?void 0:ne.total)??X.data.length,d.value=!((re=X.meta)!=null&&re.on_last_page),u.value=A}catch(ee){console.error("Error fetching statuses:",ee),c.value="Failed to load statuses",V||(i.value=[]),d.value=!1,r("error",c.value)}finally{a.value=!1,l.value=!1}},x=mr(async A=>{f.value=A,u.value=o.INITIAL_PAGE,await _(o.INITIAL_PAGE,A,!1)},bi),R=async()=>{!d.value||l.value||await _(u.value+1,f.value,!0)},P=()=>{var A;r("cancel"),(A=s.params)==null||A.api.stopEditing()},N=async A=>{var M,V,B;try{const z={workspaceId:String(s.workspaceId),itemIds:v.value,statusId:String(A.value),entityId:String(s.entityId),filterParams:E!=null&&E.value?E==null?void 0:E.value:void 0};y.value==Ft.CHECKED&&C&&(z.itemIds=void 0,z.entityId=String(s.entityId)),r("start-update");const ne=await S.value.updateItemStatus(z);if(!ne)throw new Error("Status update failed: empty response");r("updated",{workspaceId:String(s.workspaceId),itemIds:v.value,isUpdateAll:y.value==Ft.CHECKED&&C,data:{id:A.id,name:A.label,color:A.color}}),s.params&&((V=s.params)==null||V.node.setData({...(M=s.params)==null?void 0:M.node.data,status:{id:A.id,name:A.label,color:A.color}}),(B=s.params)==null||B.api.stopEditing()),r("finish-update",ne)}catch(z){console.error("Error updating status:",z),c.value="Failed to update status",r("error",c.value)}},I=Y(()=>i.value.map(A=>({...A})));Qe([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{_()},{deep:!0,immediate:!0});const k=$(null);return Qt(()=>{ct(()=>{var A;(A=k.value)==null||A.focus()})}),t({refresh:()=>_(o.INITIAL_PAGE,f.value,!1),loadMore:R,focus:()=>{var A;return(A=k.value)==null?void 0:A.focus()}}),(A,M)=>{var V;return q(),je(fa,zt({ref_key:"popupRef",ref:k},s,{"selected-id":(V=s.value)==null?void 0:V.id,options:I.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:L(x),onSelect:N,onLoadMore:R,onCancel:P,onClose:P}),{item:ye(({item:B,selectedIndex:z,isSelected:ne,handleItemHover:re,getHighlightedLabel:ee,query:X,idx:D})=>[(q(),je(xN,{key:B.value,status:B.data,selected:ne(B),onMouseover:U=>re(D),onSelect:U=>N(B),hovered:D===z},{label:ye(()=>[X?(q(),ue("span",{key:0,class:ae([A.$style["item-label"],A.$style.match]),style:{flex:"1"},innerHTML:ee(B.label)},null,10,Joe)):(q(),ue("span",{key:1,class:ae(A.$style["item-label"]),style:{flex:"1"}},it(B.label),3))]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),[["__cssModules",{$style:{"item-label":"_item-label_7ir12_1"}}]]),Qoe=tt({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,o=Y(()=>{const f=ro();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),s=t,r=$(!1),i=$(null),a=f=>{try{r.value=!1,s("updated",f)}catch(p){console.error("Error handling status update:",p)}finally{s("update-completed")}},l=Y(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId,selectedAll:n.selectedAll}));di("bulkUpdate",!0);const c=(f,p)=>{var g,v;r.value=!1,f?(s("update-completed",p),(g=i.value)==null||g.destroy()):(s("update-failed"),(v=i.value)==null||v.open())},u=$(null),d=(f,p)=>{var g;f&&((g=u.value)==null||g.focus())},h=()=>{r.value=!0,s("update-start")};return Qe(()=>n.ids,()=>{}),(f,p)=>(q(),je(zf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:ye(({hide:g,disabled:v})=>[me(pt,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:ye(()=>[me(ut,{src:"Square",class:"icon"}),p[2]||(p[2]=nt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ye(({hide:g})=>[me(IN,zt({disabled:r.value,ref_key:"statusRef",ref:u},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>c(!0,v)),onError:p[1]||(p[1]=v=>c(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:ye(()=>[p[3]||(p[3]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),qr=" ",e0=e=>e.replace(/[\r\n]+/g," "),ny=e=>e instanceof HTMLElement&&e.classList.contains("locked-tag"),zs=e=>(e==null?void 0:e.nodeType)===Node.TEXT_NODE,t0=e=>{var t;return((t=e instanceof Element?e:e.parentElement)==null?void 0:t.closest(".locked-tag"))??null},ma=e=>{let t=0,n=e.length;return ny(e.previousSibling)&&e.data.startsWith(qr)&&(t=1),ny(e.nextSibling)&&n>t&&e.data.endsWith(qr)&&(n-=1),{start:t,end:n}},ese=e=>{if(!zs(e))return!1;const{start:t,end:n}=ma(e);return n<=t},AN=e=>{const t=t0(e.startContainer),n=t0(e.endContainer);return t&&e.setStartAfter(t),n&&e.setEndAfter(n),e},tse=(e,t)=>e.length===t.length&&e.every((n,o)=>{const s=t[o];return typeof n=="string"||typeof s=="string"?n===s:n.id===s.id&&n.text===s.text&&n.direction===s.direction});class nse{constructor(t){Rn(this,"editor",null);Rn(this,"handleInput",()=>{this.editor&&(this.sanitize(),this.ensureTagPadding(),this.normalizeCaret(),this.options.onChange(this.parse()))});Rn(this,"handlePaste",t=>{var n;t.preventDefault(),this.insertPlainText(((n=t.clipboardData)==null?void 0:n.getData("text/plain"))??"")});Rn(this,"handleDrop",t=>{var o,s;t.preventDefault();const n=((o=t.dataTransfer)==null?void 0:o.getData("text/plain"))??"";n&&this.insertPlainText(n,(s=document.caretRangeFromPoint)==null?void 0:s.call(document,t.clientX,t.clientY))});Rn(this,"handleBeforeInput",t=>{const n=t.inputType;(n.startsWith("format")||n==="insertParagraph"||n==="insertLineBreak"||n==="insertFromDrop"||n==="insertFromYank")&&t.preventDefault()});Rn(this,"handleClick",t=>{const n=this.editor,o=window.getSelection();if(!n||!(o!=null&&o.isCollapsed)||t.target!==n)return;const s=document.createRange();if(s.selectNodeContents(n),t.clientX<=s.getBoundingClientRect().right)return;const[r,i]=this.getBoundaryPoint("end");o.collapse(r,i),n.scrollLeft=n.scrollWidth});Rn(this,"handleKeydown",t=>{var s,r,i;const n=this.editor;if(!n)return;if(t.key==="Escape"){(r=(s=this.options).onEscape)==null||r.call(s,t);return}if(t.key==="Enter"){t.preventDefault();return}const o=t.ctrlKey||t.metaKey;if(o&&!t.altKey&&t.key.toLowerCase()==="a"){t.preventDefault(),(i=window.getSelection())==null||i.selectAllChildren(n);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),this.moveToEdge(t.key==="Home"?"start":"end",t.shiftKey);return}if((t.key==="ArrowLeft"||t.key==="ArrowRight")&&!t.shiftKey&&!o&&!t.altKey){this.moveAcrossTag(t.key)&&t.preventDefault();return}if(t.key==="Backspace"||t.key==="Delete"){if(!o&&!t.altKey&&!t.shiftKey&&this.deleteCharacter(t.key)){t.preventDefault();return}const a=this.findAdjacentTag(t.key);a&&(t.preventDefault(),this.removeTag(a,t.key==="Backspace"?"after":"before"))}});Rn(this,"normalizeCaret",()=>{const t=this.editor,n=window.getSelection();if(!t||!(n!=null&&n.rangeCount)||!n.isCollapsed)return;const{startContainer:o,startOffset:s}=n.getRangeAt(0);if(!t.contains(o))return;const r=t0(o);if(!r&&o!==t)return;const i=r??t.childNodes[s-1]??null,a=r?r.nextSibling:t.childNodes[s]??null;if(this.ensureTagPadding(),zs(i))n.collapse(i,ma(i).end);else if(zs(a))n.collapse(a,ma(a).start);else if(zs((i==null?void 0:i.nextSibling)??null)){const l=i.nextSibling;n.collapse(l,ma(l).start)}else if(zs((a==null?void 0:a.previousSibling)??null)){const l=a.previousSibling;n.collapse(l,ma(l).end)}});this.options=t}mount(t,n=[]){this.editor=t,this.render(n),document.addEventListener("selectionchange",this.normalizeCaret)}destroy(){document.removeEventListener("selectionchange",this.normalizeCaret),this.editor=null}sync(t){this.editor&&(tse(t,this.parse())||this.render(t))}render(t){const n=this.editor;n&&(n.innerHTML="",t.forEach(o=>{typeof o=="string"?n.appendChild(document.createTextNode(e0(o))):this.options.isTagAllowed(o.id)&&n.appendChild(this.createTagNode(o))}),this.ensureTagPadding())}parse(){var o;const t=[];let n="";return(o=this.editor)==null||o.childNodes.forEach(s=>{zs(s)?n+=s.data.replace(/\u00A0/g," "):this.isAllowedTagNode(s)&&(n&&(t.push(n),n=""),t.push({id:s.dataset.id||"unknown",text:s.innerText||"Tag",direction:s.dataset.direction??void 0}))}),n&&t.push(n),t}insertTag(t){const n=this.editor;if(!n||!this.options.isTagAllowed(t.id))return;const o=n.querySelector(`.locked-tag[data-id="${t.id}"]`);if(o instanceof HTMLElement){this.applyTagData(o,t),this.handleInput();return}const s=this.createTagNode(t),r=document.createTextNode(qr),i=this.getEditorRange();i?(i.deleteContents(),i.insertNode(r),i.insertNode(s)):n.append(s,r),n.normalize(),this.handleInput(),this.placeCaretAfterTag(r)}updateTag(t,n){var s;const o=(s=this.editor)==null?void 0:s.querySelector(`.locked-tag[data-id="${t}"]`);o instanceof HTMLElement&&(o.innerText=n,this.handleInput())}replaceTag(t,n){if(!this.editor||!this.options.isTagAllowed(n.id))return;const o=this.createTagNode({id:n.id,text:n.label,direction:n.direction}),s=this.editor.querySelector(`.locked-tag[data-id="${t.id}"]`);s instanceof HTMLElement&&(s.replaceWith(o),this.handleInput())}deleteTag(t){const n=this.editor;if(!n)return;const o=n.querySelector(`.locked-tag[data-id="${t}"]`);o instanceof HTMLElement&&this.removeTag(o,"after");const s=this.parse(),r=s[0];s.length===1&&typeof r=="string"&&r.trim()===""&&(n.innerHTML="",this.options.onChange(this.parse()))}isAllowedTagNode(t){return ny(t)&&this.options.isTagAllowed(t.getAttribute("data-id")??"")}applyTagData(t,{text:n,direction:o}){t.innerText=n,o?t.dataset.direction=o:delete t.dataset.direction}createTagNode({id:t,text:n,direction:o}){const s=document.createElement("span");return s.contentEditable="false",s.className="locked-tag",s.dataset.id=t,this.applyTagData(s,{text:n,direction:o}),s}getEditorRange(){const t=window.getSelection();if(!this.editor||!(t!=null&&t.rangeCount))return null;const n=t.getRangeAt(0).cloneRange();return this.editor.contains(n.commonAncestorContainer)?AN(n):null}insertPlainText(t,n){const o=this.editor;if(!o)return;const s=window.getSelection();let r=n?AN(n):this.getEditorRange();(!r||!o.contains(r.commonAncestorContainer))&&(r=document.createRange(),r.selectNodeContents(o),r.collapse(!1)),r.deleteContents();const i=document.createTextNode(e0(t));r.insertNode(i),r.setStartAfter(i),r.collapse(!0),s==null||s.removeAllRanges(),s==null||s.addRange(r),this.handleInput()}sanitize(){const t=this.editor;if(!t)return;t.querySelectorAll(".locked-tag .locked-tag").forEach(o=>o.remove());let n=!1;if(Array.from(t.childNodes).forEach(o=>{if(zs(o)||this.isAllowedTagNode(o))return;n=!0;const s=ny(o)?"":e0(o.textContent??"");o.replaceWith(document.createTextNode(s))}),n){const o=window.getSelection(),s=document.createRange();s.selectNodeContents(t),s.collapse(!1),o==null||o.removeAllRanges(),o==null||o.addRange(s)}}ensureTagPadding(){var t;(t=this.editor)==null||t.querySelectorAll(".locked-tag").forEach(n=>{const o=n.previousSibling,s=n.nextSibling;zs(o)?o.data.endsWith(qr)||o.appendData(qr):n.before(document.createTextNode(qr)),zs(s)?s.data.startsWith(qr)||s.insertData(0,qr):n.after(document.createTextNode(qr))})}async placeCaretAfterTag(t){var s;(s=this.editor)==null||s.focus(),await Promise.resolve();const n=document.createRange();n.setStart(t,ma(t).start),n.collapse(!0);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(n)}findAdjacentTag(t){const n=this.editor,o=window.getSelection();if(!n||!o||!o.isCollapsed||!o.rangeCount)return null;const{startContainer:s,startOffset:r}=o.getRangeAt(0);if(!n.contains(s))return null;const i=t==="Backspace";let a;if(s===n)a=i?n.childNodes[r-1]??null:n.childNodes[r]??null;else if(zs(s)&&s.parentNode===n){const{start:l,end:c}=ma(s);if(i?Math.min(r,c)>l:Math.max(r,l)<c)return null;a=i?s.previousSibling:s.nextSibling}else return null;for(;ese(a);)a=i?a.previousSibling:a.nextSibling;return a&&this.isAllowedTagNode(a)?a:null}getBoundaryPoint(t){const n=this.editor,o=t==="start"?n.firstChild:n.lastChild;return zs(o)?[o,t==="start"?0:o.length]:[n,t==="start"?0:n.childNodes.length]}moveToEdge(t,n){const o=this.editor,s=window.getSelection();if(!o||!s)return;const[r,i]=this.getBoundaryPoint(t),a=n&&s.anchorNode&&o.contains(s.anchorNode)?{node:s.anchorNode,offset:s.anchorOffset}:{node:r,offset:i};s.setBaseAndExtent(a.node,a.offset,r,i),o.scrollLeft=t==="start"?0:o.scrollWidth}moveAcrossTag(t){const n=t==="ArrowLeft",o=this.findAdjacentTag(n?"Backspace":"Delete"),s=window.getSelection();if(!o||!s)return!1;const r=n?o.previousSibling:o.nextSibling;if(!zs(r))return!1;const i=ma(r);return s.collapse(r,n?i.end:i.start),!0}deleteCharacter(t){const n=window.getSelection();if(!this.editor||!(n!=null&&n.isCollapsed)||!n.rangeCount)return!1;const{startContainer:o,startOffset:s}=n.getRangeAt(0);if(!zs(o)||o.parentNode!==this.editor)return!1;const{start:r,end:i}=ma(o);let a,l=1,c=s;if(t==="Backspace"){if(a=Math.min(s,i)-1,a<r)return!1;/[\uDC00-\uDFFF]/.test(o.data[a])&&a>r&&(a--,l=2),c=s-l}else{if(a=Math.max(s,r),a>=i)return!1;/[\uD800-\uDBFF]/.test(o.data[a])&&a+1<i&&(l=2)}return o.deleteData(a,l),n.collapse(o,c),this.handleInput(),!0}removeTag(t,n){var r;const o=t.previousSibling,s=t.nextSibling;t.remove(),o instanceof Text&&s instanceof Text&&o.data.endsWith(qr)&&s.data.startsWith(qr)&&(n==="after"?o.deleteData(o.length-1,1):s.deleteData(0,1)),(r=this.editor)==null||r.normalize(),this.handleInput()}focus(){var o;(o=this.editor)==null||o.focus();const t=document.createRange();t.selectNodeContents(this.editor),t.collapse(!1);const n=window.getSelection();n==null||n.removeAllRanges(),n==null||n.addRange(t)}blur(){var t;(t=this.editor)==null||t.blur()}}const ose={class:"input-wrapper"},sse=["data-placeholder"],rse=bt(tt({__name:"DynamicInput",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Rename to"},allowedTags:{type:Array,default:void 0}},emits:["update:modelValue","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(null),i=new nse({isTagAllowed:a=>!o.allowedTags||o.allowedTags.includes(a),onChange:a=>s("update:modelValue",a),onEscape:a=>s("escape",a)});return Qt(()=>{r.value&&i.mount(r.value,o.modelValue)}),zn(()=>i.destroy()),Qe(()=>o.modelValue,a=>i.sync(a),{deep:!0}),t({insertTag:a=>i.insertTag(a),updateTag:(a,l)=>i.updateTag(a,l),replaceTag:(a,l)=>i.replaceTag(a,l),deleteTag:a=>i.deleteTag(a),focus:()=>{i.focus()},triggerFocus:()=>{ct(()=>{var a;(a=r.value)==null||a.focus()})},blur:()=>{i.blur()}}),(a,l)=>(q(),ue("div",ose,[Ee("div",{ref_key:"editorRef",ref:r,class:"custom-input single-line",contenteditable:"true","data-placeholder":e.placeholder,onPaste:l[0]||(l[0]=(...c)=>L(i).handlePaste&&L(i).handlePaste(...c)),onDrop:l[1]||(l[1]=(...c)=>L(i).handleDrop&&L(i).handleDrop(...c)),onBeforeinput:l[2]||(l[2]=(...c)=>L(i).handleBeforeInput&&L(i).handleBeforeInput(...c)),onInput:l[3]||(l[3]=(...c)=>L(i).handleInput&&L(i).handleInput(...c)),onKeydown:l[4]||(l[4]=(...c)=>L(i).handleKeydown&&L(i).handleKeydown(...c)),onClick:l[5]||(l[5]=Lt((...c)=>L(i).handleClick&&L(i).handleClick(...c),["stop","prevent"]))},null,40,sse)]))}}),[["__scopeId","data-v-e8517a76"]]),ise={key:0},ase={key:1},PN=8,lse=bt(tt({__name:"PreviewName",props:{text:{}},setup(e){const t=jt,n=e,o=$(null),s=$(null),r=$(n.text),i=$(!1),a=d=>{const h=s.value;return h.textContent=d,h.offsetWidth},l=(d,h)=>{const f=d.slice(-PN),p=d.length-PN-1;if(p<1||a(d)<=h)return d;let g=0,v=p;for(;g<v;){const C=Math.ceil((g+v)/2);a(`${d.slice(0,C)}…${f}`)<=h?g=C:v=C-1}return`${d.slice(0,g)}…${f}`},c=()=>{!o.value||!s.value||(r.value=l(n.text,o.value.clientWidth),i.value=r.value!==n.text)};let u;return Qt(()=>{c(),u=new ResizeObserver(c),u.observe(o.value)}),zn(()=>u==null?void 0:u.disconnect()),Qe(()=>n.text,()=>ct(c)),(d,h)=>(q(),ue("div",{ref_key:"rootRef",ref:o,class:"preview-name"},[i.value?Ke((q(),ue("span",ise,[nt(it(r.value),1)])),[[L(t),{content:e.text,delay:[1e3,0],bypassOverflowCheck:!0}]]):(q(),ue("span",ase,it(e.text),1)),Ee("span",{ref_key:"measureRef",ref:s,class:"measure","aria-hidden":"true"},null,512)],512))}}),[["__scopeId","data-v-f1310bab"]]),cse={class:"left-section"},use={class:"modified-template-options"},dse=["onClick"],hse={class:"setting-count"},fse={class:"field-label"},pse={class:"field-label"},gse={class:"confirmation"},mse={class:"preview-section"},vse={class:"preview-list"},yse={key:0,class:"preview-more"},kN=8,n0=7,wse=bt(tt({__name:"BulkRenamePopup",props:{item:{},selectAll:{type:Boolean},selectedItemsCount:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const o=jt,s=Po,r=$(null),i=["number","letter","name"],a={number_up:"1→9",number_down:"9→1",letter_up:"A→Z",letter_down:"Z→A",name:"Name"},l=$({}),c=$(null),u=e,d=$([]),h=Y(()=>{const G=f.value;let te=0;const oe="9999.",O={input:`${oe}0`,bulkRenameButton:`${oe}13`,cancelButton:`${oe}12`,firstField:`${oe}10`,stepField:`${oe}11`,name:`${oe}1`,number_up:`${oe}2`,number_down:`${oe}3`,letter_up:`${oe}4`,letter_down:`${oe}5`};return["name","number_up","number_down","letter_up","letter_down"].forEach((se,ve)=>{te++,O[se]=`${oe}${te}`}),G?(te++,O.firstField=`${oe}${te}`,te++,O.stepField=`${oe}${te}`):(delete O.firstField,delete O.stepField),te++,O.cancelButton=`${oe}${te}`,U.value?delete O.bulkRenameButton:(te++,O.bulkRenameButton=`${oe}${te}`),O}),f=Y(()=>d.value.find(G=>typeof G!="string"&&(G.id==="number"||G.id==="letter"))),p=$("number"),g=$("up"),v=Uo({...Gf.number}),C=Uo({...Gf.number}),S=()=>{Object.assign(v,Gf[p.value]),Object.assign(C,Gf[p.value])};Qe(f,G=>{if(!G)return;const te=G.id;te!==p.value&&(p.value=te,S()),g.value=G.direction==="down"?"down":"up"},{immediate:!0,flush:"sync"});const b=Y(()=>qJ[g.value]),y=(G,te)=>{const oe=eQ(p.value,G,te);v[G]=oe,zO(G,oe)&&(C[G]=oe)},E=$(null),_=$(null),x=$(null),R=(G,te)=>{var O,Q,se,ve;if(te.key==="Enter"||te.key==="Escape")return;if(te.key==="Tab"){te.preventDefault(),te.stopPropagation(),te.stopImmediatePropagation();const ke=te.shiftKey;G=="first"&&(ke?(O=l.value.letter_down)==null||O.focus():(Q=E.value)==null||Q.focus()),G=="step"&&(ke?(se=_.value)==null||se.focus():(ve=x.value)==null||ve.focus());return}te.key.length===1&&!te.ctrlKey&&!te.metaKey&&!te.altKey&&!ZJ(p.value,G,te.key)&&te.preventDefault()},P=(G,te)=>{var ve;te.preventDefault();const oe=te.target,O=((ve=te.clipboardData)==null?void 0:ve.getData("text/plain"))??"",Q=oe.selectionStart??oe.value.length,se=oe.selectionEnd??oe.value.length;oe.value=oe.value.slice(0,Q)+O+oe.value.slice(se),y(G,oe.value),oe.value=v[G]},N=G=>{if(zO(G,v[G]))return;const te=Gf[p.value][G];v[G]=te,C[G]=te},I=Y(()=>f.value?jO({type:p.value,direction:g.value,first:C.first,step:C.step,count:u.item.length}):[]),k=Y(()=>d.value.every(G=>typeof G=="string"&&!G)),A=Y(()=>k.value||d.value.length==0&&d.value[0]===" "?u.item.map(G=>G.name):u.item.map((G,te)=>d.value.map(oe=>typeof oe=="string"?oe:oe.id==="name"?G.name:I.value[te]??"").join(""))),M=Y(()=>u.selectAll?u.selectedItemsCount-n0:A.value.length>kN?A.value.length-n0:0),V=Y(()=>A.value.length>kN?A.value.slice(0,n0):A.value),B=[{id:"name",name:"Current name",icon:null,description:{active:"Remove from the name",inactive:"Add the current name"}},{id:"number_up",name:"Number",icon:"ArrowLeft",description:{active:"Remove from the name",inactive:"Add a number that counts up",switch:"Switch to a number that counts up"}},{id:"number_down",name:"Number",icon:"ArrowRight",description:{active:"Remove from the name",inactive:"Add a number that counts down",switch:"Switch to a number that counts down"}},{id:"letter_up",name:"Letter",icon:"ArrowLeft",description:{active:"Remove from the name",inactive:"Add a letter that counts up",switch:"Switch to a letter that counts up"}},{id:"letter_down",name:"Letter",icon:"ArrowRight",description:{active:"Remove from the name",inactive:"Add a letter that counts down",switch:"Switch to a letter that counts down"}}],z=G=>{re.value=[G];const te=G.id.split("_")[0],oe=G.id.split("_")[1],O=a[G.id],Q=r.value;if(!Q)return;const se=ke=>d.value.find(_e=>typeof _e!="string"&&ke.includes(_e.id));if(te==="name"){se(["name"])?Q.deleteTag("name"):Q.insertTag({id:te,text:O,direction:void 0});return}const ve=se(["number","letter"]);if(ve){const ke=ve.id===te,_e=ve.direction===oe;if(ke&&_e){Q.deleteTag(ve.id);return}Q.deleteTag(ve.id),Q.insertTag({id:te,text:O,direction:oe})}else Q.insertTag({id:te,text:O,direction:oe})},ne=G=>ee(G.id)?G.description.active:!!f.value&&G.description.switch?G.description.switch:G.description.inactive,re=$(null),ee=G=>{const[te,oe]=G.split("_");return d.value.some(O=>typeof O!="string"&&O.id===te&&O.direction===oe)},X=n,D=Y(()=>d.value.length===1&&typeof d.value.at(0)!="string"&&d.value[0].id==="name"),U=Y(()=>d.value.length===0||D.value),K=()=>{re.value=null,d.value=[],X("cancel")},ie=()=>{const G=d.value.map(te=>typeof te=="string"?{type:"text",value:te}:te.id==="name"?{type:"current_name"}:{type:"counter",value:v.first,direction:te.direction=="up"?"asc":"desc",format:te.id==="number"?"number":"letter",step:v.step});X("rename",G)};t({reset:()=>{re.value=null,d.value=[]},focus:()=>{var G;(G=r.value)==null||G.focus()}}),Qt(()=>{setTimeout(()=>{var G;(G=r.value)==null||G.focus()},500)});const Ae=G=>{var te,oe;G.preventDefault(),G.stopPropagation(),(te=r.value)==null||te.blur(),(oe=c.value)==null||oe.focus()},ce=G=>{var te;(G.key==="Enter"||G.key==="Tab")&&((te=r.value)==null||te.focus()),G.key==="Escape"&&K()};return(G,te)=>(q(),ue("div",{class:"bulk-rename-popup",id:"bulk-rename-el",ref_key:"popupRef",ref:c,onKeydown:ce},[Ee("div",cse,[Ke(me(rse,{modelValue:d.value,"onUpdate:modelValue":te[0]||(te[0]=oe=>d.value=oe),"allowed-tags":i,ref_key:"templateInputRef",ref:r,onEscape:Ae},null,8,["modelValue"]),[[L(s),h.value.input]]),Ee("div",use,[(q(),ue(kt,null,An(B,oe=>Ke((q(),ue("button",{onClick:O=>z(oe),ref_for:!0,ref:O=>l.value[oe.id]=O,key:oe.id,class:ae([{active:ee(oe.id)},"template-option"])},[nt(it(oe.name)+" ",1),oe.icon?(q(),je(L(ut),{key:0,src:oe.icon,style:{transform:"rotate(90deg)"}},null,8,["src"])):Ye("",!0)],10,dse)),[[L(o),{content:ne(oe),bypassOverflowCheck:!0,delay:[300,0],interactive:!1,hideOnClick:!1,appendTo:"parent"}],[L(s),`${h.value[oe.id]}`]])),64))]),Ee("div",hse,[Ee("span",fse,it(b.value.first),1),Ke((q(),je(L(Wf),{ref_key:"firstFieldRef",ref:_,"model-value":v.first,disabled:!f.value,"max-length":L(GO),onInput:te[1]||(te[1]=oe=>y("first",oe)),onKeydown:te[2]||(te[2]=oe=>R("first",oe)),onPaste:te[3]||(te[3]=oe=>P("first",oe)),onBlur:te[4]||(te[4]=oe=>N("first")),"show-clear":!1},{clear:ye(()=>[...te[10]||(te[10]=[Ee("div",null,null,-1)])]),_:1},8,["model-value","disabled","max-length"])),[[L(s),h.value.firstField]]),Ee("span",pse,it(b.value.step),1),Ke(me(L(Wf),{"model-value":v.step,disabled:!f.value,"max-length":L(UO),onInput:te[5]||(te[5]=oe=>y("step",oe)),onKeydown:te[6]||(te[6]=oe=>R("step",oe)),onPaste:te[7]||(te[7]=oe=>P("step",oe)),onBlur:te[8]||(te[8]=oe=>N("step")),"show-clear":!1,ref_key:"fieldStepRef",ref:E},null,8,["model-value","disabled","max-length"]),[[L(s),h.value.stepField]])]),Ee("div",gse,[Ke((q(),je(L(pt),{variant:"secondary",onClick:K,ref_key:"cancelBtnRef",ref:x},{default:ye(()=>[...te[11]||(te[11]=[nt(" Cancel ",-1)])]),_:1})),[[L(s),h.value.cancelButton]]),Ke((q(),je(L(pt),{onClick:ie,disabled:U.value,onKeydown:te[9]||(te[9]=jn(oe=>{oe.stopPropagation(),oe.preventDefault(),ie()},["enter"]))},{default:ye(()=>[...te[12]||(te[12]=[nt(" Rename ",-1)])]),_:1},8,["disabled"])),[[L(s),h.value.bulkRenameButton]])])]),Ee("div",mse,[te[13]||(te[13]=Ee("span",{class:"preview-title"},"Preview",-1)),Ee("ul",vse,[(q(!0),ue(kt,null,An(V.value,(oe,O)=>(q(),ue("li",{key:O},[me(lse,{text:oe},null,8,["text"])]))),128)),M.value>0?(q(),ue("li",yse," … "+it(M.value)+" more items ",1)):Ye("",!0)])])],544))}}),[["__scopeId","data-v-cc9e92cb"]]),Cse=tt({__name:"BulkRenameButton",props:{item:{},totalItem:{},selectAll:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const{popupRef:o,show:s,hide:r,triggerRef:i}=mo({interactive:!0,trigger:"manually",placement:"top-end",showArrow:!1,offset:[-350,25],hideOnClick:!0,toggleOnClick:!0,onHide:()=>{h()},onShow:()=>{ct(()=>{var f;(f=d.value)==null||f.focus()})}}),a=e,l=()=>{r()},c=f=>{u("rename",f),r()},u=n,d=$(null),h=()=>{d.value&&d.value.reset()};return t({popupRef:o,hide:r,show:s,triggerRef:i}),(f,p)=>(q(),ue(kt,null,[Ee("div",{class:"trigger-el",ref_key:"triggerRef",ref:i},null,512),Ee("div",{class:"popup-el",ref_key:"popupRef",ref:o},[me(wse,{item:a.item,"select-all":a.selectAll==L(Ft).CHECKED,"selected-items-count":a.totalItem,ref_key:"bulkRenameRef",ref:d,onCancel:l,onRename:c},null,8,["item","select-all","selected-items-count"])],512)],64))}}),bse={style:{"max-width":"225px","line-height":"14px"}},Sse={style:{"max-width":"100px","line-height":"14px"}},Ese=bt(tt({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll","refreshSelectedRow"],setup(e,{emit:t}){const n=jt,o=Po,s=e,r=t,{handelSelectAll:i}=Bf(),a=$(null),{selectionStatus:l,isSelectAll:c,selectedIds:u,isBulkUpdate:d,isUpdating:h,isLoading:f,handleUpdateStart:p,handleUpdatePostUpdate:g,handleUpdateFailed:v,handleUpdateBulkStatus:C,handleUpdateBulkDate:S,handleBulkUpdateMetric:b,handleUpdateNewAssignee:y,handleDelete:E,handleArchive:_,handleUnarchive:x,deleteThumbnail:R,deleteRendition:P,handleBulkUpdateName:N}=lQ(s,a,{onUpdated:()=>r("updated"),onRefreshSelectedRow:()=>r("refreshSelectedRow")});di("bulkUpdate",d),di("isSelectAll",c);const I=["primary"],k=[{label:"Rename",icon:"Pen",id:"bulk-rename",type:"icon",value:"bulk-rename"},{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],A=()=>{r("unselect")},M=aE(),{userPermissions:V}=ts(M),B=Y(()=>V.value.includes(lE)),z=Y(()=>{if(!B.value){console.error("User does not have permission to open review.");return}return l.value==Ft.CHECKED?Zo({type:"review_take",config:{reviewDomain:ln.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,take_id:s.entityId}}).url:Zo({type:"review_multiple_scenes",config:{reviewDomain:ln.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:u.value.join(",")}}).url}),ne=$(null),re=async ie=>{var we,Ae,ce;try{switch(h.value=!0,f.value=!0,ie.id){case"unarchive":await x();break;case"delete":await E();break;case"archive":await _();break;case"delete-thumbnail":await R();break;case"delete-rendition":await P();break;case"bulk-rename":U(),(we=a.value)==null||we.hide();break;default:console.error("Unknown action:",ie.id),f.value=!1;break}}catch(G){console.error("Error performing action:",G),(Ae=a.value)==null||Ae.open()}finally{(ce=ne.value)==null||ce.focus(),ct(()=>{h.value=!1,f.value=!1})}},ee=(ie,we)=>{var Ae;!ie&&we&&((Ae=ne.value)==null||Ae.focus())},X=Y(()=>({workspaceId:s.workspaceId,entityId:s.entityId,variant:I,disabled:h.value,ids:l.value==Ft.CHECKED?[]:u.value})),D=$(null),U=()=>{var ie;(ie=D.value)==null||ie.show()},K=Y(()=>s.selectRowData.map((ie,we)=>({name:ie.name,index:we})));return(ie,we)=>Ke((q(),ue("div",{class:ae(ie.$style["bulk-update-action"])},[Ee("div",{class:ae(ie.$style["left-actions"])},[Ee("div",{class:ae(ie.$style["selection-track"])},[me(pt,{class:ae(ie.$style["btn-close"]),variant:["tertiary","icon"],onClick:A,style:{background:"transparent"}},{prefix:ye(()=>[me(ut,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),L(l)==L(Ft).INDETERMINATE?(q(),ue("span",{key:0,class:ae(ie.$style["selected-count"])},it(e.selectRowData.length)+" selected ",3)):Ye("",!0),L(l)==L(Ft).CHECKED?(q(),ue("span",{key:1,class:ae(ie.$style["selected-count"]),style:{"line-height":"14px"}},[we[0]||(we[0]=nt(' All in " ',-1)),Ke((q(),ue("span",bse,[nt(it(e.takeName),1)])),[[L(n),{content:e.takeName}]]),we[1]||(we[1]=nt(' " ',-1))],2)):Ye("",!0),!e.loading&&L(l)==L(Ft).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(q(),je(pt,{key:2,variant:"secondary",onHandleClick:L(i)},{default:ye(()=>[Ee("span",{class:ae(ie.$style["selected-count"]),style:{"line-height":"14px"}},[we[2]||(we[2]=nt(' Select all in " ',-1)),Ke((q(),ue("span",Sse,[nt(it(e.takeName),1)])),[[L(n),{content:e.takeName}]]),we[3]||(we[3]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Ye("",!0),Ee("span",{class:ae(ie.$style.divider)},null,2)],2),me(Qoe,zt(X.value,{onUpdated:L(C),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),"selected-all":L(l)==L(Ft).CHECKED}),null,16,["onUpdated","onUpdateStart","onUpdateCompleted","onUpdateFailed","selected-all"]),me(kQ,zt({onUpdate:L(y),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),"selected-all":L(l)==L(Ft).CHECKED},X.value),null,16,["onUpdate","onUpdateStart","onUpdateCompleted","onUpdateFailed","selected-all"]),me(zQ,zt({"row-selected":e.selectRowData,"selected-all":L(l)==L(Ft).CHECKED},X.value,{onUpdated:L(S),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v)}),null,16,["row-selected","selected-all","onUpdated","onUpdateStart","onUpdateCompleted","onUpdateFailed"]),me(Xoe,{disabled:L(h),onUpdate:L(b),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),selectedIds:L(u),"workspace-id":e.workspaceId,variant:I,"entity-id":e.entityId,"selected-all":L(l)==L(Ft).CHECKED},null,8,["disabled","onUpdate","onUpdateStart","onUpdateCompleted","onUpdateFailed","selectedIds","workspace-id","entity-id","selected-all"]),Ee("span",{class:ae(ie.$style.divider)},null,2),Ke((q(),ue("div",null,[B.value?(q(),je(pt,{key:0,class:ae(ie.$style["action-button"]),variant:[...I,"icon"],href:z.value,disabled:L(h)||s.selectRowData.length>40&&L(l)!=L(Ft).CHECKED},{default:ye(()=>[me(ut,{src:"PenRuler",class:ae(ie.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Ye("",!0)])),[[L(n),s.selectRowData.length<=40||L(l)==L(Ft).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),Ee("span",{class:ae(ie.$style.divider)},null,2),me(zf,{ref_key:"wrapperRef",ref:a,isUpdating:L(h),disabled:L(h),onOnVisibleChange:ee},{trigger:ye(({hide:Ae,toggle:ce,isVisible:G,disabled:te})=>[Ke((q(),je(pt,{onEscape:Ae,actived:G,ref_key:"moreActionRef",ref:ne,class:ae(ie.$style["action-button"]),variant:["secondary","icon"],loading:L(f),disabled:te||L(h),onClick:Lt(ce,["stop"])},{default:ye(()=>[me(ut,{src:"EllipsisVertical",class:ae(ie.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[L(o),"99999"],[L(n),{content:"More actions"}]])]),popup:ye(({isVisible:Ae,hide:ce})=>[(q(),ue(kt,null,An(k,(G,te)=>me(dl,zt({clickable:!0,key:G.id},{ref_for:!0},G,{show:Ae,style:{borderLeft:0},"focus-index":"99999."+te,onClick:()=>{re(G)},onEscape:ce}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2),me(Cse,{item:K.value,totalItem:L(c)?s.totalRows:K.value.length,"select-all":L(l),onRename:L(N),ref_key:"bulkRenameButtonRef",ref:D},null,8,["item","totalItem","select-all","onRename"])],2)),[[lr,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1odua_1","left-actions":"_left-actions_1odua_20","right-actions":"_right-actions_1odua_21","selection-track":"_selection-track_1odua_26","btn-close":"_btn-close_1odua_32","close-icon":"_close-icon_1odua_38","selected-count":"_selected-count_1odua_42",divider:"_divider_1odua_48","more-button":"_more-button_1odua_53",dropdown:"_dropdown_1odua_57","dropdown-content":"_dropdown-content_1odua_60",delete:"_delete_1odua_83","icon-btn":"_icon-btn_1odua_90","selected-list":"_selected-list_1odua_94"}}]]),ml=bt(tt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Ns,n=jt,o=e,s=Y(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:r}=To(s),i=Y(()=>{var c,u,d;return!!((c=o.params)!=null&&c.api||(u=o.params)!=null&&u.node||(d=o.params)!=null&&d.context)}),a=Y(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const c=o.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=me(hf,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});nb(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=Y(()=>o.value===void 0);return(c,u)=>Ke((q(),je(Oo,zt(L(r),{ref:"displayWrapperRef"}),{default:ye(()=>[Ee("span",{class:ae(c.$style["item-table-label-renderer"])},it(o.value||"-"),3)]),_:1},16)),[[L(t),{isLoading:l.value||!i.value}],[L(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),_se=["placeholder","maxlength"],Rse={key:0,class:"wrapper-suffix"},Tse=bt(tt({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Ns,s=jt,r=e,i=n,a=$(r.value),l=$(null),c=$(null),u=$(r.value||""),d=$(!1),h=$(!1),f=Y(()=>{var I;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((I=r.value)==null?void 0:I.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=To(f),v=()=>u.value!==a.value,C=()=>{h.value=!0,d.value=!1,u.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const I=l.value.value;if(!v()){d.value=!1;return}a.value=I,i("update:value",I),i("enter",I),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():C(),i("blur",u.value))},y=I=>{var k;if(I.key==="ArrowLeft"||I.key==="ArrowRight"){I.stopPropagation();return}I.ctrlKey&&(I.key=="a"||I.key=="A")?(I.stopPropagation(),(k=l.value)==null||k.select()):I.key==="Enter"?(I.preventDefault(),I.stopPropagation(),S()):I.key==="Escape"&&(I.preventDefault(),I.stopPropagation(),C())},E=()=>{a.value=r.value,u.value=r.value,d.value=!0,ct(()=>{var I,k;(I=l.value)==null||I.click(),(k=l.value)==null||k.focus()})},_=()=>{var I;d.value?C():(I=l.value)==null||I.blur(),i("blur",u.value)},x={focus:()=>{E()}};Qt(()=>{var k;const I=(k=c.value)==null?void 0:k.$el;I&&(I.__sceneNameEditor=x)}),zn(()=>{const I=c.value;I&&delete I.__sceneNameEditor});const R=$(null),P=$(null);t({focus:E,blur:()=>{var I;return(I=l.value)==null?void 0:I.blur()},save:S,cancel:C,focusEditButton:()=>{ct(()=>{var I;(I=R.value)==null||I.focus()})},focusCancelButton:()=>{ct(()=>{var I;(I=P.value)==null||I.focus()})},startEdit:E});const N=Y(()=>r.value===void 0);return yE(c,()=>{d.value&&b()}),(I,k)=>Ke((q(),je(L(Oo),zt(L(p),{ref_key:"wrapperRef",ref:c,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),Vh({default:ye(()=>[d.value?Ye("",!0):xt(I.$slots,"default",{isEditting:d.value,isHover:L(g)},()=>[Ke((q(),ue("span",{class:ae(I.$style["label-renderer"])},[nt(it(u.value),1)],2)),[[L(s),{content:u.value||void 0}]])],void 0,0),Ke(Ee("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":k[0]||(k[0]=A=>u.value=A),class:ae(I.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:y,onBlur:b},null,42,_se),[[lr,d.value],[rx,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ye(({hovered:A,focused:M})=>[A?(q(),ue("div",Rse,[A&&!M?Ke((q(),je(pt,{key:0,variant:["icon","secondary"],size:24,onClick:Lt(E,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:R,onKeydown:[jn(Lt(E,["prevent","stop"]),["enter"]),jn(Lt(_,["prevent","stop"]),["escape"])]},{default:ye(()=>[me(L(ut),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[L(s),"Edit"]]):Ye("",!0)])):Ye("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[L(o),{isLoading:N.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),Dse=["tabindex"],FN=bt(tt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=jt,s=Ns,r=e,i=n,a=$(r.value),l=$(r.value),c=$(null),u=$(null),d=Dn("bulkUpdate",!1),{apiServices:h}=io(!d,r),f=Y(()=>{var ee;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((ee=a==null?void 0:a.value)==null?void 0:ee.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=To(f),g=Y(()=>{const ee=ln.getInstance().getItem("ws.code"),X=ln.getInstance().getItem("BASE_URL"),D=ee||r.workspaceId;return Zo({type:"scene_hub",config:{baseDomain:X,ws_code:D,scene_id:String(r.id)}}).url}),v=Y(()=>{var ee,X,D;return((X=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:X.state)==0||((D=r.data)==null?void 0:D.isDeleted)==!0}),C=Y(()=>r.readOnly||_.value),S=Y(()=>{var ee,X,D,U,K;return((ee=r.data)==null?void 0:ee.isDeleted)==!0||((D=(X=r.data)==null?void 0:X.isProcessing)==null?void 0:D.state)==0||((K=(U=r.data)==null?void 0:U.isProcessing)==null?void 0:K.state)==1}),b=Y(()=>{var ee,X;return(X=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:X.message}),y=Y(()=>{var ee;return((ee=r.data)==null?void 0:ee.isArchived)==1}),E=Y(()=>{var ee;return((ee=r.data)==null?void 0:ee.isLocked)==1}),_=Y(()=>r.value===void 0),x=Y(()=>{var ee,X;return((X=(ee=r.data)==null?void 0:ee.permissions)==null?void 0:X.has_edit_permission)==1}),R=async ee=>{var X,D,U,K,ie,we,Ae,ce,G,te;a.value=ee,p.value=!1;try{const oe=await((D=(X=h.value)==null?void 0:X.updateSceneName)==null?void 0:D.call(X,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),O=dv.get(hk)||"UTC";if(oe){const Q=mk(oe,O),se={...r.data,...Q};(U=r.params)==null||U.api.clearFocusedCell();const ve=((ie=(K=r.params)==null?void 0:K.column)==null?void 0:ie.getColId())||"",ke=((Ae=(we=r.params)==null?void 0:we.node)==null?void 0:Ae.rowIndex)||0;(ce=r.params)==null||ce.api.setFocusedCell(ke,ve),(te=(G=r.params)==null?void 0:G.node)==null||te.setData(se),l.value=a.value,i("enter")}else a.value=l.value}catch(oe){console.error("Failed to update scene name:",oe),a.value=l.value}},P={focus:()=>{p.value=!0,ct(()=>{var ee;return(ee=u.value)==null?void 0:ee.focus()})},startEdit:()=>{var ee;(ee=u.value)==null||ee.startEdit()}},N=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;Qe(()=>r.value,ee=>{a.value=ee,l.value=ee}),Qt(()=>{const ee=N();ee&&(ee.__sceneNameEditor=P)}),zn(()=>{const ee=u.value,X=ee&&"$el"in ee?ee.$el:ee;X&&delete X.__sceneNameEditor});const I=cd(),{openSceneHub:k}=I,A=ee=>{try{if(ee.ctrlKey||ee.metaKey){window.open(g.value,"_blank");return}k(String(r.id))}catch{window.open(g.value,"_blank")}finally{ne()}},M=()=>{setTimeout(()=>{re.value=!0,V.value=0,ct(()=>{var ee;(ee=B.value)==null||ee.focus()})},300)},V=$(-1),B=$(null);t({focus:M,trigerFocus:M,startEdit:()=>{var ee;(ee=u.value)==null||ee.startEdit()}});const z=ee=>{if(ee.key==="Enter"){ee.preventDefault(),A(ee);return}if(ee.key==="Escape"){ee.preventDefault(),ne();return}ee.key==="Tab"&&(ee.preventDefault(),ee.stopPropagation(),ee.stopImmediatePropagation(),ct(()=>{var X;(X=u.value)==null||X.focusEditButton()}))},ne=()=>{var D,U,K,ie,we,Ae;re.value=!1,V.value=-1,(D=r.params)==null||D.api.clearFocusedCell();const ee=((K=(U=r.params)==null?void 0:U.column)==null?void 0:K.getColId())||"",X=((we=(ie=r.params)==null?void 0:ie.node)==null?void 0:we.rowIndex)||0;(Ae=r.params)==null||Ae.api.setFocusedCell(X,ee)},re=$(!1);return(ee,X)=>Ke((q(),je(Tse,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:r.disabled,"read-only":C.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":X[0]||(X[0]=D=>a.value=D),id:`scene-name-${r.id}`,onEnter:R,"max-length":255,bordered:!0,keyboardFocusing:re.value,onBlur:ne},{default:ye(({isHover:D,isEditting:U})=>[Ke(Ee("div",{class:ae(ee.$style["scene-name-display"])},[Ke((q(),ue("a",{tabindex:V.value,ref_key:"nameRef",ref:B,onClick:Lt(A,["prevent"]),onKeydown:z,target:"_blank",class:ae(ee.$style["scene-name-text"]),style:{lineHeight:"28px"}},[nt(it(a.value),1)],42,Dse)),[[L(o),{content:a.value,delay:[1e3,0]}]]),C.value||!D&&!U&&!C.value?(q(),ue(kt,{key:0},[E.value?Ke((q(),ue("div",{key:0,class:ae([ee.$style["icon-processing"],ee.$style.isLocked])},[me(ut,{src:"Lock",color:x.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[L(o),{content:x.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Ye("",!0),y.value?Ke((q(),ue("div",{key:1,class:ae([ee.$style["icon-processing"],ee.$style.archived])},[me(ut,{src:"BoxArchive"})],2)),[[L(o),{content:"Archived",delay:[1e3,0]}]]):Ye("",!0),S.value?Ke((q(),ue("div",{key:2,class:ae([ee.$style["icon-processing"],ee.$style.processing,v.value&&ee.$style["icon-red"]])},[me(ut,{src:"AnimatedHourglass",color:"inherit"})],2)),[[L(o),b.value]]):Ye("",!0)],64)):Ye("",!0)],2),[[lr,!L(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[L(s),{isLoading:_.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nare0_1","scene-name-display":"_scene-name-display_nare0_11","icon-processing":"_icon-processing_nare0_18",archived:"_archived_nare0_28",locked:"_locked_nare0_31",processing:"_processing_nare0_34","icon-red":"_icon-red_nare0_38","scene-name-text":"_scene-name-text_nare0_43"}}]]),o0=bt(tt({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick","open"],setup(e,{expose:t,emit:n}){const o=Po,s=$([]),r=e,i=$(null),a=Y(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=Y(()=>{let C=[];return typeof r.variant=="string"?C.push(r.variant):Array.isArray(r.variant)&&(C=[...r.variant]),[...C,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=mo({toggleOnClick:!0,offset:[0,0],onShow:()=>c("open")});function v(C){c("select",C),u()}return Nh(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),Qe(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(q(),ue("div",{class:ae(C.$style["button-dropdown-wrapper"]),style:hn({"--button-size":a.value})},[Ee("div",{class:ae(C.$style["button-group"])},[xt(C.$slots,"prefix"),Ee("div",{ref_key:"triggerRef",ref:f,class:ae(L(d)?C.$style.open:"")},[xt(C.$slots,"triggerDropdown",{open:L(d)},()=>[r.readOnly?Ye("",!0):Ke((q(),je(pt,{key:0,onEscape:L(u),ref_key:"mainButton",ref:i,actived:L(d),class:ae(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:ye(()=>[xt(C.$slots,"iconDropdown",{},()=>[me(ut,{class:ae(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[L(o),e.tabIndex]])])],2)],2),Ee("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:ae(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(q(!0),ue(kt,null,An(e.options,(b,y)=>Ke((q(),je(dl,zt({ref_for:!0,ref:E=>s.value[y]=E,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Lt(E=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ye(()=>[nt(it(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[L(o),`${e.tabIndex}.${y}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),rp=bt(tt({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=jt,o=e,s=t,r=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),s("clear")},i=Y(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(q(),ue("div",{class:ae(a.$style["close-wrapper"])},[e.disableRemove?Ye("",!0):(q(),ue("div",{key:0,class:ae(a.$style["close-button"])},[Ke((q(),je(pt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:ye(()=>[me(ut,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[L(n),i.value]])],2)),xt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),xse=bt(tt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=jt,n=Ns,o=e,{isEditing:s}=sd(o),r=$(o.value),i=$(null),a=$(null),{apiServices:l}=io(!0,o),c=$(!0),u=()=>{c.value=o.value===void 0};Mh(()=>{u()}),Qt(()=>{u()}),Qe(()=>o.value,R=>{u()});const d=Y(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:i,wrapperRef:a,clickable:!(o.readOnly||c.value),active:s})),{argsMain:h,isHover:f}=To(d),p=Y(()=>{var R;return((R=r.value)==null?void 0:R.slice(0,o.maxVisible))||[]}),g=Y(()=>{var R;return Math.max(0,(((R=r.value)==null?void 0:R.length)||0)-o.maxVisible)}),v=Y(()=>{var R;return g.value<=0?"":((R=r.value)==null?void 0:R.slice(o.maxVisible).map(P=>P.name).join(", "))||""}),C=Y(()=>p.value.map(R=>({id:R.id,name:R.name,initial:R.initial,avatarId:R.id,profile_image:R.profile_image,color:R.color,size:24,user:R}))),S=Y(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Qe(()=>o.value,R=>{r.value=R},{immediate:!0,deep:!0});const b=async R=>{var N,I,k;await x(R)&&(r.value=(N=r.value)==null?void 0:N.filter(A=>A.id!==R),(k=o.params)==null||k.node.setData({...(I=o.params)==null?void 0:I.node.data,assignees:r.value}))},y=R=>{var N;const P=ln.getInstance().getItem("ws.code");return((N=l.value)==null?void 0:N.getUserInformation(P,R))||Promise.resolve(null)},{id:E}=Ng(o),_=R=>{var N,I;const P=(I=(N=o.params)==null?void 0:N.api)==null?void 0:I.getRowNode(String(E.value));P==null||P.setDataValue("assignees",Wm(R.assignees))},{removeAssignee:x}=gv({...o,entityId:o.entityId,updateRowData:_,value:o.value,errorCallback:()=>{}});return(R,P)=>Ke((q(),je(Oo,zt(L(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ye(()=>{var N;return[Ee("div",{class:ae(R.$style.assigneeGroupRenderer)},[((N=r.value)==null?void 0:N.length)===0?(q(),je(ut,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:hn(S.value)},null,8,["style"])):Ye("",!0),(q(!0),ue(kt,null,An(C.value,I=>(q(),je(rp,{key:I.id,"disable-remove":o.readOnly||o.disabled,onClear:k=>b(I.id),style:{marginLeft:"0"}},{default:ye(()=>[me(Dc,{user:I.user,"show-profile":!0,apiUpdateFunction:y,class:ae(R.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ke((q(),ue("div",{key:1,class:ae(R.$style["extra-avatars"])},[nt(" +"+it(g.value),1)],2)),[[L(t),v.value]]):Ye("",!0)],2)]}),_:1},16)),[[L(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),Ise=bt(tt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var _,x;const t=jt,n=Ns,o=PS(),s=e,r=$(null),i=$(null),{isEditing:a}=sd(s),l=R=>{if(R){if(typeof R=="string")return R;if(R instanceof Date)return R.toISOString()}},c=Y(()=>s.value===void 0),u=Y(()=>{var R;return(R=s.data)==null?void 0:R.isStarted}),d=Y(()=>{var R;return(R=s.data)==null?void 0:R.isCompleted}),h=Y(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=Y(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Y(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=To(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:y,fullEndDate:E}=BY({start:l((_=s.value)==null?void 0:_[0]),end:l((x=s.value)==null?void 0:x[1]),isStarted:u.value,isEnded:d.value,timezone:s.timezone||o});return(R,P)=>Ke((q(),je(Oo,zt(L(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:ye(()=>[c.value?Ye("",!0):(q(),ue("div",{key:0,class:ae(R.$style.dateRangeRenderer)},[h.value?Ye("",!0):(q(),je(ut,{key:0,src:"Calendar",class:ae(R.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(q(),ue(kt,{key:1},[Ke((q(),ue("span",{class:ae([R.$style.dateLabelDisplay,...L(S).map(N=>R.$style[N])])},[nt(it(L(v)),1)],2)),[[L(t),L(y)]]),P[0]||(P[0]=Ee("span",null,"→",-1)),Ke((q(),ue("span",{class:ae([R.$style.dateLabelDisplay,...L(b).map(N=>R.$style[N])])},[nt(it(L(C)),1)],2)),[[L(t),L(E)]])],64)):Ye("",!0)],2))]),_:1},16)),[[L(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_rsfrm_1",calendarIcon:"_calendarIcon_rsfrm_8",dateSection:"_dateSection_rsfrm_12",dateLabelDisplay:"_dateLabelDisplay_rsfrm_19",empty:"_empty_rsfrm_29","end-today":"_end-today_rsfrm_35",actual:"_actual_rsfrm_38","end-tomorrow":"_end-tomorrow_rsfrm_41","end-yesterday":"_end-yesterday_rsfrm_47","end-past":"_end-past_rsfrm_53","end-future":"_end-future_rsfrm_59","start-today":"_start-today_rsfrm_62","start-tomorrow":"_start-tomorrow_rsfrm_68","start-yesterday":"_start-yesterday_rsfrm_74","start-past":"_start-past_rsfrm_80","start-future":"_start-future_rsfrm_86"}}]]),Ase=tt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:PS()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=$(null);Qt(()=>{ct(()=>{o.value&&o.value.focus()})});const s=e,r=n,i=()=>{var C;(C=s.params)==null||C.api.stopEditing(),r("closed")},a=C=>`${St.fromJSDate(C,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async C=>{await v({startDate:C[0]?a(C[0]):null,dueDate:C[1]?a(C[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async C=>{await v({startDate:C?a(C):null})},h=async C=>{await v({dueDate:C?a(C):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=Dn("bulkUpdate",!1),{apiServices:g}=io(!p,s),v=async C=>{var S,b,y,E,_;try{const x=(S=o.value)==null?void 0:S.getValues(),R=await((y=(b=g.value)==null?void 0:b.changeDate)==null?void 0:y.call(b,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:C.startDate,dueDate:C.dueDate}));R!=null&&R.message&&((_=s.params)==null||_.node.setData({...(E=s.params)==null?void 0:E.node.data,dateRange:x==null?void 0:x.dateRange}))}catch(x){console.error("Failed to update scene name:",x)}};return t({focus:()=>{ct(()=>{var C;(C=o.value)==null||C.focus()})}}),(C,S)=>(q(),je(Ov,zt(s,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:i,ref_key:"calendarRef",ref:o}),null,16))}}),Pse=bt(tt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=$(null),o=$(0);let s=null;Qt(()=>{n.value&&(s=new ResizeObserver(i=>{for(const a of i)o.value=a.contentRect.height}),s.observe(n.value))}),ec(()=>{s&&n.value&&s.unobserve(n.value)});const r=Y(()=>{const i=o.value;return i>120?i-42-36:0});return(i,a)=>(q(),ue("div",{class:ae(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[Ee("div",{class:ae(i.$style["item-header"])},[Ee("div",{class:ae(i.$style["item-header__left"])},[xt(i.$slots,"header-left",{},()=>[Ee("h1",{class:ae(i.$style["item-header__title"])},[xt(i.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),Ee("div",{class:ae(i.$style["item-header__spacer"])},null,2),Ee("div",{class:ae(i.$style["item-header__actions"])},[xt(i.$slots,"header-actions")],2)],2),xt(i.$slots,"grid",{availableHeight:r.value}),Ee("div",{class:ae(i.$style.footer)},[xt(i.$slots,"footer")],2),xt(i.$slots,"new-row"),xt(i.$slots,"bulk-update-actions"),xt(i.$slots,"snackbar"),xt(i.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),ON=bt(tt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=Po,s=e,r=Y(()=>(s==null?void 0:s.workspaceId)||""),i=Y(()=>(s==null?void 0:s.entityId)||""),a=()=>{var M,V,B;return(B=(M=s.params)==null?void 0:M.api)==null?void 0:B.getCellRendererInstances({columns:["options"],rowNodes:(V=s.params)!=null&&V.node?[s.params.node]:[]})[0]},l=()=>{var V,B,z,ne;const M=a();(B=(V=M==null?void 0:M.componsenExposed)==null?void 0:V.blur)==null||B.call(V),(ne=(z=M==null?void 0:M.container)==null?void 0:z.parentElement)==null||ne.classList.remove("ag-cell-focus")},c=()=>{var B,z,ne;(z=(B=s.params)==null?void 0:B.api)==null||z.stopEditing(),l();const M=`scene-name-${s.id}`,V=document.getElementById(M);(ne=V==null?void 0:V.__sceneNameEditor)==null||ne.startEdit()},{apiServices:u}=io(!0,s),d=Y(()=>{var M;return{ws_code:r.value,entity_id:i.value,scene_id:s.id,axiosService:u,optionBlock:s.optionBlock,permissions:(M=s.data)==null?void 0:M.permissions}}),h=M=>{var B,z,ne,re,ee,X;let V=(z=(B=s.params)==null?void 0:B.api)==null?void 0:z.getRowNode(String(s.id));if(V){const D={...V.data,isDeleted:M==="deleted",isArchived:M==="archived"?!0:V.data.isArchived,isLocked:M==="locked"?!0:V.data.isLocked,disabled:!1};M=="deleted"&&(D.isLocked=!1,D.disabled=!0),M=="unarchived"&&(D.isArchived=!1),(re=(ne=s.params)==null?void 0:ne.api)==null||re.redrawRows({rowNodes:[V]}),V.setData(D),(X=(ee=s.params)==null?void 0:ee.api)==null||X.redrawRows({rowNodes:[V]})}},f=cd(),{openSceneHub:p}=f,g=()=>{ct(()=>{var B,z,ne,re,ee,X;const M=((z=(B=s.params)==null?void 0:B.node)==null?void 0:z.rowIndex)||0,V=((re=(ne=s.params)==null?void 0:ne.column)==null?void 0:re.getColId())||"";(X=(ee=s.params)==null?void 0:ee.api)==null||X.setFocusedCell(M,V)})};Y(()=>{var V,B;const M=(B=(V=s.params)==null?void 0:V.api)==null?void 0:B.getRowNode(String(s.id));return M==null?void 0:M.data});const{options:v}=wJ(d,h,c,p,g),C=n,S=()=>{var M,V,B,z,ne,re;console.trace("Focusing current cell for row:",s.id),(re=(M=s.params)==null?void 0:M.api)==null||re.setFocusedCell(((B=(V=s.params)==null?void 0:V.node)==null?void 0:B.rowIndex)||0,((ne=(z=s.params)==null?void 0:z.column)==null?void 0:ne.getColId())||"")},b=Y(()=>{var M;return(M=s.params)==null?void 0:M.api}),y=(M,V)=>{var B,z,ne,re,ee,X,D,U;if(C("actionExecuted",M),M.id=="copy-link"){(ee=b.value)==null||ee.startEditingCell({rowIndex:(z=(B=s.params)==null?void 0:B.node)==null?void 0:z.rowIndex,colKey:(re=(ne=s.params)==null?void 0:ne.column)==null?void 0:re.getColId()});return}else{if(M.id!=="copy-link"&&((X=b.value)==null||X.stopEditing()),M.id==="rename")(D=b.value)==null||D.stopEditing(),(U=b.value)==null||U.clearFocusedCell(),l();else if(M.id==="copy-link"){const K=document.getElementById(V);setTimeout(()=>{var ie,we,Ae;(Ae=(we=(ie=K==null?void 0:K.__vueParentComponent)==null?void 0:ie.exposed)==null?void 0:we.focus)==null||Ae.call(we)},300)}else if(["delete-rendition","delete-thumbnail"].includes(M.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var K,ie;(ie=(K=s.params)==null?void 0:K.api)==null||ie.clearFocusedCell()},300)}},E=()=>{var M,V;(V=(M=s.params)==null?void 0:M.api)==null||V.stopEditing()},_=M=>{var V,B,z,ne;return M==="archive"?!((B=(V=s.params)==null?void 0:V.data)!=null&&B.isArchived):M==="unarchive"?(ne=(z=s.params)==null?void 0:z.data)==null?void 0:ne.isArchived:!0},x=Y(()=>v.value.map(M=>({...M,options:M.options.filter(V=>!V.hide&&_(V.id))})).filter(M=>M.options.length>0)),R=$({}),P=$(null),N=Y(()=>{var V,B;if(s.focusableIndex)return s.focusableIndex;const M=(B=(V=s.params)==null?void 0:V.api)==null?void 0:B.getRowNode(String(s.id));return`${((M==null?void 0:M.rowIndex)??0)+10}`}),I=(M,V)=>`${N.value}.${M*10+V}`,k=(M,V)=>{if(V&&"focus"in V){R.value[M]=V;return}delete R.value[M]},A=M=>{M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation()};return Qt(()=>{var M;(M=P.value)==null||M.focus()}),t({focus(){var B;const M=`${N.value}.0`,V=R.value[M];V&&V.focus?V.focus():(B=P.value)==null||B.focus()}}),(M,V)=>Ke((q(),ue("div",{onKeydown:A,class:ae([M.$style["more-option-section"],{[M.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:P,tabindex:"0",role:"menu"},[(q(!0),ue(kt,null,An(x.value,(B,z)=>(q(),ue("div",{key:B.id,style:hn({"--g-number":Math.min(B.options.length,4),"--g-size":B.type==="column"?"36px":"auto"}),class:ae([M.$style["option-block"],M.$style[B.type]])},[(q(!0),ue(kt,null,An(B.options,(ne,re)=>(q(),ue("div",{key:ne.id,class:ae(M.$style["option-item"])},[me(Fse,{layer:s.layer,"scene-id":String(s.id),option:ne,type:B.type,onActionExecuted:ee=>y(ee,`more-action-${ee.id}-${s.id}`),focusableIndex:I(z,re),ref_for:!0,ref:ee=>k(I(z,re),ee),onHandleHide:E,id:`more-action-${ne.id}-${s.id}`,label:ne.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[L(o),N.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1jg4p_1","option-block":"_option-block_1jg4p_8","option-item":"_option-item_1jg4p_15",row:"_row_1jg4p_19",column:"_column_1jg4p_25",block:"_block_1jg4p_29"}}]]),kse={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},Fse=bt(tt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=Po,s=jt,r=e,i=$(!1),a=$(!1),l=(R,P)=>{if(!P){p();return}const N=P.target;N.closest(".tippy-content")||N.closest(".tippy-box")||N.closest("[data-tippy-root]")||N.closest(".option-item")||p()},c=$(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=mo({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async R=>{var P,N;if(!a.value){a.value=!0;try{await((N=(P=r.option).action)==null?void 0:N.call(P,R)),g("actionExecuted",r.option)}catch(I){console.error("Action execution failed:",I)}finally{a.value=!1,i.value=!1}}},C=async R=>{var P,N;if(R.preventDefault(),R.stopPropagation(),!a.value){if(r.option.isDanger){i.value=!i.value;return}if(r.option.subMenu)h();else{a.value=!0;try{await((N=(P=r.option).action)==null?void 0:N.call(P,R)),g("actionExecuted",r.option)}catch(I){console.error("Action execution failed:",I)}finally{a.value=!1}return}}},S=R=>{g("actionExecuted",R),p()},b=R=>{R.key==="Escape"&&p()},y=R=>({row:"small",column:"medium",block:"small"})[R]||"medium",E=R=>{const P=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...P],column:["menu-item",...P],block:["secondary",...P]}[R]||[]},_=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{ct(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{C(new MouseEvent("click"))}});const x=R=>{var P;R.stopPropagation(),R.preventDefault(),i.value=!1,(P=u.value)==null||P.focus()};return(R,P)=>{var N;return Ke((q(),ue("div",{ref_key:"wrapperRef",ref:c,class:ae(R.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Lt(C,["stop","prevent"])},[Ke((q(),je(pt,{ref_key:"triggerRef",ref:u,class:ae(R.$style["option-item"]),disabled:e.option.disabled||a.value,actived:L(f)||i.value,size:y(e.type),variant:E(e.type),onClick:Lt(C,["stop","prevent"]),onKeydown:b,onEscape:_,label:e.option.label},{prefix:ye(()=>[e.option.icon?(q(),ue("div",kse,[me(ut,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Ye("",!0)]),suffix:ye(()=>[e.option.subMenu?(q(),je(ut,{key:0,src:"Play",source:"remote"})):Ye("",!0),e.option.isDanger&&i.value?(q(),ue("div",{key:1,class:ae(R.$style["confirm-action"])},[Ke((q(),je(pt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:x},{default:ye(()=>[me(ut,{src:"XMarkSolid",source:"remote"})]),_:1})),[[L(o),`${r.focusableIndex}.0`],[L(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((q(),je(pt,{variant:["danger","primary","icon"],size:"small",onClick:Lt(v,["stop","prevent"]),onEscape:P[0]||(P[0]=I=>i.value=!1)},{default:ye(()=>[me(ut,{src:"Check",source:"remote"})]),_:1})),[[L(o),`${r.focusableIndex}.1`],[L(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[L(o),r.focusableIndex]]),e.option.subMenu?(q(),ue("div",{key:0,ref_key:"popupRef",ref:d,class:ae(R.$style["submenu-container"])},[me(ON,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((N=e.option)==null?void 0:N.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Ye("",!0)],2)),[[L(s),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),MN=(e,t)=>{const n=$(Number(e.value.value)),o=Y(()=>e.value.metricConfig),s=Y(()=>{var g,v;const l=o.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),r=17,i=Y(()=>{var l;return{maxRating:((l=o.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:r}});return{componentState:s,metricConfig:o,ICON_SIZE:r,ratingParams:i,standardNameforIcon:()=>{var c;return(((c=o.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},Ose=["aria-label"],NN=bt(tt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Ns,o=jt,s=e,r=Rh(!1),i=$(null),a=$(null),{isEditing:l}=sd(s),c=Y(()=>{var V,B;return{value:s.value,metricConfig:((B=(V=s.params)==null?void 0:V.colDef)==null?void 0:B.context)||s.config,error:s.error,hovered:r.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=MN(c,r),f=Y(()=>{var B,z;let V=!1;if(["number","formula"].includes(d.value.metric_type.code)){const ne=Number(s.value),re=Number((B=d.value)==null?void 0:B.format_value);Number.isFinite(re)&&re>=0&&(V=(((z=ne.toString().split(".")[1])==null?void 0:z.length)||0)>re)}return V}),p=Y(()=>{var V;return!!((V=d.value)!=null&&V.morpheme_value)||u.value.isEmpty||f.value}),g=Y(()=>{var z,ne,re;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const V=P.value,B=(z=d.value)==null?void 0:z.morpheme_type;return B==="prefix"?`${((ne=d.value)==null?void 0:ne.morpheme_value)||""} ${V}`.trim():B==="suffix"?`${V} ${((re=d.value)==null?void 0:re.morpheme_value)||""}`.trim():V}),v=Y(()=>{const{format_type:V,format_value:B}=d.value;if(V==="dropdown"&&typeof B=="string"&&B.startsWith("["))try{return JSON.parse(B)}catch{return[]}return[]}),C=Y(()=>({disabled:s.disabled,error:u.value.isError,inputRef:i,wrapperRef:a,clickable:!R.value,readOnly:s.readOnly||R.value,isEmpty:u.value.isEmpty})),{argsMain:S,isHover:b}=To(C),y=(V,B,z="en-US")=>new Intl.NumberFormat(z,{minimumFractionDigits:B,maximumFractionDigits:B}).format(V),E=Y(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const V=s.value,{format_type:B,format_value:z,mapping:ne}=d.value;if(ne&&typeof ne=="object"&&!Array.isArray(ne)){const re=ne[`!${V}`];if(re)return re}if(B==="dropdown"){const re=v.value.find(ee=>String(ee.name)===String(V));if(re)return re.name}if(typeof V=="string"){const re=Number(V);return Number.isNaN(re)?V:V.replace(/[.-]/g,"").length>16?_(V,z):_(re,z)}return typeof V=="number"?_(V,z):String(V)}),_=(V,B)=>{const z=Number.parseInt(String(B)||"2",10),ne=Number.isFinite(z)&&z>=0?z:2;try{if(typeof V=="string"){const re=V.split("."),ee=re[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),X=re[1]?re[1].substring(0,ne).padEnd(ne,"0"):"0".repeat(ne);return ne>0?`${ee}.${X}`:ee}return y(V,ne)}catch(re){return console.error("Error formatting metric value:",re,{num:V,decimals:ne}),String(V)}},x=(V,B)=>{const z=Number.parseInt(String(B)||"2",10),ne=Number.isFinite(z)&&z>=0?z:2;try{if(typeof V=="string"){const re=V.split("."),ee=re[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),X=re[1]?re[1].length:0,D=Math.max(ne,X),U=re[1]?re[1].padEnd(D,"0"):"0".repeat(D);return D>0?`${ee}.${U}`:ee}return new Intl.NumberFormat("en-US",{minimumFractionDigits:ne,maximumFractionDigits:20}).format(V)}catch(re){return console.error("Error formatting exact metric value:",re,{num:V,decimals:ne}),String(V)}},R=Y(()=>{var V;return((V=d.value)==null?void 0:V.metric_type.code)==="formula"}),P=Y(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const V=s.value,{format_type:B,format_value:z,mapping:ne}=d.value;if(ne&&typeof ne=="object"&&!Array.isArray(ne)){const re=ne[`!${V}`];if(re)return re}if(B==="dropdown"){const re=v.value.find(ee=>String(ee.name)===String(V));if(re)return re.name}if(typeof V=="string"){const re=Number(V);return Number.isNaN(re)?V:V.replace(/[.-]/g,"").length>16?x(V,z):x(re,z)}return typeof V=="number"?x(V,z):String(V)}),{tooltip:N}=bk(""),I=async V=>{V.stopPropagation(),V.preventDefault(),V.stopImmediatePropagation();try{await navigator.clipboard.writeText(P.value),N.value="Copied",setTimeout(()=>{N.value="Copy"},3e3)}catch(B){console.error("Failed to copy text:",B),N.value="Copy failed",setTimeout(()=>{N.value="Copy"},3e3)}};Qe(()=>s.value,(V,B)=>{const z=Number(V);Number.isFinite(z)&&z!==h.value?h.value=z:V==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const A=()=>{r.value=!0},M=()=>{r.value=!1};return(V,B)=>Ke((q(),je(Oo,zt(L(S),{onMouseenter:A,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:L(l),bordered:!0}),{suffix:ye(()=>[s.disabled?Ye("",!0):(q(),ue("div",{key:0,class:ae([V.$style.suffix,"wrapper-suffix"])},[r.value&&!L(u).isEmpty&&!L(u).isError?Ke((q(),je(pt,{key:0,variant:["icon","secondary"],size:24,onClick:Lt(I,["prevent","stop"])},{default:ye(()=>[me(ut,{src:"Copy",source:"remote",size:12})]),_:1})),[[L(o),{content:L(N),hideOnClick:!1,contentClass:"extra-padding"}]]):Ye("",!0)],2))]),default:ye(()=>[Ee("div",{class:ae(V.$style["metric-wrapper"]),"aria-label":L(d).format_value||void 0},[Ee("div",{class:ae([V.$style["metric-content"],s.disabled?V.$style.disabled:""])},[!L(u).isError&&L(u).isEmpty?(q(),ue(kt,{key:0},[L(u).pendingCalculation?Ke((q(),ue("span",{key:0,class:ae(V.$style["metric-empty"])},[...B[0]||(B[0]=[nt(" - ",-1)])],2)),[[L(o),"Can’t calculate yet. Complete required fields."]]):L(u).isEmpty?(q(),ue("span",{key:1,class:ae(V.$style["metric-empty"])}," - ",2)):Ye("",!0)],64)):Ye("",!0),L(u).isError?Ke((q(),ue("div",{key:1,class:ae(V.$style["metric-error"])},[...B[1]||(B[1]=[nt(" Error ",-1)])],2)),[[L(o),"Something went wrong. Review formula, inputs and retry."]]):Ye("",!0),!L(u).isEmpty&&!L(u).isError?Ke((q(),ue("span",{key:2,class:ae([V.$style["metric-value"],L(b)?V.$style.hovered:"",{[V.$style.disabled]:s.disabled}])},[nt(it(E.value),1)],2)),[[L(o),{content:g.value,bypassOverflowCheck:p.value}]]):Ye("",!0)],2)],10,Ose)]),_:1},16,["actived"])),[[L(n),{isLoading:L(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_lu0ag_1","metric-content":"_metric-content_lu0ag_5",disabled:"_disabled_lu0ag_15","metric-value":"_metric-value_lu0ag_19",hovered:"_hovered_lu0ag_19","metric-error":"_metric-error_lu0ag_23","with-morpheme":"_with-morpheme_lu0ag_38","with-formula-icon":"_with-formula-icon_lu0ag_41","metric-value--number":"_metric-value--number_lu0ag_47","metric-value--currency":"_metric-value--currency_lu0ag_47","metric-value--percentage":"_metric-value--percentage_lu0ag_47","metric-morpheme":"_metric-morpheme_lu0ag_51","metric-empty":"_metric-empty_lu0ag_64","metric-icon":"_metric-icon_lu0ag_71"}}]]),Mse={key:0,style:{color:"#6b6b6b"}},Nse=bt(tt({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue","open"],setup(e,{expose:t,emit:n}){const o=jt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},r={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},a={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},l=e,c={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=Y(()=>{var M,V;if(l.headerType)return l.headerType;if(((V=(M=l.params)==null?void 0:M.column)==null?void 0:V.getColId()).includes("metric"))return"default";const A=l.headerType??l.params.column.getColId();return c[A]||"default"}),d=$(),h=()=>{var A,M,V;const k=(M=(A=l.params)==null?void 0:A.column)==null?void 0:M.getColDef();if((V=k.colId)!=null&&V.includes("metric")){if(k.context.is_primary==1)return"primary";if(k.context.is_point_metric==1)return"secondary"}};Nh(()=>{d.value=h()}),Qt(()=>{d.value=h()});const f=Y(()=>{var k,A;return((A=(k=l.params)==null?void 0:k.column.getColDef().context)==null?void 0:A.morpheme_value)||void 0}),p=Y(()=>{var k;return(k=l.params)==null?void 0:k.displayName}),g=Y(()=>{let k=[];switch(u.value){case"dateRange":k=Object.values(s).map(A=>({...A,selected:C.value===A.value,type:"text",hover:R.value===A.value}));break;case"date":k=Object.values(r).map(A=>({...A,selected:C.value===A.value,type:"text",hover:R.value===A.value}));break;case"number":k=Object.values(i).map(A=>({...A,selected:C.value===A.value,type:"text",hover:R.value===A.value}));break;default:k=Object.values(a).map(A=>({...A,selected:C.value===A.value,type:"text",hover:R.value===A.value}));break}return C.value!=="none"&&k.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:R.value=="none"}),k}),v=Y(()=>String(C.value).endsWith("asc")?"SortUp":String(C.value).endsWith("desc")?"SortDown":"Sort"),C=$(l.modelValue??"none"),S=k=>{if(I.value){I.value=!1;return}_("update:modelValue",k),_("sort-changed",k)},b=k=>{C.value=k},y=mr(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let k;C.value==="none"?k="asc":C.value==="asc"?k="desc":k="none",C.value=k}else{const k=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],M=(k.indexOf(C.value)+1)%k.length;C.value=k[M]}},bi),E=Y(()=>{if(C.value==="none")return"No sorting applied";const k=g.value.find(A=>A.value===C.value);return(k==null?void 0:k.label)||""}),_=n,x=Y(()=>{if(l.disabled&&!l.readOnly)return"var(--disabled-color)";if(C.value!=="none")return"var(--primary-color-hover)"});Qe(()=>l.modelValue,k=>{k!=C.value&&(C.value=k)}),Qe(C,k=>{k!==l.modelValue&&S(k)});const R=$(C.value);Qe(()=>C.value,k=>{R.value=k});const P=k=>{var B,z;if(l.readOnly||l.disabled)return;let A=0;k.key==="ArrowDown"?A=1:k.key==="ArrowUp"&&(A=-1);const M=g.value.findIndex(ne=>ne.value===R.value),V=g.value.length;if(k.key==="Enter"||k.key===" ")k.preventDefault(),C.value=R.value,(B=N.value)==null||B.hide();else if(A!==0){k.preventDefault();let ne=(M+A+V)%V;R.value=g.value[ne].value}else k.key==="Escape"&&((z=N.value)==null||z.hide())},N=$(null);Qt(()=>{var k,A;(A=(k=N.value)==null?void 0:k.$el)==null||A.addEventListener("keydown",P)}),ec(()=>{var k,A;(A=(k=N.value)==null?void 0:k.$el)==null||A.removeEventListener("keydown",P)});const I=$(!1);return t({setDefaultSort:k=>{C.value=k?k.direction:"none",I.value=!0},clear:()=>{C.value="none"}}),(k,A)=>(q(),je(o0,{ref_key:"dropdownRef",ref:N,options:g.value,label:p.value,readOnly:l.readOnly,onOpen:A[0]||(A[0]=M=>k.$emit("open")),disabled:l.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:L(y),onSelect:A[1]||(A[1]=M=>b(M))},{prefix:ye(()=>[me(pt,{variant:["text"],onClick:L(y),size:"small"},{default:ye(()=>[Ke((q(),ue("b",null,[nt(it(p.value),1)])),[[L(o),{content:p.value}]]),f.value?(q(),ue("small",Mse," ("+it(f.value)+") ",1)):Ye("",!0),d.value=="primary"?Ke((q(),ue("div",{key:1,class:ae(k.$style["icon-metric"])},[me(ut,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[L(o),"Woohoo metric"]]):Ye("",!0),d.value=="secondary"?Ke((q(),ue("div",{key:2,class:ae(k.$style["icon-metric"])},[me(ut,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[L(o),"Point Metric"]]):Ye("",!0)]),_:1},8,["onClick"])]),iconDropdown:ye(()=>[Ke(me(ut,{src:v.value,source:"remote",color:x.value},null,8,["src","color"]),[[L(o),E.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),Lse=["disabled","readonly","checked","indeterminate"],LN=bt(tt({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=jt,o=Po,s=e,r=t,i=Y(()=>{if(typeof s.size=="string"){if(["small","medium","large"].includes(s.size))switch(s.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(s.size.endsWith("px"))return s.size}return typeof s.size=="number"?`${s.size}px`:"20px"}),a=Y(()=>s.allowIndeterminate?[Ft.UNCHECK,Ft.INDETERMINATE,Ft.CHECKED]:[Ft.UNCHECK,Ft.CHECKED]),l=Y(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(u.value){case Ft.UNCHECK:return s.tooltipText.unchecked;case Ft.INDETERMINATE:return s.tooltipText.indeterminate;case Ft.CHECKED:return s.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=$(typeof s.modelValue=="boolean"?s.modelValue?Ft.CHECKED:Ft.UNCHECK:s.modelValue),d=Y(()=>({checked:u.value===Ft.CHECKED,indeterminate:u.value===Ft.INDETERMINATE,none:u.value===Ft.UNCHECK})),h=Y(()=>s.disabled||s.readOnly);return Qe(()=>u.value,f=>{r("update:modelValue",f===Ft.CHECKED)}),(f,p)=>Ke((q(),ue("input",{disabled:s.disabled,key:u.value,readonly:s.readOnly,type:"checkbox",class:ae([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:hn({"--input-size":i.value})},null,46,Lse)),[[L(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[L(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),Vse=bt(tt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=jt,o=Bf(),{setSelectionStatus:s}=o,{rowCount:r,selectionStatus:i}=ts(o),a=$(new Set);Qe(i,y=>{s(y)},{immediate:!0});const l=Y(()=>i.value!==Ft.UNCHECK),c=Y(()=>({checked:i.value===Ft.CHECKED,indeterminate:i.value===Ft.INDETERMINATE,UNCHECK:i.value===Ft.UNCHECK})),u=Y(()=>({[Ft.UNCHECK]:"Click to select all",[Ft.INDETERMINATE]:"Click to clear selection",[Ft.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=Y(()=>{const y=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&y.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),y}),h=y=>({selected:y.getSelectedRows().length,total:r.value.total,loaded:r.value.loaded}),f=({api:y,state:E})=>{if(y)if(E===Ft.UNCHECK)y.deselectAll(),a.value.clear(),i.value=E;else if(E===Ft.CHECKED){const _=new Set;y.forEachNode(x=>{x.isSelected()&&_.add(x.id||"")}),a.value=_,y.forEachNode(x=>x.setSelected(!0)),i.value=E}else y.forEachNode(_=>_.setSelected(!0)),i.value=E},p=()=>{var _;const y=(_=t.params)==null?void 0:_.api;if(!y){console.error("[HeaderCheckbox] There is no API available");return}const E={[Ft.UNCHECK]:Ft.INDETERMINATE,[Ft.INDETERMINATE]:Ft.UNCHECK,[Ft.CHECKED]:Ft.UNCHECK};f({api:y,state:E[i.value]})},g=y=>{var x;const E=(x=t.params)==null?void 0:x.api;if(!E){console.error("no api");return}const _={INDETERMINATE:Ft.INDETERMINATE,GLOBAL:Ft.CHECKED,UNCHECK:Ft.UNCHECK};f({api:E,state:_[y]})},v=mr(y=>{const{selected:E,total:_}=h(y);if(_==0){i.value=Ft.UNCHECK;return}E===_?i.value=Ft.CHECKED:E===0?i.value=Ft.UNCHECK:i.value=Ft.INDETERMINATE},300);let C=[];const S=y=>{v(y)};Qt(()=>{var R;const y=(R=t.params)==null?void 0:R.api;if(!y)return;const E=P=>v(P.api),_=()=>S(y),x=()=>S(y);y.addEventListener("selectionChanged",E),y.addEventListener("rowDataUpdated",_),y.addEventListener("modelUpdated",_),C=[()=>y.removeEventListener("selectionChanged",E),()=>y.removeEventListener("rowDataUpdated",_),()=>y.removeEventListener("modelUpdated",x)]}),zn(()=>{C.forEach(y=>y())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(y,E)=>(q(),je(o0,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ye(()=>[Ke((q(),je(LN,{"tab-index":"8",id:b,disabled:t.disabled,key:L(i),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:L(i),"onUpdate:modelValue":E[0]||(E[0]=_=>vn(i)?i.value=_:null),onChange:p,"aria-label":L(i)===L(Ft).CHECKED?"All items selected":"Select visible items",class:ae(y.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[L(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_4qktt_1","button-group":"_button-group_4qktt_62","button-main":"_button-main_4qktt_62",headerCheckbox:"_headerCheckbox_4qktt_66"}}]]),VN=bt(tt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Ns,n=jt,o=e,{isEditing:s}=sd(o),r=$(null),i=$(null),a=Y(()=>o.value),l=Y(()=>a.value===void 0),c=Y(()=>{var g,v;return((g=a.value)==null?void 0:g.name)||((v=a.value)==null?void 0:v.label)||"No status"}),u=Y(()=>{var g;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:T9((g=a.value)==null?void 0:g.label),inputRef:r,wrapperRef:i,clickable:!o.disabled&&!o.readOnly,active:s}}),{argsMain:d,isHover:h}=To(u),f=Y(()=>{var g;return((g=a.value)==null?void 0:g.color)||"#fff"}),p=Y(()=>new On(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((q(),je(L(Oo),zt(L(d),{ref_key:"wrapperRef",ref:i,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!L(s)&&!L(h)||!a.value?"#f3f5f8":void 0}}),{default:ye(()=>[l.value?Ye("",!0):(q(),ue("div",{key:0,class:ae({[g.$style["status-renderer"]]:!0,[g.$style["has-status"]]:a.value,[g.$style["has-suffix"]]:!!g.$slots.suffix})},[a.value?(q(),ue(kt,{key:0},[Ke((q(),ue("div",{class:ae(g.$style["status-renderer__status-name"])},[nt(it(c.value),1)],2)),[[L(n),{content:c.value,delay:[1e3,0]}]]),xt(g.$slots,"suffix")],64)):(q(),ue(kt,{key:1},[Ee("div",{class:ae(g.$style["status-renderer__color-code"])},null,2),v[0]||(v[0]=Ee("span",{style:{color:"#a6a6a6"}},"No status",-1)),xt(g.$slots,"suffix")],64))],2))]),_:3},16,["style"])),[[L(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_k5c36_1","has-status":"_has-status_k5c36_9","has-suffix":"_has-suffix_k5c36_12","status-renderer__color-code":"_status-renderer__color-code_k5c36_22","status-renderer__status-name":"_status-renderer__status-name_k5c36_33"}}]]),BN=bt(tt({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},minWidth:{default:"300px"},popupIndex:{default:109},showCloseBtn:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,s=Y(()=>Number(o.popupIndex)),{popupRef:r,show:i,hide:a,isVisible:l}=zY({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(d){return document.body},zIndex:s.value}),c=d=>{o.closeOnEscape&&d.key==="Escape"&&l.value&&a()};Qt(()=>{document.addEventListener("keydown",c)}),zn(()=>{document.removeEventListener("keydown",c)}),t({show:i,hide:a,isVisible:l});const u=n;return Qe(()=>l.value,d=>{u(d?"shown":"hidden")}),(d,h)=>{const f=Lh("tooltip");return q(),ue("div",{ref_key:"popupRef",ref:r,class:ae(d.$style.popupContainer)},[Ee("div",{class:ae(d.$style.popupWrapper)},[Ee("div",{class:ae(d.$style.header)},[xt(d.$slots,"header",{},()=>[Ee("span",{class:ae(d.$style["header-title"])},it(e.popupName),3)]),o.showCloseBtn?Ke((q(),je(pt,{key:0,variant:["icon","text"],onClick:L(a),"aria-label":"Close popup",size:"small"},{default:ye(()=>[me(ut,{src:"Xmark",size:8})]),_:1},8,["onClick"])),[[f,"Close"]]):Ye("",!0)],2),Ee("div",{class:ae(d.$style.body)},[xt(d.$slots,"default")],2),d.$slots.footer?(q(),ue("div",{key:0,class:ae(d.$style.footer)},[xt(d.$slots,"footer")],2)):Ye("",!0)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1986t_1",popupWrapper:"_popupWrapper_1986t_9",popupFadeIn:"_popupFadeIn_1986t_1",header:"_header_1986t_24","header-title":"_header-title_1986t_34",body:"_body_1986t_43",footer:"_footer_1986t_48"}}]]),Bse=["onMouseenter","onMouseleave"],$se=["innerHTML"],Hse=["innerHTML"],Gse=["data-tooltip"],Use={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},Wse=bt(tt({__name:"Snackbar",setup(e){const t=jt,n=R3,o=Ss(),{removeNotification:s}=o,{notifications:r}=ts(o),i=f=>f.trim().startsWith("<svg"),a=$("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=$(new Set),d=f=>{var p;u.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;u.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(q(),je(r3,{name:"list",tag:"div",class:ae(["notification-center",f.$style["notification-wrapper"]])},{default:ye(()=>[(q(!0),ue(kt,null,An(L(r),g=>{var v;return Ke((q(),ue("div",{key:g.id,class:ae([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:C=>d(g.id),onMouseleave:C=>h(g.id)},[Ee("p",{class:ae(f.$style.snackbar__message)},[g.type!="white"?(q(),ue("span",{key:0,class:ae(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(q(),je(ut,{key:0,src:"CircleCheck",source:"remote"})):Ye("",!0),!g.icon&&g.type=="interactive"?(q(),je(ut,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(q(),je(ut,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(q(),ue("i",{key:3,class:ae(f.$style["icon-draw"]),innerHTML:g.icon},null,10,$se)):g.icon&&!i(g.icon)?(q(),je(ut,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)],2)):Ye("",!0),Ee("span",{class:ae(f.$style["error-message"])},[Ee("span",{class:ae(f.$style.message),innerHTML:g.message},null,10,Hse)],2)],2),g.actions?(q(),ue("div",{key:0,class:ae(f.$style["actions-notification"]),"data-notification":"true"},[(q(!0),ue(kt,null,An(g.actions,C=>(q(),je(pt,zt({key:C.label},{ref_for:!0},C,{onClick:Lt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ye(()=>[C.btnIcon?(q(),je(ut,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)]),_:2},1040,["onClick"]))),128))],2)):Ye("",!0),g.type!=="interactive"&&g.type!=="white"?Ke((q(),ue("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[me(pt,{variant:"secondary",onClick:C=>c(g.message),class:ae(f.$style["copy-btn"])},{prefix:ye(()=>[me(ut,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,Gse)),[[L(t),a.value]]):Ye("",!0),g.type=="interactive"?Ke((q(),ue("div",Use,[me(pt,{variant:"tertiary",onClick:C=>L(s)(g.id),class:ae(f.$style["close-btn"]),size:18},{default:ye(()=>[me(ut,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[L(t),"Close"]]):Ye("",!0)],42,Bse)),[[L(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_1gnza_1","notification-item":"_notification-item_1gnza_15","notification--success":"_notification--success_1gnza_30","notification--error":"_notification--error_1gnza_36","close-btn":"_close-btn_1gnza_42","notification--info":"_notification--info_1gnza_45","notification--warning":"_notification--warning_1gnza_52","notification--interactive":"_notification--interactive_1gnza_59","notification--white":"_notification--white_1gnza_67","snackbar-type":"_snackbar-type_1gnza_75",snackbar__message:"_snackbar__message_1gnza_84",message:"_message_1gnza_97","error-message":"_error-message_1gnza_105",snackbar__icon:"_snackbar__icon_1gnza_111","actions-notification":"_actions-notification_1gnza_120","icon-draw":"_icon-draw_1gnza_128","copy-btn":"_copy-btn_1gnza_136"}}]]);/*!
|
|
159
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){a=!0,r=l},f:function(){try{i||n.return==null||n.return()}finally{if(a)throw r}}}}function fd(e,t,n){return(t=cN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function pd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lN(Object(n),!0).forEach(function(o){fd(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Rne(e,t){if(e==null)return{};var n,o,s=Tne(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function Tne(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function Fc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(f,p,g,v){var C=p&&p.prototype instanceof a?p:a,S=Object.create(C.prototype);return Ws(S,"_invoke",function(b,y,E){var _,x,R,P=0,N=E||[],I=!1,k={p:0,n:0,v:e,a:A,f:A.bind(e,4),d:function(M,V){return _=M,x=0,R=e,k.n=V,i}};function A(M,V){for(x=M,R=V,t=0;!I&&P&&!B&&t<N.length;t++){var B,z=N[t],ne=k.p,re=z[2];M>3?(B=re===V)&&(R=z[(x=z[4])?5:(x=3,3)],z[4]=z[5]=e):z[0]<=ne&&((B=M<2&&ne<z[1])?(x=0,k.v=V,k.n=z[1]):ne<re&&(B=M<3||z[0]>V||V>re)&&(z[4]=M,z[5]=V,k.n=re,x=0))}if(B||M>1)return i;throw I=!0,V}return function(M,V,B){if(P>1)throw TypeError("Generator is already running");for(I&&V===1&&A(V,B),x=V,R=B;(t=x<2?e:R)||!I;){_||(x?x<3?(x>1&&(k.n=-1),A(x,R)):k.n=R:k.v=R);try{if(P=2,_){if(x||(M="next"),t=_[M]){if(!(t=t.call(_,R)))throw TypeError("iterator result is not an object");if(!t.done)return t;R=t.value,x<2&&(x=0)}else x===1&&(t=_.return)&&t.call(_),x<2&&(R=TypeError("The iterator does not provide a '"+M+"' method"),x=1);_=e}else if((t=(I=k.n<0)?R:b.call(y,k))!==i)break}catch(z){_=e,x=1,R=z}finally{P=1}}return{value:t,done:I}}}(f,g,v),!0),S}var i={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(Ws(t={},o,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,c):(f.__proto__=c,Ws(f,s,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=c,Ws(d,"constructor",c),Ws(c,"constructor",l),l.displayName="GeneratorFunction",Ws(c,s,"GeneratorFunction"),Ws(d),Ws(d,s,"Generator"),Ws(d,o,function(){return this}),Ws(d,"toString",function(){return"[object Generator]"}),(Fc=function(){return{w:r,m:h}})()}function Ws(e,t,n,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}Ws=function(r,i,a,l){function c(u,d){Ws(r,u,function(h){return this._invoke(u,d,h)})}i?s?s(r,i,{value:a,enumerable:!l,configurable:!l,writable:!l}):r[i]=a:(c("next",0),c("throw",1),c("return",2))},Ws(e,t,n,o)}function Dne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cN(e){var t=Dne(e,"string");return typeof t=="symbol"?t:t+""}function qv(e){"@babel/helpers - typeof";return qv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qv(e)}function xne(e,t){if(e){if(typeof e=="string")return iN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iN(e,t):void 0}}var KE=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function uN(e){return qv(e)==="object"&&e!==null&&!Array.isArray(e)}function dN(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Ine(e){return typeof Blob<"u"&&e instanceof Blob}var Ane=function(t){return uN(t)&&dN(t,["file","fileName"])&&Ine(t.file)&&typeof t.fileName=="string"},Pne=function(t){return uN(t)&&dN(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"},kne=Object.freeze(fd(fd({},KE.TOOLBOX_EXPORT_DATA,Ane),KE.SW_APP_LOADER,Pne));function Fne(e){return qv(e)==="object"&&e!==null&&!Array.isArray(e)}function One(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Mne(e){if(!Fne(e))return{valid:!1,reason:"Message must be an object."};if(e.version!==1)return{valid:!1,reason:"Unsupported or missing message version."};if(typeof e.type!="string"||!Object.values(KE).includes(e.type))return{valid:!1,reason:"Unknown or missing message type."};if(e.id!==void 0&&typeof e.id!="string")return{valid:!1,reason:"Message id must be a string when provided."};var t=e.id===void 0?["version","type","payload"]:["version","type","payload","id"];if(!One(e,t))return{valid:!1,reason:"Message contains missing or unexpected fields."};var n=e.type;return kne[n](e.payload)?{valid:!0,message:e}:{valid:!1,reason:"Payload does not match the ".concat(n," schema.")}}function Nne(e){var t=e.target,n=e.allowedOrigins,o=e.onMessage,s=e.onInvalidMessage,r=t??(typeof window>"u"?void 0:window);if(!r)throw new TypeError("A target window is required outside a browser environment.");if(!Array.isArray(n)||n.length===0)throw new TypeError("At least one allowed message origin must be configured.");if(n.some(function(a){return typeof a!="string"||a.length===0||a==="*"}))throw new TypeError("Allowed message origins must be explicit origin strings; wildcards are not allowed.");if(typeof o!="function")throw new TypeError("An onMessage callback is required.");var i=function(l){if(!n.includes(l.origin)){s==null||s(l.data,"Untrusted message origin: ".concat(l.origin),l);return}var c=Mne(l.data);if(c.valid===!1){s==null||s(l.data,c.reason,l);return}o(c.message,l)};return r.addEventListener("message",i),function(){return r.removeEventListener("message",i)}}class Lne extends Error{}class gl extends Lne{constructor(){super("Zone is an abstract class")}}class hN{get type(){throw new gl}get name(){throw new gl}get ianaName(){return this.name}get isUniversal(){throw new gl}offsetName(t,n){throw new gl}formatOffset(t,n){throw new gl}offset(t){throw new gl}equals(t){throw new gl}get isValid(){throw new gl}}const qE=new Map;function Vne(e){let t=qE.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),qE.set(e,t)),t}const Bne={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function $ne(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function Hne(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=Bne[r];r==="era"?o[a]=i:Xv(a)||(o[a]=parseInt(i,10))}return o}const YE=new Map;class Yv extends hN{static create(t){let n=YE.get(t);return n===void 0&&YE.set(t,n=new Yv(t)),n}static resetCache(){YE.clear(),qE.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Yv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Wne(t,n,o,this.name)}formatOffset(t,n){return Jv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=Vne(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?Hne(o,n):$ne(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=Une({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let XE=null;class gd extends hN{static get utcInstance(){return XE===null&&(XE=new gd(0)),XE}static instance(t){return t===0?gd.utcInstance:new gd(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new gd(pN(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Jv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Jv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Jv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function Xv(e){return typeof e>"u"}function Zv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function fN(e){if(!(Xv(e)||e===null||e===""))return parseInt(e,10)}function Gne(e){if(!(Xv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Une(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Wne(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function pN(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function Jv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Zv(n,2)}:${Zv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Zv(n,2)}${Zv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const gN=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function md(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function vd(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function mN(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=fN(t[n+s]);return[o,null,n+s]}}const vN=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,zne=`(?:${vN.source}?(?:\\[(${gN.source})\\])?)?`,yN=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,wN=RegExp(`${yN.source}${zne}`),ZE=RegExp(`(?:[Tt]${wN.source})?`),jne=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Kne=/(\d{4})-?W(\d\d)(?:-?(\d))?/,qne=/(\d{4})-?(\d{3})/,Yne=mN("weekYear","weekNumber","weekDay"),Xne=mN("year","ordinal"),Zne=/(\d{4})-(\d\d)-(\d\d)/,CN=RegExp(`${yN.source} ?(?:${vN.source}|(${gN.source}))?`),Jne=RegExp(`(?: ${CN.source})?`);function yd(e,t,n){const o=e[t];return Xv(o)?n:fN(o)}function Qne(e,t){return[{year:yd(e,t),month:yd(e,t+1,1),day:yd(e,t+2,1)},null,t+3]}function wd(e,t){return[{hours:yd(e,t,0),minutes:yd(e,t+1,0),seconds:yd(e,t+2,0),milliseconds:Gne(e[t+3])},null,t+4]}function np(e,t){const n=!e[t]&&!e[t+1],o=pN(e[t+1],e[t+2]),s=n?null:gd.instance(o);return[{},s,t+3]}function op(e,t){const n=e[t]?Yv.create(e[t]):null;return[{},n,t+1]}md(jne,ZE),md(Kne,ZE),md(qne,ZE),md(wN),vd(Qne,wd,np,op),vd(Yne,wd,np,op),vd(Xne,wd,np,op),vd(wd,np,op),vd(wd),md(Zne,Jne),md(CN),vd(wd,np,op);var eoe=["accessTokenKey","refreshTokenKey","domain","path","secure","sameSite","canSetTokens","cookieParser"];function Tt(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).log.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function sp(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).error.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function Qv(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).warn.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function toe(){var e=typeof window<"u"?sessionStorage.getItem("BASE_DOMAIN_COOKIE")||window.location.hostname:void 0;return Tt("getStandardizedCookieConfig - domain:",e,"from BASE_DOMAIN_COOKIE:",sessionStorage.getItem("BASE_DOMAIN_COOKIE")),{accessTokenKey:"account.token",refreshTokenKey:"account.refresh_token",domain:e,path:"/",secure:!0,sameSite:"lax"}}function noe(){return{maxRetries:5,retryDelay:500,backoffFactor:1.5}}var bN=1e3,ooe=1e4;function SN(e){if(!(typeof window>"u")){var t=window.self!==window.top;try{if(t&&window.top){Tt("Inside iframe - redirecting top window to:",e),window.top.location.replace(e);return}}catch(n){sp("Top window redirect blocked, redirecting current window instead:",n)}try{Tt("Redirecting current window to:",e),window.location.replace(e)}catch(n){sp("Failed to redirect:",n)}}}function ey(e){return typeof e!="string"||!e?e:e.length<=2?"*".repeat(e.length):"".concat(e[0]).concat("*".repeat(e.length-2)).concat(e[e.length-1])}function soe(e){return pd(pd({},e),{},{access_token:ey(e.access_token),token:ey(e.token),refresh_token:ey(e.refresh_token)})}function ty(e){if(!e)return!1;var t=e.trim();return!!t&&t!=="undefined"&&t!=="null"}function EN(e){return ty(e.getAccessToken())||ty(e.getRefreshToken())}function roe(e){if(!(typeof document>"u")){var t=typeof window<"u"?window.location.hostname:"",n=e||(typeof sessionStorage<"u"?sessionStorage.getItem("BASE_DOMAIN_COOKIE"):null)||t,o=Array.from(new Set([n,t].filter(Boolean)));Tt("Clearing all cookies - domains:",o);var s=document.cookie.split(";");s.forEach(function(r){var i=r.split("=")[0].trim();i&&(document.cookie="".concat(i,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"),o.forEach(function(a){document.cookie="".concat(i,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=").concat(a)}))})}}function ioe(){typeof sessionStorage<"u"&&sessionStorage.clear()}function aoe(e){return function(t){var n,o=(n=t.response)===null||n===void 0?void 0:n.status,s=EN(e);if(Tt("getStandardizedTokenExpiredDetection - status:",o,"userLoggedIn:",s),!s)return Tt("User not logged in - returning false"),!1;if(o===400){var r,i,a,l=(r=t.response)===null||r===void 0?void 0:r.data,c=(l==null?void 0:l.error)==="invalid_token"||(l==null||(i=l.error)===null||i===void 0?void 0:i.key)==="invalid_token";return Tt(" 400 error - isInvalidToken:",c,"error:",l==null?void 0:l.error,"error.key:",l==null||(a=l.error)===null||a===void 0?void 0:a.key),!1}if(o===401){var u,d,h=(u=t.response)===null||u===void 0?void 0:u.data,f=h==null||(d=h.error)===null||d===void 0?void 0:d.key,p=h==null?void 0:h.details;return Tt(" 401 error - errorKey:",f,"details:",p),f==="unauthenticated"&&(!p||Object.keys(p).length===0||p.reason==="refresh_token_expired")?(Tt(" 401 unauthenticated - triggering refresh"),!0):(Tt(" 401 error but not unauthenticated - returning false"),!1)}return o===425?(Tt(" 425 error - triggering refresh"),!0):(Tt("Status",o,"not handled - returning false"),!1)}}var loe=function(){function e(){var t,n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};zE(this,e),this.accessTokenKey=o.accessTokenKey||"access_token",this.refreshTokenKey=o.refreshTokenKey||"refresh_token",this.domain=o.domain,this.path=o.path||"/",this.secure=(t=o.secure)!==null&&t!==void 0?t:!0,this.sameSite=o.sameSite||"lax",this.canSetTokens=(n=o.canSetTokens)!==null&&n!==void 0?n:!0,this.cookieParser=o.cookieParser}return jE(e,[{key:"getCookieValue",value:function(n){if(typeof document>"u")return null;var o=document.cookie.split(";"),s=_ne(o),r;try{for(s.s();!(r=s.n()).done;){var i=r.value;if(i=i.trim(),i.startsWith(n+"=")){var a=i.substring(n.length+1);return this.cookieParser?this.cookieParser(a,n):decodeURIComponent(a)}}}catch(l){s.e(l)}finally{s.f()}return null}},{key:"getAccessToken",value:function(){return this.getCookieValue(this.accessTokenKey)}},{key:"getRefreshToken",value:function(){return this.getCookieValue(this.refreshTokenKey)}},{key:"getExpiresInRefreshToken",value:function(){return this.getCookieValue("account.expires_in_refresh_token")}},{key:"setTokens",value:function(n){if(!this.canSetTokens||typeof document>"u"){Qv(" CookieTokenStorage: Token setting is disabled or running in a non-browser environment");return}Tt(" setTokens called - storing tokens with keys:",this.accessTokenKey,this.refreshTokenKey,"domain:",this.domain);var o=this.domain?"; domain=".concat(this.domain):"",s=this.secure?"; secure":"",r="; samesite=".concat(this.sameSite),i="",a="";if(n.expires_in&&typeof n.expires_in=="number"){var l=new Date;l.setTime(l.getTime()+n.expires_in*1e3),i=";expires=".concat(l.toUTCString())}var c=this.getExpiresInRefreshToken();if(Tt("setTokens - refresh token data:",soe(n)),Tt("setTokens - refresh token expires_in value:",c),c){var u=new Date;u.setTime(u.getTime()+Number(c)*1e3),a=";expires=".concat(u.toUTCString())}if(n.access_token||n.token){var d=n.access_token||n.token,h="".concat(this.accessTokenKey,"=").concat(encodeURIComponent(d),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(i);document.cookie=h}if(n.refresh_token_expires_in&&typeof n.refresh_token_expires_in=="number"){var f=new Date;f.setTime(f.getTime()+n.refresh_token_expires_in*1e3),i=";expires=".concat(f.toUTCString())}if(n.refresh_token){Tt("setTokens - refresh token set to:",ey(n.refresh_token)),Tt("setTokens - refresh token expires_in set to:",a);var p="".concat(this.refreshTokenKey,"=").concat(encodeURIComponent(n.refresh_token),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(a);document.cookie=p}}},{key:"hasTokens",value:function(){return!!this.getAccessToken()&&!!this.getRefreshToken()}}])}(),coe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auth_state_channel",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auth_state_event";zE(this,e),fd(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return jE(e,[{key:"initChannel",value:function(){if(typeof BroadcastChannel<"u")try{this.channel=new BroadcastChannel(this.channelName)}catch(n){console.error("Failed to create BroadcastChannel, falling back to storage events:",n),this.channel=null}}},{key:"broadcastEvent",value:function(n){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={type:n,data:s,timestamp:Date.now()};this.channel?this.channel.postMessage(r):typeof localStorage<"u"&&(localStorage.setItem(this.storageKey,JSON.stringify(r)),setTimeout(function(){return localStorage.removeItem(o.storageKey)},100))}},{key:"onEvent",value:function(n){var o=this;return this.channel?this.channel.onmessage=function(s){n(s.data)}:typeof window<"u"&&window.addEventListener("storage",function(s){if(s.key===o.storageKey&&s.newValue)try{var r=JSON.parse(s.newValue);n(r)}catch(i){console.error("Failed to parse auth event:",i)}}),function(){o.channel?o.channel.onmessage=null:typeof window<"u"&&window.removeEventListener("storage",function(){})}}},{key:"destroy",value:function(){this.channel&&(this.channel.close(),this.channel=null)}}])}(),uoe=function(){function e(t){var n=this;if(zE(this,e),fd(this,"currentAttempt",0),fd(this,"isLoggingOut",!1),this.instanceId=Math.random().toString(36).substring(2,15),this.refreshTokenFn=t.refreshTokenFn,this.tokenStorage=t.storage,this.useStandardizedConfig=t.useStandardizedConfig===!0,Tt("RefreshTokenHandler initialized - useStandardizedConfig:",this.useStandardizedConfig),this.useStandardizedConfig){var o=noe();this.maxRetries=o.maxRetries,this.retryDelay=o.retryDelay,this.backoffFactor=o.backoffFactor,Tt(" Using standardized retry config - maxRetries:",this.maxRetries,"retryDelay:",this.retryDelay,"backoffFactor:",this.backoffFactor)}else this.maxRetries=t.maxRetries||3,this.retryDelay=t.retryDelay||1e3,this.backoffFactor=t.backoffFactor||2,Tt(" Using custom retry config - maxRetries:",this.maxRetries,"retryDelay:",this.retryDelay,"backoffFactor:",this.backoffFactor);this.onCrossTabLogout=t.onCrossTabLogout,this.authStateManager=new coe,this.initCrossTabListener(),this.onRefreshSuccess=t.onRefreshSuccess||function(){Tt("Token refresh successful")},this.onRefreshFailure=t.onRefreshFailure||function(s){console.error("Token refresh failed:",s)},this.onTokenInvalid=t.onTokenInvalid||function(){Tt("Token is invalid or cannot be refreshed");var s=new Error("No refresh token available");n.useStandardizedConfig?n.handleLogout("no_refresh_token",s):(n.onRefreshFailure(s),n.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:n.instanceId,reason:"no_refresh_token",error:"No refresh token available"}))}}return jE(e,[{key:"isLogoutInProgress",get:function(){return this.isLoggingOut}},{key:"handleLogout",value:function(n,o){if(this.isLoggingOut){Tt("handleLogout skipped - logout already in progress");return}Tt("handleLogout called with reason:",n),this.onRefreshFailure&&(Tt("Calling onRefreshFailure callback"),this.onRefreshFailure(o));var s=this.getLogoutTag(n,"this-tab");this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,tag:s,error:(o==null?void 0:o.message)||"Token refresh failed"}),this.clearStateAndRedirectToLogin(s)}},{key:"getLogoutTag",value:function(n,o){return ty(this.tokenStorage.getRefreshToken())?(console.error("False logout detected. Refresh token not expired. Reason: ".concat(n)),console.error("Sender channel: ".concat(o)),-1):1}},{key:"clearStateAndRedirectToLogin",value:function(n){if(!this.isLoggingOut){this.isLoggingOut=!0;var o=typeof sessionStorage<"u"&&sessionStorage.getItem("BASE_URL")||"",s=typeof sessionStorage<"u"&&sessionStorage.getItem("BASE_DOMAIN_COOKIE")||void 0;if(typeof localStorage<"u"&&typeof window<"u")try{var r="".concat(window.location.pathname).concat(window.location.search);localStorage.setItem("last_url_access_after_timeout",r),localStorage.removeItem("retryCount"),Tt("localStorage updated - saved last URL:",r)}catch(a){sp("Failed to update localStorage:",a)}Tt("Clearing sessionStorage and cookies"),ioe(),roe(s);var i="".concat(o,"/login?timeout=").concat(n);Tt("Redirecting to login in ".concat(bN,"ms:"),i),setTimeout(function(){return SN(i)},bN)}}},{key:"initCrossTabListener",value:function(){var n=this;this.authStateManager.onEvent(function(o){if(o.type==="auth:logout")if(Tt("Received logout event:",o.data),o.data&&o.data.sourceInstanceId!==n.instanceId){if(Tt("Logout event from different tab, executing logout handlers"),n.onCrossTabLogout?(Tt("Executing onCrossTabLogout with reason: ".concat(o.data.reason||"cross_tab_logout")),n.onCrossTabLogout(o.data.reason||"cross_tab_logout")):typeof n.onLogout=="function"?(Tt("Executing legacy onLogout with reason: ".concat(o.data.reason)),n.onLogout(o.data.reason)):n.useStandardizedConfig||console.warn("No logout handler defined for cross-tab events"),n.useStandardizedConfig){var s=o.data.tag===-1||o.data.tag===1,r=s?o.data.tag:n.getLogoutTag(o.data.reason||"cross_tab_logout","cross-tab");s&&r===-1&&(console.error("False logout detected. Reason: ".concat(o.data.reason||"cross_tab_logout")),console.error("Sender channel: cross-tab")),Tt("Standardized mode - logging out this tab after cross-tab event, tag:",r),n.clearStateAndRedirectToLogin(r)}}else Tt("Ignoring self-generated logout event")})}},{key:"handleTokenRefresh",value:function(){var t=WE(Fc().m(function o(){var s=this,r,i,a,l;return Fc().w(function(c){for(;;)switch(c.p=c.n){case 0:if(r=this.tokenStorage.getRefreshToken(),Tt(" handleTokenRefresh started, refreshToken available:",!!r),r){c.n=1;break}return Tt(" ERROR: No refresh token available - cannot refresh"),this.onTokenInvalid(),c.a(2,!1);case 1:return this.currentAttempt=0,c.p=2,c.n=3,this.executeWithRetry(function(){return Tt("Refresh attempt ".concat(s.currentAttempt+1,"/").concat(s.maxRetries)),s.refreshTokenFn(s.tokenStorage.getRefreshToken())});case 3:if(i=c.v,!(!i||!i.access_token&&!i.token)){c.n=4;break}throw console.error("Invalid token response received"),new Error("Invalid token response");case 4:return i.token&&!i.access_token&&(i.access_token=i.token),Tt(" Token refresh successful, saving new tokens"),this.tokenStorage.setTokens(i),Tt(" Calling onRefreshSuccess callback"),this.onRefreshSuccess(i),c.a(2,!0);case 5:return c.p=5,l=c.v,console.error("Token refresh failed after all attempts:",l),l===void 0&&(l=new Error("Undefined error during token refresh")),this.useStandardizedConfig?this.handleLogout("max_retry_reached",l):(this.onRefreshFailure(l),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:"max_retry_reached",error:((a=l)===null||a===void 0?void 0:a.message)||"Token refresh failed after maximum retries"})),c.a(2,!1)}},o,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=WE(Fc().m(function o(s){var r,i,a,l;return Fc().w(function(c){for(;;)switch(c.p=c.n){case 0:return c.p=0,c.n=1,s();case 1:return c.a(2,c.v);case 2:if(c.p=2,l=c.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){c.n=3;break}throw Tt("Maximum retry attempts (".concat(this.maxRetries,") reached")),l;case 3:return i=(l==null||(r=l.response)===null||r===void 0?void 0:r.status)===425,a=i?this.getRetryAfterDelay(l):this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1),Tt("Retry in ".concat(a,"ms, attempt ").concat(this.currentAttempt,"/").concat(this.maxRetries)),c.n=4,new Promise(function(u){return setTimeout(u,a)});case 4:return c.a(2,this.executeWithRetry(s))}},o,this,[[0,2]])}));function n(o){return t.apply(this,arguments)}return n}()},{key:"getRetryAfterDelay",value:function(n){var o;if(n!=null&&(o=n.response)!==null&&o!==void 0&&o.headers){var s=n.response.headers["retry-after"];if(s){var r=parseInt(s,10);if(!isNaN(r))return r*1e3;var i=new Date(s);if(!isNaN(i.getTime()))return i.getTime()-Date.now()}}return this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1)}},{key:"broadcastLogout",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"manual_logout";Tt("Broadcasting logout event with reason: ".concat(n)),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,timestamp:Date.now()})}}])}();function doe(e,t){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=(n=o.useStandardizedConfig)!==null&&n!==void 0?n:t.useStandardizedConfig;Tt("createRefreshInterceptor called - useStandardizedConfig:",s);var r=s?aoe(t.tokenStorage):o.tokenExpiredDetection||function(c){var u;return((u=c.response)===null||u===void 0?void 0:u.status)===401},i=s?[401,425]:o.retryStatusCodes||[401,425],a=o.tokenHeaderFormatter||function(c){return"Bearer ".concat(c)};Tt("Interceptor config - retryStatusCodes:",i,"using standardized detection:",s);var l=null;e.interceptors.response.use(function(c){return c},function(){var c=WE(Fc().m(function u(d){var h,f,p,g,v,C,S,b,y,E,_,x,R,P,N,I,k,A,M,V,B;return Fc().w(function(z){for(;;)switch(z.p=z.n){case 0:if(g=d.config,v=function(re){var ee,X=s&&t.isLogoutInProgress;return Qv(X?"HOLD ->":"REJECT ->",((g==null?void 0:g.method)||"").toUpperCase(),g==null?void 0:g.url,"| status:",(ee=d.response)===null||ee===void 0?void 0:ee.status,"| reason:",re,"| logoutInProgress:",t.isLogoutInProgress,"| at:",new Date().toISOString().slice(11,23)),X?new Promise(function(D,U){setTimeout(function(){Qv("Logout redirect did not happen in time - releasing held request:",g==null?void 0:g.url),U(d)},ooe)}):Promise.reject(d)},g){z.n=1;break}return z.a(2,v("no request config"));case 1:if(!g._retry){z.n=2;break}return z.a(2,v("retried request failed again"));case 2:if(C=(h=d.response)===null||h===void 0?void 0:h.status,Tt(" Response error handler triggered - status:",C,"url:",g.url),S=r(d),Tt(" tokenExpiredDetection returned:",S),b=!1,C===400)if(_=(y=d.response)===null||y===void 0?void 0:y.data,x=(_==null?void 0:_.error)==="invalid_token"||(_==null||(E=_.error)===null||E===void 0?void 0:E.key)==="invalid_token",x)if(b=!1,s){if(Tt(" 400 invalid_token (standardized) - clearing account.token from cookies"),typeof document<"u")try{R=sessionStorage.getItem("BASE_DOMAIN_COOKIE")||window.location.hostname,Tt(" Clearing account.token - domain:",R),document.cookie="account.token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=".concat(R),document.cookie="account.token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/",Tt(" ✅ Removed account.token from cookies (prevents infinite 400 loop)")}catch(ne){sp(" Failed to clear account.token:",ne)}typeof window<"u"&&(P=sessionStorage.getItem("BASE_URL")||"",N="".concat(P,"/sw?redirect=1"),Tt("Redirecting to re-auth page - URL:",N),SN(N))}else Tt(" 400 invalid_token (custom config) - user handles via callbacks");else b=!1,Tt(" 400 non-invalid_token - skip refresh");else s&&C===401&&!EN(t.tokenStorage)?(I=typeof window<"u"&&window.location.pathname.includes("/login"),k=/login|refresh-token|refreshToken/i.test(g.url||""),I||k?Tt("401 with no tokens on login page/auth request - not redirecting"):(Tt("401 with no tokens - logging out and redirecting to /login"),t.handleLogout("no_tokens",new Error("No authentication tokens available"))),b=!1):(b=S&&i.includes(C),Tt(" Status",C,"- shouldRefresh:",S,"in retryStatusCodes:",i.includes(C),"canRetry:",b));if(b){z.n=3;break}return z.a(2,v("not eligible for refresh"));case 3:if(A=((f=g.url)===null||f===void 0?void 0:f.includes("refresh-token"))||((p=g.url)===null||p===void 0?void 0:p.includes("refreshToken")),!A){z.n=4;break}return z.a(2,v("refresh endpoint itself failed"));case 4:return g._retry=!0,z.p=5,l?Tt(" Using existing refresh promise"):(Tt(" Starting new token refresh"),l=t.handleTokenRefresh()),z.n=6,l;case 6:if(M=z.v,l=null,M){z.n=7;break}return z.a(2,v("token refresh failed (waiting request)"));case 7:return V=t.tokenStorage.getAccessToken(),Tt(" Token refreshed successfully, new token available:",!!V),V?(Tt(" Injecting refreshed token into Authorization header for retry"),g.headers.Authorization=a(V)):Qv(" WARNING: Token refresh succeeded but no token in storage!"),Tt(" Retrying original request with new token"),z.a(2,e(g));case 8:return z.p=8,B=z.v,sp(" Error during refresh:",B),l=null,z.a(2,v("error thrown during refresh"))}},u,null,[[5,8]])}));return function(u){return c.apply(this,arguments)}}()),e.interceptors.request.use(function(c){var u=c.headers.Authorization;if(u){var d=String(u).replace(/^Bearer\s*/i,"").trim();if(d&&d!=="undefined"&&d!=="null")return c;Tt("Removing invalid Authorization header:",u),delete c.headers.Authorization}var h=t.tokenStorage.getAccessToken(),f=t.tokenStorage.getRefreshToken();return Tt(" Request interceptor: token exists:",!!h,"refreshToken exists:",!!f,"url:",c.url),h&&ty(h)?(Tt(" Access token available - injecting into Authorization header"),c.headers.Authorization=a(h)):Tt(f?" Access token missing/empty but refresh token available - response interceptor will handle 401":" Both tokens missing/empty - allowing request (no token to inject)"),c},function(c){return Promise.reject(c)})}function hoe(e){var t=e.useStandardizedConfig===!0;Tt("createCookieRefreshHandler called - useStandardizedConfig:",t);var n;if(t){var o=toe();n=pd(pd({},o),{},{canSetTokens:e.canSetTokens,cookieParser:e.cookieParser}),Tt(" Applied standardized cookie config:",n)}else{var s=e.accessTokenKey,r=e.refreshTokenKey,i=e.domain,a=e.path,l=e.secure,c=e.sameSite,u=e.canSetTokens,d=e.cookieParser;n={accessTokenKey:s,refreshTokenKey:r,domain:i,path:a,secure:l,sameSite:c,canSetTokens:u,cookieParser:d},Tt(" Applied custom cookie config:",n)}var h=new loe(n);e.accessTokenKey,e.refreshTokenKey,e.domain,e.path,e.secure,e.sameSite,e.canSetTokens,e.cookieParser;var f=Rne(e,eoe);return new uoe(pd(pd({},f),{},{storage:h,useStandardizedConfig:t}))}var No=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(No||{});No.review,No.review_take,No.review_scene,No.review_rendition,No.review_frame,No.review_rendition_comment,No.review_comment,No.scene_hub,No.hub_rendition,No.hub_comment,No.people_insight,No.people_detail,No.project,No.woohoo,No.update,No.core,No.project_focusMode;const _N={accessToken:"account.token",refreshToken:"account.refresh_token"},foe={baseUrl:"BASE_URL"},RN="/refresh-token",poe=3e5,goe="*",TN={Accept:"application/json","Content-Type":"application/json"},moe="undefined",voe="No access token found",Oc={badRequest:400,unauthorized:401,tooEarly:425},yoe=[Oc.unauthorized,Oc.tooEarly,Oc.badRequest],woe="unauthenticated",Coe="invalid_token",boe="refresh_token_expired",Soe={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},Eoe="Session refreshed successfully",_oe="Session expired. Please log in again.",Roe=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},Toe=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==Oc.badRequest?!1:Roe((n=e.response)==null?void 0:n.data)===Coe},Doe=()=>{},xoe=e=>sessionStorage.getItem(e)||"",JE=()=>{const e=dv.get(_N.accessToken);return e&&e!==moe?e:null},Ioe=()=>!!dv.get(_N.refreshToken),Aoe=()=>{const e=window.location.origin,t=xoe(foe.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class QE{constructor(t,n=Doe,o){this.client=t,this.showMessage=n,this.onAuthExpired=o}attach(){const t=hoe({refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(Eoe,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(_oe,"error")},useStandardizedConfig:!0});this.handler=t,doe(this.client,t,{retryStatusCodes:[...yoe],tokenExpiredDetection:QE.isTokenExpired})}refreshAccessToken(){return!this.handler||!Ioe()?Promise.resolve(!1):(this.pendingRefresh??(this.pendingRefresh=this.handler.handleTokenRefresh().catch(()=>!1).finally(()=>{this.pendingRefresh=void 0})),this.pendingRefresh)}static isTokenExpired(t){var i,a;const n=(i=t==null?void 0:t.response)==null?void 0:i.status;if(n===Oc.tooEarly)return!0;const{error:o,details:s={}}=((a=t==null?void 0:t.response)==null?void 0:a.data)??{},r=typeof o=="string"?o:o==null?void 0:o.key;return n===Oc.badRequest||n!==Oc.unauthorized||typeof o=="string"||r!==woe?!1:Object.keys(s).length===0||s.reason===boe}async refresh(t){const n=await this.client.post(RN,{refresh_token:t}),o="data"in n&&n.data?n.data:n;return{access_token:o.access_token,refresh_token:o.refresh_token,expires_in:o.expires_in}}handleAuthExpired(){var t;if(window.self===window.top){(t=this.onAuthExpired)==null||t.call(this);return}window.parent.postMessage(Soe,Aoe())}}class Poe{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=to.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??poe,headers:{...TN,...t.headers}}),this.setupRequestInterceptor(),this.setupResponseInterceptor(),this.setupErrorHandling()}get(t,n){return this.request({...n,method:"GET",url:t})}post(t,n,o){return this.request({...o,method:"POST",url:t,data:n})}put(t,n,o){return this.request({...o,method:"PUT",url:t,data:n})}patch(t,n,o){return this.request({...o,method:"PATCH",url:t,data:n})}delete(t,n){return this.request({...n,method:"DELETE",url:t})}request(t){return this.client.request(t)}setupRequestInterceptor(){this.client.interceptors.request.use(async t=>{const{baseURL:n,dynamicHeaders:o,requireToken:s}=this.options;typeof n=="function"&&(t.baseURL=n());const r=t.url===RN,i=r?JE():await this.resolveAccessToken();if(!i&&s&&!r)throw new Error(voe);t.headers.set("Accept-Language",goe),t.headers.has("Content-Type")||t.headers.set("Content-Type",TN["Content-Type"]),t.headers.has("Content-Type")&&t.headers.get("Content-Type")==="multipart/form-data"&&t.headers.delete("Content-Type"),i&&t.headers.set("Authorization",`Bearer ${i}`);for(const[a,l]of Object.entries((o==null?void 0:o(t))??{}))t.headers.set(a,l);return t})}async resolveAccessToken(){const t=JE();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),JE())}setupResponseInterceptor(){this.client.interceptors.response.use(t=>this.options.unwrapResponse?t.data:t)}setupErrorHandling(){const{withRefreshToken:t,showMessage:n,onAuthExpired:o,onError:s}=this.options;t&&(this.tokenRefresher=new QE(this.client,n,o),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,r=>(Toe(r)&&(o==null||o("/sw?redirect=1")),Promise.reject(r))),s&&this.client.interceptors.response.use(void 0,s)}}const koe=5,Foe=1e3,Ooe=3,Moe="default",Noe=e=>new URL(e,"http://localhost").pathname;class Loe{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??koe,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??Foe}async run(t,n){const o=this.resolveGroup(t);await this.acquire(o);try{return await n()}finally{this.release(o)}}resolveGroup(t){const n=Noe(t),o=this.rules.find(i=>i.pattern.test(n)),s=o?o.pattern.source:Moe;let r=this.groups.get(s);return r||(r={limit:(o==null?void 0:o.limit)??this.defaultLimit,ongoing:0,queue:[]},this.groups.set(s,r)),r}acquire(t){return new Promise(n=>{const o=()=>{t.ongoing++,n()};t.ongoing<t.limit?o():t.queue.push(o)})}release(t){t.ongoing--;const n=t.queue.shift();n&&setTimeout(n,this.releaseDelayMs)}}const Voe=(e,t)=>{const n=new Loe(t),o=to.getAdapter(e.defaults.adapter);return e.defaults.adapter=s=>n.run(s.url??"",()=>o(s)),n},Boe=(e,{maxRetries:t=Ooe}={})=>{e.interceptors.response.use(void 0,async n=>{var a,l;const o=n.config;if(((a=n.response)==null?void 0:a.status)!==429||!o)return Promise.reject(n);const s=(o._retryCount??0)+1;if(s>t)return Promise.reject(n);o._retryCount=s;const r=Number.parseInt(String(((l=n.response.headers)==null?void 0:l["retry-after"])??""),10),i=Number.isNaN(r)?2**s*1e3:r*1e3;return await new Promise(c=>setTimeout(c,i)),e.request(o)})},$oe=6e4,Hoe="/start",Goe=(e=Hoe)=>{const n=`${sessionStorage.getItem("BASE_URL")||""}${e}`;window.location.replace(n)};function Uoe(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class Woe{constructor(t,n={}){const{concurrency:o,rateLimitRetry:s,...r}=n,i=()=>Uoe("API_BASE_URL","");this.callbackFunc=t,this.api=new Poe({baseURL:i,timeout:$oe,requireToken:!0,onAuthExpired:Goe,...r,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,o!==!1&&Voe(this.axios,o),s!==!1&&Boe(this.axios,s)}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([s,r])=>{r!=null&&r!==""&&(Array.isArray(r)?r.forEach(i=>n.append(s,String(i))):typeof r=="object"?n.append(s,JSON.stringify(r)):n.append(s,String(r)))});const o=n.toString();return o?`?${o}`:""}async send(t,n,{params:o,data:s,options:r}={}){try{const i=o?this.buildQueryParams(o):"",a={...r,method:t,url:`${this.buildUrl(n)}${i}`};return s!==void 0&&(a.data=s),(await this.axios.request(a)).data}catch(i){throw Sne(i)}}get(t="",n,o){return this.send("GET",t,{params:n,options:o})}post(t="",n,o,s){return this.send("POST",t,{params:n,data:o,options:s})}put(t="",n,o){return this.send("PUT",t,{data:n,options:o})}patch(t="",n,o){return this.send("PATCH",t,{data:n,options:o})}delete(t="",n,o){return this.send("DELETE",t,{data:n,options:o})}}const zoe=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"},bulkRename:{url:`${e}/v1/workspace/${t}/item/2/bulk-rename`,method:"put",code:"bulkRename"}}),joe=(e,t)=>{const n=new Blob([e]),o=globalThis.URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(o)},Koe=15e3,qoe=new Set(["bulkDelete","bulkArchive","bulkUnarchive","bulkDateUpdate","bulkAssignUpdate","bulkStatusUpdate","bulkMetricUpdate","bulkRename","removeAssignee","delete_thumbnail","delete_rendition"]);class DN extends Woe{constructor(t,n,o){const s=n==null?void 0:n.domainApi,r=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(o,{concurrency:{rules:[{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2$/,limit:1},{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2\/metrics$/,limit:5}]}}),this.events=Object.create(null);const a=zoe({domainApi:s,wsCode:r,entityId:i}),l={};Object.entries(a).forEach(([c,u])=>{const d=c;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=u)}),this.apiConfig=l}on(t,n){var o;((o=this.events)[t]??(o[t]=[])).push(n)}off(t,n){const o=this.events[t];o&&(this.events[t]=o.filter(s=>s!==n))}emit(t,...n){const o=this.events[t];o!=null&&o.length&&o.forEach(s=>{try{s(...n)}catch(r){console.error(`Error in event listener for ${t}:`,r)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:r,responseType:i,autoDownload:a=!0,unwrapResponse:l=!0,timeout:c}){var h,f;const u=this.buildHeaders(s);let d;try{if(d=await this.axios.request({method:t,url:n,params:o,data:s,headers:u,responseType:i,timeout:c}),(((h=d.headers)==null?void 0:h["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const g=((f=d.headers)==null?void 0:f["content-disposition"])||"",v=g.includes("filename=")?g.split("filename=")[1]:"exported_items.xlsx";a&&joe(d.data,v)}if(d.status>=400&&d.status<=500)throw new Error(`Client error (${d.status}): ${d.statusText}`);return this.emit("call-api",{apiCode:r,path:n,params:o,payload:s,res:d,success:!0}),l?d.data:d}catch(p){throw console.error("API Request Error:",p),p.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:o,payload:s,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:o,payload:s,error:p,success:!1,apiCode:r,res:p==null?void 0:p.response}),p}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,r])=>{o=o.replace(`{${s}}`,String(r))}),o}async request(t,n,o={}){const{url:s,code:r,method:i}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:i,path:a,params:o.params,payload:o.payload,code:r,responseType:o.responseType,autoDownload:o.autoDownload,unwrapResponse:o.unwrapResponse,timeout:qoe.has(t)?Koe:void 0})}async getAllItem_cursor(t){var r;const n=t.workspaceId,o={entity_ids:((r=t.entityIds)==null?void 0:r.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},s=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:o,payload:{sort_by:s}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},o={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:o,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:o,query:s,per_page:r}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:r||100,page:o||1,name_like:s||void 0,permission:"1,2"}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const r={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:1},payload:r})}async multipleAssignableUser(t){const n=t.workspaceId,o=t.itemIds,s={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:o||[]};return o.length||(delete s.item_ids,s.entity_id=t.entityId),this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){var s;const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return((s=t.itemIds)==null?void 0:s.length)==0&&(o.entity_id=t.entityId,delete o.item_ids),this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const r={item_id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:r})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:r,params:s})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:o=!1,entityId:s,filterParams:r}){const i={item_ids:n,delete_all:o?1:void 0,entity_id:s};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i,params:r,unwrapResponse:!1})}async archiveScene(t,n,o){const s={item_ids:o,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:s})}async changeDate({workspaceId:t,itemIds:n,startDate:o,dueDate:s,entityId:r,filterParams:i}){const a={item_ids:n,start_date:o,due_date:s,entity_id:r};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:i,unwrapResponse:!1})}async updateAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:o,entityId:s}=t,r={item_ids:n,ws_user_role_ids:o,entity_id:s};return!n||n.length===0?(r.item_ids=void 0,r.entity_id=s):(r.item_ids=n,r.entity_id=void 0),r}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:i})}async addAssignee({workspaceId:t,itemIds:n,userIds:o,entityId:s,filterParams:r}){const i={item_ids:n,ws_user_role_ids:o,entity_id:s};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:i,params:r})}async unAssignAll(t){const{workspaceId:n,entityId:o,itemIds:s,filterParams:r}=t,i={item_ids:s,entity_id:o,ws_user_role_ids:[]};return!s||s.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(o)},{payload:i,params:r})}async updateItemStatus(t){const{workspaceId:n,itemIds:o=[],statusId:s,entityId:r}=t,i={item_ids:o,template_flow_status_id:s};return o.length||(i.item_ids=void 0,i.entity_id=r),this.request("bulkStatusUpdate",{workspaceId:n},{payload:i,params:t.filterParams,unwrapResponse:!1})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:r,params:s})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,status:1,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:r,params:s,unwrapResponse:!1})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,status:0,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:r,params:s,unwrapResponse:!1})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:r,clear:i}=t,a={item_ids:o,metric_id:s,metric_value:r,clear:i??(r==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=o,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams,unwrapResponse:!1})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:50}})}async unarchiveScene(t,n,o){const s={item_ids:o,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:s})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n,o=!0){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async downloadExportedItemsFile(t,n,o=!0){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:r,entity_ids:i}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:r,entity_ids:i}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:o}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:o},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,o){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:o})}async getFilterStatuses(t,n,o){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:o})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}async bulkRename(t){return this.request("bulkRename",{workspaceId:t.workspaceId,entityId:t.entityId},{payload:t.payload,params:t.filter,unwrapResponse:!1})}}const Yoe=(e,t,n,o,s,r,i)=>{const a=$(!1),{apiServices:l}=io(n,o),c=Y(()=>!!(s!=null&&s.value&&(r!=null&&r.value))),u=Dn("filterParams",null);return{isUpdating:a,handleUpdate:async h=>{var p;const f=h.value;try{const g={itemIds:e.value.itemIds,metricId:h.id,workspaceId:String(e.value.workspaceId),filterParams:u!=null&&u.value?u.value:void 0};h.value==null?g.clear=1:g.value=f,c.value?(delete g.itemIds,g.entityId=String(o.entityId)):g.itemIds=e.value.itemIds,a.value=!0;const v=await((p=l.value)==null?void 0:p.bulkUpdateMetric(g));return((v==null?void 0:v.status)==Us.OK||(v==null?void 0:v.status)==Us.ACCEPTED)&&t(h,v),v}catch(g){console.error("Error during bulk metric update:",g)}finally{a.value=!1}}}},Xoe=bt(tt({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=QO(),o=$([]),s=e,r=t,i=$([]),a=$(null),l=z=>{var ee,X,D;const ne=o.value.findIndex(U=>U.id===z.id);a.value=ne;const re=(ee=i.value[ne])==null?void 0:ee.$el;(X=E.value)==null||X.scrollTo(ne*30),re&&re.scrollIntoView({behavior:"smooth",block:"center"}),c(ne),(D=i.value[ne])==null||D.show()},c=z=>{a.value=z,i.value.forEach((ne,re)=>{re!==z&&ne&&ne.hide()})},u=$(""),d=()=>{u.value="",i.value.forEach(z=>{z==null||z.hide()}),a.value=null},h=Y(()=>s.selectedIds||[]),f=Y(()=>({itemIds:h.value,workspaceId:String(s.workspaceId)})),p=Dn("isSelectAll",$(!1)),g=Dn("bulkUpdate",$(!1)),v=$(null),{handleUpdate:C,isUpdating:S}=Yoe(f,(z,ne)=>{((ne==null?void 0:ne.status)==Us.OK||(ne==null?void 0:ne.status)==Us.ACCEPTED)&&r("update",z)},!1,s,g,p),b=async z=>{var ne;r("update-start");try{const re=await C(z);(re==null?void 0:re.status)!==Us.ACCEPTED&&(re==null?void 0:re.status)!==Us.OK?r("update-failed"):(r("update-completed",re),setTimeout(()=>{var ee;d(),(ee=v.value)==null||ee.hide()},500))}catch(re){console.error("Failed to update metric:",re),r("update-failed"),(ne=v.value)==null||ne.open()}},y=z=>{d(),ct(()=>{var ne;(ne=E.value)==null||ne.focus()})},E=$(null),_=(z,ne)=>{var re;z?(re=E.value)==null||re.focus():d(),z&&ne!==z&&B("")},x=$(!0),R=$(!0),{apiServices:P}=io(!1,s),N=async(z,ne,re)=>{var ee;try{return re?R.value=!0:x.value=!0,await((ee=P.value)==null?void 0:ee.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:z,query:ne,per_page:10}))}catch(X){throw console.error("Failed to fetch metric list:",X),X}finally{x.value=!1,R.value=!1}},I=$(0),k=$(!0),A=z=>({id:String(z.id),label:String(z.name),value:String(z.id),description:z.morpheme_value?`${String(z.morpheme_value)}`:"",type:n.checkEditType(z),metricConfig:z}),M=z=>z.filter(ne=>!ne.formula).filter(ne=>{var re;return((re=ne==null?void 0:ne.auth_permission)==null?void 0:re.permission)==2}).map(A),V=async()=>{I.value+=1;const z=await N(I.value,u.value,!0);if(z&&z.data){const ne=M(z.data);o.value=[...o.value,...ne],k.value=z.meta.last_page!=z.meta.current_page}else k.value=!1},B=async z=>{u.value=z,I.value=1;try{const ne=await N(I.value,u.value);ne&&ne.data?(o.value=M(ne.data),k.value=ne.meta.last_page!=ne.meta.current_page):o.value=[]}catch{o.value=[]}};return(z,ne)=>(q(),je(zf,{ref_key:"wrapperRef",ref:v,isUpdating:L(S),disabled:s.disabled,onOnVisibleChange:_},{trigger:ye(({hide:re,disabled:ee})=>[me(pt,{variant:s.variant,loading:L(S),disabled:ee,onEscape:re},{default:ye(()=>[me(ut,{src:"SquareRootVariable",class:"icon"}),ne[1]||(ne[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ye(({isVisible:re,popupRef:ee,hide:X})=>[Ke(me(fa,{ref_key:"searchListRef",ref:E,style:{width:"320px"},options:o.value,loading:x.value,"loading-more":R.value,"selected-id":void 0,"has-more":k.value,onSearch:B,onSelect:l,onLoadMore:ne[0]||(ne[0]=()=>V()),onCancel:X},{item:ye(({item:D,index:U,selectedIndex:K})=>[me(ree,{ref:ie=>i.value[U]=ie,label:D.label,type:D.type,morpheme:D.description||"",onFocusOnSearch:y,onOpen:ie=>c(U),attachTo:ee,config:D.metricConfig,onHandleUpdate:b,class:ae(["metric-update-item",{selected:a.value===U||K===U}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":ye(()=>[...ne[2]||(ne[2]=[Ee("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ye(()=>[...ne[3]||(ne[3]=[nt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[lr,re]])]),default:ye(()=>[ne[4]||(ne[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-162cbb07"]]),Zoe={class:"status-label"},xN=bt(tt({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=jt,o=e,s=t,r=a=>{s("select",a)},i=a=>new On(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(q(),ue("div",{class:ae(["status-option",{selected:o.selected,focused:o.focused,hovered:o.hovered}]),onClick:l[0]||(l[0]=c=>r(e.status.id))},[Ee("div",{class:"status-color",style:hn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),Ke((q(),ue("div",Zoe,[xt(a.$slots,"label",{},()=>[nt(it(e.status.name),1)],!0)])),[[L(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),Joe=["innerHTML"],IN=bt(tt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},s=e,r=n,i=$([]),a=$(!1),l=$(!1),c=$(null),u=$(o.INITIAL_PAGE),d=$(!0),h=$(0),f=$(""),p=Y(()=>{var A;return(A=s.value)==null?void 0:A.id});Y(()=>!!(s.id||s.ids&&s.ids.length>0));const g=A=>({label:A.name,value:A.id,selected:p.value===A.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:A,id:A.id,color:A.color}),v=Y(()=>{const A=new Set;return s.id&&A.add(String(s.id)),s.ids&&s.ids.forEach(M=>{M&&A.add(String(M))}),Array.from(A)}),C=Dn("bulkUpdate",!1),{apiServices:S}=io(!C,s),b=Bf(),{selectionStatus:y}=ts(b),E=Dn("filterParams",null),_=async(A=o.INITIAL_PAGE,M="",V=!1)=>{var B,z,ne,re;V?l.value=!0:a.value=!0,c.value=null;try{const ee={workspaceId:String(s.workspaceId),itemIds:v.value,page:A,perPage:o.PER_PAGE,name_like:M.trim(),...E||{},entityId:String(s.entityId)};if(((B=S.value)==null?void 0:B.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const X=await((z=S.value)==null?void 0:z.getAssignableStatus(ee));if(!(X!=null&&X.data)){V||(i.value=[]),d.value=!1;return}const D=X.data.map(g);i.value=V?[...i.value,...D]:D,h.value=((ne=X.meta)==null?void 0:ne.total)??X.data.length,d.value=!((re=X.meta)!=null&&re.on_last_page),u.value=A}catch(ee){console.error("Error fetching statuses:",ee),c.value="Failed to load statuses",V||(i.value=[]),d.value=!1,r("error",c.value)}finally{a.value=!1,l.value=!1}},x=mr(async A=>{f.value=A,u.value=o.INITIAL_PAGE,await _(o.INITIAL_PAGE,A,!1)},bi),R=async()=>{!d.value||l.value||await _(u.value+1,f.value,!0)},P=()=>{var A;r("cancel"),(A=s.params)==null||A.api.stopEditing()},N=async A=>{var M,V,B;try{const z={workspaceId:String(s.workspaceId),itemIds:v.value,statusId:String(A.value),entityId:String(s.entityId),filterParams:E!=null&&E.value?E==null?void 0:E.value:void 0};y.value==Ft.CHECKED&&C&&(z.itemIds=void 0,z.entityId=String(s.entityId)),r("start-update");const ne=await S.value.updateItemStatus(z);if(!ne)throw new Error("Status update failed: empty response");r("updated",{workspaceId:String(s.workspaceId),itemIds:v.value,isUpdateAll:y.value==Ft.CHECKED&&C,data:{id:A.id,name:A.label,color:A.color}}),s.params&&((V=s.params)==null||V.node.setData({...(M=s.params)==null?void 0:M.node.data,status:{id:A.id,name:A.label,color:A.color}}),(B=s.params)==null||B.api.stopEditing()),r("finish-update",ne)}catch(z){console.error("Error updating status:",z),c.value="Failed to update status",r("error",c.value)}},I=Y(()=>i.value.map(A=>({...A})));Qe([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{_()},{deep:!0,immediate:!0});const k=$(null);return Qt(()=>{ct(()=>{var A;(A=k.value)==null||A.focus()})}),t({refresh:()=>_(o.INITIAL_PAGE,f.value,!1),loadMore:R,focus:()=>{var A;return(A=k.value)==null?void 0:A.focus()}}),(A,M)=>{var V;return q(),je(fa,zt({ref_key:"popupRef",ref:k},s,{"selected-id":(V=s.value)==null?void 0:V.id,options:I.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:L(x),onSelect:N,onLoadMore:R,onCancel:P,onClose:P}),{item:ye(({item:B,selectedIndex:z,isSelected:ne,handleItemHover:re,getHighlightedLabel:ee,query:X,idx:D})=>[(q(),je(xN,{key:B.value,status:B.data,selected:ne(B),onMouseover:U=>re(D),onSelect:U=>N(B),hovered:D===z},{label:ye(()=>[X?(q(),ue("span",{key:0,class:ae([A.$style["item-label"],A.$style.match]),style:{flex:"1"},innerHTML:ee(B.label)},null,10,Joe)):(q(),ue("span",{key:1,class:ae(A.$style["item-label"]),style:{flex:"1"}},it(B.label),3))]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),[["__cssModules",{$style:{"item-label":"_item-label_7ir12_1"}}]]),Qoe=tt({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,o=Y(()=>{const f=ro();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),s=t,r=$(!1),i=$(null),a=f=>{try{r.value=!1,s("updated",f)}catch(p){console.error("Error handling status update:",p)}},l=Y(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId,selectedAll:n.selectedAll}));di("bulkUpdate",!0);const c=(f,p)=>{var g,v;r.value=!1,f?(s("update-completed",p),(g=i.value)==null||g.destroy()):(s("update-failed"),(v=i.value)==null||v.open())},u=$(null),d=(f,p)=>{var g;f&&((g=u.value)==null||g.focus())},h=()=>{r.value=!0,s("update-start")};return Qe(()=>n.ids,()=>{}),(f,p)=>(q(),je(zf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:ye(({hide:g,disabled:v})=>[me(pt,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:ye(()=>[me(ut,{src:"Square",class:"icon"}),p[2]||(p[2]=nt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ye(({hide:g})=>[me(IN,zt({disabled:r.value,ref_key:"statusRef",ref:u},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>c(!0,v)),onError:p[1]||(p[1]=v=>c(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:ye(()=>[p[3]||(p[3]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),qr=" ",e0=e=>e.replace(/[\r\n]+/g," "),ny=e=>e instanceof HTMLElement&&e.classList.contains("locked-tag"),zs=e=>(e==null?void 0:e.nodeType)===Node.TEXT_NODE,t0=e=>{var t;return((t=e instanceof Element?e:e.parentElement)==null?void 0:t.closest(".locked-tag"))??null},ma=e=>{let t=0,n=e.length;return ny(e.previousSibling)&&e.data.startsWith(qr)&&(t=1),ny(e.nextSibling)&&n>t&&e.data.endsWith(qr)&&(n-=1),{start:t,end:n}},ese=e=>{if(!zs(e))return!1;const{start:t,end:n}=ma(e);return n<=t},AN=e=>{const t=t0(e.startContainer),n=t0(e.endContainer);return t&&e.setStartAfter(t),n&&e.setEndAfter(n),e},tse=(e,t)=>e.length===t.length&&e.every((n,o)=>{const s=t[o];return typeof n=="string"||typeof s=="string"?n===s:n.id===s.id&&n.text===s.text&&n.direction===s.direction});class nse{constructor(t){Rn(this,"editor",null);Rn(this,"handleInput",()=>{this.editor&&(this.sanitize(),this.ensureTagPadding(),this.normalizeCaret(),this.options.onChange(this.parse()))});Rn(this,"handlePaste",t=>{var n;t.preventDefault(),this.insertPlainText(((n=t.clipboardData)==null?void 0:n.getData("text/plain"))??"")});Rn(this,"handleDrop",t=>{var o,s;t.preventDefault();const n=((o=t.dataTransfer)==null?void 0:o.getData("text/plain"))??"";n&&this.insertPlainText(n,(s=document.caretRangeFromPoint)==null?void 0:s.call(document,t.clientX,t.clientY))});Rn(this,"handleBeforeInput",t=>{const n=t.inputType;(n.startsWith("format")||n==="insertParagraph"||n==="insertLineBreak"||n==="insertFromDrop"||n==="insertFromYank")&&t.preventDefault()});Rn(this,"handleClick",t=>{const n=this.editor,o=window.getSelection();if(!n||!(o!=null&&o.isCollapsed)||t.target!==n)return;const s=document.createRange();if(s.selectNodeContents(n),t.clientX<=s.getBoundingClientRect().right)return;const[r,i]=this.getBoundaryPoint("end");o.collapse(r,i),n.scrollLeft=n.scrollWidth});Rn(this,"handleKeydown",t=>{var s,r,i;const n=this.editor;if(!n)return;if(t.key==="Escape"){(r=(s=this.options).onEscape)==null||r.call(s,t);return}if(t.key==="Enter"){t.preventDefault();return}const o=t.ctrlKey||t.metaKey;if(o&&!t.altKey&&t.key.toLowerCase()==="a"){t.preventDefault(),(i=window.getSelection())==null||i.selectAllChildren(n);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),this.moveToEdge(t.key==="Home"?"start":"end",t.shiftKey);return}if((t.key==="ArrowLeft"||t.key==="ArrowRight")&&!t.shiftKey&&!o&&!t.altKey){this.moveAcrossTag(t.key)&&t.preventDefault();return}if(t.key==="Backspace"||t.key==="Delete"){if(!o&&!t.altKey&&!t.shiftKey&&this.deleteCharacter(t.key)){t.preventDefault();return}const a=this.findAdjacentTag(t.key);a&&(t.preventDefault(),this.removeTag(a,t.key==="Backspace"?"after":"before"))}});Rn(this,"normalizeCaret",()=>{const t=this.editor,n=window.getSelection();if(!t||!(n!=null&&n.rangeCount)||!n.isCollapsed)return;const{startContainer:o,startOffset:s}=n.getRangeAt(0);if(!t.contains(o))return;const r=t0(o);if(!r&&o!==t)return;const i=r??t.childNodes[s-1]??null,a=r?r.nextSibling:t.childNodes[s]??null;if(this.ensureTagPadding(),zs(i))n.collapse(i,ma(i).end);else if(zs(a))n.collapse(a,ma(a).start);else if(zs((i==null?void 0:i.nextSibling)??null)){const l=i.nextSibling;n.collapse(l,ma(l).start)}else if(zs((a==null?void 0:a.previousSibling)??null)){const l=a.previousSibling;n.collapse(l,ma(l).end)}});this.options=t}mount(t,n=[]){this.editor=t,this.render(n),document.addEventListener("selectionchange",this.normalizeCaret)}destroy(){document.removeEventListener("selectionchange",this.normalizeCaret),this.editor=null}sync(t){this.editor&&(tse(t,this.parse())||this.render(t))}render(t){const n=this.editor;n&&(n.innerHTML="",t.forEach(o=>{typeof o=="string"?n.appendChild(document.createTextNode(e0(o))):this.options.isTagAllowed(o.id)&&n.appendChild(this.createTagNode(o))}),this.ensureTagPadding())}parse(){var o;const t=[];let n="";return(o=this.editor)==null||o.childNodes.forEach(s=>{zs(s)?n+=s.data.replace(/\u00A0/g," "):this.isAllowedTagNode(s)&&(n&&(t.push(n),n=""),t.push({id:s.dataset.id||"unknown",text:s.innerText||"Tag",direction:s.dataset.direction??void 0}))}),n&&t.push(n),t}insertTag(t){const n=this.editor;if(!n||!this.options.isTagAllowed(t.id))return;const o=n.querySelector(`.locked-tag[data-id="${t.id}"]`);if(o instanceof HTMLElement){this.applyTagData(o,t),this.handleInput();return}const s=this.createTagNode(t),r=document.createTextNode(qr),i=this.getEditorRange();i?(i.deleteContents(),i.insertNode(r),i.insertNode(s)):n.append(s,r),n.normalize(),this.handleInput(),this.placeCaretAfterTag(r)}updateTag(t,n){var s;const o=(s=this.editor)==null?void 0:s.querySelector(`.locked-tag[data-id="${t}"]`);o instanceof HTMLElement&&(o.innerText=n,this.handleInput())}replaceTag(t,n){if(!this.editor||!this.options.isTagAllowed(n.id))return;const o=this.createTagNode({id:n.id,text:n.label,direction:n.direction}),s=this.editor.querySelector(`.locked-tag[data-id="${t.id}"]`);s instanceof HTMLElement&&(s.replaceWith(o),this.handleInput())}deleteTag(t){const n=this.editor;if(!n)return;const o=n.querySelector(`.locked-tag[data-id="${t}"]`);o instanceof HTMLElement&&this.removeTag(o,"after");const s=this.parse(),r=s[0];s.length===1&&typeof r=="string"&&r.trim()===""&&(n.innerHTML="",this.options.onChange(this.parse()))}isAllowedTagNode(t){return ny(t)&&this.options.isTagAllowed(t.getAttribute("data-id")??"")}applyTagData(t,{text:n,direction:o}){t.innerText=n,o?t.dataset.direction=o:delete t.dataset.direction}createTagNode({id:t,text:n,direction:o}){const s=document.createElement("span");return s.contentEditable="false",s.className="locked-tag",s.dataset.id=t,this.applyTagData(s,{text:n,direction:o}),s}getEditorRange(){const t=window.getSelection();if(!this.editor||!(t!=null&&t.rangeCount))return null;const n=t.getRangeAt(0).cloneRange();return this.editor.contains(n.commonAncestorContainer)?AN(n):null}insertPlainText(t,n){const o=this.editor;if(!o)return;const s=window.getSelection();let r=n?AN(n):this.getEditorRange();(!r||!o.contains(r.commonAncestorContainer))&&(r=document.createRange(),r.selectNodeContents(o),r.collapse(!1)),r.deleteContents();const i=document.createTextNode(e0(t));r.insertNode(i),r.setStartAfter(i),r.collapse(!0),s==null||s.removeAllRanges(),s==null||s.addRange(r),this.handleInput()}sanitize(){const t=this.editor;if(!t)return;t.querySelectorAll(".locked-tag .locked-tag").forEach(o=>o.remove());let n=!1;if(Array.from(t.childNodes).forEach(o=>{if(zs(o)||this.isAllowedTagNode(o))return;n=!0;const s=ny(o)?"":e0(o.textContent??"");o.replaceWith(document.createTextNode(s))}),n){const o=window.getSelection(),s=document.createRange();s.selectNodeContents(t),s.collapse(!1),o==null||o.removeAllRanges(),o==null||o.addRange(s)}}ensureTagPadding(){var t;(t=this.editor)==null||t.querySelectorAll(".locked-tag").forEach(n=>{const o=n.previousSibling,s=n.nextSibling;zs(o)?o.data.endsWith(qr)||o.appendData(qr):n.before(document.createTextNode(qr)),zs(s)?s.data.startsWith(qr)||s.insertData(0,qr):n.after(document.createTextNode(qr))})}async placeCaretAfterTag(t){var s;(s=this.editor)==null||s.focus(),await Promise.resolve();const n=document.createRange();n.setStart(t,ma(t).start),n.collapse(!0);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(n)}findAdjacentTag(t){const n=this.editor,o=window.getSelection();if(!n||!o||!o.isCollapsed||!o.rangeCount)return null;const{startContainer:s,startOffset:r}=o.getRangeAt(0);if(!n.contains(s))return null;const i=t==="Backspace";let a;if(s===n)a=i?n.childNodes[r-1]??null:n.childNodes[r]??null;else if(zs(s)&&s.parentNode===n){const{start:l,end:c}=ma(s);if(i?Math.min(r,c)>l:Math.max(r,l)<c)return null;a=i?s.previousSibling:s.nextSibling}else return null;for(;ese(a);)a=i?a.previousSibling:a.nextSibling;return a&&this.isAllowedTagNode(a)?a:null}getBoundaryPoint(t){const n=this.editor,o=t==="start"?n.firstChild:n.lastChild;return zs(o)?[o,t==="start"?0:o.length]:[n,t==="start"?0:n.childNodes.length]}moveToEdge(t,n){const o=this.editor,s=window.getSelection();if(!o||!s)return;const[r,i]=this.getBoundaryPoint(t),a=n&&s.anchorNode&&o.contains(s.anchorNode)?{node:s.anchorNode,offset:s.anchorOffset}:{node:r,offset:i};s.setBaseAndExtent(a.node,a.offset,r,i),o.scrollLeft=t==="start"?0:o.scrollWidth}moveAcrossTag(t){const n=t==="ArrowLeft",o=this.findAdjacentTag(n?"Backspace":"Delete"),s=window.getSelection();if(!o||!s)return!1;const r=n?o.previousSibling:o.nextSibling;if(!zs(r))return!1;const i=ma(r);return s.collapse(r,n?i.end:i.start),!0}deleteCharacter(t){const n=window.getSelection();if(!this.editor||!(n!=null&&n.isCollapsed)||!n.rangeCount)return!1;const{startContainer:o,startOffset:s}=n.getRangeAt(0);if(!zs(o)||o.parentNode!==this.editor)return!1;const{start:r,end:i}=ma(o);let a,l=1,c=s;if(t==="Backspace"){if(a=Math.min(s,i)-1,a<r)return!1;/[\uDC00-\uDFFF]/.test(o.data[a])&&a>r&&(a--,l=2),c=s-l}else{if(a=Math.max(s,r),a>=i)return!1;/[\uD800-\uDBFF]/.test(o.data[a])&&a+1<i&&(l=2)}return o.deleteData(a,l),n.collapse(o,c),this.handleInput(),!0}removeTag(t,n){var r;const o=t.previousSibling,s=t.nextSibling;t.remove(),o instanceof Text&&s instanceof Text&&o.data.endsWith(qr)&&s.data.startsWith(qr)&&(n==="after"?o.deleteData(o.length-1,1):s.deleteData(0,1)),(r=this.editor)==null||r.normalize(),this.handleInput()}focus(){var o;(o=this.editor)==null||o.focus();const t=document.createRange();t.selectNodeContents(this.editor),t.collapse(!1);const n=window.getSelection();n==null||n.removeAllRanges(),n==null||n.addRange(t)}blur(){var t;(t=this.editor)==null||t.blur()}}const ose={class:"input-wrapper"},sse=["data-placeholder"],rse=bt(tt({__name:"DynamicInput",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Rename to"},allowedTags:{type:Array,default:void 0}},emits:["update:modelValue","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(null),i=new nse({isTagAllowed:a=>!o.allowedTags||o.allowedTags.includes(a),onChange:a=>s("update:modelValue",a),onEscape:a=>s("escape",a)});return Qt(()=>{r.value&&i.mount(r.value,o.modelValue)}),zn(()=>i.destroy()),Qe(()=>o.modelValue,a=>i.sync(a),{deep:!0}),t({insertTag:a=>i.insertTag(a),updateTag:(a,l)=>i.updateTag(a,l),replaceTag:(a,l)=>i.replaceTag(a,l),deleteTag:a=>i.deleteTag(a),focus:()=>{i.focus()},triggerFocus:()=>{ct(()=>{var a;(a=r.value)==null||a.focus()})},blur:()=>{i.blur()}}),(a,l)=>(q(),ue("div",ose,[Ee("div",{ref_key:"editorRef",ref:r,class:"custom-input single-line",contenteditable:"true","data-placeholder":e.placeholder,onPaste:l[0]||(l[0]=(...c)=>L(i).handlePaste&&L(i).handlePaste(...c)),onDrop:l[1]||(l[1]=(...c)=>L(i).handleDrop&&L(i).handleDrop(...c)),onBeforeinput:l[2]||(l[2]=(...c)=>L(i).handleBeforeInput&&L(i).handleBeforeInput(...c)),onInput:l[3]||(l[3]=(...c)=>L(i).handleInput&&L(i).handleInput(...c)),onKeydown:l[4]||(l[4]=(...c)=>L(i).handleKeydown&&L(i).handleKeydown(...c)),onClick:l[5]||(l[5]=Lt((...c)=>L(i).handleClick&&L(i).handleClick(...c),["stop","prevent"]))},null,40,sse)]))}}),[["__scopeId","data-v-e8517a76"]]),ise={key:0},ase={key:1},PN=8,lse=bt(tt({__name:"PreviewName",props:{text:{}},setup(e){const t=jt,n=e,o=$(null),s=$(null),r=$(n.text),i=$(!1),a=d=>{const h=s.value;return h.textContent=d,h.offsetWidth},l=(d,h)=>{const f=d.slice(-PN),p=d.length-PN-1;if(p<1||a(d)<=h)return d;let g=0,v=p;for(;g<v;){const C=Math.ceil((g+v)/2);a(`${d.slice(0,C)}…${f}`)<=h?g=C:v=C-1}return`${d.slice(0,g)}…${f}`},c=()=>{!o.value||!s.value||(r.value=l(n.text,o.value.clientWidth),i.value=r.value!==n.text)};let u;return Qt(()=>{c(),u=new ResizeObserver(c),u.observe(o.value)}),zn(()=>u==null?void 0:u.disconnect()),Qe(()=>n.text,()=>ct(c)),(d,h)=>(q(),ue("div",{ref_key:"rootRef",ref:o,class:"preview-name"},[i.value?Ke((q(),ue("span",ise,[nt(it(r.value),1)])),[[L(t),{content:e.text,delay:[1e3,0],bypassOverflowCheck:!0}]]):(q(),ue("span",ase,it(e.text),1)),Ee("span",{ref_key:"measureRef",ref:s,class:"measure","aria-hidden":"true"},null,512)],512))}}),[["__scopeId","data-v-f1310bab"]]),cse={class:"left-section"},use={class:"modified-template-options"},dse=["onClick"],hse={class:"setting-count"},fse={class:"field-label"},pse={class:"field-label"},gse={class:"confirmation"},mse={class:"preview-section"},vse={class:"preview-list"},yse={key:0,class:"preview-more"},kN=8,n0=7,wse=bt(tt({__name:"BulkRenamePopup",props:{item:{},selectAll:{type:Boolean},selectedItemsCount:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const o=jt,s=Po,r=$(null),i=["number","letter","name"],a={number_up:"1→9",number_down:"9→1",letter_up:"A→Z",letter_down:"Z→A",name:"Name"},l=$({}),c=$(null),u=e,d=$([]),h=Y(()=>{const G=f.value;let te=0;const oe="9999.",O={input:`${oe}0`,bulkRenameButton:`${oe}13`,cancelButton:`${oe}12`,firstField:`${oe}10`,stepField:`${oe}11`,name:`${oe}1`,number_up:`${oe}2`,number_down:`${oe}3`,letter_up:`${oe}4`,letter_down:`${oe}5`};return["name","number_up","number_down","letter_up","letter_down"].forEach((se,ve)=>{te++,O[se]=`${oe}${te}`}),G?(te++,O.firstField=`${oe}${te}`,te++,O.stepField=`${oe}${te}`):(delete O.firstField,delete O.stepField),te++,O.cancelButton=`${oe}${te}`,U.value?delete O.bulkRenameButton:(te++,O.bulkRenameButton=`${oe}${te}`),O}),f=Y(()=>d.value.find(G=>typeof G!="string"&&(G.id==="number"||G.id==="letter"))),p=$("number"),g=$("up"),v=Uo({...Gf.number}),C=Uo({...Gf.number}),S=()=>{Object.assign(v,Gf[p.value]),Object.assign(C,Gf[p.value])};Qe(f,G=>{if(!G)return;const te=G.id;te!==p.value&&(p.value=te,S()),g.value=G.direction==="down"?"down":"up"},{immediate:!0,flush:"sync"});const b=Y(()=>qJ[g.value]),y=(G,te)=>{const oe=eQ(p.value,G,te);v[G]=oe,zO(G,oe)&&(C[G]=oe)},E=$(null),_=$(null),x=$(null),R=(G,te)=>{var O,Q,se,ve;if(te.key==="Enter"||te.key==="Escape")return;if(te.key==="Tab"){te.preventDefault(),te.stopPropagation(),te.stopImmediatePropagation();const ke=te.shiftKey;G=="first"&&(ke?(O=l.value.letter_down)==null||O.focus():(Q=E.value)==null||Q.focus()),G=="step"&&(ke?(se=_.value)==null||se.focus():(ve=x.value)==null||ve.focus());return}te.key.length===1&&!te.ctrlKey&&!te.metaKey&&!te.altKey&&!ZJ(p.value,G,te.key)&&te.preventDefault()},P=(G,te)=>{var ve;te.preventDefault();const oe=te.target,O=((ve=te.clipboardData)==null?void 0:ve.getData("text/plain"))??"",Q=oe.selectionStart??oe.value.length,se=oe.selectionEnd??oe.value.length;oe.value=oe.value.slice(0,Q)+O+oe.value.slice(se),y(G,oe.value),oe.value=v[G]},N=G=>{if(zO(G,v[G]))return;const te=Gf[p.value][G];v[G]=te,C[G]=te},I=Y(()=>f.value?jO({type:p.value,direction:g.value,first:C.first,step:C.step,count:u.item.length}):[]),k=Y(()=>d.value.every(G=>typeof G=="string"&&!G)),A=Y(()=>k.value||d.value.length==0&&d.value[0]===" "?u.item.map(G=>G.name):u.item.map((G,te)=>d.value.map(oe=>typeof oe=="string"?oe:oe.id==="name"?G.name:I.value[te]??"").join(""))),M=Y(()=>u.selectAll?u.selectedItemsCount-n0:A.value.length>kN?A.value.length-n0:0),V=Y(()=>A.value.length>kN?A.value.slice(0,n0):A.value),B=[{id:"name",name:"Current name",icon:null,description:{active:"Remove from the name",inactive:"Add the current name"}},{id:"number_up",name:"Number",icon:"ArrowLeft",description:{active:"Remove from the name",inactive:"Add a number that counts up",switch:"Switch to a number that counts up"}},{id:"number_down",name:"Number",icon:"ArrowRight",description:{active:"Remove from the name",inactive:"Add a number that counts down",switch:"Switch to a number that counts down"}},{id:"letter_up",name:"Letter",icon:"ArrowLeft",description:{active:"Remove from the name",inactive:"Add a letter that counts up",switch:"Switch to a letter that counts up"}},{id:"letter_down",name:"Letter",icon:"ArrowRight",description:{active:"Remove from the name",inactive:"Add a letter that counts down",switch:"Switch to a letter that counts down"}}],z=G=>{re.value=[G];const te=G.id.split("_")[0],oe=G.id.split("_")[1],O=a[G.id],Q=r.value;if(!Q)return;const se=ke=>d.value.find(_e=>typeof _e!="string"&&ke.includes(_e.id));if(te==="name"){se(["name"])?Q.deleteTag("name"):Q.insertTag({id:te,text:O,direction:void 0});return}const ve=se(["number","letter"]);if(ve){const ke=ve.id===te,_e=ve.direction===oe;if(ke&&_e){Q.deleteTag(ve.id);return}Q.deleteTag(ve.id),Q.insertTag({id:te,text:O,direction:oe})}else Q.insertTag({id:te,text:O,direction:oe})},ne=G=>ee(G.id)?G.description.active:!!f.value&&G.description.switch?G.description.switch:G.description.inactive,re=$(null),ee=G=>{const[te,oe]=G.split("_");return d.value.some(O=>typeof O!="string"&&O.id===te&&O.direction===oe)},X=n,D=Y(()=>d.value.length===1&&typeof d.value.at(0)!="string"&&d.value[0].id==="name"),U=Y(()=>d.value.length===0||D.value),K=()=>{re.value=null,d.value=[],X("cancel")},ie=()=>{const G=d.value.map(te=>typeof te=="string"?{type:"text",value:te}:te.id==="name"?{type:"current_name"}:{type:"counter",value:v.first,direction:te.direction=="up"?"asc":"desc",format:te.id==="number"?"number":"letter",step:v.step});X("rename",G)};t({reset:()=>{re.value=null,d.value=[]},focus:()=>{var G;(G=r.value)==null||G.focus()}}),Qt(()=>{setTimeout(()=>{var G;(G=r.value)==null||G.focus()},500)});const Ae=G=>{var te,oe;G.preventDefault(),G.stopPropagation(),(te=r.value)==null||te.blur(),(oe=c.value)==null||oe.focus()},ce=G=>{var te;(G.key==="Enter"||G.key==="Tab")&&((te=r.value)==null||te.focus()),G.key==="Escape"&&K()};return(G,te)=>(q(),ue("div",{class:"bulk-rename-popup",id:"bulk-rename-el",ref_key:"popupRef",ref:c,onKeydown:ce},[Ee("div",cse,[Ke(me(rse,{modelValue:d.value,"onUpdate:modelValue":te[0]||(te[0]=oe=>d.value=oe),"allowed-tags":i,ref_key:"templateInputRef",ref:r,onEscape:Ae},null,8,["modelValue"]),[[L(s),h.value.input]]),Ee("div",use,[(q(),ue(kt,null,An(B,oe=>Ke((q(),ue("button",{onClick:O=>z(oe),ref_for:!0,ref:O=>l.value[oe.id]=O,key:oe.id,class:ae([{active:ee(oe.id)},"template-option"])},[nt(it(oe.name)+" ",1),oe.icon?(q(),je(L(ut),{key:0,src:oe.icon,style:{transform:"rotate(90deg)"}},null,8,["src"])):Ye("",!0)],10,dse)),[[L(o),{content:ne(oe),bypassOverflowCheck:!0,delay:[300,0],interactive:!1,hideOnClick:!1,appendTo:"parent"}],[L(s),`${h.value[oe.id]}`]])),64))]),Ee("div",hse,[Ee("span",fse,it(b.value.first),1),Ke((q(),je(L(Wf),{ref_key:"firstFieldRef",ref:_,"model-value":v.first,disabled:!f.value,"max-length":L(GO),onInput:te[1]||(te[1]=oe=>y("first",oe)),onKeydown:te[2]||(te[2]=oe=>R("first",oe)),onPaste:te[3]||(te[3]=oe=>P("first",oe)),onBlur:te[4]||(te[4]=oe=>N("first")),"show-clear":!1},{clear:ye(()=>[...te[10]||(te[10]=[Ee("div",null,null,-1)])]),_:1},8,["model-value","disabled","max-length"])),[[L(s),h.value.firstField]]),Ee("span",pse,it(b.value.step),1),Ke(me(L(Wf),{"model-value":v.step,disabled:!f.value,"max-length":L(UO),onInput:te[5]||(te[5]=oe=>y("step",oe)),onKeydown:te[6]||(te[6]=oe=>R("step",oe)),onPaste:te[7]||(te[7]=oe=>P("step",oe)),onBlur:te[8]||(te[8]=oe=>N("step")),"show-clear":!1,ref_key:"fieldStepRef",ref:E},null,8,["model-value","disabled","max-length"]),[[L(s),h.value.stepField]])]),Ee("div",gse,[Ke((q(),je(L(pt),{variant:"secondary",onClick:K,ref_key:"cancelBtnRef",ref:x},{default:ye(()=>[...te[11]||(te[11]=[nt(" Cancel ",-1)])]),_:1})),[[L(s),h.value.cancelButton]]),Ke((q(),je(L(pt),{onClick:ie,disabled:U.value,onKeydown:te[9]||(te[9]=jn(oe=>{oe.stopPropagation(),oe.preventDefault(),ie()},["enter"]))},{default:ye(()=>[...te[12]||(te[12]=[nt(" Rename ",-1)])]),_:1},8,["disabled"])),[[L(s),h.value.bulkRenameButton]])])]),Ee("div",mse,[te[13]||(te[13]=Ee("span",{class:"preview-title"},"Preview",-1)),Ee("ul",vse,[(q(!0),ue(kt,null,An(V.value,(oe,O)=>(q(),ue("li",{key:O},[me(lse,{text:oe},null,8,["text"])]))),128)),M.value>0?(q(),ue("li",yse," … "+it(M.value)+" more items ",1)):Ye("",!0)])])],544))}}),[["__scopeId","data-v-cc9e92cb"]]),Cse=tt({__name:"BulkRenameButton",props:{item:{},totalItem:{},selectAll:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const{popupRef:o,show:s,hide:r,triggerRef:i}=mo({interactive:!0,trigger:"manually",placement:"top-end",showArrow:!1,offset:[-350,25],hideOnClick:!0,toggleOnClick:!0,onHide:()=>{h()},onShow:()=>{ct(()=>{var f;(f=d.value)==null||f.focus()})}}),a=e,l=()=>{r()},c=f=>{u("rename",f),r()},u=n,d=$(null),h=()=>{d.value&&d.value.reset()};return t({popupRef:o,hide:r,show:s,triggerRef:i}),(f,p)=>(q(),ue(kt,null,[Ee("div",{class:"trigger-el",ref_key:"triggerRef",ref:i},null,512),Ee("div",{class:"popup-el",ref_key:"popupRef",ref:o},[me(wse,{item:a.item,"select-all":a.selectAll==L(Ft).CHECKED,"selected-items-count":a.totalItem,ref_key:"bulkRenameRef",ref:d,onCancel:l,onRename:c},null,8,["item","select-all","selected-items-count"])],512)],64))}}),bse={style:{"max-width":"225px","line-height":"14px"}},Sse={style:{"max-width":"100px","line-height":"14px"}},Ese=bt(tt({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll","refreshSelectedRow"],setup(e,{emit:t}){const n=jt,o=Po,s=e,r=t,{handelSelectAll:i}=Bf(),a=$(null),{selectionStatus:l,isSelectAll:c,selectedIds:u,isBulkUpdate:d,isUpdating:h,isLoading:f,handleUpdateStart:p,handleUpdatePostUpdate:g,handleUpdateFailed:v,handleUpdateBulkStatus:C,handleUpdateBulkDate:S,handleBulkUpdateMetric:b,handleUpdateNewAssignee:y,handleDelete:E,handleArchive:_,handleUnarchive:x,deleteThumbnail:R,deleteRendition:P,handleBulkUpdateName:N}=lQ(s,a,{onUpdated:()=>r("updated"),onRefreshSelectedRow:()=>r("refreshSelectedRow")});di("bulkUpdate",d),di("isSelectAll",c);const I=["primary"],k=[{label:"Rename",icon:"Pen",id:"bulk-rename",type:"icon",value:"bulk-rename"},{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],A=()=>{r("unselect")},M=aE(),{userPermissions:V}=ts(M),B=Y(()=>V.value.includes(lE)),z=Y(()=>{if(!B.value){console.error("User does not have permission to open review.");return}return l.value==Ft.CHECKED?Zo({type:"review_take",config:{reviewDomain:ln.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,take_id:s.entityId}}).url:Zo({type:"review_multiple_scenes",config:{reviewDomain:ln.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:u.value.join(",")}}).url}),ne=$(null),re=async ie=>{var we,Ae,ce;try{switch(h.value=!0,f.value=!0,ie.id){case"unarchive":await x();break;case"delete":await E();break;case"archive":await _();break;case"delete-thumbnail":await R();break;case"delete-rendition":await P();break;case"bulk-rename":U(),(we=a.value)==null||we.hide();break;default:console.error("Unknown action:",ie.id),f.value=!1;break}}catch(G){console.error("Error performing action:",G),(Ae=a.value)==null||Ae.open()}finally{(ce=ne.value)==null||ce.focus(),ct(()=>{h.value=!1,f.value=!1})}},ee=(ie,we)=>{var Ae;!ie&&we&&((Ae=ne.value)==null||Ae.focus())},X=Y(()=>({workspaceId:s.workspaceId,entityId:s.entityId,variant:I,disabled:h.value,ids:l.value==Ft.CHECKED?[]:u.value})),D=$(null),U=()=>{var ie;(ie=D.value)==null||ie.show()},K=Y(()=>s.selectRowData.map((ie,we)=>({name:ie.name,index:we})));return(ie,we)=>Ke((q(),ue("div",{class:ae(ie.$style["bulk-update-action"])},[Ee("div",{class:ae(ie.$style["left-actions"])},[Ee("div",{class:ae(ie.$style["selection-track"])},[me(pt,{class:ae(ie.$style["btn-close"]),variant:["tertiary","icon"],onClick:A,style:{background:"transparent"}},{prefix:ye(()=>[me(ut,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),L(l)==L(Ft).INDETERMINATE?(q(),ue("span",{key:0,class:ae(ie.$style["selected-count"])},it(e.selectRowData.length)+" selected ",3)):Ye("",!0),L(l)==L(Ft).CHECKED?(q(),ue("span",{key:1,class:ae(ie.$style["selected-count"]),style:{"line-height":"14px"}},[we[0]||(we[0]=nt(' All in " ',-1)),Ke((q(),ue("span",bse,[nt(it(e.takeName),1)])),[[L(n),{content:e.takeName}]]),we[1]||(we[1]=nt(' " ',-1))],2)):Ye("",!0),!e.loading&&L(l)==L(Ft).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(q(),je(pt,{key:2,variant:"secondary",onHandleClick:L(i)},{default:ye(()=>[Ee("span",{class:ae(ie.$style["selected-count"]),style:{"line-height":"14px"}},[we[2]||(we[2]=nt(' Select all in " ',-1)),Ke((q(),ue("span",Sse,[nt(it(e.takeName),1)])),[[L(n),{content:e.takeName}]]),we[3]||(we[3]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Ye("",!0),Ee("span",{class:ae(ie.$style.divider)},null,2)],2),me(Qoe,zt(X.value,{onUpdated:L(C),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),"selected-all":L(l)==L(Ft).CHECKED}),null,16,["onUpdated","onUpdateStart","onUpdateCompleted","onUpdateFailed","selected-all"]),me(kQ,zt({onUpdate:L(y),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),"selected-all":L(l)==L(Ft).CHECKED},X.value),null,16,["onUpdate","onUpdateStart","onUpdateCompleted","onUpdateFailed","selected-all"]),me(zQ,zt({"row-selected":e.selectRowData,"selected-all":L(l)==L(Ft).CHECKED},X.value,{onUpdated:L(S),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v)}),null,16,["row-selected","selected-all","onUpdated","onUpdateStart","onUpdateCompleted","onUpdateFailed"]),me(Xoe,{disabled:L(h),onUpdate:L(b),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),selectedIds:L(u),"workspace-id":e.workspaceId,variant:I,"entity-id":e.entityId,"selected-all":L(l)==L(Ft).CHECKED},null,8,["disabled","onUpdate","onUpdateStart","onUpdateCompleted","onUpdateFailed","selectedIds","workspace-id","entity-id","selected-all"]),Ee("span",{class:ae(ie.$style.divider)},null,2),Ke((q(),ue("div",null,[B.value?(q(),je(pt,{key:0,class:ae(ie.$style["action-button"]),variant:[...I,"icon"],href:z.value,disabled:L(h)||s.selectRowData.length>40&&L(l)!=L(Ft).CHECKED},{default:ye(()=>[me(ut,{src:"PenRuler",class:ae(ie.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Ye("",!0)])),[[L(n),s.selectRowData.length<=40||L(l)==L(Ft).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),Ee("span",{class:ae(ie.$style.divider)},null,2),me(zf,{ref_key:"wrapperRef",ref:a,isUpdating:L(h),disabled:L(h),onOnVisibleChange:ee},{trigger:ye(({hide:Ae,toggle:ce,isVisible:G,disabled:te})=>[Ke((q(),je(pt,{onEscape:Ae,actived:G,ref_key:"moreActionRef",ref:ne,class:ae(ie.$style["action-button"]),variant:["secondary","icon"],loading:L(f),disabled:te||L(h),onClick:Lt(ce,["stop"])},{default:ye(()=>[me(ut,{src:"EllipsisVertical",class:ae(ie.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[L(o),"99999"],[L(n),{content:"More actions"}]])]),popup:ye(({isVisible:Ae,hide:ce})=>[(q(),ue(kt,null,An(k,(G,te)=>me(dl,zt({clickable:!0,key:G.id},{ref_for:!0},G,{show:Ae,style:{borderLeft:0},"focus-index":"99999."+te,onClick:()=>{re(G)},onEscape:ce}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2),me(Cse,{item:K.value,totalItem:L(c)?s.totalRows:K.value.length,"select-all":L(l),onRename:L(N),ref_key:"bulkRenameButtonRef",ref:D},null,8,["item","totalItem","select-all","onRename"])],2)),[[lr,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1odua_1","left-actions":"_left-actions_1odua_20","right-actions":"_right-actions_1odua_21","selection-track":"_selection-track_1odua_26","btn-close":"_btn-close_1odua_32","close-icon":"_close-icon_1odua_38","selected-count":"_selected-count_1odua_42",divider:"_divider_1odua_48","more-button":"_more-button_1odua_53",dropdown:"_dropdown_1odua_57","dropdown-content":"_dropdown-content_1odua_60",delete:"_delete_1odua_83","icon-btn":"_icon-btn_1odua_90","selected-list":"_selected-list_1odua_94"}}]]),ml=bt(tt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Ns,n=jt,o=e,s=Y(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:r}=To(s),i=Y(()=>{var c,u,d;return!!((c=o.params)!=null&&c.api||(u=o.params)!=null&&u.node||(d=o.params)!=null&&d.context)}),a=Y(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const c=o.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=me(hf,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});nb(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=Y(()=>o.value===void 0);return(c,u)=>Ke((q(),je(Oo,zt(L(r),{ref:"displayWrapperRef"}),{default:ye(()=>[Ee("span",{class:ae(c.$style["item-table-label-renderer"])},it(o.value||"-"),3)]),_:1},16)),[[L(t),{isLoading:l.value||!i.value}],[L(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),_se=["placeholder","maxlength"],Rse={key:0,class:"wrapper-suffix"},Tse=bt(tt({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Ns,s=jt,r=e,i=n,a=$(r.value),l=$(null),c=$(null),u=$(r.value||""),d=$(!1),h=$(!1),f=Y(()=>{var I;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((I=r.value)==null?void 0:I.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=To(f),v=()=>u.value!==a.value,C=()=>{h.value=!0,d.value=!1,u.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const I=l.value.value;if(!v()){d.value=!1;return}a.value=I,i("update:value",I),i("enter",I),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():C(),i("blur",u.value))},y=I=>{var k;if(I.key==="ArrowLeft"||I.key==="ArrowRight"){I.stopPropagation();return}I.ctrlKey&&(I.key=="a"||I.key=="A")?(I.stopPropagation(),(k=l.value)==null||k.select()):I.key==="Enter"?(I.preventDefault(),I.stopPropagation(),S()):I.key==="Escape"&&(I.preventDefault(),I.stopPropagation(),C())},E=()=>{a.value=r.value,u.value=r.value,d.value=!0,ct(()=>{var I,k;(I=l.value)==null||I.click(),(k=l.value)==null||k.focus()})},_=()=>{var I;d.value?C():(I=l.value)==null||I.blur(),i("blur",u.value)},x={focus:()=>{E()}};Qt(()=>{var k;const I=(k=c.value)==null?void 0:k.$el;I&&(I.__sceneNameEditor=x)}),zn(()=>{const I=c.value;I&&delete I.__sceneNameEditor});const R=$(null),P=$(null);t({focus:E,blur:()=>{var I;return(I=l.value)==null?void 0:I.blur()},save:S,cancel:C,focusEditButton:()=>{ct(()=>{var I;(I=R.value)==null||I.focus()})},focusCancelButton:()=>{ct(()=>{var I;(I=P.value)==null||I.focus()})},startEdit:E});const N=Y(()=>r.value===void 0);return yE(c,()=>{d.value&&b()}),(I,k)=>Ke((q(),je(L(Oo),zt(L(p),{ref_key:"wrapperRef",ref:c,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),Vh({default:ye(()=>[d.value?Ye("",!0):xt(I.$slots,"default",{isEditting:d.value,isHover:L(g)},()=>[Ke((q(),ue("span",{class:ae(I.$style["label-renderer"])},[nt(it(u.value),1)],2)),[[L(s),{content:u.value||void 0}]])],void 0,0),Ke(Ee("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":k[0]||(k[0]=A=>u.value=A),class:ae(I.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:y,onBlur:b},null,42,_se),[[lr,d.value],[rx,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ye(({hovered:A,focused:M})=>[A?(q(),ue("div",Rse,[A&&!M?Ke((q(),je(pt,{key:0,variant:["icon","secondary"],size:24,onClick:Lt(E,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:R,onKeydown:[jn(Lt(E,["prevent","stop"]),["enter"]),jn(Lt(_,["prevent","stop"]),["escape"])]},{default:ye(()=>[me(L(ut),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[L(s),"Edit"]]):Ye("",!0)])):Ye("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[L(o),{isLoading:N.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),Dse=["tabindex"],FN=bt(tt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=jt,s=Ns,r=e,i=n,a=$(r.value),l=$(r.value),c=$(null),u=$(null),d=Dn("bulkUpdate",!1),{apiServices:h}=io(!d,r),f=Y(()=>{var ee;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((ee=a==null?void 0:a.value)==null?void 0:ee.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=To(f),g=Y(()=>{const ee=ln.getInstance().getItem("ws.code"),X=ln.getInstance().getItem("BASE_URL"),D=ee||r.workspaceId;return Zo({type:"scene_hub",config:{baseDomain:X,ws_code:D,scene_id:String(r.id)}}).url}),v=Y(()=>{var ee,X,D;return((X=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:X.state)==0||((D=r.data)==null?void 0:D.isDeleted)==!0}),C=Y(()=>r.readOnly||_.value),S=Y(()=>{var ee,X,D,U,K;return((ee=r.data)==null?void 0:ee.isDeleted)==!0||((D=(X=r.data)==null?void 0:X.isProcessing)==null?void 0:D.state)==0||((K=(U=r.data)==null?void 0:U.isProcessing)==null?void 0:K.state)==1}),b=Y(()=>{var ee,X;return(X=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:X.message}),y=Y(()=>{var ee;return((ee=r.data)==null?void 0:ee.isArchived)==1}),E=Y(()=>{var ee;return((ee=r.data)==null?void 0:ee.isLocked)==1}),_=Y(()=>r.value===void 0),x=Y(()=>{var ee,X;return((X=(ee=r.data)==null?void 0:ee.permissions)==null?void 0:X.has_edit_permission)==1}),R=async ee=>{var X,D,U,K,ie,we,Ae,ce,G,te;a.value=ee,p.value=!1;try{const oe=await((D=(X=h.value)==null?void 0:X.updateSceneName)==null?void 0:D.call(X,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),O=dv.get(hk)||"UTC";if(oe){const Q=mk(oe,O),se={...r.data,...Q};(U=r.params)==null||U.api.clearFocusedCell();const ve=((ie=(K=r.params)==null?void 0:K.column)==null?void 0:ie.getColId())||"",ke=((Ae=(we=r.params)==null?void 0:we.node)==null?void 0:Ae.rowIndex)||0;(ce=r.params)==null||ce.api.setFocusedCell(ke,ve),(te=(G=r.params)==null?void 0:G.node)==null||te.setData(se),l.value=a.value,i("enter")}else a.value=l.value}catch(oe){console.error("Failed to update scene name:",oe),a.value=l.value}},P={focus:()=>{p.value=!0,ct(()=>{var ee;return(ee=u.value)==null?void 0:ee.focus()})},startEdit:()=>{var ee;(ee=u.value)==null||ee.startEdit()}},N=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;Qe(()=>r.value,ee=>{a.value=ee,l.value=ee}),Qt(()=>{const ee=N();ee&&(ee.__sceneNameEditor=P)}),zn(()=>{const ee=u.value,X=ee&&"$el"in ee?ee.$el:ee;X&&delete X.__sceneNameEditor});const I=cd(),{openSceneHub:k}=I,A=ee=>{try{if(ee.ctrlKey||ee.metaKey){window.open(g.value,"_blank");return}k(String(r.id))}catch{window.open(g.value,"_blank")}finally{ne()}},M=()=>{setTimeout(()=>{re.value=!0,V.value=0,ct(()=>{var ee;(ee=B.value)==null||ee.focus()})},300)},V=$(-1),B=$(null);t({focus:M,trigerFocus:M,startEdit:()=>{var ee;(ee=u.value)==null||ee.startEdit()}});const z=ee=>{if(ee.key==="Enter"){ee.preventDefault(),A(ee);return}if(ee.key==="Escape"){ee.preventDefault(),ne();return}ee.key==="Tab"&&(ee.preventDefault(),ee.stopPropagation(),ee.stopImmediatePropagation(),ct(()=>{var X;(X=u.value)==null||X.focusEditButton()}))},ne=()=>{var D,U,K,ie,we,Ae;re.value=!1,V.value=-1,(D=r.params)==null||D.api.clearFocusedCell();const ee=((K=(U=r.params)==null?void 0:U.column)==null?void 0:K.getColId())||"",X=((we=(ie=r.params)==null?void 0:ie.node)==null?void 0:we.rowIndex)||0;(Ae=r.params)==null||Ae.api.setFocusedCell(X,ee)},re=$(!1);return(ee,X)=>Ke((q(),je(Tse,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:r.disabled,"read-only":C.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":X[0]||(X[0]=D=>a.value=D),id:`scene-name-${r.id}`,onEnter:R,"max-length":255,bordered:!0,keyboardFocusing:re.value,onBlur:ne},{default:ye(({isHover:D,isEditting:U})=>[Ke(Ee("div",{class:ae(ee.$style["scene-name-display"])},[Ke((q(),ue("a",{tabindex:V.value,ref_key:"nameRef",ref:B,onClick:Lt(A,["prevent"]),onKeydown:z,target:"_blank",class:ae(ee.$style["scene-name-text"]),style:{lineHeight:"28px"}},[nt(it(a.value),1)],42,Dse)),[[L(o),{content:a.value,delay:[1e3,0]}]]),C.value||!D&&!U&&!C.value?(q(),ue(kt,{key:0},[E.value?Ke((q(),ue("div",{key:0,class:ae([ee.$style["icon-processing"],ee.$style.isLocked])},[me(ut,{src:"Lock",color:x.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[L(o),{content:x.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Ye("",!0),y.value?Ke((q(),ue("div",{key:1,class:ae([ee.$style["icon-processing"],ee.$style.archived])},[me(ut,{src:"BoxArchive"})],2)),[[L(o),{content:"Archived",delay:[1e3,0]}]]):Ye("",!0),S.value?Ke((q(),ue("div",{key:2,class:ae([ee.$style["icon-processing"],ee.$style.processing,v.value&&ee.$style["icon-red"]])},[me(ut,{src:"AnimatedHourglass",color:"inherit"})],2)),[[L(o),b.value]]):Ye("",!0)],64)):Ye("",!0)],2),[[lr,!L(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[L(s),{isLoading:_.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nare0_1","scene-name-display":"_scene-name-display_nare0_11","icon-processing":"_icon-processing_nare0_18",archived:"_archived_nare0_28",locked:"_locked_nare0_31",processing:"_processing_nare0_34","icon-red":"_icon-red_nare0_38","scene-name-text":"_scene-name-text_nare0_43"}}]]),o0=bt(tt({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick","open"],setup(e,{expose:t,emit:n}){const o=Po,s=$([]),r=e,i=$(null),a=Y(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=Y(()=>{let C=[];return typeof r.variant=="string"?C.push(r.variant):Array.isArray(r.variant)&&(C=[...r.variant]),[...C,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=mo({toggleOnClick:!0,offset:[0,0],onShow:()=>c("open")});function v(C){c("select",C),u()}return Nh(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),Qe(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(q(),ue("div",{class:ae(C.$style["button-dropdown-wrapper"]),style:hn({"--button-size":a.value})},[Ee("div",{class:ae(C.$style["button-group"])},[xt(C.$slots,"prefix"),Ee("div",{ref_key:"triggerRef",ref:f,class:ae(L(d)?C.$style.open:"")},[xt(C.$slots,"triggerDropdown",{open:L(d)},()=>[r.readOnly?Ye("",!0):Ke((q(),je(pt,{key:0,onEscape:L(u),ref_key:"mainButton",ref:i,actived:L(d),class:ae(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:ye(()=>[xt(C.$slots,"iconDropdown",{},()=>[me(ut,{class:ae(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[L(o),e.tabIndex]])])],2)],2),Ee("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:ae(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(q(!0),ue(kt,null,An(e.options,(b,y)=>Ke((q(),je(dl,zt({ref_for:!0,ref:E=>s.value[y]=E,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Lt(E=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ye(()=>[nt(it(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[L(o),`${e.tabIndex}.${y}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),rp=bt(tt({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=jt,o=e,s=t,r=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),s("clear")},i=Y(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(q(),ue("div",{class:ae(a.$style["close-wrapper"])},[e.disableRemove?Ye("",!0):(q(),ue("div",{key:0,class:ae(a.$style["close-button"])},[Ke((q(),je(pt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:ye(()=>[me(ut,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[L(n),i.value]])],2)),xt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),xse=bt(tt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=jt,n=Ns,o=e,{isEditing:s}=sd(o),r=$(o.value),i=$(null),a=$(null),{apiServices:l}=io(!0,o),c=$(!0),u=()=>{c.value=o.value===void 0};Mh(()=>{u()}),Qt(()=>{u()}),Qe(()=>o.value,R=>{u()});const d=Y(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:i,wrapperRef:a,clickable:!(o.readOnly||c.value),active:s})),{argsMain:h,isHover:f}=To(d),p=Y(()=>{var R;return((R=r.value)==null?void 0:R.slice(0,o.maxVisible))||[]}),g=Y(()=>{var R;return Math.max(0,(((R=r.value)==null?void 0:R.length)||0)-o.maxVisible)}),v=Y(()=>{var R;return g.value<=0?"":((R=r.value)==null?void 0:R.slice(o.maxVisible).map(P=>P.name).join(", "))||""}),C=Y(()=>p.value.map(R=>({id:R.id,name:R.name,initial:R.initial,avatarId:R.id,profile_image:R.profile_image,color:R.color,size:24,user:R}))),S=Y(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Qe(()=>o.value,R=>{r.value=R},{immediate:!0,deep:!0});const b=async R=>{var N,I,k;await x(R)&&(r.value=(N=r.value)==null?void 0:N.filter(A=>A.id!==R),(k=o.params)==null||k.node.setData({...(I=o.params)==null?void 0:I.node.data,assignees:r.value}))},y=R=>{var N;const P=ln.getInstance().getItem("ws.code");return((N=l.value)==null?void 0:N.getUserInformation(P,R))||Promise.resolve(null)},{id:E}=Ng(o),_=R=>{var N,I;const P=(I=(N=o.params)==null?void 0:N.api)==null?void 0:I.getRowNode(String(E.value));P==null||P.setDataValue("assignees",Wm(R.assignees))},{removeAssignee:x}=gv({...o,entityId:o.entityId,updateRowData:_,value:o.value,errorCallback:()=>{}});return(R,P)=>Ke((q(),je(Oo,zt(L(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ye(()=>{var N;return[Ee("div",{class:ae(R.$style.assigneeGroupRenderer)},[((N=r.value)==null?void 0:N.length)===0?(q(),je(ut,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:hn(S.value)},null,8,["style"])):Ye("",!0),(q(!0),ue(kt,null,An(C.value,I=>(q(),je(rp,{key:I.id,"disable-remove":o.readOnly||o.disabled,onClear:k=>b(I.id),style:{marginLeft:"0"}},{default:ye(()=>[me(Dc,{user:I.user,"show-profile":!0,apiUpdateFunction:y,class:ae(R.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ke((q(),ue("div",{key:1,class:ae(R.$style["extra-avatars"])},[nt(" +"+it(g.value),1)],2)),[[L(t),v.value]]):Ye("",!0)],2)]}),_:1},16)),[[L(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),Ise=bt(tt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var _,x;const t=jt,n=Ns,o=PS(),s=e,r=$(null),i=$(null),{isEditing:a}=sd(s),l=R=>{if(R){if(typeof R=="string")return R;if(R instanceof Date)return R.toISOString()}},c=Y(()=>s.value===void 0),u=Y(()=>{var R;return(R=s.data)==null?void 0:R.isStarted}),d=Y(()=>{var R;return(R=s.data)==null?void 0:R.isCompleted}),h=Y(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=Y(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Y(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=To(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:y,fullEndDate:E}=BY({start:l((_=s.value)==null?void 0:_[0]),end:l((x=s.value)==null?void 0:x[1]),isStarted:u.value,isEnded:d.value,timezone:s.timezone||o});return(R,P)=>Ke((q(),je(Oo,zt(L(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:ye(()=>[c.value?Ye("",!0):(q(),ue("div",{key:0,class:ae(R.$style.dateRangeRenderer)},[h.value?Ye("",!0):(q(),je(ut,{key:0,src:"Calendar",class:ae(R.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(q(),ue(kt,{key:1},[Ke((q(),ue("span",{class:ae([R.$style.dateLabelDisplay,...L(S).map(N=>R.$style[N])])},[nt(it(L(v)),1)],2)),[[L(t),L(y)]]),P[0]||(P[0]=Ee("span",null,"→",-1)),Ke((q(),ue("span",{class:ae([R.$style.dateLabelDisplay,...L(b).map(N=>R.$style[N])])},[nt(it(L(C)),1)],2)),[[L(t),L(E)]])],64)):Ye("",!0)],2))]),_:1},16)),[[L(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_rsfrm_1",calendarIcon:"_calendarIcon_rsfrm_8",dateSection:"_dateSection_rsfrm_12",dateLabelDisplay:"_dateLabelDisplay_rsfrm_19",empty:"_empty_rsfrm_29","end-today":"_end-today_rsfrm_35",actual:"_actual_rsfrm_38","end-tomorrow":"_end-tomorrow_rsfrm_41","end-yesterday":"_end-yesterday_rsfrm_47","end-past":"_end-past_rsfrm_53","end-future":"_end-future_rsfrm_59","start-today":"_start-today_rsfrm_62","start-tomorrow":"_start-tomorrow_rsfrm_68","start-yesterday":"_start-yesterday_rsfrm_74","start-past":"_start-past_rsfrm_80","start-future":"_start-future_rsfrm_86"}}]]),Ase=tt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:PS()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=$(null);Qt(()=>{ct(()=>{o.value&&o.value.focus()})});const s=e,r=n,i=()=>{var C;(C=s.params)==null||C.api.stopEditing(),r("closed")},a=C=>`${St.fromJSDate(C,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async C=>{await v({startDate:C[0]?a(C[0]):null,dueDate:C[1]?a(C[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async C=>{await v({startDate:C?a(C):null})},h=async C=>{await v({dueDate:C?a(C):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=Dn("bulkUpdate",!1),{apiServices:g}=io(!p,s),v=async C=>{var S,b,y,E,_;try{const x=(S=o.value)==null?void 0:S.getValues(),R=await((y=(b=g.value)==null?void 0:b.changeDate)==null?void 0:y.call(b,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:C.startDate,dueDate:C.dueDate}));R!=null&&R.message&&((_=s.params)==null||_.node.setData({...(E=s.params)==null?void 0:E.node.data,dateRange:x==null?void 0:x.dateRange}))}catch(x){console.error("Failed to update scene name:",x)}};return t({focus:()=>{ct(()=>{var C;(C=o.value)==null||C.focus()})}}),(C,S)=>(q(),je(Ov,zt(s,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:i,ref_key:"calendarRef",ref:o}),null,16))}}),Pse=bt(tt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=$(null),o=$(0);let s=null;Qt(()=>{n.value&&(s=new ResizeObserver(i=>{for(const a of i)o.value=a.contentRect.height}),s.observe(n.value))}),ec(()=>{s&&n.value&&s.unobserve(n.value)});const r=Y(()=>{const i=o.value;return i>120?i-42-36:0});return(i,a)=>(q(),ue("div",{class:ae(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[Ee("div",{class:ae(i.$style["item-header"])},[Ee("div",{class:ae(i.$style["item-header__left"])},[xt(i.$slots,"header-left",{},()=>[Ee("h1",{class:ae(i.$style["item-header__title"])},[xt(i.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),Ee("div",{class:ae(i.$style["item-header__spacer"])},null,2),Ee("div",{class:ae(i.$style["item-header__actions"])},[xt(i.$slots,"header-actions")],2)],2),xt(i.$slots,"grid",{availableHeight:r.value}),Ee("div",{class:ae(i.$style.footer)},[xt(i.$slots,"footer")],2),xt(i.$slots,"new-row"),xt(i.$slots,"bulk-update-actions"),xt(i.$slots,"snackbar"),xt(i.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),ON=bt(tt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=Po,s=e,r=Y(()=>(s==null?void 0:s.workspaceId)||""),i=Y(()=>(s==null?void 0:s.entityId)||""),a=()=>{var M,V,B;return(B=(M=s.params)==null?void 0:M.api)==null?void 0:B.getCellRendererInstances({columns:["options"],rowNodes:(V=s.params)!=null&&V.node?[s.params.node]:[]})[0]},l=()=>{var V,B,z,ne;const M=a();(B=(V=M==null?void 0:M.componsenExposed)==null?void 0:V.blur)==null||B.call(V),(ne=(z=M==null?void 0:M.container)==null?void 0:z.parentElement)==null||ne.classList.remove("ag-cell-focus")},c=()=>{var B,z,ne;(z=(B=s.params)==null?void 0:B.api)==null||z.stopEditing(),l();const M=`scene-name-${s.id}`,V=document.getElementById(M);(ne=V==null?void 0:V.__sceneNameEditor)==null||ne.startEdit()},{apiServices:u}=io(!0,s),d=Y(()=>{var M;return{ws_code:r.value,entity_id:i.value,scene_id:s.id,axiosService:u,optionBlock:s.optionBlock,permissions:(M=s.data)==null?void 0:M.permissions}}),h=M=>{var B,z,ne,re,ee,X;let V=(z=(B=s.params)==null?void 0:B.api)==null?void 0:z.getRowNode(String(s.id));if(V){const D={...V.data,isDeleted:M==="deleted",isArchived:M==="archived"?!0:V.data.isArchived,isLocked:M==="locked"?!0:V.data.isLocked,disabled:!1};M=="deleted"&&(D.isLocked=!1,D.disabled=!0),M=="unarchived"&&(D.isArchived=!1),(re=(ne=s.params)==null?void 0:ne.api)==null||re.redrawRows({rowNodes:[V]}),V.setData(D),(X=(ee=s.params)==null?void 0:ee.api)==null||X.redrawRows({rowNodes:[V]})}},f=cd(),{openSceneHub:p}=f,g=()=>{ct(()=>{var B,z,ne,re,ee,X;const M=((z=(B=s.params)==null?void 0:B.node)==null?void 0:z.rowIndex)||0,V=((re=(ne=s.params)==null?void 0:ne.column)==null?void 0:re.getColId())||"";(X=(ee=s.params)==null?void 0:ee.api)==null||X.setFocusedCell(M,V)})};Y(()=>{var V,B;const M=(B=(V=s.params)==null?void 0:V.api)==null?void 0:B.getRowNode(String(s.id));return M==null?void 0:M.data});const{options:v}=wJ(d,h,c,p,g),C=n,S=()=>{var M,V,B,z,ne,re;console.trace("Focusing current cell for row:",s.id),(re=(M=s.params)==null?void 0:M.api)==null||re.setFocusedCell(((B=(V=s.params)==null?void 0:V.node)==null?void 0:B.rowIndex)||0,((ne=(z=s.params)==null?void 0:z.column)==null?void 0:ne.getColId())||"")},b=Y(()=>{var M;return(M=s.params)==null?void 0:M.api}),y=(M,V)=>{var B,z,ne,re,ee,X,D,U;if(C("actionExecuted",M),M.id=="copy-link"){(ee=b.value)==null||ee.startEditingCell({rowIndex:(z=(B=s.params)==null?void 0:B.node)==null?void 0:z.rowIndex,colKey:(re=(ne=s.params)==null?void 0:ne.column)==null?void 0:re.getColId()});return}else{if(M.id!=="copy-link"&&((X=b.value)==null||X.stopEditing()),M.id==="rename")(D=b.value)==null||D.stopEditing(),(U=b.value)==null||U.clearFocusedCell(),l();else if(M.id==="copy-link"){const K=document.getElementById(V);setTimeout(()=>{var ie,we,Ae;(Ae=(we=(ie=K==null?void 0:K.__vueParentComponent)==null?void 0:ie.exposed)==null?void 0:we.focus)==null||Ae.call(we)},300)}else if(["delete-rendition","delete-thumbnail"].includes(M.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var K,ie;(ie=(K=s.params)==null?void 0:K.api)==null||ie.clearFocusedCell()},300)}},E=()=>{var M,V;(V=(M=s.params)==null?void 0:M.api)==null||V.stopEditing()},_=M=>{var V,B,z,ne;return M==="archive"?!((B=(V=s.params)==null?void 0:V.data)!=null&&B.isArchived):M==="unarchive"?(ne=(z=s.params)==null?void 0:z.data)==null?void 0:ne.isArchived:!0},x=Y(()=>v.value.map(M=>({...M,options:M.options.filter(V=>!V.hide&&_(V.id))})).filter(M=>M.options.length>0)),R=$({}),P=$(null),N=Y(()=>{var V,B;if(s.focusableIndex)return s.focusableIndex;const M=(B=(V=s.params)==null?void 0:V.api)==null?void 0:B.getRowNode(String(s.id));return`${((M==null?void 0:M.rowIndex)??0)+10}`}),I=(M,V)=>`${N.value}.${M*10+V}`,k=(M,V)=>{if(V&&"focus"in V){R.value[M]=V;return}delete R.value[M]},A=M=>{M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation()};return Qt(()=>{var M;(M=P.value)==null||M.focus()}),t({focus(){var B;const M=`${N.value}.0`,V=R.value[M];V&&V.focus?V.focus():(B=P.value)==null||B.focus()}}),(M,V)=>Ke((q(),ue("div",{onKeydown:A,class:ae([M.$style["more-option-section"],{[M.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:P,tabindex:"0",role:"menu"},[(q(!0),ue(kt,null,An(x.value,(B,z)=>(q(),ue("div",{key:B.id,style:hn({"--g-number":Math.min(B.options.length,4),"--g-size":B.type==="column"?"36px":"auto"}),class:ae([M.$style["option-block"],M.$style[B.type]])},[(q(!0),ue(kt,null,An(B.options,(ne,re)=>(q(),ue("div",{key:ne.id,class:ae(M.$style["option-item"])},[me(Fse,{layer:s.layer,"scene-id":String(s.id),option:ne,type:B.type,onActionExecuted:ee=>y(ee,`more-action-${ee.id}-${s.id}`),focusableIndex:I(z,re),ref_for:!0,ref:ee=>k(I(z,re),ee),onHandleHide:E,id:`more-action-${ne.id}-${s.id}`,label:ne.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[L(o),N.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1jg4p_1","option-block":"_option-block_1jg4p_8","option-item":"_option-item_1jg4p_15",row:"_row_1jg4p_19",column:"_column_1jg4p_25",block:"_block_1jg4p_29"}}]]),kse={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},Fse=bt(tt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=Po,s=jt,r=e,i=$(!1),a=$(!1),l=(R,P)=>{if(!P){p();return}const N=P.target;N.closest(".tippy-content")||N.closest(".tippy-box")||N.closest("[data-tippy-root]")||N.closest(".option-item")||p()},c=$(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=mo({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async R=>{var P,N;if(!a.value){a.value=!0;try{await((N=(P=r.option).action)==null?void 0:N.call(P,R)),g("actionExecuted",r.option)}catch(I){console.error("Action execution failed:",I)}finally{a.value=!1,i.value=!1}}},C=async R=>{var P,N;if(R.preventDefault(),R.stopPropagation(),!a.value){if(r.option.isDanger){i.value=!i.value;return}if(r.option.subMenu)h();else{a.value=!0;try{await((N=(P=r.option).action)==null?void 0:N.call(P,R)),g("actionExecuted",r.option)}catch(I){console.error("Action execution failed:",I)}finally{a.value=!1}return}}},S=R=>{g("actionExecuted",R),p()},b=R=>{R.key==="Escape"&&p()},y=R=>({row:"small",column:"medium",block:"small"})[R]||"medium",E=R=>{const P=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...P],column:["menu-item",...P],block:["secondary",...P]}[R]||[]},_=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{ct(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{C(new MouseEvent("click"))}});const x=R=>{var P;R.stopPropagation(),R.preventDefault(),i.value=!1,(P=u.value)==null||P.focus()};return(R,P)=>{var N;return Ke((q(),ue("div",{ref_key:"wrapperRef",ref:c,class:ae(R.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Lt(C,["stop","prevent"])},[Ke((q(),je(pt,{ref_key:"triggerRef",ref:u,class:ae(R.$style["option-item"]),disabled:e.option.disabled||a.value,actived:L(f)||i.value,size:y(e.type),variant:E(e.type),onClick:Lt(C,["stop","prevent"]),onKeydown:b,onEscape:_,label:e.option.label},{prefix:ye(()=>[e.option.icon?(q(),ue("div",kse,[me(ut,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Ye("",!0)]),suffix:ye(()=>[e.option.subMenu?(q(),je(ut,{key:0,src:"Play",source:"remote"})):Ye("",!0),e.option.isDanger&&i.value?(q(),ue("div",{key:1,class:ae(R.$style["confirm-action"])},[Ke((q(),je(pt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:x},{default:ye(()=>[me(ut,{src:"XMarkSolid",source:"remote"})]),_:1})),[[L(o),`${r.focusableIndex}.0`],[L(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((q(),je(pt,{variant:["danger","primary","icon"],size:"small",onClick:Lt(v,["stop","prevent"]),onEscape:P[0]||(P[0]=I=>i.value=!1)},{default:ye(()=>[me(ut,{src:"Check",source:"remote"})]),_:1})),[[L(o),`${r.focusableIndex}.1`],[L(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[L(o),r.focusableIndex]]),e.option.subMenu?(q(),ue("div",{key:0,ref_key:"popupRef",ref:d,class:ae(R.$style["submenu-container"])},[me(ON,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((N=e.option)==null?void 0:N.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Ye("",!0)],2)),[[L(s),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),MN=(e,t)=>{const n=$(Number(e.value.value)),o=Y(()=>e.value.metricConfig),s=Y(()=>{var g,v;const l=o.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),r=17,i=Y(()=>{var l;return{maxRating:((l=o.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:r}});return{componentState:s,metricConfig:o,ICON_SIZE:r,ratingParams:i,standardNameforIcon:()=>{var c;return(((c=o.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},Ose=["aria-label"],NN=bt(tt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Ns,o=jt,s=e,r=Rh(!1),i=$(null),a=$(null),{isEditing:l}=sd(s),c=Y(()=>{var V,B;return{value:s.value,metricConfig:((B=(V=s.params)==null?void 0:V.colDef)==null?void 0:B.context)||s.config,error:s.error,hovered:r.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=MN(c,r),f=Y(()=>{var B,z;let V=!1;if(["number","formula"].includes(d.value.metric_type.code)){const ne=Number(s.value),re=Number((B=d.value)==null?void 0:B.format_value);Number.isFinite(re)&&re>=0&&(V=(((z=ne.toString().split(".")[1])==null?void 0:z.length)||0)>re)}return V}),p=Y(()=>{var V;return!!((V=d.value)!=null&&V.morpheme_value)||u.value.isEmpty||f.value}),g=Y(()=>{var z,ne,re;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const V=P.value,B=(z=d.value)==null?void 0:z.morpheme_type;return B==="prefix"?`${((ne=d.value)==null?void 0:ne.morpheme_value)||""} ${V}`.trim():B==="suffix"?`${V} ${((re=d.value)==null?void 0:re.morpheme_value)||""}`.trim():V}),v=Y(()=>{const{format_type:V,format_value:B}=d.value;if(V==="dropdown"&&typeof B=="string"&&B.startsWith("["))try{return JSON.parse(B)}catch{return[]}return[]}),C=Y(()=>({disabled:s.disabled,error:u.value.isError,inputRef:i,wrapperRef:a,clickable:!R.value,readOnly:s.readOnly||R.value,isEmpty:u.value.isEmpty})),{argsMain:S,isHover:b}=To(C),y=(V,B,z="en-US")=>new Intl.NumberFormat(z,{minimumFractionDigits:B,maximumFractionDigits:B}).format(V),E=Y(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const V=s.value,{format_type:B,format_value:z,mapping:ne}=d.value;if(ne&&typeof ne=="object"&&!Array.isArray(ne)){const re=ne[`!${V}`];if(re)return re}if(B==="dropdown"){const re=v.value.find(ee=>String(ee.name)===String(V));if(re)return re.name}if(typeof V=="string"){const re=Number(V);return Number.isNaN(re)?V:V.replace(/[.-]/g,"").length>16?_(V,z):_(re,z)}return typeof V=="number"?_(V,z):String(V)}),_=(V,B)=>{const z=Number.parseInt(String(B)||"2",10),ne=Number.isFinite(z)&&z>=0?z:2;try{if(typeof V=="string"){const re=V.split("."),ee=re[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),X=re[1]?re[1].substring(0,ne).padEnd(ne,"0"):"0".repeat(ne);return ne>0?`${ee}.${X}`:ee}return y(V,ne)}catch(re){return console.error("Error formatting metric value:",re,{num:V,decimals:ne}),String(V)}},x=(V,B)=>{const z=Number.parseInt(String(B)||"2",10),ne=Number.isFinite(z)&&z>=0?z:2;try{if(typeof V=="string"){const re=V.split("."),ee=re[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),X=re[1]?re[1].length:0,D=Math.max(ne,X),U=re[1]?re[1].padEnd(D,"0"):"0".repeat(D);return D>0?`${ee}.${U}`:ee}return new Intl.NumberFormat("en-US",{minimumFractionDigits:ne,maximumFractionDigits:20}).format(V)}catch(re){return console.error("Error formatting exact metric value:",re,{num:V,decimals:ne}),String(V)}},R=Y(()=>{var V;return((V=d.value)==null?void 0:V.metric_type.code)==="formula"}),P=Y(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const V=s.value,{format_type:B,format_value:z,mapping:ne}=d.value;if(ne&&typeof ne=="object"&&!Array.isArray(ne)){const re=ne[`!${V}`];if(re)return re}if(B==="dropdown"){const re=v.value.find(ee=>String(ee.name)===String(V));if(re)return re.name}if(typeof V=="string"){const re=Number(V);return Number.isNaN(re)?V:V.replace(/[.-]/g,"").length>16?x(V,z):x(re,z)}return typeof V=="number"?x(V,z):String(V)}),{tooltip:N}=bk(""),I=async V=>{V.stopPropagation(),V.preventDefault(),V.stopImmediatePropagation();try{await navigator.clipboard.writeText(P.value),N.value="Copied",setTimeout(()=>{N.value="Copy"},3e3)}catch(B){console.error("Failed to copy text:",B),N.value="Copy failed",setTimeout(()=>{N.value="Copy"},3e3)}};Qe(()=>s.value,(V,B)=>{const z=Number(V);Number.isFinite(z)&&z!==h.value?h.value=z:V==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const A=()=>{r.value=!0},M=()=>{r.value=!1};return(V,B)=>Ke((q(),je(Oo,zt(L(S),{onMouseenter:A,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:L(l),bordered:!0}),{suffix:ye(()=>[s.disabled?Ye("",!0):(q(),ue("div",{key:0,class:ae([V.$style.suffix,"wrapper-suffix"])},[r.value&&!L(u).isEmpty&&!L(u).isError?Ke((q(),je(pt,{key:0,variant:["icon","secondary"],size:24,onClick:Lt(I,["prevent","stop"])},{default:ye(()=>[me(ut,{src:"Copy",source:"remote",size:12})]),_:1})),[[L(o),{content:L(N),hideOnClick:!1,contentClass:"extra-padding"}]]):Ye("",!0)],2))]),default:ye(()=>[Ee("div",{class:ae(V.$style["metric-wrapper"]),"aria-label":L(d).format_value||void 0},[Ee("div",{class:ae([V.$style["metric-content"],s.disabled?V.$style.disabled:""])},[!L(u).isError&&L(u).isEmpty?(q(),ue(kt,{key:0},[L(u).pendingCalculation?Ke((q(),ue("span",{key:0,class:ae(V.$style["metric-empty"])},[...B[0]||(B[0]=[nt(" - ",-1)])],2)),[[L(o),"Can’t calculate yet. Complete required fields."]]):L(u).isEmpty?(q(),ue("span",{key:1,class:ae(V.$style["metric-empty"])}," - ",2)):Ye("",!0)],64)):Ye("",!0),L(u).isError?Ke((q(),ue("div",{key:1,class:ae(V.$style["metric-error"])},[...B[1]||(B[1]=[nt(" Error ",-1)])],2)),[[L(o),"Something went wrong. Review formula, inputs and retry."]]):Ye("",!0),!L(u).isEmpty&&!L(u).isError?Ke((q(),ue("span",{key:2,class:ae([V.$style["metric-value"],L(b)?V.$style.hovered:"",{[V.$style.disabled]:s.disabled}])},[nt(it(E.value),1)],2)),[[L(o),{content:g.value,bypassOverflowCheck:p.value}]]):Ye("",!0)],2)],10,Ose)]),_:1},16,["actived"])),[[L(n),{isLoading:L(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_lu0ag_1","metric-content":"_metric-content_lu0ag_5",disabled:"_disabled_lu0ag_15","metric-value":"_metric-value_lu0ag_19",hovered:"_hovered_lu0ag_19","metric-error":"_metric-error_lu0ag_23","with-morpheme":"_with-morpheme_lu0ag_38","with-formula-icon":"_with-formula-icon_lu0ag_41","metric-value--number":"_metric-value--number_lu0ag_47","metric-value--currency":"_metric-value--currency_lu0ag_47","metric-value--percentage":"_metric-value--percentage_lu0ag_47","metric-morpheme":"_metric-morpheme_lu0ag_51","metric-empty":"_metric-empty_lu0ag_64","metric-icon":"_metric-icon_lu0ag_71"}}]]),Mse={key:0,style:{color:"#6b6b6b"}},Nse=bt(tt({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue","open"],setup(e,{expose:t,emit:n}){const o=jt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},r={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},a={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},l=e,c={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=Y(()=>{var M,V;if(l.headerType)return l.headerType;if(((V=(M=l.params)==null?void 0:M.column)==null?void 0:V.getColId()).includes("metric"))return"default";const A=l.headerType??l.params.column.getColId();return c[A]||"default"}),d=$(),h=()=>{var A,M,V;const k=(M=(A=l.params)==null?void 0:A.column)==null?void 0:M.getColDef();if((V=k.colId)!=null&&V.includes("metric")){if(k.context.is_primary==1)return"primary";if(k.context.is_point_metric==1)return"secondary"}};Nh(()=>{d.value=h()}),Qt(()=>{d.value=h()});const f=Y(()=>{var k,A;return((A=(k=l.params)==null?void 0:k.column.getColDef().context)==null?void 0:A.morpheme_value)||void 0}),p=Y(()=>{var k;return(k=l.params)==null?void 0:k.displayName}),g=Y(()=>{let k=[];switch(u.value){case"dateRange":k=Object.values(s).map(A=>({...A,selected:C.value===A.value,type:"text",hover:R.value===A.value}));break;case"date":k=Object.values(r).map(A=>({...A,selected:C.value===A.value,type:"text",hover:R.value===A.value}));break;case"number":k=Object.values(i).map(A=>({...A,selected:C.value===A.value,type:"text",hover:R.value===A.value}));break;default:k=Object.values(a).map(A=>({...A,selected:C.value===A.value,type:"text",hover:R.value===A.value}));break}return C.value!=="none"&&k.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:R.value=="none"}),k}),v=Y(()=>String(C.value).endsWith("asc")?"SortUp":String(C.value).endsWith("desc")?"SortDown":"Sort"),C=$(l.modelValue??"none"),S=k=>{if(I.value){I.value=!1;return}_("update:modelValue",k),_("sort-changed",k)},b=k=>{C.value=k},y=mr(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let k;C.value==="none"?k="asc":C.value==="asc"?k="desc":k="none",C.value=k}else{const k=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],M=(k.indexOf(C.value)+1)%k.length;C.value=k[M]}},bi),E=Y(()=>{if(C.value==="none")return"No sorting applied";const k=g.value.find(A=>A.value===C.value);return(k==null?void 0:k.label)||""}),_=n,x=Y(()=>{if(l.disabled&&!l.readOnly)return"var(--disabled-color)";if(C.value!=="none")return"var(--primary-color-hover)"});Qe(()=>l.modelValue,k=>{k!=C.value&&(C.value=k)}),Qe(C,k=>{k!==l.modelValue&&S(k)});const R=$(C.value);Qe(()=>C.value,k=>{R.value=k});const P=k=>{var B,z;if(l.readOnly||l.disabled)return;let A=0;k.key==="ArrowDown"?A=1:k.key==="ArrowUp"&&(A=-1);const M=g.value.findIndex(ne=>ne.value===R.value),V=g.value.length;if(k.key==="Enter"||k.key===" ")k.preventDefault(),C.value=R.value,(B=N.value)==null||B.hide();else if(A!==0){k.preventDefault();let ne=(M+A+V)%V;R.value=g.value[ne].value}else k.key==="Escape"&&((z=N.value)==null||z.hide())},N=$(null);Qt(()=>{var k,A;(A=(k=N.value)==null?void 0:k.$el)==null||A.addEventListener("keydown",P)}),ec(()=>{var k,A;(A=(k=N.value)==null?void 0:k.$el)==null||A.removeEventListener("keydown",P)});const I=$(!1);return t({setDefaultSort:k=>{C.value=k?k.direction:"none",I.value=!0},clear:()=>{C.value="none"}}),(k,A)=>(q(),je(o0,{ref_key:"dropdownRef",ref:N,options:g.value,label:p.value,readOnly:l.readOnly,onOpen:A[0]||(A[0]=M=>k.$emit("open")),disabled:l.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:L(y),onSelect:A[1]||(A[1]=M=>b(M))},{prefix:ye(()=>[me(pt,{variant:["text"],onClick:L(y),size:"small"},{default:ye(()=>[Ke((q(),ue("b",null,[nt(it(p.value),1)])),[[L(o),{content:p.value}]]),f.value?(q(),ue("small",Mse," ("+it(f.value)+") ",1)):Ye("",!0),d.value=="primary"?Ke((q(),ue("div",{key:1,class:ae(k.$style["icon-metric"])},[me(ut,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[L(o),"Woohoo metric"]]):Ye("",!0),d.value=="secondary"?Ke((q(),ue("div",{key:2,class:ae(k.$style["icon-metric"])},[me(ut,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[L(o),"Point Metric"]]):Ye("",!0)]),_:1},8,["onClick"])]),iconDropdown:ye(()=>[Ke(me(ut,{src:v.value,source:"remote",color:x.value},null,8,["src","color"]),[[L(o),E.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),Lse=["disabled","readonly","checked","indeterminate"],LN=bt(tt({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=jt,o=Po,s=e,r=t,i=Y(()=>{if(typeof s.size=="string"){if(["small","medium","large"].includes(s.size))switch(s.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(s.size.endsWith("px"))return s.size}return typeof s.size=="number"?`${s.size}px`:"20px"}),a=Y(()=>s.allowIndeterminate?[Ft.UNCHECK,Ft.INDETERMINATE,Ft.CHECKED]:[Ft.UNCHECK,Ft.CHECKED]),l=Y(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(u.value){case Ft.UNCHECK:return s.tooltipText.unchecked;case Ft.INDETERMINATE:return s.tooltipText.indeterminate;case Ft.CHECKED:return s.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=$(typeof s.modelValue=="boolean"?s.modelValue?Ft.CHECKED:Ft.UNCHECK:s.modelValue),d=Y(()=>({checked:u.value===Ft.CHECKED,indeterminate:u.value===Ft.INDETERMINATE,none:u.value===Ft.UNCHECK})),h=Y(()=>s.disabled||s.readOnly);return Qe(()=>u.value,f=>{r("update:modelValue",f===Ft.CHECKED)}),(f,p)=>Ke((q(),ue("input",{disabled:s.disabled,key:u.value,readonly:s.readOnly,type:"checkbox",class:ae([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:hn({"--input-size":i.value})},null,46,Lse)),[[L(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[L(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),Vse=bt(tt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=jt,o=Bf(),{setSelectionStatus:s}=o,{rowCount:r,selectionStatus:i}=ts(o),a=$(new Set);Qe(i,y=>{s(y)},{immediate:!0});const l=Y(()=>i.value!==Ft.UNCHECK),c=Y(()=>({checked:i.value===Ft.CHECKED,indeterminate:i.value===Ft.INDETERMINATE,UNCHECK:i.value===Ft.UNCHECK})),u=Y(()=>({[Ft.UNCHECK]:"Click to select all",[Ft.INDETERMINATE]:"Click to clear selection",[Ft.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=Y(()=>{const y=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&y.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),y}),h=y=>({selected:y.getSelectedRows().length,total:r.value.total,loaded:r.value.loaded}),f=({api:y,state:E})=>{if(y)if(E===Ft.UNCHECK)y.deselectAll(),a.value.clear(),i.value=E;else if(E===Ft.CHECKED){const _=new Set;y.forEachNode(x=>{x.isSelected()&&_.add(x.id||"")}),a.value=_,y.forEachNode(x=>x.setSelected(!0)),i.value=E}else y.forEachNode(_=>_.setSelected(!0)),i.value=E},p=()=>{var _;const y=(_=t.params)==null?void 0:_.api;if(!y){console.error("[HeaderCheckbox] There is no API available");return}const E={[Ft.UNCHECK]:Ft.INDETERMINATE,[Ft.INDETERMINATE]:Ft.UNCHECK,[Ft.CHECKED]:Ft.UNCHECK};f({api:y,state:E[i.value]})},g=y=>{var x;const E=(x=t.params)==null?void 0:x.api;if(!E){console.error("no api");return}const _={INDETERMINATE:Ft.INDETERMINATE,GLOBAL:Ft.CHECKED,UNCHECK:Ft.UNCHECK};f({api:E,state:_[y]})},v=mr(y=>{const{selected:E,total:_}=h(y);if(_==0){i.value=Ft.UNCHECK;return}E===_?i.value=Ft.CHECKED:E===0?i.value=Ft.UNCHECK:i.value=Ft.INDETERMINATE},300);let C=[];const S=y=>{v(y)};Qt(()=>{var R;const y=(R=t.params)==null?void 0:R.api;if(!y)return;const E=P=>v(P.api),_=()=>S(y),x=()=>S(y);y.addEventListener("selectionChanged",E),y.addEventListener("rowDataUpdated",_),y.addEventListener("modelUpdated",_),C=[()=>y.removeEventListener("selectionChanged",E),()=>y.removeEventListener("rowDataUpdated",_),()=>y.removeEventListener("modelUpdated",x)]}),zn(()=>{C.forEach(y=>y())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(y,E)=>(q(),je(o0,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ye(()=>[Ke((q(),je(LN,{"tab-index":"8",id:b,disabled:t.disabled,key:L(i),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:L(i),"onUpdate:modelValue":E[0]||(E[0]=_=>vn(i)?i.value=_:null),onChange:p,"aria-label":L(i)===L(Ft).CHECKED?"All items selected":"Select visible items",class:ae(y.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[L(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_4qktt_1","button-group":"_button-group_4qktt_62","button-main":"_button-main_4qktt_62",headerCheckbox:"_headerCheckbox_4qktt_66"}}]]),VN=bt(tt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Ns,n=jt,o=e,{isEditing:s}=sd(o),r=$(null),i=$(null),a=Y(()=>o.value),l=Y(()=>a.value===void 0),c=Y(()=>{var g,v;return((g=a.value)==null?void 0:g.name)||((v=a.value)==null?void 0:v.label)||"No status"}),u=Y(()=>{var g;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:T9((g=a.value)==null?void 0:g.label),inputRef:r,wrapperRef:i,clickable:!o.disabled&&!o.readOnly,active:s}}),{argsMain:d,isHover:h}=To(u),f=Y(()=>{var g;return((g=a.value)==null?void 0:g.color)||"#fff"}),p=Y(()=>new On(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((q(),je(L(Oo),zt(L(d),{ref_key:"wrapperRef",ref:i,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!L(s)&&!L(h)||!a.value?"#f3f5f8":void 0}}),{default:ye(()=>[l.value?Ye("",!0):(q(),ue("div",{key:0,class:ae({[g.$style["status-renderer"]]:!0,[g.$style["has-status"]]:a.value,[g.$style["has-suffix"]]:!!g.$slots.suffix})},[a.value?(q(),ue(kt,{key:0},[Ke((q(),ue("div",{class:ae(g.$style["status-renderer__status-name"])},[nt(it(c.value),1)],2)),[[L(n),{content:c.value,delay:[1e3,0]}]]),xt(g.$slots,"suffix")],64)):(q(),ue(kt,{key:1},[Ee("div",{class:ae(g.$style["status-renderer__color-code"])},null,2),v[0]||(v[0]=Ee("span",{style:{color:"#a6a6a6"}},"No status",-1)),xt(g.$slots,"suffix")],64))],2))]),_:3},16,["style"])),[[L(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_k5c36_1","has-status":"_has-status_k5c36_9","has-suffix":"_has-suffix_k5c36_12","status-renderer__color-code":"_status-renderer__color-code_k5c36_22","status-renderer__status-name":"_status-renderer__status-name_k5c36_33"}}]]),BN=bt(tt({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},minWidth:{default:"300px"},popupIndex:{default:109},showCloseBtn:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,s=Y(()=>Number(o.popupIndex)),{popupRef:r,show:i,hide:a,isVisible:l}=zY({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(d){return document.body},zIndex:s.value}),c=d=>{o.closeOnEscape&&d.key==="Escape"&&l.value&&a()};Qt(()=>{document.addEventListener("keydown",c)}),zn(()=>{document.removeEventListener("keydown",c)}),t({show:i,hide:a,isVisible:l});const u=n;return Qe(()=>l.value,d=>{u(d?"shown":"hidden")}),(d,h)=>{const f=Lh("tooltip");return q(),ue("div",{ref_key:"popupRef",ref:r,class:ae(d.$style.popupContainer)},[Ee("div",{class:ae(d.$style.popupWrapper)},[Ee("div",{class:ae(d.$style.header)},[xt(d.$slots,"header",{},()=>[Ee("span",{class:ae(d.$style["header-title"])},it(e.popupName),3)]),o.showCloseBtn?Ke((q(),je(pt,{key:0,variant:["icon","text"],onClick:L(a),"aria-label":"Close popup",size:"small"},{default:ye(()=>[me(ut,{src:"Xmark",size:8})]),_:1},8,["onClick"])),[[f,"Close"]]):Ye("",!0)],2),Ee("div",{class:ae(d.$style.body)},[xt(d.$slots,"default")],2),d.$slots.footer?(q(),ue("div",{key:0,class:ae(d.$style.footer)},[xt(d.$slots,"footer")],2)):Ye("",!0)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1986t_1",popupWrapper:"_popupWrapper_1986t_9",popupFadeIn:"_popupFadeIn_1986t_1",header:"_header_1986t_24","header-title":"_header-title_1986t_34",body:"_body_1986t_43",footer:"_footer_1986t_48"}}]]),Bse=["onMouseenter","onMouseleave"],$se=["innerHTML"],Hse=["innerHTML"],Gse=["data-tooltip"],Use={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},Wse=bt(tt({__name:"Snackbar",setup(e){const t=jt,n=R3,o=Ss(),{removeNotification:s}=o,{notifications:r}=ts(o),i=f=>f.trim().startsWith("<svg"),a=$("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=$(new Set),d=f=>{var p;u.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;u.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(q(),je(r3,{name:"list",tag:"div",class:ae(["notification-center",f.$style["notification-wrapper"]])},{default:ye(()=>[(q(!0),ue(kt,null,An(L(r),g=>{var v;return Ke((q(),ue("div",{key:g.id,class:ae([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:C=>d(g.id),onMouseleave:C=>h(g.id)},[Ee("p",{class:ae(f.$style.snackbar__message)},[g.type!="white"?(q(),ue("span",{key:0,class:ae(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(q(),je(ut,{key:0,src:"CircleCheck",source:"remote"})):Ye("",!0),!g.icon&&g.type=="interactive"?(q(),je(ut,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(q(),je(ut,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(q(),ue("i",{key:3,class:ae(f.$style["icon-draw"]),innerHTML:g.icon},null,10,$se)):g.icon&&!i(g.icon)?(q(),je(ut,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)],2)):Ye("",!0),Ee("span",{class:ae(f.$style["error-message"])},[Ee("span",{class:ae(f.$style.message),innerHTML:g.message},null,10,Hse)],2)],2),g.actions?(q(),ue("div",{key:0,class:ae(f.$style["actions-notification"]),"data-notification":"true"},[(q(!0),ue(kt,null,An(g.actions,C=>(q(),je(pt,zt({key:C.label},{ref_for:!0},C,{onClick:Lt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ye(()=>[C.btnIcon?(q(),je(ut,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)]),_:2},1040,["onClick"]))),128))],2)):Ye("",!0),g.type!=="interactive"&&g.type!=="white"?Ke((q(),ue("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[me(pt,{variant:"secondary",onClick:C=>c(g.message),class:ae(f.$style["copy-btn"])},{prefix:ye(()=>[me(ut,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,Gse)),[[L(t),a.value]]):Ye("",!0),g.type=="interactive"?Ke((q(),ue("div",Use,[me(pt,{variant:"tertiary",onClick:C=>L(s)(g.id),class:ae(f.$style["close-btn"]),size:18},{default:ye(()=>[me(ut,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[L(t),"Close"]]):Ye("",!0)],42,Bse)),[[L(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_1gnza_1","notification-item":"_notification-item_1gnza_15","notification--success":"_notification--success_1gnza_30","notification--error":"_notification--error_1gnza_36","close-btn":"_close-btn_1gnza_42","notification--info":"_notification--info_1gnza_45","notification--warning":"_notification--warning_1gnza_52","notification--interactive":"_notification--interactive_1gnza_59","notification--white":"_notification--white_1gnza_67","snackbar-type":"_snackbar-type_1gnza_75",snackbar__message:"_snackbar__message_1gnza_84",message:"_message_1gnza_97","error-message":"_error-message_1gnza_105",snackbar__icon:"_snackbar__icon_1gnza_111","actions-notification":"_actions-notification_1gnza_120","icon-draw":"_icon-draw_1gnza_128","copy-btn":"_copy-btn_1gnza_136"}}]]);/*!
|
|
160
160
|
* vue-draggable-next v2.3.0
|
|
161
161
|
* (c) 2025 Anish George
|
|
162
162
|
* @license MIT
|
|
@@ -253,4 +253,4 @@ If you are trying to annotate ${o} with application data, use the '${o}.context'
|
|
|
253
253
|
`,s_e=class extends Fbe{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,fG),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=fG),this.isFirstLine=!1}},r_e=class extends kbe{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Ot(this.gos,{})):t.fileName;Obe(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new s_e({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function i_e(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function a_e(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var l_e={moduleName:"CsvExport",version:dt,beans:[r_e],apiFunctions:{getDataAsCsv:i_e,exportDataAsCsv:a_e},dependsOn:[o_e]},c_e=class extends qe{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new Ol(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Gn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Ot(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new Ol(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},u_e=2,d_e=class extends qe{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new c_e(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()&&(xl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=u_e-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ft(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},h_e=class extends qe{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 Ol(e);this.rootNode=t,t.level=-1,this.rowHeight=Kc(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=Kc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Tp(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;Hd(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:Kc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new d_e(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function f_e(e){var t;(t=Aw(e))==null||t.refreshCache()}function p_e(e){var t;(t=Aw(e))==null||t.purgeCache()}function g_e(e){var t;return(t=Aw(e))==null?void 0:t.getRowCount()}var m_e=class extends qe{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=rde(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=qo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){ti(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){xl(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){xl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},v_e={moduleName:"InfiniteRowModelCore",version:dt,rowModels:["infinite"],beans:[h_e,m_e]},y_e={moduleName:"InfiniteRowModel",version:dt,apiFunctions:{refreshInfiniteCache:f_e,purgeInfiniteCache:p_e,getInfiniteRowCount:g_e},dependsOn:[v_e,P0e]},w_e="↑",C_e="↓",b_e={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},S_e=class extends bn{constructor(){super(b_e),this.eValue=ht,this.eDelta=ht,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=w_e+s:i.textContent=C_e+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Ko(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:Ko(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},E_e=".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}",__e={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},R_e=class extends bn{constructor(){super(__e),this.eCurrent=ht,this.refreshCount=0,this.registerCSS(E_e)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=uo({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Gn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:Ko(o),!0}},T_e=class extends qe{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Rme(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 D_e(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var x_e={moduleName:"HighlightChanges",version:dt,beans:[T_e],userComponents:{agAnimateShowChangeCellRenderer:S_e,agAnimateSlideCellRenderer:R_e},apiFunctions:{flashCells:D_e}};function I_e(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function A_e(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function pG(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=P_e(e)),e.version=dt,e}function P_e(e){return e.cellSelection=k_e(e,"rangeSelection"),e}function k_e(e,t){if(e&&typeof e=="object")return e[t]}var F_e=class extends qe{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=qo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=qo(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=qo(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=lo(e);const o=pG(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=pG(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Ibe(Qy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(I,k)=>{const A=!(o!=null&&o.has(I))&&!!(k||t==="api");return h||(h=A),A},p={},g=I=>{let k=p[I];return k||(k={colId:I},p[I]=k,k)},v={},C=f("sort",s);C&&(s==null||s.sortModel.forEach(({colId:I,sort:k},A)=>{const M=g(I);M.sort=k,M.sortIndex=A})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((I,k)=>{const A=g(I);A.rowGroup=!0,A.rowGroupIndex=k})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:I,aggFunc:k})=>{g(I).aggFunc=k})),(b||!n)&&(v.aggFunc=null);const y=f("pivot",a);y&&(a==null||a.pivotColIds.forEach((I,k)=>{const A=g(I);A.pivot=!0,A.pivotIndex=k}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(y||!n)&&(v.pivot=null,v.pivotIndex=null);const E=f("columnPinning",l);if(E){for(const I of(l==null?void 0:l.leftColIds)??[])g(I).pinned="left";for(const I of(l==null?void 0:l.rightColIds)??[])g(I).pinned="right"}(E||!n)&&(v.pinned=null);const _=f("columnVisibility",c);if(_)for(const I of(c==null?void 0:c.hiddenColIds)??[])g(I).hide=!0;(_||!n)&&(v.hide=null);const x=f("columnSizing",u);if(x)for(const{colId:I,flex:k,width:A}of(u==null?void 0:u.columnSizingModel)??[]){const M=g(I);M.flex=k??null,M.width=A}(x||!n)&&(v.flex=null);const R=d==null?void 0:d.orderedColIds,P=!!(R!=null&&R.length)&&!(o!=null&&o.has("columnOrder")),N=P?R.map(I=>g(I)):Object.values(p);(N.length||h)&&(this.columnStates=N,ni(this.beans,{state:N,applyOrder:P,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);ni(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Abe(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!Ra(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Tp(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Tp(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")}},O_e={moduleName:"GridState",version:dt,beans:[F_e],apiFunctions:{getState:I_e,setState:A_e}};function M_e(e){return e.rowModel.isLastRowIndexKnown()}function N_e(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function L_e(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function V_e(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function B_e(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function $_e(e){var t;(t=e.pagination)==null||t.goToNextPage()}function H_e(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function G_e(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function U_e(e){var t;(t=e.pagination)==null||t.goToLastPage()}function W_e(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var z_e=class extends qe{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(Kc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?qo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},lg="paginationPageSizeSelector",j_e={tag:"span",cls:"ag-paging-page-size"},K_e=class extends bn{constructor(){super(j_e),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(lg,()=>{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(){Ko(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(lg)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(lg)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:lg}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(Pl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new z_).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(lg);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},q_e={selector:"AG-PAGE-SIZE-SELECTOR",component:K_e},Y_e=".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}",X_e=class extends R${constructor(){super(),this.btFirst=ht,this.btPrevious=ht,this.btNext=ht,this.btLast=ht,this.lbRecordCount=ht,this.lbFirstRowOnPage=ht,this.lbLastRowOnPage=ht,this.lbCurrent=ht,this.lbTotal=ht,this.pageSizeComp=ht,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(Y_e)}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(),[q_e]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",Ir(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",Ir(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",Ir(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",Ir(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):zpe(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Ve.ENTER||o.key===Ve.SPACE)&&(o.preventDefault(),n())}})}Wpe(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}):Pbe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){iue(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(o);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(u,d,C,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},Z_e={selector:"AG-PAGINATION",component:X_e},J_e=class extends qe{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 Z_e}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},Q_e={moduleName:"Pagination",version:dt,beans:[J_e,z_e],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:M_e,paginationGetPageSize:N_e,paginationGetCurrentPage:L_e,paginationGetTotalPages:V_e,paginationGetRowCount:B_e,paginationGoToNextPage:$_e,paginationGoToPreviousPage:H_e,paginationGoToFirstPage:G_e,paginationGoToLastPage:U_e,paginationGoToPage:W_e},dependsOn:[Pw]};function eRe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function gG(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&gG(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function tRe(e,t){return e.rowModel.getRowNode(t)}function nRe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function oRe(e){return e.rowRenderer.getRenderedNodes()}function sRe(e,t,n){e.rowModel.forEachNode(t,n)}function rRe(e){return e.rowRenderer.firstRenderedRow}function iRe(e){return e.rowRenderer.lastRenderedRow}function aRe(e,t){return e.rowModel.getRow(t)}function lRe(e){return e.rowModel.getRowCount()}var cRe={moduleName:"RowApi",version:dt,apiFunctions:{redrawRows:eRe,setRowNodeExpanded:gG,getRowNode:tRe,addRenderedRowListener:nRe,getRenderedNodes:oRe,forEachNode:sRe,getFirstDisplayedRowIndex:rRe,getLastDisplayedRowIndex:iRe,getDisplayedRowAtIndex:aRe,getDisplayedRowCount:lRe}},uRe={moduleName:"ScrollApi",version:dt,apiFunctions:{getVerticalPixelRange:EEe,getHorizontalPixelRange:_Ee,ensureColumnVisible:XH,ensureIndexVisible:ZH,ensureNodeVisible:REe}};function dRe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function hRe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function fRe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function pRe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function gRe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function mRe(e){return{rowHeight:Kc(e),headerHeight:Yp(e)}}function vRe(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(jp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=GR(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!UR(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(jp(c))}}return[...o,...n]}var yRe={moduleName:"RenderApi",version:dt,apiFunctions:{setGridAriaProperty:dRe,refreshCells:hRe,refreshHeader:fRe,isAnimationFrameQueueEmpty:pRe,flushAllAnimationFrames:gRe,getSizesForCurrentTheme:mRe,getCellRendererInstances:vRe}};function wRe(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function mG({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function CRe(e,t){var n;t&&typeof t=="object"?mG(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var bRe=class extends qe{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&lo(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Wd(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=vG(this.beans),i=u=>n.leftCols.some(d=>Up(d,u)),a=u=>n.rightCols.some(d=>Up(d,u)),l=e.colKeys.filter(u=>!Da(u)&&!xa(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let C=-1;const S=Object.fromEntries(c.map(({colId:E,..._})=>[E,_])),b=s??this.gos.get("skipHeaderOnAutoSize"),y=r??b;for(;C!==0;){C=0;const E=[];for(const _ of o){if(!_||yde(_))continue;const x=f.getCol(_);if(!x||v.has(x))continue;const R=p.getPreferredWidthForColumn(x,b);if(R>0){const P=S[x.colId]??{};P.minWidth??(P.minWidth=l),P.maxWidth??(P.maxWidth=a);const N=SRe(x,R,P);x.setActualWidth(N,u),v.add(x),C++}E.push(x)}E.length&&g.refresh(u)}y||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new ou(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=vG(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...C}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=Ta(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[C.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),y=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),E=C.getActualWidth();return(b==null||E>=b)&&(y==null||E<=y)}))return;const l=[],c=[];for(const v of r){const C=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>Up(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{ti(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const C=s==null?void 0:s[v.getId()],S=(C==null?void 0:C.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(o==null?void 0:o.defaultMaxWidth),y=v.getActualWidth();typeof S=="number"&&y<S?v.setActualWidth(S,t,!0):typeof b=="number"&&y>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-Ta(c);if(v<=0)for(const C of l){const S=((g=s==null?void 0:s[C.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/Ta(l);let S=v;for(let b=l.length-1;b>=0;b--){const y=l[b],E=s==null?void 0:s[y.getId()],_=(E==null?void 0:E.minWidth)??(o==null?void 0:o.defaultMinWidth),x=(E==null?void 0:E.maxWidth)??(o==null?void 0:o.defaultMaxWidth),R=y.getMinWidth(),P=y.getMaxWidth(),N=typeof _=="number"&&_>R?_:R,I=typeof x=="number"&&x<P?x:P;let k=Math.round(y.getActualWidth()*C);k<N?(k=N,h(y),d=!1):k>I?(k=I,h(y),d=!1):b===0&&(k=S),y.setActualWidth(k,t,!0),S-=k}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Wd(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function SRe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function vG({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Pp(n.eGridBody)-s}var ERe={moduleName:"ColumnAutoSize",version:dt,beans:[bRe],apiFunctions:{sizeColumnsToFit:wRe,autoSizeColumns:mG,autoSizeAllColumns:CRe},dependsOn:[G$]},_Re=".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 RRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function TRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function DRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function xRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function IRe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var ARe={moduleName:"PinnedRow",version:dt,beans:[Dge],css:[_Re],apiFunctions:{getPinnedTopRowCount:RRe,getPinnedBottomRowCount:TRe,getPinnedTopRow:DRe,getPinnedBottomRow:xRe,forEachPinnedRow:IRe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},PRe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},kRe=class extends qe{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(y,E)=>{p=y,g=null,v=E},S=y=>{const E=!y.isExpandable()&&!y.group&&!y.detail&&(u?!u({rowNode:y}):!0);if(y.rowIndex==null||!E){C(null,null);return}if(p==null||y.level!==p.level||y.footer||g&&y.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(y,r.getValue(t,y));return}const _=r.getValue(t,y);if(f){const x=Ot(n,{valueA:v,nodeA:p,valueB:_,nodeB:y,column:t,colDef:a});if(!h(x)){C(y,_);return}}else if(d?!d(v,_):v!==_){C(y,_);return}if(!g){const x=l==null?void 0:l.get(p);(x==null?void 0:x.firstNode)===p?(x.reset(),g=x):g=new PRe(t,p),c.set(p,g)}g.addSpannedNode(y),c.set(y,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,y=>{(!i||i.isRowInPage(y.rowIndex))&&S(y)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},FRe=class extends qe{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=qo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=qo(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 kRe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},ORe=class extends nh{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Fy(e,t.rowIndex)}setAriaRowSpan(){due(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(ww(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}},MRe=class extends Iw{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new ORe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},NRe=class extends qe{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new MRe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},LRe={moduleName:"CellSpan",version:dt,beans:[FRe,NRe]},VRe=class extends qe{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);$R(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Ot(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},BRe=class extends qe{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){$R(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new VRe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},$Re={moduleName:"CellStyle",version:dt,beans:[BRe]},HRe={moduleName:"RowStyle",version:dt,beans:[DCe]};function GRe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var URe=class extends qe{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},WRe="ag-column-hover",zRe=class extends qe{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(WRe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new URe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},jRe={moduleName:"ColumnHover",version:dt,beans:[zRe],apiFunctions:{isColumnHovered:GRe}},KRe=class extends qe{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!Tw.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{Tw.has(i)&&t(i,a)},o=(i,a)=>{Tw.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function qRe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function YRe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function XRe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function ZRe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var JRe={moduleName:"EventApi",version:dt,apiFunctions:{addEventListener:qRe,addGlobalListener:XRe,removeEventListener:YRe,removeGlobalListener:ZRe},beans:[KRe]},QRe={moduleName:"Locale",version:dt,beans:[xbe]},eTe=class extends qe{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=qo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=Il(this.beans,d).height;for(const g of s){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=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=zc(o),g=d+h+f+p,C=t.offsetHeight+g;if(u<5){const b=Vo(i),y=!(b!=null&&b.contains(t)),E=C==0;if(y||E){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,C,r)},l=()=>a(0);l();const c=Tl(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},tTe={moduleName:"RowAutoHeight",version:dt,beans:[eTe]},nTe={moduleName:"AllCommunity",version:dt,dependsOn:[hG,l_e,y_e,jbe,n0e,o0e,s0e,r0e,i0e,a0e,l0e,t0e,qSe,YSe,XSe,KSe,JSe,QSe,O_e,F0e,Q_e,j$,cRe,uRe,yRe,ERe,Hme,ARe,E0e,cbe,$Re,jRe,HRe,JRe,hbe,x_e,KH,QRe,tTe,$me,t_e,LRe]};let yG=!1;yG||(que.registerModules([nTe,hG]),yG=!0);class oTe{constructor(t,n){Rn(this,"gridApi",null);Rn(this,"container");Rn(this,"config");Rn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=_be(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const sTe=J$.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"),rTe=tt({__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","on-scroll"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(null);yE(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=$(null),a=Y(()=>({width:"100%",height:o.height||"500px"})),l=Y(()=>({...o,theme:sTe}));function c(){var v;if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new oTe(r.value,g),i.value.init(),(v=i.value.getApi())==null||v.addEventListener("bodyScroll",()=>{s("on-scroll",new Event("scroll"))}),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("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,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return Qe(()=>o.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}),zn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Qt(()=>{c()}),zn(()=>{h()}),(g,v)=>(q(),ue("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:ae(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function au(e){return XV(e)}const iTe=()=>[...[{headerName:"Thumbnail",field:"thumbnail",sortable:!1,filter:!1,pinned:"left",lockPinned:!0,suppressMovable:!0,headerComponent:au(Cl),width:86,resizable:!1},{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",lockPinned:!0,headerComponent:au(Cl),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:au(Cl)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:au(Cl)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:au(Cl)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:au(Cl),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:au(Cl),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>Rp.fromType(n))],Lw={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},aTe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Lw.WIDTH,minWidth:Lw.WIDTH,maxWidth:Lw.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Lw.HEADER_CLASS,headerComponent:ky(Vse),suppressMovable:!0}),wG="blank",lTe=[wG,"__checkboxSelection","options"],cTe=["uiColumnResized","uiColumnMoved","api"],uTe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},CG=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,dTe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=uf({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=$([]),a=aTe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=new Map(f==null?void 0:f.map(A=>[A.field,A])),g=iTe(),v=Rp.fromType(uTe),C=!!f,b=((d==null?void 0:d.map(A=>{var M;return{headerName:A.name,field:`metric_${A.id}`,editable:((M=A==null?void 0:A.auth_permission)==null?void 0:M.permission)==2,sortable:!0,filter:!1,flex:1,context:{...A},hide:C?!p.has(`metric_${A.id}`):!(A.is_primary||A.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:ky(Cl),headerComponentParams:()=>({headerType:A.metric_type.code=="number"||A.metric_type.code=="formula"?"number":"default"})}}))||[]).map(A=>Rp.fromType(A)),y=[a,...g,...b,v],E=[],_=[],x=[];for(const A of y)A.pinned==="left"?E.push(A):A.pinned==="right"||A.field===wG?_.push(A):x.push(A);if(!f||f.length===0){i.value=y;return}const R=new Map(x.map(A=>[A.field,A])),P=[];for(const A of f)if(A.field&&R.has(A.field)){const M=R.get(A.field);P.push({...CG(M,A),hide:A.hide}),R.delete(A.field)}const N=Array.from(R.values()),I=[...P,...N].map(A=>({...A,lockPinned:!0})),k=A=>{const M=p.get(A.field),V=CG(A,M);return M&&M.hide!==void 0?{...V,hide:M.hide}:V};i.value=[...E.map(k),...I,..._.map(k)]};Qe(e,d=>c(d),{immediate:!0});const u=mr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!cTe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(C=>{C.width&&g.set(C.colId,Number(C.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(C=>C.field&&!lTe.includes(C.field)).map(C=>({field:C.field,hide:C.hide,width:g.get(C.field)||C.width,pinned:C.pinned}));s(t,JSON.stringify(v))},bi);return qT(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},hTe=()=>{const e=ln.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},fTe=e=>{var k,A,M;const{showMessage:t,showErrorNetMessage:n}=Ss(),o=ro(),s={domainApi:hTe(),wsCode:ln.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(M=(A=(k=o==null?void 0:o.appContext)==null?void 0:k.config)==null?void 0:A.globalProperties)==null?void 0:M.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new DN(r,s);i.on("call-api",V=>{V.success?t(V.apiCode,"success"):n(V)});const a=Uo({}),l=$([]),c=$(!1),u=$(null),d=$(null),h=$(1),f=$(20);let p=Promise.resolve();const{setCachedUsers:g}=GY(),v=V=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:V}),C=50,S=async(V,B,z)=>{if(!V.length)return[];const ne=nK(V,B);return(await Promise.all(ne.map(z))).flat()},b=async V=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:V})).data.map(z=>[z==null?void 0:z.id,z.permission])}catch(B){return console.error("Failed to fetch item permissions chunk:",B),[]}},y=async(V,B)=>{try{const z=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:V,per_page:V.length*B.length,metric_ids:B}),ne=z.data.map(ee=>{const X=new Map(ee.item_metrics.map(U=>[U.metric_id,{value:U.value,auth_permission:U==null?void 0:U.auth_permission}])),D=Object.fromEntries(B.map(U=>[U,X.get(U)??null]));return[ee==null?void 0:ee.id,D]}),re=new Set(z.data.map(ee=>ee==null?void 0:ee.id));for(const ee of V)if(!re.has(ee)){const X=Object.fromEntries(B.map(D=>[D,{value:null,auth_permission:void 0}]));ne.push([ee,X])}return ne}catch(z){return console.error("Failed to fetch a chunk of metric values:",z),V.map(re=>[re,Object.fromEntries(B.map(ee=>[ee,void 0]))])}},E=async V=>{try{const B=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:V,per_page:V.length}),z=B.data.flatMap(ne=>ne.assignees);return g(z),B.data.map(ne=>[ne==null?void 0:ne.id,ne==null?void 0:ne.assignees])}catch(B){return console.error("Failed to fetch a chunk of assigned users:",B),[]}},_=async V=>{if(!V.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const B=await S(V,C,b);return Object.fromEntries(B)}catch(B){return console.error("Failed to fetch item permissions:",B),{}}},x=async(V,B)=>!V.length||!B.length?{}:(p=p.then(async()=>{try{const re=[];let ee=0;for(let D=0;D<B.length;D+=5){ee++;const U=B.slice(D,D+5),K=[];for(let we=0;we<U.length;we++){const Ae=U[we],ce=await S(V,C,G=>y(G,[Ae]));K.push(ce),await new Promise(G=>setTimeout(G,500))}re.push(...K);const ie=D+5>=B.length}const X={};for(const D of re.flat()){const[U,K]=D;X[U]||(X[U]={}),Object.assign(X[U],K)}return X}catch(z){return console.error("Failed to fetch metric values:",z),{}}}),p),R=async V=>{if(!V.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const B=await S(V,C,E);return Object.fromEntries(B)}catch(B){return console.error("Failed to fetch assigned users:",B),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async V=>{const{cursor:B,offset:z,size:ne,searchQuery:re}=V;let ee=[];c.value=!0,u.value=null;try{const X=await i.getAllItem_cursor({...V,cursor:B||void 0,offset:z||void 0,pageSize:ne||f.value,...v(re),sortBy:V.sort_by});return l.value=X.data,d.value=X.meta,h.value=X.meta.current_page||0,ee=X.data.map(D=>D==null?void 0:D.id),X}catch(X){throw u.value=X,console.error("Failed to fetch items (cursor):",X),X}finally{const X=async()=>{try{const[D,U]=await Promise.all([R(ee),_(ee)]);e.value.updateItemData({assignees:D,permission:U},ee);const K=await x(ee,e.value.metricIds);e.value.setMetricValues(K,new Set(ee),e.value.metricIds)}catch(D){console.error("Post-fetch processing failed:",D)}};c.value=!1,setTimeout(X)}},getAssignableStatus:async V=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:V})}catch(B){throw console.error("Failed to fetch assignable status:",B),B}},getMetricList:async V=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:V})}catch(B){throw console.error("Failed to fetch metric list:",B),B}},getMetricValues:x,getAssignedUsers:R}};function pTe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=IY((o.assignees[c]||[]).map(pk));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function gTe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function mTe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=$(!0),a=$(!0),l=$(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=gTe(r,e.perPage,()=>o.value,y=>{i.value=y},y=>{a.value=y});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=s.value)==null||C.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=mr(v=>{d(v)},bi);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:()=>{s.value},isSelectAll:$(!1)}}const vTe={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."]}}},yTe=e=>{var t;return(t=Object.entries(vTe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},wTe={class:"visual-btn-visual"},CTe={class:"visual-btn--label"},bTe={key:0,class:"visual-btn--description"},STe={key:1,class:"visual-btn--description"},iT=bt(tt({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(q(),ue("div",{class:ae(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[Ee("div",wTe,[xt(r.$slots,"visual",{},()=>[i[0]||(i[0]=_z('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-c2003bd7><g clip-path="url(#clip0_4824_13082)" data-v-c2003bd7><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-c2003bd7></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-c2003bd7></path></g><defs data-v-c2003bd7><clipPath id="clip0_4824_13082" data-v-c2003bd7><rect width="41.1429" height="36" fill="white" data-v-c2003bd7></rect></clipPath></defs></svg>',1))],!0)]),Ee("div",CTe,it(n.label),1),n.disabled?(q(),ue("div",bTe," Coming soon ")):(q(),ue("div",STe,it(n.description),1))],2))}}),[["__scopeId","data-v-c2003bd7"]]),bG="xlsx_toolbox",SG="feedback_lockup_toolbox",ETe="TOOLBOX_EXPORT_DATA",_Te="https://app.arbocollab.com",RTe=1e3,EG=()=>sessionStorage.getItem("BASE_URL"),_G=(e,t="xlsx-mapping")=>{const n=Dn("switchInstance",void 0),o=`${t}:load`,s=`${t}:edit`,r=new Set;let i;const a=()=>{const h=t==="xlsx-mapping"?bG:SG,f={showLoad:!1};n?n(h,"",f):window.appManager.switchInstance(h,"",f)},l=(h,f)=>{const p=setTimeout(()=>{r.delete(p),window.postMessage({type:h,payload:f},`${EG()}`)},RTe);r.add(p)},c=h=>{if(!h)throw new Error("Payload is missing");a(),l(o,h)},u=(h,f)=>{if(!h)throw new Error("Error file is missing");a(),l(s,{file:h})},d=h=>{if((h==null?void 0:h.type)!==ETe)return;const{file:f,fileName:p}=h.payload;e({channel:t,file:new File([f],p,{type:f.type}),fileName:p});const g=t==="xlsx-mapping"?bG:SG;g=="xlsx_toolbox"&&window.appManager.hide(g)};return Qt(()=>{i=Nne({target:window,allowedOrigins:[EG()||_Te],onMessage:d,onInvalidMessage:(h,f,p)=>{console.warn("Rejected postMessage:",f,p.origin)}})}),zn(()=>{i==null||i(),r.forEach(clearTimeout),r.clear()}),{openToolbox:c,sendBackErrorFile:u}},TTe={class:"header-name"},DTe={class:"modal-body"},xTe={class:"description"},ITe={key:0,class:"error-message"},ATe={class:"dynamic"},PTe={key:1,class:"choose-method-container"},kTe={key:2,class:"select-status-container"},FTe={key:3,class:"result-container"},OTe={key:4,class:"result-container"},MTe={key:2},RG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",NTe=20,LTe=bt(tt({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=jt,s=Y(()=>[1,2].includes(f.value)),r=Y(()=>IS()),i=Y(()=>({1:{title:`Create ${r.value} in bulk`,description:""},2:{title:"Select status",description:"Choose the starting status for the new work."},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,c=n,{apiServices:u}=io(!1,l),d=1,h=$(),f=$(d),p=$(null),g=$(null),v=$(null),C=$(void 0),S=$(null),b=Y(()=>i.value[f.value]),y=$(),E=()=>{var X;p.value=null,f.value=d,g.value=null,v.value=null,_.value=null,S.value=null,(X=y.value)==null||X.clear(),C.value=void 0};Qe([g,v],([X,D])=>{f.value===1&&X&&D&&(f.value=2)});const _=$(null),x=X=>Ss().getErrorMessageFromResponse(X),R=X=>{if(console.error(X),typeof X=="string"){_.value=X;return}const D=X.response,U=D==null?void 0:D.data,K=x(U);_.value=K??X.message},P=async(X,D)=>{var K;if(ne.value=!0,!u.value||!l.workspaceId||!l.entityId){console.error("API services not available");return}const U=new FormData;U.append("file",X),U.append("format",((K=D??X.name)==null?void 0:K.split(".").pop())??X.name.split(".").pop()??""),U.append("entity_id",l.entityId),U.append("template_flow_status_id",p.value??"");try{await u.value.addNewSceneViaImportFile(l.workspaceId,l.entityId,U),f.value=3,c("import-success")}catch(ie){console.error("Error uploading file:",ie),R(ie||"An unknown error occurred during file upload."),f.value=4}finally{ne.value=!1}},{openToolbox:N,sendBackErrorFile:I}=_G(({file:X,fileName:D,channel:U})=>{U==="xlsx-mapping"&&(v.value=X,C.value=D??X.name,f.value=2)}),k=async()=>{const X=await M();try{N({template:X})}catch(D){console.error("Error opening toolbox:",D),Ss().showErrorNetMessage("Failed to open toolbox.")}},A=$(!1),M=async()=>{A.value=!0;const X=l.workspaceId,D=l.entityId;if(!X||!D||!u.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const U=await u.value.downloadTemplate(X,D,!1);if(!U)throw new Error("No response from downloadTemplate API");return U}catch(U){return console.error("Error downloading template:",U),Promise.reject(U)}finally{A.value=!1}},V=X=>{const D=RG.includes(X.type);return D||(console.error("Invalid file type:",X.type),Ss().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),D},B=async()=>{const X=document.createElement("input");X.type="file",X.accept=RG,X.onchange=async()=>{var U;const D=(U=X.files)==null?void 0:U[0];if(D){if(!V(D)){E();return}g.value=Wm(D);try{const K=await M();if(!K){Ss().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}N({source:D,template:K})}catch(K){console.error("Error opening toolbox:",K),Ss().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},X.click()},z=async X=>{var D;if(!((D=u.value)!=null&&D.getAssignableStatuses)){console.error("API services not available");return}return u.value.getAssignableStatuses(l.workspaceId,{entity_id:l.entityId,name_like:X.name_like,page:X.page,per_page:NTe})},ne=$(!1),re=()=>{p.value=null,v.value&&C.value&&I(v.value,C.value)},ee=()=>{p.value&&v.value&&(ne.value=!0,P(v.value,C.value).finally(()=>{ne.value=!1}))};return t({open:()=>{var X;return(X=h.value)==null?void 0:X.show()},close:()=>{var X;return(X=h.value)==null?void 0:X.hide()}}),(X,D)=>(q(),je(L(BN),zt({ref_key:"popupRef",ref:h,style:a,onHidden:E},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Vh({header:ye(()=>[Ee("span",TTe,it(b.value.title),1)]),default:ye(()=>[Ee("div",DTe,[Ee("div",xTe,it(b.value.description),1),_.value&&f.value===4?(q(),ue("div",ITe,[D[3]||(D[3]=nt(" Error code ",-1)),Ee("span",ATe,it(_.value),1)])):Ye("",!0),f.value===1?(q(),ue("div",PTe,[me(iT,{disabled:!1,label:"Start with a blank sheet",description:`Type or paste ${r.value} details
|
|
254
254
|
into a table.`,onOnClick:k},{visual:ye(()=>[me(L(ul),{src:"BlankSheet",size:65})]),_:1},8,["description"]),me(iT,{label:"Import from file",description:`Create ${r.value} from a CSV or
|
|
255
255
|
Excel file.`,onOnClick:B},{visual:ye(()=>[me(L(ul),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):f.value===2?(q(),ue("div",kTe,[me(L(Yre),{modelValue:p.value,"onUpdate:modelValue":D[0]||(D[0]=U=>p.value=U),"get-status-func":z,"workspace-id":l.workspaceId,id:l.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:y},null,8,["modelValue","workspace-id","id"])])):f.value===3?(q(),ue("div",FTe,[me(L(ul),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(q(),ue("div",OTe,[me(L(ul),{src:"Failed",width:240,height:180,ratio:"unset"})])):Ye("",!0)])]),_:2},[f.value===2||f.value===4||f.value===3?{name:"footer",fn:ye(()=>[f.value===4?(q(),je(L(pt),{key:0,variant:"secondary",onClick:D[1]||(D[1]=()=>{var U;E(),(U=h.value)==null||U.hide()})},{default:ye(()=>[...D[4]||(D[4]=[nt(" Close ",-1)])]),_:1})):f.value===3?(q(),je(L(pt),{key:1,variant:"secondary",onClick:D[2]||(D[2]=()=>{var U;E(),(U=h.value)==null||U.hide()})},{default:ye(()=>[...D[5]||(D[5]=[nt(" Got it ",-1)])]),_:1})):Ye("",!0),f.value===2?Ke((q(),ue("div",MTe,[me(L(pt),{loading:ne.value,disabled:ne.value||!p.value,onClick:ee},{default:ye(()=>[...D[6]||(D[6]=[nt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[L(o),{content:ne.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),f.value===4?(q(),je(L(pt),{key:3,onClick:re},{default:ye(()=>[...D[7]||(D[7]=[nt(" Try Again ",-1)])]),_:1})):Ye("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-13bacc12"]]),VTe={class:"header-name"},BTe={class:"modal-body"},$Te={class:"description"},HTe={key:0,class:"error-message"},GTe={class:"dynamic"},UTe={key:1,class:"choose-method-container"},WTe={key:2,class:"result-container"},zTe={key:3,class:"result-container"},jTe={key:2},TG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",KTe=bt(tt({__name:"PopupBulkUpdate",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=jt,s=Y(()=>[1,2].includes(f.value)),r=Y(()=>IS()),i=Y(()=>({1:{title:`Update ${r.value} in bulk`,description:""},2:{title:`Update ${r.value} in bulk`,description:""},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,c=n,{apiServices:u}=io(!1,l),d=1,h=$(),f=$(d),p=$(null),g=$(null),v=$(null),C=$(void 0),S=$(null),b=Y(()=>i.value[f.value]),y=$(),E=()=>{var re;p.value=null,f.value=d,g.value=null,v.value=null,_.value=null,S.value=null,(re=y.value)==null||re.clear(),C.value=void 0};Qe([g,v],([re,ee])=>{f.value===1&&re&&ee&&(f.value=2)});const _=$(null),x=re=>Ss().getErrorMessageFromResponse(re),R=re=>{if(typeof re=="string"){_.value=re;return}const ee=re.response,X=ee==null?void 0:ee.data,D=x(X);_.value=D??re.message,console.log("Error message set to:",{errorMsg:D,message:re})},P=async(re,ee)=>{var U;B.value=!0;const X=new FormData,D=((U=re.name.split(".").pop())==null?void 0:U.toString())||"";if(X.append("file",re),X.append("format",D),X.append("entity_id",l.entityId||""),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(l.workspaceId,l.entityId,X),f.value=3,c("import-success")}catch(K){console.error("Error uploading file:",K),R(K),f.value=4}finally{B.value=!1,window.appManager.hide("feedback_lockup_toolbox")}},{openToolbox:N,sendBackErrorFile:I}=_G(({file:re,fileName:ee,channel:X})=>{X==="feedback-merge"&&(v.value=re,C.value=ee??re.name,P(re))},"feedback-merge"),k=$(!1),A=async()=>{k.value=!0;const re=l.workspaceId,ee=l.entityId;if(!re||!ee||!u.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const X=await u.value.downloadExportedItemsFile(re,ee,!1);if(!X)throw new Error("No response from downloadTemplate API");return X}catch(X){return console.error("Error downloading template:",X),Promise.reject(X)}finally{k.value=!1}},M=re=>{const ee=TG.includes(re.type);return ee||(console.error("Invalid file type:",re.type),Ss().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),ee},V=async()=>{const re=document.createElement("input");re.type="file",re.accept=TG,re.onchange=async()=>{var X;const ee=(X=re.files)==null?void 0:X[0];if(ee){if(!M(ee)){E();return}g.value=Wm(ee);try{const D=await A();if(!D){Ss().addNotification({id:"failed-download-template",message:"Failed to download file.",type:"error"});return}N({exportFile:D,feedbackFile:ee})}catch(D){console.error("Error opening toolbox:",D),Ss().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},re.click()},B=$(!1),z=()=>{p.value=null,v.value&&C.value&&I(v.value,C.value)},ne=()=>{p.value&&v.value&&(B.value=!0,P(v.value,C.value).finally(()=>{B.value=!1}))};return t({open:()=>{var re;return(re=h.value)==null?void 0:re.show()},close:()=>{var re;return(re=h.value)==null?void 0:re.hide()}}),(re,ee)=>(q(),je(L(BN),zt({ref_key:"popupRef",ref:h,style:a,onHidden:E},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Vh({header:ye(()=>[Ee("span",VTe,it(b.value.title),1)]),default:ye(()=>[Ee("div",BTe,[Ee("div",$Te,it(b.value.description),1),_.value&&f.value===4?(q(),ue("div",HTe,[ee[2]||(ee[2]=nt(" Error code ",-1)),Ee("span",GTe,it(_.value),1)])):Ye("",!0),f.value===1?(q(),ue("div",UTe,[me(iT,{disabled:!1,label:"Import from file",description:`Update ${r.value} from a CSV or Excel file.`,onOnClick:V,style:{width:"100%"}},{visual:ye(()=>[me(L(ul),{src:"UploadFile",size:65})]),_:1},8,["description"])])):f.value===3?(q(),ue("div",WTe,[me(L(ul),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(q(),ue("div",zTe,[me(L(ul),{src:"Failed",width:240,height:180,ratio:"unset"})])):Ye("",!0)])]),_:2},[f.value===4||f.value===3?{name:"footer",fn:ye(()=>[f.value===4?(q(),je(L(pt),{key:0,variant:"secondary",onClick:ee[0]||(ee[0]=()=>{var X;E(),(X=h.value)==null||X.hide()})},{default:ye(()=>[...ee[3]||(ee[3]=[nt(" Close ",-1)])]),_:1})):f.value===3?(q(),je(L(pt),{key:1,variant:"secondary",onClick:ee[1]||(ee[1]=()=>{var X;E(),(X=h.value)==null||X.hide()})},{default:ye(()=>[...ee[4]||(ee[4]=[nt(" Got it ",-1)])]),_:1})):Ye("",!0),f.value===2?Ke((q(),ue("div",jTe,[me(L(pt),{loading:B.value,disabled:B.value||!p.value,onClick:ne},{default:ye(()=>[...ee[5]||(ee[5]=[nt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[L(o),{content:B.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),f.value===4?(q(),je(L(pt),{key:3,onClick:z},{default:ye(()=>[...ee[6]||(ee[6]=[nt(" Try Again ",-1)])]),_:1})):Ye("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-d00280e8"]]),qTe=bt(tt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Ns,o=aE(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=ts(o),a=jt,l=Po,c=$(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=$(""),h=Y(()=>{var ze;const Oe=((ze=i.value)==null?void 0:ze.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Oe},{label:"Update in bulk",value:"bulk_update",type:"text",hide:!Oe,id:"bulk_update_option"}]}),f=e;Rp.initialize({wrapVueCellRenderer:ky,wrapVueCellEditor:XV});const p=cd(),{switchInstanceFunc:g}=ts(p);Qt(()=>{const Oe=ro();g.value=Oe==null?void 0:Oe.appContext.config.globalProperties.switchInstance;const ze=new BroadcastChannel("focusable_channel");ct(()=>{setTimeout(()=>{ze.postMessage("Focusable elements updated")},7e3)})});const v=$(null),C=$([]),S=Bf(),{rowCount:b}=ts(S),y=$(!1),E=$(""),_=$(),x=QO(),{metricList:R}=ts(x),P=$(""),N=$(!1),I=$(new Set),k=$(new Map),{apiServices:A}=io(!1,f),{columnDefs:M,checkboxColumn:V,saveColumnConfig:B}=dTe(R,f.entityId,v),z=$();Qe(()=>M,()=>{var Oe;(Oe=z.value)==null||Oe.updateColumnDefs(M.value)},{deep:!0});const ne=(Oe,ze)=>{B(Oe,ze)},{updateRowData:re,setMetricValues:ee}=pTe(v),X=Y(()=>({isSearching:E.value.length>0,isFiltering:!(Object.keys($e.value||{}).length==1&&Object.keys($e.value)[0]=="preflight_status")&&Object.keys($e.value||{}).length>0})),D=Y(lv),U=Y(()=>M.value.filter(Oe=>{var ze;return((ze=Oe.field)==null?void 0:ze.startsWith("metric_"))&&!Oe.hide}).map(Oe=>{var ze;return((ze=Oe.field)==null?void 0:ze.replace("metric_",""))||""}));di("timezone",D);const K=Y(()=>({autoFetch:!1,workspaceId:f.workspaceId,entityId:f.entityId,metricIds:U.value,updateItemData:re,setMetricValues:ee})),{fetchItems:ie,getMetricList:we,cusorMap:Ae,getMetricValues:ce}=fTe(K),G=Y(()=>{if(!v.value)return!1;const Oe=v.value.getSelectedRows().length;return Oe>0&&Oe>=b.value.total}),te=Y(()=>{var Oe;return((Oe=c.value)==null?void 0:Oe.name)||"Items"}),oe=Oe=>{setTimeout(()=>{ct(()=>{var ze,Mt;v.value&&(Oe?(ze=v.value)==null||ze.showNoRowsOverlay():(Mt=v.value)==null||Mt.hideOverlay())})},500)},O=(Oe,ze)=>{var Mt;b.value.total=Oe.meta.total??0,(Mt=Oe.meta.next)!=null&&Mt.cursor&&(Ae[ze+1]=Oe.meta.next.cursor),P.value=Oe.meta["X-Tsr-signature"]||"",Oe.meta.total===0?oe(!0):oe(!1)},Q=pE(),{setDefaultSort:se}=Q,ve=$(null),{sortingAPIConfiguration:ke,isSortingRunning:_e}=ts(Q),$e=$({preflight_status:"1"}),pe=Y(()=>({...$e.value,search:E.value}));di("filterParams",pe);const H=$([]),j=async({page:Oe,pageSize:ze,filterText:Mt})=>{var en,$o,Ao;(en=v.value)==null||en.hideOverlay();const pn=Ae[Oe],Mr=!pn&&Oe>1?(Oe-1)*ze:void 0,Ps=ke.value;Ps.length>0&&(_e.value=!0);try{const dh={cursor:pn,size:ze,searchQuery:Mt,offset:Mr,sort_by:Ps,...$e.value},ri=await ie(dh);if(!ri)return{rows:[],total:0};const cu=(Ao=($o=ri.meta)==null?void 0:$o.extra)==null?void 0:Ao.default_sort;cu&&se(cu);const cg=(La=>{const ug=La.data.map(Va=>mk(Va,D.value));return ug.forEach(Va=>{I.value.add(String(Va.id)),k.value.set(String(Va.id),{})}),ug})(ri);return O(ri,Oe),{rows:cg,total:b.value.total}}catch(dh){return console.error("Failed to fetch items:",dh),{rows:[],total:0}}finally{_e.value=!1}},{isLoading:be,toggleSidebar:xe,onGridReady:He,handleUnSelect:De,handleSelectAll:Ze,onSearch:ge,firstLoad:Ne}=mTe({selectRowData:$([]),isSidebarOpen:y,quickFilterText:E,gridApi:v,perPage:u.ROWS_PER_PAGE,fetcher:j}),Ct=$([]),At=mr(()=>{var Ps;const Oe=((Ps=v.value)==null?void 0:Ps.getSelectedRows())||[],ze=new Map(Oe.map(en=>[en.id,en])),Mr=Oe.map(en=>en.id).map(en=>{var $o,Ao;return[en,(Ao=($o=v.value)==null?void 0:$o.getRowNode(en))==null?void 0:Ao.rowIndex]}).sort((en,$o)=>(en[1]??0)-($o[1]??0)).map(([en])=>ze.get(en));Ct.value=Mr.filter(en=>en!==void 0)}),Zt=Uo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),on=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:M.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:xn,noRowsOverlayComponent:ky(Jre),noRowsOverlayComponentParams:()=>X.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Oe=>Oe.data.id,rowClassRules:{"row-deleted":Oe=>{var ze;return(ze=Oe.data)==null?void 0:ze.isDeleted},"row-locked":Oe=>{var ze;return(ze=Oe.data)==null?void 0:ze.isLocked},"row-archived":Oe=>{var ze;return(ze=Oe.data)==null?void 0:ze.isArchived},"row-process-locked":Oe=>{var ze,Mt;return((Mt=(ze=Oe.data)==null?void 0:ze.isProcessing)==null?void 0:Mt.state)==0},"row-inactive":Oe=>{var ze;return!((ze=Oe.data)!=null&&ze.id)},"row-empty":Oe=>!Oe.data},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:f.workspaceId,entityId:f.entityId,apiServices:A.value,sorting:_e.value},onCellKeyDown:Oe=>{var ze,Mt,pn;if(Oe.data.isDeleted)return!1;if(((ze=Oe==null?void 0:Oe.event)==null?void 0:ze.key)==="Enter"){const{api:Mr,node:Ps,column:en}=Oe,$o=Mr.getCellRendererInstances({rowNodes:[Ps],columns:[en]});if($o.length>0){const Ao=$o[0];Ao&&typeof((Mt=Ao.componsenExposed)==null?void 0:Mt.focus)=="function"&&((pn=Ao.componsenExposed)==null||pn.focus())}}},isRowSelectable:Oe=>{var ze,Mt;return!Oe.group&&((Mt=(ze=Oe.data)==null?void 0:ze.isProcessing)==null?void 0:Mt.state)!=0},suppressKeyboardEvent:Oe=>{var pn;if((pn=Oe.data)!=null&&pn.isDeleted)return!0;const ze=Oe.event.key,Mt=Oe.editing;return Mt&&ze==="Tab"?!0:Mt&&ze==="Enter"?!1:ze==="Enter"?(Oe.event.preventDefault(),Oe.event.stopPropagation(),!0):ze==="ArrowUp"||ze==="ArrowDown"||ze==="ArrowLeft"||ze==="ArrowRight"||ze==="Tab"||ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Oe=>{const ze=Oe.api.getFirstDisplayedRowIndex(),Mt=Oe.api.getLastDisplayedRowIndex();Zt.rowsDisplay.fromIndex=ze,Zt.rowsDisplay.toIndex=Mt,Zt.columnsDisplay=Oe.api.getAllDisplayedVirtualColumns().map(pn=>pn.getColId())},onViewportChanged:Oe=>{Zt.columnsDisplay=Oe.api.getAllDisplayedVirtualColumns().map(ze=>ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Oe){if(Oe.data.isDeleted&&Oe.api.stopEditing(),Oe.colDef.field=="options"){const ze=Oe.api.getCellRendererInstances({rowNodes:[Oe.node],columns:[Oe.column]});ze.length>0&&ze[0].focusUi()}},tabToNextCell:Oe=>{let ze=Oe.nextCellPosition;if(ze&&ze.column.getColId()==="ag-Grid-SelectionColumn"){const Mt=Oe.api.getAllDisplayedColumns(),pn=Mt.indexOf(ze.column),Mr=Oe.backwards?-1:1,Ps=Mt[pn+Mr];if(Ps)return{rowIndex:ze.rowIndex,column:Ps,rowPinned:ze.rowPinned}}return ze}}));function xn(){if(!v.value)return;let Oe=0;v.value.forEachNode(ze=>{ze.data&&Oe++}),b.value.loaded=Math.min(Oe,b.value.total)}Qe(()=>ke,()=>{v.value&&(P.value="",I.value.clear(),v.value.deselectAll(),Object.keys(Ae).forEach(Oe=>delete Ae[Number(Oe)]),v.value.purgeInfiniteCache(),v.value.ensureIndexVisible(0))},{deep:!0});const Le=$(),Ge=$(),Rt=()=>{Or.showPopupOverwriteScenes=!0,ct(()=>{var Oe;(Oe=Ge.value)==null||Oe.open()})},Kt=$(),qt=()=>{Or.showPopupBulkUpdate=!0,ct(()=>{var Oe;(Oe=Kt.value)==null||Oe.open()})},ot=()=>{Or.showPopupToolboxUploader=!0,ct(()=>{var Oe;(Oe=Le.value)==null||Oe.open()})},Jn=async()=>{Ne.value=!0,v.value&&(P.value="",I.value.clear(),Object.keys(Ae).forEach(Oe=>delete Ae[Number(Oe)]),await v.value.deselectAll(),await v.value.ensureIndexVisible(0,"top"),await v.value.purgeInfiniteCache(),await v.value.refreshInfiniteCache())},si=Y(()=>ln.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Ma=$();Y(()=>{var Oe;return(Oe=yTe(si.value))==null?void 0:Oe.map(ze=>`<div>• ${ze}</div>`).join(`
|
|
256
|
-
`)});function As(Oe){var ze;Oe==="new_scene"?(ze=Ma.value)==null||ze.show():Oe==="import_scenes"?ot():Oe==="overwrite_scenes"?Rt():Oe==="bulk_update"&&qt()}const Na=Oe=>{C.value=Oe.api.getSelectedRows().map(ze=>ze.id)},Hl=Oe=>{const ze=He(Oe);return ze&&(ze.addEventListener("modelUpdated",xn),ze.addEventListener("bodyScroll",()=>ze.stopEditing()),ze.addEventListener("selectionChanged",At),ze.addEventListener("columnMoved",pn=>ne(pn,!0)),ze.addEventListener("columnResized",pn=>ne(pn,!0)),ze.addEventListener("firstDataRendered",()=>{Ne.value=!1}),!document.querySelector(".ag-body-viewport"))||Oe==null||Oe.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),ze},kr=()=>{var Oe;d.value=(((Oe=document.getElementById("item-table-layout-id"))==null?void 0:Oe.clientHeight)??0)-78+"px"};Qt(()=>{ct(()=>{kr()}),window.addEventListener("resize",kr);function Oe(){requestAnimationFrame(Oe)}Oe()}),zn(()=>{window.removeEventListener("resize",kr)});const Ui=async({code:Oe,name:ze})=>{await ge(Oe),setTimeout(()=>{var Mt;(Mt=_.value)==null||Mt.setValue(ze)},300)},Fr=Oe=>{if(!v.value)return;const ze=v.value.getRowNode(Oe);ze?(v.value.ensureIndexVisible(Number(ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},Wi=Oe=>Oe.metric_type.code==="number"?"number":"default",ah=async()=>{if(f.entityId)try{const Oe=await we(f.entityId);R.value=Oe.data.map(ze=>({...ze,sortType:Wi(ze)}))}catch(Oe){console.error("Failed to initialize metric list:",Oe),R.value=[]}},Vn=async()=>{if(A.value)try{const Oe=await A.value.getUserPermission(f.workspaceId);s(Oe)}catch(Oe){console.error("Failed to fetch user permissions:",Oe)}},Co=async()=>{if(A.value)try{const Oe=await A.value.getEntityDetail(f.workspaceId,f.entityId);r(Oe.permission),c.value=Oe}catch(Oe){console.error("Failed to fetch entity details:",Oe)}},Vw=Cy(),{setUser:lh}=Vw,ch=async()=>{if(A.value)try{const Oe=await A.value.getMe();return lh(Oe),Oe}catch(Oe){console.error("Failed to fetch user details:",Oe)}},uh=async()=>{var Oe;if(A.value)try{const ze=await A.value.getWorkspaces(f.workspaceId),Mt=(Oe=ze.data[0])==null?void 0:Oe.ws_user_role_id;return Mt&&Vw.setUserRoleId(Mt),ze}catch(ze){console.error("Failed to fetch workspace details:",ze)}};Qe(()=>[f.entityId,f.workspaceId],async([Oe,ze])=>{!Oe||!ze||(ch(),uh(),ah(),Vn(),Co())},{immediate:!0,deep:!0}),Qe(U,(Oe,ze)=>{const Mt=Oe.filter(pn=>!(ze!=null&&ze.includes(pn)));Mt.length>0&&ce(Array.from(I.value),Mt).then(pn=>{ee(pn,I.value,Mt)})},{immediate:!0,deep:!0}),Qe(P,(Oe,ze)=>{N.value=!!(ze&&Oe&&ze!==Oe)}),t({refreshTable:Jn});const lT=Oe=>{$e.value=Oe,Jn()},zi=Oe=>{H.value=Oe,Jn()},Gl=Oe=>{M.value=Oe||[],ne({},!0)},ji=Y(()=>{var pn;const Oe=ln.getInstance().getItem("ws.terminology"),ze=Oe?JSON.parse(Oe):null;return`New ${((pn=ze==null?void 0:ze.find(Mr=>Mr.code==="scene"))==null?void 0:pn.name)||"Scene"}`}),Or=Uo({showPopupBulkUpdate:!1,showPopupToolboxUploader:!1,showPopupSceneCreator:!1,showPopupItemDetails:!1,showPopupOverwriteScenes:!1});return(Oe,ze)=>(q(),je(L(Pse),{"is-sidebar-open":y.value,onCloseSidebar:L(xe),onSidebarClear:L(xe),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:L(xe)},{"header-left":ye(()=>{var Mt;return[((Mt=L(i))==null?void 0:Mt.has_create_item_permission)==1?(q(),je(L(o0),{key:0,variant:["primary"],options:h.value,onSelect:As,onHandleClick:ze[1]||(ze[1]=pn=>As("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ye(()=>[Ke(me(L(pt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:ze[0]||(ze[0]=pn=>As("new_scene")),label:ji.value},null,8,["label"]),[[L(l),1]])]),_:1},8,["options"])):Ye("",!0)]}),"header-actions":ye(()=>[me(L(Vie),{"onUpdate:assignees":zi,onApplyFilter:lT,loading:L(Ne),entityId:f.entityId},null,8,["loading","entityId"]),Ke(me(L(wE),{focusIndex:"4",modelValue:E.value,"onUpdate:modelValue":ze[2]||(ze[2]=Mt=>E.value=Mt),onSearch:L(ge),class:ae(Oe.$style.itemSearchBox),onClear:ze[3]||(ze[3]=Mt=>L(ge)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[L(n),{isLoading:L(Ne),fullwidth:!0}]]),Ke((q(),je(L(qO),{status:L(be)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":N.value},{default:ye(()=>[Ke((q(),je(L(pt),{variant:["secondary","icon"],disabled:L(be),onClick:Jn},{default:ye(()=>[me(L(ut),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[L(l),5],[L(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[L(n),{isLoading:L(Ne),fullwidth:!0}]]),Ke(me(L(Mre),{"model-value":L(M),onChange:ze[4]||(ze[4]=Mt=>Gl(Mt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:z,"checkbox-column":L(V),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[L(n),{isLoading:L(Ne),fullwidth:!0}]])]),grid:ye(({availableHeight:Mt})=>[me(L(rTe),zt({id:"item_table_main",ref_key:"agGrid",ref:ve},on.value,{height:Mt+"px",isSorting:L(_e),onOnGridReady:Hl,onSelectionChanged:Na}),null,16,["height","isSorting"])]),footer:ye(()=>[Ee("div",{class:ae(Oe.$style.tableFooter),id:"table_footer"},[Ee("span",null,[ze[7]||(ze[7]=nt(" Showing ",-1)),Ee("b",null,it(L(b).loaded)+" of "+it(L(b).total),1)])],2)]),"new-row":ye(()=>[me(L(mie),{ref_key:"createNewSceneRef",ref:Ma,onSearchForCode:Ui,onFocusOnId:Fr},null,512)]),"bulk-update-actions":ye(()=>[!y.value&&C.value.length>0?Ke((q(),je(L(Ese),{key:0,selectRowData:Ct.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:L(De),onSelectAll:L(Ze),"take-name":te.value,"selected-all":G.value,"total-rows":L(b).total,"visible-rows":L(b).loaded,onUpdated:L(At),loading:L(be),onRefreshSelectedRow:L(At)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","onUpdated","loading","onRefreshSelectedRow"])),[[lr,!y.value&&C.value.length>0]]):Ye("",!0)]),snackbar:ye(()=>[me(L(Wse))]),popup:ye(()=>[Or.showPopupToolboxUploader?(q(),je(LTe,{key:0,ref_key:"popupToolboxUploaderRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:Jn,onHide:ze[5]||(ze[5]=Mt=>Or.showPopupToolboxUploader=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0),Or.showPopupBulkUpdate?(q(),je(KTe,{key:1,ref_key:"popupBulkUpdateRef",ref:Kt,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:Jn,onHide:ze[6]||(ze[6]=Mt=>Or.showPopupBulkUpdate=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0)]),_: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"}}]]),DG="0.1.
|
|
256
|
+
`)});function As(Oe){var ze;Oe==="new_scene"?(ze=Ma.value)==null||ze.show():Oe==="import_scenes"?ot():Oe==="overwrite_scenes"?Rt():Oe==="bulk_update"&&qt()}const Na=Oe=>{C.value=Oe.api.getSelectedRows().map(ze=>ze.id)},Hl=Oe=>{const ze=He(Oe);return ze&&(ze.addEventListener("modelUpdated",xn),ze.addEventListener("bodyScroll",()=>ze.stopEditing()),ze.addEventListener("selectionChanged",At),ze.addEventListener("columnMoved",pn=>ne(pn,!0)),ze.addEventListener("columnResized",pn=>ne(pn,!0)),ze.addEventListener("firstDataRendered",()=>{Ne.value=!1}),!document.querySelector(".ag-body-viewport"))||Oe==null||Oe.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),ze},kr=()=>{var Oe;d.value=(((Oe=document.getElementById("item-table-layout-id"))==null?void 0:Oe.clientHeight)??0)-78+"px"};Qt(()=>{ct(()=>{kr()}),window.addEventListener("resize",kr);function Oe(){requestAnimationFrame(Oe)}Oe()}),zn(()=>{window.removeEventListener("resize",kr)});const Ui=async({code:Oe,name:ze})=>{await ge(Oe),setTimeout(()=>{var Mt;(Mt=_.value)==null||Mt.setValue(ze)},300)},Fr=Oe=>{if(!v.value)return;const ze=v.value.getRowNode(Oe);ze?(v.value.ensureIndexVisible(Number(ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},Wi=Oe=>Oe.metric_type.code==="number"?"number":"default",ah=async()=>{if(f.entityId)try{const Oe=await we(f.entityId);R.value=Oe.data.map(ze=>({...ze,sortType:Wi(ze)}))}catch(Oe){console.error("Failed to initialize metric list:",Oe),R.value=[]}},Vn=async()=>{if(A.value)try{const Oe=await A.value.getUserPermission(f.workspaceId);s(Oe)}catch(Oe){console.error("Failed to fetch user permissions:",Oe)}},Co=async()=>{if(A.value)try{const Oe=await A.value.getEntityDetail(f.workspaceId,f.entityId);r(Oe.permission),c.value=Oe}catch(Oe){console.error("Failed to fetch entity details:",Oe)}},Vw=Cy(),{setUser:lh}=Vw,ch=async()=>{if(A.value)try{const Oe=await A.value.getMe();return lh(Oe),Oe}catch(Oe){console.error("Failed to fetch user details:",Oe)}},uh=async()=>{var Oe;if(A.value)try{const ze=await A.value.getWorkspaces(f.workspaceId),Mt=(Oe=ze.data[0])==null?void 0:Oe.ws_user_role_id;return Mt&&Vw.setUserRoleId(Mt),ze}catch(ze){console.error("Failed to fetch workspace details:",ze)}};Qe(()=>[f.entityId,f.workspaceId],async([Oe,ze])=>{!Oe||!ze||(ch(),uh(),ah(),Vn(),Co())},{immediate:!0,deep:!0}),Qe(U,(Oe,ze)=>{const Mt=Oe.filter(pn=>!(ze!=null&&ze.includes(pn)));Mt.length>0&&ce(Array.from(I.value),Mt).then(pn=>{ee(pn,I.value,Mt)})},{immediate:!0,deep:!0}),Qe(P,(Oe,ze)=>{N.value=!!(ze&&Oe&&ze!==Oe)}),t({refreshTable:Jn});const lT=Oe=>{$e.value=Oe,Jn()},zi=Oe=>{H.value=Oe,Jn()},Gl=Oe=>{M.value=Oe||[],ne({},!0)},ji=Y(()=>{var pn;const Oe=ln.getInstance().getItem("ws.terminology"),ze=Oe?JSON.parse(Oe):null;return`New ${((pn=ze==null?void 0:ze.find(Mr=>Mr.code==="scene"))==null?void 0:pn.name)||"Scene"}`}),Or=Uo({showPopupBulkUpdate:!1,showPopupToolboxUploader:!1,showPopupSceneCreator:!1,showPopupItemDetails:!1,showPopupOverwriteScenes:!1});return(Oe,ze)=>(q(),je(L(Pse),{"is-sidebar-open":y.value,onCloseSidebar:L(xe),onSidebarClear:L(xe),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:L(xe)},{"header-left":ye(()=>{var Mt;return[((Mt=L(i))==null?void 0:Mt.has_create_item_permission)==1?(q(),je(L(o0),{key:0,variant:["primary"],options:h.value,onSelect:As,onHandleClick:ze[1]||(ze[1]=pn=>As("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ye(()=>[Ke(me(L(pt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:ze[0]||(ze[0]=pn=>As("new_scene")),label:ji.value},null,8,["label"]),[[L(l),1]])]),_:1},8,["options"])):Ye("",!0)]}),"header-actions":ye(()=>[me(L(Vie),{"onUpdate:assignees":zi,onApplyFilter:lT,loading:L(Ne),entityId:f.entityId},null,8,["loading","entityId"]),Ke(me(L(wE),{focusIndex:"4",modelValue:E.value,"onUpdate:modelValue":ze[2]||(ze[2]=Mt=>E.value=Mt),onSearch:L(ge),class:ae(Oe.$style.itemSearchBox),onClear:ze[3]||(ze[3]=Mt=>L(ge)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[L(n),{isLoading:L(Ne),fullwidth:!0}]]),Ke((q(),je(L(qO),{status:L(be)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":N.value},{default:ye(()=>[Ke((q(),je(L(pt),{variant:["secondary","icon"],disabled:L(be),onClick:Jn},{default:ye(()=>[me(L(ut),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[L(l),5],[L(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[L(n),{isLoading:L(Ne),fullwidth:!0}]]),Ke(me(L(Mre),{"model-value":L(M),onChange:ze[4]||(ze[4]=Mt=>Gl(Mt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:z,"checkbox-column":L(V),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[L(n),{isLoading:L(Ne),fullwidth:!0}]])]),grid:ye(({availableHeight:Mt})=>[me(L(rTe),zt({id:"item_table_main",ref_key:"agGrid",ref:ve},on.value,{height:Mt+"px",isSorting:L(_e),onOnGridReady:Hl,onSelectionChanged:Na}),null,16,["height","isSorting"])]),footer:ye(()=>[Ee("div",{class:ae(Oe.$style.tableFooter),id:"table_footer"},[Ee("span",null,[ze[7]||(ze[7]=nt(" Showing ",-1)),Ee("b",null,it(L(b).loaded)+" of "+it(L(b).total),1)])],2)]),"new-row":ye(()=>[me(L(mie),{ref_key:"createNewSceneRef",ref:Ma,onSearchForCode:Ui,onFocusOnId:Fr},null,512)]),"bulk-update-actions":ye(()=>[!y.value&&C.value.length>0?Ke((q(),je(L(Ese),{key:0,selectRowData:Ct.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:L(De),onSelectAll:L(Ze),"take-name":te.value,"selected-all":G.value,"total-rows":L(b).total,"visible-rows":L(b).loaded,onUpdated:L(At),loading:L(be),onRefreshSelectedRow:L(At)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","onUpdated","loading","onRefreshSelectedRow"])),[[lr,!y.value&&C.value.length>0]]):Ye("",!0)]),snackbar:ye(()=>[me(L(Wse))]),popup:ye(()=>[Or.showPopupToolboxUploader?(q(),je(LTe,{key:0,ref_key:"popupToolboxUploaderRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:Jn,onHide:ze[5]||(ze[5]=Mt=>Or.showPopupToolboxUploader=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0),Or.showPopupBulkUpdate?(q(),je(KTe,{key:1,ref_key:"popupBulkUpdateRef",ref:Kt,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:Jn,onHide:ze[6]||(ze[6]=Mt=>Or.showPopupBulkUpdate=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0)]),_: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"}}]]),DG="0.1.229",YTe={key:0},XTe=bt(tt({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=Uo({id:"",workspaceId:"",apiConfig:{}}),o=Ss(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=$(null),c=()=>{const h=ln.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Mh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",DG);try{if(l.value=ro(),!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)||ln.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:ln.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 DN(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),zn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Y(()=>n.id),d=Y(()=>n.workspaceId);return di("workspaceId",d),di("entityId",u),(h,f)=>(q(),ue("div",{class:ae(h.$style.dashboardPluginWrapper)},[t.value?(q(),ue("span",YTe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(q(),je(L(qTe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ye("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),aT=async(e={},t={})=>{const n=lx(XTe),o=fJ();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${DG}`,"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",jt),n.directive("focusable",Po);const i=await xce();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=aT),Bn.default=aT,Bn.initDashboard=aT,Object.defineProperties(Bn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|