1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6],{7130:(e,t,a)=>{function i(e,t){return 400===e&&!!t&&"object"==typeof t&&("NO_PASSWORD"===t.error_code||("string"==typeof t.message?t.message:"string"==typeof t.detail?t.detail:"").startsWith("This account has no password"))}function n(e,t){return e&&"object"==typeof e?"string"==typeof e.message&&e.message.trim()?e.message:"string"==typeof e.detail&&e.detail.trim()?e.detail:t:t}a.d(t,{PE:()=>n,Te:()=>i})},32495:(e,t,a)=>{a.d(t,{SpotTheFakeGame:()=>g});var i=a(95155),n=a(12115),r=a(17652),l=a(66695),s=a(28857),o=a(30285),c=a(59434),d=a(66766);function u(e){let{round:t,selectedIndices:a,onImageToggle:s,onSubmit:u,showFeedback:m,disabled:f,isPlaceholder:h=!1}=e,p=(0,r.c3)(),[x,g]=(0,n.useState)([!0,!0,!0]),[v,w]=(0,n.useState)([!1,!1,!1]),[y,j]=(0,n.useState)(null),b=e=>{g(t=>{let a=[...t];return a[e]=!1,a})},k=e=>{w(t=>{let a=[...t];return a[e]=!0,a}),g(t=>{let a=[...t];return a[e]=!1,a})},N=e=>{f||m||s(e)};return(0,i.jsxs)("div",{className:"space-y-3",children:[(0,i.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 md:gap-3",children:t.images.map((e,n)=>(0,i.jsx)("div",{className:"relative",children:(0,i.jsx)(l.Zp,{className:(0,c.cn)("cursor-pointer transition-all duration-200 hover:scale-[1.02] relative overflow-hidden h-full",a.has(n)&&"ring-2 ring-primary",m&&a.has(n)&&t.fakeIndices.includes(n)&&"ring-green-500 bg-green-50",m&&a.has(n)&&!t.fakeIndices.includes(n)&&"ring-red-500 bg-red-50",m&&t.fakeIndices.includes(n)&&!a.has(n)&&"ring-yellow-500 bg-yellow-50",(f||h)&&"cursor-not-allowed opacity-50"),onClick:()=>N(n),children:(0,i.jsxs)(l.Wu,{className:"p-0",children:[(0,i.jsxs)("div",{className:"relative aspect-square overflow-hidden",children:[h?(0,i.jsx)("div",{className:"absolute inset-0 bg-muted"}):(0,i.jsxs)(i.Fragment,{children:[x[n]&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:(0,i.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}),v[n]?(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground",children:(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"text-2xl mb-2",children:"â ï¸"}),(0,i.jsx)("p",{className:"text-sm",children:p("spotTheFakeGame.imageLoadError")})]})}):(0,i.jsx)(d.default,{src:e.url,alt:"Image ".concat(n+1),fill:!0,sizes:"(min-width: 1024px) 33vw, 100vw",className:"object-cover",onLoad:()=>b(n),onError:()=>k(n)})]}),!m&&!h&&(0,i.jsx)("div",{className:"absolute top-2 left-2",children:(0,i.jsx)("div",{className:(0,c.cn)("w-5 h-5 md:w-6 md:h-6 rounded border-2 flex items-center justify-center transition-colors text-xs md:text-sm",a.has(n)?"bg-primary border-primary text-white":"bg-white border-gray-300 shadow-sm"),children:a.has(n)&&"â"})}),!h&&!v[n]&&!x[n]&&(0,i.jsx)("button",{className:"absolute top-2 right-2 bg-black/50 hover:bg-black/70 text-white rounded-full p-1.5 transition-colors",onClick:e=>{e.stopPropagation(),j(n)},"aria-label":"Enlarge image",children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,i.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,i.jsx)("polyline",{points:"9 21 3 21 3 15"}),(0,i.jsx)("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),(0,i.jsx)("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}),m&&!h&&(0,i.jsxs)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20",children:[a.has(n)&&t.fakeIndices.includes(n)&&(0,i.jsx)("div",{className:"bg-green-500 rounded-full w-10 h-10 md:w-12 md:h-12 flex items-center justify-center text-white text-lg md:text-xl",children:"â"}),a.has(n)&&!t.fakeIndices.includes(n)&&(0,i.jsx)("div",{className:"bg-red-500 rounded-full w-10 h-10 md:w-12 md:h-12 flex items-center justify-center text-white text-lg md:text-xl",children:"â"}),!a.has(n)&&t.fakeIndices.includes(n)&&(0,i.jsx)("div",{className:"bg-yellow-500 rounded-full w-10 h-10 md:w-12 md:h-12 flex items-center justify-center text-white text-lg md:text-xl",children:"!"})]})]}),(0,i.jsxs)("div",{className:"py-1 text-center",children:[!h&&!m&&(0,i.jsx)("p",{className:"text-[10px] font-medium text-muted-foreground hidden md:block",children:a.has(n)?p("spotTheFakeGame.selected"):p("spotTheFakeGame.clickToSelect")}),!h&&m&&(0,i.jsxs)("div",{className:"space-y-0.5",children:[(0,i.jsx)("p",{className:"text-[10px] font-medium",children:(0,i.jsx)("span",{className:(0,
1c.cn)("px-1.5 py-0.5 rounded text-white text-[10px]","gen"===e.type?"bg-red-600":"bg-green-600"),children:"gen"===e.type?"AI Generated":"Real Photo"})}),(0,i.jsx)("p",{className:"text-[10px] text-muted-foreground capitalize",children:e.category})]})]})]})})},n))}),null!==y&&!h&&(0,i.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm cursor-pointer",onClick:()=>j(null),children:(0,i.jsxs)("div",{className:"relative w-[90vw] h-[80vh] md:h-[90vh] max-w-5xl",children:[(0,i.jsx)("button",{className:"absolute -top-12 right-0 md:top-2 md:right-2 z-10 text-white bg-white/20 hover:bg-white/30 rounded-full p-3 md:p-2 transition-colors",onClick:e=>{e.stopPropagation(),j(null)},"aria-label":"Close",children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"md:w-6 md:h-6",children:[(0,i.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,i.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,i.jsx)(d.default,{src:t.images[y].url,alt:"Image ".concat(y+1," enlarged"),fill:!0,sizes:"90vw",className:"object-contain",priority:!0})]})}),!m&&(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)(o.$,{onClick:u,disabled:f||h,size:"lg",className:"px-8 py-2 text-base font-semibold w-full md:w-auto md:min-w-[180px]",children:p("spotTheFakeGame.submitAnswer")})})]})}function m(e){let{selectedIndices:t,correctIndices:a}=e,s=(0,r.c3)(),[o,d]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{d(!0);let e=setTimeout(()=>{d(!1)},2800);return()=>clearTimeout(e)},[]),!o)return null;let u=Array.from(t).sort(),m=a.sort(),f=u.length===m.length&&u.every((e,t)=>e===m[t]),h=u.filter(e=>m.includes(e)).length,p=f?"green":h>0?"yellow":"red";return(0,i.jsx)("div",{className:"fixed top-4 left-1/2 transform -translate-x-1/2 z-50 pointer-events-none",children:(0,i.jsx)("div",{className:(0,c.cn)("transition-all duration-300 transform",o?"scale-100 opacity-100 translate-y-0":"scale-95 opacity-0 -translate-y-2"),children:(0,i.jsx)(l.Zp,{className:(0,c.cn)("border-2 shadow-lg pointer-events-auto max-w-sm mx-4 lg:mx-0","green"===p&&"border-green-500 bg-green-50","yellow"===p&&"border-yellow-500 bg-yellow-50","red"===p&&"border-red-500 bg-red-50"),children:(0,i.jsx)(l.Wu,{className:"p-3 lg:p-4",children:(0,i.jsxs)("div",{className:"text-center space-y-1 lg:space-y-2",children:[(0,i.jsx)("div",{className:(0,c.cn)("text-2xl lg:text-3xl","green"===p&&"text-green-500","yellow"===p&&"text-yellow-500","red"===p&&"text-red-500"),children:f?"â":h>0?"â¡":"â"}),(0,i.jsx)("h3",{className:(0,c.cn)("text-sm lg:text-base font-bold","green"===p&&"text-green-700","yellow"===p&&"text-yellow-700","red"===p&&"text-red-700"),children:f?s(0===m.length?"spotTheFakeGame.noFakesFound":"spotTheFakeGame.correct"):h>0?s("spotTheFakeGame.partial",{correct:h,total:m.length}):s("spotTheFakeGame.incorrect")}),(0,i.jsx)("div",{className:"mt-2",children:(0,i.jsx)("div",{className:(0,c.cn)("inline-flex items-center px-2 py-1 rounded-full text-xs font-medium",f&&"bg-green-100 text-green-800",!f&&"bg-gray-100 text-gray-800"),children:s(f?"spotTheFakeGame.pointsAwarded":"spotTheFakeGame.noPoints")})})]})})})})})}var f=a(12388),h=a(92138);function p(e){let{className:t=""}=e,a=(0,r.c3)("spotTheFakeGame.evidenceMessage");return(0,i.jsxs)("div",{className:t,children:[(0,i.jsx)("p",{className:"text-base text-foreground font-medium",children:a("question")}),(0,i.jsx)("p",{className:"mt-2 text-muted-foreground text-base",children:a("body")}),(0,i.jsx)(o.$,{asChild:!0,className:"mt-4",children:(0,i.jsxs)(f.N_,{href:"/verify",children:[a("cta"),(0,i.jsx)(h.A,{className:"ml-2 h-4 w-4","aria-hidden":!0})]})})]})}function x(e){let{results:t,onPlayAgain:a}=e,n=(0,r.c3)();return(0,i.jsxs)(l.Zp,{className:"w-full max-w-2xl mx-auto",children:[(0,i.jsx)(l.aR,{className:"text-center",children:(0,i.jsx)(l.ZB,{className:"text-2xl",children:n("spotTheFakeGame.gameComplete")})}),(0,i.jsxs)(l.Wu,{className:"space-y-6",children:[(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"text-4xl font-bold text-primary mb-2",children:t.score}),(0,i.jsx)("p",{className:"text-base text-muted-foreground",children:n("spotTheFakeGame.finalScore",{score:t.score})})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,i.jsxs)("div",{className:"text-center p-4 rounded-sm bg-muted/60 border",children:[(0,i.jsxs)("div",{className:"text-2xl font-bold ".concat(t.accuracy>=90?"text-green-700 dark:text-green-400":t.accuracy>=70?"text-blue-700 dark:text-blue-400":t.accuracy>=50?"text-yellow-700 dark:text-yellow-400":"text-red-700 dark:text-red-400"),children:[t.accuracy,"%"]}),(0,i.jsx)("p",{className:"text-sm text-muted-foreground",children:n("spotTheFakeGame.accuracy",{percentage:t.accuracy})})]}),(0,i.jsxs)("div",{className:"text-center p-4 rounded-sm bg-muted/60 border",children:[(0,i.jsx)("div",{className:"text-2xl font-bold text-primary",children:t.longestStreak}),(0,i.jsx)("p",{className:"text-sm text-muted-foreground",children:n("spotTheFakeGame.longestStreak")})]})]}),(0,i.jsx)("div",{className:"text-center p-4 rounded-sm bg-secondary text-secondary-foreground border",children:(0,i.jsx)("p",{className:"text-lg",children:n(t.accuracy>=90?"spotTheFakeGame.performanceExcellent":t.accuracy>
1=70?"spotTheFakeGame.performanceGood":t.accuracy>=50?"spotTheFakeGame.performanceOkay":"spotTheFakeGame.performancePoor")})}),(0,i.jsx)(p,{className:"text-center p-4 rounded-sm bg-muted/60 border"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(o.$,{onClick:a,size:"lg",className:"w-full",children:n("spotTheFakeGame.playAgain")}),(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,i.jsx)(o.$,{variant:"outline",size:"lg",asChild:!0,children:(0,i.jsx)(f.N_,{href:"/games/spot-the-fake",target:"_blank",rel:"noopener noreferrer",children:n("spotTheFakeGame.shareChallenge")})}),(0,i.jsx)(o.$,{variant:"outline",size:"lg",asChild:!0,children:(0,i.jsx)(f.N_,{href:"/for-photographers",children:n("spotTheFakeGame.learnAboutLumethic")})})]})]}),(0,i.jsx)("div",{className:"text-center text-sm text-muted-foreground",children:(0,i.jsx)("p",{children:n("spotTheFakeGame.challengeFriends",{score:t.score})})})]})]})}function g(e){let{timeRemaining:t}=e,a=(0,r.c3)(),[o,c]=(0,n.useState)(null),[d,f]=(0,n.useState)({currentQuestionIndex:0,score:0,streak:0,answers:[],gameComplete:!1,selectedImageIndices:new Set,showFeedback:!1,timeRemaining:t}),[h,p]=(0,n.useState)("loading");(0,n.useEffect)(()=>{(async()=>{try{p("loading");let e=await fetch("/api/games/spot-the-fake");if(!e.ok)throw Error("Failed to load game data");let t=await e.json();c(t),p("playing")}catch(e){console.error("Error loading game data:",e),p("playing")}})()},[]);let g={rounds:[{images:[0,1,2].map(()=>({filename:"",filepath:"",category:"",type:"real",url:""})),fakeIndices:[]}]},v=null!=o?o:g,w=null==o;if("completed"===h&&o){let e={score:d.score,totalQuestions:o.rounds.length,accuracy:Math.round(d.score/o.rounds.length*100),longestStreak:Math.max(...d.answers.map((e,t)=>{let a=0;for(let e=t;e<d.answers.length&&d.answers[e];e++)a++;return a}))};return(0,i.jsx)(x,{results:e,onPlayAgain:()=>{f({currentQuestionIndex:0,score:0,streak:0,answers:[],gameComplete:!1,selectedImageIndices:new Set,showFeedback:!1,timeRemaining:t}),(async()=>{try{let e=await fetch("/api/games/spot-the-fake");if(e.ok){let t=await e.json();c(t)}}catch(e){console.error("Error reloading game data:",e)}})(),p("playing")}})}let y=v.rounds[d.currentQuestionIndex],j=d.currentQuestionIndex/v.rounds.length*100;return(0,i.jsxs)("div",{className:"w-full max-w-7xl mx-auto space-y-2 px-2 lg:px-4",children:[(0,i.jsx)("div",{className:"min-h-[140px]",children:(0,i.jsxs)(l.Zp,{children:[(0,i.jsxs)(l.aR,{className:"pb-1 lg:pb-2 px-3 lg:px-6 pt-3 lg:pt-4",children:[(0,i.jsx)(l.ZB,{className:"text-center text-base lg:text-lg",children:a("spotTheFakeGame.title")}),(0,i.jsx)("p",{className:"text-center text-muted-foreground text-xs lg:text-sm",children:a("spotTheFakeGame.subtitle")}),(0,i.jsx)("div",{className:"h-3 flex items-center justify-center",children:t?(0,i.jsxs)("p",{className:"text-center text-xs text-muted-foreground",children:[a("spotTheFakeGame.processingVerification")," "," ",a("spotTheFakeGame.timeRemaining",{minutes:Math.ceil(t/60)})]}):null})]}),(0,i.jsxs)(l.Wu,{className:"space-y-1 lg:space-y-2 pt-0 px-3 lg:px-6 pb-3 lg:pb-4",children:[(0,i.jsxs)("div",{className:"space-y-0.5",children:[(0,i.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,i.jsx)("span",{children:a("spotTheFakeGame.progress",{current:d.currentQuestionIndex+1,total:v.rounds.length})}),(0,i.jsx)("span",{children:a("spotTheFakeGame.score",{score:d.score})})]}),(0,i.jsx)(s.k,{value:j,className:"w-full h-1"}),(0,i.jsx)("div",{className:"min-h-[14px] flex items-center justify-center",children:d.streak>0?(0,i.jsx)("p",{className:"text-center text-xs text-green-600",children:a("spotTheFakeGame.streak",{streak:d.streak})}):null})]}),(0,i.jsx)("div",{className:"min-h-[16px]",children:(0,i.jsx)("p",{className:"text-center text-xs text-muted-foreground px-2 lg:px-0",children:a("spotTheFakeGame.instructions")})})]})]})}),(0,i.jsx)("div",{className:"min-h-[280px] lg:min-h-[360px]",children:y&&(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(u,{round:y,selectedIndices:d.selectedImageIndices,onImageToggle:e=>
1{d.showFeedback||"playing"!==h||f(t=>{let a=new Set(t.selectedImageIndices);return a.has(e)?a.delete(e):a.add(e),{...t,selectedImageIndices:a}})},onSubmit:()=>{if(!o||d.showFeedback||"playing"!==h)return;let e=o.rounds[d.currentQuestionIndex];if(!e)return;f(e=>({...e,showFeedback:!0})),p("feedback");let t=Array.from(d.selectedImageIndices).sort(),a=e.fakeIndices.slice().sort(),i=t.length===a.length&&t.every((e,t)=>e===a[t]);setTimeout(()=>{f(e=>{let t=[...e.answers,i],a=i?e.streak+1:0,n=e.score+ +!!i;a>0&&a%3==0&&(n+=1);let r=e.currentQuestionIndex+1,l=!!o&&r>=o.rounds.length;return{...e,score:n,streak:a,answers:t,currentQuestionIndex:r,gameComplete:l,selectedImageIndices:new Set,showFeedback:!1}}),o&&d.currentQuestionIndex+1>=o.rounds.length?p("completed"):p("playing")},3e3)},showFeedback:d.showFeedback,disabled:"playing"!==h,isPlaceholder:w}),d.showFeedback&&(0,i.jsx)(m,{selectedIndices:d.selectedImageIndices,correctIndices:y.fakeIndices,round:y})]})})]})}},35169:(e,t,a)=>{a.d(t,{A:()=>i});let i=(0,a(19946).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},47474:(e,t,a)=>{a.d(t,{W:()=>d});var i=a(84037);let n=["Midjourney","DALL-E","DALL\xb7E","Stable Diffusion","SDXL","Adobe Firefly","ComfyUI","InvokeAI","NovelAI","Ideogram","FLUX.1"],r={parameters:"Stable Diffusion (parameters)",prompt:"ComfyUI (prompt)",workflow:"ComfyUI (workflow)"};function l(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return t}function s(e,t){for(let a of i.t$)(e.includes("digitalsourcetype/".concat(a))||e.includes('DigitalSourceType="'.concat(a,'"')))&&o(t,{type:"iptc_digital_source_type",detail:a});for(let a of n)e.includes(a)&&o(t,{type:"generator_metadata",detail:a})}function o(e,t){e.some(e=>e.type===t.type&&e.detail===t.detail)||e.push(t)}async function c(e){return"function"==typeof e.arrayBuffer?new Uint8Array(await e.arrayBuffer()):new Promise((t,a)=>{let i=new FileReader;i.onload=()=>t(new Uint8Array(i.result)),i.onerror=()=>a(i.error),i.readAsArrayBuffer(e)})}async function d(e,t){try{if("jpeg"===t){let t=new Uint8Array(await c(e.slice(0,1048576)).then(e=>e));return{scanned:!0,declarations:function(e){let t=[],a=2;for(;a+4<=e.length&&255===e[a];){let i=e[a+1];if(218===i||217===i)break;let n=e[a+2]<<8|e[a+3];if(n<2)break;let r=e.subarray(a+4,a+2+n);(225===i||237===i)&&s(l(r),t),a+=2+n}return t}(t)}}if("png"===t){let t=await c(e);return{scanned:!0,declarations:function(e){let t=[],a=8;for(;a+12<=e.length;){let i=e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3];if(i<0||a+12+i>e.length)break;let n=l(e.subarray(a+4,a+8)),c=e.subarray(a+8,a+8+i);if("tEXt"===n||"iTXt"===n){let e=c.indexOf(0);if(e>0){let a=l(c.subarray(0,e)),i=null;if("tEXt"===n)i=l(c.subarray(e+1));else if(0===c[e+1]){let t=e+3;for(let e=0;e<2&&t<c.length;t++)0===c[t]&&e++;i=l(c.subarray(t))}a in r&&o(t,{type:"container_signature",detail:r[a]}),i&&s(i,t)}}if("IEND"===n)break;a+=12+i}return t}(t)}}return{scanned:!1,declarations:[]}}catch(e){return{scanned:!1,declarations:[]}}}},56223:(e,t,a)=>{a.d(t,{I:()=>x});var i=a(95155),n=a(12115),r=a(17652),l=a(46453),s=a(30285),o=a(62523),c=a(85057),d=a(99840),u=a(91375),m=a(7130),f=a(99241),h=a(74068);let p=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function x(e){let{source:t,className:a=""}=e,x=(0,r.c3)("auth.signIn.code"),g=(0,r.c3)("anonymousVerification.codeSignIn"),v=(0,l.Ym)(),[w,y]=(0,n.useState)(""),[j,b]=(0,n.useState)(null),[k,N]=(0,n.useState)(""),[_,C]=(0,n.useState)(null),[U,F]=(0,n.useState)(!1),[S,I]=(0,n.useState)(0),R=(0,n.useRef)(null),T="code-sign-in-".concat(t);(0,n.useEffect)(()=>{(0,h.AN)(t)},[t]),(0,n.useEffect)(()=>{if(S<=0)return;let e=setTimeout(()=>I(e=>e-1),1e3);return()=>clearTimeout(e)},[S]);let E=(0,n.useCallback)(async e=>{F(!0),C(null);try{await d.Di.loginCodeSendV1AccountsLoginCodeSendPost({email:e}),(0,h.AK)({prefilled:!1,source:t}),b(e),N(""),R.current=null,I(30)}catch(e){e instanceof d.hD&&429===e.status?((0,h.$t)({reason:"rate_limited"}),C(x("tooMany"))):e instanceof d.hD&&422===e.status?C(g("emailInvalid")):((0,h.$t)({reason:"error"}),C(g("errorGeneral")))}finally{F(!1)}},[t,x,g]),A=(0,n.useCallback)(async e=>{if(j){if(!/^\d{6}$/.test(e))return void C(x("invalidFormat"));F(!0),C(null);try{let a=await fetch("/api/auth/login-code",{method:"POST",headers:{"Content-Type":"application/json"}
1,body:JSON.stringify({email:j,code:e})}),i=await a.json().catch(()=>({}));if(a.ok&&i.success){let e=!0===i.is_new_account;(0,h.K)({is_new_account:e,source:t}),e&&(0,h.JW)(),(0,h.p7)(),(0,f.s)(),(0,u.Jx)(v,"/verifications");return}401===a.status?((0,h.$t)({reason:"invalid"}),C(x("invalid"))):429===a.status?((0,h.$t)({reason:"rate_limited"}),C(x("tooMany"))):((0,h.$t)({reason:"error"}),C((0,m.PE)(i,g("errorGeneral"))))}catch(e){(0,h.$t)({reason:"error"}),C(g("errorGeneral"))}finally{F(!1)}}},[v,j,t,x,g]),V=e=>{let t=e.replace(/\D/g,"").slice(0,6);N(t),C(null),6!==t.length||R.current===t||U||(R.current=t,A(t))};return j?(0,i.jsxs)("form",{className:"space-y-3 ".concat(a),onSubmit:e=>{e.preventDefault(),A(k)},children:[(0,i.jsx)("p",{className:"text-sm",role:"status","aria-live":"polite",children:x("sentTo",{email:j})}),(0,i.jsxs)("div",{className:"space-y-1",children:[(0,i.jsx)(c.J,{htmlFor:T,children:x("codeLabel")}),(0,i.jsx)(o.p,{id:T,type:"text",inputMode:"numeric",pattern:"[0-9]{6}",maxLength:6,autoComplete:"one-time-code",autoFocus:!0,value:k,onChange:e=>V(e.target.value),"aria-invalid":!!_||void 0,className:"tracking-[0.5em] text-center text-lg font-mono ".concat(_?"border-destructive":"")}),_&&(0,i.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:_})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)(s.$,{type:"submit",size:"sm",disabled:U||6!==k.length,children:U?x("verifying"):x("verify")}),(0,i.jsx)(s.$,{type:"button",size:"sm",variant:"link",className:"px-0",onClick:()=>void E(j),disabled:U||S>0,children:S>0?x("resendIn",{seconds:S}):x("resend")}),(0,i.jsx)(s.$,{type:"button",size:"sm",variant:"link",className:"px-0",onClick:()=>{b(null),C(null)},disabled:U,children:x("changeEmail")})]})]}):(0,i.jsxs)("form",{className:"space-y-3 ".concat(a),onSubmit:e=>{e.preventDefault();let t=w.trim();if(!p.test(t))return void C(g("emailInvalid"));E(t)},children:[(0,i.jsxs)("div",{className:"space-y-1",children:[(0,i.jsx)(c.J,{htmlFor:T,children:g("emailLabel")}),(0,i.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,i.jsx)(o.p,{id:T,type:"email",autoComplete:"email",placeholder:g("emailPlaceholder"),value:w,onChange:e=>{y(e.target.value),C(null)},"aria-invalid":!!_||void 0,className:"sm:max-w-xs ".concat(_?"border-destructive":"")}),(0,i.jsx)(s.$,{type:"submit",size:"sm",disabled:U,children:U?x("sending"):x("sendCode")})]}),_&&(0,i.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:_})]}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:x("intro")})]})}},80006:(e,t,a)=>{a.d(t,{A:()=>eb});var i=a(95155),n=a(55365),r=a(26126),l=a(30285),s=a(28857),o=a(16988),c=a(54165),d=a(62523),u=a(17652),m=a(12115),f=a(66766),h=a(19946);let p=(0,h.A)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),x=(0,h.A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);var g=a(66474),v=a(51154);let w=(0,h.A)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),y=(0,h.A)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var j=a(99840),b=a(32187),k=a(30255),N=a(32262),_=a(12388),C=a(94964),U=a(99650),F=a(45450);function S(e){let{verification:t,onStartNew:a}=e,n=(0,u.c3)();if(!t)return null;let r=(0,U.uG)(t);return(0,i.jsxs)("div",{className:"rounded-sm border border-green-600 bg-green-50 p-6 text-center",children:[(0,i.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:(0,i.jsx)("svg",{className:"h-6 w-6 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),(0,i.jsx)("h3",{className:"mb-2 text-xl font-bold text-gray-900",children:n("verificationResult.successTitle")}),(0,i.jsx)("p",{className:"mb-4 text-gray-600",children:n(r?"verificationResult.quickCheckSuccessDescription":"verificationResult.successDescription")}),r&&(0,i.jsx)(F.Ir,{className:"mx-auto mb-4 max-w-lg"}),(0,i.jsx)("p",{className:"mb-6 text-sm text-gray-500",children:n("verificationResult.duration")}),(0,i.jsxs)("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 sm:flex-row",children:[t.id&&(0,i.jsx)(_.N_,{href:"/verifications/".concat(t.id),target:"_blank",rel:"noopener noreferrer",className:"inline-flex w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 sm:w-auto",children:n("verificationResult.viewDetails")}),(0,i.jsx)("button",{onClick:a,type:"button",className:"inline-flex w-full items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:w-auto",children:n("verificationResult.startNewVerification")})]})]})}var I=a(99307),R=a(66695),T=a(56223),E=a(35169);let A=(0,h.A)("share",[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}
1]]),V=(0,h.A)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);var L=a(33786),D=a(40318),G=a(74068);function P(e){let{verificationId:t,onBack:a,onNewVerification:n,onStartRawVerification:s,remainingVerifications:o,fileNames:c}=e,d=(0,u.c3)();return(0,i.jsxs)("div",{className:"space-y-6",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-2",children:[(0,i.jsxs)(l.$,{variant:"outline",onClick:()=>{a()},className:"w-full sm:w-auto",children:[(0,i.jsx)(E.A,{className:"h-4 w-4 mr-2"}),d("anonymousVerification.backToUploader")]}),n&&o>0&&(0,i.jsx)(l.$,{onClick:()=>{n()},className:"w-full sm:w-auto",children:d("anonymousVerification.verifyAnotherImage")})]}),(0,i.jsx)(r.E,{variant:"secondary",className:"self-start sm:self-auto",children:d("anonymousVerification.results.badge")})]}),c&&(0,i.jsxs)(R.Zp,{children:[(0,i.jsx)(R.aR,{children:(0,i.jsx)(R.ZB,{className:"text-lg",children:d("anonymousVerification.results.uploadedFiles")})}),(0,i.jsx)(R.Wu,{children:(0,i.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)("span",{className:"font-medium",children:[d("anonymousVerification.photoLabel",{defaultValue:"Photo"}),":"]})," ",c.jpeg]}),c.raw&&(0,i.jsxs)("div",{children:[(0,i.jsxs)("span",{className:"font-medium",children:[d("anonymousVerification.rawLabel",{defaultValue:"RAW"}),":"]})," ",c.raw]})]})})]}),(0,i.jsx)("div",{className:"rounded-sm overflow-hidden",children:(0,i.jsx)(D.X,{verificationId:t,showMarketplace:!1,showDownload:!1,className:"w-full",onStartRawVerification:s})}),(0,i.jsx)(R.Zp,{className:"bg-primary/5 border-primary/20",children:(0,i.jsx)(R.Wu,{className:"py-6",children:(0,i.jsxs)("div",{className:"text-center space-y-4",children:[(0,i.jsx)("h3",{className:"text-lg font-semibold",children:d("anonymousVerification.results.unlockTitle")}),(0,i.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(A,{className:"h-4 w-4 text-primary"}),(0,i.jsx)("span",{children:d("anonymousVerification.results.sharePublicly")})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(V,{className:"h-4 w-4 text-primary"}),(0,i.jsx)("span",{children:d("anonymousVerification.results.keepReports")})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(L.A,{className:"h-4 w-4 text-primary"}),(0,i.jsx)("span",{children:d("anonymousVerification.results.unlimitedVerifications")})]})]}),(0,i.jsx)("p",{className:"text-sm text-muted-foreground",children:d("anonymousVerification.results.codeIntro")}),(0,i.jsx)(T.I,{source:"anon_result"}),(0,i.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,i.jsx)(_.N_,{href:"/sign-up",className:"underline hover:no-underline",onClick:()=>(0,G.kq)({location:"anon_result",cta:"sign_up_claim"}),children:d("anonymousVerification.results.createAccountClaim")})," ",d("anonymousVerification.results.signUpPrompt")]})]})})})]})}var q=a(32495),M=a(84037),B=a(39865),$=a(11622),W=a(68917);async function z(e){let[t,a,i]=await Promise.all([(0,W.Xm)(),(0,W.Ee)(),(0,W.Rn)()]);t.init(),a.init(),i.init();for(let n=0;n<e.size;n+=4194304){let r=new Uint8Array(await e.slice(n,n+4194304).arrayBuffer());t.update(r),a.update(r),i.update(r)}return{sha512:t.digest("hex"),sha256:a.digest("hex"),xxh64:i.digest("hex")}}var O=a(92679),H=a(47474);let X={format:null,width:null,height:null,hasExif:null,camera:null,software:null,editor:null,profile:"unknown"},Q=[{match:/canon/i,display:"Canon",raw:".CR3 or .CR2"},{match:/nikon/i,display:"Nikon",raw:".NEF"},{match:/sony/i,display:"Sony",raw:".ARW"},{match:/fuji/i,display:"Fujifilm",raw:".RAF"},{match:/om digital|om system/i,display:"OM System",raw:".ORF"}
1,{match:/olympus/i,display:"Olympus",raw:".ORF"},{match:/panasonic/i,display:"Panasonic",raw:".RW2"},{match:/pentax|ricoh/i,display:"Pentax",raw:".PEF or .DNG"},{match:/samsung/i,display:"Samsung",raw:".SRW or .DNG"},{match:/leica/i,display:"Leica",raw:".DNG"},{match:/hasselblad/i,display:"Hasselblad",raw:".3FR or .fff"},{match:/sigma/i,display:"Sigma",raw:".X3F or .DNG"},{match:/apple/i,display:"Apple",raw:"ProRAW .DNG"},{match:/google/i,display:"Google",raw:".DNG"},{match:/dji/i,display:"DJI",raw:".DNG"}];function Z(e){if(!e)return null;let t=e.replace(/\0+$/g,"").trim();return t.length>0&&t.length<=80?t:null}let J=[{match:/lightroom/i,name:"Lightroom"},{match:/photoshop/i,name:"Photoshop"},{match:/capture one/i,name:"Capture One"},{match:/dxo/i,name:"DxO"},{match:/affinity/i,name:"Affinity Photo"},{match:/luminar/i,name:"Luminar"},{match:/darktable/i,name:"darktable"},{match:/rawtherapee/i,name:"RawTherapee"},{match:/on1/i,name:"ON1"},{match:/gimp/i,name:"GIMP"},{match:/snapseed/i,name:"Snapseed"}],Y=new Set([640,720,750,828,1080,1125,1170,1179,1206,1242,1284,1290,1320,1344,1440]),K=new Set(["1366x768","1440x900","1536x864","1920x1080","2560x1440","2560x1600","2560x1664","2880x1800","3024x1964","3456x2234","3840x2160"]);function ee(e){let t={make:null,model:null,software:null};if(e.length<8)return t;let a=73===e[0]&&73===e[1],i=77===e[0]&&77===e[1];if(!a&&!i)return t;let n=t=>a?e[t]|e[t+1]<<8:e[t]<<8|e[t+1],r=t=>a?(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0:(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0;if(42!==n(2))return t;let l=r(4);if(l+2>e.length)return t;let s=n(l),o=t=>{let a=n(t+2),i=r(t+4);if(2!==a||0===i||i>256)return null;let l=i<=4?t+8:r(t+8);if(l+i>e.length)return null;let s="";for(let t=0;t<i;t++){let a=e[l+t];if(0===a)break;s+=String.fromCharCode(a)}return s};for(let a=0;a<Math.min(s,200);a++){let i=l+2+12*a;if(i+12>e.length)break;let r=n(i);271===r?t.make=o(i):272===r?t.model=o(i):305===r&&(t.software=o(i))}return t}let et=[69,120,105,102,0];function ea(e,t){if(e.length<t.length)return!1;for(let a=0;a<t.length;a++)if(e[a]!==t[a])return!1;return!0}async function ei(e,t){let a=e.slice(0,t);return"function"==typeof a.arrayBuffer?new Uint8Array(await a.arrayBuffer()):new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(new Uint8Array(i.result)),i.onerror=()=>t(i.error),i.readAsArrayBuffer(a)})}async function en(e,t){try{let a=null;if("jpeg"===t?a=function(e){let t={width:null,height:null,hasExif:!1,exif:{make:null,model:null,software:null}},a=2;for(;a+4<=e.length&&255===e[a];){let i=e[a+1];if(216===i||i>=208&&i<=215||1===i||255===i){a+=255===i?1:2;continue}if(218===i||217===i)break;let n=e[a+2]<<8|e[a+3];if(n<2)break;let r=e.subarray(a+4,a+2+n);i>=192&&i<=207&&196!==i&&200!==i&&204!==i&&r.length>=5?(t.height=r[1]<<8|r[2],t.width=r[3]<<8|r[4]):225===i&&ea(r,et)&&(t.hasExif=!0,t.exif=ee(r.subarray(6))),a+=2+n}return t}(await ei(e,262144)):"png"===t?a=function(e){let t={width:null,height:null,hasExif:!1,exif:{make:null,model:null,software:null}},a=8;for(;a+12<=e.length;){let i=(e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3])>>>0,n=String.fromCharCode(e[a+4],e[a+5],e[a+6],e[a+7]),r=e.subarray(a+8,Math.min(e.length,a+8+i));if("IHDR"===n&&r.length>=8?(t.width=(r[0]<<24|r[1]<<16|r[2]<<8|r[3])>>>0,t.height=(r[4]<<24|r[5]<<16|r[6]<<8|r[7])>>>0):"eXIf"===n&&(t.hasExif=!0,t.exif=ee(r)),"IDAT"===n||"IEND"===n)break;a+=12+i}return t}(await ei(e,262144)):"webp"===t&&(a=function(e){let t={width:null,height:null,hasExif:!1,exif:{make:null,model:null,software:null}},a=12;for(;a+8<=e.length;){let i=String.fromCharCode(e[a],e[a+1],e[a+2],e[a+3]),n=(e[a+4]|e[a+5]<<8|e[a+6]<<16|e[a+7]<<24)>>>0,r=e.subarray(a+8,Math.min(e.length,a+8+n));if("VP8X"===i&&r.length>=10)t.width=1+(r[4]|r[5]<<8|r[6]<<16),t.height=1+(r[7]|r[8]<<8|r[9]<<16);else if("VP8 "===i&&r.length>=10&&null===t.width)t.width=(r[6]|r[7]<<8)&16383,t.height=(r[8]|r[9]<<8)&16383;else if("VP8L"===i&&r.length>=5&&null===t.width){let e=(r[1]|r[2]<<8|r[3]<<16|r[4]<<24)>>>0;t.width=(16383&e)+1,t.height=(e>>>14&16383)+1}else"EXIF"===i&&(t.hasExif=!0,t.exif=ee(ea(r,et)?r.subarray(6):r));a+=8+n+(1&n)}return t}(await ei(e,262144))),!a)return{...X,format:t};let i=function(e,t){let a,i=Z(e),n=Z(t);if(!i&&!n)return null;let{display:r,raw:l}=function(e){var t;if(!e)return{display:null,raw:null};for(let t of Q)if(t.match.test(e))return{display:t.display,raw:t.raw};let a=null!=(t=e.trim().split(/\s+/)[0])?t:"";return{display:a?a.charAt(0).toUpperCase()+a.slice(1).toLowerCase():null,raw:null}}(i);if(n&&r&&n.toLowerCase().startsWith(r.toLowerCase()))a=n;else if(n&&r)a="".concat(r," ").concat(n);else{var s;a=null!=(s=null!=n?n:r)?s:""}return{display:a,make:r,model:n,rawExtensions:l}}(a.exif.make,a.exif.model),n=Z(a.exif.software),r={format:t,width:a.width,height:a.height,hasExif:a.hasExif,camera:i};return{...r,software:n,editor:function(e){if(!e)return null;for(let t of J)if(t.match.test(e))return t.name;return null}(n),profile:function(e){let{format:t,width:a,height:i,hasExif:n,
1camera:r}=e;return r?"camera":null===t||"heic"===t||"unknown"===t||null===n?"unknown":null!==a&&null!==i&&400>Math.min(a,i)?"tiny":!n&&null!==a&&null!==i&&function(e,t){if(K.has("".concat(e,"x").concat(t)))return!0;let a=Math.min(e,t),i=Math.max(e,t)/a;return Y.has(a)&&i>=1.9&&i<=2.3}(a,i)?"screenshot_likely":"png"===t||"webp"===t||"gif"===t||"avif"===t?"reencoded":"jpeg"!==t||n?"unknown":"stripped"}(r)}}catch(e){return{...X,format:t}}}var er=a(91550);let el=!1,es=null,eo=null,ec=null;function ed(e){let t=new Image;t.onload=()=>{if(el)try{let a=t.naturalWidth||32,i=document.createElement("canvas");i.width=a,i.height=a;let n=i.getContext("2d");if(!n)return;n.drawImage(t,0,0,a,a);let r=.28*a;n.beginPath(),n.arc(a-r,a-r,r,0,2*Math.PI),n.fillStyle="#22c55e",n.fill(),e.href=i.toDataURL("image/png")}catch(e){}},t.src=e.href}function eu(){if("undefined"!=typeof document&&el&&(el=!1,null!==eo&&document.title===es&&(document.title=eo),eo=null,es=null,ec)){for(let[e,t]of ec)try{e.setAttribute("href",t)}catch(e){}ec=null}}let em=[".cr2",".cr3",".nef",".arw",".raw",".dng",".raf",".orf",".rw2",".pef",".srw"],ef=[".jpg",".jpeg",".png",".webp",".heic",".heif",".avif",".gif"],eh=new Set(["jpeg","png","webp","gif","bmp","heic","avif"]),ep=new Set(["jpeg","png","webp","gif","heic","avif"]),ex={jpeg:"JPEG",png:"PNG",webp:"WebP",gif:"GIF",bmp:"BMP",heic:"HEIC",avif:"AVIF",tiff:"TIFF/RAW",cr3:"Canon CR3",raf:"Fujifilm RAF",unknown:"unknown"};function eg(e,t,a){if(e.length<t+a.length)return!1;for(let i=0;i<a.length;i++)if(e[t+i]!==a.charCodeAt(i))return!1;return!0}let ev=["heic","heix","hevc","heim","heis","hevm","hevs","mif1","msf1"],ew=["avif","avis"];async function ey(e){try{let a=await function(e,t){let a=e.slice(0,16);return"function"==typeof a.arrayBuffer?a.arrayBuffer():new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>t(i.error),i.readAsArrayBuffer(a)})}(e,0);var t=new Uint8Array(a);if(t.length>=3&&255===t[0]&&216===t[1]&&255===t[2])return"jpeg";if(t.length>=8&&137===t[0]&&eg(t,1,"PNG")&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7])return"png";if(eg(t,0,"RIFF")&&eg(t,8,"WEBP"))return"webp";if(eg(t,0,"GIF8"))return"gif";if(eg(t,0,"FUJIFILMCCD-RAW"))return"raf";if(eg(t,0,"BM"))return"bmp";if(eg(t,4,"ftyp")&&t.length>=12){let e=String.fromCharCode(t[8],t[9],t[10],t[11]);return ev.includes(e)?"heic":ew.includes(e)?"avif":"crx "===e?"cr3":"unknown"}return t.length>=4&&(73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3])?"tiff":"unknown"}catch(e){return null}}async function ej(e,t,a){let i=function(e){let t=e.lastIndexOf(".");return t<=0||t===e.length-1?null:e.slice(t).toLowerCase()}(t),n=a?await ey(a):null;return"raw"===e?null!==n&&eh.has(n)?{ok:!1,reason:"wrongContent",detected:n}:"tiff"===n||"cr3"===n||"raf"===n||null===i||em.includes(i)?{ok:!0,detected:n}:{ok:!1,reason:"wrongExtension",detected:null!=n?n:null}:null!==n&&ep.has(n)?{ok:!0,detected:n}:null!==n&&"unknown"!==n?{ok:!1,reason:"wrongContent",detected:n}:null===i||ef.includes(i)?{ok:!0,detected:n}:{ok:!1,reason:"wrongExtension",detected:null}}function eb(e){var t,a,h,U,F,E,A,V,L,D,W,X;let{onComplete:Q,isAnonymous:Z=!1,singleImageFirst:J=!1,handoffFile:Y=null,className:K=""}=e,[ee,et]=(0,m.useState)(null),[ea,ei]=(0,m.useState)(null),eh=null!==ea&&"jpeg"!==ea&&"heic"!==ea,[eg,ev]=(0,m.useState)(null),[ew,ey]=(0,m.useState)(null),[eb,ek]=(0,m.useState)(null),[eN,e_]=(0,m.useState)(null),[eC,eU]=(0,m.useState)(!1),[eF,eS]=(0,m.useState)(null),[eI,eR]=(0,m.useState)(null),[eT,eE]=(0,m.useState)(!1),[eA,eV]=(0,m.useState)(!1),[eL,eD]=(0,m.useState)(""),[eG,eP]=(0,m.useState)(null),[eq,eM]=(0,m.useState)({jpeg:!1,raw:!1}),eB=(0,I.y)(),[e$,eW]=(0,m.useState)(!1),[ez,eO]=(0,m.useState)(null),[eH,eX]=(0,m.useState)(()=>new URLSearchParams(window.location.search).has("upload")),[eQ,eZ]=(0,m.useState)(null),[eJ,eY]=(0,m.useState)(null),eK=(0,m.useRef)(null),e0=(0,m.useRef)(null),e1=(0,m.useRef)(null),[e2,e4]=(0,m.useState)(!0);(0,m.useEffect)(()=>{let e=()=>e4("hidden"!==document.visibilityState);return e(),document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]);let[e3,e5]=(0,m.useState)(!1),[e6,e8]=(0,m.useState)(!1),e7=(0,m.useRef)(null);(0,m.useEffect)(()=>{e5("Notification"in window&&"denied"!==Notification.permission)},[]);let[e9,te]=(0,m.useState)(null),tt=e9?(0,O.U)(e9):null,ta=(0,u.c3)(),ti=(0,u.c3)("anonymousVerification"),[tn,tr]=(0,m.useState)(!1),[tl,ts]=(0,m.useState)(null),[to,tc]=(0,m.useState)(!1),[td,tu]=(0,m.useState)(null),[tm,tf]=(0,m.useState)(!1),th=(0,m.useCallback)(async(e,t,a,i)=>{let n=await ej(e,t,a);if(!n.ok){var r;let i=n.detected?ex[n.detected]:null;if("raw"===e){eS(i?ta("verificationUploader.rawRejectedKnownFormat",{format:i}):ta("verificationUploader.rawRejectedExtension",{name:t}));let e=null!==n.detected&&ep.has(n.detected),r=e||"bmp"===n.detected;tc(r),tu(e?{name:t,blob:a}:null),r&&(0,G.RJ)({is_anonymous:Z,image_slot:ee?"occupied":"empty"})}else eS("tiff"===n.detected||"cr3"===n.detected||"raf"===n.detected?ta("verificationUploader.jpegRejectedLooksRaw"):i?ta("verificationUploader.jpegRejectedKnownFormat",{format:i}):ta("verificationUploader.jpegRejectedExtension",{name:t}));(0,G.J6)({is_anonymous:Z,reason:"client_reject_".concat(e,"_").concat(null!=(r=n.detected)?r:"extension")});return}eS(null),tc(!1),tu(null),i&&(0,G.HC)({slot:"jpeg"===e?"image":"raw",source:i,is_anonymous:Z}),"jpeg"===e?(et({name:t,blob:a}),ei(n.detected)):ev({name:t,blob:a})},[ta,Z,ee]);(0,m.useEffect)(()=>
1{if(Z)return;if(!(null==eg?void 0:eg.blob))return void ey(null);let e=!1,{blob:t,name:a}=eg;return ey({kind:"checking"}),(async()=>{try{var i;let n=await z(t),r=await B.c.lookupHashesV1OffloadsLookupPost({files:[{hashes:{sha512:n.sha512,sha256:n.sha256,xxh64:n.xxh64},filename:a,size:t.size}]});if(e)return;let l=r.results[0],s=null==l||null==(i=l.matches)?void 0:i[0];s?ey({kind:"match",match:s}):(null==l?void 0:l.near_misses)&&l.near_misses.length>0?ey({kind:"nearMiss"}):ey(null)}catch(t){e||ey(null)}})(),()=>{e=!0}},[Z,eg]);let tp=(0,m.useCallback)(async()=>{if((0,j.SU)())try{let e=await N.D.readItemsV1AccountsMeGet();if(e.accounts&&e.accounts.length>0){let t=e.accounts[0].id,a=await N.D.getAccountQuotaV1AccountsAccountIdQuotaGet(t);te(a)}}catch(e){console.error("Failed to fetch quota:",e)}},[]);(0,m.useEffect)(()=>{Z||tp()},[Z,tp]);let tx=(0,m.useRef)(null),tg=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!Z)return;let e=eB.ongoingVerification;e?eZ(t=>(null==t?void 0:t.id)===e.id?t:{id:e.id,isPair:null!=e.fileNames.raw,startedAt:e.startedAt}):eQ&&!eB.completedVerifications.some(e=>e.id===eQ.id)&&eZ(null)},[Z,eB.ongoingVerification,eB.completedVerifications,eQ]),(0,m.useEffect)(()=>{if(!Z)return;let e=eB.ongoingVerification;if(!e)return;let t=()=>{eK.current!==e.id&&(eK.current=e.id,(0,G.QL)({is_anonymous:!0,mode:null!=e.f
1ileNames.raw?"raw_pair":"image_only",waited_seconds:(Date.now()-e.startedAt)/1e3}))},a=()=>{"hidden"===document.visibilityState&&t()};return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",t),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",t)}},[Z,eB.ongoingVerification]),(0,m.useEffect)(()=>{if(!Z)return;let e=eB.unacknowledgedFailure;e&&(0,er.XL)(e.id)&&(0,G.xQ)({is_anonymous:!0,mode:null!=e.fileNames.raw?"raw_pair":"image_only"})},[Z,eB.unacknowledgedFailure]);let tv=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!Z||eH||(null==eQ?void 0:eQ.isPair))return;let e=eB.lastVerification;if(e&&!e.isOngoing){if(!e2){tv.current=e.id;return}eO(e.id),eW(!0),(0,er.XL)(e.id)&&(0,G.tG)({is_anonymous:!0,mode:null!=e.file_names.raw?"raw_pair":"image_only",via:eQ?tv.current===e.id?"tab_return":"auto":"return",waited_seconds:eQ?(Date.now()-eQ.startedAt)/1e3:null}),tv.current=null,eZ(null)}},[Z,eB.lastVerification,eH,eQ,e2]),(0,m.useEffect)(()=>{if(Z){if(!e2&&(0,er.LW)()){var e=ti("tabResultReady",{defaultValue:"â Result ready | Lumethic"});if("undefined"!=typeof document&&!el){el=!0,es=e,eo=document.title,document.title=e;try{let e=Array.from(document.querySelectorAll('link[rel~="icon"]'));ec=new Map(e.map(e=>{var t;return[e,null!=(t=e.getAttribute("href"))?t:""]})),e.forEach(ed)}catch(e){ec=null}}}else eu();return()=>eu()}},[Z,e2,eB.completedVerifications,eB.unacknowledgedFailure,ti]),(0,m.useEffect)(()=>{var e,t;if(!Z||!e6)return;let a=e7.current;if(!a)return;let i=eB.completedVerifications.find(e=>e.id===a),n=(null==(e=eB.unacknowledgedFailure)?void 0:e.id)===a;if((i||n)&&(e7.current=null,e8(!1),"hidden"===document.visibilityState))try{let e=null!=i?i:eB.unacknowledgedFailure,a=null!=(t=null==e?void 0:e.fileNames.jpeg)?t:"",n=(null==e?void 0:e.fileNames.raw)!=null?"raw_pair":"image_only",r=new Notification(i?ti("notificationReadyTitle",{defaultValue:"Your verification result is ready"}):ti("notificationFailedTitle",{defaultValue:"Your verification could not be completed"}),{body:i?ti("notificationReadyBody",{fileName:a,defaultValue:"{fileName} has finished processing. Click to view the result."}):ti("notificationFailedBody",{fileName:a,defaultValue:"Processing of {fileName} failed. Click for details."}),icon:"/favicon-64.png"});r.onclick=()=>{(0,G.rj)({mode:n}),window.focus(),r.close()}}catch(e){}},[Z,e6,eB.completedVerifications,eB.unacknowledgedFailure,ti]);let tw=(0,m.useRef)(null),[ty,tj]=(0,m.useState)(null),[tb,tk]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(!(null==ee?void 0:ee.blob)||eg||tw.current===ee)return;tw.current=ee;let e=!1;return ts({file:ee,result:null}),(0,M.WM)(ee.name,ee.blob,ea).then(t=>{e||(ts({file:ee,result:t}),(0,G.u1)({outcome:t.outcome,is_anonymous:Z}))}),tj(null),(0,H.W)(ee.blob,ea).then(t=>{e||tj({file:ee,scan:t})}),tk(null),en(ee.blob,ea).then(t=>{e||(tk({file:ee,meta:t}),(0,G.X1)({profile:t.profile,format:t.format,has_exif:t.hasExif,editor:t.editor,is_anonymous:Z}))}),()=>{e=!0}},[ee,eg,ea,Z]);let tN=(0,m.useRef)(null);(0,m.useEffect)(()=>{ee&&!eg&&!eC&&(Z&&(!eB.canStartNew||e$&&ez||eB.ongoingVerification||eQ)||tN.current===ee||(tN.current=ee,(0,G.a6)({is_anonymous:Z})))},[ee,eg,eC,Z,eB.canStartNew,eB.ongoingVerification,e$,ez,eQ]);let t_=(0,m.useRef)(!1);(0,m.useEffect)(()=>{Z&&!t_.current&&(e$&&ez||eB.ongoingVerification||eB.canStartNew||eI||(t_.current=!0,(0,G.KT)()))},[Z,e$,ez,eB.ongoingVerification,eB.canStartNew,eI]);let tC=(0,m.useCallback)(async()=>{let e=eB.ongoingVerification;if(e)try{let t=await Notification.requestPermission(),a="granted"===t;
1(0,G.OB)({granted:a,mode:null!=e.fileNames.raw?"raw_pair":"image_only"}),a?(e7.current=e.id,e8(!0)):"denied"===t&&e5(!1)}catch(e){e5(!1)}},[eB.ongoingVerification]);(0,m.useEffect)(()=>{if(!window.Dropbox){let e=document.createElement("script");e.src="https://www.dropbox.com/static/api/2/dropins.js",e.id="dropboxjs",e.type="text/javascript",e.setAttribute("data-app-key","ejd4t1jzlh78lh7"),document.body.appendChild(e)}if(!window.google){let e=document.createElement("script");e.src="https://accounts.google.com/gsi/client",e.async=!0,document.head.appendChild(e);let t=document.createElement("script");t.src="https://apis.google.com/js/api.js",t.id="googleapis",t.type="text/javascript",document.body.appendChild(t)}},[]),(0,m.useEffect)(()=>{if(null==ee?void 0:ee.blob){let e=URL.createObjectURL(ee.blob);return ek(e),()=>{URL.revokeObjectURL(e),ek(null)}}return ek(null),()=>{}},[ee]);let tU=tl&&tl.file===ee?tl:null,tF=tb&&tb.file===ee?tb.meta:null,tS=null!=(F=null==tF||null==(t=tF.camera)?void 0:t.rawExtensions)?F:ta("verificationUploader.profileCameraRawGeneric"),tI=(0,m.useCallback)(async function(){var e,t,a,i,n,r;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"full",s="quick"===l;if(!ee||!ee.blob)return void eS(ta(s?"verificationUploader.selectJpegFirst":"verificationUploader.selectBothFilesFirst"));if(!s&&(!eg||!eg.blob))return void eS(ta("verificationUploader.selectBothFilesFirst"));if(!s&&eh)return void eS(ta("verificationUploader.pairIncompatibleWarning",{format:ea?ex[ea]:""}));if((0,G.UC)({is_anonymous:Z,mode:s?"image_only":"raw_pair",precheck:s&&null!=(t=null==tU||null==(e=tU.result)?void 0:e.outcome)?t:null}),Z){try{eU(!0),eY(s&&null!=(i=null==tU||null==(a=tU.result)?void 0:a.outcome)?i:null),await eB.startAnonymousVerification(ee.blob,s?null:eg.blob,ee.name,s?null:eg.name),et(null),ei(null),ev(null),ek(null),tc(!1),tu(null),eX(!1),(0,G.Cv)({is_anonymous:!0,outcome:"submitted",mode:s?"image_only":"raw_pair"}),null==Q||Q()}catch(e){if(console.error("Anonymous verification failed:",e),(0,G.J6)({is_anonymous:!0,reason:(0,G.IV)(e),mode:s?"image_only":"raw_pair"}),e instanceof b.h&&429===e.status){let t=e.body;eS(ta("verificationUploader.rateLimitError",{resetTime:((null==t?void 0:t.detail)||{}).reset_time||"midnight UTC"}))}else eS(ta("verificationUploader.anonymousVerificationFailed"))}finally{eU(!1)}return}if(!s&&e9&&(0,O.U)(e9).blocked)return void eS(ta("verificationUploader.quotaExceeded"));eU(!0),eS(null),e_(0);try{if(!(0,j.SU)())throw Error("Authentication required");let e=await k.I.createVerificationV1VerificationsPost({image:ee.blob,...s?{}:{raw:eg.blob}});eR({...e,verification_mode:s?j.bf.IMAGE_ONLY:j.bf.RAW_PAIR}),tc(!1),tu(null),!s&&e9&&tp();let t=null==e?void 0:e.status;(0,G.Cv)({is_anonymous:!1,outcome:"string"==typeof t?t:"submitted",mode:s?"image_only":"raw_pair"}),null==Q||Q()}catch(e){(0,G.J6)({is_anonymous:!1,reason:(0,G.IV)(e),mode:s?"image_only":"raw_pair"}),e instanceof b.h&&402===e.status?(eS(ta("BUDGET_EXCEEDED"===(null==(r=e.body)||null==(n=r.detail)?void 0:n.error_code)?"verificationUploader.budgetExceeded":"verificationUploader.quotaExceeded")),tp()):eS(e instanceof Error?e.message:"Upload failed")}finally{eU(!1),e_(null)}},[ee,eg,eh,ea,Z,eB,ta,Q,e9,tp,tU]);(0,m.useEffect)(()=>{tm&&(null==ee?void 0:ee.blob)&&!eC&&(tf(!1),tI("quick"))},[tm,ee,eC,tI]);let tR=(0,m.useRef)(null);(0,m.useEffect)(()=>{Y&&tR.current!==Y.id&&(tR.current=Y.id,th("jpeg",Y.file.name,Y.file,"handoff"))},[Y,th]);let tT=Z&&!!eB.ongoingVerification,tE=Z&&e$&&!!ez,tA=Z&&null!==eQ&&!eB.ongoingVerification&&eB.completedVerifications.some(e=>e.id===eQ.id),tV=null;if(eI)return(0,i.jsx)(S,{verification:eI,onStartNew:()=>{et(null),ei(null),ev(null),ek(null),eR(null),eS(null),tc(!1),tu(null)}});Z&&(tE&&ez?tV=(0,i.jsx)(P,{verificationId:ez,onBack:()=>{eX(!0),eW(!1),eO(null),eZ(null),et(null),ei(null),ev(null),ek(null),eS(null)},onNewVerification:eB.canStartNew?()=>{eX(!0),eW(!1),eO(null),eZ(null),et(null),ei(null),ev(null),ek(null),eS(null),tc(!1),tu(null)}:void 0,onStartRawVerification:()=>{var e;eX(!0),eW(!1),eO(null),eZ(null),eS(null),null==(e=e1.current)||e.scrollIntoView({behavior:"smooth",block:"start"})},remainingVerifications:eB.remainingTotal,fileNames:null!=(V=null==(E=eB.completedVerifications.find(e=>e.id===ez))?void 0:E.fileNames)?V:(null==(A=eB.lastVerification)?void 0:A.id)===ez?eB.lastVerification.file_names:void 0}):tT&&eB.ongoingVerification&&(tV=(0,i.jsx)("div",{className:"w-full",children:(0,i.jsx)(o.I,{ongoingVerification:eB.ongoingVerification,notifications:{supported:e3,enabled:e6,onEnable:tC},precheck:eJ})})));let tL=async e=>{eE(!0),eS(null);try{var t,a,i;let n="471034728204-bf6hd1ovjah91qdih9utdohnli43v93o.apps.googleusercontent.com",r="AIzaSyBoOlwLzNtHVhZ7YXqrI4d4RLrjC-2cY1o";if(!n||!r)throw Error("Google API credentials missing");if(await new Promise(e=>{let t=0;!function a(){var i,n;(null==(n=window.google)||null==(i=n.accounts)?void 0:i.oauth2)||++t>30?e():setTimeout(a,200)}()}),!(null==(a=window.google)||null==(t=a.accounts)?void 0:t.oauth2))throw Error("Google Identity Services not loaded");let l=(await new Promise((e,t)=>
1{window.google.accounts.oauth2.initTokenClient({client_id:n,scope:"https://www.googleapis.com/auth/drive.readonly",callback:t=>{e(t)},error_callback:e=>{console.error("Token error:",e),t(Error("Failed to get access token"))}}).requestAccessToken()})).access_token;if(await new Promise(e=>{let t=0;!function a(){window.gapi&&"function"==typeof window.gapi.load||++t>30?e():setTimeout(a,200)}()}),!window.gapi)throw Error("Google API not loaded");if(await new Promise(e=>{window.gapi.load("picker",{callback:e})}),!(null==(i=window.google)?void 0:i.picker))throw Error("Google Picker not available");let s="";"jpeg"===e?s="image/jpeg,image/png,image/webp,image/heic,image/heif,image/avif,image/gif":"raw"===e&&(s="image/x-canon-cr2,image/x-canon-cr3,image/x-nikon-nef,image/x-sony-arw,image/x-adobe-dng,image/x-fuji-raf,image/x-olympus-orf,image/x-panasonic-rw2,image/x-pentax-pef,image/x-samsung-srw,application/octet-stream");let o=new window.google.picker.View(window.google.picker.ViewId.DOCS);s&&o.setMimeTypes(s),new window.google.picker.PickerBuilder().addView(o).setOAuthToken(l).setDeveloperKey(r).setCallback(async t=>{try{var a,i;if(t.action===(null==(a=window.google)?void 0:a.picker.Action.PICKED)){let a=t.docs[0],i=a.id,n=a.name,r=await fetch("https://www.googleapis.com/drive/v3/files/".concat(i,"?alt=media"),{headers:{Authorization:"Bearer ".concat(l)}});if(!r.ok)throw Error("Failed to fetch Google Drive file");let s=await r.blob();await th(e,n,s,"drive"),eE(!1)}else t.action===(null==(i=window.google)?void 0:i.picker.Action.CANCEL)&&eE(!1)}catch(e){console.error("Error in picker callback:",e),eS(ta("verificationUploader.downloadFailed",{message:e instanceof Error?e.message:"Unknown error"})),eE(!1)}}).build().setVisible(!0)}catch(e){console.error("Google Drive error:",e),eS(ta("verificationUploader.downloadFailed",{message:e instanceof Error?e.message:""})),eE(!1)}},tD=async e=>{eE(!0),eS(null);try{if(!window.Dropbox)throw Error("Dropbox Chooser not loaded");window.Dropbox.choose({success:async t=>{let a=t[0],i=await fetch(a.link);if(!i.ok)throw Error("Failed to fetch Dropbox file");let n=await i.blob();await th(e,a.name,n,"dropbox"),eE(!1)},cancel:()=>{eE(!1)},linkType:"direct",multiselect:!1,extensions:"jpeg"===e?ef:em})}catch(e){eS(ta("verificationUploader.downloadFailed")),eE(!1)}},tG=e=>{eP(e),eD(""),eV(!0)},tP=async()=>{if(eL){eV(!1);try{eS(null),eE(!0);let e="/api/download?url=".concat(encodeURIComponent(eL)),t=await fetch(e);if(!t.ok)throw Error("Failed to fetch file");let a=await t.blob(),i=eL.split("/").pop()||"linked-file";eG&&await th(eG,i,a,"link")}catch(e){eS(ta("verificationUploader.downloadFailed",{message:e instanceof Error?e.message:""}))}finally{eE(!1),eP(null)}}},tq=async(e,t)=>{var a;let i=null==(a=e.target.files)?void 0:a[0];i&&(await th(t,i.name,i,"local"),e.target.value="")},tM=(e,t,a)=>{let n="jpeg"===e?tx:tg;return t?(0,i.jsxs)("div",{className:"group relative h-48 w-full rounded-sm p-4 text-center flex flex-col items-center justify-center ".concat(J?"border border-border bg-surface":"border-2 border-dashed border-gray-300"),children:["jpeg"===e&&eb?(0,i.jsx)(f.default,{src:eb,alt:t.name||"file preview",fill:!0,style:{objectFit:"contain"},className:"rounded-sm"}):(0,i.jsx)("div",{className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)(p,{className:"h-16 w-16 text-gray-400"})}),(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black bg-opacity-50 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,i.jsx)("span",{className:"mb-2 text-sm font-semibold text-white",children:t.name}),(0,i.jsx)(l.$,{variant:"secondary",size:"sm",onClick:()=>{"jpeg"===e?(et(null),ei(null)):ev(null)},children:ta("verificationUploader.change")})]})]}):(0,i.jsxs)("div",{className:"w-full rounded-sm p-3 sm:p-4 text-center flex flex-col items-center justify-center cursor-pointer hover:border-primary transition-all ".concat(J?"border border-border bg-surface min-h-[200px]":"border-2 border-dashed border-gray-300 min-h-[280px] sm:min-h-[240px]"),onClick:()=>{var e;return null==(e=n.current)?void 0:e.click()},onDrop:t=>{var a;t.preventDefault();let i=null==(a=t.dataTransfer.files)?void 0:a[0];i&&th(e,i.name,i,"drag_drop")},onDragOver:e=>{e.preventDefault()},children:[(0,i.jsx)(p,{className:"h-10 w-10 sm:h-12 sm:w-12 text-gray-400"}),(0,i.jsx)("span",{className:"mt-2 block text-sm font-semibold text-foreground",children:a}),(0,i.jsx)("span",{className:"text-xs text-gray-400 px-2",children:ta("jpeg"===e?"verificationUploader.jpegHint":"verificationUploader.rawHint")}),"raw"===e&&ee&&(0,i.jsx)("span",{className:"mt-1 text-xs text-amber-600 px-2",children:ta("verificationUploader.rawSlotQuickCheckHint")}),"raw"===e&&(null==tF?void 0:tF.camera)&&(0,i.jsx)("span",{className:"mt-1 text-xs text-foreground px-2",children:ta("verificationUploader.rawSlotCameraHint",{camera:tF.camera.display,raw:tS})}),(0,i.jsxs)("div",{className:"mt-4 w-full max-w-md",children:[(0,i.jsxs)(l.$,{variant:"default",className:"flex w-full items-center justify-center gap-2 text-sm py-2.5",onClick:e=>{var t;e.stopPropagation(),null==(t=n.current)||t.click()},disabled:eT,children:[(0,i.jsx)(x,{className:"h-4 w-4 flex-shrink-0"}),(0,i.jsx)("span",{className:"truncate",children:ta("verificationUploader.chooseFile")})]}),!J&&(0,i.jsxs)("button",{type:"button",className:"mt-2 inline-flex items-center gap-1 text-xs text-gray-500 hover:text-primary transition-colors",onClick:t=>{t.stopPropagation(),eM(t=>({...t,[e]:!t[e]}))},"aria-expanded":eq[e],children:[(0,i.jsx)(g.A,{className:"h-3.5 w-3.5 transition-transform ".concat(eq[e]?"rotate-180":""),"aria-hidden":"true"}),ta("verificationUploader.moreSources")]}),!J&&eq[e]&&(0,i.jsxs)("div",{className:"mt-2 grid grid-cols-3 gap-2",children:[(0,i.jsxs)(l.$,{variant:"outline",size:"sm",className:"flex items-center justify-center gap-1.5 text-xs py-2 px-2",onClick:t=>{t.stopPropagation(),tD(e)},disabled:eT,children:[eT?(0,i.jsx)(v.A,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}):(0,i.jsx)(w,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,i.jsx)("span",{className:"truncate",children:"Dropbox"})]}),(0,i.jsxs)(l.$,{variant:"outline",size:"sm",className:"flex items-center justify-center gap-1.5 text-xs py-2 px-2",onClick:t=>{t.stopPropagation(),tL(e)},disabled:eT,children:[eT?(0,i.jsx)(v.A,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}):(0,i.jsx)(w,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,i.jsx)("span",{className:"truncate",children:"Drive"})]}),(0,i.jsxs)(l.$,{variant:"outline",size:"sm",className:"flex items-center justify-center gap-1.5 text-xs py-2 px-2",onClick:t=>{t.stopPropagation(),tG(e)},disabled:eT,children:[eT?(0,i.jsx)(v.A,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}):(0,i.jsx)(y,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,i.jsx)("span",{className:"truncate",children:"Link"})]})]})]}),(0,i.jsx)("input",{ref:n,type:"file",accept:"jpeg"===e?ef.join(","):em.join(","),className:"hidden",onChange:t=>
1tq(t,e)}),!J&&(0,i.jsx)("span",{className:"mt-3 hidden text-xs text-gray-500 sm:block",children:ta("verificationUploader.orDragDrop")})]})};return(0,i.jsxs)("div",{ref:e1,className:"w-full ".concat(K),children:[!Z&&tt&&(0,i.jsx)("div",{className:"mb-4 p-3 bg-gray-100 rounded-sm text-sm",children:tt.hasCredit?(0,i.jsx)("span",{className:"text-gray-700",children:ta("verificationUploader.creditRemaining",{remaining:tt.creditRemaining})}):tt.quotaRemaining>0?(0,i.jsx)("span",{className:"text-gray-700",children:ta("verificationUploader.quotaRemaining",{remaining:tt.quotaRemaining,total:tt.planLimit})}):tt.inOverage?(0,i.jsx)("span",{className:"text-amber-600",children:ta("verificationUploader.quotaExceededOverageAllowed")}):(0,i.jsxs)("span",{className:"text-red-600",children:[ta("verificationUploader.quotaExceededNoOverage")," ",(0,i.jsx)(_.N_,{href:"/profile#switch-plan",className:"underline hover:no-underline",children:ta("verificationUploader.quotaUpgradeLink")})]})}),eF&&(0,i.jsxs)(n.Fc,{variant:"destructive",className:"mb-4",children:[(0,i.jsx)(n.XL,{children:ta("verificationUploader.uploadErrorTitle")}),(0,i.jsxs)(n.TN,{children:[eF,eF===ta("verificationUploader.quotaExceeded")&&(0,i.jsx)("div",{className:"mt-2",children:(0,i.jsx)(_.N_,{href:"/profile",className:"underline hover:no-underline",children:ta("verificationUploader.manageSubscription")})})]})]}),to&&(0,i.jsxs)(n.Fc,{className:"mb-4",children:[(0,i.jsx)(n.XL,{children:ta("verificationUploader.noRawHelpTitle")}),(0,i.jsxs)(n.TN,{children:[ee?(0,i.jsx)("span",{className:"block mb-3",children:(0,i.jsx)(l.$,{size:"sm",disabled:eC,onClick:()=>{(0,G.RR)({is_anonymous:Z,action:"quick_check"}),tI("quick")},children:ta("verificationUploader.noRawHelpRunQuickCheck")})}):td?(0,i.jsx)("span",{className:"block mb-3",children:(0,i.jsx)(l.$,{size:"sm",disabled:eC,onClick:()=>{tu(null),(0,G.RR)({is_anonymous:Z,action:"move_and_run"}),tf(!0),th("jpeg",td.name,td.blob)},children:ta("verificationUploader.noRawHelpRunQuickCheck")})}):null,(0,i.jsx)("span",{className:"block",children:ee?ta("verificationUploader.noRawHelpQuickCheckReady"):ta("verificationUploader.noRawHelpQuickCheck")}),(0,i.jsxs)("span",{className:"block mt-2",children:[ta("verificationUploader.noRawHelpText")," ",(0,i.jsx)(_.N_,{href:"/tools/ai-photo-checker",className:"underline hover:no-underline",children:ta("verificationUploader.noRawHelpCheckerLink")})]})]})]}),Z&&!tT&&!tE&&eB.unacknowledgedFailure&&(0,i.jsxs)(n.Fc,{variant:"destructive",className:"mb-4",children:[(0,i.jsx)(n.XL,{children:ti("failedNoticeTitle",{defaultValue:"Your verification could not be completed"})}),(0,i.jsxs)(n.TN,{children:[(0,i.jsxs)("div",{className:"mt-1 flex flex-wrap items-center justify-between gap-3",children:[(0,i.jsx)("span",{children:ti("failedNoticeText",{defaultValue:'Processing of "{fileName}" failed and no result was produced. You can try again below â if it keeps failing, contact support.',fileName:eB.unacknowledgedFailure.fileNames.jpeg})}),(0,i.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>eB.acknowledgeFailure(eB.unacknowledgedFailure.id),children:ti("failedNoticeDismiss",{defaultValue:"Dismiss"})})]}),eB.unacknowledgedFailure.failureReason&&(0,i.jsxs)("div",{className:"mt-3",children:[(0,i.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 text-xs underline hover:no-underline",onClick:()=>tr(e=>!e),"aria-expanded":tn,children:[(0,i.jsx)(g.A,{className:"h-3.5 w-3.5 transition-transform ".concat(tn?"rotate-180":""),"aria-hidden":"true"}),ti("failedNoticeDetailsToggle",{defaultValue:"Technical details"})]}),tn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("pre",{className:"mt-2 whitespace-pre-wrap break-all rounded-sm bg-black/20 p-2 font-mono text-xs",children:eB.unacknowledgedFailure.failureReason}),(0,i.jsx)("p",{className:"mt-1 text-xs opacity-80",children:ti("failedNoticeDetailsHint",{defaultValue:"Include this text when contacting support."})})]})]})]})]}),Z&&tV,Z&&!tE&&!tT&&!eB.canStartNew&&!eI&&(0,i.jsxs)(n.Fc,{className:"mb-4",children:[(0,i.jsx)(n.XL,{children:ti("uploader.rateLimitTitle")}),(0,i.jsxs)(n.TN,{children:[(0,i.jsx)("p",{children:ti("uploader.rateLimitMessage")}),(0,i.jsx)(T.I,{source:"anon_wall",className:"mt-3"}),(0,i.jsx)("p",{className:"mt-3 text-xs",children:(0,i.jsx)(_.N_,{href:"/sign-up",className:"underline hover:no-underline",children:ti("codeSignIn.passwordInstead")})})]})]}),(!Z||eB.canStartNew&&!tE&&!tT&&!eQ)&&(0,i.jsxs)(i.Fragment,{children:[J&&!eg?(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[tM("jpeg",ee,ta("verificationUploader.jpegLabel")),(0,i.jsxs)("div",{className:"flex flex-col gap-3 rounded-sm border border-border bg-background p-4 sm:flex-row sm:items-center",children:[(0,i.jsxs)("div",{className:"flex-1",children:[(0,i.jsx)("p",{className:"text-sm font-semibold text-foreground",children:(null==tF?void 0:tF.camera)?ta("verificationUploader.singleImageRawTitleCamera",{camera:tF.camera.display,raw:tS}):ta("verificationUploader.singleImageRawTitle")}),(0,i.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:ta("verificationUploader.singleImageRawBody")})]}),(0,i.jsx)(l.$,{size:"sm",variant:(null==tF?void 0:tF.camera)?"default":"outline",onClick:()=>{var e;(null==tF?void 0:tF.camera)&&(0,G.qg)({is_anonymous:Z,surface:"single_image"}),null==(e=tg.current)||e.click()},disabled:eC,children:ta("verificationUploader.singleImageRawButton")}),(0,i.jsx)("input",{ref:tg,type:"file",accept:em.join(","),className:"hidden",onChange:e=>tq(e,"raw")})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"mb-3 text-center text-sm text-muted-foreground",children:ta("verificationUploader.conceptLine")}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[tM("jpeg",ee,ta("verificationUploader.jpegLabel")),tM("raw",eg,ta("verificationUploader.rawLabel"))]})]}),ee&&eg&&eh&&ea&&(0,i.jsxs)(n.Fc,{className:"mt-4 border-amber-300 bg-amber-50 text-amber-900",children:[(0,i.jsx)(n.XL,{children:ta("verificationUploader.pairIncompatibleTitle")}),(0,i.jsx)(n.TN,{children:ta("verificationUploader.pairIncompatibleWarning",{format:ex[ea]})})]}),!Z&&eg&&ew&&("checking"===ew.kind?(0,i.jsxs)("p",{className:"mt-4 flex items-center justify-center gap-2 text-sm text-gray-500",children:[(0,i.jsx)(v.A,{className:"h-4 w-4 animate-spin flex-shrink-0"}),ta("offloads.preflight.checking")]}):"match"===ew.kind?(0,i.jsxs)("div",{className:"mt-4 rounded-sm border border-green-300 bg-green-50 p-3 text-green-900 text-sm",children:[(0,i.jsx)("p",{children:ta("offloads.preflight.willLink",{label:ew.match.offload_label||ta("offloads.preflight.unnamedOffload"),date:ew.match.anchored_at?new Date(ew.match.anchored_at).toLocaleDateString():"â"})}),ew.match.match_grade===$.B.EVENT_ONLY&&(0,i.jsx)("p",{className:"mt-1 text-amber-800",children:ta("offloads.preflight.eventOnlyNote")})]}):(0,i.jsx)("div",{className:"mt-4 flex justify-center",children:(0,i.jsx)("span",{className:"inline-flex items-center rounded-full border border-amber-300 bg-amber-50 px-2.5 py-0.5 text-xs font-semibold text-amber-800 cursor-help",title:ta("offloads.preflight.modifiedHint"),children:ta("offloads.preflight.modifiedChip")})})),eC&&null!==eN&&(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsx)(s.k,{value:eN})}),!(J&&!eg)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"mt-4 flex justify-center",children:(0,i.jsx)(l.$,{onClick:()=>tI("full"),disabled:eC||!ee||!eg||eh,children:eC?ta("verificationUploader.uploading"):ta("verificationUploader.startVerification")})}),(0,i.jsx)("p",{className:"mt-2 text-center text-xs text-gray-500",children:ta("verificationUploader.durationHint")})]}),ee&&!eg&&!eC&&(0,i.jsxs)(n.Fc,{className:"mt-6 border-amber-300 bg-amber-50 text-amber-900",children:[(0,i.jsx)(n.XL,{className:"text-base font-semibold",children:ta("verificationUploader.quickCheckTitle")}),(0,i.jsx)(n.TN,{children:(0,i.jsxs)("div",{className:"space-y-3 mt-1",children:[(0,i.jsx)("p",{children:ta("verificationUploader.quickCheckIntro")}),tF&&"unknown"!==tF.profile&&(0,i.jsxs)("div",{className:"rounded-sm border p-3 space-y-1 ".concat("camera"===tF.profile?"border-primary/40 bg-primary/5 text-foreground":"border-amber-400 bg-amber-100"),children:["camera"===tF.profile&&tF.camera?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.profileCameraTitle",{camera:tF.camera.display})}),(0,i.jsx)("p",{className:"text-sm",children:tF.editor?ta("verificationUploader.profileCameraBodyEditor",{editor:tF.editor,raw:tS}):ta("verificationUploader.profileCameraBody",{raw:tS})}),(0,i.jsx)(l.$,{size:"sm",className:"mt-1",disabled:eC,onClick:()=>{var e;(0,G.qg)({is_anonymous:Z,surface:"quick_check"}),null==(e=tg.current)||e.click()},children:ta("verificationUploader.profileCameraButton")})]}):"screenshot_likely"===tF.profile?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.profileScreenshotTitle",{width:null!=(L=tF.width)?L:0,height:null!=(D=tF.height)?D:0})}),(0,i.jsxs)("p",{className:"text-sm",children:[ta("verificationUploader.profileScreenshotBody")," ",(0,i.jsx)(C.TrackedLink,{href:"/ask-for-the-original",location:"photo_profile",cta:"ask_for_the_original",className:"underline hover:no-underline",children:ta("verificationUploader.precheckNoneNextAsk")})]})]}):"reencoded"===tF.profile?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.profileReencodedTitle",{format:tF.format?ex[tF.format]:""})}),(0,i.jsx)("p",{className:"text-sm",children:ta("verificationUploader.profileReencodedBody")})]}):"tiny"===tF.profile?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.profileTinyTitle",{width:null!=(W=tF.width)?W:0,height:null!=(X=tF.height)?X:0})}),(0,i.jsx)("p",{className:"text-sm",children:ta("verificationUploader.profileTinyBody")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.profileStr
1ippedTitle")}),(0,i.jsx)("p",{className:"text-sm",children:ta("verificationUploader.profileStrippedBody")})]}),(0,i.jsx)("p",{className:"text-xs opacity-80",children:ta("verificationUploader.profileClaimNote")})]}),tU&&!tU.result&&(0,i.jsxs)("p",{className:"flex items-center gap-2 text-sm",children:[(0,i.jsx)(v.A,{className:"h-4 w-4 animate-spin flex-shrink-0"}),ta("verificationUploader.precheckChecking")]}),(null==tU||null==(a=tU.result)?void 0:a.outcome)==="found"&&(0,i.jsxs)("div",{className:"rounded-sm border border-green-300 bg-green-50 p-3 text-green-900 space-y-1",children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.precheckFoundTitle")}),tU.result.issuer&&(0,i.jsx)("p",{className:"text-sm",children:ta("verificationUploader.precheckFoundSignedBy",{issuer:tU.result.issuer})}),tU.result.generator&&(0,i.jsx)("p",{className:"text-sm",children:ta("verificationUploader.precheckFoundGenerator",{generator:tU.result.generator})}),tU.result.isGenerative&&(0,i.jsx)("p",{className:"text-sm font-semibold",children:ta("verificationUploader.precheckFoundGenerative")}),(0,i.jsx)("p",{className:"text-xs opacity-80",children:ta("verificationUploader.precheckFoundNote")})]}),(null==tU||null==(h=tU.result)?void 0:h.outcome)==="none"&&(0,i.jsxs)("div",{className:"rounded-sm border border-amber-400 bg-amber-100 p-3 space-y-2",children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.precheckNoneTitle")}),(0,i.jsx)("p",{className:"text-sm",children:ta("verificationUploader.precheckNoneBody")}),(0,i.jsx)("p",{className:"text-sm font-semibold pt-1",children:ta("verificationUploader.precheckNoneNextTitle")}),(0,i.jsxs)("ul",{className:"text-sm space-y-1 list-disc pl-5",children:[(0,i.jsx)("li",{children:(0,i.jsx)(C.TrackedLink,{href:"/tools/c2pa-camera-check",location:"quick_check_none",cta:"c2pa_camera_check",className:"underline hover:no-underline",children:ta("verificationUploader.precheckNoneNextCamera")})}),!J&&(0,i.jsx)("li",{children:(0,i.jsx)(C.TrackedLink,{href:"/tools/ai-photo-checker",location:"quick_check_none",cta:"ai_photo_checker",className:"underline hover:no-underline",children:ta("verificationUploader.precheckNoneNextChecker")})}),(0,i.jsx)("li",{children:(0,i.jsx)(C.TrackedLink,{href:"/articles/how-to-tell-if-photo-is-ai-generated",location:"quick_check_none",cta:"article_how_to_tell",className:"underline hover:no-underline",children:ta("verificationUploader.precheckNoneNextArticle")})}),(0,i.jsx)("li",{children:(0,i.jsx)(C.TrackedLink,{href:"/ask-for-the-original",location:"quick_check_none",cta:"ask_for_the_original",className:"underline hover:no-underline",children:ta("verificationUploader.precheckNoneNextAsk")})})]}),(0,i.jsx)("p",{className:"text-sm",children:ta("verificationUploader.precheckNoneNextRaw")})]}),(null==ty?void 0:ty.file)===ee&&ty.scan.declarations.length>0&&(0,i.jsxs)("div",{className:"rounded-sm border border-amber-400 bg-amber-100 p-3 space-y-1",children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.precheckDeclarationTitle")}),(0,i.jsx)("p",{className:"text-sm",children:ta("verificationUploader.precheckDeclarationBody",{details:ty.scan.declarations.map(e=>e.detail).join(", ")})})]}),!Z&&(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.quickCheckFree")}),Z&&(0,i.jsx)("p",{className:"text-sm font-semibold",children:ta("verificationUploader.quickCheckCostsSlot")}),(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.quickCheckChecksTitle")}),(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1 mt-1",children:[(0,i.jsx)("li",{children:ta("verificationUploader.quickCheckChecks1")}),(0,i.jsx)("li",{children:ta("verificationUploader.quickCheckChecks2")})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.quickCheckLimitsTitle")}),(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1 mt-1",children:[(0,i.jsx)("li",{children:ta("verificationUploader.quickCheckLimits1")}),(0,i.jsx)("li",{children:ta("verificationUploader.quickCheckLimits2")})]})]})]}),(0,i.jsx)("p",{className:"text-xs opacity-80",children:ta("verificationUploader.quickCheckNoC2paNote")}),(0,i.jsx)("p",{className:"text-xs opacity-80",children:ta("verificationUploader.quickCheckDurationHint")}),(0,i.jsx)("p",{className:"font-semibold",children:ta("verificationUploader.quickCheckRecommendation")}),(0,i.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 pt-1",children:[(0,i.jsx)(l.$,{size:"sm",onClick:()=>{var e;return null==(e=tg.current)?void 0:e.click()},disabled:eC,children:ta("verificationUploader.addRawInstead")}),(0,i.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>tI("quick"),disabled:eC,children:(null==tU||null==(U=tU.result)?void 0:U.outcome)==="none"?ta("verificationUploader.quickCheckRunForensic"):ta("verificationUploader.runQuickCheck")})]})]})})]}),!ee&&!J&&(0,i.jsxs)("details",{className:"mt-3 mx-auto max-w-2xl text-xs text-gray-600",children:[(0,i.jsx)("summary",{className:"cursor-pointer text-center text-gray-500 hover:text-primary",children:ta("verificationUploader.preUploadNoRawSummary")}
1),(0,i.jsxs)("p",{className:"mt-2 text-left leading-relaxed",children:[ta("verificationUploader.preUploadNoRawBody")," ",(0,i.jsx)(_.N_,{href:"/tools/ai-photo-checker",className:"underline hover:no-underline",children:ta("verificationUploader.noRawHelpCheckerLink")}),"."]})]}),(0,i.jsx)("div",{className:"mt-4 text-center text-xs text-gray-500",children:ta.rich("verificationUploader.mobileCaptureHint",{link:e=>(0,i.jsx)("a",{href:"https://apps.apple.com/de/app/lumethic-capture/id6757165600",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e})})})]}),Z&&eB.completedVerifications.length>0&&(0,i.jsxs)("div",{className:"mt-8",children:[(0,i.jsx)("h3",{className:"text-lg font-medium text-white mb-4",children:ta("verificationUploader.historyTitle")}),(0,i.jsx)("div",{className:"space-y-3",children:eB.completedVerifications.map(e=>(0,i.jsxs)("div",{className:"flex items-center justify-between p-4 bg-gray-800 rounded-sm border-2 border-gray-700 hover:border-gray-600 transition-colors",children:[(0,i.jsxs)("div",{className:"flex-1",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-white",children:[(0,i.jsx)("span",{children:e.fileNames.raw?"".concat(e.fileNames.jpeg," & ").concat(e.fileNames.raw):e.fileNames.jpeg}),!e.fileNames.raw&&(0,i.jsx)(r.E,{variant:"secondary",className:"text-xs font-normal",children:ta("verificationUploader.historyQuickCheckTag")})]}),(0,i.jsxs)("div",{className:"text-xs text-gray-400 mt-1",children:[new Date(e.completedAt).toLocaleDateString()," -",(0,i.jsx)("span",{className:"ml-1 ".concat("completed"===e.status?"text-green-400":"text-red-400"),children:"completed"===e.status?ta("verificationUploader.historyStatusCompleted"):ta("verificationUploader.historyStatusFailed")})]})]}),(0,i.jsx)(l.$,{variant:"outline",size:"sm",onClick:()=>{eX(!1),eO(e.id),eW(!0),(0,er.XL)(e.id)&&(0,G.tG)({is_anonymous:!0,mode:null!=e.f
1ileNames.raw?"raw_pair":"image_only",via:"return",waited_seconds:null})},children:ta("verificationUploader.historyViewResults")})]},e.id))})]}),eA&&(0,i.jsx)(c.lG,{open:eA,onOpenChange:eV,children:(0,i.jsxs)(c.Cf,{children:[(0,i.jsxs)(c.c7,{children:[(0,i.jsx)(c.L3,{children:ta("verificationUploader.enterFileUrl")}),(0,i.jsx)(c.rr,{children:ta("verificationUploader.enterFileUrlDescription")})]}),(0,i.jsx)(d.p,{type:"url",placeholder:"https://...",value:eL,onChange:e=>eD(e.target.value),autoFocus:!0}),(0,i.jsxs)(c.Es,{children:[(0,i.jsx)(l.$,{variant:"secondary",onClick:()=>eV(!1),children:ta("verificationUploader.cancel")}),(0,i.jsx)(l.$,{onClick:tP,disabled:!eL,children:ta("verificationUploader.select")})]})]})}),Z&&(null==eQ?void 0:eQ.isPair)&&!tE&&(0,i.jsxs)("div",{id:"waiting-game",className:"mt-8 mb-6 scroll-mt-24",children:[tA&&(0,i.jsxs)(n.Fc,{className:"sticky top-2 z-10 mb-4 border-green-300 bg-green-50 text-green-900",children:[(0,i.jsx)(n.XL,{children:ti("resultReadyTitle",{defaultValue:"Your result is ready"})}),(0,i.jsx)(n.TN,{children:(0,i.jsxs)("div",{className:"mt-1 flex flex-wrap items-center justify-between gap-3",children:[(0,i.jsx)("span",{children:ti("resultReadyText",{defaultValue:"Your verification has finished â finish the round or view it now."})}),(0,i.jsx)(l.$,{size:"sm",onClick:()=>{eQ&&(eX(!1),eO(eQ.id),eW(!0),(0,er.XL)(eQ.id)&&(0,G.tG)({is_anonymous:!0,mode:eQ.isPair?"raw_pair":"image_only",via:"banner",waited_seconds:(Date.now()-eQ.startedAt)/1e3}),eZ(null))},children:ti("viewResults")})]})})]}),(0,i.jsx)("div",{onClickCapture:()=>{eQ&&e0.current!==eQ.id&&(e0.current=eQ.id,(0,G.CQ)({mode:"raw_pair"}))},children:(0,i.jsxs)(R.Zp,{className:"border-primary/20",children:[(0,i.jsx)(R.aR,{className:"pb-3",children:(0,i.jsx)(R.ZB,{className:"text-lg",children:ti("gameWhileWaiting",{defaultValue:"Can You Identify AI-Generated Photos?"})})}),(0,i.jsxs)(R.Wu,{className:"pt-0 pb-6",children:[(0,i.jsx)("p",{className:"text-sm text-muted-foreground mb-6",children:ti("gameDescription",{defaultValue:"While you're waiting, try spotting AIâgenerated images. Can you tell what's real and what's fake?"})}),(0,i.jsx)(q.SpotTheFakeGame,{})]})]})})]})]})}},84037:(e,t,a)=>{a.d(t,{WM:()=>o,t$:()=>s,zW:()=>n});let i=null;function n(){return i||(i=a.e(6291).then(a.bind(a,6291)).then(e=>{let{createC2pa:t}=e;return t({wasmSrc:"/c2pa/c2pa_bg.wasm",settings:{verify:{verifyTrust:!1}}})})),i}let r={jpeg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",avif:"image/avif"},l={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".gif":"image/gif",".heic":"image/heic",".heif":"image/heif",".avif":"image/avif"},s=["trainedAlgorithmicMedia","compositeWithTrainedAlgorithmicMedia","algorithmicMedia","dataDrivenMedia"];async function o(e,t,a){let i=null;try{var o,c,d;let u=await n();if(!(i=await u.reader.fromBlob(function(e,t,a){var i;if(a&&r[a])return r[a];if(t.type)return t.type;let n=e.lastIndexOf(".");return null!=(i=l[n>=0?e.slice(n).toLowerCase():""])?i:"application/octet-stream"}(e,t,a),t)))return{outcome:"none"};let m=await i.manifestStore(),f=m.active_manifest?null==(o=m.manifests)?void 0:o[m.active_manifest]:void 0;if(!f)return{outcome:"none"};return{outcome:"found",issuer:null!=(d=null==(c=f.signature_info)?void 0:c.issuer)?d:null,generator:function(e){var t,a;let i=null==(t=e.claim_generator_info)?void 0:t[0];if(null==i?void 0:i.name)return i.version?"".concat(i.name," ").concat(i.version):i.name;let n=e.claim_generator;return n?(null!=(a=n.split(/\s+/)[0])?a:n).replace(/_/g," ").replace(/\//g," ").trim():null}(f),isGenerative:function(e){for(let n of["c2pa.actions","c2pa.actions.v2"]){var t,a,i;let r=null==(a=e.assertions)||null==(t=a.find(e=>e.label===n))?void 0:t.data;for(let e of null!=(i=null==r?void 0:r.actions)?i:[]){let t=null==e?void 0:e.digitalSourceType;if("string"==typeof t&&s.some(e=>t.includes(e)))return!0}}return!1}(f)}}catch(e){return{outcome:"error"}}finally{if(i)try{await i.free()}catch(e){}}}},92679:(e,t,a)=>{a.d(t,{U:()=>n,y:()=>r});let i=e=>Math.max(0,null!=e?e:0);function n(e){let t=i(e.credit_total),a=Math.min(i(e.credit_used),t),n=t-a,r
1=n>0,l=i(e.current_usage),s=i(e.plan_limit),o=Math.min(l,s),c=l>=s;return{creditTotal:t,creditUsed:a,creditRemaining:n,hasCredit:r,usage:l,planLimit:s,included:o,overage:l-o,quotaRemaining:s-o,atLimit:c,blocked:!r&&c&&!e.overage_allowed,inOverage:!r&&c&&e.overage_allowed}}function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+1,1))}},94964:(e,t,a)=>{a.r(t),a.d(t,{TrackedLink:()=>s});var i=a(95155),n=a(12115),r=a(12388),l=a(74068);let s=(0,n.forwardRef)(function(e,t){let{location:a,cta:n,source:s,onClick:o,...c}=e;return(0,i.jsx)(r.N_,{ref:t,onClick:e=>{(0,l.kq)({location:a,cta:n,source:s}),null==o||o(e)},...c})})},99241:(e,t,a)=>{a.d(t,{b:()=>l,s:()=>r});let i="lumethic.signedInWithCode";function n(){try{return"undefined"==typeof sessionStorage?null:sessionStorage}catch(e){return null}}function r(){try{var e;null==(e=n())||e.setItem(i,"1")}catch(e){}}function l(){let e=n();if(!e)return!1;try{let t=e.getItem(i);return t&&e.removeItem(i),"1"===t}catch(e){return!1}}},99307:(e,t,a)=>{a.d(t,{y:()=>s});var i=a(12115);a(40800);var n=a(2614),r=a(74068),l=a(91550);function s(){let[e,t]=(0,i.useState)(()=>(0,l.vh)()),[a,s]=(0,i.useState)(!1),[o,c]=(0,i.useState)(null),d=(0,i.useRef)(null),u=(0,i.useCallback)(()=>{t((0,l.vh)())},[]),m=(0,i.useCallback)(async e=>{var t,a,i;let s=(0,l.vh)(),o=e||(null==(t=s.ongoing_verification)?void 0:t.id);if(o)try{let e=await n.P.getSharedVerificationV1PublicVerificationsVerificationIdGet(o),t=e.status,c=s.ongoing_verification;c&&c.id===o&&t!==c.status&&(0,r.$o)({mode:null!=c.file_names.raw?"raw_pair":"image_only",status:t,elapsed_seconds:(Date.now()-c.started_at)/1e3});let m=null;if("failed"===t){let t=null==(a=e.image_metadata)?void 0:a.image_only_error,n=null==(i=e.raw_metadata)?void 0:i.raw_validation_error;"string"==typeof t&&t?m=t:"string"==typeof n&&n&&(m=n)}(0,l.XF)(t,m),u(),("completed"===t||"failed"===t)&&d.current&&(clearInterval(d.current),d.current=null)}catch(e){console.error("Failed to check verification status:",e)}},[u]),f=(0,i.useCallback)(async(e,t,a,i)=>{let r=(0,l.vh)();if(!(0,l.q8)(r))throw Error("Cannot start new verification");s(!0),c(null);try{let r=(0,l.vh)(),s=await n.P.createAnonymousVerificationV1PublicVerificationsPost({image:e,...t?{raw:t}:{}},r.anonymous_user_id);return(0,l.AT)(s.verification_id,a,i),d.current&&clearInterval(d.current),d.current=setInterval(()=>{m(s.verification_id)},1e4),u(),s.verification_id}catch(t){let e="Upload failed";throw t instanceof Error&&(e=t.message.includes("429")?"RATE_LIMIT_ERROR":t.message.includes("network")||t.message.includes("fetch")?"NETWORK_ERROR":t.message),c(e),t}finally{s(!1)}},[m,u]),h=(0,i.useCallback)(e=>{(0,l.Zy)(e),u()},[u]),p=(0,i.useCallback)(()=>{d.current&&(clearInterval(d.current),d.current=null),t((0,l.vh)())},[]);return(0,i.useEffect)(()=>{let e=(0,l.vh)();return(0,l.RN)(e)&&e.ongoing_verification&&(d.current=setInterval(()=>{m()},1e4)),()=>{d.current&&clearInterval(d.current)}},[m]),(0,i.useEffect)(()=>{let e=()=>{u()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[u]),{anonymousUserId:e.anonymous_user_id,ongoingVerification:e.ongoing_verification?{id:e.ongoing_verification.id,status:e.ongoing_verification.status,progress:e.ongoing_verification.upload_progress,startedAt:e.ongoing_verification.started_at,fileNames:e.ongoing_verification.file_names}:null,completedVerifications:(0,l.c5)(e).map(e=>({id:e.id,completedAt:e.completed_at,status:e.status,fileNames:e.file_names})),lastVerification:(0,l.U7)(e),unacknowledgedFailure:(()=>{var t;let a=(0,l.ck)(e);return a?{id:a.id,completedAt:a.completed_at,fileNames:a.file_names,failureReason:null!=(t=a.failure_reason)?t:null}:null})(),canStartNew:(0,l.q8)(e),remainingTotal:(0,l.N3)(e),maxAllowed:3,hasVerifications:(0,l.Zw)(e),shouldShowUpload:!(0,l.Zw)(e),startAnonymousVerification:f,checkVerificationStatus:m,acknowledgeFailure:h,clearState:p,clearCurrentVerification:l.sZ,isUploading:a,uploadError:o}}}}]);
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.