1import{_ as fe,r as o,b as Ce,$ as ye,c as Ae,j as e,bh as Be,bi as Ue,aF as Ie,bj as ge,bk as ze,bl as Ye,K as Ze,bm as He,bn as ue,bo as he,bp as ve,aH as de,bq as me,br as Te,bs as F,bt as Ke,bu as Se,bv as $,bw as B,bx as P,G as Ee,bc as Qe,by as ae,ay as Je,bz as se,bA as We,aB as Xe,J as Z,a2 as be,I as qe,bB as b,bC as es,bg as ss,aG as we,aJ as ts,A as as}from"./index-MwKzwEnF.js";import{D as Me}from"./DeleteIcon-DMQeOnuV.js";import{S as ke}from"./ShareIcon-MqMZNfks.js";import{C as rs}from"./ConfirmDeleteBg-CR1DrI3-.js";import{A as ls}from"./MeetingEvents-BKSw2ZjC.js";import{C as is,a as ns}from"./CopyIcon-Cr5SDF17.js";import{E as cs}from"./EditIcon-He5W9X-B.js";import{S as os}from"./ShareToSocialMedia-Dj4_7Pqf.js";import{H as Pe}from"./HasPermission-B4EV2thR.js";import{F as ds,a as ms}from"./Filter_Icon-CcMMMTl0.js";import{I as xe,a as pe}from"./index-CCjUFsZM.js";import"./CustomCards-BCpeX_0V.js";import"./_baseIsEqual-DUrvAf9p.js";import"./DownArrow-C6kKMvQi.js";import"./checkbox.esm-9iKM-QvT.js";import"./iconBase-D1v0Xrsh.js";const xs="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cdefs%3e%3cclipPath%20id='clip-path'%3e%3crect%20id='Rectangle_32939'%20data-name='Rectangle%2032939'%20width='20'%20height='20'%20transform='translate(-22835%20-5205)'%20fill='%23fff'%20stroke='%237c7b7b'%20stroke-width='1'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20id='Mask_Group_3183'%20data-name='Mask%20Group%203183'%20transform='translate(22835%205205)'%20clip-path='url(%23clip-path)'%3e%3cpath%20id='Path_108852'%20data-name='Path%20108852'%20d='M1756.386,1520.455h-7.79a4.463,4.463,0,0,1-2.1-.272,2.5,2.5,0,0,1-1.075-1.074,4.461,4.461,0,0,1-.272-2.1v-4.544a4.463,4.463,0,0,1,.272-2.1,2.5,2.5,0,0,1,1.074-1.074,4.463,4.463,0,0,1,2.1-.272h.611v-1.584a3.284,3.284,0,1,1,6.568,0v1.584h.61a4.482,4.482,0,0,1,2.1.27,2.509,2.509,0,0,1,1.078,1.059l.017.032a4.645,4.645,0,0,1,.256,2.085v4.544a4.645,4.645,0,0,1-.256,2.085l-.017.032a2.51,2.51,0,0,1-1.078,1.059A4.478,4.478,0,0,1,1756.386,1520.455Zm-7.79-9.737a4.526,4.526,0,0,0-1.325.085.8.8,0,0,0-.337.337,4.535,4.535,0,0,0-.085,1.324v4.544a4.518,4.518,0,0,0,.085,1.325.8.8,0,0,0,.338.337,4.539,4.539,0,0,0,1.323.085h7.79a4.523,4.523,0,0,0,1.325-.085l.007,0a.819.819,0,0,0,.337-.332,5.062,5.062,0,0,0,.078-1.326v-4.544a5.071,5.071,0,0,0-.078-1.326.819.819,0,0,0-.336-.331l-.007,0a4.526,4.526,0,0,0-1.325-.085Zm2.311-1.7h3.168v-1.584a1.584,1.584,0,1,0-3.168,0Z'%20transform='translate(-24577.5%20-6707.303)'%20fill='%237c7b7b'/%3e%3c/g%3e%3c/svg%3e",ps=({meetingId:l,title:g,type:u,duration:h,platform:y,description:p,hostEmail:i,allowInvitesToAddGuest:E,participantsCount:M,isActive:C,onToggleActive:m,isSelected:t,onSelect:n,onDeleteClick:A,underlineColor:N,dateRange:T,scheduleId:R,isBufferTimeEnabled:D,bufferBefore:k,bufferAfter:G,isMinimumNoticeEnabled:H,noticeBefore:v,noticeAfter:L,isDailyLimitEnabled:K,dailyLimit:U,isTimeZoneEnabled:a,inviteTimeZone:c,lockTimeZone:x,eventLinkName:I,inviteQuestions:Q,allowTextReminders:z,allowEmailReminders:J,allowEmailFollowUps:W,onPopupToggle:w,appNotConfigured:_,isPopupVisible:re,customDuration:le,isPublic:X,inviteeCallMe:ie,callMyInvitee:ne,isPaymentFree:q,currency:ce,amount:s})=>{var Ne;const r=fe(j=>j.authStore.existingUser),[f,d]=o.useState(!1),O=Ce(),De=`${(Ne=window._env_)==null?void 0:Ne.VITE_FRONTEND_URL}/${r==null?void 0:r.linkPathName}/${I}`,Le=o.useRef(null),oe=ye(),Oe=Ae(),je=j=>{j.stopPropagation();const S={meetingId:l,isPaymentFree:q,currency:ce,amount:s,appNotConfigured:_,meetingType:u,meetingName:g,duration:h,locations:y,colorCode:N,description:p,hostEmail:i,allowInvitesToAddGuest:E,participantsCount:M,dateRange:T,scheduleId:R,isBufferTimeEnabled:D,bufferBefore:k,bufferAfter:G,isMinimumNoticeEnabled:H,noticeBefore:v,noticeAfter:L,isDailyLimitEnabled:K,dailyLimit:U,isTimeZoneEnabled:a,inviteTimeZone:c,lockTimeZone:x,eventLinkName:I,inviteQuestions:Q,allowTextReminders:z,allowEmailReminders:J,allowEmailFollowUps:W,customDuration:le,isPublic:X,inv
1iteeCallMe:ie,callMyInvitee:ne};oe(Te(S)),localStorage.setItem("meetingId",String(l)),O("/MeetingTypeSteps",{state:{meetingType:S,initialStep:null,isNewMeeting:!1}}),w(l)},Ve=j=>{j.stopPropagation(),A(l),w(l)},Fe=()=>{d(!0)},Re=()=>{d(!1)},Ge=async j=>{j.stopPropagation();try{const S=await F.getmeetingTypeById(l);sessionStorage.setItem("NewMeetingType",JSON.stringify(!0)),oe(Te({...S.data,meetingId:"",meetingName:""})),O("/MeetingTypeSteps",{state:{meetingType:S.data,initialStep:Ke.MEETING_DETAILS,isNewMeeting:!0}})}catch(S){console.error("Error fetching meeting type:",S)}w(l)},_e=j=>{if(typeof j=="string")return j;const{value:S,unit:ee}=j;if(ee.toLowerCase()==="minutes"&&S>=60){const V=Math.floor(S/60),Y=S%60;return Y===0?`${V} hr${V>1?"s":""}`:`${V} hr${V>1?"s":""} ${Y} min${Y>1?"s":""}`}return`${S} ${ee}`},$e=async j=>{var ee;const S={isActive:j};if(l){const V=await F.editMeetingType(l,S);oe(Se()),Oe.success("Meeting type updated successfully"),m&&m(l,j);const Y=(ee=V==null?void 0:V.data)==null?void 0:ee.meetingId;Y?localStorage.setItem("meetingId",Y):console.warn("No meetingId found in the response."),console.log("Meeting updated:",V.data)}return!1};return e.jsx(e.Fragment,{children:e.jsxs(ls,{className:`group bg-white rounded-lg shadow-sm p-4 border-b-4 h-fit ${t?"border-tealGreen":""}`,style:{borderBottomColor:N},children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:`cursor-pointer ${t?"block":"hidden group-hover:block"}`,checked:t,onChange:()=>n(l)}),e.jsx("div",{className:"max-w-[200px]",children:e.jsx("h2",{className:"text-md font-semibold text-black cursor-pointer truncate overflow-hidden whitespace-nowrap",title:g,onClick:je,children:g})})]}),e.jsxs("div",{className:"relative flex items-center space-x-2",children:[_?e.jsx("div",{className:"shrink-0 px-2 rounded-full bg-yellow-100 border border-yellow-700 text-[10px] text-yellow-800 font-medium",children:"App not configured"}):e.jsx("div",{title:C?"Hide from booking page":"Display on booking page",children:e.jsx(Be,{initialState:C,onToggle:$e})}),e.jsx("button",{className:"text-gray-400",onClick:j=>{j.stopPropagation(),w(l)},children:e.jsx("img",{src:Ue,alt:"Menu icon",className:"w-4 h-3"})}),re&&e.jsxs("div",{ref:Le,className:"popup-element absolute right-0 mt-[120px] w-auto min-w-[160px] bg-white border border-gray-300 rounded-lg shadow-lg overflow-hidden z-10",onClick:j=>j.stopPropagation(),children:[e.jsxs("button",{className:"flex items-center px-4 py-2 w-full text-left whitespace-nowrap hover:bg-gray-100",onClick:je,children:[e.jsx("div",{className:"w-5 flex justify-center mr-2",children:e.jsx("img",{src:cs,alt:"Edit",className:"w-3 h-5"})}),e.jsx("span",{children:"Edit"})]}),e.jsx("button",{className:"flex items-center px-4 py-2 w-full text-left whitespace-nowrap hover:bg-gray-100",onClick:Ge,children:e.jsx(Pe,{feature:Ie.MEETING_TYPE,children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex justify-center items-center mr-2",children:e.jsx("img",{src:is,alt:"copy",className:"w-3 h-5"})}),e.jsx("span",{children:"Clone"})]})})}),e.jsxs("button",{className:"flex items-center px-4 py-2 w-full text-left whitespace-nowrap hover:bg-gray-100",onClick:Ve,children:[e.jsx("div",{className:"w-5 flex justify-center mr-2",children:e.jsx("img",{src:Me,alt:"Delete",className:"w-3 h-5"})}),e.jsx("span",{children:"Delete"})]})]})]})]}),e.jsx("hr",{}),e.jsxs("div",{className:"gap-6 items-center space-x-2 text-sm text-grey mb-6 mt-2",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("img",{src:u===ge.ONE_TO_ONE?ze:u===ge.GROUP?Ye:ns,alt:u,className:"w-6 h-6"}),e.jsx("span",{className:"lg:text-xs 2xl:text-sm text-grey",children:Ze[u]})]}),e.jsx("span",{className:"mx-2",children:"|"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:He,alt:"Clock icon",className:"w-3 h-3"}),e.jsx("span",{className:"lg:text-xs 2xl:text-sm text-grey",children:_e(h)})]}),e.jsx("span",{className:"mx-2",children:"|"}),e.jsx("div",{className:"flex items-center text-xs",children:q==!1&&typeof q=="boolean"?"Paid":"Free"})]}),e.jsxs("div",{className:"flex justify-center items-center bg-light-Grey p-2 rounded-lg mt-2 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("img",{src:ue(y),alt:he(y),className:"w-4 h-4 object-contain"}),e.jsx("span",{className:"text-black lg:text-xs 2xl:text-sm",children:he(y)})]}),e.jsx("span",{className:"text-gray-400 text-lg leading-none",children:"â¢"}),e.jsxs("div",{className:"flex items-center gap-1 text-gray-600 lg:text-xs 2xl:text-sm",children:[e.jsx("img",{src:X?ve:xs,alt:"",className:"w-4 h-4"}),e.jsx("span",{children:X?"Public":"Private"})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between space-x-2 ",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"bg-light-Grey rounded-sm p-2",children:e.jsx("img",{src:de(typeof i=="object"&&(i==null?void 0:i.calendarName)||me.OUTLOOK).image,alt:`${de(typeof i=="object"&&(i==null?void 0:i.calendarName)||me.OUTLOOK).displayName} 2 calendarProviderInfoMap[ 3 (typeof hostEmail === "object" && 4 hostEmail?.calendarName) || 5 "GOOGLE" 6 ]?.displayName 7 } 8 Calendar`,className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-black",children:[de(typeof i=="object"&&(i==null?void 0:i.calendarName)||me.OUTLOOK).displayName," ","Calendar"]}),e.jsx("p",{className:"text-[10px] text-grey",children:typeof i=="object"?(i==null?void 0:i.calendarEmail.length)>25?(i==null?void 0:i.calendarEmail.slice(0,25))+"...":i==null?void 0:i.calendarEmail:"N/A"})]})]}),e.jsx("div",{children:e.jsxs("button",{className:"group/icon flex items-center space-x-2 text-sm text-black hover:text-white px-2 py-1 rounded-xl bg-lightcyan hover:bg-tealGreen ",onClick:Fe,children:[e.jsx("img",{src:ke,alt:"Share",className:"w-3 h-3 group-hover/icon:invert group-hover/icon:brightness-200"}),e.jsx("span",{className:" lg:text-xs 2xl:text-sm",children:"Share"})]})})]}),f&&e.jsx(os,{isOpen:f,onClose:Re,meetingUrl:De,meetingTitle:g,summary:"Join our weekly team sync meeting to discu
8ss project updates",meetingId:l})]})})};function gs(l,g){const[u,h]=o.useState(l);return o.useEffect(()=>{const y=setTimeout(()=>{h(l)},g);return()=>{clearTimeout(y)}},[l,g]),u}const us=()=>e.jsx("div",{className:"skeleton-card p-4 rounded-lg shadow-md w-full h-[180px] bg-gray-200",children:e.jsxs("div",{className:"animate-pulse flex flex-col gap-4",children:[e.jsx("div",{className:"h-6 w-2/3 bg-gray-300 rounded"}),e.jsxs("div",{className:"flex items-center gap-4 justify-between",children:[e.jsx("div",{className:"h-4 w-1/4 bg-gray-300 rounded"}),e.jsx("div",{className:"h-4 w-1/6 bg-gray-300 rounded"})]}),e.jsx("div",{className:"h-8 bg-gray-300 rounded flex justify-center"}),e.jsxs("div",{className:"flex gap-4 justify-between pb-4",children:[e.jsx("div",{className:"h-8 w-1/4 bg-gray-300 rounded"}),e.jsx("div",{className:"h-8 w-1/4 bg-gray-300 rounded"})]})]})}),hs=Object.values(ge),fs=Object.values($),ys=Object.values(B),bs=({filters:l,setFilters:g})=>{const[u,h]=o.useState([]),[y,p]=o.useState(!1),[i,E]=o.useState(!1),[M,C]=o.useState(!1),[m,t]=o.useState(!1),[n,A]=o.useState(!1),N=async()=>{try{const a=await Qe.get("/api/users/getcalendardetail/");a.data&&Array.isArray(a.data.data)&&h(a.data.data)}catch(a){console.error("Error fetching calendar details:",a)}};o.useEffect(()=>{N()},[]);const T={[P.CALENDAR]:o.useRef(null),[P.LOCATION]:o.useRef(null),[P.MEETING_TYPE]:o.useRef(null),[P.ACCESS]:o.useRef(null),[P.STATUS]:o.useRef(null)};Ee({refs:[{ref:T[P.CALENDAR],onOutsideClick:()=>p(!1)},{ref:T[P.LOCATION],onOutsideClick:()=>E(!1)},{ref:T[P.MEETING_TYPE],onOutsideClick:()=>C(!1)},{ref:T[P.ACCESS],onOutsideClick:()=>t(!1)},{ref:T[P.STATUS],onOutsideClick:()=>A(!1)}]});const R=a=>{g(c=>({...c,calendars:c.calendars.includes(a)?c.calendars.filter(x=>x!==a):[...c.calendars,a]}))},D=a=>We(a),k=a=>{const c=D(a);c!==void 0&&g(x=>({...x,meetingLocations:x.meetingLocations.includes(c)?x.meetingLocations.filter(I=>I!==c):[...x.meetingLocations,c]}))},G=a=>{const c=a;g(x=>({...x,meetingTypes:x.meetingTypes.includes(c)?x.meetingTypes.filter(I=>I!==c):[...x.meetingTypes,c]}))},H=a=>{g(c=>({...c,access:c.access.includes(a)?c.access.filter(x=>x!==a):[...c.access,a]}))},v=a=>{g(c=>({...c,status:c.status.includes(a)?c.status.filter(x=>x!==a):[...c.status,a]}))},L=(a,c,x,I,Q,z,J,W)=>e.jsxs("div",{className:"flex items-center gap-5",ref:J,children:[e.jsx("label",{className:"lg:text-xs 2xl:text-sm text-black w-32",children:a}),e.jsxs("div",{className:"relative flex-grow",children:[e.jsxs("div",{className:"w-[330px] pl-3 pr-2 py-2 border border-gray-300 focus:outline-none focus:ring-teal-500 focus:border-teal-500 lg:text-xs 2xl:text-sm rounded-md bg-white cursor-pointer flex items-center justify-between",onClick:()=>Q(!I),children:[e.jsx("span",{children:x.length?`${x.length} ${a.toLowerCase()}(s) selected`:`Select ${a.toLowerCase()}`}),I?e.jsx(xe,{className:"w-3"}):e.jsx(pe,{className:"w-3"})]}),I&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg",children:c.map(w=>e.jsxs("div",{className:"flex items-center px-3 py-2 hover:bg-gray-100 cursor-pointer",onClick:()=>z(w),children:[e.jsx("input",{type:"checkbox",id:`${a}-${w}`,checked:x.includes(w),onChange:()=>z(w),className:"mr-2 cursor-pointer",onClick:_=>_.stopPropagation()}),W,e.jsx("label",{htmlFor:`${a}-${w}`,className:"lg:text-xs 2xl:text-sm cursor-pointer",onChange:()=>z(w),onClick:_=>_.stopPropagation(),children:a==="Meeting Type"&&w in ae?ae[w]:w})]},w))})]})]}),K=()=>e.jsxs("div",{className:"flex items-center gap-5",ref:T.calendar,children:[e.jsx("label",{className:"lg:text-xs 2xl:text-sm text-black w-32",children:"Calendar"}),e.jsxs("div",{className:"relative flex-grow",children:[e.jsxs("div",{className:"w-[330px] pl-3 pr-2 py-2 border border-gray-300 focus:outline-none focus:ring-teal-500 focus:border-teal-500 lg:text-xs 2xl:text-sm rounded-md bg-white cursor-pointer flex items-center justify-between",onClick:()=>p(!y),children:[e.jsx("span",{children:l.calendars.length?`${l.calendars.length} calendar(s) selected`:"Select calendars"}),y?e.jsx(xe,{className:"w-3"}):e.jsx(pe,{className:"w-3"})]}),y&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-[6rem] overflow-y-auto",children:u.map(a=>e.jsxs("div",{className:"flex items-center px-3 py-2 hover:bg-gray-100 cursor-pointer",onClick:()=>R(a.userCalendarID),children:[e.jsx("input",{type:"checkbox",id:`calendar-${a.userCalendarID}`,checked:l.calendars.includes(a.userCalendarID),onChange:()=>R(a.userCalendarID),className:"mr-2 cursor-pointer",onClick:c=>c.stopPropagation()}
8),e.jsx("img",{src:Je(a.calendarName),alt:a.calendarName,className:"w-4 h-4 mr-2"}),e.jsx("label",{htmlFor:`calendar-${a.userCalendarID}`,className:"lg:text-xs 2xl:text-sm cursor-pointer",onChange:()=>R(a.userCalendarID),onClick:c=>c.stopPropagation(),children:a.calendarEmail})]},a.userCalendarID))})]})]}),U=()=>e.jsxs("div",{className:"flex items-center gap-5",ref:T.location,children:[e.jsx("label",{className:"lg:text-xs 2xl:text-sm text-black w-32",children:"Location"}),e.jsxs("div",{className:"relative flex-grow",children:[e.jsxs("div",{className:"w-[330px] pl-3 pr-2 py-2 border border-gray-300 rounded-md bg-white cursor-pointer flex items-center justify-between text-xs",onClick:()=>E(!i),children:[e.jsx("span",{children:l.meetingLocations.length?`${l.meetingLocations.length} location(s) selected`:"Select location"}),i?e.jsx(xe,{className:"w-3"}):e.jsx(pe,{className:"w-3"})]}),i&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg cursor-pointer",children:[se.IN_PERSON,se.PHONE_CALL,se.GOOGLE_MEET,se.MICROSOFT_TEAMS,se.WEBEX_MEETING].map(a=>{const c=D(a);return e.jsxs("div",{className:"flex items-center px-3 py-2 hover:bg-gray-100",onClick:()=>k(a),children:[e.jsx("input",{type:"checkbox",id:`location-${a}`,checked:c!==void 0&&l.meetingLocations.includes(c),onChange:()=>k(a),className:"mr-2 cursor-pointer",onClick:x=>x.stopPropagation()}),ue&&e.jsx("img",{src:ue(a),alt:a,className:"w-5 h-5 mr-2"}),e.jsx("label",{htmlFor:`location-${a}`,className:"lg:text-xs 2xl:text-sm cursor-pointer",onChange:()=>k(a),onClick:x=>x.stopPropagation(),children:a})]},a)})})]})]});return e.jsxs("div",{className:"flex flex-col gap-3",children:[U(),L("Meeting Type",hs,l.meetingTypes,M,C,G,T.meetingType),K(),L("Access",fs,l.access,m,t,H,T.access),L("Status",ys,l.status,n,A,v,T.status)]})},js={meetingLocations:[],meetingTypes:[],calendars:[],access:[],status:[]},Ns=({isOpen:l,onClose:g,onApply:u,currentFilters:h})=>{const y=fe(t=>t.authStore.applicationDetails),p=ye(),[i,E]=o.useState(js);o.useEffect(()=>{var t,n;l&&h&&E({meetingLocations:h.locationId||[],meetingTypes:h.meetingTypes||[],calendars:h.calendar||[],access:((t=h.isPublic)==null?void 0:t.map(A=>A?$.PUBLIC:$.PRIVATE))||[],status:((n=h.isActive)==null?void 0:n.map(A=>A?B.ACTIVE:B.INACTIVE))||[]})},[l,h]),o.useEffect(()=>{y||p(Xe())},[p,y]);const M=()=>i.meetingLocations.length>0||i.meetingTypes.length>0||i.calendars.length>0||i.access.length>0||i.status.length>0,C=()=>{try{const t={searchText:"",limit:100,page:1,meetingTypes:i.meetingTypes,calendar:i.calendars,isPublic:i.access.map(n=>n===$.PUBLIC),isActive:i.status.map(n=>n===B.ACTIVE),locationId:i.meetingLocations};u(t),g()}catch(t){console.error("Error applying filters:",t)}},m=()=>{try{g()}catch(t){console.error("Error closing filter:",t)}};return l?e.jsx("div",{className:"fixed inset-[-20px] bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"w-8 h-8 bg-teal-600 rounded-full flex items-center justify-center mr-3",children:e.jsx("img",{src:ds,alt:"",className:"w-4 h-4"})}),e.jsx("h2",{className:"text-xl font-semibold",children:Z.FilterAndSearchMeetingText.Filters})]}),e.jsxs("button",{onClick:m,className:"text-gray-500 hover:text-custom-Red border rounded-full p-1 hover:border-custom-Red","data-tooltip-id":"close-tooltip",children:[e.jsx(be,{className:"h-4 w-4"}),e.jsx(qe,{id:"close-tooltip",place:"bottom",style:{fontSize:"10px",padding:"4px 8px",backgroundColor:"#333",color:"#fff",borderRadius:"4px",marginTop:"-3px"},children:"Close"})]})]}),e.jsx("div",{className:"flex flex-col gap-3 bg-greyishWhite p-5 rounded-xl",children:e.jsx(bs,{filters:i,setFilters:E,applications:y})}),e.jsxs("div",{className:"mt-[2.5rem] flex justify-end space-x-3",children:[e.jsx("button",{onClick:m,className:"px-5 py-2 border border-gray-300 rounded-md lg:text-xs 2xl:text-sm text-black hover:border-tealGreen",children:Z.ButtonText.Cancel}),e.jsx("button",{onClick:C,disabled:!M(),className:`px-6 py-2 border rounded-md shadow-sm lg:text-xs 2xl:text-sm ${M()?"hover:bg-tealGreen bg-lightcyan hover:text-white border-tealGreen text-tealGreen":"bg-gray-300 cursor-not-allowed text-white border-transparent"}`,children:Z.ButtonText.Apply})]})]})}):null},Ts=({filters:l,onClose:g,onRemoveFilter:u})=>{const h=fe(m=>{var t;return((t=m.authStore.existingUser)==null?void 0:t.userCalendars)??[]}),y=m=>{const t=h.find(n=>n.userCalendarId===m);return(t==null?void 0:t.calendarEmail)||`Calendar ${m}`},p=(m,t)=>
8{if(!t||Array.isArray(t)&&t.length===0)return[];switch(m){case b.CALENDAR:return Array.isArray(t)?t.map(n=>({displayValue:y(n),originalValue:n})):[{displayValue:y(t),originalValue:t}];case b.MEETING_TYPES:return Array.isArray(t)?t.map(n=>({displayValue:ae[n],originalValue:n})):[{displayValue:ae[t],originalValue:t}];case b.IS_PUBLIC:return Array.isArray(t)?t.map(n=>({displayValue:n?$.PUBLIC:$.PRIVATE,originalValue:n})):[{displayValue:t?$.PUBLIC:$.PRIVATE,originalValue:t}];case b.IS_ACTIVE:return Array.isArray(t)?t.map(n=>({displayValue:n?B.ACTIVE:B.INACTIVE,originalValue:n})):[{displayValue:t?B.ACTIVE:B.INACTIVE,originalValue:t}];case b.LOCATION_ID:return Array.isArray(t)?t.map(n=>({displayValue:he(n),originalValue:n})):[{displayValue:String(t),originalValue:t}];case b.SEARCH_TEXT:return t?[{displayValue:t,originalValue:t}]:[];case b.LIMIT:case b.PAGE:return[];default:return Array.isArray(t)?t.map(n=>({displayValue:String(n),originalValue:n})):[{displayValue:String(t),originalValue:t}]}},i=(m,t)=>{if(Object.entries(l).filter(([A,N])=>N!=null&&(!Array.isArray(N)||N.length>0)&&N!==""&&A!==b.LIMIT&&A!==b.PAGE).length===1&&Array.isArray(l[m])&&l[m].length===1){g();return}u(m,t)},E=()=>{try{u(b.MEETING_TYPES),u(b.CALENDAR),u(b.LOCATION_ID),u(b.IS_PUBLIC),u(b.IS_ACTIVE),g()}catch(m){console.error("Error clearing filters:",m)}},M=()=>Object.entries(l).filter(([t,n])=>n!=null&&(!Array.isArray(n)||n.length>0)&&n!==""&&t!==b.LIMIT&&t!==b.PAGE).map(([t,n])=>p(t,n).map(({displayValue:N,originalValue:T})=>e.jsxs("div",{className:"inline-flex items-center border rounded-full px-3 py-2 mr-2 mb-2 bg-white",children:[e.jsx("span",{className:"lg:text-[11px] 2xl:text-[13px]",children:N}),e.jsx("button",{onClick:()=>i(t,T),className:"ml-2 text-gray-500 hover:text-gray-700",children:e.jsx(be,{size:14,className:"hover:text-custom-Red"})})]},`${t}-${N}`)));return Object.entries(l).some(([m,t])=>t!=null&&(!Array.isArray(t)||t.length>0)&&t!==""&&m!==b.LIMIT&&m!==b.PAGE)?e.jsxs("div",{className:"bg-transparent rounded-lg relative mb-4",children:[e.jsx("div",{className:"flex flex-wrap",children:M()}),e.jsx("button",{onClick:E,className:"border border-custom-Red rounded-full px-3 py-2 mr-2 mb-2 lg:text-[11px] 2xl:text-[13px] text-custom-Red bg-white hover:bg-custom-Red hover:text-white hover:border-white",children:"Clear all filters"})]}):null},_s=()=>{const[l,g]=o.useState([]),[u,h]=o.useState(!1),[y,p]=o.useState([]),[i,E]=o.useState(null),[M,C]=o.useState(!0),[m,t]=o.useState(""),n=gs(m,300),[A,N]=o.useState(!1),[T,R]=o.useState(null),[D,k]=o.useState({searchText:"",limit:100,page:1}),[G,H]=o.useState(null),[v,L]=o.useState(!1),K=Ce(),U=ye(),a=Ae();o.useEffect(()=>{U(es()),localStorage.removeItem("meetingId")},[U]),o.useEffect(()=>{(async()=>{C(!0);try{const r=await F.getAllMeetingTypes();r!=null&&r.data&&Array.isArray(r.data)?p(r.data):(console.error("Unexpected response structure",r),p([]))}catch(r){console.error(r),p([])}finally{C(!1)}})()},[]),Ee({selectors:[{selector:".popup-element",onOutsideClick:()=>R(null)}]});const c=async s=>{C(!0),L(!0);try{const r={};s.searchText&&s.searchText.length>=3&&(r.searchText=s.searchText),s.limit&&(r.limit=s.limit),s.page&&(r.page=s.page),s.meetingTypes&&s.meetingTypes.length>0&&(r.meetingTypes=s.meetingTypes),s.calendar&&s.calendar.length>0&&(r.calendar=s.calendar),s.isPublic&&s.isPublic.length>0&&(r.isPublic=s.isPublic),s.isActive&&s.isActive.length>0&&(r.isActive=s.isActive),s.locationId&&s.locationId.length>0&&(r.locationId=s.locationId);const f=await F.filterMeetingType(r);Array.isArray(f.data)?p(f.data):(console.error("Expected an array but got:",f),p([]))}catch(r){console.error("Filter error:",r),p([])}finally{C(!1)}},x=async(s,r)=>{p(f=>f.map(d=>d.meetingId===s?{...d,isActive:r}:d))};o.useEffect(()=>{G&&clearTimeout(G);const s=setTimeout(()=>{const r={...D,searchText:m.length>=3?m:""};Object.values(r).some(d=>Array.isArray(d)?d.length>0:typeof d=="string"?d.length>=3:!1)?c(r):I()},300);return H(s),()=>{G&&clearTimeout(G)}},[m,D]);const I=async()=>{C(!0),L(!1);try{const s=await F.getAllMeetingTypes();s!=null&&s.data&&Array.isArray(s.data)?p(s.data):(console.error("Unexpected response structure",s),p([]))}catch(s){console.error(s),p([])}finally{C(!1)}},Q=s=>{R(T===s?null:s)},z=s=>{try{const r=s.replace(/ /g,"%20");navigator.clipboard.writeText(r),a.success("Booking link copied")}catch{a.error("Failed to copy link")}};o.useEffect(()=>{(async()=>
8{if(n.length>=3){const r={searchText:n,limit:100,page:1};try{const f=await F.filterMeetingType(r);Array.isArray(f.data)?p(f.data):(console.error("Expected an array but got:",f),p([]))}catch(f){console.error("Search error:",f),p([])}}else if(n===""){const r=await F.getAllMeetingTypes();p(r.data)}})()},[n]);const J=s=>{t(s)},W=s=>{g(r=>r.includes(s)?r.filter(f=>f!==s):[...r,s])},w=()=>{g([])},_=s=>{E(s),h(!0)},re=async()=>{try{i?(await F.deleteMeetingType(i),p(s=>s.filter(r=>r.meetingId!==i))):l.length>0&&(await Promise.all(l.map(async s=>{await F.deleteMeetingType(s)})),p(s=>s.filter(r=>!l.includes(r.meetingId)))),g([]),E(null),h(!1),U(Se()),a.success("Meeting type deleted successfully")}catch(s){a.error("Failed to Delete Meeting type"),console.error("Delete error:",s)}finally{}},le=()=>{l.length>0&&h(!0)},X=()=>{K(as.CREATEMEETINGTYPE_PAGE)},ie=s=>{const r={};Object.entries(s).forEach(([f,d])=>{d!=null&&(!Array.isArray(d)||d.length>0)&&d!==""&&(r[f]=d)}),k(r),c(r)},ne=(s,r)=>{k(f=>{const d={...f};if(Array.isArray(d[s])){const O=s;r!==void 0?(s==="isPublic"||s==="isActive"?d[O]=d[O].filter(te=>te!==r):d[O]=d[O].filter(te=>te!==r),d[O].length===0&&delete d[O]):delete d[s]}else delete d[s];return{...d,searchText:d.searchText||"",limit:d.limit||100,page:d.page||1}})},q=()=>{k({searchText:"",limit:100,page:1}),t(""),N(!1),L(!1),I()},ce=()=>{k({searchText:"",limit:100,page:1}),I()};return e.jsxs("div",{className:"p-6 min-h-screen mt-[-1rem] -ml-[1rem]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("h1",{className:"text-font-base font-semibold",children:"Meeting Types"}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(ss,{placeholder:"Search Meeting Type",onSearch:J}),e.jsx("div",{children:e.jsxs(we,{className:"text-black rounded-full flex gap-2 border border-[#E0E0E0] hover:border-tealGreen bg-white py-2 px-5 items-center",onClick:()=>N(!0),children:[e.jsx("img",{src:ms,alt:"FilterIcon",className:"w-4 h-4"}),e.jsx("span",{className:"text-xs",children:Z.FilterAndSearchMeetingText.Filters})]})}),e.jsx(Pe,{feature:Ie.MEETING_TYPE,children:e.jsxs(we,{onClick:X,className:"bg-tealGreen text-white h-[36px] px-4 p-2 rounded-full flex items-center",children:[e.jsx("i",{className:"pi pi-plus"}),e.jsx("span",{className:"lg:text-xs 2xl:text-sm ml-2",children:"Create Meeting Type"})]})})]})]}),e.jsx("div",{className:"mb-6",children:l.length>0?e.jsxs("div",{className:"flex items-center space-x-4 mt-4",children:[e.jsxs("button",{onClick:w,className:"flex gap-2 items-center space-x-1 ",children:[e.jsx("div",{className:"text-gray-500 hover:text-custom-Red border rounded-full p-1 hover:border-custom-Red ",children:e.jsx(be,{className:"h-4 w-4 "})}),e.jsxs("span",{className:"lg:text-sm 2xl:text-lg",children:[l.length," selected"]})]}),e.jsx("button",{onClick:le,className:"flex items-center space-x-1",children:e.jsx("div",{className:"border px-2 py-1 rounded-full hover:border-red-500",children:e.jsx("img",{src:Me,alt:"Delete",className:"w-3 h-5"})})}),e.jsx("button",{className:"flex items-center space-x-1",children:e.jsx("div",{className:"border px-2 py-1 rounded-full hover:border-green-500 hidden",children:e.jsx("img",{src:ke,alt:"Share",className:"w-3 h-5"})})})]}):null}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{children:e.jsx(Ts,{filters:D,onClose:q,onRemoveFilter:ne})}),e.jsx("div",{className:"event-list grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-3 gap-6 h-fit overflow-y-auto scrollbar-hide lg:text-sm 2xl:text-lg",children:M?Array.from({length:6}).map((s,r)=>e.jsx(us,{},r)):y.length===0?e.jsx("div",{className:"flex items-center justify-center col-span-full h-[50vh]",children:e.jsx("p",{className:"text-gray-500 text-[16px] font-semibold text-center",children:v||m?"No Results Found":"No meeting type available. Please create a meeting type."})}):y.map(s=>e.jsx(ps,{meetingId:s.meetingId,title:s.meetingName,type:s.meetingType,duration:s.duration,platform:s.locationId,description:s.description,hostEmail:s.hostEmail,allowInvitesToAddGuest:s.allowInvitesToAddGuest,participantsCount:s.participantsCount,isActive:s.isActive,onToggleActive:x,isPopupVisible:T===s.meetingId,onPopupToggle:Q,isSelected:l.includes(s.meetingId),onSelect:W,onDeleteClick:_,underlineColor:s.colorCode,dateRange:s.dateRange,scheduleId:s.scheduleId,isBufferTimeEnabled:s.isBufferTimeEnabled,bufferBefore:s.bufferBefore,bufferAfter:s.bufferAfter,isMinimumNoticeEnabled:s.isMinimumNoticeEnabled,noticeBefore:s.noticeBefore,noticeAfter:s.noticeAfter,isDailyLimitEnabled:s.isDailyLimitEnabled,dailyLimit:s.dailyLimit,isTimeZoneEnabled:s.isTimeZoneEnabled,inviteTimeZone:s.inviteTimeZone,lockTimeZone:s.lockTimeZone,eventLinkName:s.eventLinkName,inviteQuestions:s.inviteQuestions,allowTextReminders:s.allowTextReminders,appNotC
8onfigured:s.appNotConfigured,allowEmailReminders:s.allowEmailReminders,allowEmailFollowUps:s.allowEmailFollowUps,customDuration:s.customDuration,onCopyLink:z,isPublic:s.isPublic,inviteeCallMe:s==null?void 0:s.inviteeCallMe,callMyInvitee:s==null?void 0:s.callMyInvitee,locationDetails:s==null?void 0:s.locationDetails,country:s==null?void 0:s.country,state:s==null?void 0:s.state,city:s==null?void 0:s.city,zipCode:s==null?void 0:s.zipCode,address:s==null?void 0:s.address,phoneNumber:s==null?void 0:s.phoneNumber,countryCode:s==null?void 0:s.countryCode,isPaymentFree:s==null?void 0:s.isPaymentFree,currency:s==null?void 0:s.currency,amount:s==null?void 0:s.amount},s.meetingId))})]}),u&&e.jsx(ts,{isOpen:u,onClose:()=>{h(!1),E(null)},onConfirm:re,title:"Confirm Deletion",message:i?"Are you sure you want to delete this meeting type?":`Are you sure you want to delete ${l.length} meeting type(s)?`,confirmText:Z.ContactsPageText.Delete_ConfirmText,cancelText:Z.ButtonText.Cancel,bgImage:rs,iconClassName:"h-20 w-20 mt-[2rem]"}),e.jsx(Ns,{isOpen:A,onClose:()=>N(!1),onApply:ie,onReset:ce,currentFilters:D})]})};export{_s as default};
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.