PageSourceSearch

https://waitlister.me/_nuxt/Bojsz_PN.js

js waitlister.me collected 2026-09-24 19:57:52 UTC 12,718 bytes, 5 lines download raw bytes

1import{a1 as ve,i as me,y as we,a8 as ye,T as xe,b3 as be}from"./H-WxSoCY.js";import{G as ke,s as _e,n as T,I as Se,a,b as l,i as q,j as $e,u as d,x as k,e as r,y as h,F as X,k as Ce,f as Ie,t as Q,z as Z,B as Te,Y as Me,D as Ae,C as Be,_ as Ee,r as p,q as H,O as Pe}from"./BW5XXfU3.js";const Ne={class:"h-12 flex items-center justify-between px-4 py-3 border-b border-border bg-bgSecondary"},Oe={class:"flex items-center gap-2"},He={class:"flex items-center gap-1.5"},je=["innerHTML"],Ue={key:2,class:"inline-flex gap-1 items-center"},De={key:0,class:"mt-1 ml-1.5 flex items-center gap-0.5 text-textSecondary"},Le=["onClick"],ze=["fill"],Re=["onClick"],Ve=["fill"],We=["title","onClick"],Ke={key:0,viewBox:"0 0 24 24",class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor","stroke-width":"2"},Je={key:1,viewBox:"0 0 24 24",class:"w-3.5 h-3.5 text-green-600",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Ye=["disabled"],Fe={key:0,class:"text-center text-xs text-textSecondary py-1"},Ge=["disabled","onKeydown"],qe=["disabled"],Xe=["aria-label"],Qe={key:0,viewBox:"0 0 24 24",class:"w-6 h-6",fill:"none",stroke:"currentColor","stroke-width":"2"},Ze={key:1,viewBox:"0 0 24 24",class:"w-6 h-6",fill:"none",stroke:"currentColor","stroke-width":"2"},j="wl_support_session",U="wl_support_messages",ee="wl_support_owner",te=30,ne="/(?:pricing|docs|contact|sign-up|features|integrations|upgrade|settings|p|thank-you)[\\w/#?=&.\\-]*",et={__name:"SupportWidget",props:{inline:{type:Boolean,default:!1}},setup(v){const oe=v,re=me(),D=we(),{$auth:L}=ye(),z=p(null);let M=null;const f=p(!1),m=p(""),s=p([]),_=p(""),w=p(!1),g=p(""),$=p(null),y=p(null),R=H(()=>!w.value&&m.value.trim().length>0),A=H(()=>{const e=z.value,n=re.user||{},o=e?.uid||n.uid;return o?{uid:o,email:e?.email||n.email?.current||n.email||null,plan:n.product?.name||n.product?.id||null}:null});function se(){try{g.value=localStorage.getItem(j)||E(),localStorage.setItem(j,g.value);const e=localStorage.getItem(U);e&&(s.value=JSON.parse(e).slice(-te))}catch{g.value=E()}}function B(){try{localStorage.setItem(U,JSON.stringify(s.value.slice(-te)))}catch{}}function E(){try{if(crypto?.randomUUID)return crypto.randomUUID().replace(/-/g,"")}catch{}return`s${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}function P(){return{role:"assistant",greeting:!0,content:A.value?"Hi! I'm Waitlister's AI assistant. How can I help with your waitlist today?":"Hi! I'm Waitlister's AI assistant. Ask me anything about features, pricing, or whether Waitlister fits your use case."}}function V(){_.value="",g.value=E(),s.value=[P()],localStorage.setItem(j,g.value),localStorage.removeItem(U),T(()=>{S(),y.value?.focus()})}function ae(e){const n=e||"anon";let o=null;try{o=localStorage.getItem(ee)}catch{}if(o!==n){V();try{localStorage.setItem(ee,n)}catch{}}}function le(){f.value=!f.value,f.value&&(s.value.length||s.value.push(P()),T(()=>{S(),y.value?.focus()}))}function ie(e){const n=e.target;n.style.height="auto",n.style.height=Math.min(n.scrollHeight,112)+"px"}function S(){T(()=>{$.value&&($.value.scrollTop=$.value.scrollHeight)})}function ce(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function W(e){const n=e.match(/[.,:!?]+$/),o=n?n[0]:"";return{clean:o?e.slice(0,-o.length):e,trail:o}}function N(e){return e=e.replace(/`([^`]+)`/g,"<code>$1</code>"),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/__([^_]+)__/g,"<strong>$1</strong>"),e=e.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>"),e=e.replace(new RegExp(`\\[([^\\]]+)\\]\\((https?:\\/\\/[^\\s)]+|${ne})\\)`,"g"),(n,o,t)=>`<a href="${t}"${t.startsWith("http")?' target="_blank" rel="noopener noreferrer"':""}>${o}</a>`),e=e.replace(/(^|[\s(])(https?:\/\/[^\s)]+)/g,(n,o,t)=>{const{clean:i,trail:c}=W(t);return`${o}<a href="${i}" target="_blank" rel="noopener noreferrer">${i}</a>${c}`}),e=e.replace(new RegExp(`(^|[\\s(])(${ne})`,"g"),(n,o,t)=>{const{clean:i,trail:c}=W(t);return`${o}<a href="${i}">${i}</a>${c}`}),e}function ue(e){if(!e)return"";const n=ce(e).split(`
2`);let o="",t=null,i=[];const c=()=>{i.length&&(o+=`<p>${N(i.join(" "))}</p>`,i=[])},u=()=>{t&&(o+=`</${t}>`,t=null)};for(const O of n){const x=O.trim();if(!x){c(),u();continue}const b=x.match(/^[-*]\s+(.*)$/),C=x.match(/^\d+\.\s+(.*)$/);b?(c(),t!=="ul"&&(u(),o+="<ul>",t="ul"),o+=`<li>${N(b[1])}</li>`):C?(c(),t!=="ol"&&(u(),o+="<ol>",t="ol"),o+=`<li>${N(C[1])}</li>`):(u(),i.push(x))}return c(),u(),o}const de=H(()=>{for(let e=s.value.length-1;e>=0;e--)if(s.value[e].role==="assistant")return e;return-1});async function K(){if(!R.value)return;const e=m.value.trim();m.value="",_.value="",y.value&&(y.value.style.height="auto"),s.value.push({role:"user",content:e}),await J()}async function J(){const e=Pe({role:"assistant",content:"",streaming:!0});s.value.push(e),w.value=!0,S();const n={sessionId:g.value,pageUrl:window.location.href,user:A.value,messages:s.value.filter(t=>!t.streaming).map(t=>({role:t.role,content:t.content}))},o={"Content-Type":"application/json","x-app-uid":D};if(A.value)try{const t=await be();t&&(o.Authorization=`Bearer ${t}`)}catch{}try{const t=await fetch("/api/public/support/chat",{method:"POST",headers:o,body:JSON.stringify(n)});if(t.status===429){e.streaming=!1,s.value.pop(),_.value="You're sending messages a bit fast — please wait a minute and try again.";return}if(!t.ok||!t.body)throw new Error(`HTTP ${t.status}`);const i=t.body.getReader(),c=new TextDecoder;let u="";for(;;){const{done:O,value:x}=await i.read();if(O)break;u+=c.decode(x,{stream:!0});let b;for(;(b=u.indexOf(`
3
4`))!==-1;){const C=u.slice(0,b);u=u.slice(b+2);for(const ge of C.split(`
5`)){const F=ge.trim();if(!F.startsWith("data:"))continue;const G=F.slice(5).trim();if(!G)continue;let I;try{I=JSON.parse(G)}catch{continue}I.delta&&(e.content+=I.delta,S()),I.done&&(e.streaming=!1)}}}}catch(t){console.error("support chat error:",t),e.content||(e.content="Sorry — something went wrong on my end. Please try again in a moment.")}
5finally{e.streaming=!1,w.value=!1,B(),S()}}async function pe(e){try{await navigator.clipboard.writeText(e.content),e.copied=!0,setTimeout(()=>{e.copied=!1},1500)}catch{}}function Y(e,n,o){e.rating=e.rating===o?null:o,B(),he(n,e.rating)}async function he(e,n){try{await fetch("/api/public/support/feedback",{method:"POST",headers:{"Content-Type":"application/json","x-app-uid":D},body:JSON.stringify({sessionId:g.value,messageIndex:e,rating:n})})}catch{}}async function fe(){w.value||(s.value[s.value.length-1]?.role==="assistant"&&s.value.pop(),s.value[s.value.length-1]?.role==="user"&&await J())}return ke(s,B,{deep:!0}),_e(()=>{se(),oe.inline&&!s.value.length&&(s.value.push(P()),T(()=>y.value?.focus())),L?.onAuthStateChanged&&(M=L.onAuthStateChanged(e=>{z.value=e?{uid:e.uid,email:e.email}:null,ae(e?.uid||null)}))}),Se(()=>{M&&M()}),(e,n)=>{const o=xe;return a(),l("div",{class:k(["wl-support",v.inline?"h-full":""])},[q(Ee,{name:"wl-support-pop"},{default:$e(()=>[d(f)||v.inline?(a(),l("div",{key:0,class:k(["flex flex-col bg-bgBase overflow-hidden border border-border rounded-2xl",v.inline?"relative w-full h-full shadow-lg":"fixed z-[60] bottom-20 right-4 sm:right-6 w-[calc(100vw-2rem)] sm:w-[26rem] min-h-[25rem] max-h-[min(36rem,calc(100vh-8rem))] shadow-2xl"]),role:"dialog","aria-label":"Support chat"},[r("div",Ne,[r("div",Oe,[q(o,{class:"w-4 h-4 flex-shrink-0"}),n[3]||(n[3]=r("div",{class:"font-semibold text-sm text-textPrimary"},"AI Assistant",-1))]),r("div",He,[r("button",{class:"text-sm px-3 py-1.5 flex items-center justify-center gap-1.5 font-semibold text-sm font-display text-textSecondary bg-transparent hover:text-textPrimary hover:bg-bgThird rounded-lg transition-all ease-in-out duration-200 tracking-wide disabled:hover:bg-accent disabled:cursor-not-allowed whitespace-nowrap",title:"Start a new chat",onClick:V}," New chat "),v.inline?h("",!0):(a(),l("button",{key:0,class:"text-textSecondary hover:text-textPrimary p-1 rounded-md transition-all ease-in-out duration-200","aria-label":"Close",onClick:n[0]||(n[0]=t=>f.value=!1)},[...n[4]||(n[4]=[r("svg",{viewBox:"0 0 24 24",class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2"},[r("path",{d:"M6 6l12 12M18 6L6 18","stroke-linecap":"round"})],-1)])]))])]),r("div",{ref_key:"scrollEl",ref:$,class:"flex-1 overflow-y-auto px-4 py-4 space-y-3"},[(a(!0),l(X,null,Ce(d(s),(t,i)=>(a(),l("div",{key:i,class:k(["flex flex-col",t.role==="user"?"items-end":"items-start"])},[r("div",{class:k(["max-w-[85%] px-3.5 py-2 rounded-2xl text-sm leading-relaxed break-words",t.role==="user"?"bg-bgThird text-textPrimary rounded-br-sm border border-border whitespace-pre-wrap":"bg-transparent"])},[t.role==="assistant"&&t.content?(a(),l("div",{key:0,class:"wl-md",innerHTML:ue(t.content)},null,8,je)):t.role==="user"?(a(),l(X,{key:1},[Ie(Q(t.content),1)],64)):h("",!0),t.role==="assistant"&&t.streaming&&!t.content?(a(),l("span",Ue,[...n[5]||(n[5]=[r("span",{class:"wl-dot"},null,-1),r("span",{class:"wl-dot"},null,-1),r("span",{class:"wl-dot"},null,-1)])])):h("",!0)],2),t.role==="assistant"&&!t.streaming&&t.content&&!t.greeting?(a(),l("div",De,[r("button",{class:k(["p-1 rounded hover:bg-bgThird transition",t.rating==="up"?"text-green-600":"hover:text-textPrimary"]),title:"Helpful",onClick:c=>Y(t,i,"up")},[(a(),l("svg",{viewBox:"0 0 24 24",class:"w-3.5 h-3.5",fill:t.rating==="up"?"currentColor":"none",stroke:"currentColor","stroke-width":"2"},[...n[6]||(n[6]=[r("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"},null,-1)])],8,ze))],10,Le),r("button",{class:k(["p-1 rounded hover:bg-bgThird transition",t.rating==="down"?"text-red-500":"hover:text-textPrimary"]),title:"Not helpful",onClick:c=>Y(t,i,"down")},[(a(),l("svg",{viewBox:"0 0 24 24",class:"w-3.5 h-3.5",fill:t.rating==="down"?"currentColor":"none",stroke:"currentColor","stroke-width":"2"},[...n[7]||(n[7]=[r("path",{d:"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"},null,-1)])],8,Ve))],10,Re),r("button",{class:"p-1 rounded hover:bg-bgThird hover:text-textPrimary transition",title:t.copied?"Copied":"Copy",onClick:c=>pe(t)},[t.copied?(a(),l("svg",Je,[...n[9]||(n[9]=[r("path",{d:"M20 6L9 17l-5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(a(),l("svg",Ke,[...n[8]||(n[8]=[r("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),r("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},null,-1)])]))],8,We),i===d(de)?(a(),l("button",{key:0,class:"p-1 rounded hover:bg-bgThird hover:text-textPrimary transition disabled:opacity-40",title:"Regenerate",disabled:d(w),onClick:n[1]||(n[1]=c=>fe())},[...n[10]||(n[10]=[r("svg",{viewBox:"0 0 24 24",class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor","stroke-width":"2"},[r("polyline",{points:"23 4 23 10 17 10"}),r("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})],-1)])],8,Ye)):h("",!0)])):h("",!0)],2))),128)),d(_)?(a(),l("div",Fe,Q(d(_)),1)):h("",!0)],512),r("form",{class:"border-t border-border p-2.5 flex items-end gap-2",onSubmit:Z(K,["prevent"])},[Te(r("textarea",{ref_key:"inputEl",ref:y,"onUpdate:modelValue":n[2]||(n[2]=t=>Ae(m)?m.value=t:null),rows:"1",disabled:d(w),placeholder:"Ask a question…",class:"flex-1 resize-none max-h-32 bg-bgSecondary",style:{"scrollbar-width":"thin"},onKeydown:Me(Z(K,["exact","prevent"]),["enter"]),onInput:ie},null,40,Ge),[[Be,d(m)]]),r("button",{type:"submit",disabled:!d(R),class:"shrink-0 h-9 w-9 flex items-center justify-center rounded-xl bg-primary text-textPrimary disabled:opacity-40 disabled:cursor-not-allowed hover:opacity-90","aria-label":"Send"},[...n[11]||(n[11]=[r("svg",{viewBox:"0 0 24 24",class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2"},[r("path",{d:"M5 12h14M13 6l6 6-6 6","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,qe)],32)],2)):h("",!0)]),_:1}
5),v.inline?h("",!0):(a(),l("button",{key:0,class:"fixed z-[60] bottom-4 right-4 sm:right-6 h-14 w-14 rounded-full bg-primary text-textPrimary shadow-lg flex items-center justify-center hover:scale-105 active:scale-95 transition-transform","aria-label":d(f)?"Close support chat":"Open support chat",onClick:le},[d(f)?(a(),l("svg",Ze,[...n[13]||(n[13]=[r("path",{d:"M6 6l12 12M18 6L6 18","stroke-linecap":"round"},null,-1)])])):(a(),l("svg",Qe,[...n[12]||(n[12]=[r("path",{d:"M21 11.5a8.38 8.38 0 0 1-8.5 8.5 8.5 8.5 0 0 1-3.8-.9L3 21l1.9-5.7a8.5 8.5 0 1 1 16.1-3.8z","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],8,Xe))],2)}}},ot=ve(et,[["__scopeId","data-v-02208a7a"]]);export{ot as _};

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.