1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3313],{3313:(e,t,r)=>{r.r(t),r.d(t,{default:()=>eL});var n=r(5155),i=r(2115),o=r(7909);function a(e,t,r){let n=e=>"number"==typeof e?`${(100*e).toFixed(1)}%`:"",i=(e,t)=>"number"==typeof e&&"number"==typeof t?`${e.toFixed(5)}, ${t.toFixed(5)}`:"",o=(t||[]).filter(e=>e!==r&&null!=e.lat&&null!=e.lng).slice(0,4),a=` 2<!DOCTYPE html> 3<html lang="en"> 4<head> 5 <meta charset="utf-8"> 6 <title>GeoAxis Location Report</title> 7 <link rel="preconnect" href="https://fonts.googleapis.com"> 8 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 9 <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Quantico:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet"> 10 <style> 11 @page { size: letter portrait; margin: 12mm; } 12 * { margin: 0; padding: 0; box-sizing: border-box; } 13 html, body { width: 100%; height: 100%; } 14 body { 15 font-family: 'Quantico', sans-serif; 16 background: #FFFFFF; 17 color: #111111; 18 padding: 0; 19 line-height: 1.35; 20 -webkit-print-color-adjust: exact; 21 print-color-adjust: exact; 22 } 23 24 .page { 25 width: 100%; 26 max-width: 200mm; 27 margin: 0 auto; 28 display: grid; 29 grid-template-rows: auto auto 1fr auto; 30 gap: 14px; 31 page-break-after: avoid; 32 } 33 34 .header { 35 display: flex; 36 align-items: baseline; 37 justify-content: space-between; 38 padding-bottom: 10px; 39 border-bottom: 1.5px solid #111111; 40 } 41 h1 { 42 font-family: 'Instrument Serif', Georgia, serif; 43 font-size: 30px; 44 font-weight: 800; 45 letter-spacing: -1px; 46 color: #000000; 47 } 48 .subtitle { 49 font-family: 'Instrument Serif', Georgia, serif; 50 font-size: 9.5px; 51 font-weight: 700; 52 color: #666666; 53 text-transform: uppercase; 54 letter-spacing: 2px; 55 } 56 57 .top { 58 display: grid; 59 grid-template-columns: 220px 1fr; 60 gap: 18px; 61 align-items: start; 62 } 63 64 .query-image { 65 width: 100%; 66 aspect-ratio: 1 / 1; 67 object-fit: cover; 68 border-radius: 6px; 69 border: 1px solid #d4d4d4; 70 display: block; 71 } 72 .filename { 73 font-family: 'Instrument Serif', Georgia, serif; 74 color: #777777; 75 font-size: 10px; 76 margin-top: 6px; 77 text-align: center; 78 word-break: break-all; 79 } 80 81 .primary-card { 82 border: 1.5px solid #111111; 83 border-radius: 8px; 84 padding: 16px 18px; 85 } 86 .primary-card .badge { 87 display: inline-block; 88 background: #000000; 89 color: #FFFFFF; 90 padding: 3px 10px; 91 border-radius: 4px; 92 font-family: 'Instrument Serif', Georgia, serif; 93 font-size: 9px; 94 font-weight: 700; 95 letter-spacing: 1.5px; 96 text-transform: uppercase; 97 margin-bottom: 10px; 98 } 99 .primary-card .label { 100 font-family: 'Instrument Serif', Georgia, serif; 101 font-size: 9px; 102 font-weight: 700; 103 color: #777777; 104 text-transform: uppercase; 105 letter-spacing: 1.5px; 106 } 107 .primary-card .coord { 108 font-family: 'Instrument Serif', Georgia, serif; 109 font-size: 19px; 110 font-weight: 600; 111 color: #000000; 112 letter-spacing: -0.3px; 113 margin: 2px 0 10px 0; 114 } 115 .primary-card .address { 116 font-family: 'Quantico', sans-serif; 117 font-size: 14px; 118 color: #222222; 119 margin-bottom: 10px; 120 line-height: 1.3; 121 } 122 .primary-card .meta { 123 display: grid; 124 grid-template-columns: repeat(3, 1fr); 125 gap: 10px; 126 margin-top: 6px; 127 } 128 .primary-card .meta .field { border-top: 1px solid #e0e0e0; padding-top: 6px; } 129 .primary-card .meta .value { 130 font-family: 'Instrument Serif', Georgia, serif; 131 font-size: 13px; 132 font-weight: 600; 133 color: #000000; 134 } 135 136 .section-title { 137 font-family: 'Instrument Serif', Georgia, serif; 138 font-size: 10px; 139 font-weight: 700; 140 color: #000000; 141 text-transform: uppercase; 142 letter-spacing: 2px; 143 padding-bottom: 4px; 144 border-bottom: 1px solid #111111; 145 margin-bottom: 8px; 146 } 147 .others { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; } 148 .other-card { 149 border: 1px solid #d4d4d4; 150 border-radius: 6px; 151 padding: 8px 10px; 152 page-break-inside: avoid; 153 } 154 .other-card .row1 { 155 font-family: 'Instrument Serif', Georgia, serif; 156 font-size: 10px; 157 font-weight: 700; 158 color: #777777; 159 text-transform: uppercase; 160 letter-spacing: 1px; 161 margin-bottom: 2px; 162 } 163 .other-card .row2 { 164 font-family: 'Instrument Serif', Georgia, serif; 165 font-size: 12px; 166 font-weight: 600; 167 color: #000000; 168 } 169 .other-card .row3 { 170 font-family: 'Quantico', sans-serif; 171 font-size: 11px; 172 color: #555555; 173 margin-top: 2px; 174 line-height: 1.25; 175 max-height: 2.5em; 176 overflow: hidden; 177 } 178 179 .footer { 180 display: flex; 181 justify-content: space-between; 182 align-items: baseline; 183 padding-top: 8px; 184 border-top: 1px solid #111111; 185 font-family: 'Instrument Serif', Georgia, serif; 186 font-size: 9px; 187 color: #666666; 188 letter-spacing: 0.5px; 189 } 190 .footer .brand { font-weight: 800; color: #000000; letter-spacing: 1px; } 191 </style> 192</head> 193<body> 194 <div class="page"> 195 <div class="header"> 196 <h1>GeoAxis</h1>
197 <span class="subtitle">Geolocation Report · ${new Date().toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}</span> 198 </div> 199 200 <div class="top"> 201 <div> 202 <img src="${e.preview}" class="query-image" alt="Query"> 203 <div class="filename">${(e.name||"").toString().slice(0,60)}</div> 204 </div> 205 <div class="primary-card"> 206 ${r.rank?`<span class="badge">Rank ${r.rank}</span>`:'<span class="badge">Primary match</span>'} 207 <div class="label">Coordinates</div> 208 <div class="coord">${i(r.lat,r.lng)}</div> 209 ${r.address?`<div class="label">Address</div><div class="address">${r.address}</div>`:""} 210 ${r.location_name?`<div class="label">Location</div><div class="address">${r.location_name}${r.country?`, ${r.country}`:""}</div>`:""} 211 <div class="meta"> 212 ${"number"==typeof r.confidence?`<div class="field"><div class="label">Confidence</div><div class="value">${n(r.confidence)}</div></div>`:""} 213 ${"number"==typeof r.distance?`<div class="field"><div class="label">Distance</div><div class="value">${r.distance.toFixed(4)}</div></div>`:""} 214 ${"number"==typeof r.radius_km?`<div class="field"><div class="label">Radius</div><div class="value">${r.radius_km.toFixed(0)} km</div></div>`:""} 215 </div> 216 </div> 217 </div> 218 219 ${o.length?` 220 <div> 221 <div class="section-title">Other matches</div> 222 <div class="others"> 223 ${o.map(e=>` 224 <div class="other-card"> 225 <div class="row1">${e.rank?`Rank ${e.rank}`:"Match"}${"number"==typeof e.confidence?` · ${n(e.confidence)}`:""}</div> 226 <div class="row2">${i(e.lat,e.lng)}</div> 227 ${e.address?`<div class="row3">${e.address}</div>`:""} 228 </div> 229 `).join("")} 230 </div> 231 </div>`:"<div></div>"} 232 233 <div class="footer"> 234 <span class="brand">GEOAXIS</span> 235 <span>AI-powered geolocation analysis · geoaxis.ai</span> 236 </div> 237 </div> 238 239 <script> 240 (async () => { 241 // Ensure web fonts are ready before triggering print, otherwise the 242 // browser falls back to system serif and the PDF looks generic. 243 try { if (document.fonts && document.fonts.ready) await document.fonts.ready; } catch (_) {} 244 // Small grace period for layout to settle. 245 setTimeout(() => window.print(), 200); 246 })(); 247 </script> 248</body> 249</html> 250 `,l=window.open("","_blank");l&&(l.document.write(a),l.document.close())}var l=r(7650),s=r(8387),d=r(63),c=r(6380),p=r(8800),u=r(5827);let g=new Set(["business","enterprise"]);function f(){let{user:e,logout:t,subscription:r}=(0,s.useAuth)(),{show:o}=(0,p.E)(),a=(0,d.useRouter)(),[f,h]=(0,i.useState)(!1),[x,m]=(0,i.useState)(!1),[b,y]=(0,i.useState)(!1),v=(0,i.useRef)(null),k=(0,i.useRef)(null);if((0,i.useEffect)(()=>{function e(e){let t=v.current&&v.current.contains(e.target),r=k.current&&k.current.contains(e.target);t||r||h(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),!e)return(0,n.jsx)("button",{onClick:()=>o(),onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),"aria-label":"Sign in",style:{width:36,height:36,borderRadius:"50%",background:"var(--surface-strong)",border:"1px solid var(--border-strong)",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,transition:"all 0.2s ease"},children:(0,n.jsx)(u.A,{src:"/lottie/signin-hover.json",hover:x,size:20,tint:"#ffffff",forceTint:!0})});let w=async()=>{h(!1);try{await t()}catch(e){console.error("[logout] failed:",e)}},j=async()=>{if(!b){y(!0);try{let e=await c.auth.currentUser?.getIdToken();if(!e)throw Error("Not signed in");let t=await fetch("/api/get-portal-login-url",{headers:{Authorization:`Bearer ${e}`}}),r=await t.json();if(!t.ok||!r.loginUrl)throw Error(r.error||"No billing account found for this user");window.location.href=r.loginUrl}catch(e){console.error("Failed to open billing portal:",e),h(!1),alert("Could not open the billing portal. Please try again or contact [email protected].")}finally{y(!1)}}},S=(r?.plan||"").toLowerCase(),C=[...g.has(S)?[{label:"Settings (API keys)",icon:(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,n.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2
2500 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),onClick:()=>{h(!1),a.push("/dashboard/settings")}}]:[],{label:b?"Opening billing portalâ¦":"Manage Subscription",icon:(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,n.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),onClick:b?void 0:j,disabled:b},{divider:!0},{label:"Log Out",icon:(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),(0,n.jsx)("polyline",{points:"16 17 21 12 16 7"}),(0,n.jsx)("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),onClick:w,danger:!0}];return(0,n.jsxs)("div",{ref:v,style:{position:"relative"},children:[(0,n.jsx)("button",{onClick:()=>h(!f),style:{width:"36px",height:"36px",borderRadius:"50%",border:"none",backgroundColor:e?.photoURL?"transparent":"#000000",color:"var(--fg)",fontSize:"15.4px",fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.3s ease",overflow:"hidden",padding:0,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},onMouseEnter:e=>{e.currentTarget.style.borderColor="var(--fg-muted)"},onMouseLeave:e=>{f||(e.currentTarget.style.borderColor="var(--border-strong)")},children:e?.photoURL?(0,n.jsx)("img",{src:e.photoURL,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}):e?.displayName?e.displayName.charAt(0).toUpperCase():e?.email?e.email.charAt(0).toUpperCase():"U"}),f&&"undefined"!=typeof document&&(0,l.createPortal)((0,n.jsxs)("div",{ref:k,style:{position:"fixed",bottom:"20px",left:"80px",width:"220px",backgroundColor:"var(--bg-elev)",border:"1px solid var(--border)",borderRadius:"12px",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.5)",overflow:"hidden",zIndex:0x7fffffff},children:[(0,n.jsxs)("div",{style:{padding:"14px 16px",borderBottom:"1px solid var(--border)"},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:"14.3px",fontWeight:600,marginBottom:"2px"},children:e?.displayName||"User"}),(0,n.jsx)("div",{style:{color:"#888",fontSize:"12.1px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e?.email||""})]}),(0,n.jsx)("div",{style:{padding:"6px 0"},children:C.map((e,t)=>e.divider?(0,n.jsx)("div",{style:{height:"1px",backgroundColor:"var(--border)",margin:"4px 0"}},t):(0,n.jsxs)("button",{onClick:e.onClick,disabled:e.disabled,style:{width:"100%",padding:"10px 16px",display:"flex",alignItems:"center",gap:"10px",background:"none",border:"none",color:e.danger?"#ef4444":"#d4d4d4",fontSize:"14.3px",cursor:e.disabled?"default":"pointer",opacity:e.disabled?.55:1,transition:"background-color 0.2s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',textAlign:"left"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--surface)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[e.icon,(0,n.jsx)("span",{children:e.label})]},t))})]}),document.body)]})}var h=r(1875);let x=null;function m(){return x||(x=(async()=>{let e=await fetch("https://api.geoaxis.ai/api/locations");if(!e.ok)throw Error((await e.json().catch(()=>({}))).error||`HTTP ${e.status}`);let t=await e.json();return Array.isArray(t.locations)?t.locations:[]})().catch(e=>{throw x=null,e})),x}let b={AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"\xc5land Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barth\xe9lemy",BM:"Bermuda",BN:"Brunei",BO:"Bolivia",BQ:"Caribbean Netherlands",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos Islands",CD:"DR Congo",CF:"Central African Republic",CG:"Republic of the Congo",CH:"Switzerland",CI:"Ivory Coast",CK:"Cook Islands",CL:"Chile",C
250M:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Cura\xe7ao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czechia",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macau",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"R\xe9union",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"S\xe3o Tom\xe9 and Pr\xedncipe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Eswatini",TC:"Turks and Caicos Islands",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Vatican City",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"British Virgin Islands",VI:"U.S. Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XK:"Kosovo",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},y={GB:["uk","britain","great britain","england","scotland","wales"],US:["usa","america","united states of america"],NL:["holland"],AE:["uae","emirates"],CZ:["czech republic"],KR:["korea"],IE:["eire"],CH:["swiss"]};function v(e,t){if(t)return t;let r=String(e||"").toUpperCase();return b[r]||r}function k({value:e,onChange:t,disabled:r=!1,shakeNonce:o=0,recentCities:a=[],clearOnPick:s=!1,placeholder:d="Search cityâ¦",excludePaths:c=[],keepOpenOnPick:p=!1}){let[u,g]=(0,i.useState)(!1),[f,x]=(0,i.useState)(""),[b,k]=(0,i.useState)(!1),[w,j]=(0,i.useState)([]),[S,C]=(0,i.useState)(!1),[z,I]=(0,i.useState)(null),[_,M]=(0,i.useState)(0),F=(0,i.useRef)(null),R=(0,i.useRef)(null),[A,L]=(0,i.useState)(null),[T,W]=(0,i.useState)(!1);(0,i.useEffect)(()=>{W(!0)},[]);let E=e=>{if(!e)return"";let[t,r,n]=e.split("/"),i=(r||"").replaceAll("_"," ");return[(n||"").replaceAll("_"," "),i,t].filter(Boolean).join(", ")};(0,i.useEffect)(()=>{b||s||x(E(e))},[e,b,s]),(0,i.useEffect)(()=>{if(w.length)return;let e=!1;return(async()=>{C(!0),I(null);try{let t=await m();e||j(t)}catch(t){e||I(t.message||"Failed to load cities")}finally{C(!1)}})(),()=>{e=!0}},[w.length]);let $=(0,i.useRef)(null);(0,i.useEffect)(()=>
250{if(!u)return;let t=t=>{let r=F.current&&F.current.contains(t.target),n=$.current&&$.current.contains(t.target);r||n||(g(!1),k(!1),x(s?"":E(e)))};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u,e]),(0,i.useLayoutEffect)(()=>{if(!u||!F.current)return;let e=()=>{if(!F.current)return;let e=F.current.getBoundingClientRect();L({top:e.bottom,left:e.left,width:e.width})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[u]);let{filtered:B,countryHit:P}=(0,i.useMemo)(()=>{let e=new Set(c),t=e.size?w.filter(t=>!e.has(t.path)):w,r=b?f.trim().toLowerCase():"";if(r){let e=new Set(t.map(e=>String(e.country||e.path.split("/")[0]||""))),n=null;if(r.length>=2)for(let i of e){let e=t.find(e=>(e.country||e.path.split("/")[0])===i);if((function(e,t){let r=String(e||"").toUpperCase(),n=[r.toLowerCase(),v(r,t).toLowerCase()];for(let e of y[r]||[])n.push(e);return n})(i,e?.country_name).some(e=>e===r||e.startsWith(r))){n={code:i,name:v(i,e?.country_name)};break}}let i=e=>{let t=E(e.path).toLowerCase(),n=v(e.country||e.path.split("/")[0],e.country_name).toLowerCase();return t.includes(r)||e.path.toLowerCase().includes(r)||n.includes(r)};if(n){let e=t.filter(e=>(e.country||e.path.split("/")[0])===n.code).sort((e,t)=>E(e.path).localeCompare(E(t.path))),r=new Set(e.map(e=>e.path));return{filtered:[...e,...t.filter(e=>!r.has(e.path)&&i(e))],countryHit:{...n,count:e.length}}}return{filtered:t.filter(i),countryHit:null}}if(!a.length||!t.length)return{filtered:[],countryHit:null};let n=new Map(t.map(e=>[e.path,e]));return{filtered:a.map(e=>n.get(e)).filter(Boolean),countryHit:null}},[f,b,w,a,c]),H=!b&&B.length>0&&B.length<=a.length;(0,i.useEffect)(()=>{M(0)},[f,b]);let G=e=>{if((0,h.u4)("city_select",{city_path:e.path}),t(e.path),p){M(e=>Math.max(0,Math.min(e,B.length-2))),R.current?.focus();return}x(s?"":E(e.path)),k(!1),g(!1)},[D,N]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{if(!o)return;N(!0);let e=setTimeout(()=>N(!1),600);return()=>clearTimeout(e)},[o]),(0,n.jsxs)("div",{ref:F,style:{position:"relative",width:"100%"},children:[(0,n.jsx)("input",{ref:R,type:"text",value:f,disabled:r,onChange:e=>{x(e.target.value),k(!0),g(!0)},onFocus:()=>g(!0),onKeyDown:t=>{"ArrowDown"===t.key?(t.preventDefault(),g(!0),M(e=>Math.min(e+1,B.length-1))):"ArrowUp"===t.key?(t.preventDefault(),M(e=>Math.max(e-1,0))):"Enter"===t.key&&B[_]?(t.preventDefault(),G(B[_])):"Escape"===t.key&&(g(!1),k(!1),x(s?"":E(e)),R.current?.blur())},placeholder:d,className:D?"shake-redden":void 0,autoComplete:"off",spellCheck:!1,style:{boxSizing:"border-box",display:"block",width:"100%",maxWidth:"100%",padding:"10px 16px",backgroundColor:"var(--surface)",border:"none",borderRadius:"999px",color:"#FFFFFF",fontSize:"16px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',outline:"none",cursor:r?"not-allowed":"text",opacity:r?.5:1,letterSpacing:"0.1px"}}),u&&T&&A&&(0,l.createPortal)((0,n.jsx)("div",{ref:$,style:{position:"fixed",top:A.top+6,left:A.left,width:A.width,zIndex:2e3,background:"rgba(10,10,10,0.96)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:"10px",boxShadow:"0 12px 32px rgba(0,0,0,0.6)",maxHeight:"min(320px, calc(100vh - "+(A.top+16)+"px))",display:"flex",flexDirection:"column",overflow:"hidden"},children:(0,n.jsxs)("div",{className:"no-scrollbar",onWheelCapture:e=>e.stopPropagation(),style:{overflowY:"auto",flex:1,minHeight:0},children:[S&&(0,n.jsx)("div",{style:{padding:"12px",color:"#A0A0A0",fontSize:"12.5px"},children:"Loadingâ¦"}),z&&(0,n.jsx)("div",{style:{padding:"12px",color:"#ff6b6b",fontSize:"12.5px"},children:z}),!S&&!z&&0===B.length&&(0,n.jsx)("div",{style:{padding:"12px",color:"#A0A0A0",fontSize:"12.5px"},children:b?"No matches":"Start typing to find a city"}),H&&(0,n.jsx)("div",{style:{padding:"8px 14px",color:"rgba(255,255,255,0.55)",fontSize:"10.5px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.4px",borderBottom:"1px solid rgba(255,255,255,0.04)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"Recent"}),P&&(0,n.jsxs)("div",{style:{padding:"8px 14px",color:"rgba(255,255,255,0.7)",fontSize:"11.5px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.4px",borderBottom:"1px solid rgba(255,255,255,0.06)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',display:"flex",justifyContent:"space-between",gap:8},children:[(0,n.jsx)("span",{children:P.name}),(0,n.jsxs)("span",{style:{color:"rgba(255,255,255,0.45)",fontWeight:500,textTransform:"none",letterSpacing:0},children:[P.count," ",1===P.count?"index":"indexes"]}
250)]}),B.map((t,r)=>{let[i,o,a]=t.path.split("/"),l=(o||"").replaceAll("_"," "),s=(a||"").replaceAll("_"," "),d=v(i,t.country_name),c=t.path===e;return(0,n.jsxs)("button",{title:`${s}, ${l}, ${d}`,type:"button",onMouseDown:e=>{e.preventDefault()},onClick:()=>G(t),onMouseEnter:()=>M(r),style:{display:"flex",alignItems:"center",gap:"14px",width:"100%",padding:"10px 14px",background:r===_?"rgba(255,255,255,0.08)":c?"rgba(255,255,255,0.04)":"transparent",border:"none",borderBottom:"1px solid rgba(255,255,255,0.04)",color:"#FFFFFF",cursor:"pointer",textAlign:"left"},children:[(0,n.jsx)("span",{style:{fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:"16px",fontWeight:700,color:"#FFFFFF",lineHeight:1,letterSpacing:"-0.3px",minWidth:"28px",flexShrink:0},children:i}),(0,n.jsxs)("span",{style:{display:"flex",flexDirection:"column",gap:"2px",minWidth:0},children:[(0,n.jsx)("span",{style:{fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:"14px",fontWeight:600,color:"#FFFFFF",lineHeight:1.15},children:s}),(0,n.jsx)("span",{style:{fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:"12.5px",color:"rgba(255,255,255,0.55)",lineHeight:1.1},children:P?l:`${l} \xb7 ${d}`})]})]},t.path)})]})}),document.body)]})}var w=r(5394);function j({values:e=[],onChange:t,disabled:r=!1,max:o=10,recentCities:a=[],shakeNonce:l=0,cityStatus:s=null}){let d=e=>{if(!e)return"";let[t,r,n]=e.split("/"),i=(r||"").replaceAll("_"," ");return[(n||"").replaceAll("_"," "),i,t].filter(Boolean).join(", ")},c=e.length>=o,p=(0,i.useMemo)(()=>e.slice(),[e]),u='var(--font-instrument-serif), "Instrument Serif", Georgia, serif';return(0,n.jsxs)("div",{style:{width:"100%"},children:[e.length>0&&(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:e.map(i=>{let{border:o,dot:a}=(e=>{let t=s?s[e]:null;return"ok"===t?{border:"rgba(126,217,87,0.45)",dot:"#7ED957"}:"error"===t?{border:"rgba(255,77,77,0.45)",dot:"#ff4d4d"}:"running"===t?{border:"rgba(255,255,255,0.5)",dot:"#ffffff"}:"pending"===t?{border:"var(--border-strong)",dot:"var(--fg-muted)"}:{border:"var(--border-strong)",dot:null}})(i);return(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 8px 5px 10px",background:"var(--surface)",border:`1px solid ${o}`,borderRadius:999,color:"rgba(255,255,255,0.85)",fontSize:13,fontFamily:u,maxWidth:"100%"},children:[a&&(0,n.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:"50%",background:a,flexShrink:0}}),(0,n.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d(i)}),(0,n.jsx)("button",{type:"button",onClick:()=>{t(e.filter(e=>e!==i))},disabled:r,"aria-label":`Remove ${d(i)}`,style:{background:"transparent",border:"none",color:"var(--fg-muted)",cursor:r?"not-allowed":"pointer",fontSize:15,lineHeight:1,padding:"0 2px",fontFamily:"inherit"},children:"\xd7"})]},i)})}),(0,n.jsx)(k,{value:"",onChange:r=>{!r||c||e.includes(r)||t([...e,r])},disabled:r||c,shakeNonce:l,recentCities:a,clearOnPick:!0,keepOpenOnPick:!0,excludePaths:p,placeholder:c?`Maximum ${o} cities`:"Add cities or a whole countryâ¦"}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,marginTop:8,color:"rgba(255,255,255,0.6)",fontSize:13.5,lineHeight:1.3,fontFamily:u},children:[(0,n.jsx)("span",{children:0===e.length?`Add up to ${o} cities to search at once.`:"Searched one index at a time, results merged."}),(0,n.jsxs)("span",{style:{color:c?"#fff":"rgba(255,255,255,0.75)",fontWeight:600,flexShrink:0,fontSize:14},children:[e.length," / ",o]})]})]})}function S({checked:e,onChange:t,disabled:r=!1,label:o,hint:a,id:l}){let s=(0,i.useId)().replace(/:/g,""),d=`tgl-${s}`;return(0,n.jsxs)("label",{htmlFor:l||d,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,cursor:r?"not-allowed":"pointer",opacity:r?.45:1,padding:"2px 0"},children:[(0,n.jsxs)("span",{style:{minWidth:0},children:[(0,n.jsx)("span",{style:{display:"block",color:"var(--fg)",fontSize:13,fontWeight:600,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',lineHeight:1.25},children:o}),a&&(0,n.jsx)("span",{style:{display:"block",color:"var(--fg-muted)",fontSize:11,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',lineHeight:1.3,marginTop:2},children:a})]}),(0,n.jsxs)("span",{className:d,style:{display:"inline-block",flexShrink:0},children:[(0,n.jsx)("style",{children:` 251 .${d} input { display: none; } 252 .${d} .track { 253 position: relative; 254 display: block; 255 width: 41px; 256 height: 22px; 257 background: #080808; 258 border-radius: 15px; 259 transition: background 0.25s; 260 } 261 .${d} .thumb { 262 position: absolute; 263 top: 2.5px; 264 left: 2.3px; 265 width: 27px; 266 height: 17px; 267 background: #fff; 268 border-radius: 8px; 269 transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); 270 box-shadow: 271 0 1px 2px rgba(0, 0, 0, 0.35), 272 0 6px 12px rgba(0, 0, 0, 0.18); 273 } 274 .${d} input:checked + .track { background: #2f6b3f; } 275 .${d} input:checked + .track .thumb { transform: translateX(9px); } 276 `}),(0,n.jsx)("input",{id:l||d,type:"checkbox",checked:!!e,disabled:r,onChange:e=>t&&t(e.target.checked)}),(0,n.jsx)("span",{className:"track",children:(0,n.jsx)("span",{className:"thumb"})})]})]})}function C(){let{user:e,subscription:t,subscriptionChecked:r}=(0,s.useAuth)();if(!e||!r)return null;let i=t?.freeSearchesUsed||{},o=Math.max(0,5-(i.global||0))+Math.max(0,5-(i.city||0)),a=Math.floor((t?.creditBalanceCents||0)/90);if(0===o&&0===a)return null;let l=o>0&&o<=3,d=o>0&&o<=1,c=[];return o>0&&c.push((0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"baseline",gap:4},children:[(0,n.jsx)("span",{style:{color:d?"#ff6b6b":l?"#ffb84d":"var(--fg)",fontWeight:800},children:o}),(0,n.jsx)("span",{style:{color:"var(--fg-muted)"},children:"free"})]},"free")),a>0&&c.push((0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"baseline",gap:4},children:[(0,n.jsx)("span",{style:{color:"var(--fg)",fontWeight:700},children:a}),(0,n.jsx)("span",{style:{color:"var(--fg-muted)"},children:"paid"})]},"payg")),(0,n.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:10,padding:"7px 13px",borderRadius:999,background:"hsl(0 0% 0% / 0.55)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:`1px solid ${d?"rgba(255,107,107,0.65)":l?"rgba(255,184,77,0.6)":"var(--surface-strong)"}`,boxShadow:d?"0 0 0 1px rgba(255,107,107,0.35), 0 4px 16px rgba(255,107,107,0.28)":l?"0 0 0 1px rgba(255,184,77,0.3), 0 4px 14px rgba(0,0,0,0.35)":"0 4px 14px rgba(0,0,0,0.35)",animation:d?"balancePulse 1.8s ease-in-out infinite":"none",fontSize:"0.84rem",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',whiteSpace:"nowrap"},children:[c.map((e,t)=>(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:10},children:[t>0&&(0,n.jsx)("span",{style:{opacity:.35,color:"var(--fg-muted)"},children:"\xb7"}),e]},`g${t}`)),(0,n.jsx)("span",{style:{opacity:.55,fontSize:"0.7rem",color:"var(--fg-muted)",letterSpacing:"0.4px",textTransform:"uppercase"}
276,children:1===c.length?"searches left":"left"})]})}function z({size:e=28,color:t="currentColor",style:r,...i}){return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,"aria-hidden":"true",focusable:"false",style:{display:"block",flexShrink:0,color:t,...r},...i,children:(0,n.jsx)("path",{fill:"currentColor",d:"M13.5,10.5v5c0,.83-.67,1.5-1.5,1.5s-1.5-.67-1.5-1.5v-5c0-.83,.67-1.5,1.5-1.5s1.5,.67,1.5,1.5Zm-1.5,8.5c-.83,0-1.5,.67-1.5,1.5s.67,1.5,1.5,1.5,1.5-.67,1.5-1.5-.67-1.5-1.5-1.5Zm11.05-4.19L15.31,2.73c-.75-1.08-1.99-1.73-3.31-1.73s-2.56,.65-3.34,1.78L.99,14.76c-1.09,1.56-1.29,3.45-.52,4.92,.77,1.48,2.34,2.32,4.32,2.32h1.72c.83,0,1.5-.67,1.5-1.5s-.67-1.5-1.5-1.5h-1.72c-.48,0-1.33-.09-1.66-.71-.25-.48-.13-1.17,.35-1.87L11.15,4.44c.28-.4,.69-.44,.85-.44s.57,.04,.82,.39l7.74,12.08c.45,.64,.57,1.34,.32,1.82-.32,.62-1.18,.71-1.66,.71h-1.72c-.83,0-1.5,.67-1.5,1.5s.67,1.5,1.5,1.5h1.72c1.97,0,3.55-.85,4.32-2.32,.77-1.47,.57-3.36-.48-4.87Z"})})}var I=r(7173);let _=[{title:"Choose a city",desc:"Pick the city your photo is in."},{title:"Upload & crop tight",desc:"Keep the building or scene; drop sky and clutter."},{title:"Get the exact spot",desc:"Matched to street-level panoramas and pinned."}];function M({visible:e,onClose:t,isMobile:r=!1}){return((0,i.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e]),e)?(0,n.jsx)("div",{onClick:t,style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",zIndex:2200,display:"flex",alignItems:"center",justifyContent:"center",padding:r?"12px":"32px",animation:"fadeIn 0.25s ease-in-out"},children:(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:"760px",maxHeight:r?"94vh":"90vh",overflowY:"auto",background:"hsl(0 0% 6% / 0.97)",border:"1px solid var(--surface-strong)",borderRadius:"20px",padding:r?"18px 16px":"32px",boxSizing:"border-box"},children:[(0,n.jsx)("h2",{style:{margin:0,color:"var(--fg)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:r?"1.4rem":"2.1rem",fontWeight:700,letterSpacing:"-0.02em",lineHeight:1.1},children:"City Search"}),(0,n.jsx)("p",{style:{margin:r?"6px 0 0":"8px 0 0",color:"var(--fg-muted)",fontFamily:'var(--font-quantico), "Quantico", sans-serif',fontSize:r?"13px":"17px",fontStyle:"italic",lineHeight:1.35},children:"Pinpoint the exact street-level location of a photo inside a city you choose - matched against millions of indexed panoramas for pinpoint precision."}),(0,n.jsxs)("div",{style:{display:"grid",gridTemplateColumns:r?"1fr":"minmax(0, 0.85fr) minmax(0, 1fr)",gap:r?"14px":"28px",alignItems:"center",marginTop:r?"14px":"28px"},children:[(0,n.jsxs)("div",{style:{position:"relative",borderRadius:"18px",overflow:"hidden",display:"flex",flexDirection:"column",height:r?"150px":"320px"},children:[(0,n.jsx)("img",{src:"/images/2_query.webp",alt:"City Search query photo",loading:"eager",decoding:"async",fetchPriority:"high",style:{flex:1,minHeight:0,width:"100%",objectFit:"cover",display:"block"}}),(0,n.jsx)("img",{src:"/images/2_result.webp",alt:"City Search pinpointed result",loading:"eager",decoding:"async",fetchPriority:"high",style:{flex:1,minHeight:0,width:"100%",objectFit:"cover",display:"block"}})]}),(0,n.jsx)("ol",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:r?"9px":"18px"},children:_.map((e,t)=>(0,n.jsxs)("li",{style:{display:"flex",gap:r?"10px":"12px",alignItems:"flex-start"},children:[(0,n.jsx)("span",{style:{flexShrink:0,width:r?"22px":"26px",height:r?"22px":"26px",borderRadius:"50%",background:"var(--fg)",color:"#000",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:"13px",fontWeight:700},children:t+1}),(0,n.jsxs)("div",{style:{minWidth:0},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:r?"13px":"15px",fontWeight:700,lineHeight:1.2},children:e.title}),(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:r?"11.5px":"13px",lineHeight:1.35,marginTop:"1px"},children:e.desc})]})]},t))})]}),(0,n.jsx)("button",{type:"button",onClick:t,style:{width:"100%",marginTop:r?"14px":"28px",padding:r?"11px 20px":"13px 20px",background:"var(--fg)",border:"none",borderRadius:"999px",color:"#000",fontSize:"15px",fontWeight:700,cursor:"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"Got it"})]})}):null}var F=r(9708);
276class R extends Error{constructor(e,t={}){super(e||"Search failed."),this.name="SearchApiError",this.code=t.code||null,this.category=t.category||null,this.tier=t.tier||null,this.refunded="boolean"==typeof t.refunded?t.refunded:null,this.status=t.status||null,this.reference=t.reference||L(e)||null}}function A(e,t){let r=e&&"object"==typeof e?e:{};return new R(r.error||(t?`API error ${t}`:"Search failed."),{code:r.code,category:r.category,tier:r.tier,refunded:r.refunded,status:t||r.status,reference:r.request_id})}function L(e){if(!e)return null;let t=String(e).match(/Reference:\s*([A-Za-z0-9]+)/);return t?t[1]:null}let T={adult:"adult content",violence:"violent content",racy:"racy content",medical:"medical content",spoof:"spoof content"};function W(e){let t=String(e||"");return t?/safesearch:|content safety|flagged/i.test(t)?"content_blocked":/Failed to fetch|NetworkError|Load failed|ERR_NETWORK/i.test(t)?"network":/abort/i.test(t)?"aborted":/Server busy|queue_full|requests in queue/i.test(t)?"queue_full":/\b503\b|UNAVAILABLE|high demand|RESOURCE_EXHAUSTED|overloaded|\b429\b/i.test(t)?"high_demand":/\b504\b|DEADLINE_EXCEEDED|timed out|timeout/i.test(t)?"timeout":/\b403\b|\b401\b|PERMISSION_DENIED|UNAUTHENTICATED|denied access/i.test(t)?"access_de
276nied":/\b400\b|INVALID_ARGUMENT/i.test(t)?"bad_request":/no_coords|did not return coordinates/i.test(t)?"no_coords":/no parseable candidates/i.test(t)?"no_candidates":/final JSON answer|no json in|returned no text|no final text/i.test(t)?"no_answer":/vertex client unavailable|Model not loaded|warming up/i.test(t)?"model_unavailable":/No results/i.test(t)?"no_results":"internal":"internal"}function E(e){let t=String(e||"").match(/safesearch:(\w+)|content safety check \((\w+)\)/i);return t?(t[1]||t[2]).toLowerCase():null}let $={content_blocked:e=>({tone:"warning",title:`This image is classified as ${T[e]||"restricted content"}`,body:"It was not processed and no results were generated. Zelesis does not run searches on images flagged by the content safety check."}),high_demand:()=>({tone:"warning",title:"High demand right now",body:"Weâre experiencing high demand right now. Please try again shortly."}),timeout:()=>({tone:"warning",title:"The search timed out",body:"This one took too long to finish. Please try again."}),access_denied:()=>({tone:"danger",title:"Search is temporarily unavailable",body:"Our image analysis service refused the request. Weâve been notified. Please try again later."}),bad_request:()=>({tone:"warning",title:"This image couldnât be processed",body:"The image couldnât be sent for analysis. Try a smaller image or a different file."}),no_answer:()=>({tone:"danger",title:"No answer was generated",body:"Something went wrong while generating the final answer. Please try again."}),no_candidates:()=>({tone:"warning",title:"No locations found",body:"We couldnât find any likely locations for this image. Try a clearer crop or a different image."}),no_coords:()=>({tone:"warning",title:"No coordinates returned",body:"The model couldnât pin this image to a place. Please try again or try a different image."}),model_unavailable:()=>({tone:"danger",title:"Search is temporarily unavailable",body:"Our image analysis service isnât reachable right now. Please try again in a few minutes."}),queue_full:()=>({tone:"warning",title:"The server is busy",body:"Too many searches are running right now. Please try again shortly."}),network:()=>({tone:"danger",title:"Couldnât reach the server",body:"Check your connection and try again."}),aborted:()=>({tone:"warning",title:"Search cancelled",body:"The search was stopped before it finished."}),no_results:()=>({tone:"warning",title:"No results found",body:"Please try a different image or check your index path."}),internal:()=>({tone:"danger",title:"Search failed",body:"Something went wrong on our side. Please try again in a moment."})},B=new Set(["network","aborted","no_results"]);function P(e){let t=e&&"object"==typeof e,r=t?e.message||"":String(e||""),n=t&&e.code||W(r),i=t&&e.category||E(r),o=t&&e.tier?e.tier:null,a=t&&"boolean"==typeof e.refunded?e.refunded:null,l=t&&e.reference||L(r),s=($[n]||$.internal)(i);return{code:n,category:i,tier:o,refunded:a,reference:l,message:r,...s,refundLine:function({code:e,tier:t,refunded:r}){if(B.has(e))return null;if(!0===r||null===r&&null==t){if("payg"===t)return"Your credit for this search has been refunded.";if("free"===t)return"Your free search has been returned to your balance."}return"You havenât been charged for this search."}({code:n,tier:o,refunded:a})}}var H=r(8134);function G(e,t=240,r=.7){return new Promise((n,i)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{let e=Math.min(1,t/Math.max(o.width,o.height)),a=Math.max(1,Math.round(o.width*e)),l=Math.max(1,Math.round(o.height*e)),s=document.createElement("canvas");s.width=a,s.height=l,s.getContext("2d").drawImage(o,0,0,a,l);try{n(s.toDataURL("image/jpeg",r))}catch(e){i(e)}},o.onerror=i,"string"==typeof e?o.src=e:o.src=URL.createObjectURL(e)})}function D(e){if(!e)return"Untitled";if(e.location_name&&"string"==typeof e.location_name)return e.location_name.split(",")[0].trim()||"Untitled";if(e.address&&"string"==typeof e.address){let t=e.address.split(",").map(e=>e.trim()).filter(Boolean);return t.length>=2?t[1]:t[0]||"Untitled"}return"Untitled"}
276async function N(e,t){return e?(await (0,F.gS)((0,F.rJ)(c.db,"users",e,"history"),{...t,createdAt:(0,F.O5)()})).id:null}async function O(e,t,r){e&&t&&await (0,F.mZ)((0,F.H9)(c.db,"users",e,"history",t),r)}async function U(e,t,r,n=[]){if(!e||!t||!r)return null;let i=`users/${e}/history/${t}`,o=async(e,t)=>(await (0,H.D)(e,t,{contentType:t.type||"image/jpeg"}),(0,H.qk)(e)),a=r.name&&r.name.match(/\.([a-z0-9]{2,5})$/i)?.[1]||"jpg",l=(0,H.KR)(c.storage,`${i}/image.${a}`),s=[];for(let e=0;e<n.length&&e<3;e++){let t=n[e];if(!t)continue;let r=t.name&&t.name.match(/\.([a-z0-9]{2,5})$/i)?.[1]||"jpg",a=(0,H.KR)(c.storage,`${i}/extra-${e}.${r}`);s.push(o(a,t))}let[d,...p]=await Promise.all([o(l,r),...s]);return{originalUrl:d,extraUrls:p}}async function V(e,t){if(!e||!t)return;let r=(0,F.H9)(c.db,"users",e,"prefs","cityRecents");try{let e=await (0,F.x7)(r),n=Array.isArray(e.data()?.paths)?e.data().paths:[],i=[t,...n.filter(e=>e!==t)].slice(0,8);await (0,F.BN)(r,{paths:i,updatedAt:(0,F.O5)()},{merge:!0})}catch(e){console.warn("[prefs] record recent city failed",e)}}async function Z(e,t){if(e&&t)try{await (0,F.kd)((0,F.H9)(c.db,"users",e,"history",t))}catch(r){throw console.error("[history] deleteDoc failed",{uid:e,id:t,code:r?.code,message:r?.message}),r}}async function q(e,t,r){return e?(await (0,F.gS)((0,F.rJ)(c.db,"users",e,"folders"),{name:t||r||"Untitled",city:r||"",itemCount:0,createdAt:(0,F.O5)()})).id:null}async function Y(e,t){if(!e||!t)return;let r=await (0,F.GG)((0,F.rJ)(c.db,"users",e,"folders",t,"items"));await Promise.all(r.docs.map(e=>(0,F.kd)(e.ref))),await (0,F.kd)((0,F.H9)(c.db,"users",e,"folders",t))}async function J(e,t){if(!e)return null;let r=(t||"Untitled").trim(),n=(0,F.P)((0,F.rJ)(c.db,"users",e,"folders"),(0,F._M)("city","==",r),(0,F.AB)(1)),i=await (0,F.GG)(n);return i.empty?q(e,r,r):i.docs[0].id}async function K(e,t,r=2){if(!e||!t)return[];try{let n=(0,F.P)((0,F.rJ)(c.db,"users",e,"folders",t,"items"),(0,F.My)("addedAt","desc"),(0,F.AB)(r));return(await (0,F.GG)(n)).docs.map(e=>e.data()?.thumbnail||null).filter(Boolean)}catch(e){return console.warn("[folders] getFolderItemThumbnails failed",e),[]}}async function Q(e,t,r){if(!e||!t)return null;let n=await (0,F.gS)((0,F.rJ)(c.db,"users",e,"folders",t,"items"),{...r,addedAt:(0,F.O5)()});try{await (0,F.mZ)((0,F.H9)(c.db,"users",e,"folders",t),{itemCount:(0,F.GV)(1)})}catch(e){console.warn("[folders] itemCount bump failed",e)}return n.id}F.BN;let X=(0,o.default)(()=>r.e(9155).then(r.bind(r,9155)).then(e=>e.LiquidMetal),{loadableGenerated:{webpack:()=>[9155]},ssr:!1});function ee(e,t=250){let[r,n]=(0,i.useState)(e);return(0,i.useEffect)(()=>{if(e)return void n(!0);let r=setTimeout(()=>n(!1),t);return()=>clearTimeout(r)},[e,t]),e||r}function et(e,t){return`${Math.abs(e).toFixed(6)}\xb0 ${"lat"===t?e>=0?"N":"S":e>=0?"E":"W"}`}function er(e,t,r,n){let i=e=>e*Math.PI/180,o=i(r-e),a=i(n-t);return 12742*Math.asin(Math.sqrt(Math.sin(o/2)**2+Math.cos(i(e))*Math.cos(i(r))*Math.sin(a/2)**2))}function en(e,t,r){if(!r)return!1;let n="Polygon"===r.type?[r.coordinates]:"MultiPolygon"===r.type?r.coordinates:null;if(!n)return!1;for(let r of n){let n=r[0],i=!1;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[r][0],l=n[r][1],s=n[o][0],d=n[o][1];l>t!=d>t&&e<(s-a)*(t-l)/(d-l)+a&&(i=!i)}if(i)return!0}return!1}function ei(e,t,r,n,i=3){if(!Array.isArray(e)||0===e.length||!Number.isFinite(t)||!Number.isFinite(r)||!(n>0))return[];let o=[];for(let i of e){if(!Number.isFinite(i?.lat)||!Number.isFinite(i?.lng))continue;let e=er(t,r,i.lat,i.lng),a=i.region_bbox,l=a&&Array.isArray(a)&&4===a.length,s=!1;if(i.region_polygon&&l&&r>=a[0]&&r<=a[2]&&t>=a[1]&&t<=a[3]&&en(r,t,i.region_polygon))s=!0;else if(l){let e=n/111,i=n/(111*Math.max(.1,Math.cos(t*Math.PI/180)));r+i>=a[0]&&r-i<=a[2]&&t+e>=a[1]&&t-e<=a[3]&&(s=!0)}else s=e<=n;s&&o.push({city_path:i.path,region_name:i.region_name||i.city||i.path,lat:i.lat,lng:i.lng,distance_km:Number(e.toFixed(3))})}return o.sort((e,t)=>e.distance_km-t.distance_km),o.slice(0,i)}function eo(){return Math.max(0,Math.min(2,Math.log2(1200/window.innerWidth)))}async function ea(e,t=32){return e?await new Promise(r=>{let n=new Image;n.onload=()=>{try{let e=document.createElement("canvas");e.width=t,e.height=t;let i=e.getContext("2d"),o=Math.min(n.width,n.height),a=(n.width-o)/2,l=(n.height-o)/2;
276i.drawImage(n,a,l,o,o,0,0,t,t),r(e.toDataURL("image/jpeg",.75))}catch{r(e)}},n.onerror=()=>r(e),n.src=e}):null}let el="geoaxis_city_intro_seen";async function es(e,t=1024,r=.85){if(!e)return e;let n=(e.type||"").toLowerCase();return!n.startsWith("image/")||n.includes("heic")||n.includes("heif")?e:await new Promise(n=>{let i=new Image,o=URL.createObjectURL(e);i.onload=()=>{try{let a=Math.min(1,t/Math.max(i.width,i.height)),l=Math.max(1,Math.round(i.width*a)),s=Math.max(1,Math.round(i.height*a)),d=document.createElement("canvas");d.width=l,d.height=s,d.getContext("2d").drawImage(i,0,0,l,s),d.toBlob(t=>{URL.revokeObjectURL(o),n(t&&t.size<e.size?t:e)},"image/jpeg",r)}catch{URL.revokeObjectURL(o),n(e)}},i.onerror=()=>{URL.revokeObjectURL(o),n(e)},i.src=o})}let ed="https://api.geoaxis.ai",ec=({onClick:e,title:t="Remove",size:r=22,parentHover:o=!1})=>{let[a,l]=(0,i.useState)(!1);return(0,n.jsx)("button",{onClick:e,title:t,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:"transparent",border:"none",padding:"4px 6px",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",transition:"background 0.15s ease"},children:(0,n.jsx)(u.A,{src:"/lottie/trash-hover.json",hover:a,size:r,tint:a?"#ffffff":o?"#bbbbbb":"#444444"})})},ep=({radius:e=14})=>{let[t,r]=(0,i.useState)(66);return(0,i.useEffect)(()=>{r(360*Math.random())},[]),(0,n.jsx)("div",{style:{position:"absolute",inset:"-1.5px",borderRadius:`${e+1}px`,overflow:"hidden",pointerEvents:"none",zIndex:0},children:(0,n.jsx)(X,{width:400,height:140,colorBack:"#000000",colorTint:"#ffdbdb",shape:"circle",repetition:3.53,softness:1,shiftRed:.4,shiftBlue:.3,distortion:.07,contour:.42,angle:t,speed:1.36,scale:2,fit:"cover",style:{width:"100%",height:"100%",display:"block"}})})};function eu({open:e,onClick:t}){let[r,o]=(0,i.useState)(!1);return(0,n.jsx)("button",{type:"button",onClick:t,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),"aria-label":"What does this do?",style:{width:"42px",height:"42px",borderRadius:"50%",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.18)",color:"var(--fg)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,n.jsx)(u.A,{src:"/lottie/info-hover.json",hover:r||e,size:22,tint:"#ffffff",forceTint:!0})})}function eg({onClick:e,copied:t,size:r=18,tint:o="#ffffff"}){let[a,l]=(0,i.useState)(!1);return(0,n.jsx)("button",{type:"button",onClick:e,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),"aria-label":t?"Coordinates copied":"Copy coordinates",title:t?"Copied":"Copy coordinates",style:{appearance:"none",background:"transparent",border:"none",padding:0,margin:0,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:o,flexShrink:0},children:(0,n.jsx)(u.A,{src:"/lottie/copy-hover.json",hover:a||t,size:r,tint:o,forceTint:!0})})}async function ef(){let e={};try{if(c.auth.currentUser){let t=await c.auth.currentUser.getIdToken();e.Authorization=`Bearer ${t}`}}catch(e){}return e}async function eh(e,t,r,n){let i=new FormData;for(let e of(i.append("image",t,r||"query.jpg"),n.slice(0,3)))i.append("city_paths",e);let o=await ef(),a=`${e||""}/api/search-multi`,l=await fetch(a,{method:"POST",headers:o,body:i});return l.ok?await l.json():{failed:!0,status:l.status,url:a,results:[],errors:[{error:`http ${l.status}`}]}}let ex=new Set(["business","enterprise"]);async function em(e,t,r,n,i){let o=new FormData;for(let e of(o.append("image",t,r||"query.jpg"),n.slice(0,10)))o.append("city_paths",e);o.append("k",String(i||10));let a=await ef(),l=await fetch(`${e||""}/api/search-multi/jobs`,{method:"POST",headers:a,body:o}),s=await l.json().catch(()=>({}));return l.ok?{job:s.job}:{failed:!0,status:l.status,reason:s?.reason||s?.error||null,message:s?.error||`Batch search failed (HTTP ${l.status}).`}}async function eb(e,t){let r=await ef(),n=await fetch(`${e||""}/api/search-multi/jobs/${encodeURIComponent(t)}`,{method:"GET",headers:r}),i=await n.json().catch(()=>({}));return n.ok?{job:i.job}:{failed:!0,status:n.status,message:404===n.status?"This batch search is no longer available - the server may have restarted. Please run it again.":i?.error||`Batch poll failed (HTTP ${n.status}).`}}async function ey(e,t){try{let r=await ef();await fetch(`${e||""}/api/search-multi/jobs/${encodeURIComponent(t)}/cancel`,{method:"POST",headers:r})}catch(e){}}let ev=new Set;async function ek(e,t,r){if(!e)return;let n=r||e,i=`${n.size}|${n.name||"blob"}|${n.lastModified||0}`;if(!ev.has(i)){ev.add(i);try{let n=new FormData;n.append("image",e,r?.name||"image.jpg");let i=await ef();fetch(`${t}/api/lens-prewarm`,{method:"POST",body:n,headers:i}).catch(()=>{})}catch(e){}finally{setTimeout(()=>ev.delete(i),5e3)}}}async function ew(e,t,r){try{let n=await fetch(`https://api.mapbox.com/search/geocode/v6/reverse?longitude=${t}&latitude=${e}&types=address&access_token=${r}`);if(!n.ok)return"Unknown";let i=await n.json(),o=i.features?.[0];if(!o)return"Unknown";return o.properties.full_address||o.properties.name||"Unknown"}catch{return"Unknown"}}async function ej(e,t){return await Promise.all(e.map(async e=>{let r=await ew(e.lat,e.lng,t);return{...e,address:r}}))}function eS({onClick:e,disabled:t,saving:r}){let[o,a]=(0,i.useState)(!1);return(0,n.jsxs)("button",{onClick:e,disabled:t,style:{flex:1,padding:"13px",background:"transparent",border:`1px solid ${o&&!t?"var(--fg-muted)":"rgba(255, 255, 255, 0.18)"}`,borderRadius:"999px",color:"var(--fg)",fontSize:"15.4px",fontWeight:600,cursor:t?"not-allowed":"pointer",transition:"all 0.2s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",opacity:t?.5:1},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,n.jsx)(u.A,{src:"/lottie/folder-solid.json",hover:o&&!t,size:18,color:"var(--fg)"}),r?"Savingâ¦":"Save"]})}function eC({h:e,title:t,sub:r,ts:o,onClick:a,onDelete:l}){let[s,d]=(0,i.useState)(!1);return(0,n.jsxs)("div",{onClick:a,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex",gap:"10px",alignItems:"center",padding:"8px",marginBottom:"6px",borderRadius:"14px",backgroundColor:s?"var(--surface-strong)":"var(--surface)",border:"1px solid transparent",curs
276or:"pointer",transition:"background 0.15s ease"},children:[e.thumbnail?(0,n.jsx)("img",{src:e.thumbnail,alt:"",style:{width:"48px",height:"48px",objectFit:"cover",borderRadius:"6px",flexShrink:0}}):(0,n.jsx)("div",{style:{width:"48px",height:"48px",borderRadius:"6px",backgroundColor:"var(--surface)",flexShrink:0}}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:"14.3px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t}),(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"12.1px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r}),(0,n.jsxs)("div",{style:{color:"var(--fg-muted)",fontSize:"12.5px",marginTop:"3px"},children:["global"===e.searchMode?"AI Global":"City Index",o?` \xb7 ${o.toLocaleDateString()} ${o.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:""]})]}),(0,n.jsx)(ec,{onClick:l,title:"Remove",parentHover:s})]})}function ez({folder:e,uid:t,isOpen:r,onClick:o,onDelete:a}){let[l,s]=(0,i.useState)(!1),[d,c]=(0,i.useState)([]);return(0,i.useEffect)(()=>{let r=!1;return(async()=>{if(!t||!e?.id)return;let n=await K(t,e.id,2);r||c(n)})(),()=>{r=!0}},[t,e?.id,e?.itemCount]),(0,n.jsxs)("div",{onClick:o,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",cursor:"pointer"},children:[(0,n.jsx)(eI,{thumbs:d,hover:l,size:44}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:"14.3px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),(0,n.jsxs)("div",{style:{color:"var(--fg-muted)",fontSize:"12.1px"},children:[e.itemCount||0," item",1===(e.itemCount||0)?"":"s"]})]}),(0,n.jsx)(ec,{onClick:a,title:"Delete folder",parentHover:l})]})}function eI({thumbs:e,hover:t,size:r=44}){let i=e?.[1]||e?.[0]||null,o=e?.[0]||null,a=Math.round(.78*r);return(0,n.jsxs)("div",{style:{position:"relative",width:r,height:r,flexShrink:0,transition:"transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)",transform:t?"translateY(-1px)":"translateY(0)"},children:[(0,n.jsx)("div",{style:{position:"absolute",width:a,height:a,top:"50%",left:"50%",marginLeft:-a/2,marginTop:-a/2,background:i?`center / cover no-repeat url(${i})`:"linear-gradient(135deg, #6b6b6b 0%, #303030 100%)",borderRadius:"4px",border:"1px solid rgba(255,255,255,0.18)",boxShadow:"0 1px 2px rgba(0,0,0,0.5)",transformOrigin:"bottom left",transform:t?"rotate(-18deg) translate(-4px, -3px)":"rotate(-8deg) translate(-2px, -1px)",transition:"transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)"}}),(0,n.jsx)("div",{style:{position:"absolute",width:a,height:a,top:"50%",left:"50%",marginLeft:-a/2,marginTop:-a/2,background:o?`center / cover no-repeat url(${o})`:"linear-gradient(135deg, #c0c0c0 0%, #808080 100%)",borderRadius:"4px",border:"1px solid rgba(255,255,255,0.3)",boxShadow:"0 2px 4px rgba(0,0,0,0.5)",transformOrigin:"bottom right",transform:t?"rotate(14deg) translate(4px, -3px)":"rotate(6deg) translate(2px, -1px)",transition:"transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)"}})]})}function e_({title:e,lottie:t,active:r,onClick:o}){let[a,l]=(0,i.useState)(!1),s=r||a;return(0,n.jsx)("button",{title:e,onClick:o,style:{background:"transparent",border:"none",color:r||a?"var(--fg)":"var(--fg-muted)",cursor:"pointer",transition:"color 0.2s ease",width:"44px",height:"44px",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto"},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:(0,n.jsx)(u.A,{src:t,hover:s,size:22,style:{filter:s?"none":"brightness(0.85)",transition:"filter 0.2s ease"}})})}function eM({onClick:e}){let[t,r]=(0,i.useState)(!1);return(0,n.jsxs)("button",{onClick:e,style:{flex:1,padding:"13px",background:t?"transparent":"var(--fg)",border:"1px solid #FFFFFF",borderRadius:"999px",color:t?"var(--fg)":"#000000",fontSize:"15.4px",fontWeight:700,cursor:"pointer",transition:"all 0.2s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,n.jsx)(u.A,{src:"/lottie/newspaper-solid.json",hover:t,size:18,style:{filter:t?"none":"brightness(0)",transition:"filter 0.2s ease"}}),"Export"]})}function eF({onClick:e,disabled:t,saving:r}){let[o,a]=(0,i.useState)(!1);return(0,n.jsxs)("button",{type:"button",onClick:e,disabled:t,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{display:"inline-flex",alignItems:"center",gap:7,padding:"9px 14px",background:o&&!t?"rgba(255,255,255,0.16)":"rgba(255,255,255,0.1)",border:"none",borderRadius:999,color:"#fff",fontSize:13,fontWeight:600,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',transition:"background 0.15s ease"},children:[(0,n.jsx)(u.A,{src:"/lottie/folder-solid.json",hover:o&&!t,size:16,color:"#ffffff"}),r?"Savingâ¦":"Save"]})}function eR({onClick:e,disabled:t,label:r,locked:o}){let[a,l]=(0,i.useState)(!1);return(0,n.jsx)("button",{type:"button",onClick:e,disabled:t,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),title:o?"Business plan feature":void 0,style:{display:"inline-flex",alignItems:"center",gap:7,padding:"9px 14px",background:a&&!t?"rgba(255,255,255,0.18)":"rgba(255,255,255,0.07)",border:"none",borderRadius:999,color:t||o?"rgba(255,255,255,0.5)":"#ffffff",fontSize:13,fontWeight:700,cursor:t?"not-allowed":"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',whiteSpace:"nowrap",transition:"background 0.15s ease, color 0.15s ease"},children:r})}function eA({onClick:e}){let[t,r]=(0,i.useState)(!1);return(0,n.jsxs)("button",{type:"button",onClick:e,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{display:"inline-flex",alignItems:"center",gap:7,padding:"9px 14px",background:t?"rgba(255,255,255,0.85)":"#ffffff",border:"none",borderRadius:999,color:"#000000",fontSize:13,fontWeight:700,cursor:"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',transition:"background 0.15s ease"},children:[(0,n.jsx)(u.A,{src:"/lottie/newspaper-solid.json",hover:t,size:16,style:{filter:"brightness(0)"}}),"Export PDF"]})}function eL(){let[e,t]=(0,i.useState)(!1),[o,l]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!1),[g,x]=(0,i.useState)(!1),b=ee(o,250),y=ee(d,250),v=ee(g,250),[_,L]=(0,i.useState)(!1),[T,B]=(0,i.useState)(!1),[H,K]=(0,i.useState)("map"),[X,ev]=(0,i.useState)(!0),[eI,eL]=(0,i.useState)(""),[eT,eW]=(0,i.useState)(""),[eE,e$]=(0,i.useState)("global"),[eB,eP]=(0,i.useState)("medium"),[eH,eG]=(0,i.useState)("outdoor"),[eD,eN]=(0,i.useState)(!1),[eO,eU]=(0,i.useState)({width:0,height:0}),[eV,eZ]=(0,i.useState)(!1),[eq,eY]=(0,i.useState)({width:0,height:0}),[eJ,eK]=(0,i.useState)(null),[eQ,eX]=(0,i.useState)("global"),[e0,e1]=(0,i.useState)(null),[e2,e5]=(0,i.useState)(null),[e3,e4]=(0,i.useState)(0),[e6,e8]=(0,i.useState)(null),[e7,e9]=(0,i.useState)(!1),[te,tt]=(0,i.useState)(!1),[tr,tn]=(0,i.useState)(null),[ti,to]=(0,i.useState)(!1),[ta,tl]=(0,i.useState)([]),[ts,td]=(0,i.useState)(0),[tc,tp]=(0,i.useState)(!1),[tu,tg]=(0,i.useState)([]),[tf,th]=(0,i.useState)({}),[tx,tm]=(0,i.useState)(""),[tb,ty]=(0,i.useState)(!1),[tv,tk]=(0,i.useState)(!1),[tw,tj]=(0,i.useState)(!1),[tS,tC]=(0,i.useState)(0),[tz,tI]=(0,i.useState)(0),t_=(0,i.useRef)(null),[tM,tF]=(0,i.useState)(!1),[tR,tA]=(0,i.useState)("out_of_searches"),[tL,tT]=(0,i.useState)(null),[tW,tE]=(0,i.useState)(null),[t$,tB]=(0,i.useState)(!1),[tP,tH]=(0,i.useState)(null),tG=(0,i.useRef)(null);(0,i.useEffect)(()=>
276{if("global"!==eE||"instant"===eB)return;let e=tG.current;e&&e.blobPromise&&e.blobPromise.then(t=>ek(t,ed,e.source)).catch(()=>{})},[eE,eB,tP]),(0,i.useEffect)(()=>{if("global"!==eE||"instant"===eB)return;let e=tG.current;e&&e.blobPromise&&e.blobPromise.then(t=>ek(t,ed,e.source)).catch(()=>{})},[eE,eB]);let tD=(0,i.useRef)([]),tN=(0,i.useCallback)(e=>(tD.current.push(e),e),[]),tO=(0,i.useCallback)(()=>{tD.current.forEach(e=>{try{URL.revokeObjectURL(e)}catch(e){}}),tD.current=[]},[]);(0,i.useEffect)(()=>tO,[tO]);let[tU,tV]=(0,i.useState)(null),[tZ,tq]=(0,i.useState)([]),[tY,tJ]=(0,i.useState)(!1),[tK,tQ]=(0,i.useState)(null),[tX,t0]=(0,i.useState)([]),[t1,t2]=(0,i.useState)(0),t5=tX[t1],[t3,t4]=(0,i.useState)(null),[t6,t8]=(0,i.useState)(!1),[t7,t9]=(0,i.useState)(!1),[re,rt]=(0,i.useState)(!1),[rr,rn]=(0,i.useState)(!1),[ri,ro]=(0,i.useState)(!1),[ra,rl]=(0,i.useState)(!1),[rs,rd]=(0,i.useState)(!1),[rc,rp]=(0,i.useState)(!1),[ru,rg]=(0,i.useState)(!1),[rf,rh]=(0,i.useState)(null),[rx,rm]=(0,i.useState)(!1),[rb,ry]=(0,i.useState)(null),[rv,rk]=(0,i.useState)(null),[rw,rj]=(0,i.useState)({x:0,y:0,width:100,height:100}),[rS,rC]=(0,i.useState)(null),[rz,rI]=(0,i.useState)(null),[r_,rM]=(0,i.useState)(1),[rF,rR]=(0,i.useState)(!1),[rA,rL]=(0,i.useState)(!1),[rT,rW]=(0,i.useState)(null),[rE,r$]=(0,i.useState)(null),[rB,rP]=(0,i.useState)([]),rH=(0,i.useRef)([]);(0,i.useEffect)(()=>{rH.current=rB},[rB]);let[rG,rD]=(0,i.useState)(""),[rN,rO]=(0,i.useState)([]),[rU,rV]=(0,i.useState)(0),rZ=rG||t5?._source_index||t5?.city_path||"",rq=rr?{title:"Verifyingâ¦",sub:"Cross-checking evidence for the final ranking"}:re?{title:"Reranking",sub:"Matching keypoints against Street View imageryâ¦"}:ra?{title:"Loading more results",sub:`Fetching the top 30â¦`}:{title:"Finding Location",sub:"global"===eE?"Analyzing with AIâ¦":"Searching indexâ¦"},[rY,rJ]=(0,i.useState)(!1),[rK,rQ]=(0,i.useState)([]),[rX,r0]=(0,i.useState)(null),r1=(0,i.useRef)(null),[r2,r5]=(0,i.useState)(0),[r3,r4]=(0,i.useState)(!1),[r6,r8]=(0,i.useState)("results"),[r7,r9]=(0,i.useState)(110),[ne,nt]=(0,i.useState)(!1),[nr,nn]=(0,i.useState)(!1),ni=(0,i.useCallback)((e,t)=>{if("number"!=typeof e||"number"!=typeof t)return;let r=`${e.toFixed(6)}, ${t.toFixed(6)}`,n=()=>{try{let e=document.createElement("textarea");e.value=r,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch(e){}return document.body.removeChild(e),!0}catch(e){return!1}};"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(r).catch(()=>{n()}):n(),nn(!0),setTimeout(()=>nn(!1),180),nt(!0),setTimeout(()=>nt(!1),1400)},[]),[no,na]=(0,i.useState)(!0),[nl,ns]=(0,i.useState)(null),[nd,nc]=(0,i.useState)(!0),[np,nu]=(0,i.useState)(!1),[ng,nf]=(0,i.useState)(!0),[nh,nx]=(0,i.useState)(!0),[nm,nb]=(0,i.useState)(null),[ny,nv]=(0,i.useState)(!1),[nk,nw]=(0,i.useState)(null),[nj,nS]=(0,i.useState)(!1),[nC,nz]=(0,i.useState)(!1),[nI,n_]=(0,i.useState)(!1),[nM,nF]=(0,i.useState)(null),nR=(0,i.useRef)(null),nA=(0,i.useRef)(null),nL=(0,i.useRef)(null),nT=(0,i.useRef)(null),nW=(0,i.useRef)(null),nE=(0,i.useRef)(null),n$=(0,i.useRef)(null),nB=(0,i.useRef)(null),nP=(0,i.useRef)(null),nH=(0,i.useRef)(null),nG=(0,i.useRef)(null),nD=(0,i.useRef)(null),[nN,nO]=(0,i.useState)(!1),nU=(0,i.useRef)(null),nV=(0,i.useRef)(null),nZ=(0,i.useRef)(null),nq=(0,i.useRef)(!1),nY=(0,i.useRef)(0),nJ=(0,i.useRef)(0),nK=(0,i.useRef)(!1),{user:nQ,hasActiveSubscription:nX,subscription:n0,subscriptionChecked:n1}=(0,s.useAuth)(),{requireAuth:n2}=(0,p.E)(),n5=nQ?.uid,n3=(0,i.useMemo)(()=>!!nX&&(!!n0?.manuallyGranted||ex.has((n0?.plan||"").trim().toLowerCase())),[nX,n0]),[n4,n6]=(0,i.useState)([]),[n8,n7]=(0,i.useState)(null),n9=(0,i.useRef)(0),ie=(0,i.useRef)(0),it=(0,i.useRef)(null),ir=(0,i.useRef)(null),ii=(0,i.useRef)(null),[io,ia]=(0,i.useState)(()=>Date.now()),[il,is]=(0,i.useState)(null),[id,ic]=(0,i.useState)([]),[ip,iu]=(0,i.useState)(null),[ig,ih]=(0,i.useState)([]),[ix,im]=(0,i.useState)(!1),[ib,iy]=(0,i.useState)(null),[iv,ik]=(0,i.useState)(!1),[iw,ij]=(0,i.useState)(""),[iS,iC]=(0,i.useState)(!1);(0,i.useEffect)(()=>
276{if(!n5){n6([]),n7(null);return}if(!n5)return()=>{};let e=(0,F.P)((0,F.rJ)(c.db,"users",n5,"history"),(0,F.My)("createdAt","desc"),(0,F.AB)(50));return(0,F.aQ)(e,e=>n6(e.docs.map(e=>({id:e.id,...e.data()}))),e=>{console.error("[history] snapshot error",e),n6([])})},[n5]),(0,i.useEffect)(()=>{n8&&n4.some(e=>{if("running"===e.status)return!0;let t=e.createdAt?.toMillis?e.createdAt.toMillis():e.createdAt?.toDate?e.createdAt.toDate().getTime():null;return null!=t&&t>=n8.createdAtClient-1500})&&n7(null)},[n4,n8]);let iz=!!n8||n4.some(e=>"running"===e.status);(0,i.useEffect)(()=>{if(!iz||!y)return;ia(Date.now());let e=setInterval(()=>ia(Date.now()),1e3);return()=>clearInterval(e)},[iz,y]),(0,i.useEffect)(()=>{!y&&(n9.current=0,ie.current&&(cancelAnimationFrame(ie.current),ie.current=0))},[y]),(0,i.useEffect)(()=>{if(!n5)return void rh(null);n1&&rh(n0?.tipsHidden===!0)},[n5,n0,n1]);let iI=e=>!nX&&("medium"===e||"high"===e),i_=Math.max(0,5-((n0?.freeSearchesUsed||{}).city||0)),iM=n0?.creditBalanceCents||0,iF=!nX&&0===i_&&iM<90,iR=nX||iM>0,iA=[0,20];(0,i.useEffect)(()=>{n1&&(nX||"medium"!==eB&&"high"!==eB||eP("low"))},[n1,nX,eB]);let iL=(0,i.useCallback)(()=>{let e="index"===eE;e$("index"),e||!function(){try{return window.localStorage?.getItem(el)==="1"}catch(e){return!1}}()&&!0!==rf&&rg(!0)},[eE,rf]),iT=(0,i.useCallback)(()=>{try{window.localStorage?.setItem(el,"1")}catch(e){}rh(!0),rg(!1),n5&&(0,F.BN)((0,F.H9)(c.db,"users",n5),{tipsHidden:!0},{merge:!0}).catch(e=>console.error("[tips] persist hideTips failed:",e))},[n5]);(0,i.useEffect)(()=>{if(tu.length)return;let e=!1;return m().then(t=>{!e&&t.length&&tg(t)}).catch(()=>{}),()=>{e=!0}},[n5,tu.length]);let iW=(0,i.useMemo)(()=>ta.map(e=>Array.isArray(e.derived_indexes)&&e.derived_indexes.length>0?e.derived_indexes:ei(tu,e.lat,e.lng,e.radius_km,3)),[ta,tu]),iE=(0,i.useMemo)(()=>{let e=nl||{},t=ng&&Array.isArray(e.exact)?e.exact:[],r=nh&&Array.isArray(e.visual)?e.visual:[],n=[...t.map(e=>({...e,_kind:"exact"})),...r.map(e=>({...e,_kind:"visual"}))],i=new Map;return n.map(e=>{let t=`${e._kind}-${e.thumbnail_url||e.link||"item"}`,r=i.get(t)||0;return i.set(t,r+1),{...e,_key:0===r?t:`${t}-${r}`}})},[nl,ng,nh]);(0,i.useEffect)(()=>{if(!n$.current)return;let e=n$.current;if(!ta.length){for(let t=0;t<5;t++){["global-search-circle","global-search-circle-outline"].forEach(r=>{let n=`${r}-${t}`;e.getLayer(n)&&e.removeLayer(n)});let r=`global-search-area-${t}`;e.getSource(r)&&e.removeSource(r)}["global-search-circle","global-search-circle-outline"].forEach(t=>{e.getLayer(t)&&e.removeLayer(t)}),e.getSource("global-search-area")&&e.removeSource("global-search-area"),e.getLayer("evidence-layer")&&e.removeLayer("evidence-layer"),e.getSource("evidence-source")&&e.removeSource("evidence-source"),rB.forEach(e=>{try{e.remove()}catch(e){}}),rP([]);return}let t=ta[ts];if(!t)return;eK({...t,radius_meters:1e3*t.radius_km,analysis_summary:eJ?.analysis_summary}),rB.forEach(e=>{try{e.remove()}catch(e){}}),rP(iD(ta,ts,tU||tP?.preview)),iG(t.evidence_points||[]);let r=Math.max(2,Math.min(15,14-Math.log2(t.radius_km/2))-eo());n$.current.flyTo({center:[t.lng,t.lat],zoom:r,duration:800,essential:!0}),K("map")},[ts,ta,tU]),(0,i.useEffect)(()=>{let e=ta[ts];if(!e||!Number.isFinite(e.lat)||!Number.isFinite(e.lng))return;let t=`${e.lat.toFixed(4)},${e.lng.toFixed(4)}`;if(t in tf)return;let r=!1;return(async()=>{try{let n=await fetch(`/api/reverse-geocode?lat=${e.lat}&lng=${e.lng}`);if(!n.ok){r||th(e=>({...e,[t]:null}));return}let i=await n.json(),o=i&&"string"==typeof i.city&&i.city.trim()?i.city.trim():null;r||th(e=>({...e,[t]:o}))}catch(e){r||th(e=>({...e,[t]:null}))}})(),()=>{r=!0}},[ts,ta,tf]),(0,i.useEffect)(()=>{if(!n5)return void rO([]);if(!n5)return()=>{};let e=(0,F.H9)(c.db,"users",n5,"prefs","cityRecents");return(0,F.aQ)(e,e=>rO(Array.isArray(e.data()?.paths)?e.data().paths:[]),e=>{console.error("[prefs] recent cities snapshot error",e),rO([])})},[n5]),(0,i.useEffect)(()=>{if(!n5)return void ic([]);if(!n5)return()=>{};let e=(0,F.P)((0,F.rJ)(c.db,"users",n5,"folders"),(0,F.My)("createdAt","desc"));return(0,F.aQ)(e,e=>ic(e.docs.map(e=>({id:e.id,...e.data()}))),e=>{console.error("[folders] snapshot error",e),ic([])})},[n5]),(0,i.useEffect)(()=>
276{if(!n5||!ip)return void ih([]);if(!n5||!ip)return()=>{};let e=(0,F.P)((0,F.rJ)(c.db,"users",n5,"folders",ip,"items"),(0,F.My)("addedAt","desc"));return(0,F.aQ)(e,e=>ih(e.docs.map(e=>({id:e.id,...e.data()}))),e=>{console.error("[folder items] snapshot error",e),ih([])})},[n5,ip]);let i$=(0,i.useCallback)(()=>{if(eJ)return{location_name:eJ.location_name||null,country:eJ.country||null,lat:eJ.lat,lng:eJ.lng,radius_km:eJ.radius_km??null,confidence:eJ.confidence??null};if(tX&&tX.length>0){let e=tX[t1]||tX[0];return{lat:e.lat,lng:e.lng,rank:e.rank??null,address:e.address||null}}return null},[eJ,tX,t1]),iB=(0,i.useCallback)(async(e,t,r,n=[])=>{if(!n5||!t||!r)return null;try{let i=await G(t,240,.7),o=await N(n5,{searchMode:e,imageName:t.name||"image",thumbnail:i,result:r});return o&&U(n5,o,t,n.map(e=>e.file).filter(Boolean)).then(e=>e&&O(n5,o,e)).catch(e=>console.warn("[history] image upload failed",e)),o}catch(e){return console.warn("[history] persist failed",e),null}},[n5]),iP=(0,i.useCallback)(async(e,t)=>{let r=n$.current;if(!r||!e?.length)return[];rP(e=>(e.forEach(e=>{try{e.remove()}catch(e){}}),[]));let n="index-results-source",i="index-results-layer";r.getLayer(i)&&r.removeLayer(i),r.getSource(n)&&r.removeSource(n);let o=e.map((e,t)=>({type:"Feature",id:t,geometry:{type:"Point",coordinates:[e.lng,e.lat]},properties:{rank:t+1}}));return r.addSource(n,{type:"geojson",data:{type:"FeatureCollection",features:o}}),r.addLayer({id:i,type:"circle",source:n,paint:{"circle-radius":["case",["boolean",["feature-state","active"],!1],9,["interpolate",["linear"],["get","rank"],1,7,10,4.5]],"circle-color":"#ffffff","circle-stroke-color":["case",["boolean",["feature-state","active"],!1],"#ffffff","#000000"],"circle-stroke-width":["case",["boolean",["feature-state","active"],!1],3,1.5],"circle-opacity":.95}}),r.setFeatureState({source:n,id:0},{active:!0}),r._geoaxisIndexClick||(r._geoaxisIndexClick=e=>{if(!e.features?.length)return;let t=e.features[0].id;if("number"!=typeof t)return;t2(t);let[n,i]=e.features[0].geometry.coordinates;r.flyTo({center:[n,i],zoom:15})},r._geoaxisIndexEnter=()=>{r.getCanvas().style.cursor="pointer"},r._geoaxisIndexLeave=()=>{r.getCanvas().style.cursor=""},r.on("click",i,r._geoaxisIndexClick),r.on("mouseenter",i,r._geoaxisIndexEnter),r.on("mouseleave",i,r._geoaxisIndexLeave)),[]},[]);(0,i.useEffect)(()=>{let e=n$.current;if(!e||!tX?.length)return;let t="index-results-source";if(e.getSource(t))for(let r=0;r<tX.length;r++)try{e.setFeatureState({source:t,id:r},{active:r===t1})}catch(e){}},[t1,tX]);let iH=(0,i.useRef)(null);(0,i.useEffect)(()=>{if("outdoor"!==eH||!tX?.length)return;let e=tX[t1];if(!e||"number"!=typeof e.lat||"number"!=typeof e.lng)return;let t=of(e),r=`${e.lat},${e.lng},${null==t?"":t}`;iH.current!==r&&(iH.current=r,nA.current&&oh(e.lat,e.lng,{heading:t}))},[t1,tX,eH]);let iG=(0,i.useCallback)(e=>{let t=n$.current;if(!t)return;let r="evidence-source",n="evidence-layer";if(t.getLayer(n)&&t.removeLayer(n),t.getSource(r)&&t.removeSource(r),!Array.isArray(e)||!e.length)return;let i=e.filter(e=>"number"==typeof e?.lat&&"number"==typeof e?.lng).map((e,t)=>({type:"Feature",id:t,geometry:{type:"Point",coordinates:[e.lng,e.lat]},properties:{label:e.label||"",source:e.source||""}}));i.length&&(t.addSource(r,{type:"geojson",data:{type:"FeatureCollection",features:i}}),t.addLayer({id:n,type:"circle",source:r,paint:{"circle-radius":6,"circle-color":"#ffffff","circle-stroke-color":"#000000","circle-stroke-width":1.5,"circle-opacity":.95}}),t._geoaxisEvidenceClick||(t._geoaxisEvidenceClick=e=>{if(!e.features?.length)return;let r=e.features[0],n=r.geometry.coordinates[0],i=r.geometry.coordinates[1],o=`<div style="font-family:var(--font-instrument-serif), 'Instrument Serif', Georgia, serif;font-size:12px;max-width:240px;color:#111"><div style="font-weight:700;margin-bottom:2px">${r.properties.label||""}</div><div style="font-size:10px;color:#777;text-transform:uppercase;letter-spacing:0.5px">${r.properties.source||""}</div></div>`;new window.mapboxgl.Popup({closeButton:!1}).setLngLat([n,i]).setHTML(o).addTo(t)}
276,t._geoaxisEvidenceEnter=()=>{t.getCanvas().style.cursor="pointer"},t._geoaxisEvidenceLeave=()=>{t.getCanvas().style.cursor=""},t.on("click",n,t._geoaxisEvidenceClick),t.on("mouseenter",n,t._geoaxisEvidenceEnter),t.on("mouseleave",n,t._geoaxisEvidenceLeave)))},[]),iD=(0,i.useCallback)((e,t,r)=>{if(!n$.current||!window.mapboxgl)return[];let n=n$.current;for(let e=0;e<5;e++){["global-search-circle","global-search-circle-outline"].forEach(t=>{let r=`${t}-${e}`;n.getLayer(r)&&n.removeLayer(r)});let t=`global-search-area-${e}`;n.getSource(t)&&n.removeSource(t)}["global-search-circle","global-search-circle-outline"].forEach(e=>{n.getLayer(e)&&n.removeLayer(e)}),n.getSource("global-search-area")&&n.removeSource("global-search-area"),n.getLayer("index-results-layer")&&n.removeLayer("index-results-layer"),n.getSource("index-results-source")&&n.removeSource("index-results-source"),n.getLayer("evidence-layer")&&n.removeLayer("evidence-layer"),n.getSource("evidence-source")&&n.removeSource("evidence-source");let i=[];return e.forEach((e,o)=>{let a=o===t,l=e.radius_km,s=e.lat,d=e.lng;if(a){let e=[];for(let t=0;t<=64;t++){let r=t/64*2*Math.PI,n=l/111*Math.cos(r),i=l/(111*Math.cos(s*Math.PI/180))*Math.sin(r);e.push([d+i,s+n])}n.addSource(`global-search-area-${o}`,{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[e]}}}),n.addLayer({id:`global-search-circle-${o}`,type:"fill",source:`global-search-area-${o}`,paint:{"fill-color":"#ffffff","fill-opacity":.22}}),n.addLayer({id:`global-search-circle-outline-${o}`,type:"line",source:`global-search-area-${o}`,paint:{"line-color":"#ffffff","line-width":3,"line-opacity":.95,"line-dasharray":[1,0]}})}let c=document.createElement("div");c.style.borderRadius="50%",c.style.cursor="pointer",c.style.boxShadow="0 2px 8px rgba(0,0,0,0.5)",a&&r?(c.style.width="36px",c.style.height="36px",c.style.backgroundImage=`url(${r})`,c.style.backgroundSize="cover",c.style.backgroundPosition="center",c.style.border="3px solid #FFFFFF"):(a?(c.style.width="32px",c.style.height="32px",c.style.background="var(--fg)",c.style.border="2px solid #FFFFFF",c.style.color="var(--bg)",c.style.fontFamily='var(--font-instrument-serif), "Instrument Serif", Georgia, serif',c.style.fontSize="13px",c.style.fontWeight="800"):(c.style.width="24px",c.style.height="24px",c.style.background="rgba(20,20,30,0.85)",c.style.border="1.5px solid var(--fg-muted)",c.style.color="var(--fg)",c.style.fontFamily='var(--font-instrument-serif), "Instrument Serif", Georgia, serif',c.style.fontSize="12px",c.style.fontWeight="700"),c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.textContent=String(o+1)),c.addEventListener("click",e=>{e.stopPropagation(),td(o)});let p=new window.mapboxgl.Marker({element:c}).setLngLat([d,s]).addTo(n);i.push(p)}),i},[]),iN=(0,i.useCallback)(e=>{if(!e)return;let t=e.result||{},r=t.location&&"object"==typeof t.location?{...t.location,candidates:t.candidates||[]}:t,n=e.searchMode||(null!=r.radius_km?"global":"index"),i=e.imageName||"image.jpg",o=/\.[a-z0-9]{2,5}$/i.test(i)?i:`${i}.jpg`;if(tH({preview:e.thumbnail,name:o,file:null}),tq([]),rk(null),"lens_match"===e.searchMode||"lens_match"===r.source){r$(e.id||null),rR(!!e.rating),rL(!!e.rating),rW(null);let t=r.link||r.source_url||null;if(t)try{window.open(t,"_blank","noopener,noreferrer")}catch(e){}return}if(e.originalUrl&&(async()=>{let t=async(e,t)=>{let r=await fetch(e);if(!r.ok)return null;let n=await r.blob();return{file:new File([n],t,{type:n.type||"image/jpeg"}),dataUrl:await new Promise((e,t)=>{let r=new FileReader;r.onload=t=>e(t.target.result),r.onerror=t,r.readAsDataURL(n)})}};try{let r=Array.isArray(e.extraUrls)?e.extraUrls:[],n=t(e.originalUrl,o).then(e=>(e&&(tH({preview:e.dataUrl,name:o,file:e.file}),rk(e.dataUrl)),e)),i=r.map((e,r)=>t(e,`extra-${r}.jpg`).catch(()=>null)),[a,...l]=await Promise.all([n,...i]);if(!a)return;let s=l.filter(Boolean).map((e,t)=>({file:e.file,preview:e.dataUrl,name:e.file.name||`extra-${t}.jpg`}));s.length>0&&tq(s)}catch(e){console.warn("[history] restore original failed",e)}})(),rR(!!e.rating),rL(!!e.rating),rW(null),r$(e.id||null),"global"===n)eK(r),ns(r.related_images||null),nu(!1),t0([]),t2(0),tl(Array.isArray(r.candidates)&&r.candidates.length>0?r.candidates:[r]),td(0);else{eK(null),ns(null),nu(!1),tl([]);let t=Array.isArray(r.results)&&r.results.length>0?r.results.map((e,t)=>({...e,rank:e.rank??t+1})):[{...r,rank:r.rank??1}];t0(t),t2(0),rD(r.city_path||""),iP(t,e.thumbnail),t.some(e=>!e.address)&&ej(t,"pk.eyJ1IjoianNraW45NSIsImEiOiJjbW41cGxldTAwY3BpMnBwb2M4NnZhbmR3In0.9Swra9OvLxeHIOk754NzeQ").then(t0).catch(()=>{})}if(B(!0),na(!0),l(!1),u(!1),x(!1),n$.current&&"number"==typeof r.lat&&"number"==typeof r.lng){let e="global"===n?(r.radius_km?Math.max(3,Math.min(12,12-Math.log2(r.radius_km))):8)-eo():15;n$.current.flyTo({center:[r.lng,r.lat],zoom:e,duration:1200,essential:!0})}},[iP]),iO=(0,i.useCallback)(async e=>{if(!n5)return;let t=i$();if(t&&tP){im(!0);try{let r=D(t),n=e||await J(n5,r),i=tP.file||tP.preview,o=i?await G(i,320,.75):"";await Q(n5,n,{searchMode:eE,imageName:tP.name||"image.jpg",thumbnail:o,result:t});let a=id.find(e=>e.id===n)?.name||r;iy({folderId:n,name:a}),setTimeout(()=>iy(null),2500)}catch(e){console.error("[folders] save failed",e),alert("Could not save to folder.")}finally{im(!1),ik(!1)}}},[n5,tP,id,i$]),iU=(0,i.useCallback)(async e=>{if(n5&&nm){n_(!0);try{let t=eJ||(t5&&"number"==typeof t5.lat?t5:null),r=t?.location_name||t?.country||nm.source||"Lens results",n=e||await J(n5,r),i={lat:"number"==typeof t?.lat?t.lat:null,lng:"number"==typeof t?.lng?t.lng:null,address:t?.address||null,location_name:t?.location_name||null,country:t?.country||null,radius_km:"number"==typeof t?.radius_km?t.radiu
276s_km:null,confidence:"number"==typeof t?.confidence?t.confidence:null,source:"lens_match",kind:nm._kind||"visual",title:nm.title||"",link:nm.link||"",source_domain:nm.source||"",thumbnail_url:nm.thumbnail_url||"",keypoint_matches:nm.keypoint_matches??0,query_image_name:tP?.name||null};await Q(n5,n,{searchMode:"lens_match",imageName:(nm.title||"lens-match").slice(0,80),thumbnail:nm.thumbnail_url||"",result:i});let o=id.find(e=>e.id===n)?.name||r;nF({folderId:n,name:o}),setTimeout(()=>nF(null),2500)}catch(e){console.error("[folders] lens save failed",e),alert("Could not save to folder.")}finally{n_(!1),nz(!1)}}},[n5,nm,id,eJ,t5,tP]),iV=(0,i.useCallback)(async()=>{if(nm&&tP){nv(!0),nw(null);try{let e=tP.file;if(!e&&tP.preview){let t=await fetch(tP.preview),r=await t.blob();e=new File([r],tP.name||"image.jpg",{type:r.type||"image/jpeg"})}if(!e)throw Error("Original image is not available - please re-upload to retry.");let t=new FormData;t.append("image",e),t.append("lens_thumbnail_url",nm.thumbnail_url||""),t.append("lens_title",nm.title||""),t.append("lens_link",nm.link||""),t.append("lens_source",nm.source||""),t.append("lens_kind",nm._kind||"visual"),t.append("thinking_mode","instant"===eB?"medium":eB);let r=await ef(),n=await fetch(`${ed}/api/retry-with-result`,{method:"POST",body:t,headers:r});if(!n.ok){let e={};try{e=await n.json()}catch(e){}throw A(e,n.status)}let i=n.body.getReader(),o=new TextDecoder,a="",s=null;for(;;){let{done:e,value:t}=await i.read();if(e)break;let r=(a+=o.decode(t,{stream:!0})).split("\n");for(let e of(a=r.pop(),r)){let t;if(e.trim()){try{t=JSON.parse(e)}catch{continue}if("final"===t.event)s=t.data;else if("error"===t.event)throw A(t,t.status||500)}}}if(!s)throw Error("No final result returned.");eK(s.location),ns(s.related_images||nl),nb(null),nu(!1),t0([]),na(!0),l(!1),x(!1),B(!0),ev(!0),K("map");let d=Array.isArray(s.candidates)&&s.candidates.length>0?s.candidates:[s.location];if(tl(d),td(0),n$.current&&"number"==typeof s.location?.lat&&"number"==typeof s.location?.lng){let e=s.location.radius_km,t=(e?Math.max(3,Math.min(12,12-Math.log2(e))):8)-eo();n$.current.flyTo({center:[s.location.lng,s.location.lat],zoom:t,duration:1200,essential:!0})}}catch(e){if(console.error("[retry] failed",e),e instanceof R){let t=P(e);nw(`${t.title}. ${t.body}${t.refundLine?` ${t.refundLine}`:""}`)}else nw(e.message||"Retry failed")}finally{nv(!1)}}},[nm,tP,eB,nl]),iZ=(0,i.useCallback)(e=>{nq.current=!0,nY.current=e.touches[0].clientY,nK.current=r3,nJ.current=0,nU.current&&(nU.current.style.transition="none")},[r3]),iq=(0,i.useCallback)(()=>{if(!nq.current||!nU.current)return;nq.current=!1,nU.current.style.transition="max-height 0.3s cubic-bezier(0.25, 1, 0.5, 1)";let e=nJ.current;nK.current?e>60?r4(!1):nU.current.style.maxHeight="75vh":e<-60?r4(!0):nU.current.style.maxHeight="110px"},[]);(0,i.useEffect)(()=>{let e=nV.current;if(!e)return;let t=e=>{if(!nq.current||!nU.current)return;e.preventDefault();let t=e.touches[0].clientY-nY.current;nJ.current=t;let r=.75*window.innerHeight,n=(nK.current?r:110)-t;n=Math.max(110,Math.min(r,n)),nU.current.style.maxHeight=n+"px"};return e.addEventListener("touchmove",t,{passive:!1}),()=>e.removeEventListener("touchmove",t)},[e,tb,nQ]),(0,i.useEffect)(()=>{let e=()=>{t(window.innerWidth<=767)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,i.useEffect)(()=>{if(!e||!n$.current)return;let t=n$.current,r=setTimeout(()=>{let e=r3?nU.current?.offsetHeight||Math.round(.6*window.innerHeight):0;try{t.easeTo({padding:{top:0,right:0,left:0,bottom:e},duration:320})}catch(e){}},340*!!r3);return()=>clearTimeout(r)},[e,r3,r6,T,t1,ts]),(0,i.useEffect)(()=>{let t=nU.current;if(!e||!t||"undefined"==typeof ResizeObserver||"results"!==r6)return;let r=()=>r9(t.offsetHeight||110),n=new ResizeObserver(r);return n.observe(t),r(),()=>n.disconnect()},[e,nQ,tb,r6]);let iY=(0,i.useRef)(!1);(0,i.useEffect)(()=>{e&&!iY.current&&nQ&&(iY.current=!0,tb||tX.length>0||(r8("search"),r4(!0),(0,h.hZ)(),(0,h.u4)("dashboard_mobile_autoexpand",{surface:"mobile_sheet"})))},[e,nQ]),(0,i.useEffect)(()=>{let e=!1,t=tP?.preview;return t?(ea(t,128).then(t=>{e||tV(t)}),()=>{e=!0}):void tV(null)},[tP?.preview]),(0,i.useEffect)(()=>
276{if(!nR.current||n$.current)return;let e=!1,t=null,r=null;if(!document.getElementById("mapbox-gl-css")){let e=document.createElement("link");e.id="mapbox-gl-css",e.href="https://api.mapbox.com/mapbox-gl-js/v2.14.1/mapbox-gl.css",e.rel="stylesheet",document.head.appendChild(e)}if(!document.getElementById("mapbox-ctrl-hide-style")){let e=document.createElement("style");e.id="mapbox-ctrl-hide-style",e.textContent=` 277 .mapboxgl-ctrl-group { 278 display: none !important; 279 } 280 `,document.head.appendChild(e)}let n=()=>{if(e||n$.current||!nR.current||!window.mapboxgl)return;let r=window.mapboxgl;r.accessToken="pk.eyJ1IjoianNraW45NSIsImEiOiJjbW41cGxldTAwY3BpMnBwb2M4NnZhbmR3In0.9Swra9OvLxeHIOk754NzeQ";let n=window.innerWidth<=767?.6:1.4,i=new r.Map({container:nR.current,style:"mapbox://styles/mapbox/dark-v11",center:[0,20],zoom:n,pitch:0,fadeDuration:0});if(n$.current=i,i.on("load",()=>i.resize()),"undefined"!=typeof ResizeObserver&&nR.current){let e=!0;(t=new ResizeObserver(t=>{let r=t[0]?.contentRect,n=nR.current,o=r?r.width:n?n.clientWidth:0,a=r?r.height:n?n.clientHeight:0;if(o<2||a<2){e=!0;return}try{i.resize()}catch(e){}e&&(e=!1,requestAnimationFrame(()=>{try{i.resize()}catch(e){}}),setTimeout(()=>{try{i.resize()}catch(e){}},200))})).observe(nR.current)}};return r=document.getElementById("mapbox-gl-js"),window.mapboxgl?n():r?r.addEventListener("load",n):((r=document.createElement("script")).id="mapbox-gl-js",r.src="https://api.mapbox.com/mapbox-gl-js/v2.14.1/mapbox-gl.js",r.async=!0,r.addEventListener("load",n),document.head.appendChild(r)),()=>{if(e=!0,r&&r.removeEventListener("load",n),t){try{t.disconnect()}catch(e){}t=null}if(n$.current){try{n$.current.remove()}catch(e){}n$.current=null}}},[]);let iJ=e=>{let t=e.name.toLowerCase();return t.endsWith(".heic")||t.endsWith(".heif")||"image/heic"===e.type||"image/heif"===e.type},iK=e=>e.name.toLowerCase().endsWith(".avif")||"image/avif"===e.type,iQ=async e=>{if(iK(e)){t4({message:"AVIF images are not supported. Please use JPG, PNG, HEIC, or WEBP.",code:"unsupported_format",tone:"warning",title:"AVIF images arenât supported",body:"Please use a JPG, PNG, HEIC, or WEBP image instead.",refundLine:null,reference:null,timestamp:Date.now()}),t8(!0);return}let t=e;if(iJ(e)){let{default:n}=await r.e(2e3).then(r.t.bind(r,2402,23)),i=await n({blob:e,toType:"image/jpeg",quality:.9});t=new File([Array.isArray(i)?i[0]:i],e.name.replace(/\.heic|\.heif/i,".jpg"),{type:"image/jpeg"})}tO();let n=tN(URL.createObjectURL(t));tH({file:t,preview:n,name:t.name}),rk(n);try{let e=new Image;e.onload=()=>eZ(e.naturalWidth>0&&480>Math.min(e.naturalWidth,e.naturalHeight)),e.src=n}catch(e){eZ(!1)}L(!1),B(!1),eK(null),ns(null),t0([]),t4(null),t8(!1),rR(!1),rL(!1),rW(null),r$(null),is(null),t2(0),rD(""),tn(null),tl([]),td(0),K("map"),na(!1),rg(!1);let i=es(t,1024,.95);if(tG.current={source:t,blobPromise:i},"global"===eE&&"instant"!==eB&&i.then(e=>ek(e,ed,t)).catch(()=>{}),"global"===eE&&!tP)try{let e=(await r.e(7573).then(r.bind(r,7573))).default,n=await e.gps(t);n&&"number"==typeof n.latitude&&"number"==typeof n.longitude&&setTimeout(()=>iX(t,n.latitude,n.longitude),0)}catch(e){}},iX=(0,i.useCallback)((e,t,r)=>{is({lat:t,lng:r});let n={lat:t,lng:r,radius_km:.05,radius_meters:50,confidence:1,location_name:"Resolving addressâ¦",country:"",address:null,address_true:!1,source:"metadata"};eK(n),tl([n]),td(0),t0([]),B(!0),na(!0),u(!1),x(!1),l(!1),K("map");let i=(e,i)=>{let o={...n,location_name:e,address:i||null,address_true:!!i};eK(e=>e?.source==="metadata"&&e.lat===t&&e.lng===r?o:e),tl(e=>e?.length===1&&e[0]?.source==="metadata"&&e[0]?.lat===t&&e[0]?.lng===r?[o]:e)},o="pk.eyJ1IjoianNraW45NSIsImEiOiJjbW41cGxldTAwY3BpMnBwb2M4NnZhbmR3In0.9Swra9OvLxeHIOk754NzeQ";if(!o)return void i("Photo location",null);ew(t,r,o).then(e=>{let t=e&&"Unknown"!==e;i(t?e:"Photo location",t?e:null)}).catch(()=>i("Photo location",null))},[]),i0=(0,i.useCallback)(()=>{if(!il)return;let e=`Photo EXIF coordinates: ${il.lat.toFixed(6)}, ${il.lng.toFixed(6)}. Use these as a strong hint - the photo was geotagged here - but verify visually and refine to the actual scene if you can.`;is(null),eK(null),ns(null),tl([]),or({contextOverride:e})},[il]),i1=(0,i.useCallback)(e=>{if(e){if(iK(e)){t4({message:"AVIF images are not supported. Please use JPG, PNG, HEIC, or WEBP.",code:"unsupported_format",tone:"warning",title:"AVIF images arenât supported",body:"Please use a JPG, PNG, HEIC, or WEBP image instead.",refundLine:null,reference:null,timestamp:Date.now()}),t8(!0);return}tq(t=>{if(t.length>=3)return t;let r=new FileReader;return r.onload=t=>{tq(r=>r.length>=3?r:[...r,{file:e,preview:t.target.result,name:e.name||"image"}])}
280,r.readAsDataURL(e),t})}},[]),i2=e=>{let t=Array.from(e.target.files||[]);if(t.length){if((0,h.u4)("dashboard_upload_select",{source:"picker",file_count:t.length,size_bucket:(0,h.gi)(t[0]?.size),mime:t[0]?.type||"unknown",search_mode:eE}),tP){if("global"===eE){let e=3-tZ.length;t.slice(0,Math.max(0,e)).forEach(e=>i1(e))}}else iQ(t[0]),"global"===eE&&t.slice(1,4).forEach(e=>i1(e));e.target&&(e.target.value="")}};(0,i.useEffect)(()=>{let e=0,t=e=>{let t=Array.from(e.dataTransfer?.types||[]);return t.includes("Files")||t.includes("files")},r=r=>{t(r)&&1===(e+=1)&&e9(!0)},n=e=>{t(e)&&e.preventDefault()},i=r=>{t(r)&&0===(e=Math.max(0,e-1))&&e9(!1)},o=()=>{e=0,e9(!1)};return window.addEventListener("dragenter",r),window.addEventListener("dragover",n),window.addEventListener("dragleave",i),window.addEventListener("drop",o),()=>{window.removeEventListener("dragenter",r),window.removeEventListener("dragover",n),window.removeEventListener("dragleave",i),window.removeEventListener("drop",o)}},[]),(0,i.useEffect)(()=>{let e=e=>{if(tb)return;let t=e.clipboardData?.items;if(t){for(let r=0;r<t.length;r++)if(t[r].type.startsWith("image/")){let n=t[r].getAsFile();if(n){iQ(n),e.preventDefault();break}}}};return window.addEventListener("paste",e),()=>window.removeEventListener("paste",e)},[tb]);let i5=e=>t=>{if(!nP.current)return;t.preventDefault(),t.stopPropagation();let r=nP.current.getBoundingClientRect();nG.current={mode:e,startX:t.clientX,startY:t.clientY,startCrop:{...rw},rect:r},nO(!0);try{t.currentTarget.setPointerCapture(t.pointerId)}catch(e){}},i3=e=>{let t=nG.current;if(!t)return;let r=(e.clientX-t.startX)/t.rect.width*100,n=(e.clientY-t.startY)/t.rect.height*100,i=t.startCrop,o=i.x,a=i.y,l=i.width,s=i.height;if("move"===t.mode)o=Math.max(0,Math.min(100-i.width,i.x+r)),a=Math.max(0,Math.min(100-i.height,i.y+n));else{let e=i.x,d=i.x+i.width,c=i.y,p=i.y+i.height;t.mode.includes("w")&&(e=Math.max(0,Math.min(d-5,i.x+r))),t.mode.includes("e")&&(d=Math.min(100,Math.max(e+5,i.x+i.width+r))),t.mode.includes("n")&&(c=Math.max(0,Math.min(p-5,i.y+n))),t.mode.includes("s")&&(p=Math.min(100,Math.max(c+5,i.y+i.height+n))),o=e,l=d-e,a=c,s=p-c}t.live={x:o,y:a,width:l,height:s};let d=nD.current;d&&(d.style.top=`${a}%`,d.style.left=`${o}%`,d.style.width=`${l}%`,d.style.height=`${s}%`)},i4=e=>{let t=nG.current;if(t){try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}nG.current=null,t.live&&rj(t.live),nO(!1)}};(0,i.useEffect)(()=>{n$.current&&setTimeout(()=>{let e=nR.current;if(e&&!(e.clientWidth<2)&&!(e.clientHeight<2))if(n$.current.resize(),tX.length>0){let e=tX[t1];n$.current.flyTo({center:[e.lng,e.lat],zoom:15})}else eJ&&n$.current.flyTo({center:[eJ.lng,eJ.lat]})},350),nL.current&&window.google?.maps?.event&&setTimeout(()=>{try{window.google.maps.event.trigger(nL.current,"resize")}catch(e){}},350)},[H,_]),(0,i.useEffect)(()=>{let e=nA.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=()=>{if(nL.current&&window.google?.maps?.event)try{window.google.maps.event.trigger(nL.current,"resize")}catch(e){}},r=!0,n=new ResizeObserver(n=>{let i=n[0]?.contentRect,o=i?i.width:e.clientWidth,a=i?i.height:e.clientHeight;if(o<2||a<2){r=!0;return}t(),r&&(r=!1,requestAnimationFrame(t),setTimeout(t,200))});return n.observe(e),()=>n.disconnect()},[eH]);let i6=eO.width&&eO.height?eO.width/eO.height:1,i8=!!t5&&!eJ&&"split"===H&&!e&&"outdoor"===eH&&i6>1226/712,i7=(0,i.useRef)(!1);(0,i.useEffect)(()=>{if(!i7.current){i7.current=!0;return}if("outdoor"!==eH)return;let e=tX?.[t1];if(!e||"number"!=typeof e.lat||"number"!=typeof e.lng)return;let t=setTimeout(()=>{iH.current=`${e.lat},${e.lng}`,oh(e.lat,e.lng,{recreate:!0,heading:of(e)})},120);return()=>clearTimeout(t)},[i8]),(0,i.useEffect)(()=>{if(tv){tj(!0);let e=requestAnimationFrame(()=>{tC(1),tI(1)});return()=>cancelAnimationFrame(e)}if(tw){tC(0);let e=setTimeout(()=>{tj(!1),tI(0)},600);return()=>clearTimeout(e)}},[tv]),(0,i.useEffect)(()=>{if(!tv)return;let e=!1,t=setTimeout(()=>{let t=n$.current;if(e||!t)return;try{t.resize()}catch(e){}try{t.stop()}catch(e){}let r=window.innerWidth<=767?.55:1.6,n=t.getCenter(),i=t.getZoom(),o=n.lng;try{t.setPadding({top:0,right:0,bottom:0,left:0})}catch(e){}try{t.setPitch(0),t.setBearing(0)}catch(e){}let a=null,l=t=>{let s,d;if(e||!n$.current)return;null==a&&(a=t);let c=t-a,p=.12+2.88*(c>=1100?0:c<440?c/440:1-(c-440)/660);if(o=(o+p)%360,c>=750)s=r,d=18;else{let e=1-Math.pow(1-c/750,3);s=i+(r-i)*e,d=n.lat+(18-n.lat)*e}try{n$.current.jumpTo({center:[o,d],zoom:s})}catch(e){}t_.current=requestAnimationFrame(l)};t_.current=requestAnimationFrame(l)},90);return()=>{e=!0,clearTimeout(t),t_.current&&(cancelAnimationFrame(t_.current),clearTimeout(t_.current),t_.current=null);try{n$.current?.resize()}catch(e){}}},[tv]),(0,i.useEffect)(()=>{rB.length>0&&tX.length>0&&rB.forEach((e,t)=>{let r=e.getElement();t===t1?(r.style.border="3px solid #FFFFFF",r.style.width="36px",r.style.height="36px",r.style.zIndex="10"):(r.style.border="2px s
280olid #FFFFFF",r.style.width="30px",r.style.height="30px",r.style.zIndex="1")})},[t1,rB,tX]),(0,i.useCallback)(async()=>{if((0,h.u4)("city_search_cta_click"),iF){(0,h.u4)("upgrade_modal_open",{reason:"city_search_locked",mode:"index",surface:"city_search"}),tA("out_of_searches"),tF(!0);return}let e=ta[ts];if(!e)return;if(!tP?.file||!rv)return void alert("Please re-upload the image to run a city search on this entry - the original file isn't available from history.");let t=function(e,t,r,n){if(!Array.isArray(e)||0===e.length)return null;let i=null,o=1/0,a=null,l=1/0,s=null,d=1/0;for(let c of e){let e=c.region_bbox,p=e&&Array.isArray(e)&&4===e.length;if(p&&r>=e[0]&&r<=e[2]&&t>=e[1]&&t<=e[3]&&en(r,t,c.region_polygon)){let e="number"==typeof c.lat&&"number"==typeof c.lng?er(t,r,c.lat,c.lng):0;e<o&&(o=e,i=c);continue}if(p){let i=n/111,o=n/(111*Math.max(.1,Math.cos(t*Math.PI/180)));if(r+o>=e[0]&&r-o<=e[2]&&t+i>=e[1]&&t-i<=e[3]&&"number"==typeof c.lat&&"number"==typeof c.lng){let e=er(t,r,c.lat,c.lng);e<l&&(l=e,a=c);continue}}if("number"==typeof c.lat&&"number"==typeof c.lng){let e=er(t,r,c.lat,c.lng);e<=n&&e<d&&(d=e,s=c)}}let c=i||a||s;if(!c)return null;let p=i?o:a?l:d,u=i?"polygon":a?"bbox_overlap":"centroid";return{...c,distance_km:p,match_type:u}}(tu,e.lat,e.lng,e.radius_km);if(!t)return void alert(`No indexed city within ${e.radius_km.toFixed(0)} km of this candidate.`);if(tZ.length>0){tQ({cityPath:t.path}),tJ(!0);return}e$("index"),rD(t.path),rC({cityPath:t.path}),rj({x:0,y:0,width:100,height:100}),ry("crop")},[ta,ts,tu,tZ.length,tP,rv,iF]);let i9=(0,i.useCallback)(async(t,r,n,i)=>{let o=i||tP?.file,a=i?.name||tP?.file?.name||"query.jpg";if(!o)return;if(iF){(0,h.u4)("upgrade_modal_open",{reason:"city_search_locked",mode:"index",surface:"city_search"}),tA("out_of_searches"),tF(!0);return}let s=Array.isArray(r.derived_indexes)&&r.derived_indexes.length>0?r.derived_indexes:ei(tu,r.lat,r.lng,r.radius_km,3);if(!s||0===s.length)return;let d=n?[n]:s.map(e=>e.city_path);e5(t),ty(!0);try{let t=await es(o,1024,.95),r=await eh(ed,t,a,d);if(r.failed||!r.success){let e=r.url?`${r.url}`:"";alert(`Multi-search failed (status ${r.status||"unknown"})${e}.`);return}let n=r.results||[];if(tn({globalSearchResult:eJ,globalCandidates:ta,expandedCardIdx:ts}),eK(null),t0(n),t2(0),na(!1),"outdoor"===eH&&K("split"),l(!1),u(!1),"function"==typeof x&&x(!1),e&&(r8("results"),r4(!0)),n$.current){try{rH.current.forEach(e=>e.remove()),rP([]);for(let e=0;e<5;e++){["global-search-circle","global-search-circle-outline"].forEach(t=>{let r=`${t}-${e}`;n$.current.getLayer(r)&&n$.current.removeLayer(r)});let t=`global-search-area-${e}`;n$.current.getSource(t)&&n$.current.removeSource(t)}["global-search-circle","global-search-circle-outline"].forEach(e=>{n$.current.getLayer(e)&&n$.current.removeLayer(e)}),n$.current.getSource("global-search-area")&&n$.current.removeSource("global-search-area"),n$.current.getLayer("evidence-layer")&&n$.current.removeLayer("evidence-layer"),n$.current.getSource("evidence-source")&&n$.current.removeSource("evidence-source"),tl([])}catch(e){}iP(n,tP?.preview)}let i=n[0];if(i&&n$.current&&n$.current.flyTo({center:[i.lng,i.lat],zoom:15}),i&&"outdoor"===eH)try{oh(i.lat,i.lng,{heading:of(i)})}catch(e){}let s="pk.eyJ1IjoianNraW45NSIsImEiOiJjbW41cGxldTAwY3BpMnBwb2M4NnZhbmR3In0.9Swra9OvLxeHIOk754NzeQ";s&&ej(n,s).then(e=>t0(e)).catch(()=>{})}finally{e5(null),ty(!1)}},[tP,tu,eJ,ta,ts,eH,nX,iF]),oe=(0,i.useCallback)((e,t,r=null)=>{if(!t)return;if(!tP?.file||!rv)return void alert("Please re-upload the image to run a search on this entry - the original file isn't available from history.");let n=Array.isArray(t.derived_indexes)&&t.derived_indexes.length>0?t.derived_indexes:ei(tu,t.lat,t.lng,t.radius_km,3);n&&0!==n.length&&(rI({idx:e,cand:t,pickedPath:r}),rj({x:0,y:0,width:100,height:100}),ry("crop"))},[tP,rv,tu]);(0,i.useEffect)(()=>{e8(null)},[ts]);let ot=(0,i.useCallback)(async e=>{if(!e||!tK)return;let t=tK.cityPath;tH({file:e.file,preview:e.preview,name:e.name}),tJ(!1),tQ(null),tp(!0),e$("index"),rD(t);try{await or({mode:"index",cityPath:t})}finally{tp(!1)}},[tK]),or=async(t={})=>
280{if(!nQ)return void n2();let r=t.imageFile||tP?.file;if(!tP&&!t.imageFile)return;if(!r)return void alert("Please re-upload the image to run a new search - the original file isn't available from this history entry.");let n=t.mode||eE,i=t.cityPath||rG;if("index"===n&&iF){(0,h.u4)("upgrade_modal_open",{reason:"city_search_locked",mode:"index",surface:"city_search"}),tA("out_of_searches"),tF(!0);return}if("global"===n&&iI(eB)){(0,h.u4)("upgrade_modal_open",{reason:"effort_locked",mode:"global",thinking_mode:eB,surface:"effort_submit"}),tA("pro_feature"),tF(!0);return}let o=void 0!==t.rerank?!!t.rerank:"index"===n&&rs&&iR,a=Math.max(1,Math.min(Number(t.k)||("index"===n&&rc?30:10),30)),s=Date.now();(0,h.u4)("inference_search_start",{mode:n,thinking_mode:"global"===n?eB:void 0,has_city:!!i,city_path:i||void 0,rerank:o,extras_count:"global"===n?Math.min(3,tZ.length):0}),rR(!1),rL(!1),rW(null),r$(null),t4(null),t8(!1);let d="global"===n;d&&tk(!0),d&&!e?(u(!1),x(!1),l(!1),(async()=>{let e="";try{tP?.file?e=await G(tP.file,240,.7):tP?.preview&&(e=tP.preview)}catch(e){}n7({localId:`pending-${Date.now()}`,createdAtClient:Date.now(),thinking_mode:eB,thumbnail:e,context:tx.trim(),eta_seconds:{instant:5,low:20,medium:30,high:60}[eB]||30})})()):d||ty(!0);try{let d=tG.current,c=d&&d.source===r?await d.blobPromise.catch(()=>null):null;c||(c=await es(r,1024,.95));let p=new FormData;if(p.append("image",c,r.name||"image.jpg"),"global"===n){let n;p.append("global","true"),p.append("thinking_mode",eB);let i=[tx.trim(),(t.contextOverride||"").trim()].filter(Boolean).join("\n");for(let e of(i&&p.append("context",i),tZ.slice(0,3))){if(!e.file)continue;let t=await es(e.file,1024,.95);p.append("image",t,e.file.name||"image.jpg")}let o=await ef(),a=await fetch(`${ed}/api/search`,{method:"POST",body:p,headers:o});if(402===a.status){let e=await a.json().catch(()=>({}));if(e?.error==="free_exhausted"||e?.error==="no_credits"||e?.error==="insufficient_balance"){(0,h.u4)("upgrade_modal_open",{reason:e.error,mode:"global",surface:"search_402_global"}),tA("out_of_searches"),tF(!0),ty(!1);return}}if(429===a.status){let e=await a.json().catch(()=>({})),t=e?.retry_after_ms||(e?.retry_after?1e3*e.retry_after:5e3);tE(nX?`Rate limited - try again in ${Math.ceil(t/1e3)}s.`:`Free server is busy - try again in ${Math.ceil(t/1e3)}s. Upgrade for instant search.`),setTimeout(()=>tE(null),t+500),(0,h.u4)("rate_limited",{retry_after_ms:t,mode:"global"}),ty(!1);return}if(!a.ok){let e=await a.json().catch(()=>({}));throw A(e,a.status)}if((a.headers.get("content-type")||"").includes("ndjson")){let e=a.body.getReader(),t=new TextDecoder,r="",i=null,o=null;for(;;){let{value:n,done:a}=await e.read();if(a)break;let s=(r+=t.decode(n,{stream:!0})).split("\n");for(let e of(r=s.pop(),s)){let t,r=e.trim();if(r){try{t=JSON.parse(r)}catch{continue}if("final"===t.event)i=t.data;else if("error"===t.event)o=t;else if("partial"===t.event&&t.data&&t.data.success&&t.data.location){let e=t.data,r=Array.isArray(e.candidates)&&e.candidates.length>0?e.candidates:[e.location];eK(e.location),ns(e.related_images||null),nu(!1),t0([]),tl(r),td(0),na(!0),l(!1),x(!1),B(!0),ev(!0),K("map"),rn(!0)}else if("heartbeat"===t.event){let e=Number(t.position)||0;n7(t=>t&&(t.queuePosition||0)!==e?{...t,queuePosition:e}:t)}}}}if(o)throw A(o,o.status||500);if(!i)throw Error("Stream ended without final payload");n=i}else n=await a.json();if(n.success&&n.location){{let e=Date.now()-s;(0,h.u4)("inference_search_success",{mode:"global",thinking_mode:eB,latency_ms:e,latency_bucket:(0,h.AZ)(Math.round(e/1e3)),num_candidates:Array.isArray(n.candidates)?n.candidates.length:1})}eK(n.location),ns(n.related_images||null),nu(!1),t0([]),na(!0),l(!1),x(!1),B(!0),ev(!0),K("map"),e&&(r4(!0),r8("results"));let t=Array.isArray(n.candidates)&&n.candidates.length>0?n.candidates:[n.location];tl(t),td(0),rn(!1);let i=n.run_id;i&&r$(i),n5&&i&&r&&U(n5,i,r,tZ.map(e=>e.file).filter(Boolean)).then(e=>e&&O(n5,i,e)).catch(e=>console.warn("[history] image upload failed",e)),n$.current&&rH.current.forEach(e=>e.remove())}else alert(n.error||"Failed to analyze location. Please try again.")}else{if(!i){rV(e=>e+1),ty(!1);return}p.append("city_path",i),p.append("k",String(a)),o&&p.append("rerank","true");let t=await ef(),n=await fetch(`${ed}/api/search`,{method:"POST",body:p,headers:t});if(403===n.status){let e=await n.json().catch(()=>({}));if(e?.reason==="paid_required"){(0,h.u4)("upgrade_modal_open",{reason:"rerank_locked",mode:"city",surface:"search_403_city"}),tT(null),tA("pro_feature"),tF(!0),ty(!1);return}if(e?.reason==="business_required"){os(e.feature||"multi_index_batch","search_403_city"),ty(!1);return}}if(402===n.status){let e=await n.json().catch(()=>({}));if(e?.error==="free_exhausted"||e?.error==="no_credits"||e?.error==="insufficient_balance"){(0,h.u4)("upgrade_modal_open",{reason:e.error,mode:"city",surface:"search_402_city"}),tA("out_of_searches"),tF(!0),ty(!1);return}}if(429===n.status){let e=await n.json().catch(()=>({})),t=e?.retry_after_ms||(e?.retry_after?1e3*e.retry_after:5e3);tE(nX?`Rate limited - try again in ${Math.ceil(t/1e3)}s.`:`Free server is busy - try again in ${Math.ceil(t/1e3)}s. Upgrade for instant search.`),setTimeout(()=>tE(null),t+500),(0,h.u4)("rate_limited",{retry_after_ms:t,mode:"city"}),ty(!1);return}if(!n.ok){let e=await n.json().catch(()=>({}));throw A(e,n.status)}let d=await n.json();if(d.success&&d.results&&d.results.length>0){{let e=Date.now()-s;(0,h.u4)("inference_search_success",{mode:"index",city_path:i,rerank:o,latency_ms:e,latency_bucket:(0,h.AZ)(Math.round(e/1e3)),num_results:d.results.length})}if(eK(null),ns(null),t0(d.results),t2(0),na(!0),t9(!0===d.rerank_enabled),ro((d.k||10)>=30),ej(d.results,"pk.eyJ1IjoianNraW45NSIsImEiOiJjbW41cGxldTAwY3BpMnBwb2M4NnZhbmR3In0.9Swra9OvLxeHIOk754NzeQ").then(e=>{t0(e);let t=e[0];t&&r&&iB("index",r,{lat:t.lat,lng:t.lng,rank:t.rank??1,address:t.address||null,city_path:i||null,results:e.slice(0,30).map((e,t)=>({lat:e.lat,lng:e.lng,rank:e.rank??t+1,address:e.address||null,image_path:e.image_path||null}))}).then(e=>{e&&r$(e)})}),l(!1),u(!1),x(!1),na(!1),B(!0),ev(!0),K("indoor"===eH?"map":"split"),e&&(r8("results"),r4(!0)),n$.current&&tP){rH.current.forEach(e
280=>e.remove()),rP([]);for(let e=0;e<5;e++){["global-search-circle","global-search-circle-outline"].forEach(t=>{let r=`${t}-${e}`;n$.current.getLayer(r)&&n$.current.removeLayer(r)});let t=`global-search-area-${e}`;n$.current.getSource(t)&&n$.current.removeSource(t)}n$.current.getLayer("global-search-circle")&&n$.current.removeLayer("global-search-circle"),n$.current.getLayer("global-search-circle-outline")&&n$.current.removeLayer("global-search-circle-outline"),n$.current.getSource("global-search-area")&&n$.current.removeSource("global-search-area"),n$.current.getLayer("evidence-layer")&&n$.current.removeLayer("evidence-layer"),n$.current.getSource("evidence-source")&&n$.current.removeSource("evidence-source"),tl([]),iP(d.results,tP?.preview),n$.current.flyTo({center:[d.results[0].lng,d.results[0].lat],zoom:15})}}else alert("No results found. Please try a different image or check your index path.")}}catch(r){console.error("Error analyzing location:",r);let e=r.message||"",t=P(r);{let r=Date.now()-s;rn(!1),(0,h.u4)("inference_search_error",{mode:n,city_path:i||void 0,rerank:o,latency_ms:r,reason:/Rate limited/i.test(e)?"rate_limited":/subscription|Subscribe/i.test(e)?"no_subscription":/too large|413/i.test(e)?"file_too_large":"content_blocked"===t.code?"blocked_content":"internal"===t.code?t.reference?"pipeline":"unknown":t.code,error_code:t.code,category:t.category||void 0,tier:t.tier||void 0,refunded:null==t.refunded?void 0:t.refunded,message:e.slice(0,80)||void 0})}e.includes("Rate limited")||e.includes("subscription")||e.includes("Subscribe")?alert(e):(t4({message:e||"Search failed.",reference:t.reference||null,code:t.code,category:t.category,tone:t.tone,title:t.title,body:t.body,refundLine:t.refundLine,timestamp:new Date().toISOString()}),t8(!0),eK(null),ns(null),t0([]),B(!0),na(!0),l(!1),x(!1))}finally{ty(!1),tk(!1),n7(null)}},on=async()=>{if(((0,h.u4)("rerank_click",{city_path:rZ||void 0}),rZ)&&!t7&&!re&&!tb){if(!iR){(0,h.u4)("upgrade_modal_open",{reason:"rerank_locked",mode:"index",surface:"city_results"}),tT(null),tA("pro_feature"),tF(!0);return}if(!tP?.file)return void alert("Please re-upload the image to run rerank - the original file isn't available from this history entry.");rt(!0);try{await or({mode:"index",cityPath:rZ,rerank:!0,k:ri?30:10})}finally{rt(!1)}}},oi=(0,i.useCallback)((e,{fly:t})=>{if(!e||0===e.length)return;if(eK(null),ns(null),t0(e),t&&t2(0),n$.current){try{rH.current.forEach(e=>e.remove())}catch(e){}rP([]),iP(e,tP?.preview)}let r=e[0];if(t&&r&&(n$.current&&n$.current.flyTo({center:[r.lng,r.lat],zoom:15}),"outdoor"===eH))try{oh(r.lat,r.lng,{heading:of(r)})}catch(e){}},[tP,eH]),oo=(0,i.useCallback)(async(t={})=>{if(!nQ)return void n2();let r=t.cityPaths||rK;if(!r||0===r.length)return void r5(e=>e+1);if(!n3)return void os("multi_index_batch","multi_city");let n=t.imageFile||tP?.file;if(!n)return void alert("Please re-upload the image to run a batch search - the original file isn't available from this history entry.");r1.current&&(r1.current.cancelled=!0);let i={cancelled:!1};r1.current=i;let o=Date.now();(0,h.u4)("multi_batch_start",{city_count:r.length}),t4(null),t8(!1),rR(!1),rL(!1),rW(null),r$(null),t9(!1),ro(!1),rD(""),ty(!0),r0(null);try{let t=await es(n,1024,.95),a=await em(ed,t,n.name,r,10);if(a.failed){if(403===a.status&&"business_required"===a.reason)return void os("multi_index_batch","multi_city_403");if(402===a.status){(0,h.u4)("upgrade_modal_open",{reason:a.reason||"no_credits",mode:"index",surface:"multi_city_402"}),tA("out_of_searches"),tF(!0);return}t4({message:a.message,reference:null,timestamp:Date.now()});return}let s=a.job;r0(s),na(!0),l(!1),u(!1),"function"==typeof x&&x(!1),"outdoor"===eH&&K("split"),e&&(r8("results"),r4(!0));let d=o+6e5,c=!1,p="";for(;!i.cancelled&&Date.now()<d;){if(await new Promise(e=>setTimeout(e,1500)),i.cancelled)return;let e=await eb(ed,s.job_id);if(i.cancelled)return;if(e.failed)return void t4({message:e.message,reference:null,timestamp:Date.now()});if(s=e.job,r0(s),s.results&&s.results.length>0){let e=s.results.map(e=>e.panoid||`${e.lat},${e.lng}`).join("|");e!==p&&(p=e,oi(s.results,{fly:!c}),c=!0)}if("queued"!==s.status&&"running"!==s.status)break}if(i.cancelled)return;if("queued"===s.status||"running"===s.status)return void t4({message:"This batch search is taking unusually long. It may still be running on the server - try again in a few minutes.",reference:s.request_id||null,timestamp:Date.now()});let g=s.results||[];if("error"===s.status||0===g.length){(0,h.u4)("multi_batch_error",{city_count:r.length,status:s.status}),t4({message:s.error||"No matches were found in any of the selected city indexes.",reference:s.request_id||null,timestamp:Date.now()});return}(0,h.u4)("multi_batch_success",{city_count:r.length,cities_ok:(s.cities||[]).filter(e=>"ok"===e.status).length,num_results:g.length,latency_ms:Date.now()-o,latency_bucket:(0,h.AZ)(Math.round((Date.now()-o)/1e3))}),ej(g,"pk.eyJ1IjoianNraW45NSIsImEiOiJjbW41cGxldTAwY3BpMnBwb2M4NnZhbmR3In0.9Swra9OvLxeHIOk754NzeQ").then(e=>{if(i.cancelled)return;t0(e);let t=e[0];t&&n&&iB("index",n,{lat:t.lat,lng:t.lng,rank:t.rank??1,address:t.address||null,city_paths:r,results:e.slice(0,30).map((e,t)=>({lat:e.lat,lng:e.lng,rank:e.rank??t+1,address:e.address||null,image_path:e.image_path||null}))}).catch(()=>{})}).catch(()=>{})}catch(e){t4({message:e?.message||"Batch search failed.",reference:null,timestamp:Date.now()})}finally{r1.current===i&&(r1.current=null,ty(!1))}},[nQ,rK,n3,tP,eH,e,oi]);(0,i.useEffect)(()=>()=>{r1.current&&(r1.current.cancelled=!0)},[]),(0,i.useEffect)(()=>{!n3&&rY&&(rJ(!1),!rG&&rK.length>0&&rD(rK[0]))},[n3,rY]);let oa=(0,i.useCallback)(async()=>{r1.current&&(r1.current.cancelled=!0),r1.current=null,ty(!1),rX?.job_id&&((0,h.u4)("multi_batch_cancel",{job_id:r
280X.job_id}),await ey(ed,rX.job_id),r0({...rX,status:"cancelled"}))},[rX]),ol=(0,i.useCallback)(async()=>{if(((0,h.u4)("show_more_click",{city_path:rZ||void 0}),rZ)&&!ri&&!ra&&!tb){if(!tP?.file)return void alert("Please re-upload the image to load more results - the original file isn't available from this history entry.");rl(!0);try{await or({mode:"index",cityPath:rZ,k:30,rerank:t7})}finally{rl(!1)}}},[rZ,ri,ra,tb,tP,t7]),os=(e,t)=>{(0,h.u4)("upgrade_modal_open",{reason:`${e}_locked`,mode:"index",surface:t}),tT(e),tA("business_feature"),tF(!0)},od=()=>"index"===eE&&rY?oo():or(),oc=()=>{rY?(rJ(!1),!rG&&rK.length>0&&rD(rK[0])):(rJ(!0),rG&&!rK.includes(rG)&&rQ([rG,...rK].slice(0,10))),(0,h.u4)("multi_city_toggle",{enabled:!rY})},op=(0,i.useMemo)(()=>{if(!rX?.cities)return null;let e={};for(let t of rX.cities)e[t.city_path]=t.status;return e},[rX]),ou=({marginTop:e=10}={})=>(0,n.jsxs)("div",{style:{marginTop:e,padding:"10px 12px",background:"var(--surface)",borderRadius:12,display:"flex",flexDirection:"column",gap:8},children:[(0,n.jsx)(S,{label:"Rerank images",hint:iR?"Slower, more accurate":"Paid plans and credits",checked:rs&&iR,disabled:!iR,onChange:rd}),(0,n.jsx)(S,{label:"Show more results",hint:"Top 30 instead of 10",checked:rc,onChange:rp})]}),og=({marginBottom:e,hint:t=!1})=>{let r=!!rX&&("queued"===rX.status||"running"===rX.status);return(0,n.jsxs)("div",{style:{marginBottom:e},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginBottom:"8px"},children:[(0,n.jsx)("label",{style:{color:"var(--fg-muted)",fontSize:"11px",fontWeight:600,textTransform:"uppercase"},children:rY?"Cities":"City"}),n3&&(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[rY&&rK.length>0&&!r&&(0,n.jsx)("button",{type:"button",onClick:()=>rQ([]),style:{background:"transparent",border:"none",padding:0,color:"var(--fg-muted)",fontSize:"14px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',textDecoration:"underline",cursor:"pointer"},children:"Clear all"}),(0,n.jsx)("button",{type:"button",onClick:oc,disabled:r,style:{background:"transparent",border:"none",padding:0,color:"var(--fg)",fontSize:"15px",fontWeight:600,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',textDecoration:"underline",textUnderlineOffset:"3px",cursor:r?"not-allowed":"pointer",opacity:r?.5:1},children:rY?"Single city":"Multi city (up to 10)"})]})]}),rY?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(j,{values:rK,onChange:e=>{rQ(e);let t=e[e.length-1];n5&&t&&!rK.includes(t)&&V(n5,t)},disabled:r,max:10,recentCities:rN,shakeNonce:r2,cityStatus:op}),rX&&(0,n.jsx)("div",{style:{marginTop:8,fontSize:"11.5px",color:"var(--fg-muted)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:r?(0,n.jsxs)("span",{children:["Searching ",rX.progress?.done??0," of ",rX.progress?.total??rK.length," citiesâ¦"," ",(0,n.jsx)("button",{type:"button",onClick:oa,style:{background:"transparent",border:"none",padding:0,color:"var(--fg)",fontSize:"11.5px",fontFamily:"inherit",textDecoration:"underline",cursor:"pointer"},children:"Stop"})]}):(0,n.jsxs)("span",{children:["cancelled"===rX.status?"Batch stopped. ":"","Searched ",(rX.cities||[]).filter(e=>"ok"===e.status).length," of ",rX.progress?.total??rK.length," cities."]})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(k,{value:rG,onChange:e=>{rD(e),n5&&V(n5,e)},shakeNonce:rU,recentCities:rN}),t&&(0,n.jsx)("div",{style:{color:"#606060",fontSize:"11px",marginTop:"4px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"Type to search for a city."})]})]})},of=e=>{if(!e)return null;for(let t of["best_yaw","yaw","heading"]){let r=e[t],n="number"==typeof r?r:"string"==typeof r&&""!==r.trim()?Number(r):NaN;if(Number.isFinite(n))return(n%360+360)%360}return null},oh=(e,t,r={})=>{if(!nA.current)return;let n={heading:Number.isFinite(r.heading)?r.heading:0,pitch:0};(nW.current||(nW.current=new Promise((e,t)=>{if(window.google&&window.google.maps&&window.google.maps.StreetViewPanorama)return void e(window.google.maps);let r=document.querySelector('script[data-gmaps-loader="1"]');if(r){r.addEventListener("load",()=>e(window.google.maps)),r.addEventListener("error",t);return}let n=document.createElement("script");
280n.src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDi7Q9Awy-uO2jpnkv0XlmOuOKZQ8pPQ8M&v=weekly",n.async=!0,n.defer=!0,n.dataset.gmapsLoader="1",n.onload=()=>e(window.google.maps),n.onerror=t,document.head.appendChild(n)})),nW.current).then(i=>{let o=nA.current;if(!o)return;let a=nL.current&&nT.current&&nT.current!==o;if((r.recreate||a)&&nL.current&&(nL.current=null),nL.current){nL.current.setPosition({lat:e,lng:t}),nL.current.setPov(n);try{nL.current.setZoom(0)}catch(e){}if(i.event)try{i.event.trigger(nL.current,"resize")}catch(e){}}else{try{for(;o.firstChild;)o.removeChild(o.firstChild)}catch(e){}nL.current=new i.StreetViewPanorama(o,{position:{lat:e,lng:t},pov:n,zoom:0,addressControl:!1,fullscreenControl:!1,motionTracking:!1,motionTrackingControl:!1,panControl:!1,zoomControl:!1,linksControl:!1,enableCloseButton:!1,showRoadLabels:!1,clickToGo:!0,disableDefaultUI:!0}),nT.current=o}}).catch(r=>{console.error("Google Maps failed to load, falling back to embed:",r),nA.current&&((e,t,r,n=null)=>{for(;e.firstChild;)e.removeChild(e.firstChild);let i=document.createElement("iframe");i.width="100%",i.height="100%",i.style.border="0",i.loading="lazy",i.allow="gyroscope; accelerometer; pointer-lock",i.allowFullscreen=!0,i.referrerPolicy="no-referrer-when-downgrade";let o=Number.isFinite(n)?Math.round(n):0;i.src=`https://www.google.com/maps/embed/v1/streetview?key=${encodeURIComponent("AIzaSyDi7Q9Awy-uO2jpnkv0XlmOuOKZQ8pPQ8M")}&location=${t},${r}&heading=${o}&pitch=0&fov=100`,e.appendChild(i)})(nA.current,e,t,n.heading)})},ox=e=>{let t=t1;if("prev"===e&&t1>0?t--:"next"===e&&t1<tX.length-1&&t++,t!==t1){t2(t);let e=tX[t];n$.current&&n$.current.flyTo({center:[e.lng,e.lat],zoom:15}),"outdoor"===eH&&oh(e.lat,e.lng,{heading:of(e)})}},om=(e,t)=>(0,n.jsxs)("button",{disabled:null!==rT,onClick:()=>{rT||(rW(e),n5&&rE&&O(n5,rE,{rating:e.toLowerCase(),ratedAt:Date.now()}).catch(e=>console.warn("[history] rating persist failed",e)),setTimeout(()=>{rW(null),rR(!0)},300),setTimeout(()=>rL(!0),1e3))},style:{flex:1,padding:"11px 0",background:"transparent",border:`1px solid ${t}40`,borderRadius:"999px",color:t,fontSize:"14.3px",fontWeight:600,letterSpacing:"0.3px",cursor:rT?"wait":"pointer",transition:"all 0.2s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',opacity:rT&&rT!==e?.4:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},onMouseEnter:e=>{rT||(e.currentTarget.style.background=`${t}14`,e.currentTarget.style.borderColor=`${t}80`)},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.borderColor=`${t}40`},children:[rT===e&&(0,n.jsx)(w.A,{size:39,color:t,rate:.7,style:{marginRight:2}}),e]}),ob=e&&!!t5&&!eJ&&"outdoor"===eH&&"split"===H;return(0,n.jsxs)("div",{style:{backgroundColor:"#000000",height:"100vh",width:"100%",overflow:"hidden",position:"relative",fontFamily:'Outfit", sans-serif'},children:[(0,n.jsx)("style",{children:` 281 @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } 282 @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } 283 @keyframes folderInputShake { 284 0%, 100% { transform: translateX(0); } 285 15% { transform: translateX(-6px); } 286 30% { transform: translateX(6px); } 287 45% { transform: translateX(-5px); } 288 60% { transform: translateX(5px); } 289 75% { transform: translateX(-3px); } 290 90% { transform: translateX(3px); } 291 } 292 .folder-input-error::placeholder { color: #8b1a1a !important; opacity: 1; } 293 .folder-input-error::-webkit-input-placeholder { color: #8b1a1a !important; } 294 .folder-input-error::-moz-placeholder { color: #8b1a1a !important; opacity: 1; } 295 `}),(0,n.jsx)("input",{ref:nB,type:"file",accept:"image/*,.heic,.heif",multiple:!0,onChange:i2,style:{display:"none"}}),!e&&(()=>{let e=o||d||g,t=e=>{l("search"===e&&!o),u("history"===e&&!d),x("folder"===e&&!g)};return(0,n.jsxs)("div",{style:{position:"fixed",left:0,top:0,width:e?"442px":"60px",height:"100vh",background:"hsl(0 0% 0% / 0.55)",backdropFilter:"blur(20px) brightness(1.05)",WebkitBackdropFilter:"blur(20px) brightness(1.05)",borderRadius:"0 18px 18px 0",border:"1px solid var(--surface-strong)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.4), 0 0 2px 1px var(--surface) inset",zIndex:tw?1670:1e3,display:"flex",flexDirection:"row",overflow:"hidden",transition:"width 0.35s cubic-bezier(0.32, 0.72, 0, 1)"},children:[(0,n.jsxs)("div",{style:{width:"60px",flexShrink:0,display:"flex",flexDirection:"column",background:"transparent"},children:[(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"16px 0",cursor:"pointer"},onClick:()=>window.location.href="/",children:(0,n.jsx)("img",{src:"/images/logo.png",alt:"GeoAxis Logo",style:{width:"28px",height:"28px",flexShrink:0,filter:"none"}})}),(0,n.jsxs)("div",{style:{flex:1,padding:"4px 0",display:"flex",flexDirection:"column",gap:"4px"},children:[(0,n.jsx)(e_,{title:"Search",lottie:"/lottie/search-regular.json",active:o,onClick:()=>t("search")}),(0,n.jsx)(e_,{title:"History",lottie:"/lottie/clock-regular.json",active:d,onClick:()=>t("history")}),(0,n.jsx)(e_,{title:"Folders",lottie:"/lottie/folder-regular.json",active:g,onClick:()=>t("folder")})]}),(0,n.jsx)("div",{style:{padding:"12px 0",display:"flex",justifyContent:"center"},children:(0,n.jsx)(f,{})})]}),(0,n.jsx)("div",{style:{flex:1,position:"relative"}}
295)]})})(),!e&&eJ&&tP&&(()=>{let e='var(--font-instrument-serif), "Instrument Serif", Georgia, serif',t={color:"var(--fg)",fontSize:"12.1px",fontWeight:600,textTransform:"uppercase",letterSpacing:"1.4px",marginBottom:"10px"},r=(0,n.jsx)("div",{style:{height:"1px",background:"var(--surface-strong)",margin:"22px 0"}}),i={flex:1,padding:"7px 12px",background:"var(--fg)",border:"none",borderRadius:"999px",color:"#000000",fontSize:"12.1px",fontWeight:600,cursor:"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"background 0.2s ease",whiteSpace:"nowrap"},o=(e,t)=>(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"row",gap:"6px"},children:[(0,n.jsxs)("button",{onClick:()=>window.open(`https://www.google.com/maps/search/?api=1&query=${e},${t}`,"_blank","noopener,noreferrer"),style:i,onMouseEnter:e=>e.currentTarget.style.background="#ececec",onMouseLeave:e=>e.currentTarget.style.background="var(--fg)",children:[(0,n.jsx)("span",{children:"Google Maps"}),(0,n.jsxs)("svg",{width:"10",height:"14",viewBox:"0 0 92.3 132.3",style:{flexShrink:0},children:[(0,n.jsx)("path",{fill:"#1a73e8",d:"M60.2 2.2C55.8.8 51 0 46.1 0 32 0 19.3 6.4 10.8 16.5l21.8 18.3L60.2 2.2z"}),(0,n.jsx)("path",{fill:"#ea4335",d:"M10.8 16.5C4.1 24.5 0 34.9 0 46.1c0 8.7 1.7 15.7 4.6 22l28-33.3-21.8-18.3z"}),(0,n.jsx)("path",{fill:"#4285f4",d:"M46.2 28.5c9.8 0 17.7 7.9 17.7 17.7 0 4.3-1.6 8.3-4.2 11.4 0 0 13.9-16.6 27.5-32.7-5.6-10.8-15.3-19-27-22.7L32.6 34.8c3.3-3.8 8.1-6.3 13.6-6.3"}),(0,n.jsx)("path",{fill:"#fbbc04",d:"M46.2 63.8c-9.8 0-17.7-7.9-17.7-17.7 0-4.3 1.5-8.3 4.1-11.3l-28 33.3c4.8 10.6 12.8 19.2 21 29.9l34.1-40.5c-3.3 3.9-8.1 6.3-13.5 6.3"}),(0,n.jsx)("path",{fill:"#34a853",d:"M59.1 109.2c15.4-24.1 33.3-35 33.3-63 0-7.7-1.9-14.9-5.2-21.3L25.6 98c2.6 3.4 5.3 7.3 7.9 11.3 9.4 14.5 6.8 23.1 12.8 23.1s3.4-8.7 12.8-23.2"})]})]}),(0,n.jsxs)("button",{onClick:()=>window.open(`https://maps.apple.com/?ll=${e},${t}&q=${e},${t}`,"_blank","noopener,noreferrer"),style:i,onMouseEnter:e=>e.currentTarget.style.background="#ececec",onMouseLeave:e=>e.currentTarget.style.background="var(--fg)",children:[(0,n.jsx)("span",{children:"Apple Maps"}),(0,n.jsx)("svg",{width:"11",height:"13",viewBox:"0 0 814 1000",style:{flexShrink:0},children:(0,n.jsx)("path",{fill:"#000000",d:"M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z"})})]})]});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>na(e=>!e),"aria-label":no?"Collapse results":"Expand results",style:{position:"fixed",right:no?"392px":"12px",top:"50%",transform:"translateY(-50%)",width:"36px",height:"36px",borderRadius:"50%",background:"var(--fg)",border:"none",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1002,transition:"right 0.35s cubic-bezier(0.32, 0.72, 0, 1)"},children:no?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"9 18 15 12 9 6"})}):(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"15 18 9 12 15 6"})})}),(0,n.jsxs)("div",{style:{position:"fixed",right:0,top:0,width:"380px",height:"100vh",background:"hsl(0 0% 0% / 0.65)",backdropFilter:"blur(20px) brightness(1.05)",WebkitBackdropFilter:"blur(20px) brightness(1.05)",borderRadius:"18px 0 0 18px",border:"1px solid var(--surface-strong)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.4), 0 0 2px 1px var(--surface) inset",zIndex:1001,transform:no?"translateX(0)":"translateX(100%)",transition:"transform 0.35s cubic-bezier(0.32, 0.72, 0, 1)",overflow:"hidden",display:"flex",flexDirection:"column"},children:[tP&&(0,n.jsx)("div",{style:{padding:"22px 22px 0 22px",flexShrink:1,minHeight:0},children:(()=>{let e=eO.width||0,t=eO.height||0,r=e>0&&t>0&&e/t>1.05;return(0,n.jsxs)("div",{onClick:()=>{rM(1),ry("expand")},title:"View full size",style:{position:"relative",borderRadius:"10px",overflow:"hidden",cursor:"zoom-in",border:"1px solid var(--surface-strong)",display:"flex",justifyContent:"center",maxHeight:"min(280px, 32vh)",height:r?"auto":"min(220px, 28vh)",background:"rgba(0,0,0,0.4)"},children:[(0,n.jsx)("img",{src:tP.preview||tP,alt:"Query",onLoad:e=>
295eU({width:e.target.naturalWidth,height:e.target.naturalHeight}),style:{width:"100%",height:"100%",maxHeight:"min(280px, 32vh)",objectFit:r?"contain":"cover",display:"block"}}),(0,n.jsx)("div",{style:{position:"absolute",top:"10px",left:"10px",padding:"4px 11px",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",borderRadius:"5px",color:"var(--fg)",fontSize:"13.2px",fontWeight:600,letterSpacing:"0.3px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"Query"})]})})()}),(0,n.jsxs)("div",{className:"no-scrollbar","data-lenis-prevent":"true",style:{flex:1,overflowY:"auto",padding:"22px"},children:[t3&&!eJ&&(!tX||0===tX.length)&&(()=>{let e="warning"===t3.tone,t=e?"#f5b82e":"#e74c3c",r=e?"rgba(245, 184, 46, 0.10)":"rgba(231, 76, 60, 0.10)",i=e?"rgba(245, 184, 46, 0.18)":"rgba(231, 76, 60, 0.18)";return(0,n.jsxs)("button",{type:"button",onClick:()=>t8(!0),style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px",padding:"16px 18px",marginBottom:"16px",borderRadius:"14px",backgroundColor:r,border:"none",outline:"none",color:"var(--fg)",cursor:"pointer",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.18s ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=i},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=r},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",width:"100%"},children:[(0,n.jsx)(z,{size:26,color:t}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)("div",{style:{color:t,fontSize:"15px",fontWeight:600},children:t3.title||"Search failed"}),(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"12.5px",marginTop:"2px"},children:"Tap for details"})]})]}),t3.reference&&(0,n.jsxs)("div",{style:{fontSize:"11.5px",color:"var(--fg-muted)",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",letterSpacing:"0.5px"},children:["ref: ",t3.reference]})]})})(),eJ&&(0,n.jsxs)("div",{children:["multi"===eQ&&e0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("button",{type:"button",onClick:()=>{eX("global"),e1(null),e4(0)},style:{marginBottom:14,padding:"6px 0",background:"transparent",border:"none",color:"var(--fg-muted)",cursor:"pointer",fontSize:13,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"â Back to global results"}),(()=>{let e=e0.results||[];if(0===e.length)return(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:14,padding:"12px 0"},children:"No results from the searched indexes."});let r=Math.min(Math.max(0,e3),e.length-1),i=e[r];return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{style:{marginBottom:10,fontSize:12.5,color:"var(--fg-muted)"},children:["Result ",r+1," of ",e.length]}),(0,n.jsxs)("div",{style:{marginBottom:12},children:[(0,n.jsx)("div",{style:t,children:"Coordinates"}),(0,n.jsxs)("div",{style:{marginTop:4,fontSize:18,fontWeight:600,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:[et(i.lat,"lat")," \xb7 ",et(i.lng,"lng")]})]}),o(i.lat,i.lng),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:14},children:[(0,n.jsx)("button",{type:"button",onClick:()=>e4(e=>Math.max(0,e-1)),disabled:0===r,"aria-label":"Previous result",style:{width:38,height:38,background:"transparent",border:"1px solid var(--border)",borderRadius:"50%",color:"var(--fg)",cursor:0===r?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:17.6,opacity:0===r?.25:1},children:"â"}),(0,n.jsxs)("div",{style:{flex:1,textAlign:"center",color:"var(--fg)",fontSize:16},children:[r+1," ",(0,n.jsx)("span",{style:{opacity:.5},children:"/"})," ",e.length]}),(0,n.jsx)("button",{type:"button",onClick:()=>e4(t=>Math.min(e.length-1,t+1)),disabled:r===e.length-1,"aria-label":"Next result",style:{width:38,height:38,background:"transparent",border:"1px solid var(--border)",borderRadius:"50%",color:"var(--fg)",cursor:r===e.length-1?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:17.6,opacity:r===e.length-1?.25:1},children:"â"})]}),e0.partial&&(0,n.jsxs)("div",{style:{marginTop:10,fontSize:12,color:"var(--fg-muted)"},children:[(e0.errors||[]).length," index",1===(e0.errors||[]).length?"":"es"," unavailable"]})]})})()]}),"global"===eQ&&(0,n.jsxs)(n.Fragment,{children:["metadata"===eJ.source&&(0,n.jsxs)("div",{style:{marginBottom:"12px"},children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"12.1px",fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase",marginBottom:"6px"},children:"Location fetched from Metadata"}),(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"13.2px",marginBottom:"10px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"Did you want to use AI?"}),(0,n.jsx)("button",{onClick:i0,style:{width:"100%",padding:"11px 0",background:"var(--fg)",border:"none",borderRadius:"999px",color:"#000000",fontSize:"14.3px",fontWeight:700,letterSpacing:"0.3px",cursor:"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',transition:"background 0.15s ease, color 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.background="#ececec"},onMouseLeave:e=>{e.currentTarget.style.background="var(--fg)"},children:"Use AI Instead"})]}),(0,n.jsxs)("div",{style:{color:"var(--fg-muted)",fontSize:12.1,fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase",marginBottom:10},children:[ta.length," ",1===ta.length?"Result":"Results"]}),(0,n.jsx)("div",{className:"global-cards-scroller","data-lenis-prevent":"true",style:{maxHeight:"calc(100vh - 320px)",overflowY:"auto",overflowX:"hidden",paddingRight:4,marginRight:-4},children:ta.map((t,r)=>{let i=iW[r]||[],o=i.length,a=ts===r,l=e2===r,s=0===o,d=s||l,c=(t.confidence??0)>=.7?"#7ED957":(t.confidence??0)>=.4?"#f5a623":"#e74c3c",p=a?{pad:14,loc:17,country:13,lbl:11,val:17,coords:14,copy:16,mapW:16,mapH:20,gap:24,gapCol:10}:{pad:9,loc:14,country:11,lbl:9,val:13,coords:11,copy:13,mapW:13,mapH:16,gap:18,gapCol:7};return(0,n.jsxs)("div",{onMouseEnter:()=>td(r),onClick:()=>td(r),style:{backgroundColor:a?"var(--surface-strong)":"var(--surface)",borderRadius:10,padding:p.pad,marginBottom:10,cursor:"pointer",border:"1px solid transparent",transition:"background-color 0.15s ease",position:"relative",zIndex:e6===r?30:"auto",contain:e6===r?"none":"layout style"},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:p.loc,fontWeight:700,lineHeight:1.2,wordBreak:"break-word"},children:t.location_name}),(0,n.jsx)("div",{style:{marginTop:3,fontSize:p.country,color:"var(--fg-muted)"},children:t.country}),(0,n.jsxs)("div",{style:{marginTop:p.gapCol,display:"flex",gap:p.gap},children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:p.lbl,fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase"},children:"Confidence"}),(0,n.jsxs)("div",{style:{color:c,fontSize:p.val,fontWeight:700,fontFamily:e,marginTop:1},children:[Math.round((t.confidence??0)*100),"%"]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:p.lbl,fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase"},children:"Radius"}),(0,n.jsxs)("div",{style:{color:"var(--fg)",fontSize:p.val,fontWeight:700,fontFamily:e,marginTop:1},children:["\xb1\xa0",t.radius_km<1?`${Math.round(1e3*t.radius_km)}
295 m`:`${t.radius_km.toFixed(1)} km`]})]})]}),(0,n.jsxs)("div",{style:{marginTop:p.gapCol,display:"flex",alignItems:"center",gap:8},children:[(0,n.jsxs)("span",{onClick:e=>{e.stopPropagation(),ni(t.lat,t.lng)},style:{color:"var(--fg)",fontSize:p.coords,fontFamily:e,cursor:"pointer",userSelect:"text",WebkitUserSelect:"text"},children:[et(t.lat,"lat")," \xb7 ",et(t.lng,"lng")]}),(0,n.jsx)(eg,{onClick:e=>{e.stopPropagation(),ni(t.lat,t.lng)},copied:ne,size:p.copy}),(0,n.jsx)("div",{style:{flex:1}}),(0,n.jsx)("button",{type:"button","aria-label":"Open in Google Maps",className:"card-map-icon",onClick:e=>{e.stopPropagation(),window.open(`https://www.google.com/maps/search/?api=1&query=${t.lat},${t.lng}`,"_blank","noopener,noreferrer")},style:{background:"transparent",border:"none",padding:4,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsxs)("svg",{width:p.mapW,height:p.mapH,viewBox:"0 0 92.3 132.3",children:[(0,n.jsx)("path",{fill:"#1a73e8",d:"M60.2 2.2C55.8.8 51 0 46.1 0 32 0 19.3 6.4 10.8 16.5l21.8 18.3L60.2 2.2z"}),(0,n.jsx)("path",{fill:"#ea4335",d:"M10.8 16.5C4.1 24.5 0 34.9 0 46.1c0 8.7 1.7 15.7 4.6 22l28-33.3-21.8-18.3z"}),(0,n.jsx)("path",{fill:"#4285f4",d:"M46.2 28.5c9.8 0 17.7 7.9 17.7 17.7 0 4.3-1.6 8.3-4.2 11.4 0 0 13.9-16.6 27.5-32.7-5.6-10.8-15.3-19-27-22.7L32.6 34.8c3.3-3.8 8.1-6.3 13.6-6.3"}),(0,n.jsx)("path",{fill:"#fbbc04",d:"M46.2 63.8c-9.8 0-17.7-7.9-17.7-17.7 0-4.3 1.5-8.3 4.1-11.3l-28 33.3c4.8 10.6 12.8 19.2 21 29.9l34.1-40.5c-3.3 3.9-8.1 6.3-13.5 6.3"}),(0,n.jsx)("path",{fill:"#34a853",d:"M59.1 109.2c15.4-24.1 33.3-35 33.3-63 0-7.7-1.9-14.9-5.2-21.3L25.6 98c2.6 3.4 5.3 7.3 7.9 11.3 9.4 14.5 6.8 23.1 12.8 23.1s3.4-8.7 12.8-23.2"})]})}),(0,n.jsx)("button",{type:"button","aria-label":"Open in Apple Maps",className:"card-map-icon",onClick:e=>{e.stopPropagation(),window.open(`https://maps.apple.com/?ll=${t.lat},${t.lng}&q=${t.lat},${t.lng}`,"_blank","noopener,noreferrer")},style:{background:"transparent",border:"none",padding:4,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:p.mapW,height:p.mapH,viewBox:"0 0 814 1000",children:(0,n.jsx)("path",{fill:"#ffffff",d:"M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z"})})})]}),(0,n.jsx)("div",{style:{maxHeight:a?"320px":"0",opacity:+!!a,overflow:"visible",transition:"max-height 0.28s ease, opacity 0.22s ease 0.05s",pointerEvents:a?"auto":"none"},children:(0,n.jsxs)("div",{style:{position:"relative",marginTop:12,display:"flex"},onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("button",{type:"button",onClick:()=>oe(r,t),disabled:d,style:{flex:1,padding:"9px 14px",background:d?"var(--surface)":"var(--fg)",color:d?"var(--fg-muted)":"#000000",border:"1px solid var(--border-strong)",borderRadius:s?"999px":"999px 0 0 999px",borderRight:s?void 0:"none",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:s?"11.5px":"12.5px",fontWeight:700,letterSpacing:"0.3px",cursor:d?"not-allowed":"pointer",transition:"background 0.15s ease, color 0.15s ease",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,textAlign:"center",lineHeight:1.25},children:(0,n.jsx)("span",{children:l?"Searching...":s?"No Search Available for This Area":"Search Area"})}),!s&&(0,n.jsx)("button",{type:"button",onClick:()=>e8(e=>e===r?null:r),disabled:d,"aria-label":"Pick a specific index","aria-expanded":e6===r,style:{width:36,padding:"9px 0",background:d?"var(--surface)":"var(--fg)",color:d?"var(--fg-muted)":"#000000",border:"1px solid var(--border-strong)",borderRadius:"0 999px 999px 0",cursor:d?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"background 0.15s ease"},children:(0,n.jsx)("svg",{width:"10",height:"6",viewBox:"0 0 10 6","aria-hidden":!0,style:{transform:e6===r?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}
295,children:(0,n.jsx)("path",{d:"M1 1l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),a&&e6===r&&i.length>0&&(()=>{let o=r>=ta.length-2&&ta.length>=3;return(0,n.jsx)("div",{onClick:e=>e.stopPropagation(),style:{position:"absolute",...o?{bottom:"calc(100% + 4px)"}:{top:"calc(100% + 4px)"},left:0,right:0,background:"#050505",border:"1px solid #1a1a1a",borderRadius:10,padding:6,zIndex:20,boxShadow:"0 14px 36px rgba(0,0,0,0.65)"},children:i.map((i,o)=>{let a=(i.region_name||i.city_path.split("/").pop()||i.city_path).replaceAll("_"," ");return(0,n.jsxs)("button",{type:"button",onClick:()=>{e8(null),oe(r,t,i.city_path)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"9px 10px",background:"transparent",border:"none",color:"var(--fg)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:12.5,fontWeight:600,letterSpacing:"0.2px",cursor:"pointer",borderRadius:6,textAlign:"left",transition:"background 0.12s ease"},onMouseEnter:e=>{e.currentTarget.style.background="var(--surface)"},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[(0,n.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),(0,n.jsxs)("span",{style:{fontSize:11,color:"var(--fg-muted)",fontFamily:e,marginLeft:8,flexShrink:0},children:[(i.distance_km??0).toFixed(1)," km"]})]},o)})})})()]})})]},`${r}-${t.lat},${t.lng}`)})}),(0,n.jsx)("style",{children:` 296 .global-cards-scroller { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--fg-muted) transparent; } 297 .global-cards-scroller::-webkit-scrollbar { width: 6px; } 298 .global-cards-scroller::-webkit-scrollbar-track { background: transparent; } 299 .global-cards-scroller::-webkit-scrollbar-thumb { background: var(--fg-muted); border-radius: 3px; opacity: 0.6; } 300 .global-cards-scroller::-webkit-scrollbar-thumb:hover { background: var(--fg); } 301 .global-results-carousel { scrollbar-width: none; -ms-overflow-style: none; } 302 .global-results-carousel::-webkit-scrollbar { display: none; } 303 .card-map-icon { transition: transform 0.15s ease; } 304 .card-map-icon:hover { transform: scale(1.18); } 305 `}),r,(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:t,children:"Was this accurate?"}),rF?(0,n.jsx)("div",{style:{color:"#7ED957",fontSize:"15.4px",textAlign:"center",fontStyle:"italic"},children:"Thanks for the feedback"}):(0,n.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[om("Incorrect","#ff4d4d"),om("Nearby","#9aa0a6"),om("Correct","#ffffff")]})]})]})]}),t5&&!eJ&&(0,n.jsxs)("div",{children:[tr&&(0,n.jsx)("button",{type:"button",onClick:()=>{eK(tr.globalSearchResult),tl(tr.globalCandidates||[]),td(tr.expandedCardIdx??0),t0([]),t2(0),tn(null),rD("")},style:{background:"transparent",border:"none",padding:"4px 0 12px",cursor:"pointer",color:"var(--fg-muted)",fontSize:13,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"â Back to global results"}),rZ&&(()=>{let e=iR&&!t7&&!re&&!tb,t=!ri&&!ra&&!tb,r=e=>({flex:1,minWidth:0,padding:"10px 12px",background:e?"var(--fg)":"var(--surface-strong)",color:e?"#000000":"var(--fg-muted)",border:"none",borderRadius:"999px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:"13.2px",fontWeight:700,letterSpacing:"0.3px",cursor:e||!iR?"pointer":"not-allowed",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",transition:"background 0.15s ease, color 0.15s ease"});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{display:"flex",gap:"6px",marginBottom:"6px"},children:[(0,n.jsx)("button",{type:"button",onClick:on,disabled:iR&&!e,style:r(e),children:t7?"Reranked â":re?"Rerankingâ¦":"Rerank images"}),(0,n.jsx)("button",{type:"button",onClick:ol,disabled:!t,style:r(t),children:ri?`Top 30 â`:ra?"Loadingâ¦":"Show More Results"})]}),(0,n.jsx)("div",{style:{marginBottom:"14px",fontSize:"11.5px",color:"var(--fg-muted)",textAlign:"center",lineHeight:1.4,fontStyle:"italic"},children:iR?"Rerank can improve accuracy. Show more returns the top 30 instead of 10.":"Show more returns the top 30. Rerank needs a paid plan or credits."})]})})(),t5.image_path&&(0,n.jsxs)("div",{onClick:()=>ry("comparison"),style:{position:"relative",borderRadius:"10px",overflow:"hidden",marginBottom:"14px",cursor:"pointer"},children:[(0,n.jsx)("img",{src:`${ed}/api/index-image/${encodeURIComponent(t5.image_path)}`,alt:"Reference",style:{width:"100%",height:"auto",maxHeight:"200px",objectFit:"cover",display:"block"},onLoad:e=>
305eY({width:e.target.naturalWidth,height:e.target.naturalHeight}),onError:e=>{e.target.style.display="none"}}),(0,n.jsxs)("div",{style:{position:"absolute",top:"10px",left:"10px",padding:"4px 11px",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",borderRadius:"5px",color:"var(--fg)",fontSize:"13.2px",fontWeight:600,letterSpacing:"0.3px"},children:["Match #",t5.rank,t5.verified?" \xb7 Verified":""]}),t5.reranked&&(0,n.jsxs)("div",{style:{position:"absolute",bottom:"10px",left:"10px",padding:"3px 9px",background:t5.verified?"rgba(35,123,63,0.85)":"rgba(0,0,0,0.55)",backdropFilter:"blur(8px)",borderRadius:"5px",color:"#fff",fontSize:"11px",fontWeight:600,letterSpacing:"0.3px"},children:[t5.verified?"Verified":"Unverified"," \xb7 match ",Math.round(t5.match_score??t5.keypoint_matches??0)]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:t,children:"Coordinates"}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",transform:nr?"scale(0.85)":"scale(1)",transition:"transform 0.18s cubic-bezier(0.32, 0.72, 0, 1)",transformOrigin:"left center"},children:[(0,n.jsxs)("span",{onClick:()=>ni(t5.lat,t5.lng),style:{color:"var(--fg)",fontSize:"20px",fontWeight:400,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',lineHeight:1.3,cursor:"pointer",userSelect:"text",WebkitUserSelect:"text"},children:[et(t5.lat,"lat")," \xb7 ",et(t5.lng,"lng")]}),(0,n.jsx)(eg,{onClick:()=>ni(t5.lat,t5.lng),copied:ne,size:18})]}),ne&&(0,n.jsx)("div",{style:{marginTop:"4px",fontSize:"11.5px",color:"#7ED957",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontStyle:"italic"},children:"Copied"})]}),r,(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:t,children:"Address"}),(0,n.jsx)("div",{style:{color:"#e4e4e4",fontSize:"24px",lineHeight:1.45,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:t5.address||"Geocodingâ¦"})]}),tX.length>1&&(0,n.jsxs)(n.Fragment,{children:[r,(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[(0,n.jsx)("button",{onClick:()=>ox("prev"),disabled:0===t1,style:{width:"38px",height:"38px",background:"transparent",border:"1px solid var(--border)",borderRadius:"50%",color:"var(--fg)",cursor:0===t1?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"17.6px",opacity:0===t1?.25:1,transition:"all 0.2s ease"},onMouseEnter:e=>{0!==t1&&(e.currentTarget.style.borderColor="var(--fg-muted)")},onMouseLeave:e=>e.currentTarget.style.borderColor="var(--border)",children:"â"}),(0,n.jsxs)("div",{style:{flex:1,textAlign:"center",color:"var(--fg)",fontSize:"19.8px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:[t1+1," ",(0,n.jsx)("span",{style:{color:"var(--fg)",opacity:.5},children:"/"})," ",tX.length]}),(0,n.jsx)("button",{onClick:()=>ox("next"),disabled:t1===tX.length-1,style:{width:"38px",height:"38px",background:"transparent",border:"1px solid var(--border)",borderRadius:"50%",color:"var(--fg)",cursor:t1===tX.length-1?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"17.6px",opacity:t1===tX.length-1?.25:1,transition:"all 0.2s ease"},onMouseEnter:e=>{t1!==tX.length-1&&(e.currentTarget.style.borderColor="var(--fg-muted)")},onMouseLeave:e=>e.currentTarget.style.borderColor="var(--border)",children:"â"})]})]}),r,o(t5.lat,t5.lng),r,(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:t,children:"Was this accurate?"}),rF?(0,n.jsx)("div",{style:{color:"#7ED957",fontSize:"15.4px",textAlign:"center",fontStyle:"italic"},children:"Thanks for the feedback"}):(0,n.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[om("Incorrect","#ff4d4d"),om("Nearby","#9aa0a6"),om("Correct","#ffffff")]})]})]})]}),(0,n.jsxs)("div",{style:{flexShrink:0,padding:"14px 22px 18px"},children:[(0,n.jsxs)("div",{style:{display:"flex",gap:"8px",position:"relative"},children:[(0,n.jsx)(eS,{onClick:()=>ik(e=>!e),disabled:ix||!n5,saving:ix}),(0,n.jsx)(eM,{onClick:()=>{(0,h.u4)("pdf_export_click"),a(tP,tX,t5)}}),iv&&(0,n.jsxs)("div",{style:{position:"absolute",bottom:"calc(100% + 8px)",left:0,right:0,background:"hsl(0 0% 5% / 0.95)",backdropFilter:"blur(20px)",border:"1px solid rgba(255, 255, 255, 0.12)",borderRadius:"10px",padding:"12px",zIndex:100,boxShadow:"0 10px 30px rgba(0, 0, 0, 0.5)"},children:[(0,n.jsx)("div",{style:{...t,marginBottom:"10px"},children:"Save to"}),(0,n.jsxs)("button",{onClick:()=>iO(null),style:{width:"100%",textAlign:"left",padding:"10px 12px",background:"rgba(255,216,107,0.10)",border:"1px solid rgba(255,216,107,0.3)",borderRadius:"8px",color:"#FFD86B",fontSize:"15.4px",fontWeight:600,cursor:"pointer",marginBottom:"6px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:["+ Auto folder (",D(i$()),")"]}),id.length>0&&(0,n.jsx)("div",{style:{maxHeight:"200px",overflowY:"auto"},children:id.map(e=>(0,n.jsxs)("button",{onClick:()=>iO(e.id),style:{width:"100%",textAlign:"left",padding:"9px 12px",background:"transparent",border:"none",borderRadius:"6px",color:"var(--fg)",fontSize:"15.4px",cursor:"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},onMouseEnter:e=>e.currentTarget.style.backgroundColor="var(--surface-strong)",onMouseLeave:e=>e.currentTarget.style.backgroundColor="transparent",children:[e.name," ",(0,n.jsxs)("span",{style:{color:"var(--fg-muted)",fontSize:"13.2px"},children:["\xb7 ",e.itemCount||0]})]},e.id))})]})]}),ib&&(0,n.jsxs)("div",{style:{marginTop:"10px",fontSize:"14.3px",color:"#7ED957",textAlign:"center",fontStyle:"italic"},children:["Saved to ",(0,n.jsx)("strong",{children:ib.name})]})]})]})]})})(),!e&&T&&tP&&!(t5&&!eJ)&&(()=>{let e=nl||{},t=Array.isArray(e.exact)?e.exact:[],r=Array.isArray(e.visual)?e.visual:[];if(0===t.length&&0===r.length)return null;let i=o||d||g?450:72,a=no?392:12,l=iE.slice(0,10),s=Math.max(0,iE.length-l.length);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>nc(e=>!e),style:{position:"fixed",left:`calc(${i}px + (100vw - ${i}px - ${a}px) / 2 - 18px)`,bottom:nd?"234px":"12px",width:"36px",height:"36px",borderRadius:"50%",background:"var(--fg)",border:"none",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1002,transition:"bottom 0.35s cubic-bezier(0.32, 0.72, 0, 1), left 0.35s cubic-bezier(0.32, 0.72, 0, 1)"},"aria-label":nd?"Hide related images":"Show related images",children:nd?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"6 9 12 15 18 9"})}):(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"18 15 12 9 6 15"})})}),(0,n.jsxs)("div",{style:{position:"fixed",left:`${i}px`,right:`${a}px`,bottom:"12px",zIndex:1001,background:"hsl(0 0% 0% / 0.65)",backdropFilter:"blur(20px) brightness(1.05)",WebkitBackdropFilter:"blur(20px) brightness(1.05)",borderRadius:"18px",border:"1px solid var(--surface-strong)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.4), 0 0 2px 1px var(--surface) inset",height:"210px",transform:nd?"translateY(0)":"translateY(calc(100% + 24px))",transition:"transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), left 0.35s cubic-bezier(0.32, 0.72, 0, 1), right 0.35s cubic-bezier(0.32, 0.72, 0, 1)",overflow:"hidden",display:"flex",flexDirection:"column",pointerEvents:nd?"auto":"none"},children:[(0,n.jsxs)("div",{style:{height:"36px",padding:"0 18px 0 22px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0,gap:"12px"},children:[(0,n.jsxs)("span",{style:{color:"var(--fg)",fontSize:"12px",fontWeight:700,letterSpacing:"0.5px",textTransform:"uppercase",whiteSpace:"nowrap"},children:["Related Images ",(0,n.jsx)("span",{style:{color:"var(--fg-muted)",fontWeight:500,marginLeft:"6px"},children:t.length+r.length}),(0,n.jsxs)("span",{style:{color:"var(--fg-muted)",fontWeight:500,marginLeft:"6px",fontSize:"11px",textTransform:"none",letterSpacing:"0"},children:[t.length," exact \xb7 ",r.length," visual"]})]}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"14px"},children:[(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"6px",color:ng?"var(--fg)":"var(--fg-muted)",fontSize:"11.5px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.4px",cursor:"pointer",userSelect:"none"},children:[(0,n.jsx)("input",{type:"checkbox",checked:ng,onChange:e=>nf(e.target.checked),style:{accentColor:"var(--fg)",cursor:"pointer",width:"13px",height:"13px"}}),"Exact"]}),(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"6px",color:nh?"var(--fg)":"var(--fg-muted)",fontSize:"11.5px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.4px",cursor:"pointer",userSelect:"none"},children:[(0,n.jsx)("input",{type:"checkbox",checked:nh,onChange:e=>nx(e.target.checked),style:{accentColor:"var(--fg)",cursor:"pointer",width:"13px",height:"13px"}}),"Visual"]}),(0,n.jsxs)("button",{onClick:()=>nu(!0),disabled:0===iE.length,style:{background:0===iE.length?"transparent":"var(--fg)",color:0===iE.length?"var(--fg-muted)":"#000",border:0===iE.length?"1px solid var(--surface-strong)":"none",padding:"4px 12px",borderRadius:"999px",fontSize:"11.5px",fontWeight:700,letterSpacing:"0.3px",textTransform:"uppercase",cursor:0===iE.length?"not-allowed":"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:["Show More",s>0?` \xb7 ${s}`:""]})]})]}),(0,n.jsx)("div",{className:"no-scrollbar",style:{display:"flex",gap:"8px",padding:"4px 18px 18px",overflowX:"hidden",overflowY:"hidden",flex:1,alignItems:"stretch"},children:0===l.length?(0,n.jsx)("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--fg-muted)",fontSize:"12px",letterSpacing:"0.3px"},children:"Nothing to show - toggle Exact / Visual above."}):l.map(e=>(0,n.jsxs)("button",{onClick:()=>nb(e),title:e.title||e.source||"",style:{flex:"1 1 0",minWidth:0,background:"var(--surface)",borderRadius:"8px",overflow:"hidden",position:"relative",textDecoration:"none",border:"1px solid var(--surface-strong)",cursor:"pointer",padding:0,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',textAlign:"left"},children:[e.thumbnail_url?(0,n.jsx)("img",{src:e.thumbnail_url,alt:e.title||"",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:e=>{e.currentTarget.style.opacity="0.2"}}):(0,n.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--fg-muted)",fontSize:"11px"},children:"no thumb"}),(0,n.jsx)("div",{style:{position:"absolute",top:"6px",left:"6px",padding:"2px 6px",background:"rgba(0,0,0,0.7)",borderRadius:"4px",color:"var(--fg)",fontSize:"9px",fontWeight:700,letterSpacing:"0.4px",textTransform:"uppercase"},children:"exact"===e._kind?"exact":"visual"}),(0,n.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,padding:"6px 8px",background:"linear-gradient(transparent, rgba(0,0,0,0.85) 35%)",color:"var(--fg)",fontSize:"10.5px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.25},children:e.title||e.source||"(no title)"})]},e._key))})]})]})})(),np&&nl&&(()=>{let e=nl||{},t=ng&&Array.isArray(e.exact)?e.exact:[],r=nh&&Array.isArray(e.visual)?e.visual:[];return(0,n.jsx)("div",{onClick:()=>nu(!1),style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)",zIndex:2100,display:"flex",alignItems:"center",justifyContent:"center",padding:"40px",animation:"fadeIn 0.2s ease-in-out"},children:(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{background:"hsl(0 0% 6% / 0.95)",borderRadius:"16px",border:"1px solid var(--surface-strong)",padding:"24px",maxWidth:"1120px",width:"100%",maxHeight:"88vh",display:"flex",flexDirection:"column"},children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"18px",gap:"14px"},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"14px",minWidth:0},children:[(tU||tP?.preview)&&(0,n.jsxs)("div",{style:{flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[(0,n.jsx)("img",{src:tU||tP.preview,alt:"Your query",style:{width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover",border:"1px solid var(--surface-strong)",display:"block"}}),(0,n.jsx)("span",{style:{color:"var(--fg-muted)",fontSize:"10px",fontWeight:600,letterSpacing:"0.4px",textTransform:"uppercase"},children:"Your query"})]}),(0,n.jsxs)("h2",{style:{color:"var(--fg)",fontSize:"22px",fontWeight:700,margin:0,overflow:"hidden",textOverflow:"ellipsis"},children:["Related Images ",(0,n.jsxs)("span",{style:{color:"var(--fg-muted)",fontSize:"14px",fontWeight:500,marginLeft:"8px"},children:[t.length+r.length," total \xb7 ",t.length," exact \xb7 ",r.length," visual"]})]})]}),(0,n.jsx)("button",{onClick:()=>nu(!1),style:{flexShrink:0,width:"36px",height:"36px",borderRadius:"50%",background:"var(--surface)",border:"1px solid var(--surface-strong)",color:"var(--fg)",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"\xd7"})]}),(0,n.jsx)("div",{style:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(190px, 1fr))",gridAutoRows:"max-content",gap:"16px",paddingRight:"4px",alignContent:"start",alignItems:"start"},children:iE.map(e=>(0,n.jsxs)("button",{onClick:()=>{nu(!1),nb(e)},style:{background:"var(--surface)",borderRadius:"10px",overflow:"hidden",position:"relative",border:"1px solid var(--surface-strong)",aspectRatio:"4 / 5",cursor:"pointer",padding:0,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',textAlign:"left"},children:[e.thumbnail_url?(0,n.jsx)("img",{src:e.thumbnail_url,alt:e.title||"",loading:"lazy",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:e=>{e.currentTarget.style.opacity="0.2"}}):(0,n.jsx)("div",{style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--fg-muted)",fontSize:"12px"},children:"no thumb"}),(0,n.jsx)("div",{style:{position:"absolute",top:"8px",left:"8px",padding:"3px 7px",background:"rgba(0,0,0,0.7)",borderRadius:"4px",color:"var(--fg)",fontSize:"11px",fontWeight:700,letterSpacing:"0.4px",textTransform:"uppercase"},children:"exact"===e._kind?"exact":`visual \xb7 kp ${e.keypoint_matches??0}`}),(0,n.jsxs)("div",{style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 11px 10px",background:"linear-gradient(transparent, rgba(0,0,0,0.9) 30%)",color:"var(--fg)",fontSize:"13px",lineHeight:1.3},children:[(0,n.jsx)("div",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:e.title||"(no title)"}),e.source&&(0,n.jsx)("div",{style:{color:"var(--fg-muted)",marginTop:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.source})]})]},e._key))})]})})})(),nm&&(()=>{let t=()=>{ny||(nb(null),nw(null),nz(!1),nS(!1))},r="720px";return(0,n.jsxs)("div",{onClick:t,style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.92)",backdropFilter:"blur(8px)",zIndex:2200,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:e?"20px 16px":"40px",animation:"fadeIn 0.25s ease-in-out",gap:e?"16px":"24px"},children:[(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),t()},"aria-label":"Close",style:{position:"absolute",top:"20px",right:"20px",width:"40px",height:"40px",borderRadius:"50%",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.18)",color:"var(--fg)",fontSize:"18px",cursor:ny?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",opacity:ny?.4:1},children:"\xd7"}),(0,n.jsx)("div",{onClick:e=>e.stopPropagation(),style:{display:"flex",alignItems:"center",justifyContent:"center",flex:"0 1 au
305to",minHeight:0},children:nm.thumbnail_url?(0,n.jsx)("img",{src:nm.thumbnail_url,alt:nm.title||"",style:{maxWidth:e?"92vw":"80vw",maxHeight:e?"50vh":"65vh",objectFit:"contain",display:"block",borderRadius:"8px"},onError:e=>{e.currentTarget.style.opacity="0.2"}}):(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"14px"},children:"No thumbnail"})}),(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:r,textAlign:"center",flexShrink:0},children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",marginBottom:"10px"},children:[(0,n.jsx)("span",{style:{padding:"3px 9px",borderRadius:"999px",background:"exact"===nm._kind?"#FFD86B":"rgba(255,255,255,0.10)",color:"exact"===nm._kind?"#000":"var(--fg)",fontSize:"10.5px",fontWeight:700,letterSpacing:"0.4px",textTransform:"uppercase"},children:"exact"===nm._kind?"Exact match":`Visual \xb7 kp ${nm.keypoint_matches??0}`}),nm.source&&(0,n.jsx)("span",{style:{color:"var(--fg-muted)",fontSize:"12.5px",maxWidth:"50%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:nm.source})]}),(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:e?"15px":"17px",fontWeight:700,lineHeight:1.3,padding:"0 8px",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:nm.title||"(no title)"})]}),(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:r,display:"flex",flexDirection:e?"column":"row",gap:"10px",flexShrink:0,position:"relative"},children:[(0,n.jsxs)("div",{style:{display:"flex",gap:"10px",flex:e?"unset":1},children:[(0,n.jsx)("button",{onClick:iV,disabled:ny,style:{flex:1,padding:"13px 18px",background:"var(--fg)",border:"none",borderRadius:"999px",color:"#000",fontSize:"14px",fontWeight:700,cursor:ny?"wait":"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',opacity:ny?.65:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",whiteSpace:"nowrap"},children:ny?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w.A,{size:42,color:"#000",rate:.7})," Retryingâ¦"]}):"Retry with result"}),(0,n.jsx)(eu,{open:nj,onClick:()=>nS(e=>!e)})]}),(0,n.jsx)("button",{onClick:()=>{nm.link&&window.open(nm.link,"_blank","noopener,noreferrer")},disabled:!nm.link,style:{flex:e?"unset":1,padding:"13px 18px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.18)",borderRadius:"999px",color:nm.link?"var(--fg)":"var(--fg-muted)",fontSize:"14px",fontWeight:600,cursor:nm.link?"pointer":"not-allowed",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',whiteSpace:"nowrap"},children:"Visit Page â"}),(0,n.jsxs)("div",{style:{flex:e?"unset":1,position:"relative"},children:[(0,n.jsx)("button",{onClick:()=>nz(e=>!e),disabled:nI||!n5,style:{width:"100%",padding:"13px 18px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.18)",borderRadius:"999px",color:"var(--fg)",fontSize:"14px",fontWeight:600,cursor:nI||!n5?"not-allowed":"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',opacity:n5?1:.5,whiteSpace:"nowrap"},children:nI?"Savingâ¦":"Save to folder"}),nC&&(0,n.jsxs)("div",{style:{position:"absolute",bottom:"calc(100% + 8px)",left:0,right:0,background:"hsl(0 0% 4% / 0.98)",backdropFilter:"blur(20px)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:"12px",padding:"12px",zIndex:10,boxShadow:"0 10px 40px rgba(0,0,0,0.6)"},children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"11px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.4px",marginBottom:"10px",textAlign:"left"},children:"Save to"}),(0,n.jsxs)("button",{onClick:()=>iU(null),style:{width:"100%",textAlign:"left",padding:"10px 12px",background:"rgba(255,216,107,0.10)",border:"1px solid rgba(255,216,107,0.3)",borderRadius:"8px",color:"#FFD86B",fontSize:"13.5px",fontWeight:600,cursor:"pointer",marginBottom:"6px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:["+ Auto folder (",(nm.source||"Lens results").slice(0,40),")"]}),id.length>0&&(0,n.jsx)("div",{style:{maxHeight:"200px",overflowY:"auto"},children:id.map(e=>(0,n.jsxs)("button",{onClick:()=>iU(e.id),style:{width:"100%",textAlign:"left",padding:"9px 12px",background:"transparent",border:"none",borderRadius:"6px",color:"var(--fg)",fontSize:"13.5px",cursor:"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},onMouseEnter:e=>e.currentTarget.style.backgroundColor="rgba(255,255,255,0.06)",onMouseLeave:e=>e.currentTarget.style.backgroundColor="transparent",children:[e.name," ",(0,n.jsxs)("span",{style:{color:"var(--fg-muted)",fontSize:"11.5px"},children:["\xb7 ",e.itemCount||0]})]},e.id))})]})]})]}),(nj||nM||nk)&&(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:r,display:"flex",flexDirection:"column",gap:"8px",flexShrink:0},children:[nj&&(0,n.jsx)("div",{style:{background:"rgba(255,255,255,0.05)",borderRadius:"10px",border:"1px solid rgba(255,255,255,0.10)",padding:"12px 14px",color:"var(--fg-muted)",fontSize:"12.5px",lineHeight:1.5,textAlign:"left"},children:"Re-runs the search using your original image plus this picked result image, with its page title, URL and source attached as context. Faster and biased toward the match you chose."}),nM&&(0,n.jsxs)("div",{style:{fontSize:"13px",color:"#7ED957",textAlign:"center",fontStyle:"italic",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:["Saved to ",(0,n.jsx)("strong",{children:nM.name})]}),nk&&(0,n.jsx)("div",{style:{fontSize:"13px",color:"#ff7575",background:"rgba(255,80,80,0.10)",border:"1px solid rgba(255,80,80,0.25)",borderRadius:"10px",padding:"10px 12px",textAlign:"center"},children:nk})]})]})})(),!e&&(0,n.jsx)("div",{style:{position:"fixed",left:"66px",top:0,width:"370px",height:"100vh",background:"transparent",borderRadius:"14px",opacity:+!!o,pointerEvents:o?"auto":"none",transition:o?"opacity 0.25s ease 0.1s":"opacity 0.15s ease",zIndex:tw?1671:1001,display:"flex",flexDirection:"column",overflowX:"hidden"},children:b&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:"20px 20px 0 20px"},children:[(0,n.jsx)("h2",{style:{color:"var(--fg)",fontSize:"22px",fontWeight:700,marginBottom:"15px"},children:"Search Location"}),(0,n.jsx)("div",{style:{marginBottom:"15px"},children:(0,n.jsxs)("div",{style:{display:"flex",padding:"4px",backgroundColor:"var(--surface)",borderRadius:"999px",border:"1px solid var(--surface-strong)",position:"relative",boxSizing:"border-box"},children:[(0,n.jsx)("div",{id:"search-mode-pill",style:{position:"absolute",top:"4px",height:"calc(100% - 8px)",backgroundColor:"var(--fg)",borderRadius:"999px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:1,boxShadow:"0 2px 12px var(--border-strong)"}}),[{key:"global",label:"Global"},{key:"index",label:"City Search"}].map(e=>(0,n.jsx)("button",{ref:t=>
305{if(t&&eE===e.key){let e=document.getElementById("search-mode-pill");e&&(e.style.left=`${t.offsetLeft}px`,e.style.width=`${t.offsetWidth}px`)}},onClick:()=>{"index"===e.key?iL():e$(e.key)},style:{flex:1,padding:"8px 14px",background:"transparent",border:"none",borderRadius:"999px",color:eE===e.key?"#000000":"rgba(255, 255, 255, 0.7)",fontSize:"13.2px",fontWeight:eE===e.key?700:600,cursor:"pointer",transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',position:"relative",zIndex:2},children:e.label},e.key))]})}),"global"===eE&&(0,n.jsxs)("div",{style:{marginBottom:"15px"},children:[(0,n.jsx)("label",{style:{display:"block",color:"var(--fg-muted)",fontSize:"11px",fontWeight:600,marginBottom:"6px",textTransform:"uppercase"},children:"Effort"}),(0,n.jsxs)("div",{style:{display:"flex",padding:"4px",backgroundColor:"var(--surface)",borderRadius:"999px",border:"1px solid var(--surface-strong)",position:"relative",boxSizing:"border-box"},children:[(0,n.jsx)("div",{id:"thinking-mode-pill",style:{position:"absolute",top:"4px",height:"calc(100% - 8px)",backgroundColor:"var(--fg)",borderRadius:"999px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:1,boxShadow:"0 2px 12px var(--border-strong)"}}),[{key:"instant",label:"Instant"},{key:"low",label:"Low"},{key:"medium",label:"Medium"},{key:"high",label:"High"}].map(e=>(0,n.jsxs)("button",{ref:t=>{if(t&&eB===e.key){let e=document.getElementById("thinking-mode-pill");e&&(e.style.left=`${t.offsetLeft}px`,e.style.width=`${t.offsetWidth}px`)}},onClick:()=>{if(iI(e.key)){(0,h.u4)("upgrade_modal_open",{reason:"effort_locked",mode:"global",thinking_mode:e.key,surface:"effort_picker"}),tA("pro_feature"),tF(!0);return}eP(e.key)},style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",whiteSpace:"nowrap",padding:"8px 8px",background:"transparent",border:"none",borderRadius:"999px",color:eB===e.key?"#000000":"rgba(255, 255, 255, 0.7)",fontSize:"12.6px",fontWeight:eB===e.key?700:600,cursor:"pointer",transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',position:"relative",zIndex:2},children:[e.label,iI(e.key)&&(0,n.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,opacity:.65},"aria-label":"Pro only",children:[(0,n.jsx)("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),(0,n.jsx)("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]})]},e.key))]}),(0,n.jsx)("div",{style:{display:"flex",marginTop:"6px",paddingLeft:"4px",paddingRight:"4px",color:"rgba(255, 255, 255, 0.45)",fontSize:"11px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontStyle:"italic"},children:[{key:"instant",eta:"~5s"},{key:"low",eta:"~20s"},{key:"medium",eta:"~30s"},{key:"high",eta:"~60s"}].map(e=>(0,n.jsx)("div",{style:{flex:1,textAlign:"center",color:eB===e.key?"rgba(255, 255, 255, 0.85)":"var(--fg-muted)",transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:e.eta},e.key))})]}),"index"===eE&&og({marginBottom:"15px",hint:!0}),"global"===eE&&(0,n.jsxs)("div",{style:{marginBottom:"15px"},children:[(0,n.jsx)("label",{style:{display:"block",color:"var(--fg-muted)",fontSize:"12.1px",fontWeight:600,marginBottom:"6px",textTransform:"uppercase"},children:"Additional Context"}),(0,n.jsx)("textarea",{value:tx,onChange:e=>{tm(e.target.value);let t=e.target;t.style.height="auto";let r=parseFloat(getComputedStyle(t).lineHeight)||20;t.style.height=Math.min(t.scrollHeight,5*r+20)+"px"},placeholder:"Optional: provide any info you already know",rows:1,style:{width:"100%",padding:"10px 16px",backgroundColor:"var(--surface)",border:"none",borderRadius:"20px",color:"rgba(255,255,255,0.85)",fontSize:"14.3px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',resize:"none",outline:"none",lineHeight:"1.4",boxSizing:"border-box",overflow:"hidden",display:"block"}})]}),(0,n.jsxs)("div",{style:{marginBottom:"15px",flex:1,minHeight:0},children:[(0,n.jsx)("label",{style:{display:"block",color:"var(--fg-muted)",fontSize:"12.1px",fontWeight:600,marginBottom:"6px",textTransform:"uppercase"},children:"Upload Image"}),tP?(0,n.jsxs)("div",{style:{position:"relative",borderRadius:"10px",overflow:"hidden",containerType:"inline-size",maxHeight:"min(calc(100cqi * 1.08), 43vh)",background:"rgba(0,0,0,0.35)"},children:[(0,n.jsx)("img",{src:tP.preview,alt:"Preview",style:{width:"100%",height:"auto",display:"block"}}),tP?.file&&eV&&(0,n.jsxs)("div",{style:{position:"absolute",bottom:"8px",left:"8px",display:"flex",alignItems:"center",gap:"6px",maxWidth:"calc(100% - 16px)",padding:"5px 9px",borderRadius:"8px",background:"rgba(234,179,8,0.5)",backdropFilter:"blur(6px)"},title:"Low-resolution image - may reduce accuracy",children:[(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"#fff",style:{flexShrink:0},"aria-hidden":"true",children:(0,n.jsx)("path",{d:"M13.5,10.5v5c0,.83-.67,1.5-1.5,1.5s-1.5-.67-1.5-1.5v-5c0-.83,.67-1.5,1.5-1.5s1.5,.67,1.5,1.5Zm-1.5,8.5c-.83,0-1.5,.67-1.5,1.5s.67,1.5,1.5,1.5,1.5-.67,1.5-1.5-.67-1.5-1.5-1.5Zm11.05-4.19L15.31,2.73c-.75-1.08-1.99-1.73-3.31-1.73s-2.56,.65-3.34,1.78L.99,14.76c-1.09,1.56-1.29,3.45-.52,4.92,.77,1.48,2.34,2.32,4.32,2.32h1.72c.83,0,1.5-.67,1.5-1.5s-.67-1.5-1.5-1.5h-1.72c-.48,0-1.33-.09-1.66-.71-.25-.48-.13-1.17,.35-1.87L11.15,4.44c.28-.4,.69-.44,.85-.44s.57,.04,.82,.39l7.74,12.08c.45,.64,.57,1.34,.32,1.82-.32,.62-1.18,.71-1.66,.71h-1.72c-.83,0-1.5,.67-1.5,1.5s.67,1.5,1.5,1.5h1.72c1.97,0,3.5
3055-.85,4.32-2.32,.77-1.47,.57-3.36-.48-4.87Z"})}),(0,n.jsx)("span",{style:{color:"#fff",fontSize:"10.5px",fontWeight:600,lineHeight:1.25},children:"Low-res - may reduce accuracy"})]}),(0,n.jsx)("div",{style:{position:"absolute",top:"8px",left:"8px",padding:"4px 8px",backgroundColor:"rgba(0, 0, 0, 0.7)",backdropFilter:"blur(10px)",borderRadius:"4px",color:"var(--fg)",fontSize:"11px",fontWeight:600},children:tP.name.length>20?tP.name.substring(0,17)+"...":tP.name}),(0,n.jsxs)("div",{style:{position:"absolute",top:"8px",right:"8px",display:"flex",gap:"6px"},children:[(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),rj({x:0,y:0,width:100,height:100}),ry("crop")},style:{width:"28px",height:"28px",backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",border:"none",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.3s ease"},onMouseEnter:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.7)",onMouseLeave:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.5)",children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"var(--fg)",children:(0,n.jsx)("path",{d:"M22.5,17H20V8.5A4.5,4.5,0,0,0,15.5,4H7V1.5A1.5,1.5,0,0,0,5.5,0h0A1.5,1.5,0,0,0,4,1.5V4H1.5A1.5,1.5,0,0,0,0,5.5H0A1.5,1.5,0,0,0,1.5,7H4v8.5A4.5,4.5,0,0,0,8.5,20H17v2.5A1.5,1.5,0,0,0,18.5,24h0A1.5,1.5,0,0,0,20,22.5V20h2.5A1.5,1.5,0,0,0,24,18.5h0A1.5,1.5,0,0,0,22.5,17Zm-14,0A1.5,1.5,0,0,1,7,15.5V7h8.5A1.5,1.5,0,0,1,17,8.5V17Z"})})}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),ry("expand")},style:{width:"28px",height:"28px",backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",border:"none",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.3s ease"},onMouseEnter:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.7)",onMouseLeave:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.5)",children:(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"var(--fg)",children:[(0,n.jsx)("path",{d:"M9.849,19.472c-1.466,.467-2.723,.563-3.716,.517l4.928-4.928c.586-.585,.586-1.536,0-2.121-.586-.586-1.535-.586-2.121,0l-4.927,4.927c-.047-.994,.05-2.251,.516-3.716,.251-.789-.186-1.633-.975-1.884-.791-.252-1.633,.185-1.885,.974-1.522,4.779,.03,8.141,.097,8.282,.148,.312,.4,.563,.713,.711,.095,.045,1.647,.763,4.111,.763,1.196,0,2.607-.169,4.169-.667,.789-.251,1.226-1.095,.975-1.884-.253-.789-1.094-1.228-1.885-.974Z"}),(0,n.jsx)("path",{d:"M14.151,4.528c1.466-.467,2.723-.563,3.716-.517l-4.928,4.928c-.586,.585-.586,1.536,0,2.121,.586,.586,1.535,.586,2.121,0l4.927-4.927c.047,.994-.05,2.251-.516,3.716-.251,.789,.186,1.633,.975,1.884,.791,.252,1.633-.185,1.885-.974,1.522-4.779-.03-8.141-.097-8.282-.148-.312-.4-.563-.713-.711-.095-.045-1.647-.763-4.111-.763-1.196,0-2.607,.169-4.169,.667-.789,.251-1.226,1.095-.975,1.884,.253,.789,1.094,1.228,1.885,.974Z"})]})}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),tH(null),tq([]),ns(null),nu(!1)},style:{width:"28px",height:"28px",backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",border:"none",borderRadius:"50%",color:"var(--fg)",fontSize:"15.4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.3s ease"},onMouseEnter:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.7)",onMouseLeave:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.5)",children:"â"})]})]}):(0,n.jsxs)("div",{onDragOver:e=>{e.preventDefault(),tB(!0)},onDragLeave:()=>tB(!1),onDrop:e=>{e.preventDefault(),tB(!1);let t=Array.from(e.dataTransfer.files||[]).filter(e=>e.type.startsWith("image/")||iJ(e));if(t.length)if((0,h.u4)("dashboard_upload_select",{source:"drop",file_count:t.length,size_bucket:(0,h.gi)(t[0]?.size),mime:t[0]?.type||"unknown",search_mode:eE}),tP){if("global"===eE){let e=3-tZ.length;t.slice(0,Math.max(0,e)).forEach(e=>i1(e))}}else iQ(t[0]),"global"===eE&&t.slice(1,4).forEach(e=>i1(e))},onClick:()=>nB.current?.click(),style:{border:"none",borderRadius:"10px",padding:"25px 15px",textAlign:"center",cursor:"pointer",backgroundColor:t$?"var(--border)":"var(--surface)",transition:"all 0.3s ease"},children:[(0,n.jsxs)("svg",{width:"36",height:"36",viewBox:"0 0 512 512",fill:"var(--fg)",style:{margin:"0 auto 10px"},children:[(0,n.jsx)("path",{d:"M165.558,141.889l59.328-59.349l0.448,290.816c0,17.673,14.327,32,32,32l0,0c17.673,0,32-14.327,32-32l-0.448-290.453 l58.987,58.987c12.278,12.712,32.536,13.064,45.248,0.786s13.064-32.536,0.786-45.248c-0.258-0.267-0.52-0.529-0.786-0.786 l-68.523-68.523c-37.49-37.491-98.274-37.491-135.765-0.001c0,0-0.001,0.001-0.001,0.001L120.31,9
3056.641 c-12.278,12.712-11.926,32.97,0.786,45.248C133.497,153.866,153.157,153.866,165.558,141.889z"}),(0,n.jsx)("path",{d:"M480.011,309.355c-17.673,0-32,14.327-32,32v97.941c-0.012,4.814-3.911,8.714-8.725,8.725H72.736 c-4.814-0.012-8.714-3.911-8.725-8.725v-97.941c0-17.673-14.327-32-32-32s-32,14.327-32,32v97.941 c0.047,40.146,32.58,72.678,72.725,72.725h366.549c40.146-0.047,72.678-32.58,72.725-72.725v-97.941 C512.011,323.682,497.684,309.355,480.011,309.355z"})]}),(0,n.jsx)("p",{style:{color:"var(--fg)",fontSize:"14.3px",marginBottom:"3px"},children:"Drop or Click to Upload"}),(0,n.jsx)("p",{style:{color:"var(--fg-muted)",fontSize:"12.1px"},children:"JPG, PNG, HEIC, WEBP"})]}),"index"===eE&&ou(),tP&&"global"===eE&&(0,n.jsxs)("div",{style:{display:"flex",gap:"6px",marginTop:"8px",flexWrap:"wrap"},children:[tZ.map((e,t)=>(0,n.jsxs)("div",{style:{position:"relative",width:"48px",height:"48px",borderRadius:"6px",overflow:"hidden"},children:[(0,n.jsx)("img",{src:e.preview,alt:`extra ${t+1}`,style:{width:"100%",height:"100%",objectFit:"cover"}}),(0,n.jsx)("button",{onClick:()=>tq(e=>e.filter((e,r)=>r!==t)),style:{position:"absolute",top:"2px",right:"2px",width:"16px",height:"16px",background:"rgba(0,0,0,0.7)",border:"none",borderRadius:"50%",color:"var(--fg)",fontSize:"10px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:"â"})]},t)),tZ.length<3&&(0,n.jsxs)("label",{title:"Add another image (max 4 total)",style:{width:"48px",height:"48px",borderRadius:"6px",border:"none",background:"rgba(255,255,255,0.06)",color:"var(--fg-muted)",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,userSelect:"none"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.10)",onMouseLeave:e=>e.currentTarget.style.background="rgba(255,255,255,0.06)",children:["+",(0,n.jsx)("input",{type:"file",accept:"image/*,.heic,.heif",multiple:!0,onChange:i2,style:{position:"absolute",width:"0",height:"0",opacity:0,pointerEvents:"none"}})]}),(0,n.jsxs)("span",{style:{alignSelf:"center",color:"var(--fg-muted)",fontSize:"11px",marginLeft:"4px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:[1+tZ.length," / 4 images"]})]})]})]}),(0,n.jsx)("div",{style:{padding:"15px 20px 20px 20px",flexShrink:0},children:(0,n.jsxs)("button",{onClick:od,disabled:!tP||tb,style:{width:"100%",padding:"14px",backgroundColor:tP&&!tb?"var(--fg)":"var(--border)",border:"none",borderRadius:"999px",color:tP&&!tb?"#000000":"var(--fg)",fontSize:"15.4px",fontWeight:700,cursor:tP&&!tb?"pointer":"not-allowed",transition:"all 0.3s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",flexShrink:0},onMouseEnter:e=>{tP&&!tb&&(e.target.style.backgroundColor="#4a4a4a",e.target.style.color="var(--fg)")},onMouseLeave:e=>{tP&&!tb&&(e.target.style.backgroundColor="var(--fg)",e.target.style.color="#000000")},children:[tb&&(0,n.jsx)(w.A,{size:60,color:"currentColor"}),tb?re?"Rerankingâ¦":ra?"Loading moreâ¦":"global"===eE?"Analyzing with AI...":"Searching Index...":"Analyze Location"]})})]})}),!e&&(0,n.jsx)("div",{style:{position:"fixed",left:"66px",top:0,width:"370px",height:"100vh",background:"transparent",borderRadius:"14px",opacity:+!!d,pointerEvents:d?"auto":"none",transition:d?"opacity 0.25s ease 0.1s":"opacity 0.15s ease",zIndex:tw?1671:1001,display:"flex",flexDirection:"column",overflow:"hidden"},children:y&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{ref:it,style:{padding:"20px 22px 12px",flexShrink:0,transition:"padding 0.25s cubic-bezier(0.32, 0.72, 0, 1)"},children:[(0,n.jsx)("h2",{ref:ir,style:{color:"var(--fg)",fontWeight:700,margin:0,fontSize:"22px",letterSpacing:"0px",transition:"font-size 0.25s cubic-bezier(0.32, 0.72, 0, 1)"},children:"History"}),(0,n.jsx)("p",{ref:ii,style:{color:"var(--fg-muted)",fontSize:"13.2px",margin:"4px 0 0",maxHeight:"22px",opacity:1,overflow:"hidden",transition:"opacity 0.2s ease, max-height 0.25s cubic-bezier(0.32, 0.72, 0, 1)"},children:"Your recent searches"})]}),(0,n.jsxs)("div",{id:"history-pane-list",className:"dark-scrollbar",onWheel:e=>e.stopPropagation(),onScroll:e=>{let t=Math.max(0,Math.min(1,e.currentTarget.scrollTop/36));t!==n9.current&&(n9.current=t,ie.current||(ie.current=requestAnimationFrame(()=>{ie.current=0;let e=n9.current,t=it.current,r=ir.current,n=ii.current;t&&(t.style.paddingTop=`${20-8*e}px`,t.style.paddingBottom=`${12-6*e}px`),r&&(r.style.fontSize=`${22-6*e}px`,r.style.letterSpacing=`${-.2*e}px`),n&&(n.style.maxHeight=`${(1-e)*22}px`,n.style.opacity=String(1-e))})))},style:{flex:1,overflowY:"auto",padding:"4px 12px 16px"},children:[n8&&(()=>{let e=Math.max(0,Math.floor((io-n8.createdAtClient)/1e3)),t=Math.max(0,(n8.eta_seconds||30)-e),r=(n8.queuePosition||0)>0?`#${n8.queuePosition} in line`:t>90?`~${Math.round(t/60)} min remaining`:t>0?`~${t}s remaining`:"finishing upâ¦",i="high"===n8.thinking_mode?"High":"medium"===n8.thinking_mode?"Medium":"low"===n8.thinking_mode?"Low":"instant"===n8.thinking_mode?"Instant":"AI";return(0,n.jsxs)("div",{style:{position:"relative",marginBottom:"6px",borderRadius:"14px",animation:"historyPendingExpand 320ms cubic-bezier(0.32, 0.72, 0, 1) both",overflow:"hidden"},children:[(0,n.jsx)(ep,{radius:14}),(0,n.jsxs)("div",{style:{position:"relative",zIndex:1,margin:"1.5px",background:"#0a0a0a",borderRadius:"12.5px",display:"flex",gap:"10px",alignItems:"center",padding:"8px"},children:[n8.thumbnail?(0,n.jsx)("img",{src:n8.thumbnail,alt:"",style:{width:"48px",height:"48px",objectFit:"cover",borderRadius:"6px",flexShrink:0,opacity:.7}}):(0,n.jsx)("div",{style:{width:"48px",height:"48px",borderRadius:"6px",backgroundColor:"var(--surface)",flexShrink:0}}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsxs)("div",{style:{color:"var(--fg)",fontSize:"14.3px",fontWeight:600,display:"flex",alignItems:"center",gap:"8px"},children:[(0,n.jsx)(w.A,{size:48,rate:.9}),"Finding locationâ¦"]}),(0,n.jsx)("div",{style:{color:"#aaa",fontSize:"12.1px",marginTop:"2px"},children:r}),(0,n.jsxs)("div",{style:{color:"var(--fg-muted)",fontSize:"12.1px",marginTop:"3px"},children:[i," \xb7 ",n8.context?n8.context.slice(0,36):"no context"]})]})]})]},n8.localId)})(),0!==n4.length||n8?n4.map(e=>{let t,r,i=e.status||"done",o=e.result||{},a=e.createdAt?.toDate?e.createdAt.toDate():null;if("running"===i){let t=Math.max(0,(e.eta_seconds||60)-(a?Math.max(0,Math.floor((io-a.getTime())/1e3)):0)),r=t>90?`~${Math.round(t/60)} min remaining`:t>0?`~${t}s remaining`:`finishing upâ¦`,i="ultra"===e.thinking_mode?"Ultra":"high"===e.thinking_mode?"High":"medium"===e.thinking_mode?"Medium":"low"===e.thinking_mode?"Low":"instant"===e.thinking_mode?"Instant":"normal"===e.thinking_mode?"Normal":"fast"===e.thinking_mode?"Fast":"AI";return(0,n.jsxs)("div",{style:{position:"relative",marginBottom:"6px",borderRadius:"14px",overflow:"hidden"},children:[(0,n.jsx)(ep,{radius:14}),(0,n.jsxs)("div",{style:{position:"relative",zIndex:1,margin:"1.5px",background:"#0a0a0a",borderRadius:"12.5px",display:"flex",gap:"10px",alignItems:"center",padding:"8px"},children:[e.thumbnail?(0,n.jsx)("img",{src:e.thumbnail,alt:"",style:{width:"48px",height:"48px",objectFit:"cover",borderRadius:"6px",flexShrink:0,opacity:.6}}):(0,n.jsx)("div",{style:{width:"48px",height:"48px",borderRadius:"6px",backgroundColor:"var(--surface)",flexShrink:0}}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsxs)("div",{style:{color:"var(--fg)",fontSize:"14.3px",fontWeight:600,display:"flex",alignItems:"center",gap:"8px"},children:[(0,n.jsx)(w.A,{size:48,rate:.9}),"Finding locationâ¦"]}),(0,n.jsx)("div",{style:{color:"#aaa",fontSize:"12.1px",marginTop:"2px"},children:r}),(0,n.jsxs)("div",{style:{color:"var(--fg-muted)",fontSize:"12.1px",marginTop:"3px"},children:[i," \xb7 ",e.context?e.context.slice(0,36):"no context"]})]}),(0,n.jsx)(ec,{onClick:t=>{t.stopPropagation(),Z(n5,e.id).catch(t=>console.error("[history] delete failed",{uid:n5,id:e.id,err:t}))},title:"Cancel / remove"})]})]},e.id)}if("error"===i)return(0,n.jsxs)("div",{style:{display:"flex",gap:"10px",alignItems:"center",padding:"8px",marginBottom:"6px",borderRadius:"14px",backgroundColor:"rgba(231, 76, 60, 0.08)",border:"1px solid rgba(231, 76, 60, 0.25)"},children:[e.thumbnail?(0,n.jsx)("img",{src:e.thumbnail,alt:"",style:{width:"48px",height:"48px",objectFit:"cover",borderRadius:"6px",flexShrink:0,opacity:.5}}):(0,n.jsx)("div",{style:{width:"48px",height:"48px",borderRadius:"6px",backgroundColor:"var(--surface)",flexShrink:0}}),(0,n.jsx)("div",{style:{flex:1,minWidth:0},children:(()=>{let t=function(e){let t=e?.error||"";return($[e?.error_code||W(t)]||$.internal)(E(t))}(e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{color:"warning"===t.tone?"#f5b82e":"#e74c3c",fontSize:"14.3px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.title}),(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"12.1px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.body})]})})()}),(0,n.jsx)(ec,{onClick:t=>{t.stopPropagation(),Z(n5,e.id).catch(t=>console.error("[history] delete failed",{uid:n5,id:e.id,err:t}))},title:"Remove"})]},e.id);let l=o.location&&"object"==typeof o.location?{...o.location,candidates:o.candidates||[]}:o,s="number"==typeof l.lat&&"number"==typeof l.lng;return"lens_match"!==l.source&&"lens_match"!==e.searchMode||s?s?(t=l.location_name||(l.address?l.address.split(",").slice(0,2).join(","):`${l.lat.toFixed(3)}, ${l.lng.toFixed(3)}`),r=l.country||(l.address?l.address.split(",").slice(-2).join(",").trim():`${l.lat.toFixed(4)}, ${l.lng.toFixed(4)}`)):(t=l.location_name||l.title||"Untitled",r=l.country||l.source_domain||l.address||""):(t=l.title||"Lens match",r=l.source_domain||l.link||"Saved result image"),(0,n.jsx)(eC,{h:e,title:t,sub:r,ts:a,onClick:()=>iN(e),onDelete:t=>{t.stopPropagation(),Z(n5,e.id).catch(t=>console.error("[history] delete failed",{uid:n5,id:e.id,err:t}))}},e.id)}):(0,n.jsx)("p",{style:{color:"var(--fg-muted)",fontSize:"14.3px",textAlign:"center",marginTop:"40px"},children:"No history yet"})]})]})}),!e&&(0,n.jsx)("div",{style:{position:"fixed",left:"66px",top:0,width:"370px",height:"100vh",background:"transparent",borderRadius:"14px",opacity:+!!g,pointerEvents:g?"auto":"none",transition:g?"opacity 0.25s ease 0.1s":"opacity 0.15s ease",zIndex:tw?1671:1001,display:"flex",flexDirection:"column",overflow:"hidden"},children:v&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{padding:"20px 22px 12px",flexShrink:0},children:[(0,n.jsx)("h2",{style:{color:"var(--fg)",fontSize:"22px",fontWeight:700,margin:0},children:"Folders"}),(0,n.jsx)("p",{style:{color:"var(--fg-muted)",fontSize:"13.2px",margin:"4px 0 0"},children:"Saved searches grouped by location"})]}),(0,n.jsxs)("div",{id:"folder-pane-list",style:{flex:1,overflowY:"auto",padding:"4px 12px 16px"},children:[(()=>{let e=async()=>
305{if(n5){if(!iw.trim())return void(iC(!0),setTimeout(()=>iC(!1),750));await q(n5,iw.trim(),iw.trim()),ij("")}};return(0,n.jsxs)("div",{style:{display:"flex",gap:"6px",marginBottom:"12px"},children:[(0,n.jsx)("input",{type:"text",value:iw,onChange:e=>{ij(e.target.value),iS&&iC(!1)},placeholder:iS?"Please Pick a Name for the Folder":"New folder name",className:iS?"folder-input-error":"",style:{flex:1,padding:"8px 10px",fontSize:"13.2px",background:iS?"rgba(139, 26, 26, 0.12)":"var(--surface)",border:iS?"1px solid #8b1a1a":"1px solid var(--border)",borderRadius:"8px",color:iS?"#8b1a1a":"var(--fg)",outline:"none",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',animation:iS?"folderInputShake 0.45s ease":"none",transition:"background 0.25s ease, border-color 0.25s ease, color 0.25s ease"},onKeyDown:t=>{"Enter"===t.key&&e()}}),(0,n.jsx)("button",{onClick:e,style:{padding:"8px 12px",fontSize:"13.2px",fontWeight:600,background:"var(--fg)",color:"#000",border:"none",borderRadius:"8px",cursor:"pointer",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"+ New"})]})})(),0===id.length?(0,n.jsx)("p",{style:{color:"var(--fg-muted)",fontSize:"14.3px",textAlign:"center",marginTop:"40px"},children:"No folders yet"}):id.map(e=>{let t=ip===e.id;return(0,n.jsxs)("div",{style:{marginBottom:"8px",borderRadius:"10px",background:"rgba(255,255,255,0.03)",border:"1px solid var(--surface-strong)",overflow:"hidden"},children:[(0,n.jsx)(ez,{folder:e,uid:n5,isOpen:t,onClick:()=>iu(t?null:e.id),onDelete:t=>{t.stopPropagation(),confirm(`Delete folder "${e.name}"?`)&&Y(n5,e.id)}}),t&&(0,n.jsx)("div",{style:{padding:"4px 10px 10px"},children:0===ig.length?(0,n.jsx)("p",{style:{color:"var(--fg-muted)",fontSize:"13.2px",textAlign:"center",padding:"12px 0"},children:"Empty"}):ig.map(e=>{let t,r,i=e.result||{},o="number"==typeof i.lat&&"number"==typeof i.lng,a="lens_match"===i.source||"lens_match"===e.searchMode,l=a?[i.source_domain||(i.link?(()=>{try{return new URL(i.link).hostname}catch{return i.link}})():null),i.query_image_name?`From ${i.query_image_name}`:null,o?`${i.lat.toFixed(4)}, ${i.lng.toFixed(4)}`:null,i.address||null].filter(Boolean):null;return a?(t=i.title||"Lens match",r=null):o?(t=i.location_name||(i.address?i.address.split(",").slice(0,2).join(","):`${i.lat.toFixed(3)}, ${i.lng.toFixed(3)}`),r=`${i.lat.toFixed(4)}, ${i.lng.toFixed(4)}`):(t=i.location_name||i.title||"Untitled",r=i.country||i.source_domain||""),(0,n.jsxs)("div",{onClick:()=>iN(e),style:{display:"flex",gap:"10px",alignItems:"center",padding:"8px",marginBottom:"6px",borderRadius:"14px",background:"var(--surface)",cursor:"pointer",border:"1px solid transparent",transition:"background 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.background="var(--surface-strong)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--surface)"},children:[e.thumbnail&&(0,n.jsx)("img",{src:e.thumbnail,alt:"",style:{width:"48px",height:"48px",objectFit:"cover",borderRadius:"6px",flexShrink:0}}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:"14.3px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t}),a?l.map((e,t)=>(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"12.1px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e},t)):(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"12.1px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]})]},e.id)})})]},e.id)})]})]})}),(()=>{let t=!!t5&&!eJ,r=t&&"split"===H&&!e&&"outdoor"===eH,i=t&&"split"===H&&e&&"outdoor"===eH,o=r?"100%":e?"map"===H?"100%":"0":"map"===H?"100%":"split"===H?"50%":"0",a=r?"none":"streetview"!==H||e?"block":"none",l=r?"100%":e?i?"50%":"streetview"===H?"100%":"0":"streetview"===H?"100%":"split"===H?"50%":"0",s=eO?.width||0,d=eO?.height||0,c=s&&d?s/d:1,p=c>0&&c<=1,u=p?`min(${100*c}vh, 70vw)`:"50%",g=r&&c>1226/712;return tX?.[0],tX?.length,(0,n.jsxs)("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:i?`${r7}px`:0,transition:i?"none":"all 0.3s cubic-bezier(0.25, 1, 0.5, 1)",...g?{display:"grid",gridTemplateColumns:`${u} 1fr`,gridTemplateRows:"auto 1fr"}:{display:"flex",flexDirection:r?"row":"column"}},children:[r&&tP?.preview&&(0,n.jsxs)("div",{style:g?{position:"relative",gridColumn:1,gridRow:1,alignSelf:"start",width:"100%",aspectRatio:`${s} / ${d}`,background:"#000",overflow:"hidden",transition:"aspect-ratio 0.2s ease"}:{position:"relative",width:u,height:"100%",background:"#000",overflow:"hidden",flexShrink:0,transition:"width 0.2s ease"}
305,children:[!p&&!g&&(0,n.jsx)("div",{style:{position:"absolute",inset:0,backgroundImage:`url(${tP.preview})`,backgroundSize:"cover",backgroundPosition:"center",filter:"blur(28px) saturate(1.15) brightness(0.55)",transform:"scale(1.15)",zIndex:0},"aria-hidden":!0}),(0,n.jsx)("img",{src:tP.preview,alt:"Query",style:{position:"relative",zIndex:1,width:"100%",height:"100%",objectFit:"contain",display:"block"},onLoad:e=>eU({width:e.target.naturalWidth,height:e.target.naturalHeight})})]}),(0,n.jsx)("div",{ref:nR,style:tw?{position:"fixed",top:0,right:0,bottom:0,left:60*!e,zIndex:1650,display:"block",opacity:tz,transition:"opacity 0.6s ease"}:g?{gridColumn:1,gridRow:2,width:"100%",height:"100%",display:"block",minHeight:0}:{width:r?"0":"100%",height:o,display:a,order:+("split"===H&&!r)}}),"outdoor"===eH&&(0,n.jsx)("div",{ref:nA,style:g?{gridColumn:2,gridRow:"1 / span 2",width:"100%",height:"100%",display:"block",backgroundColor:"#1a1c20",position:"relative",minHeight:0}:{width:r?"auto":"100%",flex:r||i?"1 1 auto":"none",height:r?"100%":i?"auto":l,minHeight:i?0:void 0,display:r||r?"block":"map"===H?"none":"block",backgroundColor:"#1a1c20",order:"split"!==H||r?1:0,flexShrink:r||i?1:0,position:"relative"}}),i&&tP?.preview&&(0,n.jsxs)("div",{style:{order:2,width:"100%",flexShrink:0,position:"relative",background:"#000",overflow:"hidden",lineHeight:0,...p?{height:"42vh"}:{}},children:[p&&(0,n.jsx)("div",{style:{position:"absolute",inset:0,backgroundImage:`url(${tP.preview})`,backgroundSize:"cover",backgroundPosition:"center",filter:"blur(28px) saturate(1.15) brightness(0.5)",transform:"scale(1.15)",zIndex:0},"aria-hidden":!0}),(0,n.jsx)("img",{src:tP.preview,alt:"Query",onClick:()=>ry("expand"),onLoad:e=>eU({width:e.target.naturalWidth,height:e.target.naturalHeight}),style:{position:"relative",zIndex:1,width:"100%",height:p?"100%":"auto",maxHeight:p?void 0:"42vh",objectFit:"contain",display:"block",cursor:"zoom-in"}})]}),"indoor"===eH&&(0,n.jsx)("div",{ref:nE,style:{width:"100%",height:"streetview"===H?"100%":"split"===H?"50%":"0",display:"map"===H?"none":"flex",backgroundColor:"#1a1c20",alignItems:"center",justifyContent:"center",overflow:"hidden",position:"relative"},children:t5&&t5.image_path?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("img",{src:`${ed}/api/index-image/${encodeURIComponent(t5.image_path)}`,alt:"Matched Reference",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},onError:e=>{e.target.style.display="none",e.target.nextSibling.style.display="flex"}}),(0,n.jsxs)("div",{style:{display:"none",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"var(--fg-muted)",textAlign:"center",padding:"20px"},children:[(0,n.jsx)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"#A0A0A0",style:{marginBottom:"15px"},children:(0,n.jsx)("path",{d:"M21,19V5c0-1.1-0.9-2-2-2H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14C20.1,21,21,20.1,21,19z M8.5,13.5l2.5,3.01L14.5,12l4.5,6H5L8.5,13.5z"})}),(0,n.jsx)("div",{style:{fontSize:"15.4px",fontWeight:600,marginBottom:"5px"},children:"Image not available"}),(0,n.jsx)("div",{style:{fontSize:"13.2px"},children:"Check image directory path"})]}),(0,n.jsxs)("div",{style:{position:"absolute",top:"15px",left:"15px",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(10px)",borderRadius:"8px",color:"#000000",fontSize:"14.3px",fontWeight:600},children:["Reference Image - Rank #",t5.rank,t5.verified?" \xb7 Verified":""]})]}):(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"var(--fg-muted)",textAlign:"center",padding:"20px"},children:[(0,n.jsx)("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"#A0A0A0",style:{marginBottom:"15px"},children:(0,n.jsx)("path",{d:"M21,19V5c0-1.1-0.9-2-2-2H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14C20.1,21,21,20.1,21,19z M8.5,13.5l2.5,3.01L14.5,12l4.5,6H5L8.5,13.5z"})}),(0,n.jsx)("div",{style:{fontSize:"17.6px",fontWeight:600,marginBottom:"8px"},children:"Indoor Reference View"}),(0,n.jsx)("div",{style:{fontSize:"14.3px",maxWidth:"300px"},children:T?"No reference image available for this result. Ensure the image directory path is configured.":"Search for a location to display the matched reference image from the index."})]})})]})})(),!e&&t5&&!eJ&&(()=>{let e=tX?.length||0,t=t1||0,r=t5?.address,i="split"===H;return(0,n.jsxs)("div",{style:{position:"fixed",bottom:18,...i?{right:24}:{left:"50%",transform:"translateX(-50%)"},zIndex:1100,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(20px) brightness(1.05)",WebkitBackdropFilter:"blur(20px) brightness(1.05)",color:"#fff",borderRadius:18,padding:"14px 18px",width:i?"min(680px, calc(50vw - 48px))":"min(1100px, calc(100vw - 48px))",boxSizing:"border-box",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.4), 0 0 2px 1px var(--surface) inset",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',border:"1px solid var(--surface-strong)",display:"flex",flexDirection:"column",gap:12},children:[(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",gap:12},children:(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)("div",{style:{fontSize:12.1,color:"rgba(255,255,255,0.6)",fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase"},children:"Location"}),(0,n.jsx)("div",{style:{fontSize:24,fontWeight:400,marginTop:2,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"#fff",fontFamily:'var(--font-quantico), "Quantico", sans-serif',letterSpacing:"-0.2px"},children:r||`${t5?.lat?.toFixed(4)}, ${t5?.lng?.toFixed(4)}`}),(0,n.jsxs)("div",{style:{marginTop:4,display:"flex",alignItems:"center",gap:8},children:[(0,n.jsxs)("span",{onClick:()=>{t5&&ni(t5.lat,t5.lng)},style:{fontSize:12.5,color:"rgba(255,255,255,0.6)",cursor:"pointer",userSelect:"text",WebkitUserSelect:"text"},children:[t5?.lat?.toFixed(4),", ",t5?.lng?.toFixed(4)]}),(0,n.jsx)(eg,{onClick:e=>{e.stopPropagation(),t5&&ni(t5.lat,t5.lng)},copied:ne,size:14,tint:"#cfcfcf"}),(0,n.jsx)("button",{type:"button","aria-label":"Open in Google Maps",className:"card-map-icon",onClick:e=>{e.stopPropagation(),t5&&window.open(`https://www.google.com/maps/search/?api=1&query=${t5.lat},${t5.lng}`,"_blank","noopener,noreferrer")},style:{background:"transparent",border:"none",padding:2,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsxs)("svg",{width:"14",height:"18",viewBox:"0 0 92.3 132.3",children:[(0,n.jsx)("path",{fill:"#1a73e8",d:"M60.2 2.2C55.8.8 51 0 46.1 0 32 0 19.3 6.4 10.8 16.5l21.8 18.3L60.2 2.2z"}),(0,n.jsx)("path",{fill:"#ea4335",d:"M10.8 16.5C4.1 24.5 0 34.9 0 46.1c0 8.7 1.7 15.7 4.6 22l28-33.3-21.8-18.3z"}),(0,n.jsx)("path",{fill:"#4285f4",d:"M46.2 28.5c9.8 0 17.7 7.9 17.7 17.7 0 4.3-1.6 8.3-4.2 11.4 0 0 13.9-16.6 27.5-32.7-5.6-10.8-15.3-19-27-22.7L32.6 34.8c3.3-3.8 8.1-6.3 13.6-6.3"}),(0,n.jsx)("path",{fill:"#fbbc04",d:"M46.2 63.8c-9.8 0-17.7-7.9-17.7-17.7 0-4.3 1.5-8.3 4.1-11.3l-28 33.3c4.8 10.6 12.8 19.2 21 29.9l34.1-40.5c-3.3 3.9-8.1 6.3-13.5 6.3"}),(0,n.jsx)("path",{fill:"#34a853",d:"M59.1 109.2c15.4-24.1 33.3-35 33.3-63 0-7.7-1.9-14.9-5.2-21.3L25.6 98c2.6 3.4 5.3 7.3 7.9 11.3 9.4 14.5 6.8 23.1 12.8 23.1s3.4-8.7 12.8-23.2"})]})}),(0,n.jsx)("button",{type:"button","aria-label":"Open in Apple Maps",className:"card-map-icon",onClick:e=>{e.stopPropagation(),t5&&window.open(`https://maps.apple.com/?ll=${t5.lat},${t5.lng}&q=${t5.lat},${t5.lng}`,"_blank","noopener,noreferrer")},style:{background:"transparent",border:"none",padding:2,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:"14",height:"18",viewBox:"0 0 814 1000",children:(0,n.jsx)("path",{fill:"#ffffff",d:"M788.1 340.9c-
3055.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z"})})})]})]})}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[e>0&&(0,n.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 10px",background:"rgba(255,255,255,0.08)",borderRadius:999,border:"none"},children:[(0,n.jsx)("button",{type:"button",onClick:()=>ox("prev"),disabled:0===t,style:{width:26,height:26,padding:0,background:"transparent",border:"none",cursor:0===t?"not-allowed":"pointer",opacity:0===t?.35:1,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",style:{transform:"rotate(180deg)"},children:(0,n.jsx)("path",{fill:"#fff",d:"M15.75,9.525,11.164,4.939A1.5,1.5,0,0,0,9.043,7.061l4.586,4.585a.5.5,0,0,1,0,.708L9.043,16.939a1.5,1.5,0,0,0,2.121,2.122l4.586-4.586A3.505,3.505,0,0,0,15.75,9.525Z"})})}),(0,n.jsxs)("span",{style:{fontSize:13,fontWeight:600,minWidth:82,textAlign:"center",color:"#fff"},children:["Result ",t+1," / ",e]}),(0,n.jsx)("button",{type:"button",onClick:()=>ox("next"),disabled:t>=e-1,style:{width:26,height:26,padding:0,background:"transparent",border:"none",cursor:t>=e-1?"not-allowed":"pointer",opacity:t>=e-1?.35:1,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{fill:"#fff",d:"M15.75,9.525,11.164,4.939A1.5,1.5,0,0,0,9.043,7.061l4.586,4.585a.5.5,0,0,1,0,.708L9.043,16.939a1.5,1.5,0,0,0,2.121,2.122l4.586-4.586A3.505,3.505,0,0,0,15.75,9.525Z"})})})]}),rZ&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eR,{onClick:on,disabled:iR&&(t7||re||tb),locked:!iR,label:t7?"Reranked â":re?"Rerankingâ¦":"Rerank images"}),(0,n.jsx)(eR,{onClick:ol,disabled:ri||ra||tb,locked:!1,label:ri?`Top 30 â`:ra?"Loadingâ¦":"Show More Results"})]}),(0,n.jsx)("div",{style:{flex:1,minWidth:8}}),(0,n.jsx)(eF,{onClick:()=>iO(null),disabled:ix||!n5,saving:ix}),(0,n.jsx)(eA,{onClick:()=>{(0,h.u4)("pdf_export_click"),a(tP,tX,t5)}})]})]})})(),!e&&t5&&!eJ&&(0,n.jsx)("button",{type:"button",onClick:()=>{tr&&(eK(tr.globalSearchResult),tl(tr.globalCandidates||[]),td(tr.expandedCardIdx??0),tn(null),na(!0)),t0([]),t2(0),rD(""),K("map"),B(!1),na(!1),r0(null);try{rH.current.forEach(e=>e.remove()),rP([])}catch(e){}if(n$.current)try{n$.current.flyTo({center:iA,zoom:window.innerWidth<=767?.6:1.4,pitch:0,bearing:0,duration:900,essential:!0})}catch(e){}},"aria-label":"Close",style:{position:"fixed",top:14,right:14,zIndex:1101,width:36,height:36,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(20px) brightness(1.05)",WebkitBackdropFilter:"blur(20px) brightness(1.05)",border:"none",borderRadius:"50%",color:"#fff",fontSize:18,cursor:"pointer",fontFamily:"inherit",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,lineHeight:1,boxShadow:"0 6px 18px rgba(0,0,0,0.4)"},children:"\xd7"}),!e&&t5&&!eJ&&(0,n.jsx)("div",{style:{position:"fixed",top:14,right:60,zIndex:1101},children:(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",padding:"3px",gap:"3px",height:36,boxSizing:"border-box",backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(20px) brightness(1.05)",WebkitBackdropFilter:"blur(20px) brightness(1.05)",borderRadius:"999px",border:"1px solid var(--surface-strong)",position:"relative",boxShadow:"0 6px 18px rgba(0,0,0,0.4)"},children:[(0,n.jsx)("div",{id:"desktop-view-toggle-pill",style:{position:"absolute",top:"3px",width:"30px",height:"30px",backgroundColor:"var(--fg)",borderRadius:"999px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:1,boxShadow:"0 2px 12px var(--border-strong)"}}),[{key:"split",label:"Split view",icon:(0,n.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"
305currentColor",children:(0,n.jsx)("path",{d:"m9,9H2c-1.103,0-2-.897-2-2v-2C0,2.243,2.243,0,5,0h4c1.103,0,2,.897,2,2v5c0,1.103-.897,2-2,2Zm10,15h-4c-1.103,0-2-.897-2-2v-5c0-1.103.897-2,2-2h7c1.103,0,2,.897,2,2v2c0,2.757-2.243,5-5,5Zm3-11h-7c-1.103,0-2-.897-2-2V2c0-1.103.897-2,2-2h4c2.757,0,5,2.243,5,5v6c0,1.103-.897,2-2,2Zm-13,11h-4c-2.757,0-5-2.243-5-5v-6c0-1.103.897-2,2-2h7c1.103,0,2,.897,2,2v9c0,1.103-.897,2-2,2Z"})})},{key:"map",label:"Map view",icon:(0,n.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M12,12A4,4,0,1,0,8,8,4,4,0,0,0,12,12Zm0-6a2,2,0,1,1-2,2A2,2,0,0,1,12,6Zm8.66,3.157-.719-.239A8,8,0,0,0,12,0,7.993,7.993,0,0,0,4.086,9.092a5.045,5.045,0,0,0-2.548,1.3A4.946,4.946,0,0,0,0,14v4.075a5.013,5.013,0,0,0,3.6,4.8l2.87.9A4.981,4.981,0,0,0,7.959,24a5.076,5.076,0,0,0,1.355-.186l5.78-1.71a2.987,2.987,0,0,1,1.573,0l2.387.8A4,4,0,0,0,24,19.021V13.872A5.015,5.015,0,0,0,20.66,9.156ZM7.758,3.762a5.987,5.987,0,0,1,8.484,0,6.037,6.037,0,0,1,.011,8.5L12.7,15.717a.992.992,0,0,1-1.389,0L7.758,12.277A6.04,6.04,0,0,1,7.758,3.762ZM22,19.021a1.991,1.991,0,0,1-.764,1.572,1.969,1.969,0,0,1-1.626.395L17.265,20.2a5.023,5.023,0,0,0-2.717-.016L8.764,21.892a3,3,0,0,1-1.694-.029l-2.894-.9A3.013,3.013,0,0,1,2,18.075V14a2.964,2.964,0,0,1,.92-2.163,3.024,3.024,0,0,1,1.669-.806A8.021,8.021,0,0,0,6.354,13.7l3.567,3.453a2.983,2.983,0,0,0,4.174,0l3.563-3.463a7.962,7.962,0,0,0,1.813-2.821l.537.178A3.006,3.006,0,0,1,22,13.872Z"})})},{key:"streetview",label:"Street View",icon:(0,n.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)("path",{d:"m11.994 7h.012c1.896-.011 2.959-1.068 2.994-3.012-.033-1.858-1.151-2.976-3.004-2.988-1.868.011-2.961 1.096-2.996 3.013.036 1.915 1.1 2.976 2.994 2.987z"}),(0,n.jsx)("path",{d:"m17.949 13.564c-.073.731-.224 1.375-.449 1.91v2.026c0 1.93-1.57 3.5-3.5 3.5-.743 0-1.433-.232-2-.629-.567.396-1.257.629-2 .629-1.93 0-3.5-1.57-3.5-3.5v-2.025c-.224-.532-.375-1.171-.448-1.899-2.203.608-4.052 1.857-4.052 4.424 0 5 7.008 5 10 5 4.945 0 10-.594 10-5 0-2.54-1.68-3.813-4.051-4.436z"}),(0,n.jsx)("path",{d:"m8.5 17.5c0 .828.672 1.5 1.5 1.5s1.5-.672 1.5-1.5v-2h1v2c0 .828.672 1.5 1.5 1.5s1.5-.672 1.5-1.5v-2.5c.058-.091.5-.733.5-2.5s-.357-3.268-.372-3.331c-.08-.33-.32-.597-.641-.709-.053-.019-1.322-.46-2.987-.46-1.679 0-2.938.442-2.991.461-.317.113-.557.379-.636.708-.016.063-.373 1.565-.373 3.332s.442 2.409.5 2.5v2.5z"})]})}].map(e=>(0,n.jsx)("button",{"aria-label":e.label,title:e.label,ref:t=>{if(t&&H===e.key){let e=document.getElementById("desktop-view-toggle-pill");e&&(e.style.left=`${t.offsetLeft}px`,e.style.width=`${t.offsetWidth}px`)}},onClick:()=>K(e.key),style:{width:"30px",height:"30px",borderRadius:"50%",background:"transparent",border:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",position:"relative",zIndex:2,padding:0,color:H===e.key?"#000000":"rgba(255,255,255,0.7)",transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:e.icon},e.key))]})}),(e7||te)&&(0,n.jsx)("div",{onDragOver:e=>{e.preventDefault(),e9(!0)},onDrop:e=>{e.preventDefault(),e9(!1);let t=Array.from(e.dataTransfer?.files||[]).filter(e=>e.type.startsWith("image/")||iJ(e));t.length&&(iQ(t[0]),"global"===eE&&t.slice(1,4).forEach(e=>i1(e)),tt(!0))},onClick:()=>{e7||tt(!1)},style:{position:"fixed",inset:0,zIndex:1600,background:"rgba(0,0,0,0.5)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",display:"flex",alignItems:"center",justifyContent:"center",padding:24,animation:"fadeIn 0.2s ease-out"},children:(0,n.jsx)("div",{onClick:e=>e.stopPropagation(),style:{width:"min(440px, 92vw)",maxHeight:"88vh",overflowY:"auto",background:"hsl(0 0% 0% / 0.55)",backdropFilter:"blur(20px) brightness(1.05)",WebkitBackdropFilter:"blur(20px) brightness(1.05)",border:"1px solid var(--surface-strong)",borderRadius:18,boxShadow:"0 8px 32px rgba(0, 0, 0, 0.4), 0 0 2px 1px var(--surface) inset",padding:22,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',animation:"fadeIn 0.25s ease-out"},children:(()=>{let e=!!tP?.preview,t=(e,t,r,n)=>{e.currentTarget.style.background=t?n:r};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,n.jsx)("h2",{style:{color:"var(--fg)",fontSize:22,fontWeight:700,margin:0},children:e?"Analyze Image":"Drop Image"}),(0,n.jsx)("button",{type:"button",onClick:()=>{tt(!1),e9(!1)},"aria-label":"Close",style:{width:30,height:30,background:"rgba(255,255,255,0.08)",border:"none",borderRadius:"50%",color:"var(--fg)",fontSize:16,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,transition:"background 0.15s ease"},onMouseEnter:e=>t(e,!0,"rgba(255,255,255,0.08)","rgba(255,255,255,0.16)"),onMouseLeave:e=>t(e,!1,"rgba(255,255,255,0.08)","rgba(255,255,255,0.16)"),children:"\xd7"})]}),e?(0,n.jsxs)("div",{style:{position:"relative",borderRadius:14,overflow:"hidden",margin:"0 auto 16px",background:"rgba(0,0,0,0.35)",animation:"fadeIn 0.3s ease-out",width:"fit-content",maxWidth:"100%"},children:[(0,n.jsx)("img",{src:tP.preview,alt:"Query",style:{display:"block",width:"auto",height:"auto",maxWidth:"100%",maxHeight:"38vh",borderRadius:14}}),(0,n.jsxs)("div",{style:{position:"absolute",top:8,right:8,display:"flex",gap:6},children:[(0,n.jsx)("button",{type:"button","aria-label":"Crop",onClick:e=>{e.stopPropagation(),rj({x:0,y:0,width:100,height:100}),ry("crop")},style:{width:30,height:30,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",border:"none",borderRadius:"50%",color:"#fff",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"background 0.15s ease"},onMouseEnter:e=>t(e,!0,"rgba(0,0,0,0.6)","rgba(0,0,0,0.85)"),onMouseLeave:e=>t(e,!1,"rgba(0,0,0,0.6)","rgba(0,0,0,0.85)"),children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#fff",children:(0,n.jsx)("path",{d:"M22.5,17H20V8.5A4.5,4.5,0,0,0,15.5,4H7V1.5A1.5,1.5,0,0,0,5.5,0h0A1.5,1.5,0,0,0,4,1.5V4H1.5A1.5,1.5,0,0,0,0,5.5H0A1.5,1.5,0,0,0,1.5,7H4v8.5A4.5,4.5,0,0,0,8.5,20H17v2.5A1.5,1.5,0,0,0,18.5,24h0A1.5,1.5,0,0,0,20,22.5V20h2.5A1.5,1.5,0,0,0,24,18.5h0A1.5,1.5,0,0,0,22.5,17Zm-14,0A1.5,1.5,0,0,1,7,15.5V7h8.5A1.5,1.5,0,0,1,17,8.5V17Z"})})}),(0,n.jsx)("button",{type:"button",onClick:()=>nB.current?.click(),style:{padding:"6px 12px",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",border:"none",borderRadius:999,color:"#fff",fontSize:12,fontWeight:600,cursor:"pointer",transition:"background 0.15s ease"},onMouseEnter:e=>t(e,!0,"rgba(0,0,0,0.6)","rgba(0,0,0,0.85)"),onMouseLeave:e=>t(e,!1,"rgba(0,0,0,0.6)","rgba(0,0,0,0.85)"),children:"Replace"})]})]}):(0,n.jsxs)("div",{onClick:()=>nB.current?.click(),style:{border:"none",borderRadius:14,padding:"52px 15px",textAlign:"center",cursor:"pointer",backgroundColor:e7?"var(--border)":"var(--surface)",transition:"background 0.2s ease"},children:[(0,n.jsxs)("svg",{width:"44",height:"44",viewBox:"0 0 512 512",fill:"var(--fg)",style:{margin:"0 auto 12px"},children:[(0,n.jsx)("path",{d:"M165.558,141.889l59.328-59.349l0.448,290.816c0,17.673,14.327,32,32,32l0,0c17.673,0,32-14.327,32-32l-0.448-290.453 l58.987,58.987c12.278,12.712,32.536,13.064,45.248,0.786s13.064-32.536,0.786-45.248c-0.258-0.267-0.52-0.529-0.786-0.786 l-68.523-68.523c-37.49-37.491-98.274-37.491-135.765-0.001c0,0-0.001,0.001-0.001,0.001L120.31,9
3056.641 c-12.278,12.712-11.926,32.97,0.786,45.248C133.497,153.866,153.157,153.866,165.558,141.889z"}),(0,n.jsx)("path",{d:"M480.011,309.355c-17.673,0-32,14.327-32,32v97.941c-0.012,4.814-3.911,8.714-8.725,8.725H72.736 c-4.814-0.012-8.714-3.911-8.725-8.725v-97.941c0-17.673-14.327-32-32-32s-32,14.327-32,32v97.941 c0.047,40.146,32.58,72.678,72.725,72.725h366.549c40.146-0.047,72.678-32.58,72.725-72.725v-97.941 C512.011,323.682,497.684,309.355,480.011,309.355z"})]}),(0,n.jsx)("p",{style:{color:"var(--fg)",fontSize:15,marginBottom:3},children:"Drop or Click to Upload"}),(0,n.jsx)("p",{style:{color:"var(--fg-muted)",fontSize:12},children:"JPG, PNG, HEIC, WEBP"})]}),e&&(0,n.jsxs)("div",{style:{overflow:"hidden",animation:"modalReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) both"},children:[(0,n.jsxs)("div",{style:{position:"relative",display:"flex",gap:6,padding:4,background:"var(--surface)",borderRadius:999,border:"1px solid var(--surface-strong)",margin:"16px 0 14px"},children:[(0,n.jsx)("div",{id:"modal-mode-pill",style:{position:"absolute",top:4,height:"calc(100% - 8px)",backgroundColor:"var(--fg)",borderRadius:999,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:1,boxShadow:"0 2px 12px var(--border-strong)"}}),[{key:"global",label:"Global"},{key:"index",label:"City Search"}].map(e=>(0,n.jsx)("button",{type:"button",ref:t=>{if(t&&eE===e.key){let e=document.getElementById("modal-mode-pill");e&&(e.style.left=`${t.offsetLeft}px`,e.style.width=`${t.offsetWidth}px`)}},onClick:()=>{"index"===e.key?iL():e$(e.key)},style:{flex:1,padding:"8px 14px",background:"transparent",border:"none",borderRadius:999,color:eE===e.key?"#000":"rgba(255,255,255,0.7)",fontSize:13,fontWeight:eE===e.key?700:600,cursor:"pointer",fontFamily:"inherit",position:"relative",zIndex:2,transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:e.label},e.key))]}),"global"===eE&&(0,n.jsxs)("div",{style:{marginBottom:14},children:[(0,n.jsx)("label",{style:{display:"block",color:"var(--fg-muted)",fontSize:11,fontWeight:600,marginBottom:6,textTransform:"uppercase"},children:"Effort"}),(0,n.jsxs)("div",{style:{position:"relative",display:"flex",gap:6,padding:4,background:"var(--surface)",borderRadius:999,border:"1px solid var(--surface-strong)"},children:[(0,n.jsx)("div",{id:"modal-effort-pill",style:{position:"absolute",top:4,height:"calc(100% - 8px)",backgroundColor:"var(--fg)",borderRadius:999,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:1,boxShadow:"0 2px 12px var(--border-strong)"}}),[{key:"instant",label:"Instant"},{key:"low",label:"Low"},{key:"medium",label:"Medium"},{key:"high",label:"High"}].map(e=>(0,n.jsx)("button",{type:"button",ref:t=>{if(t&&eB===e.key){let e=document.getElementById("modal-effort-pill");e&&(e.style.left=`${t.offsetLeft}px`,e.style.width=`${t.offsetWidth}px`)}},onClick:()=>{if(iI(e.key)){(0,h.u4)("upgrade_modal_open",{reason:"effort_locked",mode:"global",thinking_mode:e.key,surface:"effort_picker"}),tA("pro_feature"),tF(!0);return}eP(e.key)},style:{flex:1,padding:"8px 6px",background:"transparent",border:"none",borderRadius:999,color:eB===e.key?"#000":"rgba(255,255,255,0.7)",fontSize:12.5,fontWeight:eB===e.key?700:600,cursor:"pointer",fontFamily:"inherit",position:"relative",zIndex:2,transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:e.label},e.key))]})]}),"global"===eE&&(0,n.jsxs)("div",{style:{marginBottom:14},children:[(0,n.jsx)("label",{style:{display:"block",color:"var(--fg-muted)",fontSize:11,fontWeight:600,marginBottom:6,textTransform:"uppercase"},children:"Additional Context"}),(0,n.jsx)("textarea",{value:tx,onChange:e=>{tm(e.target.value);let t=e.target;t.style.height="auto";let r=parseFloat(getComputedStyle(t).lineHeight)||20;t.style.height=Math.min(t.scrollHeight,5*r+20)+"px"},placeholder:"Optional: provide any info you already know",rows:1,style:{width:"100%",padding:"10px 16px",background:"var(--surface)",border:"none",borderRadius:20,color:"rgba(255,255,255,0.85)",fontSize:14.3,fontFamily:"inherit",resize:"none",outline:"none",lineHeight:1.4,boxSizing:"border-box",overflow:"hidden",display:"block"}})]}),"index"===eE&&og({marginBottom:14}),"index"===eE&&ou({marginTop:0}),(0,n.jsx)("button",{type:"button",onClick:()=>{tt(!1),e9(!1),od()},disabled:!tP||tb,style:{width:"100%",padding:14,background:tP&&!tb?"var(--fg)":"var(--surface-strong)",border:"none",borderRadius:999,color:tP&&!tb?"#000":"var(--fg-muted)",fontSize:15,fontWeight:700,cursor:tP&&!tb?"pointer":"not-allowed",fontFamily:"inherit",transition:"background 0.2s ease, color 0.2s ease"},onMouseEnter:e=>{tP&&!tb&&(e.currentTarget.style.background="#e6e6e6")},onMouseLeave:e=>{tP&&!tb&&(e.currentTarget.style.background="var(--fg)")},children:"Analyze Location"})]})]})})()})}),tw&&(0,n.jsx)("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:60*!e,zIndex:1660,pointerEvents:tv?"auto":"none"}}),tw&&(0,n.jsxs)("div",{style:{position:"fixed",left:0,right:0,bottom:"11%",zIndex:1700,display:"flex",flexDirection:"column",alignItems:"center",gap:10,textAlign:"center",pointerEvents:"none",opacity:tS,transition:"opacity 0.6s ease",textShadow:"0 2px 18px rgba(0,0,0,0.85)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:[(0,n.jsx)("div",{style:{color:"#fff",fontSize:26,fontWeight:700,fontFamily:'var(--font-quantico), "Quantico", sans-serif',letterSpacing:"-0.2px"},children:"Searching the globe"}),(0,n.jsx)("div",{style:{color:"rgba(255,255,255,0.8)",fontSize:14},children:"Analyzing your image with AIâ¦"}),(0,n.jsx)("div",{style:{marginTop:6,width:140,height:3,borderRadius:3,background:"rgba(255,255,255,0.18)",overflow:"hidden"},children:(0,n.jsx)("div",{style:{width:"40%",height:"100%",borderRadius:3,background:"rgba(255,255,255,0.85)",animation:"loaderShimmer 1.2s ease-in-out infinite"}})}),(0,n.jsx)("style",{children:"@keyframes loaderShimmer { 0% { transform: translateX(-120%); } 100% { transform: translateX(350%); } }"})]}),tb&&(0,n.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:1500,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)",backdropFilter:"blur(4px)"},children:[(0,n.jsx)(w.A,{size:288,style:{marginBottom:20}}),(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:"19.8px",fontWeight:700,marginBottom:"6px"},children:rq.title}),(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"14.3px"},children:rq.sub})]}),e&&!tb&&nQ&&(0,n.jsxs)("div",{ref:nU,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:1002,backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(16px)",borderRadius:"20px 20px 0 0",maxHeight:r3?ob?"55vh":"75vh":"110px",transition:"max-height 0.3s cubic-bezier(0.25, 1, 0.5, 1)",overflow:"hidden",boxShadow:"0 -4px 30px rgba(0,0,0,0.5)",display:"flex",flexDirection:"column",touchAction:"none"},children:[(0,n.jsx)("div",{ref:nV,onClick:()=>r4(!r3),onTouchStart:iZ,onTouchEnd:iq,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"10px 20px 6px",cursor:"grab",flexShrink:0,touchAction:"none"},children:(0,n.jsx)("div",{style:{width:"40px",height:"4px",borderRadius:"2px",backgroundColor:"rgba(255,255,255,0.3)"}})}),!r3&&(()=>{let e=(e,t,r,i="var(--fg-muted)")=>{let o=r6===r;return(0,n.jsxs)("button",{onClick:()=>{r8(r),r4(!0)},style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"3px",padding:"6px",background:"transparent",border:"none",color:o?"var(--fg)":i,cursor:"pointer",borderRadius:"10px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',fontSize:"10.5px",fontWeight:600,letterSpacing:"0.3px"},children:[t,(0,n.jsx)("span",{children:e})]})};return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-around",padding:"4px 12px 14px",flexShrink:0,gap:"4px"},children:[e("Search",(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 513.749 513.749",fill:"
305currentColor",children:(0,n.jsx)("path",{d:"M504.352,459.061l-99.435-99.477c74.402-99.427,54.115-240.344-45.312-314.746S119.261-9.277,44.859,90.15 S-9.256,330.494,90.171,404.896c79.868,59.766,189.565,59.766,269.434,0l99.477,99.477c12.501,12.501,32.769,12.501,45.269,0 c12.501-12.501,12.501-32.769,0-45.269L504.352,459.061z M225.717,385.696c-88.366,0-160-71.634-160-160s71.634-160,160-160 s160,71.634,160,160C385.623,314.022,314.044,385.602,225.717,385.696z"})}),"search",tP?"var(--fg)":"var(--fg-muted)"),e("History",(0,n.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),(0,n.jsx)("path",{d:"M3 3v5h5"}),(0,n.jsx)("path",{d:"M12 7v5l3 2"})]}),"history"),e("Folders",(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),"folders"),T&&e("Results",(0,n.jsxs)("span",{style:{position:"relative",display:"inline-flex"},children:[(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M19,3H5C3.897,3,3,3.897,3,5v14c0,1.103,0.897,2,2,2h14c1.103,0,2-0.897,2-2V5C21,3.897,20.103,3,19,3z M9,17H7v-7h2V17z M13,17h-2V7h2V17z M17,17h-2v-4h2V17z"})}),(0,n.jsx)("span",{style:{position:"absolute",top:"-2px",right:"-3px",width:"7px",height:"7px",borderRadius:"50%",backgroundColor:"#FFD86B"}})]}),"results","var(--fg)")]})})(),r3&&(0,n.jsxs)("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden"},children:["search"===r6&&(0,n.jsxs)("div",{style:{padding:"12px 16px"},children:[(0,n.jsx)("div",{style:{marginBottom:"12px"},children:(0,n.jsxs)("div",{style:{display:"flex",padding:"4px",backgroundColor:"var(--surface)",borderRadius:"999px",border:"1px solid var(--surface-strong)",position:"relative",boxSizing:"border-box"},children:[(0,n.jsx)("div",{id:"search-mode-pill-mobile",style:{position:"absolute",top:"4px",height:"calc(100% - 8px)",backgroundColor:"var(--fg)",borderRadius:"999px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:1,boxShadow:"0 2px 12px var(--border-strong)"}}),[{key:"global",label:"Global"},{key:"index",label:"City Search"}].map(e=>(0,n.jsx)("button",{ref:t=>{if(t&&eE===e.key){let e=document.getElementById("search-mode-pill-mobile");e&&(e.style.left=`${t.offsetLeft}px`,e.style.width=`${t.offsetWidth}px`)}},onClick:()=>{"index"===e.key?iL():e$(e.key)},style:{flex:1,padding:"8px 14px",background:"transparent",border:"none",borderRadius:"999px",color:eE===e.key?"#000000":"rgba(255,255,255,0.7)",fontSize:"13px",fontWeight:eE===e.key?700:600,cursor:"pointer",transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',position:"relative",zIndex:2},children:e.label},e.key))]})}),"global"===eE&&(0,n.jsxs)("div",{style:{marginBottom:"12px"},children:[(0,n.jsxs)("div",{style:{display:"flex",padding:"4px",backgroundColor:"var(--surface)",borderRadius:"999px",border:"1px solid var(--surface-strong)",position:"relative",boxSizing:"border-box"},children:[(0,n.jsx)("div",{id:"thinking-mode-pill-mobile",style:{position:"absolute",top:"4px",height:"calc(100% - 8px)",backgroundColor:"var(--fg)",borderRadius:"999px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:1,boxShadow:"0 2px 12px var(--border-strong)"}}),[{key:"instant",label:"Instant"},{key:"low",label:"Low"},{key:"medium",label:"Medium"},{key:"high",label:"High"}].map(e=>(0,n.jsxs)("button",{ref:t=>{if(t&&eB===e.key){let e=document.getElementById("thinking-mode-pill-mobile");e&&(e.style.left=`${t.offsetLeft}px`,e.style.width=`${t.offsetWidth}px`)}},onClick:()=>{if(iI(e.key)){(0,h.u4)("upgrade_modal_open",{reason:"effort_locked",mode:"global",thinking_mode:e.key,surface:"effort_picker"}),tA("pro_feature"),tF(!0);return}eP(e.key)},style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"3px",whiteSpace:"nowrap",padding:"8px 6px",background:"transparent",border:"none",borderRadius:"999px",color:eB===e.ke
305y?"#000000":"rgba(255,255,255,0.7)",fontSize:"12px",fontWeight:eB===e.key?700:600,cursor:"pointer",transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',position:"relative",zIndex:2},children:[e.label,iI(e.key)&&(0,n.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,opacity:.65},"aria-label":"Pro only",children:[(0,n.jsx)("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),(0,n.jsx)("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]})]},e.key))]}),(0,n.jsx)("div",{style:{display:"flex",marginTop:"4px",paddingLeft:"3px",paddingRight:"3px",fontSize:"10.5px",fontStyle:"italic",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:[{key:"instant",eta:"~5s"},{key:"low",eta:"~20s"},{key:"medium",eta:"~30s"},{key:"high",eta:"~60s"}].map(e=>(0,n.jsx)("div",{style:{flex:1,textAlign:"center",color:eB===e.key?"rgba(255,255,255,0.85)":"var(--fg-muted)"},children:e.eta},e.key))})]}),"index"===eE&&og({marginBottom:"14px"}),"index"===eE&&ou({marginTop:0}),"global"===eE&&(0,n.jsxs)("div",{style:{marginBottom:"14px"},children:[(0,n.jsx)("label",{style:{display:"block",color:"var(--fg-muted)",fontSize:"11px",fontWeight:600,marginBottom:"6px",textTransform:"uppercase"},children:"Additional Context"}),(0,n.jsx)("textarea",{value:tx,onChange:e=>{tm(e.target.value);let t=e.target;t.style.height="auto";let r=parseFloat(getComputedStyle(t).lineHeight)||20;t.style.height=Math.min(t.scrollHeight,5*r+20)+"px"},placeholder:"Optional: provide any info you already know",rows:1,style:{width:"100%",padding:"10px 16px",backgroundColor:"var(--surface)",border:"none",borderRadius:"20px",color:"rgba(255,255,255,0.85)",fontSize:"14.3px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',resize:"none",outline:"none",lineHeight:"1.4",boxSizing:"border-box",overflow:"hidden",display:"block"}})]}),(0,n.jsx)("label",{style:{display:"block",color:"var(--fg-muted)",fontSize:"11px",fontWeight:600,marginBottom:"6px",textTransform:"uppercase"},children:"Upload Image"}),tP?(0,n.jsxs)("div",{style:{position:"relative",borderRadius:"10px",overflow:"hidden",marginBottom:"14px",containerType:"inline-size",maxHeight:"min(calc(100cqi * 1.08), 36vh)",background:"rgba(0,0,0,0.35)"},children:[(0,n.jsx)("img",{src:tP.preview,alt:"Preview",style:{width:"100%",height:"auto",display:"block"}}),tP?.file&&eV&&(0,n.jsxs)("div",{style:{position:"absolute",bottom:"8px",left:"8px",display:"flex",alignItems:"center",gap:"6px",maxWidth:"calc(100% - 16px)",padding:"5px 9px",borderRadius:"8px",background:"rgba(234,179,8,0.5)",backdropFilter:"blur(6px)"},title:"Low-resolution image - may reduce accuracy",children:[(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"#fff",style:{flexShrink:0},"aria-hidden":"true",children:(0,n.jsx)("path",{d:"M13.5,10.5v5c0,.83-.67,1.5-1.5,1.5s-1.5-.67-1.5-1.5v-5c0-.83,.67-1.5,1.5-1.5s1.5,.67,1.5,1.5Zm-1.5,8.5c-.83,0-1.5,.67-1.5,1.5s.67,1.5,1.5,1.5,1.5-.67,1.5-1.5-.67-1.5-1.5-1.5Zm11.05-4.19L15.31,2.73c-.75-1.08-1.99-1.73-3.31-1.73s-2.56,.65-3.34,1.78L.99,14.76c-1.09,1.56-1.29,3.45-.52,4.92,.77,1.48,2.34,2.32,4.32,2.32h1.72c.83,0,1.5-.67,1.5-1.5s-.67-1.5-1.5-1.5h-1.72c-.48,0-1.33-.09-1.66-.71-.25-.48-.13-1.17,.35-1.87L11.15,4.44c.28-.4,.69-.44,.85-.44s.57,.04,.82,.39l7.74,12.08c.45,.64,.57,1.34,.32,1.82-.32,.62-1.18,.71-1.66,.71h-1.72c-.83,0-1.5,.67-1.5,1.5s.67,1.5,1.5,1.5h1.72c1.97,0,3.55-.85,4.32-2.32,.77-1.47,.57-3.36-.48-4.87Z"})}),(0,n.jsx)("span",{style:{color:"#fff",fontSize:"10.5px",fontWeight:600,lineHeight:1.25},children:"Low-res - may reduce accuracy"})]}),(0,n.jsxs)("div",{style:{position:"absolute",top:"8px",right:"8px",display:"flex",gap:"6px"},children:[(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),rj({x:0,y:0,width:100,height:100}),ry("crop")},"aria-label":"Crop image",style:{width:"32px",height:"32px",backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(10px)",border:"none",borderRadius:"50%",color:"var(--fg)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"var(--fg)",children:(0,n.jsx)("path",{d:"M22.5,17H20V8.5A4.5,4.5,0,0,0,15.5,4H7V1.5A1.5,1.5,0,0,0,5.5,0h0A1.5,1.5,0,0,0,4,1.5V4H1.5A1.5,1.5,0,0,0,0,5.5H0A1.5,1.5,0,0,0,1.5,7H4v8.5A4.5,4.5,0,0,0,8.5,20H17v2.5A1.5,1.5,0,0,0,18.5,24h0A1.5,1.5,0,0,0,20,22.5V20h2.5A1.5,1.5,0,0,0,24,18.5h0A1.5,1.5,0,0,0,22.5,17Zm-14,0A1.5,1.5,0,0,1,7,15.5V7h8.5A1.5,1.5,0,0,1,17,8.5V17Z"})})}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),tH(null),ns(null),nu(!1)},"aria-label":"Remove image",style:{width:"32px",height:"32px",backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(10px)",border:"none",borderRadius:"50%",color:"var(--fg)",fontSize:"15.4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"â"})]})]}):(0,n.jsxs)("div",{onClick:()=>nB.current?.click(),style:{padding:"40px 20px",borderRadius:"10px",border:"none",backgroundColor:"var(--surface)",textAlign:"center",marginBottom:"14px",cursor:"pointer"},children:[(0,n.jsx)("div",{style:{color:"rgba(255,255,255,0.3)",fontSize:"14.3px"},children:"Tap to upload image"}),(0,n.jsx)("div",{style:{color:"var(--border-strong)",fontSize:"12.1px",marginTop:"4px"},children:"JPG, PNG, HEIC, WEBP"})]}),(0,n.jsx)("button",{onClick:od,disabled:!tP||tb,style:{width:"100%",padding:"12px",backgroundColor:tP&&!tb?"var(--fg)":"var(--border)",border:"none",borderRadius:"8px",color:tP&&!tb?"#000000":"var(--fg)",fontSize:"15.4px",fontWeight:700,cursor:tP&&!tb?"pointer":"not-allowed",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginBottom:"20px"},children:tb?re?"Rerankingâ¦":ra?"Loading moreâ¦":"Analyzing...":"Analyze Location"})]}),"results"===r6&&(()=>{let e='var(--font-quantico), "Quantico", sans-serif',t='var(--font-instrument-serif), "Instrument Serif", Georgia, serif',r={color:"var(--fg-muted)",fontSize:"10.5px",fontWeight:600,textTransform:"uppercase",letterSpacing:"1.3px",marginBottom:"6px",fontFamily:t},i=(0,n.jsx)("div",{style:{height:"1px",background:"rgba(255,255,255,0.07)",margin:"14px 0"}});if(tP&&eJ){if("multi"===eQ&&e0){let o,a,l,s,d=e0.results||[],c=0===d.length?0:Math.min(Math.max(0,e3),d.length-1),p=d[c];return(0,n.jsxs)("div",{style:{padding:"16px 18px 24px"},children:[(0,n.jsx)("button",{type:"button",onClick:()=>{eX("global"),e1(null),e4(0)},style:{marginBottom:14,padding:"6px 0",background:"transparent",border:"none",color:"var(--fg-muted)",cursor:"pointer",fontSize:13,fontFamily:t},children:"â Back to global results"}),0===d.length?(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:14,padding:"12px 0"},children:"No results from the searched indexes."}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{marginBottom:10,fontSize:12,color:"var(--fg-muted)"},children:["Result ",c+1," of ",d.length]}),(o=p.lat,a=p.lng,(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:r,children:"Coordinates"}),(0,n.jsxs)("button",{type:"button",onClick:()=>ni(o,a),style:{display:"flex",alignItems:"center",gap:"8px",background:"transparent",border:"none",padding:0,color:"var(--fg)",fontSize:"22px",fontFamily:e,fontWeight:400,cursor:"pointer",textAlign:"left",userSelect:"text",WebkitUserSelect:"text"},"aria-label":"Copy coordinates",children:[(0,n.jsxs)("span",{style:{letterSpacing:"0.2px"},children:[o.toFixed(6),", ",a.toFixed(6)]}),(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--fg-muted)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,n.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,n.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]}),ne&&(0,n.jsx)("div",{style:{marginTop:"4px",fontSize:"11.5px",color:"#7ED957",fontFamily:e,fontStyle:"italic"},children:"Copied"})]})),i,(l=p.lat,s=p.lng,(0,n.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[(0,n.jsxs)("button",{type:"button",onClick:()=>window.open(`https://www.google.com/maps/search/?api=1&query=${l},${s}`,"_blank","noopener,noreferrer"),style:{flex:1,padding:"10px 12px",background:"var(--fg)",border:"none",borderRadius:"999px",color:"#000000",fontSize:"13px",fontWeight:700,cursor:"pointer",fontFamily:t,display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",whiteSpace:"nowrap"},children:[(0,n.jsx)("span",{children:"Google Maps"}),(0,n.jsxs)("svg",{width:"10",height:"14",viewBox:"0 0 92.3 132.3",style:{flexShrink:0},children:[(0,n.jsx)("path",{fill:"#1a73e8",d:"M60.2 2.2C55.8.8 51 0 46.1 0 32 0 19.3 6.4 10.8 16.5l21.8 18.3L60.2 2.2z"}),(0,n.jsx)("path",{fill:"#ea4335",d:"M10.8 16.5C4.1 24.5 0 34.9 0 46.1c0 8.7 1.7 15.7 4.6 22l28-33.3-21.8-18.3z"}),(0,n.jsx)("path",{fill:"#4285f4",d:"M46.2 28.5c9.8 0 17.7 7.9 17.7 17.7 0 4.3-1.6 8.3-4.2 11.4 0 0 13.9-16.6 27.5-32.7-5.6-10.8-15.3-19-27-22.7L32.6 34.8c3.3-3.8 8.1-6.3 13.6-6.3"}),(0,n.jsx)("path",{fill:"#fbbc04",d:"M46.2 63.8c-9.8 0-17.7-7.9-17.7-17.7 0-4.3 1.5-8.3 4.1-11.3l-28 33.3c4.8 10.6 12.8 19.2 21 29.9l34.1-40.5c-3.3 3.9-8.1 6.3-13.5 6.3"}),(0,n.jsx)("path",{fill:"#34a853",d:"M59.1 109.2c15.4-24.1 33.3-35 33.3-63 0-7.7-1.9-14.9-5.2-21.3L25.6 98c2.6 3.4 5.3 7.3 7.9 11.3 9.4 14.5 6.8 23.1 12.8 23.1s3.4-8.7 12.8-23.2"})]})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>window.open(`https://maps.apple.com/?ll=${l},${s}&q=${l},${s}`,"_blank","noopener,noreferrer"),style:{flex:1,padding:"10px 12px",background:"var(--fg)",border:"none",borderRadius:"999px",color:"#000000",fontSize:"13px",fontWeight:700,cursor:"pointer",fontFamily:t,display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",whiteSpace:"nowrap"},children:[(0,n.jsx)("span",{children:"Apple Maps"}),(0,n.jsx)("svg",{width:"11",height:"13",viewBox:"0 0 814 1000",style:{flexShrink:0}
305,children:(0,n.jsx)("path",{fill:"#000000",d:"M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z"})})]})]})),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:14},children:[(0,n.jsx)("button",{type:"button",onClick:()=>e4(e=>Math.max(0,e-1)),disabled:0===c,"aria-label":"Previous result",style:{width:36,height:36,background:"transparent",border:"1px solid var(--border)",borderRadius:"50%",color:"var(--fg)",cursor:0===c?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,opacity:0===c?.25:1},children:"â"}),(0,n.jsxs)("div",{style:{flex:1,textAlign:"center",color:"var(--fg)",fontSize:16},children:[c+1," ",(0,n.jsx)("span",{style:{opacity:.5},children:"/"})," ",d.length]}),(0,n.jsx)("button",{type:"button",onClick:()=>e4(e=>Math.min(d.length-1,e+1)),disabled:c===d.length-1,"aria-label":"Next result",style:{width:36,height:36,background:"transparent",border:"1px solid var(--border)",borderRadius:"50%",color:"var(--fg)",cursor:c===d.length-1?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,opacity:c===d.length-1?.25:1},children:"â"})]}),e0.partial&&(0,n.jsxs)("div",{style:{marginTop:10,fontSize:12,color:"var(--fg-muted)"},children:[(e0.errors||[]).length," index",1===(e0.errors||[]).length?"":"es"," unavailable"]})]})]})}return(0,n.jsxs)("div",{style:{padding:"16px 18px 24px"},children:[(0,n.jsxs)("div",{style:{position:"relative",borderRadius:"12px",overflow:"hidden",border:"1px solid var(--surface-strong)",marginBottom:"16px"},children:[(0,n.jsx)("img",{src:tP.preview,alt:"Query",style:{width:"100%",height:"auto",maxHeight:"150px",objectFit:"cover",display:"block"}}),(0,n.jsx)("div",{style:{position:"absolute",top:"8px",left:"8px",padding:"4px 10px",backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(8px)",borderRadius:"6px",color:"var(--fg)",fontSize:"11px",fontWeight:600,fontFamily:t,letterSpacing:"0.3px"},children:"AI Global Search"})]}),"metadata"===eJ.source&&(0,n.jsxs)("div",{style:{marginBottom:"12px"},children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"11px",fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase",marginBottom:"6px"},children:"Location fetched from Metadata"}),(0,n.jsx)("button",{onClick:i0,style:{width:"100%",padding:"10px 0",background:"var(--fg)",border:"none",borderRadius:"999px",color:"#000000",fontSize:"13px",fontWeight:700,letterSpacing:"0.3px",cursor:"pointer",fontFamily:t},children:"Use AI Instead"})]}),(0,n.jsxs)("div",{style:{color:"var(--fg-muted)",fontSize:11,fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase",marginBottom:10},children:[ta.length," ",1===ta.length?"Result":"Results"]}),(0,n.jsx)("div",{ref:nZ,className:"global-results-carousel",onScroll:e=>{let t=e.currentTarget,r=t.scrollLeft+t.clientWidth/2,n=0,i=1/0;for(let e=0;e<t.children.length;e++){let o=t.children[e],a=Math.abs(o.offsetLeft+o.offsetWidth/2-r);a<i&&(i=a,n=e)}td(e=>e===n?e:n)},style:{display:"flex",alignItems:"stretch",gap:10,overflowX:"auto",overflowY:"visible",scrollSnapType:"x mandatory",WebkitOverflowScrolling:"touch",margin:"0 -18px",padding:"2px 18px 8px",scrollPaddingLeft:18,scrollPaddingRight:18},children:ta.map((e,r)=>{let i=iW[r]||[],o=i.length,a=ts===r,l=e2===r,s=0===o,d=s||l,c=(e.confidence??0)>=.7?"#7ED957":(e.confidence??0)>=.4?"#f5a623":"#e74c3c",p=a?{pad:12,loc:15,country:12,lbl:10,val:15,coords:13,copy:14,mapW:14,mapH:18,gap:20,gapCol:8}:{pad:8,loc:12.5,country:10,lbl:9,val:11.5,coords:10.5,copy:11,mapW:11,mapH:14,gap:14,gapCol:6};return(0,n.jsxs)("div",{onClick:()=>{nZ.current?.children[r]?.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),td(r)},style:{flex:"0 0 84%",boxSizing:"border-box",scrollSnapAlign:"center",backgroundColor:a?"var(--surface-strong)":"var(--surface)",borderRadius:10,padding:p.pad,cursor:"pointer",border:a?"1p
305x solid var(--border-strong)":"1px solid transparent",transition:"background-color 0.15s ease, border-color 0.15s ease",position:"relative",zIndex:e6===r?30:"auto",contain:e6===r?"none":"layout style"},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:p.loc,fontWeight:700,lineHeight:1.2,wordBreak:"break-word"},children:e.location_name}),(0,n.jsx)("div",{style:{marginTop:3,fontSize:p.country,color:"var(--fg-muted)"},children:e.country}),(0,n.jsxs)("div",{style:{marginTop:p.gapCol,display:"flex",gap:p.gap},children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:p.lbl,fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase"},children:"Confidence"}),(0,n.jsxs)("div",{style:{color:c,fontSize:p.val,fontWeight:700,fontFamily:t,marginTop:1},children:[Math.round((e.confidence??0)*100),"%"]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:p.lbl,fontWeight:600,letterSpacing:"0.3px",textTransform:"uppercase"},children:"Radius"}),(0,n.jsxs)("div",{style:{color:"var(--fg)",fontSize:p.val,fontWeight:700,fontFamily:t,marginTop:1},children:["\xb1\xa0",e.radius_km<1?`${Math.round(1e3*e.radius_km)} m`:`${e.radius_km.toFixed(1)} km`]})]})]}),(0,n.jsxs)("div",{style:{marginTop:p.gapCol,display:"flex",alignItems:"center",gap:8},children:[(0,n.jsxs)("span",{onClick:t=>{t.stopPropagation(),ni(e.lat,e.lng)},style:{color:"var(--fg)",fontSize:p.coords,fontFamily:t,cursor:"pointer",userSelect:"text",WebkitUserSelect:"text"},children:[et(e.lat,"lat")," \xb7 ",et(e.lng,"lng")]}),(0,n.jsx)(eg,{onClick:t=>{t.stopPropagation(),ni(e.lat,e.lng)},copied:ne,size:p.copy}),(0,n.jsx)("div",{style:{flex:1}}),(0,n.jsx)("button",{type:"button","aria-label":"Open in Google Maps",className:"card-map-icon",onClick:t=>{t.stopPropagation(),window.open(`https://www.google.com/maps/search/?api=1&query=${e.lat},${e.lng}`,"_blank","noopener,noreferrer")},style:{background:"transparent",border:"none",padding:4,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsxs)("svg",{width:p.mapW,height:p.mapH,viewBox:"0 0 92.3 132.3",children:[(0,n.jsx)("path",{fill:"#1a73e8",d:"M60.2 2.2C55.8.8 51 0 46.1 0 32 0 19.3 6.4 10.8 16.5l21.8 18.3L60.2 2.2z"}),(0,n.jsx)("path",{fill:"#ea4335",d:"M10.8 16.5C4.1 24.5 0 34.9 0 46.1c0 8.7 1.7 15.7 4.6 22l28-33.3-21.8-18.3z"}),(0,n.jsx)("path",{fill:"#4285f4",d:"M46.2 28.5c9.8 0 17.7 7.9 17.7 17.7 0 4.3-1.6 8.3-4.2 11.4 0 0 13.9-16.6 27.5-32.7-5.6-10.8-15.3-19-27-22.7L32.6 34.8c3.3-3.8 8.1-6.3 13.6-6.3"}),(0,n.jsx)("path",{fill:"#fbbc04",d:"M46.2 63.8c-9.8 0-17.7-7.9-17.7-17.7 0-4.3 1.5-8.3 4.1-11.3l-28 33.3c4.8 10.6 12.8 19.2 21 29.9l34.1-40.5c-3.3 3.9-8.1 6.3-13.5 6.3"}),(0,n.jsx)("path",{fill:"#34a853",d:"M59.1 109.2c15.4-24.1 33.3-35 33.3-63 0-7.7-1.9-14.9-5.2-21.3L25.6 98c2.6 3.4 5.3 7.3 7.9 11.3 9.4 14.5 6.8 23.1 12.8 23.1s3.4-8.7 12.8-23.2"})]})}),(0,n.jsx)("button",{type:"button","aria-label":"Open in Apple Maps",className:"card-map-icon",onClick:t=>{t.stopPropagation(),window.open(`https://maps.apple.com/?ll=${e.lat},${e.lng}&q=${e.lat},${e.lng}`,"_blank","noopener,noreferrer")},style:{background:"transparent",border:"none",padding:4,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:p.mapW,height:p.mapH,viewBox:"0 0 814 1000",children:(0,n.jsx)("path",{fill:"#ffffff",d:"M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z"})})})]}),(0,n.jsx)("div",{style:{maxHeight:a?"320px":"0",opacity:+!!a,overflow:"visible",transition:"max-height 0.28s ease, opacity 0.22s ease 0.05s",pointerEvents:a?"auto":"none"},children:(0,n.jsxs)("div",{style:{position:"relative",marginTop:12,display:"flex"},onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("button",{type:"button",onClick:()=>oe(r,e),disabled:d,style:{flex:1,padding:"9px 14px",background:d?"var(--surface)":"var(--fg)",color:d?"var(--fg-muted)":"#000000",border:"1px solid var(--border-strong)",borderRadius:s?"999px":"999px 0 0 999px",borderRight:s?void 0:"none",fontFamily:t,fontSize:s?11:12,fontWeight:700,letterSpacing:"0.3px",cursor:d?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,textAlign:"center",lineHeight:1.25},children:(0,n.jsx)("span",{children:l?"Searching...":s?"No Search Available for This Area":"Search Area"})}),!s&&(0,n.jsx)("button",{type:"button",onClick:()=>e8(e=>e===r?null:r),disabled:d,"aria-label":"Pick a specific index","aria-expanded":e6===r,style:{width:34,padding:"9px 0",background:d?"var(--surface)":"var(--fg)",color:d?"var(--fg-muted)":"#000000",border:"1px solid var(--border-strong)",borderRadius:"0 999px 999px 0",cursor:d?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:"10",height:"6",viewBox:"0 0 10 6","aria-hidden":!0,style:{transform:e6===r?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}
305,children:(0,n.jsx)("path",{d:"M1 1l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),a&&e6===r&&i.length>0&&(0,n.jsx)("div",{onClick:e=>e.stopPropagation(),style:{position:"absolute",bottom:"calc(100% + 4px)",left:0,right:0,background:"#050505",border:"1px solid #1a1a1a",borderRadius:10,padding:6,zIndex:20,boxShadow:"0 14px 36px rgba(0,0,0,0.65)"},children:i.map((i,o)=>{let a=(i.region_name||i.city_path.split("/").pop()||i.city_path).replaceAll("_"," ");return(0,n.jsxs)("button",{type:"button",onClick:()=>{e8(null),oe(r,e,i.city_path)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"9px 10px",background:"transparent",border:"none",color:"var(--fg)",fontFamily:t,fontSize:12,fontWeight:600,letterSpacing:"0.2px",cursor:"pointer",borderRadius:6,textAlign:"left"},children:[(0,n.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),(0,n.jsxs)("span",{style:{fontSize:11,color:"var(--fg-muted)",fontFamily:t,marginLeft:8,flexShrink:0},children:[(i.distance_km??0).toFixed(1)," km"]})]},o)})})]})})]},`${r}-${e.lat},${e.lng}`)})})]})}if(tP&&t5&&!eJ){let i=iR&&!t7&&!re&&!tb,o=!ri&&!ra&&!tb,a=0===t1,l=t1===tX.length-1,s=(e,t)=>({width:32,height:32,flexShrink:0,background:t?"var(--fg)":"transparent",border:t?"1px solid var(--fg)":"1px solid var(--border)",borderRadius:"50%",color:t?"#000000":"var(--fg)",cursor:e?"pointer":"not-allowed",opacity:e?1:.3,display:"flex",alignItems:"center",justifyContent:"center",padding:0,fontSize:15,touchAction:"manipulation",WebkitTapHighlightColor:"transparent"}),d=(0,n.jsx)("span",{style:{width:12,height:12,border:"1.5px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 0.8s linear infinite",display:"block"}}),c=(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M20 6 9 17l-5-5"})}),p=(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M3 12a9 9 0 0 1 15.5-6.3L21 8"}),(0,n.jsx)("path",{d:"M21 3v5h-5"}),(0,n.jsx)("path",{d:"M21 12a9 9 0 0 1-15.5 6.3L3 16"}),(0,n.jsx)("path",{d:"M3 21v-5h5"})]}),u=(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",children:(0,n.jsx)("path",{d:"M12 5v14M5 12h14"})}),g=t7?"Reranked":re?"Reranking":iR?"Rerank images":"Rerank needs a paid plan or credits",f=ri?"Top 30 loaded":ra?"Loading more results":"Show more results (top 30)";return(0,n.jsxs)("div",{style:{padding:"8px 16px 14px"},children:[t5.image_path&&(0,n.jsxs)("div",{onClick:()=>ry("comparison"),style:{position:"relative",borderRadius:"10px",overflow:"hidden",border:"1px solid rgba(255,255,255,0.18)",cursor:"pointer",marginBottom:"10px"},children:[(0,n.jsx)("img",{src:`${ed}/api/index-image/${encodeURIComponent(t5.image_path)}`,alt:"Match",style:{width:"100%",height:"90px",objectFit:"cover",display:"block"}}),(0,n.jsxs)("div",{style:{position:"absolute",top:"4px",left:"4px",padding:"2px 7px",backgroundColor:"rgba(255,255,255,0.92)",borderRadius:"4px",color:"#000000",fontSize:"9.5px",fontWeight:600,fontFamily:t},children:["Match #",t5.rank,t5.verified?" \xb7 Verified":""]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{...r,marginBottom:3},children:"Address"}),(0,n.jsx)("div",{style:{color:"#e4e4e4",fontSize:"15px",lineHeight:1.3,fontFamily:e},children:t5.address||"Geocodingâ¦"}),(0,n.jsxs)("div",{style:{marginTop:5,display:"flex",alignItems:"center",gap:8},children:[(0,n.jsxs)("span",{onClick:()=>ni(t5.lat,t5.lng),style:{fontSize:11.5,color:"var(--fg-muted)",fontFamily:t,cursor:"pointer",userSelect:"text",WebkitUserSelect:"text"},children:[t5.lat.toFixed(6),", ",t5.lng.toFixed(6)]}),(0,n.jsx)(eg,{onClick:e=>{e.stopPropagation(),ni(t5.lat,t5.lng)},copied:ne,size:13}),(0,n.jsx)("button",{type:"button","aria-label":"Open in Google Maps",className:"card-map-icon",onClick:()=>window.open(`https://www.google.com/maps/search/?api=1&query=${t5.lat},${t5.lng}`,"_blank","noopener,noreferrer"),style:{background:"transparent",border:"none",padding:2,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsxs)("svg",{width:"14",height:"18",viewBox:"0 0 92.3 132.3",children:[(0,n.jsx)("path",{fill:"#1a73e8",d:"M60.2 2.2C55.8.8 51 0 46.1 0 32 0 19.3 6.4 10.8 16.5l21.8 18.3L60.2 2.2z"}),(0,n.jsx)("path",{fill:"#ea4335",d:"M10.8 16.5C4.1 24.5 0 34.9 0 46.1c0 8.7 1.7 15.7 4.6 22l28-33.3-21.8-18.3z"}),(0,n.jsx)("path",{fill:"#4285f4",d:"M46.2 28.5c9.8 0 17.7 7.9 17.7 17.7 0 4.3-1.6 8.3-4.2 11.4 0 0 13.9-16.6 27.5-32.7-5.6-10.8-15.3-19-27-22.7L32.6 34.8c3.3-3.8 8.1-6.3 13.6-6.3"}),(0,n.jsx)("path",{fill:"#fbbc04",d:"M46.2 63.8c-9.8 0-17.7-7.9-17.7-17.7 0-4.3 1.5-8.3 4.1-11.3l-28 33.3c4.8 10.6 12.8 19.2 21 29.9l34.1-40.5c-3.3 3.9-8.1 6.3-13.5 6.3"}),(0,n.jsx)("path",{fill:"#34a853",d:"M59.1 109.2c15.4-24.1 33.3-35 33.3-63 0-7.7-1.9-14.9-5.2-21.3L25.6 98c2.6 3.4 5.3 7.3 7.9 11.3 9.4 14.5 6.8 23.1 12.8 23.1s3.4-8.7 12.8-23.2"})]})}),(0,n.jsx)("button",{type:"button","aria-label":"Open in Apple Maps",className:"card-map-icon",onClick:()=>window.open(`https://maps.apple.com/?ll=${t5.lat},${t5.lng}&q=${t5.lat},${t5.lng}`,"_blank","noopener,noreferrer"),style:{background:"transparent",border:"none",padding:2,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:"14",height:"18",viewBox:"0 0 814 1000",children:(0,n.jsx)("path",{fill:"#ffffff",d:"M788.1 340.9c-
3055.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z"})})})]})]}),(tX.length>1||rZ)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{height:"1px",background:"rgba(255,255,255,0.07)",margin:"10px 0"}}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[tX.length>1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button","aria-label":"Previous result",onClick:()=>ox("prev"),disabled:a,style:s(!a,!1),children:"â"}),(0,n.jsxs)("div",{style:{minWidth:52,textAlign:"center",color:"var(--fg)",fontSize:"14px",fontFamily:e},children:[t1+1," ",(0,n.jsx)("span",{style:{opacity:.5},children:"/"})," ",tX.length]}),(0,n.jsx)("button",{type:"button","aria-label":"Next result",onClick:()=>ox("next"),disabled:l,style:s(!l,!1),children:"â"})]}),(0,n.jsx)("div",{style:{flex:1}}),rZ&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button","aria-label":g,title:g,onClick:on,disabled:iR&&!i,style:s(i||!iR,i),children:t7?c:re?d:p}),(0,n.jsx)("button",{type:"button","aria-label":f,title:f,onClick:ol,disabled:!o,style:s(o,o),children:ri?c:ra?d:u})]})]})]})]})}return null})(),"history"===r6&&(0,n.jsxs)("div",{style:{padding:"6px 14px 18px"},children:[(0,n.jsx)("h3",{style:{color:"var(--fg)",fontSize:"18px",fontWeight:700,margin:"6px 0 14px"},children:"History"}),0===n4.length?(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"13px",padding:"20px 0",textAlign:"center"},children:"No searches yet."}):(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:n4.slice(0,60).map(e=>{let t,r,i=e.result||{},o=i.location&&"object"==typeof i.location?{...i.location,candidates:i.candidates||[]}:i,a="number"==typeof o.lat&&"number"==typeof o.lng;"lens_match"!==o.source&&"lens_match"!==e.searchMode||a?a?(t=o.location_name||(o.address?o.address.split(",").slice(0,2).join(","):`${o.lat.toFixed(3)}, ${o.lng.toFixed(3)}`),r=o.country||(o.address?o.address.split(",").slice(-2).join(",").trim():`${o.lat.toFixed(4)}, ${o.lng.toFixed(4)}`)):(t=o.location_name||o.title||"Untitled",r=o.country||o.source_domain||o.address||""):(t=o.title||"Lens match",r=o.source_domain||o.link||"Saved result image");let l=e.createdAt?.toDate?e.createdAt.toDate():null;return(0,n.jsx)(eC,{h:e,title:t,sub:r,ts:l,onClick:()=>{iN(e),r4(!1),r8("results")},onDelete:t=>{t.stopPropagation(),Z(n5,e.id).catch(t=>console.error("[history] delete failed",{uid:n5,id:e.id,err:t}))}},e.id)})})]}),"folders"===r6&&(0,n.jsxs)("div",{style:{padding:"6px 14px 18px"},children:[(0,n.jsx)("h3",{style:{color:"var(--fg)",fontSize:"18px",fontWeight:700,margin:"6px 0 14px"},children:"Folders"}),0===id.length?(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"13px",padding:"20px 0",textAlign:"center"},children:"No folders yet - save a result to create one."}):(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:id.map(e=>(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"9px 12px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",borderRadius:"10px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:[(0,n.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"var(--fg)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:(0,n.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,n.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:"14px",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,n.jsxs)("div",{style:{color:"var(--fg-muted)",fontSize:"11.5px",marginTop:"2px"},children:[e.itemCount||0," item",1===(e.itemCount||0)?"":"s"]})]})]},e.id))})]})]})]}),e&&nQ&&(0,n.jsx)("div",{style:{position:"fixed",top:"14px",right:"14px",zIndex:1003},children:(0,n.jsx)(f,{})}),e&&!tb&&t5&&!eJ&&"outdoor"===eH&&(0,n.jsx)("div",{style:{position:"fixed",top:"14px",left:"14px",zIndex:1003},children:(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",padding:"4px",gap:"4px",backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",borderRadius:"999px",border:"1px solid var(--surface-strong)",position:"relative",boxShadow:"0 4px 20px rgba(0,0,0,0.45)"},children:[(0,n.jsx)("div",{id:"mobile-view-toggle-pill",style:{position:"absolute",left:"4px",width:"40px",height:"40px",backgroundColor:"var(--fg)",borderRadius:"999px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:1,boxShadow:"0 2px 12px var(--border-strong)"}}),[{key:"split",label:"Split view",icon:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"
305currentColor",children:(0,n.jsx)("path",{d:"m9,9H2c-1.103,0-2-.897-2-2v-2C0,2.243,2.243,0,5,0h4c1.103,0,2,.897,2,2v5c0,1.103-.897,2-2,2Zm10,15h-4c-1.103,0-2-.897-2-2v-5c0-1.103.897-2,2-2h7c1.103,0,2,.897,2,2v2c0,2.757-2.243,5-5,5Zm3-11h-7c-1.103,0-2-.897-2-2V2c0-1.103.897-2,2-2h4c2.757,0,5,2.243,5,5v6c0,1.103-.897,2-2,2Zm-13,11h-4c-2.757,0-5-2.243-5-5v-6c0-1.103.897-2,2-2h7c1.103,0,2,.897,2,2v9c0,1.103-.897,2-2,2Z"})})},{key:"map",label:"Map view",icon:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M12,12A4,4,0,1,0,8,8,4,4,0,0,0,12,12Zm0-6a2,2,0,1,1-2,2A2,2,0,0,1,12,6Zm8.66,3.157-.719-.239A8,8,0,0,0,12,0,7.993,7.993,0,0,0,4.086,9.092a5.045,5.045,0,0,0-2.548,1.3A4.946,4.946,0,0,0,0,14v4.075a5.013,5.013,0,0,0,3.6,4.8l2.87.9A4.981,4.981,0,0,0,7.959,24a5.076,5.076,0,0,0,1.355-.186l5.78-1.71a2.987,2.987,0,0,1,1.573,0l2.387.8A4,4,0,0,0,24,19.021V13.872A5.015,5.015,0,0,0,20.66,9.156ZM7.758,3.762a5.987,5.987,0,0,1,8.484,0,6.037,6.037,0,0,1,.011,8.5L12.7,15.717a.992.992,0,0,1-1.389,0L7.758,12.277A6.04,6.04,0,0,1,7.758,3.762ZM22,19.021a1.991,1.991,0,0,1-.764,1.572,1.969,1.969,0,0,1-1.626.395L17.265,20.2a5.023,5.023,0,0,0-2.717-.016L8.764,21.892a3,3,0,0,1-1.694-.029l-2.894-.9A3.013,3.013,0,0,1,2,18.075V14a2.964,2.964,0,0,1,.92-2.163,3.024,3.024,0,0,1,1.669-.806A8.021,8.021,0,0,0,6.354,13.7l3.567,3.453a2.983,2.983,0,0,0,4.174,0l3.563-3.463a7.962,7.962,0,0,0,1.813-2.821l.537.178A3.006,3.006,0,0,1,22,13.872Z"})})},{key:"streetview",label:"Street View",icon:(0,n.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)("path",{d:"m11.994 7h.012c1.896-.011 2.959-1.068 2.994-3.012-.033-1.858-1.151-2.976-3.004-2.988-1.868.011-2.961 1.096-2.996 3.013.036 1.915 1.1 2.976 2.994 2.987z"}),(0,n.jsx)("path",{d:"m17.949 13.564c-.073.731-.224 1.375-.449 1.91v2.026c0 1.93-1.57 3.5-3.5 3.5-.743 0-1.433-.232-2-.629-.567.396-1.257.629-2 .629-1.93 0-3.5-1.57-3.5-3.5v-2.025c-.224-.532-.375-1.171-.448-1.899-2.203.608-4.052 1.857-4.052 4.424 0 5 7.008 5 10 5 4.945 0 10-.594 10-5 0-2.54-1.68-3.813-4.051-4.436z"}),(0,n.jsx)("path",{d:"m8.5 17.5c0 .828.672 1.5 1.5 1.5s1.5-.672 1.5-1.5v-2h1v2c0 .828.672 1.5 1.5 1.5s1.5-.672 1.5-1.5v-2.5c.058-.091.5-.733.5-2.5s-.357-3.268-.372-3.331c-.08-.33-.32-.597-.641-.709-.053-.019-1.322-.46-2.987-.46-1.679 0-2.938.442-2.991.461-.317.113-.557.379-.636.708-.016.063-.373 1.565-.373 3.332s.442 2.409.5 2.5v2.5z"})]})}].map(e=>(0,n.jsx)("button",{"aria-label":e.label,ref:t=>{if(t&&H===e.key){let e=document.getElementById("mobile-view-toggle-pill");e&&(e.style.top=`${t.offsetTop}px`,e.style.height=`${t.offsetHeight}px`)}},onClick:()=>K(e.key),style:{width:"40px",height:"40px",borderRadius:"50%",background:"transparent",border:"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",position:"relative",zIndex:2,padding:0,color:H===e.key?"#000000":"rgba(255,255,255,0.7)",transition:"color 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:e.icon},e.key))]})}),(0,n.jsx)(M,{visible:ru&&"index"===eE,onClose:iT,isMobile:e}),tY&&(()=>{let e=[tP?{...tP,_idx:-1}:null,...tZ.map((e,t)=>({...e,_idx:t}))].filter(Boolean);return(0,n.jsx)("div",{onClick:()=>{tJ(!1),tQ(null)},style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(8px)",zIndex:2100,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px"},children:(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{maxWidth:"720px",width:"100%",background:"hsl(0 0% 6% / 0.96)",border:"1px solid var(--surface-strong)",borderRadius:"14px",padding:"24px"},children:[(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:"20px",fontWeight:700,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',marginBottom:"6px"},children:"Pick an image to search"}),(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:"13px",marginBottom:"18px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"City search uses one image at a time - choose which photo to run against the indexed city."}),(0,n.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:"12px"},children:e.map((e,t)=>(0,n.jsx)("button",{type:"button",onClick:()=>ot(e),style:{position:"relative",aspectRatio:"1 / 1",borderRadius:"10px",overflow:"hidden",border:"1px solid var(--border)",cursor:"pointer",padding:0,background:"transparent",transition:"border-color 0.15s ease, transform 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.borderColor="var(--fg)",e.currentTarget.style.transform="scale(1.02)"},onMouseLeave:e=>{e.currentTarget.style.borderColor="var(--border)",e.currentTarget.style.transform="scale(1)"},children:(0,n.jsx)("img",{src:e.preview,alt:e.name,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})},t))}),(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"18px"},children:(0,n.jsx)("button",{onClick:()=>{tJ(!1),tQ(null)},style:{background:"transparent",border:"1px solid var(--border-strong)",borderRadius:"999px",padding:"8px 18px",color:"var(--fg)",fontSize:"13px",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',cursor:"pointer"},children:"Cancel"})})]})})})(),"expand"===rb&&tP&&(0,n.jsxs)("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.95)",zIndex:2e3,display:"flex",alignItems:"center",justifyContent:"center",padding:"40px",animation:"fadeIn 0.3s ease-in-out"},onClick:()=>{ry(null),rM(1)},onWheel:e=>{e.preventDefault(),rM(t=>Math.max(.5,Math.min(3,t+(e.deltaY>0?-.1:.1))))},children:[(0,n.jsx)("style",{children:` 306 @keyframes fadeIn { 307 from { opacity: 0; } 308 to { opacity: 1; } 309 } 310 `}),(0,n.jsx)("button",{onClick:()=>{ry(null),rM(1)},style:{position:"absolute",top:"20px",right:"20px",width:"48px",height:"48px",backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",border:"none",borderRadius:"50%",color:"var(--fg)",fontSize:"24px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.3s ease",zIndex:2001},onMouseEnter:e=>e.target.style.backgroundColor="rgba(255, 0, 0, 0.7)",onMouseLeave:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.5)",children:"â"}),(0,n.jsxs)("div",{style:{position:"absolute",top:"20px",left:"20px",padding:"10px 16px",backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",borderRadius:"20px",color:"var(--fg)",fontSize:"15.4px",fontWeight:600},children:["Zoom: ",Math.round(100*r_),"% (Scroll to zoom)"]}),(0,n.jsx)("img",{src:tP.preview,alt:"Expanded",style:{maxWidth:"90%",maxHeight:"90%",objectFit:"contain",transform:`scale(${r_})`,transition:"transform 0.1s ease, opacity 0.3s ease-in-out",borderRadius:"12px",animation:"fadeIn 0.3s ease-in-out",cursor:"zoom-in"},onClick:e=>e.stopPropagation()})]}),"crop"===rb&&tP&&(0,n.jsxs)("div",{ref:nH,style:{position:"fixed",inset:0,zIndex:2e3,backgroundColor:"rgba(0, 0, 0, 0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",animation:"fadeIn 0.3s ease-in-out"},children:[rS&&(0,n.jsxs)("div",{style:{marginBottom:"20px",textAlign:"center",padding:"0 24px",maxWidth:"760px"},children:[(0,n.jsx)("h2",{style:{margin:0,color:"var(--fg)",fontFamily:'var(--font-quantico), "Quantico", sans-serif',fontSize:"30px",fontWeight:400,letterSpacing:"-0.4px",lineHeight:1.15},children:"Cropping Increases the Accuracy of the Search"}),(0,n.jsx)("p",{style:{margin:"8px 0 0",color:"var(--fg-muted)",fontFamily:'var(--font-quantico), "Quantico", sans-serif',fontSize:"15px",fontStyle:"italic"},children:"Tighten the frame to the building or scene - drop sky, hands, table."})]}),(0,n.jsxs)("div",{style:{position:"relative",maxWidth:"80%",maxHeight:"70vh",overflow:"hidden"},children:[(0,n.jsx)("img",{ref:nP,src:rv||tP.preview,alt:"Crop",style:{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain",userSelect:"none",display:"block",borderRadius:14*!nN,transition:"border-radius 0.18s ease"},draggable:"false"}),(0,n.jsxs)("div",{ref:nD,onPointerDown:i5("move"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",top:`${rw.y}%`,left:`${rw.x}%`,width:`${rw.width}%`,height:`${rw.height}%`,border:"1.5px solid #FFFFFF",boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.6)",borderRadius:14*!nN,transition:"border-radius 0.18s ease",cursor:"move",touchAction:"none",userSelect:"none"},children:[(0,n.jsxs)("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[(0,n.jsx)("div",{style:{position:"absolute",top:0,bottom:0,left:"33.3333%",width:1,background:"var(--fg-muted)"}}),(0,n.jsx)("div",{style:{position:"absolute",top:0,bottom:0,left:"66.6667%",width:1,background:"var(--fg-muted)"}}),(0,n.jsx)("div",{style:{position:"absolute",left:0,right:0,top:"33.3333%",height:1,background:"var(--fg-muted)"}}),(0,n.jsx)("div",{style:{position:"absolute",left:0,right:0,top:"66.6667%",height:1,background:"var(--fg-muted)"}})]}),(0,n.jsx)("div",{onPointerDown:i5("n"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",top:-12,left:18,right:18,height:24,cursor:"ns-resize",touchAction:"none",zIndex:5}}),(0,n.jsx)("div",{onPointerDown:i5("s"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",bottom:-12,left:18,right:18,height:24,cursor:"ns-resize",touchAction:"none",zIndex:5}}),(0,n.jsx)("div",{onPointerDown:i5("w"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",left:-12,top:18,bottom:18,width:24,cursor:"ew-resize",touchAction:"none",zIndex:5}}),(0,n.jsx)("div",{onPointerDown:i5("e"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",right:-12,top:18,bottom:18,width:24,cursor:"ew-resize",touchAction:"none",zIndex:5}}),(0,n.jsx)("div",{onPointerDown:i5("nw"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",top:-13,left:-13,width:26,height:26,backgroundColor:"var(--fg)",border:"2px s
310olid rgba(0,0,0,0.6)",borderRadius:"50%",boxShadow:"0 2px 6px rgba(0,0,0,0.35)",cursor:"nwse-resize",touchAction:"none",zIndex:10}}),(0,n.jsx)("div",{onPointerDown:i5("ne"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",top:-13,right:-13,width:26,height:26,backgroundColor:"var(--fg)",border:"2px solid rgba(0,0,0,0.6)",borderRadius:"50%",boxShadow:"0 2px 6px rgba(0,0,0,0.35)",cursor:"nesw-resize",touchAction:"none",zIndex:10}}),(0,n.jsx)("div",{onPointerDown:i5("sw"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",bottom:-13,left:-13,width:26,height:26,backgroundColor:"var(--fg)",border:"2px solid rgba(0,0,0,0.6)",borderRadius:"50%",boxShadow:"0 2px 6px rgba(0,0,0,0.35)",cursor:"nesw-resize",touchAction:"none",zIndex:10}}),(0,n.jsx)("div",{onPointerDown:i5("se"),onPointerMove:i3,onPointerUp:i4,onPointerCancel:i4,style:{position:"absolute",bottom:-13,right:-13,width:26,height:26,backgroundColor:"var(--fg)",border:"2px solid rgba(0,0,0,0.6)",borderRadius:"50%",boxShadow:"0 2px 6px rgba(0,0,0,0.35)",cursor:"nwse-resize",touchAction:"none",zIndex:10}})]})]}),(0,n.jsxs)("div",{style:{display:"flex",gap:e?"8px":"12px",marginTop:e?"16px":"24px"},children:[(0,n.jsx)("button",{onClick:()=>{if(!nP.current||!rv)return;let e=new Image;e.onload=()=>{let t=document.createElement("canvas"),r=t.getContext("2d"),n=rw.x/100*e.width,i=rw.y/100*e.height,o=rw.width/100*e.width,a=rw.height/100*e.height;t.width=o,t.height=a,r.drawImage(e,n,i,o,a,0,0,o,a),t.toBlob(e=>{if(!e)return;let t=new File([e],tP.name,{type:"image/jpeg"}),r=tN(URL.createObjectURL(e));if(tG.current={source:t,blobPromise:es(t,1024,.95)},tH({file:t,preview:r,name:tP.name}),ry(null),rS){let e=rS.cityPath;rC(null),tp(!0),(async()=>{try{await or({mode:"index",cityPath:e,imageFile:t})}finally{tp(!1)}})()}if(rz){let{idx:e,cand:r,pickedPath:n}=rz;rI(null),(async()=>{try{await i9(e,r,n,t)}catch(e){}})()}},"image/jpeg",.92)},e.src=rv},style:{padding:e?"7px 14px":"10px 24px",backgroundColor:"var(--fg)",border:"none",borderRadius:"50px",color:"#000000",fontSize:e?"12.5px":"15.4px",fontWeight:600,cursor:"pointer",transition:"all 0.3s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},onMouseEnter:e=>{e.target.style.backgroundColor="rgba(255, 255, 255, 0.85)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--fg)"},children:rS?e?"Apply & Search":"Apply Crop & Search":e?"Apply":"Apply Crop"}),(0,n.jsxs)("button",{onClick:()=>{let e=rv||tP?.preview;if(!e)return;let t=new Image;t.onload=()=>{let e=document.createElement("canvas"),r=e.getContext("2d");e.width=t.height,e.height=t.width,r.translate(e.width/2,e.height/2),r.rotate(Math.PI/2),r.drawImage(t,-t.width/2,-t.height/2),rk(e.toDataURL("image/jpeg",.92)),rj({x:0,y:0,width:100,height:100})},t.src=e},title:"Rotate 90\xb0",style:{display:"inline-flex",alignItems:"center",gap:"7px",padding:e?"7px 14px":"10px 24px",backgroundColor:"var(--fg)",border:"none",borderRadius:"50px",color:"#000000",fontSize:e?"12.5px":"15.4px",fontWeight:600,cursor:"pointer",transition:"all 0.3s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--fg)"},children:[(0,n.jsxs)("svg",{width:e?14:16,height:e?14:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{pointerEvents:"none"},children:[(0,n.jsx)("path",{d:"M21 12a9 9 0 1 1-3.5-7.1"}),(0,n.jsx)("polyline",{points:"21 3 21 8 16 8"})]}),e?"":"Rotate"]}),(0,n.jsx)("button",{onClick:()=>{rj({x:0,y:0,width:100,height:100})},style:{padding:e?"7px 14px":"10px 24px",backgroundColor:"var(--fg)",border:"none",borderRadius:"50px",color:"#000000",fontSize:e?"12.5px":"15.4px",fontWeight:600,cursor:"pointer",transition:"all 0.3s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},onMouseEnter:e=>e.target.style.backgroundColor="rgba(255, 255, 255, 0.85)",onMouseLeave:e=>e.target.style.backgroundColor="var(--fg)",children:"Reset"}),(0,n.jsx)("button",{onClick:()=>{ry(null),rC(null)},style:{padding:e?"7px 14px":"10px 24px",backgroundColor:"var(--fg)",border:"none",borderRadius:"50px",color:"#000000",fontSize:e?"12.5px":"15.4px",fontWeight:600,cursor:"pointer",transition:"all 0.3s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},onMouseEnter:e=>{e.target.style.backgroundColor="rgba(255, 0, 0, 0.75)",e.target.style.color="var(--fg)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--fg)",e.target.style.color="#000000"},children:"Cancel"})]})]}),"comparison"===rb&&tP&&t5&&(0,n.jsxs)("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.95)",zIndex:2e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:e?"20px":"40px",animation:"fadeIn 0.3s ease-in-out"},onClick:()=>ry(null),children:[(0,n.jsx)("button",{onClick:()=>ry(null),style:{position:"absolute",top:"20px",right:"20px",width:"48px",height:"48px",backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",border:"none",borderRadius:"50%",color:"var(--fg)",fontSize:"24px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.3s ease",zIndex:2001},onMouseEnter:e=>e.target.style.backgroundColor="rgba(255, 0, 0, 0.7)",onMouseLeave:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.5)",children:"â"}),(0,n.jsxs)("div",{style:{display:"flex",flexDirection:e?"column":"row",gap:e?"16px":"30px",maxWidth:"90vw",maxHeight:e?"50vh":"70vh",marginBottom:"30px",justifyContent:"center"},onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flex:1},children:(0,n.jsxs)("div",{style:{position:"relative",borderRadius:"12px",overflow:"hidden",border:"2px s
310olid var(--border-strong)",maxHeight:e?"22vh":"60vh"},children:[(0,n.jsx)("img",{src:tP.preview,alt:"Query",style:{maxWidth:e?"80vw":t5.image_path?"40vw":"80vw",maxHeight:e?"22vh":"60vh",objectFit:"contain",display:"block"}}),(0,n.jsx)("div",{style:{position:"absolute",top:"12px",left:"12px",padding:"8px 16px",backgroundColor:"rgba(0, 0, 0, 0.8)",backdropFilter:"blur(10px)",borderRadius:"8px",color:"var(--fg)",fontSize:"15.4px",fontWeight:600},children:"Query Image"})]})}),t5.image_path&&(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flex:1},children:(0,n.jsxs)("div",{style:{position:"relative",borderRadius:"12px",overflow:"hidden",border:"2px solid var(--fg-muted)",maxHeight:"60vh"},children:[(0,n.jsx)("img",{src:`${ed}/api/index-image/${encodeURIComponent(t5.image_path)}`,alt:"Reference",style:{maxWidth:"40vw",maxHeight:"60vh",objectFit:"contain",display:"block"},onError:e=>{e.target.src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><rect fill="%23333" width="200" height="200"/><text fill="%23999" x="50%" y="50%" text-anchor="middle" dy=".3em">No Image</text></svg>'}}),(0,n.jsxs)("div",{style:{position:"absolute",top:"12px",left:"12px",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(10px)",borderRadius:"8px",color:"var(--fg)",fontSize:"15.4px",fontWeight:600},children:["Match #",t5.rank]})]})})]}),(0,n.jsxs)("div",{style:{display:"flex",gap:e?"12px":"20px",padding:e?"14px 20px":"20px 30px",backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",borderRadius:"12px",border:"1px solid var(--border)",flexWrap:e?"wrap":"nowrap",justifyContent:"center"},onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{style:{textAlign:"center"},children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:e?"9.9px":"12.1px",fontWeight:600,textTransform:"uppercase",marginBottom:"4px"},children:"Latitude"}),(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:e?"14.3px":"17.6px",fontWeight:600},children:t5.lat.toFixed(6)})]}),(0,n.jsx)("div",{style:{width:"1px",backgroundColor:"var(--border-strong)",display:e?"none":"block"}}),(0,n.jsxs)("div",{style:{textAlign:"center"},children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:e?"9.9px":"12.1px",fontWeight:600,textTransform:"uppercase",marginBottom:"4px"},children:"Longitude"}),(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:e?"14.3px":"17.6px",fontWeight:600},children:t5.lng.toFixed(6)})]}),(0,n.jsx)("div",{style:{width:"1px",backgroundColor:"var(--border-strong)",display:e?"none":"block"}}),(0,n.jsxs)("div",{style:{textAlign:"center",maxWidth:"400px"},children:[(0,n.jsx)("div",{style:{color:"var(--fg-muted)",fontSize:e?"9.9px":"12.1px",fontWeight:600,textTransform:"uppercase",marginBottom:"4px"},children:"Address"}),(0,n.jsx)("div",{style:{color:"var(--fg)",fontSize:e?"13.2px":"15.4px"},children:t5.address||"Geocoding..."})]})]})]}),!e&&T&&X&&!eJ&&"outdoor"===eH&&!(t5&&!eJ)&&(0,n.jsxs)("div",{style:{position:"fixed",bottom:"30px",left:"50%",transform:"translateX(-50%)",display:"flex",gap:"10px",zIndex:1001,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",padding:"6px",borderRadius:"50px",border:"1px solid var(--border)"},children:[(0,n.jsx)("button",{onClick:()=>K("map"),style:{padding:"10px 20px",backgroundColor:"map"===H?"var(--fg)":"transparent",border:"none",borderRadius:"50px",color:"map"===H?"#000000":"var(--fg)",fontSize:"15.4px",fontWeight:600,cursor:"pointer",transition:"all 0.3s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"Map View"}),(0,n.jsx)("button",{onClick:()=>K("streetview"),style:{padding:"10px 20px",backgroundColor:"streetview"===H?"var(--fg)":"transparent",border:"none",borderRadius:"50px",color:"streetview"===H?"#000000":"var(--fg)",fontSize:"15.4px",fontWeight:600,cursor:"pointer",transition:"all 0.3s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"indoor"===eH?"Reference View":"Street View"}),(0,n.jsx)("button",{onClick:()=>K("split"),style:{padding:"10px 20px",backgroundColor:"split"===H?"var(--fg)":"transparent",border:"none",borderRadius:"50px",color:"split"===H?"#000000":"var(--fg)",fontSize:"15.4px",fontWeight:600,cursor:"pointer",transition:"all 0.3s ease",fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif'},children:"Split Screen"})]}),!e&&T&&(0,n.jsx)("div",{style:{position:"fixed",top:"20px",right:"20px",display:"flex",gap:"10px",zIndex:1001},children:!X&&!eJ&&"outdoor"===eH&&(0,n.jsx)("button",{onClick:()=>ev(!0),style:{padding:"10px 20px",backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)",border:"1px solid var(--border)",borderRadius:"50px",color:"var(--fg)",fontSize:"15.4px",fontWeight:600,cursor:"pointer",transition:"all 0.3s ease"},onMouseEnter:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.7)",onMouseLeave:e=>e.target.style.backgroundColor="rgba(0, 0, 0, 0.5)",children:"Show View Controls"})}),t6&&t3&&(()=>{let e="warning"===t3.tone?"#f5b82e":"#e74c3c";return(0,n.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"search-notice-title",onClick:e=>{e.target===e.currentTarget&&t8(!1)},style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.62)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px"},children:(0,n.jsxs)("div",{style:{width:"min(440px, 100%)",background:"var(--bg-elev)",border:"none",outline:"none",borderRadius:"18px",padding:"22px 24px 20px",boxShadow:"0 24px 64px rgba(0,0,0,0.5)",color:"var(--fg)",fontFamily:"inherit"},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",ga
310p:"14px"},children:[(0,n.jsx)(z,{size:30,color:e,style:{marginTop:"1px"}}),(0,n.jsx)("div",{id:"search-notice-title",style:{fontSize:"18px",fontWeight:600,lineHeight:1.3,color:e},children:t3.title||"Search failed"})]}),(0,n.jsx)("p",{style:{margin:"14px 0 0",color:"var(--fg-subtle)",fontSize:"14px",lineHeight:1.55},children:t3.body||"The search couldnât be completed. Please try again in a moment."}),t3.refundLine&&(0,n.jsx)("p",{style:{margin:"10px 0 0",color:"var(--fg-muted)",fontSize:"13.5px",lineHeight:1.5},children:t3.refundLine}),t3.reference&&(0,n.jsxs)("div",{style:{marginTop:"16px",padding:"10px 12px",background:"var(--surface-strong)",borderRadius:"10px",display:"flex",alignItems:"center",gap:"10px"},children:[(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)("div",{style:{fontSize:"11px",color:"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.7px"},children:"Reference"}),(0,n.jsx)("div",{style:{fontSize:"13.5px",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t3.reference})]}),(0,n.jsx)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(t3.reference)}catch(e){}},style:{padding:"6px 12px",background:"var(--surface)",border:"none",borderRadius:"7px",color:"var(--fg)",fontSize:"12.5px",cursor:"pointer",transition:"background 0.18s ease"},onMouseEnter:e=>e.currentTarget.style.background="var(--border)",onMouseLeave:e=>e.currentTarget.style.background="var(--surface)",children:"Copy"})]}),(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"20px"},children:(0,n.jsx)("button",{type:"button",onClick:()=>t8(!1),style:{padding:"9px 18px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-fg)",border:"none",borderRadius:"8px",fontSize:"14px",fontWeight:600,cursor:"pointer",transition:"transform 0.12s ease"},onMouseDown:e=>e.currentTarget.style.transform="scale(0.97)",onMouseUp:e=>e.currentTarget.style.transform="scale(1)",children:"Close"})})]})})})(),!nX&&(0,n.jsx)("div",{style:{position:"fixed",top:12,right:e?62:16,zIndex:50,pointerEvents:"none"},children:(0,n.jsx)("div",{style:{pointerEvents:"auto"},children:(0,n.jsx)(C,{})})}),(0,n.jsx)(I.A,{open:tM,variant:tR,feature:tL,onClose:()=>tF(!1)}),tW&&(0,n.jsx)("div",{style:{position:"fixed",bottom:24,right:24,zIndex:100,padding:"14px 18px",borderRadius:12,background:"rgba(255, 100, 100, 0.15)",border:"1px solid rgba(255, 100, 100, 0.3)",color:"#ff8080",fontSize:"0.95rem",maxWidth:360,fontFamily:'var(--font-instrument-serif), "Instrument Serif", Georgia, serif',backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:tW})]})}},5394:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(5155),i=r(2115);function o({size:e=288,color:t="#f5f5f7",rate:r=1,className:o,style:a,label:l="Loading"}){let s=(0,i.useId)().replace(/:/g,""),d=`goo-weld-${s}`;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"8 8 48 48",width:e,height:e,fill:"none",role:"img","aria-label":l,className:o,style:{color:t,"--rate":r,flexShrink:0,...a},children:[(0,n.jsx)("style",{children:` 311 .goo-arm-${s} { 312 transform-box: view-box; 313 transform-origin: center; 314 animation: goo-swing calc(var(--dur) * var(--rate, 1)) linear infinite; 315 } 316 .goo-core-${s} { 317 transform-box: view-box; 318 transform-origin: center; 319 animation: goo-breathe calc(3.2s * var(--rate, 1)) ease-in-out infinite; 320 } 321 @keyframes goo-swing { from { transform: rotate(0deg); } to { transform: rotate(calc(var(--dir) * 360deg)); } } 322 @keyframes goo-breathe { 0%, 100% { transform: scale(.82); } 50% { transform: scale(1.05); } } 323 @media (prefers-reduced-motion: reduce) { 324 .goo-arm-${s} { animation: none; transform: rotate(var(--rest)); } 325 .goo-core-${s} { animation: none; transform: scale(1); } 326 } 327 `}),(0,n.jsx)("defs",{children:(0,n.jsxs)("filter",{id:d,x:"-30%",y:"-30%",width:"160%",height:"160%",children:[(0,n.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.6",result:"soft"}),(0,n.jsx)("feColorMatrix",{in:"soft",type:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -8"})]})}),(0,n.jsxs)("g",{filter:`url(#${d}
327)`,fill:"currentColor",children:[(0,n.jsx)("circle",{className:`goo-core-${s}`,cx:"32",cy:"32",r:"9.5"}),(0,n.jsx)("g",{className:`goo-arm-${s}`,style:{"--dur":"2.8s","--dir":1,"--rest":"20deg"},children:(0,n.jsx)("circle",{cx:"32",cy:"21",r:"7"})}),(0,n.jsx)("g",{className:`goo-arm-${s}`,style:{"--dur":"3.6s","--dir":-1,"--rest":"140deg"},children:(0,n.jsx)("circle",{cx:"32",cy:"17.5",r:"5.5"})}),(0,n.jsx)("g",{className:`goo-arm-${s}`,style:{"--dur":"2.2s","--dir":1,"--rest":"255deg"},children:(0,n.jsx)("circle",{cx:"32",cy:"23",r:"4.6"})}),(0,n.jsx)("g",{className:`goo-arm-${s}`,style:{"--dur":"4.4s","--dir":-1,"--rest":"310deg"},children:(0,n.jsx)("circle",{cx:"32",cy:"16",r:"4"})})]})]})}},5827:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(5155),i=r(2115);let o=(0,r(7909).default)(()=>Promise.all([r.e(9066),r.e(7853)]).then(r.t.bind(r,7853,23)),{loadableGenerated:{webpack:()=>[7853]},ssr:!1}),a=new Map,l=new Map;function s({src:e,hover:t,loop:r=!1,size:s=18,color:d,tint:c,forceTint:p=!1,style:u}){let[g,f]=(0,i.useState)(()=>a.get(e)||null),h=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(g)return;let t=!1;return fetch(e).then(e=>e.json()).then(r=>{t||(a.set(e,r),f(r))}).catch(()=>{}),()=>{t=!0}},[e,g]);let x=(0,i.useMemo)(()=>{if(!g)return null;if(!c)return g;let t=`${e}|${c}|${+!!p}`,r=l.get(t);return r||(r=function(e,t,r=.3,n=!1){let[i,o,a]=function(e){let t=e.replace("#",""),r=3===t.length?t.split("").map(e=>e+e).join(""):t;return[parseInt(r.slice(0,2),16)/255,parseInt(r.slice(2,4),16)/255,parseInt(r.slice(4,6),16)/255]}(t),l=JSON.parse(JSON.stringify(e)),s=e=>{if(e&&"object"==typeof e){if(Array.isArray(e))return void e.forEach(s);for(let t of Object.keys(e)){let l=e[t];if("c"===t&&l&&0===l.a&&Array.isArray(l.k)&&4===l.k.length&&"number"==typeof l.k[0]){let[e,t,s,d]=l.k,c=.2126*e+.7152*t+.0722*s,p=e>.9&&t<.1&&s<.1;(n?!p:c<r&&!p)&&(l.k=[i,o,a,d],n&&"string"==typeof l.x&&delete l.x)}else s(l)}}};return s(l),l}(g,c,.3,p),l.set(t,r)),r},[g,e,c,p]);(0,i.useEffect)(()=>{if(r)return;let e=h.current;e&&x&&(t?e.goToAndPlay(0,!0):e.goToAndStop(0,!0))},[t,x,r]);let m={width:s,height:s,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:d,...u};return x?(0,n.jsx)("span",{style:m,"aria-hidden":"true",children:(0,n.jsx)(o,{lottieRef:h,animationData:x,loop:r,autoplay:r,style:{width:"100%",height:"100%"}})}):(0,n.jsx)("span",{style:m,"aria-hidden":"true"})}}}]);
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.