PageSourceSearch

https://getvoltr.com/app/assets/ReuseMessagesModal-CJnG_mZm.js

js getvoltr.com collected 2026-10-02 05:04:02 UTC 2,229 bytes, 1 lines download raw bytes

1import{j as s}from"./react-BJCrwb27.js";import{a as v}from"./tanstack-BOscu_PA.js";import"./index-Cok8iJMB.js";import{aZ as C,M as L,S as M,ag as R,aT as $,a as b}from"./route-support-BEJAjkqU.js";import"./vendor-DIeMxnSD.js";function U({allowedTypes:t,creator:i,layer:j="default",onClose:u,onPick:S}){var p,y;const o=v({queryKey:["outreach-type-messages"],queryFn:({signal:e})=>b("/api/outreach?action=type_messages",{signal:e}),staleTime:6e4}),r=(t==null?void 0:t.length)===1?t[0]:"",m=v({queryKey:["outreach-message-history",r],queryFn:({signal:e})=>b(`/api/outreach?action=message_history&type=${encodeURIComponent(r)}`,{signal:e}),enabled:!!r,staleTime:6e4}),f=((p=o.data)==null?void 0:p.messages)||{},h=e=>{var a;return((a=f[e])==null?void 0:a.body)||R[e]||""},N=!!(i&&(i.name||i.handle)),d=e=>{e&&(S(N&&i?$(e,i):e),u())},E=e=>d(h(e)),g=t!=null&&t.length?new Set(t):null,c=C.filter(e=>!g||g.has(e.type)).map(e=>({...e,body:h(e.type)})).filter(e=>e.body),B=new Set(c.map(e=>String(e.body).trim().toLowerCase()).filter(Boolean)),l=(((y=m.data)==null?void 0:y.messages)||[]).map(e=>String(e.body||"").trim()).filter(Boolean).filter(e=>!B.has(e.toLowerCase()));return s.jsx(L,{layer:j,onClose:u,title:"Reuse a message",width:"520px",children:o.isLoading&&!o.data||m.isLoading&&!m.data?s.jsx(M,{variant:"rows",count:4,label:"Loading messages"}):c.length||l.length?s.jsxs("div",{className:"rum-list",children:[c.map(e=>{const a=String(e.body).replace(/\s+/g," ").trim(),n=a.length>220?`${a.slice(0,220)}…`:a;return s.jsxs("div",{children:[s.jsx("div",{className:"rum-section-label",children:e.label}),s.jsx("button",{className:"rum-item",type:"button",onClick:()=>E(e.type),children:s.jsx("div",{className:"rum-item-text",children:n})})]},e.type)}),l.length?s.jsxs("div",{children:[s.jsx("div",{className:"rum-section-label",children:"Recent history"}),l.map((e,a)=>{const n=e.replace(/\s+/g," ").trim(),x=n.length>220?`${n.slice(0,220)}…`:n;return s.jsx("button",{className:"rum-item",type:"button",onClick:()=>d(e),children:s.jsx("div",{className:"rum-item-text",children:x})},`${r}-${a}-${x}`)})]}):null]}):s.jsx("div",{className:"rum-empty",children:"No reusable messages available."})})}export{U as ReuseMessagesModal};

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.