1"use strict";(self.webpackChunkmain=self.webpackChunkmain||[]).push([[1537],{17088(e,i,l){var t=l(74848),o=l(68575),s=l(27753),n=l(47237),a=l(63710),r=l(46093);const d=({text:e,truncateLength:i,textStyle:l})=>{const{t:d}=(0,a.Bd)();return(0,t.jsxs)(n.a,{sx:Object.assign({},r.A.flexColumn),children:[(0,t.jsxs)(s.o,{sx:Object.assign({},l),children:[e.slice(0,i),e.length>i?"...":""]}),e.length&&e.length>i?(0,t.jsx)(o.l,{sx:{"& .MuiTooltip-tooltip":{height:"fit-content",maxHeight:"50vh",overflow:"auto"}},title:(0,t.jsx)(s.o,{sx:Object.assign({color:e=>e.palette.otColors.secondary[500]},l),children:e}),placement:"top-start",children:(0,t.jsx)(n.a,{children:(0,t.jsx)(s.o,{sx:{fontSize:"12px",color:e=>e.palette.otColors.secondary[300]},children:d("SEE_MORE")})})}):null]})};l.d(i,["A",0,d])},68575(e,i,l){var t=l(74848),o=l(58331),s=l(11848),n=l(64715),a=function(e,i){var l={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&i.indexOf(t)<0&&(l[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)i.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(l[t[o]]=e[t[o]])}return l};const r=(0,s.Ay)(e=>{var{className:i}=e,l=a(e,["className"]);return(0,t.jsx)(n.m,Object.assign({},l,{classes:{popper:i}}))})(({theme:e})=>({[`& .${o.A.tooltip}`]:{backgroundColor:e.palette.background.default,color:e.palette.otColors.secondary[400],maxWidth:"60ch",fontSize:e.typography.pxToRem(12),border:"1px solid #dadde9"}}));l.d(i,["l",0,r])},28790(e,i,l){var t=l(74848),o=(l(96540),function(e,i){var l={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&i.indexOf(t)<0&&(l[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)i.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(l[t[o]]=e[t[o]])}return l});l.d(i,["q",0,e=>{var{width:i=161}=e,l=o(e,["width"]);return(0,t.jsxs)("svg",Object.assign({width:i,height:"140",viewBox:"0 0 161 140",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{children:[(0,t.jsx)("path",{d:"M86.3158 140C123.402 140 153.468 109.934 153.468 72.7152C153.468 35.4966 123.269 5.43042 86.3158 5.43042C49.2297 5.43042 19.1635 35.4966 19.1635 72.7152C19.1635 109.934 49.2297 140 86.3158 140Z",fill:"#EAEEF9"}),(0,t.jsx)("path",{d:"M154.026 23.1788C154.026 25.9018 151.819 28.1092 149.096 28.1092C146.373 28.1092 144.165 25.9018 144.165 23.1788C144.165 20.4557 146.373 18.2483 149.096 18.2483C151.819 18.2483 154.026 20.4557 154.026 23.1788Z",fill:"#EAEEF9",stroke:"#EAECF0"}),(0,t.jsx)("path",{d:"M160.253 3.70861C160.253 5.48067 158.816 6.91722 157.044 6.91722C155.272 6.91722 153.835 5.48068 153.835 3.70861C153.835 1.93654 155.272 0.5 157.044 0.5C158.816 0.5 160.253 1.93654 160.253 3.70861Z",fill:"#EAEEF9",stroke:"#EAECF0"}),(0,t.jsx)("path",{d:"M25.9479 24.7682C25.9479 26.5402 24.5113 27.9768 22.7392 27.9768C20.9672 27.9768 19.5306 26.5402 19.5306 24.7682C19.5306 22.9961 20.9672 21.5596 22.7392 21.5596C24.5113 21.5596 25.9479 22.9961 25.9479 24.7682Z",fill:"#EAEEF9",stroke:"#EAECF0"}),(0,t.jsx)("path",{d:"M7.13485 108.646C10.9387 108.646 14.0223 105.563 14.0223 101.759C14.0223 97.9552 10.9387 94.8716 7.13485 94.8716C3.33104 94.8716 0.247437 97.9552 0.247437 101.759C0.247437 105.563 3.33104 108.646 7.13485 108.646Z",fill:"#EAEEF9"}),(0,t.jsx)("path",{d:"M91.9141 76.815V102.148H117.247V76.815H91.9141ZM60.2474 102.148H85.5808V76.815H60.2474V102.148ZM60.2474 45.1483V70.4817H85.5808V45.1483H60.2474ZM103.504 41L85.5808 58.8917L103.504 76.815L121.427 58.8917L103.504 41Z",fill:"#98A2B3"})]}))}])},99708(e,i,l){var t=l(66052),o=l(83175),s=l(29438),n=l(58156),a=l.n(n),r=l(42426),d=l.n(r),c=l(79859),m=l.n(c),u=l(80218),v=l.n(u),p=l(62193),b=l.n(p),h=l(96540);const g=({pageSize:e,list:i,search:l="",attributes:n=[],isExact:r=!1,page:c=1,totalPages:u=1,customFilter:p,customSort:g,customOrder:x,selectionData:j})=>(0,h.useMemo)(()=>{var h,y,f,_,A;const E=i.filter(e=>!(0,o.i)(n)||n.some(i=>{const t=i.split(".");if((null==t?void 0:t.length)>1&&(0,o.i)(e[t[0]]))return d()(e[t[0]]||[],e=>m()(v()(String(e[t[1]])),v()(l)));const s=a()(e,i,"");return r?s===l:String(s).toLowerCase().includes(l.toLowerCase())})),C=l?E:i;let N=p?C.filter(e=>p({item:e})):C;if(N=g?[...N].sort(g):N,N=x?x(N):N,null==j?void 0:j.length){const e=j.filter(e=>"filter"===(null==e?void 0:e.selectType)),i=j.filter(e=>"sort"===(null==e?void 0:e.selectType));if(e.length&&(N=N.filter(i=>(0,t.Y)(i,e))),i.length){const e=`${null===(y=null===(h=i[0])||void 0===h?void 0:h.key)||void 0===y?void 0:y.identifier}`,l=null===(A=null===(_=null===(f=i[0])||void 0===f?void 0:f.key)||void 0===_?void 0:_.item)||void 0===A?void 0:A.value;N=(0,s.q)(N,e,l)}}const O=((null==j?void 0:j.length)||!b()(l)||Boolean(p))&&e?Math.ceil(N.length/e):u;return{filteredList:e?N.slice((c-1)*e,(c-1)*e+e):N,filteredTotalPages:O}},[n,p,x,g,r,i,c,e,l,j,u]);l.d(i,["A",0,g])},84706(e,i,l){var t=l(72173),o=l(69790),s=l(63064),n=l(36165),a=l(4535),r=l(96102);const d=()=>{const e=(0,s.jE)(),{errorToaster:i}=(0,r.A)(),{user:l}=(0,t.Ay)();return{handleSidebarVisibility:async(t,s)=>{e.setQueryData(["company",a.A.getCompanyIdToken(),o.E5.EMBEDDED_APPS_LIST],e=>e?Object.assign(Object.assign({},e),{data:{data:e.data.data.map(e=>e._id===s?Object.assign(Object.assign({},e),{members:e.members.map(e=>e.member._id===(null==l?void 0:l._id)?Object.assign(Object.assign({},e),{isSidebar:t}):e)}):e)}}):{data:{data:[]}});try{await n.Ay.embedApp.updateSidebarVisibility(s,{isSidebar:t}
1),e.invalidateQueries(["company",a.A.getCompanyIdToken(),o.E5.EMBEDDED_APPS_LIST])}catch(l){i(l),e.invalidateQueries(["company",a.A.getCompanyIdToken(),o.E5.EMBEDDED_APPS_LIST])}}}};l.d(i,["A",0,d])},61537(e,i,l){l.r(i),l.d(i,{default:()=>pe});var t=l(74848),o=l(36165),s=l(26726),n=l(95801),a=l(28790),r=l(8561),d=l(69790),c=l(4535),m=l(99708),u=l(33583),v=l(24495),p=l(96102),b=l(38842),h=l(7048),g=l(76880),x=l(78624),j=l(60288),y=l(50505),f=l(72173),_=l(43375),A=l(43627),E=l(77536),C=l(67034),N=l(54706),O=l(70702),S=l(47237),M=l(35025),w=l(40639),T=l(36636),D=l(78873),k=l(27753),I=l(63064),P=l(9421),L=l(40799),B=l(96540),V=l(8179),R=l(42784),z=l(17088),W=l(93335),H=l(74979),U=l(1795),$=l(37488),Y=l(150),F=l(15426),Z=l(84706),q=l(46093),Q=l(44699),G=l(35778);const K={fontSize:".875rem",fontWeight:500,lineHeight:"140%"},X={fontSize:".75rem",fontWeight:500,lineHeight:"130%"},J={sx:{maxHeight:"25vh",overflow:"auto"}},ee=({embedData:e})=>{var i,l,o,s,n,a;const{t:r}=(0,v.A)();return"all_team_members"===e.visibility?(0,t.jsx)(k.o,{color:"success.600",component:"span",sx:Object.assign({},K),children:"All Team Members"}):"all_clients"===e.visibility?(0,t.jsx)(k.o,{color:"primary.500",component:"span",sx:Object.assign({},K),children:"All Clients"}):"all"===e.visibility?(0,t.jsx)(k.o,{color:"success.600",component:"span",sx:Object.assign({},K),children:"All"}):"teams_&_clients"===e.visibility?(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".75rem","& .MuiAvatar-root:last-child":{marginLeft:"-8px !important"}}),children:[(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".875rem"}),children:[(0,t.jsx)(k.o,{color:"success.600",sx:Object.assign({},X),children:"Teams"}),(0,t.jsx)(Q.g,{imagesWithName:null===(i=e.teamMembers)||void 0===i?void 0:i.map(e=>{var i;return{image:null===(i=e.member)||void 0===i?void 0:i.profileImage,name:e.member.firstName?(0,G.M)(null==e?void 0:e.member.firstName,null==e?void 0:e.member.lastName):r("INVITED_USER")}}),tooltipProps:J,max:2})]}),(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".875rem"}),children:[(0,t.jsx)(k.o,{color:"primary.500",sx:Object.assign({},X),children:"Clients"}),(0,t.jsx)(Q.g,{imagesWithName:null===(l=e.clients)||void 0===l?void 0:l.map(e=>{var i;return{image:null===(i=e.member)||void 0===i?void 0:i.profileImage,name:e.member.firstName?(0,G.M)(null==e?void 0:e.member.firstName,null==e?void 0:e.member.lastName):r("INVITED_USER")}}),tooltipProps:J,max:2})]})]}):"all_team_members&&clients"===e.visibility?(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".75rem","& .MuiAvatar-root:last-child":{marginLeft:"-8px !important"}}),children:[(0,t.jsx)(k.o,{color:"success.600",component:"span",sx:Object.assign({},K),children:"All Team Members"}),(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".875rem"}),children:[(0,t.jsx)(k.o,{color:"primary.500",sx:Object.assign({},X),children:"Clients"}),(0,t.jsx)(Q.g,{imagesWithName:null===(o=e.clients)||void 0===o?void 0:o.map(e=>{var i;return{image:null===(i=e.member)||void 0===i?void 0:i.profileImage,name:e.member.firstName?(0,G.M)(null==e?void 0:e.member.firstName,null==e?void 0:e.member.lastName):r("INVITED_USER")}}),tooltipProps:J,max:2})]})]}):"all_clients&&teams"===e.visibility?(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".75rem","& .MuiAvatar-root:last-child":{marginLeft:"-8px !important"}}),children:[(0,t.jsx)(k.o,{color:"primary.500",component:"span",sx:Object.assign({},K),children:"All Clients"}),(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".875rem"}),children:[(0,t.jsx)(k.o,{color:"success.600",sx:Object.assign({},X),children:"Teams"}),(0,t.jsx)(Q.g,{imagesWithName:null===(s=e.teamMembers)||void 0===s?void 0:s.map(e=>{var i;return{image:null===(i=e.member)||void 0===i?void 0:i.profileImage,name:e.member.firstName?(0,G.M)(null==e?void 0:e.member.firstName,null==e?void 0:e.member.lastName):r("INVITED_USER")}}),tooltipProps:J,max:2})]})]}):"teams"===e.visibility?(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".875rem","& .MuiAvatar-root:last-child":{marginLeft:"-8px !important"}}),children:[(0,t.jsx)(k.o,{color:"success.600",sx:Object.assign({}
1,X),children:"Teams"}),(0,t.jsx)(Q.g,{imagesWithName:null===(n=e.teamMembers)||void 0===n?void 0:n.map(e=>{var i;return{image:null===(i=e.member)||void 0===i?void 0:i.profileImage,name:e.member.firstName?(0,G.M)(null==e?void 0:e.member.firstName,null==e?void 0:e.member.lastName):r("INVITED_USER")}}),tooltipProps:J,max:3})]}):"clients"===e.visibility?(0,t.jsxs)(S.a,{sx:Object.assign(Object.assign({},q.A.flexStart),{gap:".875rem","& .MuiAvatar-root:last-child":{marginLeft:"-8px !important"}}),children:[(0,t.jsx)(k.o,{color:"primary.500",sx:Object.assign({},X),children:"Clients"}),(0,t.jsx)(Q.g,{imagesWithName:null===(a=e.clients)||void 0===a?void 0:a.map(e=>{var i;return{image:null===(i=e.member)||void 0===i?void 0:i.profileImage,name:e.member.firstName?(0,G.M)(null==e?void 0:e.member.firstName,null==e?void 0:e.member.lastName):r("INVITED_USER")}}),tooltipProps:J,max:3})]}):(0,t.jsx)(k.o,{color:"secondary.400",sx:Object.assign({},X),children:"Admins"})},ie=e=>{var i,l;if("custom"===e.appType){const l=e.iconLink?W.jq.selectableIconsMap[e.iconLink]:void 0;if(l)return(0,t.jsx)(l,{style:{width:"100%",height:"100%"}});const o=W.jq.getCustomImageIconUrl(e.iconLink);return o?(0,t.jsx)("img",{src:o,alt:""}):null!==(i=V.embeddedAppsListIconMap[e.appType])&&void 0!==i?i:null}return null!==(l=V.embeddedAppsListIconMap[e.appType])&&void 0!==l?l:null},le=({embed:e,typeLabel:i,sortable:l,onOpenMenu:o,onView:s})=>{var n;const{t:a}=(0,v.A)(),{theme:r}=(0,j.A)(),{user:d}=(0,f.Ay)(),{handleSidebarVisibility:c}=(0,Z.A)(),{attributes:m,listeners:u,setNodeRef:p,setActivatorNodeRef:b,transform:h,transition:g,isDragging:x}=(0,A.gl)({id:e._id,disabled:!l}),y=Boolean(null===(n=e.members.find(e=>e.member._id===(null==d?void 0:d._id)))||void 0===n?void 0:n.isSidebar);return(0,t.jsxs)("div",Object.assign({ref:p},m,{className:"ee-embed-row"+(x?" ee-embed-row--dragging":""),style:{transform:H.Ks.Transform.toString(h),transition:g},children:[(0,t.jsx)("button",Object.assign({type:"button",ref:b,className:"ee-embed-row__handle"+(l?"":" ee-embed-row__handle--disabled"),"aria-label":`Reorder ${e.title}`,disabled:!l},l?u:{},{children:(0,t.jsx)(Y.A,{size:16,strokeWidth:1.75,"aria-hidden":"true"})})),(0,t.jsx)("span",{className:"ee-embed-row__icon",children:ie(e)}),(0,t.jsxs)("div",{className:"ee-embed-row__body",children:[(0,t.jsxs)("div",{className:"ee-embed-row__top",children:[(0,t.jsxs)("div",{className:"ee-embed-row__titleblock",children:[(0,t.jsx)(z.A,{text:e.title,truncateLength:70,textStyle:{color:r.palette.otColors.secondary[600],fontSize:".875rem",fontWeight:500,lineHeight:"140%"}}),(0,t.jsxs)("span",{className:"ee-embed-row__visibility",children:["Visible to: ",(0,t.jsx)(ee,{embedData:e})]})]}),(0,t.jsxs)("div",{className:"ee-embed-row__meta",children:[(0,t.jsx)("span",{className:"ee-embed-row__chip",children:i}),(0,t.jsxs)("button",{type:"button",className:"ee-embed-row__view","aria-label":`View ${e.title}`,onClick:i=>{i.stopPropagation(),s(e)},children:[(0,t.jsx)(F.A,{size:16,strokeWidth:1.75,"aria-hidden":"true"}),a("VIEW",{defaultValue:"View"})]}),(0,t.jsx)("button",{type:"button",className:"ee-embed-row__kebab","aria-label":`Actions for ${e.title}`,onClick:i=>{i.stopPropagation(),o(i,e)}
1,children:(0,t.jsx)(U.A,{sx:{fontSize:18}})})]})]}),(0,t.jsxs)("div",{className:"ee-embed-row__toggle-row",children:[(0,t.jsx)("span",{className:"ee-embed-row__toggle-label",children:a("SHOW_APP_IN_YOUR_SIDEBAR")}),(0,t.jsx)($.U,{size:"small",checked:y,onChange:(i,l)=>{c(l,e._id)},sx:{"& .MuiSwitch-track":{backgroundColor:r.palette.otColors.secondary[200]}}})]})]})]}))};var te=l(94017),oe=l(57710),se=l(9483);const ne=({value:e,onChange:i})=>{var l;const{t:o}=(0,v.A)(),{theme:s}=(0,j.A)(),n=(0,h.f)(),a=[{value:"none",label:o("NONE",{defaultValue:"None"})},{value:"type",label:o("TYPE",{defaultValue:"Type"})}],r=null===(l=a.find(i=>i.value===e))||void 0===l?void 0:l.label;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"ee-groupby-trigger",onClick:e=>n.open(e),children:[(0,t.jsx)(oe.A,{sx:{fontSize:16}}),(0,t.jsxs)("span",{className:"ee-groupby-trigger__label",children:[o("GROUP_BY"),": ",(0,t.jsx)("strong",{children:r})]}),(0,t.jsx)(se.A,{sx:{fontSize:18}})]}),(0,t.jsx)(w.W,{sx:{".MuiPaper-root":{border:`1px solid ${s.palette.otColors.secondary[200]}`,boxShadow:s.otShadows.md},"& .MuiPaper-rounded":{borderRadius:"8px"}},anchorEl:n.popoverEl,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(n.popoverEl),onClose:n.close,children:a.map(l=>(0,t.jsxs)(T.D,{sx:{minWidth:140,display:"flex",justifyContent:"space-between",gap:2,px:1.5},onClick:()=>{i(l.value),n.close()},children:[l.label,e===l.value?(0,t.jsx)(te.A,{sx:{fontSize:16}}):null]},l.value))})]})};var ae=l(62846),re=l(67772),de=l(36585),ce=l(32912),me=l(19276);const ue=({dialogProps:e})=>{var i;const{t:l}=(0,v.A)(),{theme:o}=(0,j.A)(),{navigate:s}=(0,g.A)(),{sidebarModuleName:n}=(0,x.A)();return(0,t.jsxs)(re.l,{open:null!==(i=null==e?void 0:e.isOpen)&&void 0!==i&&i,onClose:null==e?void 0:e.close,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{borderRadius:"8px"}},children:[(0,t.jsxs)(ae.L,{sx:Object.assign(Object.assign({px:3,py:1.5},q.A.flexSpaceBetween),{alignItems:"center"}),children:[(0,t.jsx)(ce.A,{csp:"secondary.900",fwt:600,fsz:20,children:l("__EMBED_APPS__",{moduleNameEmbed:l(n("item:embed").customNameSingular)})}),(0,t.jsx)(me.A,{onClick:e.close})]}),(0,t.jsx)(de.C,{dividers:!0,sx:{px:4.75,py:3.5,pb:4.75,display:"grid",gridTemplateColumns:"1fr 1fr",gap:3,[o.breakpoints.down("sm")]:{gridTemplateColumns:"1fr"}},children:(0,V.v6)(l,n).map(e=>(0,t.jsxs)(S.a,{sx:{px:2,py:1.5,display:"grid",gridTemplateColumns:"auto 1fr",gap:2,borderRadius:"4px",cursor:"pointer",border:`1px solid ${o.palette.otColors.secondary[200]}`},onClick:()=>{s(r.Ay.addNewEmbed.path+`?app-type=${e.type}`)},children:[e.icon,(0,t.jsxs)(S.a,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)(ce.A,{variant:"bodyMd",csp:"secondary.800",lh:"140%",fwt:600,children:e.label}),(0,t.jsx)(ce.A,{csp:"secondary.500",lh:"140%",children:e.description})]})]},e.type))})]})},ve=(e,i,l)=>!e.allTeamMembers||e.allClients||(null==l?void 0:l.length)?!e.allClients||e.allTeamMembers||(null==i?void 0:i.length)?e.allTeamMembers&&e.allClients?"all":!e.allTeamMembers&&!e.allClients&&(null==i?void 0:i.length)&&(null==l?void 0:l.length)?"teams_&_clients":e.allTeamMembers&&!e.allClients&&(null==l?void 0:l.length)?"all_team_members&&clients":!e.allTeamMembers&&e.allClients&&(null==i?void 0:i.length)?"all_clients&&teams":(null==i?void 0:i.length)?"teams":(null==l?void 0:l.length)?"clients":"admins":"all_clients":"all_team_members";l(13700),l(64193);const pe=()=>{var e,i,l,z,W;const{navigate:H}=(0,g.A)(),{t:U}=(0,v.A)(),{theme:$}=(0,j.A)(),{user:Y}=(0,f.Ay)(),{isSuperAdmin:F,isAdmin:Z,isAssignee:q,isClient:Q,isProjectManager:G}=(0,b.A)(),K=(0,u.A)(),{sidebarModuleName:X}=(0,x.A)(),[J,ee]=(0,B.useState)(""),[ie,te]=(0,B.useState)("none"),oe=(0,I.jE)(),{markAsBusy:se,markAsNotBusy:ae,errorToaster:re}=(0,p.A)(),de=(0,h.f)(),ce=(0,y.A)(),me=["company",c.A.getCompanyIdToken(),d.E5.EMBEDDED_APPS_LIST],pe=(0,P.I)({queryFn:o.Ay.embedApp.list,queryKey:me,select:e=>{var i;return Object.assign(Object.assign({},e.data),{data:null!==(i=e.data.data)&&void 0!==i?i:[]})},refetchOnMount:!0}),be=(0,B.useMemo)(()=>{var e,i;const l=(null!==(i=null===(e=pe.data)||void 0===e?void 0:e.data)&&void 0!==i?i:[]).map(e=>{const i=e.allTeamMembers?[]:e.members.filter(e=>{var i,l,t,o,s,n,a,r,c;return(null===(t=null===(l=null===(i=null==e?void 0:e.member)||void 0===i?void 0:i.role)||void 0===l?void 0:l.role)||void 0===t?void 0:t.name)!==d.z7.CLIENT&&(null===(n=null===(s=null===(o=null==e?void 0:e.member)||void 0===o?void 0:o.role)||void 0===s?void 0:s.role)||void 0===n?void 0:n.name)!==d.z7.ADMIN&&(null===(c=null===(r=null===(a=null==e?void 0:e.member)||void 0===a?void 0:a.role)||void 0===r?void 0:r.role)||void 0===c?void 0:c.name)!==d.z7.SUPERADMIN}),l=e.allClients?[]:e.members.filter(e=>{var i,l,t;return(null===(t=null===(l=null===(i=null==e?void 0:e.member)||void 0===i?void 0:i.role)||void 0===l?void 0:l.role)||void 0===t?void 0:t.name)===d.z7.CLIENT});return Object.assign(Object.assign({},e),{teamMembers:i,clients:l,visibility:ve(e,i,l)})});return l.filter(e=>((e,i,l)=>{const{isSuperAdmin:t,isAdmin:o,isAssignee:s,isProjectManager:n,isClient:a}=l;if(t||o)return!0;
1if(e.allTeamMembers&&(s||n))return!0;if(e.allClients&&a)return!0;if(e.teamMembers.length||e.clients.length){const l=e.teamMembers.some(e=>e.member._id===i),t=e.clients.some(e=>e.member._id===i);return l||t}return!1})(e,null==Y?void 0:Y._id,{isSuperAdmin:F,isAdmin:Z,isAssignee:q,isProjectManager:G,isClient:Q}))},[null===(e=pe.data)||void 0===e?void 0:e.data,null==Y?void 0:Y._id,F,Z,q,G,Q]),{filteredList:he}=(0,m.A)({search:J,list:be,attributes:["title"],isExact:!1}),ge="none"===ie&&!J.trim(),xe=(0,_.FR)((0,_.MS)(_.AN,{activationConstraint:{distance:8}})),je=(0,B.useMemo)(()=>{if("type"!==ie)return null;const e=[],i=new Map;return he.forEach(l=>{var t,o;const s=null!==(t=l.appType)&&void 0!==t?t:"custom";i.has(s)||(i.set(s,[]),e.push(s)),null===(o=i.get(s))||void 0===o||o.push(l)}),e.map(e=>{var l;return{appType:e,items:null!==(l=i.get(e))&&void 0!==l?l:[]}})},[ie,he]),ye=()=>K.open(),fe=U("__NEW_EMBED__",{moduleNameEmbed:U(X("item:embed").customNameSingular)}),_e=U("NO_EXTERNAL_APP_HAS_BEEN_EMBEDDED"),Ae=U("NO_EXTERNAL_APP_HAS_BEEN_EMBEDDED_DESCRIPTION"),Ee=e=>{"link"===e.type&&e.openInNewTab?window.open(e.content,"_blank","noopener,noreferrer"):H(r.Ay.embeddedAppView.path.replace(":id",e._id))},Ce=(e,i)=>{var l,o;return(0,t.jsx)(le,{embed:e,typeLabel:null!==(o=null!==(l=V.C_[e.appType])&&void 0!==l?l:e.appType)&&void 0!==o?o:"",sortable:i,onOpenMenu:(e,i)=>de.open(e,i),onView:Ee},e._id)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ue,{dialogProps:K}),(0,t.jsxs)(w.W,{sx:{".MuiPaper-root":{border:`1px solid ${$.palette.otColors.secondary[200]}`,boxShadow:$.otShadows.md},"& .MuiPaper-rounded":{borderRadius:"8px"}},anchorEl:de.popoverEl,anchorOrigin:{vertical:"bottom",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(de.popoverEl),onClose:de.close,children:[(0,t.jsx)(T.D,{sx:{minWidth:150,display:"flex",justifyContent:"space-between",gap:2,px:1.5},onClick:()=>{var e,i,l,t;H(r.Ay.updateEmbed.path.replace(":id",null!==(i=null===(e=de.popoverData)||void 0===e?void 0:e._id)&&void 0!==i?i:"")+`?app-type=${null!==(t=null===(l=de.popoverData)||void 0===l?void 0:l.appType)&&void 0!==t?t:""}`),de.close()},children:(0,t.jsx)(k.o,{sx:{fontSize:14,color:$.palette.otColors.secondary[900]},children:U("EDIT")})}),(0,t.jsx)(T.D,{sx:{minWidth:150,display:"flex",justifyContent:"space-between",gap:2,px:1.5},onClick:()=>{ce.open(de.popoverData),de.close()},children:(0,t.jsx)(k.o,{sx:{fontSize:14,color:$.palette.otColors.secondary[900]},children:U("REMOVE")})})]}),ce.show?(0,t.jsx)(s.u,{open:ce.show,onClose:ce.close,onCancel:ce.close,onConfirm:()=>{var e,i;return(async e=>{se();try{await o.Ay.embedApp.multiDelete({embedIds:[e]}),ae(),ce.close(),oe.invalidateQueries(me)}catch(e){ae(),re(e)}})(null!==(i=null===(e=ce.selectedData)||void 0===e?void 0:e._id)&&void 0!==i?i:"")},useTemplate:!1,titleContent:(0,t.jsxs)(k.o,{variant:"bodyMd",sx:{fontWeight:600,color:$.palette.otColors.secondary[900]},children:[U("DELETE")," ",null===(i=ce.selectedData)||void 0===i?void 0:i.title]}),descriptionContent:(0,t.jsx)(k.o,{variant:"bodySm",sx:{fontWeight:400,color:$.palette.otColors.secondary[700]},children:`${U("ARE_YOU_SURE_YOU_WANT_TO")} ${U("DELETE")} ${null===(l=ce.selectedData)||void 0===l?void 0:l.title}? ${U("THIS_ACTION_CANNOT_BE_UNDONE")}`}),icon:(0,t.jsx)(C.A,{fontSize:"inherit"}),cancelButtonText:U(s.d.cancel.NO_KEEP_IT),confirmButtonText:U(s.d.confirm.YES_DELETE_IT),cancelButtonVariant:"contained",cancelButtonProps:{sx:{bgcolor:e=>e.palette.otColors.primary[600],"&:hover":{bgcolor:e=>e.palette.otColors.primary[700]}}},confirmButtonVariant:"outlined"}):null,(0,t.jsxs)("div",{className:"ee-embeds-page-root",children:[(0,t.jsx)("div",{className:"ee-embeds-page-header",children:(0,t.jsx)(R.A,{as:"header",className:"ee-embeds-header",children:(0,t.jsxs)("div",{className:"ee-embeds-header__top",children:[(0,t.jsx)("div",{className:"ee-embeds-header__copy",children:(0,t.jsx)("h1",{className:"ee-embeds-header__title",children:U("__EMBEDS__",{moduleName:U(X("item:embed").customNamePlural)})})}),(0,t.jsxs)("div",{className:"ee-embeds-header__actions",children:[(0,t.jsxs)("label",{className:"ee-embeds-search",children:[(0,t.jsx)(L.A,{size:16,strokeWidth:1.75,className:"ee-embeds-search__icon","aria-hidden":"true"}),(0,t.jsx)("input",{type:"text",className:"ee-embeds-search__input",value:J,onChange:e=>ee(e.target.value),placeholder:U("SEARCH_BY_PLACEHOLDER_IN_INTEGRATIONS_PAGE")})]}),(null!==(W=null===(z=pe.data)||void 0===z?void 0:z.data.length)&&void 0!==W?W:0)>0?(0,t.jsx)(ne,{value:ie,onChange:te}):null,(0,t.jsxs)(n.dB,{type:"button",variant:"primary",onClick:ye,children:[(0,t.jsx)(E.A,{fontSize:"inherit"}),fe]})]})]})})}),(0,t.jsxs)("div",{className:"ee-embed-scroll-area",children:[pe.isLoading?(0,t.jsx)(S.a,{sx:{padding:"1.5rem",bgcolor:$.palette.otColors.table.backgroundColor},children:Array(5).fill(1).map((e,i)=>(0,t.jsx)(N.A,{variant:"rectangular",width:"100%",height:72,sx:{bgcolor:$.palette.otColors.secondary[200],borderRadius:"10px",mb:2}}
1,i))}):null,pe.isSuccess&&0!==he.length?(0,t.jsx)(R.A,{as:"div",className:"ee-embed-list-wrap",children:(0,t.jsx)(_.Mp,{sensors:xe,collisionDetection:_.fp,onDragEnd:async e=>{if(!ge)return;const{active:i,over:l}=e;if(!l||i.id===l.id)return;const t=he.findIndex(e=>e._id===i.id),s=he.findIndex(e=>e._id===l.id);if(-1===t||-1===s)return;const n=(0,A.be)(he,t,s).map(e=>e._id);oe.setQueryData(me,e=>{var i;if(!(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.data))return e;const l=[...e.data.data].sort((e,i)=>n.indexOf(e._id)-n.indexOf(i._id));return Object.assign(Object.assign({},e),{data:Object.assign(Object.assign({},e.data),{data:l})})});try{await o.Ay.embedApp.changePosition({body:{embedId:i.id,newPosition:s}}),oe.invalidateQueries(me)}catch(e){re(e),oe.invalidateQueries(me)}},children:(0,t.jsx)(A.gB,{items:he.map(e=>e._id),strategy:A._G,children:je?je.map(e=>{var i;return(0,t.jsxs)("div",{className:"ee-embed-group",children:[(0,t.jsx)("div",{className:"ee-embed-group__header",children:(null!==(i=V.C_[e.appType])&&void 0!==i?i:e.appType).toUpperCase()}),e.items.map(e=>Ce(e,!1))]},e.appType)}):he.map(e=>Ce(e,ge))})})}):null,pe.isError||pe.isSuccess&&0===he.length?(0,t.jsxs)(S.a,{sx:{padding:"1.5rem",bgcolor:$.palette.otColors.table.backgroundColor},children:[(0,t.jsx)(O.A,{isShow:pe.isError,onRetryButton:pe.refetch}),(0,t.jsx)(M.A,{isShow:pe.isSuccess&&0===he.length&&!!J,text2:U("__EMPTY_SEARCHED_LIST_TEXT__",{name:`"${J}"`}),svg:(0,t.jsx)(D.A,{})}),(0,t.jsx)(M.A,{isShow:pe.isSuccess&&0===he.length&&!J,svg:(0,t.jsx)(a.q,{}),buttonTitle:fe,onCreateButton:ye,text1:_e,text2:Ae})]}):null]})]})]})}},66052(e,i,l){var t=l(57296),o=l(19747),s=l.n(o),n=l(58156),a=l.n(n),r=l(79859),d=l.n(r),c=l(42426),m=l.n(c);l.d(i,["Y",0,(e,i)=>{var l,o,n,r,c,u,v,p,b,h,g,x;if(0===(null==i?void 0:i.length))return!0;const j={},y=null==i?void 0:i.find(e=>{var i,l,t,o;return void 0!==(null===(l=null===(i=null==e?void 0:e.key)||void 0===i?void 0:i.item)||void 0===l?void 0:l.minValue)||void 0!==(null===(o=null===(t=null==e?void 0:e.key)||void 0===t?void 0:t.item)||void 0===o?void 0:o.maxValue)}),f=null==i?void 0:i.find(e=>{var i,l,t,o;return void 0!==(null===(l=null===(i=null==e?void 0:e.key)||void 0===i?void 0:i.item)||void 0===l?void 0:l.startDate)||void 0!==(null===(o=null===(t=null==e?void 0:e.key)||void 0===t?void 0:t.item)||void 0===o?void 0:o.endDate)});i.forEach(e=>{var i,l,t,o,s,n,a,r,d,c,m,u,v;const p=null===(i=null==e?void 0:e.key)||void 0===i?void 0:i.identifier,b=void 0!==(null===(t=null===(l=null==e?void 0:e.key)||void 0===l?void 0:l.item)||void 0===t?void 0:t.minValue)||void 0!==(null===(s=null===(o=null==e?void 0:e.key)||void 0===o?void 0:o.item)||void 0===s?void 0:s.maxValue)?null==e?void 0:e.key:void 0,h=void 0!==(null===(a=null===(n=null==e?void 0:e.key)||void 0===n?void 0:n.item)||void 0===a?void 0:a.startDate)||void 0!==(null===(d=null===(r=null==e?void 0:e.key)||void 0===r?void 0:r.item)||void 0===d?void 0:d.endDate)?null==e?void 0:e.key:void 0;if(!(null==b?void 0:b.identifier)&&!h)if(j[p]){const i=[...j[p]];i.push(null===(m=null===(c=null==e?void 0:e.key)||void 0===c?void 0:c.item)||void 0===m?void 0:m.value),j[p]=i}else j[p]=[null===(v=null===(u=null==e?void 0:e.key)||void 0===u?void 0:u.item)||void 0===v?void 0:v.value]});const _=Object.keys(j);let A=0;null==_||_.forEach(i=>{const l=i.split("."),t=l.length>1,o=t?l.slice(0,-1).join("."):void 0,s=o?a()(e,o):void 0,n=a()(e,i),r=a()(j,i);if(!r||0===r.length)return;if(Array.isArray(s)||Array.isArray(n)){const e=Array.isArray(s)?s:Array.isArray(n)?n:[];if(t&&Array.isArray(s)){const e=l[l.length-1],i=s.map(i=>null==i?void 0:i[e]).filter(e=>null!=e);m()(r,e=>d()(i,e))&&(A+=1)}else{const i=null==e?void 0:e.map(e=>{var i,l;return"string"==typeof e?e:(null===(i=null==e?void 0:e.label)||void 0===i?void 0:i._id)?null===(l=null==e?void 0:e.label)||void 0===l?void 0:l._id:null==e?void 0:e._id}),l=m()(r,e=>d()(i,e));l&&(A+=1)}return}const c=(()=>{var e,i,l;if(null==n)return n;if("object"!=typeof n)return n;const t=null!==(e=a()(n,"_id"))&&void 0!==e?e:a()(n,"id");return void 0!==t?t:null==s||"object"!=typeof s?s:null!==(l=null!==(i=a()(s,"_id"))&&void 0!==i?i:a()(s,"id"))&&void 0!==l?l:s})();if(null==c)return;const u=String(c);r.some(e=>String(e)===u)&&(A+=1)});const E=[],C=A===(null==_?void 0:_.length);if(E.push(C),null===(l=null==f?void 0:f.key)||void 0===l?void 0:l.identifier){const i=new Date(t.Ay.get(a()(e,null===(o=null==f?void 0:f.key)||void 0===o?void 0:o.identifier)).format("YYYY-MM-DD")),l=new Date(null===(r=null===(n=null==f?void 0:f.key)||void 0===n?void 0:n.item)||void 0===r?void 0:r.startDate),s=new Date(null===(u=null===(c=null==f?void 0:f.key)||void 0===c?void 0:c.item)||void 0===u?void 0:u.endDate),d=i>=l&&i<=s;E.push(d)}if(null===(v=null==y?void 0:y.key)||void 0===v?void 0:v.identifier){const i=a()(e,null===(p=null==y?void 0:y.key)||void 0===p?void 0:p.identifier),l=+i>=+(null===(h=null===(b=null==y?void 0:y.key)||void 0===b?void 0:b.item)||void 0===h?void 0:h.minValue)&&+i<=+(null===(x=null===(g=null==y?void 0:y.key)||void 0===g?void 0:g.item)||void 0===x?void 0:x.maxValue);E.push(l)}return s()(E,e=>!0===e)}])},83175(e,i,l){l.d(i,["i",0,e=>!!(e&&Array.isArray(e)&&e.length)])},29438(e,i,l){var t=l(58156),o=l.n(t);l.d(i,["q",0,(e,i,l)=>{const t=[...e];return"+"===l?t.sort((e,l)=>{var t,s;return o()(e,i)?o()(l,i)?isNaN(Number(o()(e,i)))||isNaN(Number(o()(l,i)))?"string"==typeof o()(e,i)?(null===(t=o()(e,i))||void 0===t?void 0:t.toLowerCase())>(null===(s=o()(l,i))||void 0===s?void 0:s.toLowerCase())?1:-1:o()(e,i)>o()(l,i)?1:-1:+o()(e,i)>+o()(l,i)?1:-1:-1:1}):"-"===l?t.sort((e,l)=>{var t,s;return o()(e,i)?o()(l,i)?isNaN(Number(o()(e,i)))||isNaN(Number(o()(l,i)))?"string"==typeof o()(e,i)?(null===(t=o()(l,i))||void 0===t?void 0:t.toLowerCase())>(null===(s=o()(e,i))||void 0===s?void 0:s.toLowerCase())?1:-1:o()(l,i)>o()(e,i)?1:-1:+o()(l,i)>+o()(e,i)?1:-1:-1:1}):t}])}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.