1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,419829,47075,652404,403568,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(174080),l=e.i(86906),a=e.i(881335),s=e.i(469550),i=e.i(88494),o=e.i(37727),c=e.i(178583),u=e.i(752044),d=e.i(82735),m=e.i(837647),p=e.i(728480),f=e.i(431343),h=e.i(503116),x=e.i(493886),g=e.i(531278),y=e.i(610384),b=e.i(761691),w=e.i(76208),v=e.i(311397),k=e.i(538526),j=e.i(723448),C=e.i(770703),N=e.i(901132),_=e.i(417842),S=e.i(993899),T=e.i(652361),M=e.i(728231),E=e.i(992427),D=e.i(647163),I=e.i(777845);let R=new Map;function A(e){return e?R.get(e)??null:null}function P(e,t){e&&(t&&/\S/.test(t)?R.set(e,t):R.delete(e))}function U(e){e&&R.delete(e)}e.s(["clearComposerDraft",0,U,"hasAnyComposerDraft",0,function(){return R.size>0},"readComposerDraft",0,A,"writeComposerDraft",0,P],47075);let $=/\{\{\s*(\w+(?:\|\w+)*)\s*\}\}/g;function F(e,t,n){let r;if(!e||!e.includes("{{"))return{text:e,caret:t};let l=[];for(;null!==(r=$.exec(e));){let e=r[1].split("|"),t=!1,a="";for(let r of e)if(r in n){t=!0;let e=n[r]??"";if(e){a=e;break}}t&&a&&l.push({start:r.index,end:r.index+r[0].length,value:a})}if(0===l.length)return{text:e,caret:t};let a="",s=0,i=t;for(let n of l){a+=e.slice(s,n.start)+n.value;let r=n.value.length-(n.end-n.start);t>=n.end?i+=r:t>n.start&&(i=a.length),s=n.end}return a+=e.slice(s),i=Math.max(0,Math.min(i,a.length)),{text:a,caret:i}}var L=e.i(59377),q=e.i(611423),O=e.i(309204),H=e.i(602487),B=e.i(572377),z=e.i(522016),V=e.i(961888),W=e.i(298809),W=W,G=e.i(63727),K=e.i(406120),X=e.i(149685),Y=e.i(939951),J=e.i(488844),Z=e.i(208402),Q=e.i(335416),ee=e.i(213788);let et={deal:X.Handshake,document:K.FileSignature,doc:W.default,ticket:Z.Ticket,task:Y.ListTodo,product:J.Package,sequence:Q.Workflow,job:G.Briefcase,recording:x.Film},en={xs:{mark:"h-3.5 w-3.5",glyph:"h-2.5 w-2.5",text:"text-[10px]",initial:"text-[7px]"},sm:{mark:"h-5 w-5",glyph:"h-3.5 w-3.5",text:"text-sm",initial:"text-[10px]"}};function er({mention:e,size:r="xs",className:l}){let a=en[r];if(("company"===e.recordType||"company"===e.kind)&&(e.domain||e.imageUrl))return(0,t.jsx)(ee.CompanyLogo,{domain:e.domain,companyName:e.name,logoUrl:e.imageUrl,size:"xs",className:(0,D.cn)("shrink-0",a.mark,l)});let s="app"===e.kind?V.Blocks:e.recordType?et[e.recordType]??null:null;return(0,t.jsx)("span",{className:(0,D.cn)("relative flex shrink-0 items-center justify-center overflow-hidden squircle bg-muted avatar-border font-medium",a.mark,a.initial,l),children:e.imageUrl?(0,t.jsx)("img",{src:e.imageUrl,alt:"",className:"absolute inset-0 h-full w-full object-cover",referrerPolicy:"no-referrer"}):s?(0,n.createElement)(s,{className:(0,D.cn)(a.glyph,"text-foreground/70")}):e.name.charAt(0).toUpperCase()})}let el={xs:"gap-1 rounded-md px-1.5 py-0.5",sm:"gap-1.5 rounded-full sq-capsule py-[5px] pl-[5px] pr-3"};function ea(e){return e.replace(/\s+/g," ").trim()}function es({platform:e}){return"member"===e?null:"linkedin"===e?(0,t.jsx)("span",{className:"flex h-3.5 w-3.5 items-center justify-center rounded-[4px] bg-[#0A66C2] text-white shrink-0",children:(0,t.jsx)(B.LinkedInGlyph,{className:"size-2"})}):(0,t.jsx)("span",{className:"flex h-3.5 w-3.5 items-center justify-center rounded-[4px] bg-black text-white dark:bg-white dark:text-black shrink-0",children:(0,t.jsx)(B.XGlyph,{className:"size-2"})})}e.s(["MentionMark",0,er,"MentionPill",0,function({mention:e,size:n="xs",isMe:r=!1,className:l}){let a=en[n],s=(0,D.cn)("entity-chip inline-flex items-center border align-middle font-medium text-foreground/80 transition-colors",el[n],a.text,r&&"ring-1 ring-inset ring-primary/30 text-foreground",l),i=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(er,{mention:e,size:n}),(0,t.jsx)("span",{className:"max-w-[160px] truncate",children:e.name})]});return e.href?(0,t.jsx)(z.default,{href:e.href,className:s,onClick:e=>e.stopPropagation(),children:i}):(0,t.jsx)("span",{className:s,children:i})}],652404);let ei=(0,n.forwardRef)(function({query:e,platforms:r,memberSearch:l,onSelect:a,onClose:s}
1,i){let[o,c]=(0,n.useState)([]),[u,d]=(0,n.useState)(0),[m,p]=(0,n.useState)(!1),[f,h]=(0,n.useState)(null),x=(0,n.useRef)(void 0),g=(0,n.useRef)(0),y=(0,n.useRef)([]),b=(0,n.useRef)(0);if((0,n.useEffect)(()=>{y.current=o},[o]),(0,n.useEffect)(()=>{b.current=u},[u]),(0,n.useImperativeHandle)(i,()=>({handleKeyDown(e){let t=y.current;switch(e){case"ArrowDown":return d(e=>t.length?Math.min(e+1,t.length-1):0),!0;case"ArrowUp":return d(e=>Math.max(e-1,0)),!0;case"Enter":case"Tab":{let e=t[b.current];if(e)return a(e),!0;return!1}case"Escape":return s(),!0;default:return!1}}})),(0,n.useEffect)(()=>{x.current&&clearTimeout(x.current);let t=e.trim(),n=++g.current;return t.length<2?(x.current=setTimeout(()=>{c([]),p(!1),h(null)},0),()=>{x.current&&clearTimeout(x.current)}):(x.current=setTimeout(async()=>{p(!0),h(null);let e=r.includes("linkedin"),a=r.includes("x"),s=r.includes("member")&&!!l,[i,o,u,m]=await Promise.all([s?l(t).catch(()=>null):null,e?(0,O.sendExtensionMessage)({action:"linkedin_people_search",keywords:t,start:0,count:5,looseKeywords:!0,minResults:5}).catch(()=>null):null,e?(0,O.sendExtensionMessage)({action:"linkedin_company_search",keywords:t,start:0,count:5}).catch(()=>null):null,a?(0,H.typeaheadXPeople)(t,{count:5}).catch(()=>null):null]);if(n!==g.current)return;let f=[];for(let e of(i||[]).slice(0,100))f.push(e);for(let e of(o?.results||[]).slice(0,5)){if(!e.profile_urn||!e.name)continue;let t=ea(e.name);f.push({id:e.profile_urn,platform:"linkedin",kind:"person",name:t,token:`@${t}`,urn:e.profile_urn,imageUrl:e.image_url,subtitle:e.headline})}for(let e of(u?.results||[]).slice(0,5)){if(!e.company_urn||!e.name)continue;let t=ea(e.name);f.push({id:e.company_urn,platform:"linkedin",kind:"company",name:t,token:`@${t}`,urn:e.company_urn,imageUrl:e.image_url,subtitle:e.industry})}for(let e of m?.data?.people?.slice(0,5)||[])e.screenName&&f.push({id:`x:${e.screenName.toLowerCase()}`,platform:"x",kind:e.isOrganization?"company":"person",name:ea(e.name||e.screenName),token:`@${e.screenName}`,screenName:e.screenName,imageUrl:e.profileImageUrl,subtitle:`@${e.screenName}`});0===f.length&&h(o?.error||u?.error||(m&&!m.ok?m.error:null)||null),c(f),d(0),p(!1)},250),()=>{x.current&&clearTimeout(x.current)})},[e,r.join(","),l]),e.trim().length<2)return(0,t.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Type a name to mentionâ¦"});if(m&&0===o.length)return(0,t.jsx)("div",{className:"py-1",children:Array.from({length:3}).map((e,n)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[(0,t.jsx)(q.Skeleton,{className:"h-7 w-7 squircle shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,t.jsx)(q.Skeleton,{className:"h-3 w-28"}),(0,t.jsx)(q.Skeleton,{className:"h-2.5 w-20"})]})]},n))});if(0===o.length)return f?(0,t.jsx)("div",{className:"px-3 py-2 text-xs text-destructive",children:f}):(0,t.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No matches"});let w=o.findIndex(e=>"record"===e.kind);return(0,t.jsx)("ul",{className:"max-h-[22rem] overflow-y-auto p-1",children:o.map((e,n)=>(0,t.jsxs)("li",{children:[n===w&&(0,t.jsx)("span",{className:"mt-1 block px-2 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"In your workspace"}),(0,t.jsxs)("button",{type:"button",onClick:()=>a(e),onMouseEnter:()=>d(n),className:(0,D.cn)("flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left hover:bg-accent",n===u&&"bg-accent"),children:[(0,t.jsx)(er,{mention:e,size:"sm",className:"h-8 w-8 text-[10px]"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 leading-tight",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"block text-xs font-semibold truncate",children:e.name}),(0,t.jsx)(es,{platform:e.platform})]}),e.subtitle&&(0,t.jsx)("span",{className:"block text-[10px] text-muted-foreground truncate",children:e.subt
1itle})]})]})]},e.id))})});var eo=e.i(853265),ec=e.i(783618);let eu=(0,ec.pillClass)("icon","max-w-full select-none align-middle leading-none");function ed(e){return{token:e.token,name:e.name,imageUrl:e.imageUrl}}function em(e){let t=document.createElement("span");if(t.contentEditable="false",t.dataset.token=e.token,e.chipKind&&(t.dataset.chipKind=e.chipKind),t.className=eu,e.imageUrl){let n=document.createElement("img");n.src=e.imageUrl,n.alt="",n.className="squircle h-[18px] w-[18px] shrink-0 object-cover",t.appendChild(n)}else{let n=document.createElement("span");n.className="squircle flex h-[18px] w-[18px] shrink-0 items-center justify-center bg-muted text-[9px] font-semibold uppercase text-muted-foreground",e.mark?(n.classList.remove("uppercase"),n.classList.add("text-[11px]"),e.markColor&&(n.classList.remove("bg-muted","text-muted-foreground"),n.style.backgroundColor=`color-mix(in srgb, ${e.markColor} 18%, transparent)`,n.style.color=e.markColor),n.textContent=e.mark):n.textContent=e.name.slice(0,1),t.appendChild(n)}let n=document.createElement("span");return n.className="truncate",n.textContent=e.name,t.appendChild(n),t}function ep(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE?t+=n.nodeValue??"":n instanceof HTMLElement&&(n.dataset.token?t+=n.dataset.token:"BR"===n.tagName?t+="\n":t+=ep(n));return t}function ef(e){let t=window.getSelection();if(!t||0===t.rangeCount)return ep(e).length;let n=t.getRangeAt(0).cloneRange();n.selectNodeContents(e),n.setEnd(t.getRangeAt(0).endContainer,t.getRangeAt(0).endOffset);let r=n.cloneContents(),l=document.createElement("div");return l.appendChild(r),ep(l).length}function eh({text:e,placeholder:r,disabled:l,className:a,handleRef:s,onTextChange:i,onCaret:o,onKeyDown:c,onPaste:u,onChipClick:d}){let m=(0,n.useRef)(null),p=(0,n.useRef)(""),f=(0,n.useCallback)(()=>{let e=m.current;if(!e)return;let t=ep(e);p.current=t,i(t),o(t,ef(e))},[i,o]);return(0,n.useEffect)(()=>{let t=m.current;t&&e!==p.current&&(t.textContent=e,p.current=e)},[e]),(0,n.useEffect)(()=>{s&&(s.current={focus:()=>{let e=m.current;if(!e)return;e.focus();let t=window.getSelection();if(!t)return;let n=document.createRange();n.selectNodeContents(e),n.collapse(!1),t.removeAllRanges(),t.addRange(n)},replaceMention:(e,t)=>{let n=m.current,r=n?.querySelector(`[data-token="${CSS.escape(e)}"]`);n&&r&&(r.replaceWith(em(ed(t))),f())},insertMention:(e,t)=>{s.current?.insertChip(ed(e),t)},insertChip:(e,t)=>{let n=m.current,r=window.getSelection();if(!n||!r||0===r.rangeCount)return;let l=r.getRangeAt(0);for(let e=0;e<t&&(l.setStart(l.startContainer,Math.max(0,l.startOffset-1)),0!==l.startOffset||l.startContainer===n);e++);l.deleteContents();let a=em(e),s=document.createTextNode("Â ");l.insertNode(s),l.insertNode(a),l.setStartAfter(s),l.collapse(!0),r.removeAllRanges(),r.addRange(l),n.focus(),f()},insertText:(e,t)=>{let n=m.current,r=window.getSelection();if(!n||!r||0===r.rangeCount)return;let l=r.getRangeAt(0);for(let e=0;e<t&&(l.setStart(l.startContainer,Math.max(0,l.startOffset-1)),0!==l.startOffset||l.startContainer===n);e++);l.deleteContents(),l.collapse(!0),r.removeAllRanges(),r.addRange(l),n.focus(),document.execCommand("insertText",!1,e),f()}})},[s,f]),(0,t.jsx)("div",{ref:m,role:"textbox","aria-multiline":"true","aria-label":r,tabIndex:0,contentEditable:!l,suppressContentEditableWarning:!0,"data-placeholder":r,onInput:f,onKeyUp:()=>{let e=m.current;e&&o(ep(e),ef(e))},onMouseUp:()=>{let e=m.current;e&&o(ep(e),ef(e))},onKeyDown:c,onClick:e=>{let t=e.target.closest("[data-token]");t?.dataset.token&&d?.(t.dataset.token,t.getBoundingClientRect())},onPaste:e=>{if(u?.(e),e.defaultPrevented)return;e.preventDefault();let t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)},className:`mention-editor whitespace-pre-wrap break-words outline-none ${a??""}`})}var ex=e.i(875527),eg=e.i(552500),ey=e.i(846696),eb=e.i(463059),ew=e.i(373375),ev=e.i(747697),ek=e.i(401851),ej=e.i(974875),eC=e.i(980797),eN=e.i(585890),e_=e.i(607709),eS=e.i(167881),eT=e.i(157734),eM=e.i(314743),eE=e.i(324973),eD=e.i(402370),eI=e.i(504574),eR=e.i(414318);let eA="everything:follow-up-prefs";function eP(){try{return JSON.parse(window.localStorage.getItem(eA)??"{}")}catch{return{}}}function eU(){let e=new Date(9e5*Math.ceil(Date.now()/9e5));return(0,ek.format)(e,"HH:mm")}function e$({target:e,handleRef:r,disabled:l}){let{channel:a,conversationRef:s,contactId:i,emailProvider:o}=e,c=(0,n.useMemo)(()=>
1eP(),[]),[u,d]=(0,n.useState)(!1),[m,p]=(0,n.useState)("main"),[f,h]=(0,n.useState)(null),[x,g]=(0,n.useState)(null),[y,b]=(0,n.useState)(),[w,v]=(0,n.useState)("09:00"),[k,j]=(0,n.useState)(c.taskTypeByChannel?.[a]??(0,eI.defaultFollowUpTaskType)(a)),[C,N]=(0,n.useState)(null),[_,S]=(0,n.useState)(!1),[T,E]=(0,n.useState)(0);(0,n.useEffect)(()=>{let e=!1,t=new URLSearchParams({channel:a,conversation_ref:s});return fetch(`/api/follow-ups?${t}`).then(e=>e.ok?e.json():null).then(t=>{e||N(t?.follow_up??null)}).catch(()=>{}),()=>{e=!0}},[a,s,T]),(0,eR.useOnInboxRefresh)(()=>E(e=>e+1));let D=(0,n.useCallback)(()=>{f&&!C&&!_&&i&&(S(!0),fetch("/api/follow-ups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:a,conversation_ref:s,email_provider:o??null,contact_id:i,task_type:k,due_at:f.toISOString()})}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t?.error||"Could not set the follow-up");N(t.follow_up),h(null),g(null)}).catch(e=>{ey.toast.error(e instanceof Error?e.message:"Could not set the follow-up")}).finally(()=>S(!1)))},[f,C,_,i,a,s,o,k]);(0,n.useImperativeHandle)(r,()=>({commit:D}),[D]);let I=(0,n.useCallback)(()=>{if(!_){if(!C){h(null),g(null),d(!1);return}S(!0),fetch(`/api/follow-ups?id=${encodeURIComponent(C.id)}`,{method:"DELETE"}).then(e=>{if(!e.ok)throw Error("Could not remove the follow-up");N(null),d(!1)}).catch(()=>ey.toast.error("Could not remove the follow-up")).finally(()=>S(!1))}},[C,_]),R=(0,n.useCallback)(e=>{h((0,eI.resolveFollowUpDue)(e)),g(e),d(!1)},[]),A=(0,n.useCallback)(()=>{let e=f??(0,eI.resolveFollowUpDue)(eI.DEFAULT_FOLLOW_UP_CADENCE);b(e),v((0,ek.format)(e,"HH:mm")),p("custom")},[f]),P=(0,n.useCallback)(()=>{if(!y)return;let[e,t]=w.split(":").map(Number),n=new Date(y);n.setHours(e??9,t??0,0,0),h(n),g(null),p("main"),d(!1)},[y,w]),U=(0,n.useCallback)(e=>{j(e);var t={taskTypeByChannel:{...eP().taskTypeByChannel,[a]:e}};try{window.localStorage.setItem(eA,JSON.stringify({...eP(),...t}))}catch{}p("main")},[a]),$=!!(C||f),F=C?new Date(C.due_at):f,q=eD.TASK_TYPE_CONFIG[k],O=C?eD.TASK_TYPE_CONFIG[C.task_type]??q:q,H=C?`Follow-up task ${(0,eI.describeFollowUpDue)(new Date(C.due_at))} if they haven't replied`:F?`Follow up ${(0,eI.describeFollowUpDue)(F)} if no reply`:"Follow up if no reply";return(0,t.jsxs)(L.Popover,{open:u,onOpenChange:e=>{d(e),e||p("main")},children:[(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(L.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",disabled:l,"aria-label":"Follow up if no reply",className:"relative h-7 w-7 flex items-center justify-center rounded-xl [corner-shape:squircle] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50",style:$?{color:"var(--ring)"}:void 0,children:[(0,t.jsx)(eE.TasksIcon,{className:"h-4 w-4"}),$&&(0,t.jsx)("span",{className:"absolute right-0.5 top-0.5 size-1.5 rounded-full",style:{backgroundColor:"var(--ring)"}})]})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:H})]}),(0,t.jsx)(L.PopoverContent,{align:"start",className:"w-auto p-0 z-[100]",container:(0,e_.isDemoMode)()?void 0:"u">typeof document?document.body:null,children:C?(0,t.jsxs)("div",{className:"p-2 min-w-[240px] space-y-1",children:[(0,t.jsx)("p",{className:"px-2 pt-1 pb-2 text-xs font-medium text-muted-foreground",children:"Follow-up set"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 pb-1 text-sm",children:[(0,t.jsx)(O.Icon,{className:"!h-4 !w-4 shrink-0"}),(0,t.jsx)("span",{className:"font-medium",children:O.label})]}),(0,t.jsxs)("p",{className:"px-2 pb-2 text-xs text-muted-foreground",children:["Lands ",(0,eI.describeFollowUpDue)(new Date(C.due_at)),", only if they haven't replied by then."]}),(0,t.jsx)("div",{className:"border-t my-1"}),(0,t.jsx)("button",{type:"button",onClick:I,disabled:_,className:"flex w-full items-center rounded-md px-2 py-2 text-sm text-destructive transition-colors hover:bg-muted disabled:opacity-50",children:"Remove follow-up"})]}):"type"===m?(0,t.jsxs)("div",{className:"p-2 min-w-[240px] max-h-80 overflow-y-auto space-y-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>p("main"),className:"flex w-full items-center gap-1.5 rounded-md px-2 pt-1 pb-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(ew.ChevronLeft,{className:"size-3.5"}),"Task type"]}),eD.TASK_TYPE_ORDER.map(e=>{let n=eD.TASK_TYPE_CONFIG[e];return(0,t.jsxs)("button",{type:"button",onClick:()=>U(e),className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-muted ${e===k?"font-medium":""}`,children:[(0,t.jsx)(n.Icon,{className:"!h-4 !w-4 shrink-0"}),n.label]},e)})]}):"custom"===m?(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(eT.Calendar,{mode:"single",selected:y,onSelect:e=>{b(e);let t=e&&(0,eC.isToday)(e)?eU():null;t&&w<t&&v(t)}
1,disabled:e=>(0,ej.isBefore)(e,(0,eN.startOfDay)(new Date)),className:"p-0",initialFocus:!0}),(0,t.jsxs)("div",{className:"flex w-[128px] shrink-0 flex-col border-l pl-3",children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Time"}),(0,t.jsx)(eM.TimePicker,{inline:!0,value:w,onValueChange:v,min:y&&(0,eC.isToday)(y)?eU():void 0,variant:"on-white",inputClassName:"h-8 text-sm",className:"flex-1",listClassName:"max-h-[204px] flex-1"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-1",children:[(0,t.jsx)(eS.Button,{variant:"ghost",size:"sm",onClick:()=>p("main"),children:"Back"}),(0,t.jsx)(eS.Button,{size:"sm",onClick:P,disabled:!y,children:"Set follow-up"})]})]}):(0,t.jsxs)("div",{className:"p-2 min-w-[248px] space-y-1",children:[(0,t.jsx)("p",{className:"px-2 pt-1 pb-2 text-xs font-medium text-muted-foreground",children:"Follow up if no reply"}),(0,t.jsxs)("button",{type:"button",onClick:()=>p("type"),className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-muted",children:[(0,t.jsx)(q.Icon,{className:"!h-4 !w-4 shrink-0"}),(0,t.jsx)("span",{className:"font-medium",children:q.label}),(0,t.jsx)(eb.ChevronRight,{className:"ml-auto size-3.5 text-muted-foreground"})]}),(0,t.jsx)("div",{className:"border-t my-1"}),eI.FOLLOW_UP_CADENCES.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>R(e.value),className:"flex w-full items-center justify-between gap-4 rounded-md px-2 py-2 text-sm transition-colors hover:bg-muted",children:[(0,t.jsx)("span",{className:x===e.value?"font-medium":"",children:e.label}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,eI.describeFollowUpDue)((0,eI.resolveFollowUpDue)(e.value))})]},e.value)),(0,t.jsx)("div",{className:"border-t my-1"}),(0,t.jsxs)("button",{type:"button",onClick:A,className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-muted",children:[(0,t.jsx)(ev.CalendarIcon,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:f&&!x?"font-medium":"",children:"Pick date & time"}),f&&!x&&(0,t.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:(0,ek.format)(f,"MMM d, h:mm a")})]}),f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"border-t my-1"}),(0,t.jsx)("button",{type:"button",onClick:I,className:"flex w-full items-center rounded-md px-2 py-2 text-sm text-destructive transition-colors hover:bg-muted",children:"Don't follow up"})]})]})})]})}var eF=e.i(926925),eL=e.i(495242);let eq="voice-note",eO=[{mimeType:"audio/mp4",extension:"m4a"},{mimeType:"audio/mp4;codecs=mp4a.40.2",extension:"m4a"},{mimeType:"audio/aac",extension:"m4a"},{mimeType:"audio/webm;codecs=opus",extension:"webm"},{mimeType:"audio/webm",extension:"webm"}];function eH(){if("u"<typeof MediaRecorder)return null;for(let e of eO){if("function"!=typeof MediaRecorder.isTypeSupported)break;if(MediaRecorder.isTypeSupported(e.mimeType))return{...e,filename:`${eq}.${e.extension}`}}return null}function eB(e){if(null==e||!Number.isFinite(e)||e<0)return"--:--";let t=Math.round(e);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,"0")}`}function ez(e,t=28){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;let r=[];for(let e=0;e<t;e++)r.push(.15+((n=0x41c64e6d*n+12345>>>0)>>>16)%1e3/1e3*.85);return r}function eV({file:e,className:r}){let l=(0,n.useRef)(null),[a,s]=(0,n.useState)(!1),[i,o]=(0,n.useState)(null),[c,u]=(0,n.use
1State)(0),[d,m]=(0,n.useState)(null);(0,n.useEffect)(()=>{let t=URL.createObjectURL(e);return m(t),()=>URL.revokeObjectURL(t)},[e]);let p=(0,n.useMemo)(()=>ez(`${e.name}:${e.size}`,20),[e.name,e.size]),h=(0,n.useCallback)(()=>{let e=l.current;e&&(e.paused?e.play().catch(()=>s(!1)):e.pause())},[]),x=Math.round((i&&i>0?Math.min(1,c/i):0)*p.length);return(0,t.jsxs)("div",{className:(0,D.cn)("flex h-12 w-[184px] items-center gap-2 rounded-lg [corner-shape:squircle] border border-border bg-card px-2",r),children:[(0,t.jsx)("button",{type:"button",onClick:h,"aria-label":a?"Pause":"Play",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-foreground transition-colors duration-150 hover:bg-accent",children:a?(0,t.jsx)(eL.Pause,{className:"h-3 w-3"}):(0,t.jsx)(f.Play,{className:"ml-0.5 h-3 w-3"})}),(0,t.jsx)("span",{className:"flex h-5 min-w-0 flex-1 items-center gap-[2px]","aria-hidden":!0,children:p.map((e,n)=>(0,t.jsx)("span",{className:(0,D.cn)("w-[2px] flex-1 rounded-full",n<x?"bg-foreground":"bg-muted-foreground"),style:{height:`${Math.round(100*e)}%`,opacity:n<x?1:.35}},n))}),(0,t.jsx)("span",{className:"shrink-0 text-[10px] tabular-nums text-muted-foreground",children:eB(a||c>0?c:i)}),d&&(0,t.jsx)("audio",{ref:l,src:d,preload:"metadata",onPlay:()=>s(!0),onPause:()=>s(!1),onLoadedMetadata:e=>{let t=e.currentTarget.duration;Number.isFinite(t)&&t>0&&o(t)},onTimeUpdate:e=>u(e.currentTarget.currentTime),onEnded:()=>{s(!1),u(0)},className:"hidden"})]})}e.s(["formatVoiceNoteDuration",0,eB,"isVoiceNoteFilename",0,function(e){return((e??"").split(/[\\/]/).pop()?.trim().toLowerCase()??"").startsWith(eq)},"pickVoiceNoteFormat",0,eH,"readAudioDuration",0,function(e,t){return new Promise(n=>{if("u"<typeof Audio)return void n(t);let r=URL.createObjectURL(e),l=new Audio,a=!1,s=e=>{a||(a=!0,URL.revokeObjectURL(r),n(Number.isFinite(e)&&e>0?e:t))};l.preload="metadata",l.onloadedmetadata=()=>s(l.duration),l.onerror=()=>s(t),setTimeout(()=>s(t),1500),l.src=r})},"voiceNoteBars",0,ez,"voiceNoteSupported",0,function(){return!("u"<typeof navigator)&&!!navigator.mediaDevices?.getUserMedia&&null!==eH()}],403568);var eW=e.i(880028),eG=e.i(839166),eK=e.i(803635),eX=e.i(59844),eY=e.i(595727);let eJ=(0,C.default)(()=>e.A(699838).then(e=>e.VideoEditorDialog),{loadableGenerated:{modules:[162411]},ssr:!1});function eZ(e,t){let n=-1;for(let r=t-1;r>=0;r--){let t=e[r];if("@"===t){let t=0===r?" ":e[r-1];/\s/.test(t)&&(n=r);break}if(/\s/.test(t))break}if(n<0)return null;let r=e.slice(n+1,t);return/[\n\r]/.test(r)?null:{startIndex:n,query:r}}function eQ(e,t){if(!e||0===e.size)return null;let n=e.type||t,r=e.name?.trim();if(r&&e.type)return e;let l="image/jpeg"===n?"jpg":"image/svg+xml"===n?"svg":n.split("/")[1]||"png";return new File([e],r||`Pasted image.${l}`,{type:n||"application/octet-stream"})}function e0({progress:e,size:n=14,className:r}){let l=(n-1.5)/2,a=n/2,s=n/2,i=2*Math.PI*l,o=Math.min(1,Math.max(0,e));return(0,t.jsxs)("svg",{width:n,height:n,className:r,viewBox:`0 0 ${n} ${n}`,children:[(0,t.jsx)("circle",{cx:a,cy:s,r:l,fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"text-muted-foreground/30"}),(0,t.jsx)("circle",{cx:a,cy:s,r:l,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeDasharray:`${o*i} ${i}`,className:"text-muted-foreground/70",transform:`rotate(-90 ${a} ${s})`})]})}function e1({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[(0,t.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0,t.jsx)("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),(0,t.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),(0,t.jsx)("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]})}function e2({open:e,triggerRef:a,virtualRect:s,estimatedHeight:i=480,estimatedWidth:o=360,align:c="start",zIndex:u=200,children:d}){let m=(0,l.usePaneContainer)(),[p,f]=(0,n.useState)(null);if((0,n.useLayoutEffect)(()=>{if(!e)return void f(null);let t=()=>{let e,t=s?{top:s.top,left:s.left,right:s.right??s.left+(s.width??0),bottom:s.bottom??s.top+(s.height??0)}:(()=>{let e=a?.current;if(!e)return null;let t=e.getBoundingClientRect();
1return{top:t.top,left:t.left,right:t.right,bottom:t.bottom}})();if(!t)return void f(null);let n=m?(0,l.findScaledFrame)(m):null;if(n){let e=n.scale,r=(t.top-n.rect.top)/e,l=(t.bottom-n.rect.top)/e,a=(t.left-n.rect.left)/e,s=(t.right-n.rect.left)/e,u=r-8,d=n.height-l-8,m=d>=i,p=u>=i,h=!m&&(!!p||u>d),x=Math.max(80,h?u:d),g={left:0,contained:!0};h?g.bottom=n.height-r+8:g.top=l+8,g.maxHeight=Math.min(i,x);let y="end"===c?s-o:a;g.left=y=Math.min(Math.max(8,y),Math.max(8,n.width-o-8)),f(g);return}let r=window.innerHeight,u=window.innerWidth,d=t.top-8,p=r-t.bottom-8,h=d>=i,x=Math.max(80,(e=!(p>=i)&&(!!h||d>p))?d:p),g={left:0};e?g.bottom=r-t.top+8:g.top=t.bottom+8,g.maxHeight=Math.min(i,x);let y="end"===c?t.right-o:t.left,b=Math.max(8,u-o-8);y<8&&(y=8),y>b&&(y=b),g.left=y,f(g)};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[e,a,i,o,c,m,s?.top,s?.left,s?.height]),!e||!p)return null;let h={zIndex:u,left:p.left,top:p.top,bottom:p.bottom,maxHeight:p.maxHeight};return p.contained&&m?(0,r.createPortal)((0,t.jsx)("div",{className:"absolute overflow-y-auto",style:h,children:d}),m):(0,t.jsx)("div",{className:"fixed overflow-y-auto",style:h,children:d})}function e5({anchorRef:e,onSelect:l,onClose:a}){let[s,i]=(0,n.useState)(null);return((0,n.useLayoutEffect)(()=>{let t=()=>{let t=window.innerWidth,n=window.innerHeight,r=e.current?.getBoundingClientRect(),l=r?r.top:n/2,a=r?r.left+r.width/2:t/2,s=Math.max(16,Math.min(t-360-16,a-180)),o=l-8-16,c=n-(r?r.bottom:n/2)-8-16,u=o>=280||o>=c,d=Math.min(440,u?o:c);i({left:s,top:u?l-8-d:(r?r.bottom:n/2)+8,maxHeight:Math.max(220,d)})};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[e]),!s||"u"<typeof document)?null:(0,r.createPortal)((0,t.jsx)("div",{"data-composer-overlay":!0,className:"fixed z-[200]",style:{left:s.left,top:s.top,width:360,maxHeight:s.maxHeight},children:(0,t.jsx)(T.GiphyPicker,{onSelect:l,onClose:a})}),document.body)}e.s(["ChatInputBox",0,function({placeholder:e="Write a message...",onSubmit:l,disabled:C=!1,sending:R=!1,text:$="",onTextChange:q,onTyping:O,mergeVars:H,useRichEditor:B=!1,html:z="",onHtmlChange:V,onAddAttachments:W,resetKey:G=0,draftKey:K,showVoice:X=!1,onVoiceNote:Y,showVideo:J=!1,onVideoNote:Z,replyTo:Q,onCancelReply:ee,contextChips:et,attachments:en=[],onRemoveAttachment:el,onReplaceAttachment:ea,onDropFiles:eu,extraActions:ed,trailingActions:em,rightExtras:ep,onScheduleSend:ef,showStop:ey=!1,onStop:eb,undoActive:ew=!1,undoProgress:ev=0,hideSendSpinner:ek=!1,dictating:eC=!1,onUndo:eN,rows:e_=2,wrapperClassName:eS,autoFocus:eT=!1,mentionPlatforms:eM,inlineMentionChips:eE=!1,mentions:eD=[],onMentionsChange:eI,memberMentionSearch:eR,slashCommands:eA,onSlashItemPicked:eP,handleRef:eU}){let[eL,eq]=(0,n.useState)(!1),eO=(0,n.useRef)(0),eH=(0,n.useRef)(null),eB=(0,n.useRef)(null),ez=(0,n.useRef)(null),e3=(0,n.useRef)(null),e4=(0,n.useRef)(null),e8=(0,n.useRef)(null),[e6,e7]=(0,n.useState)(!1),[e9]=(0,n.useState)(G),te=K&&G===e9?A(K):null,tt=!!B&&!!z&&(!!/<(img|video|audio|iframe|source)\b/i.test(z)||z.replace(/<[^>]*>/g,"").replace(/ | /gi," ").replace(/[\u200B-\u200D\uFEFF]/g,"").trim().length>0);(0,n.useEffect)(()=>{te&&(B?tt||V?.(te):$.trim()||q?.(te))},[]);let tn=(0,n.useRef)(!0);(0,n.useEffect)(()=>{if(!K)return;let e=B?tt?z:"":$;(!tn.current||(tn.current=!1,e.trim()))&&P(K,e)},[K,B,tt,z,$]);let tr=(0,ex.useFollowUpTarget)(),tl=(0,n.useRef)(null),ta=(0,E.useIsMobile)(),[ts,ti]=(0,n.useState)(!1);(0,n.useEffect)(()=>{ti("ontouchstart"in window||navigator.maxTouchPoints>0)},[]);let to=(0,N.useChatSlashMenu)({textareaRef:eH,extraItems:eA}),tc=!B&&!!eM?.length,[tu,td]=(0,n.useState)(null),tm=(0,n.useRef)(null),tp=(0,n.useRef)(null),[tf,th]=(0,n.useState)(null),tx=tc&&!!tu,tg=!!eA?.length&&eE&&!B,[ty,tb]=(0,n.useState)(null),tw=tg&&!!ty,tv=(0,n.useCallback)(()=>tb(null),[]),tk=(0,n.useCallback)(()=>{B?e8.current?.focus():eE&&tc?tp.current?.focus():eH.current?.focus()},[B,eE,tc]);(0,n.useEffect)(()=>
1{if(eU)return eU.current={focus:tk},()=>{eU.current=null}},[eU,tk]);let tj=(0,n.useCallback)(e=>{let t=(ty?.query.length??0)+1,n=tp.current;e.chipToken?n?.insertChip({token:e.chipToken,name:e.label,mark:e.chipMark??"/",markColor:e.chipColor??null,chipKind:e.itemType},t):n?.insertText(e.body,t),tb(null),eP?.(e)},[ty,eP]),tC=(0,n.useCallback)((e,t)=>{tc&&td(eZ(e,t))},[tc]),tN=(0,n.useCallback)(e=>{if(eE){if(tf){tp.current?.replaceMention(tf,e),eI?.([...eD.filter(e=>e.token!==tf),e]),th(null),td(null);return}let t=(tu?.query.length??0)+1;tp.current?.insertMention(e,t),eI?.([...eD,e]),td(null);return}let t=eH.current;if(!t||!tu)return;let n=t.selectionStart??$.length,r=$.slice(0,tu.startIndex),l=$.slice(n),a=`${e.token} `,s=(r+a).length;q?.(r+a+l),eI?.([...eD,e]),td(null),requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(s,s)})},[eE,tf,tu,$,eD,q,eI]),t_=(0,n.useCallback)(e=>{let t=eD[e];if(!t)return;let n=$.indexOf(t.token);if(n>=0){let e=n+t.token.length,r=" "===$[e]?e+1:e;q?.($.slice(0,n)+$.slice(r))}eI?.(eD.filter((t,
1n)=>n!==e))},[eD,$,q,eI]),tS=(0,n.useRef)(null),[tT,tM]=(0,n.useState)(null),tE=to.showMenu||to.showEmojiPicker||to.showGifPicker||tx||tw,tD=(0,n.useCallback)(()=>{if(tf)return;if(eE){let e=window.getSelection();if(!e||0===e.rangeCount)return;let t=e.getRangeAt(0).cloneRange();t.collapse(!0);let n=t.getClientRects()[0]??null;if(!n){let e=document.createElement("span");e.appendChild(document.createTextNode("â")),t.insertNode(e),n=e.getBoundingClientRect(),e.remove()}n&&tM({top:n.top,left:n.left,height:n.height||20});return}let e=eH.current;if(!e)return;let t=e.selectionStart??0,n=(0,N.getCaretCoordinates)(e,t),r=e.getBoundingClientRect(),l=parseFloat(window.getComputedStyle(e).lineHeight)||20;tM({top:r.top+n.top,left:r.left+n.left,height:l})},[eE,tf]);(0,n.useLayoutEffect)(()=>{if(!tE)return void tM(null);tD();let e=()=>tD();return window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[tE,tD,$]);let[tI,tR]=(0,n.useState)(!1),[tA,tP]=(0,n.useState)(0),tU=(0,n.useRef)(null),t$=(0,n.useRef)([]),tF=(0,n.useRef)(null),tL=(0,n.useRef)(0);(0,n.useEffect)(()=>(tI?(tL.current=Date.now(),tP(0),tF.current=setInterval(()=>{tP(Date.now()-tL.current)},200)):tF.current&&(clearInterval(tF.current),tF.current=null),()=>{tF.current&&clearInterval(tF.current)}),[tI]);let tq=(0,n.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",n=new MediaRecorder(e,{mimeType:t});t$.current=[],n.ondataavailable=e=>{e.data.size>0&&t$.current.push(e.data)},n.onstop=()=>{e.getTracks().forEach(e=>e.stop());let n=new Blob(t$.current,{type:t}),r=Date.now()-tL.current;n.size>0&&Y?.(n,r),t$.current=[]},n.start(250),tU.current=n,tR(!0)}catch{}},[Y]),tO=(0,n.useCallback)(()=>{let e=tU.current;e&&"inactive"!==e.state&&e.stop(),tU.current=null,tR(!1)},[]),tH=(0,n.useCallback)(()=>{let e=tU.current;e&&"inactive"!==e.state&&(e.onstop=()=>{e.stream.getTracks().forEach(e=>e.stop())},e.stop()),tU.current=null,t$.current=[],tR(!1)},[]),[tB,tz]=(0,n.useState)(null),[tV,tW]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(eu||B)&&(0,T.prefetchTrending)().catch(()=>{})},[eu,B]);let tG=(0,n.useCallback)(()=>{tW(e=>(e||(0,T.prefetchMemes)().catch(()=>{}),!e))},[]),tK=(0,n.useCallback)(async e=>{if(tW(!1),B){e8.current?.insertImage(e.full),requestAnimationFrame(()=>e8.current?.focus());return}if(eu)try{let t=await fetch(e.full);
1if(!t.ok)return;let n=await t.blob(),r=(e.title||"gif").replace(/[^a-z0-9]+/gi,"-").slice(0,40)||"gif",l=new File([n],`${r}-${e.id}.gif`,{type:n.type||"image/gif"}),a=new DataTransfer;a.items.add(l),eu(a.files)}catch{}},[B,eu]),{videoRecording:tX,videoRecordingMs:tY,videoMode:tJ,videoPaused:tZ,showVideoModeMenu:tQ,cameraPreviewStream:t0,recordingLayout:t1,studioBg:t2,cameraAspectRatio:t5,setShowVideoModeMenu:t3,setRecordingLayout:t4,setStudioBg:t8,setStudioBgImage:t6,setCameraAspectRatio:t7,startVideoRecording:t9,stopVideoRecording:ne,cancelVideoRecording:nt,pauseResumeVideo:nn,restartVideoRecording:nr,cameraPreviewCallbackRef:nl}=(0,v.useVideoRecorder)({onVideoNote:Z}),na=(0,n.useCallback)(e=>{let t=e.target.files?.[0];if(!t||!Z)return;t3(!1);let n=t.type.startsWith("video/")?t.type.split(";")[0].trim():"video/mp4",r=document.createElement("video");r.preload="metadata";let l=URL.createObjectURL(t);r.onloadedmetadata=()=>{let e=Math.round(1e3*(r.duration||0));URL.revokeObjectURL(l),Z(new Blob([t],{type:n}),e)},r.onerror=()=>{URL.revokeObjectURL(l),Z(new Blob([t],{type:n}),0)},r.src=l,e.target.value=""},[Z,t3]),ns=B?tt||en.length>0:$.trim().length>0||en.length>0,ni=(0,n.useCallback)((e,t)=>{let n=en.find(t=>t.id===e);if(!n||!n.file.type.startsWith("image/"))return;let r=new FileReader;r.onload=()=>{"string"==typeof r.result&&(e8.current?.insertImageAt(r.result,t),el?.(e),requestAnimationFrame(()=>e8.current?.focus()))},r.readAsDataURL(n.file)},[en,el]),no=(0,n.useRef)(null),nc=(0,n.useCallback)((e,t)=>{if(!B||!t.file.type.startsWith("image/"))return;let n=e.touches[0];n&&(no.current={attachmentId:t.id,previewUrl:t.preview??null,startX:n.clientX,startY:n.clientY,dragging:!1,clone:null})},[B]),nu=(0,n.useCallback)(e=>{let t=no.current;if(no.current=null,!t||(t.clone&&t.clone.remove(),!t.dragging))return;let n=e.changedTouches[0];if(!n)return;let r=e8.current?.posFromClientCoords(n.clientX,n.clientY);null!=r&&ni(t.attachmentId,r)},[ni]);(0,n.useEffect)(()=>{if(!B)return;let e=e=>{let t=no.current;if(!t)return;let n=e.touches[0];if(n){if(!t.dragging){let e=Math.abs(n.clientX-t.startX),r=Math.abs(n.clientY-t.startY);if(r>8&&r>e){t.dragging=!0;let e=document.createElement("div");if(e.style.position="fixed",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.transform="translate(-50%, -50%)",e.style.opacity="0.9",e.style.left=`${n.clientX}px`,e.style.top=`${n.clientY}px`,t.previewUrl){let n=document.createElement("img");n.src=t.previewUrl,n.style.width="64px",n.style.height="64px",n.style.borderRadius="12px",n.style.objectFit="cover",n.style.boxShadow="0 8px 24px rgba(0,0,0,0.35)",e.appendChild(n)}document.body.appendChild(e),t.clone=e}}t.dragging&&(e.preventDefault(),t.clone&&(t.clone.style.left=`${n.clientX}px`,t.clone.style.top=`${n.clientY}px`))}},t=()=>{let e=no.current;no.current=null,e?.clone&&e.clone.remove()};return document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchcancel",t),()=>{document.removeEventListener("touchmove",e),document.removeEventListener("touchcancel",t)}},[B]),(0,n.useEffect)(()=>{Q&&eH.current&&eH.current.focus()},[Q]);let nd=(0,n.useCallback)(()=>{let e=eH.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`,e.style.overflowY=e.scrollHeight>e.clientHeight?"auto":"hidden")},[]);(0,n.useEffect)(()=>{nd()},[$,nd]),(0,n.useEffect)(()=>{if(B||!H||!q||!$.includes("{{"))return;let e=F($,$.length,H);e.text!==$&&q(e.text)},[$,H,q,B]);let nm=(0,n.useCallback)(()=>{ns&&!C&&(e7(!0),U(K),Promise.resolve(l()).then(()=>tl.current?.commit()).catch(()=>{}),requestAnimationFrame(tk))},[l,ns,C,tk,K]);(0,n.useEffect)(()=>{if(C||!e6)return;let e=requestAnimationFrame(()=>{tk(),e7(!1)});return()=>cancelAnimationFrame(e)},[C,e6,tk]);let[np,nf]=(0,n.useState)(!1),[nh,nx]=(0,n.useState)(""),[ng,ny]=(0,n.useState)(""),[nb,nw]=(0,n.useState)("AM"),[nv,nk]=(0,n.useState)(""),nj=(0,n.useRef)(null),nC=(0,n.useRef)(null),nN=(0,n.useCallback)(()=>{if(!ef||!ns)return;let e=new Date().getHours()+1;e>23&&(e=0);let t=e>=12?"PM":"AM";nx((0===e?12:e>12?e-12:e).toString()),ny("00"),nw(t),nk(""),nf(!0),requestAnimationFrame(()=>nj.current?.focus())},[ef,ns]),n_=(0,n.useCallback)(()=>
1{if(!ef)return;let e=parseInt(nh),t=parseInt(ng);if(isNaN(e)||isNaN(t)||e<1||e>12||t<0||t>59)return void nk("Invalid time");let n="AM"===nb?12===e?0:e:12===e?12:e+12,r=(0,eX.setSeconds)((0,eK.setMinutes)((0,eG.setHours)(new Date,n),t),0);(0,ej.isBefore)(r,new Date)&&(r=(0,eX.setSeconds)((0,eK.setMinutes)((0,eG.setHours)((0,eY.addDays)(new Date,1),n),t),0)),nf(!1),ef(r),requestAnimationFrame(()=>eH.current?.focus())},[nh,ng,nb,ef]),nS=(0,n.useCallback)(e=>{tx&&["ArrowDown","ArrowUp","Enter","Tab","Escape"].includes(e.key)&&tm.current?.handleKeyDown(e.key)?e.preventDefault():to.showMenu&&("ArrowDown"===e.key||"ArrowUp"===e.key||"Enter"===e.key||"Escape"===e.key)||to.showEmojiPicker&&"Escape"===e.key||(!to.showGifPicker||"Escape"!==e.key)&&("Enter"!==e.key||e.shiftKey||e.metaKey||e.ctrlKey||ta||(e.preventDefault(),ns&&!C&&nm()),"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&ef&&(e.preventDefault(),nN()),"Escape"===e.key&&Q&&ee?.())},[nm,ns,C,Q,ee,ef,nN,to.showMenu,to.showEmojiPicker,to.closeEmojiPicker,ta,tx]),nT=(0,eg.useAttachShortcut)(eu?()=>eB.current?.click():null),nM=(0,n.useCallback)(e=>{eu&&(e.preventDefault(),e.stopPropagation(),eO.current++,e.dataTransfer.types.includes("Files")&&eq(!0))},[eu]),nE=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eO.current--,eO.current<=0&&(eO.current=0,eq(!1))},[]),nD=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),nI=(0,n.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),eO.current=0,eq(!1),eu){if(e.dataTransfer.files.length>0)return void eu(e.dataTransfer.files);(0,j.filesFromRecentDrag)(e.dataTransfer).then(e=>{e?.length&&eu(e)})}},[eu]),nR=(0,n.useCallback)(e=>{if(!eu)return;let t=function(e){if(!e)return[];let t=[];for(let n of e.items?Array.from(e.items):[]){if("file"!==n.kind)continue;let e=eQ(n.getAsFile(),n.type);e&&t.push(e)}if(0===t.length&&e.files?.length)for(let n of Array.from(e.files)){let e=eQ(n,n.type);e&&t.push(e)}return t}(e.clipboardData);0!==t.length&&(e.preventDefault(),eu(function(e){let t=new DataTransfer;for(let n of e)t.items.add(n);return t.files}(t)))},[eu]);return(0,t.jsxs)("div",{"data-swipe-down-origin":!0,onKeyDownCapture:nT,children:[(0,t.jsx)("svg",{className:"absolute w-0 h-0","aria-hidden":!0,children:(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"squircle-clip",clipPathUnits:"objectBoundingBox",children:(0,t.jsx)("path",{d:"M0.5,0 C0.648,0 0.742,0 0.82,0.025 C0.898,0.05 0.95,0.102 0.975,0.18 C1,0.258 1,0.352 1,0.5 C1,0.648 1,0.742 0.975,0.82 C0.95,0.898 0.898,0.95 0.82,0.975 C0.742,1 0.648,1 0.5,1 C0.352,1 0.258,1 0.18,0.975 C0.102,0.95 0.05,0.898 0.025,0.82 C0,0.742 0,0.648 0,0.5 C0,0.352 0,0.258 0.025,0.18 C0.05,0.102 0.102,0.05 0.18,0.025 C0.258,0 0.352,0 0.5,0 Z"})})})}),Q&&(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-3 py-2 mb-1.5 rounded-t-xl oat-surface bg-[#FAF9F5] dark:bg-black border border-b-0 border-card-border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{Q.messageId&&(0,I.jumpToThreadMessage)(Q.messageId)},className:(0,D.cn)("flex flex-1 min-w-0 items-center gap-2.5 text-left rounded-lg -m-1 p-1 transition-colors",Q.messageId?"cursor-pointer hover:bg-black/[0.04] dark:hover:bg-white/[0.06]":"cursor-default"),children:[Q.mediaUrl&&(0,t.jsxs)("div",{className:"relative shrink-0 h-9 w-9 bg-muted",style:{clipPath:"url(#squircle-clip)"},children:[(0,t.jsx)("img",{src:Q.mediaUrl,alt:"",className:"h-full w-full object-cover",referrerPolicy:"no-referrer"}),"video"===Q.mediaType&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:(0,t.jsx)(f.Play,{className:"h-3 w-3 text-white fill-white"})})]}),!Q.mediaUrl&&"video"===Q.mediaType&&(0,t.jsx)("div",{className:"relative shrink-0 h-9 w-9 bg-muted flex items-center justify-center",style:{clipPath:"url(#squircle-clip)"},children:(0,t.jsx)(x.Film,{className:"h-4 w-4 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("p",{className:"text-[10px] font-medium text-primary",children:["Replying to ",Q.name]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground truncate",children:Q.text||("gif"===Q.mediaType?"GIF":"video"===Q.mediaType?"Video":"image"===Q.mediaType?"Image":"")}),Q.note&&(0,t.jsx)("p",{className:"text-[10px] leading-snug text-muted-foreground",children:Q.note})]})]}),(0,t.jsx)("button",{type:"button",onClick:ee,className:"shrink-0 text-muted-foreground hover:text-foreground",children:(0,t.jsx)(o.X,{className:"h-3.5 w-3.5"})})]}),np&&!Q&&(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-3.5 py-2 mb-1.5 rounded-t-xl rounded-b-none border border-b-0 oat-surface bg-[#FAF9F5] dark:bg-black border-card-border",children:[(0,t.jsx)(h.Clock,{className:"h-3.5 w-3.5 text-amber-500 shrink-0"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0",children:"Send at"}),(0,t.jsxs)("div",{className:"flex items-center gap-0 rounded-md border border-border/80 bg-white dark:bg-background px-2 py-1",children:[(0,t.jsx)("input",{ref:nj,type:"text",inputMode:"numeric",maxLength:2,value:nh,onChange:e=>{let t=e.target.value.replace(/\D/g,"").slice(0,2);nx(t),nk(""),2===t.length&&nC.current?.focus()},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),n_()),"Escape"===e.key&&(e.preventDefault(),nf(!1),eH.current?.focus()),"ArrowRight"===e.key&&(e.currentTarget.selectionStart??0)>=nh.length&&(e.preventDefault(),nC.current?.focus())},onFocus:e=>e.target.select(),className:"w-[1.1rem] bg-transparent text-xs font-medium text-foreground text-center focus:outline-none",placeholder:"5"}
1),(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60",children:":"}),(0,t.jsx)("input",{ref:nC,type:"text",inputMode:"numeric",maxLength:2,value:ng,onChange:e=>{ny(e.target.value.replace(/\D/g,"").slice(0,2)),nk("")},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),n_()),"Escape"===e.key&&(e.preventDefault(),nf(!1),eH.current?.focus()),"Backspace"!==e.key||ng||(e.preventDefault(),nj.current?.focus()),"ArrowLeft"===e.key&&(e.currentTarget.selectionStart??0)===0&&(e.preventDefault(),nj.current?.focus())},onFocus:e=>e.target.select(),className:"w-[1.1rem] bg-transparent text-xs font-medium text-foreground text-center focus:outline-none",placeholder:"00"}),(0,t.jsx)("button",{type:"button",onClick:()=>nw(e=>"AM"===e?"PM":"AM"),className:"ml-1 text-[10px] font-semibold text-muted-foreground hover:text-foreground transition-colors",children:nb})]}),nv&&(0,t.jsx)("span",{className:"text-[10px] text-destructive",children:nv}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("button",{type:"button",onClick:n_,className:"inline-flex items-center gap-1 rounded-md bg-foreground text-background px-2.5 py-1 text-[11px] font-medium hover:bg-foreground
1/90 transition-colors",children:["Schedule",(0,t.jsx)("kbd",{className:"text-[9px] opacity-60",children:"âµ"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{nf(!1),eH.current?.focus()},className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(o.X,{className:"h-3 w-3"})})]}),(0,t.jsxs)("div",{"data-composer":!0,className:`oat-surface rounded-2xl border bg-[#FAF9F5] dark:bg-black transition-all ${eL?"ring-2 ring-primary/30":"border-card-border"} ${Q||np?"rounded-t-none border-t-0":""} ${eS??""}`,onDragEnter:nM,onDragLeave:nE,onDragOver:nD,onDrop:nI,children:[et&&(0,t.jsx)("div",{className:"px-3 pt-2.5 flex flex-wrap items-center gap-1.5",children:et}),en.length>0&&(0,t.jsx)("div",{className:"px-3 pt-2.5 flex gap-1.5 overflow-x-auto scrollbar-thin",children:en.map(e=>{let n=e.file.type.startsWith("image/"),r=e.file.type.startsWith("video/"),l=e.file.type.startsWith("audio/");return(0,t.jsxs)("div",{className:"relative shrink-0 group",draggable:B&&n,onDragStart:t=>{B&&n&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData(w.INLINE_ATTACHMENT_DRAG_TYPE,e.id))},onTouchStart:t=>nc(t,e),onTouchEnd:nu,style:B&&n?{touchAction:"pan-x"}:void 0,title:B&&n?"Drag into the email to insert inline":void 0,children:[l?(0,t.jsx)(eV,{file:e.file}):(0,t.jsx)("button",{type:"button",className:`block focus:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded-lg ${B&&n?"cursor-grab active:cursor-grabbing":""}`,onClick:()=>{(n||r)&&tz({url:r?URL.createObjectURL(e.file):e.preview||URL.createObjectURL(e.file),type:r?"video":"image",name:e.file.name,attachmentId:e.id,file:e.file})},children:e.preview?(0,t.jsxs)("div",{className:"relative cursor-pointer",children:[(0,t.jsx)("img",{src:e.preview,alt:"",className:"h-12 w-12 object-cover squircle"}),r&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"h-5 w-5 rounded-full bg-black/50 flex items-center justify-center",children:(0,t.jsx)(f.Play,{className:"h-2.5 w-2.5 text-white ml-0.5"})})})]}):(0,t.jsx)("div",{className:"h-12 w-12 p-px bg-border squircle",children:(0,t.jsx)("div",{className:"h-full w-full bg-card dark:bg-card flex items-center justify-center cursor-pointer squircle",children:r?(0,t.jsx)(f.Play,{className:"h-5 w-5 text-muted-foreground"}):(0,y.isSheetsFile)(e.file.type,e.file.name)||(0,y.isDocsFile)(e.file.type,e.file.name)?(0,t.jsx)(y.GoogleFileTypeIcon,{mimeType:e.file.type,filename:e.file.name,className:"h-7 w-7"}):(0,b.isPdfFile)(e.file.type,e.file.name)?(0,t.jsx)(b.PdfIcon,{className:"h-7 w-7"}):(0,t.jsx)(c.FileText,{className:"h-5 w-5 text-muted-foreground"})})})}),"number"==typeof e.progress&&e.progress<1&&(0,t.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-1 overflow-hidden rounded-b-lg bg-black/40",children:(0,t.jsx)("div",{className:"h-full bg-white transition-[width] duration-150",style:{width:`${Math.round(100*Math.max(0,Math.min(1,e.progress)))}%`}})}),(0,t.jsxs)("div",{className:"absolute -top-1 -right-1 flex items-center gap-0.5",children:[B&&n&&(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button","aria-label":"Insert inline",onClick:()=>{let t=new FileReader;t.onload=()=>{let n=t.result;"string"==typeof n&&(e8.current?.insertImage(n),el?.(e.id))},t.readAsDataURL(e.file)},className:"hidden md:flex h-4 w-4 rounded-full bg-muted border border-border opacity-0 group-hover:opacity-100 transition-opacity items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted",children:(0,t.jsx)(p.ArrowDownToLine,{className:"h-2.5 w-2.5"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Insert inline"})]}),(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button","aria-label":"Remove attachment",onClick:()=>el?.(e.id),className:"h-5 w-5 md:h-4 md:w-4 rounded-full bg-muted border border-border flex items-center justify-center text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors opacity-100 md:opacity-0 md:group-hover:opacity-100",children:(0,t.jsx)(o.X,{className:"h-3 w-3 md:h-2.5 md:w-2.5"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Remove"})]})]})]},e.id)})}),(0,t.jsx)("div",{"data-composer-body":!0,className:"relative px-3.5 py-3.5",children:B?(0,t.jsx)(w.ComposeEditor,{ref:e8,autoF
1ocus:eT,placeholder:e,initialContent:te&&!tt?te:z,onHtmlChange:e=>V?.(e),onInlineAttachmentDrop:ni,onAddAttachments:e=>{if(W)W(e);else if(eu){let t=new DataTransfer;e.forEach(e=>t.items.add(e)),eu(t.files)}},onEnterSubmit:ns&&!C?nm:void 0,compact:!0,showToolbar:!1},G):(0,t.jsxs)(t.Fragment,{children:[eE&&tc?(0,t.jsx)(eh,{handleRef:tp,text:$,placeholder:e,disabled:C,className:"max-h-[200px] overflow-y-auto text-base leading-[28px] md:max-h-[40vh] md:text-sm",onTextChange:e=>{if(q?.(e),eI&&eD.length){let t=(0,eo.pruneMentions)(e,eD);t.length!==eD.length&&eI(t)}},onCaret:(e,t)=>{!tf&&(td(eZ(e,t)),tg&&tb(function(e,t){let n=-1;for(let r=t-1;r>=0;r--){let t=e[r];if("/"===t){let t=0===r?" ":e[r-1];/\s/.test(t)&&(n=r);break}if(/\s/.test(t))break}if(n<0)return null;let r=e.slice(n+1,t);return/[\n\r]/.test(r)?null:{startIndex:n,query:r}}(e,t)))},onPaste:nR,onChipClick:(e,t)=>{th(e),tM({top:t.top,left:t.left,height:t.height}),td({startIndex:0,query:""})},onKeyDown:e=>{tx&&["ArrowDown","ArrowUp","Enter","Tab","Escape"].includes(e.key)&&tm.current?.handleKeyDown(e.key)||tw&&["ArrowDown","ArrowUp","Enter","Tab","Escape"].includes(e.key)?e.preventDefault():"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ns&&!C&&nm())}}):(0,t.jsx)("textarea",{ref:eH,value:$,onChange:e=>{let t=e.target.value,n=e.target.selectionStart??t.length;if(O?.(),tc&&eI&&eD.length){let e=(0,eo.pruneMentions)(t,eD);e.length!==eD.length&&eI(e)}if(H){let e=F(t,n,H);if(e.text!==t){q?.(e.text),to.handleTextChange(e.text,e.caret),tC(e.text,e.caret),requestAnimationFrame(()=>{eH.current?.setSelectionRange(e.caret,e.caret)});return}}q?.(t),to.handleTextChange(t,n),tC(t,n)},onSelect:e=>{if(!tc)return;let t=e.currentTarget;tC(t.value,t.selectionStart??t.value.length)},onKeyDown:nS,onInput:nd,onPaste:nR,placeholder:e,disabled:C&&!e6,readOnly:C&&e6,rows:e_,autoFocus:eT,className:"w-full resize-none bg-transparent text-base md:text-sm outline-none placeholder:text-muted-foreground disabled:opacity-50 leading-relaxed overflow-hidden max-h-[200px] md:max-h-[40vh]"}),(0,t.jsxs)(L.Popover,{open:tx,onOpenChange:e=>{e||(td(null),th(null))},children:[(0,t.jsx)(L.PopoverAnchor,{asChild:!0,children:(0,t.jsx)("span",{ref:tS,"aria-hidden":!0,className:"fixed pointer-events-none",style:tT?{top:tT.top,left:tT.left,width:0,height:tT.height}:{top:0,left:0,width:0,height:0}})}),(0,t.jsx)(L.PopoverContent,{align:"start",side:"top",sideOffset:8,className:"w-80 p-0",onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),children:tu&&(0,t.jsx)(ei,{ref:tm,query:tu.query,platforms:eM,memberSearch:eR,onSelect:tN,onClose:()=>td(null)})})]}),tw&&eA&&(0,t.jsx)(_.ChatSlashMenu,{position:{top:tT?.top??0,left:tT?.left??0},anchorRef:tS,query:ty?.query??"",items:eA,onSelect:tj,onClose:tv,onDismissFromEmptyBackspace:tv}),to.showMenu&&to.menuItems.length>0&&(0,t.jsx)(_.ChatSlashMenu,{position:{top:tT?.top??to.menuPosition.top,left:tT?.left??to.menuPosition.left},anchorRef:tS,query:to.menuQuery,items:to.menuItems,onSearchChange:to.handleMenuSearchChange,onSelect:e=>{let t=to.handleSelect(e,$),n=H?F(t.newText,t.newCursorPos,H):{text:t.newText,caret:t.newCursorPos};q?.(n.text),requestAnimationFrame(()=>{eH.current?.focus(),eH.current?.setSelectionRange(n.caret,n.caret)})},onClose:to.closeMenu,onDismissFromEmptyBackspace:()=>{let{newText:e,newCursorPos:t}=to.dismissSlashAndRemoveTrigger($);q?.(e),requestAnimationFrame(()=>{eH.current?.focus(),eH.current?.setSelectionRange(t,t)})}}),to.showEmojiPicker&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[199]",onClick:()=>{to.closeEmojiPicker(),requestAnimationFrame(()=>eH.current?.focus())}}),(0,t.jsx)(e2,{open:to.showEmojiPicker,virtualRect:tT,estimatedHeight:360,estimatedWidth:320,children:(0,t.jsx)(S.EmojiPicker,{onSelect:e=>{let{newText:t,newCursorPos:n}=to.handleEmojiSelect(e,$);q?.(t),requestAnimationFrame(()=>{eH.current?.focus(),eH.current?.setSelectionRange(n,n)})},onClose:()=>{to.closeEmojiPicker(),requestAnimationFrame(()=>eH.current?.focus())},onDismissFromEmptyBackspace:()=>{let{newText:e,newCursorPos:t}=to.dismissEmojiAndRemoveTrigger($);q?.(e),requestAnimationFrame(()=>{eH.current?.focus(),eH.current?.setSelectionRange(t,t)})},autoFocusSearch:!1})})]}),to.showGifPicker&&(eu||B)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[199]",onClick:()=>{to.closeGifPicker(),requestAnimationFrame(()=>eH.current?.focus())}}),ta?(0,t.jsx)("div",{className:"fixed bottom-20 left-1/2 z-[200]",style:{transform:"translateX(-50%) scale(min(1, calc((100vw - 24px) / 360)))",transformOrigin:"bottom center"},children:(0,t.jsx)(T.GiphyPicker,{externalQuery:to.gifQuery,focusSearchOnMount:!1,onSelect:e=>{let{newText:t,newCursorPos:n}=to.handleGifTriggerRemove($);q?.(t),requestAnimationFrame(()=>{eH.current?.focus(),eH.current?.setSelectionRange(n,n)}),tK(e)},onClose:()=>{to.closeGifPicker(),requestAnimationFrame(()=>eH.current?.focus())}})}):(0,t.jsx)(e2,{open:to.showGifPicker,virtualRect:tT,estimatedHeight:480,estimatedWidth:360,children:(0,t.jsx)(T.GiphyPicker,{externalQuery:to.gifQuery,focusSearchOnMount:!1,onSelect:e=>{let{newText:t,newCursorPos:n}=to.handleGifTriggerRemove($);q?.(t),requestAnimationFrame(()=>{eH.current?.focus(),eH.current?.setSelectionRange(n,n)}),tK(e)},onClose:()=>{to.closeGifPicker(),requestAnimationFrame(()=>eH.current?.focus())}})})]})]})}),tc&&!eE&&eD.length>0&&(0,t.jsx)("div",{className:"px-3.5 pb-1 flex flex-wrap gap-1.5",children:eD.map((e,n)=>(0,t.jsxs)("span",{className:(0,ec.pillClass)(),children:[(0,t.jsx)(er,{mention:e,size:"sm"}),(0,t.jsx)("span",{className:"max-w-[120px] truncate",children:e.name}),(0,t.jsx)(es,{platform:e.platform}),(0,t.jsx)("button",{type:"button","aria-label":`Remove mention of ${e.name}`,onClick:()=>t_(n),className:"-mr-1 ml-0.5 shrink-0 rounded-full p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:(0,t.jsx)(o.X,{className:"h-3 w-3"})})]},`${e.id}-${n}`))}),(0,t.jsxs)("div",{"data-composer-toolbar":!0,className:"flex items-center justify-between gap-2 px-3.5 py-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-0.5",children:[ed,eu&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:eB,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&eu(e.target.files),e.target.value=""}}),(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>eB.current?.click(),className:"h-7 w-7 flex items-center justify-center rounded-lg [corner-shape:squircle] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:(0,t.jsx)(d.Paperclip,{className:"h-4 w-4"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Attach file (ââ§U)"})]})]}),(eu||B)&&(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{ref:e3,type:"button",onClick:tG,className:"h-7 w-7 flex items-center justify-center rounded-lg [corner-shape:squircle] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:(0,t.jsx)(a.GifIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Send a GIF"})]}),tV&&(0,t.jsxs)(t.Fragment,{children:["u">typeof document&&(0,r.createPortal)((0,t.jsx)("div",{className:"fixed inset-0 z-[199]",onClick:()=>tW(!1)}),document.body),ta?(0,t.jsx)("div",{className:"fixed bottom-20 left-1/2 z-[200]",style:{transform:"translateX(-50%) scale(min(1, calc((100vw - 24px) / 360)))",transformOrigin:"bottom center"},children:(0,t.jsx)(T.GiphyPicker,{onSelect:tK,onClose:()=>tW(!1)})}
1):(0,t.jsx)(e5,{anchorRef:e3,onSelect:tK,onClose:()=>tW(!1)})]})]}),em,X&&Y&&!tI&&!tX&&(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:tq,className:"h-7 w-7 flex items-center justify-center rounded-lg [corner-shape:squircle] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:(0,t.jsx)(e1,{className:"h-4 w-4"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Voice note"})]}),J&&Z&&!tI&&!tX&&(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("button",{ref:e4,type:"button",onClick:()=>{ts?ez.current?.click():t3(!tQ)},className:"h-7 w-7 flex items-center justify-center rounded-lg [corner-shape:squircle] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:(0,t.jsx)(s.VideoNoteIcon,{className:"h-4 w-4"})}),tQ&&!ts&&(0,t.jsx)(e2,{open:tQ,triggerRef:e4,estimatedHeight:224,estimatedWidth:208,zIndex:50,children:(0,t.jsxs)("div",{className:"w-52 bg-popover border border-border rounded-lg shadow-md p-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>t9("screen_camera"),className:"w-full px-2 py-2 text-left text-sm rounded-md [corner-shape:squircle] hover:bg-muted flex items-center gap-2 transition-colors",children:[(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:"h-4 w-4 text-muted-foreground",children:[(0,t.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,t.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,t.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium",children:"Screen + Camera"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Record screen with camera overlay"})]})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>t9("screen_only"),className:"w-full px-2 py-2 text-left text-sm rounded-md [corner-shape:squircle] hover:bg-muted flex items-center gap-2 transition-colors",children:[(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:"h-4 w-4 text-muted-foreground",children:[(0,t.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,t.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,t.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium",children:"Screen only"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Record screen, no camera"})]})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>t9("camera_only"),className:"w-full px-2 py-2 text-left text-sm rounded-md [corner-shape:squircle] hover:bg-muted flex items-center gap-2 transition-colors",children:[(0,t.jsx)(s.VideoNoteIcon,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium",children:"Camera only"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Record yourself"})]})]})]})}),(0,t.jsx)("input",{ref:ez,type:"file",accept:"video/*",capture:"user",className:"hidden",onChange:na})]}),ef&&(0,t.jsx)(eF.SendLaterPopover,{variant:"compact",onSchedule:ef,disabled:C}),tr&&(0,t.jsx)(e$,{target:tr,handleRef:tl,disabled:C},`${tr.channel}:${tr.conversationRef}`)]}),tI?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-xs text-destructive font-medium flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-destructive animate-pulse"}),(0,v.formatDuration)(tA)]}),(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:tH,className:"h-6 w-6 flex items-center justify-center rounded-full text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",children:(0,t.jsx)(o.X,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Cancel"})]}),(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:tO,className:"h-6 w-6 flex items-center justify-center rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors",children:(0,t.jsx)(u.Square,{className:"h-2.5 w-2.5 fill-current"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Stop & send"})]})]}):tX?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-xs text-destructive font-medium flex items-center gap-1.5",children:[(0,t.jsx)(s.VideoNoteIcon,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-destructive animate-pulse"}),(0,v.formatDuration)(tY)]}
1),!t0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:nt,className:"h-6 w-6 flex items-center justify-center rounded-full text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",children:(0,t.jsx)(o.X,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Cancel"})]}),(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:ne,className:"h-6 w-6 flex items-center justify-center rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors",children:(0,t.jsx)(u.Square,{className:"h-2.5 w-2.5 fill-current"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Stop & send"})]})]})]}):ew&&eN?(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eN,className:"h-6 w-6 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:(0,t.jsx)(m.Undo2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Undo send"})]}),(0,t.jsx)(e0,{progress:ev,className:"shrink-0"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[ep,ey&&eb&&!ns?(0,t.jsxs)(M.Tooltip,{children:[(0,t.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eb,onMouseDown:e=>e.preventDefault(),className:"h-[26px] w-[26px] flex items-center justify-center rounded-full transition-opacity shadow-sm text-white hover:opacity-90",style:{backgroundColor:"var(--ring)"},title:"Stop",children:(0,t.jsx)("span",{className:"stop-pulse block h-[10px] w-[10px] rounded-[2px] bg-current"})})}),(0,t.jsx)(M.TooltipContent,{side:"top",children:"Stop"})]}):(0,t.jsx)("button",{type:"button",onClick:nm,disabled:C||!ns&&!eC,className:`h-7 w-7 flex items-center justify-center rounded-full transition-opacity shadow-sm text-white ${(ns||eC)&&!C?"hover:opacity-90":"opacity-40"} disabled:opacity-30`,style:{backgroundColor:"var(--ring)"},title:"Send",children:eC?(0,t.jsx)(eW.TranscribingBars,{}):R&&!ek?(0,t.jsx)(g.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(i.SendArrowIcon,{className:"h-3.5 w-3.5"})})]})]})]}),tB&&"image"===tB.type&&"u">typeof document&&(0,r.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-sm",onClick:()=>tz(null),children:[(0,t.jsx)("button",{type:"button",onClick:()=>tz(null),className:"absolute top-4 right-4 h-9 w-9 flex items-center justify-center rounded-full bg-white/10 backdrop-blur-md text-white hover:bg-white/20 transition-colors z-10",children:(0,t.jsx)(o.X,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"max-w-[90vw] max-h-[85vh]",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("img",{src:tB.url,alt:tB.name,className:"max-w-full max-h-[85vh] object-contain rounded-xl"}),(0,t.jsx)("p",{className:"text-center text-white/60 text-xs mt-2 truncate",children:tB.name})]})]}),document.body),tB&&"video"===tB.type&&tB.file&&(0,t.jsx)(eJ,{open:!0,onClose:()=>tz(null),videoFile:tB.file,onSave:e=>{tB.attachmentId&&ea&&ea(tB.attachmentId,e),tz(null)}}),tX&&t0&&(0,t.jsx)(k.VideoRecordingPreview,{mode:tJ,paused:tZ,recordingMs:tY,cameraPreviewStream:t0,cameraPreviewCallbackRef:nl,onStop:ne,onCancel:nt,onPauseResume:nn,onRestart:nr,cameraAspectRatio:t5,onCameraAspectRatioChange:t7})]})}],419829)},875527,504574,e=>{"use strict";var t=e.i(843476),n=e.i(271645);function r(e,t){let n=new Date(e),r=t;for(;r>0;){n.setDate(n.getDate()+1);let e=n.getDay();0!==e&&6!==e&&(r-=1)}return n}let l=["email","linkedin","whatsapp","sms","imessage","slack","chat","x","reddit"];function a(e){return l.includes(e)}e.s(["DEFAULT_FOLLOW_UP_CADENCE",0,"2_business_days","FOLLOW_UP_CADENCES",0,[{value:"tomorrow",label:"Tomorrow"},{value:"2_business_days",label:"In 2 business days"},{value:"3_business_days",label:"In 3 business days"},{value:"1_week",label:"In 1 week"},{value:"2_weeks",label:"In 2 weeks"},{value:"1_month",label:"In 1 month"}],"defaultFollowUpTaskType",0,function(e){switch(e){case"email":return"reply_email";case"linkedin":return"linkedin_message";case"whatsapp":return"send_whatsapp";case"sms":return"send_sms";case"imessage":case"messages":return"send_message";default:return"custom"}},"describeFollowUpDue",0,function(e,t=new Date){let n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=Math.round((n(e)-n(t))/864e5);return 0===r?"today":1===r?"tomorrow":r>1&&r<7?e.toLocaleDateString(void 0,{weekday:"long"}):e.toLocaleDateString(void 0,{month:"short",day:"numeric"})},"isFollowUpChannel",0,a,"resolveFollowUpDue",0,function(e,t=new Date){let n;switch(e){case"tomorrow":(n=new Date(t)).setDate(n.getDate()+1);break;case"2_business_days":n=r(t,2);break;case"3_business_days":n=r(t,3);break;case"1_week":(n=new Date(t)).setDate(n.getDate()+7);break;case"2_weeks":(n=new Date(t)).setDate(n.getDate()+14);break;case"1_month":(n=new Date(t)).setMonth(n.getMonth()+1)}return n.setHours(9,0,0,0),n}],504574);let s=(0,n.createContext)(null);e.s(["FollowUpProvider",0,function({channel:e,conversationRef:r,contactId:l,emailProvider:i,children:o}){let c=(0,n.useContext)(s),u=(0,n.useMemo)(()=>r&&l&&a(e)?{channel:e,conversationRef:r,contactId:l,emailProvider:i??null}:c,[e,r,l,i,c]);return(0,t.jsx)(s.Provider,{value:u,children:o})},"useFollowUpTarget",0,function(){return(0,n.useContext)(s)}],875527)},926925,59844,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(503116),l=e.i(747697),a=e.i(401851),s=e.i(595727),i=e.i(281092),o=e.i(839166),c=e.i(803635);function u(e,t,n){let r=(0,i.toDate)(e,n?.in);return r.setSeconds(t),r}e.s(["setSeconds",0,u],59844);var d=e.i(974875),m=e.i(585890),p=e.i(980797),f=e.i(647163),h=e.i(167881),x=e.i(59377),g=e.i(607709),y=e.i(157734),b=e.i(314743),w=e.i(728231);function v(){let e=new Date(9e5*Math.ceil(new Date().getTime()/9e5));return(0,a.format)(e,"HH:mm")}e.s(["SendLaterPopover",0,function({onSchedule:e,disabled:k,className:j,variant:C="default"}
1){let[N,_]=(0,n.useState)(!1),[S,T]=(0,n.useState)(!1),[M,E]=(0,n.useState)((0,s.addDays)(new Date,1)),[D,I]=(0,n.useState)(()=>{let e=Math.min(new Date().getHours()+1,23);return`${e.toString().padStart(2,"0")}:00`}),R=(0,n.useMemo)(()=>M&&(0,p.isToday)(M)?v():void 0,[M]),[A,P]=(0,n.useState)(""),U=function(){var e;let t,n=new Date,r=(0,s.addDays)(n,1),l=((t=1-(e=void 0,(0,i.toDate)(n,e?.in).getDay()))<=0&&(t+=7),(0,s.addDays)(n,t,e)),d=n.getHours(),m=[];if(d<17){let e=Math.max(d+1,9),t=u((0,o.setHours)((0,c.setMinutes)(new Date,0),e),0);m.push({label:e<12?"Later this morning":"Later today",sublabel:(0,a.format)(t,"h:mm a"),date:t})}return m.push({label:"Tomorrow morning",sublabel:(0,a.format)((0,o.setHours)((0,c.setMinutes)(r,0),9),"EEE, d MMM, h:mm a"),date:u((0,o.setHours)((0,c.setMinutes)(r,0),9),0)},{label:"Tomorrow afternoon",sublabel:(0,a.format)((0,o.setHours)((0,c.setMinutes)(r,0),13),"EEE, d MMM, h:mm a"),date:u((0,o.setHours)((0,c.setMinutes)(r,0),13),0)},{label:"Monday morning",sublabel:(0,a.format)((0,o.setHours)((0,c.setMinutes)(l,0),9),"EEE, d MMM, h:mm a"),date:u((0,o.setHours)((0,c.setMinutes)(l,0),9),0)}),m}();return(0,t.jsxs)(x.Popover,{open:N,onOpenChange:function(e){_(e),e||T(!1)},children:[(0,t.jsxs)(w.Tooltip,{children:[(0,t.jsx)(w.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(x.PopoverTrigger,{asChild:!0,children:"compact"===C?(0,t.jsx)("button",{type:"button",disabled:k,className:(0,f.cn)("h-7 w-7 flex items-center justify-center rounded-xl [corner-shape:squircle] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50",j),title:"Schedule send",children:(0,t.jsx)(r.Clock,{className:"h-4 w-4"})}):(0,t.jsx)(h.Button,{type:"button",size:"icon",className:(0,f.cn)("h-8 w-8 rounded-l-none",j),disabled:k,children:(0,t.jsx)(r.Clock,{className:"h-3.5 w-3.5"})})})}),(0,t.jsxs)(w.TooltipContent,{side:"top",className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{children:"Schedule send"}),(0,t.jsxs)("kbd",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[10px] font-medium text-muted-foreground",children:[(0,t.jsx)("span",{children:"â"}),(0,t.jsx)("span",{children:"âµ"})]})]})]}),(0,t.jsx)(x.PopoverContent,{align:"end",className:"w-auto p-0 z-[100]",container:(0,g.isDemoMode)()?void 0:"u">typeof document?document.body:null,children:S?(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(y.Calendar,{mode:"single",selected:M,onSelect:e=>{E(e),P("");let t=e&&(0,p.isToday)(e)?v():null;t&&D<t&&I(t)},disabled:e=>(0,d.isBefore)(e,(0,m.startOfDay)(new Date)),className:"p-0",initialFocus:!0}),(0,t.jsxs)("div",{className:"flex w-[128px] shrink-0 flex-col border-l pl-3",children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Time"}),(0,t.jsx)(b.TimePicker,{inline:!0,value:D,onValueChange:e=>{I(e),P("")},min:R,variant:"on-white",inputClassName:"h-8 text-sm",className:"flex-1",listClassName:"max-h-[204px] flex-1"})]})]}),A&&(0,t.jsx)("p",{className:"text-[11px] text-destructive",children:A}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-1",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>T(!1),children:"Back"}),(0,t.jsx)(h.Button,{size:"sm",onClick:function(){if(!M||!D)return;let[t,n]=D.split(":").map(Number),r=u((0,c.setMinutes)((0,o.setHours)(M,t),n),0);(0,d.isBefore)(r,new Date)?P("Pick a future time"):(P(""),e(r),_(!1),T(!1))},disabled:!M,children:"Schedule Send"})]})]}):(0,t.jsxs)("div",{className:"p-2 space-y-1 min-w-[240px]",children:[(0,t.jsx)("p",{className:"px-2 pt-1 pb-2 text-xs font-medium text-muted-foreground",children:"Schedule send"}),U.map(n=>(0,t.jsxs)("button",{type:"button",onClick:()=>{e(n.date),_(!1),T(!1)},className:"flex w-full items-center justify-between rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",children:[(0,t.jsx)("span",{className:"font-medium",children:n.label}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:n.sublabel})]},n.label)),(0,t.jsx)("div",{className:"border-t my-1"}),(0,t.jsxs)("button",{type:"button",onClick:()=>T(!0),className:"flex w-full items-center gap-2 rounded-lg [corner-shape:squircle] px-2 py-2 text-sm hover:bg-muted transition-colors",children:[(0,t.jsx)(l.CalendarIcon,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-medium",children:"Pick date & time"})]})]})})]})}],926925)},881335,e=>{"use strict";var t=e.i(843476);e.s(["GifIcon",0,function({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:e,xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2.5",stroke:"currentColor",strokeWidth:1.8}),(0,t.jsx)("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontSize:"7",fontWeight:"700",fill:"currentColor",fontFamily:"system-ui, -apple-system, sans-serif",children:"GIF"})]})}])},610384,85782,107615,e=>{"use strict";var t=e.i(843476),n=e.i(271645);function r({className:e}){let l=(0,n.useId)().replace(/:/g,""),a=e=>`gdocs_${l}_${e}`;return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36",className:e,"aria-hidden":!0,
1children:[(0,t.jsx)("mask",{id:a("a"),width:"24",height:"32",x:"6",y:"2",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},children:(0,t.jsx)("path",{fill:"#3186ff",d:"M24.44 34H11.55c-1.68 0-2.52 0-3.18-.26a3.8 3.8 0 0 1-2.1-2.11C6 30.97 6 30.13 6 28.45V7.55c0-1.68 0-2.52.26-3.18a3.8 3.8 0 0 1 2.11-2.1C9.03 2 9.87 2 11.55 2h7.2l10.27 10.27c.32.32.47.47.59.65q.27.38.35.84c.04.21.04.43.04.88l-.01 13.8c0 1.68 0 2.53-.27 3.2a3.8 3.8 0 0 1-2.1 2.1c-.67.26-1.5.26-3.18.26"})}),(0,t.jsxs)("g",{mask:`url(#${a("a")})`,children:[(0,t.jsx)("path",{fill:"#3186ff",d:"M29.99 34H6V2h12.75L30 13.25z"}),(0,t.jsx)("g",{filter:`url(#${a("b")})`,children:(0,t.jsx)("path",{fill:`url(#${a("c")})`,d:"M8.06 36.5h19.88V4.25H8.06z"})})]}),(0,t.jsx)("path",{fill:"#76bbff",d:"M29.06 12.31a2.8 2.8 0 0 0-1.68-.56h-6.23a2.4 2.4 0 0 1-2.4-2.4V2z"}),(0,t.jsx)("rect",{width:"12",height:"2",x:"12",y:"21",fill:"#fff",rx:"1"}),(0,t.jsx)("rect",{width:"9",height:"2",x:"12",y:"26",fill:"#fff",rx:"1"}),(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:a("c"),x1:"18",x2:"10.24",y1:"11.62",y2:"32.63",gradientUnits:"userSpaceOnUse",children:[(0,t.jsx)("stop",{offset:".33",stopColor:"#3186ff"}),(0,t.jsx)("stop",{offset:"1",stopColor:"#a9a8ff"})]}),(0,t.jsxs)("filter",{id:a("b"),width:"24.38",height:"36.75",x:"5.81",y:"2",colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[(0,t.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,t.jsx)("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,t.jsx)("feGaussianBlur",{result:a("blur"),stdDeviation:"1.13"})]})]})]})}function l({className:e}){let r=(0,n.useId)().replace(/:/g,""),a=e=>`gsheets_${r}_${e}`;return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36",className:e,"aria-hidden":!0,children:[(0,t.jsx)("path",{fill:"#009954",d:"M34.5 22.08c0 1.79 0 2.68-.27 3.4a4 4 0 0 1-2.25 2.24c-.71.28-1.6.28-3.4.28H18.44c-1.8 0-2.69 0-3.4-.28a4 4 0 0 1-2.24-2.25c-.28-.7-.28-1.6-.28-3.39v-8.16c0-1.79 0-2.68.28-3.4a4 4 0 0 1 2.24-2.24c.71-.28 1.6-.28 3.4-.28H28.6c1.79 0 2.68 0 3.39.28a4 4 0 0 1 2.25 2.25c.28.7.28 1.6.28 3.39z"}),(0,t.jsx)("mask",{id:a("a"),width:"31",height:"24",x:"1",y:"6",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},children:(0,t.jsx)("rect",{width:"30",height:"24",x:"31.5",y:"30",fill:"#0ebc5f",rx:"4",transform:"rotate(180 31.5 30)"})}),(0,t.jsxs)("g",{mask:`url(#${a("a")})`,children:[(0,t.jsx)("rect",{width:"30",height:"24",x:"31.5",y:"30",fill:"#0ebc5f",rx:"4",transform:"rotate(180 31.5 30)"}),(0,t.jsx)("g",{filter:`url(#${a("b")})`,children:(0,t.jsx)("rect",{width:"27",height:"20",fill:`url(#${a("c")})`,rx:"4",transform:"matrix(-1 0 0 1 34.5 8)"})})]}),(0,t.jsx)("path",{fill:"#fff",d:"M9 22.88c-.62 0-1.12-.5-1.12-1.13v-7.31H5.25a1.13 1.13 0 0 1 0-2.25h2.63V9.75a1.13 1.13 0 0 1 2.25 0v2.44H21a1.13 1.13 0 0 1 0 2.25H10.13v7.31c0 .62-.5 1.13-1.13 1.13"}),(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:a("c"),x1:"22.92",x2:"3.89",y1:"8.49",y2:"8.49",gradientUnits:"userSpaceOnUse",children:[(0,t.jsx)("stop",{stopColor:"#0ebc5f"}),(0,t.jsx)("stop",{offset:".95",stopColor:"#78c9ff"})]}),(0,t.jsxs)("filter",{id:a("b"),width:"31.5",height:"24.5",x:"5.26",y:"5.75",colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[(0,t.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,t.jsx)("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,t.jsx)("feGaussianBlur",{result:a("blur"),stdDeviation:"1.13"})]})]})]})}function a(e,t){let n=(e||"").toLowerCase(),r=(t||"").toLowerCase();return n.includes("spreadsheet")||n.includes("excel")||n.includes("csv")||"application/vnd.google-apps.spreadsheet"===n||r.endsWith(".csv")||r.endsWith(".xlsx")||r.endsWith(".xls")||r.endsWith(".xlsm")||r.endsWith(".xlsb")||r.endsWith(".numbers")||r.endsWith(".gsheet")}function s(e,t){let n=(e||"").toLowerCase(),r=(t||"").toLowerCase();return n.includes("wordprocessingml")||"application/msword"===n||"application/vnd.google-apps.document"===n||r.endsWith(".docx")||r.endsWith(".doc")||r.endsWith(".gdoc")}e.s(["GoogleDocsIcon",0,r],85782),e.s(["GoogleSheetsIcon",0,l],107615),e.s(["GoogleFileTypeIcon",0,function({mimeType:e,filename:n,className:i}){return a(e,n)?(0,t.jsx)(l,{className:i}):s(e,n)?(0,t.jsx)(r,{className:i}):null},"isDocsFile",0,s,"isSheetsFile",0,a],610384)},761691,e=>{"use strict";var t=e.i(843476);e.s(["PdfIcon",0,function(e){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"none","aria-hidden":"true",...e,children:[(0,t.jsx)("path",{fill:"#e5252a",d:"M302 0 446 144V447a65 65 0 0 1-65 65H130a65 65 0 0 1-65-65V65A65 65 0 0 1 130 0Z"}),(0,t.jsx)("path",{fill:"#ed676a",d:"M302 0 446 144H302Z"}),(0,t.jsx)("path",{fill:"#fff",fillRule:"evenodd",d:"M139 289h40a30 30 0 0 1 0 60h-18v32h-22Zm22 21h16a8.5 8.5 0 0 1 0 17h-16Z",clipRule:"evenodd"}),(0,t.jsx)("path",{fill:"#fff",fillRule:"evenodd",d:"M221 289h34a46 46 0 0 1 0 92h-34Zm22 19h9a27 27 0 0 1 0 54h-9Z",clipRule:"evenodd"}),(0,t.jsx)("path",{fill:"#fff",d:"M315 289h65v19h-42v16h33v20h-33v37h-23Z"})]})},"isPdfFile",0,function(e,t){let n=(e||"").toLowerCase(),r=(t||"").toLowerCase();return"application/pdf"===n||"application/x-pdf"===n||r.endsWith(".pdf")}])},469550,88494,e=>{"use strict";var t=e.i(843476);e.s(["VideoNoteIcon",0,function({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,t.jsx)("path",{d:"M21 4.93137C21 4.32555 21 4.02265 20.8802 3.88238C20.7763 3.76068 20.6203 3.69609 20.4608 3.70865C20.2769 3.72312 20.0627 3.93731 19.6343 4.36569L16 8L19.6343 11.6343C20.0627 12.0627 20.2769 12.2769 20.4608 12.2914C20.6203 12.3039 20.7763 12.2393 20.8802 12.1176C21 11.9774 21 11.6744 21 11.0686V4.93137Z",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M1 5.8C1 4.11984 1 3.27976 1.32698 2.63803C1.6146 2.07354 2.07354 1.6146 2.63803 1.32698C3.27976 1 4.11984 1 5.8 1H11.2C12.8802 1 13.7202 1 14.362 1.32698C14.9265 1.6146 15.3854 2.07354 15.673 2.63803C16 3.27976 16 4.11984 16 5.8V10.2C16 11.8802 16 12.7202 15.673 13.362C15.3854 13.9265 14.9265 14.3854 14.362 14.673C13.7202 15 12.8802 15 11.2 15H5.8C4.11984 15 3.27976 15 2.63803 14.673C2.07354 14.3854 1.6146 13.9265 1.32698 13.362C1 12.7202 1 11.8802 1 10.2V5.8Z",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}],469550),e.s(["SendArrowIcon",0,function({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[(0,t.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"5"}),(0,t.jsx)("polyline",{points:"5 12 12 5 19 12"})]})}],88494)},314743,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(503116),l=e.i(647163),a=e.i(23750);let s=/(am?|pm?)$/,i=/^(\d{1,2}):(\d{2})$/;function o(e){let t,n,r=e.trim().toLowerCase().replace(/[\s.]/g,"");if(!r)return null;let l=r.match(s)?.[1]?.[0],a=r.replace(s,"");if(!/^\d{1,2}:?\d{0,2}$/.test(a))return null;if(a.includes(":")){let[e,r]=a.split(":");t=Number(e),n=r?Number(r):0}else a.length<=2?(t=Number(a),n=0):(t=Number(a.slice(0,a.length-2)),n=Number(a.slice(-2)));return Number.isNaN(t)||Number.isNaN(n)||("p"===l&&t<12&&(t+=12),"a"===l&&12===t&&(t=0),t>23||n>59)?null:`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`}function c(e){let t=(e??"").match(i);if(!t)return"";let n=Number(t[1]);return`${n%12==0?12:n%12}:${t[2]} ${n<12?"AM":"PM"}`}function u(e){let t=c(e),[n,r]=t.toLowerCase().split(" ");return{value:e,label:t,digits12:n.replace(":",""),digits24:e.replace(":",""),meridiem:r}}e.s(["TimePicker",0,function({value:e,onValueChange:d,min:m,step:p=15,inline:f=!1,variant:h,className:x,inputClassName:g,listClassName:y,disabled:b,placeholder:w="e.g. 3:15 PM",id:v,"aria-label":k="Time"}){let j,C=(0,n.useId)(),N=`${v??C}
1-times`,[_,S]=(0,n.useState)(!1),[T,M]=(0,n.useState)(null),[E,D]=(0,n.useState)(null),I=(0,n.useRef)(null),R=(0,n.useRef)(null),A=(0,n.useMemo)(()=>(function(e,t){let n=-1;if(t){let e=o(t);if(e){let[t,r]=e.split(":").map(Number);n=60*t+r}}let r=[];for(let t=0;t<1440;t+=e){if(t<n)continue;let e=`${Math.floor(t/60).toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`,l=c(e),[a,s]=l.toLowerCase().split(" ");r.push({value:e,label:l,digits12:a.replace(":",""),digits24:e.replace(":",""),meridiem:s})}return r})(p,m),[p,m]),P=(0,n.useMemo)(()=>{if(!i.test(e??"")||A.some(t=>t.value===e))return A;let t=u(e),n=A.findIndex(t=>t.value>e);return n<0?[...A,t]:[...A.slice(0,n),t,...A.slice(n)]},[A,e]),{digits:U,meridiem:$}={digits:(j=(T??"").toLowerCase().replace(/[\s:.]/g,"")).replace(s,""),meridiem:j.match(s)?.[1]??""},F=null!==T?o(T):null,L=(0,n.useMemo)(()=>{let e=U||$?P.filter(e=>(!U||e.digits12.startsWith(U)||e.digits24.startsWith(U))&&(!$||e.meridiem.startsWith($))):P;return F&&!e.some(e=>e.value===F)?[u(F),...e]:e},[P,U,$,F]),q=f||_,O=L.findIndex(t=>t.value===e),H=Math.min(E??(O>=0?O:0),Math.max(L.length-1,0));function B(e){d(e),M(null),D(null),f||S(!1)}(0,n.useEffect)(()=>{q&&R.current?.querySelector('[data-active="true"]')?.scrollIntoView({block:"nearest"})},[q,H]),(0,n.useEffect)(()=>{if(_&&!f)return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0);function e(e){I.current?.contains(e.target)||(M(null),D(null),S(!1))}},[_,f]);let z=(0,t.jsx)("div",{ref:R,id:N,role:"listbox",className:(0,l.cn)("overflow-y-auto overscroll-contain p-1",y??"max-h-56",!f&&"rounded-[16px] [corner-shape:squircle] squircle-safari-fallback border bg-popover"),children:0===L.length?(0,t.jsx)("p",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No matching time"}):L.map((n,r)=>(0,t.jsx)("button",{type:"button",role:"option","aria-selected":n.value===e,"data-active":r===H?"true":void 0,onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>D(r),onClick:()=>B(n.value),className:(0,l.cn)("w-full rounded-[12px] [corner-shape:squircle] px-2 py-1.5 text-left text-sm tabular-nums transition-colors",n.value===e?"bg-primary text-primary-foreground":r===H?"bg-muted":"hover:bg-muted"),children:n.label},n.value))}),V=f?z:(0,t.jsx)("div",{className:"sq-elevated-host absolute inset-x-0 top-[calc(100%+4px)] z-50 overflow-visible rounded-[16px] shadow-md",children:z});return(0,t.jsxs)("div",{ref:I,className:(0,l.cn)("relative",f&&"flex min-h-0 flex-col gap-1.5",x),children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{id:v,type:"text",inputMode:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,role:"combobox","aria-expanded":q,"aria-controls":N,"aria-label":k,disabled:b,placeholder:w,value:T??c(e),onChange:e=>{M(e.target.value),D(null),f||S(!0)},onFocus:()=>!f&&S(!0),onBlur:function(){if(null===T)return;let e=o(T);e?B(e):M(null)},onKeyDown:function(e){if("ArrowDown"===e.key||"ArrowUp"===e.key){e.preventDefault(),q||S(!0);let t="ArrowDown"===e.key?H+1:H-1;D(Math.max(0,Math.min(L.length-1,t)));return}if("Enter"===e.key){e.preventDefault();let t=null!==T?o(T):null;null!==T&&!t&&L[H]?B(L[H].value):t?B(t):L[H]&&B(L[H].value);return}"Escape"===e.key&&!f&&_&&(e.preventDefault(),e.stopPropagation(),M(null),D(null),S(!1))},className:(0,l.cn)("h-9 w-full min-w-0 rounded-[18px] [corner-shape:squircle] squircle-field-fallback border border-transparent py-1 pl-3 pr-8 text-base tabular-nums outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a.controlVariants[h??"default"],g)}),(0,t.jsx)(r.Clock,{className:"pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"})]}),q&&V]})},"formatTimeValue",0,c])},777845,e=>{"use strict";function t(e){if(!e.isConnected)return!1;if("function"==typeof e.checkVisibility)try{return e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0})}catch{}let t=e.getClientRects();if(!t.length)return!1;let n=window.getComputedStyle(e);
1if("none"===n.display||"hidden"===n.visibility||0===Number.parseFloat(n.opacity))return!1;let{width:r,height:l}=t[0];return r>0||l>0}let n=["data-community-message-id","data-chat-message-id","data-wa-message-id","data-slack-ts","data-message-urn","data-message-id","data-widget-message-id"];function r(e,l=document){if(!e)return null;for(let r of n){let n=[];for(let t of l.querySelectorAll(`[${r}]`))t instanceof HTMLElement&&t.getAttribute(r)===e&&n.push(t);if(!n.length)continue;let a=n.find(t);if(a)return a;return n[0]}return null}function l(e,t={}){let n=t.behavior??"smooth",r=t.block??"center",a=e.parentElement;for(;a&&a!==document.documentElement;){let e=window.getComputedStyle(a);if(("auto"===e.overflowY||"scroll"===e.overflowY||"overlay"===e.overflowY)&&a.scrollHeight>a.clientHeight+1)break;a=a.parentElement}if(!a||a===document.documentElement)return void e.scrollIntoView({behavior:n,block:r,inline:"nearest"});let s=a.getBoundingClientRect(),i=e.getBoundingClientRect(),o=i.top-s.top+a.scrollTop,c="start"===r?o-12:o-a.clientHeight/2+i.height/2,u=Math.max(0,a.scrollHeight-a.clientHeight);a.scrollTo({top:Math.max(0,Math.min(u,c)),behavior:n})}e.s(["jumpToMessageWhenReady",0,function(e,t={}){let n=t.attempts??20,a=t.intervalMs??120,s=0,i=()=>{let o=r(e);if(o){l(o),function(e,t=3e3){let n=e.style.backgroundColor,r=e.style.transition;e.style.transition="background-color 150ms ease-out",e.style.backgroundColor="color-mix(in oklab, currentColor 6%, transparent)",window.setTimeout(()=>{e.style.backgroundColor=n,window.setTimeout(()=>{e.style.transition=r},200)},t)}(o,t.highlightMs);return}++s<n&&window.setTimeout(i,a)};i()},"jumpToThreadMessage",0,function(e,t={}){let n=r(e,t.root??document);return!!n&&(l(n),!function(e,t="2px solid hsl(var(--primary) / 0.4)",n=2500){let r=e.style.outline,l=e.style.borderRadius;e.style.outline=t,e.style.borderRadius="0.75rem";let a=document.documentElement.classList.contains("dark")?"inset 0 0 0 9999px rgba(255, 255, 255, 0.14)":"inset 0 0 0 9999px rgba(0, 0, 0, 0.14)",s=[];for(let t of[e,...e.querySelectorAll("*")]){let e=window.getComputedStyle(t),n=e.backgroundColor;!n||"transparent"===n||/^rgba\(.+,\s*0\)$/.test(n)||(s.push({node:t,boxShadow:t.style.boxShadow,transition:t.style.transition}),t.style.transition="box-shadow 200ms ease-out",t.style.boxShadow="none"!==e.boxShadow?`${e.boxShadow}, ${a}`:a)}window.setTimeout(()=>{for(let{node:t,boxShadow:n}of(e.style.outline=r,e.style.borderRadius=l,s))t.style.boxShadow=n;window.setTimeout(()=>{for(let{node:e,transition:t}of s)e.style.transition=t},250)},n)}(n,t.outline),!0)}])},514181,913258,e=>{"use strict";var t=e.i(271645),n=e.i(846696),r=e.i(920755);let l=RegExp("\\b(?:um|umm|ummm|uh|uhh|uhhh|er|erm|ah|ahh|eh|hmm|hmmm|mmm|mm|mhm|uh-huh|uhhuh)\\b[,]?","gi"),a=new Set(["had","that","is","is-ness","no","very","ha","bye"]),s=/\b(\w+)(\s+\1\b)+/gi,i=/\b(i)(?=$|[\s,.!?;:]|'(?:m|ve|ll|d|s)\b)/g;function o(e,{startsSentence:t=!0}={}){let n=e;return(n=(n=(n=(n=n.replace(l," ")).replace(s,(e,t)=>a.has(t.toLowerCase())?e:e.slice(0,t.length))).replace(/\s+/g," ").replace(/\s+([,.!?;:%])/g,"$1").replace(/([,;:])(?=[^\s,;:.!?])/g,"$1 ").replace(/([.!?])(?=[A-Za-z])/g,"$1 ").replace(/\s+([)\]}])/g,"$1").replace(/([([{])\s+/g,"$1")).replace(/,\s*(?=[,.!?;:])/g,"").replace(/^[\s,;:]+/,"").trim())?(n=(n=n.replace(i,"I")).replace(/([.!?])\s+([a-z])/g,(e,t,n)=>`${t} ${n.toUpperCase()}`),t&&(n=n.replace(/^([a-z])/,e=>e.toUpperCase())),n):""}function c(e){return/[.!?]["')\]]*$/.test(e.trim())}async function u(e){let t=o(e),n=e.trim();if(!n)return"";try{var r,l,a;let e=await fetch("/api/claude/dictation-bridge");if(!e.ok)return t;let{port:s,token:i}=await e.json();if("number"!=typeof s||"string"!=typeof i)return t;return await (r=s,l=i,a=n,new Promise(e=>{let t;try{t=new WebSocket(`ws://127.0.0.1:${r}`)}catch{e(null);return}let n=!1,s=r=>{if(!n){n=!0,clearTimeout(i);try{t.close()}catch{}e(r)}},i=setTimeout(()=>s(null),9e3);t.onerror=()=>s(null),t.onclose=()=>s(null),t.onopen=()=>t.send(JSON.stringify({type:"hello",token:l})),t.onmessage=e=>{let n;try{n=JSON.parse(String(e.data))}catch{return}"ready"===n.type?t.send(JSON.stringify({type:"tidy",text:a,context:location.hostname})):"tidied"===n.type?s((n.text??"").trim()||null):"error"===n.type&&s(null)}}))||t}catch{return t}}async function d(e){try{let t=await fetch("/api/claude/dictation-bridge");if(!t.ok)return!1;let{port:n,token:r}=await t.json();if("number"!=typeof n||"string"!=typeof r)return!1;return await new Promise(t=>{let l;try{l=new WebSocket(`ws://127.0.0.1:${n}`)}catch{t(!1);return}let a=!1,s=!1,i=e=>{a||(a=!0,clearTimeout(c),t(e))},o=()=>
1{if(s){s=!1;try{l.close()}catch{}e?.()}},c=setTimeout(()=>i(!1),1200);l.onerror=()=>{i(!1),o()},l.onclose=()=>{i(!1),o()},l.onopen=()=>l.send(JSON.stringify({type:"hello",token:r})),l.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}"ready"===t.type?l.send(JSON.stringify({type:"dictate"})):"dictating"===t.type?(s=!0,i(!0)):"dictation-ended"===t.type?o():"error"===t.type&&i(!1)}})}catch{return!1}}function m(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}e.s(["delegateDictationToHelper",0,d,"endsSentence",0,c,"polishDictation",0,o,"tidyDictation",0,u],913258);let p=null;async function f(){if(p&&Date.now()-p.at<6e4)return p.info;let e=null;try{let t=await fetch("/api/claude/dictation-bridge");if(t.ok){let n=await t.json();"number"==typeof n.port&&"string"==typeof n.token&&(e={port:n.port,token:n.token})}}catch{}return p={at:Date.now(),info:e},e}let h=()=>()=>{},x=()=>"u">typeof navigator&&!!navigator.mediaDevices?.getUserMedia,g=()=>!1;e.s(["useDictation",0,function({onCommit:e,onStart:l,onStop:a,polish:s=!0}){let i=(0,t.useMemo)(()=>(0,r.createClient)(),[]),[u,d]=(0,t.useState)(!1),[y,b]=(0,t.useState)(!1),[w,v]=(0,t.useState)(""),[k,j]=(0,t.useState)([]),[C,N]=(0,t.useState)("speech"),_=(0,t.useRef)(null),S=(0,t.useRef)(null),T=(0,t.useRef)(null),M=(0,t.useRef)(!1),E=(0,t.useRef)(!1),D=(0,t.useRef)(!1),I=(0,t.useRef)(0),R=(0,t.useRef)(0),A=(0,t.useRef)(null),P=(0,t.useRef)(e),U=(0,t.useRef)(l),$=(0,t.useRef)(a);(0,t.useEffect)(()=>{P.current=e,U.current=l,$.current=a});let F=(0,t.useRef)(!1),L=(0,t.useRef)(s);(0,t.useEffect)(()=>{L.current=s});let q=(0,t.useCallback)(e=>{let t=L.current?o(e,{startsSentence:!F.current}):e.trim();t&&(F.current=!c(t),P.current(t))},[]),O=(0,t.useSyncExternalStore)(h,x,g),H=(0,t.useRef)(null),B=(0,t.useRef)(null),z=(0,t.useCallback)(()=>{A.current&&(clearInterval(A.current),A.current=null)},[]),V=(0,t.useCallback)(()=>{let e=T.current;T.current=null,e&&(clearInterval(e.timer),e.owned.ctx&&"closed"!==e.owned.ctx.state&&e.owned.ctx.close().catch(()=>{}),e.owned.stream?.getTracks().forEach(e=>e.stop()),j([]))},[]),W=(0,t.useCallback)((e,t)=>{V(),j(Array(34).fill(.12));let n=new Uint8Array(e.fftSize);T.current={timer:setInterval(()=>{e.getByteTimeDomainData(n);let t=0;for(let e=0;e<n.length;e++){let r=(n[e]-128)/128;t+=r*r}let r=Math.min(1,Math.max(.12,3.2*Math.sqrt(t/n.length)));j(e=>[...e.slice(1),r])},80),owned:t}},[V]),G=(0,t.useCallback)(e=>{try{let t=new AudioContext,n=t.createAnalyser();n.fftSize=512,t.createMediaStreamSource(e).connect(n),W(n,{ctx:t,stream:e})}catch{e.getTracks().forEach(e=>e.stop())}},[W]),K=(0,t.useCallback)(()=>{let e=m();if(!e)return!1;let t=new e;t.lang=navigator.language||"en-US",t.continuous=!0,t.interimResults=!0,t.maxAlternatives=1,t.onresult=e=>{R.current=Date.now();let t="";for(let n=e.resultIndex;n<e.results.length;n++){let r=e.results[n],l=r[0].transcript;r.isFinal?q(l):t+=l}v(t.trim())},t.onend=()=>{if(_.current=null,v(""),D.current){D.current=!1,M.current=!1;return}if(M.current){M.current=!1,d(!1),V(),$.current?.();return}E.current=!1,B.current?.()||(d(!1),V(),$.current?.())},t.onerror=e=>{let t=e?.error??"";"no-speech"!==t&&"aborted"!==t&&(M.current=!0,z(),v(""),"not-allowed"===t||"service-not-allowed"===t?(d(!1),V(),n.toast.error("Microphone access is blocked for this site"),$.current?.()):"network"===t?(D.current=!0,N("record"),H.current?.()):(d(!1),V(),n.toast.error(`Dictation stopped${t?`: ${t}`:""}`),$.current?.()))},_.current=t,I.current=Date.now(),R.current=Date.now();try{return t.start(),!0}catch{return _.current=null,!1}},[z,V,q]);(0,t.useEffect)(()=>{B.current=K},[K]);let X=(0,t.useCallback)(()=>{z(),A.current=setInterval(()=>{let e=_.current;if(!e||E.current)return;let t=Date.now()-I.current,n=Date.now()-R.current;t<45e3||n<900||(E.current=!0,e.stop())},300)},[z]),Y=(0,t.useCallback)(async e=>{let t=Date.now()+6e4;for(;Date.now()<t;){await new Promise(e=>setTimeout(e,250));let{data:t}=await i.from("claude_dictations").select("status, text, error").eq("id",e).maybeSingle();if(t){if("succeeded"===t.status)return t.text;if("failed"===t.status)return n.toast.error(t.error||"Could not transcribe that"),null}}return n.toast.error("Your Mac didn't answer in time"),null},[i]),J=(0,t.useCallback)(async e=>{let t=e.reduce((e,t)=>
1e+t.length,0);if(t<3200)return;let r=new Int16Array(t),l=0;for(let t of e)r.set(t,l),l+=t.length;try{let e=await fetch("/api/claude/dictate",{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:r.buffer});if(!e.ok)throw Error(String(e.status));let{id:t}=await e.json(),n=await Y(t);n&&q(n)}catch{n.toast.error("Could not transcribe that")}},[Y,q]),Z=(0,t.useCallback)(async()=>{let e;try{e=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{n.toast.error("Microphone access is blocked for this site"),$.current?.();return}if(M.current){e.getTracks().forEach(e=>e.stop()),$.current?.();return}let t=new AudioContext({sampleRate:16e3}),r=t.createMediaStreamSource(e),l=t.createScriptProcessor(2048,1,1),a=[],s=null,i=!1,o=!1,c=0,u=null,m=()=>{if(i=!1,s){s.onmessage=null,s.onclose=null,s.onerror=null;try{s.close()}catch{}s=null}};l.onaudioprocess=e=>{let t=e.inputBuffer.getChannelData(0),n=new Int16Array(t.length);for(let e=0;e<t.length;e++){let r=Math.max(-1,Math.min(1,t[e]));n[e]=r<0?32768*r:32767*r}a.push(n),i&&s?.readyState===WebSocket.OPEN&&s.send(n.buffer)},r.connect(l);let h=t.createGain();h.gain.value=0,l.connect(h),h.connect(t.destination);let x=t.createAnalyser();x.fftSize=512,r.connect(x),W(x,{ctx:null,stream:null}),(async()=>{let e,t=await f();if(t&&!o){try{e=await new Promise((e,n)=>{let r;try{r=new WebSocket(`ws://127.0.0.1:${t.port}`)}catch{n(Error("bridge unavailable"));return}r.binaryType="arraybuffer";let l=!1,a=()=>{if(!l){l=!0,clearTimeout(s);try{r.close()}catch{}n(Error("bridge unavailable"))}},s=setTimeout(a,2500);r.onerror=a,r.onclose=a,r.onopen=()=>{r.send(JSON.stringify({type:"hello",token:t.token}))},r.onmessage=t=>{try{let n=JSON.parse(String(t.data));"ready"!==n.type||l?"error"===n.type&&a():(l=!0,clearTimeout(s),e(r))}catch{}}})}catch{p=null;return}if(o)return e.close();for(let t of(e.onerror=null,e.onclose=()=>{i=!1,s=null,u?.()},e.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}"interim"===t.type?v((t.text??"").trim()):"commit"===t.type?(q(t.text??""),c=a.length,v("")):"done"===t.type?u?.():"error"===t.type&&(i=!1,u?.())},s=e,i=!0,a))e.send(t.buffer)}})();let g=()=>{o=!0,l.disconnect(),r.disconnect(),x.disconnect(),h.disconnect(),e.getTracks().forEach(e=>e.stop()),t.close(),V()};S.current={discard:()=>{g(),m(),a.length=0,v("")},stop:async()=>{g(),b(!0);try{if(i&&s?.readyState===WebSocket.OPEN){let e=new Promise(e=>{u=e});s.send(JSON.stringify({type:"stop"})),await Promise.race([e,new Promise(e=>setTimeout(e,6e3))])}if(c<a.length){let e=a.slice(c),t=e.reduce((e,t)=>e+t.length,0);(0===c||t>=16e3)&&await J(e)}}finally{m(),v(""),b(!1),$.current?.()}}},d(!0),U.current?.()},[J,W,V,q]);(0,t.useEffect)(()=>{H.current=Z},[Z]);let Q=(0,t.useCallback)(async()=>{let e;if(!u&&!y){if(M.current=!1,E.current=!1,D.current=!1,F.current=!1,"record"===C||!m()){"record"!==C&&N("record"),await Z();return}try{e=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{n.toast.error("Microphone access is blocked for this site");return}K()?(d(!0),G(e),X(),U.current?.()):(e.getTracks().forEach(e=>e.stop()),n.toast.error("Dictation could not start"))}},[u,y,C,Z,K,G,X]),ee=(0,t.useCallback)(async()=>{z(),M.current=!0,D.current=!1,v(""),_.current?.stop();let e=S.current;S.current=null,d(!1),e?await e.stop():V()},[z,V]),et=(0,t.useCallback)(()=>{z(),M.current=!0,D.current=!1;let e=S.current;S.current=null,_.current?.abort(),e?.discard(),v(""),b(!1),d(!1),V(),$.current?.()},[z,V]),en=(0,t.useCallback)(async()=>{u?await ee():await Q()},[u,Q,ee]);return(0,t.useEffect)(()=>()=>{M.current=!0,A.current&&clearInterval(A.current),_.current?.abort(),S.current?.stop();let e=T.current;T.current=null,e&&(clearInterval(e.timer),e.owned.ctx&&"closed"!==e.owned.ctx.state&&e.owned.ctx.close().catch(()=>{}),e.owned.stream?.getTracks().forEach(e=>e.stop()))},[]),{supported:O,listening:u,transcribing:y,interim:w,levels:k,engine:C,start:Q,stop:ee,cancel:et,toggle:en}}],514181)},884728,e=>{"use strict";var t=e.i(271645),n=e.i(780790);let r=()=>{},l=()=>r,a=()=>!0;e.s(["useIsMac",0,function(){return(0,t.useSyncExternalStore)(l,n.isMacKeyboard,a)}])},309204,e=>{"use strict";let t=null;e.s(["sendExtensionMessage",0,function(e,n=2e4){return t?Promise.resolve(t(e)).then(e=>e??{error:"Not available in the demo"}):new Promise(t=>{let r=`req-${Date.now()}-${Math.random().toString(36).slice(2)}`,l=`everything-${e.action}-response-${r}`,a=e=>{let n=e.detail;window.removeEventListener(l,a),clearTimeout(s),t(n??{error:"Extension returned no response"})},s=setTimeout(()=>{window.removeEventListener(l,a),t({error:"Chrome extension not responding (is it installed and enabled?)"})},n);window.addEventListener(l,a),window.dispatchEvent(new CustomEvent("everything-extension-request",{detail:{...e,_reqId:r,_responseEvent:l}}))})},"setDemoExtensionResponder",0,function(e){t=e}])},607709,e=>{"use strict";let t=!1;e.s(["isDemoMode",0,function(){return t},"setDemoMode",0,function(e){t=e}])},491318,e=>{"use strict";function t(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}let n=[[/\*\*(?=\S)([\s\S]*?\S)\*\*/g,"strong"],[/__(?=\S)([\s\S]*?\S)__/g,"u"],[/\*(?=\S)([^*\n]*?\S)\*/g,"em"]],r=/!\[([^\]]*)\]\((https?:\/\/[^\s)]+|\/[^\s)]+)\)/g,l=/\[([^\]]+)\]\((https?:\/\/[^\s)]+|mailto:[^\s)]+|\/[^\s)]+)\)/g;function a(e){let a=[],s=e=>(a.push(e),`\u0000${a.length-1}\u0000`);return(function(e){let t=e;for(let[e,r]of n)t=t.replace(e,(e,t)=>`<${r}>${t}</${r}>`);return t})(t(e.replace(/\u0000/g,"")).replace(r,(e,t,n)=>s(`<img src="${n}" alt="${t}" style="max-width:100%;height:auto;display:block;margin:12px 0;">`)).replace(l,(e,t,n)=>/^https?:\/\//.test(t.trim())?s(`<a href="${n}">${t}</a>`):`${s(`<a href="${n}">`)}${t}${s("</a>")}`).replace(/(https?:\/\/[^\s<]+)/g,e=>{let t=e.match(/^(.*?)([.,;
1:!?)\]]*)$/),n=t?t[1]:e,r=t?t[2]:"";return`<a href="${n}">${n}</a>${r}`})).replace(RegExp("\0(\\d+)\0","g"),(e,t)=>a[Number(t)]??"")}function s(e){let t=e.match(/^[ \t]*/)?.[0]??"",n=0;for(let e of t)n+=" "===e?2:1;return Math.floor(n/2)}function i(e){let t=e.trim(),n=t.match(/^(?:[\u2022\-*]|[\u2610\u2611])\s+(.*)$/);if(n)return{type:"ul",text:n[1]};let r=t.match(/^\d+\.\s+(.*)$/);return r?{type:"ol",text:r[1]}:null}e.s(["sequenceBodyToHtml",0,function(e){if(!e)return"";if(/<(p|div|br|h[1-6]|ul|ol|table|blockquote|pre)\b/i.test(e))return e;let n=e.replace(/\r\n/g,"\n").split("\n"),r=[],l=[],o=()=>{},c=()=>{l.length&&(r.push(`<p>${l.join("<br>")}</p>`),l=[]),o()},u=0;for(;u<n.length;){let e=n[u],d=e.trim();if(d.startsWith("```")){c();let e=[];for(u++;u<n.length&&!n[u].trim().startsWith("```");)e.push(n[u]),u++;u++,r.push(`<pre><code>${t(e.join("\n"))}</code></pre>`);continue}if(""===d){c(),u++;continue}if(/^---+$/.test(d)){c(),r.push("<hr>"),u++;continue}let m=d.match(/^(#{1,3})\s+(.*)$/);if(m){c();let e=m[1].length;r.push(`<h${e}>${a(m[2])}</h${e}>`),u++;continue}if(m=d.match(/^>\s?(.*)$/)){c();let e=[a(m[1])];for(u++;u<n.length;){let t=n[u].trim().match(/^>\s?(.*)$/);if(!t)break;e.push(a(t[1])),u++}r.push(`<blockquote>${e.join("<br>")}</blockquote>`);continue}let p=i(e);if(p){c();let t=s(e),l=[];for(;u<n.length;){let e=i(n[u]);if(!e)break;let r=Math.max(t,s(n[u]));if(r===t&&e.type!==p.type)break;l.push({depth:r,type:e.type,html:a(e.text)}),u++}r.push(function e(t){let n=[],r=0;for(;r<t.length;){let l=t[r],a=r+1;for(;a<t.length&&t[a].depth>l.depth;)a++;let s=t.slice(r+1,a);n.push(`<li>${l.html}${s.length?e(s):""}</li>`),r=a}return`<${t[0].type}>${n.join("")}</${t[0].type}>`}(l));continue}o(),l.push(a(e.trimEnd())),u++}return c(),r.join("")}])},965638,e=>{"use strict";let t=[{key:"first_name",label:"First Name",category:"contact",aliases:["first","fname","given name","name","nickname","preferred name"]},{key:"last_name",label:"Last Name",category:"contact",aliases:["last","lname","surname","family name"]},{key:"full_name",label:"Full Name",category:"contact",aliases:["name","contact name"]},{key:"nickname",label:"Nickname",category:"contact",aliases:["nick","preferred name","alias","short name"]},{key:"email",label:"Email",category:"contact",aliases:["email address","mail"]},{key:"phone",label:"Phone",category:"contact",aliases:["phone number","mobile","cell"]},{key:"job_title",label:"Job Title",category:"contact",aliases:["title","role","position"]},{key:"linkedin_url",label:"LinkedIn URL",category:"contact",aliases:["linkedin","li url","profile"]},{key:"city",label:"City",category:"contact",aliases:["location","town"]},{key:"state",label:"State",category:"contact",aliases:["region","province"]},{key:"country",label:"Country",category:"contact",aliases:[]},{key:"company_name",label:"Company Name",category:"company",aliases:["company","org","organization","business"]},{key:"company_domain",label:"Company Domain",category:"company",aliases:["domain","website","url"]},{key:"company_industry",label:"Industry",category:"company",aliases:["industry","sector"]},{key:"company_size",label:"Company Size",category:"company",aliases:["size","employees","headcount"]},{key:"owner_first_name",label:"Your First Name",category:"owner",aliases:["my first name","sender first name","rep first name"]},{key:"owner_last_name",label:"Your Last Name",category:"owner",aliases:["my last name","sender last name","rep last name"]},{key:"owner_name",label:"Your Name",category:"owner",aliases:["my name","sender name","rep name"]},{key:"owner_email",label:"Your Email",category:"owner",aliases:["my email","sender email"]},{key:"owner_phone",label:"Your Phone",category:"owner",aliases:["my ph
1one","sender phone"]},{key:"unsubscribe_link",label:"Unsubscribe Link",category:"sequence",aliases:["unsubscribe","opt out","optout"]},{key:"first_name|full_name",label:"First Name or Full Name",category:"conditional",aliases:["if first name","name fallback"],insertText:"{{first_name|full_name}}"},{key:"phone|email",label:"Phone or Email",category:"conditional",aliases:["if phone","contact fallback"],insertText:"{{phone|email}}"},{key:"company_name|job_title",label:"Company or Job Title",category:"conditional",aliases:["if company","company fallback"],insertText:"{{company_name|job_title}}"}],n={contact:"Contact",company:"Company",owner:"Sender",sequence:"Sequence",conditional:"If / Fallback"};e.s(["MERGE_VARIABLES",0,t,"getCategoryLabel",0,function(e){return n[e]??e},"searchVariables",0,function(e){if(!e)return t;let n=e.toLowerCase().trim();return t.filter(e=>!!(e.key.includes(n)||e.label.toLowerCase().includes(n))||e.aliases.some(e=>e.includes(n)))}])},402370,e=>{"use strict";var t=e.i(572377);let n={send_email:{value:"send_email",label:"New Email",Icon:t.GmailSquircle,channel:"email"},manual_email:{value:"manual_email",label:"New Email (Manual)",Icon:t.GmailSquircle,channel:"email"},reply_email:{value:"reply_email",label:"Reply Email",Icon:t.GmailSquircle,channel:"email"},manual_reply_email:{value:"manual_reply_email",label:"Reply Email (Manual)",Icon:t.GmailSquircle,channel:"email"},linkedin_connect:{value:"linkedin_connect",label:"LinkedIn Connection",Icon:t.LinkedInSquircle,channel:"linkedin"},linkedin_message:{value:"linkedin_message",label:"LinkedIn Message",Icon:t.LinkedInSquircle,channel:"linkedin"},linkedin_inmail:{value:"linkedin_inmail",label:"LinkedIn InMail",Icon:t.LinkedInSquircle,channel:"linkedin"},linkedin_voice_note:{value:"linkedin_voice_note",label:"LinkedIn Voice Note",Icon:function(e){return(0,t.VoiceNoteSquircle)({...e,color:"#0A66C2"})},channel:"linkedin"},linkedin_video:{value:"linkedin_video",label:"LinkedIn Video",Icon:function(e){return(0,t.VideoSquircle)({...e,color:"#0A66C2"})},channel:"linkedin"},linkedin_post_comment:{value:"linkedin_post_comment",label:"Comment on Post",Icon:t.LinkedInSquircle,channel:"linkedin"},linkedin_post_react:{value:"linkedin_post_react",label:"React to Post",Icon:t.LinkedInSquircle,channel:"linkedin"},send_whatsapp:{value:"send_whatsapp",label:"WhatsApp Message",Icon:t.WhatsAppSquircle,channel:"whatsapp"},manual_whatsapp:{value:"manual_whatsapp",label:"WhatsApp (Manual)",Icon:t.WhatsAppSquircle,channel:"whatsapp"},whatsapp_voice_note:{value:"whatsapp_voice_note",label:"WhatsApp Voice Note",Icon:function(e){return(0,t.VoiceNoteSquircle)({...e,color:"#25D366"})},channel:"whatsapp"},whatsapp_video:{value:"whatsapp_video",label:"WhatsApp Video",Icon:function(e){return(0,t.VideoSquircle)({...e,color:"#25D366"})},channel:"whatsapp"},send_sms:{value:"send_sms",label:"Send SMS",Icon:t.SmsSquircle,channel:"phone"},send_message:{value:"send_message",label:"Send iMessage/SMS",Icon:t.IMessageSquircle,channel:"phone"},call:{value:"call",label:"Call",Icon:t.CallSquircle,channel:"phone"},custom:{value:"custom",label:"Custom Task",Icon:t.CustomTaskSquircle,channel:"other"}},r={email:"email",linkedin:"LinkedIn",whatsapp:"WhatsApp",sms:"SMS",imessage:"iMessage",slack:"Slack",x:"X",reddit:"Reddit"};e.s(["STATUS_LABELS",0,{not_started:"Not Started",in_progress:"In Progress",complete:"Complete",skipped:"Skipped"},"TASK_TYPE_CONFIG",0,n,"TASK_TYPE_ORDER",0,["send_email","reply_email","linkedin_connect","linkedin_message","linkedin_inmail","linkedin_voice_note","linkedin_video","send_whatsapp","whatsapp_voice_note","whatsapp_video","send_message","send_sms","call","custom"],"describeAutoComplete",0,function(e){return"call"===e?"they called you":`they replied on ${r[e]??e}`},"getAutoCompletedStamp",0,function(e){let t=e?.auto_completed;return t?.reason==="inbound_reply"?t:null},"getTaskTypeConfig",0,function(e){let t=n[e];return t||{...n.custom,label:e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}}])},602487,893586,225655,e=>{"use strict";var t=e.i(428605);function n(e){return e?e.replace(/_(normal|bigger|mini|200x200)(\.[a-z]{3,4})$/i,"_400x400$2"):null}function r(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function l(e){if("string"!=typeof e||!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:new Date(t).toISOString()}function a(e){return e?"TweetWithVisibilityResults"===e.__typename||e.tweet?e.tweet??null:"TweetTombstone"===e.__typename?null:e:null}function s(e){let a=e?.data?.user?.result??e?.result??e;if(!a||"UserUnavailable"===a.__typename)return null;let s=a.core??{},i=a.legacy??{},o=a.avatar??{},c=a.affiliates_highlighted_label?.label,u=Array.isArray(i.pinned_tweet_ids_str)?i.pinned_tweet_ids_str.filter(e=>"string"==typeof e):null;return{xUserId:a.rest_id??i.id_str??null,screenName:s.screen_name??i.screen_name??null,name:s.name??i.name??null,description:(0,t.decodeHtmlEntities)(i.description??"")||null,location:a.location?.location??i.location??null,url:i.entities?.url?.urls?.[0]?.expanded_url??i.url??null,profileImageUrl:n(o.image_url??i.profile_image_url_https??null),profileBannerUrl:i.profile_banner_url??null,followersCount:r(i.followers_count),followingCount:r(i.friends_count),statusesCount:r(i.statuses_count),listedCount:r(i.listed_count),mediaCount:r(i.media_count),isVerified:"boolean"==typeof i.verified?i.verified:null,isBlueVerified:"boolean"==typeof a.is_blue_verified?a.is_blue_verified:null,isProtected:"boolean"==typeof i.protected?i.protected:null,professionalCategory:a.professional?.category?.[0]?.name??null,pinnedPostIds:u&&u.length?u:null,xCreatedAt:l(s.created_at??i.created_at),isOrganization:"Square"===a.profile_image_shape||(a.verification?.verified_type??i.verified_type)==="Business",affiliationName:c?.description??null,affiliationScreenName:function(e){if("string"!=typeof e)return null;let t=e.match(/^https?:\/\/(?:www\.)?(?:twitter|x)\.com\/([A-Za-z0-9_]{1,15})\/?$/);return t?t[1]:null}(c?.url?.url),affiliationBadgeUrl:c?.badge?.url??null}}function i(e){let n=a(e);if(!n)return null;let s=n.legacy??{},i=n.rest_id??s.id_str;if(!i)return null;let o=n.core?.user_results?.result,c=o?.core??{},u=o?.legacy??{},d=a(s.retweeted_status_result?.result),m=d??n,p=m.legacy??{},f=m.note_tweet?.note_tweet_results?.result?.text,h=p.extended_entities?.media??p.entities?.media??[],x=(Array.isArray(h)?h:[]).map(e=>{let t=e?.type==="video"||e?.type==="animated_gif",n=e?.video_info?.variants?.filter(e=>e?.content_type==="video/mp4")?.sort((e,t)=>
1(t?.bitrate??0)-(e?.bitrate??0))?.[0]?.url??null;return{type:e?.type??"photo",url:t?n:e?.media_url_https??null,thumb:e?.media_url_https??null}}),g=p.entities?.urls??[],y=(Array.isArray(g)?g:[]).map(e=>({url:e?.url,expanded:e?.expanded_url??null,display:e?.display_url??null})).filter(e=>!!e.url),b=f??p.full_text??null;if(!f&&b){let e=p.display_text_range;Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&(b=b.slice(e[0],e[1]))}return{xPostId:i,authorXUserId:o?.rest_id??s.user_id_str??null,authorScreenName:c.screen_name??u.screen_name??null,text:function(e,n,r){let l=(0,t.decodeHtmlEntities)(e??"");if(!l)return"";if(Array.isArray(r))for(let e of r){if(!e?.url)continue;let t=e.display||e.expanded||e.url;t&&l.includes(e.url)&&(l=l.split(e.url).join(t))}return Array.isArray(n)&&n.length>0&&(l=l.replace(/(?:^|\s)https?:\/\/t\.co\/\w+/g,"").trim()),l}(b,x,y)||null,lang:p.lang??null,postedAt:l(s.created_at),replyCount:r(p.reply_count),repostCount:r(p.retweet_count),likeCount:r(p.favorite_count),quoteCount:r(p.quote_count),viewCount:m.views?.count!=null&&Number(m.views.count)||null,bookmarkCount:r(p.bookmark_count),isRepost:!!d,isQuote:!!s.is_quote_status,quotedPostId:s.quoted_status_id_str??null,inReplyToPostId:s.in_reply_to_status_id_str??null,inReplyToScreenName:"string"==typeof s.in_reply_to_screen_name?s.in_reply_to_screen_name:null,conversationId:s.conversation_id_str??null,media:x,urls:y}}function o(e){let t=[e?.data?.user?.result?.timeline_v2?.timeline,e?.data?.user?.result?.timeline?.timeline,e?.data?.home?.home_timeline_urt,e?.data?.search_by_raw_query?.search_timeline?.timeline,e?.data?.threaded_conversation_with_injections_v2,e?.data?.timeline?.timeline].filter(Boolean),n=[];for(let e of t)Array.isArray(e?.instructions)&&n.push(...e.instructions);let r=[],l=[],o=null,c=new Set,u=new Set,d=e=>{let t=e?.content??e?.item;if(!t)return;if("TimelineTimelineCursor"===t.entryType||"Bottom"===t.cursorType){"Bottom"===t.cursorType&&t.value&&(o=t.value);return}if(Array.isArray(t.items)){for(let e of t.items)d(e);return}let n=t.itemContent??t;if(n?.cursorType==="Bottom"&&n.value){o=n.value;return}let r=n?.user_results?.result??null;if(r&&!n?.tweet_results){let e=s(r);e?.xUserId&&!u.has(e.xUserId)&&(u.add(e.xUserId),l.push(e));return}let a=n?.tweet_results?.result;a&&m(a)},m=(e,t=0)=>{let n=i(e);n&&!c.has(n.xPostId)&&(c.add(n.xPostId),r.push(n));let o=a(e);if((e=>{let t=e?.core?.user_results?.result;if(!t)return;let n=s(t);n?.xUserId&&!u.has(n.xUserId)&&(u.add(n.xUserId),l.push(n))})(o),!(t>=2))for(let e of[o?.legacy?.retweeted_status_result?.result,o?.quoted_status_result?.result].filter(Boolean))m(e,t+1)};for(let e of n){if(Array.isArray(e?.entries))for(let t of e.entries)d(t);e?.entry&&d(e.entry)}return{posts:r,cursor:o,profiles:l}}function c(e){let{posts:t,cursor:n,profiles:r}=o(e);if(r.length)return{people:r,cursor:n};let l=new Map;for(let e of t)!e.authorXUserId||l.has(e.authorXUserId)||l.set(e.authorXUserId,{xUserId:e.authorXUserId,screenName:e.authorScreenName,name:e.authorScreenName,description:null,location:null,url:null,profileImageUrl:null,profileBannerUrl:null,followersCount:null,followingCount:null,statusesCount:null,listedCount:null,mediaCount:null,isVerified:null,isBlueVerified:null,isProtected:null,professionalCategory:null,pinnedPostIds:null,xCreatedAt:null,isOrganization:!1,affiliationName:null,affiliationScreenName:null,affiliationBadgeUrl:null});return{people:Array.from(l.values()),cursor:n}}function u(e){if(!e)return null;let t=e.trim(),n=t.match(/^(?:https?:\/\/)?(?:www\.|mobile\.)?(?:twitter|x)\.com\/(.+)$/i);return n&&(t=n[1].split(/[/?#]/)[0]),(t=t.replace(/^@+/,""))?t.toLowerCase():null}e.s(["decodeCreateTweet",0,function(e){let t=e?.data?.create_tweet?.tweet_results?.result;return t?i(t):null},"decodeSearchPeople",0,c,"decodeTimeline",0,o,"decodeUser",0,s,"upgradeProfileImageUrl",0,n,"xPostUrl",0,function(e,t){return e?`https://x.com/${e}/status/${t}`:`https://x.com/i/web/status/${t}`}],893586),e.s(["normalizeScreenName",0,u],225655);let d=0;function m(){return!("u"<typeof document)&&"true"===document.documentElement.getAttribute("data-boring-linkedin-ext")}async function p(e,t,n){let r;try{let n=await fetch("/api/x/tunnel",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,args:t})});if(!n.ok){let e=await n.json().catch(()=>({}));return{ok:!1,error:e.error||`Enqueue failed (HTTP ${n.status})`}}if(!(r=(await n.json()).id))return{ok:!1,error:"Enqueue returned no id"}}catch(e){return{ok:!1,error:e?.message||"Enqueue failed"}}let l=Date.now()+n;for(;Date.now()<l;){await new Promise(e=>setTimeout(e,1500));try{let e=await fetch(`/api/x/tunnel?id=${encodeURIComponent(r)}`);if(!e.ok)continue;let t=await e.json();if("completed"===t.status)return t.result??{ok:!0,data:void 0};if("failed"===t.status||"skipped"===t.status)return t.result??{ok:!1,error:t.error||`Action ${t.status}`}}catch{}}return{ok:!1,error:"Timed out waiting for a browser session to run this"}}async function f(e,t={},n={}){if(!n.forceTunnel&&m()){var r;let l=await (r=n.timeoutMs??3e4,new Promise(n=>{let l=(d=d+1&0x7fffffff,`${Date.now().toString(36)}-${d.toString(36)}`),a=!1,s=e=>{let t=e.detail;!t||t.id!==l||a||(a=!0,window.removeEventListener("everything-x-action-response",s),clearTimeout(i),n({ok:!!t.ok,status:t.status,data:t.data,error:t.error}))},i=setTimeout(()=>{a||(a=!0,window.removeEventListener("everything-x-action-response",s),n({ok:!1,error:"Extension did not respond"}))},r);window.addEventListener("everything-x-action-response",s),window.dispatchEvent(new CustomEvent("everything-x-action",{detail:{id:l,action:e,args:t}}))}));if(l.ok||"extension_reloaded"!==l.error&&"Extension did not respond"!==l.error)return l}return p(e,t,n.timeoutMs??9e4)}async function h(e){let t=u(e);if(!t)return{ok:!1,error:"screen_name required"};let n=await f("x_fetch_profile",{screen_name:t});if(!n.ok)return{ok:!1,status:n.status,error:n.error||"Profile fetch failed"};let r=s(n.data);return r?.xUserId?{ok:!0,data:{xUserId:r.xUserId,screenName:r.screenName}}:{ok:!1,error:"Profile has no user id"}}async function x(e,t,n={}){let r=e.userId?.trim()||null,l=null;if(!r&&e.handle){let t=await h(e.handle);if(!t.ok||!t.data)return{ok:!1,status:t.status,error:t.error};r=t.data.xUserId,l=t.data.screenName}return r?{...await function(e,t,n={}){return"replies"===t?function(e,t={}){return f("x_user_tweets_and_replies",{user_id:e,...t})}(e,n):"media"===t?function(e,t={}){return f("x_user_media",{user_id:e,...t})}(e,n):function(e,t={}){return f("x_user_tweets",{user_id:e,...t})}(e,n)}(r,t,n),resolvedUserId:r,resolvedScreenName:l}:{ok:!1,error:"user_id or screen_name required"}}function g(e){let t=(e.screenName||"").replace(/^@/,"");return t?{xUserId:e.xUserId,screenName:t,name:e.name?.trim()||t,description:e.description,location:e.location,profileImageUrl:e.profileImageUrl,followersCount:e.followersCount,isVerified:!!e.isVerified,isBlueVerified:!!e.isBlueVerified,isOrganization:!!e.isOrganization,affiliationName:e.affiliationName}:null}function y(e){let t=[],n=new Set;for(let r of e){if(!r||"object"!=typeof r)continue;let e=String(r.screen_name||"").replace(/^@/,"");if(!e)continue;let l=e.toLowerCase();if(n.has(l))continue;n.add(l);let a=r.profile_image_url_https||r.profile_image_url;t.push({xUserId:null!=r.id_str?String(r.id_str):null!=r.id?String(r.id):null,
1screenName:e,name:String(r.name||e),description:"string"==typeof r.description?r.description:null,location:"string"==typeof r.location?r.location:null,profileImageUrl:a?String(a).replace(/_(normal|bigger|mini|200x200)(\.[a-z]{3,4})$/i,"_400x400$2"):null,followersCount:"number"==typeof r.followers_count?r.followers_count:null,isVerified:!!r.verified,isBlueVerified:!!(r.is_blue_verified||r.ext_is_blue_verified),isOrganization:!1,affiliationName:null})}return t}async function b(e,t={}){let n=e.trim();if(!n)return{ok:!0,data:{people:[]}};let r=Math.min(t.count??8,20),l=new URLSearchParams({q:n,src:"search_box",result_type:"users",count:String(r)}),a=await f("x_api",{url:`https://x.com/i/api/1.1/search/typeahead.json?${l.toString()}`,method:"GET"});return a.ok?{ok:!0,data:{people:y(Array.isArray(a.data?.users)?a.data.users:[]).slice(0,r)}}:{ok:!1,error:a.error}}async function w(e,t={}){let n=Math.min(t.count??20,50),r=await function(e,t={}){return f("x_search",{query:e,...t})}(e,{count:n,product:"People",...t.cursor?{cursor:t.cursor}:{}});if(r.ok){let e=c(r.data);return{ok:!0,data:{people:e.people.map(g).filter(e=>!!e),cursor:e.cursor,source:"timeline"}}}if(t.cursor)return{ok:!1,status:r.status,error:r.error||"Could not load more results"};let l=await f("x_people_search",{query:e,count:n});if(l.ok&&l.data?.people)return{ok:!0,data:{people:l.data.people,cursor:l.data.cursor??null,source:l.data.cursor?"timeline":"typeahead"}};let a=new URLSearchParams({q:e,src:"search_box",result_type:"users",count:String(n)}),s=await f("x_api",{url:`https://x.com/i/api/1.1/search/typeahead.json?${a.toString()}`,method:"GET"});return s.ok?{ok:!0,data:{people:y(Array.isArray(s.data?.users)?s.data.users:[]),cursor:null,source:"typeahead"}}:{ok:!1,status:s.status??r.status,error:s.error||r.error||"Search failed"}}e.s(["createXPost",0,function(e){return f("x_create_tweet",{text:e.text,...e.replyTo?{reply_to:e.replyTo}:{}},{timeoutMs:45e3})},"deleteXPost",0,function(e){return f("x_delete_tweet",{tweet_id:e},{timeoutMs:45e3})},"fetchXUserTimelineForIdentity",0,x,"isExtensionInstalled",0,m,"searchXPeople",0,w,"typeaheadXPeople",0,b,"xAction",0,f],602487)},24708,e=>{"use strict";var t=e.i(677241);e.s(["constructNow",0,function(e){return(0,t.constructFrom)(e,Date.now())}])},980797,e=>{"use strict";var t=e.i(677241),n=e.i(24708),r=e.i(550516);e.s(["isToday",0,function(e,l){return(0,r.isSameDay)((0,t.constructFrom)(l?.in||e,e),(0,n.constructNow)(l?.in||e))}])},839166,803635,e=>{"use strict";var t=e.i(281092);e.s(["setHours",0,function(e,n,r){let l=(0,t.toDate)(e,r?.in);return l.setHours(n),l}],839166),e.s(["setMinutes",0,function(e,n,r){let l=(0,t.toDate)(e,r?.in);return l.setMinutes(n),l}],803635)},64402,e=>{"use strict";let t=(0,e.i(475254).default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);e.s(["default",0,t])},728480,e=>{"use strict";var t=e.i(64402);e.s(["ArrowDownToLine",()=>t.default])},34016,e=>{"use strict";let t=(0,e.i(475254).default)("baseline",[["path",{d:"M4 20h16",key:"14thso"}],["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);e.s(["default",0,t])},882025,e=>{"use strict";let t=(0,e.i(475254).default)("blocks",[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]);e.s(["default",0,t])},961888,e=>{"use strict";var t=e.i(882025);e.s(["Blocks",()=>t.default])},298809,e=>{"use strict";let t=(0,e.i(475254).default)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]);e.s(["default",0,t])},747697,e=>{"use strict";var t=e.i(361277);e.s(["CalendarIcon",()=>t.default])},915952,e=>{"use strict";let t=(0,e.i(475254).default)("file-pen-line",[["path",{d:"m18.226 5.226-2.52-2.52A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-.351",key:"1k2beg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);e.s(["default",0,t])},406120,e=>{"use strict";var t=e.i(915952);e.s(["FileSignature",()=>t.default])},338714,e=>{"use strict";let t=(0,e.i(475254).default)("film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);e.s(["default",0,t])},493886,e=>{"use strict";var t=e.i(338714);e.s(["Film",()=>t.default])},262860,e=>{"use strict";let t=(0,e.i(475254).default)("handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);e.s(["default",0,t])},149685,e=>{"use strict";var t=e.i(262860);e.s(["Handshake",()=>t.default])},296497,e=>{"use strict";let t=(0,e.i(475254).default)("highlighter",[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]]);e.s(["default",0,t])},192986,20623,e=>{"use strict";var t=e.i(475254);let n=(0,t.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);e.s(["default",0,n],192986);let r=(0,t.default)("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",ke
1y:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);e.s(["default",0,r],20623)},101405,e=>{"use strict";let t=(0,e.i(475254).default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);e.s(["default",0,t])},939951,e=>{"use strict";var t=e.i(101405);e.s(["ListTodo",()=>t.default])},406940,778835,e=>{"use strict";var t=e.i(475254);let n=(0,t.default)("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);e.s(["default",0,n],406940);let r=(0,t.default)("text-align-justify",[["path",{d:"M3 5h18",key:"1u36vt"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 19h18",key:"awlh7x"}]]);e.s(["default",0,r],778835)},393392,57522,e=>{"use strict";var t=e.i(475254);let n=(0,t.default)("text-align-center",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]]);e.s(["default",0,n],393392);let r=(0,t.default)("text-align-end",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}
1]]);e.s(["default",0,r],57522)},977258,e=>{"use strict";let t=(0,e.i(475254).default)("ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);e.s(["default",0,t])},208402,853265,e=>{"use strict";var t=e.i(977258);function n(e){let t=e.match(/urn:li:(?:fsd_)?company:(\d+)/);return t?`urn:li:fsd_company:${t[1]}`:e}function r(e,t){let n=t.filter(e=>"linkedin"===e.platform&&!!e.urn&&!!e.name).map(t=>({entity:t,pos:e.indexOf(t.token)})).filter(e=>e.pos>=0).sort((e,t)=>e.pos-t.pos),r=0,l="",a=[];for(let{entity:t}of n){let n=e.indexOf(t.token,r);if(n<0)continue;let s=(l+=e.slice(r,n)).length;l+=t.name,a.push({start:s,length:t.name.length,entity:t}),r=n+t.token.length}return{text:l+=e.slice(r),spans:a}}e.s(["Ticket",()=>t.default],208402),e.s(["adaptTextForX",0,function(e,t){let n=e;for(let e of t){if("x"===e.platform)continue;let t=n.indexOf(e.token);t>=0&&(n=n.slice(0,t)+e.name+n.slice(t+e.token.length))}return n},"buildLinkedInMessageBody",0,function(e,t){let{text:l,spans:a}=r(e,t);return{text:l,attributes:a.map(({start:e,length:t,entity:r})=>({start:e,length:t,attributeKindUnion:{entity:{urn:"company"===r.kind?n(r.urn):r.urn}}}))}},"buildLinkedInPostCommentary",0,function(e,t){let{text:l,spans:a}=r(e,t);return{text:l,attributesV2:a.map(({start:e,length:t,entity:r})=>({start:e,length:t,detailDataUnion:"company"===r.kind?{companyMention:n(r.urn)}:{profileMention:r.urn},$type:"com.linkedin.voyager.dash.common.text.TextAttribute"}))}},"pruneMentions",0,function(e,t){return t.filter(t=>e.includes(t.token))}],853265)},612329,e=>{"use strict";let t=(0,e.i(475254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",0,t])},727612,e=>{"use strict";var t=e.i(612329);e.s(["Trash2",()=>t.default])},808554,e=>{"use strict";let t=(0,e.i(475254).default)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);e.s(["default",0,t])},335416,e=>{"use strict";var t=e.i(808554);e.s(["Workflow",()=>t.default])},752822,(e,t,n)=>{"use strict";var r=e.r(271645),l=e.r(802239),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=l.useSyncExternalStore,i=r.useRef,o=r.useEffect,c=r.useMemo,u=r.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,t,n,r,l){var d=i(null);if(null===d.current){var m={hasValue:!1,value:null};d.current=m}else m=d.current;var p=s(e,(d=c(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),void 0!==l&&m.hasValue){var t=m.value;if(l(t,e))return i=t}return i=e}if(t=i,a(s,e))return t;var n=r(e);return void 0!==l&&l(t,n)?(s=e,t):(s=e,i=n)}var s,i,o=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,l]))[0],d[1]);return o(function(){m.hasValue=!0,m.value=p},[p]),u(p),p}},430224,(e,t,n)=>{"use strict";e.i(247167),t.exports=e.r(752822)}]);
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.