1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,654664,e=>{"use strict";var t=e.i(435564),a=e.i(17460),s=e.i(318869),n=e.i(862286),l=e.i(471135);function i({className:e,users:i,table:r,setColumnFilter:d,clearColumnFilter:o,getColumnFilterValue:c,setRowPredicate:u,clearRowPredicate:x,columnId:h,value:p,onChangeValue:m,clearLabel:g,hideClear:f,showInactiveUsers:y,allContactsLabel:v,compactTypography:T=!1}){let b=h??"assignedTo",C="function"==typeof m,N=c?.(b),j="string"==typeof N&&N.length>0?N:"all",[S,w]=a.default.useState(j),L=C?null===p?"all":p??"":S,k=a.default.useCallback(e=>{if(C)return void m?.(e);if(w(e),"all"===e){x?.(),o?.(b);return}if(""===e){o?.(b),u?.(e=>{let t=e.assignedTo;return null==t||""===t});return}x?.(),d?.(b,e)},[C,m,b,d,o,u,x]),I=a.default.useCallback(()=>{C?m?.(null):(w("all"),x?.(),o?.(b))},[C,m,b,x,o]);return(0,t.jsxs)("div",{className:(0,s.cn)("flex w-full items-center gap-2",e),children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(n.default,{users:i,currentAssignedTo:L,onAssignedToChange:k,variant:n.AssignedToSelectVariant.Form,showIcon:!1,active:C?null!==p:"all"!==S,showInactiveUsers:y,showAllContactsOption:!0,allContactsLabel:v,triggerClassName:(0,s.cn)(T&&"text-2xs"),optionClassName:(0,s.cn)(T&&"text-2xs")})}),!f&&(0,t.jsx)(l.Button,{variant:"ghost",size:"xs",className:(0,s.cn)(T&&"text-3xs"),onClick:I,children:g??"Clear"})]})}e.s(["default",()=>i])},598081,e=>{"use strict";var t=e.i(435564);e.i(618463);var a=e.i(267660),s=e.i(17460),n=e.i(975031),l=e.i(318869),i=e.i(471135),r=e.i(625354),d=e.i(903766);let o=[d.QuickKey.ScheduledToday,d.QuickKey.ScheduledOverdue],c=[d.QuickKey.UnreadInbound,d.QuickKey.Unpaid,d.QuickKey.Stale],u=e=>e===d.QuickKey.Scheduled||void 0!==e&&o.includes(e);function x({className:e,setRowPredicate:x,clearRowPredicate:h,value:p,onChange:m,visible:g,includeChatbot:f,chatbotIncludedByAssignee:y=!1,onIncludeChatbotChange:v,orientation:T="horizontal"}){let b=(0,n.useTranslations)(),C="function"==typeof m,N=(e=>{if(e)return e[d.QuickKey.NeedsReply]||e[d.QuickKey.Unread]?d.QuickKey.NeedsReply:[d.QuickKey.Scheduled,...o,...c].find(t=>e[t])})(p),[j,S]=s.default.useState(N);s.default.useEffect(()=>{C&&S(N)},[C,N]),s.default.useEffect(()=>{if(!C&&x&&h){if(!j)return void h();x(e=>{let t=e.lastMessageDirection,s=!!e.reminderActive,n=Number(e.unreadCount??0);if(j===d.QuickKey.NeedsReply&&t!==a.MessageDirection.INBOUND&&!(n>0))return!1;return j!==d.QuickKey.Scheduled||!!s})}},[C,j,x,h]);let w=e=>{if(C){let t=N===e||e===d.QuickKey.Scheduled&&u(N)?void 0:e,a=Object.fromEntries(Object.values(d.QuickKey).map(e=>[e,e===t]));m?.(a)}else S(t=>t===e?void 0:e)},L=g&&g.length>0?g:[d.QuickKey.NeedsReply,d.QuickKey.Scheduled],k=j===d.QuickKey.ScheduledToday?b.leadQueueText.scheduledTodayOnly:j===d.QuickKey.ScheduledOverdue?b.leadQueueText.scheduledOverdueOnly:void 0,I={[d.QuickKey.UnreadInbound]:{label:b.leadQueueText.unread,title:b.leadQueueText.unreadInboundOnly},[d.QuickKey.Unpaid]:{label:b.leadQueueText.unpaid,title:b.leadQueueText.unpaidOnly},[d.QuickKey.Stale]:{label:b.leadQueueText.stale,title:b.leadQueueText.staleOnly}},A=j&&c.includes(j)?I[j]:void 0,M="vertical"===T,Q=(0,l.cn)("rounded-full px-0.5 text-3xs",M&&"h-[18px] min-h-0 py-0 leading-none");return(0,t.jsxs)("div",{className:(0,l.cn)("flex",M?"w-auto flex-col items-stretch gap-px":"w-full items-center gap-0.5",e),children:["boolean"==typeof f&&(0,t.jsx)(i.Button,{variant:f||y?"default":"outline",size:"xs",className:(0,l.cn)(Q,y&&"opacity-70"),title:y?b.leadQueueText.includeChatbotByAssignee:void 0,onClick:()=>v?.(!f),children:b.leadQueueText.includeChatbot}),(0,t.jsx)(r.Separator,{orientation:M?"horizontal":"vertical",className:(0,l.cn)(M?"my-px w-full":"h-6 mx-0.5")}),A&&j&&(0,t.jsx)(i.Button,{variant:"default",size:"xs",className:Q,title:A.title,onClick:()=>w(j),children:A.label}),L.includes(d.QuickKey.Scheduled)&&(0,t.jsx)(i.Button,{variant:u(j)?"default":"outline",size:"xs",className:Q,title:k,onClick:()=>w(d.QuickKey.Scheduled),children:b.leadQueueText.scheduled}),L.includes(d.QuickKey.NeedsReply)&&(0,t.jsx)(i.Button,{variant:j===d.QuickKey.NeedsReply?"default":"outline",size:"xs",className:Q,onClick:()=>w(d.QuickKey.NeedsReply),children:b.leadQueueText.needsReply})]})}e.s(["default",()=>x])},336384,e=>{"use strict";var t,a=e.i(435564),s=e.i(275535),n=e.i(975031),l=e.i(318869),i=e.i(494210),r=e.i(471135),d=((t={}).Xs="xs",t);function o({className:e,value:t,onChange:d,counts:o,labels:c,size:u="xs",disabled:x=!1,hideClear:h=!1,showAll:p=!1,isAllActive:m=!1,onSelectAll:g,showPrioritized:f=!1,isPrioritizedActive:y=!1,onSelectPrioritized:v,showNotMessaged:T=!1,isNotMessagedActive:b=!1,onSelectNotMessaged:C}){let N=(0,i.useSharedTranslations)(),j=(0,n.useTranslations)(),S=e=>e?e.replace(/\s*\(\{count\}\)\s*/,"").trim():e,w=c?.leads??S(j.leadQueueText?.leadsCount)??"Leads",L=c?.clients??S(j.leadQueueText?.clientsCount)??"Clients",k=c?.queued??S(j.leadQueueText?.queuedCount)??"Queued",I=c?.new??S(j.leadQueueText?.newCount)??"Not Messaged",A=c?.clear??N.clear??"Clear",M="px-0.5 whitespace-normal break-words text-center leading-tight text-3xs";return(0,a.jsxs)("div",{className:(0,l.cn)("flex w-full flex-wrap items-center gap-0.5",e),children:[p&&(0,a.jsxs)(r.Button,{className:M,variant:m?"default":"outline",size:u,disabled:x,onClick:g,"aria-pressed":m,children:[j.leadQueueText.allContacts,"number"==typeof o?.all?` (${o.all})`:""]}),(0,a.jsxs)(r.Button,{className:M,variant:t===s.ContactType.LEAD?"default":"outline",size:u,disabled:x,onClick:()=>d(s.ContactType.LEAD),"aria-pressed":t===s.ContactType.LEAD,children:[w,"number"==typeof o?.leads?` (${o?.leads})`:""]}),(0,a.jsxs)(r.Button,{className:M,variant:t===s.ContactType.CLIENT?"default":"outline",size:u,disabled:x,onClick:()=>d(s.ContactType.CLIENT),"aria-pressed":t===s.ContactType.CLIENT,children:[L,"number"==typeof o?.clients?` (${o?.clients})`:""]}),f&&(0,a.jsxs)(r.Button,{className:M,variant:y?"default":"outline",size:u,disabled:x,onClick:()=>v&&v(),"aria-pressed":y,children:[k,"number"==typeof o?.queued?` (${o?.queued})`:""]}),T&&(0,a.jsxs)(r.Button,{className:M,variant:b?"default":"outline",size:u,disabled:x,onClick:()=>C&&C(),"aria-pressed":b,children:[I,"number"==typeof o?.new?` (${o?.new})`:""]}),!h&&(0,a.jsx)(r.Button,{className:"flex w-full",variant:"ghost",size:u,disabled:x,onClick:()=>d(null),children:A})]})}e.s(["ComponentSize",()=>d,"default",()=>o])},826766,236426,e=>{"use strict";var t=e.i(435564),a=e.i(75299),s=e.i(670275),n=e.i(921122),l=e.i(30275),i=e.i(484024),r=e.i(975031),d=e.i(218799),o=e.i(471135),c=e.i(333316);function u({isFilterSectionCollapsed:e,filters:u,setFilters:x,handleSearchChange:h,handleSearchAllMessages:p,handleStageToggle:m,handleInterestLevelToggle:g,handleAssignedToChange:f,handleSoldByChange:y,handleWhatsappLinePhoneChange:v,handleDateRangeAddedChange:T,handleLastMessageDirectionChange:b,loadedContactCount:C,isAdvancedFilterOpen:N,setIsAdvancedFilterOpen:j,users:S,onResetFilters:w}
1){let L=(0,r.useTranslations)(),{defaultOrderBy:k}=(0,c.useContactCenterDataContext)(),I=u.pinnedContactIds??null,A=I?.length??0,M=L.leadQueueMenuText.pinnedContactsLabel.replace("{count}",String(A));return(0,t.jsxs)("div",{className:"w-full min-w-0",children:[(0,t.jsx)("div",{className:"mb-0 flex w-full min-w-0 items-center justify-between text-3xs text-muted-foreground",children:(0,t.jsx)(d.default,{filters:u,setFilters:x,handleSearchChange:h,handleSearchAllMessages:p,handleInterestLevelToggle:g,handleAssignedToChange:f,handleSoldByChange:y,handleWhatsappLinePhoneChange:v,handleDateRangeAddedChange:T,handleLastMessageDirectionChange:b,loadedContactCount:C,isAdvancedFilterOpen:N,setIsAdvancedFilterOpen:j,users:S,onResetFilters:w,defaultOrderBy:k,className:"w-full min-w-0"})}),A>0&&(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-1 text-4xs text-primary",children:[(0,t.jsx)(a.Pin,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"grow truncate",children:M}),(0,t.jsx)(o.Button,{variant:"ghost",size:"xs",className:"h-5 w-5 p-0 text-primary hover:bg-primary/20","aria-label":L.leadQueueMenuText.pinnedContactsClear,title:L.leadQueueMenuText.pinnedContactsClear,onClick:()=>x(e=>({...e,pinnedContactIds:null})),children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]}),!e&&(0,t.jsx)("div",{className:"mt-px flex flex-col gap-1",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsx)(l.default,{filters:u,stageOrder:n.LIFECYCLE_STAGE_FILTER_ORDER,handleStageToggle:m}),(0,t.jsx)(i.default,{filters:u,setFilters:x})]})})]})}e.s(["default",()=>u],826766);var x=e.i(17460),h=e.i(809321),p=e.i(97873);e.i(536549);var m=e.i(41321),g=e.i(582049),f=e.i(573911),y=e.i(685177);e.s(["default",0,({item:e,onSelect:a,isSelected:s,isMergingContacts:n=!1,isSelectedForMerge:l=!1,onToggleForMerge:i,displayPriorityScore:r=!0})=>{let d=(0,y.useCommunicationDispatch)(),o=(0,p.useAppErrorToast)(),{isMergingContacts:c,selectedContactsForMerge:u,mergingAnchorContact:v,toggleContactForMerge:T}=(0,f.useContactCenterUIContext)(),b=e.kind===m.ThreadKind.CONTACT?e.contactId:void 0,C=!!v&&!!b&&v.contactId===b,N=b&&u?u.has(b):l,j=x.default.useCallback(async(t,a)=>{try{await d((0,h.updateInterestLevel)({locationId:e.locationId,contactId:t,interestLevel:a})).unwrap()}catch(e){o({error:e,context:"contact-center.conversation-list.update-interest-level"})}},[d,e.locationId,o]);return(0,t.jsx)(g.default,{item:e,onSelect:a,isSelected:s,isMergingContacts:c??n,isSelectedForMerge:N,isAnchor:C,onToggleForMerge:T??i,onInterestLevelChange:j,displayPriorityScore:r})}],236426)},481580,e=>{"use strict";var t=e.i(435564);e.i(210957);var a=e.i(275535);e.i(2532);var s=e.i(627026),n=e.i(975031),l=e.i(70392),i=e.i(397237);function r(e){let a=(0,n.useTranslations)(),{timeZone:s}=(0,l.useDisplayPreferences)();return(0,t.jsx)(d,{...e,translations:a.daysOldBadgeText,timeZone:s,now:new Date})}function d(e){let n,l,r,d,o,c,u;if(!e.dateAdded)return(0,t.jsx)("div",{});let x=e.contactType===a.ContactType.LEAD?"text-background":"text-muted-foreground";return(0,t.jsx)("div",{className:"contents",children:(n=(0,s.differenceInCalendarDaysInTimeZone)(e.now,e.dateAdded,e.timeZone),l="bg-feedback-danger-solid",n<=14?l="bg-feedback-success-solid":n<=30&&(l="bg-feedback-warning-solid"),r=e.translations.over30days,d=e.translations.between14and30days,o=e.translations.recentlyAdded,c=r,n<=14?c=o:n<=30&&(c=d),l=e.contactType===a.ContactType.LEAD?l:"bg-background border border-border",u=e.translations.daysWithSuffix.replace("{days}",n.toString()),(0,t.jsx)(i.TooltipProvider,{children:(0,t.jsxs)(i.Tooltip,{children:[(0,t.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:`text-3xs ${x} font-bold py-px px-1 m-0 rounded-full ${l} ${e.className??""}`,children:u})}),(0,t.jsx)(i.TooltipContent,{children:(0,t.jsx)("p",{children:c})})]})}))})}e.s(["DaysOldBadgePresentation",()=>d,"default",()=>r])},294477,e=>{"use strict";var t=e.i(476864),a=e.i(17460);function s(e){let[s,n]=(0,a.useState)(!1);return{searching:s,matchingContacts:(0,a.useCallback)(async a=>{let s=a.trim();if(!s)return null;if(e){n(!0);try{let a=await t.MessagesService.searchMessages(e,s,100);return{contactIds:a?.data?.contactIds??[],hasMore:a?.data?.hasMore===!0}}catch{return}finally{n(!1)}}},[e])}}e.s(["useMessageSearch",()=>s])},61442,e=>{"use strict";e.i(2532);var t=e.i(627026),a=e.i(489032);function s(e,a){return((0,t.getWeekdayIndexInTimeZone)(e,a)+6)%7+1}function n({date:e,displayLocale:n,fallback:l,now:i,timeZone:r}){if(!e)return l;let d=new Date(e);if(Number.isNaN(d.getTime()))return l;if((0,t.isSameDayInTimeZone)(i,d,r))return(0,a.formatMessageTime)(e,r);if(7>(0,t.differenceInCalendarDaysInTimeZone)(i,d,r)&&s(i,r)>s(d,r)){var o;return(o=(0,t.formatDateInputToLocalizedDate)(d,{locale:n,userTz:r,fallback:l,formatOptions:{weekday:"short",year:void 0,month:void 0,day:void 0}}))?o.charAt(0).toLocaleUpperCase()+o.slice(1):o}return(0,t.formatDateInputToLocalizedDate)(d,{locale:n,userTz:r,fallback:l,formatOptions:{month:"2-digit",day:"2-digit",year:"2-digit"}})}e.s(["formatConversationListItemTime",()=>n])},677622,e=>{"use strict";function t(e){return!!(e.lastMessageType||e.lastMessageDirection||e.lastMessageChannel||e.lastMessageStatus||e.lastMessageBody?.trim()||(e.unreadCount??0)>0)}e.s(["hasConversation",()=>t])},326626,e=>{"use strict";var t=e.i(435564);e.i(131854);var a=e.i(61626),s=e.i(604793);e.i(210957);var n=e.i(275535),l=e.i(248377),i=e.i(859874),r=e.i(585832),d=e.i(783957),o=e.i(670275);e.i(536549);var c=e.i(41321);let u={positive:"green",negative:"red",neutral:"gray"};
1function x({icon:e,tone:a,tooltip:s,size:n=18}){return(0,t.jsx)("span",{title:s,className:"inline-flex items-center pl-1",children:(0,t.jsx)(e,{size:n,color:u[a],strokeWidth:2.5,fill:"transparent"})})}function h(e,a,s,n=!0){return a?(0,t.jsx)(l.Bell,{size:16,color:"white",strokeWidth:2}):e>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.MessageCircle,{size:12,strokeWidth:2.2}),(0,t.jsx)("span",{children:e})]}):s&&n?(0,t.jsx)("span",{className:"text-2xs font-bold text-foreground",children:s}):e.toString()}function p(e){if(e.kind===c.ThreadKind.CONTACT&&e.contactType===n.ContactType.CLIENT){if(!e.paymentStatus)return null;let s=e.paymentStatus===a.PaymentStatus.PAID,n=e.paymentStatus===a.PaymentStatus.NOT_PAID;return(0,t.jsx)(r.DollarSign,{size:20,fill:"transparent",strokeWidth:2,className:`pl-1 ${s?"text-feedback-success-foreground":n?"text-feedback-danger-foreground":"text-muted-foreground"}`})}return null}function m(e){return e.kind!==c.ThreadKind.CONTACT||e.contactType===n.ContactType.CLIENT?null:e.serviceEligibilityStatus===s.ServiceEligibilityStatus.Eligible?(0,t.jsx)(x,{icon:i.Check,tone:"positive",tooltip:"Eligible"}):e.serviceEligibilityStatus===s.ServiceEligibilityStatus.Ineligible?(0,t.jsx)(x,{icon:o.X,tone:"negative",tooltip:"Ineligible"}):null}function g(e,t,a){return e.kind!==c.ThreadKind.CONTACT||e.contactType===n.ContactType.CLIENT?t:a}e.s(["getContactTypeDisplay",()=>g,"getPaymentStatusDisplayIcon",()=>p,"getServiceEligibilityIcon",()=>m,"unreadAlertDisplay",()=>h],326626)},553203,e=>{"use strict";var t=e.i(435564);e.i(618463);var a=e.i(477510),s=e.i(859874),n=e.i(554442),l=e.i(318869);function i({className:e,size:i=20,status:r}){return r===a.MessageStatus.SENT?(0,t.jsx)(s.Check,{"aria-hidden":"true",className:(0,l.cn)("text-muted-foreground",e),size:i,strokeWidth:1.75}):r===a.MessageStatus.READ?(0,t.jsx)(n.CheckCheck,{"aria-hidden":"true",className:(0,l.cn)("text-primary",e),size:i,strokeWidth:2}):r===a.MessageStatus.DELIVERED||r===a.MessageStatus.UNREAD?(0,t.jsx)(n.CheckCheck,{"aria-hidden":"true",className:(0,l.cn)("text-muted-foreground",e),size:i,strokeWidth:2}):null}e.s(["ConversationMessageStatusIcon",()=>i])},582049,e=>{"use strict";var t=e.i(435564);e.i(477636);var a=e.i(293086);e.i(210957);var s=e.i(275535),n=e.i(515969);let l=(0,e.i(439205).default)("phone-off",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]);var i=e.i(674585),r=e.i(18383),d=e.i(17460),o=e.i(975031),c=e.i(948263),u=e.i(399596),x=e.i(239553),h=e.i(494210),p=e.i(70392),m=e.i(462045),g=e.i(707110),f=e.i(580624),y=e.i(387625),v=e.i(915904),T=e.i(61442),b=e.i(677622);e.i(536549);var C=e.i(41321),N=e.i(713350),j=e.i(481580),S=e.i(326626),w=e.i(553203);let L=({item:e,onSelect:o,isSelected:c,isMergingContacts:x=!1,isSelectedForMerge:h=!1,isAnchor:p=!1,onToggleForMerge:m,onInterestLevelChange:N,displayPriorityScore:L=!0,automationBadge:k,translations:I,sharedTranslations:A,users:M,locale:Q,displayLocale:B,timeZone:D,resolveBrandLabel:O,now:E})=>{let F,[P,U]=d.default.useState(()=>new Set),z=(0,b.hasConversation)(e),R=e.kind===C.ThreadKind.CONTACT,K=R?e.contactId:void 0,_=e.assignedTo?M[e.assignedTo]:void 0,$=_?.role===a.UserRole.CHATBOT,W=!!_&&P.has(_.userId),V=()=>{if(x){R&&!p&&K&&m&&m(K);return}o(e)},q=R&&e.visibleTo&&e.visibleTo.length>0,H=e.kind===C.ThreadKind.CONTACT&&e.isRecentlyHandoffReady;return(0,t.jsx)("div",{className:`hover:cursor-pointer ${x?p?"bg-secondary hover:bg-muted-foreground":h?"bg-feedback-info hover:bg-feedback-info":"bg-muted-foreground hover:bg-muted-foreground text-background":c?"bg-muted hover:bg-secondary":"hover:bg-muted"} ${e.reminderActive&&!x?"bg-feedback-warning":""} ${$&&!x&&!c&&!e.reminderActive?"bg-feedback-info":""}`,onClick:V,onKeyDown:e=>
1{e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),V())},role:"button",tabIndex:0,children:(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:"flex items-center px-2 border-b border-porcelain",children:[x&&R&&(0,t.jsx)("div",{className:"mr-2 flex items-center",children:(0,t.jsx)("input",{type:"checkbox",checked:h,onChange:e=>{e.stopPropagation(),!p&&K&&m&&m(K)},onClick:e=>e.stopPropagation(),disabled:p,className:"w-4 h-4"})}),(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsxs)("div",{className:"relative -left-1 -top-px flex items-center leading-none",children:[(0,t.jsx)(j.DaysOldBadgePresentation,{translations:I.daysOldBadgeText,timeZone:D,now:E,dateAdded:e.dateAdded||void 0,contactType:R?e.contactType||s.ContactType.LEAD:s.ContactType.CLIENT}),R&&e.originatingBrandId?(0,t.jsx)("span",{className:"ml-0.5 max-w-[72px] truncate rounded bg-muted px-1 py-px text-4xs font-semibold leading-tight text-muted-foreground",children:O(e.originatingBrandId)}):null,(0,t.jsx)("div",{className:"pl-1 pr-1 text-3xs w-[40px]",children:(0,S.getContactTypeDisplay)(e,I.conversationListItemText.contactTypeClient??A.cliente,I.conversationListItemText.contactTypeLead??A.lead)})]}),(0,t.jsxs)("div",{className:"pl-2 pr-2 relative",children:[(0,t.jsx)("div",{className:"ml-1.5 mt-0.5",children:(F=R&&e.phoneNumberInvalid?(0,t.jsx)("div",{className:"w-[35px] h-[35px] rounded-full bg-feedback-danger flex items-center justify-center",children:(0,t.jsx)(l,{size:20,className:"text-feedback-danger-foreground"})}):(()=>{if(!_)return(0,t.jsxs)("div",{className:"relative w-[35px] h-[35px] rounded-full bg-secondary flex items-center justify-center",children:[(0,t.jsx)(i.UserCircle2,{size:30,className:"text-muted-foreground"}),(0,t.jsx)(n.AlertCircle,{size:16,strokeWidth:2.5,className:"absolute -top-1.25 -right-1.25 text-feedback-danger-foreground"})]});if(_.profileImage&&!W)return(0,t.jsx)("img",{src:_.profileImage,alt:`${_.firstName} ${_.lastName}`,width:30,height:30,onError:()=>{U(e=>{let t=new Set(e);return t.add(_.userId),t})}});let e=_.firstName?.charAt(0).toUpperCase()||"",a=_.lastName?.charAt(0).toUpperCase()||"";return(0,t.jsxs)("div",{className:"w-[35px] h-[35px] rounded-full bg-feedback-success flex items-center justify-center text-feedback-success-foreground font-bold text-md",children:[e,a]})})(),(0,t.jsxs)("div",{className:"relative",children:[F,q&&(0,t.jsx)("div",{className:"absolute -bottom-1 -left-1 w-[14px] h-[14px] rounded-full bg-feedback-info flex items-center justify-center",children:(0,t.jsx)(r.Users,{size:9,strokeWidth:2.5,className:"text-feedback-info-foreground"})})]}))}),R&&e.country&&(0,t.jsx)("span",{className:"absolute left-0 -bottom-0 text-xs leading-none",children:(0,u.countryCodeToFlag)(e.country)})]})]}),(0,t.jsxs)("div",{className:"py-2 grow min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-1 min-w-0",children:[(0,t.jsx)("h3",{className:`text-2xs font-bold min-w-0 flex-1 truncate ${x&&!p&&!h?"text-background":"text-foreground"}`,children:e.kind===C.ThreadKind.CONTACT?(0,t.jsx)(g.ContactNamePresentation,{labels:I.conversationListItemText,firstName:e.firstName,lastName:e.lastName}):e.title}),(0,t.jsxs)("div",{className:"flex max-w-[55%] min-w-0 shrink items-center justify-end gap-1",children:[k?(0,t.jsx)("span",{className:"rounded-full bg-primary/10 px-1.5 py-0.5 text-4xs font-semibold uppercase text-primary",children:k}):null,H?(0,t.jsx)("span",{className:"max-w-[92px] whitespace-normal break-words rounded-full bg-feedback-warning px-1.5 py-0.5 text-center text-4xs font-semibold uppercase leading-tight text-feedback-warning-foreground",children:I.conversationListItemText.handoffReady}):(0,t.jsx)("span",{className:"min-w-0 truncate text-2xs font-bold text-muted-foreground",children:R&&e.probableSource?I.conversationListItemText.probableSourceMapping[e.probableSource]:""}),R&&e.contactType===s.ContactType.CLIENT?(0,t.jsx)("span",{className:`text-2xs font-bold ${x&&!p&&!h?"text-background":"text-foreground"}`,children:(0,S.getPaymentStatusDisplayIcon)(e)}):(0,t.jsxs)(t.Fragment,{children:[R&&N&&!x?(0,t.jsx)(f.FlameIconsPresentation,{labels:I.leadQueueMenuText,currentLevel:e.interestLevel,onLevelChange:t=>{N(e.contactId,t)},size:y.FlameIconSize.Small,variant:"header"}):(0,t.jsx)(y.default,{currentLevel:e.kind===C.ThreadKind.CONTACT?e.interestLevel:void 0,size:y.FlameIconSize.Small}),(0,S.getServiceEligibilityIcon)(e)]})]}),(0,t.jsx)("span",{className:`text-2xs shrink-0 ${x&&!p&&!h?"text-muted-foreground":e.unreadCount?"text-feedback-success-foreground":"text-darkGray"}`,children:(0,T.formatConversationListItemTime)({date:z&&e.lastMessageDateAdded||void 0,displayLocale:B,fallback:"",now:E,timeZone:D})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 min-w-0",children:[(0,t.jsx)("div",{className:"shrink-0",children:z?(0,t.jsx)(w.ConversationMessageStatusIcon,{className:"pl-1",status:e.lastMessageStatus}):null}),(0,t.jsx)("p",{className:`text-2xs truncate ${x&&!p&&!h?"text-muted-foreground":"text-darkGray"}`,children:z?(0,v.getFormattedLastMessageBody)({messageContentText:I.messageContentText,lastMessageBody:e.lastMessageBody||void 0,lastMessageType:e.lastMessageType||void 0,locale:Q}):I.conversationListItemText.noConversation})]}),(0,t.jsx)("div",{className:"shrink-0 pl-2 pr-2",children:(0,t.jsx)("p",{className:`inline-flex min-h-5 min-w-5 items-center justify-center gap-0.5 rounded-full px-1.5 py-0.5 text-center text-2xs font-bold ${e.unreadCount||e.reminderActive?"bg-feedback-success-solid text-background":"bg-transparent text-transparent"}
1`,children:(0,S.unreadAlertDisplay)(e.unreadCount||0,e.reminderActive||!1,e.kind===C.ThreadKind.CONTACT?e.priorityScore:void 0,L)})})]})]})]})})})};e.s(["default",0,e=>{let a=(0,h.useSharedTranslations)(),s=(0,o.useTranslations)(),n=(0,x.useAuth)(),{resolveBrandLabel:l}=(0,N.useDashboardBrandLabels)(n?.locationId,{defaultBrand:s.leadQueueMenuText.websiteBrandDefault,unattributed:s.leadQueueMenuText.websiteBrandNone}),{users:i}=(0,c.useKernelSelector)(e=>e.users),{locale:r}=(0,m.useLocale)(),{locale:d,timeZone:u}=(0,p.useDisplayPreferences)();return(0,t.jsx)(L,{...e,translations:s,sharedTranslations:a,users:i,locale:r,displayLocale:d,timeZone:u,resolveBrandLabel:l,now:new Date})}],582049)},467885,e=>{"use strict";var t=e.i(435564);e.i(618463);var a=e.i(267660);e.i(131854);var s=e.i(657230),n=e.i(514490),l=e.i(17460),i=e.i(975031),r=e.i(318869),d=e.i(239553),o=e.i(654664),c=e.i(494210),u=e.i(387625),x=e.i(471135),h=e.i(907979),p=e.i(539946),m=e.i(962454),g=e.i(664265),f=e.i(713350),y=e.i(370141),v=e.i(109809),T=e.i(689376),b=e.i(685177);let C=Object.values(s.InterestLevel),N="UNSET",j="UNSET";e.s(["AdvancedFilterSection",0,({filters:e,setFilters:S,handleInterestLevelToggle:w,handleAssignedToChange:L,handleSoldByChange:k,handleWhatsappLinePhoneChange:I,users:A,isAdvancedFilterOpen:M,setIsAdvancedFilterOpen:Q,handleLastMessageDirectionChange:B,className:D})=>{let O=(0,c.useSharedTranslations)(),E={...(0,i.useTranslations)(),...(0,g.useCommunicationModuleTranslations)()},{lines:F,fetch:P}=(0,m.useWhatsappLines)(),U=(0,d.useAuth)(),z=(0,b.useCommunicationSelector)(e=>e.contacts.contacts),{brands:R,resolveBrandLabel:K}=(0,f.useDashboardBrandLabels)(U?.locationId,{defaultBrand:E.leadQueueMenuText.websiteBrandDefault,unattributed:E.leadQueueMenuText.websiteBrandNone}),_=(0,l.useMemo)(()=>{let e=R.map(e=>e.brandId),t=new Set;for(let e of z){let a=e.originatingBrandId?.trim();a&&t.add(a)}let a=[...e];for(let e of t)a.includes(e)||a.push(e);return a},[R,z]);(0,l.useEffect)(()=>{U?.teamId&&P({teamId:U.teamId})},[U?.teamId,P]);let $=e.interestLevels&&e.interestLevels.length>0||null!==e.assignedTo||null!=e.soldBy||null!==e.whatsappLinePhone||null!==e.probableSource||e.probableSourceUnsetOnly||!!e.originatingBrandId||!!e.originatingBrandIdUnsetOnly||void 0!==e.lastMessageDirection&&null!==e.lastMessageDirection||(e.conversationType??y.ConversationTypeFilter.ALL)!==y.ConversationTypeFilter.ALL||Array.isArray(e.pinnedContactIds)&&e.pinnedContactIds.length>0,W={[s.InterestLevel.CONFIRMED_INTERESTED]:E.leadQueueMenuText.interestLevelConfirmed,[s.InterestLevel.POSSIBLE_INTERESTED]:E.leadQueueMenuText.interestLevelPossible,[s.InterestLevel.NONE]:E.leadQueueMenuText.interestLevelNone},V=e.interestLevels.map(e=>W[e]),q=e.interestLevels.length>0,H=void 0!==e.lastMessageDirection&&null!==e.lastMessageDirection,Z=(e.conversationType??y.ConversationTypeFilter.ALL)!==y.ConversationTypeFilter.ALL,G=null!==e.assignedTo,X=null!=e.soldBy,Y=null!==e.whatsappLinePhone,J=e.probableSourceUnsetOnly||null!==e.probableSource,ee=!!e.originatingBrandIdUnsetOnly||null!=e.originatingBrandId,et=e=>(0,r.cn)("h-7 rounded-md px-2 text-2xs shadow-none",e?"border-primary bg-primary text-primary-foreground hover:bg-primary/90":"border-input bg-background text-foreground hover:bg-accent"),ea=null===e.whatsappLinePhone?v.CONTACT_CENTER_WHATSAPP_LINE_ALL:""===e.whatsappLinePhone?v.CONTACT_CENTER_WHATSAPP_LINE_UNBOUND:e.whatsappLinePhone,es=(()=>{if(null===e.whatsappLinePhone)return E.leadQueueMenuText.whatsappLinePhoneAny;if(""===e.whatsappLinePhone)return E.leadQueueMenuText.whatsappLinePhoneUnbound;let t=F.find(t=>t.phoneNumber===e.whatsappLinePhone);return t?.friendlyName?`${t.friendlyName} (${t.phoneNumber})`:e.whatsappLinePhone})();return(0,t.jsxs)(h.DropdownMenu,{open:M,onOpenChange:Q,children:[(0,t.jsx)(h.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(x.Button,{variant:$?"default":"outline",size:"xs",className:(0,r.cn)("h-7 px-2 text-3xs",D),children:[(0,t.jsx)(n.Filter,{size:14,className:"mr-1"})," ",E.leadQueueMenuText.advancedFilterButton]})}),(0,t.jsxs)(h.DropdownMenuContent,{align:"end",className:"w-72 p-3",children:[(0,t.jsx)(h.DropdownMenuLabel,{className:"px-0 pb-2 pt-0 text-xs font-semibold",children:E.leadQueueMenuText.advancedFiltersTitle}),(0,t.jsxs)("div",{className:"space-y-1 border-b pb-1.5",children:[(0,t.jsx)("div",{className:"text-3xs font-semibold",children:E.leadQueueMenuText.interestLevelLabel}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:C.map(a=>(0,t.jsxs)(x.Button,{variant:"outline",size:"xs",className:et(e.interestLevels.includes(a)),onClick:()=>w(a),children:[(0,t.jsx)(u.default,{currentLevel:a}),(0,t.jsx)("span",{children:W[a]})]},a))}),q&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 text-3xs",children:[(0,t.jsxs)("span",{className:"min-w-0 truncate text-muted-foreground",children:[E.leadQueueMenuText.selectedInterestLabel,": ",V.join(", ")
1]}),(0,t.jsx)(x.Button,{variant:"link",size:"xs",onClick:()=>S(e=>({...e,interestLevels:[]})),className:"h-auto shrink-0 p-0 text-3xs",children:O.clear??"Clear"})]})]}),(0,t.jsxs)("div",{className:"space-y-1 border-b py-1.5",children:[(0,t.jsx)("div",{className:"text-3xs font-semibold",children:E.leadQueueMenuText.lastMessageDateAdded}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(0,t.jsx)(x.Button,{variant:"outline",size:"xs",className:et(!H),onClick:()=>B(null),children:E.leadQueueMenuText.lastMessageAnyDirection}),(0,t.jsx)(x.Button,{variant:"outline",size:"xs",className:et(e.lastMessageDirection===a.MessageDirection.INBOUND),onClick:()=>B(a.MessageDirection.INBOUND),children:E.leadQueueMenuText.lastMessageIncomingShort}),(0,t.jsx)(x.Button,{variant:"outline",size:"xs",className:et(e.lastMessageDirection===a.MessageDirection.OUTBOUND),onClick:()=>B(a.MessageDirection.OUTBOUND),children:E.leadQueueMenuText.lastMessageOutgoingShort})]})]}),(0,t.jsxs)("div",{className:"space-y-1 border-b py-1.5",children:[(0,t.jsx)("div",{className:"text-3xs font-semibold",children:E.leadQueueMenuText.conversationTypeLabel}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(p.Select,{value:e.conversationType??y.ConversationTypeFilter.ALL,onValueChange:e=>S(t=>({...t,conversationType:e})),children:[(0,t.jsx)(p.SelectTrigger,{className:(0,r.cn)("h-8 flex-1 px-2 py-0 text-2xs",Z&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:(0,t.jsx)(p.SelectValue,{children:(e.conversationType??y.ConversationTypeFilter.ALL)===y.ConversationTypeFilter.ALL?E.leadQueueMenuText.conversationTypeAny:e.conversationType===y.ConversationTypeFilter.DIRECT?E.leadQueueMenuText.conversationTypeDirectOnly:E.leadQueueMenuText.conversationTypeGroupOnly})}),(0,t.jsxs)(p.SelectContent,{className:"py-0 my-0 text-2xs",children:[(0,t.jsx)(p.SelectItem,{value:y.ConversationTypeFilter.ALL,className:"text-2xs",children:E.leadQueueMenuText.conversationTypeAny}),(0,t.jsx)(p.SelectItem,{value:y.ConversationTypeFilter.DIRECT,className:"text-2xs",children:E.leadQueueMenuText.conversationTypeDirectOnly}),(0,t.jsx)(p.SelectItem,{value:y.ConversationTypeFilter.GROUP,className:"text-2xs",children:E.leadQueueMenuText.conversationTypeGroupOnly})]})]}),Z&&(0,t.jsx)(x.Button,{variant:"ghost",size:"xs",onClick:()=>S(e=>({...e,conversationType:y.ConversationTypeFilter.ALL})),className:"h-8 shrink-0 px-2 text-3xs",children:O.clear??"Clear"})]})]}),(0,t.jsxs)("div",{className:"space-y-1 border-b py-1.5",children:[(0,t.jsx)("div",{className:"text-3xs font-semibold",children:O.asignado_a}),(0,t.jsx)(o.default,{users:A,value:e.assignedTo,onChangeValue:e=>null===e||"all"===e?L("all"):L(e),clearLabel:O.clear??"Clear",hideClear:!G,allContactsLabel:E.leadQueueMenuText.assignedToAny,compactTypography:!0,showInactiveUsers:!0})]}),(0,t.jsxs)("div",{className:"space-y-1 border-b py-1.5",children:[(0,t.jsx)("div",{className:"text-3xs font-semibold",children:E.leadQueueMenuText.soldByLabel}),(0,t.jsx)(o.default,{users:A,value:e.soldBy,onChangeValue:e=>null===e||"all"===e||""===e?k("all"):k(e),clearLabel:O.clear??"Clear",hideClear:!X,allContactsLabel:E.leadQueueMenuText.soldByAny,compactTypography:!0}),U.userId?(0,t.jsx)(x.Button,{type:"button",variant:e.soldBy===U.userId?"default":"outline",size:"xs",className:"h-7 text-2xs",onClick:()=>k(U.userId),children:E.leadQueueMenuText.soldByMe}):null]}),(0,t.jsxs)("div",{className:"space-y-1 border-b py-1.5",children:[(0,t.jsx)("div",{className:"text-3xs font-semibold",children:E.leadQueueMenuText.whatsappLinePhoneLabel}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(p.Select,{value:ea,onValueChange:e=>I(e),children:[(0,t.jsx)(p.SelectTrigger,{className:(0,r.cn)("h-8 flex-1 px-2 py-0 text-2xs",Y&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:(0,t.jsx)(p.SelectValue,{children:es})}),(0,t.jsxs)(p.SelectContent,{className:"py-0 my-0 text-2xs",children:[(0,t.jsx)(p.SelectItem,{value:v.CONTACT_CENTER_WHATSAPP_LINE_ALL,className:"text-2xs",children:E.leadQueueMenuText.whatsappLinePhoneAny}),(0,t.jsx)(p.SelectItem,{value:v.CONTACT_CENTER_WHATSAPP_LINE_UNBOUND,className:"text-2xs",children:E.leadQueueMenuText.whatsappLinePhoneUnbound}),F.map(e=>(0,t.jsx)(p.SelectItem,{value:e.phoneNumber,className:"text-2xs",children:e.friendlyName?`${e.friendlyName} (${e.phoneNumber})`:e.phoneNumber},e.phoneNumber))]})]}),Y&&(0,t.jsx)(x.Button,{variant:"ghost",size:"xs",onClick:()=>I("all"),className:"h-8 shrink-0 px-2 text-3xs",children:O.clear??"Clear"})]})]}),(0,t.jsxs)("div",{className:"space-y-1 border-b py-1.5",children:[(0,t.jsx)("div",{className:"text-3xs font-semibold",children:E.leadQueueMenuText.probableSourceLabel}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(p.Select,{value:e.probableSourceUnsetOnly?N:e.probableSource??"ALL",onValueChange:e=>{"ALL"===e?S(e=>({...e,probableSource:null,probableSourceUnsetOnly:!1})):e===N?S(e=>({...e,probableSource:null,probableSourceUnsetOnly:!0})):S(t=>({...t,probableSource:e,probableSourceUnsetOnly:!1}))},children:[(0,t.jsx)(p.SelectTrigger,{className:(0,r.cn)("h-8 flex-1 px-2 py-0 text-2xs",J&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:(0,t.jsx)(p.SelectValue,{children:e.probableSourceUnsetOnly?E.leadQueueMenuText.probableSourceNotSet:e.probableSource?E.conversationListItemText.probableSourceMapping[e.probableSource]:E.leadQueueMenuText.probableSourceAny})}),(0,t.jsxs)(p.SelectContent,{className:"py-0 my-0 text-2xs",children:[(0,t.jsx)(p.SelectItem,{value:"ALL",className:"text-2xs",children:E.leadQueueMenuText.probableSourceAny}),(0,t.jsx)(p.SelectItem,{value:N,className:"text-2xs",children:E.leadQueueMenuText.probableSourceNotSet}),Object.values(s.ProbableSource).map(e=>(0,t.jsx)(p.SelectItem,{value:e,className:"text-2xs",children:E.conversationListItemText.probableSourceMapping[e]},e))]})]}),J&&(0,t.jsx)(x.Button,{variant:"ghost",size:"xs",onClick:()=>S(e=>({...e,probableSource:null,probableSourceUnsetOnly:!1})),className:"h-8 shrink-0 px-2 text-3xs",children:O.clear??"Clear"})]})]}),(0,t.jsxs)("div",{className:"space-y-1 border-b py-1.5",children:[(0,t.jsx)("div",{className:"text-3xs font-semibold",children:E.leadQueueMenuText.websiteBrandLabel}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(p.Select,{value:e.originatingBrandIdUnsetOnly?j:e.originatingBrandId??"ALL",onValueChange:e=>{"ALL"===e?S(e=>({...e,originatingBrandId:null,originatingBrandIdUnsetOnly:!1})):e===j?S(e=>({...e,originatingBrandId:null,originatingBrandIdUnsetOnly:!0})):S(t=>({...t,originatingBrandId:e,originatingBrandIdUnsetOnly:!1}))},children:[(0,t.jsx)(p.SelectTrigger,{className:(0,r.cn)("h-8 flex-1 px-2 py-0 text-2xs",ee&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:(0,t.jsx)(p.SelectValue,{children:e.originatingBrandIdUnsetOnly?E.leadQueueMenuText.websiteBrandNone:e.originatingBrandId?K(e.originatingBrandId):E.leadQueueMenuText.websiteBrandAny})}),(0,t.jsxs)(p.SelectContent,{className:"py-0 my-0 text-2xs",children:[(0,t.jsx)(p.SelectItem,{value:"ALL",className:"text-2xs",children:E.leadQueueMenuText.websiteBrandAny}),(0,t.jsx)(p.SelectItem,{value:j,className:"text-2xs",children:E.leadQueueMenuText.websiteBrandNone}),_.map(e=>(0,t.jsx)(p.SelectItem,{value:e,className:"text-2xs",children:K(e)},e))]})]}),ee&&(0,t.jsx)(x.Button,{variant:"ghost",size:"xs",onClick:()=>S(e=>({...e,originatingBrandId:null,originatingBrandIdUnsetOnly:!1})),className:"h-8 shrink-0 px-2 text-3xs",children:O.clear??"Clear"})]})]}),(0,t.jsx)(x.Button,{variant:"outline",size:"xs",onClick:()=>{S(e=>T.LeadQueueFilterTransitions.resetAdvanced(e))},className:"mt-1.5 h-8 w-full text-2xs",children:E.leadQueueMenuText.resetAdvancedFilters})]})]})}])},386783,e=>{"use strict";e.i(477636);var t=e.i(293086);class a{static isIncludedByAssignee(e,a){return!1===e.includeChatbot&&!!e.assignedTo&&a[e.assignedTo]?.role===t.UserRole.CHATBOT}matches(e,s){if(!1!==s.filters.includeChatbot||a.isIncludedByAssignee(s.filters,s.usersById))return!0;let n=e.assignedTo||"";if(!n)return!0;let l=s.usersById?.[n];return!l||l.role!==t.UserRole.CHATBOT}}e.s(["ChatbotFilter",()=>a])},218799,e=>{"use strict";var t=e.i(435564),a=e.i(61112);e.i(2532);var s=e.i(92534),n=e.i(857411),l=e.i(467885),i=e.i(386783),r=e.i(689376),d=e.i(975031),o=e.i(489032),c=e.i(318869),u=e.i(494210),x=e.i(355689),h=e.i(471135),p=e.i(504275),m=e.i(396725),g=e.i(539946),f=e.i(397237),y=e.i(598081);
1let v=({filters:e,handleDateRangeAddedChange:a,compact:n=!1,shrinkToFit:l=!1})=>{let i=(0,x.useBusinessTimeZone)(),r=(0,d.useTranslations)();return(0,t.jsx)(p.DatePickerWithRange,{dateRange:(()=>{let t=e.dateRangeAdded?.from?(0,s.isoDayToLocalDate)(e.dateRangeAdded.from):void 0,a=e.dateRangeAdded?.to?(0,s.isoDayToLocalDate)(e.dateRangeAdded.to):void 0;if(t||a)return{from:t,to:a}})(),onDateRangeChange:e=>{e&&(e.from||e.to)?a({from:e.from?(0,s.convertLocalDateToIsoDay)(e.from):void 0,to:e.to?(0,s.convertLocalDateToIsoDay)(e.to):void 0}):a(null)},calendarTimeZone:i,translations:r.datePickerText,triggerClassName:(0,c.cn)("h-7 w-auto px-0.5 py-0 text-3xs",l&&"w-full min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap [&_svg]:shrink-0"),variant:n?"compact":"default",getTriggerLabel:e=>(0,o.makeCondensedDateRangeLabel)(e,r.datePickerText.allTime,i),className:(0,c.cn)(l&&"min-w-0 max-w-full")})};function T({filters:e,setFilters:s,handleSearchChange:o,handleSearchAllMessages:x,handleInterestLevelToggle:p,handleAssignedToChange:T,handleSoldByChange:b,handleWhatsappLinePhoneChange:C,handleDateRangeAddedChange:N,handleLastMessageDirectionChange:j,loadedContactCount:S,isAdvancedFilterOpen:w,setIsAdvancedFilterOpen:L,users:k,onResetFilters:I,defaultOrderBy:A,layout:M="stacked",disableSearchAllInDatabase:Q=!1,showQuickFilters:B=!1,handleQuickFiltersChange:D,onIncludeChatbotChange:O,bottomRowSlot:E,className:F}){let P=(0,u.useSharedTranslations)(),U=(0,d.useTranslations)(),z="inline"===M,R=!!Array.isArray(e.messageSearchContactIds)||!!e.messageSearchContactIds,K=Array.isArray(e.messageSearchContactIds)?e.messageSearchContactIds.length:0,_=R?K:S,$=R&&!0===e.messageSearchHasMore,W=$?`${_}+`:String(_),V=R?z?U.leadQueueMenuText.searchScopeAllInline:U.leadQueueMenuText.searchScopeAllShort:z?U.leadQueueMenuText.searchScopeLoadedInline:U.leadQueueMenuText.searchScopeLoadedShort,q=($?U.leadQueueMenuText.searchScopeAllCappedTooltip:R?U.leadQueueMenuText.searchScopeAllTooltip:U.leadQueueMenuText.searchScopeLoadedTooltip).replace("{count}",String(_)),H=e.orderBy??a.LeadQueueOrderBy.DEFAULT,Z=void 0!==e.orderBy&&void 0!==A&&e.orderBy!==A,G=(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)(h.Button,{variant:R?"default":"outline",size:"xs",className:(0,c.cn)("crm-lead-queue-search-scope-button h-auto min-h-0 min-w-0 whitespace-normal px-1.5 py-[2px] text-4xs leading-tight transition-[margin] duration-200",z?"h-7 w-[4.75rem] max-w-[5.25rem] shrink-0":"w-[7.5rem] min-w-0 shrink overflow-hidden whitespace-nowrap",R?"border-primary bg-primary text-primary-foreground hover:bg-primary/90":"border-primary/25 bg-brand-subtle text-brand-subtle-foreground hover:bg-primary/15"),"data-lead-queue-filter-control":"search-scope","data-search-scope":R?"all":"loaded",onClick:()=>x(),children:[(0,t.jsx)(n.Search,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,c.cn)("min-w-0 flex-1 text-center whitespace-normal",!z&&"truncate whitespace-nowrap"),children:V.replace("{count}",W)})]})}),(0,t.jsx)(f.TooltipContent,{side:"bottom",className:"max-w-64",children:q})]}),X=(0,t.jsxs)("div",{className:(0,c.cn)("flex items-center gap-0.5",z?"shrink-0":"min-w-0 shrink overflow-hidden"),"data-lead-queue-filter-control":"order","data-order-customized":Z,children:[(0,t.jsxs)("span",{className:(0,c.cn)("whitespace-nowrap text-4xs text-foreground",!z&&"min-w-0 shrink truncate"),children:[U.leadQueueMenuText.sortOrderL
1abel,":"]}),(0,t.jsxs)(g.Select,{value:H,onValueChange:e=>s(t=>({...t,orderBy:Object.values(a.LeadQueueOrderBy).find(t=>t===e)??t.orderBy})),children:[(0,t.jsx)(g.SelectTrigger,{className:(0,c.cn)("h-6 px-1 py-0 text-3xs text-foreground",z?"h-7 w-[4.5rem]":"w-auto min-w-0 max-w-full shrink overflow-hidden",Z&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:(0,t.jsx)(g.SelectValue,{children:H===a.LeadQueueOrderBy.DATE_ADDED?U.leadQueueMenuText.dateAdded:H===a.LeadQueueOrderBy.LAST_MESSAGE_DATE_ADDED?U.leadQueueMenuText.lastMessageDateAdded:U.leadQueueMenuText.default})}),(0,t.jsxs)(g.SelectContent,{className:"py-0 my-0 text-3xs",children:[(0,t.jsx)(g.SelectItem,{value:a.LeadQueueOrderBy.DEFAULT,className:"text-3xs",children:U.leadQueueMenuText.default}),(0,t.jsx)(g.SelectItem,{value:a.LeadQueueOrderBy.DATE_ADDED,className:"text-3xs",children:U.leadQueueMenuText.dateAdded}),(0,t.jsx)(g.SelectItem,{value:a.LeadQueueOrderBy.LAST_MESSAGE_DATE_ADDED,className:"text-3xs",children:U.leadQueueMenuText.lastMessageDateAdded})]})]})]}),Y=(0,t.jsx)(h.Button,{variant:"outline",size:"xs",className:(0,c.cn)("px-1 text-3xs text-foreground",z?"h-7":"h-6 min-w-0 shrink overflow-hidden text-ellipsis whitespace-nowrap"),"data-lead-queue-filter-control":"reset",onClick:I,children:U.leadQueueMenuText.resetFilters}),J=(0,t.jsxs)("div",{className:(0,c.cn)("relative",z?"w-40 shrink-0":"min-w-0 grow basis-0"),"data-lead-queue-filter-control":"search",children:[(0,t.jsx)(n.Search,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 transform text-muted-foreground/70"}),(0,t.jsx)(m.Input,{type:"text",placeholder:P.buscar,value:e.searchTerm,onChange:o,className:"pl-7 pr-2 py-1 h-7 text-3xs rounded-md"})]}),ee=(0,t.jsx)(l.AdvancedFilterSection,{filters:e,setFilters:s,handleInterestLevelToggle:p,handleAssignedToChange:T,handleSoldByChange:b,handleWhatsappLinePhoneChange:C,users:k,isAdvancedFilterOpen:w,setIsAdvancedFilterOpen:L,handleLastMessageDirectionChange:j}),et=B&&D?(0,t.jsx)(y.default,{className:(0,c.cn)(z&&"shrink-0"),orientation:z?"vertical":"horizontal",value:r.LeadQueueFilterTransitions.quickFilterValue(e),onChange:D,includeChatbot:e.includeChatbot??!0,chatbotIncludedByAssignee:i.ChatbotFilter.isIncludedByAssignee(e,k),onIncludeChatbotChange:O}):null;return z?(0,t.jsxs)("div",{className:(0,c.cn)("flex min-w-0 flex-row flex-wrap items-start gap-x-3 gap-y-1",F),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[!Q&&G,J]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[X,(0,t.jsx)(v,{filters:e,handleDateRangeAddedChange:N,compact:!0})]}),E,(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[ee,Y]}),et]}):(0,t.jsxs)("div",{className:(0,c.cn)("w-full min-w-0",F),children:[(0,t.jsxs)("div",{className:"flex w-full min-w-0 flex-nowrap items-center justify-between gap-1","data-lead-queue-filter-row":"primary",children:[!Q&&G,X,Y]}),(0,t.jsxs)("div",{className:"mt-px flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex w-full min-w-0 flex-nowrap items-center gap-1","data-lead-queue-filter-row":"secondary",children:[J,(0,t.jsx)("div",{className:"min-w-0 shrink overflow-hidden","data-lead-queue-filter-control":"date",children:(0,t.jsx)(v,{filters:e,handleDateRangeAddedChange:N,shrinkToFit:!0})}),(0,t.jsx)("div",{className:"min-w-0 shrink overflow-hidden","data-lead-queue-filter-control":"advanced",children:(0,t.jsx)(l.AdvancedFilterSection,{filters:e,setFilters:s,handleInterestLevelToggle:p,handleAssignedToChange:T,handleSoldByChange:b,handleWhatsappLinePhoneChange:C,users:k,isAdvancedFilterOpen:w,setIsAdvancedFilterOpen:L,handleLastMessageDirectionChange:j,className:"w-full min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap [&_svg]:shrink-0"})})]}),et]})]})}e.s(["default",()=>T])},929832,e=>{"use strict";var t=e.i(17460),a=e.i(294477),s=e.i(689376);function n({filters:e,setFilters:n,locationId:l}){let i=(0,t.useCallback)(e=>{var t;let a,s=(a=(t=e.target.value).replace(/\s/g,"").replace(/^\+/,""),/^\d+$/.test(a)?a:t);n(e=>({...e,searchTerm:s,...e.messageSearchContactIds?{messageSearchContactIds:null,messageSearchHasMore:!1}:{}}))},[n]),{matchingContacts:r}=(0,a.useMessageSearch)(l),d=(0,t.useCallback)(async()=>{let t=await r(e.searchTerm||"");void 0!==t&&n(e=>({...e,messageSearchContactIds:t?.contactIds??null,messageSearchHasMore:t?.hasMore??!1}))},[e.searchTerm,r,n]),o=(0,t.useCallback)(e=>{n(t=>({...t,stages:t.stages.includes(e)?t.stages.filter(t=>t!==e):[...t.stages,e]}))},[n]),c=(0,t.useCallback)(e=>{n(t=>({...t,interestLevels:t.interestLevels.includes(e)?t.interestLevels.filter(t=>t!==e):[...t.interestLevels,e]}))},[n]),u=(0,t.useCallback)(e=>{n(t=>s.LeadQueueFilterTransitions.withAssignee(t,e))},[n]),x=(0,t.useCallback)(e=>{n(t=>s.LeadQueueFilterTransitions.withSeller(t,e))},[n]),h=(0,t.useCallback)(e=>{n(t=>({...t,whatsappLinePhone:"all"===e?null:"unbound"===e?"":e}))},[n]),p=(0,t.useCallback)(e=>{n(t=>({...t,dateRangeAdded:e}))},[n]),m=(0,t.useCallback)(e=>{n(t=>({...t,lastMessageDirection:e}))},[n]),g=(0,t.useCallback)(e=>{n(t=>s.LeadQueueFilterTransitions.withQuickFilters(t,e))},[n]);return{handleSearchChange:i,handleSearchAllMessages:d,handleStageToggle:o,handleInterestLevelToggle:c,handleAssignedToChange:u,handleSoldByChange:x,handleWhatsappLinePhoneChange:h,handleDateRangeAddedChange:p,handleLastMessageDirectionChange:m,handleQuickFiltersChange:g,handleIncludeChatbotChange:(0,t.useCallback)(e=>{n(t=>({...t,includeChatbot:e}))},[n]),handleMinPriorityScoreChange:(0,t.useCallback)(e=>{n(t=>({...t,minPriorityScore:e}))},[n])}}e.s(["useLeadQueueFilters",()=>n])}]);
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.