PageSourceSearch

https://www.gemphere.com/assets/DigestActionConfirm-1BoxlTCv.js

js gemphere.com collected 2026-09-24 14:43:41 UTC 10,614 bytes, 1 lines download raw bytes

1import{cr as te,u as ne,z as ae,r as l,cs as re,j as e,P as ie,ct as le,bT as p,b_ as G,bU as oe,cu as ce}from"./index-BVpny5eT.js";import{H as w,C as Y,c as R}from"./card-DhoUrTwb.js";import{T as D}from"./textarea-BO5nTpve.js";import{A as q}from"./arrow-right-CxLcKX5N.js";function v(s,n="there"){return((s==null?void 0:s.name)||(s==null?void 0:s.email)||n).toString()}function u(s,n="there"){const a=String(s||"").trim();return a?a.split(/\s+/)[0]:n}function B(s){return`${s}${s.endsWith("s")?"'":"'s"}`}function de(s){return String(s||"").trim().split(/\n\n+/).filter(Boolean).map((a,r)=>e.jsx("p",{className:"mb-4 whitespace-pre-line leading-relaxed last:mb-0",children:a},r))}function F({text:s,placeholder:n}){const a=s.trim();return a?e.jsx(e.Fragment,{children:de(a)}):e.jsxs("p",{className:"mb-4 italic leading-relaxed text-[#807667]",children:["[",n,"]"]})}function M({recipientName:s,connectorName:n,otherName:a,bylineName:r,bylineExtra:c,blurb:i}){const C=u(s),b=u(a,"them"),j=n||"A friend";return e.jsxs("div",{className:"rounded-xl bg-[#f4eadc] p-5 text-[15px] leading-relaxed text-[#28251f]",children:[e.jsxs("p",{className:"mb-4",children:["Hi ",C,","]}),e.jsxs("p",{className:"mb-4",children:[j," would like to intro you to ",a||b,"."]}),e.jsx(F,{text:i,placeholder:`${B(b)} blurb here`}),e.jsxs("p",{className:"mb-4",children:["If you're open to meeting ",b,", hit"," ",e.jsx("span",{className:"font-semibold text-[#1c1a17]",children:"Yes, connect us"})," and we'll loop you both in."]}),e.jsx("p",{className:"mb-1",children:"Best,"}),e.jsx("p",{className:"mb-1 font-semibold",children:"Gem"}),e.jsxs("p",{className:"text-[13px] leading-relaxed text-[#8d8272]",children:["Ecosystem analyst to ",r,c?` · ${c}`:""]})]})}function k({children:s}){return e.jsx("div",{className:"mb-3 mt-7 text-[12px] font-semibold uppercase tracking-[0.08em] text-[#8d8272] first:mt-0",children:s})}function me(s){return s==="digest_meet"?{title:"Send this intro?",primary:"Send intro",subtitle:"We'll start the double opt-in. Both sides confirm before contact info is shared."}:s==="digest_ask"?{title:"Ask for this intro?",primary:"Ask for intro",subtitle:"Your connector will get a one-tap email with your blurb. They forward only if they're up for it."}:s==="digest_help"?{title:"Make this intro?",primary:"Send intro",subtitle:"We'll send a quick yes/not-now to both people. Nothing goes out without their consent."}:{title:"Confirm action?",primary:"Confirm",subtitle:""}}function be(){const{token:s=""}=te(),{user:n,isReady:a}=ne(),r=ae(),c=(n==null?void 0:n.accessToken)||"",[i,C]=l.useState(null),[b,j]=l.useState(!1),[N,I]=l.useState(!1),[$,y]=l.useState(null),[O,U]=l.useState(null),[d,A]=l.useState(""),[S,H]=l.useState(""),[L,z]=l.useState(!1),_=l.useCallback(async()=>{if(!(!s||!c)){j(!0),y(null);try{const t=await re(c,s);C(t),A(String(t.payload.blurb||"")),H(String(t.payload.note||t.payload.context||""))}catch(t){y(t instanceof Error?t.message:String(t))}finally{j(!1)}}},[s,c]);l.useEffect(()=>{if(a){if(!n){r(`/?returnTo=${encodeURIComponent(`/digest/action/${s}`)}`,{replace:!0});return}_()}},[a,n,r,s,_]);async function V(){if(i){I(!0),y(null);try{const t=await ce(c,s,{blurb:d.trim()||void 0,note:S.trim()||void 0});U({introId:t.introId||0})}catch(t){y(t instanceof Error?t.message:String(t))}finally{I(!1)}}}if(!a)return e.jsx("div",{className:"gp-page-loading-screen",children:e.jsx(ie,{variant:"page",message:"Signing you in…"})});if(O)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(w,{}),e.jsx("main",{className:"pt-24 pb-16 px-4 max-w-2xl mx-auto",children:e.jsx(Y,{className:"border-emerald-500/40",children:e.jsxs(R,{className:"p-6 text-center space-y-4",children:[e.jsx(le,{className:"w-10 h-10 text-emerald-500 mx-auto"}),e.jsx("h1",{className:"text-xl font-semibold",children:"You're done — we've taken it from here."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The intro is now in your Intros tab. You'll see it move through the pipeline as the other side responds."}),e.jsxs("div",{className:"flex justify-center gap-2 pt-2",children:[e.jsxs(p,{onClick:()=>r("/warm-intros"),children:["Open Intros",e.jsx(q,{className:"w-4 h-4 ml-2"})]}),e.jsx(p,{variant:"outline",onClick:()=>r("/home"),children:"Back home"})]})]})})})]});if(b)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(w,{}),e.jsx("main",{className:"pt-24 pb-16 px-4 max-w-2xl mx-auto",children:e.jsxs("div",{className:"flex items-center justify-center text-muted-foreground gap-2 py-12",children:[e.jsx(G,{className:"w-4 h-4 animate-spin"}),"Loading the request…"]})})]});if($)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(w,{}),e.jsx("main",{className:"pt-24 pb-16 px-4 max-w-2xl mx-auto",children:e.jsx(Y,{className:"border-destructive/40",children:e.jsxs(R,{className:"p-6 text-center space-y-3",children:[e.jsx(oe,{className:"w-10 h-10 text-destructive mx-auto"}),e.jsx("h1",{className:"text-xl font-semibold",children:"We couldn't load this request"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e.jsx(p,{variant:"outline",onClick:()=>r("/home"),children:"Back home"})]})})})]});if(!i)return null;const X=me(i.kind),m=i.payload||{},J=m.target||{},K=m.connector||{},Q=m.askerForIntro||{},Z=m.recipient||{},o=v(Z,m.recipientName||"there"),x=v(J,"the other person"),f=i.kind==="digest_help"?o:v(K,m.adminName||"Gemphere"),P=v(Q,o),E=u(o),h=u(x,"them"),W=u(f),T=u(P,"them"),g=S.trim(),ee=g||"Open to making the intro? We'll handle the rest before anyone is looped in.",se=g||`${f} has ${x} in their network and can intro you — would it be helpful for what you're focused on?`;return e.jsxs("div",{className:"min-h-screen bg-[#e7dece]",children:[e.jsx(w,{}),e.jsx("main",{className:"px-4 pb-14 pt-24 sm:px-6",children:e.jsxs("div",{className:"mx-auto max-w-[520px]",children:[e.jsxs("div",{className:"rounded-2xl bg-[#fff3e4] px-8 py-9 text-[#27231d] shadow-sm sm:px-10",children:[e.jsxs("p",{className:"mb-7 text-[16px] font-medium",children:["Hey ",E,","]}),L&&e.jsxs("div",{className:"mb-7 space-y-4 rounded-xl border border-[#e2d7c5] bg-[#fbefdf] p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[12px] font-semibold uppercase tracking-[0.08em] text-[#756d60]",children:"Message"}),e.jsx(D,{rows:4,value:S,onChange:t=>H(t.target.value),placeholder:"The short context that goes in the body of the email.",className:"border-[#d8cbb8] bg-[#fff8ee] text-[14px]"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[12px] font-semibold uppercase tracking-[0.08em] text-[#756d60]",children:"Blurb"}),e.jsx(D,{rows:5,value:d,onChange:t=>A(t.target.value),placeholder:"The intro paragraph the other person will see.",className:"border-[#d8cbb8] bg-[#fff8ee] text-[14px]"})]})]}),i.kind==="digest_help"&&e.jsxs(e.Fragment,{children:[e.jsxs(k,{children:[T," will see this"]}),e.jsxs("div",{className:"rounded-xl bg-[#f4eadc] p-5 text-[15px] leading-relaxed text-[#28251f]",children:[e.jsxs("p",{className:"mb-4",children:["Hey ",T,","]}),e.jsx("p",{className:"mb-4 whitespace-pre-line",children:se}),e.jsx(F,{text:d,placeholder:`${B(h)} blurb here`}),e.jsxs("p",{className:"mb-4",children:["If you're open to meeting ",h,", hit"," ",e.jsx("span",{className:"font-semibold text-[#1c1a17]",children:"Yes, connect us"})," and we'll loop you both in."]}),e.jsx("p",{className:"mb-1",children:"Best,"}),e.jsx("p",{className:"mb-1 font-semibold",children:"Gem"}),e.jsxs("p",{className:"text-[13px] leading-relaxed text-[#8d8272]",children:["Ecosystem analyst to ",o]})]}),e.jsxs(k,{children:["Then ",h," sees this once ",T," says yes"]}),e.jsx(M,{recipientName:x,connectorName:f,otherName:P,bylineName:o,blurb:d})]}),i.kind==="digest_meet"&&e.jsxs(e.Fragment,{children:[e.jsxs(k,{children:["What goes out to ",h]}),e.jsxs("div",{className:"rounded-xl bg-[#f4eadc] p-5 text-[15px] leading-relaxed text-[#28251f]",children:[e.jsxs("p",{className:"mb-4",children:["Hi ",h,","]}),e.jsxs("p",{className:"mb-4",children:[o," would like to intro themselves to you",g?".":" — would it be helpful for what you're focused on?"]}),g&&e.jsx("p",{className:"mb-4 whitespace-pre-line",children:g}),e.jsx(F,{text:d,placeholder:`${B(E)} blurb here`}),e.jsxs("p",{className:"mb-4",children:["If you're open to meeting ",E,", hit"," ",e.jsx("span",{className:"font-semibold text-[#1c1a17]",children:"Yes, connect us"})," and we'll loop you both in."]}),e.jsx("p",{className:"mb-1",children:"Best,"}),e.jsx("p",{className:"mb-1 font-semibold",children:"Gem"}),e.jsxs("p",{className:"text-[13px] leading-relaxed text-[#8d8272]",children:["Ecosystem analyst to ",x]})]})]}),i.kind==="digest_ask"&&e.jsxs(e.Fragment,{children:[e.jsxs(k,{children:[W," will see this"]}),e.jsxs("div",{className:"rounded-xl bg-[#f4eadc] p-5 text-[15px] leading-relaxed text-[#28251f]",children:[e.jsxs("p",{className:"mb-4",children:["Hey ",W,","]}
1),e.jsxs("p",{className:"mb-4",children:[e.jsx("span",{className:"font-semibold",children:o})," would like to reach"," ",e.jsx("span",{className:"font-semibold",children:x})," and noticed you two are connected."]}),e.jsx("p",{className:"mb-4 whitespace-pre-line",children:ee}),e.jsxs("div",{className:"mb-4 rounded-xl bg-[#fff3e4] p-4",children:[e.jsxs("p",{className:"mb-3 text-[13px] text-[#6f6658]",children:["Here's the email we'll send to ",h," for them:"]}),e.jsx(M,{recipientName:x,connectorName:f,otherName:o,bylineName:o,bylineExtra:`forwarded by ${f}`,blurb:d})]})]})]}),e.jsxs("div",{className:"mt-7 flex flex-wrap items-center gap-3",children:[e.jsxs(p,{onClick:V,disabled:N,className:"rounded-full bg-[#1f1d1a] px-6 text-white hover:bg-[#2d2a25]",children:[N?e.jsx(G,{className:"mr-1 h-4 w-4 animate-spin"}):e.jsx(q,{className:"mr-1 h-4 w-4"}),X.primary]}),e.jsx(p,{type:"button",variant:"outline",onClick:()=>z(t=>!t),disabled:N,className:"rounded-full border-[#d5c8b7] bg-[#fff9ef] px-6 text-[#29251f] hover:bg-[#f7ead9]",children:L?"Preview":"Edit first"}),e.jsx(p,{type:"button",variant:"ghost",onClick:()=>r("/home"),disabled:N,className:"rounded-full px-3 text-[#8b806f] hover:bg-[#f5e9d9] hover:text-[#29251f]",children:"Pass"})]}),e.jsxs("div",{className:"mt-7 border-t border-[#e2d7c5] pt-5 text-[12px] leading-relaxed text-[#8d8272]",children:["Via ",e.jsx("span",{className:"font-semibold underline",children:"Gemphere"}),". Warm intros to anyone, through people who already have your back."]})]}),e.jsx("div",{className:"mt-5 text-center text-[12px] text-[#8d8272]",children:"© 2026 Gemphere"})]})})]})}export{be as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.