PageSourceSearch

https://www.tryly.ai/_next/static/chunks/59327-8295df5e17ca4b82.js

js tryly.ai collected 2026-10-02 06:27:31 UTC 17,538 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[59327],{17977:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(95155),l=n(27139);function i(e){let{message:t,onReply:n,busy:i=!1,replyLabel:r="Reply to Emily",variant:s="inline",theme:c="light",className:o}=e,d=(0,l.cloudMessageText)(t);return d?(0,a.jsxs)("div",{className:o?"emily-inline ".concat(o):"emily-inline","data-variant":s,"data-theme":c,children:[(0,a.jsx)("style",{children:"\n.emily-inline {\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n  width: 100%;\n  padding: 12px 14px;\n  border: 1px solid #99f6e4;\n  border-radius: 14px;\n  background: linear-gradient(180deg, #f0fdfa 0%, #ecfdf5 100%);\n  font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;\n  color: #134e4a;\n  text-align: left;\n}\n.emily-inline-head {\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  min-width: 0;\n}\n.emily-inline-dot {\n  width: 7px;\n  height: 7px;\n  border-radius: 50%;\n  background: #22c55e;\n  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);\n  flex: 0 0 auto;\n}\n.emily-inline-name {\n  font-size: 13px;\n  font-weight: 600;\n  color: #0f766e;\n  letter-spacing: -0.1px;\n  flex: 0 0 auto;\n}\n.emily-inline-subtitle {\n  font-size: 12px;\n  color: #5eaaa2;\n  min-width: 0;\n  overflow-wrap: anywhere;\n}\n@media (max-width: 359px) {\n  .emily-inline-subtitle { display: none; }\n}\n.emily-inline-message {\n  margin: 0;\n  font-size: 13.5px;\n  line-height: 1.5;\n  color: #134e4a;\n  white-space: pre-wrap;\n  overflow-wrap: anywhere;\n  word-break: break-word;\n}\n.emily-inline-reply {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  align-self: stretch;\n  min-height: 44px;\n  padding: 0 18px;\n  border: 1px solid #0d9488;\n  border-radius: 12px;\n  background: #ffffff;\n  color: #0f766e;\n  font-family: inherit;\n  font-size: 14px;\n  font-weight: 600;\n  cursor: pointer;\n  -webkit-tap-highlight-color: transparent;\n  transition: background-color 160ms ease;\n}\n.emily-inline-reply:hover { background: #f0fdfa; }\n.emily-inline-reply[disabled] { opacity: 0.6; cursor: default; }\n.emily-inline-reply:focus-visible {\n  outline: 2px solid #0f766e;\n  outline-offset: 2px;\n}\n.emily-inline[data-theme='dark'] {\n  border-color: rgba(255, 255, 255, 0.15);\n  background: rgba(255, 255, 255, 0.06);\n  color: rgba(255, 255, 255, 0.85);\n}\n.emily-inline[data-theme='dark'] .emily-inline-name { color: #ffffff; }\n.emily-inline[data-theme='dark'] .emily-inline-subtitle { color: rgba(255, 255, 255, 0.5); }\n.emily-inline[data-theme='dark'] .emily-inline-message { color: rgba(255, 255, 255, 0.85); }\n.emily-inline[data-theme='dark'] .emily-inline-reply {\n  border-color: rgba(255, 255, 255, 0.15);\n  background: rgba(255, 255, 255, 0.1);\n  color: #ffffff;\n}\n.emily-inline[data-theme='dark'] .emily-inline-reply:hover { background: rgba(255, 255, 255, 0.16); }\n.emily-inline[data-theme='dark'] .emily-inline-reply:focus-visible {\n  outline: 2px solid #5eead4;\n  outline-offset: 2px;\n}\n@media (min-width: 420px) {\n  .emily-inline-reply { align-self: flex-start; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .emily-inline-reply { transition: none; }\n}\n"}),(0,a.jsxs)("div",{className:"emily-inline-head",children:[(0,a.jsx)("span",{className:"emily-inline-dot","aria-hidden":"true"}),(0,a.jsx)("span",{className:"emily-inline-name",children:"Emily"}),(0,a.jsx)("span",{className:"emily-inline-subtitle",children:l.EMILY_SUBTITLE})]}),(0,a.jsx)("p",{className:"emily-inline-message",children:d}),(0,a.jsx)("button",{type:"button",className:"emily-inline-reply",onClick:n,disabled:i,children:r})]}):null}},59327:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var a=n(95155),l=n(12115),i=n(94514),r=n(6296),s=n(51914),c=n(67899),o=n(25344),d=n(14405),u=n(53961),m=n(25777),x=n(22754),h=n(46815),f=n(7236),p=n(92628),b=n(23079),y=n(62164),g=n(17977),w=n(91399);function v(e){var t,n;let{isOpen:v,onClose:j,theme:k="light",onSuccess:N,wall:_=null}=e,{plan:S,billingInterval:C,refreshCredits:P,credits:A}
1=(0,h.A)(),E="annual"===C?"annual":"monthly",M=()=>"u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"".concat(Date.now(),"-").concat(Math.round(1e9*Math.random())),T=e=>{try{localStorage.removeItem("qt_nonce:".concat(e))}catch(e){}},[I,U]=(0,l.useState)(null),[q,B]=(0,l.useState)(null),z=(0,l.useMemo)(()=>(0,b.xX)(S,I,q),[S,I,q]),F=(0,l.useMemo)(()=>(0,b.y5)(S,I,q),[S,I,q]),[O,D]=(0,l.useState)(null!=(t=z[1])?t:z[0]),[R,L]=(0,l.useState)(""),[X,Y]=(0,l.useState)(null!=(n=F[1])?n:F[0]),$=(0,l.useRef)(!1),[W,V]=(0,l.useState)(!1),[J,K]=(0,l.useState)(null),[G,H]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)(!1),[ee,et]=(0,l.useState)(!1),[en,ea]=(0,l.useState)(null),[el,ei]=(0,l.useState)(0),[er,es]=(0,l.useState)(null),ec=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!R&&!z.includes(O)){var e;D(null!=(e=z[1])?e:z[0])}},[z,R,O]),(0,l.useEffect)(()=>{var e;$.current||Y(null!=(e=F[1])?e:F[0])},[F]),(0,l.useEffect)(()=>{if(!v)return;let e=e=>{"Escape"===e.key&&j()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v,j]),(0,l.useEffect)(()=>{if(!v)return;H(!1),K(null),V(!1),Z(!1),et(!1),es(null),$.current=!1;let e=!1;return(async()=>{try{let t=await fetch("/api/credits/quick-topup"),n=await t.json();e||ea((null==n?void 0:n.hasCard)?{brand:n.brand,last4:n.last4}:null)}catch(t){e||ea(null)}})(),()=>{e=!0}},[v]);let eo="free"!==S,ed=(0,w.E)({moment:"paid_wall",active:v&&eo,surface:"buy_credits_popup",payload:{wall:(null==_?void 0:_.kind)?{kind:_.kind,units:_.units}:null},wall:{openedBy:"auto"}}),eu=eo&&ed.render,em=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!eu)return;let e=em.current;if(!e)return;let t=!1;try{var n,a,l;t=null!=(n=null==(a=(l=window).matchMedia)?void 0:a.call(l,"(prefers-reduced-motion: reduce)").matches)&&n}catch(e){}try{e.scrollIntoView({block:"nearest",behavior:t?"auto":"smooth"})}catch(e){}},[eu]),(0,l.useEffect)(()=>{!v&&ec.current&&(clearTimeout(ec.current),ec.current=null)},[v]),(0,l.useEffect)(()=>()=>{ec.current&&clearTimeout(ec.current)},[]);let[ex,eh]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!v)return;let e=!1;return(async()=>{try{let t=await fetch("/api/credits/rescue-offer/can-offer",{method:"POST"}),n=await t.json();!e&&n.shouldShow&&eh({credits:n.credits,priceCents:n.priceCents,planMonthlyCredits:n.planMonthlyCredits,regularPriceCents:n.regularPriceCents})}catch(e){}})(),()=>{e=!0}},[v]),(0,l.useEffect)(()=>{if(!v)return;let e=!1;return(async()=>{try{let a=(0,f.createClient)(),{data:{user:l}}=await a.auth.getUser();if(!l||e)return;let{data:i}=await a.from("fashion_users").select("id").eq("auth_user_id",l.id).maybeSingle();if(!(null==i?void 0:i.id)||e)return;let{data:r}=await a.from("fashion_subscriptions").select("pricing_version, v2_pack_id").eq("user_id",i.id).in("status",["active","canceled"]).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(!e){var t,n;U(null!=(t=null==r?void 0:r.pricing_version)?t:null),B(null!=(n=null==r?void 0:r.v2_pack_id)?n:null)}}catch(e){}})(),()=>{e=!0}},[v]),!v)return null;if(ex)return(0,a.jsx)(p.y,{priceCents:ex.priceCents,credits:ex.credits,regularPriceCents:ex.regularPriceCents,planMonthlyCredits:ex.planMonthlyCredits,onAccept:async()=>{try{let e=await fetch("/api/credits/rescue-offer/accept",{method:"POST"}),t=await e.json();if(t.checkoutUrl){window.location.href=t.checkoutUrl;return}window.alert(t.error||"Unable to start checkout. Please try again.")}catch(e){window.alert("Unable to start checkout. Please try again.")}},onDecline:async()=>{eh(null);try{await fetch("/api/credits/rescue-offer/decline",{method:"POST"})}catch(e){}},onClose:()=>{eh(null),j()}});let ef="dark"===k,ep=(0,b.rI)(S),eb=Math.min(b.tU,Math.max(b.XS,X||b.XS)),ey=(0,b.Lv)(S,E,I,eb,q),eg=(0,b.OM)(eb,S,E,I,q),ew=e=>{ec.current&&clearTimeout(ec.current),ec.current=setTimeout(()=>{ec.current=null,e(),j()},1500)},ev=async(e,t)=>{for(let n=0;n<12;n++){let n=await P();if(n>=e+t)return n;await new Promise(e=>setTimeout(e,1e3))}return null},ej=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(W)return;e&&(e=>{try{localStorage.setItem("qt_nonce:".concat(e),M())}catch(e){}})(eb);let t=(e=>{try{let t=localStorage.getItem("qt_nonce:".concat(e));if(t)return t;let n=M();return localStorage.setItem("qt_nonce:".concat(e),n),n}catch(e){return M()}})(eb);V(!0),K(null);try{let a=await fetch("/api/credits/quick-topup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({credits:eb,clientNonce:t,force:e})}),l=await a.json().catch(()=>({}));if(l&&(l.succeeded&&!l.grantPending||l.duplicateSuspected||l.fallbackToCheckout)&&T(eb),null==l?void 0:l.duplicateSuspected){var n;l.brand&&l.last4&&ea({brand:l.brand,last4:l.last4}),V(!1),es({credits:null!=(n=l.credits)?n:eb,newBalance:"number"==typeof l.newBalance?l.newBalance:null});return}if((null==l?void 0:l.succeeded)&&!(null==l?void 0:l.grantPending)&&"number"==typeof l.newBalance){l.brand&&l.last4&&ea({brand:l.brand,last4:l.last4}),ei(eb),V(!1),H(!0),await P(),ew(()=>null==N?void 0:N(l.newBalance));return}if((null==l?void 0:l.succeeded)||(null==l?void 0:l.chargePending)){l.brand&&l.last4&&ea({brand:l.brand,last4:l.last4}),ei(eb),V(!1),H(!0),Z(!0);let e=await ev(A,eb);null!==e?(T(eb),ew(()=>null==N?void 0:N(e))):et(!0);return}if(null==l?void 0:l.fallbackToCheckout)return void await (0,b.pD)(eb);throw Error((null==l?void 0:l.error)||"Could not complete the top-up.")}catch(e){K(e instanceof Error?e.message:"Something went wrong. Please try again."),V(!1)}},ek=async()=>{es(null),await P(),j()},eN=async()=>{try{await ed.reply()}finally{j()}};return(0,a.jsx)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm animate-in fade-in-0 duration-200",onClick:j,"data-chat-quiet-block":!0,children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),style:ef?{background:"rgba(28,28,30,0.78)",backdropFilter:"blur(60px) saturate(1.8) brightness(1.08)",WebkitBackdropFilter:"blur(60px) saturate(1.8) brightness(1.08)",border:"0.5px solid rgba(255,255,255,0.18)",boxShadow:"0 8px 64px rgba(0,0,0,0.5), inset 0 0.5px 0 rgba(255,255,255,0.12)"}:void 0,className:"relative w-full max-w-sm rounded-3xl animate-in zoom-in-95 duration-200 ".concat(eu?"flex flex-col max-h-[92dvh] overflow-y-auto overscroll-contain":"p-6 sm:p-7 max-h-[92vh] overflow-y-auto"," ").concat(ef?"text-white":"bg-gradient-to-br from-white via-white to-slate-50/90 border border-white/60 shadow-[0_20px_80px_rgba(0,0,0,0.25)] text-slate-900"),children:[(0,a.jsxs)("div",{className:eu?"flex-1 min-h-0 overflow-y-auto overscroll-contain px-6 sm:px-7 pt-6 sm:pt-7 shadow-[inset_0_-12px_12px_-12px_rgba(15,23,42,0.12)]":"contents",children:[(0,a.jsx)("div",{className:"flex justify-center mb-3",children:(0,a.jsx)(x.A,{className:"w-11 h-11"})}),(0,a.jsx)("h2",{className:"text-center text-xl font-extrabold tracking-tight mb-1 ".concat(ef?"text-white":"text-slate-900"),children:"You're out of credits"}),(0,a.jsx)("p",{className:"text-center text-sm font-semibold leading-relaxed mb-4 ".concat(ef?"text-white/75":"text-slate-600"),children:en?"Add credits instantly with your saved card.":"Choose an amount and continue to secure checkout."}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm mb-4 ".concat(ef?"text-white/70":"text-slate-600"),children:[(0,a.jsx)("span",{className:"font-medium",children:"Your rate:"}),(0,a.jsxs)("span",{className:"line-through ".concat(ef?"text-white/35":"text-slate-400"),children:["$",ep.toFixed(2)]}),(0,a.jsxs)("span",{className:"font-bold ".concat(ef?"text-white":"text-slate-900"),children:["$",ey.toFixed(2),"/credit"]})]}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(y.A,{value:eb,onChange:e=>{$.current=!0,Y(e)}
1,quickAmounts:F,getPrice:e=>(0,b.OM)(e,S,E,I,q),getReward:e=>{let t=(0,b.vc)(e,S,E,I,q);return t.isReward?{listPrice:(t.listAmountCents/100).toFixed(2),savingsPct:t.savingsPct}:null},min:b.XS,max:b.tU,dark:ef,variant:"compact",disabled:W})}),eu&&(0,a.jsx)("div",{ref:em,className:"mt-4 min-w-0 scroll-mb-2",children:(0,a.jsx)(g.A,{message:ed.opener,onReply:eN,busy:ed.replying,theme:ef?"dark":"light"})})]}),(0,a.jsxs)("div",{className:eu?"flex-none px-6 sm:px-7 pb-6 sm:pb-7 pt-3":"contents",children:[J&&(0,a.jsx)("p",{className:"text-center text-xs font-medium text-red-400 mb-3",children:J}),en&&(0,a.jsxs)("div",{className:"flex items-center justify-center gap-1.5 text-[12px] mb-2.5 ".concat(ef?"text-white/55":"text-slate-500"),children:[(0,a.jsx)("span",{children:"Charged instantly to"}),(0,a.jsxs)("span",{className:"font-semibold ".concat(ef?"text-white/85":"text-slate-700"),children:[(0,a.jsx)("span",{className:"capitalize",children:en.brand})," •••• ",en.last4]})]}),(0,a.jsx)("button",{onClick:()=>ej(),disabled:W||eb<b.XS,className:"w-full flex items-center justify-center gap-2 rounded-2xl py-3.5 px-4 font-bold text-base text-white bg-gradient-to-r from-emerald-500 to-teal-500 shadow-[0_8px_24px_rgba(16,185,129,0.3)] hover:from-emerald-600 hover:to-teal-600 hover:shadow-[0_12px_32px_rgba(16,185,129,0.42)] hover:scale-[1.02] transition-all disabled:opacity-60 disabled:hover:scale-100",children:W?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.A,{className:"w-5 h-5 animate-spin"})," ",en?"Charging…":"Starting checkout…"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.A,{className:"w-5 h-5",strokeWidth:3})," Add ",eb," Credits \xb7 $",eg]})}),(0,a.jsxs)("button",{onClick:()=>{window.location.href="/account#pricing"},disabled:W,className:"mt-2.5 w-full flex items-center justify-center gap-2 rounded-2xl py-3 px-4 font-semibold text-sm transition-all disabled:opacity-60 ".concat(ef?"bg-white/10 text-white hover:bg-white/16 border border-white/15":"bg-gradient-to-r from-slate-900 to-slate-800 text-white hover:shadow-lg"),children:[(0,a.jsx)(o.A,{className:"w-4 h-4"})," Upgrade plan instead"]}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-x-3.5 gap-y-1 flex-wrap mt-3 text-[11px] font-semibold ".concat(ef?"text-white/55":"text-slate-500"),children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"w-3.5 h-3.5 text-blue-600"})," Valid 365 days"]}),en?(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(u.A,{className:"w-3.5 h-3.5 text-amber-500"})," Instant when available"]}):(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(m.A,{className:"w-3.5 h-3.5 text-amber-500"})," Secure checkout"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(i.A,{className:"w-3.5 h-3.5 text-violet-600"})," Keep on cancel"]})]}),(0,a.jsx)("button",{onClick:j,disabled:W,className:"mt-3 w-full text-center text-sm underline underline-offset-4 transition-colors disabled:opacity-60 ".concat(ef?"text-white/50 hover:text-white/80":"text-slate-500 hover:text-slate-700"),children:"Maybe later"})]}),er&&(0,a.jsxs)("div",{className:"absolute inset-0 rounded-3xl flex flex-col items-center justify-center text-center p-6 animate-in fade-in-0 duration-200 ".concat(ef?"bg-[#1c1c1e]":"bg-gradient-to-br from-white to-slate-50"),children:[(0,a.jsx)("h3",{className:"text-lg font-extrabold mb-1.5 ".concat(ef?"text-white":"text-slate-900"),children:"You just added credits"}),(0,a.jsxs)("p",{className:"text-sm mb-5 ".concat(ef?"text-white/60":"text-slate-500"),children:[er.credits," credits were added a moment ago. Add ",er.credits," more?"]}),(0,a.jsxs)("button",{onClick:()=>{es(null),ej(!0)},disabled:W,className:"w-full flex items-center justify-center gap-2 rounded-2xl py-3 px-4 font-bold text-base text-white bg-gradient-to-r from-emerald-500 to-teal-500 shadow-[0_8px_24px_rgba(16,185,129,0.3)] hover:from-emerald-600 hover:to-teal-600 transition-all disabled:opacity-60 disabled:hover:from-emerald-500 disabled:hover:to-teal-500",children:[W?(0,a.jsx)(r.A,{className:"w-5 h-5 animate-spin"}):(0,a.jsx)(c.A,{className:"w-5 h-5"})," Yes, add ",er.credits," more \xb7 $",(0,b.OM)(er.credits,S,E,I,q)]}),(0,a.jsx)("button",{onClick:ek,className:"mt-3 text-sm underline underline-offset-4 ".concat(ef?"text-white/50 hover:text-white/80":"text-slate-500 hover:text-slate-700"),
1children:"No, I'm all set"})]}),G&&(0,a.jsxs)("div",{className:"absolute inset-0 rounded-3xl flex flex-col items-center justify-center text-center p-6 animate-in fade-in-0 duration-200 ".concat(ef?"bg-[#1c1c1e]":"bg-gradient-to-br from-white to-emerald-50"),children:[(0,a.jsx)("div",{className:"w-16 h-16 rounded-full bg-emerald-500/15 flex items-center justify-center mb-3",children:(0,a.jsx)(i.A,{className:"w-8 h-8 text-emerald-500",strokeWidth:3})}),(0,a.jsx)("h3",{className:"text-lg font-extrabold ".concat(ef?"text-white":"text-slate-900"),children:Q?"".concat(el," credits on the way"):"".concat(el," credits added")}),en&&(0,a.jsxs)("p",{className:"text-xs mt-1 ".concat(ef?"text-white/55":"text-slate-500"),children:["Charged to ",(0,a.jsx)("span",{className:"capitalize",children:en.brand})," •••• ",en.last4]}),(0,a.jsx)("p",{className:"text-xs mt-2 font-semibold text-emerald-500",children:ee?"Payment confirmed — your credits are arriving, this can take a moment.":Q?"Confirming your payment…":"Back to creating…"}),ee&&(0,a.jsx)("button",{onClick:j,className:"mt-4 rounded-2xl py-2.5 px-6 font-bold text-sm text-white bg-gradient-to-r from-emerald-500 to-teal-500",children:"Done"})]})]})})}}}]);

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.