PageSourceSearch

https://2nd-look.vercel.app/_next/static/chunks/618-31cda8bac1a85199.js

js 2nd-look.vercel.app collected 2026-10-03 05:52:42 UTC 15,373 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[618],{5889:(e,t,r)=>{r.d(t,{UQ:()=>i,GA:()=>c,BX:()=>v,CH:()=>f,qN:()=>h,UB:()=>w,dT:()=>g,LV:()=>m,vG:()=>d,W1:()=>u});var n=r(6161),a=r(7163);let s=n.gMt("stage",[n.Ikc({stage:n.euz("retrieval"),incidents:n.YOg(n.Ikc({id:n.YjP(),brand:n.YjP(),title:n.YjP(),year:n.aig(),region:n.YjP(),matchedSignals:n.YOg(n.YjP())}))}),n.Ikc({stage:n.euz("calendar"),launchDate:n.YjP().nullable(),hits:n.YOg(a.t9)}),n.Ikc({stage:n.euz("creative")}),n.Ikc({stage:n.euz("model"),model:n.YjP(),attempt:n.aig()}),n.Ikc({stage:n.euz("validating")}),n.Ikc({stage:n.euz("complete"),result:a.DJ}),n.Ikc({stage:n.euz("error")}).extend(a.ol.shape)]);class i extends Error{constructor(e,t,r){super(t),this.name="ApiRequestError",this.code=e,this.status=r}}async function o(e){try{let t=a.ol.safeParse(await e.json());if(t.success)return new i(t.data.error.code,t.data.error.message,e.status)}catch(e){}return new i("http_error","Request failed (HTTP ".concat(e.status,")."),e.status)}async function l(e,t,r){let n;try{n=await fetch(e,r)}catch(e){throw new i("network","Couldn't reach the server. Check your connection and try again.",0)}if(!n.ok)throw await o(n);let a=t.safeParse(await n.json());if(!a.success)throw new i("invalid_response","The server sent an unexpected response.",n.status);return a.data}async function c(e,t,r){let n;try{n=await fetch("/api/analyze",{method:"POST",headers:{"content-type":"application/json",accept:"application/x-ndjson"},body:JSON.stringify(e),signal:r})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw e;throw new i("network","Couldn't reach the server. Check your connection and try again.",0)}if(!n.ok||!n.body)throw await o(n);let a=n.body.pipeThrough(new TextDecoderStream).getReader(),l="",c=null;for(;;){var d;let{value:e,done:r}=await a.read();e&&(l+=e);let n=l.split("\n");for(let e of(l=r?"":null!=(d=n.pop())?d:"",r?n.filter(Boolean):n)){if(!e.trim())continue;let r=s.safeParse(JSON.parse(e));if(!r.success)continue;let n=r.data;if("error"===n.stage)throw new i(n.error.code,n.error.message,200);"complete"===n.stage&&(c=n.result),t(n)}if(r)break}if(!c)throw new i("incomplete","The analysis stopped before finishing. Try again.",200);return c}async function d(e){let t=new FormData;t.append("file",e);let{url:r}=await l("/api/upload",n.Ikc({url:n.YjP()}),{method:"POST",body:t});return r}async function u(e){let{upload:t}=await r.e(333).then(r.bind(r,4333));try{return(await t(e.name||"creative",e,{access:"public",handleUploadUrl:"/api/upload"})).url}catch(e){throw new i("upload_failed",e instanceof Error?e.message:"Upload failed.",0)}}let p=n.Ikc({jobId:n.YjP(),magicHourProjectId:n.YjP(),prompt:n.YjP(),creditsCharged:n.aig(),requestBody:n.g1P(n.YjP(),n.L5J()),job:a.LE});function m(e){return l("/api/generate",p,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function h(e){return l("/api/generate/".concat(encodeURIComponent(e)),a.LE,{cache:"no-store"})}let x=n.Ikc({free:n.aig().int().min(0),reviews:n.aig().int().min(0),code:n.YjP().nullable(),renders:n.aig().int().min(0).nullable()});function f(e){let t=e?"?analysis=".concat(encodeURIComponent(e)):"";return l("/api/wallet".concat(t),x,{cache:"no-store"})}function w(e){return l("/api/wallet/restore",x,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:e})})}function g(e){return l("/api/checkout",n.Ikc({url:n.OZ5()}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pack:e})})}let b=n.Ikc({status:n.k5n(["fulfilled","pending","not_paid"]),reviews:n.aig().int().min(0)});function v(e){return l("/api/checkout/confirm",b,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e})})}},8618:(e,t,r)=>{r.r(t),r.d(t,{BillingProvider:()=>h,RunNote:()=>y,WalletButton:()=>j,reviewsLabel:()=>m,useBilling:()=>p});var n=r(5155),a=r(6497),s=r(3825),i=r(2115),o=r(5889),l=r(6161);l.k5n(["starter","team","agency"]);let c=[{id:"starter",name:"Starter",reviews:10,priceCents:1500,blurb:"One campaign and its revisions"}
1,{id:"team",name:"Team",reviews:50,priceCents:5900,blurb:"A brand team’s launch calendar"},{id:"agency",name:"Agency",reviews:200,priceCents:19900,blurb:"Many clients, many markets"}];l.YjP().regex(new RegExp("^[".concat("0123456789ABCDEFGHJKMNPQRSTVWXYZ","]{").concat(20,"}$")));var d=r(2248);let u=(0,i.createContext)(null);function p(){return(0,i.useContext)(u)}function m(e){return"".concat(e," ").concat(1===e?"review":"reviews")}function h(e){let{enabled:t,children:r}=e;return t?(0,n.jsx)(x,{children:r}):(0,n.jsx)(n.Fragment,{children:r})}function x(e){let{children:t}=e,[r,a]=(0,i.useState)(null),[s,l]=(0,i.useState)({open:!1,reason:null}),[c,d]=(0,i.useState)(null),p=(0,i.useCallback)(async()=>{try{a(await (0,o.CH)())}catch(e){}},[]);(0,i.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=e.get("purchase"),r=e.get("session_id");if(t){e.delete("purchase"),e.delete("session_id");let t=e.toString();window.history.replaceState(null,"","".concat(window.location.pathname).concat(t?"?".concat(t):"").concat(window.location.hash))}if("success"===t&&r)return void(0,o.BX)(r).then(async e=>{let t=await (0,o.CH)();a(t),d("fulfilled"===e.status?{title:"".concat(m(e.reviews)," added. You have ").concat(m(t.reviews),"."),body:"Keep this recovery code to use them in another browser. It’s also on the Stripe checkout page.",code:t.code}:"pending"===e.status?{title:"Your payment is processing.",body:"The ".concat(m(e.reviews)," are added as soon as Stripe confirms it. Bank payments can take a few days.")}:{title:"That checkout didn’t finish, so nothing was charged."})}).catch(()=>{d({title:"Checkout complete. Your reviews will appear in a minute.",body:"If they don’t, reload the page."}),p()});"cancelled"===t&&d({title:"Checkout cancelled. Nothing was charged."}),p()},[p]);let h=(0,i.useCallback)(()=>d(null),[]),x=(0,i.useMemo)(()=>({wallet:r,allowance:r?r.free+r.reviews:null,openPricing:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return l({open:!0,reason:e})},refresh:p}),[r,p]);return(0,n.jsxs)(u.Provider,{value:x,children:[t,(0,n.jsx)(f,{open:s.open,reason:s.reason,wallet:r,onClose:()=>l(e=>({...e,open:!1})),onRestored:e=>{a(e),l(e=>({...e,open:!1})),d({title:"Reviews restored. You have ".concat(m(e.reviews),".")})}}),(0,n.jsx)(v,{notice:c,onDismiss:h})]})}function f(e){let{open:t,reason:r,wallet:a,onClose:s,onRestored:l}=e,d=(0,i.useRef)(null),u=(0,i.useId)(),[p,h]=(0,i.useState)(null),[x,f]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=d.current;e&&(t&&!e.open?(f(null),e.showModal()):!t&&e.open&&e.close())},[t]),(0,i.useEffect)(()=>{let e=e=>e.persisted&&h(null);return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[]);let w=async e=>{h(e),f(null);try{let{url:t}=await (0,o.dT)(e);window.location.assign(t)}catch(e){h(null),f(e instanceof o.UQ?e.message:"Checkout didn’t open, and nothing was charged. Try again.")}};return(0,n.jsxs)("dialog",{ref:d,"aria-labelledby":"".concat(u,"-title"),onClose:s,onClick:e=>{e.target===e.currentTarget&&s()},className:"sheet-dialog m-auto max-h-[calc(100dvh-2rem)] w-[min(50rem,calc(100%-2rem))] max-w-none overflow-y-auto rounded-[12px] border border-rule bg-paper p-0 text-ink backdrop:bg-[rgb(10_11_13/0.5)]",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-6 border-b border-rule px-5 pt-6 pb-5 sm:px-7",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{id:"".concat(u,"-title"),className:"font-serif text-[2rem] leading-none tracking-tight sm:text-[2.4rem]",children:"Buy reviews"}),(0,n.jsx)("p",{className:"mt-3 max-w-[60ch] text-[0.95rem] leading-relaxed text-ink-2",children:function(e){let t="Each review reads the picture, the words and the launch date against every market you pick, and includes one alternative from Magic Hour.";return"review"===e?"You’ve used your free review. ".concat(t):"render"===e?"This review’s included alternative is used. Another one costs one review from a pack.":t}(r)}),a&&a.reviews>0&&(0,n.jsxs)("p",{className:"mt-2 text-[0.9rem] text-ink-3",children:["You have ",m(a.reviews)," left."]})]}),(0,n.jsx)("button",{type:"button",onClick:s,"aria-label":"Close",className:"-mr-2 -mt-1 grid h-10 w-10 shrink-0 place-items-center rounded-[6px] text-ink-3 transition-colors hover:bg-sheet hover:text-ink",children:(0,n.jsx)("svg",{viewBox:"0 0 16 16",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6","aria-hidden":!0,
1children:(0,n.jsx)("path",{d:"M3 3l10 10M13 3L3 13",strokeLinecap:"round"})})})]}),(0,n.jsx)("ul",{className:"grid gap-3 px-5 py-5 sm:grid-cols-3 sm:px-7",children:c.map(e=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button",disabled:null!==p,onClick:()=>w(e.id),className:"group grid h-full w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] border border-rule bg-sheet px-4 py-3.5 text-left transition-colors hover:border-ink focus-visible:border-ink disabled:cursor-wait disabled:opacity-60 disabled:hover:border-rule sm:flex sm:flex-col sm:items-stretch sm:py-4",children:[(0,n.jsxs)("span",{className:"flex flex-col",children:[(0,n.jsx)("span",{className:"text-[0.85rem] text-ink-3",children:e.name}),(0,n.jsxs)("span",{className:"mt-1.5 flex flex-wrap items-baseline gap-x-2 sm:mt-2",children:[(0,n.jsx)("span",{className:"font-serif text-[2.2rem] leading-none sm:text-[2.5rem]",children:function(e){let t=e/100;return Number.isInteger(t)?"$".concat(t):"$".concat(t.toFixed(2))}(e.priceCents)}),(0,n.jsxs)("span",{className:"text-[0.85rem] text-ink-3",children:["$".concat((e.priceCents/e.reviews/100).toFixed(2))," a review"]})]}),(0,n.jsx)("span",{className:"mt-2 text-[1rem] font-medium sm:mt-3",children:m(e.reviews)}),(0,n.jsx)("span",{className:"mt-0.5 text-[0.88rem] text-ink-2",children:e.blurb})]}),(0,n.jsx)("span",{className:"sm:mt-auto sm:pt-4",children:(0,n.jsx)("span",{className:"block rounded-[6px] bg-ink px-4 py-2.5 text-center text-[0.92rem] font-medium whitespace-nowrap text-paper transition-colors duration-200 group-enabled:group-hover:bg-pencil",children:p===e.id?"Opening…":(0,n.jsxs)(n.Fragment,{children:["Buy",(0,n.jsxs)("span",{className:"max-sm:hidden",children:[" ",e.reviews," reviews"]})]})})})]})},e.id))}),(0,n.jsxs)("div",{className:"px-5 pb-5 sm:px-7",children:[(0,n.jsx)("p",{className:"max-w-[70ch] text-[0.88rem] leading-relaxed text-ink-3",children:"Reviews never expire. A review or alternative that fails is refunded automatically. Stripe handles the payment; Second Look never sees your card. Prices in US dollars."}),x&&(0,n.jsx)("p",{role:"alert",className:"mt-3 text-[0.92rem] text-critical",children:x})]}),(0,n.jsx)("div",{className:"border-t border-rule px-5 py-5 sm:px-7",children:(null==a?void 0:a.code)?(0,n.jsx)(g,{code:a.code}):(0,n.jsx)(b,{onRestored:l})})]})}function w(e){let{text:t}=e,[r,a]=(0,i.useState)(!1);return(0,n.jsx)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),1600)}catch(e){}},className:"rounded-[6px] border border-rule-strong px-3 py-1.5 text-[0.85rem] text-ink transition-colors hover:border-ink",children:r?"Copied":"Copy"})}function g(e){let{code:t}=e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-[0.85rem] text-ink-3",children:"Your recovery code"}),(0,n.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-3",children:[(0,n.jsx)("code",{className:"font-mono text-[1.05rem] tracking-wide select-all",children:t}),(0,n.jsx)(w,{text:t})]}),(0,n.jsx)("p",{className:"mt-2 text-[0.88rem] text-ink-2",children:"Enter it in another browser to use your reviews there."})]})}function b(e){let{onRestored:t}=e,r=(0,i.useId)(),[a,s]=(0,i.useState)(""),[l,c]=(0,i.useState)(!1),[d,u]=(0,i.useState)(null);return(0,n.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),a.trim()){c(!0),u(null);try{t(await (0,o.UB)(a)),s("")}catch(e){u(e instanceof o.UQ?e.message:"Couldn’t restore that code. Try again.")}finally{c(!1)}}},children:[(0,n.jsx)("label",{htmlFor:r,className:"text-[0.9rem] text-ink-2",children:"Bought reviews in another browser? Enter the recovery code from that purchase."}),(0,n.jsxs)("div",{className:"mt-2 flex max-w-[30rem] gap-2",children:[(0,n.jsx)("input",{id:r,value:a,onChange:e=>s(e.target.value),placeholder:"XXXXX-XXXXX-XXXXX-XXXXX",autoComplete:"off",spellCheck:!1,maxLength:40,"aria-invalid":!!d,className:"min-w-0 flex-1 rounded-[6px] border border-rule-strong bg-sheet px-3 py-2 font-mono text-[0.92rem] uppercase tracking-wide placeholder:normal-case placeholder:tracking-normal placeholder:text-ink-3/70 focus:border-pencil focus:outline-none"}),(0,n.jsx)("button",{type:"submit",disabled:l||!a.trim(),className:"rounded-[6px] border border-ink px-4 py-2 text-[0.9rem] font-medium transition-colors hover:bg-ink hover:text-paper disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-ink",children:l?"Restoring…":"Restore"})]}),d&&(0,n.jsx)("p",{role:"alert",className:"mt-2 text-[0.88rem] text-critical",children:d})]})}function v(e){let{notice:t,onDismiss:r}=e;return(0,i.useEffect)(()=>
1{if(!t||t.code)return;let e=setTimeout(r,8e3);return()=>clearTimeout(e)},[t,r]),(0,n.jsx)(a.N,{children:t&&(0,n.jsxs)(s.PY1.div,{role:"status",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.25,ease:d.sp},className:"fixed inset-x-4 top-[calc(4.75rem+env(safe-area-inset-top))] z-50 mx-auto max-w-[32rem] rounded-[10px] border border-rule-strong bg-sheet px-4 py-3.5 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.35)] sm:px-5",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,n.jsx)("p",{className:"font-medium",children:t.title}),(0,n.jsx)("button",{type:"button",onClick:r,className:"shrink-0 text-[0.88rem] text-ink-3 underline underline-offset-4 hover:text-ink",children:"Dismiss"})]}),t.body&&(0,n.jsx)("p",{className:"mt-1 text-[0.9rem] text-ink-2",children:t.body}),t.code&&(0,n.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-3",children:[(0,n.jsx)("code",{className:"font-mono text-[1rem] tracking-wide select-all",children:t.code}),(0,n.jsx)(w,{text:t.code})]})]},t.title)})}function y(e){let{allowanceClassName:t=""}=e,r=p(),a="Takes about a minute.";if(!(null==r?void 0:r.wallet))return(0,n.jsx)(n.Fragment,{children:a});let{wallet:s,openPricing:i}=r;if(s.reviews>0||s.free>0){let e=s.reviews>0?"".concat(m(s.reviews)," left."):"Your first review is free.";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:t,children:e})," ",a]})}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:t,children:"No reviews left."})," ",(0,n.jsx)("button",{type:"button",onClick:()=>i("review"),className:"text-pencil underline underline-offset-4",children:"Buy reviews"})]})}function j(){let e=p();if(!e)return null;let{wallet:t,openPricing:r}=e,a=t?t.reviews>0?"".concat(m(t.reviews)," left"):t.free>0?"".concat(t.free," free"):"Buy reviews":"Reviews";return(0,n.jsx)("button",{type:"button",onClick:()=>r(null),className:"rounded-[6px] border border-rule-strong px-2.5 py-1 text-[0.85rem] text-ink transition-colors hover:border-ink sm:text-[0.9rem]",children:a})}}}]);

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.