1import{j as e,d as Z,r as g,f as Ts,L as Fn,a as Un}from"./vendor-react-Bq0AAjM7.js";import{F as Bn}from"./FirstMeetingUpgradePopup-Bz4q6Ypy.js";import{l as M,J as R,b2 as L,ht as Ds,a as G,aK as Ce,aM as K,cT as z,E as ie,aL as gt,d as Ls,C as Ps,g as Os,ch as _s,hu as _,e as ms,bM as ht,bN as Bt,bO as pt,ax as zn,h7 as Gn,ba as gs,aN as pe,aO as xe,aP as fe,I,aQ as be,aR as ve,bu as je,cM as He,ac as ee,aV as Vn,aW as $n,aX as Wn,aY as Hn,aZ as Jn,a_ as Yn,a$ as Kn,hk as Ot,hj as Zn,d_ as he,b1 as Qn,dB as zt,dn as Gt,eC as Fs,bd as Vt,be as $t,bf as Wt,aS as xt,cU as Xn,a1 as Je,b0 as Ht,U as we,db as q,bh as Us,bi as Bs,em as qn,en as St,eo as kt,eI as ea,eJ as ta,hv as _t,co as sa,bv as na,bw as aa,d9 as ra,hw as Ue,dc as _e,hx as ct,cf as ia,dl as oa,bF as la,x as oe,y as We,cY as ca,bg as da,z as ye,B as zs,c1 as Se,c2 as ke,$ as Gs,a0 as Vs,a3 as $s,a7 as Ws,aT as ua,d1 as ma,ce as ga,M as ha,W as pa,gX as xa,G as Hs,H as Js,dP as fa,bl as ba,ef as va,dX as ja,dY as ya,Q as hs,au as Na,cq as Ea,bm as It,cB as Ys,fX as Ie,a2 as Ks,dN as Ca,at as wa,cw as Sa,cx as ka,cy as Ia,cH as Ra,gf as Aa}from"./main-D49UUfSD.js";import{u as Ma}from"./useHidePlainChat-CgB1uSRE.js";import{u as Jt}from"./useOrganisationActions-BVWeZ-8E.js";import{u as Yt}from"./useManagedSettingHelpers-DU1ArCmY.js";import{u as Ye,S as dt}from"./SeatLocked-w6BrO7Hk.js";import{u as Ta,R as Da,a as La,M as Pa,b as Oa,N as _a}from"./updateCalendarEventNotetaker-Cv9Ckv_X.js";import{cq as Fa,aq as ft,t as Ke,u as bt,o as Re,z as ut,F as Ua,A as Fe,B as ps,H as at,C as le,O as Ba,cr as za,n as Ga,a3 as Zs}from"./vendor-misc-DMccS2Mw.js";import{T as vt,a as jt,b as ce}from"./tabs-Bz7BswTQ.js";import{W as Va}from"./WebHubOrganisationLayout-D9vlIJ3g.js";import{P as $a}from"./ProviderConnectButton-DkDt69Df.js";import{u as Wa}from"./useConnectCalendar-EZEGwiGH.js";import{u as Ha}from"./useIntegrationAccessGuard-WuM0inPC.js";import{M as yt,d as Ja,e as Ya,f as Ka,G as Za,C as Qa,h as xs}from"./ChatMessageList-XyEXIlgf.js";import{T as Kt}from"./ThreadDayDivider-wklQKpgq.js";import{f as Xa,a as qa}from"./formatTimeRange-CDkyP71v.js";import{b as er,d as tr,e as sr,a as Qs,i as Xs,N as Zt,f as nr,h as ar,j as rr}from"./utils-BRCZESoD.js";import{C as ir}from"./CalendarEvent-CErJ0TeH.js";import{g as or}from"./groupBy-Cp1aJ2BK.js";import{R as Ft,a as mt}from"./radio-group-CzmMixzN.js";import{D as lr}from"./dropdownClassNames-Dga6WU27.js";import{P as qs,a as en,b as tn}from"./popover-4HcJ00FV.js";import{u as cr,p as dr,C as ur}from"./ChatInput-LhdmIzRh.js";import{S as fs,a as bs,b as mr}from"./search-bar-CQkSk4Df.js";import{S as Be,a as ze,b as Ge,c as Ve,d as $e}from"./select-4sRtrU5h.js";import{u as Ae,a as gr,b as sn,c as nn,l as an,d as rn,e as on,s as ln}from"./useCallRecordings-fhI5azc0.js";import{t as cn,C as dn,O as hr,u as pr,a as un,b as xr,I as fr,c as br}from"./CopyRecordingLinkPopover-nRD6Jxyb.js";import{a as vr,E as jr,c as mn}from"./index-Dl4pFCyo.js";import{D as Qt,E as Xt,G as vs}from"./vendor-ui-HM9MEgw-.js";import{o as yr}from"./organisationConfigDefaults-C37-9FfX.js";import{S as Nr,e as Er,a as Cr,b as wr,c as Sr,d as kr,f as Ir,h as Rr}from"./sheet-Bh4sUrct.js";import{C as Ar}from"./ConfirmDialog-D_fg_k30.js";import{S as Mr,L as Tr,B as Dr}from"./ReactCrop-bIj5Q5x-.js";import{c as Ze}from"./vendor-sentry-BBJkNfRx.js";import{c as Lr,s as gn,u as Pr,b as Or,m as W}from"./proxy-DAl5xTRT.js";import{A as _r}from"./index-BdXXo1LO.js";import{u as Fr}from"./useRecallZoomConnectionRedirect-CrUoWmjK.js";import{u as Ur,a as Br}from"./useCalendarConnections-D3MiHFd6.js";import{T as zr}from"./textarea-Csiq-Gmc.js";import{t as Gr,p as Vr}from"./vendor-icons-DePtd98t.js";import{f as hn}from"./formatTimeAgo-ZL4xsmDE.js";import{c as $r}from"./copyText-0_NNZNe-.js";import"./vendor-runtime-DG-GlVKR.js";import"./pricing-C1IJ1mLx.js";import"./currency-BvZtfEGc.js";import"./vendor-analytics-DaFEZfd9.js";import"./useAccessibleSpaces-CQ2K9Xs8.js";import"./UpgradeAction-BTdZVCbp.js";import"./askAdminToUpgradeCopy-DJ5QaKnM.js";import"./ErrorBoundary-ilVjDrsx.js";import"./LoadFailed-USmzVBxQ.js";import"./Drawer-DvSV0I9s.js";
1import"./ThreadUnreadDot-D_aBtxhK.js";import"./chunkArray-B4GsduDf.js";import"./formatTimestampLabel-R9Kn71XV.js";import"./useIsSpacesEnabled-CtwbGBox.js";import"./WebHubTourProvider-BIOFdQl4.js";import"./TourTooltipCard-Dwe5K3W2.js";import"./tokens-DaqiVV3J.js";import"./ThreadStepDots-CkX8036c.js";import"./webHubTourStorage-DyoTGtrU.js";import"./useFlowAccess-Bo-NPwgn.js";import"./useSpaceInvitesQuery-BokVFtR7.js";import"./Space-gD2pE8f9.js";import"./useSpaceUserPreferences-CKmOlYTt.js";import"./useSuggestedSpacesQuery-D6QhqqZe.js";import"./useRecentSpaces-1capDSVt.js";import"./isFyxer1Organisation-BwqJT8KB.js";import"./isEnterpriseOrganisation-Fjb8mzJZ.js";import"./useIsOutsideDashboardOnboardingWindow-BWuWvSLB.js";import"./useEmailForwardingConnections-BLaDD6g6.js";import"./emailForwardingConnectionsQueryRoot-f2XcGuCb.js";import"./AnnouncementDialog-DGy6pe-B.js";import"./PriorityVisualization-CboE8PTJ.js";import"./classifyTermsDocumentForOrganisation-CMvC-vzO.js";import"./trials-8KUt_9DV.js";import"./useSignInProvider-iuhx0BUw.js";import"./usePaidIntegrationBlockReason-V3k2bmNX.js";import"./pricing2026Copy-B9umRD-S.js";import"./connectedMailboxLimit-DW5QMT-u.js";import"./getLimit-C0UR8BUV.js";import"./integrationSettingKey-DoJ8kxoa.js";import"./FyxerThinking-CB08HK5n.js";import"./useHasDocumentAccess-B59dXvXv.js";import"./DocumentUpload-_o4WqiFm.js";import"./progress-1_6MsTuc.js";import"./stringifyLocale-CGN90IVL.js";import"./mermaid-3ZIDBTTL-BTdJrOGe.js";import"./index-DirJCEvl.js";import"./marked.esm-arQYK1KV.js";import"./ChatToolUsage-C9HStSZv.js";/* empty css */import"./getBrowserTimezone-s91SEF56.js";import"./index-Dh4PUTGt.js";import"./index-mg-HgWsm.js";import"./index-BJfBsrKE.js";import"./index-D3nCXTpj.js";import"./index-NniXEa6m.js";import"./input-group-DJNqLKaG.js";import"./resolveAriaLabelledBy-B6xExwUN.js";import"./ThreadRadio-41PHdMNV.js";import"./index-D2UeztMp.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="e16457a6-895f-470a-8b1e-10ea15ce17ac",t._sentryDebugIdIdentifier="sentry-dbid-e16457a6-895f-470a-8b1e-10ea15ce17ac")}catch{}function Wr({className:t,...s}){return e.jsx("nav",{"aria-label":"Pagination","data-slot":"pagination",className:M("flex flex-col items-center justify-between gap-3 sm:flex-row",t),...s})}function Hr({className:t,...s}){return e.jsx("span",{"data-slot":"pagination-summary",className:M("text-body-sm text-muted-foreground",t),...s})}function Jr({className:t,...s}){return e.jsx("ul",{"data-slot":"pagination-content",className:M("m-0 flex list-none items-center gap-1 p-0",t),...s})}function Rt({...t}){return e.jsx("li",{"data-slot":"pagination-item",...t})}function Yr({className:t,...s}){return e.jsx("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:M("flex h-7 items-center justify-center px-1.5 text-body-sm text-disabled-foreground",t),...s,children:"â¦"})}const Kr=({currentPage:t,totalPages:s})=>{const r=[],i=[];for(let l=Math.max(2,t-2);l<=Math.min(s-1,t+2);l++)r.push(l);return t-2>2?i.push(1,"..."):i.push(1),i.push(...r),t+2<s-1?i.push("...",s):s>1&&i.push(s),i},Qe=({currentPage:t,totalPages:s,totalItems:a,itemsPerPage:r,onPageChange:i,showResultsInfo:l=!0,className:n})=>{if(s<=1)return null;const o=(t-1)*r+1,d=Math.min(t*r,a);return e.jsxs(Wr,{className:n,children:[l&&e.jsxs(Hr,{children:["Showing ",o," to ",d," of ",a," results"]}),e.jsxs(Jr,{children:[e.jsx(Rt,{children:e.jsx(R,{variant:"ghost",size:"icon-sm","aria-label":"Go to previous page",disabled:t===1,onClick:()=>i(t-1),children:e.jsx(Gr,{})})}),Kr({currentPage:t,totalPages:s}).map((c,m)=>e.jsx(Rt,{children:c==="..."?e.jsx(Yr,{}):e.jsx(R,{variant:"ghost",size:"sm","aria-label":`Go to page ${c}`,"aria-current":t===c?"page":void 0,onClick:()=>i(c),className:M("min-w-7 px-1.5 font-normal text-muted-foreground hover:bg-surface hover:text-foreground",t===c&&"bg-surface font-medium text-foreground"),children:c})},c==="..."?`ellipsis-${m}`:c)),e.jsx(Rt,{children:e.jsx(R,{variant:"ghost",size:"icon-sm","aria-label":"Go to next page",disabled:t===s,onClick:()=>i(t+1),children:e.jsx(Vr,{})})})]})]})};
1function Zr(t){t.values.forEach(s=>s.stop())}function Ut(t,s){[...s].reverse().forEach(r=>{const i=t.getVariant(r);i&&gn(t,i),t.variantChildren&&t.variantChildren.forEach(l=>{Ut(l,s)})})}function Qr(t,s){if(Array.isArray(s))return Ut(t,s);if(typeof s=="string")return Ut(t,[s]);gn(t,s)}function Xr(){const t=new Set,s={subscribe(a){return t.add(a),()=>void t.delete(a)},start(a,r){const i=[];return t.forEach(l=>{i.push(Lr(l,a,{transitionOverride:r}))}),Promise.all(i)},set(a){return t.forEach(r=>{Qr(r,a)})},stop(){t.forEach(a=>{Zr(a)})},mount(){return()=>{s.stop()}}};return s}function qr(){const t=Pr(Xr);return Or(t.mount,[]),t}const ei=qr,ti=()=>{var x;const{userMembership:t}=L(),{updateMembership:s}=Jt(),{desktopAppStatus:{value:a,isLoading:r}}=Ds(),[i,l]=Z(),{logEvent:n}=G(),{canEdit:o,resolved:d,isLoading:c}=Yt(),m=i.get("auto_enable_notetaker")==="true",{autoJoinMeetingConfiguration:u}=t.data(),p=((x=d.autoJoinMeetingConfiguration)==null?void 0:x.value)??u,f=o("autoJoinMeetingConfiguration"),{isSeatLocked:h}=Ye("meetingRecording");g.useEffect(()=>{if(!m||r||c)return;if(h){Ce({action:"turn on Notetaker",fix:"Upgrade your seat to record and get notes from your meetings."}),l(C=>{const y=new URLSearchParams(C);return y.delete("auto_enable_notetaker"),y},{replace:!0});return}const b=async()=>{try{a&&a.previousAutoJoinMeetingConfiguration?K.info({title:"Your desktop app already records your meetings"}):f&&p!==z.ALWAYS&&(n(ie.TURN_ON_NOTETAKER_AUTO_JOIN_MEETINGS),await s({autoJoinMeetingConfiguration:z.ALWAYS}),K.success({title:"Notetaker turned on"}))}catch{gt({action:"turn on Notetaker",onRetry:()=>void b()})}finally{l(C=>{const y=new URLSearchParams(C);return y.delete("auto_enable_notetaker"),y},{replace:!0})}};b()},[m,r,c,a,p,f,s,l,n,h])},si=()=>{const[t,s]=Z(),{isSeatLocked:a}=Ye("meetingRecording"),{isPlanLocked:r,isPending:i}=Ta(),l=t.get("join_meeting");g.useEffect(()=>{if(!l||i)return;if(a||r){Ce({action:"add Notetaker to this meeting",fix:a?"Upgrade your seat to record and get notes from your meetings.":Da}),s(d=>{const c=new URLSearchParams(d);return c.delete("join_meeting"),c},{replace:!0});return}let n=!1;const o=async()=>{try{const d=Ls(Ps.CalendarEvent,l),c=await Os(d);if(n)return;if(!c.exists()){Ce({action:"add Notetaker to this meeting",fix:"Itâs no longer in your calendar."});return}if(c.data().isBotInvited){K.info({title:"Notetaker is already joining this meeting"});return}await _s(d,{isBotInvited:!0}),K.success({title:"Notetaker added to this meeting"})}catch{gt({action:"add Notetaker to this meeting",onRetry:()=>void o()})}finally{n||s(d=>{const c=new URLSearchParams(d);return c.delete("join_meeting"),c},{replace:!0})}};return o(),()=>{n=!0}},[l,s,a,r,i])},ni=()=>{const{userMembership:t}=L(),{updateMembership:s}=Jt(),{canEdit:a,isLoading:r}=Yt(),i=r||a("callRecordingDistribution"),[l,n]=Z(),{callRecordingDistribution:o}=t.data(),d=l.get("enable_sharing")==="true",c=o===_.HOST_ONLY||o===_.NONE,m=g.useCallback(()=>{n(p=>{const f=new URLSearchParams(p);return f.delete("enable_sharing"),f},{replace:!0})},[n]),u=g.useCallback(async()=>{if(!i){Ce({action:"turn on sharing",fix:"Your organization manages this setting. Ask an admin to change it."}),m();return}try{await s({callRecordingDistribution:_.EVERYONE_ON_INVITE}),K.success({title:"Summaries will be shared with attendees"})}catch{gt({action:"turn on sharing",onRetry:()=>void u()})}finally{m()}},[s,i,m]);g.useEffect(()=>{r||d&&c&&u()},[d,c,u,r])};var me=(t=>(t.CALL_RECORDINGS="call-recordings",t.CALENDAR_EVENTS="calendar-events",t))(me||{});const ai=({className:t})=>{const{calendarConnections:s}=L(),{integration:a,redirectingIntegration:r,connectWith:i}=Wa(),{isConnectionAllowed:l}=Ha(),{isSeatLocked:n}=Ye("calendarConnection"),o=l(ms.GOOGLE_CALENDAR)||l(ms.MICROSOFT_OUTLOOK_CALENDAR);return n||s.length>0||!o?null:e.jsxs(ht,{className:M("mb-4",t),children:[e.jsx(Bt,{children:"Connect your calendar"}),e.jsx(pt,{children:"Let Fyxer automatically join and take notes in your upcoming meetings."}),e.jsx("div",{className:"mt-2",children:e.jsx($a,{serviceType:zn.CALENDAR,integration:a,redirectingIntegration:r,onConnect:i,variant:"brand",size:"sm",className:"w-auto"})})]})},qt=()=>{const{calendarEvents:{value:t,isLoading:s}}=Gn();if(s)throw new Error("calendar events are still loading");if(t===void 0)throw new Error("calendar events are missing");return{calendarEvents:t}},pn=t=>Object.entries(t).map(([s,a])=>({key:s,value:a})),ri=({isOpen:t,onClose:s,onUpdate:a,meetingTitle:r})=>{const[i,l]=g.useState("current");return e.jsx(Vn,{open:t,onOpenChange:n=>!n&&s(),children:e.jsxs($n,{children:[e.jsxs(Wn,{children:[e.jsxs(Hn,{children:['Update "',r,'"']}),e.jsx(Jn,{children:"Change Notetaker for this meeting only, or for every meeting in the series?"})]}),e.jsxs(Ft,{value:i,onValueChange:n=>l(n),className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex cursor-pointer items-center space-x-2",onClick:()=>l("current"),children:[e.jsx(mt,{value:"current","aria-label":"This meeting only"}),e.jsx("span",{className:"text-body-sm text-rb-darkbtn",children:"This meeting only"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center space-x-2",onClick:()=>l("all"),children:[e.jsx(mt,{value:"all","aria-label":"All meetings in the series"}),e.jsx("span",{className:"text-body-sm text-rb-darkbtn",children:"All meetings in the series"})]})]}),e.jsxs(Yn,{children:[e.jsx(Kn,{onClick:n=>n.stopPropagation(),children:"Discard change"}),e.jsx(R,{variant:"primary",size:"md",onClick:n=>{n.stopPropagation(),a(i)},children:"Save changes"})]})]})})},ii=({calendarEventDoc:t,calendarEmail:s})=>{const{organisationId:a}=L(),{userId:r}=je(),{calendarEvents:i}=qt(),{logButtonPress:l}=G(),n=t.data(),o=t.id,d=n.title||"Untitled",[c,m]=g.useState(!1),u=bt({mutationFn:async h=>{m(!1);const x=!n.isBotInvited;return l(ee.TOGGLE_MEETING_NOTETAKER,{calendarEventId:o}),h==="current"?(await _s(t.ref,{isBotInvited:x}),x):(await La({calendarEventDoc:t,calendarEventDocs:i,userId:r,organisationId:a,isBotInvited:x}),x)},onSuccess:h=>{K.success({title:h?"Notetaker added to this meeting":"Notetaker removed from this meeting"})},onError:(h,x)=>{He({action:"update meeting",error:h,onRetry:()=>u.mutate(x)})}}),p=er({calendarEvent:n,calendarEmail:s}),f=()=>
1{if(n.isRecurring){m(!0);return}u.mutate("current")};return e.jsxs(e.Fragment,{children:[e.jsx(yt,{title:d,startsAt:n.startsAt,endsAt:n.endsAt,showDay:!1,peopleCount:Qs(n),status:p.isEligible?"upcoming":"cantRecord",statusDetail:p.isEligible?void 0:sr(p.reason),to:tr({organisationId:a,connectionId:n.connectionId,providerId:n.providerId,startsAt:n.startsAt}),actions:e.jsxs(e.Fragment,{children:[n.meetingUrl&&e.jsx(Pa,{joinUrl:Oa({meetingUrl:n.meetingUrl,calendarEmail:s}),meetingTitle:d,startsAt:n.startsAt,endsAt:n.endsAt}),p.isEligible&&e.jsx(_a,{checked:n.isBotInvited,meetingTitle:d,disabled:u.isPending,onChange:f})]})}),e.jsx(ri,{isOpen:c,onClose:()=>m(!1),onUpdate:u.mutate,meetingTitle:d})]})},oi=({fallback:t,filter:s})=>{const{calendarEvents:a}=qt(),{calendarConnections:r}=L(),i=r.reduce((o,d)=>{const c=d.id,m=d.data().metadata.email;return{...o,[c]:m}},{}),l=a.filter(gs(o=>{var f;const{connectionId:d,attendees:c}=o,m=i[d];if(!m)return!1;const u=((f=c==null?void 0:c.find(h=>h.email===m))==null?void 0:f.responseStatus)===ir.DECLINED,p=Fa(o.endsAt,new Date);return!u&&!p&&(s?s(o):!0)})),n=pn(or(l,gs(o=>Ke(o.startsAt,"yyyy-MM-dd"))));return e.jsx("div",{className:"flex min-h-full flex-col",children:n.length===0?e.jsx(e.Fragment,{children:t||e.jsx(pe,{size:"lg",className:"min-h-[420px] flex-1",children:e.jsxs(xe,{children:[e.jsx(fe,{children:e.jsx(I,{name:"CalendarBlank"})}),e.jsx(be,{children:"No upcoming meetings"}),e.jsx(ve,{children:"Scheduled meetings from your connected calendar appear here, ready for Fyxer to join."})]})})}):n.map(({key:o,value:d})=>{const c=Xa({date:ft(o),otherDayFormat:"EEEE, d MMMM"});return e.jsxs("div",{className:"py-4",children:[e.jsx(Kt,{label:c,className:"px-3.5 pb-3"}),e.jsx("div",{className:"flex flex-col gap-0.5",children:d.map(m=>{const{connectionId:u}=m.data(),p=i[u];return p?e.jsx(ii,{calendarEventDoc:m,calendarEmail:p},m.id):null})})]},o)})})},li=({query:t,selectedPeople:s=[],selectedDomains:a=[],sortBy:r="date_desc",enabled:i=!0})=>{const{data:l,isLoading:n}=Ae({query:t,enabled:i,pageSize:20,fetchFullRecordings:!1,sortBy:r,facetFilters:{attendeeEmails:s,domains:a}}),{data:o,isLoading:d}=gr({query:t,enabled:i&&!!t}),c=((l==null?void 0:l.items)||[]).map(p=>{var f,h,x,b;return{id:p.objectID,startsAt:(f=p.calendarEvent)==null?void 0:f.startsAt,endsAt:(h=p.calendarEvent)==null?void 0:h.endsAt,title:((x=p.calendarEvent)==null?void 0:x.title)||"Untitled Recording",type:"CALL_RECORDING",attendeeEmails:((b=p.calendarEvent)==null?void 0:b.attendeeEmails)||[],access:cn(p)}}),m=t?(o==null?void 0:o.emails)??[]:(l==null?void 0:l.attendeeEmails)??[];return{data:{domains:t?(o==null?void 0:o.domains)??[]:(l==null?void 0:l.domains)??[],attendeeEmails:m,results:c},isFetching:n||d}},ci=t=>{const s=t.data();return("providerEventId"in s?s.providerEventId:void 0)??t.id},rt=t=>{var r,i;const s=(r=t.calendarEvent)==null?void 0:r.startsAt,a=(i=t.calendarEvent)==null?void 0:i.endsAt;return!s||!a?0:a.getTime()-s.getTime()},js=t=>Ot(t)?0:Zn(t)?1:2,di=(t,s)=>t.length===1?t:t.sort((a,r)=>{var p,f;const i=a.data(),l=r.data(),n=js(i),o=js(l);if(n!==o)return n-o;const d=Ot(i),c=Ot(l);if(d&&c){const h=rt(l)-rt(i);if(h!==0)return h}if(!d&&!c){const h=i.userId===s,x=l.userId===s;if(h!==x)return h?-1:1;if(h&&x){const b=rt(l)-rt(i);if(b!==0)return b}}const m=((p=i.calendarEvent)==null?void 0:p.startsAt)??i.createdAt;return(((f=l.calendarEvent)==null?void 0:f.startsAt)??l.createdAt).getTime()-m.getTime()}),es=t=>{const s=t.reduce((a,r)=>{var d;const i=r.data(),l=((d=i.calendarEvent)==null?void 0:d.startsAt)??i.createdAt,n=Ke(l,"yyyy-MM-dd"),o=ci(r);return a[n]||(a[n]={}),a[n][o]||(a[n][o]=[]),a[n][o].push(r),a},{});return pn(s).map(({key:a,value:r})=>({key:a,value:Object.values(r)}))},xn=t=>(t??[]).filter(s=>!Xs({email:s,nonHumanDomains:Zt})).length,ui=t=>{var a;const s=t.calendarEvent;if(s)return(a=s.attendees)!=null&&a.length?Qs(s):xn(s.attendeeEmails)},ts=({callRecordings:t,scope:s="all"})=>{var u,p,f;const{organisationId:a,allVerifiableEmailAddresses:r}=L(),{userId:i}=je(),{logButtonPress:l}=G(),n=Ts(),o=di([...t],i)[0],d=o.data(),c=Ja(d),m=`/org/${a}/meeting-assistant/call-recordings/${o.id}`;return e.jsx(yt,{title:((u=d.calendarEvent)==null?void 0:u.title)??"Untitled",startsAt:(p=d.calendarEvent)==null?void 0:p.startsAt,endsAt:(f=d.calendarEvent)==null?void 0:f.endsAt,timeFallback:`Recorded ${Qn({date:d.createdAt})}`,showDay:!1,peopleCount:ui(d),status:c,to:m,onOpen:()=>l(ee.CLICK_MEETING_CARD,{scope:s,recording_id:o.id}),tags:e.jsx(hr,{callRecording:d,viewerEmails:r}),actions:e.jsx(dn,{callRecordingId:o.id,known:cn(d),onManageAccess:()=>n(`${m}?shouldEditAccess=true`),children:({onClick:h,isPending:x})=>e.jsx(he,{icon:"Link",label:"Copy share link",variant:"ghost",size:"sm",className:"opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100 max-lg:opacity-100",onClick:h,disabled:x})})})},ys=[{label:"Newest first",value:"date_desc"},{label:"Oldest first",value:"date_asc"}],Ns=32,mi=t=>t.length>Ns?`${t.slice(0,Ns)}â¦`:t,Es=({ariaLabel:t,icon:s,placeholder:a,searchPlaceholder:r,emptyMessage:i,options:l,value:n,onChange:o,onSearchChange:d,className:c})=>{const[m,u]=g.useState(!1),[p,f]=g.useState(""),h=g.useRef(null),x=p.trim(),b=x&&!l.some(S=>S.value.toLowerCase()===x.toLowerCase())?x:void 0,C=[...l,...b?[{label:`Add "${b}"`,value:b}]:[]],y=S=>{o(n.includes(S)?n.filter(D=>D!==S):[...n,S])},k=n.length===0?a:n.length===1?n[0]:`${n.length} selected`;return e.jsxs(qs,{open:m,onOpenChange:S=>{u(S),S||(f(""),d(""))},children:[e.jsx(en,{render:e.jsx(Ht,{"aria-label":t,icon:s,active:m||n.length>0,isTrailingIconRotated:m,stretch:!0,label:k,className:c})}),e.jsxs(tn,{align:"start",sideOffset:4,initialFocus:h,className:M("gap-0.5 p-1.5","w-(--anchor-width) min-w-[220px] gap-1"),children:[e.jsx(we,{ref:h,value:p,onChange:S=>{f(S.target.value),d(S.target.value)},placeholder:r,"aria-label":`${t} search`,className:"shadow-none"}),e.jsx("div",{role:"listbox","aria-label":t,"aria-multiselectable":!0,className:"flex max-h-[220px] flex-col gap-0.5 overflow-y-auto",children:C.length===0?e.jsx("p",{className:"px-2 py-1.5 text-body-sm text-rb-secondary-dark",children:i}):C.map(S=>{const D=n.includes(S.value);return e.jsxs("button",{type:"button",role:"option","aria-selected":D,className:M(lr.item,"justify-between hover:bg-rb-gray-neutral/60"),onMouseDown:U=>U.preventDefault(),onClick:()=>
1y(S.value),children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:S.label}),D&&e.jsx(I,{name:"Check",size:12,color:"secondary-dark"})]},S.value)})})]})]})},gi=({triggerVariant:t="icon"})=>{var tt,st;const{organisationId:s,memberships:a}=L(),r=Ts(),{logButtonPress:i}=G(),l=zt(),[,n]=Z(),[o,d]=g.useState(!1),[c,m]=g.useState(""),[u,p]=g.useState(""),[f,h]=g.useState([]),[x,b]=g.useState([]),[C,y]=g.useState("date_desc"),[k,S]=g.useState(!1),[D,U]=g.useState(""),[N,A]=g.useState(""),P=g.useRef(!1),B=g.useRef(null),Q=cr(v=>{g.startTransition(()=>p(v))},300),H=()=>{i(ee.OPEN_MEETINGS_SEARCH,{scope:"CALL_RECORDINGS"}),d(!0)},se=v=>{m(v),Q(v),v&&!P.current&&(P.current=!0,i(ee.TYPE_MEETINGS_SEARCH,{scope:"CALL_RECORDINGS"}))},J=(v,Y)=>{i(ee.CLICK_MEETINGS_SEARCH_RESULT,{scope:"CALL_RECORDINGS",result_type:Y,result_id:v,search_query:u})},{data:w,isFetching:te}=li({query:u,selectedPeople:f,selectedDomains:x,sortBy:C,enabled:o}),ne=v=>{d(v),v||(P.current=!1,m(""),p(""),h([]),b([]),S(!1))},Me=D.toLowerCase(),Te=((w==null?void 0:w.attendeeEmails)??[]).filter(v=>v.toLowerCase().includes(Me)).map(v=>({label:v,value:v})),ae=N.toLowerCase(),Et=((w==null?void 0:w.domains)??[]).filter(v=>v.toLowerCase().includes(ae)).map(v=>({label:v,value:v})),qe=f.length>0||x.length>0,et=()=>{h([]),b([]),y("date_desc")},Ne=!!c||qe;return e.jsxs(Gt,{open:o,onOpenChange:ne,children:[e.jsx(Fs,{render:t==="refined"?e.jsxs("button",{type:"button",onClick:H,className:"flex h-8 w-full max-w-[380px] items-center gap-2 rounded-lg border border-rb-darkbtn/10 bg-rb-white pr-2 pl-3 shadow-rb-shadow-soft-xs transition-colors hover:border-rb-gray-hovered focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden",children:[e.jsx(I,{name:"MagnifyingGlass",size:14,color:"secondary-dark",className:"shrink-0"}),e.jsx("span",{className:"flex-1 text-left text-body-sm text-rb-secondary-dark",children:"Search meetings"})]}):t==="inline"?e.jsx(fs,{className:"w-full cursor-pointer",onClick:H,children:e.jsx(bs,{readOnly:!0,placeholder:"Search meetings",className:"cursor-pointer"})}):e.jsx(he,{icon:"MagnifyingGlass",label:"Search meetings",size:"md",onClick:H})}),e.jsxs(Vt,{size:"lg",className:"h-[80vh] gap-0 overflow-hidden p-0",showCloseButton:!0,children:[e.jsx($t,{className:"px-4 py-4",children:e.jsx(Wt,{children:"Find a meeting"})}),e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex w-full flex-col gap-3 px-4 py-4",children:[e.jsxs(fs,{searching:te,className:"w-full",children:[e.jsx(bs,{ref:B,placeholder:"Search meetings",value:c,onChange:v=>se(v.target.value),autoFocus:!0}),c&&e.jsx(mr,{onClick:()=>m("")})]}),e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2",children:[e.jsx(Es,{ariaLabel:"Filter by people",icon:"User",placeholder:"People",searchPlaceholder:"Search people",emptyMessage:"No people found",options:Te,value:f,onSearchChange:U,onChange:v=>{h(v),m(""),p("")},className:"w-auto min-w-0 flex-1"}),e.jsx(Es,{ariaLabel:"Filter by company",icon:"Buildings",placeholder:"Companies",searchPlaceholder:"Search companies",emptyMessage:"No companies found",options:Et,value:x,onSearchChange:A,onChange:v=>{b(v),m(""),p("")},className:"w-auto min-w-0 flex-1"}),e.jsxs(Be,{items:ys,value:C,onValueChange:v=>{v!==null&&y(v==="date_asc"?"date_asc":"date_desc")},children:[e.jsx(ze,{"aria-label":"Sort meetings",children:e.jsx(Ge,{placeholder:"Selectâ¦"})}),e.jsx(Ve,{align:"start",children:ys.map(v=>e.jsx($e,{value:v.value,children:v.label},v.value))})]}),e.jsx(R,{size:"md",disabled:f.length===0&&x.length===0,onClick:et,children:l?"Clear":"Clear filters"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:Ne&&(w==null?void 0:w.results.length)===0&&(((tt=w==null?void 0:w.attendeeEmails)==null?void 0:tt.length)??0)===0&&(((st=w==null?void 0:w.domains)==null?void 0:st.length)??0)===0&&!te?e.jsxs(pe,{size:"lg",children:[e.jsxs(xe,{children:[e.jsx(fe,{children:e.jsx(I,{name:"MagnifyingGlass"})}),e.jsx(be,{children:`No meetings match â${mi(u)}â`}),e.jsx(ve,{children:"Try a different spelling or a person's name, or clear the filters to
1search every recording."})]}),qe&&e.jsx(xt,{children:e.jsx(R,{size:"md",onClick:et,children:"Clear filters"})})]}):e.jsxs("div",{className:"flex flex-col gap-6",children:[(w==null?void 0:w.results)&&w.results.length>0&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h4",{className:"px-1 text-body-sm font-medium text-rb-darkbtn",children:Ne?"Recorded meetings":"Recent meetings"}),e.jsx("div",{className:"flex flex-col gap-0.5",children:(Ne?k?w.results:w.results.slice(0,5):w.results.slice(0,3)).map(v=>e.jsx(yt,{title:v.title,startsAt:v.startsAt?new Date(v.startsAt):void 0,endsAt:v.endsAt?new Date(v.endsAt):void 0,timeFallback:"Date unknown",peopleCount:xn(v.attendeeEmails),status:"recorded",to:`/org/${s}/meeting-assistant/call-recordings/${v.id}`,openInNewTab:!0,onOpen:()=>J(v.id,"meeting"),actions:e.jsx(dn,{callRecordingId:v.id,known:v.access,onManageAccess:()=>{ne(!1),r(`/org/${s}/meeting-assistant/call-recordings/${v.id}?shouldEditAccess=true`)},children:({onClick:Y,isPending:F})=>e.jsx(he,{icon:"Link",label:"Copy share link",variant:"ghost",size:"sm",onClick:Y,disabled:F})})},v.id))}),Ne&&!k&&w.results.length>5&&e.jsx(R,{className:"w-min",size:"md",onClick:()=>S(!0),children:`See all (${w.results.length})`})]}),((w==null?void 0:w.attendeeEmails)??[]).length>0&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h4",{className:"px-1 text-body-sm font-medium text-rb-darkbtn",children:"People"}),e.jsx("div",{className:"flex flex-col gap-0.5",children:w.attendeeEmails.slice(0,3).map(v=>{var de;const Y=a.find(Oe=>Oe.data().userEmail===v),F=Y==null?void 0:Y.data(),De=(F==null?void 0:F.userName)??v,Ct=F==null?void 0:F.userPhotoUrl,{firstName:Le,lastName:Pe}=Xn(De),wt=`${(Le==null?void 0:Le[0])??""}${(Pe==null?void 0:Pe[0])??""}`.toUpperCase()||((de=De[0])==null?void 0:de.toUpperCase())||"";return e.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-[10px] border border-transparent px-3.5 py-3 text-left transition-colors hover:border-rb-darkbtn/6 hover:bg-rb-gray-neutral/30",onClick:()=>{J(v,"person"),ne(!1),n(Oe=>{const E=new URLSearchParams(Oe);return E.set("email",v),E})},children:[e.jsx(Je,{text:wt,imageUrl:Ct,size:"sm"}),e.jsx("span",{className:"text-body-sm font-medium text-rb-darkbtn",children:F!=null&&F.userName?`${De} (${v})`:v})]},v)})})]}),((w==null?void 0:w.domains)??[]).length>0&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h4",{className:"px-1 text-body-sm font-medium text-rb-darkbtn",children:"Companies"}),e.jsx("div",{className:"flex flex-col gap-0.5",children:w.domains.slice(0,3).map(v=>e.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-[10px] border border-transparent px-3.5 py-3 text-left transition-colors hover:border-rb-darkbtn/6 hover:bg-rb-gray-neutral/30",onClick:()=>{J(v,"domain"),ne(!1),n(Y=>{const F=new URLSearchParams(Y);return F.set("domain",v),F})},children:[e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${v}&sz=32`,alt:"",className:"size-5 shrink-0"}),e.jsx("span",{className:"text-body-sm font-medium text-rb-darkbtn",children:v})]},v))})]})]})})]})]})]})},hi="/assets/desktop-app-Dbm9LL5c.webp",pi=({isVisibleSurface:t})=>{const{userMembership:s}=L(),a=s.data().callRecordingDistribution??q.callRecordingDistribution,r=a!==_.HOST_ONLY&&a!==_.NONE,{data:i,isLoading:l}=Ae({pageSize:1,fetchFullRecordings:!1,enabled:t&&r}),n=!l&&((i==null?void 0:i.total)??0)===0;return t&&r&&n},Cs=[{value:"keep-indefinitely",label:"Keep until deleted manually"},{value:"7",label:"7 days"},{value:"14",label:"2 weeks"},{value:"30",label:"1 month"},{value:"60",label:"2 months"},{value:"90",label:"3 months"},{value:"180",label:"6 months"},{value:"365",label:"1 year"},{value:"730",label:"2 years"},{value:"1095",label:"3 years"}],xi=({open:t,onOpenChange:s,pendingRetentionDays:a,onConfirm:r})=>e.jsx(Ar,{open:t,onOpenChange:s,title:"Enable Call Recording Auto-Deletion?",description:`This action will enable automatic deletion of call recordings after ${a} days.`,confirmLabel:"Enable Auto-Deletion",destructive:!0,onConfirm:r,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-body font-medium text-red-600",children:"This is permanent and cannot be reversed."}),e.jsx("p",{className:"text-body text-rb-secondary-dark",children:"Once deleted, call recordings cannot be recovered. All existing recordings will be scheduled for deleti
1on based on their creation date."})]})});function fi(t,s,a){return Tr(Dr({unit:"%",width:90},a,t,s),t,s)}const bi=({aspectRatio:t,currentImageStoragePath:s,uploadPath:a,targetHeight:r,onUploadComplete:i,onDeleteComplete:l})=>{const n=g.useRef(null),o=g.useRef(null),[,d]=g.useState(),[c,m]=g.useState(),[u,p]=g.useState(),[f,h]=g.useState(),[x,b]=g.useState(!1),[C,y]=g.useState(s),k=Re({queryKey:["downloadUrl",C??"undefined"],queryFn:async()=>{if(C)return await ta(St(kt,C))},refetchOnWindowFocus:!1}),S=N=>{const{files:A}=N.target;!A||A.length===0||(d(A[0]),m(URL.createObjectURL(A[0])),b(!0))},D=async()=>{const N=o.current;if(!f||!N)return;const A=N.naturalWidth/N.clientWidth,P=N.naturalHeight/N.clientHeight,B=f.width*A,Q=f.height*P,H=f.x*A,se=f.y*P,J=document.createElement("canvas"),w=r?r/Q:1;J.width=B*w,J.height=Q*w;const te=J.getContext("2d");if(!te)throw new Error("Unable to get 2D context");te.drawImage(N,H,se,B,Q,0,0,B*w,Q*w);const ne=await new Promise((Me,Te)=>{J.toBlob(ae=>ae?Me(ae):Te(new Error("No blob")),"image/jpeg")});await ea(St(kt,a),ne),b(!1),d(void 0),m(void 0),p(void 0),y(a),k.refetch(),await(i==null?void 0:i(a))},U=async()=>{if(C)try{await(l==null?void 0:l(C)),y(void 0),await qn(St(kt,C))}catch(N){Ze(N),gt({action:"delete image",onRetry:()=>void U()})}};return e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"file",ref:n,className:"hidden",accept:"image/*",onChange:S}),C?e.jsxs("div",{style:{aspectRatio:t},className:"relative w-full max-w-96 overflow-hidden rounded-md border border-rb-gray-neutral",children:[e.jsx("img",{src:k.data,className:"h-full w-full object-cover",style:{aspectRatio:t}}),e.jsxs("div",{className:"absolute right-4 bottom-4 left-4 flex gap-2",children:[e.jsx(R,{size:"md",onClick:()=>{var N;return(N=n.current)==null?void 0:N.click()},children:"Replace"}),e.jsx(R,{size:"md",onClick:U,children:"Delete"})]})]}):e.jsxs("button",{onClick:()=>{var N;return(N=n.current)==null?void 0:N.click()},className:"flex w-full max-w-96 flex-col items-center justify-center gap-2 rounded-md border border-dashed border-rb-gray-hovered p-8 transition-colors hover:border-rb-black hover:bg-rb-parchment",style:{aspectRatio:t},type:"button",children:[e.jsx(I,{name:"Plus",size:24,color:"secondary-dark"}),e.jsx("p",{className:"text-body text-rb-secondary-dark",children:"Upload image"})]}),e.jsx(Gt,{open:x,onOpenChange:b,children:e.jsxs(Vt,{children:[e.jsx($t,{children:e.jsx(Wt,{children:"Crop image"})}),e.jsx(Us,{children:e.jsx(Mr,{crop:u,onChange:(N,A)=>p(A),onComplete:N=>h(N),aspect:t,children:e.jsx("img",{src:c,ref:o,onLoad:N=>{const{width:A,height:P}=N.currentTarget;p(fi(A,P,t))}})})}),e.jsxs(Bs,{children:[e.jsx(R,{size:"md",onClick:()=>b(!1),children:"Cancel"}),e.jsx(R,{variant:"brand",size:"md",onClick:D,children:"Crop & Upload"})]})]})})]})},vi=t=>t.split(" ").length<=5,ji=()=>{try{const s=navigator.language.split("-")[0].toLowerCase();return _t.some(r=>r.value===s)?s.toLowerCase():"en"}catch{return"AUTO"}},fn=g.forwardRef(({onMouseEnter:t,onMouseLeave:s,className:a,size:r=28,...i},l)=>{const n=ei(),o=g.useRef(!1);g.useImperativeHandle(l,()=>(o.current=!0,{startAnimation:()=>n.start("animate"),stopAnimation:()=>n.start("normal")})),g.useEffect(()=>{n.set("normal")},[n]);const d=g.useCallback(m=>{o.current||n.start("animate"),t==null||t(m)},[n,t]),c=g.useCallback(m=>{o.current||n.start("normal"),s==null||s(m)},[n,s]);return e.jsx("div",{className:M(a),onMouseEnter:d,onMouseLeave:c,...i,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 10v3"}),e.jsx(W.path,{variants:{normal:{d:"M6 6v11"},animate:{d:["M6 6v11","M6 10v3","M6 6v11"],transition:{duration:1.5,repeat:1/0}}},initial:"normal",d:"M6 6v11",animate:n}),e.jsx(W.path,{variants:{normal:{d:"M10 3v18"},animate:{d:["M10 3v18","M10 9v5","M10 3v18"],transition:{duration:1,repeat:1/0}}},initial:"normal",d:"M10 3v18",animate:n}),e.jsx(W.path,{variants:{normal:{d:"M14 8v7"},animate:{d:["M14 8v7","M14 6v11","M14 8v7"],transition:{duration:.8,repeat:1/0}}},initial:"normal",d:"M14 8v7",animate:n}),e.jsx(W.path,{variants:{normal:{d:"M18 5v13"},animate:{d:["M18 5v13","M18 7v9","M18 5v13"],transition:{duration:1.5,repeat:1/0}}},initial:"normal",d:"M18 5v13",animate:n}),e.jsx("path",{d:"M22 10v3"})]})})});fn.displayName="AudioLinesIcon";function yi(t){const s=Math.floor(t/3600),a=Math.floor(t%3600/60),r=M
1ath.floor(t%60);return s>0?`${s}:${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${a}:${r.toString().padStart(2,"0")}`}const Ni={collapsed:{transition:{type:"spring",stiffness:400,damping:35}},expanded:{transition:{type:"spring",stiffness:400,damping:35}}},Ei=()=>{const[t,s]=g.useState(0),[a,r]=g.useState(!1),i=g.useRef(null),l=a,n=g.useCallback(()=>r(!0),[]),o=g.useCallback(()=>r(!1),[]);return g.useEffect(()=>{if(!l)return;const d=setInterval(()=>{s(c=>c+1)},1e3);return()=>clearInterval(d)},[l]),g.useEffect(()=>{var d;(d=i.current)==null||d.startAnimation()},[]),e.jsx(W.div,{layout:!0,className:M("w-fit transform-gpu rounded-lg"),variants:Ni,initial:"collapsed",animate:l?"expanded":"collapsed",onPointerEnter:n,onPointerLeave:o,children:e.jsxs("div",{className:"group relative",children:[e.jsx("div",{className:"drag-region drag-handle absolute top-1/2 right-0 z-10 translate-x-1/2 -translate-y-1/2 cursor-grab rounded-md rounded-l-sm bg-rb-off-white text-rb-darkbtn active:cursor-grabbing",children:e.jsx("div",{className:"relative h-full w-full rounded-md py-1 after:pointer-events-none after:absolute after:top-0 after:right-0 after:bottom-0 after:box-border after:w-1/2 after:rounded-tr-md after:rounded-br-md after:border-t after:border-r after:border-b after:border-border after:content-['']",children:e.jsx(I,{name:"DotsSixVertical",size:14})})}),e.jsxs("div",{className:"relative flex w-[42px] flex-col items-center overflow-hidden rounded-lg border bg-rb-off-white px-1.5 py-2.5",children:[e.jsx(W.div,{layout:!0,initial:!1,animate:{height:l?"auto":0,opacity:l?1:0},transition:{height:{type:"spring",stiffness:400,damping:35},opacity:{duration:.2}},className:"transform-gpu overflow-hidden pt-1",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(W.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.2},children:e.jsx(R,{variant:"ghost",size:"sm",title:"Open in Fyxer","aria-label":"Open in Fyxer",children:e.jsx("img",{src:"/favicon.png",alt:"",className:"mx-auto w-4 object-contain",draggable:!1})})}),e.jsx(W.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.05},children:e.jsx("span",{className:"font-mono text-[10px] font-normal text-rb-darkbtn tabular-nums",children:yi(t)})}),e.jsx(W.div,{className:"mb-1.5 h-px w-full bg-border",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.1}})]})}),e.jsx(_r,{children:e.jsx(W.div,{layout:!0,transition:{type:"spring",stiffness:400,damping:30},className:"mx-auto mb-1.5 flex w-full items-center justify-center overflow-hidden",children:e.jsx(fn,{ref:i,size:24,className:"flex w-full items-center justify-center text-rb-orange-neutral"})})}),e.jsx(R,{variant:"ghost",size:"sm",title:"Stop recording","aria-label":"Stop recording",children:e.jsx(I,{name:"Square",size:16,filled:!0,className:"text-rb-orange-neutral"})}),e.jsx(W.div,{layout:!0,initial:!1,animate:{height:l?"auto":0,opacity:l?1:0},transition:{height:{type:"spring",stiffness:400,damping:35},opacity:{duration:.2}},children:e.jsx("div",{className:"mt-1.5 flex transform-gpu flex-col items-center gap-1.5",children:e.jsx(W.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.2,delay:.15},children:e.jsx(R,{variant:"ghost",size:"sm",title:"Resume recording","aria-label":"Resume recording",children:e.jsx(I,{name:"Pause",size:16,filled:!0})})})})})]})]})})},Ci="https://www.fyxer.com/notetaker/download",wi=oa({arr:[...[..._t].splice(0,5),...la([..._t],t=>t.label,"asc")],getKey:t=>t.label}),ws=wi.map(t=>({label:t.label,value:t.value})),Ss=[{value:Ue.ALL,label:"All meetings"},{value:Ue.EXTERNAL,label:"External meetings"},{value:Ue.INTERNAL,label:"Internal meetings"}],ks=[{value:_.EVERYONE_ON_INVITE,label:"Everyone on the calendar invite"},{value:_.INTERNAL_ATTENDEES_ONLY,label:"Internal attendees only"},{value:_.HOST_ONLY,label:"Myself only"},{value:_.NONE,label:"No one"}],Is=({callRecordingDistribution:t,shouldSendAttendeesCallRecording:s,shouldShareCallRecordingsWithAttendeesByDefault:a})=>{const r=s??q.shouldSendAttendeesCallRecording;return a?t||(r?_.EVERYONE_ON_INVITE:_.HOST_ONLY):t===_.NONE?_.NONE:_.HOST_ONLY},bn=({className:t,children:s})=>e.jsx("div",{className:M("divide-y divide-rb-darkbtn/6 overflow-hidden rounded-xl border border-rb-darkbtn/10 bg-rb-white shadow-rb-shadow-soft-xs",t),children:s}),Ee=({label:t,hint:s,children:a})=>e.jsxs("section",{className:"flex flex-col gap-2.5",children:[e.jsx(Kt,{label:t}),e.jsx(bn,{children:a}),s]}),V=({stacked:t=!1,className:s,children:a})=>e.jsx("div",{className:M("flex gap-3 px-3.5 py-3",t?"flex-col items-stretch gap-2":"items-center justify-between",s),children:a}),$=({title:t,description:s})=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-body-sm font-medium text-rb-darkbtn",children:t}),s&&e.jsx("div",{className:"mt-0.5 text-label text-rb-secondary-dark",children:s})]}),At=({children:t})=>e.jsx("p",{className:"text-label text-rb-secondary-dark",children:t}),Si=ut({autoJoinMeetingConfiguration:at(z),shouldSendMeetingRecordingFailureEmails:Fe(),callRecordingDistribution:at(_),meetingPreReadEmailConfiguration:at(ct),shouldSendMeetingPreReadEmailForRecurringMeetings:Fe(),turnMeetingPrereadSharingOff:Fe(),meetingTranscriptLanguage:le(),meetingCustomTerminology:ps(le()).max(100).transform(t=>t.filter(s=>s.trim().length>0&&vi(s))),emailsWithAccessToAllRecordings:ps(ut({email:le().min(1,"Enter an email").email("Enter a valid email"),meetingTypeAccess:at(Ue)})).max(100),shouldCreateMeetingFollowUpDrafts:Fe(),hideNotetakerImage:Fe(),retentionDays:Ua().optional()}),ki=()=>{var os,ls,cs,ds,us;const{userMembership:t,organisation:s,organisationId:a,subscription:r}=L(),i=sa("editOrganisationSettings"),{updateMembership:l,updateOrg:n}=Jt(),{isSeatLocked:o}=Ye("meetingRecording"),{resolved:d,isLoading:c,canEdit:m,getLockedBy:u,isVisible:p}=Yt(),[f,h]=g.useState("general"),[x,b]=g.useState(!1),[C,y]=g.useState(),{logFormSubmit:k,logEvent:S}=G(),{desktopAppStatus:{value:D}}=Ds(),U=r==null?void 0:r.data().planType,N=i&&(vr()!==jr.PROD||U&&na(aa.PRO)(U)||ra(s)),A=m("autoJoinMeetingConfiguration"),P=(os=d.autoJoinMeetingConfiguration)==null?void 0:os.value,B=u("autoJoinMeetingConfiguration"),Q=p("autoJoinMeetingConfiguration"),H=m("callRecordingDistribution"),se=(ls=d.callRecordingDistribution)==null?void 0:ls.value,J=u("callRecordingDistribution"),w=p("callRecordingDistribution"),te=m("meetingTranscriptLanguage"),ne=(cs=d.meetingTranscriptLanguage)==null?void 0:cs.value,Me=u("meetingTranscriptLanguage"),Te=p("meetingTranscriptLanguage"),ae=m("shouldSendMeetingRecordingFailureEmails"),Et=(ds=d.shouldSendMeetingRecordingFailureEmails)==null?void 0:ds.value,qe=u("shouldSendMeetingRecordingFailureEmails"),et=p("shouldSendMeetingRecordingFailureEmails"),{autoJoinMeetingConfiguration:Ne,callRecordingDistribution:tt,shouldSe
1ndAttendeesCallRecording:st,shouldSendMeetingRecordingFailureEmails:v,meetingPreReadEmailConfiguration:Y,shouldSendMeetingPreReadEmailForRecurringMeetings:F,turnMeetingPrereadSharingOff:De,meetingTranscriptLanguage:Ct,meetingCustomTerminology:Le,emailsWithAccessToAllRecordings:Pe,shouldCreateMeetingFollowUpDrafts:wt}=t.data(),de=s.shouldShareCallRecordingsWithAttendeesByDefault??yr.shouldShareCallRecordingsWithAttendeesByDefault,Oe=de?ks:ks.filter(j=>j.value===_.HOST_ONLY||j.value===_.NONE),E=Qt({resolver:Xt(Si),defaultValues:{autoJoinMeetingConfiguration:Ne??q.autoJoinMeetingConfiguration,shouldSendMeetingRecordingFailureEmails:v??q.shouldSendMeetingRecordingFailureEmails,callRecordingDistribution:Is({callRecordingDistribution:tt,shouldSendAttendeesCallRecording:st,shouldShareCallRecordingsWithAttendeesByDefault:de}),meetingPreReadEmailConfiguration:Y??q.meetingPreReadEmailConfiguration,shouldSendMeetingPreReadEmailForRecurringMeetings:F??q.shouldSendMeetingPreReadEmailForRecurringMeetings,turnMeetingPrereadSharingOff:De??q.turnMeetingPrereadSharingOff,meetingTranscriptLanguage:Ct??ji(),meetingCustomTerminology:Le??q.meetingCustomTerminology,emailsWithAccessToAllRecordings:Pe??q.emailsWithAccessToAllRecordings,shouldCreateMeetingFollowUpDrafts:wt??q.shouldCreateMeetingFollowUpDrafts,hideNotetakerImage:s.hideNotetakerImage??!1,retentionDays:s.callRecordingRetentionDays}});g.useEffect(()=>{if(c)return;const j=["autoJoinMeetingConfiguration","callRecordingDistribution","meetingTranscriptLanguage","shouldSendMeetingRecordingFailureEmails"],T={};for(const re of j){const X=d[re];X&&(X.source==="org-default"||X.source==="team-default")&&(T[re]=re==="callRecordingDistribution"?Is({callRecordingDistribution:X.value,shouldShareCallRecordingsWithAttendeesByDefault:de}):X.value)}Object.keys(T).length>0&&E.reset({...E.formState.defaultValues,...T},{keepDirtyValues:!0})},[c,d,de,E]);const Nn=j=>{if(j==="keep-indefinitely"){E.setValue("retentionDays",void 0,{shouldDirty:!0});return}const T=parseInt(j);!E.getValues("retentionDays")&&T?(y(T),b(!0)):E.setValue("retentionDays",T,{shouldDirty:!0})},{fields:as,append:En,remove:Cn}=vs({control:E.control,name:"meetingCustomTerminology"}),{fields:rs,append:wn,remove:Sn}=vs({control:E.control,name:"emailsWithAccessToAllRecordings"}),kn=async j=>{const{dirtyFields:T}=E.formState,{hideNotetakerImage:re,retentionDays:X,...O}=j;k(ia.UPDATE_CONFIGURATION,{autoJoinMeetingConfiguration:j.autoJoinMeetingConfiguration,meetingTranscriptLanguage:j.meetingTranscriptLanguage}),T.autoJoinMeetingConfiguration&&S(j.autoJoinMeetingConfiguration===z.NEVER?ie.TURN_OFF_NOTETAKER_AUTO_JOIN_MEETINGS:ie.TURN_ON_NOTETAKER_AUTO_JOIN_MEETINGS),await l({...A&&T.autoJoinMeetingConfiguration?{autoJoinMeetingConfiguration:O.autoJoinMeetingConfiguration}:{},...H&&T.callRecordingDistribution?{callRecordingDistribution:O.callRecordingDistribution}:{},meetingPreReadEmailConfiguration:O.meetingPreReadEmailConfiguration,...te&&T.meetingTranscriptLanguage?{meetingTranscriptLanguage:O.meetingTranscriptLanguage}:{},...ae&&T.shouldSendMeetingRecordingFailureEmails?{shouldSendMeetingRecordingFailureEmails:O.shouldSendMeetingRecordingFailureEmails}:{},shouldSendMeetingPreReadEmailForRecurringMeetings:O.shouldSendMeetingPreReadEmailForRecurringMeetings,turnMeetingPrereadSharingOff:O.turnMeetingPrereadSharingOff,meetingCustomTerminology:O.meetingCustomTerminology,emailsWithAccessToAllRecordings:O.emailsWithAccessToAllRecordings,shouldCreateMeetingFollowUpDrafts:O.shouldCreateMeetingFollowUpDrafts});const _n=T.hideNotetakerImage||T.retentionDays;i&&_n&&await n({hideNotetakerImage:re,callRecordingRetentionDays:X}),E.reset(j),K.success({title:"Notetaker settings saved"})},nt=A?E.watch("autoJoinMeetingConfiguration"):P??E.watch("autoJoinMeetingConfiguration"),is=nt===z.ALWAYS||nt===z.ONLY_EXTERNAL,In=pi({isVisibleSurface:!D&&!is}),Rn=H?E.watch("callRecordingDistribution"):se??E.watch("callRecordingDistribution"),An=te?E.watch("meetingTranscriptLanguage"):ne??E.watch("meetingTranscriptLanguage"),Mn=ae?E.watch("shouldSendMeetingRecordingFailureEmails"):Et??E.watch("shouldSe
1ndMeetingRecordingFailureEmails"),Tn=()=>{switch(nt){case z.ALWAYS:return"Fyxer will join all meetings with a meeting link.";case z.ONLY_MINE:return"Fyxer will only join meetings that you are hosting.";case z.ONLY_EXTERNAL:return"Fyxer will only join meetings with external attendees.";case z.NEVER:default:return"Fyxer will not join any meetings unless you manually tell it to."}},Dn=[{label:"All meetings",value:z.ALWAYS},{label:"External meetings only",value:z.ONLY_EXTERNAL},{label:"Meetings I'm hosting",value:z.ONLY_MINE}],Ln=()=>{S(ie.DESKTOP_APP_SETTING_DOWNLOAD_LINK_CLICKED),window.open(Ci,"_blank","noopener,noreferrer")},Pn={label:"None",value:z.NEVER},On=E.formState.isDirty;return e.jsxs(Nr,{children:[e.jsx(dt,{feature:"meetingRecording",children:e.jsx(Er,{render:e.jsx(he,{icon:"Gear",label:"Notetaker settings",title:"Notetaker settings",size:"md",disabled:o})})}),e.jsxs(Cr,{children:[e.jsxs(wr,{className:"gap-3",children:[e.jsx(Sr,{children:"Notetaker settings"}),e.jsx(vt,{value:f,onValueChange:j=>h(j),children:e.jsxs(jt,{activateOnFocus:!0,"aria-label":"Notetaker settings sections",children:[e.jsx(ce,{value:"general",children:"General"}),e.jsx(ce,{value:"pre-reads",children:"Pre-reads"})]})})]}),e.jsxs(kr,{children:[f==="general"&&e.jsxs("div",{className:"flex flex-col gap-5",children:[!D&&!is&&In?e.jsx(bn,{children:e.jsxs(V,{stacked:!0,children:[e.jsx($,{title:"Get the desktop app"}),e.jsxs("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-3",children:[e.jsx("div",{className:"min-w-[42px]"}),e.jsxs("div",{className:"relative mb-2 flex flex-col items-center justify-center gap-3",children:[e.jsx("img",{src:hi,alt:"Fyxer desktop app",className:"w-20 shrink-0"}),e.jsx("p",{className:"max-w-sm text-center text-body-sm text-rb-darkbtn",children:"Let Fyxer record using your device without Notetaker joining your meetings."}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(R,{size:"md",onClick:Ln,children:[e.jsx(I,{name:"DownloadSimple",color:"current","data-icon":"inline-start"}),"Download the desktop app"]})})]}),e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(Ei,{})})]})]})}):null,Q&&e.jsx(Ee,{label:"Joining",hint:e.jsxs(e.Fragment,{children:[e.jsx(At,{children:Tn()}),B&&e.jsx(At,{children:B})]}),children:e.jsx(Ft,{value:nt,onValueChange:j=>E.setValue("autoJoinMeetingConfiguration",j,{shouldDirty:!0}),className:"gap-0 divide-y divide-rb-darkbtn/6",children:[...Dn,Pn].map(j=>e.jsxs("label",{className:M("flex cursor-pointer items-center gap-2 px-3.5 py-2.5",!A&&"pointer-events-none opacity-50"),children:[e.jsx(mt,{value:j.value,"aria-label":j.label}),e.jsx("span",{className:"text-body-sm text-rb-darkbtn",children:j.label})]},j.value))})}),e.jsxs(Ee,{label:"Transcription",children:[Te&&e.jsxs(V,{className:M(!te&&"pointer-events-none opacity-50"),children:[e.jsx($,{title:"Transcript language",description:Me??void 0}),e.jsxs(Be,{items:ws,value:An,onValueChange:j=>{j!==null&&E.setValue("meetingTranscriptLanguage",j,{shouldDirty:!0})},children:[e.jsx(ze,{"aria-label":"Transcript language",className:"shrink-0",children:e.jsx(Ge,{placeholder:"Selectâ¦"})}),e.jsx(Ve,{align:"start",children:ws.map(j=>e.jsx($e,{value:j.value,children:j.label},j.value))})]})]}),e.jsxs(V,{stacked:!0,children:[e.jsx($,{title:"Custom words",description:"Company names, technical terms, or acronyms that improve accuracy."}),as.map((j,T)=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(we,{...E.register(`meetingCustomTerminology.${T}`),placeholder:"e.g. 'Project x'"}),e.jsx(R,{variant:"ghost",size:"icon-sm","aria-label":"Remove custom word",onClick:()=>Cn(T),children:e.jsx(I,{name:"X",color:"current"})})]},j.id)),as.length<100&&e.jsxs(R,{size:"sm",onClick:()=>En(""),className:"self-start",children:[e.jsx(I,{name:"Plus",color:"current","data-icon":"inline-start"}),"Add custom word"]})]})]}),e.jsxs(Ee,{label:"Sharing",children:[e.jsxs(V,{stacked:!0,children:[e.jsx($,{title:"Automatically share recordings",description:"Emails added below will be auto-invited to your Fyxer meeting recordings."}),rs.map((j,T)=>{var re,X;return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(we,{...E.register(`emailsWithAccessToAllRecordings.${T}.email`),placeholder:"[email protected]","aria-invalid":!!((X=(re=E.formState.errors.emailsWithAccessToAllRecordings)==null?void 0:re[T])!=null&&X.email),className:"flex-1"}),e.jsxs(Be,{items:Ss,value:E.watch(`emailsWithAccessToAllRecordings.${T}.meetingTypeAccess`),onValueChange:O=>{O!==null&&E.setValue(`emailsWithAccessToAllRecordings.${T}.meetingTypeAccess`,O,{shouldDirty:!0})},children:[e.jsx(ze,{"aria-label":"Meeting access",children:e.jsx(Ge,{placeholder:"Selectâ¦"})}),e.jsx(Ve,{align:"start",children:Ss.map(O=>e.jsx($e,{value:O.value,children:O.label},O.value))})]}),e.jsx(R,{variant:"ghost",size:"icon-sm","aria-label":"Remove email",onClick:()=>Sn(T),children:e.jsx(I,{name:"X",color:"current"})})]},j.id)}),rs.length<100&&e.jsxs(R,{size:"sm",onClick:()=>wn({email:"",meetingTypeAccess:Ue.ALL}),className:"self-start",children:[e.jsx(I,{name:"Plus",color:"current","data-icon":"inl
1ine-start"}),"Add email"]})]}),w&&e.jsxs(V,{stacked:!0,children:[e.jsx($,{title:"Send meeting recap to",description:"Choose who automatically receives meeting recordings via email."}),e.jsx(Ft,{value:Rn,onValueChange:j=>E.setValue("callRecordingDistribution",j,{shouldDirty:!0}),className:M("flex flex-col gap-2",!H&&"pointer-events-none opacity-50"),children:Oe.map(j=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[e.jsx(mt,{value:j.value,"aria-label":j.label}),e.jsx("span",{className:"text-body-sm text-rb-darkbtn",children:j.label})]},j.value))}),J&&e.jsx(At,{children:J})]})]}),i&&e.jsxs(Ee,{label:"Notetaker appearance",children:[e.jsxs(V,{children:[e.jsx($,{title:"Hide Notetaker image in meetings",description:"Notetaker will appear without an avatar or profile image."}),e.jsx(_e,{checked:E.watch("hideNotetakerImage"),onCheckedChange:j=>E.setValue("hideNotetakerImage",j,{shouldDirty:!0}),"aria-label":"Hide Notetaker image in meetings"})]}),N&&!E.watch("hideNotetakerImage")&&e.jsxs(V,{stacked:!0,children:[e.jsx($,{title:"Custom Notetaker image",description:"This image shows on Notetaker for all members. Recommended: 16:9 aspect ratio, at least 720px high."}),e.jsx(bi,{aspectRatio:16/9,targetHeight:360*2,currentImageStoragePath:s.customMeetingNotetakerImageStoragePath,uploadPath:`organisations/${a}/meeting-notetaker-image.jpg`,onUploadComplete:j=>n({customMeetingNotetakerImageStoragePath:j,customMeetingNotetakerImageUpdatedAt:Date.now()}),onDeleteComplete:()=>n({customMeetingNotetakerImageStoragePath:void 0,customMeetingNotetakerImageUpdatedAt:Date.now()})})]})]}),e.jsxs(Ee,{label:"After the meeting",children:[e.jsxs(V,{children:[e.jsx($,{title:"Create follow-up email drafts",description:"Automatically create a follow-up email draft after each recorded meeting."}),e.jsx(_e,{checked:E.watch("shouldCreateMeetingFollowUpDrafts"),onCheckedChange:j=>E.setValue("shouldCreateMeetingFollowUpDrafts",j,{shouldDirty:!0}),"aria-label":"Create follow-up email drafts"})]}),et&&e.jsxs(V,{children:[e.jsx($,{title:"Send failure emails",description:qe??"We'll send you an email if we couldn't join the meeting."}),e.jsx(_e,{checked:Mn,onCheckedChange:j=>E.setValue("shouldSendMeetingRecordingFailureEmails",j,{shouldDirty:!0}),disabled:!ae,"aria-label":"Send failure emails"})]}),N&&e.jsxs(V,{children:[e.jsx($,{title:"Auto-delete recordings after",description:'Leave as "Keep until deleted manually" to retain indefinitely.'}),e.jsxs(Be,{items:Cs,value:((us=E.watch("retentionDays"))==null?void 0:us.toString())??"keep-indefinitely",onValueChange:j=>{j!==null&&Nn(j)},children:[e.jsx(ze,{"aria-label":"Auto-delete recordings after",className:"shrink-0",children:e.jsx(Ge,{placeholder:"Selectâ¦"})}),e.jsx(Ve,{align:"start",children:Cs.map(j=>e.jsx($e,{value:j.value,children:j.label},j.value))})]})]})]})]}),f==="pre-reads"&&e.jsx("div",{className:"flex flex-col gap-5",children:e.jsxs(Ee,{label:"Pre-reads",children:[e.jsxs(V,{children:[e.jsx($,{title:"Send pre-read emails",description:"Fyxer will create meeting pre-reads 15 minutes before recurring meetings that have previously been recorded."}),e.jsx(_e,{checked:E.watch("meetingPreReadEmailConfiguration")!==ct.NEVER,onCheckedChange:j=>E.setValue("meetingPreReadEmailConfiguration",j?ct.ALWAYS:ct.NEVER,{shouldDirty:!0}),"aria-label":"Send pre-read emails"})]}),e.jsxs(V,{children:[e.jsx($,{title:"Turn off pre-read sharing",description:"Stops Fyxer from CCing eligible teammates on your pre-read emails."}),e.jsx(_e,{checked:E.watch("turnMeetingPrereadSharingOff"),onCheckedChange:j=>E.setValue("turnMeetingPrereadSharingOff",j,{shouldDirty:!0}),"aria-label":"Turn off pre-read sharing"})]})]})})]}),e.jsxs(Ir,{children:[e.jsx(Rr,{render:e.jsx(R,{size:"md",children:"Cancel"})}),e.jsx(R,{variant:"primary",size:"md",onClick:E.handleSubmit(kn),disabled:!On||E.formState.isSubmitting||c,children:E.formState.isSubmitting?"Saving...":"Update preferences"})]})]}),e.jsx(xi,{open:x,onOpenChange:b,pendingRetentionDays:C,onConfirm:()=>{C&&E.setValue("retentionDays",C,{shouldDirty:!0}),b(!1),y(void 0)}})]})},Ii=()=>{const[t,s]=g.useState([]),[a,r]=g.useState(()=>oe.local.string(We.SELECTED_MICROPHONE_DEVICE_ID).get()||null),[i,l]=g.useState(!0),[n,o]=g.useState(null),d=g.useCallback(async()=>{try{l(!0),o(null),await navigator.mediaDevices.getUserMedia({audio:!0});const p=(await navigator.mediaDevices.enumerateDevices()).filter(f=>f.kind==="audioinput").map(f=>({deviceId:f.deviceId,label:f.label||`Microphone ${f.deviceId.slice(0,8)}`}));s(p),p.length>0&&!a&&r(p[0].deviceId)}catch(u){const p=u instanceof Error?u.message:"Failed to get audio devices";o(p)}finally{l(!1)}},[a]),c=g.useCallback(async()=>{await d()},[d]),m=g.useCallback(u=>{r(u),oe.local.string(We.SELECTED_MICROPHONE_DEVICE_ID).set(u)},[]);return{devices:t,selectedDeviceId:a,setSelectedDeviceId:m,isLoading:i,error:n,refreshDevices:c}},ge={Mic:"mic",Invite:"invite",Upload:"upload"},Rs=[{key:ge.Mic,title:"Start recording now",description:"Fyxer will use your device microphone to record your meeting for up to 2 hours. A summary and transcript will be generated after the recording has finished.",icon:"Microphone"},{key:ge.Invite,title:"Add to video call",description:"Invite Notetaker to your online meeting to re
1cord and generate a summary and transcript.",icon:"Users"},{key:ge.Upload,title:"Upload audio or video",description:"Upload a pre-recorded meeting file (video or audio) to generate a summary and transcript.",icon:"File"}],As=le().url("Please enter a valid URL").refine(ar,{message:"Please enter a valid Zoom, Google Meet, or Microsoft Teams URL"}),it=["https://zoom.us/j/...","https://meet.google.com/...","https://teams.microsoft.com/.."],Ri=ut({title:le().optional(),calendarEventId:le().optional()}),Ai=ut({title:le().optional(),calendarEventId:le().optional(),file:za(File,{message:"Please select a file to import."}).refine(t=>t.size<=1073741824,{message:"File size must be less than 1GB."}).refine(t=>["video/","audio/"].some(a=>t.type.startsWith(a)),{message:"Please select a valid video or audio file."})}),ue=ge,Mi=({children:t,open:s,onOpenChange:a,tab:r=ue.Mic,hideTabs:i=!1})=>{const[l,n]=g.useState(r),o=i?r:l,{calendarEvents:d}=qt(),c=g.useMemo(()=>d.filter(h=>{const x=h.data();return Ba(x.startsAt)}),[d]),m=g.useMemo(()=>c.find(h=>{const x=h.data(),b=new Date;return x.startsAt<=b&&b<=x.endsAt}),[c]),u=Rs.find(h=>h.key===o)??Rs[0],{title:p,description:f}=u;return e.jsxs(Gt,{open:s,onOpenChange:a,children:[t?e.jsx(Fs,{render:t}):null,e.jsxs(Vt,{children:[e.jsx($t,{children:e.jsxs(Wt,{className:"flex items-center gap-2",children:[p,e.jsx(ca,{variant:"brand",children:"Beta"})]})}),e.jsxs(Us,{className:"flex flex-col gap-4",children:[i?null:e.jsx(vt,{value:o,onValueChange:h=>n(h),children:e.jsxs(jt,{activateOnFocus:!0,"aria-label":"Recording method",children:[e.jsx(ce,{value:ue.Mic,children:"Record via mic"}),e.jsx(ce,{value:ue.Invite,children:"Invite to meeting"}),e.jsx(ce,{value:ue.Upload,children:"Upload recording"})]})}),e.jsx(da,{children:f}),o===ue.Mic&&e.jsx(Oi,{todaysEvents:c,currentMeetingId:m==null?void 0:m.id,onDone:()=>a==null?void 0:a(!1)}),o===ue.Invite&&e.jsx(Li,{onDone:()=>a==null?void 0:a(!1)}),o===ue.Upload&&e.jsx(Pi,{todaysEvents:c,currentMeetingId:m==null?void 0:m.id,onDone:()=>a==null?void 0:a(!1)})]})]})]})},Mt="new-meeting",vn=({value:t,onValueChange:s,todaysEvents:a,timeZone:r})=>{const l=[{id:Mt,title:"New meeting"},...a.map(n=>{const o=n.data();return{id:n.id,title:o.title||"Untitled Meeting",timeLabel:qa({startsAt:o.startsAt,endsAt:o.endsAt})}})].map(n=>({value:n.id,label:n.timeLabel?`${n.title} · ${n.timeLabel}`:n.title}));return e.jsxs(Se,{children:[e.jsx(ke,{children:"Link to event (optional)"}),e.jsxs(Be,{items:l,value:t||Mt,onValueChange:n=>{n!==null&&s(n===Mt?"":n)},children:[e.jsx(ze,{"aria-label":"Link to event",className:"w-full",children:e.jsx(Ge,{placeholder:"Selectâ¦"})}),e.jsx(Ve,{align:"start",children:l.map(n=>e.jsx($e,{value:n.value,children:n.label},n.value))})]})]})},Ti=t=>new Promise(s=>{try{const a=URL.createObjectURL(t),r=t.type.startsWith("video/")?document.createElement("video"):document.createElement("audio");r.onloadedmetadata=()=>{URL.revokeObjectURL(a),s(r.duration*1e3)},r.onerror=()=>{URL.revokeObjectURL(a),s(0)},r.src=a}catch{s(0)}}),Di=()=>{const{organisationId:t}=L(),{redirectToAuthUrl:s,isRedirecting:a}=Fr(),{logButtonPress:r}=G(),i=async()=>{try{await s(t)}catch(n){Ze(n,{tags:{product:"notetaker",component:"StartRecordingModal.InviteBot",action:"connect_zoom"}}),He({action:"connect Zoom",error:n,onRetry:i})}},l=()=>{const n={integration:"ZOOM",serviceType:"CALENDAR",entryPoint:"invite_to_meeting"};return r(ee.SELECT_INTEGRATION,n),r(ee.CONFIRM_INTEGRATION,n),i()};return e.jsxs(ht,{variant:"muted",role:"status",children:[e.jsx(pt,{children:"Notetaker can skip the waiting room on Zoom meetings you host. Connect Zoom to turn this on."}),e.jsx("div",{className:"mt-2",children:e.jsx(dt,{feature:"meetingRecording",children:e.jsx(R,{size:"sm",disabled:a,onClick:l,children:a?"Connecting...":"Connect Zoom"})})})]})},Li=({onDone:t})=>{const[s,a]=g.useState(""),[r,i]=g.useState(it[0]),l=ye(),{recallZoomConnections:n,areRecallZoomConnectionsLoading:o}=L(),{memberships:d}=ua(),{logEvent:c}=G(),{userId:m}=je(),u=bt({mutationFn:async h=>(c(ie.ADHOC_MEETING_CREATED,{meetingUrl:h,userId:m}),l.adhocMeetings.create({meetingUrl:h,membershipId:d[0].id})),onSuccess:h=>{h.outcome==="ALREADY_SCHEDULED"?K.info({title:"Already scheduled",description:"Notetaker is already set to join this meeting."}):K.info({title:"Notetaker is joining the meeting"}),t(),a("")},onError:(h,x)=>{Ze(h,{tags:{product:"notetaker",component:"StartRecordingModal.InviteBot",action:"invite_bot"}}),He({action:"start recording",error:h,onRetry:()=>u.mutate(x)})}});g.useEffect(()=>{const h=setTimeout(()=>{const b=(it.indexOf(r)+1)%it.length;i(it[b])},3e3);return()=>clearTimeout(h)},[r]);const p=()=>{const h=As.safeParse(s);if(!h.success){const x=h.error.issues[0],b=(x==null?void 0:x.message)??"Enter a valid meeting URL.";
1Ce({action:"start recording",fix:b});return}u.mutate(s)},f=!o&&n.length===0&&As.safeParse(s).success&&nr(s)!==void 0;return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs(Se,{children:[e.jsx(ke,{htmlFor:"meeting-url",children:"Meeting URL"}),e.jsx(we,{id:"meeting-url",value:s,onChange:h=>a(h.target.value),placeholder:r})]}),f&&e.jsx(Di,{}),e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{variant:"brand",size:"md",onClick:p,disabled:u.isPending,children:u.isPending?"Starting...":"Start recording"})})]})},Pi=({todaysEvents:t,currentMeetingId:s,onDone:a})=>{const{organisationId:r,timeZone:i}=L(),l=ye(),{uploadFile:n,uploadProgress:o}=pr(),d=zs(),{logEvent:c}=G(),m=sn(),u=Qt({resolver:Xt(Ai),defaultValues:{calendarEventId:s||"",title:"",file:void 0}}),p=bt({mutationFn:async y=>{c(ie.IMPORT_MEETING_FILE,{fileName:y.file.name,fileSize:y.file.size,title:y.title,calendarEventId:y.calendarEventId});const k=await Ti(y.file),{storagePath:S,callRecordingId:D}=await l.importMeeting.create({title:y.title,calendarEventId:y.calendarEventId,filename:y.file.name,durationMs:k,organisationId:r});await n(y.file,S),m(),d({path:`/org/${r}/meeting-assistant/call-recordings/${D}`,hash:"tab=transcript"})},onSuccess:()=>{K.success({title:"Meeting file imported"}),a(),u.reset()},onError:(y,k)=>{Ze(y,{tags:{product:"notetaker",component:"StartRecordingModal.Upload",action:"upload_recording"}}),He({action:"import meeting file",error:y,onRetry:()=>p.mutate(k)})}}),f=y=>p.mutate(y),h=y=>{if(y===0)return"0 Bytes";
1const k=1024,S=["Bytes","KB","MB","GB"],D=Math.floor(Math.log(y)/Math.log(k));return parseFloat((y/Math.pow(k,D)).toFixed(2))+" "+S[D]},b=u.watch("calendarEventId")==="",C=u.watch("file");return e.jsxs("form",{onSubmit:u.handleSubmit(f),className:"flex flex-col gap-4",children:[e.jsx(vn,{value:u.watch("calendarEventId"),onValueChange:y=>u.setValue("calendarEventId",y),todaysEvents:t,timeZone:i}),b&&e.jsxs(Se,{children:[e.jsx(ke,{htmlFor:"import-title",children:"Meeting title (optional)"}),e.jsx(we,{id:"import-title",placeholder:"Enter meeting title...",value:u.watch("title")||"",onChange:y=>u.setValue("title",y.target.value)})]}),e.jsxs(Se,{"data-invalid":!!u.formState.errors.file,children:[e.jsx(ke,{htmlFor:"import-file",children:"Meeting file"}),e.jsx("input",{id:"import-file",type:"file",accept:"video/*,audio/*",onChange:y=>{var k;return u.setValue("file",(k=y.target.files)==null?void 0:k[0])},className:"w-full cursor-pointer rounded-lg border border-rb-gray-neutral bg-rb-white px-3 py-2 text-body-sm text-rb-darkbtn shadow-rb-shadow-soft-xs outline-hidden transition-[border-color] file:mr-3 file:rounded-md file:border-0 file:bg-rb-gray-neutral file:px-3 file:py-1 file:text-body-sm file:font-medium hover:border-rb-gray-hovered focus-visible:border-rb-darkbtn"}),e.jsx(ma,{children:"Supported formats: Video and audio files up to 1GB"}),C&&e.jsxs("span",{className:"text-body-sm text-rb-orange-dark",children:["Selected: ",C.name," (",h(C.size),")"]}),e.jsx(ga,{errors:[u.formState.errors.file]})]}),p.isPending&&o&&e.jsxs("div",{className:"flex flex-col gap-2 text-body-sm text-rb-secondary-dark",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Upload progress"}),e.jsxs("span",{children:[o.percentage,"%"]})]}),e.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-rb-gray-neutral",children:e.jsx("div",{className:"h-full bg-rb-orange-neutral transition-all",style:{width:`${o.percentage}%`}})}),e.jsx("span",{children:"Uploading file to storage..."})]}),e.jsx(Bs,{children:e.jsx(R,{variant:"brand",size:"md",type:"submit",disabled:p.isPending,children:p.isPending?"Importing...":"Import meeting"})})]})},Oi=({todaysEvents:t,currentMeetingId:s,onDone:a})=>{const r=ye(),{organisationId:i,timeZone:l}=L(),{logEvent:n}=G(),{userId:o}=je(),d=zs(),{devices:c,selectedDeviceId:m,setSelectedDeviceId:u,refreshDevices:p,error:f}=Ii(),h=sn(),x=Qt({resolver:Xt(Ri),defaultValues:{calendarEventId:s||"",title:""}});g.useEffect(()=>{p()},[p]);const b=bt({mutationFn:async N=>{m&&oe.local.string(We.SELECTED_MICROPHONE_DEVICE_ID).set(m);const A=await r.inPersonMeeting.create({organisationId:i,title:N.title,calendarEventId:N.calendarEventId});return A.state==="NEW"&&n(ie.IN_PERSON_MEETING_CREATED,{callRecordingId:A.callRecordingId,hasCalendarEvent:N.calendarEventId!=="",userId:o}),A},onSuccess:N=>{const{callRecordingId:A,state:P}=N;P==="EXISTING"?Ce({action:"start recording",fix:"This meeting already has a recording. Delete it first, or choose âNew meetingâ in the event list."}):(K.success({title:"Recording started",description:"Keep this tab open, and donât refresh it, until the recording ends."}),h(),d({path:`/org/${i}/meeting-assistant/call-recordings/${A}`,hash:"tab=notes"}),a())},onError:(N,A)=>{Ze(N,{tags:{product:"notetaker",component:"StartRecordingModal.RecordViaMic",action:"start_mic_recording"}}),console.error("Failed to start recording:",N),He({action:"start recording",error:N,onRetry:()=>b.mutate(A)})}}),C=async N=>{b.mutate(N)},k=x.watch("calendarEventId")==="",[S,D]=g.useState(!1),U=c.find(N=>N.deviceId===m);return e.jsxs("form",{onSubmit:x.handleSubmit(C),className:"flex flex-col gap-4",children:[e.jsx(vn,{value:x.watch("calendarEventId"),onValueChange:N=>x.setValue("calendarEventId",N),todaysEvents:t,timeZone:l}),k&&e.jsxs(Se,{children:[e.jsx(ke,{htmlFor:"recording-title",children:"Meeting title (optional)"}),e.jsx(we,{id:"recording-title",value:x.watch("title")||"",onChange:N=>x.setValue("title",N.target.value),placeholder:"Enter meeting title..."})]}),e.jsxs(Se,{children:[e.jsx(ke,{children:"Microphone"}),e.jsxs(Gs,{modal:!1,open:S,onOpenChange:D,children:[e.jsx(Vs,{disabled:b.isPending||c.length===0,render:e.jsx(Ht,{icon:"Microphone",stretch:!0,active:S,isTrailingIconRotated:S,label:(U==null?void 0:U.label)||"Default microphone","aria-label":"Microphone"})}),e.jsx($s,{className:"w-(--anchor-width)",children:c.map(N=>e.jsx(Ws,{className:"cursor-pointer",onClick:()=>u(N.deviceId),children:e.jsx("span",{className:"min-w-0 flex-1 truncate",children:N.label})},N.deviceId))})]})]}),f&&e.jsxs(ht,{variant:"warning",children:[e.jsx(Bt,{children:"Microphone access required"}),e.jsx(pt,{children:"Please allow microphone access in your browser settings to record."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{variant:"brand",size:"md",type:"submit",disabled:b.isPending||!!f||c.length===0,children:b.isPending?"Starting...":"Start recording"})})]})},Tt=[{tab:ge.Invite,icon:"Users",label:"Invite to meeting",rowLabel:"Invite Fyxer to a meeting",description:"Paste a Zoom, Meet or Teams link and it joins"},{tab:ge.Mic,icon:"Microphone",label:"Start recording now",rowLabel:"Record what's in the room",description:"Use your mic for in-person conversations"},{tab:ge.Upload,icon:"File",label:"Upload recording",rowLabel:"Upload a past recording",description:"Get notes for a call you already had"}],jn=({align:t="start",layout:s="dropdown"})=>{const{isSeatLocked:a}=Ye("meetingRecording"),[r,i]=g.useState(),l=s==="rows"?e.jsx("div",{className:"flex w-full max-w-[420px] flex-col gap-2",children:Tt.map(({tab:n,icon:o,rowLabel:d,description:c})=>e.jsx(dt,{feature:"meetingRecording",children:e.jsxs("button",{type:"button",onClick:()=>i(n),disabled:a,className:M("flex w-full items-center gap-3 rounded-xl border border-rb-gray-neutral bg-rb-white px-3.5 py-3 text-left shadow-rb-shadow-soft-xs transition-colors duration-150 hover:border-rb-gray-hovered focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden motion-reduce:transition-none","disabled:cursor-not-allowed disabled:hover:border-rb-gray-neutral"),children:[e.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-rb-gray-neutral bg-rb-white",children:e.jsx(I,{name:o,size:16,color:a?"disabled":"secondary-dark"})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:M("block text-body-sm font-medium",a?"text-rb-disabled":"text-rb-darkbtn"),children:d}),e.jsx("span",{className:M("mt-px block text-body-sm",a?"text-rb-disabled":"text-rb-secondary-dark"),children:c})]}),e.jsx(I,{name:"CaretRight",size:16,color:"disabled"})]})}
1,n))}):e.jsxs(Gs,{modal:!1,children:[e.jsx(dt,{feature:"meetingRecording",children:e.jsx(Vs,{render:e.jsxs(R,{variant:"brand",size:"md",disabled:a,children:["Record meeting",e.jsx(I,{name:"CaretDown",color:"current","data-icon":"inline-end"})]})})}),e.jsx($s,{align:t,className:"w-[220px]",children:Tt.map(({tab:n,icon:o,label:d})=>e.jsxs(Ws,{className:"cursor-pointer",onClick:()=>i(n),children:[e.jsx(I,{name:o,size:14,color:"secondary-dark"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:d})]},n))})]});return e.jsxs(e.Fragment,{children:[l,Tt.map(({tab:n})=>e.jsx(Mi,{open:r===n,onOpenChange:o=>i(o?n:void 0),tab:n,hideTabs:!0},n))]})},_i=7,Fi=t=>t.length>40?`${t.slice(0,39).trimEnd()}â¦`:t,Ui=({className:t})=>{var u,p;const{user:s,emailSignUp:a}=ha(),[r,i]=g.useState(()=>oe.local.string(We.PENDING_CALL_RECORDING_ID).get()),l=(u=a.value)==null?void 0:u.data().createdAt,n=l?Ga(new Date,l)<=_i:!1,o=((p=s.value)==null?void 0:p.signupSource)===pa.MEETING_ASSISTANT&&n,{data:d}=Re({queryKey:["resumeRecordingTitle",r],enabled:!!(o&&r),staleTime:1/0,queryFn:async()=>{var f,h;if(r)try{return((h=(f=(await Os(Ls(Ps.CallRecording,r))).data())==null?void 0:f.calendarEvent)==null?void 0:h.title)??void 0}catch{return}}});if(!o||!r)return null;const c=()=>{oe.local.string(We.PENDING_CALL_RECORDING_ID).remove(),i(void 0)},m=d?`Go back to ${Fi(d)}`:"Go back to your meeting notes";return e.jsxs(ht,{className:M("mb-4",t),children:[e.jsx(Bt,{children:"Pick up where you left off"}),e.jsx(pt,{children:"Continue viewing the meeting notes you arrived on."}),e.jsx("div",{className:"mt-2",children:e.jsx(Fn,{to:`/call-recordings/${r}`,target:"_blank",rel:"noopener noreferrer",onClick:c,children:e.jsxs(R,{variant:"brand",size:"sm",children:[m,e.jsx(I,{name:"ArrowRight",color:"current","data-icon":"inline-end"})]})})}),e.jsx(xa,{children:e.jsx(he,{variant:"ghost",size:"sm",icon:"X",label:"Dismiss",onClick:c})})]})};function ss(t){const s=ye();return Re({queryKey:["company-metadata",t],enabled:!!t,staleTime:1/0,queryFn:async()=>t?s.enrichment.company(t):null})}const Nt=()=>{const{memberships:t}=L();return g.useMemo(()=>{const s=new Map;for(const a of t){const r=a.data();s.set(r.userEmail,{userName:r.userName??void 0,userPhotoUrl:r.userPhotoUrl??void 0})}return s},[t])};function ns(t){const s=ye();return Re({queryKey:["person-metadata",t],enabled:!!t,staleTime:1/0,queryFn:async()=>t?s.enrichment.person(t):null})}function Bi(){const[t]=Z(),s=t.get("email"),a=t.get("domain"),r=Nt(),{data:i}=ns(s??void 0),{data:l}=ss(a??void 0);return g.useMemo(()=>{var n,o;if(s){const d=r.get(s),c=(d==null?void 0:d.userName)??((n=i==null?void 0:i.enrichedIndividualData)==null?void 0:n.name)??s;return Ya(c)}if(a){const d=((o=l==null?void 0:l.enrichedOrganisationData)==null?void 0:o.name)??a;return Ka(d)}return Za},[s,a,r,i,l])}const zi=({suggestions:t,className:s})=>{const{currentThreadId:a}=un();return e.jsx(Hs,{className:M("gap-0 overflow-hidden py-0 sm:gap-0 sm:py-0",s),children:e.jsx(Js,{className:"flex min-h-0 flex-1 flex-col gap-0 px-0 sm:px-0",children:e.jsx(fa,{threadId:a,children:e.jsx(Gi,{suggestions:t})})})})},Gi=({suggestions:t})=>{const{currentThreadId:s}=un(),{userId:a}=je(),{authUser:r}=ba(),{organisationId:i,timeZone:l}=L(),n=Ur(),o=Br(),{messages:d}=va(),{isPending:c}=ja(),{cancel:m}=ya(),{chatThreadId:u,send:p,sendPrompt:f,startNewChat:h}=xr({surface:"global_meeting",threadType:hs.GLOBAL_MEETING,enabledInboxIds:n.map(b=>b.connectionId),enabledCalendarIds:o.map(b=>b.connectionId),hasEmailConnection:n.length>0,hasCalendarConnection:o.length>0}),x=g.useCallback(async b=>Promise.all(b.map(C=>dr({organisationId:i,userId:a,userEmail:r.email??"",file:C,chatThreadId:u}))),[r.email,i,u,a]);return e.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden",children:[e.jsx(fr,{chatSource:"global_meeting",onNewChat:h,className:"absolute top-3 right-3 z-10"}),d.length===0?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center overflow-hidden px-4",children:e.jsx(br,{suggestions:t,threadType:hs.GLOBAL_MEETING,onSendSuggestion:f})}):e.jsx(Qa,{className:"text-body-sm"}),e.jsx("div",{className:"shrink-0",children:e.jsx(ur,{organisationId:i,timeZone:l,currentChatThreadI
1d:s??void 0,onSend:p,onFilesAdded:x,placeholder:xs[0],mobilePlaceholder:xs[0],sendDisabled:c,isStreaming:c,onStop:()=>void m(),animateEntrance:!1,containerClassName:"relative bottom-auto left-auto right-auto mx-auto w-full rounded-none border-x-0 border-b-0 border-t border-rb-darkbtn/6 shadow-none focus-within:border-rb-darkbtn/6 sm:static"})})]})},Vi=({question:t,value:s,onChange:a})=>{const r=t.ratingLeast||t.ratingMost;return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-title-sm leading-tight font-medium",children:t.title}),t.description&&e.jsx("p",{className:"text-body text-rb-secondary-dark",children:t.description})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex w-full gap-2",children:[1,2,3,4,5].map(i=>e.jsx("button",{type:"button",onClick:()=>a(i),className:M("flex h-10 flex-1 items-center justify-center rounded-sm border text-body font-medium transition-all",s===i?"border-rb-orange-neutral bg-rb-orange-neutral text-white":"border-rb-gray-neutral bg-white text-rb-black hover:border-rb-gray-hovered hover:bg-rb-parchment"),children:i},i))}),r&&e.jsxs("div",{className:"flex justify-between px-1",children:[e.jsx("label",{className:"text-label text-rb-secondary-dark",children:t.ratingLeast}),e.jsx("label",{className:"text-label text-rb-secondary-dark",children:t.ratingMost})]})]})]})},$i=({question:t,value:s,onChange:a})=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-title-sm font-medium",children:t.title}),t.description&&e.jsx("p",{className:"text-body text-rb-secondary-dark",children:t.description})]}),e.jsx(zr,{value:s,onChange:r=>a(r.target.value),placeholder:"Type your answer here...",rows:4})]}),Wi=({onClose:t})=>(g.useEffect(()=>{const s=setTimeout(()=>{t()},3e3);return()=>clearTimeout(s)},[t]),e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 py-8 text-center",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-rb-orange-neutral",children:e.jsx("svg",{className:"h-6 w-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h3",{className:"text-title-sm font-medium",children:"Thank you!"}),e.jsx("p",{className:"text-body text-rb-secondary-dark",children:"Your feedback helps us improve Fyxer."})]})]})),Hi=({id:t,questions:s,onClose:a,onComplete:r})=>{const{logEvent:i}=G(),{organisationId:l}=Na(),[n,o]=g.useState(0),[d,c]=g.useState(()=>Array(s.length).fill(null)),[m,u]=g.useState(!1),p=g.useCallback(y=>{c(k=>{const S=[...k];return S[n]=y,S})},[n]),f=g.useCallback(()=>{const y=s[n],k=d[n];k!==null&&i(ie.SURVEY_RESPONSE_SENT,{survey_id:t,question_title:y.title,answer:k,organisation_id:l}),n<s.length-1?o(n+1):u(!0)},[d,n,t,i,l,s]),h=g.useCallback(()=>{r==null||r(),a()},[a,r]),x=s[n],b=d[n],C=b!==null&&(typeof b!="string"||b.trim().length>0);return m?e.jsx(Wi,{onClose:h}):e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"text-label text-rb-secondary-dark",children:["Question ",n+1," of ",s.length]}),e.jsx("button",{type:"button",onClick:h,className:"rounded-sm p-1 text-rb-secondary-dark transition-colors hover:bg-rb-parchment hover:text-rb-black","aria-label":"Close feedback widget",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),x.type==="rating"?e.jsx(Vi,{question:x,value:b,onChange:p}):e.jsx($i,{question:x,value:b||"",onChange:p}),e.jsx("div",{className:"flex justify-end",children:e.jsx(Ea,{label:C?void 0:"Please provide an answer",children:e.jsx("span",{className:"inline-flex",tabIndex:C?void 0:0,children:e.jsx(R,{variant:"brand",size:"md",onClick:f,disabled:!C,children:n<s.length-1?"Next":"Send Feedback"})})})})]})},Ji=({id:t,questions:s,isOpen:a,onClose:r,onComplete:i})=>{const[l,n]=g.useState(!1);if(g.useEffect(()=>{if(a){n(!0);return}const d=setTimeout(()=>n(!1),300);return()=>clearTimeout(d)},[a]),!a&&!l)return null;const o=e.jsx("div",{className:M("fixed bottom-4 left-4 z-50 hidden md:block","w-[400px] max-w-[calc(100vw-2rem)]","rounded-lg border border-rb-gray-neutral bg-rb-white shadow-rb-shadow","p-6","transition-all duration-500 ease-out",a?"translate-y-0 opacity-100":"translate-y-8 opacity-0"),children:e.jsx(Hi,{id:t,questions:s,onClose:r,onComplete:i})});return Un.createPortal(o,document.body)},Yi=t=>
1{const{id:s,questions:a,defaultTriggerOnMount:r,skipIfCompleted:i=!0}=t,[l,n]=g.useState(!1),o=zt(768),c=oe.local.array(It.COMPLETED_SURVEYS).get().includes(s),m=g.useCallback(()=>{i&&c||n(!0)},[i,c]),u=g.useCallback(()=>{n(!1)},[]),p=g.useCallback(()=>{n(h=>!h)},[]),f=g.useCallback(()=>{const h=oe.local.array(It.COMPLETED_SURVEYS).get();h.includes(s)||oe.local.array(It.COMPLETED_SURVEYS).set([...h,s])},[s]);return g.useEffect(()=>{r&&!o&&!(i&&c)&&m()},[r,o,i,c,m]),{id:s,questions:a,isOpen:l,open:m,close:u,toggle:p,markCompleted:f,hasCompleted:c}},Ki=mn().ALGOLIA_APP_ID;function Zi(){const{organisationId:t,allVerifiableEmailAddresses:s}=L(),{user:a}=je(),r=a==null?void 0:a.email,i=ye();return Re({queryKey:["company-domains",t,r],enabled:!!(t&&r),staleTime:1/0,placeholderData:Zs,queryFn:async()=>{var h;if(!r)return[];const l=await nn(t,()=>i.organisations.id(t).algolia.keys.create()),n=an(Ki,l),o=s.length>0?s:[r],d=rn({organisationId:t,viewerEmails:o}),m=(await n.searchForHits({requests:[{indexName:Ys.CALL_RECORDING,query:"",hitsPerPage:1e3,filters:d.join(" AND "),facets:["domains"],maxValuesPerFacet:1e3}]})).results[0],u=((h=m.facets)==null?void 0:h.domains)??{},p=on(m.hits,x=>x.domains??[]),f=Object.entries(u).filter(([x])=>!rr({domain:x,nonHumanDomains:Zt})).map(([x,b])=>({domain:x,count:b,lastInteractedAt:p.get(x)}));return f.sort(ln),f}})}const yn=({name:t,domain:s,size:a="sm"})=>{const r=(t??s).charAt(0).toUpperCase(),i=s.replace(/[^a-zA-Z0-9.-]/g,"");return e.jsx(Je,{text:r,imageUrl:`https://www.google.com/s2/favicons?domain=${i}&sz=32`,variant:"logo",size:a==="sm"?"md":"lg"})},Qi=({domain:t,recordingCount:s,lastInteractedAt:a,onNavigate:r})=>{var d;const{data:i}=ss(t),{logButtonPress:l}=G(),n=((d=i==null?void 0:i.enrichedOrganisationData)==null?void 0:d.name)??t,o=a?hn({date:a}):null;return e.jsxs("button",{type:"button",onClick:()=>{l(ee.CLICK_COMPANY_LIST_ITEM,{domain:t}),r(t)},className:"group flex w-full items-center justify-between gap-2 rounded-[10px] border border-transparent px-3.5 py-3 text-left transition-colors hover:border-rb-darkbtn/6 hover:bg-rb-gray-neutral/30 focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden focus-visible:ring-inset",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(yn,{name:n,domain:t}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"line-clamp-1 text-body-sm font-medium text-rb-darkbtn",children:n}),o&&e.jsxs("span",{className:"truncate text-body-sm text-rb-secondary-dark",children:["Last interacted ",o]})]})]}),e.jsxs("span",{className:"shrink-0 text-body-sm text-rb-secondary-dark",children:[s," ",s===1?"interaction":"interactions"]})]})},Xe="min-h-[420px]",ot=20,Xi=()=>{const[,t]=Z(),[s,a]=g.useState(1),{data:r,isLoading:i}=Zi(),l=g.useCallback(c=>{t(m=>{const u=new URLSearchParams(m);return u.set("domain",c),u})},[t]),n=(r==null?void 0:r.length)??0,o=Math.ceil(n/ot),d=g.useMemo(()=>{if(!r)return[];const c=(s-1)*ot;return r.slice(c,c+ot)},[r,s]);return i&&(r??[]).length===0?e.jsx(Ie,{rows:4}):n===0?e.jsx(pe,{size:"lg",className:M(Xe,"flex-1"),children:e.jsxs(xe,{children:[e.jsx(fe,{children:e.jsx(I,{name:"Buildings"})}),e.jsx(be,{children:"No companies yet"}),e.jsx(ve,{children:"After a meeting, Fyxer groups it under the company everyone came from, so you can pick up an account where you left it."})]})}):e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsx("div",{className:"flex flex-col gap-0.5",children:d.map(({domain:c,count:m,lastInteractedAt:u})=>e.jsx(Qi,{domain:c,recordingCount:m,lastInteractedAt:u,onNavigate:l},c))}),e.jsx(Qe,{currentPage:s,totalPages:o,totalItems:n,itemsPerPage:ot,onPageChange:a})]})},Dt=20,qi=({emails:t,membershipsByEmail:s})=>{const[a,r]=g.useState(!1),[,i]=Z(),l=async(o,d)=>{d.stopPropagation(),await $r({text:o,copied:{title:"Email address copied"}})},n=o=>{r(!1),i(d=>{const c=new URLSearchParams(d);return c.delete("domain"),c.set("email",o),c},{replace:!0})};return e.jsx("div",{className:"shrink-0",children:e.jsxs(qs,{open:a,onOpenChange:r,children:[e.jsx(en,{render:e.jsx(Ht,{active:a,isTrailingIconRotated:a,label:`${t.length} ${t.length===1?"person":"people"}`,"aria-label":"People at this company"})}),e.jsxs(tn,{align:"start",className:"max-w-[400px] overflow-hidden p-0",children:[e.jsx("div",{className:"border-b border-rb-gray-neutral px-4 py-3",children:e.jsx("span",{className:"text-body-sm font-medium text-rb-darkbtn",children:"People at this company"})}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:t.map(o=>{var u;const d=s.get(o),c=(d==null?void 0:d.userName)??o,m=((u=c[0])==null?void 0:u.toUpperCase())??"";return e.jsxs("button",{type:"button",onClick:()=>n(o),className:"flex w-full items-center justify-between gap-3 px-4 py-2 text-left hover:bg-rb-gray-neutral/50 focus-visible:bg-rb-gray-neutral/50 focus-visible:outline-hidden",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(Je,{text:m,imageUrl:d==null?void 0:d.userPhotoUrl,size:"md","aria-label":c}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"truncate text-body-sm font-medium text-rb-darkbtn",children:c}),(d==null?void 0:d.userName)&&e.jsx("span",{className:"truncate text-body-sm text-rb-secondary-dark",children:o})]})]}),e.jsx(he,{icon:"Copy",label:"Copy email address",size:"sm",onClick:p=>l(o,p)})]},o)})})]})]})})},eo=({domain:t,onBack:s})=>{var h;const[a,r]=g.useState(1),i=Nt(),{data:l}=ss(t),{data:n,isLoading:o}=Ae({page:a,pageSize:Dt,facetFilters:{domains:[t]}}),d=((h=l==null?void 0:l.enrichedOrganisationData)==null?void 0:h.name)??t,c=l==null?void 0:l.enrichedOrganisationData,m=g.useMemo(()=>((n==null?void 0:n.attendeeEmails)??[]).filter(x=>x.endsWith(`@${t}`)),[n==null?void 0:n.attendeeEmails,t]),u=(n==null?void 0:n.total)??0,p=Math.ceil(u/Dt),f=g.useMemo(()=>es((n==null?void 0:n.items)??[]),[n==null?void 0:n.items]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("button",{type:"button",onClick:s,className:"mt-4 flex min-h-[44px] items-center gap-1 self-start rounded-md px-2 py-2 text-body-sm text-rb-secondary-dark hover:bg-rb-gray-neutral/50 focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden",children:[e.jsx(I,{name:"ArrowLeft",size:14,color:"secondary-dark"}),"Back to Companies"]}),e.jsxs("div",{className:"mt-4 flex items-start justify-between gap-4 roun
1ded-rb-card border border-rb-gray-neutral bg-rb-white p-4 shadow-rb-shadow-soft-xs",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(yn,{name:d,domain:t,size:"md"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[e.jsx("span",{className:"truncate text-body-lg font-medium text-rb-darkbtn",children:d}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-body-sm text-rb-secondary-dark",children:[(c==null?void 0:c.industry)&&e.jsx("span",{children:c.industry}),e.jsxs("a",{href:(c==null?void 0:c.websiteUrl)||`https://${t}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[e.jsx(I,{name:"Globe",size:12,color:"secondary-dark"}),t]})]})]})]}),m.length>0&&e.jsx(qi,{emails:m,membershipsByEmail:i})]}),o&&f.length===0?e.jsx(Ie,{rows:3}):f.length===0?e.jsxs(pe,{size:"lg",className:Xe,children:[e.jsxs(xe,{children:[e.jsx(fe,{children:e.jsx(I,{name:"Clock"})}),e.jsx(be,{children:`No recordings for ${d}`}),e.jsx(ve,{children:"Every meeting with them collects here. The ones you had before are no longer in your recordings."})]}),e.jsx(xt,{children:e.jsxs(R,{size:"md",onClick:s,children:[e.jsx(I,{name:"ArrowLeft",color:"current","data-icon":"inline-start"}),"Back to Companies"]})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{children:f.map(({key:x,value:b})=>{const C=ft(x),y=Ke(C,"EEEE, d MMMM");return e.jsxs("div",{className:"py-4",children:[e.jsx("div",{className:"pb-2",children:e.jsx("span",{className:"text-body-sm font-medium text-rb-darkbtn",children:y})}),e.jsx("div",{className:"flex flex-col gap-0.5",children:b.map(k=>e.jsx(ts,{callRecordings:k,scope:"company"},k[0].id))})]},x)})}),e.jsx(Qe,{currentPage:a,totalPages:p,totalItems:u,itemsPerPage:Dt,onPageChange:r})]})]})},to=mn().ALGOLIA_APP_ID;function so(){const{organisationId:t,allVerifiableEmailAddresses:s}=L(),{user:a}=je(),r=a==null?void 0:a.email,i=ye();return Re({queryKey:["attendee-emails",t,r],enabled:!!(t&&r),staleTime:1/0,placeholderData:Zs,queryFn:async()=>{var h;if(!r)return[];const l=await nn(t,()=>i.organisations.id(t).algolia.keys.create()),n=an(to,l),o=s.length>0?s:[r],d=rn({organisationId:t,viewerEmails:o}),m=(await n.searchForHits({requests:[{indexName:Ys.CALL_RECORDING,query:"",hitsPerPage:1e3,filters:d.join(" AND "),facets:["calendarEvent.attendeeEmails"],maxValuesPerFacet:1e3}]})).results[0],u=((h=m.facets)==null?void 0:h["calendarEvent.attendeeEmails"])??{},p=on(m.hits,x=>{var b;return((b=x.calendarEvent)==null?void 0:b.attendeeEmails)??[]}),f=Object.entries(u).filter(([x])=>!o.includes(x)&&!Xs({email:x,nonHumanDomains:Zt})).map(([x,b])=>({email:x,count:b,lastInteractedAt:p.get(x)}));return f.sort(ln),f}})}const Ms=3,no=({email:t,recordingCount:s,onNavigate:a})=>{const{organisationId:r}=L(),{logButtonPress:i}=G(),l=Nt(),{data:n}=ns(t),{data:o,isLoading:d}=Ae({pageSize:Ms,facetFilters:{attendeeEmails:[t]},fetchFullRecordings:!1}),c=l.get(t),m=c==null?void 0:c.userPhotoUrl,u=n==null?void 0:n.enrichedIndividualData,p=(c==null?void 0:c.userName)??(u==null?void 0:u.name)??t,f=Ks(p),h=g.useMemo(()=>(o==null?void 0:o.items)??[],[o==null?void 0:o.items]),x=g.useMemo(()=>{var y;if(h.length===0)return null;const C=(y=h[0].calendarEvent)==null?void 0:y.startsAt;return C?hn({date:C}):null},[h]);return e.jsxs("div",{className:"rounded-rb-card border border-rb-gray-neutral bg-rb-white shadow-rb-shadow-soft-xs",children:[e.jsx("div",{className:"flex items-center justify-between px-4 pt-4 pb-2",children:e.jsxs("button",{type:"button",onClick:()=>{i(ee.CLICK_PERSON_LIST_ITEM,{email:t}),a(t)},className:"flex items-center gap-3 rounded-md hover:opacity-80 focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:ring-offset-2 focus-visible:outline-hidden",children:[e.jsx(Je,{text:f,imageUrl:m,size:"md","aria-label":p}),e.jsxs("div",{className:"flex min-w-0 flex-col text-left",children:[e.jsx("span",{className:"truncate text-body-sm font-medium text-rb-darkbtn",children:p}),e.jsxs("div",{className:"flex items-center gap-2",children:[(u==null?void 0:u.title)&&e.jsx("span",{className:"truncate text-body-sm text-rb-secondary-dark",children:u.title}),x&&e.jsxs("span",{className:"truncate text-body-sm text-rb-secondary-dark",children:[u!=null&&u.title?"·":""," Last interacted ",x]})]})]})]})}),e.jsx("div",{className:"px-2.5 pb-2",children:d?e.jsx(Ie,{rows:2}):h.length>0?e.jsx("div",{className:"flex flex-col gap-0.5",children:h.map(b=>{var C,y,k;return e.jsx(yt,{density:"compact",title:((C=b.calendarEvent)==null?void 0:C.title)??"Untitled",startsAt:(y=b.calendarEvent)!=null&&y.startsAt?new Date(b.calendarEvent.startsAt):void 0,endsAt:(k=b.calendarEvent)!=null&&k.endsAt?new Date(b.calendarEvent.endsAt):void 0,status:"recorded",to:`/org/${r}/meeting-assistant/call-recordings/${b.objectID}`},b.objectID)})}):null}),s>Ms&&e.jsx("div",{className:"px-4 pb-4",children:e.jsxs("button",{type:"button",onClick:()=>a(t),className:"flex w-full items-center gap-1 text-body-sm text-rb-secondary-dark hover:underline focus-visible:rounded-xs focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden",children:["View all ",s," interactions",e.
1jsx(I,{name:"CaretRight",size:14,color:"secondary-dark"})]})})]})},lt=10,ao=()=>{const[,t]=Z(),[s,a]=g.useState(1),{data:r,isLoading:i}=so(),l=g.useCallback(c=>{t(m=>{const u=new URLSearchParams(m);return u.set("email",c),u})},[t]),n=(r==null?void 0:r.length)??0,o=Math.ceil(n/lt),d=g.useMemo(()=>{if(!r)return[];const c=(s-1)*lt;return r.slice(c,c+lt)},[r,s]);return i&&(r??[]).length===0?e.jsx(Ie,{rows:4}):n===0?e.jsx(pe,{size:"lg",className:M(Xe,"flex-1"),children:e.jsxs(xe,{children:[e.jsx(fe,{children:e.jsx(I,{name:"Users"})}),e.jsx(be,{children:"No people yet"}),e.jsx(ve,{children:"Everyone you meet shows up here with their meetings, so you can read the history before the next call."})]})}):e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[d.map(({email:c,count:m})=>e.jsx(no,{email:c,recordingCount:m,onNavigate:l},c)),e.jsx(Qe,{currentPage:s,totalPages:o,totalItems:n,itemsPerPage:lt,onPageChange:a})]})},Lt=20,ro=({email:t,onBack:s})=>{var A;const[a,r]=g.useState(1),[,i]=Z(),l=Nt(),{data:n}=ns(t),{data:o,isLoading:d}=Ae({page:a,pageSize:Lt,facetFilters:{attendeeEmails:[t]}}),c=l.get(t),m=c==null?void 0:c.userPhotoUrl,u=n==null?void 0:n.enrichedIndividualData,p=n==null?void 0:n.content,f=(c==null?void 0:c.userName)??(u==null?void 0:u.name)??t,h=Ca(t),x=h==null?void 0:h.replace(/[^a-zA-Z0-9.-]/g,""),b=Ks(f),[C,y]=g.useState(!1),k=g.useCallback(()=>y(!0),[]),S=(o==null?void 0:o.total)??0,D=Math.ceil(S/Lt),U=()=>{h&&i(P=>{const B=new URLSearchParams(P);return B.delete("email"),B.set("domain",h),B},{replace:!0})},N=g.useMemo(()=>es((o==null?void 0:o.items)??[]),[o==null?void 0:o.items]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("button",{type:"button",onClick:s,className:"mt-4 flex min-h-[44px] items-center gap-1 self-start rounded-md px-2 py-2 text-body-sm text-rb-secondary-dark hover:bg-rb-gray-neutral/50 focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden",children:[e.jsx(I,{name:"ArrowLeft",size:14,color:"secondary-dark"}),"Back to People"]}),e.jsx("div",{className:"mt-4 rounded-rb-card border border-rb-gray-neutral bg-rb-white p-4 shadow-rb-shadow-soft-xs",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Je,{text:b,imageUrl:m,size:"lg","aria-label":f}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[e.jsx("span",{className:"truncate text-body-lg font-medium text-rb-darkbtn",children:f}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-body-sm text-rb-secondary-dark",children:[(u==null?void 0:u.title)&&e.jsx("span",{children:u.title}),e.jsx("span",{children:t})]}),p&&e.jsx("p",{className:"mt-1 text-body-sm text-rb-secondary-dark",children:p}),h&&e.jsxs("button",{type:"button",onClick:U,className:"mt-1 flex items-center gap-1 self-start rounded-xs text-body-sm text-rb-secondary-dark hover:underline focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden",children:[C?e.jsx(I,{name:"Globe",size:16,color:"secondary-dark"}):e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${x}&sz=16`,alt:"",className:"size-4",onError:k}),((A=u==null?void 0:u.org)==null?void 0:A.name)??h,e.jsx(I,{name:"CaretRight",size:12,color:"secondary-dark"})]})]})]})}),d&&N.length===0?e.jsx(Ie,{rows:3}):N.length===0?e.jsxs(pe,{size:"lg",className:Xe,children:[e.jsxs(xe,{children:[e.jsx(fe,{children:e.jsx(I,{name:"Clock"})}),e.jsx(be,{children:`No recordings for ${f}`}),e.jsx(ve,{children:"Every meeting with them collects here. The ones you had before are no longer in your recordings."})]}),e.jsx(xt,{children:e.jsxs(R,{size:"md",onClick:s,children:[e.jsx(I,{name:"ArrowLeft",color:"current","data-icon":"inline-start"}),"Back to People"]})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{children:N.map(({key:P,value:
1B})=>{const Q=ft(P),H=Ke(Q,"EEEE, d MMMM");return e.jsxs("div",{className:"py-4",children:[e.jsx("div",{className:"pb-2",children:e.jsx("span",{className:"text-body-sm font-medium text-rb-darkbtn",children:H})}),e.jsx("div",{className:"flex flex-col gap-0.5",children:B.map(se=>e.jsx(ts,{callRecordings:se,scope:"person"},se[0].id))})]},P)})}),e.jsx(Qe,{currentPage:a,totalPages:D,totalItems:S,itemsPerPage:Lt,onPageChange:r})]})]})},Pt=20,io=()=>{const[t,s]=g.useState(1),{data:a,isLoading:r}=Ae({page:t,pageSize:Pt}),i=(a==null?void 0:a.total)??0,l=Math.ceil(i/Pt),n=g.useMemo(()=>es((a==null?void 0:a.items)??[]),[a==null?void 0:a.items]);return r&&n.length===0?e.jsx(Ie,{rows:4}):n.length===0?e.jsxs(pe,{size:"lg",className:M(Xe,"flex-1"),children:[e.jsxs(xe,{children:[e.jsx(fe,{children:e.jsx(I,{name:"Microphone"})}),e.jsx(be,{children:"Your recorded meetings will live here"}),e.jsx(ve,{children:"Fyxer joins the calls on your calendar and writes the notes. Nothing to set up beyond your first meeting."})]}),e.jsx(xt,{children:e.jsx(jn,{layout:"rows"})})]}):e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"flex flex-col gap-0.5",children:n.map(({key:o,value:d})=>{const c=ft(o),m=Ke(c,"EEEE, d MMMM");return e.jsxs("div",{children:[e.jsx(Kt,{label:m,className:"px-3.5 pt-4 pb-1.5"}),e.jsx("div",{className:"flex flex-col gap-0.5",children:d.map(u=>e.jsx(ts,{callRecordings:u},u[0].id))})]},o)})}),e.jsx(Qe,{currentPage:t,totalPages:l,totalItems:i,itemsPerPage:Pt,onPageChange:s})]})},oo=[{label:"My meetings",value:"my-meetings"},{label:"Companies",value:"companies"},{label:"People",value:"people"}],lo=()=>{const[t,s]=g.useState("my-meetings"),[a,r]=Z(),{logButtonPress:i}=G(),l=Yi({id:"company-and-people-tabs-survey",questions:[{type:"rating",title:"How useful do you find the new Companies and People tabs for organizing your recordings?",ratingLeast:"Not useful at all",ratingMost:"Extremely useful"},{type:"text",title:"What changes or additions would you like to see in the Companies and People tabs?",description:"e.g. filtering, sorting, grouping, or any other features"}],defaultTriggerOnMount:t!=="my-meetings"}),n=a.get("domain"),o=a.get("email"),d=()=>{r(u=>{const p=new URLSearchParams(u);return p.delete("domain"),p},{replace:!0})},c=()=>{r(u=>{const p=new URLSearchParams(u);return p.delete("email"),p},{replace:!0})},m=e.jsx(Ji,{id:l.id,questions:l.questions,isOpen:l.isOpen,onClose:l.close,onComplete:l.markCompleted});return n?e.jsxs(e.Fragment,{children:[m,e.jsx(eo,{domain:n,onBack:d})]}):o?e.jsxs(e.Fragment,{children:[m,e.jsx(ro,{email:o,onBack:c})]}):e.jsxs(e.Fragment,{children:[m,e.jsxs("div",{className:"flex min-h-full flex-col",children:[e.jsx(vt,{value:t,onValueChange:u=>{s(u),i(ee.CLICK_CONTACTS_SUB_TAB,{tab:u})},children:e.jsx(jt,{activateOnFocus:!0,"aria-label":"Meetings and contacts",className:"px-2",children:oo.map(u=>e.jsx(ce,{value:u.value,children:u.label},u.value))})}),e.jsxs("div",{role:"tabpanel",id:`panel-${t}`,"aria-labelledby":`tab-${t}`,className:"mt-1 flex flex-1 flex-col",children:[t==="my-meetings"?e.jsx(io,{}):null,t==="companies"?e.jsx(Xi,{}):null,t==="people"?e.jsx(ao,{}):null]})]})]})},co=({currentTab:t,onTabChange:s})=>{const a=Bi(),r=zt(Va),[i,l]=g.useState(!1),n=r&&i;return e.jsxs(wa,{className:"h-[calc(100dvh-3.5rem)] min-w-0 overflow-hidden bg-rb-canvas lg:h-dvh",children:[e.jsxs(Sa,{className:"min-w-0 shrink-0",children:[e.jsx(ka,{children:e.jsx(Ia,{children:"Notetaker"})}),r&&e.jsx(Ra,{children:e.jsx(he,{icon:i?"ArrowLeft":"Chat",label:i?"Back to meetings":"Insights",size:"md",onClick:()=>l(o=>!o)})})]}),!n&&e.jsxs(e.Fragment,{children:[e.jsx(Ui,{className:"mb-0"}),e.jsx(ai,{className:"mb-0"}),e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-2",children:[e.jsx(vt,{value:t,onValueChange:s,children:e.jsxs(jt,{activateOnFocus:!0,"aria-label":"Meetings view",children:[e.jsx(ce,{value:me.CALL_RECORDINGS,children:"Recorded"}),e.jsx(ce,{value:me.CALENDAR_EVENTS,children:"Upcoming"})]})}),e.jsxs("div",{className:"flex min-w-0 flex-1 basis-full items-center gap-2 lg:basis-auto lg:justify-end",children:[e.jsx("div",{className:"min-w-0 flex-1 lg:w-[280px] lg:flex-none",children:e.jsx(gi,{triggerVariant:"refined"})}),e.jsx(jn,{align:"end"}),e.jsx(ki,{})]})]})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 gap-4 sm:gap-6",children:[e.jsx(Hs,{className:M("min-w-0 flex-1 gap-0 overflow-hidden pt-5 pb-3 sm:gap-0 sm:pt-5 sm:pb-3",n&&"hidden"),children:e.jsx(Js,{className:"flex min-h-0 flex-1 flex-col px-3",children:e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t===me.CALL_RECORDINGS?e.jsx(lo,{}):e.jsx(oi,{})})})}),e.jsx(zi,{suggestions:a,className:M("min-w-0 flex-1 lg:w-[440px] lg:flex-none lg:shrink-0",!n&&"max-lg:hidden")})]})]})},ic=()=>{const[t]=Z(),[s,a]=g.useState(()=>t.get("tab")===me.CALENDAR_EVENTS?me.CALENDAR_EVENTS:me.CALL_RECORDINGS);return ni(),ti(),si(),Ma(),e.jsxs(Aa,{permission:{feature:"Notetaker"},children:[e.jsx(Bn,{}),e.jsx(co,{currentTab:s,onTabChange:a})]})};export{ic as Notetaker};
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.